Diffstat (limited to 'noncore/net/mail/taskbarapplet/mailapplet.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
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 } |