summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mail.pro3
-rw-r--r--noncore/net/mail/settingsdialog.cpp15
-rw-r--r--noncore/net/mail/settingsdialogui.ui120
-rw-r--r--noncore/net/mail/taskbarapplet/mailapplet.cpp32
-rw-r--r--noncore/net/mail/taskbarapplet/mailapplet.h2
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
@@ -37,5 +37,6 @@ INTERFACES = editaccountsui.ui \
settingsdialogui.ui \
statuswidgetui.ui \
- newmaildirui.ui
+ newmaildirui.ui
+
INCLUDEPATH += $(OPIEDIR)/include
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,3 +1,4 @@
#include <qcheckbox.h>
+#include <qspinbox.h>
#include <qpe/config.h>
@@ -22,4 +23,10 @@ void SettingsDialog::readConfig() {
cfg.setGroup( "Compose" );
checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
+ cfg.setGroup( "Applet" );
+ cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) );
+ spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) );
+ cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) );
+ cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) );
+
}
@@ -29,6 +36,10 @@ void SettingsDialog::writeConfig() {
cfg.writeEntry( "showHtml", showHtmlButton->isChecked() );
cfg.setGroup( "Compose" );
- cfg.writeEntry( "sendLater", checkBoxLater->isChecked() );;
-
+ cfg.writeEntry( "sendLater", checkBoxLater->isChecked() );
+ cfg.setGroup( "Applet" );
+ cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() );
+ cfg.writeEntry( "CheckEvery", spCheckOften->value() );
+ cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() );
+ cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() );
}
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
@@ -12,5 +12,5 @@
<x>0</x>
<y>0</y>
- <width>324</width>
+ <width>320</width>
<height>379</height>
</rect>
@@ -153,4 +153,122 @@
</vbox>
</widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Taskbar Applet</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>3</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>3</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>cbEnableTaskbarApplet</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Enable Taskbar Applet</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>spCheckOften</cstring>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string> min</string>
+ </property>
+ <property stdset="1">
+ <name>value</name>
+ <number>5</number>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Check how often</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>cbBlinkLed</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Blink Led when new mails arrive</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>cbPlaySound</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Play Sound when new mails arrive</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
</widget>
</vbox>
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
@@ -69,7 +69,35 @@ void MailApplet::slotCheck() {
}
+ int newMails = 0;
+
+ if ( true ) {
+ ODevice *device = ODevice::inst();
+ if ( isHidden() ) show();
+ if ( m_config->readBoolEntry( "BlinkLed", true ) ) {
+ if ( !device-> ledList ( ).isEmpty( ) ) {
+ OLed led = ( device->ledList( ).contains( Led_Mail ) ) ? Led_Mail : device->ledList( ) [0];
+ device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On );
+ }
+ }
+ if ( m_config->readBoolEntry( "PlaySound", false ) )
+ device->alarmSound();
+
+ Config cfg( "mail" );
+ cfg.setGroup( "Status" );
+ cfg.writeEntry( "NewMails", newMails ); // todo
+
+ QCopEnvelope env( "QPE/Pim", "newMails(int)" );
+ env << newMails;
+
+ } else {
+ ODevice *device = ODevice::inst();
+ if ( !isHidden() ) hide();
+ if ( !device-> ledList( ).isEmpty( ) ) {
+ OLed led = ( device->ledList( ).contains( Led_Mail ) ) ? Led_Mail : device->ledList( ) [0];
+ device->setLedState( led, Led_Off );
+ }
+ }
+
// go trough accounts and check here
- // depending on result show or hide
// also trigger qcop call and save status to config
- // get led to blink
}
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
@@ -12,5 +12,5 @@ class MailApplet : public QButton {
public:
- MailApplet(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
+ MailApplet( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
protected: