Diffstat (limited to 'core/pim/today/plugins/todolist') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 16 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 6 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.cpp | 32 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.h | 4 |
4 files changed, 44 insertions, 14 deletions
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index b5abbd3..1238f92 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -20,3 +20,2 @@ | |||
20 | #include "todopluginconfig.h" | 20 | #include "todopluginconfig.h" |
21 | #include "todopluginwidget.h" | ||
22 | 21 | ||
@@ -24,2 +23,3 @@ | |||
24 | TodolistPlugin::TodolistPlugin() { | 23 | TodolistPlugin::TodolistPlugin() { |
24 | m_widget = 0l; | ||
25 | } | 25 | } |
@@ -27,2 +27,3 @@ TodolistPlugin::TodolistPlugin() { | |||
27 | TodolistPlugin::~TodolistPlugin() { | 27 | TodolistPlugin::~TodolistPlugin() { |
28 | delete m_widget; | ||
28 | } | 29 | } |
@@ -34,3 +35,3 @@ QString TodolistPlugin::pluginName() const { | |||
34 | double TodolistPlugin::versionNumber() const { | 35 | double TodolistPlugin::versionNumber() const { |
35 | return 0.8; | 36 | return 0.9; |
36 | } | 37 | } |
@@ -42,3 +43,6 @@ QString TodolistPlugin::pixmapNameWidget() const { | |||
42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { | 43 | QWidget* TodolistPlugin::widget( QWidget *wid ) { |
43 | return new TodolistPluginWidget( wid, "Todolist" ); | 44 | if(!m_widget) { |
45 | m_widget = new TodolistPluginWidget( wid, "Todolist" ); | ||
46 | } | ||
47 | return m_widget; | ||
44 | } | 48 | } |
@@ -61 +65,7 @@ bool TodolistPlugin::excludeFromRefresh() const { | |||
61 | } | 65 | } |
66 | |||
67 | void TodolistPlugin::refresh() { | ||
68 | if ( m_widget ) { | ||
69 | m_widget->refresh(); | ||
70 | } | ||
71 | } | ||
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index f98afdb..6106d0c 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h | |||
@@ -26,2 +26,4 @@ | |||
26 | 26 | ||
27 | #include "todopluginwidget.h" | ||
28 | |||
27 | class TodolistPlugin : public TodayPluginObject { | 29 | class TodolistPlugin : public TodayPluginObject { |
@@ -40,2 +42,6 @@ public: | |||
40 | bool excludeFromRefresh() const; | 42 | bool excludeFromRefresh() const; |
43 | void refresh(); | ||
44 | |||
45 | private: | ||
46 | TodolistPluginWidget *m_widget; | ||
41 | }; | 47 | }; |
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp index 773e5cf..3242dac 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.cpp +++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp | |||
@@ -32,4 +32,5 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) | |||
32 | 32 | ||
33 | todoLabel = 0l; | ||
34 | todo = 0l; | 33 | todo = 0l; |
34 | layoutTodo = 0l; | ||
35 | todoLabel = 0l; | ||
35 | 36 | ||
@@ -38,3 +39,2 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) | |||
38 | } | 39 | } |
39 | |||
40 | todo = new OTodoAccess(); | 40 | todo = new OTodoAccess(); |
@@ -42,2 +42,16 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) | |||
42 | 42 | ||
43 | if ( layoutTodo ) { | ||
44 | delete layoutTodo; | ||
45 | } | ||
46 | layoutTodo = new QVBoxLayout( this ); | ||
47 | layoutTodo->setAutoAdd( true ); | ||
48 | |||
49 | |||
50 | if ( todoLabel ) { | ||
51 | delete todoLabel; | ||
52 | } | ||
53 | todoLabel = new OClickableLabel( this ); | ||
54 | |||
55 | connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); | ||
56 | |||
43 | readConfig(); | 57 | readConfig(); |
@@ -48,2 +62,4 @@ TodolistPluginWidget::~TodolistPluginWidget() { | |||
48 | delete todo; | 62 | delete todo; |
63 | delete todoLabel; | ||
64 | delete layoutTodo; | ||
49 | } | 65 | } |
@@ -58,2 +74,5 @@ void TodolistPluginWidget::readConfig() { | |||
58 | 74 | ||
75 | void TodolistPluginWidget:: refresh() { | ||
76 | getTodo(); | ||
77 | } | ||
59 | 78 | ||
@@ -64,10 +83,2 @@ void TodolistPluginWidget::getTodo() { | |||
64 | 83 | ||
65 | QVBoxLayout* layoutTodo = new QVBoxLayout( this ); | ||
66 | |||
67 | if ( todoLabel ) { | ||
68 | delete todoLabel; | ||
69 | } | ||
70 | |||
71 | todoLabel = new OClickableLabel( this ); | ||
72 | connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); | ||
73 | 84 | ||
@@ -120,3 +131,2 @@ void TodolistPluginWidget::getTodo() { | |||
120 | todoLabel->setText( output ); | 131 | todoLabel->setText( output ); |
121 | layoutTodo->addWidget( todoLabel ); | ||
122 | } | 132 | } |
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.h b/core/pim/today/plugins/todolist/todopluginwidget.h index 37b0ee1..0d0deb5 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.h +++ b/core/pim/today/plugins/todolist/todopluginwidget.h | |||
@@ -21,2 +21,3 @@ | |||
21 | #include <qwidget.h> | 21 | #include <qwidget.h> |
22 | #include <qlayout.h> | ||
22 | 23 | ||
@@ -35,2 +36,4 @@ public: | |||
35 | 36 | ||
37 | void refresh(); | ||
38 | |||
36 | protected slots: | 39 | protected slots: |
@@ -40,2 +43,3 @@ private: | |||
40 | OClickableLabel *todoLabel; | 43 | OClickableLabel *todoLabel; |
44 | QVBoxLayout* layoutTodo; | ||
41 | 45 | ||