author | harlekin <harlekin> | 2003-12-05 11:20:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-05 11:20:37 (UTC) |
commit | 2b37759fc317b5efd9b371210b16117f7d346455 (patch) (side-by-side diff) | |
tree | f99beb5ff1c886f9b41a2d3a34300f8f121cf738 /core/pim/today/plugins/todolist | |
parent | 1ef5137234e2b7cd0be2a220a86d848503196269 (diff) | |
download | opie-2b37759fc317b5efd9b371210b16117f7d346455.zip opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.gz opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.bz2 |
today in HEAD up to date
Diffstat (limited to 'core/pim/today/plugins/todolist') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/plugins/todolist/.cvsignore | 1 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/config.in | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todolist.pro | 19 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 8 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 1 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.cpp | 15 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.h | 1 |
7 files changed, 41 insertions, 6 deletions
diff --git a/core/pim/today/plugins/todolist/.cvsignore b/core/pim/today/plugins/todolist/.cvsignore index 2888d4a..b9284b8 100644 --- a/core/pim/today/plugins/todolist/.cvsignore +++ b/core/pim/today/plugins/todolist/.cvsignore @@ -1,2 +1,3 @@ Makefile* +todopluginconfigbase* moc* diff --git a/core/pim/today/plugins/todolist/config.in b/core/pim/today/plugins/todolist/config.in index c862f37..48ba226 100644 --- a/core/pim/today/plugins/todolist/config.in +++ b/core/pim/today/plugins/todolist/config.in @@ -1,4 +1,4 @@ config TODAY_TODOLIST - boolean "opie-today-todolistplugin (shows the next todo entries)" + boolean "todolist" default "y" depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE diff --git a/core/pim/today/plugins/todolist/todolist.pro b/core/pim/today/plugins/todolist/todolist.pro index 0343223..6a63f4e 100644 --- a/core/pim/today/plugins/todolist/todolist.pro +++ b/core/pim/today/plugins/todolist/todolist.pro @@ -14,9 +14,28 @@ INCLUDEPATH += $(OPIEDIR)/include \ DEPENDPATH += $(OPIEDIR)/include \ ../ ../library LIBS+= -lqpe -lopie DESTDIR = $(OPIEDIR)/plugins/today TARGET = todaytodolistplugin +TRANSLATIONS = ../../../../../i18n/de/libtodaytodolistplugin.ts \ + ../../../../../i18n/nl/libtodaytodolistplugin.ts \ + ../../../../../i18n/xx/libtodaytodolistplugin.ts \ + ../../../../../i18n/en/libtodaytodolistplugin.ts \ + ../../../../../i18n/es/libtodaytodolistplugin.ts \ + ../../../../../i18n/fr/libtodaytodolistplugin.ts \ + ../../../../../i18n/hu/libtodaytodolistplugin.ts \ + ../../../../../i18n/ja/libtodaytodolistplugin.ts \ + ../../../../../i18n/ko/libtodaytodolistplugin.ts \ + ../../../../../i18n/no/libtodaytodolistplugin.ts \ + ../../../../../i18n/pl/libtodaytodolistplugin.ts \ + ../../../../../i18n/pt/libtodaytodolistplugin.ts \ + ../../../../../i18n/pt_BR/libtodaytodolistplugin.ts \ + ../../../../../i18n/sl/libtodaytodolistplugin.ts \ + ../../../../../i18n/zh_CN/libtodaytodolistplugin.ts \ + ../../../../../i18n/zh_TW/libtodaytodolistplugin.ts \ + ../../../../../i18n/it/libtodaytodolistplugin.ts \ + ../../../../../i18n/da/libtodaytodolistplugin.ts + include ( $(OPIEDIR)/include.pro ) diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index 7eeb8f1..801de9d 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp @@ -1,12 +1,12 @@ /* * todoplugin.cpp * - * copyright : (c) 2002 by Maximilian Reiß + * copyright : (c) 2002,2003 by Maximilian Reiß * email : harlekin@handhelds.org * */ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -63,8 +63,14 @@ bool TodolistPlugin::excludeFromRefresh() const { return false; } void TodolistPlugin::refresh() { if ( m_widget ) { m_widget->refresh(); } } + +void TodolistPlugin::reinitialize() { + if ( m_widget ) { + m_widget->reinitialize(); + } +} diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index d7b51b4..f68162f 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h @@ -36,14 +36,15 @@ public: double versionNumber() const; QString pixmapNameWidget() const; QWidget* widget(QWidget *); QString pixmapNameConfig() const; TodayConfigWidget* configWidget(QWidget *); QString appName() const; bool excludeFromRefresh() const; void refresh(); + void reinitialize(); private: QGuardedPtr<TodolistPluginWidget> m_widget; }; #endif diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp index 15081ec..0364f94 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.cpp +++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp @@ -58,58 +58,65 @@ TodolistPluginWidget::~TodolistPluginWidget() { void TodolistPluginWidget::readConfig() { Config cfg( "todaytodoplugin" ); cfg.setGroup( "config" ); m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); } -void TodolistPluginWidget:: refresh() { +void TodolistPluginWidget:: refresh() { + todo->reload(); + getTodo(); +} + +void TodolistPluginWidget::reinitialize() { + readConfig(); + todo->reload(); getTodo(); } /** * Get the todos */ void TodolistPluginWidget::getTodo() { QString output; QString tmpout; int count = 0; int ammount = 0; // get overdue todos first - m_list = todo->overDue(); + m_list = todo->sorted( true, 3, 2, 1); for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) { QString desc = (*m_it).summary(); if( desc.isEmpty() ) { desc = (*m_it).description(); } - tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; + tmpout += "<font color=#e00000><b>[" + QString("%1").arg((*m_it).priority() ) + "]" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; ammount++ ; } } // get total number of still open todos m_list = todo->sorted( true, 1, 4, 1); for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { count +=1; // not the overdues, we allready got them, and not if we are // over the maxlines if ( !(*m_it).isOverdue() && ( ammount < m_maxLinesTask ) ) { QString desc = (*m_it).summary(); if( desc.isEmpty() ) { desc = (*m_it).description(); } - tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; + tmpout += "<b> [" + QString("%1").arg((*m_it).priority() ) + "] </b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; ammount++; } } if ( count > 0 ) { if( count == 1 ) { output += QObject::tr( "There is <b> 1</b> active task: <br>" ); } else { diff --git a/core/pim/today/plugins/todolist/todopluginwidget.h b/core/pim/today/plugins/todolist/todopluginwidget.h index 0db65c4..9cac43d 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.h +++ b/core/pim/today/plugins/todolist/todopluginwidget.h @@ -27,16 +27,17 @@ class TodolistPluginWidget : public QWidget { Q_OBJECT public: TodolistPluginWidget( QWidget *parent, const char *name ); ~TodolistPluginWidget(); void refresh(); + void reinitialize(); protected slots: void startTodolist(); private: OClickableLabel *todoLabel; QVBoxLayout* layoutTodo; |