-rw-r--r-- | bin/kdepim/WhatsNew.txt | 13 | ||||
-rw-r--r-- | kmicromail/composemail.cpp | 21 | ||||
-rw-r--r-- | kmicromail/composemail.h | 1 | ||||
-rw-r--r-- | kmicromail/composemailui.ui | 74 | ||||
-rw-r--r-- | kmicromail/editaccounts.cpp | 19 | ||||
-rw-r--r-- | kmicromail/editaccounts.h | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 46 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 6 | ||||
-rw-r--r-- | kmicromail/main.cpp | 2 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 2 | ||||
-rw-r--r-- | kmicromail/smtpconfigui.ui | 97 |
11 files changed, 191 insertions, 91 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 3dbbbb6..031c7f2 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -18,2 +18,15 @@ Made the quite difficult timezone change in KO/Pi easy. +OM/Pi: +Fixed too small icons on desktop. +Fixed non visible icons in mainwindow on Z with fastload enabled. +Added signature file setting to smtp account config. +And the signature can be edited and saved in the edit mail dialog. +That does mean: +Simply edit the signature for the selected smtp account in the +edit new mail dialog and press the "save signature" button there. +Then the signature is saved to the file specified in the smtp account settings. +If there is no file specified, it is saved automatically to the file +kdepim/apps/kopiemail/<accountname>.sig. + + diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 976e309..ed8a2ee 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -151,3 +151,5 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); - + connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); + if ( smtpAccountBox->count()) + fillValues(0); @@ -167,4 +169,11 @@ void ComposeMail::fillSettings() } - - +void ComposeMail::saveSig() +{ + if ( smtpAccountBox->count()) { + int cur = smtpAccountBox->currentItem (); + SMTPaccount *smtp = smtpAccounts.at( cur ); + if ( smtp ) + smtp->setSignature( sigMultiLine->text()); + } +} void ComposeMail::saveAsDraft() @@ -340,3 +349,3 @@ void ComposeMail::pickAddressReply() -void ComposeMail::fillValues( int ) +void ComposeMail::fillValues( int current ) { @@ -356,4 +365,6 @@ void ComposeMail::fillValues( int ) } - sigMultiLine->setText( smtp->getSignature() ); #endif + SMTPaccount *smtp = smtpAccounts.at( current ); + if ( smtp ) + sigMultiLine->setText( smtp->getSignature() ); } diff --git a/kmicromail/composemail.h b/kmicromail/composemail.h index a7fa41c..966ac3e 100644 --- a/kmicromail/composemail.h +++ b/kmicromail/composemail.h @@ -70,2 +70,3 @@ private slots: void setStatus( QString ); + void saveSig(); diff --git a/kmicromail/composemailui.ui b/kmicromail/composemailui.ui index 610907c..23f47d3 100644 --- a/kmicromail/composemailui.ui +++ b/kmicromail/composemailui.ui @@ -14,4 +14,4 @@ <y>0</y> - <width>579</width> - <height>476</height> + <width>275</width> + <height>382</height> </rect> @@ -333,3 +333,3 @@ <name>margin</name> - <number>3</number> + <number>2</number> </property> @@ -337,16 +337,5 @@ <name>spacing</name> - <number>3</number> + <number>2</number> </property> - <widget row="3" column="0" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>replyButton</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Reply-To</string> - </property> - </widget> - <widget row="2" column="0" > + <widget row="1" column="0" > <class>QPushButton</class> @@ -361,3 +350,3 @@ </widget> - <widget row="1" column="1" > + <widget row="0" column="1" > <class>QLineEdit</class> @@ -368,3 +357,3 @@ </widget> - <widget row="2" column="1" > + <widget row="1" column="1" > <class>QLineEdit</class> @@ -375,3 +364,3 @@ </widget> - <widget row="3" column="1" > + <widget row="2" column="1" > <class>QLineEdit</class> @@ -382,3 +371,3 @@ </widget> - <widget row="6" column="0" rowspan="1" colspan="2" > + <widget row="4" column="0" rowspan="1" colspan="2" > <class>QMultiLineEdit</class> @@ -389,7 +378,7 @@ </widget> - <widget row="5" column="0" > - <class>QLabel</class> + <widget row="0" column="0" > + <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>sigLabel</cstring> + <cstring>ccButton</cstring> </property> @@ -397,31 +386,32 @@ <name>text</name> - <string>Signature</string> + <string>CC</string> </property> </widget> - <spacer row="4" column="0" > - <property> + <widget row="3" column="1" > + <class>QPushButton</class> + <property stdset="1"> <name>name</name> - <cstring>Spacer3</cstring> + <cstring>SaveSigButton</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> + <name>text</name> + <string>Save signature</string> </property> + </widget> + <widget row="2" column="0" > + <class>QPushButton</class> <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> + <name>name</name> + <cstring>replyButton</cstring> </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> + <property stdset="1"> + <name>text</name> + <string>Reply-To</string> </property> - </spacer> - <widget row="1" column="0" > - <class>QPushButton</class> + </widget> + <widget row="3" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>ccButton</cstring> + <cstring>sigLabel</cstring> </property> @@ -429,3 +419,3 @@ <name>text</name> - <string>CC</string> + <string>Signature</string> </property> diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 48c3963..8253c91 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp @@ -21,2 +21,3 @@ #include <klocale.h> +#include <kfiledialog.h> @@ -481,3 +482,9 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, fillValues(); - + QIconSet icon; + //icon = SmallIcon("fileexport"); + icon = SmallIcon("fileopen"); + SignaturButton->setText(""); + SignaturButton->setIconSet (icon ) ; + SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; + connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); @@ -490,3 +497,9 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, } - +void SMTPconfig::chooseSig() +{ + QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); + if ( !lnk.isEmpty() ) { + SignaturEdit->setText( lnk ); + } +} void SMTPconfig::slotConnectionToggle( int index ) @@ -518,2 +531,3 @@ void SMTPconfig::fillValues() passLine->setText( data->getPassword() ); + SignaturEdit->setText( data->getSigFile() ); } @@ -529,2 +543,3 @@ void SMTPconfig::accept() data->setPassword( passLine->text() ); + data->setSigFile( SignaturEdit->text() ); diff --git a/kmicromail/editaccounts.h b/kmicromail/editaccounts.h index 6cf842e..465780c 100644 --- a/kmicromail/editaccounts.h +++ b/kmicromail/editaccounts.h @@ -123,2 +123,3 @@ protected slots: void accept(); + void chooseSig(); diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 19093b1..8f909f9 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp @@ -3,2 +3,6 @@ +#include <qtextcodec.h> +#include <qtextstream.h> +#include <qfile.h> + //#include <opie2/odebug.h> @@ -368,2 +372,41 @@ SMTPaccount::SMTPaccount( QString filename ) +QString SMTPaccount::getSignature() +{ + QFileInfo fi ( signature ); + if ( ! fi.exists() ) + return QString(); + + QFile file( signature ); + if (!file.open( IO_ReadOnly ) ) { + return QString(); + + } + QTextStream ts( &file ); + ts.setCodec( QTextCodec::codecForName("utf8") ); + QString text = ts.read(); + file.close(); + + return text; + +} +void SMTPaccount::setSignature( QString b ) +{ + + QFileInfo fi ( signature ); + if ( ! fi.exists() ) { + QString filedir( locateLocal("data", "kopiemail" ) ); + signature = filedir+ "/" + getAccountName() +".sig"; + qDebug("new sig %s ", signature.latin1()); + save(); + } + QFile fileIn( signature ); + if (!fileIn.open( IO_WriteOnly ) ) { + qDebug("OM: Cannot write signature file %s ", signature.latin1() ); + return ; + } + QTextStream tsIn( &fileIn ); + tsIn.setCodec( QTextCodec::codecForName("utf8") ); + tsIn << b ; + fileIn.close(); +} QString SMTPaccount::getUniqueFileName() @@ -394,3 +437,3 @@ void SMTPaccount::read() user = conf->readEntry( "User" ); - //password = conf->readEntryCrypt( "Password" ); + signature = conf->readEntry( "SigFile" ); setPasswordList( conf->readListEntry( "FolderHistory")); @@ -412,2 +455,3 @@ void SMTPaccount::save() conf->writeEntry( "User", user ); + conf->writeEntry( "SigFile", signature ); //conf->writeEntryCrypt( "Password", password ); diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index c996fe0..a6e95fe 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h @@ -129,2 +129,8 @@ public: + void setSigFile( QString b ) { signature = b; } + QString getSigFile() { return signature; } + + QString getSignature(); + void setSignature( QString b ); + private: diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp index 006390c..1789da0 100644 --- a/kmicromail/main.cpp +++ b/kmicromail/main.cpp @@ -43,3 +43,3 @@ int main( int argc, char **argv ) { #else - fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/"; + fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/icons22/"; KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 0794e00..4c58909 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -237,2 +237,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) slotSetCodec( KOPrefs::instance()->mCurrentCodec ); + menuBar->setMaximumWidth( menuBar->sizeHint().width()); + //menuBar->setMaximumSize( menuBar->sizeHint()); #ifdef DESKTOP_VERSION diff --git a/kmicromail/smtpconfigui.ui b/kmicromail/smtpconfigui.ui index ae0a49a..aae6f12 100644 --- a/kmicromail/smtpconfigui.ui +++ b/kmicromail/smtpconfigui.ui @@ -14,4 +14,4 @@ <y>0</y> - <width>331</width> - <height>426</height> + <width>266</width> + <height>365</height> </rect> @@ -31,3 +31,3 @@ <name>margin</name> - <number>3</number> + <number>5</number> </property> @@ -35,3 +35,3 @@ <name>spacing</name> - <number>3</number> + <number>2</number> </property> @@ -60,20 +60,2 @@ <widget> - <class>Line</class> - <property stdset="1"> - <name>name</name> - <cstring>line1</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> - </property> - </widget> - <widget> <class>QLayoutWidget</class> @@ -202,20 +184,2 @@ <widget> - <class>Line</class> - <property stdset="1"> - <name>name</name> - <cstring>line2</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> - </property> - </widget> - <widget> <class>QCheckBox</class> @@ -329,2 +293,55 @@ </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout7</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1_2</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Signatur File</string> + </property> + </widget> + <widget> + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>SignaturEdit</cstring> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>SignaturButton</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>text</name> + <string>F</string> + </property> + </widget> + </hbox> + </widget> <spacer> |