From d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2 Mon Sep 17 00:00:00 2001 From: harlekin Date: Sat, 05 Oct 2002 20:46:18 +0000 Subject: buttons resizable and clickable again --- (limited to 'core') diff --git a/core/pim/today/changelog b/core/pim/today/changelog index 5fd3284..25d63ef 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog @@ -1,3 +1,7 @@ +0.5.1 + +* icons scalable and clickable again + 0.5 * now fully plugin based diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control index 6ea5090..28087f9 100644 --- a/core/pim/today/opie-today.control +++ b/core/pim/today/opie-today.control @@ -3,7 +3,7 @@ Priority: optional Section: opie/applications Maintainer: Maximilian Reiß Architecture: arm -Version: 0.5-$SUB_VERSION +Version: 0.5.1-$SUB_VERSION Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) License: GPL Description: today screen diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index 4ebb178..cacdb65 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp @@ -30,7 +30,7 @@ DatebookPlugin::~DatebookPlugin() { } QString DatebookPlugin::pluginName() const { - return "Datebook plugin"; + return QObject::tr( "Datebook plugin"); } double DatebookPlugin::versionNumber() const { @@ -54,6 +54,6 @@ TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { } QString DatebookPlugin::appName() const { - return QObject::tr( "Datebook" ); + return "datebook"; } diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp index 3ddf16e..1c90df4 100644 --- a/core/pim/today/plugins/mail/mailplugin.cpp +++ b/core/pim/today/plugins/mail/mailplugin.cpp @@ -26,11 +26,11 @@ MailPlugin::~MailPlugin() { } QString MailPlugin::pluginName() const { - return "Mail plugin"; + return QObject::tr( "Mail plugin" ); } double MailPlugin::versionNumber() const { - return 0.5; + return 0.6; } QString MailPlugin::pixmapNameWidget() const { @@ -50,7 +50,7 @@ TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { } QString MailPlugin::appName() const { - return "Mail"; + return "mail"; } diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index 19d9f37..09b54af 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp @@ -28,7 +28,7 @@ TodolistPlugin::~TodolistPlugin() { } QString TodolistPlugin::pluginName() const { - return "Todolist plugin"; + return QObject::tr( "Todolist plugin" ); } double TodolistPlugin::versionNumber() const { @@ -52,7 +52,7 @@ TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { } QString TodolistPlugin::appName() const { - return QObject::tr( "Todolist" ); + return "todolist"; } diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp index d793aae..320969e 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.cpp +++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp @@ -30,7 +30,7 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) : QWidget( parent, name ) { - todoLabel= 0l; + todoLabel = 0l; todo = 0l; if ( todo ) { diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 35758d5..34ec3cb 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -114,6 +114,8 @@ void Today::init() { m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); m_allApplets = cfg.readListEntry( "AllApplets", ',' ); + cfg.setGroup( "General" ); + m_iconSize = cfg.readNumEntry( "IconSize", 18 ); } @@ -135,7 +137,6 @@ void Today::loadPlugins() { QStringList list = dir.entryList(); QStringList::Iterator it; - QMap tempList; for ( it = list.begin(); it != list.end(); ++it ) { @@ -163,9 +164,11 @@ void Today::loadPlugins() { plugin.guiBox = new QWidget( this ); QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); QPixmap plugPix; - plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); + plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); plugIcon->setPixmap( plugPix ); + plugIcon->setName( plugin.guiPart->appName() ); + connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); // a scrollview for each plugin QScrollView* sv = new QScrollView( plugin.guiBox ); QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); @@ -251,7 +254,7 @@ void Today::startConfig() { TodayConfig conf( this, "dialog", true ); - TodayPlugin plugin; + TodayPlugin plugin; QList configWidgetList; for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { @@ -311,6 +314,11 @@ void Today::startAddressbook() { } +void Today::startApplication() { + QCopEnvelope e( "QPE/System", "execute(QString)" ); + e << QString( sender()->name() ); +} + /** * launch addressbook (personal card) */ diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 92512b9..6f13df6 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -32,7 +32,7 @@ #include class QVBoxLayout; - +class OClickableLabel; class Today : public TodayBase { @@ -46,6 +46,7 @@ class Today : public TodayBase { private slots: void startConfig(); void startAddressbook(); + void startApplication(); void editCard(); void refresh(); @@ -64,9 +65,8 @@ private slots: QStringList m_excludeApplets; QStringList m_allApplets; - // QString m_autoStartTimer; int m_newStart; - // int m_autoStart; + int m_iconSize; int m_maxCharClip; }; diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 3fc5830..097965b 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -29,6 +29,7 @@ #include #include #include +#include class ToolButton : public QToolButton { @@ -81,11 +82,19 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); QHBox *hbox_inactive = new QHBox( tab_3 ); - TimeLabel = new QLabel( hbox_inactive , "TimeLabel" ); + TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); TimeLabel->setText( tr( "minutes inactive" ) ); SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); + QHBox *hbox_iconSize = new QHBox( tab_3 ); + QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); + iconSizeLabel->setText( tr( "Icon size" ) ); + // iconSizeLabel->setToolTip( tr( "Set the icon size in pixel" ) ); + SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); + SpinBoxIconSize->setMaxValue( 32 ); + tab3Layout->addWidget( hbox_auto ); tab3Layout->addWidget( hbox_inactive ); + tab3Layout->addWidget( hbox_iconSize ); TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); m_applets_changed = false; @@ -108,7 +117,7 @@ void TodayConfig::setAutoStart() { QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); e << QString( "add" ); e << QString( "today" ); - e << QString("%1").arg( m_autoStartTimer ); + e << QString( "%1" ).arg( m_autoStartTimer ); } else { QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); e << QString( "remove" ); @@ -127,6 +136,10 @@ void TodayConfig::readConfig() { m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); SpinBoxTime->setValue( m_autoStartTimer ); + cfg.setGroup( "General" ); + m_iconSize = cfg.readNumEntry( "IconSize", 18 ); + SpinBoxIconSize->setValue( m_iconSize ); + cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); } @@ -168,6 +181,11 @@ void TodayConfig::writeConfig() { 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 ); + // set autostart settings setAutoStart(); diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h index f23b850..aa227dd 100644 --- a/core/pim/today/todayconfig.h +++ b/core/pim/today/todayconfig.h @@ -55,6 +55,7 @@ private: int m_autoStart; int m_autoStartTimer; + int m_iconSize; QStringList m_excludeApplets; bool m_applets_changed; @@ -66,6 +67,7 @@ private: QSpinBox* SpinBox7; QLabel* TimeLabel; QSpinBox* SpinBoxTime; + QSpinBox* SpinBoxIconSize; }; #endif -- cgit v0.9.0.2