summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-21 13:29:48 (UTC)
committer harlekin <harlekin>2003-12-21 13:29:48 (UTC)
commit1281563b998508efeaa63739fb2c7c92e8316e9c (patch) (unidiff)
treeff9aa7202b0fa81e0eec727414aef69ba82b7780
parent228ff69db6e535a872a0f397ba157f832567af80 (diff)
downloadopie-1281563b998508efeaa63739fb2c7c92e8316e9c.zip
opie-1281563b998508efeaa63739fb2c7c92e8316e9c.tar.gz
opie-1281563b998508efeaa63739fb2c7c92e8316e9c.tar.bz2
send mail later/ enqueue gui side implementation
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp11
-rw-r--r--noncore/net/mail/composemailui.ui21
-rw-r--r--noncore/net/mail/settingsdialog.cpp6
-rw-r--r--noncore/net/mail/settingsdialogui.ui50
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,48 +1,54 @@
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
9ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 10ComposeMail::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
44void ComposeMail::pickAddress( QLineEdit *line ) 50void 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 );
@@ -140,32 +146,37 @@ void ComposeMail::addAttachment()
140 } 146 }
141} 147}
142 148
143void ComposeMail::removeAttachment() 149void 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
154void ComposeMail::accept() 160void 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() );
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,82 +1,93 @@
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" >
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
8SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 8SettingsDialog::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
14SettingsDialog::~SettingsDialog() { 14SettingsDialog::~SettingsDialog() {
15 15
16} 16}
17 17
18void SettingsDialog::readConfig() { 18void 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
24void SettingsDialog::writeConfig() { 26void 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
31void SettingsDialog::accept() { 35void 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,30 +1,30 @@
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>
@@ -53,40 +53,40 @@
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>
@@ -94,23 +94,65 @@
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>