summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/TODO2
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.cpp5
-rw-r--r--core/pim/today/plugins/todolist/todopluginconfig.cpp11
-rw-r--r--core/pim/today/today.cpp2
-rw-r--r--core/pim/today/todaybase.cpp7
-rw-r--r--core/pim/today/todaybase.h2
-rw-r--r--core/pim/today/todayconfig.cpp1
7 files changed, 21 insertions, 9 deletions
diff --git a/core/pim/today/TODO b/core/pim/today/TODO
index 49503bd..4dc22aa 100644
--- a/core/pim/today/TODO
+++ b/core/pim/today/TODO
@@ -1,15 +1,13 @@
1TODO for today: 1TODO for today:
2 2
3- all icons clickable
4
5- retail rom mail plugin (z) 3- retail rom mail plugin (z)
6 4
7- autostart on retail rom (Z) 5- autostart on retail rom (Z)
8 6
9* show "upcoming appointents the next days 7* show "upcoming appointents the next days
10 8
11* show alarm icons on alarm events (partly done) 9* show alarm icons on alarm events (partly done)
12 10
13* qcop integration for updating events? 11* qcop integration for updating events?
14 12
15 13
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
index 606916b..e93c82c 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
@@ -1,81 +1,86 @@
1 1
2 2
3#include "datebookpluginconfig.h" 3#include "datebookpluginconfig.h"
4 4
5#include <qpe/config.h> 5#include <qpe/config.h>
6 6
7#include <qlayout.h> 7#include <qlayout.h>
8#include <qtoolbutton.h> 8#include <qtoolbutton.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qhbox.h> 10#include <qhbox.h>
11#include <qwhatsthis.h>
11#include <qvbox.h> 12#include <qvbox.h>
12 13
13DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) 14DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name)
14 : TodayConfigWidget( parent, name ) { 15 : TodayConfigWidget( parent, name ) {
15 16
16 QVBoxLayout * layout = new QVBoxLayout( this ); 17 QVBoxLayout * layout = new QVBoxLayout( this );
17 layout->setMargin( 20 ); 18 layout->setMargin( 20 );
18 19
19 QHBox *box1 = new QHBox( this ); 20 QHBox *box1 = new QHBox( this );
20 QLabel* TextLabel4 = new QLabel( box1, "TextLabel4" ); 21 QLabel* TextLabel4 = new QLabel( box1, "TextLabel4" );
21 TextLabel4->setText( tr( "Show location" ) ); 22 TextLabel4->setText( tr( "Show location" ) );
22 CheckBox1 = new QCheckBox( box1, "CheckBox1" ); 23 CheckBox1 = new QCheckBox( box1, "CheckBox1" );
24 QWhatsThis::add( CheckBox1 , tr( "Check this if the location of an appointment should be shown for each one" ) );
23 25
24 QHBox *box2 = new QHBox( this ); 26 QHBox *box2 = new QHBox( this );
25 QLabel* TextLabel5 = new QLabel( box2 , "TextLabel5" ); 27 QLabel* TextLabel5 = new QLabel( box2 , "TextLabel5" );
26 TextLabel5->setText( tr( "Show notes" ) ); 28 TextLabel5->setText( tr( "Show notes" ) );
27 CheckBox2 = new QCheckBox( box2, "CheckBox2" ); 29 CheckBox2 = new QCheckBox( box2, "CheckBox2" );
30 QWhatsThis::add( CheckBox2 , tr( "Check this if the note attached to an appointment should be shown for each one" ) );
28 31
29 QHBox *box3 = new QHBox( this ); 32 QHBox *box3 = new QHBox( this );
30 QLabel* TextLabel6 = new QLabel( box3, "All Day"); 33 QLabel* TextLabel6 = new QLabel( box3, "All Day");
31 TextLabel6->setText( tr( "Show only later\n appointments") ); 34 TextLabel6->setText( tr( "Show only later\n appointments") );
32 CheckBox3 = new QCheckBox ( box3, "CheckBox3" ); 35 CheckBox3 = new QCheckBox ( box3, "CheckBox3" );
36 QWhatsThis::add( CheckBox3 , tr( "Check this if only appointments later then current time should be shown" ) );
33 37
34 QHBox *box4 = new QHBox( this ); 38 QHBox *box4 = new QHBox( this );
35 QLabel *TextLabel3 = new QLabel( box4, "TextLabel3" ); 39 QLabel *TextLabel3 = new QLabel( box4, "TextLabel3" );
36 TextLabel3->setText( tr( "How many \nappointment\n" 40 TextLabel3->setText( tr( "How many \nappointment\n"
37 "should be \nshown?" ) ); 41 "should be \nshown?" ) );
38 SpinBox1 = new QSpinBox( box4, "SpinBox1" ); 42 SpinBox1 = new QSpinBox( box4, "SpinBox1" );
43 QWhatsThis::add( SpinBox1 , tr( "How many appointments should be shown maximal. In chronical order" ) );
39 SpinBox1->setMaxValue( 10 ); 44 SpinBox1->setMaxValue( 10 );
40 SpinBox1->setValue( 5 ); 45 SpinBox1->setValue( 5 );
41 46
42 layout->addWidget( box1 ); 47 layout->addWidget( box1 );
43 layout->addWidget( box2 ); 48 layout->addWidget( box2 );
44 layout->addWidget( box3 ); 49 layout->addWidget( box3 );
45 layout->addWidget( box4 ); 50 layout->addWidget( box4 );
46 51
47 readConfig(); 52 readConfig();
48} 53}
49 54
50void DatebookPluginConfig::readConfig() { 55void DatebookPluginConfig::readConfig() {
51 Config cfg( "todaydatebookplugin" ); 56 Config cfg( "todaydatebookplugin" );
52 cfg.setGroup( "config" ); 57 cfg.setGroup( "config" );
53 58
54 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); 59 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
55 SpinBox1->setValue( m_max_lines_meet ); 60 SpinBox1->setValue( m_max_lines_meet );
56 m_show_location = cfg.readNumEntry( "showlocation", 1 ); 61 m_show_location = cfg.readNumEntry( "showlocation", 1 );
57 CheckBox1->setChecked( m_show_location ); 62 CheckBox1->setChecked( m_show_location );
58 m_show_notes = cfg.readNumEntry( "shownotes", 0 ); 63 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
59 CheckBox2->setChecked( m_show_notes ); 64 CheckBox2->setChecked( m_show_notes );
60 m_only_later = cfg.readNumEntry( "onlylater", 1 ); 65 m_only_later = cfg.readNumEntry( "onlylater", 1 );
61 CheckBox3->setChecked( m_only_later ); 66 CheckBox3->setChecked( m_only_later );
62} 67}
63 68
64 69
65void DatebookPluginConfig::writeConfig() { 70void DatebookPluginConfig::writeConfig() {
66 Config cfg( "todaydatebookplugin" ); 71 Config cfg( "todaydatebookplugin" );
67 cfg.setGroup( "config" ); 72 cfg.setGroup( "config" );
68 73
69 m_max_lines_meet = SpinBox1->value(); 74 m_max_lines_meet = SpinBox1->value();
70 cfg.writeEntry( "maxlinesmeet", m_max_lines_meet); 75 cfg.writeEntry( "maxlinesmeet", m_max_lines_meet);
71 m_show_location = CheckBox1->isChecked(); 76 m_show_location = CheckBox1->isChecked();
72 cfg.writeEntry( "showlocation", m_show_location); 77 cfg.writeEntry( "showlocation", m_show_location);
73 m_show_notes = CheckBox2->isChecked(); 78 m_show_notes = CheckBox2->isChecked();
74 cfg.writeEntry( "shownotes", m_show_notes ); 79 cfg.writeEntry( "shownotes", m_show_notes );
75 m_only_later = CheckBox3->isChecked(); 80 m_only_later = CheckBox3->isChecked();
76 cfg.writeEntry( "onlylater", m_only_later ); 81 cfg.writeEntry( "onlylater", m_only_later );
77 cfg.write(); 82 cfg.write();
78} 83}
79 84
80DatebookPluginConfig::~DatebookPluginConfig() { 85DatebookPluginConfig::~DatebookPluginConfig() {
81} 86}
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.cpp b/core/pim/today/plugins/todolist/todopluginconfig.cpp
index 110b2e0..56b7aa2 100644
--- a/core/pim/today/plugins/todolist/todopluginconfig.cpp
+++ b/core/pim/today/plugins/todolist/todopluginconfig.cpp
@@ -1,79 +1,82 @@
1/* 1/*
2 * todopluginconfig.cpp 2 * todopluginconfig.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 "todopluginconfig.h" 17#include "todopluginconfig.h"
18 18
19#include <qpe/config.h> 19#include <qpe/config.h>
20 20
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qhbox.h> 22#include <qhbox.h>
23#include <qtoolbutton.h> 23#include <qtoolbutton.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qwhatsthis.h>
25 26
26 27
27 28
28TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) 29TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name)
29 : TodayConfigWidget(parent, name ) { 30 : TodayConfigWidget(parent, name ) {
30 31
31 QVBoxLayout * layout = new QVBoxLayout( this ); 32 QVBoxLayout * layout = new QVBoxLayout( this );
32 layout->setMargin( 20 ); 33 layout->setMargin( 20 );
33 34
34 QHBox *box1 = new QHBox( this ); 35 QHBox *box1 = new QHBox( this );
35 36
36 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); 37 QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" );
37 TextLabel6->setText( tr( "How many\n tasks should \n" 38 TextLabel6->setText( tr( "tasks shown " ) );
38 "be shown?" ) );
39 39
40 SpinBox2 = new QSpinBox( box1, "SpinBox2" ); 40 SpinBox2 = new QSpinBox( box1, "SpinBox2" );
41 SpinBox2->setMaxValue( 40 ); 41 SpinBox2->setMaxValue( 40 );
42 QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of task that should be shown" ) );
43
44
42 45
43 QHBox *box2 = new QHBox( this ); 46 QHBox *box2 = new QHBox( this );
44 47
45 QLabel* clipLabel = new QLabel( box2, "" ); 48 QLabel* clipLabel = new QLabel( box2, "" );
46 clipLabel->setText( tr( "Clip line after\n X chars" ) ); 49 clipLabel->setText( tr( "Clip line after X chars" ) );
47 50
48 SpinBoxClip = new QSpinBox( box2, "SpinClip" ); 51 SpinBoxClip = new QSpinBox( box2, "SpinClip" );
49 SpinBoxClip->setMaxValue( 200 ); 52 SpinBoxClip->setMaxValue( 200 );
50 53 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) );
51 layout->addWidget( box1 ); 54 layout->addWidget( box1 );
52 layout->addWidget( box2 ); 55 layout->addWidget( box2 );
53 56
54 readConfig(); 57 readConfig();
55} 58}
56 59
57void TodolistPluginConfig::readConfig() { 60void TodolistPluginConfig::readConfig() {
58 Config cfg( "todaytodoplugin" ); 61 Config cfg( "todaytodoplugin" );
59 cfg.setGroup( "config" ); 62 cfg.setGroup( "config" );
60 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); 63 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 );
61 SpinBox2->setValue( m_max_lines_task ); 64 SpinBox2->setValue( m_max_lines_task );
62 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 65 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
63 SpinBoxClip->setValue( m_maxCharClip ); 66 SpinBoxClip->setValue( m_maxCharClip );
64} 67}
65 68
66 69
67void TodolistPluginConfig::writeConfig() { 70void TodolistPluginConfig::writeConfig() {
68 Config cfg( "todaytodoplugin" ); 71 Config cfg( "todaytodoplugin" );
69 cfg.setGroup( "config" ); 72 cfg.setGroup( "config" );
70 m_max_lines_task = SpinBox2->value(); 73 m_max_lines_task = SpinBox2->value();
71 cfg.writeEntry( "maxlinestask", m_max_lines_task ); 74 cfg.writeEntry( "maxlinestask", m_max_lines_task );
72 m_maxCharClip = SpinBoxClip->value(); 75 m_maxCharClip = SpinBoxClip->value();
73 cfg.writeEntry( "maxcharclip", m_maxCharClip ); 76 cfg.writeEntry( "maxcharclip", m_maxCharClip );
74 cfg.write(); 77 cfg.write();
75} 78}
76 79
77 80
78TodolistPluginConfig::~TodolistPluginConfig() { 81TodolistPluginConfig::~TodolistPluginConfig() {
79} 82}
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 34ec3cb..dd98824 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -1,265 +1,267 @@
1/* 1/*
2 * today.cpp 2 * today.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 "today.h" 18#include "today.h"
19#include <opie/todayconfigwidget.h> 19#include <opie/todayconfigwidget.h>
20 20
21#include <qpe/config.h> 21#include <qpe/config.h>
22#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
23#include <qpe/resource.h> 23#include <qpe/resource.h>
24#include <qpe/global.h> 24#include <qpe/global.h>
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26#include <qpe/contact.h> 26#include <qpe/contact.h>
27 27
28#include <qdir.h> 28#include <qdir.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qpixmap.h> 33#include <qpixmap.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <opie/otabwidget.h> 36#include <opie/otabwidget.h>
37#include <qdialog.h> 37#include <qdialog.h>
38#include <qwhatsthis.h>
38 39
39 40
40struct TodayPlugin { 41struct TodayPlugin {
41 QLibrary *library; 42 QLibrary *library;
42 TodayPluginInterface *iface; 43 TodayPluginInterface *iface;
43 TodayPluginObject *guiPart; 44 TodayPluginObject *guiPart;
44 QWidget *guiBox; 45 QWidget *guiBox;
45 QString name; 46 QString name;
46 bool active; 47 bool active;
47 int pos; 48 int pos;
48}; 49};
49 50
50static QValueList<TodayPlugin> pluginList; 51static QValueList<TodayPlugin> pluginList;
51 52
52Today::Today( QWidget* parent, const char* name, WFlags fl ) 53Today::Today( QWidget* parent, const char* name, WFlags fl )
53 : TodayBase( parent, name, fl ) { 54 : TodayBase( parent, name, fl ) {
54 55
55 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 56 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
56 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 57 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
57 58
58#if defined(Q_WS_QWS) 59#if defined(Q_WS_QWS)
59#if !defined(QT_NO_COP) 60#if !defined(QT_NO_COP)
60 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 61 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
61 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 62 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
62 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 63 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
63#endif 64#endif
64#endif 65#endif
65 66
66 setOwnerField(); 67 setOwnerField();
67 refresh(); 68 refresh();
68 showMaximized(); 69 showMaximized();
69} 70}
70 71
71/** 72/**
72 * Qcop receive method. 73 * Qcop receive method.
73 */ 74 */
74void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 75void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
75 QDataStream stream( data, IO_ReadOnly ); 76 QDataStream stream( data, IO_ReadOnly );
76 if ( msg == "message(QString)" ) { 77 if ( msg == "message(QString)" ) {
77 QString message; 78 QString message;
78 stream >> message; 79 stream >> message;
79 setOwnerField( message ); 80 setOwnerField( message );
80 } 81 }
81} 82}
82 83
83/** 84/**
84 * Initialises the owner field with the default value, the username 85 * Initialises the owner field with the default value, the username
85 */ 86 */
86void Today::setOwnerField() { 87void Today::setOwnerField() {
87 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 88 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
88 if ( QFile::exists( file ) ) { 89 if ( QFile::exists( file ) ) {
89 Contact cont = Contact::readVCard( file )[0]; 90 Contact cont = Contact::readVCard( file )[0];
90 QString returnString = cont.fullName(); 91 QString returnString = cont.fullName();
91 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 92 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
92 } else { 93 } else {
93 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 94 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
94 } 95 }
95} 96}
96 97
97/** 98/**
98 * Set the owner field with a given QString, for example per qcop. 99 * Set the owner field with a given QString, for example per qcop.
99 */ 100 */
100void Today::setOwnerField( QString &message ) { 101void Today::setOwnerField( QString &message ) {
101 if ( !message.isEmpty() ) { 102 if ( !message.isEmpty() ) {
102 OwnerField->setText( "<b>" + message + "</b>" ); 103 OwnerField->setText( "<b>" + message + "</b>" );
103 } 104 }
104} 105}
105 106
106 107
107/** 108/**
108 * Init stuff needed for today. Reads the config file. 109 * Init stuff needed for today. Reads the config file.
109 */ 110 */
110void Today::init() { 111void Today::init() {
111 // read config 112 // read config
112 Config cfg( "today" ); 113 Config cfg( "today" );
113 cfg.setGroup( "Plugins" ); 114 cfg.setGroup( "Plugins" );
114 115
115 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 116 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
116 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 117 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
117 cfg.setGroup( "General" ); 118 cfg.setGroup( "General" );
118 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 119 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
119} 120}
120 121
121 122
122/** 123/**
123 * Load the plugins 124 * Load the plugins
124 */ 125 */
125void Today::loadPlugins() { 126void Today::loadPlugins() {
126 127
127 QValueList<TodayPlugin>::Iterator tit; 128 QValueList<TodayPlugin>::Iterator tit;
128 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 129 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
129 (*tit).library->unload(); 130 (*tit).library->unload();
130 delete (*tit).library; 131 delete (*tit).library;
131 } 132 }
132 pluginList.clear(); 133 pluginList.clear();
133 134
134 QString path = QPEApplication::qpeDir() + "/plugins/today"; 135 QString path = QPEApplication::qpeDir() + "/plugins/today";
135 QDir dir( path, "lib*.so" ); 136 QDir dir( path, "lib*.so" );
136 137
137 QStringList list = dir.entryList(); 138 QStringList list = dir.entryList();
138 QStringList::Iterator it; 139 QStringList::Iterator it;
139 140
140 QMap<QString, TodayPlugin> tempList; 141 QMap<QString, TodayPlugin> tempList;
141 142
142 for ( it = list.begin(); it != list.end(); ++it ) { 143 for ( it = list.begin(); it != list.end(); ++it ) {
143 TodayPluginInterface *iface = 0; 144 TodayPluginInterface *iface = 0;
144 QLibrary *lib = new QLibrary( path + "/" + *it ); 145 QLibrary *lib = new QLibrary( path + "/" + *it );
145 146
146 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 147 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
147 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 148 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
148 qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); 149 qDebug( "loading: %s", QString( path + "/" + *it ).latin1() );
149 qDebug( QString(*it) ); 150 qDebug( QString(*it) );
150 TodayPlugin plugin; 151 TodayPlugin plugin;
151 plugin.library = lib; 152 plugin.library = lib;
152 plugin.iface = iface; 153 plugin.iface = iface;
153 plugin.name = QString(*it); 154 plugin.name = QString(*it);
154 155
155 // find out if plugins should be shown 156 // find out if plugins should be shown
156 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 157 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
157 plugin.active = true; 158 plugin.active = true;
158 } else { 159 } else {
159 plugin.active = false; 160 plugin.active = false;
160 } 161 }
161 plugin.guiPart = plugin.iface->guiPart(); 162 plugin.guiPart = plugin.iface->guiPart();
162 163
163 // package the whole thing into a qwidget so it can be shown and hidden 164 // package the whole thing into a qwidget so it can be shown and hidden
164 plugin.guiBox = new QWidget( this ); 165 plugin.guiBox = new QWidget( this );
165 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 166 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
166 QPixmap plugPix; 167 QPixmap plugPix;
167 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); 168 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
168 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 169 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
169 plugIcon->setPixmap( plugPix ); 170 plugIcon->setPixmap( plugPix );
171 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
170 plugIcon->setName( plugin.guiPart->appName() ); 172 plugIcon->setName( plugin.guiPart->appName() );
171 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); 173 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
172 // a scrollview for each plugin 174 // a scrollview for each plugin
173 QScrollView* sv = new QScrollView( plugin.guiBox ); 175 QScrollView* sv = new QScrollView( plugin.guiBox );
174 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); 176 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
175 // not sure if that is good .-) 177 // not sure if that is good .-)
176 sv->setMinimumHeight( 10 ); 178 sv->setMinimumHeight( 10 );
177 sv->setResizePolicy( QScrollView::AutoOneFit ); 179 sv->setResizePolicy( QScrollView::AutoOneFit );
178 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 180 sv->setHScrollBarMode( QScrollView::AlwaysOff );
179 sv->setFrameShape( QFrame::NoFrame ); 181 sv->setFrameShape( QFrame::NoFrame );
180 sv->addChild( plugWidget ); 182 sv->addChild( plugWidget );
181 // make sure the icon is on the top alligned 183 // make sure the icon is on the top alligned
182 boxLayout->addWidget( plugIcon, 0, AlignTop ); 184 boxLayout->addWidget( plugIcon, 0, AlignTop );
183 boxLayout->addWidget( sv, 0, AlignTop ); 185 boxLayout->addWidget( sv, 0, AlignTop );
184 boxLayout->setStretchFactor( plugIcon, 1 ); 186 boxLayout->setStretchFactor( plugIcon, 1 );
185 boxLayout->setStretchFactor( sv, 9 ); 187 boxLayout->setStretchFactor( sv, 9 );
186 // "prebuffer" it in one more list, to get the sorting done 188 // "prebuffer" it in one more list, to get the sorting done
187 tempList.insert( plugin.name, plugin ); 189 tempList.insert( plugin.name, plugin );
188 190
189 // on first start the list is off course empty 191 // on first start the list is off course empty
190 if ( m_allApplets.isEmpty() ) { 192 if ( m_allApplets.isEmpty() ) {
191 layout->addWidget( plugin.guiBox ); 193 layout->addWidget( plugin.guiBox );
192 pluginList.append( plugin ); 194 pluginList.append( plugin );
193 } 195 }
194 } else { 196 } else {
195 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); 197 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() );
196 delete lib; 198 delete lib;
197 } 199 }
198 } 200 }
199 201
200 if ( !m_allApplets.isEmpty() ) { 202 if ( !m_allApplets.isEmpty() ) {
201 TodayPlugin tempPlugin; 203 TodayPlugin tempPlugin;
202 QStringList::Iterator stringit; 204 QStringList::Iterator stringit;
203 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { 205 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) {
204 tempPlugin = ( tempList.find( *stringit ) ).data(); 206 tempPlugin = ( tempList.find( *stringit ) ).data();
205 if ( !( (tempPlugin.name).isEmpty() ) ) { 207 if ( !( (tempPlugin.name).isEmpty() ) ) {
206 layout->addWidget( tempPlugin.guiBox ); 208 layout->addWidget( tempPlugin.guiBox );
207 pluginList.append( tempPlugin ); 209 pluginList.append( tempPlugin );
208 } 210 }
209 } 211 }
210 } 212 }
211} 213}
212 214
213 215
214/** 216/**
215 * Repaint method. Reread all fields. 217 * Repaint method. Reread all fields.
216 */ 218 */
217void Today::draw() { 219void Today::draw() {
218 220
219 if ( pluginList.count() == 0 ) { 221 if ( pluginList.count() == 0 ) {
220 QLabel *noPlugins = new QLabel( this ); 222 QLabel *noPlugins = new QLabel( this );
221 noPlugins->setText( tr( "No plugins found" ) ); 223 noPlugins->setText( tr( "No plugins found" ) );
222 layout->addWidget( noPlugins ); 224 layout->addWidget( noPlugins );
223 return; 225 return;
224 } 226 }
225 227
226 uint count = 0; 228 uint count = 0;
227 TodayPlugin plugin; 229 TodayPlugin plugin;
228 for ( uint i = 0; i < pluginList.count(); i++ ) { 230 for ( uint i = 0; i < pluginList.count(); i++ ) {
229 plugin = pluginList[i]; 231 plugin = pluginList[i];
230 232
231 if ( plugin.active ) { 233 if ( plugin.active ) {
232 // qDebug( plugin.name + " is ACTIVE " ); 234 // qDebug( plugin.name + " is ACTIVE " );
233 plugin.guiBox->show(); 235 plugin.guiBox->show();
234 } else { 236 } else {
235 // qDebug( plugin.name + " is INACTIVE" ); 237 // qDebug( plugin.name + " is INACTIVE" );
236 plugin.guiBox->hide(); 238 plugin.guiBox->hide();
237 } 239 }
238 count++; 240 count++;
239 } 241 }
240 242
241 if ( count == 0 ) { 243 if ( count == 0 ) {
242 QLabel *noPluginsActive = new QLabel( this ); 244 QLabel *noPluginsActive = new QLabel( this );
243 noPluginsActive->setText( tr( "No plugins activated" ) ); 245 noPluginsActive->setText( tr( "No plugins activated" ) );
244 layout->addWidget( noPluginsActive ); 246 layout->addWidget( noPluginsActive );
245 } 247 }
246 layout->addStretch(0); 248 layout->addStretch(0);
247} 249}
248 250
249 251
250/** 252/**
251 * The method for the configuration dialog. 253 * The method for the configuration dialog.
252 */ 254 */
253void Today::startConfig() { 255void Today::startConfig() {
254 256
255 TodayConfig conf( this, "dialog", true ); 257 TodayConfig conf( this, "dialog", true );
256 258
257 TodayPlugin plugin; 259 TodayPlugin plugin;
258 QList<TodayConfigWidget> configWidgetList; 260 QList<TodayConfigWidget> configWidgetList;
259 261
260 for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { 262 for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) {
261 plugin = pluginList[i]; 263 plugin = pluginList[i];
262 264
263 // load the config widgets in the tabs 265 // load the config widgets in the tabs
264 if ( plugin.guiPart->configWidget( this ) != 0l ) { 266 if ( plugin.guiPart->configWidget( this ) != 0l ) {
265 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); 267 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 );
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index 352c9c1..12e8411 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,103 +1,106 @@
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> 19#include <qframe.h>
20#include <qlabel.h> 20#include <qlabel.h>
21#include <qimage.h> 21#include <qimage.h>
22#include <qpixmap.h> 22#include <qpixmap.h>
23#include <qapplication.h> 23#include <qapplication.h>
24#include <qwhatsthis.h>
24 25
25#include <qpe/resource.h> 26#include <qpe/resource.h>
26 27
27 28
28TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 29TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
29 : QWidget( parent, name, fl ) { 30 : QWidget( parent, name, WStyle_ContextHelp ) {
30 31
31 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo 32 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
32 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla 33 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla
33 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon 34 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon
34 35
35 layout = new QVBoxLayout( this ); 36 layout = new QVBoxLayout( this );
36 37
37 QPalette pal = this->palette(); 38 QPalette pal = this->palette();
38 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 39 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
39 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 40 pal.setColor( QPalette::Active, QColorGroup::Button, col );
40 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 41 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
41 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 42 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
42 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 43 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
43 this->setPalette( pal ); 44 this->setPalette( pal );
44 45
45 // --- logo Section --- 46 // --- logo Section ---
46 QPalette pal2; 47 QPalette pal2;
47 QColorGroup cg; 48 QColorGroup cg;
48 cg.setColor( QColorGroup::Text, white ); 49 cg.setColor( QColorGroup::Text, white );
49 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); 50 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) );
50 pal2.setActive( cg ); 51 pal2.setActive( cg );
51 // today logo 52 // today logo
52 Frame = new QLabel( this, "Frame" ); 53 Frame = new QLabel( this, "Frame" );
53 Frame->setPalette( pal2 ); 54 Frame->setPalette( pal2 );
54 Frame->setFrameShape( QFrame::StyledPanel ); 55 Frame->setFrameShape( QFrame::StyledPanel );
55 Frame->setFrameShadow( QFrame::Raised ); 56 Frame->setFrameShadow( QFrame::Raised );
56 Frame->setLineWidth( 0 ); 57 Frame->setLineWidth( 0 );
57 Frame->setMaximumHeight( 50 ); 58 Frame->setMaximumHeight( 50 );
58 Frame->setMinimumHeight( 50 ); 59 Frame->setMinimumHeight( 50 );
59 60
60 // Today text 61 // Today text
61 QLabel* TodayLabel = new QLabel( Frame, "TodayText" ); 62 QLabel* TodayLabel = new QLabel( Frame, "TodayText" );
62 TodayLabel->setGeometry( QRect( 10, 0, 168, 40 ) ); 63 TodayLabel->setGeometry( QRect( 10, 0, 168, 40 ) );
63 QFont TodayLabel_font( TodayLabel->font() ); 64 QFont TodayLabel_font( TodayLabel->font() );
64 TodayLabel_font.setBold( TRUE ); 65 TodayLabel_font.setBold( TRUE );
65 TodayLabel_font.setPointSize( 40 ); 66 TodayLabel_font.setPointSize( 40 );
66 TodayLabel->setFont( TodayLabel_font ); 67 TodayLabel->setFont( TodayLabel_font );
67 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 68 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
68 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); 69 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
69 70
70 // date 71 // date
71 DateLabel = new QLabel( Frame, "TextLabel1" ); 72 DateLabel = new QLabel( Frame, "TextLabel1" );
72 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); 73 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) );
73 QFont DateLabel_font( DateLabel->font() ); 74 QFont DateLabel_font( DateLabel->font() );
74 DateLabel_font.setBold( TRUE ); 75 DateLabel_font.setBold( TRUE );
75 DateLabel->setFont( DateLabel_font ); 76 DateLabel->setFont( DateLabel_font );
76 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 77 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
77 DateLabel->setTextFormat( RichText ); 78 DateLabel->setTextFormat( RichText );
78 79
79 // Opiezilla 80 // Opiezilla
80 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" ); 81 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" );
81 Opiezilla->setPixmap( opiezilla ); 82 Opiezilla->setPixmap( opiezilla );
82 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 ); 83 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 );
84 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) );
83 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); 85 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
84 86
85 // Ownerfield 87 // Ownerfield
86 OwnerField = new OClickableLabel( this , "Owner" ); 88 OwnerField = new OClickableLabel( this , "Owner" );
87 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); 89 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) );
88 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); 90 OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) );
89 OwnerField->setMaximumHeight(12); 91 OwnerField->setMaximumHeight(12);
90 92
91 // config 93 // config
92 ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); 94 ConfigButton = new OClickableLabel ( Frame, "PushButton1" );
93 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) ); 95 ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) );
94 ConfigButton->setPixmap( config ); 96 ConfigButton->setPixmap( config );
97 QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) );
95 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); 98 ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin );
96} 99}
97 100
98/** 101/**
99 * D' tor 102 * D' tor
100 */ 103 */
101TodayBase::~TodayBase() { 104TodayBase::~TodayBase() {
102} 105}
103 106
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 7c50f32..340c7a6 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -1,53 +1,53 @@
1/* 1/*
2 * todaybase.h 2 * todaybase.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 TODAYBASE_H 17#ifndef TODAYBASE_H
18#define TODAYBASE_H 18#define TODAYBASE_H
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21#include <opie/oclickablelabel.h> 21#include <opie/oclickablelabel.h>
22 22
23class QVBox; 23class QVBox;
24class QGridLayout; 24class QGridLayout;
25class QFrame; 25class QFrame;
26class QLabel; 26class QLabel;
27class QPushButton; 27class QPushButton;
28class QBoxLayout; 28class QBoxLayout;
29 29
30 30
31class TodayBase : public QWidget 31class TodayBase : public QWidget
32{ 32{
33 Q_OBJECT 33 Q_OBJECT
34 34
35public: 35public:
36 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 36 TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 );
37 ~TodayBase(); 37 ~TodayBase();
38 38
39 QFrame* Frame4; 39 QFrame* Frame4;
40 QPushButton* DatesButton; 40 QPushButton* DatesButton;
41 QVBoxLayout* layout; 41 QVBoxLayout* layout;
42 OClickableLabel* OwnerField; 42 OClickableLabel* OwnerField;
43 QLabel* Frame; 43 QLabel* Frame;
44 QLabel* DateLabel; 44 QLabel* DateLabel;
45 QFrame* Frame15; 45 QFrame* Frame15;
46 OClickableLabel* ConfigButton; 46 OClickableLabel* ConfigButton;
47 47
48protected: 48protected:
49 49
50 50
51}; 51};
52 52
53#endif 53#endif
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index d15e2ab..f9dd8f7 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -1,167 +1,168 @@
1/* 1/*
2 * todayconfig.cpp 2 * todayconfig.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 "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 22
23#include <qcheckbox.h> 23#include <qcheckbox.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qspinbox.h> 25#include <qspinbox.h>
26#include <qtabwidget.h> 26#include <qtabwidget.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qheader.h> 28#include <qheader.h>
29#include <qhbox.h> 29#include <qhbox.h>
30#include <qvbox.h> 30#include <qvbox.h>
31#include <qtoolbutton.h> 31#include <qtoolbutton.h>
32#include <qtooltip.h> 32#include <qtooltip.h>
33#include <qwhatsthis.h> 33#include <qwhatsthis.h>
34 34
35class ToolButton : public QToolButton { 35class ToolButton : public QToolButton {
36 36
37public: 37public:
38 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) 38 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
39 : QToolButton( parent, name ) { 39 : QToolButton( parent, name ) {
40 setPixmap( Resource::loadPixmap( icon ) ); 40 setPixmap( Resource::loadPixmap( icon ) );
41 setAutoRaise( TRUE ); 41 setAutoRaise( TRUE );
42 setFocusPolicy( QWidget::NoFocus ); 42 setFocusPolicy( QWidget::NoFocus );
43 setToggleButton( t ); 43 setToggleButton( t );
44 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); 44 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
45 } 45 }
46}; 46};
47 47
48 48
49/** 49/**
50 * The class has currently quite some duplicate code. 50 * The class has currently quite some duplicate code.
51 * By that way it would be real easy to have it as seperate app in settings tab 51 * By that way it would be real easy to have it as seperate app in settings tab
52 * 52 *
53 */ 53 */
54TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 54TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
55 : QDialog( parent, name, modal, WStyle_ContextHelp ) { 55 : QDialog( parent, name, modal, WStyle_ContextHelp ) {
56 56
57 setCaption( tr( "Today config" ) ); 57 setCaption( tr( "Today config" ) );
58 58
59 QVBoxLayout *layout = new QVBoxLayout( this ); 59 QVBoxLayout *layout = new QVBoxLayout( this );
60 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 60 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
61 layout->addWidget( TabWidget3 ); 61 layout->addWidget( TabWidget3 );
62 62
63 tab_2 = new QWidget( TabWidget3, "tab_2" ); 63 tab_2 = new QWidget( TabWidget3, "tab_2" );
64 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); 64 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
65 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); 65 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
66 tab2Layout->addWidget( l ); 66 tab2Layout->addWidget( l );
67 QHBox *hbox1 = new QHBox( tab_2 ); 67 QHBox *hbox1 = new QHBox( tab_2 );
68 m_appletListView = new QListView( hbox1 ); 68 m_appletListView = new QListView( hbox1 );
69 m_appletListView->addColumn( "PluginList" ); 69 m_appletListView->addColumn( "PluginList" );
70 m_appletListView->header()->hide(); 70 m_appletListView->header()->hide();
71 m_appletListView->setSorting( -1 ); 71 m_appletListView->setSorting( -1 );
72 QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin ore use the arrow buttons on the right to change the appearance order" ) );
72 QVBox *vbox1 = new QVBox( hbox1 ); 73 QVBox *vbox1 = new QVBox( hbox1 );
73 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); 74 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
74 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); 75 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
75 tab2Layout->addWidget( hbox1 ); 76 tab2Layout->addWidget( hbox1 );
76 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); 77 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) );
77 78
78 tab_3 = new QWidget( TabWidget3, "tab_3" ); 79 tab_3 = new QWidget( TabWidget3, "tab_3" );
79 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); 80 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
80 tab3Layout->setMargin( 20 ); 81 tab3Layout->setMargin( 20 );
81 QHBox *hbox_auto = new QHBox( tab_3 ); 82 QHBox *hbox_auto = new QHBox( tab_3 );
82 TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); 83 TextLabel2 = new QLabel( hbox_auto, "AutoStart" );
83 TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); 84 TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) );
84 QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); 85 QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) );
85 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); 86 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" );
86 QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); 87 QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) );
87 QHBox *hbox_inactive = new QHBox( tab_3 ); 88 QHBox *hbox_inactive = new QHBox( tab_3 );
88 TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); 89 TimeLabel = new QLabel( hbox_inactive, "TimeLabel" );
89 TimeLabel->setText( tr( "minutes inactive" ) ); 90 TimeLabel->setText( tr( "minutes inactive" ) );
90 QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); 91 QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) );
91 SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); 92 SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" );
92 QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); 93 QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) );
93 QHBox *hbox_iconSize = new QHBox( tab_3 ); 94 QHBox *hbox_iconSize = new QHBox( tab_3 );
94 QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); 95 QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" );
95 iconSizeLabel->setText( tr( "Icon size" ) ); 96 iconSizeLabel->setText( tr( "Icon size" ) );
96 QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); 97 QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) );
97 SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); 98 SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" );
98 SpinBoxIconSize->setMaxValue( 32 ); 99 SpinBoxIconSize->setMaxValue( 32 );
99 QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) ); 100 QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) );
100 101
101 tab3Layout->addWidget( hbox_auto ); 102 tab3Layout->addWidget( hbox_auto );
102 tab3Layout->addWidget( hbox_inactive ); 103 tab3Layout->addWidget( hbox_inactive );
103 tab3Layout->addWidget( hbox_iconSize ); 104 tab3Layout->addWidget( hbox_iconSize );
104 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); 105 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
105 106
106 m_applets_changed = false; 107 m_applets_changed = false;
107 108
108 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); 109 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) );
109 110
110 readConfig(); 111 readConfig();
111 showMaximized(); 112 showMaximized();
112} 113}
113 114
114 115
115/** 116/**
116 * Autostart, uses the new (opie only) autostart method in the launcher code. 117 * Autostart, uses the new (opie only) autostart method in the launcher code.
117 * If registered against that today ist started on each resume. 118 * If registered against that today ist started on each resume.
118 */ 119 */
119void TodayConfig::setAutoStart() { 120void TodayConfig::setAutoStart() {
120 Config cfg( "today" ); 121 Config cfg( "today" );
121 cfg.setGroup( "Autostart" ); 122 cfg.setGroup( "Autostart" );
122 if ( m_autoStart ) { 123 if ( m_autoStart ) {
123 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); 124 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" );
124 e << QString( "add" ); 125 e << QString( "add" );
125 e << QString( "today" ); 126 e << QString( "today" );
126 e << QString( "%1" ).arg( m_autoStartTimer ); 127 e << QString( "%1" ).arg( m_autoStartTimer );
127 } else { 128 } else {
128 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); 129 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
129 e << QString( "remove" ); 130 e << QString( "remove" );
130 e << QString( "today" ); 131 e << QString( "today" );
131 } 132 }
132} 133}
133 134
134/** 135/**
135 * Read the config part 136 * Read the config part
136 */ 137 */
137void TodayConfig::readConfig() { 138void TodayConfig::readConfig() {
138 Config cfg( "today" ); 139 Config cfg( "today" );
139 cfg.setGroup( "Autostart" ); 140 cfg.setGroup( "Autostart" );
140 m_autoStart = cfg.readNumEntry( "autostart", 1 ); 141 m_autoStart = cfg.readNumEntry( "autostart", 1 );
141 CheckBoxAuto->setChecked( m_autoStart ); 142 CheckBoxAuto->setChecked( m_autoStart );
142 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); 143 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 );
143 SpinBoxTime->setValue( m_autoStartTimer ); 144 SpinBoxTime->setValue( m_autoStartTimer );
144 145
145 cfg.setGroup( "General" ); 146 cfg.setGroup( "General" );
146 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 147 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
147 SpinBoxIconSize->setValue( m_iconSize ); 148 SpinBoxIconSize->setValue( m_iconSize );
148 149
149 cfg.setGroup( "Plugins" ); 150 cfg.setGroup( "Plugins" );
150 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 151 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
151} 152}
152 153
153/** 154/**
154 * Write the config part 155 * Write the config part
155 */ 156 */
156void TodayConfig::writeConfig() { 157void TodayConfig::writeConfig() {
157 Config cfg( "today" ); 158 Config cfg( "today" );
158 cfg.setGroup( "Plugins" ); 159 cfg.setGroup( "Plugins" );
159 if ( m_applets_changed ) { 160 if ( m_applets_changed ) {
160 QStringList exclude; 161 QStringList exclude;
161 QStringList include; 162 QStringList include;
162 QStringList all_applets; 163 QStringList all_applets;
163 164
164 QListViewItemIterator list_it( m_appletListView ); 165 QListViewItemIterator list_it( m_appletListView );
165 166
166 // this makes sure the names get saved in the order selected 167 // this makes sure the names get saved in the order selected
167 for ( ; list_it.current(); ++list_it ) { 168 for ( ; list_it.current(); ++list_it ) {