author | harlekin <harlekin> | 2002-10-05 20:46:18 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-05 20:46:18 (UTC) |
commit | d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2 (patch) (side-by-side diff) | |
tree | 3afa0409bea98ca92ebfa269485f0845b3c96b6a | |
parent | ab196dbed05f9e534709a9c0b7f44eca65a72929 (diff) | |
download | opie-d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2.zip opie-d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2.tar.gz opie-d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2.tar.bz2 |
buttons resizable and clickable again
-rw-r--r-- | core/pim/today/changelog | 4 | ||||
-rw-r--r-- | core/pim/today/opie-today.control | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.cpp | 6 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 14 | ||||
-rw-r--r-- | core/pim/today/today.h | 6 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 22 | ||||
-rw-r--r-- | core/pim/today/todayconfig.h | 2 |
10 files changed, 49 insertions, 17 deletions
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,8 +1,12 @@ +0.5.1 + +* icons scalable and clickable again + 0.5 * now fully plugin based 0.3.4 * "fill our business card now a clickable label" * Several bugfixes regarding todo section. 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 @@ -1,14 +1,14 @@ Files: bin/today apps/1Pim/today.desktop pics/today/* Priority: optional Section: opie/applications Maintainer: Maximilian Reiß <harlekin@handhelds.org> 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 This today screen app gives an overview of appointments and todos. It also shows incoming and outgoing mails from opiemail. When using Opie (opie.handhelds.org) today can be autostarted on resume. 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 @@ -25,17 +25,17 @@ DatebookPlugin::DatebookPlugin() { } DatebookPlugin::~DatebookPlugin() { } QString DatebookPlugin::pluginName() const { - return "Datebook plugin"; + return QObject::tr( "Datebook plugin"); } double DatebookPlugin::versionNumber() const { return 1.0; } QString DatebookPlugin::pixmapNameWidget() const { return "DateBook"; @@ -49,11 +49,11 @@ QString DatebookPlugin::pixmapNameConfig() const { return "DateBook"; } TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { return new DatebookPluginConfig( wid , "Datebook" ); } 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 @@ -21,21 +21,21 @@ MailPlugin::MailPlugin() { } 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 { return "mail/desktopicon"; } QWidget* MailPlugin::widget( QWidget * wid ) { return new MailPluginWidget( wid, "Mail" ); @@ -45,12 +45,12 @@ QString MailPlugin::pixmapNameConfig() const { return 0l; } TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { return 0l; } 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 @@ -23,17 +23,17 @@ TodolistPlugin::TodolistPlugin() { } TodolistPlugin::~TodolistPlugin() { } QString TodolistPlugin::pluginName() const { - return "Todolist plugin"; + return QObject::tr( "Todolist plugin" ); } double TodolistPlugin::versionNumber() const { return 0.7; } QString TodolistPlugin::pixmapNameWidget() const { return "TodoList"; @@ -47,12 +47,12 @@ QString TodolistPlugin::pixmapNameConfig() const { return "TodoList"; } TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { return new TodolistPluginConfig( wid , "Todolist" ); } 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 @@ -25,17 +25,17 @@ #include <qpe/config.h> #include <qpe/timestring.h> #include <qpe/qcopenvelope_qws.h> TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) : QWidget( parent, name ) { - todoLabel= 0l; + todoLabel = 0l; todo = 0l; if ( todo ) { delete todo; } todo = new ToDoDB(); readConfig(); 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 @@ -109,16 +109,18 @@ void Today::setOwnerField( QString &message ) { */ 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 ); } /** * Load the plugins */ void Today::loadPlugins() { @@ -130,17 +132,16 @@ void Today::loadPlugins() { pluginList.clear(); QString path = QPEApplication::qpeDir() + "/plugins/today"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); QStringList::Iterator it; - QMap<QString, TodayPlugin> tempList; for ( it = list.begin(); it != list.end(); ++it ) { TodayPluginInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { @@ -158,19 +159,21 @@ void Today::loadPlugins() { plugin.active = false; } plugin.guiPart = plugin.iface->guiPart(); // package the whole thing into a qwidget so it can be shown and hidden 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() ); // not sure if that is good .-) sv->setMinimumHeight( 10 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setHScrollBarMode( QScrollView::AlwaysOff ); sv->setFrameShape( QFrame::NoFrame ); @@ -246,17 +249,17 @@ void Today::draw() { /** * The method for the configuration dialog. */ void Today::startConfig() { TodayConfig conf( this, "dialog", true ); - TodayPlugin plugin; + TodayPlugin plugin; QList<TodayConfigWidget> configWidgetList; 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 ); @@ -306,16 +309,21 @@ void Today::refresh() { } void Today::startAddressbook() { QCopEnvelope e( "QPE/System", "execute(QString)" ); e << QString( "addressbook" ); } +void Today::startApplication() { + QCopEnvelope e( "QPE/System", "execute(QString)" ); + e << QString( sender()->name() ); +} + /** * launch addressbook (personal card) */ void Today::editCard() { startAddressbook(); while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { qApp->processEvents(); } 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 @@ -27,30 +27,31 @@ #include <qpe/qlibrary.h> #include <qpe/event.h> #include "todayconfig.h" #include "todaybase.h" #include <opie/todayplugininterface.h> class QVBoxLayout; - +class OClickableLabel; class Today : public TodayBase { Q_OBJECT public: Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~Today(); private slots: void startConfig(); void startAddressbook(); + void startApplication(); void editCard(); void refresh(); private: void init(); void setOwnerField(); void setOwnerField(QString &string); void loadPlugins(); @@ -59,15 +60,14 @@ private: private slots: void channelReceived(const QCString &msg, const QByteArray & data); private: TodayConfig *conf; QStringList m_excludeApplets; QStringList m_allApplets; - // QString m_autoStartTimer; int m_newStart; - // int m_autoStart; + int m_iconSize; int m_maxCharClip; }; #endif 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 @@ -24,16 +24,17 @@ #include <qlabel.h> #include <qspinbox.h> #include <qtabwidget.h> #include <qlayout.h> #include <qheader.h> #include <qhbox.h> #include <qvbox.h> #include <qtoolbutton.h> +#include <qtooltip.h> class ToolButton : public QToolButton { public: ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) : QToolButton( parent, name ) { setPixmap( Resource::loadPixmap( icon ) ); setAutoRaise( TRUE ); @@ -76,21 +77,29 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags 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)" ) ); 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; connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); readConfig(); showMaximized(); @@ -103,17 +112,17 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags */ void TodayConfig::setAutoStart() { Config cfg( "today" ); cfg.setGroup( "Autostart" ); if ( m_autoStart ) { 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" ); e << QString( "today" ); } } /** @@ -122,16 +131,20 @@ 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 ); + cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); } /** * Write the config part */ void TodayConfig::writeConfig() { @@ -163,16 +176,21 @@ 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 ); + // set autostart settings setAutoStart(); } void TodayConfig::moveSelectedUp() { QListViewItem *item = m_appletListView->selectedItem(); 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 @@ -50,22 +50,24 @@ private: void setAutoStart(); 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; QWidget* tab_2; QWidget* tab_3; QLabel* TextLabel1; QSpinBox* SpinBox7; QLabel* TimeLabel; QSpinBox* SpinBoxTime; + QSpinBox* SpinBoxIconSize; }; #endif |