30 files changed, 199 insertions, 159 deletions
diff --git a/core/pim/today/.cvsignore b/core/pim/today/.cvsignore index 1ee9a27..11e7045 100644 --- a/core/pim/today/.cvsignore +++ b/core/pim/today/.cvsignore @@ -1,3 +1,5 @@ *.moc Makefile* moc_* +todayconfigmiscbase.cpp +todayconfigmiscbase.h diff --git a/core/pim/today/changelog b/core/pim/today/changelog index a77e581..b492435 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog @@ -1,3 +1,9 @@ +0.7 + +* now all plugins in a big scrollview +* config dialogs guis are ui files now +* plugin interface has one new virtual method - reinitialize ( used when coming back from config dialog ) + 0.6.2 * header can now be made smaller diff --git a/core/pim/today/main.cpp b/core/pim/today/main.cpp index 72c0a2e..156cd0f 100644 --- a/core/pim/today/main.cpp +++ b/core/pim/today/main.cpp @@ -19,18 +19,6 @@ #include "today.h" #include <qpe/qpeapplication.h> +#include <opie/oapplicationfactory.h> -QPEApplication *todayApp; - -int main( int argc, char ** argv ) -{ - QPEApplication a(argc, argv); - todayApp=&a; - - Today t; - - t.setCaption( Today::tr("Today") ); - a.showMainWidget(&t); - - return a.exec(); -} +OPIE_EXPORT_APP( OApplicationFactory<Today> ) diff --git a/core/pim/today/plugin.cpp b/core/pim/today/plugin.cpp deleted file mode 100644 index 349413b..0000000 --- a/core/pim/today/plugin.cpp +++ b/dev/null @@ -1,17 +0,0 @@ -#include "today.h" -#include <qwidget.h> -#include <qcombobox.h> -#include <oappplugin.h> - -#define Q_BASEINSTANCE( i ) \ - QUnknownInterface* iface = 0; \ - i->queryInterface( IID_QUnknown, &iface ); \ - return iface - -Q_EXPORT_INTERFACE() -{ - Today *t = new Today; - t->setCaption( Today::tr("Today") ); - OAppPlugin *comp = new OAppPlugin(t); - Q_BASEINSTANCE( comp ); -} diff --git a/core/pim/today/plugins/datebook/.cvsignore b/core/pim/today/plugins/datebook/.cvsignore index 2888d4a..10cf625 100644 --- a/core/pim/today/plugins/datebook/.cvsignore +++ b/core/pim/today/plugins/datebook/.cvsignore @@ -1,2 +1,3 @@ Makefile* +datebookpluginconfigbase* moc* diff --git a/core/pim/today/plugins/datebook/config.in b/core/pim/today/plugins/datebook/config.in index 621510f..7a14438 100644 --- a/core/pim/today/plugins/datebook/config.in +++ b/core/pim/today/plugins/datebook/config.in @@ -1,4 +1,4 @@ config TODAY_DATEBOOK - boolean "opie-today-datebookplugin (datebook plugin)" + boolean "datebook" default "y" depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE diff --git a/core/pim/today/plugins/datebook/datebook.pro b/core/pim/today/plugins/datebook/datebook.pro index bd45f71..1f75964 100644 --- a/core/pim/today/plugins/datebook/datebook.pro +++ b/core/pim/today/plugins/datebook/datebook.pro @@ -18,4 +18,23 @@ LIBS+= -lqpe -lopie DESTDIR = $(OPIEDIR)/plugins/today TARGET = todaydatebookplugin +TRANSLATIONS = ../../../../../i18n/de/libtodaydatebookplugin.ts \ + ../../../../../i18n/nl/libtodaydatebookplugin.ts \ + ../../../../../i18n/xx/libtodaydatebookplugin.ts \ + ../../../../../i18n/en/libtodaydatebookplugin.ts \ + ../../../../../i18n/es/libtodaydatebookplugin.ts \ + ../../../../../i18n/fr/libtodaydatebookplugin.ts \ + ../../../../../i18n/hu/libtodaydatebookplugin.ts \ + ../../../../../i18n/ja/libtodaydatebookplugin.ts \ + ../../../../../i18n/ko/libtodaydatebookplugin.ts \ + ../../../../../i18n/no/libtodaydatebookplugin.ts \ + ../../../../../i18n/pl/libtodaydatebookplugin.ts \ + ../../../../../i18n/pt/libtodaydatebookplugin.ts \ + ../../../../../i18n/pt_BR/libtodaydatebookplugin.ts \ + ../../../../../i18n/sl/libtodaydatebookplugin.ts \ + ../../../../../i18n/zh_CN/libtodaydatebookplugin.ts \ + ../../../../../i18n/zh_TW/libtodaydatebookplugin.ts \ + ../../../../../i18n/it/libtodaydatebookplugin.ts \ + ../../../../../i18n/da/libtodaydatebookplugin.ts + include ( $(OPIEDIR)/include.pro ) diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp index 3c1e97a..e595047 100644 --- a/core/pim/today/plugins/datebook/datebookevent.cpp +++ b/core/pim/today/plugins/datebook/datebookevent.cpp @@ -1,7 +1,7 @@ /* * datebookevent.cpp * - * copyright : (c) 2002 by Maximilian Reiß + * copyright : (c) 2002, 2003 by Maximilian Reiß * email : harlekin@handhelds.org * */ @@ -19,6 +19,7 @@ #include <qpe/timestring.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> +#include <qpe/calendar.h> #include <opie/odevice.h> @@ -28,6 +29,7 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, QWidget* parent, bool show_location, bool show_notes, + bool timeExtraLine, int maxCharClip, const char* name, WFlags fl) : @@ -52,17 +54,25 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, msg += "<BR><i>" + (ev).location() + "</i>"; } + QString timeSpacer = " "; + if ( timeExtraLine ) { + timeSpacer = "<br>"; + } + if ( ( TimeString::timeString( QTime( (ev).event().start().time() ) ) == "00:00" ) && ( TimeString::timeString( QTime( (ev).event().end().time() ) ) == "23:59" ) ) { - msg += "<br>All day"; + msg += tr ( "All day" ); } else { // start time of event - QDate tempDate = (ev).event().start().date(); - msg += "<br>" - + ampmTime( QTime( (ev).event().start().time() ) ) +// QDate tempDate = (ev).event().start().date(); + msg += timeSpacer; + msg += ampmTime( QTime( (ev).event().start().time() ) ) // end time of event - + "<b> - </b>" + ampmTime( QTime( (ev).event().end().time() ) ) - + differDate( tempDate ); + + "<b> - </b>" + ampmTime( QTime( (ev).event().end().time() ) ); + } + + if ( (ev).date() != QDate::currentDate() ) { + msg += differDate( (ev).date() /* tempDate*/ ); } // include possible note or not @@ -101,18 +111,18 @@ QString DateBookEvent::ampmTime( QTime tm ) { } QString DateBookEvent::differDate( QDate date ) { - QDate currentDate = QDate::currentDate(); +// QDate currentDate = QDate::currentDate(); QString returnText = "<font color = #407DD9><b> "; - int differDate = currentDate.daysTo( date ); - if ( currentDate.dayOfWeek() == date.dayOfWeek() ) { - returnText += "" ; - // not working right for recurring events - //} else if ( differDate == 1 ) { - //returnText += tr( "tomorrow" ); - } else { - //returnText += tr( "in %1 days" ).arg( differDate ); - returnText += " [ " + date.dayName( date.dayOfWeek() ) + " ] "; - } +// int differDate = currentDate.daysTo( date ); +// if ( currentDate.dayOfWeek() == date.dayOfWeek() ) { +// returnText += "" ; +// // not working right for recurring events +// //} else if ( differDate == 1 ) { +// //returnText += tr( "tomorrow" ); +// } else { +// returnText += " [ " + Calendar::nameOfDay( date.dayOfWeek() ) + " ] "; +// } + returnText += " [ " + Calendar::nameOfDay( date.dayOfWeek() ) + " ] "; returnText += "</b></font>"; return returnText; } @@ -126,7 +136,7 @@ void DateBookEvent::editEventSlot( const Event &e ) { if ( ODevice::inst()->system() == System_Zaurus ) { QCopEnvelope env( "QPE/Application/datebook", "raise()" ); } else { - QCopEnvelope env( "QPE/Datebook", "editEvent(int)" ); + QCopEnvelope env( "QPE/Application/datebook", "editEvent(int)" ); env << e.uid(); } } diff --git a/core/pim/today/plugins/datebook/datebookevent.h b/core/pim/today/plugins/datebook/datebookevent.h index 8027809..1a090e3 100644 --- a/core/pim/today/plugins/datebook/datebookevent.h +++ b/core/pim/today/plugins/datebook/datebookevent.h @@ -1,7 +1,7 @@ /* * datebookplugin.h * - * copyright : (c) 2002 by Maximilian Reiß + * copyright : (c) 2002, 2003 by Maximilian Reiß * email : harlekin@handhelds.org * */ @@ -30,16 +30,19 @@ public: QWidget* parent = 0, bool show_location = 0, bool show_notes = 0, + bool timeExtraLine = 0, int maxCharClip = 0, const char* name = 0, WFlags fl = 0 ); ~DateBookEvent(); + signals: void editEvent( const Event &e ); private slots: void editEventSlot( const Event &e ); void editMe(); + private: QString ampmTime( QTime ); diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index 4e650ee..f77e440 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp @@ -69,3 +69,10 @@ void DatebookPlugin::refresh() { m_widget->refresh(); } } + +void DatebookPlugin::reinitialize() { + if ( m_widget ) { + m_widget->reinitialize(); + } +} + diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index db899e8..890c59b 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h @@ -39,6 +39,7 @@ public: QString appName() const; bool excludeFromRefresh() const; void refresh(); + void reinitialize(); private: QGuardedPtr<DatebookPluginWidget> m_widget; diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index 1970654..9e95bcd 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -30,11 +30,6 @@ DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name ) db = 0l; m_layoutDates = 0l; - if ( db ) { - delete db; - } - db = new DateBookDB; - if ( m_layoutDates ) { delete m_layoutDates; } @@ -45,7 +40,6 @@ DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name ) readConfig(); getDates(); - m_layoutDates->addStretch(5); } DatebookPluginWidget::~DatebookPluginWidget() { @@ -62,6 +56,12 @@ void DatebookPluginWidget::readConfig() { m_show_notes = cfg.readNumEntry( "shownotes", 0 ); m_onlyLater = cfg.readNumEntry( "onlylater", 1 ); m_moreDays = cfg.readNumEntry( "moredays", 0 ); + m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 ); +} + +void DatebookPluginWidget::reinitialize() { + readConfig(); + refresh(); } void DatebookPluginWidget::refresh() { @@ -74,7 +74,6 @@ void DatebookPluginWidget::refresh() { m_layoutDates->setAutoAdd( true ); getDates(); - m_layoutDates->addStretch(5); } /** @@ -82,6 +81,12 @@ void DatebookPluginWidget::refresh() { */ void DatebookPluginWidget::getDates() { + + if ( db ) { + delete db; + } + db = new DateBookDB; + QDate date = QDate::currentDate(); QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) ); qBubbleSort( list ); @@ -94,20 +99,33 @@ void DatebookPluginWidget::getDates() { if ( count < m_max_lines_meet ) { if ( !m_onlyLater ) { count++; - DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes ); + DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine ); m_eventsList.append( l ); l->show(); QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); - } else if ( QDateTime::currentDateTime() <= (*it).event().end() || (*it).event().start().date() != date ) { + } else { + if ( ( QDateTime::currentDateTime() <= (*it).event().end() ) + // Show events which span over many days and are not elapsed. + || ( ( (*it).event().start().date() != date ) && ( QDateTime::currentDateTime() <= (*it).event().end() ) ) + // Show repeated event for today that is not elapsed. + || ( ( (*it).event().repeatType() != Event::NoRepeat ) + && ( ( date.dayOfWeek() == (*it).date().dayOfWeek() ) + && ( QTime::currentTime() < (*it).event().start().time() ) ) ) + // Show repeated event for next days. + || ( ( (*it).event().repeatType() != Event::NoRepeat ) + && ( date.dayOfWeek() != (*it).date().dayOfWeek() ) ) + ) + { count++; // show only later appointments - DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes ); + DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine ); m_eventsList.append( l ); l->show(); QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); } } } + } if ( m_onlyLater && count == 0 ) { QLabel* noMoreEvents = new QLabel( this ); m_eventsList.append( noMoreEvents ); diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.h b/core/pim/today/plugins/datebook/datebookpluginwidget.h index 35d43cd..8988073 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.h +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.h @@ -34,6 +34,7 @@ public: DatebookPluginWidget( QWidget *parent, const char *name ); ~DatebookPluginWidget(); void refresh(); + void reinitialize(); private: DateBookDB* db; @@ -52,7 +53,8 @@ private: // should only later appointments be shown or all for the current day. bool m_onlyLater; int m_moreDays; - + // true if time of an appointment should be an extra line + bool m_timeExtraLine; }; #endif diff --git a/core/pim/today/plugins/mail/config.in b/core/pim/today/plugins/mail/config.in index 6f3e06d..6f4450f 100644 --- a/core/pim/today/plugins/mail/config.in +++ b/core/pim/today/plugins/mail/config.in @@ -1,4 +1,4 @@ config TODAY_MAIL - boolean "opie-today-mailplugin (mail plugin)" + boolean "mail" default "y" depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE diff --git a/core/pim/today/plugins/mail/mail.pro b/core/pim/today/plugins/mail/mail.pro index 60ed87d..70c484d 100644 --- a/core/pim/today/plugins/mail/mail.pro +++ b/core/pim/today/plugins/mail/mail.pro @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG -= moc -CONFIG += qt plugin release +CONFIG += qt release # Input HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h @@ -16,4 +16,22 @@ LIBS+= -lqpe -lopie DESTDIR = $(OPIEDIR)/plugins/today TARGET = todaymailplugin +TRANSLATIONS = ../../../../../i18n/de/libtodaymailplugin.ts \ + ../../../../../i18n/nl/libtodaymailplugin.ts \ + ../../../../../i18n/xx/libtodaymailplugin.ts \ + ../../../../../i18n/en/libtodaymailplugin.ts \ + ../../../../../i18n/es/libtodaymailplugin.ts \ + ../../../../../i18n/fr/libtodaymailplugin.ts \ + ../../../../../i18n/hu/libtodaymailplugin.ts \ + ../../../../../i18n/ja/libtodaymailplugin.ts \ + ../../../../../i18n/ko/libtodaymailplugin.ts \ + ../../../../../i18n/no/libtodaymailplugin.ts \ + ../../../../../i18n/pl/libtodaymailplugin.ts \ + ../../../../../i18n/pt/libtodaymailplugin.ts \ + ../../../../../i18n/pt_BR/libtodaymailplugin.ts \ + ../../../../../i18n/sl/libtodaymailplugin.ts \ + ../../../../../i18n/zh_CN/libtodaymailplugin.ts \ + ../../../../../i18n/zh_TW/libtodaymailplugin.ts \ + ../../../../../i18n/it/libtodaymailplugin.ts \ + ../../../../../i18n/da/libtodaymailplugin.ts include ( $(OPIEDIR)/include.pro ) diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp index 9430c30..bf30538 100644 --- a/core/pim/today/plugins/mail/mailplugin.cpp +++ b/core/pim/today/plugins/mail/mailplugin.cpp @@ -67,3 +67,6 @@ void MailPlugin::refresh() { m_widget->refresh(); } } + +void MailPlugin::reinitialize() { +} diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h index 295a88c..5b93314 100644 --- a/core/pim/today/plugins/mail/mailplugin.h +++ b/core/pim/today/plugins/mail/mailplugin.h @@ -41,6 +41,7 @@ public: QString appName() const; bool excludeFromRefresh() const; void refresh(); + void reinitialize(); private: QGuardedPtr<MailPluginWidget> m_widget; diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp index 3c1d908..646996a 100644 --- a/core/pim/today/plugins/mail/mailpluginwidget.cpp +++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp @@ -29,7 +29,7 @@ MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) delete m_mailLabel; } m_mailLabel = new OClickableLabel( this ); - m_mailLabel->setMaximumHeight( 15 ); + //m_mailLabel->setMaximumHeight( 15 ); connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); if ( m_layout ) { diff --git a/core/pim/today/plugins/mail/opie-today-mailplugin.control b/core/pim/today/plugins/mail/opie-today-mailplugin.control index 1419557..e69de29 100644 --- a/core/pim/today/plugins/mail/opie-today-mailplugin.control +++ b/core/pim/today/plugins/mail/opie-today-mailplugin.control @@ -1,9 +0,0 @@ -Package: opie-today-mailplugin -Files: plugins/today/libtodaymailplugin.so* -Priority: optional -Section: opie/applications -Maintainer: Maximilian Reiss <harlekin@handhelds.org> -Architecture: arm -Version: $QPE_VERSION-$SUB_VERSION -Depends: libqte2, opie-today -Description: Mail plugin for today 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 @@ -19,4 +19,23 @@ 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,7 +1,7 @@ /* * todoplugin.cpp * - * copyright : (c) 2002 by Maximilian Reiß + * copyright : (c) 2002,2003 by Maximilian Reiß * email : harlekin@handhelds.org * */ @@ -68,3 +68,9 @@ void TodolistPlugin::refresh() { 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 @@ -41,6 +41,7 @@ public: QString appName() const; bool excludeFromRefresh() const; void refresh(); + void reinitialize(); private: QGuardedPtr<TodolistPluginWidget> m_widget; 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 @@ -64,6 +64,13 @@ void TodolistPluginWidget::readConfig() { } void TodolistPluginWidget:: refresh() { + todo->reload(); + getTodo(); +} + +void TodolistPluginWidget::reinitialize() { + readConfig(); + todo->reload(); getTodo(); } @@ -79,7 +86,7 @@ void TodolistPluginWidget::getTodo() { 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 ) ) { @@ -87,7 +94,7 @@ void TodolistPluginWidget::getTodo() { 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++ ; } } @@ -104,7 +111,7 @@ void TodolistPluginWidget::getTodo() { 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++; } } 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 @@ -32,6 +32,7 @@ public: ~TodolistPluginWidget(); void refresh(); + void reinitialize(); protected slots: void startTodolist(); diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index dd8d59b..d4a0ae6 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -192,12 +192,7 @@ void Today::loadPlugins() { } QString path = QPEApplication::qpeDir() + "/plugins/today"; - qWarning("Searching for Plugins in: %s", path.latin1()); -#ifdef Q_OS_MACX - QDir dir( path, "lib*.dylib" ); -#else QDir dir( path, "lib*.so" ); -#endif QStringList list = dir.entryList(); QStringList::Iterator it; @@ -220,14 +215,11 @@ void Today::loadPlugins() { QString type = (*it).left( (*it).find(".") ); - // grr, sharp rom does not know Global::languageList(); - // QStringList langs = Global::languageList(); - QString tfn = QPEApplication::qpeDir() + "/i18n/"; - QDir langDir = tfn; - QStringList langs = langDir.entryList("*", QDir::Dirs ); + QString lang; + Config config("locale"); + config.setGroup("Language"); + lang = config.readEntry( "Language", "en" ); - for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) { - QString lang = *lit; qDebug( "Languages: " + lang ); QTranslator * trans = new QTranslator( qApp ); QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; @@ -236,7 +228,6 @@ void Today::loadPlugins() { } else { delete trans; } - } // find out if plugins should be shown diff --git a/core/pim/today/today.pro b/core/pim/today/today.pro index 03ee795..2968e6a 100644 --- a/core/pim/today/today.pro +++ b/core/pim/today/today.pro @@ -1,11 +1,14 @@ CONFIG += qt warn on release quick-app HEADERS = today.h todaybase.h todayconfig.h -SOURCES = today.cpp todaybase.cpp todayconfig.cpp +SOURCES = today.cpp todaybase.cpp todayconfig.cpp main.cpp +INTERFACES = todayconfigmiscbase.ui + INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie -INTERFACES = + TARGET = today include ( $(OPIEDIR)/include.pro ) +} diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index a60f1d2..bfb5ec6 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -1,7 +1,7 @@ /* * todayconfig.cpp * - * copyright : (c) 2002 by Maximilian Reiß + * copyright : (c) 2002, 2003 by Maximilian Reiß * email : harlekin@handhelds.org * */ @@ -76,54 +76,13 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) tab2Layout->addWidget( hbox1 ); TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); + // Misc tab tab_3 = new QWidget( TabWidget3, "tab_3" ); QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); - tab3Layout->setMargin( 20 ); - QHBox *hbox_auto = new QHBox( tab_3 ); - TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); - TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); - QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); - CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); - QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); - - QHBox *hbox_hide = new QHBox( tab_3 ); - TextLabel4 = new QLabel( hbox_hide, "HideBanner" ); - TextLabel4->setText( tr( "Tiny Banner" ) ); - //QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); - CheckBoxHide = new QCheckBox( hbox_hide, "CheckBoxHide" ); - // QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); - - QHBox *hbox_inactive = new QHBox( tab_3 ); - TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); - TimeLabel->setText( tr( "minutes inactive" ) ); - QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); - SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); - SpinBoxTime->setMaxValue ( 1440 ); - QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); - QHBox *hbox_iconSize = new QHBox( tab_3 ); - QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); - iconSizeLabel->setText( tr( "Icon size" ) ); - QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); - SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); - SpinBoxIconSize->setMaxValue( 32 ); - QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) ); - - QHBox *hbox_refresh = new QHBox( tab_3 ); - QLabel *refreshLabel = new QLabel( hbox_refresh ); - refreshLabel->setText( tr( "Refresh" ) ); - QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); - SpinRefresh = new QSpinBox( hbox_refresh ); - SpinRefresh->setMinValue( 0 ); - SpinRefresh->setSuffix( tr( " sec" ) ); - SpinRefresh->setMaxValue ( 7200 ); - SpinRefresh->setSpecialValueText ( tr("never") ); - QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); - - tab3Layout->addWidget( hbox_auto ); - tab3Layout->addWidget( hbox_hide ); - tab3Layout->addWidget( hbox_inactive ); - tab3Layout->addWidget( hbox_iconSize ); - tab3Layout->addWidget( hbox_refresh ); + + m_guiMisc = new TodayConfigMiscBase( tab_3 ); + + tab3Layout->addWidget( m_guiMisc ); TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); m_applets_changed = false; @@ -161,15 +120,15 @@ void TodayConfig::readConfig() { Config cfg( "today" ); cfg.setGroup( "Autostart" ); m_autoStart = cfg.readNumEntry( "autostart", 1 ); - CheckBoxAuto->setChecked( m_autoStart ); + m_guiMisc->CheckBoxAuto->setChecked( m_autoStart ); m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); - SpinBoxTime->setValue( m_autoStartTimer ); + m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer ); cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); - SpinBoxIconSize->setValue( m_iconSize ); - SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); - CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); + m_guiMisc->SpinBoxIconSize->setValue( m_iconSize ); + m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); + m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); cfg.setGroup( "Plugins" ); @@ -209,16 +168,16 @@ void TodayConfig::writeConfig() { } cfg.setGroup( "Autostart" ); - m_autoStart = CheckBoxAuto->isChecked(); + m_autoStart = m_guiMisc->CheckBoxAuto->isChecked(); cfg.writeEntry( "autostart", m_autoStart ); - m_autoStartTimer = SpinBoxTime->value(); + m_autoStartTimer = m_guiMisc->SpinBoxTime->value(); cfg.writeEntry( "autostartdelay", m_autoStartTimer ); - m_iconSize = SpinBoxIconSize->value(); + m_iconSize = m_guiMisc->SpinBoxIconSize->value(); cfg.setGroup( "General" ); cfg.writeEntry( "IconSize", m_iconSize ); - cfg.writeEntry( "HideBanner", CheckBoxHide->isChecked() ); - cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); + cfg.writeEntry( "HideBanner", m_guiMisc->CheckBoxHide->isChecked() ); + cfg.writeEntry( "checkinterval", m_guiMisc->SpinRefresh->value()*1000 ); // set autostart settings setAutoStart(); diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h index 41bd44b..0a7687c 100644 --- a/core/pim/today/todayconfig.h +++ b/core/pim/today/todayconfig.h @@ -1,7 +1,7 @@ /* * todayconfig.h * - * copyright : (c) 2002 by Maximilian Reiß + * copyright : (c) 2002,2003 by Maximilian Reiß * email : harlekin@handhelds.org * */ @@ -22,6 +22,9 @@ #include <qlistview.h> #include <opie/otabwidget.h> + +#include "todayconfigmiscbase.h" + class QCheckBox; class QLabel; class QSpinBox; @@ -59,16 +62,12 @@ private: QStringList m_excludeApplets; bool m_applets_changed; - QLabel* TextLabel2; - QCheckBox* CheckBoxAuto, *CheckBoxHide; QWidget* tab_2; QWidget* tab_3; QLabel* TextLabel1, *TextLabel4; QSpinBox* SpinBox7; - QLabel* TimeLabel; - QSpinBox* SpinBoxTime; - QSpinBox* SpinRefresh; - QSpinBox* SpinBoxIconSize; + + TodayConfigMiscBase *m_guiMisc; }; #endif |