summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-05 20:46:18 (UTC)
committer harlekin <harlekin>2002-10-05 20:46:18 (UTC)
commitd7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2 (patch) (unidiff)
tree3afa0409bea98ca92ebfa269485f0845b3c96b6a
parentab196dbed05f9e534709a9c0b7f44eca65a72929 (diff)
downloadopie-d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2.zip
opie-d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2.tar.gz
opie-d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2.tar.bz2
buttons resizable and clickable again
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/changelog4
-rw-r--r--core/pim/today/opie-today.control2
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.cpp4
-rw-r--r--core/pim/today/plugins/mail/mailplugin.cpp6
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.cpp4
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.cpp2
-rw-r--r--core/pim/today/today.cpp14
-rw-r--r--core/pim/today/today.h6
-rw-r--r--core/pim/today/todayconfig.cpp22
-rw-r--r--core/pim/today/todayconfig.h2
10 files changed, 49 insertions, 17 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index 5fd3284..25d63ef 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,96 +1,100 @@
10.5.1
2
3* icons scalable and clickable again
4
10.5 50.5
2 6
3* now fully plugin based 7* now fully plugin based
4 8
50.3.4 90.3.4
6 10
7* "fill our business card now a clickable label" 11* "fill our business card now a clickable label"
8* Several bugfixes regarding todo section. 12* Several bugfixes regarding todo section.
9 13
100.3.3 140.3.3
11 15
12* Changed the logo so it better scales to bigger display and also 16* Changed the logo so it better scales to bigger display and also
13 made the "Today" string translatable. 17 made the "Today" string translatable.
14* some am/pm fixes 18* some am/pm fixes
15* clickable labels now in libopie 19* clickable labels now in libopie
16 20
170.3.2 210.3.2
18 22
19* Autostart is now more configurable. You can decide how long 23* Autostart is now more configurable. You can decide how long
20 the ipaq has to has been suspended, before autostart is triggered.(Opie 24 the ipaq has to has been suspended, before autostart is triggered.(Opie
21 only) 25 only)
22* am/pm time optinal (autodetect) 26* am/pm time optinal (autodetect)
23 27
240.3.1 280.3.1
25 29
26* fixed the wrong color of the buttons 30* fixed the wrong color of the buttons
27* better translation (thanks carsten and others) 31* better translation (thanks carsten and others)
28* fixes memory leaks 32* fixes memory leaks
29* bugfixes in calendar part, now location and note are working again. 33* bugfixes in calendar part, now location and note are working again.
30 34
310.3.0 350.3.0
32 36
33* today uses now tododb from libopie. So major changes in the todo part: 37* today uses now tododb from libopie. So major changes in the todo part:
34 - overdue items on top 38 - overdue items on top
35 - then sorted by date, then by priority 39 - then sorted by date, then by priority
36* some cleanups 40* some cleanups
37* speed optimisations 41* speed optimisations
38 42
390.2.9 430.2.9
40 44
41* Many bugfixes. 45* Many bugfixes.
42* Today now apparently sorts the dates _allways_ right, i would assume it 46* Today now apparently sorts the dates _allways_ right, i would assume it
43to be a qt bug 47to be a qt bug
44 48
450.2.8 490.2.8
46 50
47* Appointments are now clickable (connection to datebook still missing) 51* Appointments are now clickable (connection to datebook still missing)
48* autostart support (opie only) 52* autostart support (opie only)
49 53
500.2.7 540.2.7
51 55
52* check if todolist.xml was changed before parsing it 56* check if todolist.xml was changed before parsing it
53* check only every 30 sec for changes. 57* check only every 30 sec for changes.
54* some visual stuff 58* some visual stuff
55* as usual many little improvements .-) 59* as usual many little improvements .-)
56 60
570.2.6 610.2.6
58 62
59* added scrollbars to dates and todo 63* added scrollbars to dates and todo
60* all day detection 64* all day detection
61* some smaller bugfixes 65* some smaller bugfixes
62 66
630.2.5 670.2.5
64 68
65* some other minor fixes regarding autoupdate 69* some other minor fixes regarding autoupdate
66* fixed segfault with todolist > 7 entries 70* fixed segfault with todolist > 7 entries
67* fixed the "ugly grey border around buttons" issue 71* fixed the "ugly grey border around buttons" issue
68* fixed the "empty calendar field" "bug" 72* fixed the "empty calendar field" "bug"
69* shown only later appointments as option 73* shown only later appointments as option
70 74
71 75
720.2.4 760.2.4
73 77
74* added support for email 78* added support for email
75* autoupdates after 1 min 79* autoupdates after 1 min
76* QCopEnvelope instead of system() 80* QCopEnvelope instead of system()
77* starting to use qvbox in gui 81* starting to use qvbox in gui
78 82
79 83
800.2.3 840.2.3
81 85
82* the 4 am release 86* the 4 am release
83* several bugfixes 87* several bugfixes
84 88
85 89
860.2.2 900.2.2
87 91
88* started working on calling other apps 92* started working on calling other apps
89* and finished it 93* and finished it
90 94
910.2.1 950.2.1
92 96
93* images no more inline 97* images no more inline
94* config dialog 98* config dialog
95 99
960.1.1 1000.1.1
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control
index 6ea5090..28087f9 100644
--- a/core/pim/today/opie-today.control
+++ b/core/pim/today/opie-today.control
@@ -1,16 +1,16 @@
1Files: bin/today apps/1Pim/today.desktop pics/today/* 1Files: bin/today apps/1Pim/today.desktop pics/today/*
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiß <harlekin@handhelds.org> 4Maintainer: Maximilian Reiß <harlekin@handhelds.org>
5Architecture: arm 5Architecture: arm
6Version: 0.5-$SUB_VERSION 6Version: 0.5.1-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION)
8License: GPL 8License: GPL
9Description: today screen 9Description: today screen
10 This today screen app gives an overview of appointments 10 This today screen app gives an overview of appointments
11 and todos. 11 and todos.
12 It also shows incoming and outgoing mails from opiemail. 12 It also shows incoming and outgoing mails from opiemail.
13 When using Opie (opie.handhelds.org) today can be autostarted 13 When using Opie (opie.handhelds.org) today can be autostarted
14 on resume. 14 on resume.
15 It is highly configurable. 15 It is highly configurable.
16 16
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp
index 4ebb178..cacdb65 100644
--- a/core/pim/today/plugins/datebook/datebookplugin.cpp
+++ b/core/pim/today/plugins/datebook/datebookplugin.cpp
@@ -1,59 +1,59 @@
1 1
2/* 2/*
3 * datebookplugin.cpp 3 * datebookplugin.cpp
4 * 4 *
5 * copyright : (c) 2002 by Maximilian Reiß 5 * copyright : (c) 2002 by Maximilian Reiß
6 * email : harlekin@handhelds.org 6 * email : harlekin@handhelds.org
7 * 7 *
8 */ 8 */
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18 18
19 19
20#include "datebookevent.h" 20#include "datebookevent.h"
21#include "datebookplugin.h" 21#include "datebookplugin.h"
22#include "datebookpluginwidget.h" 22#include "datebookpluginwidget.h"
23#include "datebookpluginconfig.h" 23#include "datebookpluginconfig.h"
24 24
25 25
26DatebookPlugin::DatebookPlugin() { 26DatebookPlugin::DatebookPlugin() {
27} 27}
28 28
29DatebookPlugin::~DatebookPlugin() { 29DatebookPlugin::~DatebookPlugin() {
30} 30}
31 31
32QString DatebookPlugin::pluginName() const { 32QString DatebookPlugin::pluginName() const {
33 return "Datebook plugin"; 33 return QObject::tr( "Datebook plugin");
34} 34}
35 35
36double DatebookPlugin::versionNumber() const { 36double DatebookPlugin::versionNumber() const {
37 return 1.0; 37 return 1.0;
38} 38}
39 39
40QString DatebookPlugin::pixmapNameWidget() const { 40QString DatebookPlugin::pixmapNameWidget() const {
41 return "DateBook"; 41 return "DateBook";
42} 42}
43 43
44QWidget* DatebookPlugin::widget( QWidget* wid ) { 44QWidget* DatebookPlugin::widget( QWidget* wid ) {
45 return new DatebookPluginWidget( wid, "Datebook" ); 45 return new DatebookPluginWidget( wid, "Datebook" );
46} 46}
47 47
48QString DatebookPlugin::pixmapNameConfig() const { 48QString DatebookPlugin::pixmapNameConfig() const {
49 return "DateBook"; 49 return "DateBook";
50} 50}
51 51
52TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { 52TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) {
53 return new DatebookPluginConfig( wid , "Datebook" ); 53 return new DatebookPluginConfig( wid , "Datebook" );
54} 54}
55 55
56QString DatebookPlugin::appName() const { 56QString DatebookPlugin::appName() const {
57 return QObject::tr( "Datebook" ); 57 return "datebook";
58} 58}
59 59
diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp
index 3ddf16e..1c90df4 100644
--- a/core/pim/today/plugins/mail/mailplugin.cpp
+++ b/core/pim/today/plugins/mail/mailplugin.cpp
@@ -1,56 +1,56 @@
1/* 1/*
2 * mailplugin.cpp 2 * mailplugin.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 "mailplugin.h" 18#include "mailplugin.h"
19#include "mailpluginwidget.h" 19#include "mailpluginwidget.h"
20 20
21 21
22MailPlugin::MailPlugin() { 22MailPlugin::MailPlugin() {
23} 23}
24 24
25MailPlugin::~MailPlugin() { 25MailPlugin::~MailPlugin() {
26} 26}
27 27
28QString MailPlugin::pluginName() const { 28QString MailPlugin::pluginName() const {
29 return "Mail plugin"; 29 return QObject::tr( "Mail plugin" );
30} 30}
31 31
32double MailPlugin::versionNumber() const { 32double MailPlugin::versionNumber() const {
33 return 0.5; 33 return 0.6;
34} 34}
35 35
36QString MailPlugin::pixmapNameWidget() const { 36QString MailPlugin::pixmapNameWidget() const {
37 return "mail/desktopicon"; 37 return "mail/desktopicon";
38} 38}
39 39
40QWidget* MailPlugin::widget( QWidget * wid ) { 40QWidget* MailPlugin::widget( QWidget * wid ) {
41 return new MailPluginWidget( wid, "Mail" ); 41 return new MailPluginWidget( wid, "Mail" );
42} 42}
43 43
44QString MailPlugin::pixmapNameConfig() const { 44QString MailPlugin::pixmapNameConfig() const {
45 return 0l; 45 return 0l;
46} 46}
47 47
48TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { 48TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) {
49 return 0l; 49 return 0l;
50} 50}
51 51
52QString MailPlugin::appName() const { 52QString MailPlugin::appName() const {
53 return "Mail"; 53 return "mail";
54} 54}
55 55
56 56
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp
index 19d9f37..09b54af 100644
--- a/core/pim/today/plugins/todolist/todoplugin.cpp
+++ b/core/pim/today/plugins/todolist/todoplugin.cpp
@@ -1,58 +1,58 @@
1/* 1/*
2 * todoplugin.cpp 2 * todoplugin.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 18
19#include "todoplugin.h" 19#include "todoplugin.h"
20#include "todopluginconfig.h" 20#include "todopluginconfig.h"
21#include "todopluginwidget.h" 21#include "todopluginwidget.h"
22 22
23 23
24TodolistPlugin::TodolistPlugin() { 24TodolistPlugin::TodolistPlugin() {
25} 25}
26 26
27TodolistPlugin::~TodolistPlugin() { 27TodolistPlugin::~TodolistPlugin() {
28} 28}
29 29
30QString TodolistPlugin::pluginName() const { 30QString TodolistPlugin::pluginName() const {
31 return "Todolist plugin"; 31 return QObject::tr( "Todolist plugin" );
32} 32}
33 33
34double TodolistPlugin::versionNumber() const { 34double TodolistPlugin::versionNumber() const {
35 return 0.7; 35 return 0.7;
36} 36}
37 37
38QString TodolistPlugin::pixmapNameWidget() const { 38QString TodolistPlugin::pixmapNameWidget() const {
39 return "TodoList"; 39 return "TodoList";
40} 40}
41 41
42QWidget* TodolistPlugin::widget( QWidget *wid ) { 42QWidget* TodolistPlugin::widget( QWidget *wid ) {
43 return new TodolistPluginWidget( wid, "Todolist" ); 43 return new TodolistPluginWidget( wid, "Todolist" );
44} 44}
45 45
46QString TodolistPlugin::pixmapNameConfig() const { 46QString TodolistPlugin::pixmapNameConfig() const {
47 return "TodoList"; 47 return "TodoList";
48} 48}
49 49
50TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { 50TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) {
51 return new TodolistPluginConfig( wid , "Todolist" ); 51 return new TodolistPluginConfig( wid , "Todolist" );
52} 52}
53 53
54QString TodolistPlugin::appName() const { 54QString TodolistPlugin::appName() const {
55 return QObject::tr( "Todolist" ); 55 return "todolist";
56} 56}
57 57
58 58
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp
index d793aae..320969e 100644
--- a/core/pim/today/plugins/todolist/todopluginwidget.cpp
+++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp
@@ -1,129 +1,129 @@
1/* 1/*
2 * todopluginwidget.cpp 2 * todopluginwidget.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 "todopluginwidget.h" 17#include "todopluginwidget.h"
18 18
19#include <qvaluelist.h> 19#include <qvaluelist.h>
20#include <qtl.h> 20#include <qtl.h>
21#include <qstring.h> 21#include <qstring.h>
22#include <qscrollview.h> 22#include <qscrollview.h>
23#include <qobject.h> 23#include <qobject.h>
24#include <qlayout.h> 24#include <qlayout.h>
25 25
26#include <qpe/config.h> 26#include <qpe/config.h>
27#include <qpe/timestring.h> 27#include <qpe/timestring.h>
28#include <qpe/qcopenvelope_qws.h> 28#include <qpe/qcopenvelope_qws.h>
29 29
30TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) 30TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
31 : QWidget( parent, name ) { 31 : QWidget( parent, name ) {
32 32
33 todoLabel= 0l; 33 todoLabel = 0l;
34 todo = 0l; 34 todo = 0l;
35 35
36 if ( todo ) { 36 if ( todo ) {
37 delete todo; 37 delete todo;
38 } 38 }
39 todo = new ToDoDB(); 39 todo = new ToDoDB();
40 40
41 readConfig(); 41 readConfig();
42 getTodo(); 42 getTodo();
43} 43}
44 44
45TodolistPluginWidget::~TodolistPluginWidget() { 45TodolistPluginWidget::~TodolistPluginWidget() {
46 delete todo; 46 delete todo;
47} 47}
48 48
49 49
50void TodolistPluginWidget::readConfig() { 50void TodolistPluginWidget::readConfig() {
51 Config cfg( "todaytodoplugin" ); 51 Config cfg( "todaytodoplugin" );
52 cfg.setGroup( "config" ); 52 cfg.setGroup( "config" );
53 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); 53 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 );
54 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 54 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
55} 55}
56 56
57 57
58/** 58/**
59 * Get the todos 59 * Get the todos
60 */ 60 */
61void TodolistPluginWidget::getTodo() { 61void TodolistPluginWidget::getTodo() {
62 62
63 QVBoxLayout* layoutTodo = new QVBoxLayout( this ); 63 QVBoxLayout* layoutTodo = new QVBoxLayout( this );
64 64
65 if ( todoLabel ) { 65 if ( todoLabel ) {
66 delete todoLabel; 66 delete todoLabel;
67 } 67 }
68 68
69 todoLabel = new OClickableLabel( this ); 69 todoLabel = new OClickableLabel( this );
70 todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); 70 todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
71 connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); 71 connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) );
72 72
73 QString output; 73 QString output;
74 QString tmpout; 74 QString tmpout;
75 int count = 0; 75 int count = 0;
76 int ammount = 0; 76 int ammount = 0;
77 77
78 // get overdue todos first 78 // get overdue todos first
79 QValueList<ToDoEvent> overDueList = todo->overDue(); 79 QValueList<ToDoEvent> overDueList = todo->overDue();
80 qBubbleSort( overDueList ); 80 qBubbleSort( overDueList );
81 for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); 81 for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin();
82 it != overDueList.end(); ++it ) { 82 it != overDueList.end(); ++it ) {
83 if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { 83 if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) {
84 QString desc = (*it).summary(); 84 QString desc = (*it).summary();
85 if( desc.isEmpty() ) { 85 if( desc.isEmpty() ) {
86 desc = (*it).description(); 86 desc = (*it).description();
87 } 87 }
88 tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; 88 tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>";
89 ammount++; 89 ammount++;
90 } 90 }
91 } 91 }
92 92
93 // get total number of still open todos 93 // get total number of still open todos
94 QValueList<ToDoEvent> openTodo = todo->rawToDos(); 94 QValueList<ToDoEvent> openTodo = todo->rawToDos();
95 qBubbleSort( openTodo ); 95 qBubbleSort( openTodo );
96 for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin(); 96 for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin();
97 it != openTodo.end(); ++it ) { 97 it != openTodo.end(); ++it ) {
98 if ( !(*it).isCompleted() ){ 98 if ( !(*it).isCompleted() ){
99 count +=1; 99 count +=1;
100 // not the overdues, we allready got them, and not if we are 100 // not the overdues, we allready got them, and not if we are
101 // over the maxlines 101 // over the maxlines
102 if ( !(*it).isOverdue() && ( ammount < m_maxLinesTask ) ) { 102 if ( !(*it).isOverdue() && ( ammount < m_maxLinesTask ) ) {
103 QString desc = (*it).summary(); 103 QString desc = (*it).summary();
104 if( desc.isEmpty() ) { 104 if( desc.isEmpty() ) {
105 desc = (*it).description(); 105 desc = (*it).description();
106 } 106 }
107 tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; 107 tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>";
108 ammount++; 108 ammount++;
109 } 109 }
110 } 110 }
111 } 111 }
112 112
113 113
114 if ( count > 0 ) { 114 if ( count > 0 ) {
115 if( count == 1 ) { 115 if( count == 1 ) {
116 output += QObject::tr( "There is <b> 1</b> active task: <br>" ); 116 output += QObject::tr( "There is <b> 1</b> active task: <br>" );
117 } else { 117 } else {
118 output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg( count ); 118 output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg( count );
119 } 119 }
120 output += tmpout; 120 output += tmpout;
121 } else { 121 } else {
122 output = QObject::tr( "No active tasks" ); 122 output = QObject::tr( "No active tasks" );
123 } 123 }
124 todoLabel->setText( output ); 124 todoLabel->setText( output );
125 layoutTodo->addWidget( todoLabel ); 125 layoutTodo->addWidget( todoLabel );
126} 126}
127 127
128/** 128/**
129 * start the todolist 129 * start the todolist
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 35758d5..34ec3cb 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -21,307 +21,315 @@
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 38
39 39
40struct TodayPlugin { 40struct TodayPlugin {
41 QLibrary *library; 41 QLibrary *library;
42 TodayPluginInterface *iface; 42 TodayPluginInterface *iface;
43 TodayPluginObject *guiPart; 43 TodayPluginObject *guiPart;
44 QWidget *guiBox; 44 QWidget *guiBox;
45 QString name; 45 QString name;
46 bool active; 46 bool active;
47 int pos; 47 int pos;
48}; 48};
49 49
50static QValueList<TodayPlugin> pluginList; 50static QValueList<TodayPlugin> pluginList;
51 51
52Today::Today( QWidget* parent, const char* name, WFlags fl ) 52Today::Today( QWidget* parent, const char* name, WFlags fl )
53 : TodayBase( parent, name, fl ) { 53 : TodayBase( parent, name, fl ) {
54 54
55 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 55 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
56 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 56 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
57 57
58#if defined(Q_WS_QWS) 58#if defined(Q_WS_QWS)
59#if !defined(QT_NO_COP) 59#if !defined(QT_NO_COP)
60 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 60 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
61 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 61 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
62 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 62 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
63#endif 63#endif
64#endif 64#endif
65 65
66 setOwnerField(); 66 setOwnerField();
67 refresh(); 67 refresh();
68 showMaximized(); 68 showMaximized();
69} 69}
70 70
71/** 71/**
72 * Qcop receive method. 72 * Qcop receive method.
73 */ 73 */
74void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 74void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
75 QDataStream stream( data, IO_ReadOnly ); 75 QDataStream stream( data, IO_ReadOnly );
76 if ( msg == "message(QString)" ) { 76 if ( msg == "message(QString)" ) {
77 QString message; 77 QString message;
78 stream >> message; 78 stream >> message;
79 setOwnerField( message ); 79 setOwnerField( message );
80 } 80 }
81} 81}
82 82
83/** 83/**
84 * Initialises the owner field with the default value, the username 84 * Initialises the owner field with the default value, the username
85 */ 85 */
86void Today::setOwnerField() { 86void Today::setOwnerField() {
87 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 87 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
88 if ( QFile::exists( file ) ) { 88 if ( QFile::exists( file ) ) {
89 Contact cont = Contact::readVCard( file )[0]; 89 Contact cont = Contact::readVCard( file )[0];
90 QString returnString = cont.fullName(); 90 QString returnString = cont.fullName();
91 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 91 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
92 } else { 92 } else {
93 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 93 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
94 } 94 }
95} 95}
96 96
97/** 97/**
98 * Set the owner field with a given QString, for example per qcop. 98 * Set the owner field with a given QString, for example per qcop.
99 */ 99 */
100void Today::setOwnerField( QString &message ) { 100void Today::setOwnerField( QString &message ) {
101 if ( !message.isEmpty() ) { 101 if ( !message.isEmpty() ) {
102 OwnerField->setText( "<b>" + message + "</b>" ); 102 OwnerField->setText( "<b>" + message + "</b>" );
103 } 103 }
104} 104}
105 105
106 106
107/** 107/**
108 * Init stuff needed for today. Reads the config file. 108 * Init stuff needed for today. Reads the config file.
109 */ 109 */
110void Today::init() { 110void Today::init() {
111 // read config 111 // read config
112 Config cfg( "today" ); 112 Config cfg( "today" );
113 cfg.setGroup( "Plugins" ); 113 cfg.setGroup( "Plugins" );
114 114
115 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 115 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
116 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 116 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
117 cfg.setGroup( "General" );
118 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
117} 119}
118 120
119 121
120/** 122/**
121 * Load the plugins 123 * Load the plugins
122 */ 124 */
123void Today::loadPlugins() { 125void Today::loadPlugins() {
124 126
125 QValueList<TodayPlugin>::Iterator tit; 127 QValueList<TodayPlugin>::Iterator tit;
126 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 128 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
127 (*tit).library->unload(); 129 (*tit).library->unload();
128 delete (*tit).library; 130 delete (*tit).library;
129 } 131 }
130 pluginList.clear(); 132 pluginList.clear();
131 133
132 QString path = QPEApplication::qpeDir() + "/plugins/today"; 134 QString path = QPEApplication::qpeDir() + "/plugins/today";
133 QDir dir( path, "lib*.so" ); 135 QDir dir( path, "lib*.so" );
134 136
135 QStringList list = dir.entryList(); 137 QStringList list = dir.entryList();
136 QStringList::Iterator it; 138 QStringList::Iterator it;
137 139
138
139 QMap<QString, TodayPlugin> tempList; 140 QMap<QString, TodayPlugin> tempList;
140 141
141 for ( it = list.begin(); it != list.end(); ++it ) { 142 for ( it = list.begin(); it != list.end(); ++it ) {
142 TodayPluginInterface *iface = 0; 143 TodayPluginInterface *iface = 0;
143 QLibrary *lib = new QLibrary( path + "/" + *it ); 144 QLibrary *lib = new QLibrary( path + "/" + *it );
144 145
145 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 146 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
146 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 147 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
147 qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); 148 qDebug( "loading: %s", QString( path + "/" + *it ).latin1() );
148 qDebug( QString(*it) ); 149 qDebug( QString(*it) );
149 TodayPlugin plugin; 150 TodayPlugin plugin;
150 plugin.library = lib; 151 plugin.library = lib;
151 plugin.iface = iface; 152 plugin.iface = iface;
152 plugin.name = QString(*it); 153 plugin.name = QString(*it);
153 154
154 // find out if plugins should be shown 155 // find out if plugins should be shown
155 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 156 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
156 plugin.active = true; 157 plugin.active = true;
157 } else { 158 } else {
158 plugin.active = false; 159 plugin.active = false;
159 } 160 }
160 plugin.guiPart = plugin.iface->guiPart(); 161 plugin.guiPart = plugin.iface->guiPart();
161 162
162 // package the whole thing into a qwidget so it can be shown and hidden 163 // package the whole thing into a qwidget so it can be shown and hidden
163 plugin.guiBox = new QWidget( this ); 164 plugin.guiBox = new QWidget( this );
164 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 165 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
165 QPixmap plugPix; 166 QPixmap plugPix;
166 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); 167 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
167 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 168 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
168 plugIcon->setPixmap( plugPix ); 169 plugIcon->setPixmap( plugPix );
170 plugIcon->setName( plugin.guiPart->appName() );
171 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
169 // a scrollview for each plugin 172 // a scrollview for each plugin
170 QScrollView* sv = new QScrollView( plugin.guiBox ); 173 QScrollView* sv = new QScrollView( plugin.guiBox );
171 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); 174 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
172 // not sure if that is good .-) 175 // not sure if that is good .-)
173 sv->setMinimumHeight( 10 ); 176 sv->setMinimumHeight( 10 );
174 sv->setResizePolicy( QScrollView::AutoOneFit ); 177 sv->setResizePolicy( QScrollView::AutoOneFit );
175 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 178 sv->setHScrollBarMode( QScrollView::AlwaysOff );
176 sv->setFrameShape( QFrame::NoFrame ); 179 sv->setFrameShape( QFrame::NoFrame );
177 sv->addChild( plugWidget ); 180 sv->addChild( plugWidget );
178 // make sure the icon is on the top alligned 181 // make sure the icon is on the top alligned
179 boxLayout->addWidget( plugIcon, 0, AlignTop ); 182 boxLayout->addWidget( plugIcon, 0, AlignTop );
180 boxLayout->addWidget( sv, 0, AlignTop ); 183 boxLayout->addWidget( sv, 0, AlignTop );
181 boxLayout->setStretchFactor( plugIcon, 1 ); 184 boxLayout->setStretchFactor( plugIcon, 1 );
182 boxLayout->setStretchFactor( sv, 9 ); 185 boxLayout->setStretchFactor( sv, 9 );
183 // "prebuffer" it in one more list, to get the sorting done 186 // "prebuffer" it in one more list, to get the sorting done
184 tempList.insert( plugin.name, plugin ); 187 tempList.insert( plugin.name, plugin );
185 188
186 // on first start the list is off course empty 189 // on first start the list is off course empty
187 if ( m_allApplets.isEmpty() ) { 190 if ( m_allApplets.isEmpty() ) {
188 layout->addWidget( plugin.guiBox ); 191 layout->addWidget( plugin.guiBox );
189 pluginList.append( plugin ); 192 pluginList.append( plugin );
190 } 193 }
191 } else { 194 } else {
192 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); 195 qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() );
193 delete lib; 196 delete lib;
194 } 197 }
195 } 198 }
196 199
197 if ( !m_allApplets.isEmpty() ) { 200 if ( !m_allApplets.isEmpty() ) {
198 TodayPlugin tempPlugin; 201 TodayPlugin tempPlugin;
199 QStringList::Iterator stringit; 202 QStringList::Iterator stringit;
200 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { 203 for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) {
201 tempPlugin = ( tempList.find( *stringit ) ).data(); 204 tempPlugin = ( tempList.find( *stringit ) ).data();
202 if ( !( (tempPlugin.name).isEmpty() ) ) { 205 if ( !( (tempPlugin.name).isEmpty() ) ) {
203 layout->addWidget( tempPlugin.guiBox ); 206 layout->addWidget( tempPlugin.guiBox );
204 pluginList.append( tempPlugin ); 207 pluginList.append( tempPlugin );
205 } 208 }
206 } 209 }
207 } 210 }
208} 211}
209 212
210 213
211/** 214/**
212 * Repaint method. Reread all fields. 215 * Repaint method. Reread all fields.
213 */ 216 */
214void Today::draw() { 217void Today::draw() {
215 218
216 if ( pluginList.count() == 0 ) { 219 if ( pluginList.count() == 0 ) {
217 QLabel *noPlugins = new QLabel( this ); 220 QLabel *noPlugins = new QLabel( this );
218 noPlugins->setText( tr( "No plugins found" ) ); 221 noPlugins->setText( tr( "No plugins found" ) );
219 layout->addWidget( noPlugins ); 222 layout->addWidget( noPlugins );
220 return; 223 return;
221 } 224 }
222 225
223 uint count = 0; 226 uint count = 0;
224 TodayPlugin plugin; 227 TodayPlugin plugin;
225 for ( uint i = 0; i < pluginList.count(); i++ ) { 228 for ( uint i = 0; i < pluginList.count(); i++ ) {
226 plugin = pluginList[i]; 229 plugin = pluginList[i];
227 230
228 if ( plugin.active ) { 231 if ( plugin.active ) {
229 // qDebug( plugin.name + " is ACTIVE " ); 232 // qDebug( plugin.name + " is ACTIVE " );
230 plugin.guiBox->show(); 233 plugin.guiBox->show();
231 } else { 234 } else {
232 // qDebug( plugin.name + " is INACTIVE" ); 235 // qDebug( plugin.name + " is INACTIVE" );
233 plugin.guiBox->hide(); 236 plugin.guiBox->hide();
234 } 237 }
235 count++; 238 count++;
236 } 239 }
237 240
238 if ( count == 0 ) { 241 if ( count == 0 ) {
239 QLabel *noPluginsActive = new QLabel( this ); 242 QLabel *noPluginsActive = new QLabel( this );
240 noPluginsActive->setText( tr( "No plugins activated" ) ); 243 noPluginsActive->setText( tr( "No plugins activated" ) );
241 layout->addWidget( noPluginsActive ); 244 layout->addWidget( noPluginsActive );
242 } 245 }
243 layout->addStretch(0); 246 layout->addStretch(0);
244} 247}
245 248
246 249
247/** 250/**
248 * The method for the configuration dialog. 251 * The method for the configuration dialog.
249 */ 252 */
250void Today::startConfig() { 253void Today::startConfig() {
251 254
252 TodayConfig conf( this, "dialog", true ); 255 TodayConfig conf( this, "dialog", true );
253 256
254 TodayPlugin plugin; 257 TodayPlugin plugin;
255 QList<TodayConfigWidget> configWidgetList; 258 QList<TodayConfigWidget> configWidgetList;
256 259
257 for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { 260 for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) {
258 plugin = pluginList[i]; 261 plugin = pluginList[i];
259 262
260 // load the config widgets in the tabs 263 // load the config widgets in the tabs
261 if ( plugin.guiPart->configWidget( this ) != 0l ) { 264 if ( plugin.guiPart->configWidget( this ) != 0l ) {
262 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); 265 TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 );
263 configWidgetList.append( widget ); 266 configWidgetList.append( widget );
264 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() 267 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig()
265 , plugin.guiPart->appName() ); 268 , plugin.guiPart->appName() );
266 } 269 }
267 // set the order/activate tab 270 // set the order/activate tab
268 conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), 271 conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(),
269 Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); 272 Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) );
270 } 273 }
271 274
272 if ( conf.exec() == QDialog::Accepted ) { 275 if ( conf.exec() == QDialog::Accepted ) {
273 conf.writeConfig(); 276 conf.writeConfig();
274 TodayConfigWidget *confWidget; 277 TodayConfigWidget *confWidget;
275 for ( confWidget = configWidgetList.first(); confWidget != 0; 278 for ( confWidget = configWidgetList.first(); confWidget != 0;
276 confWidget = configWidgetList.next() ) { 279 confWidget = configWidgetList.next() ) {
277 confWidget->writeConfig(); 280 confWidget->writeConfig();
278 } 281 }
279 refresh(); 282 refresh();
280 } 283 }
281} 284}
282 285
283 286
284/** 287/**
285 * Refresh for the view. Reload all applets 288 * Refresh for the view. Reload all applets
286 * 289 *
287 */ 290 */
288void Today::refresh() { 291void Today::refresh() {
289 init(); 292 init();
290 293
291 // set the date in top label 294 // set the date in top label
292 QDate date = QDate::currentDate(); 295 QDate date = QDate::currentDate();
293 QString time = ( tr( date.toString() ) ); 296 QString time = ( tr( date.toString() ) );
294 297
295 DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); 298 DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) );
296 299
297 if ( layout ) { 300 if ( layout ) {
298 delete layout; 301 delete layout;
299 } 302 }
300 layout = new QVBoxLayout( this ); 303 layout = new QVBoxLayout( this );
301 layout->addWidget( Frame ); 304 layout->addWidget( Frame );
302 layout->addWidget( OwnerField ); 305 layout->addWidget( OwnerField );
303 306
304 loadPlugins(); 307 loadPlugins();
305 draw(); 308 draw();
306} 309}
307 310
308void Today::startAddressbook() { 311void Today::startAddressbook() {
309 QCopEnvelope e( "QPE/System", "execute(QString)" ); 312 QCopEnvelope e( "QPE/System", "execute(QString)" );
310 e << QString( "addressbook" ); 313 e << QString( "addressbook" );
311} 314}
312 315
313 316
317void Today::startApplication() {
318 QCopEnvelope e( "QPE/System", "execute(QString)" );
319 e << QString( sender()->name() );
320}
321
314/** 322/**
315 * launch addressbook (personal card) 323 * launch addressbook (personal card)
316 */ 324 */
317void Today::editCard() { 325void Today::editCard() {
318 startAddressbook(); 326 startAddressbook();
319 while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { 327 while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) {
320 qApp->processEvents(); 328 qApp->processEvents();
321 } 329 }
322 QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); 330 QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" );
323} 331}
324 332
325Today::~Today() { 333Today::~Today() {
326} 334}
327 335
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 92512b9..6f13df6 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -1,73 +1,73 @@
1/* 1/*
2 * today.h 2 * today.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 17
18#ifndef TODAY_H 18#ifndef TODAY_H
19#define TODAY_H 19#define TODAY_H
20 20
21#include <opie/tododb.h> 21#include <opie/tododb.h>
22 22
23#include <qdatetime.h> 23#include <qdatetime.h>
24#include <qlist.h> 24#include <qlist.h>
25#include <qhbox.h> 25#include <qhbox.h>
26 26
27#include <qpe/qlibrary.h> 27#include <qpe/qlibrary.h>
28#include <qpe/event.h> 28#include <qpe/event.h>
29 29
30#include "todayconfig.h" 30#include "todayconfig.h"
31#include "todaybase.h" 31#include "todaybase.h"
32#include <opie/todayplugininterface.h> 32#include <opie/todayplugininterface.h>
33 33
34class QVBoxLayout; 34class QVBoxLayout;
35 35class OClickableLabel;
36 36
37 37
38class Today : public TodayBase { 38class Today : public TodayBase {
39 39
40 Q_OBJECT 40 Q_OBJECT
41 41
42 public: 42 public:
43 Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 43 Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
44 ~Today(); 44 ~Today();
45 45
46private slots: 46private slots:
47 void startConfig(); 47 void startConfig();
48 void startAddressbook(); 48 void startAddressbook();
49 void startApplication();
49 void editCard(); 50 void editCard();
50 void refresh(); 51 void refresh();
51 52
52private: 53private:
53 void init(); 54 void init();
54 void setOwnerField(); 55 void setOwnerField();
55 void setOwnerField(QString &string); 56 void setOwnerField(QString &string);
56 void loadPlugins(); 57 void loadPlugins();
57 void draw(); 58 void draw();
58 59
59private slots: 60private slots:
60 void channelReceived(const QCString &msg, const QByteArray & data); 61 void channelReceived(const QCString &msg, const QByteArray & data);
61 62
62 private: 63 private:
63 TodayConfig *conf; 64 TodayConfig *conf;
64 QStringList m_excludeApplets; 65 QStringList m_excludeApplets;
65 QStringList m_allApplets; 66 QStringList m_allApplets;
66 67
67 // QString m_autoStartTimer;
68 int m_newStart; 68 int m_newStart;
69 // int m_autoStart; 69 int m_iconSize;
70 int m_maxCharClip; 70 int m_maxCharClip;
71}; 71};
72 72
73#endif 73#endif
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 3fc5830..097965b 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -1,222 +1,240 @@
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 33
33class ToolButton : public QToolButton { 34class ToolButton : public QToolButton {
34 35
35public: 36public:
36 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) 37 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
37 : QToolButton( parent, name ) { 38 : QToolButton( parent, name ) {
38 setPixmap( Resource::loadPixmap( icon ) ); 39 setPixmap( Resource::loadPixmap( icon ) );
39 setAutoRaise( TRUE ); 40 setAutoRaise( TRUE );
40 setFocusPolicy( QWidget::NoFocus ); 41 setFocusPolicy( QWidget::NoFocus );
41 setToggleButton( t ); 42 setToggleButton( t );
42 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); 43 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
43 } 44 }
44}; 45};
45 46
46 47
47/** 48/**
48 * The class has currently quite some duplicate code. 49 * The class has currently quite some duplicate code.
49 * By that way it would be real easy to have it as seperate app in settings tab 50 * By that way it would be real easy to have it as seperate app in settings tab
50 * 51 *
51 */ 52 */
52TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl ) 53TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl )
53 : QDialog( parent, name, modal, fl ) { 54 : QDialog( parent, name, modal, fl ) {
54 55
55 setCaption( tr( "Today config" ) ); 56 setCaption( tr( "Today config" ) );
56 57
57 QVBoxLayout *layout = new QVBoxLayout( this ); 58 QVBoxLayout *layout = new QVBoxLayout( this );
58 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 59 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
59 layout->addWidget( TabWidget3 ); 60 layout->addWidget( TabWidget3 );
60 61
61 tab_2 = new QWidget( TabWidget3, "tab_2" ); 62 tab_2 = new QWidget( TabWidget3, "tab_2" );
62 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); 63 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
63 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); 64 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
64 tab2Layout->addWidget( l ); 65 tab2Layout->addWidget( l );
65 QHBox *hbox1 = new QHBox( tab_2 ); 66 QHBox *hbox1 = new QHBox( tab_2 );
66 m_appletListView = new QListView( hbox1 ); 67 m_appletListView = new QListView( hbox1 );
67 m_appletListView->addColumn( "PluginList" ); 68 m_appletListView->addColumn( "PluginList" );
68 m_appletListView->header()->hide(); 69 m_appletListView->header()->hide();
69 m_appletListView->setSorting( -1 ); 70 m_appletListView->setSorting( -1 );
70 QVBox *vbox1 = new QVBox( hbox1 ); 71 QVBox *vbox1 = new QVBox( hbox1 );
71 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); 72 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
72 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); 73 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
73 tab2Layout->addWidget( hbox1 ); 74 tab2Layout->addWidget( hbox1 );
74 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); 75 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) );
75 76
76 tab_3 = new QWidget( TabWidget3, "tab_3" ); 77 tab_3 = new QWidget( TabWidget3, "tab_3" );
77 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); 78 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
78 tab3Layout->setMargin( 20 ); 79 tab3Layout->setMargin( 20 );
79 QHBox *hbox_auto = new QHBox( tab_3 ); 80 QHBox *hbox_auto = new QHBox( tab_3 );
80 TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); 81 TextLabel2 = new QLabel( hbox_auto, "AutoStart" );
81 TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); 82 TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) );
82 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); 83 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" );
83 QHBox *hbox_inactive = new QHBox( tab_3 ); 84 QHBox *hbox_inactive = new QHBox( tab_3 );
84 TimeLabel = new QLabel( hbox_inactive , "TimeLabel" ); 85 TimeLabel = new QLabel( hbox_inactive, "TimeLabel" );
85 TimeLabel->setText( tr( "minutes inactive" ) ); 86 TimeLabel->setText( tr( "minutes inactive" ) );
86 SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); 87 SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" );
88 QHBox *hbox_iconSize = new QHBox( tab_3 );
89 QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" );
90 iconSizeLabel->setText( tr( "Icon size" ) );
91 // iconSizeLabel->setToolTip( tr( "Set the icon size in pixel" ) );
92 SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" );
93 SpinBoxIconSize->setMaxValue( 32 );
94
87 tab3Layout->addWidget( hbox_auto ); 95 tab3Layout->addWidget( hbox_auto );
88 tab3Layout->addWidget( hbox_inactive ); 96 tab3Layout->addWidget( hbox_inactive );
97 tab3Layout->addWidget( hbox_iconSize );
89 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); 98 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
90 99
91 m_applets_changed = false; 100 m_applets_changed = false;
92 101
93 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); 102 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) );
94 103
95 readConfig(); 104 readConfig();
96 showMaximized(); 105 showMaximized();
97} 106}
98 107
99 108
100/** 109/**
101 * Autostart, uses the new (opie only) autostart method in the launcher code. 110 * Autostart, uses the new (opie only) autostart method in the launcher code.
102 * If registered against that today ist started on each resume. 111 * If registered against that today ist started on each resume.
103 */ 112 */
104void TodayConfig::setAutoStart() { 113void TodayConfig::setAutoStart() {
105 Config cfg( "today" ); 114 Config cfg( "today" );
106 cfg.setGroup( "Autostart" ); 115 cfg.setGroup( "Autostart" );
107 if ( m_autoStart ) { 116 if ( m_autoStart ) {
108 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); 117 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" );
109 e << QString( "add" ); 118 e << QString( "add" );
110 e << QString( "today" ); 119 e << QString( "today" );
111 e << QString("%1").arg( m_autoStartTimer ); 120 e << QString( "%1" ).arg( m_autoStartTimer );
112 } else { 121 } else {
113 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); 122 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
114 e << QString( "remove" ); 123 e << QString( "remove" );
115 e << QString( "today" ); 124 e << QString( "today" );
116 } 125 }
117} 126}
118 127
119/** 128/**
120 * Read the config part 129 * Read the config part
121 */ 130 */
122void TodayConfig::readConfig() { 131void TodayConfig::readConfig() {
123 Config cfg( "today" ); 132 Config cfg( "today" );
124 cfg.setGroup( "Autostart" ); 133 cfg.setGroup( "Autostart" );
125 m_autoStart = cfg.readNumEntry( "autostart", 1 ); 134 m_autoStart = cfg.readNumEntry( "autostart", 1 );
126 CheckBoxAuto->setChecked( m_autoStart ); 135 CheckBoxAuto->setChecked( m_autoStart );
127 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); 136 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 );
128 SpinBoxTime->setValue( m_autoStartTimer ); 137 SpinBoxTime->setValue( m_autoStartTimer );
129 138
139 cfg.setGroup( "General" );
140 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
141 SpinBoxIconSize->setValue( m_iconSize );
142
130 cfg.setGroup( "Plugins" ); 143 cfg.setGroup( "Plugins" );
131 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 144 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
132} 145}
133 146
134/** 147/**
135 * Write the config part 148 * Write the config part
136 */ 149 */
137void TodayConfig::writeConfig() { 150void TodayConfig::writeConfig() {
138 Config cfg( "today" ); 151 Config cfg( "today" );
139 cfg.setGroup( "Plugins" ); 152 cfg.setGroup( "Plugins" );
140 if ( m_applets_changed ) { 153 if ( m_applets_changed ) {
141 QStringList exclude; 154 QStringList exclude;
142 QStringList include; 155 QStringList include;
143 QStringList all_applets; 156 QStringList all_applets;
144 157
145 QListViewItemIterator list_it( m_appletListView ); 158 QListViewItemIterator list_it( m_appletListView );
146 159
147 // this makes sure the names get saved in the order selected 160 // this makes sure the names get saved in the order selected
148 for ( ; list_it.current(); ++list_it ) { 161 for ( ; list_it.current(); ++list_it ) {
149 QMap <QString, QCheckListItem *>::Iterator it; 162 QMap <QString, QCheckListItem *>::Iterator it;
150 for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { 163 for ( it = m_applets.begin(); it != m_applets. end (); ++it ) {
151 if ( list_it.current() == (*it) && !(*it)-> isOn () ) { 164 if ( list_it.current() == (*it) && !(*it)-> isOn () ) {
152 exclude << it.key(); 165 exclude << it.key();
153 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ 166 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){
154 include << it.key(); 167 include << it.key();
155 } 168 }
156 if ( list_it.current() == (*it) ) { 169 if ( list_it.current() == (*it) ) {
157 all_applets << it.key(); 170 all_applets << it.key();
158 } 171 }
159 } 172 }
160 } 173 }
161 cfg.writeEntry( "ExcludeApplets", exclude, ',' ); 174 cfg.writeEntry( "ExcludeApplets", exclude, ',' );
162 cfg.writeEntry( "IncludeApplets", include, ',' ); 175 cfg.writeEntry( "IncludeApplets", include, ',' );
163 cfg.writeEntry( "AllApplets", all_applets, ',' ); 176 cfg.writeEntry( "AllApplets", all_applets, ',' );
164 } 177 }
165 178
166 cfg.setGroup( "Autostart" ); 179 cfg.setGroup( "Autostart" );
167 m_autoStart = CheckBoxAuto->isChecked(); 180 m_autoStart = CheckBoxAuto->isChecked();
168 cfg.writeEntry( "autostart", m_autoStart ); 181 cfg.writeEntry( "autostart", m_autoStart );
169 m_autoStartTimer = SpinBoxTime->value(); 182 m_autoStartTimer = SpinBoxTime->value();
170 cfg.writeEntry( "autostartdelay", m_autoStartTimer ); 183 cfg.writeEntry( "autostartdelay", m_autoStartTimer );
184 m_iconSize = SpinBoxIconSize->value();
185
186 cfg.setGroup( "General" );
187 cfg.writeEntry( "IconSize", m_iconSize );
188
171 189
172 // set autostart settings 190 // set autostart settings
173 setAutoStart(); 191 setAutoStart();
174} 192}
175 193
176 194
177void TodayConfig::moveSelectedUp() { 195void TodayConfig::moveSelectedUp() {
178 QListViewItem *item = m_appletListView->selectedItem(); 196 QListViewItem *item = m_appletListView->selectedItem();
179 if ( item && item->itemAbove() ) { 197 if ( item && item->itemAbove() ) {
180 item->itemAbove()->moveItem( item ); 198 item->itemAbove()->moveItem( item );
181 } 199 }
182} 200}
183 201
184 202
185void TodayConfig::moveSelectedDown() { 203void TodayConfig::moveSelectedDown() {
186 QListViewItem *item = m_appletListView->selectedItem(); 204 QListViewItem *item = m_appletListView->selectedItem();
187 if ( item && item->itemBelow() ) { 205 if ( item && item->itemBelow() ) {
188 item->moveItem( item->itemBelow() ); 206 item->moveItem( item->itemBelow() );
189 } 207 }
190} 208}
191 209
192 210
193/** 211/**
194 * Set up the icons in the order/active tab 212 * Set up the icons in the order/active tab
195 */ 213 */
196void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon ) { 214void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon ) {
197 215
198 QCheckListItem *item; 216 QCheckListItem *item;
199 item = new QCheckListItem( m_appletListView, name, QCheckListItem::CheckBox ); 217 item = new QCheckListItem( m_appletListView, name, QCheckListItem::CheckBox );
200 218
201 if ( !icon.isNull() ) { 219 if ( !icon.isNull() ) {
202 item->setPixmap( 0, icon ); 220 item->setPixmap( 0, icon );
203 } 221 }
204 222
205 if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) { 223 if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) {
206 item->setOn( TRUE ); 224 item->setOn( TRUE );
207 } 225 }
208 226
209 m_applets[libName] = item; 227 m_applets[libName] = item;
210 228
211 // kind of hack to get the first tab as default. 229 // kind of hack to get the first tab as default.
212 TabWidget3->setCurrentTab( tab_2 ); 230 TabWidget3->setCurrentTab( tab_2 );
213} 231}
214 232
215void TodayConfig::appletChanged() { 233void TodayConfig::appletChanged() {
216 m_applets_changed = true; 234 m_applets_changed = true;
217} 235}
218 236
219 237
220TodayConfig::~TodayConfig() { 238TodayConfig::~TodayConfig() {
221} 239}
222 240
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index f23b850..aa227dd 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -1,71 +1,73 @@
1/* 1/*
2 * todayconfig.h 2 * todayconfig.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 TODAYCONFIG_H 17#ifndef TODAYCONFIG_H
18#define TODAYCONFIG_H 18#define TODAYCONFIG_H
19 19
20#include <qvariant.h> 20#include <qvariant.h>
21#include <qdialog.h> 21#include <qdialog.h>
22#include <qlistview.h> 22#include <qlistview.h>
23#include <opie/otabwidget.h> 23#include <opie/otabwidget.h>
24 24
25class QCheckBox; 25class QCheckBox;
26class QLabel; 26class QLabel;
27class QSpinBox; 27class QSpinBox;
28class QTabWidget; 28class QTabWidget;
29 29
30class TodayConfig : public QDialog { 30class TodayConfig : public QDialog {
31 31
32 Q_OBJECT 32 Q_OBJECT
33 33
34public: 34public:
35 TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 35 TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
36 ~TodayConfig(); 36 ~TodayConfig();
37 37
38 OTabWidget* TabWidget3; 38 OTabWidget* TabWidget3;
39 39
40 void writeConfig(); 40 void writeConfig();
41 void pluginManagement( QString libName, QString name, QPixmap icon ); 41 void pluginManagement( QString libName, QString name, QPixmap icon );
42 42
43 43
44protected slots: 44protected slots:
45 void appletChanged(); 45 void appletChanged();
46 void moveSelectedUp(); 46 void moveSelectedUp();
47 void moveSelectedDown(); 47 void moveSelectedDown();
48 48
49private: 49private:
50 void setAutoStart(); 50 void setAutoStart();
51 void readConfig(); 51 void readConfig();
52 52
53 QListView* m_appletListView; 53 QListView* m_appletListView;
54 QMap<QString,QCheckListItem*> m_applets; 54 QMap<QString,QCheckListItem*> m_applets;
55 55
56 int m_autoStart; 56 int m_autoStart;
57 int m_autoStartTimer; 57 int m_autoStartTimer;
58 int m_iconSize;
58 QStringList m_excludeApplets; 59 QStringList m_excludeApplets;
59 bool m_applets_changed; 60 bool m_applets_changed;
60 61
61 QLabel* TextLabel2; 62 QLabel* TextLabel2;
62 QCheckBox* CheckBoxAuto; 63 QCheckBox* CheckBoxAuto;
63 QWidget* tab_2; 64 QWidget* tab_2;
64 QWidget* tab_3; 65 QWidget* tab_3;
65 QLabel* TextLabel1; 66 QLabel* TextLabel1;
66 QSpinBox* SpinBox7; 67 QSpinBox* SpinBox7;
67 QLabel* TimeLabel; 68 QLabel* TimeLabel;
68 QSpinBox* SpinBoxTime; 69 QSpinBox* SpinBoxTime;
70 QSpinBox* SpinBoxIconSize;
69}; 71};
70 72
71#endif 73#endif