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,79 +1,79 @@
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();
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,88 +1,80 @@
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;
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,67 +1,66 @@
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 );