author | harlekin <harlekin> | 2004-01-04 15:47:32 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-01-04 15:47:32 (UTC) |
commit | 59fee003137f5fd7782e3a42159e53424d100e67 (patch) (unidiff) | |
tree | dae5f375349ff02ac96f9bd309aeea52837003cd | |
parent | 5c4c2a789c19e727bb9ca323ea1fec1b7d1bd057 (diff) | |
download | opie-59fee003137f5fd7782e3a42159e53424d100e67.zip opie-59fee003137f5fd7782e3a42159e53424d100e67.tar.gz opie-59fee003137f5fd7782e3a42159e53424d100e67.tar.bz2 |
config taskbar applet
-rw-r--r-- | noncore/net/mail/mail.pro | 3 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialog.cpp | 15 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialogui.ui | 120 | ||||
-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.cpp | 32 | ||||
-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.h | 2 |
5 files changed, 165 insertions, 7 deletions
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro index a96c88e..96ffaa8 100644 --- a/noncore/net/mail/mail.pro +++ b/noncore/net/mail/mail.pro | |||
@@ -35,9 +35,10 @@ INTERFACES = editaccountsui.ui \ | |||
35 | addresspickerui.ui \ | 35 | addresspickerui.ui \ |
36 | composemailui.ui \ | 36 | composemailui.ui \ |
37 | settingsdialogui.ui \ | 37 | settingsdialogui.ui \ |
38 | statuswidgetui.ui \ | 38 | statuswidgetui.ui \ |
39 | newmaildirui.ui | 39 | newmaildirui.ui |
40 | |||
40 | 41 | ||
41 | INCLUDEPATH += $(OPIEDIR)/include | 42 | INCLUDEPATH += $(OPIEDIR)/include |
42 | 43 | ||
43 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) | 44 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) |
diff --git a/noncore/net/mail/settingsdialog.cpp b/noncore/net/mail/settingsdialog.cpp index f9de405..061ea72 100644 --- a/noncore/net/mail/settingsdialog.cpp +++ b/noncore/net/mail/settingsdialog.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <qcheckbox.h> | 1 | #include <qcheckbox.h> |
2 | #include <qspinbox.h> | ||
2 | 3 | ||
3 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
4 | 5 | ||
5 | #include "settingsdialog.h" | 6 | #include "settingsdialog.h" |
@@ -20,17 +21,27 @@ void SettingsDialog::readConfig() { | |||
20 | cfg.setGroup( "Settings" ); | 21 | cfg.setGroup( "Settings" ); |
21 | showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); | 22 | showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); |
22 | cfg.setGroup( "Compose" ); | 23 | cfg.setGroup( "Compose" ); |
23 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); | 24 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); |
25 | cfg.setGroup( "Applet" ); | ||
26 | cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) ); | ||
27 | spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) ); | ||
28 | cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) ); | ||
29 | cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) ); | ||
30 | |||
24 | } | 31 | } |
25 | 32 | ||
26 | void SettingsDialog::writeConfig() { | 33 | void SettingsDialog::writeConfig() { |
27 | Config cfg( "mail" ); | 34 | Config cfg( "mail" ); |
28 | cfg.setGroup( "Settings" ); | 35 | cfg.setGroup( "Settings" ); |
29 | cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); | 36 | cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); |
30 | cfg.setGroup( "Compose" ); | 37 | cfg.setGroup( "Compose" ); |
31 | cfg.writeEntry( "sendLater", checkBoxLater->isChecked() );; | 38 | cfg.writeEntry( "sendLater", checkBoxLater->isChecked() ); |
32 | 39 | cfg.setGroup( "Applet" ); | |
40 | cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() ); | ||
41 | cfg.writeEntry( "CheckEvery", spCheckOften->value() ); | ||
42 | cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() ); | ||
43 | cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() ); | ||
33 | } | 44 | } |
34 | 45 | ||
35 | void SettingsDialog::accept() { | 46 | void SettingsDialog::accept() { |
36 | writeConfig(); | 47 | writeConfig(); |
diff --git a/noncore/net/mail/settingsdialogui.ui b/noncore/net/mail/settingsdialogui.ui index c5589dc..a078168 100644 --- a/noncore/net/mail/settingsdialogui.ui +++ b/noncore/net/mail/settingsdialogui.ui | |||
@@ -10,9 +10,9 @@ | |||
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>324</width> | 14 | <width>320</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"> |
@@ -151,8 +151,126 @@ | |||
151 | </property> | 151 | </property> |
152 | </spacer> | 152 | </spacer> |
153 | </vbox> | 153 | </vbox> |
154 | </widget> | 154 | </widget> |
155 | <widget> | ||
156 | <class>QWidget</class> | ||
157 | <property stdset="1"> | ||
158 | <name>name</name> | ||
159 | <cstring>tab</cstring> | ||
160 | </property> | ||
161 | <attribute> | ||
162 | <name>title</name> | ||
163 | <string>Taskbar Applet</string> | ||
164 | </attribute> | ||
165 | <vbox> | ||
166 | <property stdset="1"> | ||
167 | <name>margin</name> | ||
168 | <number>3</number> | ||
169 | </property> | ||
170 | <property stdset="1"> | ||
171 | <name>spacing</name> | ||
172 | <number>3</number> | ||
173 | </property> | ||
174 | <widget> | ||
175 | <class>QCheckBox</class> | ||
176 | <property stdset="1"> | ||
177 | <name>name</name> | ||
178 | <cstring>cbEnableTaskbarApplet</cstring> | ||
179 | </property> | ||
180 | <property stdset="1"> | ||
181 | <name>text</name> | ||
182 | <string>Enable Taskbar Applet</string> | ||
183 | </property> | ||
184 | </widget> | ||
185 | <widget> | ||
186 | <class>QLayoutWidget</class> | ||
187 | <property stdset="1"> | ||
188 | <name>name</name> | ||
189 | <cstring>Layout2</cstring> | ||
190 | </property> | ||
191 | <hbox> | ||
192 | <property stdset="1"> | ||
193 | <name>margin</name> | ||
194 | <number>0</number> | ||
195 | </property> | ||
196 | <property stdset="1"> | ||
197 | <name>spacing</name> | ||
198 | <number>6</number> | ||
199 | </property> | ||
200 | <widget> | ||
201 | <class>QSpinBox</class> | ||
202 | <property stdset="1"> | ||
203 | <name>name</name> | ||
204 | <cstring>spCheckOften</cstring> | ||
205 | </property> | ||
206 | <property stdset="1"> | ||
207 | <name>suffix</name> | ||
208 | <string> min</string> | ||
209 | </property> | ||
210 | <property stdset="1"> | ||
211 | <name>value</name> | ||
212 | <number>5</number> | ||
213 | </property> | ||
214 | </widget> | ||
215 | <widget> | ||
216 | <class>QLabel</class> | ||
217 | <property stdset="1"> | ||
218 | <name>name</name> | ||
219 | <cstring>TextLabel1</cstring> | ||
220 | </property> | ||
221 | <property stdset="1"> | ||
222 | <name>text</name> | ||
223 | <string>Check how often</string> | ||
224 | </property> | ||
225 | </widget> | ||
226 | </hbox> | ||
227 | </widget> | ||
228 | <widget> | ||
229 | <class>QCheckBox</class> | ||
230 | <property stdset="1"> | ||
231 | <name>name</name> | ||
232 | <cstring>cbBlinkLed</cstring> | ||
233 | </property> | ||
234 | <property stdset="1"> | ||
235 | <name>text</name> | ||
236 | <string>Blink Led when new mails arrive</string> | ||
237 | </property> | ||
238 | </widget> | ||
239 | <widget> | ||
240 | <class>QCheckBox</class> | ||
241 | <property stdset="1"> | ||
242 | <name>name</name> | ||
243 | <cstring>cbPlaySound</cstring> | ||
244 | </property> | ||
245 | <property stdset="1"> | ||
246 | <name>text</name> | ||
247 | <string>Play Sound when new mails arrive</string> | ||
248 | </property> | ||
249 | </widget> | ||
250 | <spacer> | ||
251 | <property> | ||
252 | <name>name</name> | ||
253 | <cstring>Spacer3</cstring> | ||
254 | </property> | ||
255 | <property stdset="1"> | ||
256 | <name>orientation</name> | ||
257 | <enum>Vertical</enum> | ||
258 | </property> | ||
259 | <property stdset="1"> | ||
260 | <name>sizeType</name> | ||
261 | <enum>Expanding</enum> | ||
262 | </property> | ||
263 | <property> | ||
264 | <name>sizeHint</name> | ||
265 | <size> | ||
266 | <width>20</width> | ||
267 | <height>20</height> | ||
268 | </size> | ||
269 | </property> | ||
270 | </spacer> | ||
271 | </vbox> | ||
272 | </widget> | ||
155 | </widget> | 273 | </widget> |
156 | </vbox> | 274 | </vbox> |
157 | </widget> | 275 | </widget> |
158 | </UI> | 276 | </UI> |
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp index f3550c7..8bf4b89 100644 --- a/noncore/net/mail/taskbarapplet/mailapplet.cpp +++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp | |||
@@ -67,9 +67,37 @@ void MailApplet::slotCheck() { | |||
67 | m_intervalTimer->changeInterval( newIntervalMs ); | 67 | m_intervalTimer->changeInterval( newIntervalMs ); |
68 | m_intervalMs = newIntervalMs; | 68 | m_intervalMs = newIntervalMs; |
69 | } | 69 | } |
70 | 70 | ||
71 | int newMails = 0; | ||
72 | |||
73 | if ( true ) { | ||
74 | ODevice *device = ODevice::inst(); | ||
75 | if ( isHidden() ) show(); | ||
76 | if ( m_config->readBoolEntry( "BlinkLed", true ) ) { | ||
77 | if ( !device-> ledList ( ).isEmpty( ) ) { | ||
78 | OLed led = ( device->ledList( ).contains( Led_Mail ) ) ? Led_Mail : device->ledList( ) [0]; | ||
79 | device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); | ||
80 | } | ||
81 | } | ||
82 | if ( m_config->readBoolEntry( "PlaySound", false ) ) | ||
83 | device->alarmSound(); | ||
84 | |||
85 | Config cfg( "mail" ); | ||
86 | cfg.setGroup( "Status" ); | ||
87 | cfg.writeEntry( "NewMails", newMails ); // todo | ||
88 | |||
89 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); | ||
90 | env << newMails; | ||
91 | |||
92 | } else { | ||
93 | ODevice *device = ODevice::inst(); | ||
94 | if ( !isHidden() ) hide(); | ||
95 | if ( !device-> ledList( ).isEmpty( ) ) { | ||
96 | OLed led = ( device->ledList( ).contains( Led_Mail ) ) ? Led_Mail : device->ledList( ) [0]; | ||
97 | device->setLedState( led, Led_Off ); | ||
98 | } | ||
99 | } | ||
100 | |||
71 | // go trough accounts and check here | 101 | // go trough accounts and check here |
72 | // depending on result show or hide | ||
73 | // also trigger qcop call and save status to config | 102 | // also trigger qcop call and save status to config |
74 | // get led to blink | ||
75 | } | 103 | } |
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.h b/noncore/net/mail/taskbarapplet/mailapplet.h index 1c48b29..34bdc22 100644 --- a/noncore/net/mail/taskbarapplet/mailapplet.h +++ b/noncore/net/mail/taskbarapplet/mailapplet.h | |||
@@ -10,9 +10,9 @@ class MailApplet : public QButton { | |||
10 | 10 | ||
11 | Q_OBJECT | 11 | Q_OBJECT |
12 | 12 | ||
13 | public: | 13 | public: |
14 | MailApplet(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); | 14 | MailApplet( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); |
15 | 15 | ||
16 | protected: | 16 | protected: |
17 | void drawButton(QPainter *); | 17 | void drawButton(QPainter *); |
18 | void drawButtonText(QPainter *); | 18 | void drawButtonText(QPainter *); |