-rw-r--r-- | kmicromail/mainwindow.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 1dc374b..875ab77 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,355 +1,359 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qvbox.h> | 4 | #include <qvbox.h> |
5 | #include <qheader.h> | 5 | #include <qheader.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | //#include <kdialog.h> | 8 | //#include <kdialog.h> |
9 | #include <kiconloader.h> | 9 | #include <kiconloader.h> |
10 | #include <kapplication.h> | 10 | #include <kapplication.h> |
11 | 11 | ||
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qapplication.h> | 13 | #include <qapplication.h> |
14 | #include <qstatusbar.h> | 14 | #include <qstatusbar.h> |
15 | #include <kabc/stdaddressbook.h> | 15 | #include <kabc/stdaddressbook.h> |
16 | extern QStatusBar* globalSstatusBarMainWindow; | 16 | extern QStatusBar* globalSstatusBarMainWindow; |
17 | #else | 17 | #else |
18 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
19 | #include <klocale.h> | 19 | #include <klocale.h> |
20 | #endif | 20 | #endif |
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include <KDGanttMinimizeSplitter.h> | 23 | #include <KDGanttMinimizeSplitter.h> |
24 | 24 | ||
25 | #include "koprefs.h" | 25 | #include "koprefs.h" |
26 | 26 | ||
27 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 27 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
28 | : QMainWindow( parent, name ) //, flags ) | 28 | : QMainWindow( parent, name ) //, flags ) |
29 | { | 29 | { |
30 | #ifdef DESKTOP_VERSION | 30 | #ifdef DESKTOP_VERSION |
31 | globalSstatusBarMainWindow = statusBar(); | 31 | globalSstatusBarMainWindow = statusBar(); |
32 | #endif | 32 | #endif |
33 | setCaption( i18n( "KOpieMail/Pi" ) ); | 33 | setCaption( i18n( "KOpieMail/Pi" ) ); |
34 | setToolBarsMovable( false ); | 34 | setToolBarsMovable( false ); |
35 | //KABC::StdAddressBook::self(); | 35 | //KABC::StdAddressBook::self(); |
36 | toolBar = new QToolBar( this ); | 36 | toolBar = new QToolBar( this ); |
37 | menuBar = new QPEMenuBar( toolBar ); | 37 | menuBar = new QPEMenuBar( toolBar ); |
38 | mailMenu = new QPopupMenu( menuBar ); | 38 | mailMenu = new QPopupMenu( menuBar ); |
39 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 39 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
40 | settingsMenu = new QPopupMenu( menuBar ); | 40 | settingsMenu = new QPopupMenu( menuBar ); |
41 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 41 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
42 | 42 | ||
43 | addToolBar( toolBar ); | 43 | addToolBar( toolBar ); |
44 | toolBar->setHorizontalStretchable( true ); | 44 | toolBar->setHorizontalStretchable( true ); |
45 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 45 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
46 | 0, 0, this ); | 46 | 0, 0, this ); |
47 | connect(getMail, SIGNAL( activated() ), | 47 | connect(getMail, SIGNAL( activated() ), |
48 | SLOT( slotGetAllMail() ) ); | 48 | SLOT( slotGetAllMail() ) ); |
49 | getMail->addTo( mailMenu ); | 49 | getMail->addTo( mailMenu ); |
50 | 50 | ||
51 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 51 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
52 | 0, 0, this ); | 52 | 0, 0, this ); |
53 | getMail->addTo( toolBar ); | 53 | getMail->addTo( toolBar ); |
54 | getMail->addTo( mailMenu ); | 54 | getMail->addTo( mailMenu ); |
55 | connect(getMail, SIGNAL( activated() ), | 55 | connect(getMail, SIGNAL( activated() ), |
56 | SLOT( slotGetMail() ) ); | 56 | SLOT( slotGetMail() ) ); |
57 | 57 | ||
58 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), | 58 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), |
59 | 0, 0, this ); | 59 | 0, 0, this ); |
60 | composeMail->addTo( toolBar ); | 60 | composeMail->addTo( toolBar ); |
61 | composeMail->addTo( mailMenu ); | 61 | composeMail->addTo( mailMenu ); |
62 | 62 | ||
63 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , | 63 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , |
64 | 0, 0, this ); | 64 | 0, 0, this ); |
65 | sendQueued->addTo( toolBar ); | 65 | sendQueued->addTo( toolBar ); |
66 | sendQueued->addTo( mailMenu ); | 66 | sendQueued->addTo( mailMenu ); |
67 | 67 | ||
68 | /* | 68 | /* |
69 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, | 69 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, |
70 | 0, 0, this ); | 70 | 0, 0, this ); |
71 | syncFolders->addTo( toolBar ); | 71 | syncFolders->addTo( toolBar ); |
72 | syncFolders->addTo( mailMenu ); | 72 | syncFolders->addTo( mailMenu ); |
73 | */ | 73 | */ |
74 | 74 | ||
75 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , | 75 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , |
76 | 0, 0, this, 0, true ); | 76 | 0, 0, this, 0, true ); |
77 | showFolders->addTo( toolBar ); | 77 | showFolders->addTo( toolBar ); |
78 | showFolders->addTo( mailMenu ); | 78 | showFolders->addTo( mailMenu ); |
79 | showFolders->setOn( true ); | 79 | showFolders->setOn( true ); |
80 | connect(showFolders, SIGNAL( toggled(bool) ), | 80 | connect(showFolders, SIGNAL( toggled(bool) ), |
81 | SLOT( slotShowFolders(bool) ) ); | 81 | SLOT( slotShowFolders(bool) ) ); |
82 | 82 | ||
83 | /* | 83 | /* |
84 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 84 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
85 | 0, 0, this ); | 85 | 0, 0, this ); |
86 | searchMails->addTo( toolBar ); | 86 | searchMails->addTo( toolBar ); |
87 | searchMails->addTo( mailMenu ); | 87 | searchMails->addTo( mailMenu ); |
88 | */ | 88 | */ |
89 | 89 | ||
90 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 90 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
91 | deleteMails->addTo( toolBar ); | 91 | deleteMails->addTo( toolBar ); |
92 | deleteMails->addTo( mailMenu ); | 92 | deleteMails->addTo( mailMenu ); |
93 | connect( deleteMails, SIGNAL( activated() ), | 93 | connect( deleteMails, SIGNAL( activated() ), |
94 | SLOT( slotDeleteAllMail() ) ); | 94 | SLOT( slotDeleteAllMail() ) ); |
95 | 95 | ||
96 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , | 96 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , |
97 | 0, 0, this ); | 97 | 0, 0, this ); |
98 | editSettings->addTo( settingsMenu ); | 98 | editSettings->addTo( settingsMenu ); |
99 | connect( editSettings, SIGNAL( activated() ), | 99 | connect( editSettings, SIGNAL( activated() ), |
100 | SLOT( slotEditSettings() ) ); | 100 | SLOT( slotEditSettings() ) ); |
101 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , | 101 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , |
102 | 0, 0, this ); | 102 | 0, 0, this ); |
103 | editAccounts->addTo( settingsMenu ); | 103 | editAccounts->addTo( settingsMenu ); |
104 | codecMenu = new QPopupMenu( menuBar ); | 104 | codecMenu = new QPopupMenu( menuBar ); |
105 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); | 105 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); |
106 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); | 106 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); |
107 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); | 107 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); |
108 | codecMenu->insertItem( "Chinese (big-5)",3,3); | 108 | codecMenu->insertItem( "Chinese (big-5)",3,3); |
109 | codecMenu->insertItem( "Unicode (utf-8)",4,4); | 109 | codecMenu->insertItem( "Unicode (utf-8)",4,4); |
110 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); | 110 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); |
111 | //disabled | 111 | //disabled |
112 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); | 112 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); |
113 | //setCentralWidget( view ); | 113 | //setCentralWidget( view ); |
114 | 114 | ||
115 | QVBox* wrapperBox = new QVBox( this ); | 115 | QVBox* wrapperBox = new QVBox( this ); |
116 | setCentralWidget( wrapperBox ); | 116 | setCentralWidget( wrapperBox ); |
117 | 117 | ||
118 | // QWidget *view = new QWidget( wrapperBox ); | 118 | // QWidget *view = new QWidget( wrapperBox ); |
119 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); | 119 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); |
120 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 120 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
121 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 121 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
122 | 122 | ||
123 | folderView = new AccountView( split ); | 123 | folderView = new AccountView( split ); |
124 | folderView->header()->hide(); | 124 | folderView->header()->hide(); |
125 | folderView->setRootIsDecorated( false ); | 125 | folderView->setRootIsDecorated( false ); |
126 | folderView->addColumn( i18n( "Mailbox" ) ); | 126 | folderView->addColumn( i18n( "Mailbox" ) ); |
127 | 127 | ||
128 | //layout->addWidget( folderView ); | 128 | //layout->addWidget( folderView ); |
129 | 129 | ||
130 | mailView = new QListView( split ); | 130 | mailView = new QListView( split ); |
131 | mailView->addColumn( i18n( " " ) ); | 131 | mailView->addColumn( i18n( " " ) ); |
132 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 132 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
133 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 133 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
134 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 134 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
135 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 135 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
136 | if ( KOPrefs::instance()->mShowToField ) | ||
137 | mailView->addColumn( i18n( "To" ),QListView::Manual); | ||
136 | mailView->setAllColumnsShowFocus(true); | 138 | mailView->setAllColumnsShowFocus(true); |
137 | //mailView->setSorting(-1); | 139 | //mailView->setSorting(-1); |
138 | mailView->setRootIsDecorated( false ); | 140 | mailView->setRootIsDecorated( false ); |
139 | statusWidget = new StatusWidget( wrapperBox ); | 141 | statusWidget = new StatusWidget( wrapperBox ); |
140 | statusWidget->hide(); | 142 | statusWidget->hide(); |
141 | 143 | ||
142 | //layout->addWidget( mailView ); | 144 | //layout->addWidget( mailView ); |
143 | //layout->setStretchFactor( folderView, 1 ); | 145 | //layout->setStretchFactor( folderView, 1 ); |
144 | //layout->setStretchFactor( mailView, 2 ); | 146 | //layout->setStretchFactor( mailView, 2 ); |
145 | 147 | ||
146 | slotAdjustLayout(); | 148 | slotAdjustLayout(); |
147 | #ifndef DESKTOP_VERSION | 149 | #ifndef DESKTOP_VERSION |
148 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 150 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
149 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 151 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
150 | #endif | 152 | #endif |
151 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 153 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
152 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 154 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
153 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 155 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
154 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 156 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
155 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 157 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
156 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 158 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
157 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 159 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
158 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 160 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
159 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 161 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
160 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 162 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
161 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 163 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
162 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 164 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
163 | //mailView->setMultiSelection ( true ); | 165 | //mailView->setMultiSelection ( true ); |
164 | mailView->setSelectionMode( QListView::Extended ); | 166 | mailView->setSelectionMode( QListView::Extended ); |
165 | QValueList<int> list; | 167 | QValueList<int> list; |
166 | int fw = 100; | 168 | int fw = 100; |
167 | if ( QApplication::desktop()->width() > 320 ) | 169 | if ( QApplication::desktop()->width() > 320 ) |
168 | fw = 50; | 170 | fw = 50; |
169 | list.append( fw ); | 171 | list.append( fw ); |
170 | list.append( 100 ); | 172 | list.append( 100 ); |
171 | split->setSizes( list ); | 173 | split->setSizes( list ); |
172 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 174 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
173 | mailView->setShowSortIndicator ( true ); | 175 | mailView->setShowSortIndicator ( true ); |
174 | QLabel *spacer = new QLabel( toolBar ); | 176 | QLabel *spacer = new QLabel( toolBar ); |
175 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 177 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
176 | toolBar->setStretchableWidget( spacer ); | 178 | toolBar->setStretchableWidget( spacer ); |
177 | 179 | ||
178 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 180 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
179 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 181 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
180 | if ( QApplication::desktop()->width() > 320 ) | 182 | if ( QApplication::desktop()->width() > 320 ) |
181 | closeMail->addTo(toolBar); | 183 | closeMail->addTo(toolBar); |
182 | closeMail->addTo(mailMenu); | 184 | closeMail->addTo(mailMenu); |
183 | 185 | ||
184 | 186 | ||
185 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 187 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
186 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 188 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
187 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 189 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
188 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 190 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
189 | li->addTo(helpMenu); | 191 | li->addTo(helpMenu); |
190 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 192 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
191 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 193 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
192 | li->addTo(helpMenu); | 194 | li->addTo(helpMenu); |
193 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 195 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
194 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 196 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
195 | li->addTo(helpMenu); | 197 | li->addTo(helpMenu); |
196 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 198 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
197 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 199 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
198 | #ifdef DESKTOP_VERSION | 200 | #ifdef DESKTOP_VERSION |
199 | resize ( 640, 480 ); | 201 | resize ( 640, 480 ); |
200 | #endif | 202 | #endif |
201 | } | 203 | } |
202 | 204 | ||
203 | MainWindow::~MainWindow() | 205 | MainWindow::~MainWindow() |
204 | { | 206 | { |
205 | } | 207 | } |
206 | 208 | ||
207 | void MainWindow::slotSetCodec( int codec ) | 209 | void MainWindow::slotSetCodec( int codec ) |
208 | { | 210 | { |
209 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | 211 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); |
210 | //qDebug("codec %d ", codec); | 212 | //qDebug("codec %d ", codec); |
211 | KOPrefs::instance()->mCurrentCodec = codec; | 213 | KOPrefs::instance()->mCurrentCodec = codec; |
212 | KOPrefs::instance()->isDirty = true; | 214 | KOPrefs::instance()->isDirty = true; |
213 | QString name; | 215 | QString name; |
214 | switch ( codec ) { | 216 | switch ( codec ) { |
215 | case 0: | 217 | case 0: |
216 | name = "iso-8859-1"; | 218 | name = "iso-8859-1"; |
217 | break; | 219 | break; |
218 | case 1: | 220 | case 1: |
219 | name = "iso-8859-5"; | 221 | name = "iso-8859-5"; |
220 | break; | 222 | break; |
221 | case 2: | 223 | case 2: |
222 | name = "iso-8859-15"; | 224 | name = "iso-8859-15"; |
223 | break; | 225 | break; |
224 | case 3: | 226 | case 3: |
225 | name = "big-5"; | 227 | name = "big-5"; |
226 | break; | 228 | break; |
227 | case 4: | 229 | case 4: |
228 | name = "utf-8"; | 230 | name = "utf-8"; |
229 | break; | 231 | break; |
230 | case 5: | 232 | case 5: |
231 | name = KOPrefs::instance()->mSendCodec.lower(); | 233 | name = KOPrefs::instance()->mSendCodec.lower(); |
232 | break; | 234 | break; |
233 | } | 235 | } |
234 | KOPrefs::instance()->mCurrentCodeName = name ; | 236 | KOPrefs::instance()->mCurrentCodeName = name ; |
235 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); | 237 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); |
236 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); | 238 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); |
237 | } | 239 | } |
238 | void MainWindow::showLicence() | 240 | void MainWindow::showLicence() |
239 | { | 241 | { |
240 | KApplication::showLicence(); | 242 | KApplication::showLicence(); |
241 | } | 243 | } |
242 | void MainWindow::showAbout() | 244 | void MainWindow::showAbout() |
243 | { | 245 | { |
244 | QString version; | 246 | QString version; |
245 | #include <../version> | 247 | #include <../version> |
246 | 248 | ||
247 | QString cap = "About KOpieMail/Pi"; | 249 | QString cap = "About KOpieMail/Pi"; |
248 | QString text =i18n("KOpieMail/Platform-independent\n") + | 250 | QString text =i18n("KOpieMail/Platform-independent\n") + |
249 | "(OM/Pi) " + version + " - " | 251 | "(OM/Pi) " + version + " - " |
250 | 252 | ||
251 | #ifdef DESKTOP_VERSION | 253 | #ifdef DESKTOP_VERSION |
252 | "Desktop Edition\n" | 254 | "Desktop Edition\n" |
253 | #else | 255 | #else |
254 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" | 256 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" |
255 | #endif | 257 | #endif |
256 | "www.pi-sync.net\n\n" | 258 | "www.pi-sync.net\n\n" |
257 | 259 | ||
258 | 260 | ||
259 | 261 | ||
260 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" | 262 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" |
261 | "KOpieMail/Pi is based on Opie Mail\n" | 263 | "KOpieMail/Pi is based on Opie Mail\n" |
262 | "Copyright (c) Rajko Albrecht and the Opie team\n" | 264 | "Copyright (c) Rajko Albrecht and the Opie team\n" |
263 | "KOpieMail/Pi is licensed under the GPL\n" | 265 | "KOpieMail/Pi is licensed under the GPL\n" |
264 | "\n" | 266 | "\n" |
265 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" | 267 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" |
266 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" | 268 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" |
267 | "libEtPan has its own licence - see LibEtPan licence\n"; | 269 | "libEtPan has its own licence - see LibEtPan licence\n"; |
268 | 270 | ||
269 | KApplication::showText( cap, text ); | 271 | KApplication::showText( cap, text ); |
270 | } | 272 | } |
271 | void MainWindow::showEtpanLicence() | 273 | void MainWindow::showEtpanLicence() |
272 | { | 274 | { |
273 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 275 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
274 | 276 | ||
275 | } | 277 | } |
276 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 278 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
277 | { | 279 | { |
278 | qDebug("appMessage implemented by subclass"); | 280 | qDebug("appMessage implemented by subclass"); |
279 | } | 281 | } |
280 | 282 | ||
281 | void MainWindow::slotAdjustLayout() { | 283 | void MainWindow::slotAdjustLayout() { |
282 | 284 | ||
283 | /* | 285 | /* |
284 | QWidget *d = QApplication::desktop(); | 286 | QWidget *d = QApplication::desktop(); |
285 | 287 | ||
286 | if ( d->width() < d->height() ) { | 288 | if ( d->width() < d->height() ) { |
287 | layout->setDirection( QBoxLayout::TopToBottom ); | 289 | layout->setDirection( QBoxLayout::TopToBottom ); |
288 | } else { | 290 | } else { |
289 | layout->setDirection( QBoxLayout::LeftToRight ); | 291 | layout->setDirection( QBoxLayout::LeftToRight ); |
290 | } | 292 | } |
291 | */ | 293 | */ |
292 | } | 294 | } |
293 | 295 | ||
294 | void MainWindow::slotAdjustColumns() | 296 | void MainWindow::slotAdjustColumns() |
295 | { | 297 | { |
296 | bool hidden = folderView->isHidden(); | 298 | bool hidden = folderView->isHidden(); |
297 | if ( hidden ) folderView->show(); | 299 | if ( hidden ) folderView->show(); |
298 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 300 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
299 | if ( hidden ) folderView->hide(); | 301 | if ( hidden ) folderView->hide(); |
300 | 302 | ||
301 | mailView->setColumnWidth( 0, 10 ); | 303 | mailView->setColumnWidth( 0, 10 ); |
302 | mailView->setColumnWidth( 1, 100 ); | 304 | mailView->setColumnWidth( 1, 100 ); |
303 | mailView->setColumnWidth( 2, 100 ); | 305 | mailView->setColumnWidth( 2, 100 ); |
304 | mailView->setColumnWidth( 3, 50 ); | 306 | mailView->setColumnWidth( 3, 50 ); |
305 | mailView->setColumnWidth( 4, 120 ); | 307 | mailView->setColumnWidth( 4, 120 ); |
308 | if ( KOPrefs::instance()->mShowToField ) | ||
309 | mailView->setColumnWidth( 5, 100 ); | ||
306 | } | 310 | } |
307 | 311 | ||
308 | void MainWindow::slotEditSettings() | 312 | void MainWindow::slotEditSettings() |
309 | { | 313 | { |
310 | } | 314 | } |
311 | 315 | ||
312 | void MainWindow::slotShowFolders( bool ) | 316 | void MainWindow::slotShowFolders( bool ) |
313 | { | 317 | { |
314 | qDebug("not implemented: "); | 318 | qDebug("not implemented: "); |
315 | } | 319 | } |
316 | 320 | ||
317 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 321 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
318 | { | 322 | { |
319 | qDebug("not implemented: "); | 323 | qDebug("not implemented: "); |
320 | } | 324 | } |
321 | 325 | ||
322 | void MainWindow::mailLeftClicked(QListViewItem * ) | 326 | void MainWindow::mailLeftClicked(QListViewItem * ) |
323 | { | 327 | { |
324 | qDebug("not implemented: "); | 328 | qDebug("not implemented: "); |
325 | } | 329 | } |
326 | 330 | ||
327 | void MainWindow::displayMail() | 331 | void MainWindow::displayMail() |
328 | { | 332 | { |
329 | qDebug("not implemented: "); | 333 | qDebug("not implemented: "); |
330 | } | 334 | } |
331 | 335 | ||
332 | void MainWindow::slotDeleteMail() | 336 | void MainWindow::slotDeleteMail() |
333 | { | 337 | { |
334 | qDebug("not implemented: "); | 338 | qDebug("not implemented: "); |
335 | } | 339 | } |
336 | 340 | ||
337 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 341 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
338 | { | 342 | { |
339 | qDebug("not implemented: "); | 343 | qDebug("not implemented: "); |
340 | } | 344 | } |
341 | 345 | ||
342 | void MainWindow::slotSendQueued() | 346 | void MainWindow::slotSendQueued() |
343 | { | 347 | { |
344 | qDebug("not implemented: "); | 348 | qDebug("not implemented: "); |
345 | } | 349 | } |
346 | 350 | ||
347 | void MainWindow::slotEditAccounts() | 351 | void MainWindow::slotEditAccounts() |
348 | { | 352 | { |
349 | qDebug("not implemented: "); | 353 | qDebug("not implemented: "); |
350 | } | 354 | } |
351 | 355 | ||
352 | void MainWindow::slotComposeMail() | 356 | void MainWindow::slotComposeMail() |
353 | { | 357 | { |
354 | qDebug("not implemented: "); | 358 | qDebug("not implemented: "); |
355 | } | 359 | } |