author | harlekin <harlekin> | 2003-02-10 21:28:14 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-02-10 21:28:14 (UTC) |
commit | bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a (patch) (side-by-side diff) | |
tree | 9c622e670cab66c44d9bd079707945cf3c9bcb89 /core/pim/today/plugins/todolist/todopluginwidget.cpp | |
parent | de272b8c47c3960a3fe574317fe2e6fb0c32e4af (diff) | |
download | opie-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/todopluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
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 @@ -29,24 +29,40 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) : QWidget( parent, name ) { - todoLabel = 0l; todo = 0l; + layoutTodo = 0l; + todoLabel = 0l; if ( todo ) { delete todo; } - todo = new OTodoAccess(); todo->load(); + 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(); getTodo(); } TodolistPluginWidget::~TodolistPluginWidget() { delete todo; + delete todoLabel; + delete layoutTodo; } void TodolistPluginWidget::readConfig() { @@ -55,22 +71,17 @@ void TodolistPluginWidget::readConfig() { m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); } +void TodolistPluginWidget:: refresh() { + getTodo(); +} /** * Get the todos */ void TodolistPluginWidget::getTodo() { - QVBoxLayout* layoutTodo = new QVBoxLayout( this ); - - if ( todoLabel ) { - delete todoLabel; - } - - todoLabel = new OClickableLabel( this ); - connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); QString output; QString tmpout; int count = 0; @@ -85,9 +96,9 @@ void TodolistPluginWidget::getTodo() { if( desc.isEmpty() ) { desc = (*m_it).description(); } tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; - ammount++; + ammount++ ; } } // get total number of still open todos @@ -117,9 +128,8 @@ void TodolistPluginWidget::getTodo() { } else { output = QObject::tr( "No active tasks" ); } todoLabel->setText( output ); - layoutTodo->addWidget( todoLabel ); } /** * start the todolist |