-rw-r--r-- | noncore/net/mail/composemail.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/composemailui.ui | 21 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialog.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialogui.ui | 50 |
4 files changed, 78 insertions, 10 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index 048fa85..f680f5c 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -1,80 +1,86 @@ | |||
1 | #include <qt.h> | 1 | #include <qt.h> |
2 | 2 | ||
3 | #include <opie/ofiledialog.h> | 3 | #include <opie/ofiledialog.h> |
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | #include <qpe/config.h> | ||
5 | 6 | ||
6 | #include "composemail.h" | 7 | #include "composemail.h" |
7 | #include "smtpwrapper.h" | 8 | #include "smtpwrapper.h" |
8 | 9 | ||
9 | ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 10 | ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
10 | : ComposeMailUI( parent, name, modal, flags ) | 11 | : ComposeMailUI( parent, name, modal, flags ) |
11 | { | 12 | { |
12 | settings = s; | 13 | settings = s; |
13 | 14 | ||
15 | Config cfg( "mail" ); | ||
16 | cfg.setGroup( "Compose" ); | ||
17 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); | ||
18 | |||
14 | attList->addColumn( tr( "Name" ) ); | 19 | attList->addColumn( tr( "Name" ) ); |
15 | attList->addColumn( tr( "Size" ) ); | 20 | attList->addColumn( tr( "Size" ) ); |
16 | 21 | ||
17 | QList<Account> accounts = settings->getAccounts(); | 22 | QList<Account> accounts = settings->getAccounts(); |
18 | Account *it; | 23 | Account *it; |
19 | for ( it = accounts.first(); it; it = accounts.next() ) { | 24 | for ( it = accounts.first(); it; it = accounts.next() ) { |
20 | if ( it->getType().compare( "SMTP" ) == 0 ) { | 25 | if ( it->getType().compare( "SMTP" ) == 0 ) { |
21 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 26 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
22 | fromBox->insertItem( smtp->getMail() ); | 27 | fromBox->insertItem( smtp->getMail() ); |
23 | smtpAccounts.append( smtp ); | 28 | smtpAccounts.append( smtp ); |
24 | } | 29 | } |
25 | } | 30 | } |
26 | 31 | ||
27 | if ( smtpAccounts.count() > 0 ) { | 32 | if ( smtpAccounts.count() > 0 ) { |
28 | fillValues( fromBox->currentItem() ); | 33 | fillValues( fromBox->currentItem() ); |
29 | } else { | 34 | } else { |
30 | QMessageBox::information( this, tr( "Problem" ), | 35 | QMessageBox::information( this, tr( "Problem" ), |
31 | tr( "<p>Please create an SMTP account first.</p>" ), | 36 | tr( "<p>Please create an SMTP account first.</p>" ), |
32 | tr( "Ok" ) ); | 37 | tr( "Ok" ) ); |
38 | return; | ||
33 | } | 39 | } |
34 | 40 | ||
35 | connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); | 41 | connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); |
36 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 42 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
37 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); | 43 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); |
38 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); | 44 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); |
39 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); | 45 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); |
40 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 46 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
41 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 47 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
42 | } | 48 | } |
43 | 49 | ||
44 | void ComposeMail::pickAddress( QLineEdit *line ) | 50 | void ComposeMail::pickAddress( QLineEdit *line ) |
45 | { | 51 | { |
46 | QString names = AddressPicker::getNames(); | 52 | QString names = AddressPicker::getNames(); |
47 | if ( line->text().isEmpty() ) { | 53 | if ( line->text().isEmpty() ) { |
48 | line->setText( names ); | 54 | line->setText( names ); |
49 | } else if ( !names.isEmpty() ) { | 55 | } else if ( !names.isEmpty() ) { |
50 | line->setText( line->text() + ", " + names ); | 56 | line->setText( line->text() + ", " + names ); |
51 | } | 57 | } |
52 | } | 58 | } |
53 | 59 | ||
54 | 60 | ||
55 | void ComposeMail::setTo( const QString & to ) | 61 | void ComposeMail::setTo( const QString & to ) |
56 | { | 62 | { |
57 | /* QString toline; | 63 | /* QString toline; |
58 | QStringList toEntry = to; | 64 | QStringList toEntry = to; |
59 | for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) { | 65 | for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) { |
60 | toline += (*it); | 66 | toline += (*it); |
61 | } | 67 | } |
62 | toLine->setText( toline ); | 68 | toLine->setText( toline ); |
63 | */ | 69 | */ |
64 | toLine->setText( to ); | 70 | toLine->setText( to ); |
65 | } | 71 | } |
66 | 72 | ||
67 | void ComposeMail::setSubject( const QString & subject ) | 73 | void ComposeMail::setSubject( const QString & subject ) |
68 | { | 74 | { |
69 | subjectLine->setText( subject ); | 75 | subjectLine->setText( subject ); |
70 | } | 76 | } |
71 | 77 | ||
72 | void ComposeMail::setInReplyTo( const QString & messageId ) | 78 | void ComposeMail::setInReplyTo( const QString & messageId ) |
73 | { | 79 | { |
74 | 80 | ||
75 | } | 81 | } |
76 | 82 | ||
77 | void ComposeMail::setMessage( const QString & text ) | 83 | void ComposeMail::setMessage( const QString & text ) |
78 | { | 84 | { |
79 | message->setText( text ); | 85 | message->setText( text ); |
80 | } | 86 | } |
@@ -108,96 +114,101 @@ void ComposeMail::fillValues( int current ) | |||
108 | if ( smtp->getUseCC() ) { | 114 | if ( smtp->getUseCC() ) { |
109 | ccLine->setText( smtp->getCC() ); | 115 | ccLine->setText( smtp->getCC() ); |
110 | } | 116 | } |
111 | bccLine->clear(); | 117 | bccLine->clear(); |
112 | if ( smtp->getUseBCC() ) { | 118 | if ( smtp->getUseBCC() ) { |
113 | bccLine->setText( smtp->getBCC() ); | 119 | bccLine->setText( smtp->getBCC() ); |
114 | } | 120 | } |
115 | replyLine->clear(); | 121 | replyLine->clear(); |
116 | if ( smtp->getUseReply() ) { | 122 | if ( smtp->getUseReply() ) { |
117 | replyLine->setText( smtp->getReply() ); | 123 | replyLine->setText( smtp->getReply() ); |
118 | } | 124 | } |
119 | 125 | ||
120 | sigMultiLine->setText( smtp->getSignature() ); | 126 | sigMultiLine->setText( smtp->getSignature() ); |
121 | } | 127 | } |
122 | 128 | ||
123 | void ComposeMail::slotAdjustColumns() | 129 | void ComposeMail::slotAdjustColumns() |
124 | { | 130 | { |
125 | int currPage = tabWidget->currentPageIndex(); | 131 | int currPage = tabWidget->currentPageIndex(); |
126 | 132 | ||
127 | tabWidget->showPage( attachTab ); | 133 | tabWidget->showPage( attachTab ); |
128 | attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); | 134 | attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); |
129 | attList->setColumnWidth( 1, 80 ); | 135 | attList->setColumnWidth( 1, 80 ); |
130 | 136 | ||
131 | tabWidget->setCurrentPage( currPage ); | 137 | tabWidget->setCurrentPage( currPage ); |
132 | } | 138 | } |
133 | 139 | ||
134 | void ComposeMail::addAttachment() | 140 | void ComposeMail::addAttachment() |
135 | { | 141 | { |
136 | DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" ); | 142 | DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" ); |
137 | if ( !lnk.name().isEmpty() ) { | 143 | if ( !lnk.name().isEmpty() ) { |
138 | Attachment *att = new Attachment( lnk ); | 144 | Attachment *att = new Attachment( lnk ); |
139 | (void) new AttachViewItem( attList, att ); | 145 | (void) new AttachViewItem( attList, att ); |
140 | } | 146 | } |
141 | } | 147 | } |
142 | 148 | ||
143 | void ComposeMail::removeAttachment() | 149 | void ComposeMail::removeAttachment() |
144 | { | 150 | { |
145 | if ( !attList->currentItem() ) { | 151 | if ( !attList->currentItem() ) { |
146 | QMessageBox::information( this, tr( "Error" ), | 152 | QMessageBox::information( this, tr( "Error" ), |
147 | tr( "<p>Please select a File.</p>" ), | 153 | tr( "<p>Please select a File.</p>" ), |
148 | tr( "Ok" ) ); | 154 | tr( "Ok" ) ); |
149 | } else { | 155 | } else { |
150 | attList->takeItem( attList->currentItem() ); | 156 | attList->takeItem( attList->currentItem() ); |
151 | } | 157 | } |
152 | } | 158 | } |
153 | 159 | ||
154 | void ComposeMail::accept() | 160 | void ComposeMail::accept() |
155 | { | 161 | { |
162 | if ( checkBoxLater->isChecked() ) { | ||
163 | qDebug( "Send later" ); | ||
164 | } | ||
165 | |||
166 | |||
156 | qDebug( "Sending Mail with " + | 167 | qDebug( "Sending Mail with " + |
157 | smtpAccounts.at( fromBox->currentItem() )->getAccountName() ); | 168 | smtpAccounts.at( fromBox->currentItem() )->getAccountName() ); |
158 | Mail *mail = new Mail(); | 169 | Mail *mail = new Mail(); |
159 | SMTPaccount *smtp = smtpAccounts.at( fromBox->currentItem() ); | 170 | SMTPaccount *smtp = smtpAccounts.at( fromBox->currentItem() ); |
160 | mail->setMail( smtp->getMail() ); | 171 | mail->setMail( smtp->getMail() ); |
161 | mail->setName( smtp->getName() ); | 172 | mail->setName( smtp->getName() ); |
162 | 173 | ||
163 | if ( !toLine->text().isEmpty() ) { | 174 | if ( !toLine->text().isEmpty() ) { |
164 | mail->setTo( toLine->text() ); | 175 | mail->setTo( toLine->text() ); |
165 | } else { | 176 | } else { |
166 | qDebug( "No Reciever spezified -> returning" ); | 177 | qDebug( "No Reciever spezified -> returning" ); |
167 | return; | 178 | return; |
168 | } | 179 | } |
169 | 180 | ||
170 | mail->setCC( ccLine->text() ); | 181 | mail->setCC( ccLine->text() ); |
171 | mail->setBCC( bccLine->text() ); | 182 | mail->setBCC( bccLine->text() ); |
172 | mail->setReply( replyLine->text() ); | 183 | mail->setReply( replyLine->text() ); |
173 | mail->setSubject( subjectLine->text() ); | 184 | mail->setSubject( subjectLine->text() ); |
174 | QString txt = message->text(); | 185 | QString txt = message->text(); |
175 | if ( !sigMultiLine->text().isEmpty() ) { | 186 | if ( !sigMultiLine->text().isEmpty() ) { |
176 | txt.append( "\n--\n" ); | 187 | txt.append( "\n--\n" ); |
177 | txt.append( sigMultiLine->text() ); | 188 | txt.append( sigMultiLine->text() ); |
178 | } | 189 | } |
179 | mail->setMessage( txt ); | 190 | mail->setMessage( txt ); |
180 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); | 191 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); |
181 | while ( it != NULL ) { | 192 | while ( it != NULL ) { |
182 | mail->addAttachment( it->getAttachment() ); | 193 | mail->addAttachment( it->getAttachment() ); |
183 | it = (AttachViewItem *) it->itemBelow(); | 194 | it = (AttachViewItem *) it->itemBelow(); |
184 | } | 195 | } |
185 | 196 | ||
186 | SMTPwrapper wrapper( settings ); | 197 | SMTPwrapper wrapper( settings ); |
187 | wrapper.sendMail( *mail ); | 198 | wrapper.sendMail( *mail ); |
188 | 199 | ||
189 | QDialog::accept(); | 200 | QDialog::accept(); |
190 | } | 201 | } |
191 | 202 | ||
192 | AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) | 203 | AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) |
193 | : QListViewItem( parent ) | 204 | : QListViewItem( parent ) |
194 | { | 205 | { |
195 | attachment = att; | 206 | attachment = att; |
196 | qDebug( att->getMimeType() ); | 207 | qDebug( att->getMimeType() ); |
197 | setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ? | 208 | setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ? |
198 | Resource::loadPixmap( "UnknownDocument-14" ) : | 209 | Resource::loadPixmap( "UnknownDocument-14" ) : |
199 | attachment->getDocLnk().pixmap() ); | 210 | attachment->getDocLnk().pixmap() ); |
200 | setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); | 211 | setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); |
201 | setText( 1, QString::number( att->getSize() ) ); | 212 | setText( 1, QString::number( att->getSize() ) ); |
202 | } | 213 | } |
203 | 214 | ||
diff --git a/noncore/net/mail/composemailui.ui b/noncore/net/mail/composemailui.ui index 9f5feb9..4d225e4 100644 --- a/noncore/net/mail/composemailui.ui +++ b/noncore/net/mail/composemailui.ui | |||
@@ -1,114 +1,125 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>ComposeMailUI</class> | 2 | <class>ComposeMailUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>ComposeMailUI</cstring> | 7 | <cstring>ComposeMailUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>264</width> | 14 | <width>260</width> |
15 | <height>360</height> | 15 | <height>360</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Compose Message</string> | 20 | <string>Compose Message</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>0</number> | 31 | <number>3</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>0</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QCheckBox</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>checkBoxLater</cstring> | ||
42 | </property> | ||
43 | <property stdset="1"> | ||
44 | <name>text</name> | ||
45 | <string>send later</string> | ||
46 | </property> | ||
47 | </widget> | ||
48 | <widget> | ||
38 | <class>QTabWidget</class> | 49 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 50 | <property stdset="1"> |
40 | <name>name</name> | 51 | <name>name</name> |
41 | <cstring>tabWidget</cstring> | 52 | <cstring>tabWidget</cstring> |
42 | </property> | 53 | </property> |
43 | <property> | 54 | <property> |
44 | <name>layoutMargin</name> | 55 | <name>layoutMargin</name> |
45 | </property> | 56 | </property> |
46 | <property> | 57 | <property> |
47 | <name>layoutSpacing</name> | 58 | <name>layoutSpacing</name> |
48 | </property> | 59 | </property> |
49 | <widget> | 60 | <widget> |
50 | <class>QWidget</class> | 61 | <class>QWidget</class> |
51 | <property stdset="1"> | 62 | <property stdset="1"> |
52 | <name>name</name> | 63 | <name>name</name> |
53 | <cstring>mailTab</cstring> | 64 | <cstring>mailTab</cstring> |
54 | </property> | 65 | </property> |
55 | <attribute> | 66 | <attribute> |
56 | <name>title</name> | 67 | <name>title</name> |
57 | <string>Mail</string> | 68 | <string>Mail</string> |
58 | </attribute> | 69 | </attribute> |
59 | <grid> | 70 | <grid> |
60 | <property stdset="1"> | 71 | <property stdset="1"> |
61 | <name>margin</name> | 72 | <name>margin</name> |
62 | <number>4</number> | 73 | <number>-1</number> |
63 | </property> | 74 | </property> |
64 | <property stdset="1"> | 75 | <property stdset="1"> |
65 | <name>spacing</name> | 76 | <name>spacing</name> |
66 | <number>3</number> | 77 | <number>-1</number> |
67 | </property> | 78 | </property> |
68 | <widget row="2" column="1" > | 79 | <widget row="2" column="1" > |
69 | <class>QLineEdit</class> | 80 | <class>QLineEdit</class> |
70 | <property stdset="1"> | 81 | <property stdset="1"> |
71 | <name>name</name> | 82 | <name>name</name> |
72 | <cstring>subjectLine</cstring> | 83 | <cstring>subjectLine</cstring> |
73 | </property> | 84 | </property> |
74 | </widget> | 85 | </widget> |
75 | <widget row="3" column="0" rowspan="1" colspan="2" > | 86 | <widget row="3" column="0" rowspan="1" colspan="2" > |
76 | <class>QMultiLineEdit</class> | 87 | <class>QMultiLineEdit</class> |
77 | <property stdset="1"> | 88 | <property stdset="1"> |
78 | <name>name</name> | 89 | <name>name</name> |
79 | <cstring>message</cstring> | 90 | <cstring>message</cstring> |
80 | </property> | 91 | </property> |
81 | </widget> | 92 | </widget> |
82 | <widget row="2" column="0" > | 93 | <widget row="2" column="0" > |
83 | <class>QLabel</class> | 94 | <class>QLabel</class> |
84 | <property stdset="1"> | 95 | <property stdset="1"> |
85 | <name>name</name> | 96 | <name>name</name> |
86 | <cstring>subjectLabel</cstring> | 97 | <cstring>subjectLabel</cstring> |
87 | </property> | 98 | </property> |
88 | <property stdset="1"> | 99 | <property stdset="1"> |
89 | <name>text</name> | 100 | <name>text</name> |
90 | <string>Subject</string> | 101 | <string>Subject</string> |
91 | </property> | 102 | </property> |
92 | </widget> | 103 | </widget> |
93 | <widget row="0" column="0" > | 104 | <widget row="0" column="0" > |
94 | <class>QLabel</class> | 105 | <class>QLabel</class> |
95 | <property stdset="1"> | 106 | <property stdset="1"> |
96 | <name>name</name> | 107 | <name>name</name> |
97 | <cstring>fromLabel</cstring> | 108 | <cstring>fromLabel</cstring> |
98 | </property> | 109 | </property> |
99 | <property stdset="1"> | 110 | <property stdset="1"> |
100 | <name>text</name> | 111 | <name>text</name> |
101 | <string>From</string> | 112 | <string>From</string> |
102 | </property> | 113 | </property> |
103 | </widget> | 114 | </widget> |
104 | <widget row="1" column="1" > | 115 | <widget row="1" column="1" > |
105 | <class>QLineEdit</class> | 116 | <class>QLineEdit</class> |
106 | <property stdset="1"> | 117 | <property stdset="1"> |
107 | <name>name</name> | 118 | <name>name</name> |
108 | <cstring>toLine</cstring> | 119 | <cstring>toLine</cstring> |
109 | </property> | 120 | </property> |
110 | </widget> | 121 | </widget> |
111 | <widget row="0" column="1" > | 122 | <widget row="0" column="1" > |
112 | <class>QComboBox</class> | 123 | <class>QComboBox</class> |
113 | <property stdset="1"> | 124 | <property stdset="1"> |
114 | <name>name</name> | 125 | <name>name</name> |
diff --git a/noncore/net/mail/settingsdialog.cpp b/noncore/net/mail/settingsdialog.cpp index 9741e94..f9de405 100644 --- a/noncore/net/mail/settingsdialog.cpp +++ b/noncore/net/mail/settingsdialog.cpp | |||
@@ -1,34 +1,38 @@ | |||
1 | #include <qradiobutton.h> | 1 | #include <qcheckbox.h> |
2 | 2 | ||
3 | #include <qpe/config.h> | 3 | #include <qpe/config.h> |
4 | 4 | ||
5 | #include "settingsdialog.h" | 5 | #include "settingsdialog.h" |
6 | 6 | ||
7 | 7 | ||
8 | SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 8 | SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
9 | : SettingsDialogUI( parent, name, modal, fl ) { | 9 | : SettingsDialogUI( parent, name, modal, fl ) { |
10 | 10 | ||
11 | readConfig(); | 11 | readConfig(); |
12 | } | 12 | } |
13 | 13 | ||
14 | SettingsDialog::~SettingsDialog() { | 14 | SettingsDialog::~SettingsDialog() { |
15 | 15 | ||
16 | } | 16 | } |
17 | 17 | ||
18 | void SettingsDialog::readConfig() { | 18 | void SettingsDialog::readConfig() { |
19 | Config cfg("mail"); | 19 | Config cfg("mail"); |
20 | cfg.setGroup( "Settings" ); | 20 | cfg.setGroup( "Settings" ); |
21 | showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); | 21 | showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); |
22 | cfg.setGroup( "Compose" ); | ||
23 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); | ||
22 | } | 24 | } |
23 | 25 | ||
24 | void SettingsDialog::writeConfig() { | 26 | void SettingsDialog::writeConfig() { |
25 | Config cfg( "mail" ); | 27 | Config cfg( "mail" ); |
26 | cfg.setGroup( "Settings" ); | 28 | cfg.setGroup( "Settings" ); |
27 | cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); | 29 | cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); |
30 | cfg.setGroup( "Compose" ); | ||
31 | cfg.writeEntry( "sendLater", checkBoxLater->isChecked() );; | ||
28 | 32 | ||
29 | } | 33 | } |
30 | 34 | ||
31 | void SettingsDialog::accept() { | 35 | void SettingsDialog::accept() { |
32 | writeConfig(); | 36 | writeConfig(); |
33 | QDialog::accept(); | 37 | QDialog::accept(); |
34 | } | 38 | } |
diff --git a/noncore/net/mail/settingsdialogui.ui b/noncore/net/mail/settingsdialogui.ui index 3b03aeb..c5589dc 100644 --- a/noncore/net/mail/settingsdialogui.ui +++ b/noncore/net/mail/settingsdialogui.ui | |||
@@ -1,116 +1,158 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>SettingsDialogUI</class> | 2 | <class>SettingsDialogUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>SettingsDialogUI</cstring> | 7 | <cstring>SettingsDialogUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>328</width> | 14 | <width>324</width> |
15 | <height>379</height> | 15 | <height>379</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Settings Dialog</string> | 20 | <string>Settings Dialog</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>3</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget2</cstring> | 41 | <cstring>TabWidget2</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutMargin</name> | 44 | <name>layoutMargin</name> |
45 | </property> | 45 | </property> |
46 | <property> | 46 | <property> |
47 | <name>layoutSpacing</name> | 47 | <name>layoutSpacing</name> |
48 | </property> | 48 | </property> |
49 | <widget> | 49 | <widget> |
50 | <class>QWidget</class> | 50 | <class>QWidget</class> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>name</name> | 52 | <name>name</name> |
53 | <cstring>tab</cstring> | 53 | <cstring>tab</cstring> |
54 | </property> | 54 | </property> |
55 | <attribute> | 55 | <attribute> |
56 | <name>title</name> | 56 | <name>title</name> |
57 | <string>View Mail</string> | 57 | <string>View Mail</string> |
58 | </attribute> | 58 | </attribute> |
59 | <vbox> | 59 | <vbox> |
60 | <property stdset="1"> | 60 | <property stdset="1"> |
61 | <name>margin</name> | 61 | <name>margin</name> |
62 | <number>3</number> | 62 | <number>3</number> |
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>3</number> | 66 | <number>3</number> |
67 | </property> | 67 | </property> |
68 | <widget> | 68 | <widget> |
69 | <class>QRadioButton</class> | 69 | <class>QCheckBox</class> |
70 | <property stdset="1"> | 70 | <property stdset="1"> |
71 | <name>name</name> | 71 | <name>name</name> |
72 | <cstring>showHtmlButton</cstring> | 72 | <cstring>showHtmlButton</cstring> |
73 | </property> | 73 | </property> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>text</name> | 75 | <name>text</name> |
76 | <string>View mail as Html </string> | 76 | <string>View mail as Html</string> |
77 | </property> | 77 | </property> |
78 | </widget> | 78 | </widget> |
79 | <spacer> | 79 | <spacer> |
80 | <property> | 80 | <property> |
81 | <name>name</name> | 81 | <name>name</name> |
82 | <cstring>Spacer1</cstring> | 82 | <cstring>Spacer1</cstring> |
83 | </property> | 83 | </property> |
84 | <property stdset="1"> | 84 | <property stdset="1"> |
85 | <name>orientation</name> | 85 | <name>orientation</name> |
86 | <enum>Vertical</enum> | 86 | <enum>Vertical</enum> |
87 | </property> | 87 | </property> |
88 | <property stdset="1"> | 88 | <property stdset="1"> |
89 | <name>sizeType</name> | 89 | <name>sizeType</name> |
90 | <enum>Expanding</enum> | 90 | <enum>Expanding</enum> |
91 | </property> | 91 | </property> |
92 | <property> | 92 | <property> |
93 | <name>sizeHint</name> | 93 | <name>sizeHint</name> |
94 | <size> | 94 | <size> |
95 | <width>20</width> | 95 | <width>20</width> |
96 | <height>20</height> | 96 | <height>20</height> |
97 | </size> | 97 | </size> |
98 | </property> | 98 | </property> |
99 | </spacer> | 99 | </spacer> |
100 | </vbox> | 100 | </vbox> |
101 | </widget> | 101 | </widget> |
102 | <widget> | 102 | <widget> |
103 | <class>QWidget</class> | 103 | <class>QWidget</class> |
104 | <property stdset="1"> | 104 | <property stdset="1"> |
105 | <name>name</name> | 105 | <name>name</name> |
106 | <cstring>tab</cstring> | 106 | <cstring>tab</cstring> |
107 | </property> | 107 | </property> |
108 | <attribute> | 108 | <attribute> |
109 | <name>title</name> | 109 | <name>title</name> |
110 | <string>Tab 2</string> | 110 | <string>Compose Mail</string> |
111 | </attribute> | 111 | </attribute> |
112 | <vbox> | ||
113 | <property stdset="1"> | ||
114 | <name>margin</name> | ||
115 | <number>3</number> | ||
116 | </property> | ||
117 | <property stdset="1"> | ||
118 | <name>spacing</name> | ||
119 | <number>3</number> | ||
120 | </property> | ||
121 | <widget> | ||
122 | <class>QCheckBox</class> | ||
123 | <property stdset="1"> | ||
124 | <name>name</name> | ||
125 | <cstring>checkBoxLater</cstring> | ||
126 | </property> | ||
127 | <property stdset="1"> | ||
128 | <name>text</name> | ||
129 | <string>Send mails later ( enqueue in outbox )</string> | ||
130 | </property> | ||
131 | </widget> | ||
132 | <spacer> | ||
133 | <property> | ||
134 | <name>name</name> | ||
135 | <cstring>Spacer2</cstring> | ||
136 | </property> | ||
137 | <property stdset="1"> | ||
138 | <name>orientation</name> | ||
139 | <enum>Vertical</enum> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>sizeType</name> | ||
143 | <enum>Expanding</enum> | ||
144 | </property> | ||
145 | <property> | ||
146 | <name>sizeHint</name> | ||
147 | <size> | ||
148 | <width>20</width> | ||
149 | <height>20</height> | ||
150 | </size> | ||
151 | </property> | ||
152 | </spacer> | ||
153 | </vbox> | ||
112 | </widget> | 154 | </widget> |
113 | </widget> | 155 | </widget> |
114 | </vbox> | 156 | </vbox> |
115 | </widget> | 157 | </widget> |
116 | </UI> | 158 | </UI> |