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 | |||
@@ -36,7 +36,8 @@ INTERFACES = editaccountsui.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 | ||
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,4 +1,5 @@ | |||
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 | ||
@@ -21,6 +22,12 @@ void SettingsDialog::readConfig() { | |||
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() { |
@@ -28,8 +35,12 @@ void SettingsDialog::writeConfig() { | |||
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() { |
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 | |||
@@ -11,7 +11,7 @@ | |||
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> |
@@ -152,6 +152,124 @@ | |||
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> |
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 | |||
@@ -68,8 +68,36 @@ void MailApplet::slotCheck() { | |||
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 | |||
@@ -11,7 +11,7 @@ class MailApplet : public QButton { | |||
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 *); |