summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/mail.pro1
-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.h0
5 files changed, 163 insertions, 5 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
@@ -38,6 +38,7 @@ INTERFACES = editaccountsui.ui \
statuswidgetui.ui \
newmaildirui.ui
+
INCLUDEPATH += $(OPIEDIR)/include
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,4 +1,5 @@
#include <qcheckbox.h>
+#include <qspinbox.h>
#include <qpe/config.h>
@@ -21,6 +22,12 @@ void SettingsDialog::readConfig() {
showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) );
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 ) );
+
}
void SettingsDialog::writeConfig() {
@@ -28,8 +35,12 @@ void SettingsDialog::writeConfig() {
cfg.setGroup( "Settings" );
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() );
}
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>324</width>
+ <width>320</width>
<height>379</height>
</rect>
</property>
@@ -152,6 +152,124 @@
</spacer>
</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>
</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() {
m_intervalMs = newIntervalMs;
}
+ 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