Diffstat (limited to 'core/pim/today/plugins/datebook') (more/less context) (ignore whitespace changes)
11 files changed, 38 insertions, 32 deletions
diff --git a/core/pim/today/plugins/datebook/datebook.pro b/core/pim/today/plugins/datebook/datebook.pro index 413aa47..798c981 100644 --- a/core/pim/today/plugins/datebook/datebook.pro +++ b/core/pim/today/plugins/datebook/datebook.pro @@ -1,40 +1,40 @@ TEMPLATE = lib CONFIG -= moc CONFIG += qt plugin release # Input HEADERS = datebookplugin.h datebookpluginimpl.h datebookpluginconfig.h \ datebookevent.h datebookpluginwidget.h SOURCES = datebookplugin.cpp datebookpluginimpl.cpp datebookpluginconfig.cpp \ datebookevent.cpp datebookpluginwidget.cpp INTERFACES = datebookpluginconfigbase.ui INCLUDEPATH += $(OPIEDIR)/include \ ../ ../library DEPENDPATH += $(OPIEDIR)/include \ ../ ../library -LIBS+= -lqpe -lopie +LIBS+= -lqpe -lopiecore2 -lopieui2 -lopiepim2 DESTDIR = $(OPIEDIR)/plugins/today TARGET = todaydatebookplugin TRANSLATIONS = ../../../../../i18n/de/libtodaydatebookplugin.ts \ ../../../../../i18n/nl/libtodaydatebookplugin.ts \ ../../../../../i18n/xx/libtodaydatebookplugin.ts \ ../../../../../i18n/en/libtodaydatebookplugin.ts \ ../../../../../i18n/es/libtodaydatebookplugin.ts \ ../../../../../i18n/fr/libtodaydatebookplugin.ts \ ../../../../../i18n/hu/libtodaydatebookplugin.ts \ ../../../../../i18n/ja/libtodaydatebookplugin.ts \ ../../../../../i18n/ko/libtodaydatebookplugin.ts \ ../../../../../i18n/no/libtodaydatebookplugin.ts \ ../../../../../i18n/pl/libtodaydatebookplugin.ts \ ../../../../../i18n/pt/libtodaydatebookplugin.ts \ ../../../../../i18n/pt_BR/libtodaydatebookplugin.ts \ ../../../../../i18n/sl/libtodaydatebookplugin.ts \ ../../../../../i18n/zh_CN/libtodaydatebookplugin.ts \ ../../../../../i18n/zh_TW/libtodaydatebookplugin.ts \ ../../../../../i18n/it/libtodaydatebookplugin.ts \ ../../../../../i18n/da/libtodaydatebookplugin.ts include ( $(OPIEDIR)/include.pro ) diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp index e19a690..9a820f2 100644 --- a/core/pim/today/plugins/datebook/datebookevent.cpp +++ b/core/pim/today/plugins/datebook/datebookevent.cpp @@ -1,46 +1,47 @@ /* * datebookevent.cpp * - * copyright : (c) 2002, 2003 by Maximilian Reiß + * 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 "datebookevent.h" + #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/calendar.h> -#include <opie/odevice.h> +#include <opie2/odevice.h> using namespace Opie; DateBookEvent::DateBookEvent(const EffectiveEvent &ev, QWidget* parent, bool show_location, bool show_notes, bool timeExtraLine, int maxCharClip, const char* name, WFlags fl) : OClickableLabel(parent,name,fl), event(ev) { // setAlignment( AlignTop ); QString msg; Config config( "qpe" ); config.setGroup( "Time" ); // if 24 h format ampm = config.readBoolEntry( "AMPM", TRUE ); msg += "<B>" + (ev).description() + "</B>"; if ( (ev).event().hasAlarm() ) { diff --git a/core/pim/today/plugins/datebook/datebookevent.h b/core/pim/today/plugins/datebook/datebookevent.h index 1a090e3..e2ee077 100644 --- a/core/pim/today/plugins/datebook/datebookevent.h +++ b/core/pim/today/plugins/datebook/datebookevent.h @@ -1,46 +1,48 @@ /* * datebookplugin.h * - * copyright : (c) 2002, 2003 by Maximilian Reiß + * 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. * * * ***************************************************************************/ #ifndef DATEBOOKEVENT_PLUGIN_H #define DATEBOOKEVENT_PLUGIN_H -#include <opie/oclickablelabel.h> +#include <opie2/oclickablelabel.h> + #include <qpe/datebookdb.h> +using namespace Opie; class DateBookEvent: public OClickableLabel { Q_OBJECT public: DateBookEvent( const EffectiveEvent &ev, QWidget* parent = 0, bool show_location = 0, bool show_notes = 0, bool timeExtraLine = 0, int maxCharClip = 0, const char* name = 0, WFlags fl = 0 ); ~DateBookEvent(); signals: void editEvent( const Event &e ); private slots: void editEventSlot( const Event &e ); void editMe(); private: diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index 8dfa52f..f46806f 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp @@ -1,43 +1,40 @@ - /* * datebookplugin.cpp * - * copyright : (c) 2002,2003 by Maximilian Reiß + * 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 "datebookplugin.h" #include "datebookpluginconfig.h" DatebookPlugin::DatebookPlugin() { } DatebookPlugin::~DatebookPlugin() { delete (DatebookPluginWidget*)m_widget; } QString DatebookPlugin::pluginName() const { return QObject::tr( "Datebook plugin"); } double DatebookPlugin::versionNumber() const { return 1.0; } QString DatebookPlugin::pixmapNameWidget() const { return "datebook/DateBook"; } QWidget* DatebookPlugin::widget( QWidget* wid ) { diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index 890c59b..631d6a3 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h @@ -1,49 +1,49 @@ /* * datebookplugin.h * * copyright : (c) 2002,2003 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. * * * ***************************************************************************/ #ifndef DATEBOOK_PLUGIN_H #define DATEBOOK_PLUGIN_H -#include <qguardedptr.h> +#include "datebookpluginwidget.h" -#include <opie/oclickablelabel.h> -#include <opie/todayplugininterface.h> +#include <opie2/oclickablelabel.h> +#include <opie2/todayplugininterface.h> -#include "datebookpluginwidget.h" +#include <qguardedptr.h> class DatebookPlugin : public TodayPluginObject { public: DatebookPlugin(); ~DatebookPlugin(); QString pluginName() const; double versionNumber() const; QString pixmapNameWidget() const; QWidget* widget( QWidget *); QString pixmapNameConfig() const; TodayConfigWidget* configWidget( QWidget *); QString appName() const; bool excludeFromRefresh() const; void refresh(); void reinitialize(); private: QGuardedPtr<DatebookPluginWidget> m_widget; }; #endif diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp index 8ead40d..5fd5221 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp @@ -1,28 +1,28 @@ /* * datebookpluginconfig.cpp * - * copyright : (c) 2002,2003 by Maximilian Reiß + * 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 "datebookpluginconfig.h" #include <qpe/config.h> #include <qlayout.h> DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) : TodayConfigWidget( parent, name ) { QVBoxLayout *layout = new QVBoxLayout( this ); diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h index 2d303fc..4f4e3f1 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.h +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h @@ -1,50 +1,53 @@ /* * datebookpluginconfig.h * - * copyright : (c) 2002,2003 by Maximilian Reiß + * 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. * * * ***************************************************************************/ #ifndef DATEBOOK_PLUGIN_CONFIG_H #define DATEBOOK_PLUGIN_CONFIG_H +#include "datebookpluginconfigbase.h" + +#include <opie2/todayconfigwidget.h> #include <qcheckbox.h> #include <qspinbox.h> -#include <opie/todayconfigwidget.h> -#include "datebookpluginconfigbase.h" + + class DatebookPluginConfig : public TodayConfigWidget { Q_OBJECT public: DatebookPluginConfig( QWidget *parent, const char *name ); ~DatebookPluginConfig(); void writeConfig(); private: /** * if changed then save */ bool changed(); void readConfig(); DatebookPluginConfigBase *m_gui; // how many lines should be showed in the datebook section int m_max_lines_meet; // If location is to be showed too, 1 to activate it. int m_show_location; diff --git a/core/pim/today/plugins/datebook/datebookpluginimpl.cpp b/core/pim/today/plugins/datebook/datebookpluginimpl.cpp index 6baffb9..ee250db 100644 --- a/core/pim/today/plugins/datebook/datebookpluginimpl.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginimpl.cpp @@ -1,45 +1,45 @@ /* * datebookpluginimpl.cpp * - * copyright : (c) 2002 by Maximilian Reiß + * 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 "datebookplugin.h" #include "datebookpluginimpl.h" DatebookPluginImpl::DatebookPluginImpl() { datebookPlugin = new DatebookPlugin(); } DatebookPluginImpl::~DatebookPluginImpl() { delete datebookPlugin; } TodayPluginObject* DatebookPluginImpl::guiPart() { return datebookPlugin; } QRESULT DatebookPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { *iface = this, (*iface)->addRef(); }else return QS_FALSE; - + return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( DatebookPluginImpl ); } diff --git a/core/pim/today/plugins/datebook/datebookpluginimpl.h b/core/pim/today/plugins/datebook/datebookpluginimpl.h index 7c19e59..d34dd6d 100644 --- a/core/pim/today/plugins/datebook/datebookpluginimpl.h +++ b/core/pim/today/plugins/datebook/datebookpluginimpl.h @@ -1,39 +1,39 @@ /* * datebookpluginimpl.h * - * copyright : (c) 2002 by Maximilian Reiß + * 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. * * * ***************************************************************************/ #ifndef DATEBOOK_PLUGIN_IMPL_H #define DATEBOOK_PLUGIN_IMPL_H -#include <opie/todayplugininterface.h> +#include <opie2/todayplugininterface.h> class DatebookPlugin; class DatebookPluginImpl : public TodayPluginInterface{ public: DatebookPluginImpl(); virtual ~DatebookPluginImpl(); QRESULT queryInterface( const QUuid &, QUnknownInterface** ); Q_REFCOUNT virtual TodayPluginObject *guiPart(); private: DatebookPlugin *datebookPlugin; }; #endif diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index 1b11d1b..b6707df 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -1,28 +1,28 @@ /* * datebookpluginwidget.cpp * - * copyright : (c) 2002,2003 by Maximilian Reiß + * 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 "datebookpluginwidget.h" #include <qpe/config.h> #include <qtl.h> DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name ) : QWidget(parent, name ) { db = 0l; m_layoutDates = 0l; @@ -79,60 +79,60 @@ void DatebookPluginWidget::refresh() { 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 & ) ) ); - } else { - if ( ( QDateTime::currentDateTime() <= (*it).event().end() ) + } 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() ) ) ) + && ( ( 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() ) ) - ) + && ( 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 & ) ) ); } } } } 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/datebook/datebookpluginwidget.h b/core/pim/today/plugins/datebook/datebookpluginwidget.h index 8988073..68af323 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.h +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.h @@ -1,51 +1,54 @@ /* * datebookpluginwidget.h * * copyright : (c) 2002,2003 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. * * * ***************************************************************************/ #ifndef DATEBOOK_PLUGIN_WIDGET_H #define DATEBOOK_PLUGIN_WIDGET_H +#include "datebookevent.h" + +#include <opie2/oclickablelabel.h> + +#include <qpe/datebookdb.h> + #include <qlayout.h> #include <qguardedptr.h> #include <qlist.h> -#include <qpe/datebookdb.h> -#include <opie/oclickablelabel.h> - -#include "datebookevent.h" +using namespace Opie; class DatebookPluginWidget : public QWidget { Q_OBJECT public: DatebookPluginWidget( QWidget *parent, const char *name ); ~DatebookPluginWidget(); void refresh(); void reinitialize(); private: DateBookDB* db; QGuardedPtr<QVBoxLayout> m_layoutDates; QList<QWidget> m_eventsList; void readConfig(); void getDates(); // how many lines should be showed in the datebook section int m_max_lines_meet; // If location is to be showed too, 1 to activate it. bool m_show_location; // if notes should be shown |