-rw-r--r-- | kmicromail/mainwindow.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 9a52d1b..e3c5ec3 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -34,133 +34,143 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
34 | #endif | 34 | #endif |
35 | setCaption( i18n( "KOpieMail/Pi" ) ); | 35 | setCaption( i18n( "KOpieMail/Pi" ) ); |
36 | setToolBarsMovable( false ); | 36 | setToolBarsMovable( false ); |
37 | //KABC::StdAddressBook::self(); | 37 | //KABC::StdAddressBook::self(); |
38 | toolBar = new QToolBar( this ); | 38 | toolBar = new QToolBar( this ); |
39 | menuBar = new QPEMenuBar( toolBar ); | 39 | menuBar = new QPEMenuBar( toolBar ); |
40 | mailMenu = new QPopupMenu( menuBar ); | 40 | mailMenu = new QPopupMenu( menuBar ); |
41 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 41 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
42 | settingsMenu = new QPopupMenu( menuBar ); | 42 | settingsMenu = new QPopupMenu( menuBar ); |
43 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 43 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
44 | 44 | ||
45 | addToolBar( toolBar ); | 45 | addToolBar( toolBar ); |
46 | toolBar->setHorizontalStretchable( true ); | 46 | toolBar->setHorizontalStretchable( true ); |
47 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 47 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
48 | 0, 0, this ); | 48 | 0, 0, this ); |
49 | connect(getMail, SIGNAL( activated() ), | 49 | connect(getMail, SIGNAL( activated() ), |
50 | SLOT( slotGetAllMail() ) ); | 50 | SLOT( slotGetAllMail() ) ); |
51 | getMail->addTo( mailMenu ); | 51 | getMail->addTo( mailMenu ); |
52 | 52 | ||
53 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 53 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
54 | 0, 0, this ); | 54 | 0, 0, this ); |
55 | getMail->addTo( toolBar ); | 55 | getMail->addTo( toolBar ); |
56 | getMail->addTo( mailMenu ); | 56 | getMail->addTo( mailMenu ); |
57 | connect(getMail, SIGNAL( activated() ), | 57 | connect(getMail, SIGNAL( activated() ), |
58 | SLOT( slotGetMail() ) ); | 58 | SLOT( slotGetMail() ) ); |
59 | 59 | ||
60 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), | 60 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), |
61 | 0, 0, this ); | 61 | 0, 0, this ); |
62 | composeMail->addTo( toolBar ); | 62 | composeMail->addTo( toolBar ); |
63 | composeMail->addTo( mailMenu ); | 63 | composeMail->addTo( mailMenu ); |
64 | 64 | ||
65 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , | 65 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , |
66 | 0, 0, this ); | 66 | 0, 0, this ); |
67 | sendQueued->addTo( toolBar ); | 67 | sendQueued->addTo( toolBar ); |
68 | sendQueued->addTo( mailMenu ); | 68 | sendQueued->addTo( mailMenu ); |
69 | 69 | ||
70 | /* | 70 | /* |
71 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, | 71 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, |
72 | 0, 0, this ); | 72 | 0, 0, this ); |
73 | syncFolders->addTo( toolBar ); | 73 | syncFolders->addTo( toolBar ); |
74 | syncFolders->addTo( mailMenu ); | 74 | syncFolders->addTo( mailMenu ); |
75 | */ | 75 | */ |
76 | 76 | ||
77 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , | 77 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , |
78 | 0, 0, this, 0, true ); | 78 | 0, 0, this, 0, true ); |
79 | showFolders->addTo( toolBar ); | 79 | showFolders->addTo( toolBar ); |
80 | showFolders->addTo( mailMenu ); | 80 | showFolders->addTo( mailMenu ); |
81 | showFolders->setOn( true ); | 81 | showFolders->setOn( true ); |
82 | connect(showFolders, SIGNAL( toggled(bool) ), | 82 | connect(showFolders, SIGNAL( toggled(bool) ), |
83 | SLOT( slotShowFolders(bool) ) ); | 83 | SLOT( slotShowFolders(bool) ) ); |
84 | 84 | ||
85 | /* | 85 | /* |
86 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 86 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
87 | 0, 0, this ); | 87 | 0, 0, this ); |
88 | searchMails->kopddTo( toolBar ); | 88 | searchMails->kopddTo( toolBar ); |
89 | searchMails->addTo( mailMenu ); | 89 | searchMails->addTo( mailMenu ); |
90 | */ | 90 | */ |
91 | 91 | ||
92 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 92 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
93 | deleteMails->addTo( toolBar ); | 93 | deleteMails->addTo( toolBar ); |
94 | deleteMails->addTo( mailMenu ); | 94 | deleteMails->addTo( mailMenu ); |
95 | connect( deleteMails, SIGNAL( activated() ), | 95 | connect( deleteMails, SIGNAL( activated() ), |
96 | SLOT( slotDeleteAllMail() ) ); | 96 | SLOT( slotDeleteAllMail() ) ); |
97 | 97 | ||
98 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , | 98 | editSettings = new QAction( i18n( "Configure OM/Pi..." ), SmallIcon("SettingsIcon") , |
99 | 0, 0, this ); | 99 | 0, 0, this ); |
100 | editSettings->addTo( settingsMenu ); | 100 | editSettings->addTo( settingsMenu ); |
101 | connect( editSettings, SIGNAL( activated() ), | 101 | connect( editSettings, SIGNAL( activated() ), |
102 | SLOT( slotEditSettings() ) ); | 102 | SLOT( slotEditSettings() ) ); |
103 | |||
104 | |||
105 | QAction * editSettings2 = new QAction( i18n( "Global Settings..." ), SmallIcon("SettingsIcon") , | ||
106 | 0, 0, this ); | ||
107 | editSettings2->addTo( settingsMenu ); | ||
108 | connect( editSettings2, SIGNAL( activated() ), | ||
109 | SLOT( slotEditGlobalSettings() ) ); | ||
110 | |||
111 | |||
112 | |||
103 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , | 113 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , |
104 | 0, 0, this ); | 114 | 0, 0, this ); |
105 | editAccounts->addTo( settingsMenu ); | 115 | editAccounts->addTo( settingsMenu ); |
106 | codecMenu = new QPopupMenu( menuBar ); | 116 | codecMenu = new QPopupMenu( menuBar ); |
107 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); | 117 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); |
108 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); | 118 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); |
109 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); | 119 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); |
110 | codecMenu->insertItem( "Chinese (big-5)",3,3); | 120 | codecMenu->insertItem( "Chinese (big-5)",3,3); |
111 | codecMenu->insertItem( "Unicode (utf-8)",4,4); | 121 | codecMenu->insertItem( "Unicode (utf-8)",4,4); |
112 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); | 122 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); |
113 | //disabled | 123 | //disabled |
114 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); | 124 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); |
115 | //setCentralWidget( view ); | 125 | //setCentralWidget( view ); |
116 | 126 | ||
117 | QVBox* wrapperBox = new QVBox( this ); | 127 | QVBox* wrapperBox = new QVBox( this ); |
118 | setCentralWidget( wrapperBox ); | 128 | setCentralWidget( wrapperBox ); |
119 | 129 | ||
120 | // QWidget *view = new QWidget( wrapperBox ); | 130 | // QWidget *view = new QWidget( wrapperBox ); |
121 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); | 131 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); |
122 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); | 132 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); |
123 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); | 133 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); |
124 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 134 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
125 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 135 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
126 | subLE = 0; | 136 | subLE = 0; |
127 | fromLE = 0; | 137 | fromLE = 0; |
128 | toLE = 0; | 138 | toLE = 0; |
129 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { | 139 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { |
130 | QWidget* infoBox = new QWidget( splithor ); | 140 | QWidget* infoBox = new QWidget( splithor ); |
131 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 141 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
132 | if ( KOPrefs::instance()->mShowInfoSub ) { | 142 | if ( KOPrefs::instance()->mShowInfoSub ) { |
133 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 143 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
134 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 144 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; |
135 | } | 145 | } |
136 | if ( KOPrefs::instance()->mShowInfoFrom ) { | 146 | if ( KOPrefs::instance()->mShowInfoFrom ) { |
137 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | 147 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); |
138 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 148 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; |
139 | } | 149 | } |
140 | if ( KOPrefs::instance()->mShowInfoTo ) { | 150 | if ( KOPrefs::instance()->mShowInfoTo ) { |
141 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | 151 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); |
142 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 152 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; |
143 | } | 153 | } |
144 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 154 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); |
145 | if ( !KOPrefs::instance()->mShowInfoStart ) { | 155 | if ( !KOPrefs::instance()->mShowInfoStart ) { |
146 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); | 156 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); |
147 | } | 157 | } |
148 | } | 158 | } |
149 | 159 | ||
150 | 160 | ||
151 | folderView = new AccountView( split ); | 161 | folderView = new AccountView( split ); |
152 | folderView->header()->hide(); | 162 | folderView->header()->hide(); |
153 | folderView->setRootIsDecorated( false ); | 163 | folderView->setRootIsDecorated( false ); |
154 | folderView->addColumn( i18n( "Mailbox" ) ); | 164 | folderView->addColumn( i18n( "Mailbox" ) ); |
155 | 165 | ||
156 | //layout->addWidget( folderView ); | 166 | //layout->addWidget( folderView ); |
157 | 167 | ||
158 | mailView = new QListView( split ); | 168 | mailView = new QListView( split ); |
159 | mailView->addColumn( i18n( " " ) ); | 169 | mailView->addColumn( i18n( " " ) ); |
160 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 170 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
161 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 171 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
162 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 172 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
163 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 173 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
164 | if ( KOPrefs::instance()->mShowToField ) | 174 | if ( KOPrefs::instance()->mShowToField ) |
165 | mailView->addColumn( i18n( "To" ),QListView::Manual); | 175 | mailView->addColumn( i18n( "To" ),QListView::Manual); |
166 | mailView->setAllColumnsShowFocus(true); | 176 | mailView->setAllColumnsShowFocus(true); |
@@ -308,109 +318,112 @@ void MainWindow::showAbout() | |||
308 | "(OM/Pi) " + version + " - " | 318 | "(OM/Pi) " + version + " - " |
309 | 319 | ||
310 | #ifdef DESKTOP_VERSION | 320 | #ifdef DESKTOP_VERSION |
311 | "Desktop Edition\n" | 321 | "Desktop Edition\n" |
312 | #else | 322 | #else |
313 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" | 323 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" |
314 | #endif | 324 | #endif |
315 | "www.pi-sync.info\n\n" | 325 | "www.pi-sync.info\n\n" |
316 | 326 | ||
317 | 327 | ||
318 | 328 | ||
319 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" | 329 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" |
320 | "KOpieMail/Pi is based on Opie Mail\n" | 330 | "KOpieMail/Pi is based on Opie Mail\n" |
321 | "Copyright (c) Rajko Albrecht and the Opie team\n" | 331 | "Copyright (c) Rajko Albrecht and the Opie team\n" |
322 | "KOpieMail/Pi is licensed under the GPL\n" | 332 | "KOpieMail/Pi is licensed under the GPL\n" |
323 | "\n" | 333 | "\n" |
324 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" | 334 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" |
325 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" | 335 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" |
326 | "libEtPan has its own licence - see LibEtPan licence\n"; | 336 | "libEtPan has its own licence - see LibEtPan licence\n"; |
327 | 337 | ||
328 | KApplication::showText( cap, text ); | 338 | KApplication::showText( cap, text ); |
329 | } | 339 | } |
330 | void MainWindow::showEtpanLicence() | 340 | void MainWindow::showEtpanLicence() |
331 | { | 341 | { |
332 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 342 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
333 | 343 | ||
334 | } | 344 | } |
335 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 345 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
336 | { | 346 | { |
337 | qDebug("appMessage implemented by subclass"); | 347 | qDebug("appMessage implemented by subclass"); |
338 | } | 348 | } |
339 | 349 | ||
340 | void MainWindow::slotAdjustLayout() { | 350 | void MainWindow::slotAdjustLayout() { |
341 | 351 | ||
342 | /* | 352 | /* |
343 | QWidget *d = QApplication::desktop(); | 353 | QWidget *d = QApplication::desktop(); |
344 | 354 | ||
345 | if ( d->width() < d->height() ) { | 355 | if ( d->width() < d->height() ) { |
346 | layout->setDirection( QBoxLayout::TopToBottom ); | 356 | layout->setDirection( QBoxLayout::TopToBottom ); |
347 | } else { | 357 | } else { |
348 | layout->setDirection( QBoxLayout::LeftToRight ); | 358 | layout->setDirection( QBoxLayout::LeftToRight ); |
349 | } | 359 | } |
350 | */ | 360 | */ |
351 | } | 361 | } |
352 | 362 | ||
353 | void MainWindow::slotAdjustColumns() | 363 | void MainWindow::slotAdjustColumns() |
354 | { | 364 | { |
355 | bool hidden = folderView->isHidden(); | 365 | bool hidden = folderView->isHidden(); |
356 | if ( hidden ) folderView->show(); | 366 | if ( hidden ) folderView->show(); |
357 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 367 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
358 | if ( hidden ) folderView->hide(); | 368 | if ( hidden ) folderView->hide(); |
359 | 369 | ||
360 | mailView->setColumnWidth( 0, 10 ); | 370 | mailView->setColumnWidth( 0, 10 ); |
361 | mailView->setColumnWidth( 1, 100 ); | 371 | mailView->setColumnWidth( 1, 100 ); |
362 | mailView->setColumnWidth( 2, 100 ); | 372 | mailView->setColumnWidth( 2, 100 ); |
363 | mailView->setColumnWidth( 3, 50 ); | 373 | mailView->setColumnWidth( 3, 50 ); |
364 | mailView->setColumnWidth( 4, 120 ); | 374 | mailView->setColumnWidth( 4, 120 ); |
365 | if ( KOPrefs::instance()->mShowToField ) | 375 | if ( KOPrefs::instance()->mShowToField ) |
366 | mailView->setColumnWidth( 5, 100 ); | 376 | mailView->setColumnWidth( 5, 100 ); |
367 | } | 377 | } |
368 | 378 | ||
369 | void MainWindow::slotEditSettings() | 379 | void MainWindow::slotEditSettings() |
370 | { | 380 | { |
371 | } | 381 | } |
382 | void MainWindow::slotEditGlobalSettings() | ||
383 | { | ||
384 | } | ||
372 | 385 | ||
373 | void MainWindow::slotShowFolders( bool ) | 386 | void MainWindow::slotShowFolders( bool ) |
374 | { | 387 | { |
375 | qDebug("not implemented: "); | 388 | qDebug("not implemented: "); |
376 | } | 389 | } |
377 | 390 | ||
378 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 391 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
379 | { | 392 | { |
380 | qDebug("not implemented: "); | 393 | qDebug("not implemented: "); |
381 | } | 394 | } |
382 | 395 | ||
383 | void MainWindow::mailLeftClicked(QListViewItem * ) | 396 | void MainWindow::mailLeftClicked(QListViewItem * ) |
384 | { | 397 | { |
385 | qDebug("not implemented: "); | 398 | qDebug("not implemented: "); |
386 | } | 399 | } |
387 | 400 | ||
388 | void MainWindow::displayMail() | 401 | void MainWindow::displayMail() |
389 | { | 402 | { |
390 | qDebug("not implemented: "); | 403 | qDebug("not implemented: "); |
391 | } | 404 | } |
392 | 405 | ||
393 | void MainWindow::slotDeleteMail() | 406 | void MainWindow::slotDeleteMail() |
394 | { | 407 | { |
395 | qDebug("not implemented: "); | 408 | qDebug("not implemented: "); |
396 | } | 409 | } |
397 | 410 | ||
398 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 411 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
399 | { | 412 | { |
400 | qDebug("not implemented: "); | 413 | qDebug("not implemented: "); |
401 | } | 414 | } |
402 | 415 | ||
403 | void MainWindow::slotSendQueued() | 416 | void MainWindow::slotSendQueued() |
404 | { | 417 | { |
405 | qDebug("not implemented: "); | 418 | qDebug("not implemented: "); |
406 | } | 419 | } |
407 | 420 | ||
408 | void MainWindow::slotEditAccounts() | 421 | void MainWindow::slotEditAccounts() |
409 | { | 422 | { |
410 | qDebug("not implemented: "); | 423 | qDebug("not implemented: "); |
411 | } | 424 | } |
412 | 425 | ||
413 | void MainWindow::slotComposeMail() | 426 | void MainWindow::slotComposeMail() |
414 | { | 427 | { |
415 | qDebug("not implemented: "); | 428 | qDebug("not implemented: "); |
416 | } | 429 | } |