summaryrefslogtreecommitdiff
path: root/noncore/net
Side-by-side diff
Diffstat (limited to 'noncore/net') (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
@@ -40,2 +40,3 @@ INTERFACES = editaccountsui.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,2 +1,3 @@
#include <qcheckbox.h>
+#include <qspinbox.h>
@@ -23,2 +24,8 @@ void SettingsDialog::readConfig() {
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 ) );
+
}
@@ -30,4 +37,8 @@ void SettingsDialog::writeConfig() {
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
@@ -13,3 +13,3 @@
<y>0</y>
- <width>324</width>
+ <width>320</width>
<height>379</height>
@@ -154,2 +154,120 @@
</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>
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
@@ -70,6 +70,34 @@ 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