summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
Unidiff
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/today.cpp12
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() {
111 // read config 111 // read config
112 Config cfg( "today" ); 112 Config cfg( "today" );
113 cfg.setGroup( "Plugins" ); 113 cfg.setGroup( "Plugins" );
114 114
115 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 115 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
116 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 116 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
117 cfg.setGroup( "General" );
118 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
117} 119}
118 120
119 121
120/** 122/**
121 * Load the plugins 123 * Load the plugins
122 */ 124 */
@@ -132,13 +134,12 @@ void Today::loadPlugins() {
132 QString path = QPEApplication::qpeDir() + "/plugins/today"; 134 QString path = QPEApplication::qpeDir() + "/plugins/today";
133 QDir dir( path, "lib*.so" ); 135 QDir dir( path, "lib*.so" );
134 136
135 QStringList list = dir.entryList(); 137 QStringList list = dir.entryList();
136 QStringList::Iterator it; 138 QStringList::Iterator it;
137 139
138
139 QMap<QString, TodayPlugin> tempList; 140 QMap<QString, TodayPlugin> tempList;
140 141
141 for ( it = list.begin(); it != list.end(); ++it ) { 142 for ( it = list.begin(); it != list.end(); ++it ) {
142 TodayPluginInterface *iface = 0; 143 TodayPluginInterface *iface = 0;
143 QLibrary *lib = new QLibrary( path + "/" + *it ); 144 QLibrary *lib = new QLibrary( path + "/" + *it );
144 145
@@ -160,15 +161,17 @@ void Today::loadPlugins() {
160 plugin.guiPart = plugin.iface->guiPart(); 161 plugin.guiPart = plugin.iface->guiPart();
161 162
162 // package the whole thing into a qwidget so it can be shown and hidden 163 // package the whole thing into a qwidget so it can be shown and hidden
163 plugin.guiBox = new QWidget( this ); 164 plugin.guiBox = new QWidget( this );
164 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 165 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
165 QPixmap plugPix; 166 QPixmap plugPix;
166 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); 167 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
167 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 168 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
168 plugIcon->setPixmap( plugPix ); 169 plugIcon->setPixmap( plugPix );
170 plugIcon->setName( plugin.guiPart->appName() );
171 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
169 // a scrollview for each plugin 172 // a scrollview for each plugin
170 QScrollView* sv = new QScrollView( plugin.guiBox ); 173 QScrollView* sv = new QScrollView( plugin.guiBox );
171 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); 174 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
172 // not sure if that is good .-) 175 // not sure if that is good .-)
173 sv->setMinimumHeight( 10 ); 176 sv->setMinimumHeight( 10 );
174 sv->setResizePolicy( QScrollView::AutoOneFit ); 177 sv->setResizePolicy( QScrollView::AutoOneFit );
@@ -308,12 +311,17 @@ void Today::refresh() {
308void Today::startAddressbook() { 311void Today::startAddressbook() {
309 QCopEnvelope e( "QPE/System", "execute(QString)" ); 312 QCopEnvelope e( "QPE/System", "execute(QString)" );
310 e << QString( "addressbook" ); 313 e << QString( "addressbook" );
311} 314}
312 315
313 316
317void Today::startApplication() {
318 QCopEnvelope e( "QPE/System", "execute(QString)" );
319 e << QString( sender()->name() );
320}
321
314/** 322/**
315 * launch addressbook (personal card) 323 * launch addressbook (personal card)
316 */ 324 */
317void Today::editCard() { 325void Today::editCard() {
318 startAddressbook(); 326 startAddressbook();
319 while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) { 327 while( !QCopChannel::isRegistered( "QPE/Addressbook" ) ) {