4 files changed, 26 insertions, 28 deletions
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index f5f6ed6..7ab27a0 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp @@ -33,5 +33,5 @@ QString TodolistPlugin::pluginName() const { double TodolistPlugin::versionNumber() const { - return 0.1; + return 0.7; } @@ -41,5 +41,5 @@ QString TodolistPlugin::pixmapNameWidget() const { QWidget* TodolistPlugin::widget( QWidget *wid ) { - return new TodolistPluginWidget( wid, "Todolist" ); + return new TodolistPluginWidget( wid, "Todolist" ); } @@ -53,5 +53,5 @@ ConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { QString TodolistPlugin::appName() const { - return "Todolist"; + return QObject::tr( "Todolist" ); } @@ -64,8 +64,2 @@ int TodolistPlugin::maxHeight() const { } - - - - int main() { -} - diff --git a/core/pim/today/plugins/todolist/todopluginconfig.cpp b/core/pim/today/plugins/todolist/todopluginconfig.cpp index da81600..2d8f1b6 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.cpp +++ b/core/pim/today/plugins/todolist/todopluginconfig.cpp @@ -51,5 +51,5 @@ TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) void TodolistPluginConfig::readConfig() { - Config cfg( "todaydatebookplugin" ); + Config cfg( "todaytodoplugin" ); cfg.setGroup( "config" ); m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); @@ -59,6 +59,7 @@ void TodolistPluginConfig::readConfig() { void TodolistPluginConfig::writeConfig() { - Config cfg( "todaydatebookplugin" ); + Config cfg( "todaytodoplugin" ); cfg.setGroup( "config" ); + m_max_lines_task = SpinBox2->value(); cfg.writeEntry( "maxlinestask", m_max_lines_task ); cfg.write(); diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp index 2a0e5a3..4731b43 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.cpp +++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp @@ -28,10 +28,10 @@ #include <qpe/qcopenvelope_qws.h> -TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name) - : QWidget(parent, name ) { +TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) + : QWidget( parent, name ) { todoLabel= 0l; - todo = 0l; + if ( todo ) { delete todo; @@ -48,8 +48,9 @@ TodolistPluginWidget::~TodolistPluginWidget() { } + void TodolistPluginWidget::readConfig() { - Config cfg( "todaytodolistplugin" ); + Config cfg( "todaytodoplugin" ); cfg.setGroup( "config" ); - m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); + m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); } @@ -62,5 +63,5 @@ void TodolistPluginWidget::getTodo() { QVBoxLayout* layoutTodo = new QVBoxLayout( this ); - if ( todoLabel ) { + if ( todoLabel ) { delete todoLabel; } @@ -68,5 +69,6 @@ void TodolistPluginWidget::getTodo() { todoLabel = new OClickableLabel( this ); todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); - connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); + connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); + QString output; QString tmpout; @@ -76,7 +78,7 @@ void TodolistPluginWidget::getTodo() { // get overdue todos first QValueList<ToDoEvent> overDueList = todo->overDue(); - qBubbleSort(overDueList); + qBubbleSort( overDueList ); for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); - it!=overDueList.end(); ++it ) { + it != overDueList.end(); ++it ) { if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { QString desc = (*it).summary(); @@ -84,5 +86,5 @@ void TodolistPluginWidget::getTodo() { desc = (*it).description(); } - tmpout += "<font color=#e00000><b>-" + desc.mid(0, m_maxCharClip) + "</b></font><br>"; + tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; ammount++; } @@ -92,6 +94,6 @@ void TodolistPluginWidget::getTodo() { QValueList<ToDoEvent> openTodo = todo->rawToDos(); qBubbleSort( openTodo ); - for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin(); - it!=openTodo.end(); ++it ) { + for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin(); + it != openTodo.end(); ++it ) { if ( !(*it).isCompleted() ){ count +=1; @@ -103,5 +105,5 @@ void TodolistPluginWidget::getTodo() { desc = (*it).description(); } - tmpout += "<b>-</b>" + desc.mid(0, m_maxCharClip) + "<br>"; + tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; ammount++; } @@ -114,10 +116,10 @@ void TodolistPluginWidget::getTodo() { output += QObject::tr( "There is <b> 1</b> active task: <br>" ); } else { - output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg(count); + output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg( count ); } output += tmpout; } else { output = QObject::tr( "No active tasks" ); - } + } todoLabel->setText( output ); layoutTodo->addWidget( todoLabel ); @@ -128,5 +130,5 @@ void TodolistPluginWidget::getTodo() { */ void TodolistPluginWidget::startTodolist() { - QCopEnvelope e("QPE/System", "execute(QString)"); - e << QString("todolist"); + QCopEnvelope e( "QPE/System", "execute(QString)" ); + e << QString( "todolist" ); } diff --git a/core/pim/today/plugins/todolist/todopluginwidget.h b/core/pim/today/plugins/todolist/todopluginwidget.h index ccc312a..970f430 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.h +++ b/core/pim/today/plugins/todolist/todopluginwidget.h @@ -39,4 +39,5 @@ private: OClickableLabel *todoLabel; ToDoDB *todo; + void readConfig(); void getTodo(); |