-rw-r--r-- | core/pim/today/today.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index d8b427d..901a61a 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -12,49 +12,49 @@ | |||
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | 17 | ||
18 | #include "today.h" | 18 | #include "today.h" |
19 | #include "configwidget.h" | 19 | #include "configwidget.h" |
20 | 20 | ||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/contact.h> | 26 | #include <qpe/contact.h> |
27 | 27 | ||
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qlabel.h> | 31 | #include <qlabel.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qpixmap.h> | 33 | #include <qpixmap.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <qtabwidget.h> | 36 | #include <opie/otabwidget.h> |
37 | #include <qdialog.h> | 37 | #include <qdialog.h> |
38 | 38 | ||
39 | 39 | ||
40 | struct TodayPlugin { | 40 | struct TodayPlugin { |
41 | QLibrary *library; | 41 | QLibrary *library; |
42 | TodayPluginInterface *iface; | 42 | TodayPluginInterface *iface; |
43 | TodayPluginObject *guiPart; | 43 | TodayPluginObject *guiPart; |
44 | QWidget *guiBox; | 44 | QWidget *guiBox; |
45 | QString name; | 45 | QString name; |
46 | bool active; | 46 | bool active; |
47 | int pos; | 47 | int pos; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static QValueList<TodayPlugin> pluginList; | 50 | static QValueList<TodayPlugin> pluginList; |
51 | 51 | ||
52 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 52 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
53 | : TodayBase( parent, name, fl ) { | 53 | : TodayBase( parent, name, fl ) { |
54 | 54 | ||
55 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); | 55 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); |
56 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); | 56 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); |
57 | 57 | ||
58 | #if defined(Q_WS_QWS) | 58 | #if defined(Q_WS_QWS) |
59 | #if !defined(QT_NO_COP) | 59 | #if !defined(QT_NO_COP) |
60 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); | 60 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); |
@@ -239,49 +239,50 @@ void Today::draw() { | |||
239 | noPluginsActive->setText( tr( "No plugins activated" ) ); | 239 | noPluginsActive->setText( tr( "No plugins activated" ) ); |
240 | layout->addWidget( noPluginsActive ); | 240 | layout->addWidget( noPluginsActive ); |
241 | } | 241 | } |
242 | layout->addStretch(0); | 242 | layout->addStretch(0); |
243 | } | 243 | } |
244 | 244 | ||
245 | 245 | ||
246 | /** | 246 | /** |
247 | * The method for the configuration dialog. | 247 | * The method for the configuration dialog. |
248 | */ | 248 | */ |
249 | void Today::startConfig() { | 249 | void Today::startConfig() { |
250 | 250 | ||
251 | TodayConfig conf( this, "dialog", true ); | 251 | TodayConfig conf( this, "dialog", true ); |
252 | 252 | ||
253 | TodayPlugin plugin; | 253 | TodayPlugin plugin; |
254 | QList<ConfigWidget> configWidgetList; | 254 | QList<ConfigWidget> configWidgetList; |
255 | 255 | ||
256 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { | 256 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { |
257 | plugin = pluginList[i]; | 257 | plugin = pluginList[i]; |
258 | 258 | ||
259 | // load the config widgets in the tabs | 259 | // load the config widgets in the tabs |
260 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 260 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
261 | ConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); | 261 | ConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); |
262 | configWidgetList.append( widget ); | 262 | configWidgetList.append( widget ); |
263 | conf.TabWidget3->insertTab( widget, plugin.guiPart->appName() ); | 263 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() |
264 | , plugin.guiPart->appName() ); | ||
264 | } | 265 | } |
265 | // set the order/activate tab | 266 | // set the order/activate tab |
266 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), | 267 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), |
267 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); | 268 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); |
268 | } | 269 | } |
269 | 270 | ||
270 | if ( conf.exec() == QDialog::Accepted ) { | 271 | if ( conf.exec() == QDialog::Accepted ) { |
271 | conf.writeConfig(); | 272 | conf.writeConfig(); |
272 | ConfigWidget *confWidget; | 273 | ConfigWidget *confWidget; |
273 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 274 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
274 | confWidget = configWidgetList.next() ) { | 275 | confWidget = configWidgetList.next() ) { |
275 | confWidget->writeConfig(); | 276 | confWidget->writeConfig(); |
276 | } | 277 | } |
277 | refresh(); | 278 | refresh(); |
278 | } | 279 | } |
279 | } | 280 | } |
280 | 281 | ||
281 | 282 | ||
282 | /** | 283 | /** |
283 | * Refresh for the view. Reload all applets | 284 | * Refresh for the view. Reload all applets |
284 | * | 285 | * |
285 | */ | 286 | */ |
286 | void Today::refresh() { | 287 | void Today::refresh() { |
287 | init(); | 288 | init(); |