-rw-r--r-- | core/pim/today/today.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 5e5d373..0b61bf8 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -23,12 +23,13 @@ | |||
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/global.h> | 26 | #include <qpe/global.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/contact.h> | 28 | #include <qpe/contact.h> |
29 | #include <qpe/timestring.h> | ||
29 | 30 | ||
30 | #include <qdir.h> | 31 | #include <qdir.h> |
31 | #include <qfile.h> | 32 | #include <qfile.h> |
32 | #include <qtimer.h> | 33 | #include <qtimer.h> |
33 | #include <qwhatsthis.h> | 34 | #include <qwhatsthis.h> |
34 | #include <qtranslator.h> | 35 | #include <qtranslator.h> |
@@ -127,22 +128,39 @@ void Today::init() { | |||
127 | cfg.setGroup( "Plugins" ); | 128 | cfg.setGroup( "Plugins" ); |
128 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 129 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
129 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 130 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
130 | 131 | ||
131 | cfg.setGroup( "General" ); | 132 | cfg.setGroup( "General" ); |
132 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 133 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
134 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); | ||
133 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); | 135 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
134 | 136 | ||
135 | // set the date in top label | 137 | // set the date in top label |
136 | QDate date = QDate::currentDate(); | 138 | QDate date = QDate::currentDate(); |
137 | QString time = ( tr( date.toString() ) ); | 139 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); |
138 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); | ||
139 | 140 | ||
140 | if ( layout ) { | 141 | if ( layout ) { |
141 | delete layout; | 142 | delete layout; |
142 | } | 143 | } |
144 | |||
145 | if ( m_hideBanner ) { | ||
146 | Opiezilla->hide(); | ||
147 | TodayLabel->hide(); | ||
148 | Frame->setMaximumHeight( 18 ); | ||
149 | Frame->setMinimumHeight( 18 ); | ||
150 | DateLabel->setGeometry( QRect( 10, 2, 168, 12 ) ); | ||
151 | ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-20, 0, 25, 20 ) ); | ||
152 | } else { | ||
153 | Opiezilla->show(); | ||
154 | TodayLabel->show(); | ||
155 | Frame->setMaximumHeight( 50 ); | ||
156 | Frame->setMinimumHeight( 50 ); | ||
157 | DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); | ||
158 | ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 29, 25, 20 ) ); | ||
159 | } | ||
160 | |||
143 | layout = new QVBoxLayout( this ); | 161 | layout = new QVBoxLayout( this ); |
144 | layout->addWidget( Frame ); | 162 | layout->addWidget( Frame ); |
145 | layout->addWidget( OwnerField ); | 163 | layout->addWidget( OwnerField ); |
146 | } | 164 | } |
147 | 165 | ||
148 | /** | 166 | /** |
@@ -316,13 +334,13 @@ void Today::startConfig() { | |||
316 | 334 | ||
317 | TodayConfig conf( this, "dialog", true ); | 335 | TodayConfig conf( this, "dialog", true ); |
318 | 336 | ||
319 | TodayPlugin plugin; | 337 | TodayPlugin plugin; |
320 | QList<TodayConfigWidget> configWidgetList; | 338 | QList<TodayConfigWidget> configWidgetList; |
321 | 339 | ||
322 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { | 340 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { |
323 | plugin = pluginList[i]; | 341 | plugin = pluginList[i]; |
324 | 342 | ||
325 | // load the config widgets in the tabs | 343 | // load the config widgets in the tabs |
326 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 344 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
327 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); | 345 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); |
328 | configWidgetList.append( widget ); | 346 | configWidgetList.append( widget ); |