summaryrefslogtreecommitdiff
path: root/core/pim/today
Side-by-side diff
Diffstat (limited to 'core/pim/today') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp4
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.cpp4
-rw-r--r--core/pim/today/plugins/mail/mailpluginwidget.cpp4
-rw-r--r--core/pim/today/today.cpp4
-rw-r--r--core/pim/today/todayconfig.cpp2
5 files changed, 9 insertions, 9 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index c8652f3..b0d456d 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -1,89 +1,89 @@
/*
* addresspluginwidget.cpp
*
* copyright : (c) 2003 by Stefan Eilers
* email : eilers.stefan@epost.de
*
* This implementation was derived from the todolist plugin implementation
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "addresspluginwidget.h"
#include <qpe/config.h>
#include <opie/ocontact.h>
AddressBookPluginWidget::AddressBookPluginWidget( QWidget *parent, const char* name )
: QWidget( parent, name ) {
addressLabel = 0l;
m_contactdb = 0l;
layoutTodo = 0l;
// Hä ? Nonsense ! (se)
if ( m_contactdb ) {
delete m_contactdb;
}
m_contactdb = new OContactAccess("addressplugin");
- connect( m_contactdb, SIGNAL( signalChanged( const OContactAccess * ) ),
- this, SLOT( refresh( const OContactAccess * ) ) );
+ connect( m_contactdb, SIGNAL( signalChanged(const OContactAccess*) ),
+ this, SLOT( refresh(const OContactAccess*) ) );
readConfig();
getAddress();
}
AddressBookPluginWidget::~AddressBookPluginWidget() {
delete m_contactdb;
}
void AddressBookPluginWidget::refresh( const OContactAccess* )
{
qWarning(" AddressBookPluginWidget::Database was changed externally ! ");
m_contactdb->reload();
getAddress();
}
void AddressBookPluginWidget::reinitialize() {
readConfig();
getAddress();
}
void AddressBookPluginWidget::readConfig() {
Config cfg( "todayaddressplugin" );
cfg.setGroup( "config" );
m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 );
m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 );
m_urgentDays = cfg.readNumEntry( "urgentdays", 7 );
m_entryColor = cfg.readEntry("entrycolor", Qt::black.name() );
m_headlineColor = cfg.readEntry( "headlinecolor", Qt::black.name() );
m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() );
m_showBirthdays = cfg.readBoolEntry( "showBirthdays", true );
m_showAnniversaries = cfg.readBoolEntry( "showAnniversaries", true );
}
/**
* Get the addresss
*/
void AddressBookPluginWidget::getAddress() {
if ( ! layoutTodo ){
layoutTodo = new QVBoxLayout( this );
}
if ( ! addressLabel ) {
addressLabel = new OClickableLabel( this );
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
index b6707df..0820802 100644
--- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
@@ -54,87 +54,87 @@ void DatebookPluginWidget::readConfig() {
m_onlyLater = cfg.readNumEntry( "onlylater", 1 );
m_moreDays = cfg.readNumEntry( "moredays", 0 );
m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 );
}
void DatebookPluginWidget::reinitialize() {
readConfig();
refresh();
}
void DatebookPluginWidget::refresh() {
m_eventsList.clear();
if ( m_layoutDates ) {
delete m_layoutDates;
}
m_layoutDates = new QVBoxLayout( this );
m_layoutDates->setAutoAdd( true );
getDates();
}
/**
* Get all events that are in the datebook xml file for today
*/
void DatebookPluginWidget::getDates() {
if ( db ) {
delete db;
}
db = new DateBookDB;
QDate date = QDate::currentDate();
QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) );
qBubbleSort( list );
int count = 0;
if ( list.count() > 0 ) {
for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) {
if ( count < m_max_lines_meet ) {
if ( !m_onlyLater ) {
count++;
DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine );
m_eventsList.append( l );
l->show();
- QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) );
+ QObject::connect ( l, SIGNAL( editEvent(const Event&) ), l, SLOT( editEventSlot(const Event&) ) );
} else {
if ( ( QDateTime::currentDateTime() <= (*it).event().end() )
// Show events which span over many days and are not elapsed.
|| ( ( (*it).event().start().date() != date ) && ( QDateTime::currentDateTime() <= (*it).event().end() ) )
// Show repeated event for today that is not elapsed.
|| ( ( (*it).event().repeatType() != Event::NoRepeat )
&& ( ( date.dayOfWeek() == (*it).date().dayOfWeek() )
&& ( QTime::currentTime() < (*it).event().start().time() ) ) )
// Show repeated event for next days.
|| ( ( (*it).event().repeatType() != Event::NoRepeat )
&& ( date.dayOfWeek() != (*it).date().dayOfWeek() ) )
)
{
count++;
// show only later appointments
DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine );
m_eventsList.append( l );
l->show();
- QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) );
+ QObject::connect ( l, SIGNAL( editEvent(const Event&) ), l, SLOT( editEventSlot(const Event&) ) );
}
}
}
}
if ( m_onlyLater && count == 0 ) {
QLabel* noMoreEvents = new QLabel( this );
m_eventsList.append( noMoreEvents );
noMoreEvents->show();
noMoreEvents->setText( QObject::tr( "No more appointments today" ) );
}
} else {
QLabel* noEvents = new QLabel( this );
m_eventsList.append( noEvents );
noEvents->show();
noEvents->setText( QObject::tr( "No appointments today" ) );
}
}
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp
index 4194270..a8e4c41 100644
--- a/core/pim/today/plugins/mail/mailpluginwidget.cpp
+++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp
@@ -1,92 +1,92 @@
/*
* mailpluginwidget.cpp
*
* copyright : (c) 2002,2003,2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "mailpluginwidget.h"
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name)
: QWidget(parent, name ) {
m_mailLabel = 0l;
m_layout = 0l;
if ( m_mailLabel ) {
delete m_mailLabel;
}
m_mailLabel = new OClickableLabel( this );
connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) );
if ( m_layout ) {
delete m_layout;
}
m_layout = new QHBoxLayout( this );
m_layout->setAutoAdd( true );
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *qCopChannel = new QCopChannel( "QPE/Pim" , this );
- connect ( qCopChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
- this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
+ connect ( qCopChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
+ this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) );
#endif
#endif
readConfig();
getInfo();
}
void MailPluginWidget::channelReceived( const QCString &msg, const QByteArray & data ) {
QDataStream stream( data, IO_ReadOnly );
if ( msg == "outgoingMails(int)" ) {
stream >> m_outgoing;
} else if ( msg == "newMails(int)" ) {
stream >> m_newMails;
}
getInfo();
}
MailPluginWidget::~MailPluginWidget() {
delete m_mailLabel;
delete m_layout;
}
void MailPluginWidget::readConfig() {
Config cfg( "todaymailplugin" );
cfg.setGroup( "config" );
Config cfg2( "mail" );
cfg2.setGroup( "Status" );
m_newMails = cfg2.readNumEntry( "newMails", 0 );
m_outgoing = cfg2.readNumEntry( "outgoing", 0 );
}
void MailPluginWidget::refresh() {
getInfo();
}
void MailPluginWidget::getInfo() {
m_mailLabel->setText( QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( m_newMails ).arg( m_outgoing ) );
}
/**
* launches datebook
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 72cdfd6..812f8b5 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -8,98 +8,98 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#define QTOPIA_INTERNAL_LANGLIST
#include "today.h"
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qpe/contact.h>
#include <qdir.h>
#include <qtimer.h>
#include <qwhatsthis.h>
struct TodayPlugin {
TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
QLibrary *library;
QInterfacePtr<TodayPluginInterface> iface;
TodayPluginObject *guiPart;
QWidget *guiBox;
QString name;
bool active;
bool excludeRefresh;
int pos;
};
static QValueList<TodayPlugin> pluginList;
static QMap<QString, TodayPlugin> tempList;
Today::Today( QWidget* parent, const char* name, WFlags fl )
: TodayBase( parent, name, fl ) {
QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
- connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
- this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
+ connect ( todayChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
+ this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) );
#endif
#endif
setOwnerField();
m_refreshTimer = new QTimer( this );
connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
m_refreshTimer->start( 15000 );
m_big_box = 0L;
layout = new QVBoxLayout( this );
layout->addWidget( Frame );
layout->addWidget( OwnerField );
m_sv = new QScrollView( this );
m_sv->setResizePolicy( QScrollView::AutoOneFit );
m_sv->setHScrollBarMode( QScrollView::AlwaysOff );
m_sv->setFrameShape( QFrame::NoFrame );
layout->addWidget( m_sv );
layout->setStretchFactor( m_sv,4 );
qApp->processEvents();
loadPlugins();
QPEApplication::showWidget( this );
}
/**
* Qcop receive method.
*/
void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
QDataStream stream( data, IO_ReadOnly );
if ( msg == "message(QString)" ) {
QString message;
stream >> message;
setOwnerField( message );
}
}
void Today::setRefreshTimer( int interval ) {
disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
// 0 is "never" case
if ( !interval == 0 ) {
connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
m_refreshTimer->changeInterval( interval );
}
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 5c51515..a6f53e1 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -40,97 +40,97 @@ public:
setFocusPolicy( QWidget::NoFocus );
setToggleButton( t );
connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
}
};
/**
* The class has currently quite some duplicate code.
* By that way it would be real easy to have it as seperate app in settings tab
*
*/
TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
: QDialog( parent, name, modal, WStyle_ContextHelp ) {
setCaption( tr( "Today Config" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
layout->addWidget( TabWidget3 );
tab_2 = new QWidget( TabWidget3, "tab_2" );
QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
tab2Layout->addWidget( l );
QHBox *hbox1 = new QHBox( tab_2 );
m_appletListView = new QListView( hbox1 );
m_appletListView->addColumn( "PluginList" );
m_appletListView->header()->hide();
m_appletListView->setSorting( -1 );
QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) );
QVBox *vbox1 = new QVBox( hbox1 );
new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
tab2Layout->addWidget( hbox1 );
TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) );
// Misc tab
tab_3 = new QWidget( TabWidget3, "tab_3" );
QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
m_guiMisc = new TodayConfigMiscBase( tab_3 );
tab3Layout->addWidget( m_guiMisc );
TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
m_applets_changed = false;
- connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) );
+ connect ( m_appletListView , SIGNAL( clicked(QListViewItem*) ), this, SLOT( appletChanged() ) );
readConfig();
QPEApplication::showDialog( this );
}
/**
* Autostart, uses the new (opie only) autostart method in the launcher code.
* If registered against that today ist started on each resume.
*/
void TodayConfig::setAutoStart() {
Config cfg( "today" );
cfg.setGroup( "Autostart" );
if ( m_autoStart ) {
QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" );
e << QString( "add" );
e << QString( "today" );
e << QString( "%1" ).arg( m_autoStartTimer );
} else {
QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
e << QString( "remove" );
e << QString( "today" );
}
}
/**
* Read the config part
*/
void TodayConfig::readConfig() {
Config cfg( "today" );
cfg.setGroup( "Autostart" );
m_autoStart = cfg.readNumEntry( "autostart", 1 );
m_guiMisc->CheckBoxAuto->setChecked( m_autoStart );
m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 );
m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer );
cfg.setGroup( "General" );
m_iconSize = cfg.readNumEntry( "IconSize", 18 );
m_guiMisc->SpinBoxIconSize->setValue( m_iconSize );
m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 );
m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) );
cfg.setGroup( "Plugins" );
m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
}
/**