-rw-r--r-- | kaddressbook/kabcore.cpp | 7 | ||||
-rw-r--r-- | kmicromail/composemail.cpp | 24 | ||||
-rw-r--r-- | kmicromail/mailistviewitem.cpp | 77 | ||||
-rw-r--r-- | kmicromail/mailistviewitem.h | 7 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 10 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 2 |
6 files changed, 80 insertions, 47 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index a6d722d..68d3d2d 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1008,9 +1008,10 @@ void KABCore::openConfigDialog() connect( ConfigureDialog, SIGNAL( okClicked() ), this, SLOT( configurationChanged() ) ); saveSettings(); ConfigureDialog->showMaximized(); - ConfigureDialog->exec(); + if ( ConfigureDialog->exec() ) + KMessageBox::information( this, i18n("If you configured \nExtensions,\nplease restart!\n") ); delete ConfigureDialog; } void KABCore::openLDAPDialog() @@ -1360,16 +1361,17 @@ void KABCore::initActions() this, SLOT( configureKeyBindings() ), actionCollection(), "kaddressbook_configure_shortcuts" ); #ifdef KAB_EMBEDDED mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); + mActionConfigureToolbars->setEnabled( false ); #endif //KAB_EMBEDDED } else { mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); } - + mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, actionCollection(), "options_show_jump_bar" ); connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); @@ -1595,8 +1597,9 @@ void KABCore::configureResources() KRES::KCMKResources dlg( this, "" , 0 ); if ( !dlg.exec() ) return; + KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); } #endif //KAB_EMBEDDED diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index ca4f247..c1b58a4 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -42,10 +42,10 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); QStringList mails = con.emails(); QString defmail = con.preferredEmail(); if ( mails.count() == 0) - QMessageBox::information( parentWidget(), tr( "Hint" ), - tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!" ), + QMessageBox::information( 0, tr( "Hint" ), + tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), tr( "Ok" ) ); if (defmail.length()!=0) { fromBox->insertItem(defmail); } @@ -72,16 +72,8 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m smtpAccountBox->insertItem( smtp->getAccountName() ); smtpAccounts.append( smtp ); } } - if ( smtpAccounts.count() > 0 ) { - fillValues( smtpAccountBox->currentItem() ); - } else { - QMessageBox::information( parentWidget(), tr( "Problem" ), - tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail." ), - tr( "Ok" ) ); - return; - } connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); @@ -90,8 +82,16 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); mMail = 0; warnAttach = true; + if ( smtpAccounts.count() > 0 ) { + fillValues( smtpAccountBox->currentItem() ); + } else { + QMessageBox::information( 0, tr( "Problem" ), + tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), + tr( "Ok" ) ); + return; + } } void ComposeMail::saveAsDraft() { @@ -319,10 +319,10 @@ void ComposeMail::accept() void ComposeMail::reject() { //qDebug("ComposeMail::reject() "); - int yesno = QMessageBox::warning(0,tr("Stop editing message"), - tr("Store message into drafts?"), + int yesno = QMessageBox::warning(0,tr("Store message?"), + tr("Store message into drafts?\n"), tr("Yes"), tr("No")); //qDebug("button %d ", yesno); diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index b9b4cd9..1ca0ada 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp @@ -20,40 +20,44 @@ void MailListViewItem::showEntry() } else { setPixmap( 0,SmallIcon ( "kmmsgnew") ); } double s = mail_data->Msgsize(); - int w; - w=0; - - while (s>1024) { - s/=1024; + int w = 0; + s/=1024; + if (s>999.0) { + s/=1024.0; ++w; - if (w>=2) break; } - - QString q=""; - QString fsize=""; - switch(w) { - case 1: - q="k"; + QString fsort; + fsort.sprintf( "%.2f", s ); + QString fsize = QString::number( s, 'f', 2 ); + // 1.23 + // 11.23 + // 111.23 + // 999.23 maxlen + switch(fsize.length() ) { + case 4: + fsort = "00" + fsize ; break; - case 2: - q="M"; + case 5: + fsort = "0" + fsize ; break; default: - break; + fsort = fsize ; + break; + } - - { - QTextOStream o(&fsize); - if (w>0) o.precision(2); else o.precision(0); - o.setf(QTextStream::fixed); - o << s << " " << q << "Byte"; + if ( w == 0 ) { + setText(3, fsize + "kB" ); + mKeyMap.insert(3, "k" + fsort); + //setText(3, "kB" + fsort ); // test only + } else { + //setText(3, fsize + "MB"); + mKeyMap.insert(4, "M" +fsort ); } - setText(1,mail_data->getSubject()); setText(2,mail_data->getFrom()); - setText(3,fsize); + QString date = mail_data->getDate(); int kom = date.find( ",")+2; if ( kom == 1 ) @@ -90,19 +94,42 @@ void MailListViewItem::showEntry() else if ( mon == "Nov" ) so = "11"; else if ( mon == "Dec" ) so = "12"; - date = date.mid(7,4)+"-"+so+"-"+date.left(2)+" "+date.mid(12,14); + date = date.mid(7,4)+so+date.left(2)+date.mid(12,14); } // if ( date.left(1) != "1" || date.left(1) != "2" ) // date = date.mid(5); - setText(4,date); + mKeyMap.insert(4,date); + setText(4,mail_data->getDate()); } void MailListViewItem::storeData(const RecMailP&data) { mail_data = data; } +void MailListViewItem::setSortKey(int column,const QString &key) +{ + mKeyMap.insert(column,key); +} +QString MailListViewItem::key(int column, bool) const +{ + // to make is fast, we use here special cases + if ( column == 3 || column == 4 ) { + return *mKeyMap.find(column); + } + if ( column == 1 ) { + if ( text(1).left(4).lower() == "re: " ) + return text(1).mid(4); + + } + return text(column); + /* + QMap<int,QString>::ConstIterator it = mKeyMap.find(column); + if (it == mKeyMap.end()) return text(column); + else return *it; + */ +} const RecMailP& MailListViewItem::data()const { return mail_data; diff --git a/kmicromail/mailistviewitem.h b/kmicromail/mailistviewitem.h index d953d83..cf8040b 100644 --- a/kmicromail/mailistviewitem.h +++ b/kmicromail/mailistviewitem.h @@ -14,10 +14,13 @@ public: void storeData(const RecMailP&data); const RecMailP&data()const; void showEntry(); MAILLIB::ATYPE wrapperType(); - + QString key(int column, bool) const; + void setSortKey(int column,const QString &key); protected: - RecMailP mail_data; + RecMailP mail_data; + private: + QMap<int,QString> mKeyMap; }; #endif diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 78377ea..ddc7b3e 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -94,22 +94,22 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); folderView = new AccountView( split ); folderView->header()->hide(); - folderView->setRootIsDecorated( true ); + folderView->setRootIsDecorated( false ); folderView->addColumn( tr( "Mailbox" ) ); //layout->addWidget( folderView ); mailView = new QListView( split ); - mailView->addColumn( tr( "" ) ); + mailView->addColumn( tr( " " ) ); mailView->addColumn( tr( "Subject" ),QListView::Manual ); mailView->addColumn( tr( "Sender" ),QListView::Manual ); mailView->addColumn( tr( "Size" ),QListView::Manual); - mailView->addColumn( tr( "Date" )); + mailView->addColumn( tr( "Date" ),QListView::Manual); mailView->setAllColumnsShowFocus(true); //mailView->setSorting(-1); - + mailView->setRootIsDecorated( false ); statusWidget = new StatusWidget( wrapperBox ); statusWidget->hide(); //layout->addWidget( mailView ); @@ -175,9 +175,9 @@ void MainWindow::slotAdjustColumns() folderView->setColumnWidth( 0, folderView->visibleWidth() ); if ( hidden ) folderView->hide(); mailView->setColumnWidth( 0, 10 ); - mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); + mailView->setColumnWidth( 1, 80 ); mailView->setColumnWidth( 2, 80 ); mailView->setColumnWidth( 3, 50 ); mailView->setColumnWidth( 4, 50 ); } diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index b1992ec..bdbd93a 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -147,9 +147,9 @@ void OpieMail::slotSendQueued() } } if (smtpList.count()==0) { - QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); + QMessageBox::information(0,tr("Info"),tr("Define a smtp account first!\n")); return; } if (smtpList.count()==1) { |