summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp24
-rw-r--r--core/pim/today/today.h1
-rw-r--r--core/pim/today/todaybase.cpp4
-rw-r--r--core/pim/today/todaybase.h2
-rw-r--r--core/pim/today/todayconfig.cpp13
-rw-r--r--core/pim/today/todayconfig.h4
6 files changed, 40 insertions, 8 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
@@ -21,16 +21,17 @@
21#include "today.h" 21#include "today.h"
22 22
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>
35 36
36struct TodayPlugin { 37struct TodayPlugin {
@@ -125,26 +126,43 @@ void Today::init() {
125 Config cfg( "today" ); 126 Config cfg( "today" );
126 127
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/**
149 * Load the plugins 167 * Load the plugins
150 */ 168 */
@@ -314,17 +332,17 @@ void Today::startConfig() {
314 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 332 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
315 m_refreshTimer->stop( ); 333 m_refreshTimer->stop( );
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 );
329 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() 347 conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig()
330 , plugin.guiPart->appName() ); 348 , plugin.guiPart->appName() );
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 3802feb..b28ac96 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -61,11 +61,12 @@ private slots:
61 QStringList m_allApplets; 61 QStringList m_allApplets;
62 62
63 QTimer *m_refreshTimer; 63 QTimer *m_refreshTimer;
64 64
65 bool m_refreshTimerEnabled; 65 bool m_refreshTimerEnabled;
66 int m_newStart; 66 int m_newStart;
67 int m_iconSize; 67 int m_iconSize;
68 int m_maxCharClip; 68 int m_maxCharClip;
69 int m_hideBanner;
69}; 70};
70 71
71#endif 72#endif
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index da4efa3..a36ecaa 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -53,17 +53,17 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
53 Frame->setPalette( pal2 ); 53 Frame->setPalette( pal2 );
54 Frame->setFrameShape( QFrame::StyledPanel ); 54 Frame->setFrameShape( QFrame::StyledPanel );
55 Frame->setFrameShadow( QFrame::Raised ); 55 Frame->setFrameShadow( QFrame::Raised );
56 Frame->setLineWidth( 0 ); 56 Frame->setLineWidth( 0 );
57 Frame->setMaximumHeight( 50 ); 57 Frame->setMaximumHeight( 50 );
58 Frame->setMinimumHeight( 50 ); 58 Frame->setMinimumHeight( 50 );
59 59
60 // Today text 60 // Today text
61 QLabel* TodayLabel = new QLabel( Frame, "TodayText" ); 61 TodayLabel = new QLabel( Frame, "TodayText" );
62 TodayLabel->setGeometry( QRect( 10, 1, 168, 40 ) ); 62 TodayLabel->setGeometry( QRect( 10, 1, 168, 40 ) );
63 QFont TodayLabel_font( TodayLabel->font() ); 63 QFont TodayLabel_font( TodayLabel->font() );
64 TodayLabel_font.setBold( TRUE ); 64 TodayLabel_font.setBold( TRUE );
65 TodayLabel_font.setPointSize( 40 ); 65 TodayLabel_font.setPointSize( 40 );
66 TodayLabel->setFont( TodayLabel_font ); 66 TodayLabel->setFont( TodayLabel_font );
67 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 67 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
68 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); 68 TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" );
69 69
@@ -72,17 +72,17 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags )
72 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); 72 DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) );
73 QFont DateLabel_font( DateLabel->font() ); 73 QFont DateLabel_font( DateLabel->font() );
74 DateLabel_font.setBold( TRUE ); 74 DateLabel_font.setBold( TRUE );
75 DateLabel->setFont( DateLabel_font ); 75 DateLabel->setFont( DateLabel_font );
76 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 76 DateLabel->setBackgroundOrigin( QLabel::ParentOrigin );
77 DateLabel->setTextFormat( RichText ); 77 DateLabel->setTextFormat( RichText );
78 78
79 // Opiezilla 79 // Opiezilla
80 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" ); 80 Opiezilla = new QLabel( Frame, "OpieZilla" );
81 Opiezilla->setPixmap( opiezilla ); 81 Opiezilla->setPixmap( opiezilla );
82 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 ); 82 Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 );
83 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); 83 QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) );
84 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); 84 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
85 85
86 // Ownerfield 86 // Ownerfield
87 OwnerField = new OClickableLabel( this , "Owner" ); 87 OwnerField = new OClickableLabel( this , "Owner" );
88 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); 88 OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) );
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h
index 340c7a6..b0b2e14 100644
--- a/core/pim/today/todaybase.h
+++ b/core/pim/today/todaybase.h
@@ -38,16 +38,18 @@ public:
38 38
39 QFrame* Frame4; 39 QFrame* Frame4;
40 QPushButton* DatesButton; 40 QPushButton* DatesButton;
41 QVBoxLayout* layout; 41 QVBoxLayout* layout;
42 OClickableLabel* OwnerField; 42 OClickableLabel* OwnerField;
43 QLabel* Frame; 43 QLabel* Frame;
44 QLabel* DateLabel; 44 QLabel* DateLabel;
45 QFrame* Frame15; 45 QFrame* Frame15;
46 QLabel* Opiezilla;
47 QLabel* TodayLabel;
46 OClickableLabel* ConfigButton; 48 OClickableLabel* ConfigButton;
47 49
48protected: 50protected:
49 51
50 52
51}; 53};
52 54
53#endif 55#endif
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 0774ccb..a60f1d2 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -49,17 +49,17 @@ public:
49/** 49/**
50 * The class has currently quite some duplicate code. 50 * The class has currently quite some duplicate code.
51 * By that way it would be real easy to have it as seperate app in settings tab 51 * By that way it would be real easy to have it as seperate app in settings tab
52 * 52 *
53 */ 53 */
54TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 54TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
55 : QDialog( parent, name, modal, WStyle_ContextHelp ) { 55 : QDialog( parent, name, modal, WStyle_ContextHelp ) {
56 56
57 setCaption( tr( "Today config" ) ); 57 setCaption( tr( "Today Config" ) );
58 58
59 QVBoxLayout *layout = new QVBoxLayout( this ); 59 QVBoxLayout *layout = new QVBoxLayout( this );
60 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 60 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
61 layout->addWidget( TabWidget3 ); 61 layout->addWidget( TabWidget3 );
62 62
63 tab_2 = new QWidget( TabWidget3, "tab_2" ); 63 tab_2 = new QWidget( TabWidget3, "tab_2" );
64 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); 64 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
65 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); 65 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
@@ -80,16 +80,24 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
80 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); 80 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
81 tab3Layout->setMargin( 20 ); 81 tab3Layout->setMargin( 20 );
82 QHBox *hbox_auto = new QHBox( tab_3 ); 82 QHBox *hbox_auto = new QHBox( tab_3 );
83 TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); 83 TextLabel2 = new QLabel( hbox_auto, "AutoStart" );
84 TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); 84 TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) );
85 QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); 85 QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) );
86 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); 86 CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" );
87 QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); 87 QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) );
88
89 QHBox *hbox_hide = new QHBox( tab_3 );
90 TextLabel4 = new QLabel( hbox_hide, "HideBanner" );
91 TextLabel4->setText( tr( "Tiny Banner" ) );
92 //QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) );
93 CheckBoxHide = new QCheckBox( hbox_hide, "CheckBoxHide" );
94 // QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) );
95
88 QHBox *hbox_inactive = new QHBox( tab_3 ); 96 QHBox *hbox_inactive = new QHBox( tab_3 );
89 TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); 97 TimeLabel = new QLabel( hbox_inactive, "TimeLabel" );
90 TimeLabel->setText( tr( "minutes inactive" ) ); 98 TimeLabel->setText( tr( "minutes inactive" ) );
91 QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); 99 QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) );
92 SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); 100 SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" );
93 SpinBoxTime->setMaxValue ( 1440 ); 101 SpinBoxTime->setMaxValue ( 1440 );
94 QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); 102 QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) );
95 QHBox *hbox_iconSize = new QHBox( tab_3 ); 103 QHBox *hbox_iconSize = new QHBox( tab_3 );
@@ -107,16 +115,17 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
107 SpinRefresh = new QSpinBox( hbox_refresh ); 115 SpinRefresh = new QSpinBox( hbox_refresh );
108 SpinRefresh->setMinValue( 0 ); 116 SpinRefresh->setMinValue( 0 );
109 SpinRefresh->setSuffix( tr( " sec" ) ); 117 SpinRefresh->setSuffix( tr( " sec" ) );
110 SpinRefresh->setMaxValue ( 7200 ); 118 SpinRefresh->setMaxValue ( 7200 );
111 SpinRefresh->setSpecialValueText ( tr("never") ); 119 SpinRefresh->setSpecialValueText ( tr("never") );
112 QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); 120 QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) );
113 121
114 tab3Layout->addWidget( hbox_auto ); 122 tab3Layout->addWidget( hbox_auto );
123 tab3Layout->addWidget( hbox_hide );
115 tab3Layout->addWidget( hbox_inactive ); 124 tab3Layout->addWidget( hbox_inactive );
116 tab3Layout->addWidget( hbox_iconSize ); 125 tab3Layout->addWidget( hbox_iconSize );
117 tab3Layout->addWidget( hbox_refresh ); 126 tab3Layout->addWidget( hbox_refresh );
118 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); 127 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
119 128
120 m_applets_changed = false; 129 m_applets_changed = false;
121 130
122 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); 131 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) );
@@ -155,16 +164,17 @@ void TodayConfig::readConfig() {
155 CheckBoxAuto->setChecked( m_autoStart ); 164 CheckBoxAuto->setChecked( m_autoStart );
156 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); 165 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 );
157 SpinBoxTime->setValue( m_autoStartTimer ); 166 SpinBoxTime->setValue( m_autoStartTimer );
158 167
159 cfg.setGroup( "General" ); 168 cfg.setGroup( "General" );
160 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 169 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
161 SpinBoxIconSize->setValue( m_iconSize ); 170 SpinBoxIconSize->setValue( m_iconSize );
162 SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); 171 SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 );
172 CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) );
163 173
164 174
165 cfg.setGroup( "Plugins" ); 175 cfg.setGroup( "Plugins" );
166 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 176 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
167} 177}
168 178
169/** 179/**
170 * Write the config part 180 * Write the config part
@@ -202,16 +212,17 @@ void TodayConfig::writeConfig() {
202 m_autoStart = CheckBoxAuto->isChecked(); 212 m_autoStart = CheckBoxAuto->isChecked();
203 cfg.writeEntry( "autostart", m_autoStart ); 213 cfg.writeEntry( "autostart", m_autoStart );
204 m_autoStartTimer = SpinBoxTime->value(); 214 m_autoStartTimer = SpinBoxTime->value();
205 cfg.writeEntry( "autostartdelay", m_autoStartTimer ); 215 cfg.writeEntry( "autostartdelay", m_autoStartTimer );
206 m_iconSize = SpinBoxIconSize->value(); 216 m_iconSize = SpinBoxIconSize->value();
207 217
208 cfg.setGroup( "General" ); 218 cfg.setGroup( "General" );
209 cfg.writeEntry( "IconSize", m_iconSize ); 219 cfg.writeEntry( "IconSize", m_iconSize );
220 cfg.writeEntry( "HideBanner", CheckBoxHide->isChecked() );
210 cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); 221 cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 );
211 222
212 // set autostart settings 223 // set autostart settings
213 setAutoStart(); 224 setAutoStart();
214} 225}
215 226
216 227
217void TodayConfig::moveSelectedUp() { 228void TodayConfig::moveSelectedUp() {
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index 68483c2..41bd44b 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -55,20 +55,20 @@ private:
55 55
56 int m_autoStart; 56 int m_autoStart;
57 int m_autoStartTimer; 57 int m_autoStartTimer;
58 int m_iconSize; 58 int m_iconSize;
59 QStringList m_excludeApplets; 59 QStringList m_excludeApplets;
60 bool m_applets_changed; 60 bool m_applets_changed;
61 61
62 QLabel* TextLabel2; 62 QLabel* TextLabel2;
63 QCheckBox* CheckBoxAuto; 63 QCheckBox* CheckBoxAuto, *CheckBoxHide;
64 QWidget* tab_2; 64 QWidget* tab_2;
65 QWidget* tab_3; 65 QWidget* tab_3;
66 QLabel* TextLabel1; 66 QLabel* TextLabel1, *TextLabel4;
67 QSpinBox* SpinBox7; 67 QSpinBox* SpinBox7;
68 QLabel* TimeLabel; 68 QLabel* TimeLabel;
69 QSpinBox* SpinBoxTime; 69 QSpinBox* SpinBoxTime;
70 QSpinBox* SpinRefresh; 70 QSpinBox* SpinRefresh;
71 QSpinBox* SpinBoxIconSize; 71 QSpinBox* SpinBoxIconSize;
72}; 72};
73 73
74#endif 74#endif