summaryrefslogtreecommitdiffabout
path: root/kmicromail/mainwindow.cpp
Unidiff
Diffstat (limited to 'kmicromail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/mainwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 7655385..4115276 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -54,252 +54,255 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
54 composeMail->addTo( toolBar ); 54 composeMail->addTo( toolBar );
55 composeMail->addTo( mailMenu ); 55 composeMail->addTo( mailMenu );
56 56
57 sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , 57 sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") ,
58 0, 0, this ); 58 0, 0, this );
59 sendQueued->addTo( toolBar ); 59 sendQueued->addTo( toolBar );
60 sendQueued->addTo( mailMenu ); 60 sendQueued->addTo( mailMenu );
61 61
62 /* 62 /*
63 syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, 63 syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC,
64 0, 0, this ); 64 0, 0, this );
65 syncFolders->addTo( toolBar ); 65 syncFolders->addTo( toolBar );
66 syncFolders->addTo( mailMenu ); 66 syncFolders->addTo( mailMenu );
67 */ 67 */
68 68
69 showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , 69 showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") ,
70 0, 0, this, 0, true ); 70 0, 0, this, 0, true );
71 showFolders->addTo( toolBar ); 71 showFolders->addTo( toolBar );
72 showFolders->addTo( mailMenu ); 72 showFolders->addTo( mailMenu );
73 showFolders->setOn( true ); 73 showFolders->setOn( true );
74 connect(showFolders, SIGNAL( toggled(bool) ), 74 connect(showFolders, SIGNAL( toggled(bool) ),
75 SLOT( slotShowFolders(bool) ) ); 75 SLOT( slotShowFolders(bool) ) );
76 76
77 /* 77 /*
78 searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), 78 searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ),
79 0, 0, this ); 79 0, 0, this );
80 searchMails->addTo( toolBar ); 80 searchMails->addTo( toolBar );
81 searchMails->addTo( mailMenu ); 81 searchMails->addTo( mailMenu );
82 */ 82 */
83 83
84 deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); 84 deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this);
85 deleteMails->addTo( toolBar ); 85 deleteMails->addTo( toolBar );
86 deleteMails->addTo( mailMenu ); 86 deleteMails->addTo( mailMenu );
87 connect( deleteMails, SIGNAL( activated() ), 87 connect( deleteMails, SIGNAL( activated() ),
88 SLOT( slotDeleteMail() ) ); 88 SLOT( slotDeleteMail() ) );
89 89
90 editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , 90 editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") ,
91 0, 0, this ); 91 0, 0, this );
92 editSettings->addTo( settingsMenu ); 92 editSettings->addTo( settingsMenu );
93 connect( editSettings, SIGNAL( activated() ), 93 connect( editSettings, SIGNAL( activated() ),
94 SLOT( slotEditSettings() ) ); 94 SLOT( slotEditSettings() ) );
95 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , 95 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") ,
96 0, 0, this ); 96 0, 0, this );
97 editAccounts->addTo( settingsMenu ); 97 editAccounts->addTo( settingsMenu );
98 98
99 //setCentralWidget( view ); 99 //setCentralWidget( view );
100 100
101 QVBox* wrapperBox = new QVBox( this ); 101 QVBox* wrapperBox = new QVBox( this );
102 setCentralWidget( wrapperBox ); 102 setCentralWidget( wrapperBox );
103 103
104 // QWidget *view = new QWidget( wrapperBox ); 104 // QWidget *view = new QWidget( wrapperBox );
105 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); 105 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox);
106 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); 106 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
107 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); 107 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
108 108
109 folderView = new AccountView( split ); 109 folderView = new AccountView( split );
110 folderView->header()->hide(); 110 folderView->header()->hide();
111 folderView->setRootIsDecorated( false ); 111 folderView->setRootIsDecorated( false );
112 folderView->addColumn( i18n( "Mailbox" ) ); 112 folderView->addColumn( i18n( "Mailbox" ) );
113 113
114 //layout->addWidget( folderView ); 114 //layout->addWidget( folderView );
115 115
116 mailView = new QListView( split ); 116 mailView = new QListView( split );
117 mailView->addColumn( i18n( " " ) ); 117 mailView->addColumn( i18n( " " ) );
118 mailView->addColumn( i18n( "Subject" ),QListView::Manual ); 118 mailView->addColumn( i18n( "Subject" ),QListView::Manual );
119 mailView->addColumn( i18n( "Sender" ),QListView::Manual ); 119 mailView->addColumn( i18n( "Sender" ),QListView::Manual );
120 mailView->addColumn( i18n( "Size" ),QListView::Manual); 120 mailView->addColumn( i18n( "Size" ),QListView::Manual);
121 mailView->addColumn( i18n( "Date" ),QListView::Manual); 121 mailView->addColumn( i18n( "Date" ),QListView::Manual);
122 mailView->setAllColumnsShowFocus(true); 122 mailView->setAllColumnsShowFocus(true);
123 //mailView->setSorting(-1); 123 //mailView->setSorting(-1);
124 mailView->setRootIsDecorated( false ); 124 mailView->setRootIsDecorated( false );
125 statusWidget = new StatusWidget( wrapperBox ); 125 statusWidget = new StatusWidget( wrapperBox );
126 statusWidget->hide(); 126 statusWidget->hide();
127 127
128 //layout->addWidget( mailView ); 128 //layout->addWidget( mailView );
129 //layout->setStretchFactor( folderView, 1 ); 129 //layout->setStretchFactor( folderView, 1 );
130 //layout->setStretchFactor( mailView, 2 ); 130 //layout->setStretchFactor( mailView, 2 );
131 131
132 slotAdjustLayout(); 132 slotAdjustLayout();
133#ifndef DESKTOP_VERSION 133#ifndef DESKTOP_VERSION
134 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); 134 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
135 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); 135 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
136#endif 136#endif
137 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, 137 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this,
138 SLOT( mailLeftClicked(QListViewItem*) ) ); 138 SLOT( mailLeftClicked(QListViewItem*) ) );
139 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, 139 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this,
140 SLOT( mailLeftClicked(QListViewItem*) ) ); 140 SLOT( mailLeftClicked(QListViewItem*) ) );
141 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 141 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
142 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); 142 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
143 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), 143 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)),
144 this,SLOT(refreshMailView(const QValueList<RecMailP>&))); 144 this,SLOT(refreshMailView(const QValueList<RecMailP>&)));
145 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 145 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
146 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 146 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
147// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 147// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
148 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 148 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
149 //mailView->setMultiSelection ( true ); 149 //mailView->setMultiSelection ( true );
150 mailView->setSelectionMode( QListView::Extended ); 150 mailView->setSelectionMode( QListView::Extended );
151 QValueList<int> list; 151 QValueList<int> list;
152 int fw = 100; 152 int fw = 100;
153 if ( QApplication::desktop()->width() > 320 ) 153 if ( QApplication::desktop()->width() > 320 )
154 fw = 50; 154 fw = 50;
155 list.append( fw ); 155 list.append( fw );
156 list.append( 100 ); 156 list.append( 100 );
157 split->setSizes( list ); 157 split->setSizes( list );
158 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 158 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
159 mailView->setShowSortIndicator ( true ); 159 mailView->setShowSortIndicator ( true );
160 QLabel *spacer = new QLabel( toolBar ); 160 QLabel *spacer = new QLabel( toolBar );
161 spacer->setBackgroundMode( QWidget::PaletteButton ); 161 spacer->setBackgroundMode( QWidget::PaletteButton );
162 toolBar->setStretchableWidget( spacer ); 162 toolBar->setStretchableWidget( spacer );
163 163
164 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 164 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
165 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 165 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
166 if ( QApplication::desktop()->width() > 320 ) 166 if ( QApplication::desktop()->width() > 320 )
167 closeMail->addTo(toolBar); 167 closeMail->addTo(toolBar);
168 closeMail->addTo(mailMenu); 168 closeMail->addTo(mailMenu);
169 169
170 170
171 QPopupMenu* helpMenu = new QPopupMenu( menuBar ); 171 QPopupMenu* helpMenu = new QPopupMenu( menuBar );
172 menuBar->insertItem( i18n( "Help" ), helpMenu ); 172 menuBar->insertItem( i18n( "Help" ), helpMenu );
173 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); 173 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this);
174 connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); 174 connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
175 li->addTo(helpMenu); 175 li->addTo(helpMenu);
176 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); 176 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this);
177 connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); 177 connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
178 li->addTo(helpMenu); 178 li->addTo(helpMenu);
179 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); 179 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this);
180 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); 180 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
181 li->addTo(helpMenu); 181 li->addTo(helpMenu);
182#ifdef DESKTOP_VERSION
183 resize ( 640, 480 );
184#endif
182} 185}
183 186
184MainWindow::~MainWindow() 187MainWindow::~MainWindow()
185{ 188{
186} 189}
187 190
188void MainWindow::showLicence() 191void MainWindow::showLicence()
189{ 192{
190 KApplication::showLicence(); 193 KApplication::showLicence();
191} 194}
192void MainWindow::showAbout() 195void MainWindow::showAbout()
193{ 196{
194 QString version; 197 QString version;
195#include <../version> 198#include <../version>
196 199
197 QString cap = "About KOpieMail/Pi"; 200 QString cap = "About KOpieMail/Pi";
198 QString text =i18n("KOpieMail/Platform-independent\n") + 201 QString text =i18n("KOpieMail/Platform-independent\n") +
199 "(OM/Pi) " + version + " - " 202 "(OM/Pi) " + version + " - "
200 203
201#ifdef DESKTOP_VERSION 204#ifdef DESKTOP_VERSION
202 "Desktop Edition\n" 205 "Desktop Edition\n"
203#else 206#else
204 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" 207 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n"
205#endif 208#endif
206 "www.pi-sync.net\n\n" 209 "www.pi-sync.net\n\n"
207 210
208 211
209 212
210"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" 213"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n"
211 "KOpieMail/Pi is based on Opie Mail\n" 214 "KOpieMail/Pi is based on Opie Mail\n"
212 "Copyright (c) Rajko Albrecht and the Opie team\n" 215 "Copyright (c) Rajko Albrecht and the Opie team\n"
213 "KOpieMail/Pi is licensed under the GPL\n" 216 "KOpieMail/Pi is licensed under the GPL\n"
214 "\n" 217 "\n"
215 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" 218 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n"
216 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" 219 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n"
217 "libEtPan has its own licence - see LibEtPan licence\n"; 220 "libEtPan has its own licence - see LibEtPan licence\n";
218 221
219 KApplication::showText( cap, text ); 222 KApplication::showText( cap, text );
220} 223}
221void MainWindow::showEtpanLicence() 224void MainWindow::showEtpanLicence()
222{ 225{
223 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); 226 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" );
224 227
225} 228}
226void MainWindow::appMessage(const QCString &, const QByteArray &) 229void MainWindow::appMessage(const QCString &, const QByteArray &)
227{ 230{
228 qDebug("appMessage implemented by subclass"); 231 qDebug("appMessage implemented by subclass");
229} 232}
230 233
231void MainWindow::slotAdjustLayout() { 234void MainWindow::slotAdjustLayout() {
232 235
233 /* 236 /*
234 QWidget *d = QApplication::desktop(); 237 QWidget *d = QApplication::desktop();
235 238
236 if ( d->width() < d->height() ) { 239 if ( d->width() < d->height() ) {
237 layout->setDirection( QBoxLayout::TopToBottom ); 240 layout->setDirection( QBoxLayout::TopToBottom );
238 } else { 241 } else {
239 layout->setDirection( QBoxLayout::LeftToRight ); 242 layout->setDirection( QBoxLayout::LeftToRight );
240 } 243 }
241 */ 244 */
242} 245}
243 246
244void MainWindow::slotAdjustColumns() 247void MainWindow::slotAdjustColumns()
245{ 248{
246 bool hidden = folderView->isHidden(); 249 bool hidden = folderView->isHidden();
247 if ( hidden ) folderView->show(); 250 if ( hidden ) folderView->show();
248 folderView->setColumnWidth( 0, folderView->visibleWidth() ); 251 folderView->setColumnWidth( 0, folderView->visibleWidth() );
249 if ( hidden ) folderView->hide(); 252 if ( hidden ) folderView->hide();
250 253
251 mailView->setColumnWidth( 0, 10 ); 254 mailView->setColumnWidth( 0, 10 );
252 mailView->setColumnWidth( 1, 100 ); 255 mailView->setColumnWidth( 1, 100 );
253 mailView->setColumnWidth( 2, 100 ); 256 mailView->setColumnWidth( 2, 100 );
254 mailView->setColumnWidth( 3, 50 ); 257 mailView->setColumnWidth( 3, 50 );
255 mailView->setColumnWidth( 4, 120 ); 258 mailView->setColumnWidth( 4, 120 );
256} 259}
257 260
258void MainWindow::slotEditSettings() 261void MainWindow::slotEditSettings()
259{ 262{
260} 263}
261 264
262void MainWindow::slotShowFolders( bool ) 265void MainWindow::slotShowFolders( bool )
263{ 266{
264 qDebug("not implemented: "); 267 qDebug("not implemented: ");
265} 268}
266 269
267void MainWindow::refreshMailView(const QValueList<RecMailP>&) 270void MainWindow::refreshMailView(const QValueList<RecMailP>&)
268{ 271{
269 qDebug("not implemented: "); 272 qDebug("not implemented: ");
270} 273}
271 274
272void MainWindow::mailLeftClicked(QListViewItem * ) 275void MainWindow::mailLeftClicked(QListViewItem * )
273{ 276{
274 qDebug("not implemented: "); 277 qDebug("not implemented: ");
275} 278}
276 279
277void MainWindow::displayMail() 280void MainWindow::displayMail()
278{ 281{
279 qDebug("not implemented: "); 282 qDebug("not implemented: ");
280} 283}
281 284
282void MainWindow::slotDeleteMail() 285void MainWindow::slotDeleteMail()
283{ 286{
284 qDebug("not implemented: "); 287 qDebug("not implemented: ");
285} 288}
286 289
287void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) 290void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
288{ 291{
289 qDebug("not implemented: "); 292 qDebug("not implemented: ");
290} 293}
291 294
292void MainWindow::slotSendQueued() 295void MainWindow::slotSendQueued()
293{ 296{
294 qDebug("not implemented: "); 297 qDebug("not implemented: ");
295} 298}
296 299
297void MainWindow::slotEditAccounts() 300void MainWindow::slotEditAccounts()
298{ 301{
299 qDebug("not implemented: "); 302 qDebug("not implemented: ");
300} 303}
301 304
302void MainWindow::slotComposeMail() 305void MainWindow::slotComposeMail()
303{ 306{
304 qDebug("not implemented: "); 307 qDebug("not implemented: ");
305} 308}