summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/todolist
authorharlekin <harlekin>2003-02-10 21:28:14 (UTC)
committer harlekin <harlekin>2003-02-10 21:28:14 (UTC)
commitbbb3cdf8f91d567f6c2e786bd144b64bd679ff9a (patch) (unidiff)
tree9c622e670cab66c44d9bd079707945cf3c9bcb89 /core/pim/today/plugins/todolist
parentde272b8c47c3960a3fe574317fe2e6fb0c32e4af (diff)
downloadopie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.zip
opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.tar.gz
opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.tar.bz2
adapted to new refresh, datebookplugin still need some work
Diffstat (limited to 'core/pim/today/plugins/todolist') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.cpp16
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.h8
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.cpp34
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.h4
4 files changed, 46 insertions, 16 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
@@ -19,11 +19,12 @@
19#include "todoplugin.h" 19#include "todoplugin.h"
20#include "todopluginconfig.h" 20#include "todopluginconfig.h"
21#include "todopluginwidget.h"
22 21
23 22
24TodolistPlugin::TodolistPlugin() { 23TodolistPlugin::TodolistPlugin() {
24 m_widget = 0l;
25} 25}
26 26
27TodolistPlugin::~TodolistPlugin() { 27TodolistPlugin::~TodolistPlugin() {
28 delete m_widget;
28} 29}
29 30
@@ -33,5 +34,5 @@ QString TodolistPlugin::pluginName() const {
33 34
34double TodolistPlugin::versionNumber() const { 35double TodolistPlugin::versionNumber() const {
35 return 0.8; 36 return 0.9;
36} 37}
37 38
@@ -41,5 +42,8 @@ QString TodolistPlugin::pixmapNameWidget() const {
41 42
42QWidget* TodolistPlugin::widget( QWidget *wid ) { 43QWidget* 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}
45 49
@@ -60,2 +64,8 @@ bool TodolistPlugin::excludeFromRefresh() const {
60 return false; 64 return false;
61} 65}
66
67void 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
@@ -25,4 +25,6 @@
25#include <opie/todayplugininterface.h> 25#include <opie/todayplugininterface.h>
26 26
27#include "todopluginwidget.h"
28
27class TodolistPlugin : public TodayPluginObject { 29class TodolistPlugin : public TodayPluginObject {
28 30
@@ -30,5 +32,5 @@ public:
30 TodolistPlugin(); 32 TodolistPlugin();
31 ~TodolistPlugin(); 33 ~TodolistPlugin();
32 34
33 QString pluginName() const; 35 QString pluginName() const;
34 double versionNumber() const; 36 double versionNumber() const;
@@ -39,4 +41,8 @@ public:
39 QString appName() const; 41 QString appName() const;
40 bool excludeFromRefresh() const; 42 bool excludeFromRefresh() const;
43 void refresh();
44
45 private:
46 TodolistPluginWidget *m_widget;
41}; 47};
42 48
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
@@ -31,14 +31,28 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
31 : QWidget( parent, name ) { 31 : QWidget( parent, name ) {
32 32
33 todoLabel = 0l;
34 todo = 0l; 33 todo = 0l;
34 layoutTodo = 0l;
35 todoLabel = 0l;
35 36
36 if ( todo ) { 37 if ( todo ) {
37 delete todo; 38 delete todo;
38 } 39 }
39
40 todo = new OTodoAccess(); 40 todo = new OTodoAccess();
41 todo->load(); 41 todo->load();
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();
44 getTodo(); 58 getTodo();
@@ -47,4 +61,6 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
47TodolistPluginWidget::~TodolistPluginWidget() { 61TodolistPluginWidget::~TodolistPluginWidget() {
48 delete todo; 62 delete todo;
63 delete todoLabel;
64 delete layoutTodo;
49} 65}
50 66
@@ -57,4 +73,7 @@ void TodolistPluginWidget::readConfig() {
57} 73}
58 74
75void TodolistPluginWidget:: refresh() {
76 getTodo();
77}
59 78
60/** 79/**
@@ -63,12 +82,4 @@ void TodolistPluginWidget::readConfig() {
63void TodolistPluginWidget::getTodo() { 82void 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
74 QString output; 85 QString output;
@@ -87,5 +98,5 @@ void TodolistPluginWidget::getTodo() {
87 } 98 }
88 tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; 99 tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>";
89 ammount++; 100 ammount++ ;
90 } 101 }
91 } 102 }
@@ -119,5 +130,4 @@ void TodolistPluginWidget::getTodo() {
119 } 130 }
120 todoLabel->setText( output ); 131 todoLabel->setText( output );
121 layoutTodo->addWidget( todoLabel );
122} 132}
123 133
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
@@ -20,4 +20,5 @@
20#include <qstring.h> 20#include <qstring.h>
21#include <qwidget.h> 21#include <qwidget.h>
22#include <qlayout.h>
22 23
23#include <opie/otodo.h> 24#include <opie/otodo.h>
@@ -34,4 +35,6 @@ public:
34 ~TodolistPluginWidget(); 35 ~TodolistPluginWidget();
35 36
37 void refresh();
38
36protected slots: 39protected slots:
37 void startTodolist(); 40 void startTodolist();
@@ -39,4 +42,5 @@ protected slots:
39private: 42private:
40 OClickableLabel *todoLabel; 43 OClickableLabel *todoLabel;
44 QVBoxLayout* layoutTodo;
41 45
42 OTodoAccess *todo; 46 OTodoAccess *todo;