-rw-r--r-- | core/pim/today/today.cpp | 24 | ||||
-rw-r--r-- | core/pim/today/today.h | 1 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/todaybase.h | 2 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 13 | ||||
-rw-r--r-- | core/pim/today/todayconfig.h | 4 |
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 @@ -17,24 +17,25 @@ #define QTOPIA_INTERNAL_LANGLIST #include "today.h" #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> #include <qpe/global.h> #include <qpe/qpeapplication.h> #include <qpe/contact.h> +#include <qpe/timestring.h> #include <qdir.h> #include <qfile.h> #include <qtimer.h> #include <qwhatsthis.h> #include <qtranslator.h> struct TodayPlugin { TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} QLibrary *library; QInterfacePtr<TodayPluginInterface> iface; TodayPluginObject *guiPart; @@ -121,34 +122,51 @@ void Today::setOwnerField( QString &message ) { * Init stuff needed for today. Reads the config file. */ void Today::init() { // read config Config cfg( "today" ); cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 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( "<font color=#FFFFFF>" + time + "</font>" ) ); + DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); 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 ); } /** * Load the plugins */ void Today::loadPlugins() { init(); QValueList<TodayPlugin>::Iterator tit; @@ -310,25 +328,25 @@ void Today::draw() { */ void Today::startConfig() { // disconnect timer to prevent problems while being on config dialog disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); m_refreshTimer->stop( ); TodayConfig conf( this, "dialog", true ); TodayPlugin plugin; QList<TodayConfigWidget> 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 if ( plugin.guiPart->configWidget( this ) != 0l ) { TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); configWidgetList.append( widget ); conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() , plugin.guiPart->appName() ); } // set the order/activate tab conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); 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 @@ -57,15 +57,16 @@ private slots: private: TodayConfig *conf; QStringList m_excludeApplets; QStringList m_allApplets; QTimer *m_refreshTimer; bool m_refreshTimerEnabled; 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 @@ -49,44 +49,44 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); pal2.setActive( cg ); // today logo Frame = new QLabel( this, "Frame" ); Frame->setPalette( pal2 ); Frame->setFrameShape( QFrame::StyledPanel ); Frame->setFrameShadow( QFrame::Raised ); Frame->setLineWidth( 0 ); Frame->setMaximumHeight( 50 ); 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 ); TodayLabel_font.setPointSize( 40 ); TodayLabel->setFont( TodayLabel_font ); TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); // date DateLabel = new QLabel( Frame, "TextLabel1" ); DateLabel->setGeometry( QRect( 10, 35, 168, 12 ) ); QFont DateLabel_font( DateLabel->font() ); DateLabel_font.setBold( TRUE ); DateLabel->setFont( DateLabel_font ); DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); 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ß" ) ); Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); // Ownerfield OwnerField = new OClickableLabel( this , "Owner" ); OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); OwnerField->setMaximumHeight(12); // config 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 @@ -34,20 +34,22 @@ class TodayBase : public QWidget public: TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 ); ~TodayBase(); QFrame* Frame4; QPushButton* DatesButton; QVBoxLayout* layout; OClickableLabel* OwnerField; QLabel* Frame; QLabel* DateLabel; QFrame* Frame15; + QLabel* Opiezilla; + QLabel* TodayLabel; OClickableLabel* ConfigButton; protected: }; #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 @@ -45,25 +45,25 @@ public: } }; /** * The class has currently quite some duplicate code. * By that way it would be real easy to have it as seperate app in settings tab * */ 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 ); layout->addWidget( TabWidget3 ); tab_2 = new QWidget( TabWidget3, "tab_2" ); QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); tab2Layout->addWidget( l ); QHBox *hbox1 = new QHBox( tab_2 ); m_appletListView = new QListView( hbox1 ); m_appletListView->addColumn( "PluginList" ); @@ -76,24 +76,32 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) tab2Layout->addWidget( hbox1 ); TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); 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" ); @@ -103,24 +111,25 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 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 ); TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); m_applets_changed = false; connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); readConfig(); showMaximized(); } @@ -151,24 +160,25 @@ void TodayConfig::setAutoStart() { void TodayConfig::readConfig() { Config cfg( "today" ); cfg.setGroup( "Autostart" ); m_autoStart = cfg.readNumEntry( "autostart", 1 ); CheckBoxAuto->setChecked( m_autoStart ); m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); 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 ) ); cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); } /** * Write the config part */ void TodayConfig::writeConfig() { Config cfg( "today" ); cfg.setGroup( "Plugins" ); @@ -198,24 +208,25 @@ void TodayConfig::writeConfig() { cfg.writeEntry( "AllApplets", all_applets, ',' ); } cfg.setGroup( "Autostart" ); m_autoStart = CheckBoxAuto->isChecked(); cfg.writeEntry( "autostart", m_autoStart ); m_autoStartTimer = SpinBoxTime->value(); cfg.writeEntry( "autostartdelay", m_autoStartTimer ); m_iconSize = SpinBoxIconSize->value(); cfg.setGroup( "General" ); cfg.writeEntry( "IconSize", m_iconSize ); + cfg.writeEntry( "HideBanner", CheckBoxHide->isChecked() ); cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); // set autostart settings setAutoStart(); } void TodayConfig::moveSelectedUp() { QListViewItem *item = m_appletListView->selectedItem(); if ( item && item->itemAbove() ) { item->itemAbove()->moveItem( item ); } 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 @@ -51,24 +51,24 @@ private: void readConfig(); QListView* m_appletListView; QMap<QString,QCheckListItem*> m_applets; int m_autoStart; int m_autoStartTimer; int m_iconSize; QStringList m_excludeApplets; 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; QSpinBox* SpinRefresh; QSpinBox* SpinBoxIconSize; }; #endif |