-rw-r--r-- | core/pim/today/today.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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 @@ -111,12 +111,14 @@ 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 */ @@ -132,13 +134,12 @@ void Today::loadPlugins() { 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 ); @@ -160,15 +161,17 @@ void Today::loadPlugins() { 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 ); @@ -308,12 +311,17 @@ 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" ) ) { |