author | harlekin <harlekin> | 2003-12-21 13:29:48 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-21 13:29:48 (UTC) |
commit | 1281563b998508efeaa63739fb2c7c92e8316e9c (patch) (unidiff) | |
tree | ff9aa7202b0fa81e0eec727414aef69ba82b7780 | |
parent | 228ff69db6e535a872a0f397ba157f832567af80 (diff) | |
download | opie-1281563b998508efeaa63739fb2c7c92e8316e9c.zip opie-1281563b998508efeaa63739fb2c7c92e8316e9c.tar.gz opie-1281563b998508efeaa63739fb2c7c92e8316e9c.tar.bz2 |
send mail later/ enqueue gui side implementation
-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,21 +1,26 @@ | |||
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); |
@@ -25,16 +30,17 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
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() ) ); |
@@ -148,16 +154,21 @@ void ComposeMail::removeAttachment() | |||
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() ) { |
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 | |||
@@ -6,40 +6,51 @@ | |||
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> |
@@ -54,21 +65,21 @@ | |||
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> |
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,9 +1,9 @@ | |||
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 ) { |
@@ -14,21 +14,25 @@ SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, W | |||
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 | |||
@@ -6,17 +6,17 @@ | |||
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> |
@@ -61,24 +61,24 @@ | |||
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"> |
@@ -102,15 +102,57 @@ | |||
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> |