summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
Unidiff
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 2f6907d..2497ee1 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -15,6 +15,9 @@
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17 17
18
19#define QTOPIA_INTERNAL_LANGLIST
20
18#include "today.h" 21#include "today.h"
19#include <opie/todayconfigwidget.h> 22#include <opie/todayconfigwidget.h>
20 23
@@ -36,7 +39,7 @@
36#include <opie/otabwidget.h> 39#include <opie/otabwidget.h>
37#include <qdialog.h> 40#include <qdialog.h>
38#include <qwhatsthis.h> 41#include <qwhatsthis.h>
39 42#include <qtranslator.h>
40 43
41struct TodayPlugin { 44struct TodayPlugin {
42 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} 45 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
@@ -161,8 +164,8 @@ void Today::loadPlugins() {
161 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 164 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
162 (*tit).guiBox->hide(); 165 (*tit).guiBox->hide();
163 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); 166 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
164 (*tit).library->unload();
165 delete (*tit).guiBox; 167 delete (*tit).guiBox;
168 (*tit).library->unload();
166 delete (*tit).library; 169 delete (*tit).library;
167 } 170 }
168 pluginList.clear(); 171 pluginList.clear();
@@ -190,6 +193,20 @@ void Today::loadPlugins() {
190 plugin.iface = iface; 193 plugin.iface = iface;
191 plugin.name = QString(*it); 194 plugin.name = QString(*it);
192 195
196 QString type = (*it).left( (*it).find(".") );
197 QStringList langs = Global::languageList();
198 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) {
199 QString lang = *lit;
200 qDebug( "Languages: " + lang );
201 QTranslator * trans = new QTranslator( qApp );
202 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
203 if ( trans->load( tfn ) ) {
204 qApp->installTranslator( trans );
205 } else {
206 delete trans;
207 }
208 }
209
193 // find out if plugins should be shown 210 // find out if plugins should be shown
194 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 211 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
195 plugin.active = true; 212 plugin.active = true;
@@ -303,6 +320,7 @@ void Today::startConfig() {
303 320
304 // disconnect timer to prevent problems while being on config dialog 321 // disconnect timer to prevent problems while being on config dialog
305 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 322 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
323 m_refreshTimer->stop( );
306 324
307 TodayConfig conf( this, "dialog", true ); 325 TodayConfig conf( this, "dialog", true );
308 326
@@ -334,7 +352,8 @@ void Today::startConfig() {
334 loadPlugins(); 352 loadPlugins();
335 } else { 353 } else {
336 // since refresh is not called in that case , reconnect the signal 354 // since refresh is not called in that case , reconnect the signal
337 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 355 m_refreshTimer->start( 15000 ); // get the config value in here later
356 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
338 } 357 }
339} 358}
340 359