From 7c43e678395bbf781195686b34cc596ea72aa512 Mon Sep 17 00:00:00 2001 From: harlekin Date: Sat, 29 Mar 2003 13:23:53 +0000 Subject: added option to made the banner on top much smaller and also the date should adapt to local settings now ( hopefully ) --- (limited to 'core/pim/today') 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 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -130,16 +131,33 @@ void Today::init() { cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); + m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); // set the date in top label QDate date = QDate::currentDate(); - QString time = ( tr( date.toString() ) ); - DateLabel->setText( QString( "" + time + "" ) ); + DateLabel->setText( QString( "" + TimeString::longDateString( date ) + "" ) ); if ( layout ) { delete layout; } + + if ( m_hideBanner ) { + Opiezilla->hide(); + TodayLabel->hide(); + Frame->setMaximumHeight( 18 ); + Frame->setMinimumHeight( 18 ); + DateLabel->setGeometry( QRect( 10, 2, 168, 12 ) ); + ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-20, 0, 25, 20 ) ); + } else { + Opiezilla->show(); + TodayLabel->show(); + Frame->setMaximumHeight( 50 ); + Frame->setMinimumHeight( 50 ); + DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); + ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 29, 25, 20 ) ); + } + layout = new QVBoxLayout( this ); layout->addWidget( Frame ); layout->addWidget( OwnerField ); @@ -319,7 +337,7 @@ void Today::startConfig() { TodayPlugin plugin; QList configWidgetList; - for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { + for ( int i = pluginList.count() - 1; i >= 0; i-- ) { plugin = pluginList[i]; // load the config widgets in the tabs 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 @@ -66,6 +66,7 @@ private slots: int m_newStart; int m_iconSize; int m_maxCharClip; + int m_hideBanner; }; #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 @@ -58,7 +58,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) Frame->setMinimumHeight( 50 ); // Today text - QLabel* TodayLabel = new QLabel( Frame, "TodayText" ); + TodayLabel = new QLabel( Frame, "TodayText" ); TodayLabel->setGeometry( QRect( 10, 1, 168, 40 ) ); QFont TodayLabel_font( TodayLabel->font() ); TodayLabel_font.setBold( TRUE ); @@ -77,7 +77,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) DateLabel->setTextFormat( RichText ); // Opiezilla - QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" ); + Opiezilla = new QLabel( Frame, "OpieZilla" ); Opiezilla->setPixmap( opiezilla ); Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 ); QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); 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 @@ -43,6 +43,8 @@ public: QLabel* Frame; QLabel* DateLabel; QFrame* Frame15; + QLabel* Opiezilla; + QLabel* TodayLabel; OClickableLabel* ConfigButton; protected: 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 @@ -54,7 +54,7 @@ public: TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) : QDialog( parent, name, modal, WStyle_ContextHelp ) { - setCaption( tr( "Today config" ) ); + setCaption( tr( "Today Config" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); @@ -85,6 +85,14 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 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" ) ); @@ -112,6 +120,7 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 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 ); @@ -160,6 +169,7 @@ void TodayConfig::readConfig() { m_iconSize = cfg.readNumEntry( "IconSize", 18 ); SpinBoxIconSize->setValue( m_iconSize ); SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); + CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); cfg.setGroup( "Plugins" ); @@ -207,6 +217,7 @@ void TodayConfig::writeConfig() { cfg.setGroup( "General" ); cfg.writeEntry( "IconSize", m_iconSize ); + cfg.writeEntry( "HideBanner", CheckBoxHide->isChecked() ); cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); // set autostart settings 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 @@ -60,10 +60,10 @@ private: bool m_applets_changed; QLabel* TextLabel2; - QCheckBox* CheckBoxAuto; + QCheckBox* CheckBoxAuto, *CheckBoxHide; QWidget* tab_2; QWidget* tab_3; - QLabel* TextLabel1; + QLabel* TextLabel1, *TextLabel4; QSpinBox* SpinBox7; QLabel* TimeLabel; QSpinBox* SpinBoxTime; -- cgit v0.9.0.2