summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.cpp4
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.h1
-rw-r--r--core/pim/today/today.cpp8
-rw-r--r--core/pim/today/today.h7
-rw-r--r--core/pim/today/todaybase.cpp1
5 files changed, 3 insertions, 18 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
index 3a7360d..97fb77e 100644
--- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
@@ -1,118 +1,118 @@
1 /* 1 /*
2 * datebookpluginwidget.cpp 2 * datebookpluginwidget.cpp
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002 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/timestring.h> 20#include <qpe/timestring.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22 22
23#include <qdatetime.h> 23#include <qdatetime.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qtl.h> 26#include <qtl.h>
27#include <qscrollview.h> 27#include <qscrollview.h>
28#include <qtimer.h> 28#include <qtimer.h>
29 29
30DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name) 30DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name )
31 : QWidget(parent, name ) { 31 : QWidget(parent, name ) {
32 32
33 db = 0l; 33 db = 0l;
34 m_layoutDates = 0l; 34 m_layoutDates = 0l;
35 35
36 if ( db ) { 36 if ( db ) {
37 delete db; 37 delete db;
38 } 38 }
39 db = new DateBookDB; 39 db = new DateBookDB;
40 40
41 if ( m_layoutDates ) { 41 if ( m_layoutDates ) {
42 delete m_layoutDates; 42 delete m_layoutDates;
43 } 43 }
44 m_layoutDates = new QVBoxLayout( this ); 44 m_layoutDates = new QVBoxLayout( this );
45 m_layoutDates->setAutoAdd( true ); 45 m_layoutDates->setAutoAdd( true );
46 46
47 m_eventsList.setAutoDelete( true ); 47 m_eventsList.setAutoDelete( true );
48 48
49 readConfig(); 49 readConfig();
50 getDates(); 50 getDates();
51} 51}
52 52
53DatebookPluginWidget::~DatebookPluginWidget() { 53DatebookPluginWidget::~DatebookPluginWidget() {
54 delete db; 54 delete db;
55 delete m_layoutDates; 55 delete m_layoutDates;
56} 56}
57 57
58 58
59void DatebookPluginWidget::readConfig() { 59void DatebookPluginWidget::readConfig() {
60 Config cfg( "todaydatebookplugin" ); 60 Config cfg( "todaydatebookplugin" );
61 cfg.setGroup( "config" ); 61 cfg.setGroup( "config" );
62 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); 62 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
63 m_show_location = cfg.readNumEntry( "showlocation", 1 ); 63 m_show_location = cfg.readNumEntry( "showlocation", 1 );
64 m_show_notes = cfg.readNumEntry( "shownotes", 0 ); 64 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
65 m_onlyLater = cfg.readNumEntry( "onlylater", 1 ); 65 m_onlyLater = cfg.readNumEntry( "onlylater", 1 );
66 m_moreDays = cfg.readNumEntry( "moredays", 0 ); 66 m_moreDays = cfg.readNumEntry( "moredays", 0 );
67} 67}
68 68
69void DatebookPluginWidget::refresh() { 69void DatebookPluginWidget::refresh() {
70 m_eventsList.clear(); 70 m_eventsList.clear();
71 getDates(); 71 getDates();
72} 72}
73 73
74/** 74/**
75 * Get all events that are in the datebook xml file for today 75 * Get all events that are in the datebook xml file for today
76 */ 76 */
77void DatebookPluginWidget::getDates() { 77void DatebookPluginWidget::getDates() {
78 78
79 QDate date = QDate::currentDate(); 79 QDate date = QDate::currentDate();
80 QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) ); 80 QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) );
81 qBubbleSort( list ); 81 qBubbleSort( list );
82 int count = 0; 82 int count = 0;
83 83
84 if ( list.count() > 0 ) { 84 if ( list.count() > 0 ) {
85 85
86 for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) { 86 for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) {
87 87
88 if ( count <= m_max_lines_meet ) { 88 if ( count <= m_max_lines_meet ) {
89 if ( !m_onlyLater ) { 89 if ( !m_onlyLater ) {
90 count++; 90 count++;
91 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes ); 91 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes );
92 m_eventsList.append( l ); 92 m_eventsList.append( l );
93 l->show(); 93 l->show();
94 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); 94 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) );
95 } else if ( QDateTime::currentDateTime() <= (*it).event().end() ) { 95 } else if ( QDateTime::currentDateTime() <= (*it).event().end() ) {
96 count++; 96 count++;
97 // show only later appointments 97 // show only later appointments
98 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes ); 98 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes );
99 m_eventsList.append( l ); 99 m_eventsList.append( l );
100 l->show(); 100 l->show();
101 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); 101 QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) );
102 } 102 }
103 } 103 }
104 } 104 }
105 if ( m_onlyLater && count == 0 ) { 105 if ( m_onlyLater && count == 0 ) {
106 QLabel* noMoreEvents = new QLabel( this ); 106 QLabel* noMoreEvents = new QLabel( this );
107 m_eventsList.append( noMoreEvents ); 107 m_eventsList.append( noMoreEvents );
108 noMoreEvents->show(); 108 noMoreEvents->show();
109 noMoreEvents->setText( QObject::tr( "No more appointments today" ) ); 109 noMoreEvents->setText( QObject::tr( "No more appointments today" ) );
110 } 110 }
111 } else { 111 } else {
112 QLabel* noEvents = new QLabel( this ); 112 QLabel* noEvents = new QLabel( this );
113 m_eventsList.append( noEvents ); 113 m_eventsList.append( noEvents );
114 noEvents->show(); 114 noEvents->show();
115 noEvents->setText( QObject::tr( "No appointments today" ) ); 115 noEvents->setText( QObject::tr( "No appointments today" ) );
116 } 116 }
117} 117}
118 118
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h
index 7a2235c..d7b51b4 100644
--- a/core/pim/today/plugins/todolist/todoplugin.h
+++ b/core/pim/today/plugins/todolist/todoplugin.h
@@ -1,50 +1,49 @@
1/* 1/*
2 * todoplugin.h 2 * todoplugin.h
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002 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#include <qstring.h> 20#include <qstring.h>
21#include <qguardedptr.h> 21#include <qguardedptr.h>
22#include <qwidget.h> 22#include <qwidget.h>
23 23
24#include <opie/tododb.h>
25#include <opie/oclickablelabel.h> 24#include <opie/oclickablelabel.h>
26#include <opie/todayplugininterface.h> 25#include <opie/todayplugininterface.h>
27 26
28#include "todopluginwidget.h" 27#include "todopluginwidget.h"
29 28
30class TodolistPlugin : public TodayPluginObject { 29class TodolistPlugin : public TodayPluginObject {
31 30
32public: 31public:
33 TodolistPlugin(); 32 TodolistPlugin();
34 ~TodolistPlugin(); 33 ~TodolistPlugin();
35 34
36 QString pluginName() const; 35 QString pluginName() const;
37 double versionNumber() const; 36 double versionNumber() const;
38 QString pixmapNameWidget() const; 37 QString pixmapNameWidget() const;
39 QWidget* widget(QWidget *); 38 QWidget* widget(QWidget *);
40 QString pixmapNameConfig() const; 39 QString pixmapNameConfig() const;
41 TodayConfigWidget* configWidget(QWidget *); 40 TodayConfigWidget* configWidget(QWidget *);
42 QString appName() const; 41 QString appName() const;
43 bool excludeFromRefresh() const; 42 bool excludeFromRefresh() const;
44 void refresh(); 43 void refresh();
45 44
46 private: 45 private:
47 QGuardedPtr<TodolistPluginWidget> m_widget; 46 QGuardedPtr<TodolistPluginWidget> m_widget;
48}; 47};
49 48
50#endif 49#endif
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 2497ee1..5e5d373 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -1,136 +1,128 @@
1/* 1/*
2 * today.cpp 2 * today.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 17
18 18
19#define QTOPIA_INTERNAL_LANGLIST 19#define QTOPIA_INTERNAL_LANGLIST
20 20
21#include "today.h" 21#include "today.h"
22#include <opie/todayconfigwidget.h>
23 22
24#include <qpe/config.h> 23#include <qpe/config.h>
25#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
26#include <qpe/resource.h> 25#include <qpe/resource.h>
27#include <qpe/global.h> 26#include <qpe/global.h>
28#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
29#include <qpe/contact.h> 28#include <qpe/contact.h>
30 29
31#include <qdir.h> 30#include <qdir.h>
32#include <qfile.h> 31#include <qfile.h>
33#include <qpushbutton.h>
34#include <qlabel.h>
35#include <qtimer.h> 32#include <qtimer.h>
36#include <qpixmap.h>
37#include <qlayout.h>
38#include <qhbox.h>
39#include <opie/otabwidget.h>
40#include <qdialog.h>
41#include <qwhatsthis.h> 33#include <qwhatsthis.h>
42#include <qtranslator.h> 34#include <qtranslator.h>
43 35
44struct TodayPlugin { 36struct TodayPlugin {
45 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} 37 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
46 QLibrary *library; 38 QLibrary *library;
47 QInterfacePtr<TodayPluginInterface> iface; 39 QInterfacePtr<TodayPluginInterface> iface;
48 TodayPluginObject *guiPart; 40 TodayPluginObject *guiPart;
49 QWidget *guiBox; 41 QWidget *guiBox;
50 QString name; 42 QString name;
51 bool active; 43 bool active;
52 bool excludeRefresh; 44 bool excludeRefresh;
53 int pos; 45 int pos;
54}; 46};
55 47
56static QValueList<TodayPlugin> pluginList; 48static QValueList<TodayPlugin> pluginList;
57 49
58Today::Today( QWidget* parent, const char* name, WFlags fl ) 50Today::Today( QWidget* parent, const char* name, WFlags fl )
59 : TodayBase( parent, name, fl ) { 51 : TodayBase( parent, name, fl ) {
60 52
61 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 53 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
62 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 54 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
63 55
64#if defined(Q_WS_QWS) 56#if defined(Q_WS_QWS)
65#if !defined(QT_NO_COP) 57#if !defined(QT_NO_COP)
66 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 58 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
67 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 59 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
68 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 60 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
69#endif 61#endif
70#endif 62#endif
71 63
72 setOwnerField(); 64 setOwnerField();
73 m_refreshTimer = new QTimer( this ); 65 m_refreshTimer = new QTimer( this );
74 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 66 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
75 m_refreshTimer->start( 15000 ); 67 m_refreshTimer->start( 15000 );
76 //init(); 68 //init();
77 loadPlugins(); 69 loadPlugins();
78 showMaximized(); 70 showMaximized();
79} 71}
80 72
81/** 73/**
82 * Qcop receive method. 74 * Qcop receive method.
83 */ 75 */
84void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 76void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
85 QDataStream stream( data, IO_ReadOnly ); 77 QDataStream stream( data, IO_ReadOnly );
86 if ( msg == "message(QString)" ) { 78 if ( msg == "message(QString)" ) {
87 QString message; 79 QString message;
88 stream >> message; 80 stream >> message;
89 setOwnerField( message ); 81 setOwnerField( message );
90 } 82 }
91} 83}
92 84
93void Today::setRefreshTimer( int interval ) { 85void Today::setRefreshTimer( int interval ) {
94 86
95 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 87 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
96 88
97 // 0 is "never" case 89 // 0 is "never" case
98 if ( !interval == 0 ) { 90 if ( !interval == 0 ) {
99 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 91 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
100 m_refreshTimer->changeInterval( interval ); 92 m_refreshTimer->changeInterval( interval );
101 } 93 }
102} 94}
103 95
104 96
105/** 97/**
106 * Initialises the owner field with the default value, the username 98 * Initialises the owner field with the default value, the username
107 */ 99 */
108void Today::setOwnerField() { 100void Today::setOwnerField() {
109 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 101 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
110 if ( QFile::exists( file ) ) { 102 if ( QFile::exists( file ) ) {
111 Contact cont = Contact::readVCard( file )[0]; 103 Contact cont = Contact::readVCard( file )[0];
112 QString returnString = cont.fullName(); 104 QString returnString = cont.fullName();
113 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 105 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
114 } else { 106 } else {
115 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 107 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
116 } 108 }
117} 109}
118 110
119/** 111/**
120 * Set the owner field with a given QString, for example per qcop. 112 * Set the owner field with a given QString, for example per qcop.
121 */ 113 */
122void Today::setOwnerField( QString &message ) { 114void Today::setOwnerField( QString &message ) {
123 if ( !message.isEmpty() ) { 115 if ( !message.isEmpty() ) {
124 OwnerField->setText( "<b>" + message + "</b>" ); 116 OwnerField->setText( "<b>" + message + "</b>" );
125 } 117 }
126} 118}
127 119
128/** 120/**
129 * Init stuff needed for today. Reads the config file. 121 * Init stuff needed for today. Reads the config file.
130 */ 122 */
131void Today::init() { 123void Today::init() {
132 // read config 124 // read config
133 Config cfg( "today" ); 125 Config cfg( "today" );
134 126
135 cfg.setGroup( "Plugins" ); 127 cfg.setGroup( "Plugins" );
136 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 128 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 24f5611..3802feb 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -1,76 +1,71 @@
1/* 1/*
2 * today.h 2 * today.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 17
18#ifndef TODAY_H 18#ifndef TODAY_H
19#define TODAY_H 19#define TODAY_H
20 20
21#include <opie/tododb.h>
22
23#include <qdatetime.h>
24#include <qlist.h>
25#include <qhbox.h>
26 21
27#include <qpe/qlibrary.h> 22#include <qpe/qlibrary.h>
28#include <qpe/event.h>
29 23
30#include "todayconfig.h" 24#include "todayconfig.h"
31#include "todaybase.h" 25#include "todaybase.h"
26
32#include <opie/todayplugininterface.h> 27#include <opie/todayplugininterface.h>
33 28
34class QVBoxLayout; 29class QVBoxLayout;
35class OClickableLabel; 30class OClickableLabel;
36 31
37 32
38class Today : public TodayBase { 33class Today : public TodayBase {
39 34
40 Q_OBJECT 35 Q_OBJECT
41 36
42 public: 37 public:
43 Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 38 Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
44 ~Today(); 39 ~Today();
45 40
46private slots: 41private slots:
47 void startConfig(); 42 void startConfig();
48 void startApplication(); 43 void startApplication();
49 void editCard(); 44 void editCard();
50 void refresh(); 45 void refresh();
51 46
52private: 47private:
53 void init(); 48 void init();
54 void setOwnerField(); 49 void setOwnerField();
55 void setOwnerField(QString &string); 50 void setOwnerField(QString &string);
56 void loadPlugins(); 51 void loadPlugins();
57 void draw(); 52 void draw();
58 void setRefreshTimer( int ); 53 void setRefreshTimer( int );
59 54
60private slots: 55private slots:
61 void channelReceived(const QCString &msg, const QByteArray & data); 56 void channelReceived(const QCString &msg, const QByteArray & data);
62 57
63 private: 58 private:
64 TodayConfig *conf; 59 TodayConfig *conf;
65 QStringList m_excludeApplets; 60 QStringList m_excludeApplets;
66 QStringList m_allApplets; 61 QStringList m_allApplets;
67 62
68 QTimer *m_refreshTimer; 63 QTimer *m_refreshTimer;
69 64
70 bool m_refreshTimerEnabled; 65 bool m_refreshTimerEnabled;
71 int m_newStart; 66 int m_newStart;
72 int m_iconSize; 67 int m_iconSize;
73 int m_maxCharClip; 68 int m_maxCharClip;
74}; 69};
75 70
76#endif 71#endif
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index 9a93b56..826e253 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,106 +1,105 @@
1/* 1/*
2 * todaybase.cpp 2 * todaybase.cpp
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002 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 <qframe.h>
20#include <qlabel.h> 19#include <qlabel.h>
21#include <qimage.h> 20#include <qimage.h>
22#include <qpixmap.h> 21#include <qpixmap.h>
23#include <qapplication.h> 22#include <qapplication.h>
24#include <qwhatsthis.h> 23#include <qwhatsthis.h>
25 24
26#include <qpe/resource.h> 25#include <qpe/resource.h>
27 26
28 27
29TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) 28TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
30 : QWidget( parent, name, WStyle_ContextHelp ) { 29 : QWidget( parent, name, WStyle_ContextHelp ) {
31 30
32 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo 31 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
33 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla 32 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla
34 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon 33 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon
35 34
36 layout = new QVBoxLayout( this ); 35 layout = new QVBoxLayout( this );
37 36
38 QPalette pal = this->palette(); 37 QPalette pal = this->palette();
39 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 38 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
40 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 39 pal.setColor( QPalette::Active, QColorGroup::Button, col );
41 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 40 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
42 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 41 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
43 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 42 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
44 this->setPalette( pal ); 43 this->setPalette( pal );
45 44
46 // --- logo Section --- 45 // --- logo Section ---
47 QPalette pal2; 46 QPalette pal2;
48 QColorGroup cg; 47 QColorGroup cg;
49 cg.setColor( QColorGroup::Text, white ); 48 cg.setColor( QColorGroup::Text, white );
50 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); 49 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
51 pal2.setActive( cg ); 50 pal2.setActive( cg );
52 // today logo 51 // today logo
53 Frame = new QLabel( this, "Frame" ); 52 Frame = new QLabel( this, "Frame" );
54 Frame->setPalette( pal2 ); 53 Frame->setPalette( pal2 );
55 Frame->setFrameShape( QFrame::StyledPanel ); 54 Frame->setFrameShape( QFrame::StyledPanel );
56 Frame->setFrameShadow( QFrame::Raised ); 55 Frame->setFrameShadow( QFrame::Raised );
57 Frame->setLineWidth( 0 ); 56 Frame->setLineWidth( 0 );
58 Frame->setMaximumHeight( 50 ); 57 Frame->setMaximumHeight( 50 );
59 Frame->setMinimumHeight( 50 ); 58 Frame->setMinimumHeight( 50 );
60 59
61 // Today text 60 // Today text
62 QLabel* TodayLabel = new QLabel( Frame, "TodayText" ); 61 QLabel* TodayLabel = new QLabel( Frame, "TodayText" );
63 TodayLabel->setGeometry( QRect( 10, 1, 168, 40 ) ); 62 TodayLabel->setGeometry( QRect( 10, 1, 168, 40 ) );
64 QFont TodayLabel_font( TodayLabel->font() ); 63 QFont TodayLabel_font( TodayLabel->font() );
65 TodayLabel_font.setBold( TRUE ); 64 TodayLabel_font.setBold( TRUE );
66 TodayLabel_font.setPointSize( 40 ); 65 TodayLabel_font.setPointSize( 40 );
67 TodayLabel->setFont( TodayLabel_font ); 66 TodayLabel->setFont( TodayLabel_font );
68 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 67 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
69 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); 68 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
70 69
71 // date 70 // date
72 DateLabel = new QLabel( Frame, "TextLabel1" ); 71 DateLabel = new QLabel( Frame, "TextLabel1" );
73 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); 72 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) );
74 QFont DateLabel_font( DateLabel->font() ); 73 QFont DateLabel_font( DateLabel->font() );
75 DateLabel_font.setBold( TRUE ); 74 DateLabel_font.setBold( TRUE );
76 DateLabel->setFont( DateLabel_font ); 75 DateLabel->setFont( DateLabel_font );
77 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 76 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
78 DateLabel->setTextFormat( RichText ); 77 DateLabel->setTextFormat( RichText );
79 78
80 // Opiezilla 79 // Opiezilla
81 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" ); 80 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" );
82 Opiezilla->setPixmap( opiezilla ); 81 Opiezilla->setPixmap( opiezilla );
83 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 ); 82 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 );
84 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); 83 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) );
85 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); 84 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
86 85
87 // Ownerfield 86 // Ownerfield
88 OwnerField = new OClickableLabel( this , "Owner" ); 87 OwnerField = new OClickableLabel( this , "Owner" );
89 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); 88 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) );
90 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); 89 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
91 OwnerField->setMaximumHeight(12); 90 OwnerField->setMaximumHeight(12);
92 91
93 // config 92 // config
94 ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); 93 ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
95 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 29, 25, 20 ) ); 94 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 29, 25, 20 ) );
96 ConfigButton->setPixmap( config ); 95 ConfigButton->setPixmap( config );
97 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); 96 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
98 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); 97 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
99} 98}
100 99
101/** 100/**
102 * D' tor 101 * D' tor
103 */ 102 */
104TodayBase::~TodayBase() { 103TodayBase::~TodayBase() {
105} 104}
106 105