summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/datebook
Unidiff
Diffstat (limited to 'core/pim/today/plugins/datebook') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebook.pro2
-rw-r--r--core/pim/today/plugins/datebook/datebookevent.cpp5
-rw-r--r--core/pim/today/plugins/datebook/datebookevent.h6
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.cpp5
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.h8
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.cpp2
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.h9
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginimpl.cpp4
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginimpl.h4
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.cpp14
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.h11
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 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG -= moc 2CONFIG -= moc
3CONFIG += qt plugin release 3CONFIG += qt plugin release
4# Input 4# Input
5HEADERS = datebookplugin.h datebookpluginimpl.h datebookpluginconfig.h \ 5HEADERS = datebookplugin.h datebookpluginimpl.h datebookpluginconfig.h \
6 datebookevent.h datebookpluginwidget.h 6 datebookevent.h datebookpluginwidget.h
7SOURCES = datebookplugin.cpp datebookpluginimpl.cpp datebookpluginconfig.cpp \ 7SOURCES = datebookplugin.cpp datebookpluginimpl.cpp datebookpluginconfig.cpp \
8 datebookevent.cpp datebookpluginwidget.cpp 8 datebookevent.cpp datebookpluginwidget.cpp
9INTERFACES = datebookpluginconfigbase.ui 9INTERFACES = datebookpluginconfigbase.ui
10 10
11INCLUDEPATH += $(OPIEDIR)/include \ 11INCLUDEPATH += $(OPIEDIR)/include \
12 ../ ../library 12 ../ ../library
13DEPENDPATH += $(OPIEDIR)/include \ 13DEPENDPATH += $(OPIEDIR)/include \
14 ../ ../library 14 ../ ../library
15 15
16LIBS+= -lqpe -lopie 16LIBS+= -lqpe -lopiecore2 -lopieui2 -lopiepim2
17 17
18DESTDIR = $(OPIEDIR)/plugins/today 18DESTDIR = $(OPIEDIR)/plugins/today
19TARGET = todaydatebookplugin 19TARGET = todaydatebookplugin
20 20
21TRANSLATIONS = ../../../../../i18n/de/libtodaydatebookplugin.ts \ 21TRANSLATIONS = ../../../../../i18n/de/libtodaydatebookplugin.ts \
22 ../../../../../i18n/nl/libtodaydatebookplugin.ts \ 22 ../../../../../i18n/nl/libtodaydatebookplugin.ts \
23 ../../../../../i18n/xx/libtodaydatebookplugin.ts \ 23 ../../../../../i18n/xx/libtodaydatebookplugin.ts \
24 ../../../../../i18n/en/libtodaydatebookplugin.ts \ 24 ../../../../../i18n/en/libtodaydatebookplugin.ts \
25 ../../../../../i18n/es/libtodaydatebookplugin.ts \ 25 ../../../../../i18n/es/libtodaydatebookplugin.ts \
26 ../../../../../i18n/fr/libtodaydatebookplugin.ts \ 26 ../../../../../i18n/fr/libtodaydatebookplugin.ts \
27 ../../../../../i18n/hu/libtodaydatebookplugin.ts \ 27 ../../../../../i18n/hu/libtodaydatebookplugin.ts \
28 ../../../../../i18n/ja/libtodaydatebookplugin.ts \ 28 ../../../../../i18n/ja/libtodaydatebookplugin.ts \
29 ../../../../../i18n/ko/libtodaydatebookplugin.ts \ 29 ../../../../../i18n/ko/libtodaydatebookplugin.ts \
30 ../../../../../i18n/no/libtodaydatebookplugin.ts \ 30 ../../../../../i18n/no/libtodaydatebookplugin.ts \
31 ../../../../../i18n/pl/libtodaydatebookplugin.ts \ 31 ../../../../../i18n/pl/libtodaydatebookplugin.ts \
32 ../../../../../i18n/pt/libtodaydatebookplugin.ts \ 32 ../../../../../i18n/pt/libtodaydatebookplugin.ts \
33 ../../../../../i18n/pt_BR/libtodaydatebookplugin.ts \ 33 ../../../../../i18n/pt_BR/libtodaydatebookplugin.ts \
34 ../../../../../i18n/sl/libtodaydatebookplugin.ts \ 34 ../../../../../i18n/sl/libtodaydatebookplugin.ts \
35 ../../../../../i18n/zh_CN/libtodaydatebookplugin.ts \ 35 ../../../../../i18n/zh_CN/libtodaydatebookplugin.ts \
36 ../../../../../i18n/zh_TW/libtodaydatebookplugin.ts \ 36 ../../../../../i18n/zh_TW/libtodaydatebookplugin.ts \
37 ../../../../../i18n/it/libtodaydatebookplugin.ts \ 37 ../../../../../i18n/it/libtodaydatebookplugin.ts \
38 ../../../../../i18n/da/libtodaydatebookplugin.ts 38 ../../../../../i18n/da/libtodaydatebookplugin.ts
39 39
40include ( $(OPIEDIR)/include.pro ) 40include ( $(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 @@
1/* 1/*
2 * datebookevent.cpp 2 * datebookevent.cpp
3 * 3 *
4 * copyright : (c) 2002, 2003 by Maximilian Reiß 4 * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "datebookevent.h" 17#include "datebookevent.h"
18
18#include <qpe/config.h> 19#include <qpe/config.h>
19#include <qpe/qcopenvelope_qws.h> 20#include <qpe/qcopenvelope_qws.h>
20#include <qpe/calendar.h> 21#include <qpe/calendar.h>
21 22
22#include <opie/odevice.h> 23#include <opie2/odevice.h>
23 24
24using namespace Opie; 25using namespace Opie;
25 26
26DateBookEvent::DateBookEvent(const EffectiveEvent &ev, 27DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
27 QWidget* parent, 28 QWidget* parent,
28 bool show_location, 29 bool show_location,
29 bool show_notes, 30 bool show_notes,
30 bool timeExtraLine, 31 bool timeExtraLine,
31 int maxCharClip, 32 int maxCharClip,
32 const char* name, 33 const char* name,
33 WFlags fl) : 34 WFlags fl) :
34 OClickableLabel(parent,name,fl), event(ev) { 35 OClickableLabel(parent,name,fl), event(ev) {
35 36
36 // setAlignment( AlignTop ); 37 // setAlignment( AlignTop );
37 38
38 QString msg; 39 QString msg;
39 40
40 Config config( "qpe" ); 41 Config config( "qpe" );
41 config.setGroup( "Time" ); 42 config.setGroup( "Time" );
42 // if 24 h format 43 // if 24 h format
43 ampm = config.readBoolEntry( "AMPM", TRUE ); 44 ampm = config.readBoolEntry( "AMPM", TRUE );
44 45
45 msg += "<B>" + (ev).description() + "</B>"; 46 msg += "<B>" + (ev).description() + "</B>";
46 if ( (ev).event().hasAlarm() ) { 47 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 @@
1/* 1/*
2 * datebookplugin.h 2 * datebookplugin.h
3 * 3 *
4 * copyright : (c) 2002, 2003 by Maximilian Reiß 4 * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef DATEBOOKEVENT_PLUGIN_H 17#ifndef DATEBOOKEVENT_PLUGIN_H
18#define DATEBOOKEVENT_PLUGIN_H 18#define DATEBOOKEVENT_PLUGIN_H
19 19
20#include <opie/oclickablelabel.h> 20#include <opie2/oclickablelabel.h>
21
21#include <qpe/datebookdb.h> 22#include <qpe/datebookdb.h>
22 23
24using namespace Opie;
23 25
24class DateBookEvent: public OClickableLabel { 26class DateBookEvent: public OClickableLabel {
25 27
26 Q_OBJECT 28 Q_OBJECT
27 29
28public: 30public:
29 DateBookEvent( const EffectiveEvent &ev, 31 DateBookEvent( const EffectiveEvent &ev,
30 QWidget* parent = 0, 32 QWidget* parent = 0,
31 bool show_location = 0, 33 bool show_location = 0,
32 bool show_notes = 0, 34 bool show_notes = 0,
33 bool timeExtraLine = 0, 35 bool timeExtraLine = 0,
34 int maxCharClip = 0, 36 int maxCharClip = 0,
35 const char* name = 0, 37 const char* name = 0,
36 WFlags fl = 0 ); 38 WFlags fl = 0 );
37 ~DateBookEvent(); 39 ~DateBookEvent();
38 40
39 signals: 41 signals:
40 void editEvent( const Event &e ); 42 void editEvent( const Event &e );
41 43
42private slots: 44private slots:
43 void editEventSlot( const Event &e ); 45 void editEventSlot( const Event &e );
44 void editMe(); 46 void editMe();
45 47
46 private: 48 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 @@
1
2/* 1/*
3 * datebookplugin.cpp 2 * datebookplugin.cpp
4 * 3 *
5 * copyright : (c) 2002,2003 by Maximilian Reiß 4 * copyright : (c) 2002,2003, 2004 by Maximilian Reiß
6 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
7 * 6 *
8 */ 7 */
9/*************************************************************************** 8/***************************************************************************
10 * * 9 * *
11 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 13 * (at your option) any later version. *
15 * * 14 * *
16 ***************************************************************************/ 15 ***************************************************************************/
17 16
18
19
20#include "datebookplugin.h" 17#include "datebookplugin.h"
21#include "datebookpluginconfig.h" 18#include "datebookpluginconfig.h"
22 19
23 20
24DatebookPlugin::DatebookPlugin() { 21DatebookPlugin::DatebookPlugin() {
25} 22}
26 23
27DatebookPlugin::~DatebookPlugin() { 24DatebookPlugin::~DatebookPlugin() {
28 delete (DatebookPluginWidget*)m_widget; 25 delete (DatebookPluginWidget*)m_widget;
29} 26}
30 27
31QString DatebookPlugin::pluginName() const { 28QString DatebookPlugin::pluginName() const {
32 return QObject::tr( "Datebook plugin"); 29 return QObject::tr( "Datebook plugin");
33} 30}
34 31
35double DatebookPlugin::versionNumber() const { 32double DatebookPlugin::versionNumber() const {
36 return 1.0; 33 return 1.0;
37} 34}
38 35
39QString DatebookPlugin::pixmapNameWidget() const { 36QString DatebookPlugin::pixmapNameWidget() const {
40 return "datebook/DateBook"; 37 return "datebook/DateBook";
41} 38}
42 39
43QWidget* DatebookPlugin::widget( QWidget* wid ) { 40QWidget* 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 @@
1/* 1/*
2 * datebookplugin.h 2 * datebookplugin.h
3 * 3 *
4 * copyright : (c) 2002,2003 by Maximilian Reiß 4 * copyright : (c) 2002,2003 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef DATEBOOK_PLUGIN_H 17#ifndef DATEBOOK_PLUGIN_H
18#define DATEBOOK_PLUGIN_H 18#define DATEBOOK_PLUGIN_H
19 19
20#include <qguardedptr.h> 20#include "datebookpluginwidget.h"
21 21
22#include <opie/oclickablelabel.h> 22#include <opie2/oclickablelabel.h>
23#include <opie/todayplugininterface.h> 23#include <opie2/todayplugininterface.h>
24 24
25#include "datebookpluginwidget.h" 25#include <qguardedptr.h>
26 26
27class DatebookPlugin : public TodayPluginObject { 27class DatebookPlugin : public TodayPluginObject {
28 28
29public: 29public:
30 DatebookPlugin(); 30 DatebookPlugin();
31 ~DatebookPlugin(); 31 ~DatebookPlugin();
32 32
33 QString pluginName() const; 33 QString pluginName() const;
34 double versionNumber() const; 34 double versionNumber() const;
35 QString pixmapNameWidget() const; 35 QString pixmapNameWidget() const;
36 QWidget* widget( QWidget *); 36 QWidget* widget( QWidget *);
37 QString pixmapNameConfig() const; 37 QString pixmapNameConfig() const;
38 TodayConfigWidget* configWidget( QWidget *); 38 TodayConfigWidget* configWidget( QWidget *);
39 QString appName() const; 39 QString appName() const;
40 bool excludeFromRefresh() const; 40 bool excludeFromRefresh() const;
41 void refresh(); 41 void refresh();
42 void reinitialize(); 42 void reinitialize();
43 43
44 private: 44 private:
45 QGuardedPtr<DatebookPluginWidget> m_widget; 45 QGuardedPtr<DatebookPluginWidget> m_widget;
46}; 46};
47 47
48 48
49#endif 49#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 @@
1/* 1/*
2 * datebookpluginconfig.cpp 2 * datebookpluginconfig.cpp
3 * 3 *
4 * copyright : (c) 2002,2003 by Maximilian Reiß 4 * copyright : (c) 2002,2003,2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17 17
18#include "datebookpluginconfig.h" 18#include "datebookpluginconfig.h"
19 19
20#include <qpe/config.h> 20#include <qpe/config.h>
21 21
22#include <qlayout.h> 22#include <qlayout.h>
23 23
24DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) 24DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name)
25 : TodayConfigWidget( parent, name ) { 25 : TodayConfigWidget( parent, name ) {
26 26
27 QVBoxLayout *layout = new QVBoxLayout( this ); 27 QVBoxLayout *layout = new QVBoxLayout( this );
28 28
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 @@
1/* 1/*
2 * datebookpluginconfig.h 2 * datebookpluginconfig.h
3 * 3 *
4 * copyright : (c) 2002,2003 by Maximilian Reiß 4 * copyright : (c) 2002,2003,2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef DATEBOOK_PLUGIN_CONFIG_H 17#ifndef DATEBOOK_PLUGIN_CONFIG_H
18#define DATEBOOK_PLUGIN_CONFIG_H 18#define DATEBOOK_PLUGIN_CONFIG_H
19 19
20#include "datebookpluginconfigbase.h"
21
22#include <opie2/todayconfigwidget.h>
20 23
21#include <qcheckbox.h> 24#include <qcheckbox.h>
22#include <qspinbox.h> 25#include <qspinbox.h>
23 26
24#include <opie/todayconfigwidget.h>
25 27
26#include "datebookpluginconfigbase.h" 28
29
27 30
28class DatebookPluginConfig : public TodayConfigWidget { 31class DatebookPluginConfig : public TodayConfigWidget {
29 32
30 Q_OBJECT 33 Q_OBJECT
31 34
32 35
33public: 36public:
34 DatebookPluginConfig( QWidget *parent, const char *name ); 37 DatebookPluginConfig( QWidget *parent, const char *name );
35 ~DatebookPluginConfig(); 38 ~DatebookPluginConfig();
36 39
37 void writeConfig(); 40 void writeConfig();
38private: 41private:
39 /** 42 /**
40 * if changed then save 43 * if changed then save
41 */ 44 */
42 bool changed(); 45 bool changed();
43 void readConfig(); 46 void readConfig();
44 47
45 48
46 DatebookPluginConfigBase *m_gui; 49 DatebookPluginConfigBase *m_gui;
47 // how many lines should be showed in the datebook section 50 // how many lines should be showed in the datebook section
48 int m_max_lines_meet; 51 int m_max_lines_meet;
49 // If location is to be showed too, 1 to activate it. 52 // If location is to be showed too, 1 to activate it.
50 int m_show_location; 53 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 @@
1/* 1/*
2 * datebookpluginimpl.cpp 2 * datebookpluginimpl.cpp
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "datebookplugin.h" 17#include "datebookplugin.h"
18#include "datebookpluginimpl.h" 18#include "datebookpluginimpl.h"
19 19
20DatebookPluginImpl::DatebookPluginImpl() { 20DatebookPluginImpl::DatebookPluginImpl() {
21 datebookPlugin = new DatebookPlugin(); 21 datebookPlugin = new DatebookPlugin();
22} 22}
23 23
24DatebookPluginImpl::~DatebookPluginImpl() { 24DatebookPluginImpl::~DatebookPluginImpl() {
25 delete datebookPlugin; 25 delete datebookPlugin;
26} 26}
27 27
28TodayPluginObject* DatebookPluginImpl::guiPart() { 28TodayPluginObject* DatebookPluginImpl::guiPart() {
29 return datebookPlugin; 29 return datebookPlugin;
30} 30}
31 31
32QRESULT DatebookPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { 32QRESULT DatebookPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) {
33 *iface = 0; 33 *iface = 0;
34 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { 34 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
35 *iface = this, (*iface)->addRef(); 35 *iface = this, (*iface)->addRef();
36 }else 36 }else
37 return QS_FALSE; 37 return QS_FALSE;
38 38
39 return QS_OK; 39 return QS_OK;
40 40
41} 41}
42 42
43Q_EXPORT_INTERFACE() { 43Q_EXPORT_INTERFACE() {
44 Q_CREATE_INSTANCE( DatebookPluginImpl ); 44 Q_CREATE_INSTANCE( DatebookPluginImpl );
45} 45}
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 @@
1/* 1/*
2 * datebookpluginimpl.h 2 * datebookpluginimpl.h
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef DATEBOOK_PLUGIN_IMPL_H 17#ifndef DATEBOOK_PLUGIN_IMPL_H
18#define DATEBOOK_PLUGIN_IMPL_H 18#define DATEBOOK_PLUGIN_IMPL_H
19 19
20#include <opie/todayplugininterface.h> 20#include <opie2/todayplugininterface.h>
21 21
22class DatebookPlugin; 22class DatebookPlugin;
23 23
24class DatebookPluginImpl : public TodayPluginInterface{ 24class DatebookPluginImpl : public TodayPluginInterface{
25 25
26public: 26public:
27 DatebookPluginImpl(); 27 DatebookPluginImpl();
28 virtual ~DatebookPluginImpl(); 28 virtual ~DatebookPluginImpl();
29 29
30 QRESULT queryInterface( const QUuid &, QUnknownInterface** ); 30 QRESULT queryInterface( const QUuid &, QUnknownInterface** );
31 Q_REFCOUNT 31 Q_REFCOUNT
32 32
33 virtual TodayPluginObject *guiPart(); 33 virtual TodayPluginObject *guiPart();
34 34
35private: 35private:
36 DatebookPlugin *datebookPlugin; 36 DatebookPlugin *datebookPlugin;
37}; 37};
38 38
39#endif 39#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 @@
1 /* 1 /*
2 * datebookpluginwidget.cpp 2 * datebookpluginwidget.cpp
3 * 3 *
4 * copyright : (c) 2002,2003 by Maximilian Reiß 4 * copyright : (c) 2002,2003, 2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17 17
18#include "datebookpluginwidget.h" 18#include "datebookpluginwidget.h"
19 19
20#include <qpe/config.h> 20#include <qpe/config.h>
21 21
22#include <qtl.h> 22#include <qtl.h>
23 23
24DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name ) 24DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name )
25 : QWidget(parent, name ) { 25 : QWidget(parent, name ) {
26 26
27 db = 0l; 27 db = 0l;
28 m_layoutDates = 0l; 28 m_layoutDates = 0l;
@@ -79,60 +79,60 @@ void DatebookPluginWidget::refresh() {
79void DatebookPluginWidget::getDates() { 79void DatebookPluginWidget::getDates() {
80 80
81 81
82 if ( db ) { 82 if ( db ) {
83 delete db; 83 delete db;
84 } 84 }
85 db = new DateBookDB; 85 db = new DateBookDB;
86 86
87 QDate date = QDate::currentDate(); 87 QDate date = QDate::currentDate();
88 QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) ); 88 QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) );
89 qBubbleSort( list ); 89 qBubbleSort( list );
90 int count = 0; 90 int count = 0;
91 91
92 if ( list.count() > 0 ) { 92 if ( list.count() > 0 ) {
93 93
94 for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) { 94 for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) {
95 95
96 if ( count < m_max_lines_meet ) { 96 if ( count < m_max_lines_meet ) {
97 if ( !m_onlyLater ) { 97 if ( !m_onlyLater ) {
98 count++; 98 count++;
99 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine ); 99 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine );
100 m_eventsList.append( l ); 100 m_eventsList.append( l );
101 l->show(); 101 l->show();
102 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); 102 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) );
103 } else { 103 } else {
104 if ( ( QDateTime::currentDateTime() <= (*it).event().end() ) 104 if ( ( QDateTime::currentDateTime() <= (*it).event().end() )
105 // Show events which span over many days and are not elapsed. 105 // Show events which span over many days and are not elapsed.
106 || ( ( (*it).event().start().date() != date ) && ( QDateTime::currentDateTime() <= (*it).event().end() ) ) 106 || ( ( (*it).event().start().date() != date ) && ( QDateTime::currentDateTime() <= (*it).event().end() ) )
107 // Show repeated event for today that is not elapsed. 107 // Show repeated event for today that is not elapsed.
108 || ( ( (*it).event().repeatType() != Event::NoRepeat ) 108 || ( ( (*it).event().repeatType() != Event::NoRepeat )
109 && ( ( date.dayOfWeek() == (*it).date().dayOfWeek() ) 109 && ( ( date.dayOfWeek() == (*it).date().dayOfWeek() )
110 && ( QTime::currentTime() < (*it).event().start().time() ) ) ) 110 && ( QTime::currentTime() < (*it).event().start().time() ) ) )
111 // Show repeated event for next days. 111 // Show repeated event for next days.
112 || ( ( (*it).event().repeatType() != Event::NoRepeat ) 112 || ( ( (*it).event().repeatType() != Event::NoRepeat )
113 && ( date.dayOfWeek() != (*it).date().dayOfWeek() ) ) 113 && ( date.dayOfWeek() != (*it).date().dayOfWeek() ) )
114 ) 114 )
115 { 115 {
116 count++; 116 count++;
117 // show only later appointments 117 // show only later appointments
118 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine ); 118 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine );
119 m_eventsList.append( l ); 119 m_eventsList.append( l );
120 l->show(); 120 l->show();
121 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); 121 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) );
122 } 122 }
123 } 123 }
124 } 124 }
125 } 125 }
126 if ( m_onlyLater && count == 0 ) { 126 if ( m_onlyLater && count == 0 ) {
127 QLabel* noMoreEvents = new QLabel( this ); 127 QLabel* noMoreEvents = new QLabel( this );
128 m_eventsList.append( noMoreEvents ); 128 m_eventsList.append( noMoreEvents );
129 noMoreEvents->show(); 129 noMoreEvents->show();
130 noMoreEvents->setText( QObject::tr( "No more appointments today" ) ); 130 noMoreEvents->setText( QObject::tr( "No more appointments today" ) );
131 } 131 }
132 } else { 132 } else {
133 QLabel* noEvents = new QLabel( this ); 133 QLabel* noEvents = new QLabel( this );
134 m_eventsList.append( noEvents ); 134 m_eventsList.append( noEvents );
135 noEvents->show(); 135 noEvents->show();
136 noEvents->setText( QObject::tr( "No appointments today" ) ); 136 noEvents->setText( QObject::tr( "No appointments today" ) );
137 } 137 }
138} 138}
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 @@
1/* 1/*
2 * datebookpluginwidget.h 2 * datebookpluginwidget.h
3 * 3 *
4 * copyright : (c) 2002,2003 by Maximilian Reiß 4 * copyright : (c) 2002,2003 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef DATEBOOK_PLUGIN_WIDGET_H 17#ifndef DATEBOOK_PLUGIN_WIDGET_H
18#define DATEBOOK_PLUGIN_WIDGET_H 18#define DATEBOOK_PLUGIN_WIDGET_H
19 19
20#include "datebookevent.h"
21
22#include <opie2/oclickablelabel.h>
23
24#include <qpe/datebookdb.h>
25
20#include <qlayout.h> 26#include <qlayout.h>
21#include <qguardedptr.h> 27#include <qguardedptr.h>
22#include <qlist.h> 28#include <qlist.h>
23 29
24#include <qpe/datebookdb.h> 30using namespace Opie;
25#include <opie/oclickablelabel.h>
26
27#include "datebookevent.h"
28 31
29class DatebookPluginWidget : public QWidget { 32class DatebookPluginWidget : public QWidget {
30 33
31 Q_OBJECT 34 Q_OBJECT
32 35
33public: 36public:
34 DatebookPluginWidget( QWidget *parent, const char *name ); 37 DatebookPluginWidget( QWidget *parent, const char *name );
35 ~DatebookPluginWidget(); 38 ~DatebookPluginWidget();
36 void refresh(); 39 void refresh();
37 void reinitialize(); 40 void reinitialize();
38 41
39private: 42private:
40 DateBookDB* db; 43 DateBookDB* db;
41 QGuardedPtr<QVBoxLayout> m_layoutDates; 44 QGuardedPtr<QVBoxLayout> m_layoutDates;
42 QList<QWidget> m_eventsList; 45 QList<QWidget> m_eventsList;
43 void readConfig(); 46 void readConfig();
44 void getDates(); 47 void getDates();
45 48
46 49
47 // how many lines should be showed in the datebook section 50 // how many lines should be showed in the datebook section
48 int m_max_lines_meet; 51 int m_max_lines_meet;
49 // If location is to be showed too, 1 to activate it. 52 // If location is to be showed too, 1 to activate it.
50 bool m_show_location; 53 bool m_show_location;
51 // if notes should be shown 54 // if notes should be shown