author | zautrix <zautrix> | 2005-02-03 10:48:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-03 10:48:05 (UTC) |
commit | fb6753570dc90e936b4e89092554ab012e946a56 (patch) (unidiff) | |
tree | 6d3ae5c866f0bbb99f0b6bc8194d04d2c7681ff9 /kmicromail/mainwindow.cpp | |
parent | e0fce8c0f108e054cb6e4e4767affd04b398da45 (diff) | |
download | kdepimpi-fb6753570dc90e936b4e89092554ab012e946a56.zip kdepimpi-fb6753570dc90e936b4e89092554ab012e946a56.tar.gz kdepimpi-fb6753570dc90e936b4e89092554ab012e946a56.tar.bz2 |
mail fixes
-rw-r--r-- | kmicromail/mainwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 0794e00..4c58909 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -190,96 +190,98 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
190 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 190 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
191 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 191 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
192 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 192 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
193 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 193 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
194 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 194 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
195 | 195 | ||
196 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, | 196 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, |
197 | SLOT( setInfoFields(QListViewItem*) ) ); | 197 | SLOT( setInfoFields(QListViewItem*) ) ); |
198 | 198 | ||
199 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 199 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
200 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 200 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
201 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 201 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
202 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 202 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
203 | //mailView->setMultiSelection ( true ); | 203 | //mailView->setMultiSelection ( true ); |
204 | mailView->setSelectionMode( QListView::Extended ); | 204 | mailView->setSelectionMode( QListView::Extended ); |
205 | QValueList<int> list; | 205 | QValueList<int> list; |
206 | int fw = 100; | 206 | int fw = 100; |
207 | if ( QApplication::desktop()->width() > 320 ) | 207 | if ( QApplication::desktop()->width() > 320 ) |
208 | fw = 50; | 208 | fw = 50; |
209 | list.append( fw ); | 209 | list.append( fw ); |
210 | list.append( 100 ); | 210 | list.append( 100 ); |
211 | split->setSizes( list ); | 211 | split->setSizes( list ); |
212 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 212 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
213 | mailView->setShowSortIndicator ( true ); | 213 | mailView->setShowSortIndicator ( true ); |
214 | QLabel *spacer = new QLabel( toolBar ); | 214 | QLabel *spacer = new QLabel( toolBar ); |
215 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 215 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
216 | toolBar->setStretchableWidget( spacer ); | 216 | toolBar->setStretchableWidget( spacer ); |
217 | 217 | ||
218 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 218 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
219 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 219 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
220 | if ( QApplication::desktop()->width() > 320 ) | 220 | if ( QApplication::desktop()->width() > 320 ) |
221 | closeMail->addTo(toolBar); | 221 | closeMail->addTo(toolBar); |
222 | closeMail->addTo(mailMenu); | 222 | closeMail->addTo(mailMenu); |
223 | 223 | ||
224 | 224 | ||
225 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 225 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
226 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 226 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
227 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 227 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
228 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 228 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
229 | li->addTo(helpMenu); | 229 | li->addTo(helpMenu); |
230 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 230 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
231 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 231 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
232 | li->addTo(helpMenu); | 232 | li->addTo(helpMenu); |
233 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 233 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
234 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 234 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
235 | li->addTo(helpMenu); | 235 | li->addTo(helpMenu); |
236 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 236 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
237 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 237 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
238 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); | ||
239 | //menuBar->setMaximumSize( menuBar->sizeHint()); | ||
238 | #ifdef DESKTOP_VERSION | 240 | #ifdef DESKTOP_VERSION |
239 | resize ( 640, 480 ); | 241 | resize ( 640, 480 ); |
240 | #endif | 242 | #endif |
241 | } | 243 | } |
242 | 244 | ||
243 | MainWindow::~MainWindow() | 245 | MainWindow::~MainWindow() |
244 | { | 246 | { |
245 | } | 247 | } |
246 | 248 | ||
247 | void MainWindow::setInfoFields(QListViewItem* item ) | 249 | void MainWindow::setInfoFields(QListViewItem* item ) |
248 | { | 250 | { |
249 | if ( item == 0) { | 251 | if ( item == 0) { |
250 | if ( subLE ) subLE->setText(""); | 252 | if ( subLE ) subLE->setText(""); |
251 | if ( fromLE ) fromLE->setText(""); | 253 | if ( fromLE ) fromLE->setText(""); |
252 | if ( toLE ) toLE->setText(""); | 254 | if ( toLE ) toLE->setText(""); |
253 | return; | 255 | return; |
254 | } | 256 | } |
255 | RecMailP mail = ((MailListViewItem*)item)->data(); | 257 | RecMailP mail = ((MailListViewItem*)item)->data(); |
256 | if ( subLE ) subLE->setText(mail->getSubject()); | 258 | if ( subLE ) subLE->setText(mail->getSubject()); |
257 | if ( fromLE ) fromLE->setText(mail->getFrom()); | 259 | if ( fromLE ) fromLE->setText(mail->getFrom()); |
258 | if ( toLE ) toLE->setText(mail->To().join(";" )); | 260 | if ( toLE ) toLE->setText(mail->To().join(";" )); |
259 | if ( subLE ) subLE->setCursorPosition(0); | 261 | if ( subLE ) subLE->setCursorPosition(0); |
260 | if ( fromLE ) fromLE->setCursorPosition(0); | 262 | if ( fromLE ) fromLE->setCursorPosition(0); |
261 | if ( toLE ) toLE->setCursorPosition(0); | 263 | if ( toLE ) toLE->setCursorPosition(0); |
262 | 264 | ||
263 | } | 265 | } |
264 | void MainWindow::slotSetCodec( int codec ) | 266 | void MainWindow::slotSetCodec( int codec ) |
265 | { | 267 | { |
266 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | 268 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); |
267 | //qDebug("codec %d ", codec); | 269 | //qDebug("codec %d ", codec); |
268 | KOPrefs::instance()->mCurrentCodec = codec; | 270 | KOPrefs::instance()->mCurrentCodec = codec; |
269 | KOPrefs::instance()->isDirty = true; | 271 | KOPrefs::instance()->isDirty = true; |
270 | QString name; | 272 | QString name; |
271 | switch ( codec ) { | 273 | switch ( codec ) { |
272 | case 0: | 274 | case 0: |
273 | name = "iso-8859-1"; | 275 | name = "iso-8859-1"; |
274 | break; | 276 | break; |
275 | case 1: | 277 | case 1: |
276 | name = "iso-8859-5"; | 278 | name = "iso-8859-5"; |
277 | break; | 279 | break; |
278 | case 2: | 280 | case 2: |
279 | name = "iso-8859-15"; | 281 | name = "iso-8859-15"; |
280 | break; | 282 | break; |
281 | case 3: | 283 | case 3: |
282 | name = "big-5"; | 284 | name = "big-5"; |
283 | break; | 285 | break; |
284 | case 4: | 286 | case 4: |
285 | name = "utf-8"; | 287 | name = "utf-8"; |