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 { | |||
33 | 33 | ||
34 | double TodolistPlugin::versionNumber() const { | 34 | double TodolistPlugin::versionNumber() const { |
35 | return 0.1; | 35 | return 0.7; |
36 | } | 36 | } |
37 | 37 | ||
@@ -41,5 +41,5 @@ QString TodolistPlugin::pixmapNameWidget() const { | |||
41 | 41 | ||
42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { | 42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { |
43 | return new TodolistPluginWidget( wid, "Todolist" ); | 43 | return new TodolistPluginWidget( wid, "Todolist" ); |
44 | } | 44 | } |
45 | 45 | ||
@@ -53,5 +53,5 @@ ConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { | |||
53 | 53 | ||
54 | QString TodolistPlugin::appName() const { | 54 | QString TodolistPlugin::appName() const { |
55 | return "Todolist"; | 55 | return QObject::tr( "Todolist" ); |
56 | } | 56 | } |
57 | 57 | ||
@@ -64,8 +64,2 @@ int TodolistPlugin::maxHeight() const { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | |||
67 | |||
68 | |||
69 | int main() { | ||
70 | } | ||
71 | |||
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) | |||
51 | 51 | ||
52 | void TodolistPluginConfig::readConfig() { | 52 | void TodolistPluginConfig::readConfig() { |
53 | Config cfg( "todaydatebookplugin" ); | 53 | Config cfg( "todaytodoplugin" ); |
54 | cfg.setGroup( "config" ); | 54 | cfg.setGroup( "config" ); |
55 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); | 55 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); |
@@ -59,6 +59,7 @@ void TodolistPluginConfig::readConfig() { | |||
59 | 59 | ||
60 | void TodolistPluginConfig::writeConfig() { | 60 | void TodolistPluginConfig::writeConfig() { |
61 | Config cfg( "todaydatebookplugin" ); | 61 | Config cfg( "todaytodoplugin" ); |
62 | cfg.setGroup( "config" ); | 62 | cfg.setGroup( "config" ); |
63 | m_max_lines_task = SpinBox2->value(); | ||
63 | cfg.writeEntry( "maxlinestask", m_max_lines_task ); | 64 | cfg.writeEntry( "maxlinestask", m_max_lines_task ); |
64 | cfg.write(); | 65 | 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 @@ | |||
28 | #include <qpe/qcopenvelope_qws.h> | 28 | #include <qpe/qcopenvelope_qws.h> |
29 | 29 | ||
30 | TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name) | 30 | TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) |
31 | : QWidget(parent, name ) { | 31 | : QWidget( parent, name ) { |
32 | 32 | ||
33 | todoLabel= 0l; | 33 | todoLabel= 0l; |
34 | |||
35 | todo = 0l; | 34 | todo = 0l; |
35 | |||
36 | if ( todo ) { | 36 | if ( todo ) { |
37 | delete todo; | 37 | delete todo; |
@@ -48,8 +48,9 @@ TodolistPluginWidget::~TodolistPluginWidget() { | |||
48 | } | 48 | } |
49 | 49 | ||
50 | |||
50 | void TodolistPluginWidget::readConfig() { | 51 | void TodolistPluginWidget::readConfig() { |
51 | Config cfg( "todaytodolistplugin" ); | 52 | Config cfg( "todaytodoplugin" ); |
52 | cfg.setGroup( "config" ); | 53 | cfg.setGroup( "config" ); |
53 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); | 54 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); |
54 | } | 55 | } |
55 | 56 | ||
@@ -62,5 +63,5 @@ void TodolistPluginWidget::getTodo() { | |||
62 | QVBoxLayout* layoutTodo = new QVBoxLayout( this ); | 63 | QVBoxLayout* layoutTodo = new QVBoxLayout( this ); |
63 | 64 | ||
64 | if ( todoLabel ) { | 65 | if ( todoLabel ) { |
65 | delete todoLabel; | 66 | delete todoLabel; |
66 | } | 67 | } |
@@ -68,5 +69,6 @@ void TodolistPluginWidget::getTodo() { | |||
68 | todoLabel = new OClickableLabel( this ); | 69 | todoLabel = new OClickableLabel( this ); |
69 | todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); | 70 | todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); |
70 | connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); | 71 | connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); |
72 | |||
71 | QString output; | 73 | QString output; |
72 | QString tmpout; | 74 | QString tmpout; |
@@ -76,7 +78,7 @@ void TodolistPluginWidget::getTodo() { | |||
76 | // get overdue todos first | 78 | // get overdue todos first |
77 | QValueList<ToDoEvent> overDueList = todo->overDue(); | 79 | QValueList<ToDoEvent> overDueList = todo->overDue(); |
78 | qBubbleSort(overDueList); | 80 | qBubbleSort( overDueList ); |
79 | for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); | 81 | for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); |
80 | it!=overDueList.end(); ++it ) { | 82 | it != overDueList.end(); ++it ) { |
81 | if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { | 83 | if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { |
82 | QString desc = (*it).summary(); | 84 | QString desc = (*it).summary(); |
@@ -84,5 +86,5 @@ void TodolistPluginWidget::getTodo() { | |||
84 | desc = (*it).description(); | 86 | desc = (*it).description(); |
85 | } | 87 | } |
86 | tmpout += "<font color=#e00000><b>-" + desc.mid(0, m_maxCharClip) + "</b></font><br>"; | 88 | tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; |
87 | ammount++; | 89 | ammount++; |
88 | } | 90 | } |
@@ -92,6 +94,6 @@ void TodolistPluginWidget::getTodo() { | |||
92 | QValueList<ToDoEvent> openTodo = todo->rawToDos(); | 94 | QValueList<ToDoEvent> openTodo = todo->rawToDos(); |
93 | qBubbleSort( openTodo ); | 95 | qBubbleSort( openTodo ); |
94 | for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin(); | 96 | for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin(); |
95 | it!=openTodo.end(); ++it ) { | 97 | it != openTodo.end(); ++it ) { |
96 | if ( !(*it).isCompleted() ){ | 98 | if ( !(*it).isCompleted() ){ |
97 | count +=1; | 99 | count +=1; |
@@ -103,5 +105,5 @@ void TodolistPluginWidget::getTodo() { | |||
103 | desc = (*it).description(); | 105 | desc = (*it).description(); |
104 | } | 106 | } |
105 | tmpout += "<b>-</b>" + desc.mid(0, m_maxCharClip) + "<br>"; | 107 | tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; |
106 | ammount++; | 108 | ammount++; |
107 | } | 109 | } |
@@ -114,10 +116,10 @@ void TodolistPluginWidget::getTodo() { | |||
114 | output += QObject::tr( "There is <b> 1</b> active task: <br>" ); | 116 | output += QObject::tr( "There is <b> 1</b> active task: <br>" ); |
115 | } else { | 117 | } else { |
116 | output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg(count); | 118 | output += QObject::tr( "There are <b> %1</b> active tasks: <br>" ).arg( count ); |
117 | } | 119 | } |
118 | output += tmpout; | 120 | output += tmpout; |
119 | } else { | 121 | } else { |
120 | output = QObject::tr( "No active tasks" ); | 122 | output = QObject::tr( "No active tasks" ); |
121 | } | 123 | } |
122 | todoLabel->setText( output ); | 124 | todoLabel->setText( output ); |
123 | layoutTodo->addWidget( todoLabel ); | 125 | layoutTodo->addWidget( todoLabel ); |
@@ -128,5 +130,5 @@ void TodolistPluginWidget::getTodo() { | |||
128 | */ | 130 | */ |
129 | void TodolistPluginWidget::startTodolist() { | 131 | void TodolistPluginWidget::startTodolist() { |
130 | QCopEnvelope e("QPE/System", "execute(QString)"); | 132 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
131 | e << QString("todolist"); | 133 | e << QString( "todolist" ); |
132 | } | 134 | } |
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: | |||
39 | OClickableLabel *todoLabel; | 39 | OClickableLabel *todoLabel; |
40 | ToDoDB *todo; | 40 | ToDoDB *todo; |
41 | |||
41 | void readConfig(); | 42 | void readConfig(); |
42 | void getTodo(); | 43 | void getTodo(); |