author | harlekin <harlekin> | 2004-01-04 15:47:32 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-01-04 15:47:32 (UTC) |
commit | 59fee003137f5fd7782e3a42159e53424d100e67 (patch) (side-by-side diff) | |
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 | 1 | ||||
-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 | 0 |
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 @@ -25,28 +25,29 @@ SOURCES = main.cpp \ settingsdialog.cpp \ statuswidget.cpp \ newmaildir.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 @@ -1,30 +1,30 @@ <!DOCTYPE UI><UI> <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> </property> <vbox> <property stdset="1"> <name>margin</name> @@ -139,20 +139,138 @@ <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> + <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 @@ -55,21 +55,49 @@ void MailApplet::slotClicked() { ODevice *device = ODevice::inst(); if ( !device-> ledList ( ). isEmpty ( ) ) { OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0]; 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 |