summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-03-01 15:47:43 (UTC)
committer harlekin <harlekin>2004-03-01 15:47:43 (UTC)
commit87676b131aad1bfe979570a48107527db4040020 (patch) (unidiff)
tree9f7ee88adc4b8987e8d3387e2370719078f7ff5e
parentc50e4c32d34a0550f167480b6306aac632fb201c (diff)
downloadopie-87676b131aad1bfe979570a48107527db4040020.zip
opie-87676b131aad1bfe979570a48107527db4040020.tar.gz
opie-87676b131aad1bfe979570a48107527db4040020.tar.bz2
today plus datebook, mail, todolist plugins libopie1->libopie2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/main.cpp5
-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
-rw-r--r--core/pim/today/plugins/mail/mail.pro2
-rw-r--r--core/pim/today/plugins/mail/mailplugin.h9
-rw-r--r--core/pim/today/plugins/mail/mailpluginimpl.cpp4
-rw-r--r--core/pim/today/plugins/mail/mailpluginimpl.h4
-rw-r--r--core/pim/today/plugins/mail/mailpluginwidget.cpp3
-rw-r--r--core/pim/today/plugins/mail/mailpluginwidget.h4
-rw-r--r--core/pim/today/plugins/todolist/todolist.pro2
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.cpp5
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.h13
-rw-r--r--core/pim/today/plugins/todolist/todopluginconfig.h6
-rw-r--r--core/pim/today/plugins/todolist/todopluginimpl.cpp4
-rw-r--r--core/pim/today/plugins/todolist/todopluginimpl.h4
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.cpp2
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.h11
-rw-r--r--core/pim/today/today.cpp4
-rw-r--r--core/pim/today/today.h20
-rw-r--r--core/pim/today/today.pro3
-rw-r--r--core/pim/today/todaybase.cpp7
-rw-r--r--core/pim/today/todaybase.h13
-rw-r--r--core/pim/today/todayconfig.cpp2
-rw-r--r--core/pim/today/todayconfig.h10
33 files changed, 109 insertions, 98 deletions
diff --git a/core/pim/today/main.cpp b/core/pim/today/main.cpp
index d4ec3ce..974c050 100644
--- a/core/pim/today/main.cpp
+++ b/core/pim/today/main.cpp
@@ -1,23 +1,24 @@
1/* 1/*
2 * main.cpp 2 * main.cpp
3 * 3 *
4 * --------------------- 4 * ---------------------
5 * 5 *
6 * begin : Sun 10 17:20:00 CEST 2002 6 * begin : Sun 10 17:20:00 CEST 2002
7 * copyright : (c) 2002 by Maximilian Reiß 7 * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
8 * email : max.reiss@gmx.de 8 * email : max.reiss@gmx.de
9 * 9 *
10 */ 10 */
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19 19
20#include "today.h" 20#include "today.h"
21#include <opie/oapplicationfactory.h> 21
22#include <opie2/oapplicationfactory.h>
22 23
23OPIE_EXPORT_APP( OApplicationFactory<Today> ) 24OPIE_EXPORT_APP( OApplicationFactory<Today> )
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,146 +1,147 @@
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() ) {
47 msg += " <b>" + tr("[with alarm]") +"</b>"; 48 msg += " <b>" + tr("[with alarm]") +"</b>";
48 } 49 }
49 50
50 // include location or not 51 // include location or not
51 if ( show_location ) { 52 if ( show_location ) {
52 msg += "<BR><i>" + (ev).location() + "</i>"; 53 msg += "<BR><i>" + (ev).location() + "</i>";
53 } 54 }
54 55
55 QString timeSpacer = " "; 56 QString timeSpacer = " ";
56 if ( timeExtraLine ) { 57 if ( timeExtraLine ) {
57 timeSpacer = "<br>"; 58 timeSpacer = "<br>";
58 } 59 }
59 60
60 if ( ( TimeString::timeString( QTime( (ev).event().start().time() ) ) == "00:00" ) 61 if ( ( TimeString::timeString( QTime( (ev).event().start().time() ) ) == "00:00" )
61 && ( TimeString::timeString( QTime( (ev).event().end().time() ) ) == "23:59" ) ) { 62 && ( TimeString::timeString( QTime( (ev).event().end().time() ) ) == "23:59" ) ) {
62 msg += tr ( "All day" ); 63 msg += tr ( "All day" );
63 } else { 64 } else {
64 // start time of event 65 // start time of event
65// QDate tempDate = (ev).event().start().date(); 66// QDate tempDate = (ev).event().start().date();
66 msg += timeSpacer; 67 msg += timeSpacer;
67 msg += ampmTime( QTime( (ev).event().start().time() ) ) 68 msg += ampmTime( QTime( (ev).event().start().time() ) )
68 // end time of event 69 // end time of event
69 + "<b> - </b>" + ampmTime( QTime( (ev).event().end().time() ) ); 70 + "<b> - </b>" + ampmTime( QTime( (ev).event().end().time() ) );
70 } 71 }
71 72
72 if ( (ev).date() != QDate::currentDate() ) { 73 if ( (ev).date() != QDate::currentDate() ) {
73 msg += differDate( (ev).date() /* tempDate*/ ); 74 msg += differDate( (ev).date() /* tempDate*/ );
74 } 75 }
75 76
76 // include possible note or not 77 // include possible note or not
77 if ( show_notes ) { 78 if ( show_notes ) {
78 msg += "<br> <i>" + tr("note") + "</i>:" +( (ev).notes() ).mid( 0, maxCharClip ); 79 msg += "<br> <i>" + tr("note") + "</i>:" +( (ev).notes() ).mid( 0, maxCharClip );
79 } 80 }
80 setText( msg ); 81 setText( msg );
81 connect( this, SIGNAL( clicked() ), this, SLOT( editMe() ) ); 82 connect( this, SIGNAL( clicked() ), this, SLOT( editMe() ) );
82} 83}
83 84
84DateBookEvent::~DateBookEvent() { 85DateBookEvent::~DateBookEvent() {
85} 86}
86 87
87/** 88/**
88 * AM/PM timestring conversion. 89 * AM/PM timestring conversion.
89 * @param tm the timestring 90 * @param tm the timestring
90 * @return formatted to am/pm is system is set to it 91 * @return formatted to am/pm is system is set to it
91 */ 92 */
92QString DateBookEvent::ampmTime( QTime tm ) { 93QString DateBookEvent::ampmTime( QTime tm ) {
93 QString s; 94 QString s;
94 if( ampm ) { 95 if( ampm ) {
95 int hour = tm.hour(); 96 int hour = tm.hour();
96 if ( hour == 0 ) { 97 if ( hour == 0 ) {
97 hour = 12; 98 hour = 12;
98 } 99 }
99 if ( hour > 12 ) { 100 if ( hour > 12 ) {
100 hour -= 12; 101 hour -= 12;
101 } 102 }
102 s.sprintf( "%2d:%02d %s", hour, tm.minute(), 103 s.sprintf( "%2d:%02d %s", hour, tm.minute(),
103 (tm.hour() >= 12) ? "PM" : "AM" ); 104 (tm.hour() >= 12) ? "PM" : "AM" );
104 return s; 105 return s;
105 } else { 106 } else {
106 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); 107 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
107 return s; 108 return s;
108 } 109 }
109} 110}
110 111
111QString DateBookEvent::differDate( QDate date ) { 112QString DateBookEvent::differDate( QDate date ) {
112// QDate currentDate = QDate::currentDate(); 113// QDate currentDate = QDate::currentDate();
113 QString returnText = "<font color = #407DD9><b> "; 114 QString returnText = "<font color = #407DD9><b> ";
114// int differDate = currentDate.daysTo( date ); 115// int differDate = currentDate.daysTo( date );
115// if ( currentDate.dayOfWeek() == date.dayOfWeek() ) { 116// if ( currentDate.dayOfWeek() == date.dayOfWeek() ) {
116// returnText += "" ; 117// returnText += "" ;
117// // not working right for recurring events 118// // not working right for recurring events
118// //} else if ( differDate == 1 ) { 119// //} else if ( differDate == 1 ) {
119// //returnText += tr( "tomorrow" ); 120// //returnText += tr( "tomorrow" );
120// } else { 121// } else {
121// returnText += " [ " + Calendar::nameOfDay( date.dayOfWeek() ) + " ] "; 122// returnText += " [ " + Calendar::nameOfDay( date.dayOfWeek() ) + " ] ";
122// } 123// }
123 returnText += " [ " + Calendar::nameOfDay( date.dayOfWeek() ) + " ] "; 124 returnText += " [ " + Calendar::nameOfDay( date.dayOfWeek() ) + " ] ";
124 returnText += "</b></font>"; 125 returnText += "</b></font>";
125 return returnText; 126 return returnText;
126} 127}
127 128
128 129
129/** 130/**
130 * starts the edit dialog as known from datebook 131 * starts the edit dialog as known from datebook
131 */ 132 */
132void DateBookEvent::editEventSlot( const Event &e ) { 133void DateBookEvent::editEventSlot( const Event &e ) {
133 134
134 if ( ODevice::inst()->system() == System_Zaurus ) { 135 if ( ODevice::inst()->system() == System_Zaurus ) {
135 QCopEnvelope env( "QPE/Application/datebook", "raise()" ); 136 QCopEnvelope env( "QPE/Application/datebook", "raise()" );
136 } else { 137 } else {
137 QCopEnvelope env( "QPE/Application/datebook", "editEvent(int)" ); 138 QCopEnvelope env( "QPE/Application/datebook", "editEvent(int)" );
138 env << e.uid(); 139 env << e.uid();
139 } 140 }
140} 141}
141 142
142 143
143void DateBookEvent::editMe() { 144void DateBookEvent::editMe() {
144 emit editEvent( event.event() ); 145 emit editEvent( event.event() );
145} 146}
146 147
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,54 +1,56 @@
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:
47 49
48 QString ampmTime( QTime ); 50 QString ampmTime( QTime );
49 QString differDate( QDate date ); 51 QString differDate( QDate date );
50 const EffectiveEvent event; 52 const EffectiveEvent event;
51 bool ampm; 53 bool ampm;
52}; 54};
53 55
54#endif 56#endif
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,77 +1,74 @@
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 ) {
44 if(!m_widget) { 41 if(!m_widget) {
45 m_widget = new DatebookPluginWidget( wid, "Datebook" ); 42 m_widget = new DatebookPluginWidget( wid, "Datebook" );
46 } 43 }
47 return m_widget; 44 return m_widget;
48} 45}
49 46
50QString DatebookPlugin::pixmapNameConfig() const { 47QString DatebookPlugin::pixmapNameConfig() const {
51 return "datebook/DateBook"; 48 return "datebook/DateBook";
52} 49}
53 50
54TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { 51TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) {
55 return new DatebookPluginConfig( wid , "Datebook" ); 52 return new DatebookPluginConfig( wid , "Datebook" );
56} 53}
57 54
58QString DatebookPlugin::appName() const { 55QString DatebookPlugin::appName() const {
59 return "datebook"; 56 return "datebook";
60} 57}
61 58
62bool DatebookPlugin::excludeFromRefresh() const { 59bool DatebookPlugin::excludeFromRefresh() const {
63 return false; 60 return false;
64} 61}
65 62
66void DatebookPlugin::refresh() { 63void DatebookPlugin::refresh() {
67 if ( m_widget ) { 64 if ( m_widget ) {
68 m_widget->refresh(); 65 m_widget->refresh();
69 } 66 }
70} 67}
71 68
72void DatebookPlugin::reinitialize() { 69void DatebookPlugin::reinitialize() {
73 if ( m_widget ) { 70 if ( m_widget ) {
74 m_widget->reinitialize(); 71 m_widget->reinitialize();
75 } 72 }
76} 73}
77 74
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,73 +1,73 @@
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
29 m_gui = new DatebookPluginConfigBase( this ); 29 m_gui = new DatebookPluginConfigBase( this );
30 30
31 layout->addWidget( m_gui ); 31 layout->addWidget( m_gui );
32 32
33 readConfig(); 33 readConfig();
34} 34}
35 35
36void DatebookPluginConfig::readConfig() { 36void DatebookPluginConfig::readConfig() {
37 Config cfg( "todaydatebookplugin" ); 37 Config cfg( "todaydatebookplugin" );
38 cfg.setGroup( "config" ); 38 cfg.setGroup( "config" );
39 39
40 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); 40 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
41 m_gui->SpinBox1->setValue( m_max_lines_meet ); 41 m_gui->SpinBox1->setValue( m_max_lines_meet );
42 m_show_location = cfg.readNumEntry( "showlocation", 1 ); 42 m_show_location = cfg.readNumEntry( "showlocation", 1 );
43 m_gui->CheckBox1->setChecked( m_show_location ); 43 m_gui->CheckBox1->setChecked( m_show_location );
44 m_show_notes = cfg.readNumEntry( "shownotes", 0 ); 44 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
45 m_gui->CheckBox2->setChecked( m_show_notes ); 45 m_gui->CheckBox2->setChecked( m_show_notes );
46 m_only_later = cfg.readNumEntry( "onlylater", 1 ); 46 m_only_later = cfg.readNumEntry( "onlylater", 1 );
47 m_gui->CheckBox4->setChecked( cfg.readNumEntry( "timeextraline", 1 ) ); 47 m_gui->CheckBox4->setChecked( cfg.readNumEntry( "timeextraline", 1 ) );
48 m_gui->CheckBox3->setChecked( m_only_later ); 48 m_gui->CheckBox3->setChecked( m_only_later );
49 m_more_days = cfg.readNumEntry( "moredays", 0 ); 49 m_more_days = cfg.readNumEntry( "moredays", 0 );
50 m_gui->SpinBox2->setValue( m_more_days ); 50 m_gui->SpinBox2->setValue( m_more_days );
51} 51}
52 52
53 53
54void DatebookPluginConfig::writeConfig() { 54void DatebookPluginConfig::writeConfig() {
55 Config cfg( "todaydatebookplugin" ); 55 Config cfg( "todaydatebookplugin" );
56 cfg.setGroup( "config" ); 56 cfg.setGroup( "config" );
57 57
58 m_max_lines_meet = m_gui->SpinBox1->value(); 58 m_max_lines_meet = m_gui->SpinBox1->value();
59 cfg.writeEntry( "maxlinesmeet", m_max_lines_meet); 59 cfg.writeEntry( "maxlinesmeet", m_max_lines_meet);
60 m_show_location = m_gui->CheckBox1->isChecked(); 60 m_show_location = m_gui->CheckBox1->isChecked();
61 cfg.writeEntry( "showlocation", m_show_location); 61 cfg.writeEntry( "showlocation", m_show_location);
62 m_show_notes = m_gui->CheckBox2->isChecked(); 62 m_show_notes = m_gui->CheckBox2->isChecked();
63 cfg.writeEntry( "shownotes", m_show_notes ); 63 cfg.writeEntry( "shownotes", m_show_notes );
64 m_only_later = m_gui->CheckBox3->isChecked(); 64 m_only_later = m_gui->CheckBox3->isChecked();
65 cfg.writeEntry( "timeextraline", m_gui->CheckBox4->isChecked() ); 65 cfg.writeEntry( "timeextraline", m_gui->CheckBox4->isChecked() );
66 cfg.writeEntry( "onlylater", m_only_later ); 66 cfg.writeEntry( "onlylater", m_only_later );
67 m_more_days = m_gui->SpinBox2->value(); 67 m_more_days = m_gui->SpinBox2->value();
68 cfg.writeEntry( "moredays", m_more_days ); 68 cfg.writeEntry( "moredays", m_more_days );
69 cfg.write(); 69 cfg.write();
70} 70}
71 71
72DatebookPluginConfig::~DatebookPluginConfig() { 72DatebookPluginConfig::~DatebookPluginConfig() {
73} 73}
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,60 +1,63 @@
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;
51 // if notes should be shown 54 // if notes should be shown
52 int m_show_notes; 55 int m_show_notes;
53 // should only later appointments be shown or all for the current day. 56 // should only later appointments be shown or all for the current day.
54 int m_only_later; 57 int m_only_later;
55 int m_more_days; 58 int m_more_days;
56 59
57}; 60};
58 61
59 62
60#endif 63#endif
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,140 +1,140 @@
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;
29 29
30 if ( m_layoutDates ) { 30 if ( m_layoutDates ) {
31 delete m_layoutDates; 31 delete m_layoutDates;
32 } 32 }
33 m_layoutDates = new QVBoxLayout( this ); 33 m_layoutDates = new QVBoxLayout( this );
34 m_layoutDates->setAutoAdd( true ); 34 m_layoutDates->setAutoAdd( true );
35 35
36 m_eventsList.setAutoDelete( true ); 36 m_eventsList.setAutoDelete( true );
37 37
38 readConfig(); 38 readConfig();
39 getDates(); 39 getDates();
40} 40}
41 41
42DatebookPluginWidget::~DatebookPluginWidget() { 42DatebookPluginWidget::~DatebookPluginWidget() {
43 delete db; 43 delete db;
44 delete m_layoutDates; 44 delete m_layoutDates;
45} 45}
46 46
47 47
48void DatebookPluginWidget::readConfig() { 48void DatebookPluginWidget::readConfig() {
49 Config cfg( "todaydatebookplugin" ); 49 Config cfg( "todaydatebookplugin" );
50 cfg.setGroup( "config" ); 50 cfg.setGroup( "config" );
51 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); 51 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
52 m_show_location = cfg.readNumEntry( "showlocation", 1 ); 52 m_show_location = cfg.readNumEntry( "showlocation", 1 );
53 m_show_notes = cfg.readNumEntry( "shownotes", 0 ); 53 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
54 m_onlyLater = cfg.readNumEntry( "onlylater", 1 ); 54 m_onlyLater = cfg.readNumEntry( "onlylater", 1 );
55 m_moreDays = cfg.readNumEntry( "moredays", 0 ); 55 m_moreDays = cfg.readNumEntry( "moredays", 0 );
56 m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 ); 56 m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 );
57} 57}
58 58
59void DatebookPluginWidget::reinitialize() { 59void DatebookPluginWidget::reinitialize() {
60 readConfig(); 60 readConfig();
61 refresh(); 61 refresh();
62} 62}
63 63
64void DatebookPluginWidget::refresh() { 64void DatebookPluginWidget::refresh() {
65 m_eventsList.clear(); 65 m_eventsList.clear();
66 66
67 if ( m_layoutDates ) { 67 if ( m_layoutDates ) {
68 delete m_layoutDates; 68 delete m_layoutDates;
69 } 69 }
70 m_layoutDates = new QVBoxLayout( this ); 70 m_layoutDates = new QVBoxLayout( this );
71 m_layoutDates->setAutoAdd( true ); 71 m_layoutDates->setAutoAdd( true );
72 72
73 getDates(); 73 getDates();
74} 74}
75 75
76/** 76/**
77 * Get all events that are in the datebook xml file for today 77 * Get all events that are in the datebook xml file for today
78 */ 78 */
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}
139 139
140 140
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,60 +1,63 @@
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
52 bool m_show_notes; 55 bool m_show_notes;
53 // should only later appointments be shown or all for the current day. 56 // should only later appointments be shown or all for the current day.
54 bool m_onlyLater; 57 bool m_onlyLater;
55 int m_moreDays; 58 int m_moreDays;
56 // true if time of an appointment should be an extra line 59 // true if time of an appointment should be an extra line
57 bool m_timeExtraLine; 60 bool m_timeExtraLine;
58}; 61};
59 62
60#endif 63#endif
diff --git a/core/pim/today/plugins/mail/mail.pro b/core/pim/today/plugins/mail/mail.pro
index 70c484d..1c3555b 100644
--- a/core/pim/today/plugins/mail/mail.pro
+++ b/core/pim/today/plugins/mail/mail.pro
@@ -1,37 +1,37 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG -= moc 2CONFIG -= moc
3CONFIG += qt release 3CONFIG += qt release
4 4
5# Input 5# Input
6HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h 6HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h
7SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp 7SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp
8 8
9INCLUDEPATH += $(OPIEDIR)/include \ 9INCLUDEPATH += $(OPIEDIR)/include \
10 ../ ../library 10 ../ ../library
11DEPENDPATH += $(OPIEDIR)/include \ 11DEPENDPATH += $(OPIEDIR)/include \
12 ../ ../library 12 ../ ../library
13 13
14LIBS+= -lqpe -lopie 14LIBS+= -lqpe -lopiecore2 -opiepim2
15 15
16DESTDIR = $(OPIEDIR)/plugins/today 16DESTDIR = $(OPIEDIR)/plugins/today
17TARGET = todaymailplugin 17TARGET = todaymailplugin
18 18
19TRANSLATIONS = ../../../../../i18n/de/libtodaymailplugin.ts \ 19TRANSLATIONS = ../../../../../i18n/de/libtodaymailplugin.ts \
20 ../../../../../i18n/nl/libtodaymailplugin.ts \ 20 ../../../../../i18n/nl/libtodaymailplugin.ts \
21 ../../../../../i18n/xx/libtodaymailplugin.ts \ 21 ../../../../../i18n/xx/libtodaymailplugin.ts \
22 ../../../../../i18n/en/libtodaymailplugin.ts \ 22 ../../../../../i18n/en/libtodaymailplugin.ts \
23 ../../../../../i18n/es/libtodaymailplugin.ts \ 23 ../../../../../i18n/es/libtodaymailplugin.ts \
24 ../../../../../i18n/fr/libtodaymailplugin.ts \ 24 ../../../../../i18n/fr/libtodaymailplugin.ts \
25 ../../../../../i18n/hu/libtodaymailplugin.ts \ 25 ../../../../../i18n/hu/libtodaymailplugin.ts \
26 ../../../../../i18n/ja/libtodaymailplugin.ts \ 26 ../../../../../i18n/ja/libtodaymailplugin.ts \
27 ../../../../../i18n/ko/libtodaymailplugin.ts \ 27 ../../../../../i18n/ko/libtodaymailplugin.ts \
28 ../../../../../i18n/no/libtodaymailplugin.ts \ 28 ../../../../../i18n/no/libtodaymailplugin.ts \
29 ../../../../../i18n/pl/libtodaymailplugin.ts \ 29 ../../../../../i18n/pl/libtodaymailplugin.ts \
30 ../../../../../i18n/pt/libtodaymailplugin.ts \ 30 ../../../../../i18n/pt/libtodaymailplugin.ts \
31 ../../../../../i18n/pt_BR/libtodaymailplugin.ts \ 31 ../../../../../i18n/pt_BR/libtodaymailplugin.ts \
32 ../../../../../i18n/sl/libtodaymailplugin.ts \ 32 ../../../../../i18n/sl/libtodaymailplugin.ts \
33 ../../../../../i18n/zh_CN/libtodaymailplugin.ts \ 33 ../../../../../i18n/zh_CN/libtodaymailplugin.ts \
34 ../../../../../i18n/zh_TW/libtodaymailplugin.ts \ 34 ../../../../../i18n/zh_TW/libtodaymailplugin.ts \
35 ../../../../../i18n/it/libtodaymailplugin.ts \ 35 ../../../../../i18n/it/libtodaymailplugin.ts \
36 ../../../../../i18n/da/libtodaymailplugin.ts 36 ../../../../../i18n/da/libtodaymailplugin.ts
37include ( $(OPIEDIR)/include.pro ) 37include ( $(OPIEDIR)/include.pro )
diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h
index 7d6d5e8..1edffef 100644
--- a/core/pim/today/plugins/mail/mailplugin.h
+++ b/core/pim/today/plugins/mail/mailplugin.h
@@ -1,50 +1,53 @@
1/* 1/*
2 * mailplugin.h 2 * mailplugin.h
3 * 3 *
4 * copyright : (c) 2002,2004 by Maximilian Reiß 4 * copyright : (c) 2002,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#ifndef MAIL_PLUGIN_H 18#ifndef MAIL_PLUGIN_H
19#define MAIL_PLUGIN_H 19#define MAIL_PLUGIN_H
20 20
21#include "mailpluginwidget.h"
22
23#include <opie2/todayplugininterface.h>
24#include <opie2/todayconfigwidget.h>
25
21#include <qwidget.h> 26#include <qwidget.h>
22#include <qguardedptr.h> 27#include <qguardedptr.h>
23 28
24#include <opie/todayplugininterface.h>
25#include <opie/todayconfigwidget.h>
26 29
27#include "mailpluginwidget.h" 30
28 31
29class MailPlugin : public TodayPluginObject { 32class MailPlugin : public TodayPluginObject {
30 33
31public: 34public:
32 MailPlugin(); 35 MailPlugin();
33 ~MailPlugin(); 36 ~MailPlugin();
34 37
35 QString pluginName() const; 38 QString pluginName() const;
36 double versionNumber() const; 39 double versionNumber() const;
37 QString pixmapNameWidget() const; 40 QString pixmapNameWidget() const;
38 QWidget* widget(QWidget *); 41 QWidget* widget(QWidget *);
39 QString pixmapNameConfig() const; 42 QString pixmapNameConfig() const;
40 TodayConfigWidget* configWidget(QWidget *); 43 TodayConfigWidget* configWidget(QWidget *);
41 QString appName() const; 44 QString appName() const;
42 bool excludeFromRefresh() const; 45 bool excludeFromRefresh() const;
43 void refresh(); 46 void refresh();
44 void reinitialize(); 47 void reinitialize();
45 48
46 private: 49 private:
47 QGuardedPtr<MailPluginWidget> m_widget; 50 QGuardedPtr<MailPluginWidget> m_widget;
48}; 51};
49 52
50#endif 53#endif
diff --git a/core/pim/today/plugins/mail/mailpluginimpl.cpp b/core/pim/today/plugins/mail/mailpluginimpl.cpp
index dfd3a64..fac27f4 100644
--- a/core/pim/today/plugins/mail/mailpluginimpl.cpp
+++ b/core/pim/today/plugins/mail/mailpluginimpl.cpp
@@ -1,48 +1,48 @@
1/* 1/*
2 * mailpluginimpl.cpp 2 * mailpluginimpl.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 17
18 18
19#include "mailplugin.h" 19#include "mailplugin.h"
20#include "mailpluginimpl.h" 20#include "mailpluginimpl.h"
21 21
22MailPluginImpl::MailPluginImpl() { 22MailPluginImpl::MailPluginImpl() {
23 mailPlugin = new MailPlugin(); 23 mailPlugin = new MailPlugin();
24} 24}
25 25
26MailPluginImpl::~MailPluginImpl() { 26MailPluginImpl::~MailPluginImpl() {
27 delete mailPlugin; 27 delete mailPlugin;
28} 28}
29 29
30 30
31TodayPluginObject* MailPluginImpl::guiPart() { 31TodayPluginObject* MailPluginImpl::guiPart() {
32 return mailPlugin; 32 return mailPlugin;
33} 33}
34 34
35QRESULT MailPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { 35QRESULT MailPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) {
36 *iface = 0; 36 *iface = 0;
37 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { 37 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
38 *iface = this, (*iface)->addRef(); 38 *iface = this, (*iface)->addRef();
39 }else 39 }else
40 return QS_FALSE; 40 return QS_FALSE;
41 41
42 return QS_OK; 42 return QS_OK;
43 43
44} 44}
45 45
46Q_EXPORT_INTERFACE() { 46Q_EXPORT_INTERFACE() {
47 Q_CREATE_INSTANCE( MailPluginImpl ); 47 Q_CREATE_INSTANCE( MailPluginImpl );
48} 48}
diff --git a/core/pim/today/plugins/mail/mailpluginimpl.h b/core/pim/today/plugins/mail/mailpluginimpl.h
index 72e1760..35b3805 100644
--- a/core/pim/today/plugins/mail/mailpluginimpl.h
+++ b/core/pim/today/plugins/mail/mailpluginimpl.h
@@ -1,39 +1,39 @@
1/* 1/*
2 * mailpluginimpl.h 2 * mailpluginimpl.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 MAIL_PLUGIN_IMPL_H 17#ifndef MAIL_PLUGIN_IMPL_H
18#define MAIL_PLUGIN_IMPL_H 18#define MAIL_PLUGIN_IMPL_H
19 19
20#include <opie/todayplugininterface.h> 20#include <opie2/todayplugininterface.h>
21 21
22class MailPlugin; 22class MailPlugin;
23 23
24class MailPluginImpl : public TodayPluginInterface{ 24class MailPluginImpl : public TodayPluginInterface{
25 25
26public: 26public:
27 MailPluginImpl(); 27 MailPluginImpl();
28 virtual ~MailPluginImpl(); 28 virtual ~MailPluginImpl();
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 MailPlugin *mailPlugin; 36 MailPlugin *mailPlugin;
37}; 37};
38 38
39#endif 39#endif
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp
index feecd81..4194270 100644
--- a/core/pim/today/plugins/mail/mailpluginwidget.cpp
+++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp
@@ -1,98 +1,97 @@
1/* 1/*
2 * mailpluginwidget.cpp 2 * mailpluginwidget.cpp
3 * 3 *
4 * copyright : (c) 2002,2003,2004 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#include "mailpluginwidget.h"
16 17
17#include <qpe/config.h> 18#include <qpe/config.h>
18#include <qpe/qcopenvelope_qws.h> 19#include <qpe/qcopenvelope_qws.h>
19 20
20#include "mailpluginwidget.h"
21
22MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) 21MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name)
23 : QWidget(parent, name ) { 22 : QWidget(parent, name ) {
24 23
25 m_mailLabel = 0l; 24 m_mailLabel = 0l;
26 m_layout = 0l; 25 m_layout = 0l;
27 26
28 if ( m_mailLabel ) { 27 if ( m_mailLabel ) {
29 delete m_mailLabel; 28 delete m_mailLabel;
30 } 29 }
31 m_mailLabel = new OClickableLabel( this ); 30 m_mailLabel = new OClickableLabel( this );
32 connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); 31 connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) );
33 32
34 if ( m_layout ) { 33 if ( m_layout ) {
35 delete m_layout; 34 delete m_layout;
36 } 35 }
37 m_layout = new QHBoxLayout( this ); 36 m_layout = new QHBoxLayout( this );
38 m_layout->setAutoAdd( true ); 37 m_layout->setAutoAdd( true );
39 38
40 39
41#if defined(Q_WS_QWS) 40#if defined(Q_WS_QWS)
42#if !defined(QT_NO_COP) 41#if !defined(QT_NO_COP)
43 QCopChannel *qCopChannel = new QCopChannel( "QPE/Pim" , this ); 42 QCopChannel *qCopChannel = new QCopChannel( "QPE/Pim" , this );
44 connect ( qCopChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 43 connect ( qCopChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
45 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 44 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
46#endif 45#endif
47#endif 46#endif
48 47
49 readConfig(); 48 readConfig();
50 getInfo(); 49 getInfo();
51} 50}
52 51
53 52
54void MailPluginWidget::channelReceived( const QCString &msg, const QByteArray & data ) { 53void MailPluginWidget::channelReceived( const QCString &msg, const QByteArray & data ) {
55 QDataStream stream( data, IO_ReadOnly ); 54 QDataStream stream( data, IO_ReadOnly );
56 if ( msg == "outgoingMails(int)" ) { 55 if ( msg == "outgoingMails(int)" ) {
57 stream >> m_outgoing; 56 stream >> m_outgoing;
58 } else if ( msg == "newMails(int)" ) { 57 } else if ( msg == "newMails(int)" ) {
59 stream >> m_newMails; 58 stream >> m_newMails;
60 } 59 }
61 getInfo(); 60 getInfo();
62} 61}
63MailPluginWidget::~MailPluginWidget() { 62MailPluginWidget::~MailPluginWidget() {
64 delete m_mailLabel; 63 delete m_mailLabel;
65 delete m_layout; 64 delete m_layout;
66} 65}
67 66
68 67
69void MailPluginWidget::readConfig() { 68void MailPluginWidget::readConfig() {
70 Config cfg( "todaymailplugin" ); 69 Config cfg( "todaymailplugin" );
71 cfg.setGroup( "config" ); 70 cfg.setGroup( "config" );
72 71
73 Config cfg2( "mail" ); 72 Config cfg2( "mail" );
74 cfg2.setGroup( "Status" ); 73 cfg2.setGroup( "Status" );
75 74
76 m_newMails = cfg2.readNumEntry( "newMails", 0 ); 75 m_newMails = cfg2.readNumEntry( "newMails", 0 );
77 m_outgoing = cfg2.readNumEntry( "outgoing", 0 ); 76 m_outgoing = cfg2.readNumEntry( "outgoing", 0 );
78} 77}
79 78
80 79
81void MailPluginWidget::refresh() { 80void MailPluginWidget::refresh() {
82 getInfo(); 81 getInfo();
83} 82}
84 83
85void MailPluginWidget::getInfo() { 84void MailPluginWidget::getInfo() {
86 85
87 86
88 87
89 m_mailLabel->setText( QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( m_newMails ).arg( m_outgoing ) ); 88 m_mailLabel->setText( QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( m_newMails ).arg( m_outgoing ) );
90} 89}
91 90
92/** 91/**
93 * launches datebook 92 * launches datebook
94 */ 93 */
95void MailPluginWidget::startMail() { 94void MailPluginWidget::startMail() {
96 QCopEnvelope e("QPE/System", "execute(QString)"); 95 QCopEnvelope e("QPE/System", "execute(QString)");
97 e << QString( "opiemail" ); 96 e << QString( "opiemail" );
98} 97}
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.h b/core/pim/today/plugins/mail/mailpluginwidget.h
index 6d16d2c..0ad8738 100644
--- a/core/pim/today/plugins/mail/mailpluginwidget.h
+++ b/core/pim/today/plugins/mail/mailpluginwidget.h
@@ -1,50 +1,52 @@
1/* 1/*
2 * mailpluginwidget.h 2 * mailpluginwidget.h
3 * 3 *
4 * copyright : (c) 2002,2003,2004 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 MAIL_PLUGIN_WIDGET_H 17#ifndef MAIL_PLUGIN_WIDGET_H
18#define MAIL_PLUGIN_WIDGET_H 18#define MAIL_PLUGIN_WIDGET_H
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21 21
22#include <opie/oclickablelabel.h> 22#include <opie2/oclickablelabel.h>
23
24using namespace Opie;
23 25
24class MailPluginWidget : public QWidget { 26class MailPluginWidget : public QWidget {
25 27
26 Q_OBJECT 28 Q_OBJECT
27 29
28public: 30public:
29 MailPluginWidget( QWidget *parent, const char *name ); 31 MailPluginWidget( QWidget *parent, const char *name );
30 ~MailPluginWidget(); 32 ~MailPluginWidget();
31 33
32 void refresh(); 34 void refresh();
33 35
34protected slots: 36protected slots:
35 void startMail(); 37 void startMail();
36 38
37private: 39private:
38 OClickableLabel* m_mailLabel; 40 OClickableLabel* m_mailLabel;
39 QHBoxLayout* m_layout; 41 QHBoxLayout* m_layout;
40 void readConfig(); 42 void readConfig();
41 void getInfo(); 43 void getInfo();
42 44
43 int m_newMails; 45 int m_newMails;
44 int m_outgoing; 46 int m_outgoing;
45 47
46private slots: 48private slots:
47 void channelReceived(const QCString &msg, const QByteArray & data); 49 void channelReceived(const QCString &msg, const QByteArray & data);
48}; 50};
49 51
50#endif 52#endif
diff --git a/core/pim/today/plugins/todolist/todolist.pro b/core/pim/today/plugins/todolist/todolist.pro
index 095247f..8f2f898 100644
--- a/core/pim/today/plugins/todolist/todolist.pro
+++ b/core/pim/today/plugins/todolist/todolist.pro
@@ -1,41 +1,41 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG -= moc 2CONFIG -= moc
3CONFIG += qt plugin release 3CONFIG += qt plugin release
4 4
5# Input 5# Input
6HEADERS = todoplugin.h todopluginimpl.h todopluginconfig.h \ 6HEADERS = todoplugin.h todopluginimpl.h todopluginconfig.h \
7 todopluginwidget.h 7 todopluginwidget.h
8SOURCES = todoplugin.cpp todopluginimpl.cpp todopluginconfig.cpp \ 8SOURCES = todoplugin.cpp todopluginimpl.cpp todopluginconfig.cpp \
9 todopluginwidget.cpp 9 todopluginwidget.cpp
10INTERFACES= todopluginconfigbase.ui 10INTERFACES= todopluginconfigbase.ui
11 11
12INCLUDEPATH += $(OPIEDIR)/include \ 12INCLUDEPATH += $(OPIEDIR)/include \
13 ../ ../library 13 ../ ../library
14DEPENDPATH += $(OPIEDIR)/include \ 14DEPENDPATH += $(OPIEDIR)/include \
15 ../ ../library 15 ../ ../library
16 16
17LIBS+= -lqpe -lopie 17LIBS+= -lqpe -lopiecore2 -lopieui2 -lopiepim2
18 18
19DESTDIR = $(OPIEDIR)/plugins/today 19DESTDIR = $(OPIEDIR)/plugins/today
20TARGET = todaytodolistplugin 20TARGET = todaytodolistplugin
21 21
22TRANSLATIONS = ../../../../../i18n/de/libtodaytodolistplugin.ts \ 22TRANSLATIONS = ../../../../../i18n/de/libtodaytodolistplugin.ts \
23 ../../../../../i18n/nl/libtodaytodolistplugin.ts \ 23 ../../../../../i18n/nl/libtodaytodolistplugin.ts \
24 ../../../../../i18n/xx/libtodaytodolistplugin.ts \ 24 ../../../../../i18n/xx/libtodaytodolistplugin.ts \
25 ../../../../../i18n/en/libtodaytodolistplugin.ts \ 25 ../../../../../i18n/en/libtodaytodolistplugin.ts \
26 ../../../../../i18n/es/libtodaytodolistplugin.ts \ 26 ../../../../../i18n/es/libtodaytodolistplugin.ts \
27 ../../../../../i18n/fr/libtodaytodolistplugin.ts \ 27 ../../../../../i18n/fr/libtodaytodolistplugin.ts \
28 ../../../../../i18n/hu/libtodaytodolistplugin.ts \ 28 ../../../../../i18n/hu/libtodaytodolistplugin.ts \
29 ../../../../../i18n/ja/libtodaytodolistplugin.ts \ 29 ../../../../../i18n/ja/libtodaytodolistplugin.ts \
30 ../../../../../i18n/ko/libtodaytodolistplugin.ts \ 30 ../../../../../i18n/ko/libtodaytodolistplugin.ts \
31 ../../../../../i18n/no/libtodaytodolistplugin.ts \ 31 ../../../../../i18n/no/libtodaytodolistplugin.ts \
32 ../../../../../i18n/pl/libtodaytodolistplugin.ts \ 32 ../../../../../i18n/pl/libtodaytodolistplugin.ts \
33 ../../../../../i18n/pt/libtodaytodolistplugin.ts \ 33 ../../../../../i18n/pt/libtodaytodolistplugin.ts \
34 ../../../../../i18n/pt_BR/libtodaytodolistplugin.ts \ 34 ../../../../../i18n/pt_BR/libtodaytodolistplugin.ts \
35 ../../../../../i18n/sl/libtodaytodolistplugin.ts \ 35 ../../../../../i18n/sl/libtodaytodolistplugin.ts \
36 ../../../../../i18n/zh_CN/libtodaytodolistplugin.ts \ 36 ../../../../../i18n/zh_CN/libtodaytodolistplugin.ts \
37 ../../../../../i18n/zh_TW/libtodaytodolistplugin.ts \ 37 ../../../../../i18n/zh_TW/libtodaytodolistplugin.ts \
38 ../../../../../i18n/it/libtodaytodolistplugin.ts \ 38 ../../../../../i18n/it/libtodaytodolistplugin.ts \
39 ../../../../../i18n/da/libtodaytodolistplugin.ts 39 ../../../../../i18n/da/libtodaytodolistplugin.ts
40 40
41include ( $(OPIEDIR)/include.pro ) 41include ( $(OPIEDIR)/include.pro )
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp
index 801de9d..5783814 100644
--- a/core/pim/today/plugins/todolist/todoplugin.cpp
+++ b/core/pim/today/plugins/todolist/todoplugin.cpp
@@ -1,76 +1,73 @@
1/* 1/*
2 * todoplugin.cpp 2 * todoplugin.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
18
19#include "todoplugin.h" 17#include "todoplugin.h"
20#include "todopluginconfig.h" 18#include "todopluginconfig.h"
21 19
22
23TodolistPlugin::TodolistPlugin() { 20TodolistPlugin::TodolistPlugin() {
24} 21}
25 22
26TodolistPlugin::~TodolistPlugin() { 23TodolistPlugin::~TodolistPlugin() {
27 delete (TodolistPluginWidget*)m_widget; 24 delete (TodolistPluginWidget*)m_widget;
28} 25}
29 26
30QString TodolistPlugin::pluginName() const { 27QString TodolistPlugin::pluginName() const {
31 return QObject::tr( "Todolist plugin" ); 28 return QObject::tr( "Todolist plugin" );
32} 29}
33 30
34double TodolistPlugin::versionNumber() const { 31double TodolistPlugin::versionNumber() const {
35 return 0.9; 32 return 0.9;
36} 33}
37 34
38QString TodolistPlugin::pixmapNameWidget() const { 35QString TodolistPlugin::pixmapNameWidget() const {
39 return "todo/TodoList"; 36 return "todo/TodoList";
40} 37}
41 38
42QWidget* TodolistPlugin::widget( QWidget *wid ) { 39QWidget* TodolistPlugin::widget( QWidget *wid ) {
43 if(!m_widget) { 40 if(!m_widget) {
44 m_widget = new TodolistPluginWidget( wid, "Todolist" ); 41 m_widget = new TodolistPluginWidget( wid, "Todolist" );
45 } 42 }
46 return m_widget; 43 return m_widget;
47} 44}
48 45
49QString TodolistPlugin::pixmapNameConfig() const { 46QString TodolistPlugin::pixmapNameConfig() const {
50 return "todo/TodoList"; 47 return "todo/TodoList";
51} 48}
52 49
53TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { 50TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) {
54 return new TodolistPluginConfig( wid , "Todolist" ); 51 return new TodolistPluginConfig( wid , "Todolist" );
55} 52}
56 53
57QString TodolistPlugin::appName() const { 54QString TodolistPlugin::appName() const {
58 return "todolist"; 55 return "todolist";
59} 56}
60 57
61 58
62bool TodolistPlugin::excludeFromRefresh() const { 59bool TodolistPlugin::excludeFromRefresh() const {
63 return false; 60 return false;
64} 61}
65 62
66void TodolistPlugin::refresh() { 63void TodolistPlugin::refresh() {
67 if ( m_widget ) { 64 if ( m_widget ) {
68 m_widget->refresh(); 65 m_widget->refresh();
69 } 66 }
70} 67}
71 68
72void TodolistPlugin::reinitialize() { 69void TodolistPlugin::reinitialize() {
73 if ( m_widget ) { 70 if ( m_widget ) {
74 m_widget->reinitialize(); 71 m_widget->reinitialize();
75 } 72 }
76} 73}
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h
index f68162f..bea15d5 100644
--- a/core/pim/today/plugins/todolist/todoplugin.h
+++ b/core/pim/today/plugins/todolist/todoplugin.h
@@ -1,50 +1,53 @@
1/* 1/*
2 * todoplugin.h 2 * todoplugin.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 TODOLIST_PLUGIN_H 17#ifndef TODOLIST_PLUGIN_H
18#define TODOLIST_PLUGIN_H 18#define TODOLIST_PLUGIN_H
19 19
20
21#include "todopluginwidget.h"
22
23#include <opie2/oclickablelabel.h>
24#include <opie2/todayplugininterface.h>
25
20#include <qstring.h> 26#include <qstring.h>
21#include <qguardedptr.h> 27#include <qguardedptr.h>
22#include <qwidget.h> 28#include <qwidget.h>
23 29
24#include <opie/oclickablelabel.h> 30using namespace Opie;
25#include <opie/todayplugininterface.h>
26
27#include "todopluginwidget.h"
28 31
29class TodolistPlugin : public TodayPluginObject { 32class TodolistPlugin : public TodayPluginObject {
30 33
31public: 34public:
32 TodolistPlugin(); 35 TodolistPlugin();
33 ~TodolistPlugin(); 36 ~TodolistPlugin();
34 37
35 QString pluginName() const; 38 QString pluginName() const;
36 double versionNumber() const; 39 double versionNumber() const;
37 QString pixmapNameWidget() const; 40 QString pixmapNameWidget() const;
38 QWidget* widget(QWidget *); 41 QWidget* widget(QWidget *);
39 QString pixmapNameConfig() const; 42 QString pixmapNameConfig() const;
40 TodayConfigWidget* configWidget(QWidget *); 43 TodayConfigWidget* configWidget(QWidget *);
41 QString appName() const; 44 QString appName() const;
42 bool excludeFromRefresh() const; 45 bool excludeFromRefresh() const;
43 void refresh(); 46 void refresh();
44 void reinitialize(); 47 void reinitialize();
45 48
46 private: 49 private:
47 QGuardedPtr<TodolistPluginWidget> m_widget; 50 QGuardedPtr<TodolistPluginWidget> m_widget;
48}; 51};
49 52
50#endif 53#endif
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h
index a2d7d2c..7040369 100644
--- a/core/pim/today/plugins/todolist/todopluginconfig.h
+++ b/core/pim/today/plugins/todolist/todopluginconfig.h
@@ -1,58 +1,58 @@
1/* 1/*
2 * todopluginconfig.h 2 * todopluginconfig.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 TODOLIST_PLUGIN_CONFIG_H 17#ifndef TODOLIST_PLUGIN_CONFIG_H
18#define TODOLIST_PLUGIN_CONFIG_H 18#define TODOLIST_PLUGIN_CONFIG_H
19 19
20#include <qspinbox.h> 20#include "todopluginconfigbase.h"
21 21
22#include <opie/todayconfigwidget.h> 22#include <opie2/todayconfigwidget.h>
23 23
24#include "todopluginconfigbase.h" 24#include <qspinbox.h>
25 25
26class TodolistPluginConfig : public TodayConfigWidget { 26class TodolistPluginConfig : public TodayConfigWidget {
27 Q_OBJECT 27 Q_OBJECT
28 28
29public: 29public:
30 30
31 TodolistPluginConfig( QWidget *parent, const char *name ); 31 TodolistPluginConfig( QWidget *parent, const char *name );
32 ~TodolistPluginConfig(); 32 ~TodolistPluginConfig();
33 33
34private: 34private:
35 /** 35 /**
36 * if changed then save 36 * if changed then save
37 */ 37 */
38 bool changed(); 38 bool changed();
39 void readConfig(); 39 void readConfig();
40 void writeConfig(); 40 void writeConfig();
41 41
42 TodoPluginConfigBase *m_gui; 42 TodoPluginConfigBase *m_gui;
43 43
44 44
45 // how many lines should be showed in the todolist section 45 // how many lines should be showed in the todolist section
46 int m_max_lines_task; 46 int m_max_lines_task;
47 // clip the lines after X chars 47 // clip the lines after X chars
48 int m_maxCharClip; 48 int m_maxCharClip;
49 49
50 50
51 51
52}; 52};
53 53
54 54
55 55
56 56
57 57
58#endif 58#endif
diff --git a/core/pim/today/plugins/todolist/todopluginimpl.cpp b/core/pim/today/plugins/todolist/todopluginimpl.cpp
index 639587f..1a6189f 100644
--- a/core/pim/today/plugins/todolist/todopluginimpl.cpp
+++ b/core/pim/today/plugins/todolist/todopluginimpl.cpp
@@ -1,46 +1,46 @@
1/* 1/*
2 * todopluginimpl.cpp 2 * todopluginimpl.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 "todoplugin.h" 17#include "todoplugin.h"
18#include "todopluginimpl.h" 18#include "todopluginimpl.h"
19 19
20TodolistPluginImpl::TodolistPluginImpl() { 20TodolistPluginImpl::TodolistPluginImpl() {
21 todolistPlugin = new TodolistPlugin(); 21 todolistPlugin = new TodolistPlugin();
22} 22}
23 23
24TodolistPluginImpl::~TodolistPluginImpl() { 24TodolistPluginImpl::~TodolistPluginImpl() {
25 delete todolistPlugin; 25 delete todolistPlugin;
26} 26}
27 27
28 28
29TodayPluginObject* TodolistPluginImpl::guiPart() { 29TodayPluginObject* TodolistPluginImpl::guiPart() {
30 return todolistPlugin; 30 return todolistPlugin;
31} 31}
32 32
33QRESULT TodolistPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { 33QRESULT TodolistPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) {
34 *iface = 0; 34 *iface = 0;
35 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { 35 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
36 *iface = this, (*iface)->addRef(); 36 *iface = this, (*iface)->addRef();
37 }else 37 }else
38 return QS_FALSE; 38 return QS_FALSE;
39 39
40 return QS_OK; 40 return QS_OK;
41 41
42} 42}
43 43
44Q_EXPORT_INTERFACE() { 44Q_EXPORT_INTERFACE() {
45 Q_CREATE_INSTANCE( TodolistPluginImpl ); 45 Q_CREATE_INSTANCE( TodolistPluginImpl );
46} 46}
diff --git a/core/pim/today/plugins/todolist/todopluginimpl.h b/core/pim/today/plugins/todolist/todopluginimpl.h
index ca62fdb..f9b0b37 100644
--- a/core/pim/today/plugins/todolist/todopluginimpl.h
+++ b/core/pim/today/plugins/todolist/todopluginimpl.h
@@ -1,39 +1,39 @@
1/* 1/*
2 * todopluginimpl.h 2 * todopluginimpl.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 TODOLIST_PLUGIN_IMPL_H 17#ifndef TODOLIST_PLUGIN_IMPL_H
18#define TODOLIST_PLUGIN_IMPL_H 18#define TODOLIST_PLUGIN_IMPL_H
19 19
20#include <opie/todayplugininterface.h> 20#include <opie2/todayplugininterface.h>
21 21
22class TodolistPlugin; 22class TodolistPlugin;
23 23
24class TodolistPluginImpl : public TodayPluginInterface{ 24class TodolistPluginImpl : public TodayPluginInterface{
25 25
26public: 26public:
27 TodolistPluginImpl(); 27 TodolistPluginImpl();
28 virtual ~TodolistPluginImpl(); 28 virtual ~TodolistPluginImpl();
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 TodolistPlugin *todolistPlugin; 36 TodolistPlugin *todolistPlugin;
37}; 37};
38 38
39#endif 39#endif
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp
index 0364f94..567c70f 100644
--- a/core/pim/today/plugins/todolist/todopluginwidget.cpp
+++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp
@@ -1,138 +1,138 @@
1/* 1/*
2 * todopluginwidget.cpp 2 * todopluginwidget.cpp
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#include "todopluginwidget.h" 17#include "todopluginwidget.h"
18 18
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/qcopenvelope_qws.h> 20#include <qpe/qcopenvelope_qws.h>
21 21
22TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) 22TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
23 : QWidget( parent, name ) { 23 : QWidget( parent, name ) {
24 24
25 todo = 0l; 25 todo = 0l;
26 layoutTodo = 0l; 26 layoutTodo = 0l;
27 todoLabel = 0l; 27 todoLabel = 0l;
28 28
29 if ( todo ) { 29 if ( todo ) {
30 delete todo; 30 delete todo;
31 } 31 }
32 todo = new OTodoAccess(); 32 todo = new OPimTodoAccess();
33 todo->load(); 33 todo->load();
34 34
35 if ( layoutTodo ) { 35 if ( layoutTodo ) {
36 delete layoutTodo; 36 delete layoutTodo;
37 } 37 }
38 layoutTodo = new QVBoxLayout( this ); 38 layoutTodo = new QVBoxLayout( this );
39 layoutTodo->setAutoAdd( true ); 39 layoutTodo->setAutoAdd( true );
40 40
41 if ( todoLabel ) { 41 if ( todoLabel ) {
42 delete todoLabel; 42 delete todoLabel;
43 } 43 }
44 todoLabel = new OClickableLabel( this ); 44 todoLabel = new OClickableLabel( this );
45 45
46 connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); 46 connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) );
47 47
48 readConfig(); 48 readConfig();
49 getTodo(); 49 getTodo();
50} 50}
51 51
52TodolistPluginWidget::~TodolistPluginWidget() { 52TodolistPluginWidget::~TodolistPluginWidget() {
53 delete todo; 53 delete todo;
54 delete todoLabel; 54 delete todoLabel;
55 delete layoutTodo; 55 delete layoutTodo;
56} 56}
57 57
58 58
59void TodolistPluginWidget::readConfig() { 59void TodolistPluginWidget::readConfig() {
60 Config cfg( "todaytodoplugin" ); 60 Config cfg( "todaytodoplugin" );
61 cfg.setGroup( "config" ); 61 cfg.setGroup( "config" );
62 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); 62 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 );
63 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 63 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
64} 64}
65 65
66void TodolistPluginWidget:: refresh() { 66void TodolistPluginWidget:: refresh() {
67 todo->reload(); 67 todo->reload();
68 getTodo(); 68 getTodo();
69} 69}
70 70
71void TodolistPluginWidget::reinitialize() { 71void TodolistPluginWidget::reinitialize() {
72 readConfig(); 72 readConfig();
73 todo->reload(); 73 todo->reload();
74 getTodo(); 74 getTodo();
75} 75}
76 76
77/** 77/**
78 * Get the todos 78 * Get the todos
79 */ 79 */
80void TodolistPluginWidget::getTodo() { 80void TodolistPluginWidget::getTodo() {
81 81
82 82
83 QString output; 83 QString output;
84 QString tmpout; 84 QString tmpout;
85 int count = 0; 85 int count = 0;
86 int ammount = 0; 86 int ammount = 0;
87 87
88 // get overdue todos first 88 // get overdue todos first
89 m_list = todo->sorted( true, 3, 2, 1); 89 m_list = todo->sorted( true, 3, 2, 1);
90 90
91 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 91 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
92 if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) { 92 if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) {
93 QString desc = (*m_it).summary(); 93 QString desc = (*m_it).summary();
94 if( desc.isEmpty() ) { 94 if( desc.isEmpty() ) {
95 desc = (*m_it).description(); 95 desc = (*m_it).description();
96 } 96 }
97 tmpout += "<font color=#e00000><b>[" + QString("%1").arg((*m_it).priority() ) + "]" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; 97 tmpout += "<font color=#e00000><b>[" + QString("%1").arg((*m_it).priority() ) + "]" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>";
98 ammount++ ; 98 ammount++ ;
99 } 99 }
100 } 100 }
101 101
102 // get total number of still open todos 102 // get total number of still open todos
103 m_list = todo->sorted( true, 1, 4, 1); 103 m_list = todo->sorted( true, 1, 4, 1);
104 104
105 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 105 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
106 count +=1; 106 count +=1;
107 // not the overdues, we allready got them, and not if we are 107 // not the overdues, we allready got them, and not if we are
108 // over the maxlines 108 // over the maxlines
109 if ( !(*m_it).isOverdue() && ( ammount < m_maxLinesTask ) ) { 109 if ( !(*m_it).isOverdue() && ( ammount < m_maxLinesTask ) ) {
110 QString desc = (*m_it).summary(); 110 QString desc = (*m_it).summary();
111 if( desc.isEmpty() ) { 111 if( desc.isEmpty() ) {
112 desc = (*m_it).description(); 112 desc = (*m_it).description();
113 } 113 }
114 tmpout += "<b> [" + QString("%1").arg((*m_it).priority() ) + "] </b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; 114 tmpout += "<b> [" + QString("%1").arg((*m_it).priority() ) + "] </b>" + desc.mid( 0, m_maxCharClip ) + "<br>";
115 ammount++; 115 ammount++;
116 } 116 }
117 } 117 }
118 118
119 if ( count > 0 ) { 119 if ( count > 0 ) {
120 if( count == 1 ) { 120 if( count == 1 ) {
121 output += QObject::tr( "There is <b> 1</b> active task: <br>" ); 121 output += QObject::tr( "There is <b> 1</b> active task: <br>" );
122 } else { 122 } else {
123 output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg( count ); 123 output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg( count );
124 } 124 }
125 output += tmpout; 125 output += tmpout;
126 } else { 126 } else {
127 output = QObject::tr( "No active tasks" ); 127 output = QObject::tr( "No active tasks" );
128 } 128 }
129 todoLabel->setText( output ); 129 todoLabel->setText( output );
130} 130}
131 131
132/** 132/**
133 * start the todolist 133 * start the todolist
134 */ 134 */
135void TodolistPluginWidget::startTodolist() { 135void TodolistPluginWidget::startTodolist() {
136 QCopEnvelope e( "QPE/System", "execute(QString)" ); 136 QCopEnvelope e( "QPE/System", "execute(QString)" );
137 e << QString( "todolist" ); 137 e << QString( "todolist" );
138} 138}
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.h b/core/pim/today/plugins/todolist/todopluginwidget.h
index 9cac43d..a020cf4 100644
--- a/core/pim/today/plugins/todolist/todopluginwidget.h
+++ b/core/pim/today/plugins/todolist/todopluginwidget.h
@@ -1,54 +1,55 @@
1/* 1/*
2 * todopluginwidget.h 2 * todopluginwidget.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 TODOLIST_PLUGIN_WIDGET_H 17#ifndef TODOLIST_PLUGIN_WIDGET_H
18#define TODOLIST_PLUGIN_WIDGET_H 18#define TODOLIST_PLUGIN_WIDGET_H
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21 21
22#include <opie/otodoaccess.h> 22#include <opie2/otodoaccess.h>
23#include <opie/oclickablelabel.h> 23#include <opie2/oclickablelabel.h>
24 24
25using namespace Opie;
25 26
26class TodolistPluginWidget : public QWidget { 27class TodolistPluginWidget : public QWidget {
27 28
28 Q_OBJECT 29 Q_OBJECT
29 30
30public: 31public:
31 TodolistPluginWidget( QWidget *parent, const char *name ); 32 TodolistPluginWidget( QWidget *parent, const char *name );
32 ~TodolistPluginWidget(); 33 ~TodolistPluginWidget();
33 34
34 void refresh(); 35 void refresh();
35 void reinitialize(); 36 void reinitialize();
36 37
37protected slots: 38protected slots:
38 void startTodolist(); 39 void startTodolist();
39 40
40private: 41private:
41 OClickableLabel *todoLabel; 42 OClickableLabel *todoLabel;
42 QVBoxLayout* layoutTodo; 43 QVBoxLayout* layoutTodo;
43 44
44 OTodoAccess *todo; 45 OPimTodoAccess *todo;
45 OTodoAccess::List m_list; 46 OPimTodoAccess::List m_list;
46 OTodoAccess::List::Iterator m_it; 47 OPimTodoAccess::List::Iterator m_it;
47 48
48 void readConfig(); 49 void readConfig();
49 void getTodo(); 50 void getTodo();
50 int m_maxLinesTask; 51 int m_maxLinesTask;
51 int m_maxCharClip; 52 int m_maxCharClip;
52}; 53};
53 54
54#endif 55#endif
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index c83a5df..b55a4a7 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -1,478 +1,476 @@
1/* 1/*
2 * today.cpp 2 * today.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
18
19#define QTOPIA_INTERNAL_LANGLIST 17#define QTOPIA_INTERNAL_LANGLIST
20 18
21#include "today.h" 19#include "today.h"
22 20
23#include <qpe/config.h> 21#include <qpe/config.h>
24#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
25#include <qpe/resource.h> 23#include <qpe/resource.h>
26#include <qpe/global.h> 24#include <qpe/global.h>
27#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
28#include <qpe/contact.h> 26#include <qpe/contact.h>
29 27
30#include <qdir.h> 28#include <qdir.h>
31#include <qtimer.h> 29#include <qtimer.h>
32#include <qwhatsthis.h> 30#include <qwhatsthis.h>
33 31
34struct TodayPlugin { 32struct TodayPlugin {
35 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} 33 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
36 QLibrary *library; 34 QLibrary *library;
37 QInterfacePtr<TodayPluginInterface> iface; 35 QInterfacePtr<TodayPluginInterface> iface;
38 TodayPluginObject *guiPart; 36 TodayPluginObject *guiPart;
39 QWidget *guiBox; 37 QWidget *guiBox;
40 QString name; 38 QString name;
41 bool active; 39 bool active;
42 bool excludeRefresh; 40 bool excludeRefresh;
43 int pos; 41 int pos;
44}; 42};
45 43
46static QValueList<TodayPlugin> pluginList; 44static QValueList<TodayPlugin> pluginList;
47 45
48static QMap<QString, TodayPlugin> tempList; 46static QMap<QString, TodayPlugin> tempList;
49 47
50Today::Today( QWidget* parent, const char* name, WFlags fl ) 48Today::Today( QWidget* parent, const char* name, WFlags fl )
51 : TodayBase( parent, name, fl ) { 49 : TodayBase( parent, name, fl ) {
52 50
53 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 51 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
54 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 52 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
55 53
56#if defined(Q_WS_QWS) 54#if defined(Q_WS_QWS)
57#if !defined(QT_NO_COP) 55#if !defined(QT_NO_COP)
58 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 56 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
59 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 57 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
60 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 58 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
61#endif 59#endif
62#endif 60#endif
63 61
64 setOwnerField(); 62 setOwnerField();
65 m_refreshTimer = new QTimer( this ); 63 m_refreshTimer = new QTimer( this );
66 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 64 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
67 m_refreshTimer->start( 15000 ); 65 m_refreshTimer->start( 15000 );
68 m_big_box = 0L; 66 m_big_box = 0L;
69 67
70 68
71 layout = new QVBoxLayout( this ); 69 layout = new QVBoxLayout( this );
72 layout->addWidget( Frame ); 70 layout->addWidget( Frame );
73 layout->addWidget( OwnerField ); 71 layout->addWidget( OwnerField );
74 72
75 m_sv = new QScrollView( this ); 73 m_sv = new QScrollView( this );
76 m_sv->setResizePolicy( QScrollView::AutoOneFit ); 74 m_sv->setResizePolicy( QScrollView::AutoOneFit );
77 m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); 75 m_sv->setHScrollBarMode( QScrollView::AlwaysOff );
78 m_sv->setFrameShape( QFrame::NoFrame ); 76 m_sv->setFrameShape( QFrame::NoFrame );
79 77
80 layout->addWidget( m_sv ); 78 layout->addWidget( m_sv );
81 layout->setStretchFactor( m_sv,4 ); 79 layout->setStretchFactor( m_sv,4 );
82 80
83 qApp->processEvents(); 81 qApp->processEvents();
84 loadPlugins(); 82 loadPlugins();
85 QPEApplication::showWidget( this ); 83 QPEApplication::showWidget( this );
86} 84}
87 85
88/** 86/**
89 * Qcop receive method. 87 * Qcop receive method.
90 */ 88 */
91void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 89void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
92 QDataStream stream( data, IO_ReadOnly ); 90 QDataStream stream( data, IO_ReadOnly );
93 if ( msg == "message(QString)" ) { 91 if ( msg == "message(QString)" ) {
94 QString message; 92 QString message;
95 stream >> message; 93 stream >> message;
96 setOwnerField( message ); 94 setOwnerField( message );
97 } 95 }
98} 96}
99 97
100void Today::setRefreshTimer( int interval ) { 98void Today::setRefreshTimer( int interval ) {
101 99
102 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 100 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
103 101
104 // 0 is "never" case 102 // 0 is "never" case
105 if ( !interval == 0 ) { 103 if ( !interval == 0 ) {
106 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 104 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
107 m_refreshTimer->changeInterval( interval ); 105 m_refreshTimer->changeInterval( interval );
108 } 106 }
109} 107}
110 108
111 109
112/** 110/**
113 * Initialises the owner field with the default value, the username 111 * Initialises the owner field with the default value, the username
114 */ 112 */
115void Today::setOwnerField() { 113void Today::setOwnerField() {
116 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 114 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
117 if ( QFile::exists( file ) ) { 115 if ( QFile::exists( file ) ) {
118 Contact cont = Contact::readVCard( file )[0]; 116 Contact cont = Contact::readVCard( file )[0];
119 QString returnString = cont.fullName(); 117 QString returnString = cont.fullName();
120 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 118 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
121 } else { 119 } else {
122 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 120 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
123 } 121 }
124} 122}
125 123
126/** 124/**
127 * Set the owner field with a given QString, for example per qcop. 125 * Set the owner field with a given QString, for example per qcop.
128 */ 126 */
129void Today::setOwnerField( QString &message ) { 127void Today::setOwnerField( QString &message ) {
130 if ( !message.isEmpty() ) { 128 if ( !message.isEmpty() ) {
131 OwnerField->setText( "<b>" + message + "</b>" ); 129 OwnerField->setText( "<b>" + message + "</b>" );
132 } 130 }
133} 131}
134 132
135/** 133/**
136 * Init stuff needed for today. Reads the config file. 134 * Init stuff needed for today. Reads the config file.
137 */ 135 */
138void Today::init() { 136void Today::init() {
139 // read config 137 // read config
140 Config cfg( "today" ); 138 Config cfg( "today" );
141 139
142 cfg.setGroup( "Plugins" ); 140 cfg.setGroup( "Plugins" );
143 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 141 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
144 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 142 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
145 143
146 cfg.setGroup( "General" ); 144 cfg.setGroup( "General" );
147 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 145 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
148 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); 146 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 );
149 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); 147 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
150 148
151 // set the date in top label 149 // set the date in top label
152 QDate date = QDate::currentDate(); 150 QDate date = QDate::currentDate();
153 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); 151 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) );
154 152
155 if ( m_hideBanner ) { 153 if ( m_hideBanner ) {
156 Opiezilla->hide(); 154 Opiezilla->hide();
157 TodayLabel->hide(); 155 TodayLabel->hide();
158 } else { 156 } else {
159 Opiezilla->show(); 157 Opiezilla->show();
160 TodayLabel->show(); 158 TodayLabel->show();
161 } 159 }
162 160
163 if ( m_big_box ) { 161 if ( m_big_box ) {
164 delete m_big_box; 162 delete m_big_box;
165 } 163 }
166 164
167 m_big_box = new QWidget( m_sv->viewport() ); 165 m_big_box = new QWidget( m_sv->viewport() );
168 m_sv->addChild( m_big_box ); 166 m_sv->addChild( m_big_box );
169 m_bblayout = new QVBoxLayout ( m_big_box ); 167 m_bblayout = new QVBoxLayout ( m_big_box );
170} 168}
171 169
172/** 170/**
173 * Load the plugins 171 * Load the plugins
174 */ 172 */
175void Today::loadPlugins() { 173void Today::loadPlugins() {
176 174
177 init(); 175 init();
178 176
179 QValueList<TodayPlugin>::Iterator tit; 177 QValueList<TodayPlugin>::Iterator tit;
180 if ( !pluginList.isEmpty() ) { 178 if ( !pluginList.isEmpty() ) {
181 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 179 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
182 (*tit).guiBox->hide(); 180 (*tit).guiBox->hide();
183 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); 181 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
184 delete (*tit).guiBox; 182 delete (*tit).guiBox;
185 (*tit).library->unload(); 183 (*tit).library->unload();
186 delete (*tit).library; 184 delete (*tit).library;
187 } 185 }
188 pluginList.clear(); 186 pluginList.clear();
189 } 187 }
190 188
191 QString path = QPEApplication::qpeDir() + "/plugins/today"; 189 QString path = QPEApplication::qpeDir() + "/plugins/today";
192#ifdef Q_OS_MACX 190#ifdef Q_OS_MACX
193 qWarning("Searching for Plugins in: %s", path.latin1()); 191 qWarning("Searching for Plugins in: %s", path.latin1());
194 QDir dir( path, "lib*.dylib" ); 192 QDir dir( path, "lib*.dylib" );
195#else 193#else
196 QDir dir( path, "lib*.so" ); 194 QDir dir( path, "lib*.so" );
197#endif 195#endif
198 196
199 QStringList list = dir.entryList(); 197 QStringList list = dir.entryList();
200 QStringList::Iterator it; 198 QStringList::Iterator it;
201 199
202 // QMap<QString, TodayPlugin> tempList; 200 // QMap<QString, TodayPlugin> tempList;
203 201
204 for ( it = list.begin(); it != list.end(); ++it ) { 202 for ( it = list.begin(); it != list.end(); ++it ) {
205 QInterfacePtr<TodayPluginInterface> iface; 203 QInterfacePtr<TodayPluginInterface> iface;
206 QLibrary *lib = new QLibrary( path + "/" + *it ); 204 QLibrary *lib = new QLibrary( path + "/" + *it );
207 205
208 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 206 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
209 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 207 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
210 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); 208 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
211 qDebug( QString(*it) ); 209 qDebug( QString(*it) );
212 210
213 TodayPlugin plugin; 211 TodayPlugin plugin;
214 plugin.library = lib; 212 plugin.library = lib;
215 plugin.iface = iface; 213 plugin.iface = iface;
216 plugin.name = QString(*it); 214 plugin.name = QString(*it);
217 215
218 QString type = (*it).left( (*it).find(".") ); 216 QString type = (*it).left( (*it).find(".") );
219 217
220 QString lang; 218 QString lang;
221 Config config("locale"); 219 Config config("locale");
222 config.setGroup("Language"); 220 config.setGroup("Language");
223 lang = config.readEntry( "Language", "en" ); 221 lang = config.readEntry( "Language", "en" );
224 222
225 qDebug( "Languages: " + lang ); 223 qDebug( "Languages: " + lang );
226 QTranslator * trans = new QTranslator( qApp ); 224 QTranslator * trans = new QTranslator( qApp );
227 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; 225 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
228 if ( trans->load( tfn ) ) { 226 if ( trans->load( tfn ) ) {
229 qApp->installTranslator( trans ); 227 qApp->installTranslator( trans );
230 } else { 228 } else {
231 delete trans; 229 delete trans;
232 } 230 }
233 231
234 232
235 // find out if plugins should be shown 233 // find out if plugins should be shown
236 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 234 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
237 plugin.active = true; 235 plugin.active = true;
238 } else { 236 } else {
239 plugin.active = false; 237 plugin.active = false;
240 } 238 }
241 239
242 plugin.guiPart = plugin.iface->guiPart(); 240 plugin.guiPart = plugin.iface->guiPart();
243 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); 241 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();
244 242
245 // package the whole thing into a qwidget so it can be shown and hidden 243 // package the whole thing into a qwidget so it can be shown and hidden
246 plugin.guiBox = new QWidget( m_big_box ); 244 plugin.guiBox = new QWidget( m_big_box );
247 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 245 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
248 QPixmap plugPix; 246 QPixmap plugPix;
249 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); 247 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
250 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 248 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
251 plugIcon->setPixmap( plugPix ); 249 plugIcon->setPixmap( plugPix );
252 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); 250 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
253 plugIcon->setName( plugin.guiPart->appName() ); 251 plugIcon->setName( plugin.guiPart->appName() );
254 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); 252 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
255 253
256 QWidget *plugWidget = plugin.guiPart->widget( plugin.guiBox ); 254 QWidget *plugWidget = plugin.guiPart->widget( plugin.guiBox );
257 boxLayout->addWidget( plugIcon, 0, AlignTop ); 255 boxLayout->addWidget( plugIcon, 0, AlignTop );
258 boxLayout->addWidget( plugWidget, 0, AlignTop ); 256 boxLayout->addWidget( plugWidget, 0, AlignTop );
259 boxLayout->setStretchFactor( plugIcon, 1 ); 257 boxLayout->setStretchFactor( plugIcon, 1 );
260 boxLayout->setStretchFactor( plugWidget, 9 ); 258 boxLayout->setStretchFactor( plugWidget, 9 );
261 259
262 // "prebuffer" it in one more list, to get the sorting done 260 // "prebuffer" it in one more list, to get the sorting done
263 tempList.insert( plugin.name, plugin ); 261 tempList.insert( plugin.name, plugin );
264 262
265 // on first start the list is off course empty 263 // on first start the list is off course empty
266 if ( m_allApplets.isEmpty() ) { 264 if ( m_allApplets.isEmpty() ) {
267 pluginList.append( plugin ); 265 pluginList.append( plugin );
268 m_bblayout->addWidget( plugin.guiBox ); 266 m_bblayout->addWidget( plugin.guiBox );
269 } 267 }
270 268
271 // if plugin is not yet in the list, add it to the layout too 269 // if plugin is not yet in the list, add it to the layout too
272 else if ( !m_allApplets.contains( plugin.name ) ) { 270 else if ( !m_allApplets.contains( plugin.name ) ) {
273 pluginList.append( plugin ); 271 pluginList.append( plugin );
274 } 272 }
275 } else { 273 } else {
276 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); 274 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() );
277 delete lib; 275 delete lib;
278 } 276 }
279 277
280 } 278 }
281 279
282 280
283 if ( !m_allApplets.isEmpty() ) { 281 if ( !m_allApplets.isEmpty() ) {
284 TodayPlugin tempPlugin; 282 TodayPlugin tempPlugin;
285 QStringList::Iterator stringit; 283 QStringList::Iterator stringit;
286 284
287 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { 285 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) {
288 tempPlugin = ( tempList.find( *stringit ) ).data(); 286 tempPlugin = ( tempList.find( *stringit ) ).data();
289 if ( !( (tempPlugin.name).isEmpty() ) ) { 287 if ( !( (tempPlugin.name).isEmpty() ) ) {
290 pluginList.append( tempPlugin ); 288 pluginList.append( tempPlugin );
291 m_bblayout->addWidget( tempPlugin.guiBox ); 289 m_bblayout->addWidget( tempPlugin.guiBox );
292 } 290 }
293 } 291 }
294 } 292 }
295 m_bblayout->addStretch( 2 ); 293 m_bblayout->addStretch( 2 );
296 draw(); 294 draw();
297} 295}
298 296
299 297
300 298
301 299
302/** 300/**
303 * Repaint method. Reread all fields. 301 * Repaint method. Reread all fields.
304 */ 302 */
305void Today::draw() { 303void Today::draw() {
306 304
307 if ( pluginList.count() == 0 ) { 305 if ( pluginList.count() == 0 ) {
308 QLabel *noPlugins = new QLabel( this ); 306 QLabel *noPlugins = new QLabel( this );
309 noPlugins->setText( tr( "No plugins found" ) ); 307 noPlugins->setText( tr( "No plugins found" ) );
310 layout->addWidget( noPlugins ); 308 layout->addWidget( noPlugins );
311 return; 309 return;
312 } 310 }
313 311
314 uint count = 0; 312 uint count = 0;
315 TodayPlugin plugin; 313 TodayPlugin plugin;
316 for ( uint i = 0; i < pluginList.count(); i++ ) { 314 for ( uint i = 0; i < pluginList.count(); i++ ) {
317 plugin = pluginList[i]; 315 plugin = pluginList[i];
318 316
319 if ( plugin.active ) { 317 if ( plugin.active ) {
320 // qDebug( plugin.name + " is ACTIVE " ); 318 // qDebug( plugin.name + " is ACTIVE " );
321 plugin.guiBox->show(); 319 plugin.guiBox->show();
322 } else { 320 } else {
323 // qDebug( plugin.name + " is INACTIVE" ); 321 // qDebug( plugin.name + " is INACTIVE" );
324 plugin.guiBox->hide(); 322 plugin.guiBox->hide();
325 } 323 }
326 count++; 324 count++;
327 } 325 }
328 326
329 if ( count == 0 ) { 327 if ( count == 0 ) {
330 QLabel *noPluginsActive = new QLabel( this ); 328 QLabel *noPluginsActive = new QLabel( this );
331 noPluginsActive->setText( tr( "No plugins activated" ) ); 329 noPluginsActive->setText( tr( "No plugins activated" ) );
332 layout->addWidget( noPluginsActive ); 330 layout->addWidget( noPluginsActive );
333 } 331 }
334 repaint(); 332 repaint();
335} 333}
336 334
337 335
338/** 336/**
339 * The method for the configuration dialog. 337 * The method for the configuration dialog.
340 */ 338 */
341void Today::startConfig() { 339void Today::startConfig() {
342 340
343 // disconnect timer to prevent problems while being on config dialog 341 // disconnect timer to prevent problems while being on config dialog
344 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 342 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
345 m_refreshTimer->stop( ); 343 m_refreshTimer->stop( );
346 344
347 TodayConfig conf( this, "dialog", true ); 345 TodayConfig conf( this, "dialog", true );
348 346
349 TodayPlugin plugin; 347 TodayPlugin plugin;
350 QList<TodayConfigWidget> configWidgetList; 348 QList<TodayConfigWidget> configWidgetList;
351 349
352 for ( int i = pluginList.count() - 1; i >= 0; i-- ) { 350 for ( int i = pluginList.count() - 1; i >= 0; i-- ) {
353 plugin = pluginList[i]; 351 plugin = pluginList[i];
354 352
355 // load the config widgets in the tabs 353 // load the config widgets in the tabs
356 if ( plugin.guiPart->configWidget( this ) != 0l ) { 354 if ( plugin.guiPart->configWidget( this ) != 0l ) {
357 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); 355 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 );
358 configWidgetList.append( widget ); 356 configWidgetList.append( widget );
359 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() 357 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig()
360 , plugin.guiPart->appName() ); 358 , plugin.guiPart->appName() );
361 } 359 }
362 // set the order/activate tab 360 // set the order/activate tab
363 conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), 361 conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(),
364 Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); 362 Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) );
365 } 363 }
366 364
367 if ( conf.exec() == QDialog::Accepted ) { 365 if ( conf.exec() == QDialog::Accepted ) {
368 conf.writeConfig(); 366 conf.writeConfig();
369 TodayConfigWidget *confWidget; 367 TodayConfigWidget *confWidget;
370 for ( confWidget = configWidgetList.first(); confWidget != 0; 368 for ( confWidget = configWidgetList.first(); confWidget != 0;
371 confWidget = configWidgetList.next() ) { 369 confWidget = configWidgetList.next() ) {
372 confWidget->writeConfig(); 370 confWidget->writeConfig();
373 } 371 }
374 372
375 // make the plugins to reinitialize ( reread its configs ) 373 // make the plugins to reinitialize ( reread its configs )
376 reinitialize(); 374 reinitialize();
377 draw(); 375 draw();
378 376
379 } else { 377 } else {
380 // since refresh is not called in that case , reconnect the signal 378 // since refresh is not called in that case , reconnect the signal
381 m_refreshTimer->start( 15000 ); // get the config value in here later 379 m_refreshTimer->start( 15000 ); // get the config value in here later
382 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 380 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
383 } 381 }
384} 382}
385 383
386 384
387 385
388void Today::reinitialize() { 386void Today::reinitialize() {
389 387
390 Config cfg( "today" ); 388 Config cfg( "today" );
391 cfg.setGroup( "Plugins" ); 389 cfg.setGroup( "Plugins" );
392 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 390 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
393 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 391 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
394 392
395 /* reinitialize all plugins */ 393 /* reinitialize all plugins */
396 QValueList<TodayPlugin>::Iterator it; 394 QValueList<TodayPlugin>::Iterator it;
397 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { 395 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
398 if ( !(*it).excludeRefresh ) { 396 if ( !(*it).excludeRefresh ) {
399 (*it).guiPart->reinitialize(); 397 (*it).guiPart->reinitialize();
400 qDebug( "reinit" ); 398 qDebug( "reinit" );
401 } 399 }
402 400
403 /* check if plugins is still to be shown */ 401 /* check if plugins is still to be shown */
404 if ( m_excludeApplets.grep( (*it).name ).isEmpty() ) { 402 if ( m_excludeApplets.grep( (*it).name ).isEmpty() ) {
405 (*it).active = true; 403 (*it).active = true;
406 } else { 404 } else {
407 (*it).active = false; 405 (*it).active = false;
408 } 406 }
409 407
410 } 408 }
411 409
412 cfg.setGroup( "General" ); 410 cfg.setGroup( "General" );
413 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 411 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
414 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); 412 m_hideBanner = cfg.readNumEntry( "HideBanner", 0 );
415 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); 413 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
416 414
417 // set the date in top label 415 // set the date in top label
418 QDate date = QDate::currentDate(); 416 QDate date = QDate::currentDate();
419 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); 417 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) );
420 418
421 if ( m_hideBanner ) { 419 if ( m_hideBanner ) {
422 Opiezilla->hide(); 420 Opiezilla->hide();
423 TodayLabel->hide(); 421 TodayLabel->hide();
424 } else { 422 } else {
425 Opiezilla->show(); 423 Opiezilla->show();
426 TodayLabel->show(); 424 TodayLabel->show();
427 } 425 }
428 426
429 delete m_bblayout; 427 delete m_bblayout;
430 m_bblayout = new QVBoxLayout( m_big_box ); 428 m_bblayout = new QVBoxLayout( m_big_box );
431 TodayPlugin tempPlugin; 429 TodayPlugin tempPlugin;
432 QStringList::Iterator stringit; 430 QStringList::Iterator stringit;
433 431
434 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { 432 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) {
435 tempPlugin = ( tempList.find( *stringit ) ).data(); 433 tempPlugin = ( tempList.find( *stringit ) ).data();
436 if ( !( (tempPlugin.name).isEmpty() ) ) { 434 if ( !( (tempPlugin.name).isEmpty() ) ) {
437 m_bblayout->addWidget( tempPlugin.guiBox ); 435 m_bblayout->addWidget( tempPlugin.guiBox );
438 } 436 }
439 } 437 }
440 m_bblayout->addStretch( 2 ); 438 m_bblayout->addStretch( 2 );
441 439
442} 440}
443 441
444/** 442/**
445 * Refresh for the view. Reload all applets 443 * Refresh for the view. Reload all applets
446 * 444 *
447 */ 445 */
448void Today::refresh() { 446void Today::refresh() {
449 447
450 QValueList<TodayPlugin>::Iterator it; 448 QValueList<TodayPlugin>::Iterator it;
451 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { 449 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
452 if ( !(*it).excludeRefresh ) { 450 if ( !(*it).excludeRefresh ) {
453 (*it).guiPart->refresh(); 451 (*it).guiPart->refresh();
454 qDebug( "refresh" ); 452 qDebug( "refresh" );
455 } 453 }
456 } 454 }
457 455
458 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( QDate::currentDate() ) + "</font>" ) ); 456 DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( QDate::currentDate() ) + "</font>" ) );
459 457
460 updateGeometry(); 458 updateGeometry();
461 repaint(); 459 repaint();
462} 460}
463 461
464void Today::startApplication() { 462void Today::startApplication() {
465 QCopEnvelope e( "QPE/System", "execute(QString)" ); 463 QCopEnvelope e( "QPE/System", "execute(QString)" );
466 e << QString( sender()->name() ); 464 e << QString( sender()->name() );
467} 465}
468 466
469/** 467/**
470 * launch addressbook (personal card) 468 * launch addressbook (personal card)
471 */ 469 */
472void Today::editCard() { 470void Today::editCard() {
473 QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" ); 471 QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" );
474} 472}
475 473
476Today::~Today() { 474Today::~Today() {
477} 475}
478 476
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index bf2293a..972731c 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -1,83 +1,83 @@
1/* 1/*
2 * today.h 2 * today.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
17
18#ifndef TODAY_H 16#ifndef TODAY_H
19#define TODAY_H 17#define TODAY_H
20 18
21#include <qscrollview.h>
22#include <qvbox.h>
23
24#include <qpe/qlibrary.h>
25 19
26#include "todayconfig.h" 20#include "todayconfig.h"
27#include "todaybase.h" 21#include "todaybase.h"
28 22
29#include <opie/todayplugininterface.h> 23#include <opie2/todayplugininterface.h>
24#include <opie2/oclickablelabel.h>
30 25
31class QVBoxLayout; 26#include <qpe/qlibrary.h>
32class OClickableLabel; 27
28#include <qscrollview.h>
29#include <qvbox.h>
33 30
31using namespace Opie;
32
33class QVBoxLayout;
34 34
35class Today : public TodayBase { 35class Today : public TodayBase {
36 36
37 Q_OBJECT 37 Q_OBJECT
38 38
39 public: 39 public:
40 Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 40 Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
41 ~Today(); 41 ~Today();
42 static QString appName() { return QString::fromLatin1("today"); } 42 static QString appName() { return QString::fromLatin1("today"); }
43 43
44private slots: 44private slots:
45 void startConfig(); 45 void startConfig();
46 void startApplication(); 46 void startApplication();
47 void editCard(); 47 void editCard();
48 void refresh(); 48 void refresh();
49 49
50private: 50private:
51 void init(); 51 void init();
52 void setOwnerField(); 52 void setOwnerField();
53 void setOwnerField(QString &string); 53 void setOwnerField(QString &string);
54 void loadPlugins(); 54 void loadPlugins();
55 void draw(); 55 void draw();
56 void reinitialize(); 56 void reinitialize();
57 57
58 void setRefreshTimer( int ); 58 void setRefreshTimer( int );
59 59
60private slots: 60private slots:
61 void channelReceived(const QCString &msg, const QByteArray & data); 61 void channelReceived(const QCString &msg, const QByteArray & data);
62 62
63 private: 63 private:
64 TodayConfig *conf; 64 TodayConfig *conf;
65 QStringList m_excludeApplets; 65 QStringList m_excludeApplets;
66 QStringList m_allApplets; 66 QStringList m_allApplets;
67 67
68 QScrollView *m_sv; 68 QScrollView *m_sv;
69 QWidget* m_big_box; 69 QWidget* m_big_box;
70 QVBoxLayout *m_bblayout; 70 QVBoxLayout *m_bblayout;
71 71
72 72
73 73
74 QTimer *m_refreshTimer; 74 QTimer *m_refreshTimer;
75 75
76 bool m_refreshTimerEnabled; 76 bool m_refreshTimerEnabled;
77 int m_newStart; 77 int m_newStart;
78 int m_iconSize; 78 int m_iconSize;
79 int m_maxCharClip; 79 int m_maxCharClip;
80 int m_hideBanner; 80 int m_hideBanner;
81}; 81};
82 82
83#endif 83#endif
diff --git a/core/pim/today/today.pro b/core/pim/today/today.pro
index 2968e6a..b55a812 100644
--- a/core/pim/today/today.pro
+++ b/core/pim/today/today.pro
@@ -1,14 +1,15 @@
1 CONFIG += qt warn on release quick-app 1 CONFIG += qt warn on release quick-app
2 2
3 HEADERS = today.h todaybase.h todayconfig.h 3 HEADERS = today.h todaybase.h todayconfig.h
4 SOURCES = today.cpp todaybase.cpp todayconfig.cpp main.cpp 4 SOURCES = today.cpp todaybase.cpp todayconfig.cpp main.cpp
5INTERFACES = todayconfigmiscbase.ui 5INTERFACES = todayconfigmiscbase.ui
6 6
7 INCLUDEPATH+= $(OPIEDIR)/include 7 INCLUDEPATH+= $(OPIEDIR)/include
8 DEPENDPATH+= $(OPIEDIR)/include 8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe -lopie 9LIBS += -lqpe -lopiecore2 -lopiepim2 -lopieui2
10 10
11 TARGET = today 11 TARGET = today
12 12
13include ( $(OPIEDIR)/include.pro ) 13include ( $(OPIEDIR)/include.pro )
14} 14}
15
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index f2958ad..14cdfd9 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,105 +1,104 @@
1/* 1/*
2 * todaybase.cpp 2 * todaybase.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 "todaybase.h" 17#include "todaybase.h"
18 18
19#include <qvbox.h>
20#include <qwhatsthis.h>
21
22#include <qpe/resource.h> 19#include <qpe/resource.h>
23 20
21#include <qvbox.h>
22#include <qwhatsthis.h>
24 23
25TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) 24TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
26 : QWidget( parent, name, WStyle_ContextHelp ) { 25 : QWidget( parent, name, WStyle_ContextHelp ) {
27 26
28 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo 27 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
29 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla 28 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla
30 QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon 29 QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon
31 30
32 layout = 0L; 31 layout = 0L;
33 32
34 QPalette pal = this->palette(); 33 QPalette pal = this->palette();
35 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 34 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
36 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 35 pal.setColor( QPalette::Active, QColorGroup::Button, col );
37 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 36 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
38 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 37 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
39 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 38 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
40 this->setPalette( pal ); 39 this->setPalette( pal );
41 40
42 // --- logo Section --- 41 // --- logo Section ---
43 QPalette pal2; 42 QPalette pal2;
44 QColorGroup cg; 43 QColorGroup cg;
45 cg.setColor( QColorGroup::Text, white ); 44 cg.setColor( QColorGroup::Text, white );
46 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); 45 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
47 pal2.setActive( cg ); 46 pal2.setActive( cg );
48 47
49// today logo 48// today logo
50 Frame = new QLabel( this, "Frame" ); 49 Frame = new QLabel( this, "Frame" );
51 Frame->setPalette( pal2 ); 50 Frame->setPalette( pal2 );
52 Frame->setFrameShape( QFrame::StyledPanel ); 51 Frame->setFrameShape( QFrame::StyledPanel );
53 Frame->setFrameShadow( QFrame::Raised ); 52 Frame->setFrameShadow( QFrame::Raised );
54 Frame->setLineWidth( 0 ); 53 Frame->setLineWidth( 0 );
55 54
56 QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); 55 QHBoxLayout *frameLayout = new QHBoxLayout( Frame );
57 QVBox *box1 = new QVBox( Frame ); 56 QVBox *box1 = new QVBox( Frame );
58 57
59 // Today text 58 // Today text
60 TodayLabel = new QLabel( box1, "TodayText" ); 59 TodayLabel = new QLabel( box1, "TodayText" );
61 QFont TodayLabel_font( TodayLabel->font() ); 60 QFont TodayLabel_font( TodayLabel->font() );
62 TodayLabel_font.setBold( TRUE ); 61 TodayLabel_font.setBold( TRUE );
63 TodayLabel_font.setPointSize( 40 ); 62 TodayLabel_font.setPointSize( 40 );
64 TodayLabel->setFont( TodayLabel_font ); 63 TodayLabel->setFont( TodayLabel_font );
65 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 64 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
66 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); 65 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
67 66
68 // date 67 // date
69 DateLabel = new QLabel( box1, "TextLabel1" ); 68 DateLabel = new QLabel( box1, "TextLabel1" );
70 QFont DateLabel_font( DateLabel->font() ); 69 QFont DateLabel_font( DateLabel->font() );
71 DateLabel_font.setBold( TRUE ); 70 DateLabel_font.setBold( TRUE );
72 DateLabel->setFont( DateLabel_font ); 71 DateLabel->setFont( DateLabel_font );
73 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 72 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
74 DateLabel->setTextFormat( RichText ); 73 DateLabel->setTextFormat( RichText );
75 74
76 // Opiezilla 75 // Opiezilla
77 Opiezilla = new QLabel( Frame, "OpieZilla" ); 76 Opiezilla = new QLabel( Frame, "OpieZilla" );
78 Opiezilla->setPixmap( opiezilla ); 77 Opiezilla->setPixmap( opiezilla );
79 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); 78 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) );
80 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); 79 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
81 80
82 81
83 // Ownerfield 82 // Ownerfield
84 OwnerField = new OClickableLabel( this , "Owner" ); 83 OwnerField = new OClickableLabel( this , "Owner" );
85 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); 84 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
86 85
87 // config 86 // config
88 ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); 87 ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
89 ConfigButton->setPixmap( config ); 88 ConfigButton->setPixmap( config );
90 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); 89 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
91 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); 90 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
92 91
93 frameLayout->addWidget( box1, 1 ); 92 frameLayout->addWidget( box1, 1 );
94 frameLayout->addStretch( 1 ); 93 frameLayout->addStretch( 1 );
95 frameLayout->addWidget( ConfigButton, 0, AlignBottom ); 94 frameLayout->addWidget( ConfigButton, 0, AlignBottom );
96 frameLayout->addWidget( Opiezilla ); 95 frameLayout->addWidget( Opiezilla );
97} 96}
98 97
99 98
100/** 99/**
101 * D' tor 100 * D' tor
102 */ 101 */
103TodayBase::~TodayBase() { 102TodayBase::~TodayBase() {
104} 103}
105 104
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index b0b2e14..b737351 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -1,55 +1,56 @@
1/* 1/*
2 * todaybase.h 2 * todaybase.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 TODAYBASE_H 17#ifndef TODAYBASE_H
18#define TODAYBASE_H 18#define TODAYBASE_H
19 19
20#include <opie2/oclickablelabel.h>
21
20#include <qlayout.h> 22#include <qlayout.h>
21#include <opie/oclickablelabel.h>
22 23
23class QVBox; 24class QVBox;
24class QGridLayout; 25class QGridLayout;
25class QFrame; 26class QFrame;
26class QLabel; 27class QLabel;
27class QPushButton; 28class QPushButton;
28class QBoxLayout; 29class QBoxLayout;
29 30
30 31
32using namespace Opie;
33
34
31class TodayBase : public QWidget 35class TodayBase : public QWidget
32{ 36{
33 Q_OBJECT 37 Q_OBJECT
34 38
35public: 39public:
36 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 ); 40 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 );
37 ~TodayBase(); 41 ~TodayBase();
38 42
39 QFrame* Frame4; 43 QFrame* Frame4;
40 QPushButton* DatesButton; 44 QPushButton* DatesButton;
41 QVBoxLayout* layout; 45 QVBoxLayout* layout;
42 OClickableLabel* OwnerField; 46 Opie::OClickableLabel* OwnerField;
43 QLabel* Frame; 47 QLabel* Frame;
44 QLabel* DateLabel; 48 QLabel* DateLabel;
45 QFrame* Frame15; 49 QFrame* Frame15;
46 QLabel* Opiezilla; 50 QLabel* Opiezilla;
47 QLabel* TodayLabel; 51 QLabel* TodayLabel;
48 OClickableLabel* ConfigButton; 52 OClickableLabel* ConfigButton;
49 53
50protected:
51
52
53}; 54};
54 55
55#endif 56#endif
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 9ced0d8..5c51515 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -1,230 +1,230 @@
1/* 1/*
2 * todayconfig.cpp 2 * todayconfig.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 "todayconfig.h" 17#include "todayconfig.h"
18 18
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/qcopenvelope_qws.h> 21#include <qpe/qcopenvelope_qws.h>
22#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qspinbox.h> 26#include <qspinbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qheader.h> 28#include <qheader.h>
29#include <qvbox.h> 29#include <qvbox.h>
30#include <qtoolbutton.h> 30#include <qtoolbutton.h>
31#include <qwhatsthis.h> 31#include <qwhatsthis.h>
32 32
33class ToolButton : public QToolButton { 33class ToolButton : public QToolButton {
34 34
35public: 35public:
36 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) 36 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
37 : QToolButton( parent, name ) { 37 : QToolButton( parent, name ) {
38 setPixmap( Resource::loadPixmap( icon ) ); 38 setPixmap( Resource::loadPixmap( icon ) );
39 setAutoRaise( TRUE ); 39 setAutoRaise( TRUE );
40 setFocusPolicy( QWidget::NoFocus ); 40 setFocusPolicy( QWidget::NoFocus );
41 setToggleButton( t ); 41 setToggleButton( t );
42 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); 42 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
43 } 43 }
44}; 44};
45 45
46 46
47/** 47/**
48 * The class has currently quite some duplicate code. 48 * The class has currently quite some duplicate code.
49 * By that way it would be real easy to have it as seperate app in settings tab 49 * By that way it would be real easy to have it as seperate app in settings tab
50 * 50 *
51 */ 51 */
52TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 52TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
53 : QDialog( parent, name, modal, WStyle_ContextHelp ) { 53 : QDialog( parent, name, modal, WStyle_ContextHelp ) {
54 54
55 setCaption( tr( "Today Config" ) ); 55 setCaption( tr( "Today Config" ) );
56 56
57 QVBoxLayout *layout = new QVBoxLayout( this ); 57 QVBoxLayout *layout = new QVBoxLayout( this );
58 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 58 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
59 layout->addWidget( TabWidget3 ); 59 layout->addWidget( TabWidget3 );
60 60
61 tab_2 = new QWidget( TabWidget3, "tab_2" ); 61 tab_2 = new QWidget( TabWidget3, "tab_2" );
62 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); 62 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
63 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); 63 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
64 tab2Layout->addWidget( l ); 64 tab2Layout->addWidget( l );
65 QHBox *hbox1 = new QHBox( tab_2 ); 65 QHBox *hbox1 = new QHBox( tab_2 );
66 m_appletListView = new QListView( hbox1 ); 66 m_appletListView = new QListView( hbox1 );
67 m_appletListView->addColumn( "PluginList" ); 67 m_appletListView->addColumn( "PluginList" );
68 m_appletListView->header()->hide(); 68 m_appletListView->header()->hide();
69 m_appletListView->setSorting( -1 ); 69 m_appletListView->setSorting( -1 );
70 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" ) ); 70 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" ) );
71 QVBox *vbox1 = new QVBox( hbox1 ); 71 QVBox *vbox1 = new QVBox( hbox1 );
72 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); 72 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
73 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); 73 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
74 tab2Layout->addWidget( hbox1 ); 74 tab2Layout->addWidget( hbox1 );
75 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); 75 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) );
76 76
77 // Misc tab 77 // Misc tab
78 tab_3 = new QWidget( TabWidget3, "tab_3" ); 78 tab_3 = new QWidget( TabWidget3, "tab_3" );
79 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); 79 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
80 80
81 m_guiMisc = new TodayConfigMiscBase( tab_3 ); 81 m_guiMisc = new TodayConfigMiscBase( tab_3 );
82 82
83 tab3Layout->addWidget( m_guiMisc ); 83 tab3Layout->addWidget( m_guiMisc );
84 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); 84 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
85 85
86 m_applets_changed = false; 86 m_applets_changed = false;
87 87
88 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); 88 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) );
89 89
90 readConfig(); 90 readConfig();
91 QPEApplication::showDialog( this ); 91 QPEApplication::showDialog( this );
92} 92}
93 93
94 94
95/** 95/**
96 * Autostart, uses the new (opie only) autostart method in the launcher code. 96 * Autostart, uses the new (opie only) autostart method in the launcher code.
97 * If registered against that today ist started on each resume. 97 * If registered against that today ist started on each resume.
98 */ 98 */
99void TodayConfig::setAutoStart() { 99void TodayConfig::setAutoStart() {
100 Config cfg( "today" ); 100 Config cfg( "today" );
101 cfg.setGroup( "Autostart" ); 101 cfg.setGroup( "Autostart" );
102 if ( m_autoStart ) { 102 if ( m_autoStart ) {
103 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); 103 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" );
104 e << QString( "add" ); 104 e << QString( "add" );
105 e << QString( "today" ); 105 e << QString( "today" );
106 e << QString( "%1" ).arg( m_autoStartTimer ); 106 e << QString( "%1" ).arg( m_autoStartTimer );
107 } else { 107 } else {
108 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); 108 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
109 e << QString( "remove" ); 109 e << QString( "remove" );
110 e << QString( "today" ); 110 e << QString( "today" );
111 } 111 }
112} 112}
113 113
114/** 114/**
115 * Read the config part 115 * Read the config part
116 */ 116 */
117void TodayConfig::readConfig() { 117void TodayConfig::readConfig() {
118 Config cfg( "today" ); 118 Config cfg( "today" );
119 cfg.setGroup( "Autostart" ); 119 cfg.setGroup( "Autostart" );
120 m_autoStart = cfg.readNumEntry( "autostart", 1 ); 120 m_autoStart = cfg.readNumEntry( "autostart", 1 );
121 m_guiMisc->CheckBoxAuto->setChecked( m_autoStart ); 121 m_guiMisc->CheckBoxAuto->setChecked( m_autoStart );
122 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); 122 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 );
123 m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer ); 123 m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer );
124 124
125 cfg.setGroup( "General" ); 125 cfg.setGroup( "General" );
126 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 126 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
127 m_guiMisc->SpinBoxIconSize->setValue( m_iconSize ); 127 m_guiMisc->SpinBoxIconSize->setValue( m_iconSize );
128 m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); 128 m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 );
129 m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); 129 m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) );
130 130
131 131
132 cfg.setGroup( "Plugins" ); 132 cfg.setGroup( "Plugins" );
133 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 133 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
134} 134}
135 135
136/** 136/**
137 * Write the config part 137 * Write the config part
138 */ 138 */
139void TodayConfig::writeConfig() { 139void TodayConfig::writeConfig() {
140 Config cfg( "today" ); 140 Config cfg( "today" );
141 cfg.setGroup( "Plugins" ); 141 cfg.setGroup( "Plugins" );
142 if ( m_applets_changed ) { 142 if ( m_applets_changed ) {
143 QStringList exclude; 143 QStringList exclude;
144 QStringList include; 144 QStringList include;
145 QStringList all_applets; 145 QStringList all_applets;
146 146
147 QListViewItemIterator list_it( m_appletListView ); 147 QListViewItemIterator list_it( m_appletListView );
148 148
149 // this makes sure the names get saved in the order selected 149 // this makes sure the names get saved in the order selected
150 for ( ; list_it.current(); ++list_it ) { 150 for ( ; list_it.current(); ++list_it ) {
151 QMap <QString, QCheckListItem *>::Iterator it; 151 QMap <QString, QCheckListItem *>::Iterator it;
152 for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { 152 for ( it = m_applets.begin(); it != m_applets. end (); ++it ) {
153 if ( list_it.current() == (*it) && !(*it)-> isOn () ) { 153 if ( list_it.current() == (*it) && !(*it)-> isOn () ) {
154 exclude << it.key(); 154 exclude << it.key();
155 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ 155 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){
156 include << it.key(); 156 include << it.key();
157 } 157 }
158 if ( list_it.current() == (*it) ) { 158 if ( list_it.current() == (*it) ) {
159 all_applets << it.key(); 159 all_applets << it.key();
160 } 160 }
161 } 161 }
162 } 162 }
163 cfg.writeEntry( "ExcludeApplets", exclude, ',' ); 163 cfg.writeEntry( "ExcludeApplets", exclude, ',' );
164 cfg.writeEntry( "IncludeApplets", include, ',' ); 164 cfg.writeEntry( "IncludeApplets", include, ',' );
165 cfg.writeEntry( "AllApplets", all_applets, ',' ); 165 cfg.writeEntry( "AllApplets", all_applets, ',' );
166 } 166 }
167 167
168 cfg.setGroup( "Autostart" ); 168 cfg.setGroup( "Autostart" );
169 m_autoStart = m_guiMisc->CheckBoxAuto->isChecked(); 169 m_autoStart = m_guiMisc->CheckBoxAuto->isChecked();
170 cfg.writeEntry( "autostart", m_autoStart ); 170 cfg.writeEntry( "autostart", m_autoStart );
171 m_autoStartTimer = m_guiMisc->SpinBoxTime->value(); 171 m_autoStartTimer = m_guiMisc->SpinBoxTime->value();
172 cfg.writeEntry( "autostartdelay", m_autoStartTimer ); 172 cfg.writeEntry( "autostartdelay", m_autoStartTimer );
173 m_iconSize = m_guiMisc->SpinBoxIconSize->value(); 173 m_iconSize = m_guiMisc->SpinBoxIconSize->value();
174 174
175 cfg.setGroup( "General" ); 175 cfg.setGroup( "General" );
176 cfg.writeEntry( "IconSize", m_iconSize ); 176 cfg.writeEntry( "IconSize", m_iconSize );
177 cfg.writeEntry( "HideBanner", m_guiMisc->CheckBoxHide->isChecked() ); 177 cfg.writeEntry( "HideBanner", m_guiMisc->CheckBoxHide->isChecked() );
178 cfg.writeEntry( "checkinterval", m_guiMisc->SpinRefresh->value()*1000 ); 178 cfg.writeEntry( "checkinterval", m_guiMisc->SpinRefresh->value()*1000 );
179 179
180 // set autostart settings 180 // set autostart settings
181 setAutoStart(); 181 setAutoStart();
182} 182}
183 183
184 184
185void TodayConfig::moveSelectedUp() { 185void TodayConfig::moveSelectedUp() {
186 QListViewItem *item = m_appletListView->selectedItem(); 186 QListViewItem *item = m_appletListView->selectedItem();
187 if ( item && item->itemAbove() ) { 187 if ( item && item->itemAbove() ) {
188 item->itemAbove()->moveItem( item ); 188 item->itemAbove()->moveItem( item );
189 } 189 }
190} 190}
191 191
192 192
193void TodayConfig::moveSelectedDown() { 193void TodayConfig::moveSelectedDown() {
194 QListViewItem *item = m_appletListView->selectedItem(); 194 QListViewItem *item = m_appletListView->selectedItem();
195 if ( item && item->itemBelow() ) { 195 if ( item && item->itemBelow() ) {
196 item->moveItem( item->itemBelow() ); 196 item->moveItem( item->itemBelow() );
197 } 197 }
198} 198}
199 199
200 200
201/** 201/**
202 * Set up the icons in the order/active tab 202 * Set up the icons in the order/active tab
203 */ 203 */
204void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon ) { 204void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon ) {
205 205
206 QCheckListItem *item; 206 QCheckListItem *item;
207 item = new QCheckListItem( m_appletListView, name, QCheckListItem::CheckBox ); 207 item = new QCheckListItem( m_appletListView, name, QCheckListItem::CheckBox );
208 208
209 if ( !icon.isNull() ) { 209 if ( !icon.isNull() ) {
210 item->setPixmap( 0, icon ); 210 item->setPixmap( 0, icon );
211 } 211 }
212 212
213 if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) { 213 if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) {
214 item->setOn( TRUE ); 214 item->setOn( TRUE );
215 } 215 }
216 216
217 m_applets[libName] = item; 217 m_applets[libName] = item;
218 218
219 // kind of hack to get the first tab as default. 219 // kind of hack to get the first tab as default.
220 TabWidget3->setCurrentTab( tab_2 ); 220 TabWidget3->setCurrentTab( tab_2 );
221} 221}
222 222
223void TodayConfig::appletChanged() { 223void TodayConfig::appletChanged() {
224 m_applets_changed = true; 224 m_applets_changed = true;
225} 225}
226 226
227 227
228TodayConfig::~TodayConfig() { 228TodayConfig::~TodayConfig() {
229} 229}
230 230
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index 0a7687c..3b585c9 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -1,73 +1,73 @@
1/* 1/*
2 * todayconfig.h 2 * todayconfig.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 TODAYCONFIG_H 17#ifndef TODAYCONFIG_H
18#define TODAYCONFIG_H 18#define TODAYCONFIG_H
19 19
20#include "todayconfigmiscbase.h"
21
22#include <opie2/otabwidget.h>
23
20#include <qvariant.h> 24#include <qvariant.h>
21#include <qdialog.h> 25#include <qdialog.h>
22#include <qlistview.h> 26#include <qlistview.h>
23#include <opie/otabwidget.h>
24
25
26#include "todayconfigmiscbase.h"
27 27
28class QCheckBox; 28class QCheckBox;
29class QLabel; 29class QLabel;
30class QSpinBox; 30class QSpinBox;
31class QTabWidget; 31class QTabWidget;
32 32
33class TodayConfig : public QDialog { 33class TodayConfig : public QDialog {
34 34
35 Q_OBJECT 35 Q_OBJECT
36 36
37public: 37public:
38 TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE ); 38 TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE );
39 ~TodayConfig(); 39 ~TodayConfig();
40 40
41 OTabWidget* TabWidget3; 41 OTabWidget* TabWidget3;
42 42
43 void writeConfig(); 43 void writeConfig();
44 void pluginManagement( QString libName, QString name, QPixmap icon ); 44 void pluginManagement( QString libName, QString name, QPixmap icon );
45 45
46 46
47protected slots: 47protected slots:
48 void appletChanged(); 48 void appletChanged();
49 void moveSelectedUp(); 49 void moveSelectedUp();
50 void moveSelectedDown(); 50 void moveSelectedDown();
51 51
52private: 52private:
53 void setAutoStart(); 53 void setAutoStart();
54 void readConfig(); 54 void readConfig();
55 55
56 QListView* m_appletListView; 56 QListView* m_appletListView;
57 QMap<QString,QCheckListItem*> m_applets; 57 QMap<QString,QCheckListItem*> m_applets;
58 58
59 int m_autoStart; 59 int m_autoStart;
60 int m_autoStartTimer; 60 int m_autoStartTimer;
61 int m_iconSize; 61 int m_iconSize;
62 QStringList m_excludeApplets; 62 QStringList m_excludeApplets;
63 bool m_applets_changed; 63 bool m_applets_changed;
64 64
65 QWidget* tab_2; 65 QWidget* tab_2;
66 QWidget* tab_3; 66 QWidget* tab_3;
67 QLabel* TextLabel1, *TextLabel4; 67 QLabel* TextLabel1, *TextLabel4;
68 QSpinBox* SpinBox7; 68 QSpinBox* SpinBox7;
69 69
70 TodayConfigMiscBase *m_guiMisc; 70 TodayConfigMiscBase *m_guiMisc;
71}; 71};
72 72
73#endif 73#endif