author | harlekin <harlekin> | 2002-10-31 17:09:01 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-31 17:09:01 (UTC) |
commit | 16fcb285f9ba7c514fc3f2695768a82feeb7182b (patch) (unidiff) | |
tree | 4b1b09287dd339e7138608464c309f938f89e257 | |
parent | ba60ce32edbad5e743494c0de33534258ee5d80c (diff) | |
download | opie-16fcb285f9ba7c514fc3f2695768a82feeb7182b.zip opie-16fcb285f9ba7c514fc3f2695768a82feeb7182b.tar.gz opie-16fcb285f9ba7c514fc3f2695768a82feeb7182b.tar.bz2 |
started support for plugins without refresh, not finished yet
-rw-r--r-- | core/pim/today/changelog | 5 | ||||
-rw-r--r-- | core/pim/today/opie-today.control | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.cpp | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.h | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.h | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 159 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 6 |
10 files changed, 119 insertions, 70 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog index 93abdcb..ba3cdbc 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog | |||
@@ -1,111 +1,116 @@ | |||
1 | 0.6 | ||
2 | |||
3 | * longer refresh intervals possible | ||
4 | * plugins can decide now if they want to take part in refresh cycles | ||
5 | |||
1 | 0.5.2 | 6 | 0.5.2 |
2 | 7 | ||
3 | * refresh settings | 8 | * refresh settings |
4 | * only launch datebook config when clicked on a date ( opie only ) | 9 | * only launch datebook config when clicked on a date ( opie only ) |
5 | * less qcop trouble on sharps retail rom | 10 | * less qcop trouble on sharps retail rom |
6 | 11 | ||
7 | 0.5.1 | 12 | 0.5.1 |
8 | 13 | ||
9 | * icons scalable and clickable again | 14 | * icons scalable and clickable again |
10 | 15 | ||
11 | 0.5 | 16 | 0.5 |
12 | 17 | ||
13 | * now fully plugin based | 18 | * now fully plugin based |
14 | 19 | ||
15 | 0.3.4 | 20 | 0.3.4 |
16 | 21 | ||
17 | * "fill our business card now a clickable label" | 22 | * "fill our business card now a clickable label" |
18 | * Several bugfixes regarding todo section. | 23 | * Several bugfixes regarding todo section. |
19 | 24 | ||
20 | 0.3.3 | 25 | 0.3.3 |
21 | 26 | ||
22 | * Changed the logo so it better scales to bigger display and also | 27 | * Changed the logo so it better scales to bigger display and also |
23 | made the "Today" string translatable. | 28 | made the "Today" string translatable. |
24 | * some am/pm fixes | 29 | * some am/pm fixes |
25 | * clickable labels now in libopie | 30 | * clickable labels now in libopie |
26 | 31 | ||
27 | 0.3.2 | 32 | 0.3.2 |
28 | 33 | ||
29 | * Autostart is now more configurable. You can decide how long | 34 | * Autostart is now more configurable. You can decide how long |
30 | the ipaq has to has been suspended, before autostart is triggered.(Opie | 35 | the ipaq has to has been suspended, before autostart is triggered.(Opie |
31 | only) | 36 | only) |
32 | * am/pm time optinal (autodetect) | 37 | * am/pm time optinal (autodetect) |
33 | 38 | ||
34 | 0.3.1 | 39 | 0.3.1 |
35 | 40 | ||
36 | * fixed the wrong color of the buttons | 41 | * fixed the wrong color of the buttons |
37 | * better translation (thanks carsten and others) | 42 | * better translation (thanks carsten and others) |
38 | * fixes memory leaks | 43 | * fixes memory leaks |
39 | * bugfixes in calendar part, now location and note are working again. | 44 | * bugfixes in calendar part, now location and note are working again. |
40 | 45 | ||
41 | 0.3.0 | 46 | 0.3.0 |
42 | 47 | ||
43 | * today uses now tododb from libopie. So major changes in the todo part: | 48 | * today uses now tododb from libopie. So major changes in the todo part: |
44 | - overdue items on top | 49 | - overdue items on top |
45 | - then sorted by date, then by priority | 50 | - then sorted by date, then by priority |
46 | * some cleanups | 51 | * some cleanups |
47 | * speed optimisations | 52 | * speed optimisations |
48 | 53 | ||
49 | 0.2.9 | 54 | 0.2.9 |
50 | 55 | ||
51 | * Many bugfixes. | 56 | * Many bugfixes. |
52 | * Today now apparently sorts the dates _allways_ right, i would assume it | 57 | * Today now apparently sorts the dates _allways_ right, i would assume it |
53 | to be a qt bug | 58 | to be a qt bug |
54 | 59 | ||
55 | 0.2.8 | 60 | 0.2.8 |
56 | 61 | ||
57 | * Appointments are now clickable (connection to datebook still missing) | 62 | * Appointments are now clickable (connection to datebook still missing) |
58 | * autostart support (opie only) | 63 | * autostart support (opie only) |
59 | 64 | ||
60 | 0.2.7 | 65 | 0.2.7 |
61 | 66 | ||
62 | * check if todolist.xml was changed before parsing it | 67 | * check if todolist.xml was changed before parsing it |
63 | * check only every 30 sec for changes. | 68 | * check only every 30 sec for changes. |
64 | * some visual stuff | 69 | * some visual stuff |
65 | * as usual many little improvements .-) | 70 | * as usual many little improvements .-) |
66 | 71 | ||
67 | 0.2.6 | 72 | 0.2.6 |
68 | 73 | ||
69 | * added scrollbars to dates and todo | 74 | * added scrollbars to dates and todo |
70 | * all day detection | 75 | * all day detection |
71 | * some smaller bugfixes | 76 | * some smaller bugfixes |
72 | 77 | ||
73 | 0.2.5 | 78 | 0.2.5 |
74 | 79 | ||
75 | * some other minor fixes regarding autoupdate | 80 | * some other minor fixes regarding autoupdate |
76 | * fixed segfault with todolist > 7 entries | 81 | * fixed segfault with todolist > 7 entries |
77 | * fixed the "ugly grey border around buttons" issue | 82 | * fixed the "ugly grey border around buttons" issue |
78 | * fixed the "empty calendar field" "bug" | 83 | * fixed the "empty calendar field" "bug" |
79 | * shown only later appointments as option | 84 | * shown only later appointments as option |
80 | 85 | ||
81 | 86 | ||
82 | 0.2.4 | 87 | 0.2.4 |
83 | 88 | ||
84 | * added support for email | 89 | * added support for email |
85 | * autoupdates after 1 min | 90 | * autoupdates after 1 min |
86 | * QCopEnvelope instead of system() | 91 | * QCopEnvelope instead of system() |
87 | * starting to use qvbox in gui | 92 | * starting to use qvbox in gui |
88 | 93 | ||
89 | 94 | ||
90 | 0.2.3 | 95 | 0.2.3 |
91 | 96 | ||
92 | * the 4 am release | 97 | * the 4 am release |
93 | * several bugfixes | 98 | * several bugfixes |
94 | 99 | ||
95 | 100 | ||
96 | 0.2.2 | 101 | 0.2.2 |
97 | 102 | ||
98 | * started working on calling other apps | 103 | * started working on calling other apps |
99 | * and finished it | 104 | * and finished it |
100 | 105 | ||
101 | 0.2.1 | 106 | 0.2.1 |
102 | 107 | ||
103 | * images no more inline | 108 | * images no more inline |
104 | * config dialog | 109 | * config dialog |
105 | 110 | ||
106 | 0.1.1 | 111 | 0.1.1 |
107 | 112 | ||
108 | * started changelog. | 113 | * started changelog. |
109 | * fixed segfault on empty/nonexistant todolist.xml | 114 | * fixed segfault on empty/nonexistant todolist.xml |
110 | * better handling for file location | 115 | * better handling for file location |
111 | 116 | ||
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control index 267a195..acdcf8e 100644 --- a/core/pim/today/opie-today.control +++ b/core/pim/today/opie-today.control | |||
@@ -1,16 +1,16 @@ | |||
1 | Files: bin/today apps/1Pim/today.desktop pics/today/* | 1 | Files: bin/today apps/1Pim/today.desktop pics/today/* |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Maximilian Reiß <harlekin@handhelds.org> | 4 | Maintainer: Maximilian Reiß <harlekin@handhelds.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: 0.5.2-$SUB_VERSION | 6 | Version: 0.6-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) |
8 | License: GPL | 8 | License: GPL |
9 | Description: today screen | 9 | Description: 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 cacdb65..eda84be 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp | |||
@@ -1,59 +1,62 @@ | |||
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 | ||
26 | DatebookPlugin::DatebookPlugin() { | 26 | DatebookPlugin::DatebookPlugin() { |
27 | } | 27 | } |
28 | 28 | ||
29 | DatebookPlugin::~DatebookPlugin() { | 29 | DatebookPlugin::~DatebookPlugin() { |
30 | } | 30 | } |
31 | 31 | ||
32 | QString DatebookPlugin::pluginName() const { | 32 | QString DatebookPlugin::pluginName() const { |
33 | return QObject::tr( "Datebook plugin"); | 33 | return QObject::tr( "Datebook plugin"); |
34 | } | 34 | } |
35 | 35 | ||
36 | double DatebookPlugin::versionNumber() const { | 36 | double DatebookPlugin::versionNumber() const { |
37 | return 1.0; | 37 | return 1.0; |
38 | } | 38 | } |
39 | 39 | ||
40 | QString DatebookPlugin::pixmapNameWidget() const { | 40 | QString DatebookPlugin::pixmapNameWidget() const { |
41 | return "DateBook"; | 41 | return "DateBook"; |
42 | } | 42 | } |
43 | 43 | ||
44 | QWidget* DatebookPlugin::widget( QWidget* wid ) { | 44 | QWidget* DatebookPlugin::widget( QWidget* wid ) { |
45 | return new DatebookPluginWidget( wid, "Datebook" ); | 45 | return new DatebookPluginWidget( wid, "Datebook" ); |
46 | } | 46 | } |
47 | 47 | ||
48 | QString DatebookPlugin::pixmapNameConfig() const { | 48 | QString DatebookPlugin::pixmapNameConfig() const { |
49 | return "DateBook"; | 49 | return "DateBook"; |
50 | } | 50 | } |
51 | 51 | ||
52 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { | 52 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { |
53 | return new DatebookPluginConfig( wid , "Datebook" ); | 53 | return new DatebookPluginConfig( wid , "Datebook" ); |
54 | } | 54 | } |
55 | 55 | ||
56 | QString DatebookPlugin::appName() const { | 56 | QString DatebookPlugin::appName() const { |
57 | return "datebook"; | 57 | return "datebook"; |
58 | } | 58 | } |
59 | 59 | ||
60 | bool DatebookPlugin::excludeFromRefresh() const { | ||
61 | return false; | ||
62 | } | ||
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index 4d0f8e6..13c62a9 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | * datebookplugin.h | 2 | * datebookplugin.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 DATEBOOK_PLUGIN_H | 17 | #ifndef DATEBOOK_PLUGIN_H |
18 | #define DATEBOOK_PLUGIN_H | 18 | #define DATEBOOK_PLUGIN_H |
19 | 19 | ||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qwidget.h> | 21 | #include <qwidget.h> |
22 | 22 | ||
23 | #include <opie/oclickablelabel.h> | 23 | #include <opie/oclickablelabel.h> |
24 | #include <opie/todayplugininterface.h> | 24 | #include <opie/todayplugininterface.h> |
25 | 25 | ||
26 | class DatebookPlugin : public TodayPluginObject { | 26 | class DatebookPlugin : public TodayPluginObject { |
27 | 27 | ||
28 | public: | 28 | public: |
29 | DatebookPlugin(); | 29 | DatebookPlugin(); |
30 | ~DatebookPlugin(); | 30 | ~DatebookPlugin(); |
31 | 31 | ||
32 | QString pluginName() const; | 32 | QString pluginName() const; |
33 | double versionNumber() const; | 33 | double versionNumber() const; |
34 | QString pixmapNameWidget() const; | 34 | QString pixmapNameWidget() const; |
35 | QWidget* widget( QWidget *); | 35 | QWidget* widget( QWidget *); |
36 | QString pixmapNameConfig() const; | 36 | QString pixmapNameConfig() const; |
37 | TodayConfigWidget* configWidget( QWidget *); | 37 | TodayConfigWidget* configWidget( QWidget *); |
38 | QString appName() const; | 38 | QString appName() const; |
39 | 39 | bool excludeFromRefresh() const; | |
40 | }; | 40 | }; |
41 | 41 | ||
42 | 42 | ||
43 | #endif | 43 | #endif |
diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp index 1c90df4..d497970 100644 --- a/core/pim/today/plugins/mail/mailplugin.cpp +++ b/core/pim/today/plugins/mail/mailplugin.cpp | |||
@@ -1,56 +1,60 @@ | |||
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 | ||
22 | MailPlugin::MailPlugin() { | 22 | MailPlugin::MailPlugin() { |
23 | } | 23 | } |
24 | 24 | ||
25 | MailPlugin::~MailPlugin() { | 25 | MailPlugin::~MailPlugin() { |
26 | } | 26 | } |
27 | 27 | ||
28 | QString MailPlugin::pluginName() const { | 28 | QString MailPlugin::pluginName() const { |
29 | return QObject::tr( "Mail plugin" ); | 29 | return QObject::tr( "Mail plugin" ); |
30 | } | 30 | } |
31 | 31 | ||
32 | double MailPlugin::versionNumber() const { | 32 | double MailPlugin::versionNumber() const { |
33 | return 0.6; | 33 | return 0.6; |
34 | } | 34 | } |
35 | 35 | ||
36 | QString MailPlugin::pixmapNameWidget() const { | 36 | QString MailPlugin::pixmapNameWidget() const { |
37 | return "mail/desktopicon"; | 37 | return "mail/desktopicon"; |
38 | } | 38 | } |
39 | 39 | ||
40 | QWidget* MailPlugin::widget( QWidget * wid ) { | 40 | QWidget* MailPlugin::widget( QWidget * wid ) { |
41 | return new MailPluginWidget( wid, "Mail" ); | 41 | return new MailPluginWidget( wid, "Mail" ); |
42 | } | 42 | } |
43 | 43 | ||
44 | QString MailPlugin::pixmapNameConfig() const { | 44 | QString MailPlugin::pixmapNameConfig() const { |
45 | return 0l; | 45 | return 0l; |
46 | } | 46 | } |
47 | 47 | ||
48 | TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { | 48 | TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { |
49 | return 0l; | 49 | return 0l; |
50 | } | 50 | } |
51 | 51 | ||
52 | QString MailPlugin::appName() const { | 52 | QString MailPlugin::appName() const { |
53 | return "mail"; | 53 | return "mail"; |
54 | } | 54 | } |
55 | 55 | ||
56 | 56 | ||
57 | bool MailPlugin::excludeFromRefresh() const { | ||
58 | return false; | ||
59 | } | ||
60 | |||
diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h index d2a3dcb..c937b9e 100644 --- a/core/pim/today/plugins/mail/mailplugin.h +++ b/core/pim/today/plugins/mail/mailplugin.h | |||
@@ -1,47 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * mailplugin.h | 2 | * mailplugin.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 MAIL_PLUGIN_H | 18 | #ifndef MAIL_PLUGIN_H |
19 | #define MAIL_PLUGIN_H | 19 | #define MAIL_PLUGIN_H |
20 | 20 | ||
21 | #include <qstring.h> | 21 | #include <qstring.h> |
22 | #include <qwidget.h> | 22 | #include <qwidget.h> |
23 | 23 | ||
24 | #include <opie/tododb.h> | 24 | #include <opie/tododb.h> |
25 | #include <opie/oclickablelabel.h> | 25 | #include <opie/oclickablelabel.h> |
26 | 26 | ||
27 | #include <opie/todayplugininterface.h> | 27 | #include <opie/todayplugininterface.h> |
28 | #include <opie/todayconfigwidget.h> | 28 | #include <opie/todayconfigwidget.h> |
29 | 29 | ||
30 | class MailPlugin : public TodayPluginObject { | 30 | class MailPlugin : public TodayPluginObject { |
31 | 31 | ||
32 | public: | 32 | public: |
33 | MailPlugin(); | 33 | MailPlugin(); |
34 | ~MailPlugin(); | 34 | ~MailPlugin(); |
35 | 35 | ||
36 | QString pluginName() const; | 36 | QString pluginName() const; |
37 | double versionNumber() const; | 37 | double versionNumber() const; |
38 | QString pixmapNameWidget() const; | 38 | QString pixmapNameWidget() const; |
39 | QWidget* widget(QWidget *); | 39 | QWidget* widget(QWidget *); |
40 | QString pixmapNameConfig() const; | 40 | QString pixmapNameConfig() const; |
41 | TodayConfigWidget* configWidget(QWidget *); | 41 | TodayConfigWidget* configWidget(QWidget *); |
42 | QString appName() const; | 42 | QString appName() const; |
43 | 43 | bool excludeFromRefresh() const; | |
44 | |||
45 | }; | 44 | }; |
46 | 45 | ||
47 | #endif | 46 | #endif |
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index 09b54af..e10b414 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -1,58 +1,61 @@ | |||
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 | ||
24 | TodolistPlugin::TodolistPlugin() { | 24 | TodolistPlugin::TodolistPlugin() { |
25 | } | 25 | } |
26 | 26 | ||
27 | TodolistPlugin::~TodolistPlugin() { | 27 | TodolistPlugin::~TodolistPlugin() { |
28 | } | 28 | } |
29 | 29 | ||
30 | QString TodolistPlugin::pluginName() const { | 30 | QString TodolistPlugin::pluginName() const { |
31 | return QObject::tr( "Todolist plugin" ); | 31 | return QObject::tr( "Todolist plugin" ); |
32 | } | 32 | } |
33 | 33 | ||
34 | double TodolistPlugin::versionNumber() const { | 34 | double TodolistPlugin::versionNumber() const { |
35 | return 0.7; | 35 | return 0.7; |
36 | } | 36 | } |
37 | 37 | ||
38 | QString TodolistPlugin::pixmapNameWidget() const { | 38 | QString TodolistPlugin::pixmapNameWidget() const { |
39 | return "TodoList"; | 39 | return "TodoList"; |
40 | } | 40 | } |
41 | 41 | ||
42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { | 42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { |
43 | return new TodolistPluginWidget( wid, "Todolist" ); | 43 | return new TodolistPluginWidget( wid, "Todolist" ); |
44 | } | 44 | } |
45 | 45 | ||
46 | QString TodolistPlugin::pixmapNameConfig() const { | 46 | QString TodolistPlugin::pixmapNameConfig() const { |
47 | return "TodoList"; | 47 | return "TodoList"; |
48 | } | 48 | } |
49 | 49 | ||
50 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { | 50 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { |
51 | return new TodolistPluginConfig( wid , "Todolist" ); | 51 | return new TodolistPluginConfig( wid , "Todolist" ); |
52 | } | 52 | } |
53 | 53 | ||
54 | QString TodolistPlugin::appName() const { | 54 | QString TodolistPlugin::appName() const { |
55 | return "todolist"; | 55 | return "todolist"; |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
59 | bool TodolistPlugin::excludeFromRefresh() const { | ||
60 | return false; | ||
61 | } | ||
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index 0a6669f..f98afdb 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | * todoplugin.h | 2 | * todoplugin.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #ifndef TODOLIST_PLUGIN_H | 17 | #ifndef TODOLIST_PLUGIN_H |
18 | #define TODOLIST_PLUGIN_H | 18 | #define TODOLIST_PLUGIN_H |
19 | 19 | ||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qwidget.h> | 21 | #include <qwidget.h> |
22 | 22 | ||
23 | #include <opie/tododb.h> | 23 | #include <opie/tododb.h> |
24 | #include <opie/oclickablelabel.h> | 24 | #include <opie/oclickablelabel.h> |
25 | #include <opie/todayplugininterface.h> | 25 | #include <opie/todayplugininterface.h> |
26 | 26 | ||
27 | class TodolistPlugin : public TodayPluginObject { | 27 | class TodolistPlugin : public TodayPluginObject { |
28 | 28 | ||
29 | public: | 29 | public: |
30 | TodolistPlugin(); | 30 | TodolistPlugin(); |
31 | ~TodolistPlugin(); | 31 | ~TodolistPlugin(); |
32 | 32 | ||
33 | QString pluginName() const; | 33 | QString pluginName() const; |
34 | double versionNumber() const; | 34 | double versionNumber() const; |
35 | QString pixmapNameWidget() const; | 35 | QString pixmapNameWidget() const; |
36 | QWidget* widget(QWidget *); | 36 | QWidget* widget(QWidget *); |
37 | QString pixmapNameConfig() const; | 37 | QString pixmapNameConfig() const; |
38 | TodayConfigWidget* configWidget(QWidget *); | 38 | TodayConfigWidget* configWidget(QWidget *); |
39 | QString appName() const; | 39 | QString appName() const; |
40 | 40 | bool excludeFromRefresh() const; | |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #endif | 43 | #endif |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 8184730..3eda5c0 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -1,352 +1,385 @@ | |||
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 | #include <qwhatsthis.h> |
39 | 39 | ||
40 | 40 | ||
41 | struct TodayPlugin { | 41 | struct TodayPlugin { |
42 | QLibrary *library; | 42 | QLibrary *library; |
43 | TodayPluginInterface *iface; | 43 | TodayPluginInterface *iface; |
44 | TodayPluginObject *guiPart; | 44 | TodayPluginObject *guiPart; |
45 | QWidget *guiBox; | 45 | QWidget *guiBox; |
46 | QString name; | 46 | QString name; |
47 | bool active; | 47 | bool active; |
48 | bool excludeRefresh; | ||
48 | int pos; | 49 | int pos; |
49 | }; | 50 | }; |
50 | 51 | ||
51 | static QValueList<TodayPlugin> pluginList; | 52 | static QValueList<TodayPlugin> pluginList; |
52 | 53 | ||
53 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 54 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
54 | : TodayBase( parent, name, fl ) { | 55 | : TodayBase( parent, name, fl ) { |
55 | 56 | ||
56 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); | 57 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); |
57 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); | 58 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); |
58 | 59 | ||
59 | #if defined(Q_WS_QWS) | 60 | #if defined(Q_WS_QWS) |
60 | #if !defined(QT_NO_COP) | 61 | #if !defined(QT_NO_COP) |
61 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); | 62 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); |
62 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), | 63 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), |
63 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); | 64 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); |
64 | #endif | 65 | #endif |
65 | #endif | 66 | #endif |
66 | 67 | ||
67 | setOwnerField(); | 68 | setOwnerField(); |
68 | m_refreshTimer = new QTimer( this ); | 69 | m_refreshTimer = new QTimer( this ); |
69 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 70 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
70 | m_refreshTimer->start( 15000 ); | 71 | m_refreshTimer->start( 15000 ); |
71 | refresh(); | 72 | refresh(); |
72 | showMaximized(); | 73 | showMaximized(); |
73 | } | 74 | } |
74 | 75 | ||
75 | /** | 76 | /** |
76 | * Qcop receive method. | 77 | * Qcop receive method. |
77 | */ | 78 | */ |
78 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { | 79 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { |
79 | QDataStream stream( data, IO_ReadOnly ); | 80 | QDataStream stream( data, IO_ReadOnly ); |
80 | if ( msg == "message(QString)" ) { | 81 | if ( msg == "message(QString)" ) { |
81 | QString message; | 82 | QString message; |
82 | stream >> message; | 83 | stream >> message; |
83 | setOwnerField( message ); | 84 | setOwnerField( message ); |
84 | } | 85 | } |
85 | } | 86 | } |
86 | 87 | ||
87 | void Today::setRefreshTimer( int interval ) { | 88 | void Today::setRefreshTimer( int interval ) { |
88 | 89 | ||
89 | if ( m_refreshTimerEnabled ) { | 90 | |
91 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | ||
92 | |||
93 | // 0 is "never" case | ||
94 | if ( !interval == 0 ) { | ||
95 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | ||
90 | m_refreshTimer->changeInterval( interval ); | 96 | m_refreshTimer->changeInterval( interval ); |
91 | } | 97 | } |
92 | } | 98 | } |
93 | 99 | ||
94 | 100 | ||
95 | /** | 101 | /** |
96 | * Initialises the owner field with the default value, the username | 102 | * Initialises the owner field with the default value, the username |
97 | */ | 103 | */ |
98 | void Today::setOwnerField() { | 104 | void Today::setOwnerField() { |
99 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); | 105 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); |
100 | if ( QFile::exists( file ) ) { | 106 | if ( QFile::exists( file ) ) { |
101 | Contact cont = Contact::readVCard( file )[0]; | 107 | Contact cont = Contact::readVCard( file )[0]; |
102 | QString returnString = cont.fullName(); | 108 | QString returnString = cont.fullName(); |
103 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); | 109 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); |
104 | } else { | 110 | } else { |
105 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); | 111 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); |
106 | } | 112 | } |
107 | } | 113 | } |
108 | 114 | ||
109 | /** | 115 | /** |
110 | * Set the owner field with a given QString, for example per qcop. | 116 | * Set the owner field with a given QString, for example per qcop. |
111 | */ | 117 | */ |
112 | void Today::setOwnerField( QString &message ) { | 118 | void Today::setOwnerField( QString &message ) { |
113 | if ( !message.isEmpty() ) { | 119 | if ( !message.isEmpty() ) { |
114 | OwnerField->setText( "<b>" + message + "</b>" ); | 120 | OwnerField->setText( "<b>" + message + "</b>" ); |
115 | } | 121 | } |
116 | } | 122 | } |
117 | 123 | ||
118 | 124 | ||
119 | /** | 125 | /** |
120 | * Init stuff needed for today. Reads the config file. | 126 | * Init stuff needed for today. Reads the config file. |
121 | */ | 127 | */ |
122 | void Today::init() { | 128 | void Today::init() { |
123 | // read config | 129 | // read config |
124 | Config cfg( "today" ); | 130 | Config cfg( "today" ); |
125 | 131 | ||
126 | cfg.setGroup( "Plugins" ); | 132 | cfg.setGroup( "Plugins" ); |
127 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 133 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
128 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 134 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
129 | 135 | ||
130 | cfg.setGroup( "General" ); | 136 | cfg.setGroup( "General" ); |
131 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 137 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
132 | m_refreshTimer->changeInterval( cfg.readNumEntry( "checkinterval", 15000 ) ); | 138 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
133 | |||
134 | } | 139 | } |
135 | 140 | ||
136 | 141 | ||
137 | /** | 142 | /** |
138 | * Load the plugins | 143 | * Load the plugins |
139 | */ | 144 | */ |
140 | void Today::loadPlugins() { | 145 | void Today::loadPlugins() { |
141 | 146 | ||
147 | // extra list for plugins that exclude themself from periodic refresh | ||
148 | QMap<QString, TodayPlugin> pluginListRefreshExclude; | ||
149 | |||
142 | QValueList<TodayPlugin>::Iterator tit; | 150 | QValueList<TodayPlugin>::Iterator tit; |
143 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { | 151 | if ( !pluginList.isEmpty() ) { |
144 | (*tit).library->unload(); | 152 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { |
145 | delete (*tit).library; | 153 | if ( (*tit).excludeRefresh ) { |
154 | pluginListRefreshExclude.insert( (*tit).name , (*tit) ); | ||
155 | qDebug( "Found an plug that does not want refresh feature" ); | ||
156 | } else { | ||
157 | (*tit).library->unload(); | ||
158 | delete (*tit).library; | ||
159 | } | ||
160 | } | ||
161 | pluginList.clear(); | ||
146 | } | 162 | } |
147 | pluginList.clear(); | 163 | |
148 | 164 | ||
149 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 165 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
150 | QDir dir( path, "lib*.so" ); | 166 | QDir dir( path, "lib*.so" ); |
151 | 167 | ||
152 | QStringList list = dir.entryList(); | 168 | QStringList list = dir.entryList(); |
153 | QStringList::Iterator it; | 169 | QStringList::Iterator it; |
154 | 170 | ||
155 | QMap<QString, TodayPlugin> tempList; | 171 | QMap<QString, TodayPlugin> tempList; |
156 | 172 | ||
157 | for ( it = list.begin(); it != list.end(); ++it ) { | 173 | for ( it = list.begin(); it != list.end(); ++it ) { |
158 | TodayPluginInterface *iface = 0; | 174 | TodayPluginInterface *iface = 0; |
159 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 175 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
160 | 176 | ||
161 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 177 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
162 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 178 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
163 | qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); | 179 | qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); |
164 | qDebug( QString(*it) ); | 180 | qDebug( QString(*it) ); |
165 | TodayPlugin plugin; | 181 | |
166 | plugin.library = lib; | 182 | // If plugin is exludes from refresh, get it in the list again here. |
167 | plugin.iface = iface; | 183 | |
168 | plugin.name = QString(*it); | 184 | if ( pluginListRefreshExclude.contains( (*it) ) ) { |
169 | 185 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); | |
170 | // find out if plugins should be shown | 186 | qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); |
171 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { | ||
172 | plugin.active = true; | ||
173 | } else { | 187 | } else { |
174 | plugin.active = false; | 188 | |
175 | } | 189 | TodayPlugin plugin; |
176 | plugin.guiPart = plugin.iface->guiPart(); | 190 | plugin.library = lib; |
177 | 191 | plugin.iface = iface; | |
178 | // package the whole thing into a qwidget so it can be shown and hidden | 192 | plugin.name = QString(*it); |
179 | plugin.guiBox = new QWidget( this ); | 193 | |
180 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); | 194 | // find out if plugins should be shown |
181 | QPixmap plugPix; | 195 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { |
182 | plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); | 196 | plugin.active = true; |
183 | OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); | 197 | } else { |
184 | plugIcon->setPixmap( plugPix ); | 198 | plugin.active = false; |
185 | QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); | 199 | } |
186 | plugIcon->setName( plugin.guiPart->appName() ); | 200 | plugin.guiPart = plugin.iface->guiPart(); |
187 | connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); | 201 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); |
188 | // a scrollview for each plugin | 202 | |
189 | QScrollView* sv = new QScrollView( plugin.guiBox ); | 203 | // package the whole thing into a qwidget so it can be shown and hidden |
190 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); | 204 | plugin.guiBox = new QWidget( this ); |
191 | // not sure if that is good .-) | 205 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); |
192 | sv->setMinimumHeight( 10 ); | 206 | QPixmap plugPix; |
193 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 207 | plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); |
194 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 208 | OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); |
195 | sv->setFrameShape( QFrame::NoFrame ); | 209 | plugIcon->setPixmap( plugPix ); |
196 | sv->addChild( plugWidget ); | 210 | QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); |
197 | // make sure the icon is on the top alligned | 211 | plugIcon->setName( plugin.guiPart->appName() ); |
198 | boxLayout->addWidget( plugIcon, 0, AlignTop ); | 212 | connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); |
199 | boxLayout->addWidget( sv, 0, AlignTop ); | 213 | // a scrollview for each plugin |
200 | boxLayout->setStretchFactor( plugIcon, 1 ); | 214 | QScrollView* sv = new QScrollView( plugin.guiBox ); |
201 | boxLayout->setStretchFactor( sv, 9 ); | 215 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); |
202 | // "prebuffer" it in one more list, to get the sorting done | 216 | // not sure if that is good .-) |
203 | tempList.insert( plugin.name, plugin ); | 217 | sv->setMinimumHeight( 10 ); |
204 | 218 | sv->setResizePolicy( QScrollView::AutoOneFit ); | |
205 | // on first start the list is off course empty | 219 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
206 | if ( m_allApplets.isEmpty() ) { | 220 | sv->setFrameShape( QFrame::NoFrame ); |
207 | layout->addWidget( plugin.guiBox ); | 221 | sv->addChild( plugWidget ); |
208 | pluginList.append( plugin ); | 222 | // make sure the icon is on the top alligned |
223 | boxLayout->addWidget( plugIcon, 0, AlignTop ); | ||
224 | boxLayout->addWidget( sv, 0, AlignTop ); | ||
225 | boxLayout->setStretchFactor( plugIcon, 1 ); | ||
226 | boxLayout->setStretchFactor( sv, 9 ); | ||
227 | // "prebuffer" it in one more list, to get the sorting done | ||
228 | tempList.insert( plugin.name, plugin ); | ||
229 | |||
230 | // on first start the list is off course empty | ||
231 | if ( m_allApplets.isEmpty() ) { | ||
232 | layout->addWidget( plugin.guiBox ); | ||
233 | pluginList.append( plugin ); | ||
234 | } | ||
209 | } | 235 | } |
210 | } else { | 236 | } else { |
211 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 237 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); |
212 | delete lib; | 238 | delete lib; |
213 | } | 239 | } |
214 | } | 240 | } |
215 | 241 | ||
216 | if ( !m_allApplets.isEmpty() ) { | 242 | if ( !m_allApplets.isEmpty() ) { |
217 | TodayPlugin tempPlugin; | 243 | TodayPlugin tempPlugin; |
218 | QStringList::Iterator stringit; | 244 | QStringList::Iterator stringit; |
245 | |||
219 | for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { | 246 | for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { |
220 | tempPlugin = ( tempList.find( *stringit ) ).data(); | 247 | tempPlugin = ( tempList.find( *stringit ) ).data(); |
221 | if ( !( (tempPlugin.name).isEmpty() ) ) { | 248 | if ( !( (tempPlugin.name).isEmpty() ) ) { |
222 | layout->addWidget( tempPlugin.guiBox ); | 249 | layout->addWidget( tempPlugin.guiBox ); |
223 | pluginList.append( tempPlugin ); | 250 | pluginList.append( tempPlugin ); |
224 | } | 251 | } |
225 | } | 252 | } |
226 | } | 253 | } |
227 | } | 254 | } |
228 | 255 | ||
229 | 256 | ||
230 | /** | 257 | /** |
231 | * Repaint method. Reread all fields. | 258 | * Repaint method. Reread all fields. |
232 | */ | 259 | */ |
233 | void Today::draw() { | 260 | void Today::draw() { |
234 | 261 | ||
235 | if ( pluginList.count() == 0 ) { | 262 | if ( pluginList.count() == 0 ) { |
236 | QLabel *noPlugins = new QLabel( this ); | 263 | QLabel *noPlugins = new QLabel( this ); |
237 | noPlugins->setText( tr( "No plugins found" ) ); | 264 | noPlugins->setText( tr( "No plugins found" ) ); |
238 | layout->addWidget( noPlugins ); | 265 | layout->addWidget( noPlugins ); |
239 | return; | 266 | return; |
240 | } | 267 | } |
241 | 268 | ||
242 | uint count = 0; | 269 | uint count = 0; |
243 | TodayPlugin plugin; | 270 | TodayPlugin plugin; |
244 | for ( uint i = 0; i < pluginList.count(); i++ ) { | 271 | for ( uint i = 0; i < pluginList.count(); i++ ) { |
245 | plugin = pluginList[i]; | 272 | plugin = pluginList[i]; |
246 | 273 | ||
247 | if ( plugin.active ) { | 274 | if ( plugin.active ) { |
248 | // qDebug( plugin.name + " is ACTIVE " ); | 275 | // qDebug( plugin.name + " is ACTIVE " ); |
249 | plugin.guiBox->show(); | 276 | plugin.guiBox->show(); |
250 | } else { | 277 | } else { |
251 | // qDebug( plugin.name + " is INACTIVE" ); | 278 | // qDebug( plugin.name + " is INACTIVE" ); |
252 | plugin.guiBox->hide(); | 279 | plugin.guiBox->hide(); |
253 | } | 280 | } |
254 | count++; | 281 | count++; |
255 | } | 282 | } |
256 | 283 | ||
257 | if ( count == 0 ) { | 284 | if ( count == 0 ) { |
258 | QLabel *noPluginsActive = new QLabel( this ); | 285 | QLabel *noPluginsActive = new QLabel( this ); |
259 | noPluginsActive->setText( tr( "No plugins activated" ) ); | 286 | noPluginsActive->setText( tr( "No plugins activated" ) ); |
260 | layout->addWidget( noPluginsActive ); | 287 | layout->addWidget( noPluginsActive ); |
261 | } | 288 | } |
262 | layout->addStretch(0); | 289 | layout->addStretch(0); |
263 | } | 290 | } |
264 | 291 | ||
265 | 292 | ||
266 | /** | 293 | /** |
267 | * The method for the configuration dialog. | 294 | * The method for the configuration dialog. |
268 | */ | 295 | */ |
269 | void Today::startConfig() { | 296 | void Today::startConfig() { |
270 | 297 | ||
298 | // disconnect timer to prevent problems while being on config dialog | ||
299 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | ||
300 | |||
271 | TodayConfig conf( this, "dialog", true ); | 301 | TodayConfig conf( this, "dialog", true ); |
272 | 302 | ||
273 | TodayPlugin plugin; | 303 | TodayPlugin plugin; |
274 | QList<TodayConfigWidget> configWidgetList; | 304 | QList<TodayConfigWidget> configWidgetList; |
275 | 305 | ||
276 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { | 306 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { |
277 | plugin = pluginList[i]; | 307 | plugin = pluginList[i]; |
278 | 308 | ||
279 | // load the config widgets in the tabs | 309 | // load the config widgets in the tabs |
280 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 310 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
281 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); | 311 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); |
282 | configWidgetList.append( widget ); | 312 | configWidgetList.append( widget ); |
283 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() | 313 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() |
284 | , plugin.guiPart->appName() ); | 314 | , plugin.guiPart->appName() ); |
285 | } | 315 | } |
286 | // set the order/activate tab | 316 | // set the order/activate tab |
287 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), | 317 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), |
288 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); | 318 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); |
289 | } | 319 | } |
290 | 320 | ||
291 | if ( conf.exec() == QDialog::Accepted ) { | 321 | if ( conf.exec() == QDialog::Accepted ) { |
292 | conf.writeConfig(); | 322 | conf.writeConfig(); |
293 | TodayConfigWidget *confWidget; | 323 | TodayConfigWidget *confWidget; |
294 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 324 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
295 | confWidget = configWidgetList.next() ) { | 325 | confWidget = configWidgetList.next() ) { |
296 | confWidget->writeConfig(); | 326 | confWidget->writeConfig(); |
297 | } | 327 | } |
298 | refresh(); | 328 | refresh(); |
329 | } else { | ||
330 | // since refresh is not called in that case , reconnect the signal | ||
331 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | ||
299 | } | 332 | } |
300 | } | 333 | } |
301 | 334 | ||
302 | 335 | ||
303 | /** | 336 | /** |
304 | * Refresh for the view. Reload all applets | 337 | * Refresh for the view. Reload all applets |
305 | * | 338 | * |
306 | */ | 339 | */ |
307 | void Today::refresh() { | 340 | void Today::refresh() { |
308 | init(); | 341 | init(); |
309 | 342 | ||
310 | qDebug(" refresh "); | 343 | qDebug(" refresh "); |
311 | // set the date in top label | 344 | // set the date in top label |
312 | QDate date = QDate::currentDate(); | 345 | QDate date = QDate::currentDate(); |
313 | QString time = ( tr( date.toString() ) ); | 346 | QString time = ( tr( date.toString() ) ); |
314 | 347 | ||
315 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); | 348 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); |
316 | 349 | ||
317 | if ( layout ) { | 350 | if ( layout ) { |
318 | delete layout; | 351 | delete layout; |
319 | } | 352 | } |
320 | layout = new QVBoxLayout( this ); | 353 | layout = new QVBoxLayout( this ); |
321 | layout->addWidget( Frame ); | 354 | layout->addWidget( Frame ); |
322 | layout->addWidget( OwnerField ); | 355 | layout->addWidget( OwnerField ); |
323 | 356 | ||
324 | loadPlugins(); | 357 | loadPlugins(); |
325 | draw(); | 358 | draw(); |
326 | } | 359 | } |
327 | 360 | ||
328 | void Today::startAddressbook() { | 361 | void Today::startAddressbook() { |
329 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 362 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
330 | e << QString( "addressbook" ); | 363 | e << QString( "addressbook" ); |
331 | } | 364 | } |
332 | 365 | ||
333 | 366 | ||
334 | void Today::startApplication() { | 367 | void Today::startApplication() { |
335 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 368 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
336 | e << QString( sender()->name() ); | 369 | e << QString( sender()->name() ); |
337 | } | 370 | } |
338 | 371 | ||
339 | /** | 372 | /** |
340 | * launch addressbook (personal card) | 373 | * launch addressbook (personal card) |
341 | */ | 374 | */ |
342 | void Today::editCard() { | 375 | void Today::editCard() { |
343 | startAddressbook(); | 376 | startAddressbook(); |
344 | while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { | 377 | while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { |
345 | qApp->processEvents(); | 378 | qApp->processEvents(); |
346 | } | 379 | } |
347 | QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); | 380 | QCopEnvelope v( "QPE/Addressbook", "editPersonalAndClose()" ); |
348 | } | 381 | } |
349 | 382 | ||
350 | Today::~Today() { | 383 | Today::~Today() { |
351 | } | 384 | } |
352 | 385 | ||
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index db1141a..8d0b069 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp | |||
@@ -1,259 +1,261 @@ | |||
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 | ||
35 | class ToolButton : public QToolButton { | 35 | class ToolButton : public QToolButton { |
36 | 36 | ||
37 | public: | 37 | public: |
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 | */ |
54 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | 54 | TodayConfig::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 | 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" ) ); |
73 | QVBox *vbox1 = new QVBox( hbox1 ); | 73 | QVBox *vbox1 = new QVBox( hbox1 ); |
74 | new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); | 74 | new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); |
75 | new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); | 75 | new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); |
76 | tab2Layout->addWidget( hbox1 ); | 76 | tab2Layout->addWidget( hbox1 ); |
77 | TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); | 77 | TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); |
78 | 78 | ||
79 | tab_3 = new QWidget( TabWidget3, "tab_3" ); | 79 | tab_3 = new QWidget( TabWidget3, "tab_3" ); |
80 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); | 80 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); |
81 | tab3Layout->setMargin( 20 ); | 81 | tab3Layout->setMargin( 20 ); |
82 | QHBox *hbox_auto = new QHBox( tab_3 ); | 82 | QHBox *hbox_auto = new QHBox( tab_3 ); |
83 | TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); | 83 | TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); |
84 | TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); | 84 | TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); |
85 | 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." ) ); |
86 | CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); | 86 | CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); |
87 | 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." ) ); |
88 | QHBox *hbox_inactive = new QHBox( tab_3 ); | 88 | QHBox *hbox_inactive = new QHBox( tab_3 ); |
89 | TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); | 89 | TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); |
90 | TimeLabel->setText( tr( "minutes inactive" ) ); | 90 | TimeLabel->setText( tr( "minutes inactive" ) ); |
91 | 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" ) ); |
92 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); | 92 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); |
93 | 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" ) ); |
94 | QHBox *hbox_iconSize = new QHBox( tab_3 ); | 94 | QHBox *hbox_iconSize = new QHBox( tab_3 ); |
95 | QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); | 95 | QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); |
96 | iconSizeLabel->setText( tr( "Icon size" ) ); | 96 | iconSizeLabel->setText( tr( "Icon size" ) ); |
97 | QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); | 97 | QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); |
98 | SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); | 98 | SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); |
99 | SpinBoxIconSize->setMaxValue( 32 ); | 99 | SpinBoxIconSize->setMaxValue( 32 ); |
100 | QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) ); | 100 | QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) ); |
101 | 101 | ||
102 | QHBox *hbox_refresh = new QHBox( tab_3 ); | 102 | QHBox *hbox_refresh = new QHBox( tab_3 ); |
103 | QLabel *refreshLabel = new QLabel( hbox_refresh ); | 103 | QLabel *refreshLabel = new QLabel( hbox_refresh ); |
104 | refreshLabel->setText( tr( "Refresh" ) ); | 104 | refreshLabel->setText( tr( "Refresh" ) ); |
105 | QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); | 105 | QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); |
106 | SpinRefresh = new QSpinBox( hbox_refresh ); | 106 | SpinRefresh = new QSpinBox( hbox_refresh ); |
107 | SpinRefresh->setMinValue( 2 ); | 107 | SpinRefresh->setMinValue( 0 ); |
108 | SpinRefresh->setSuffix( tr( " seconds" ) ); | 108 | SpinRefresh->setSuffix( tr( " sec" ) ); |
109 | SpinRefresh->setMaxValue ( 7200 ); | ||
110 | SpinRefresh->setSpecialValueText ( tr("never") ); | ||
109 | QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); | 111 | QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); |
110 | 112 | ||
111 | tab3Layout->addWidget( hbox_auto ); | 113 | tab3Layout->addWidget( hbox_auto ); |
112 | tab3Layout->addWidget( hbox_inactive ); | 114 | tab3Layout->addWidget( hbox_inactive ); |
113 | tab3Layout->addWidget( hbox_iconSize ); | 115 | tab3Layout->addWidget( hbox_iconSize ); |
114 | tab3Layout->addWidget( hbox_refresh ); | 116 | tab3Layout->addWidget( hbox_refresh ); |
115 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); | 117 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); |
116 | 118 | ||
117 | m_applets_changed = false; | 119 | m_applets_changed = false; |
118 | 120 | ||
119 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); | 121 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); |
120 | 122 | ||
121 | readConfig(); | 123 | readConfig(); |
122 | showMaximized(); | 124 | showMaximized(); |
123 | } | 125 | } |
124 | 126 | ||
125 | 127 | ||
126 | /** | 128 | /** |
127 | * Autostart, uses the new (opie only) autostart method in the launcher code. | 129 | * Autostart, uses the new (opie only) autostart method in the launcher code. |
128 | * If registered against that today ist started on each resume. | 130 | * If registered against that today ist started on each resume. |
129 | */ | 131 | */ |
130 | void TodayConfig::setAutoStart() { | 132 | void TodayConfig::setAutoStart() { |
131 | Config cfg( "today" ); | 133 | Config cfg( "today" ); |
132 | cfg.setGroup( "Autostart" ); | 134 | cfg.setGroup( "Autostart" ); |
133 | if ( m_autoStart ) { | 135 | if ( m_autoStart ) { |
134 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); | 136 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); |
135 | e << QString( "add" ); | 137 | e << QString( "add" ); |
136 | e << QString( "today" ); | 138 | e << QString( "today" ); |
137 | e << QString( "%1" ).arg( m_autoStartTimer ); | 139 | e << QString( "%1" ).arg( m_autoStartTimer ); |
138 | } else { | 140 | } else { |
139 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); | 141 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); |
140 | e << QString( "remove" ); | 142 | e << QString( "remove" ); |
141 | e << QString( "today" ); | 143 | e << QString( "today" ); |
142 | } | 144 | } |
143 | } | 145 | } |
144 | 146 | ||
145 | /** | 147 | /** |
146 | * Read the config part | 148 | * Read the config part |
147 | */ | 149 | */ |
148 | void TodayConfig::readConfig() { | 150 | void TodayConfig::readConfig() { |
149 | Config cfg( "today" ); | 151 | Config cfg( "today" ); |
150 | cfg.setGroup( "Autostart" ); | 152 | cfg.setGroup( "Autostart" ); |
151 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); | 153 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); |
152 | CheckBoxAuto->setChecked( m_autoStart ); | 154 | CheckBoxAuto->setChecked( m_autoStart ); |
153 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); | 155 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); |
154 | SpinBoxTime->setValue( m_autoStartTimer ); | 156 | SpinBoxTime->setValue( m_autoStartTimer ); |
155 | 157 | ||
156 | cfg.setGroup( "General" ); | 158 | cfg.setGroup( "General" ); |
157 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 159 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
158 | SpinBoxIconSize->setValue( m_iconSize ); | 160 | SpinBoxIconSize->setValue( m_iconSize ); |
159 | SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); | 161 | SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); |
160 | 162 | ||
161 | 163 | ||
162 | cfg.setGroup( "Plugins" ); | 164 | cfg.setGroup( "Plugins" ); |
163 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 165 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
164 | } | 166 | } |
165 | 167 | ||
166 | /** | 168 | /** |
167 | * Write the config part | 169 | * Write the config part |
168 | */ | 170 | */ |
169 | void TodayConfig::writeConfig() { | 171 | void TodayConfig::writeConfig() { |
170 | Config cfg( "today" ); | 172 | Config cfg( "today" ); |
171 | cfg.setGroup( "Plugins" ); | 173 | cfg.setGroup( "Plugins" ); |
172 | if ( m_applets_changed ) { | 174 | if ( m_applets_changed ) { |
173 | QStringList exclude; | 175 | QStringList exclude; |
174 | QStringList include; | 176 | QStringList include; |
175 | QStringList all_applets; | 177 | QStringList all_applets; |
176 | 178 | ||
177 | QListViewItemIterator list_it( m_appletListView ); | 179 | QListViewItemIterator list_it( m_appletListView ); |
178 | 180 | ||
179 | // this makes sure the names get saved in the order selected | 181 | // this makes sure the names get saved in the order selected |
180 | for ( ; list_it.current(); ++list_it ) { | 182 | for ( ; list_it.current(); ++list_it ) { |
181 | QMap <QString, QCheckListItem *>::Iterator it; | 183 | QMap <QString, QCheckListItem *>::Iterator it; |
182 | for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { | 184 | for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { |
183 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { | 185 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { |
184 | exclude << it.key(); | 186 | exclude << it.key(); |
185 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ | 187 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ |
186 | include << it.key(); | 188 | include << it.key(); |
187 | } | 189 | } |
188 | if ( list_it.current() == (*it) ) { | 190 | if ( list_it.current() == (*it) ) { |
189 | all_applets << it.key(); | 191 | all_applets << it.key(); |
190 | } | 192 | } |
191 | } | 193 | } |
192 | } | 194 | } |
193 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); | 195 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); |
194 | cfg.writeEntry( "IncludeApplets", include, ',' ); | 196 | cfg.writeEntry( "IncludeApplets", include, ',' ); |
195 | cfg.writeEntry( "AllApplets", all_applets, ',' ); | 197 | cfg.writeEntry( "AllApplets", all_applets, ',' ); |
196 | } | 198 | } |
197 | 199 | ||
198 | cfg.setGroup( "Autostart" ); | 200 | cfg.setGroup( "Autostart" ); |
199 | m_autoStart = CheckBoxAuto->isChecked(); | 201 | m_autoStart = CheckBoxAuto->isChecked(); |
200 | cfg.writeEntry( "autostart", m_autoStart ); | 202 | cfg.writeEntry( "autostart", m_autoStart ); |
201 | m_autoStartTimer = SpinBoxTime->value(); | 203 | m_autoStartTimer = SpinBoxTime->value(); |
202 | cfg.writeEntry( "autostartdelay", m_autoStartTimer ); | 204 | cfg.writeEntry( "autostartdelay", m_autoStartTimer ); |
203 | m_iconSize = SpinBoxIconSize->value(); | 205 | m_iconSize = SpinBoxIconSize->value(); |
204 | 206 | ||
205 | cfg.setGroup( "General" ); | 207 | cfg.setGroup( "General" ); |
206 | cfg.writeEntry( "IconSize", m_iconSize ); | 208 | cfg.writeEntry( "IconSize", m_iconSize ); |
207 | cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); | 209 | cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); |
208 | 210 | ||
209 | // set autostart settings | 211 | // set autostart settings |
210 | setAutoStart(); | 212 | setAutoStart(); |
211 | } | 213 | } |
212 | 214 | ||
213 | 215 | ||
214 | void TodayConfig::moveSelectedUp() { | 216 | void TodayConfig::moveSelectedUp() { |
215 | QListViewItem *item = m_appletListView->selectedItem(); | 217 | QListViewItem *item = m_appletListView->selectedItem(); |
216 | if ( item && item->itemAbove() ) { | 218 | if ( item && item->itemAbove() ) { |
217 | item->itemAbove()->moveItem( item ); | 219 | item->itemAbove()->moveItem( item ); |
218 | } | 220 | } |
219 | } | 221 | } |
220 | 222 | ||
221 | 223 | ||
222 | void TodayConfig::moveSelectedDown() { | 224 | void TodayConfig::moveSelectedDown() { |
223 | QListViewItem *item = m_appletListView->selectedItem(); | 225 | QListViewItem *item = m_appletListView->selectedItem(); |
224 | if ( item && item->itemBelow() ) { | 226 | if ( item && item->itemBelow() ) { |
225 | item->moveItem( item->itemBelow() ); | 227 | item->moveItem( item->itemBelow() ); |
226 | } | 228 | } |
227 | } | 229 | } |
228 | 230 | ||
229 | 231 | ||
230 | /** | 232 | /** |
231 | * Set up the icons in the order/active tab | 233 | * Set up the icons in the order/active tab |
232 | */ | 234 | */ |
233 | void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon ) { | 235 | void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon ) { |
234 | 236 | ||
235 | QCheckListItem *item; | 237 | QCheckListItem *item; |
236 | item = new QCheckListItem( m_appletListView, name, QCheckListItem::CheckBox ); | 238 | item = new QCheckListItem( m_appletListView, name, QCheckListItem::CheckBox ); |
237 | 239 | ||
238 | if ( !icon.isNull() ) { | 240 | if ( !icon.isNull() ) { |
239 | item->setPixmap( 0, icon ); | 241 | item->setPixmap( 0, icon ); |
240 | } | 242 | } |
241 | 243 | ||
242 | if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) { | 244 | if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) { |
243 | item->setOn( TRUE ); | 245 | item->setOn( TRUE ); |
244 | } | 246 | } |
245 | 247 | ||
246 | m_applets[libName] = item; | 248 | m_applets[libName] = item; |
247 | 249 | ||
248 | // kind of hack to get the first tab as default. | 250 | // kind of hack to get the first tab as default. |
249 | TabWidget3->setCurrentTab( tab_2 ); | 251 | TabWidget3->setCurrentTab( tab_2 ); |
250 | } | 252 | } |
251 | 253 | ||
252 | void TodayConfig::appletChanged() { | 254 | void TodayConfig::appletChanged() { |
253 | m_applets_changed = true; | 255 | m_applets_changed = true; |
254 | } | 256 | } |
255 | 257 | ||
256 | 258 | ||
257 | TodayConfig::~TodayConfig() { | 259 | TodayConfig::~TodayConfig() { |
258 | } | 260 | } |
259 | 261 | ||