author | harlekin <harlekin> | 2003-02-11 21:26:39 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-02-11 21:26:39 (UTC) |
commit | 39f9441dabcb094be258240f7ec3c53ed038133e (patch) (unidiff) | |
tree | 7d6e7f49ce18c6c3723cbc59358c58a252011133 /core | |
parent | af398bd4c280e7c27754b409851fbe8189d08819 (diff) | |
download | opie-39f9441dabcb094be258240f7ec3c53ed038133e.zip opie-39f9441dabcb094be258240f7ec3c53ed038133e.tar.gz opie-39f9441dabcb094be258240f7ec3c53ed038133e.tar.bz2 |
now when coming back from the config dialog ALL plugins get restarted
-rw-r--r-- | core/pim/today/today.cpp | 35 | ||||
-rw-r--r-- | core/pim/today/today.h | 2 |
2 files changed, 6 insertions, 31 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 1f758f2..2f6907d 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -2,5 +2,5 @@ | |||
2 | * today.cpp | 2 | * today.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
@@ -71,5 +71,5 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
71 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 71 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
72 | m_refreshTimer->start( 15000 ); | 72 | m_refreshTimer->start( 15000 ); |
73 | init(); | 73 | //init(); |
74 | loadPlugins(); | 74 | loadPlugins(); |
75 | showMaximized(); | 75 | showMaximized(); |
@@ -123,5 +123,4 @@ void Today::setOwnerField( QString &message ) { | |||
123 | } | 123 | } |
124 | 124 | ||
125 | |||
126 | /** | 125 | /** |
127 | * Init stuff needed for today. Reads the config file. | 126 | * Init stuff needed for today. Reads the config file. |
@@ -139,10 +138,7 @@ void Today::init() { | |||
139 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); | 138 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
140 | 139 | ||
141 | |||
142 | // qDebug(" refresh "); | ||
143 | // set the date in top label | 140 | // set the date in top label |
144 | QDate date = QDate::currentDate(); | 141 | QDate date = QDate::currentDate(); |
145 | QString time = ( tr( date.toString() ) ); | 142 | QString time = ( tr( date.toString() ) ); |
146 | |||
147 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); | 143 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); |
148 | 144 | ||
@@ -155,5 +151,4 @@ void Today::init() { | |||
155 | } | 151 | } |
156 | 152 | ||
157 | |||
158 | /** | 153 | /** |
159 | * Load the plugins | 154 | * Load the plugins |
@@ -161,14 +156,8 @@ void Today::init() { | |||
161 | void Today::loadPlugins() { | 156 | void Today::loadPlugins() { |
162 | 157 | ||
163 | // extra list for plugins that exclude themself from periodic refresh | 158 | init(); |
164 | QMap<QString, TodayPlugin> pluginListRefreshExclude; | ||
165 | |||
166 | QValueList<TodayPlugin>::Iterator tit; | 159 | QValueList<TodayPlugin>::Iterator tit; |
167 | if ( !pluginList.isEmpty() ) { | 160 | if ( !pluginList.isEmpty() ) { |
168 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { | 161 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { |
169 | if ( (*tit).excludeRefresh ) { | ||
170 | pluginListRefreshExclude.insert( (*tit).name , (*tit) ); | ||
171 | qDebug( "Found a plugin that does not want refresh feature" ); | ||
172 | } else { | ||
173 | (*tit).guiBox->hide(); | 162 | (*tit).guiBox->hide(); |
174 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); | 163 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); |
@@ -177,5 +166,4 @@ void Today::loadPlugins() { | |||
177 | delete (*tit).library; | 166 | delete (*tit).library; |
178 | } | 167 | } |
179 | } | ||
180 | pluginList.clear(); | 168 | pluginList.clear(); |
181 | } | 169 | } |
@@ -190,5 +178,4 @@ void Today::loadPlugins() { | |||
190 | 178 | ||
191 | for ( it = list.begin(); it != list.end(); ++it ) { | 179 | for ( it = list.begin(); it != list.end(); ++it ) { |
192 | //TodayPluginInterface *iface = 0; | ||
193 | QInterfacePtr<TodayPluginInterface> iface; | 180 | QInterfacePtr<TodayPluginInterface> iface; |
194 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 181 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
@@ -199,16 +186,4 @@ void Today::loadPlugins() { | |||
199 | qDebug( QString(*it) ); | 186 | qDebug( QString(*it) ); |
200 | 187 | ||
201 | // If plugin is exludes from refresh, get it in the list again here. | ||
202 | |||
203 | if ( pluginListRefreshExclude.contains( (*it) ) ) { | ||
204 | // if its not in allApplets list, add it to a layout | ||
205 | if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { | ||
206 | layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); | ||
207 | pluginList.append( pluginListRefreshExclude[(*it)] ); | ||
208 | } else { | ||
209 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); | ||
210 | } | ||
211 | } else { | ||
212 | |||
213 | TodayPlugin plugin; | 188 | TodayPlugin plugin; |
214 | plugin.library = lib; | 189 | plugin.library = lib; |
@@ -240,5 +215,5 @@ void Today::loadPlugins() { | |||
240 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); | 215 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); |
241 | // not sure if that is good .-) | 216 | // not sure if that is good .-) |
242 | sv->setMinimumHeight( 10 ); | 217 | sv->setMinimumHeight( 12 ); |
243 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 218 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
244 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 219 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
@@ -264,5 +239,4 @@ void Today::loadPlugins() { | |||
264 | pluginList.append( plugin ); | 239 | pluginList.append( plugin ); |
265 | } | 240 | } |
266 | } | ||
267 | } else { | 241 | } else { |
268 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 242 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); |
@@ -371,4 +345,5 @@ void Today::startConfig() { | |||
371 | */ | 345 | */ |
372 | void Today::refresh() { | 346 | void Today::refresh() { |
347 | |||
373 | init(); | 348 | init(); |
374 | 349 | ||
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 35b7ee3..24f5611 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -2,5 +2,5 @@ | |||
2 | * today.h | 2 | * today.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |