summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp7
-rw-r--r--kmicromail/composemail.cpp24
-rw-r--r--kmicromail/mailistviewitem.cpp77
-rw-r--r--kmicromail/mailistviewitem.h7
-rw-r--r--kmicromail/mainwindow.cpp10
-rw-r--r--kmicromail/opiemail.cpp2
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
@@ -1009,7 +1009,8 @@ void KABCore::openConfigDialog()
1009 this, SLOT( configurationChanged() ) ); 1009 this, SLOT( configurationChanged() ) );
1010 saveSettings(); 1010 saveSettings();
1011 ConfigureDialog->showMaximized(); 1011 ConfigureDialog->showMaximized();
1012 ConfigureDialog->exec(); 1012 if ( ConfigureDialog->exec() )
1013 KMessageBox::information( this, i18n("If you configured \nExtensions,\nplease restart!\n") );
1013 delete ConfigureDialog; 1014 delete ConfigureDialog;
1014} 1015}
1015 1016
@@ -1361,6 +1362,7 @@ void KABCore::initActions()
1361 "kaddressbook_configure_shortcuts" ); 1362 "kaddressbook_configure_shortcuts" );
1362#ifdef KAB_EMBEDDED 1363#ifdef KAB_EMBEDDED
1363 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1364 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1365 mActionConfigureToolbars->setEnabled( false );
1364#endif //KAB_EMBEDDED 1366#endif //KAB_EMBEDDED
1365 1367
1366 } else { 1368 } else {
@@ -1368,7 +1370,7 @@ void KABCore::initActions()
1368 1370
1369 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1371 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1370 } 1372 }
1371 1373
1372 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1374 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
1373 actionCollection(), "options_show_jump_bar" ); 1375 actionCollection(), "options_show_jump_bar" );
1374 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 1376 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
@@ -1596,6 +1598,7 @@ void KABCore::configureResources()
1596 1598
1597 if ( !dlg.exec() ) 1599 if ( !dlg.exec() )
1598 return; 1600 return;
1601 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
1599} 1602}
1600#endif //KAB_EMBEDDED 1603#endif //KAB_EMBEDDED
1601 1604
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index ca4f247..c1b58a4 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -43,8 +43,8 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
43 QStringList mails = con.emails(); 43 QStringList mails = con.emails();
44 QString defmail = con.preferredEmail(); 44 QString defmail = con.preferredEmail();
45 if ( mails.count() == 0) 45 if ( mails.count() == 0)
46 QMessageBox::information( parentWidget(), tr( "Hint" ), 46 QMessageBox::information( 0, tr( "Hint" ),
47 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!" ), 47 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
48 tr( "Ok" ) ); 48 tr( "Ok" ) );
49 if (defmail.length()!=0) { 49 if (defmail.length()!=0) {
50 fromBox->insertItem(defmail); 50 fromBox->insertItem(defmail);
@@ -73,14 +73,6 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
73 smtpAccounts.append( smtp ); 73 smtpAccounts.append( smtp );
74 } 74 }
75 } 75 }
76 if ( smtpAccounts.count() > 0 ) {
77 fillValues( smtpAccountBox->currentItem() );
78 } else {
79 QMessageBox::information( parentWidget(), tr( "Problem" ),
80 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail." ),
81 tr( "Ok" ) );
82 return;
83 }
84 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 76 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
85 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 77 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
86 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 78 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
@@ -91,6 +83,14 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
91 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); 83 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) );
92 mMail = 0; 84 mMail = 0;
93 warnAttach = true; 85 warnAttach = true;
86 if ( smtpAccounts.count() > 0 ) {
87 fillValues( smtpAccountBox->currentItem() );
88 } else {
89 QMessageBox::information( 0, tr( "Problem" ),
90 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
91 tr( "Ok" ) );
92 return;
93 }
94} 94}
95void ComposeMail::saveAsDraft() 95void ComposeMail::saveAsDraft()
96{ 96{
@@ -320,8 +320,8 @@ void ComposeMail::accept()
320void ComposeMail::reject() 320void ComposeMail::reject()
321{ 321{
322 //qDebug("ComposeMail::reject() "); 322 //qDebug("ComposeMail::reject() ");
323 int yesno = QMessageBox::warning(0,tr("Stop editing message"), 323 int yesno = QMessageBox::warning(0,tr("Store message?"),
324 tr("Store message into drafts?"), 324 tr("Store message into drafts?\n"),
325 tr("Yes"), 325 tr("Yes"),
326 tr("No")); 326 tr("No"));
327 327
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index b9b4cd9..1ca0ada 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -21,38 +21,42 @@ void MailListViewItem::showEntry()
21 setPixmap( 0,SmallIcon ( "kmmsgnew") ); 21 setPixmap( 0,SmallIcon ( "kmmsgnew") );
22 } 22 }
23 double s = mail_data->Msgsize(); 23 double s = mail_data->Msgsize();
24 int w; 24 int w = 0;
25 w=0; 25 s/=1024;
26 26 if (s>999.0) {
27 while (s>1024) { 27 s/=1024.0;
28 s/=1024;
29 ++w; 28 ++w;
30 if (w>=2) break;
31 } 29 }
32 30 QString fsort;
33 QString q=""; 31 fsort.sprintf( "%.2f", s );
34 QString fsize=""; 32 QString fsize = QString::number( s, 'f', 2 );
35 switch(w) { 33 // 1.23
36 case 1: 34 // 11.23
37 q="k"; 35 // 111.23
36 // 999.23 maxlen
37 switch(fsize.length() ) {
38 case 4:
39 fsort = "00" + fsize ;
38 break; 40 break;
39 case 2: 41 case 5:
40 q="M"; 42 fsort = "0" + fsize ;
41 break; 43 break;
42 default: 44 default:
43 break; 45 fsort = fsize ;
46 break;
47
44 } 48 }
45 49 if ( w == 0 ) {
46 { 50 setText(3, fsize + "kB" );
47 QTextOStream o(&fsize); 51 mKeyMap.insert(3, "k" + fsort);
48 if (w>0) o.precision(2); else o.precision(0); 52 //setText(3, "kB" + fsort ); // test only
49 o.setf(QTextStream::fixed); 53 } else {
50 o << s << " " << q << "Byte"; 54 //setText(3, fsize + "MB");
55 mKeyMap.insert(4, "M" +fsort );
51 } 56 }
52
53 setText(1,mail_data->getSubject()); 57 setText(1,mail_data->getSubject());
54 setText(2,mail_data->getFrom()); 58 setText(2,mail_data->getFrom());
55 setText(3,fsize); 59
56 QString date = mail_data->getDate(); 60 QString date = mail_data->getDate();
57 61
58 int kom = date.find( ",")+2; 62 int kom = date.find( ",")+2;
@@ -91,17 +95,40 @@ void MailListViewItem::showEntry()
91 so = "11"; 95 so = "11";
92 else if ( mon == "Dec" ) 96 else if ( mon == "Dec" )
93 so = "12"; 97 so = "12";
94 date = date.mid(7,4)+"-"+so+"-"+date.left(2)+" "+date.mid(12,14); 98 date = date.mid(7,4)+so+date.left(2)+date.mid(12,14);
95 } 99 }
96 // if ( date.left(1) != "1" || date.left(1) != "2" ) 100 // if ( date.left(1) != "1" || date.left(1) != "2" )
97 // date = date.mid(5); 101 // date = date.mid(5);
98 setText(4,date); 102 mKeyMap.insert(4,date);
103 setText(4,mail_data->getDate());
99} 104}
100 105
101void MailListViewItem::storeData(const RecMailP&data) 106void MailListViewItem::storeData(const RecMailP&data)
102{ 107{
103 mail_data = data; 108 mail_data = data;
104} 109}
110void MailListViewItem::setSortKey(int column,const QString &key)
111{
112 mKeyMap.insert(column,key);
113}
114QString MailListViewItem::key(int column, bool) const
115{
116 // to make is fast, we use here special cases
117 if ( column == 3 || column == 4 ) {
118 return *mKeyMap.find(column);
119 }
120 if ( column == 1 ) {
121 if ( text(1).left(4).lower() == "re: " )
122 return text(1).mid(4);
123
124 }
125 return text(column);
126 /*
127 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
128 if (it == mKeyMap.end()) return text(column);
129 else return *it;
130 */
131}
105 132
106const RecMailP& MailListViewItem::data()const 133const RecMailP& MailListViewItem::data()const
107{ 134{
diff --git a/kmicromail/mailistviewitem.h b/kmicromail/mailistviewitem.h
index d953d83..cf8040b 100644
--- a/kmicromail/mailistviewitem.h
+++ b/kmicromail/mailistviewitem.h
@@ -15,9 +15,12 @@ public:
15 const RecMailP&data()const; 15 const RecMailP&data()const;
16 void showEntry(); 16 void showEntry();
17 MAILLIB::ATYPE wrapperType(); 17 MAILLIB::ATYPE wrapperType();
18 18 QString key(int column, bool) const;
19 void setSortKey(int column,const QString &key);
19protected: 20protected:
20 RecMailP mail_data; 21 RecMailP mail_data;
22 private:
23 QMap<int,QString> mKeyMap;
21}; 24};
22 25
23#endif 26#endif
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 78377ea..ddc7b3e 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -95,20 +95,20 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
95 95
96 folderView = new AccountView( split ); 96 folderView = new AccountView( split );
97 folderView->header()->hide(); 97 folderView->header()->hide();
98 folderView->setRootIsDecorated( true ); 98 folderView->setRootIsDecorated( false );
99 folderView->addColumn( tr( "Mailbox" ) ); 99 folderView->addColumn( tr( "Mailbox" ) );
100 100
101 //layout->addWidget( folderView ); 101 //layout->addWidget( folderView );
102 102
103 mailView = new QListView( split ); 103 mailView = new QListView( split );
104 mailView->addColumn( tr( "" ) ); 104 mailView->addColumn( tr( " " ) );
105 mailView->addColumn( tr( "Subject" ),QListView::Manual ); 105 mailView->addColumn( tr( "Subject" ),QListView::Manual );
106 mailView->addColumn( tr( "Sender" ),QListView::Manual ); 106 mailView->addColumn( tr( "Sender" ),QListView::Manual );
107 mailView->addColumn( tr( "Size" ),QListView::Manual); 107 mailView->addColumn( tr( "Size" ),QListView::Manual);
108 mailView->addColumn( tr( "Date" )); 108 mailView->addColumn( tr( "Date" ),QListView::Manual);
109 mailView->setAllColumnsShowFocus(true); 109 mailView->setAllColumnsShowFocus(true);
110 //mailView->setSorting(-1); 110 //mailView->setSorting(-1);
111 111 mailView->setRootIsDecorated( false );
112 statusWidget = new StatusWidget( wrapperBox ); 112 statusWidget = new StatusWidget( wrapperBox );
113 statusWidget->hide(); 113 statusWidget->hide();
114 114
@@ -176,7 +176,7 @@ void MainWindow::slotAdjustColumns()
176 if ( hidden ) folderView->hide(); 176 if ( hidden ) folderView->hide();
177 177
178 mailView->setColumnWidth( 0, 10 ); 178 mailView->setColumnWidth( 0, 10 );
179 mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); 179 mailView->setColumnWidth( 1, 80 );
180 mailView->setColumnWidth( 2, 80 ); 180 mailView->setColumnWidth( 2, 80 );
181 mailView->setColumnWidth( 3, 50 ); 181 mailView->setColumnWidth( 3, 50 );
182 mailView->setColumnWidth( 4, 50 ); 182 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
@@ -148,7 +148,7 @@ void OpieMail::slotSendQueued()
148 } 148 }
149 if (smtpList.count()==0) 149 if (smtpList.count()==0)
150 { 150 {
151 QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); 151 QMessageBox::information(0,tr("Info"),tr("Define a smtp account first!\n"));
152 return; 152 return;
153 } 153 }
154 if (smtpList.count()==1) 154 if (smtpList.count()==1)