summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt13
-rw-r--r--kmicromail/composemail.cpp21
-rw-r--r--kmicromail/composemail.h1
-rw-r--r--kmicromail/composemailui.ui74
-rw-r--r--kmicromail/editaccounts.cpp19
-rw-r--r--kmicromail/editaccounts.h1
-rw-r--r--kmicromail/libmailwrapper/settings.cpp46
-rw-r--r--kmicromail/libmailwrapper/settings.h6
-rw-r--r--kmicromail/main.cpp2
-rw-r--r--kmicromail/mainwindow.cpp2
-rw-r--r--kmicromail/smtpconfigui.ui97
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.
18 18
19OM/Pi:
20Fixed too small icons on desktop.
21Fixed non visible icons in mainwindow on Z with fastload enabled.
22Added signature file setting to smtp account config.
23And the signature can be edited and saved in the edit mail dialog.
24That does mean:
25Simply edit the signature for the selected smtp account in the
26edit new mail dialog and press the "save signature" button there.
27Then the signature is saved to the file specified in the smtp account settings.
28If there is no file specified, it is saved automatically to the file
29kdepim/apps/kopiemail/<accountname>.sig.
30
31
19 32
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
151 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 151 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
152 152 connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) );
153 if ( smtpAccountBox->count())
154 fillValues(0);
153 155
@@ -167,4 +169,11 @@ void ComposeMail::fillSettings()
167} 169}
168 170void ComposeMail::saveSig()
169 171{
172 if ( smtpAccountBox->count()) {
173 int cur = smtpAccountBox->currentItem ();
174 SMTPaccount *smtp = smtpAccounts.at( cur );
175 if ( smtp )
176 smtp->setSignature( sigMultiLine->text());
177 }
178}
170void ComposeMail::saveAsDraft() 179void ComposeMail::saveAsDraft()
@@ -340,3 +349,3 @@ void ComposeMail::pickAddressReply()
340 349
341void ComposeMail::fillValues( int ) 350void ComposeMail::fillValues( int current )
342{ 351{
@@ -356,4 +365,6 @@ void ComposeMail::fillValues( int )
356 } 365 }
357 sigMultiLine->setText( smtp->getSignature() );
358#endif 366#endif
367 SMTPaccount *smtp = smtpAccounts.at( current );
368 if ( smtp )
369 sigMultiLine->setText( smtp->getSignature() );
359} 370}
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:
70 void setStatus( QString ); 70 void setStatus( QString );
71 void saveSig();
71 72
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 @@
14 <y>0</y> 14 <y>0</y>
15 <width>579</width> 15 <width>275</width>
16 <height>476</height> 16 <height>382</height>
17 </rect> 17 </rect>
@@ -333,3 +333,3 @@
333 <name>margin</name> 333 <name>margin</name>
334 <number>3</number> 334 <number>2</number>
335 </property> 335 </property>
@@ -337,16 +337,5 @@
337 <name>spacing</name> 337 <name>spacing</name>
338 <number>3</number> 338 <number>2</number>
339 </property> 339 </property>
340 <widget row="3" column="0" > 340 <widget row="1" column="0" >
341 <class>QPushButton</class>
342 <property stdset="1">
343 <name>name</name>
344 <cstring>replyButton</cstring>
345 </property>
346 <property stdset="1">
347 <name>text</name>
348 <string>Reply-To</string>
349 </property>
350 </widget>
351 <widget row="2" column="0" >
352 <class>QPushButton</class> 341 <class>QPushButton</class>
@@ -361,3 +350,3 @@
361 </widget> 350 </widget>
362 <widget row="1" column="1" > 351 <widget row="0" column="1" >
363 <class>QLineEdit</class> 352 <class>QLineEdit</class>
@@ -368,3 +357,3 @@
368 </widget> 357 </widget>
369 <widget row="2" column="1" > 358 <widget row="1" column="1" >
370 <class>QLineEdit</class> 359 <class>QLineEdit</class>
@@ -375,3 +364,3 @@
375 </widget> 364 </widget>
376 <widget row="3" column="1" > 365 <widget row="2" column="1" >
377 <class>QLineEdit</class> 366 <class>QLineEdit</class>
@@ -382,3 +371,3 @@
382 </widget> 371 </widget>
383 <widget row="6" column="0" rowspan="1" colspan="2" > 372 <widget row="4" column="0" rowspan="1" colspan="2" >
384 <class>QMultiLineEdit</class> 373 <class>QMultiLineEdit</class>
@@ -389,7 +378,7 @@
389 </widget> 378 </widget>
390 <widget row="5" column="0" > 379 <widget row="0" column="0" >
391 <class>QLabel</class> 380 <class>QPushButton</class>
392 <property stdset="1"> 381 <property stdset="1">
393 <name>name</name> 382 <name>name</name>
394 <cstring>sigLabel</cstring> 383 <cstring>ccButton</cstring>
395 </property> 384 </property>
@@ -397,31 +386,32 @@
397 <name>text</name> 386 <name>text</name>
398 <string>Signature</string> 387 <string>CC</string>
399 </property> 388 </property>
400 </widget> 389 </widget>
401 <spacer row="4" column="0" > 390 <widget row="3" column="1" >
402 <property> 391 <class>QPushButton</class>
392 <property stdset="1">
403 <name>name</name> 393 <name>name</name>
404 <cstring>Spacer3</cstring> 394 <cstring>SaveSigButton</cstring>
405 </property> 395 </property>
406 <property stdset="1"> 396 <property stdset="1">
407 <name>orientation</name> 397 <name>text</name>
408 <enum>Vertical</enum> 398 <string>Save signature</string>
409 </property> 399 </property>
400 </widget>
401 <widget row="2" column="0" >
402 <class>QPushButton</class>
410 <property stdset="1"> 403 <property stdset="1">
411 <name>sizeType</name> 404 <name>name</name>
412 <enum>Expanding</enum> 405 <cstring>replyButton</cstring>
413 </property> 406 </property>
414 <property> 407 <property stdset="1">
415 <name>sizeHint</name> 408 <name>text</name>
416 <size> 409 <string>Reply-To</string>
417 <width>20</width>
418 <height>20</height>
419 </size>
420 </property> 410 </property>
421 </spacer> 411 </widget>
422 <widget row="1" column="0" > 412 <widget row="3" column="0" >
423 <class>QPushButton</class> 413 <class>QLabel</class>
424 <property stdset="1"> 414 <property stdset="1">
425 <name>name</name> 415 <name>name</name>
426 <cstring>ccButton</cstring> 416 <cstring>sigLabel</cstring>
427 </property> 417 </property>
@@ -429,3 +419,3 @@
429 <name>text</name> 419 <name>text</name>
430 <string>CC</string> 420 <string>Signature</string>
431 </property> 421 </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 @@
21#include <klocale.h> 21#include <klocale.h>
22#include <kfiledialog.h>
22 23
@@ -481,3 +482,9 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name,
481 fillValues(); 482 fillValues();
482 483 QIconSet icon;
484 //icon = SmallIcon("fileexport");
485 icon = SmallIcon("fileopen");
486 SignaturButton->setText("");
487 SignaturButton->setIconSet (icon ) ;
488 SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ;
489 connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) );
483 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 490 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
@@ -490,3 +497,9 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name,
490} 497}
491 498void SMTPconfig::chooseSig()
499{
500 QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this );
501 if ( !lnk.isEmpty() ) {
502 SignaturEdit->setText( lnk );
503 }
504}
492void SMTPconfig::slotConnectionToggle( int index ) 505void SMTPconfig::slotConnectionToggle( int index )
@@ -518,2 +531,3 @@ void SMTPconfig::fillValues()
518 passLine->setText( data->getPassword() ); 531 passLine->setText( data->getPassword() );
532 SignaturEdit->setText( data->getSigFile() );
519} 533}
@@ -529,2 +543,3 @@ void SMTPconfig::accept()
529 data->setPassword( passLine->text() ); 543 data->setPassword( passLine->text() );
544 data->setSigFile( SignaturEdit->text() );
530 545
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:
123 void accept(); 123 void accept();
124 void chooseSig();
124 125
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 @@
3 3
4#include <qtextcodec.h>
5#include <qtextstream.h>
6#include <qfile.h>
7
4//#include <opie2/odebug.h> 8//#include <opie2/odebug.h>
@@ -368,2 +372,41 @@ SMTPaccount::SMTPaccount( QString filename )
368 372
373QString SMTPaccount::getSignature()
374{
375 QFileInfo fi ( signature );
376 if ( ! fi.exists() )
377 return QString();
378
379 QFile file( signature );
380 if (!file.open( IO_ReadOnly ) ) {
381 return QString();
382
383 }
384 QTextStream ts( &file );
385 ts.setCodec( QTextCodec::codecForName("utf8") );
386 QString text = ts.read();
387 file.close();
388
389 return text;
390
391}
392void SMTPaccount::setSignature( QString b )
393{
394
395 QFileInfo fi ( signature );
396 if ( ! fi.exists() ) {
397 QString filedir( locateLocal("data", "kopiemail" ) );
398 signature = filedir+ "/" + getAccountName() +".sig";
399 qDebug("new sig %s ", signature.latin1());
400 save();
401 }
402 QFile fileIn( signature );
403 if (!fileIn.open( IO_WriteOnly ) ) {
404 qDebug("OM: Cannot write signature file %s ", signature.latin1() );
405 return ;
406 }
407 QTextStream tsIn( &fileIn );
408 tsIn.setCodec( QTextCodec::codecForName("utf8") );
409 tsIn << b ;
410 fileIn.close();
411}
369QString SMTPaccount::getUniqueFileName() 412QString SMTPaccount::getUniqueFileName()
@@ -394,3 +437,3 @@ void SMTPaccount::read()
394 user = conf->readEntry( "User" ); 437 user = conf->readEntry( "User" );
395 //password = conf->readEntryCrypt( "Password" ); 438 signature = conf->readEntry( "SigFile" );
396 setPasswordList( conf->readListEntry( "FolderHistory")); 439 setPasswordList( conf->readListEntry( "FolderHistory"));
@@ -412,2 +455,3 @@ void SMTPaccount::save()
412 conf->writeEntry( "User", user ); 455 conf->writeEntry( "User", user );
456 conf->writeEntry( "SigFile", signature );
413 //conf->writeEntryCrypt( "Password", password ); 457 //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:
129 129
130 void setSigFile( QString b ) { signature = b; }
131 QString getSigFile() { return signature; }
132
133 QString getSignature();
134 void setSignature( QString b );
135
130private: 136private:
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 ) {
43#else 43#else
44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/"; 44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/icons22/";
45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 45 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 )
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
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 @@
14 <y>0</y> 14 <y>0</y>
15 <width>331</width> 15 <width>266</width>
16 <height>426</height> 16 <height>365</height>
17 </rect> 17 </rect>
@@ -31,3 +31,3 @@
31 <name>margin</name> 31 <name>margin</name>
32 <number>3</number> 32 <number>5</number>
33 </property> 33 </property>
@@ -35,3 +35,3 @@
35 <name>spacing</name> 35 <name>spacing</name>
36 <number>3</number> 36 <number>2</number>
37 </property> 37 </property>
@@ -60,20 +60,2 @@
60 <widget> 60 <widget>
61 <class>Line</class>
62 <property stdset="1">
63 <name>name</name>
64 <cstring>line1</cstring>
65 </property>
66 <property stdset="1">
67 <name>sizePolicy</name>
68 <sizepolicy>
69 <hsizetype>1</hsizetype>
70 <vsizetype>0</vsizetype>
71 </sizepolicy>
72 </property>
73 <property stdset="1">
74 <name>orientation</name>
75 <enum>Horizontal</enum>
76 </property>
77 </widget>
78 <widget>
79 <class>QLayoutWidget</class> 61 <class>QLayoutWidget</class>
@@ -202,20 +184,2 @@
202 <widget> 184 <widget>
203 <class>Line</class>
204 <property stdset="1">
205 <name>name</name>
206 <cstring>line2</cstring>
207 </property>
208 <property stdset="1">
209 <name>sizePolicy</name>
210 <sizepolicy>
211 <hsizetype>1</hsizetype>
212 <vsizetype>0</vsizetype>
213 </sizepolicy>
214 </property>
215 <property stdset="1">
216 <name>orientation</name>
217 <enum>Horizontal</enum>
218 </property>
219 </widget>
220 <widget>
221 <class>QCheckBox</class> 185 <class>QCheckBox</class>
@@ -329,2 +293,55 @@
329 </widget> 293 </widget>
294 <widget>
295 <class>QLayoutWidget</class>
296 <property stdset="1">
297 <name>name</name>
298 <cstring>Layout7</cstring>
299 </property>
300 <hbox>
301 <property stdset="1">
302 <name>margin</name>
303 <number>0</number>
304 </property>
305 <property stdset="1">
306 <name>spacing</name>
307 <number>6</number>
308 </property>
309 <widget>
310 <class>QLabel</class>
311 <property stdset="1">
312 <name>name</name>
313 <cstring>TextLabel1_2</cstring>
314 </property>
315 <property stdset="1">
316 <name>text</name>
317 <string>Signatur File</string>
318 </property>
319 </widget>
320 <widget>
321 <class>QLineEdit</class>
322 <property stdset="1">
323 <name>name</name>
324 <cstring>SignaturEdit</cstring>
325 </property>
326 </widget>
327 <widget>
328 <class>QPushButton</class>
329 <property stdset="1">
330 <name>name</name>
331 <cstring>SignaturButton</cstring>
332 </property>
333 <property stdset="1">
334 <name>sizePolicy</name>
335 <sizepolicy>
336 <hsizetype>1</hsizetype>
337 <vsizetype>1</vsizetype>
338 </sizepolicy>
339 </property>
340 <property stdset="1">
341 <name>text</name>
342 <string>F</string>
343 </property>
344 </widget>
345 </hbox>
346 </widget>
330 <spacer> 347 <spacer>