-rw-r--r-- | core/pim/today/configwidget.h | 17 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.cpp | 10 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.h | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginconfig.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginconfig.h | 6 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.cpp | 11 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.h | 7 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 9 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 5 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.h | 4 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 11 | ||||
-rw-r--r-- | core/pim/today/todayconfigwidget.h | 21 | ||||
-rw-r--r-- | core/pim/today/todayplugininterface.h | 13 |
14 files changed, 49 insertions, 73 deletions
diff --git a/core/pim/today/configwidget.h b/core/pim/today/configwidget.h deleted file mode 100644 index 02ce37a..0000000 --- a/core/pim/today/configwidget.h +++ b/dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | |||
2 | #ifndef CONFIG_WIDGET_H | ||
3 | #define CONFIG_WIDGET_H | ||
4 | |||
5 | |||
6 | class ConfigWidget : public QWidget { | ||
7 | |||
8 | |||
9 | public: | ||
10 | |||
11 | ConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) {} ; | ||
12 | virtual ~ConfigWidget() {}; | ||
13 | |||
14 | virtual void writeConfig() = 0; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index a1721f6..4ebb178 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp | |||
@@ -49,7 +49,7 @@ QString DatebookPlugin::pixmapNameConfig() const { | |||
49 | return "DateBook"; | 49 | return "DateBook"; |
50 | } | 50 | } |
51 | 51 | ||
52 | ConfigWidget* 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 | ||
@@ -57,11 +57,3 @@ QString DatebookPlugin::appName() const { | |||
57 | return QObject::tr( "Datebook" ); | 57 | return QObject::tr( "Datebook" ); |
58 | } | 58 | } |
59 | 59 | ||
60 | int DatebookPlugin::minHeight() const { | ||
61 | return 10; | ||
62 | } | ||
63 | |||
64 | int DatebookPlugin::maxHeight() const { | ||
65 | return 100; | ||
66 | } | ||
67 | |||
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index 61dc9f3..625c7cd 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h | |||
@@ -35,10 +35,8 @@ public: | |||
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 | ConfigWidget* configWidget( QWidget *); | 38 | TodayConfigWidget* configWidget( QWidget *); |
39 | QString appName() const; | 39 | QString appName() const; |
40 | virtual int minHeight() const; | ||
41 | virtual int maxHeight() const; | ||
42 | 40 | ||
43 | }; | 41 | }; |
44 | 42 | ||
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp index 0f60c28..606916b 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <qvbox.h> | 11 | #include <qvbox.h> |
12 | 12 | ||
13 | DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) | 13 | DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) |
14 | : ConfigWidget( parent, name ) { | 14 | : TodayConfigWidget( parent, name ) { |
15 | 15 | ||
16 | QVBoxLayout * layout = new QVBoxLayout( this ); | 16 | QVBoxLayout * layout = new QVBoxLayout( this ); |
17 | layout->setMargin( 20 ); | 17 | layout->setMargin( 20 ); |
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h index 9505a2d..99aa76c 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.h +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h | |||
@@ -2,13 +2,13 @@ | |||
2 | #ifndef DATEBOOK_PLUGIN_CONFIG_H | 2 | #ifndef DATEBOOK_PLUGIN_CONFIG_H |
3 | #define DATEBOOK_PLUGIN_CONFIG_H | 3 | #define DATEBOOK_PLUGIN_CONFIG_H |
4 | 4 | ||
5 | //#include <qwidget.h> | 5 | |
6 | #include <qcheckbox.h> | 6 | #include <qcheckbox.h> |
7 | #include <qspinbox.h> | 7 | #include <qspinbox.h> |
8 | 8 | ||
9 | #include "../../configwidget.h" | 9 | #include "../../todayconfigwidget.h" |
10 | 10 | ||
11 | class DatebookPluginConfig : public ConfigWidget { | 11 | class DatebookPluginConfig : public TodayConfigWidget { |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp index 4241228..3ddf16e 100644 --- a/core/pim/today/plugins/mail/mailplugin.cpp +++ b/core/pim/today/plugins/mail/mailplugin.cpp | |||
@@ -30,7 +30,7 @@ QString MailPlugin::pluginName() const { | |||
30 | } | 30 | } |
31 | 31 | ||
32 | double MailPlugin::versionNumber() const { | 32 | double MailPlugin::versionNumber() const { |
33 | return 0.1; | 33 | return 0.5; |
34 | } | 34 | } |
35 | 35 | ||
36 | QString MailPlugin::pixmapNameWidget() const { | 36 | QString MailPlugin::pixmapNameWidget() const { |
@@ -45,7 +45,7 @@ QString MailPlugin::pixmapNameConfig() const { | |||
45 | return 0l; | 45 | return 0l; |
46 | } | 46 | } |
47 | 47 | ||
48 | ConfigWidget* MailPlugin::configWidget( QWidget* wid ) { | 48 | TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { |
49 | return 0l; | 49 | return 0l; |
50 | } | 50 | } |
51 | 51 | ||
@@ -53,11 +53,4 @@ QString MailPlugin::appName() const { | |||
53 | return "Mail"; | 53 | return "Mail"; |
54 | } | 54 | } |
55 | 55 | ||
56 | int MailPlugin::minHeight() const { | ||
57 | return 10; | ||
58 | } | ||
59 | |||
60 | int MailPlugin::maxHeight() const { | ||
61 | return 10; | ||
62 | } | ||
63 | 56 | ||
diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h index 96c73ed..a27f4c7 100644 --- a/core/pim/today/plugins/mail/mailplugin.h +++ b/core/pim/today/plugins/mail/mailplugin.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <opie/oclickablelabel.h> | 25 | #include <opie/oclickablelabel.h> |
26 | 26 | ||
27 | #include "../../todayplugininterface.h" | 27 | #include "../../todayplugininterface.h" |
28 | #include "../../configwidget.h" | 28 | #include "../../todayconfigwidget.h" |
29 | 29 | ||
30 | class MailPlugin : public TodayPluginObject { | 30 | class MailPlugin : public TodayPluginObject { |
31 | 31 | ||
@@ -38,10 +38,9 @@ public: | |||
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 | ConfigWidget* configWidget(QWidget *); | 41 | TodayConfigWidget* configWidget(QWidget *); |
42 | QString appName() const; | 42 | QString appName() const; |
43 | virtual int minHeight() const; | 43 | |
44 | virtual int maxHeight() const; | ||
45 | 44 | ||
46 | }; | 45 | }; |
47 | 46 | ||
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index 7ab27a0..19d9f37 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -47,7 +47,7 @@ QString TodolistPlugin::pixmapNameConfig() const { | |||
47 | return "TodoList"; | 47 | return "TodoList"; |
48 | } | 48 | } |
49 | 49 | ||
50 | ConfigWidget* 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 | ||
@@ -55,11 +55,4 @@ QString TodolistPlugin::appName() const { | |||
55 | return QObject::tr( "Todolist" ); | 55 | return QObject::tr( "Todolist" ); |
56 | } | 56 | } |
57 | 57 | ||
58 | int TodolistPlugin::minHeight() const { | ||
59 | return 10; | ||
60 | } | ||
61 | |||
62 | int TodolistPlugin::maxHeight() const { | ||
63 | return 100; | ||
64 | } | ||
65 | 58 | ||
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index 7e5006f..2c03389 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h | |||
@@ -36,10 +36,9 @@ public: | |||
36 | QString pixmapNameWidget() const; | 36 | QString pixmapNameWidget() const; |
37 | QWidget* widget(QWidget *); | 37 | QWidget* widget(QWidget *); |
38 | QString pixmapNameConfig() const; | 38 | QString pixmapNameConfig() const; |
39 | ConfigWidget* configWidget(QWidget *); | 39 | TodayConfigWidget* configWidget(QWidget *); |
40 | QString appName() const; | 40 | QString appName() const; |
41 | virtual int minHeight() const; | 41 | |
42 | virtual int maxHeight() const; | ||
43 | }; | 42 | }; |
44 | 43 | ||
45 | #endif | 44 | #endif |
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.cpp b/core/pim/today/plugins/todolist/todopluginconfig.cpp index 69ad727..110b2e0 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.cpp +++ b/core/pim/today/plugins/todolist/todopluginconfig.cpp | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | 27 | ||
28 | TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) | 28 | TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) |
29 | : ConfigWidget(parent, name ) { | 29 | : TodayConfigWidget(parent, name ) { |
30 | 30 | ||
31 | QVBoxLayout * layout = new QVBoxLayout( this ); | 31 | QVBoxLayout * layout = new QVBoxLayout( this ); |
32 | layout->setMargin( 20 ); | 32 | layout->setMargin( 20 ); |
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h index 934b319..26557d5 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.h +++ b/core/pim/today/plugins/todolist/todopluginconfig.h | |||
@@ -20,9 +20,9 @@ | |||
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | #include <qspinbox.h> | 21 | #include <qspinbox.h> |
22 | 22 | ||
23 | #include "../../configwidget.h" | 23 | #include "../../todayconfigwidget.h" |
24 | 24 | ||
25 | class TodolistPluginConfig : public ConfigWidget { | 25 | class TodolistPluginConfig : public TodayConfigWidget { |
26 | 26 | ||
27 | 27 | ||
28 | public: | 28 | public: |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 7673df5..f5f88f8 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | 17 | ||
18 | #include "today.h" | 18 | #include "today.h" |
19 | #include "configwidget.h" | 19 | #include "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> |
@@ -169,7 +169,8 @@ void Today::loadPlugins() { | |||
169 | // a scrollview for each plugin | 169 | // a scrollview for each plugin |
170 | QScrollView* sv = new QScrollView( plugin.guiBox ); | 170 | QScrollView* sv = new QScrollView( plugin.guiBox ); |
171 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); | 171 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); |
172 | sv->setMinimumHeight( plugin.guiPart->minHeight() ); | 172 | // not sure if that is good .-) |
173 | sv->setMinimumHeight( 10 ); | ||
173 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 174 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
174 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 175 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
175 | sv->setFrameShape( QFrame::NoFrame ); | 176 | sv->setFrameShape( QFrame::NoFrame ); |
@@ -251,14 +252,14 @@ void Today::startConfig() { | |||
251 | TodayConfig conf( this, "dialog", true ); | 252 | TodayConfig conf( this, "dialog", true ); |
252 | 253 | ||
253 | TodayPlugin plugin; | 254 | TodayPlugin plugin; |
254 | QList<ConfigWidget> configWidgetList; | 255 | QList<TodayConfigWidget> configWidgetList; |
255 | 256 | ||
256 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { | 257 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { |
257 | plugin = pluginList[i]; | 258 | plugin = pluginList[i]; |
258 | 259 | ||
259 | // load the config widgets in the tabs | 260 | // load the config widgets in the tabs |
260 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 261 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
261 | ConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); | 262 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); |
262 | configWidgetList.append( widget ); | 263 | configWidgetList.append( widget ); |
263 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() | 264 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() |
264 | , plugin.guiPart->appName() ); | 265 | , plugin.guiPart->appName() ); |
@@ -270,7 +271,7 @@ void Today::startConfig() { | |||
270 | 271 | ||
271 | if ( conf.exec() == QDialog::Accepted ) { | 272 | if ( conf.exec() == QDialog::Accepted ) { |
272 | conf.writeConfig(); | 273 | conf.writeConfig(); |
273 | ConfigWidget *confWidget; | 274 | TodayConfigWidget *confWidget; |
274 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 275 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
275 | confWidget = configWidgetList.next() ) { | 276 | confWidget = configWidgetList.next() ) { |
276 | confWidget->writeConfig(); | 277 | confWidget->writeConfig(); |
diff --git a/core/pim/today/todayconfigwidget.h b/core/pim/today/todayconfigwidget.h new file mode 100644 index 0000000..48cf379 --- a/dev/null +++ b/core/pim/today/todayconfigwidget.h | |||
@@ -0,0 +1,21 @@ | |||
1 | |||
2 | #ifndef CONFIG_WIDGET_H | ||
3 | #define CONFIG_WIDGET_H | ||
4 | |||
5 | |||
6 | class TodayConfigWidget : public QWidget { | ||
7 | |||
8 | |||
9 | public: | ||
10 | |||
11 | TodayConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) {} ; | ||
12 | virtual ~TodayConfigWidget() {}; | ||
13 | |||
14 | /** | ||
15 | * Plugins need to reimplement this in the config widget | ||
16 | * Used when the config dialog is closed to write config stuff | ||
17 | */ | ||
18 | virtual void writeConfig() = 0; | ||
19 | }; | ||
20 | |||
21 | #endif | ||
diff --git a/core/pim/today/todayplugininterface.h b/core/pim/today/todayplugininterface.h index 01e7d58..becb79c 100644 --- a/core/pim/today/todayplugininterface.h +++ b/core/pim/today/todayplugininterface.h | |||
@@ -3,7 +3,7 @@ | |||
3 | #define TODAY_PLUGIN_INTERFACE | 3 | #define TODAY_PLUGIN_INTERFACE |
4 | 4 | ||
5 | #include <qpe/qcom.h> | 5 | #include <qpe/qcom.h> |
6 | #include "configwidget.h" | 6 | #include "todayconfigwidget.h" |
7 | 7 | ||
8 | class QString; | 8 | class QString; |
9 | class QWidget; | 9 | class QWidget; |
@@ -35,10 +35,7 @@ public: | |||
35 | */ | 35 | */ |
36 | virtual double versionNumber() const = 0; | 36 | virtual double versionNumber() const = 0; |
37 | 37 | ||
38 | /** | 38 | |
39 | * the path and name of the identifer icon that should be shown | ||
40 | * in "Resource" notation, that means only subdir/picname form $QPEDIR/pics | ||
41 | */ | ||
42 | virtual QString pixmapNameWidget() const = 0; | 39 | virtual QString pixmapNameWidget() const = 0; |
43 | 40 | ||
44 | /** widget for the today view | 41 | /** widget for the today view |
@@ -55,7 +52,7 @@ public: | |||
55 | * Config plugin widget - optional | 52 | * Config plugin widget - optional |
56 | * If the plugin has a config widget, it _needs_ a parent here. | 53 | * If the plugin has a config widget, it _needs_ a parent here. |
57 | */ | 54 | */ |
58 | virtual ConfigWidget* configWidget( QWidget * ) = 0; | 55 | virtual TodayConfigWidget* configWidget( QWidget * ) = 0; |
59 | 56 | ||
60 | /** | 57 | /** |
61 | * The application that should be assigned to the button (pixmap) | 58 | * The application that should be assigned to the button (pixmap) |
@@ -65,12 +62,12 @@ public: | |||
65 | /** | 62 | /** |
66 | * minimum height the plugin at least should have | 63 | * minimum height the plugin at least should have |
67 | */ | 64 | */ |
68 | virtual int minHeight() const = 0; | 65 | // virtual int minHeight() const = 0; |
69 | 66 | ||
70 | /** | 67 | /** |
71 | * maximum height that should be used before starting scrolling | 68 | * maximum height that should be used before starting scrolling |
72 | */ | 69 | */ |
73 | virtual int maxHeight() const = 0; | 70 | // virtual int maxHeight() const = 0; |
74 | 71 | ||
75 | }; | 72 | }; |
76 | 73 | ||