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
@@ -29,24 +29,25 @@ SOURCES = main.cpp \
INTERFACES = editaccountsui.ui \
selectmailtypeui.ui \
imapconfigui.ui \
pop3configui.ui \
nntpconfigui.ui \
smtpconfigui.ui \
addresspickerui.ui \
composemailui.ui \
settingsdialogui.ui \
statuswidgetui.ui \
newmaildirui.ui
+
INCLUDEPATH += $(OPIEDIR)/include
CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
contains( CONFTEST, y ){
LIBS += -lqpe -lopie -lmailwrapper -liconv
}else{
LIBS += -lqpe -lopie -lmailwrapper
}
TARGET = opiemail
include ( $(OPIEDIR)/include.pro )
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,38 +1,49 @@
#include <qcheckbox.h>
+#include <qspinbox.h>
#include <qpe/config.h>
#include "settingsdialog.h"
SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: SettingsDialogUI( parent, name, modal, fl ) {
readConfig();
}
SettingsDialog::~SettingsDialog() {
}
void SettingsDialog::readConfig() {
Config cfg("mail");
cfg.setGroup( "Settings" );
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() {
Config cfg( "mail" );
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() {
writeConfig();
QDialog::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
@@ -2,25 +2,25 @@
<class>SettingsDialogUI</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>SettingsDialogUI</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>324</width>
+ <width>320</width>
<height>379</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Settings Dialog</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
@@ -143,16 +143,134 @@
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</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>
</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
@@ -59,17 +59,45 @@ void MailApplet::slotClicked() {
device->setLedState( led, Led_Off );
}
}
void MailApplet::slotCheck() {
// Check wether the check interval has been changed.
int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000;
if ( newIntervalMs != m_intervalMs ) {
m_intervalTimer->changeInterval( newIntervalMs );
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