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 @@ #include "todopluginconfig.h" -#include "todopluginwidget.h" @@ -24,2 +23,3 @@ TodolistPlugin::TodolistPlugin() { + m_widget = 0l; } @@ -27,2 +27,3 @@ TodolistPlugin::TodolistPlugin() { TodolistPlugin::~TodolistPlugin() { + delete m_widget; } @@ -34,3 +35,3 @@ QString TodolistPlugin::pluginName() const { double TodolistPlugin::versionNumber() const { - return 0.8; + return 0.9; } @@ -42,3 +43,6 @@ QString TodolistPlugin::pixmapNameWidget() const { QWidget* TodolistPlugin::widget( QWidget *wid ) { - return new TodolistPluginWidget( wid, "Todolist" ); + if(!m_widget) { + m_widget = new TodolistPluginWidget( wid, "Todolist" ); + } + return m_widget; } @@ -61 +65,7 @@ bool TodolistPlugin::excludeFromRefresh() const { } + +void TodolistPlugin::refresh() { + if ( m_widget ) { + m_widget->refresh(); + } +} 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 @@ +#include "todopluginwidget.h" + class TodolistPlugin : public TodayPluginObject { @@ -40,2 +42,6 @@ public: bool excludeFromRefresh() const; + void refresh(); + + private: + TodolistPluginWidget *m_widget; }; 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 ) - todoLabel = 0l; todo = 0l; + layoutTodo = 0l; + todoLabel = 0l; @@ -38,3 +39,2 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) } - todo = new OTodoAccess(); @@ -42,2 +42,16 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) + if ( layoutTodo ) { + delete layoutTodo; + } + layoutTodo = new QVBoxLayout( this ); + layoutTodo->setAutoAdd( true ); + + + if ( todoLabel ) { + delete todoLabel; + } + todoLabel = new OClickableLabel( this ); + + connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); + readConfig(); @@ -48,2 +62,4 @@ TodolistPluginWidget::~TodolistPluginWidget() { delete todo; + delete todoLabel; + delete layoutTodo; } @@ -58,2 +74,5 @@ void TodolistPluginWidget::readConfig() { +void TodolistPluginWidget:: refresh() { + getTodo(); +} @@ -64,10 +83,2 @@ void TodolistPluginWidget::getTodo() { - QVBoxLayout* layoutTodo = new QVBoxLayout( this ); - - if ( todoLabel ) { - delete todoLabel; - } - - todoLabel = new OClickableLabel( this ); - connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); @@ -120,3 +131,2 @@ void TodolistPluginWidget::getTodo() { todoLabel->setText( output ); - layoutTodo->addWidget( todoLabel ); } 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 @@ #include <qwidget.h> +#include <qlayout.h> @@ -35,2 +36,4 @@ public: + void refresh(); + protected slots: @@ -40,2 +43,3 @@ private: OClickableLabel *todoLabel; + QVBoxLayout* layoutTodo; |