summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/extensionmanager.cpp54
-rw-r--r--kaddressbook/extensionmanager.h3
2 files changed, 30 insertions, 27 deletions
diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp
index 9114cdc..98561dc 100644
--- a/kaddressbook/extensionmanager.cpp
+++ b/kaddressbook/extensionmanager.cpp
@@ -28,7 +28,7 @@
28#include <klocale.h> 28#include <klocale.h>
29 29
30#ifndef KAB_EMBEDDED 30#ifndef KAB_EMBEDDED
31#include <ktrader.h> 31#include <ktrader.h>
32#else //KAB_EMBEDDED 32#else //KAB_EMBEDDED
33#include <features/mergewidget.h> 33#include <features/mergewidget.h>
34#include <features/distributionlistwidget.h> 34#include <features/distributionlistwidget.h>
@@ -55,5 +55,5 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent,
55 55
56 mActionExtensions->plug( settingsmenu ); 56 mActionExtensions->plug( settingsmenu );
57 57
58 connect( mActionExtensions, SIGNAL( activated( int ) ), 58 connect( mActionExtensions, SIGNAL( activated( int ) ),
59 SLOT( setActiveExtension( int ) ) ); 59 SLOT( setActiveExtension( int ) ) );
@@ -75,8 +75,8 @@ void ExtensionManager::restoreSettings()
75 mCurrentExtensionWidget = mExtensionWidgetList.at( i-1 ); 75 mCurrentExtensionWidget = mExtensionWidgetList.at( i-1 );
76 while ( mCurrentExtensionWidget ) { 76 while ( mCurrentExtensionWidget ) {
77 if( i != KABPrefs::instance()->mCurrentExtension ) 77 if( i != KABPrefs::instance()->mCurrentExtension )
78 mCurrentExtensionWidget->hide(); 78 mCurrentExtensionWidget->hide();
79 mCurrentExtensionWidget = mExtensionWidgetList.at( ++i-1 ); 79 mCurrentExtensionWidget = mExtensionWidgetList.at( ++i-1 );
80 80
81 } 81 }
82 setActiveExtension( mActionExtensions->currentItem() ); 82 setActiveExtension( mActionExtensions->currentItem() );
@@ -92,5 +92,5 @@ void ExtensionManager::reconfigure()
92 saveSettings(); 92 saveSettings();
93 createExtensionWidgets(); 93 createExtensionWidgets();
94 restoreSettings(); 94 restoreSettings();
95} 95}
96 96
@@ -113,8 +113,8 @@ void ExtensionManager::setActiveExtension( int id )
113 hide(); 113 hide();
114 mCurrentExtensionWidget = 0; 114 mCurrentExtensionWidget = 0;
115#ifndef DESKTOP_VERSION 115#ifndef DESKTOP_VERSION
116//US our screen is so small, that we better hide the detailscreen, just in case. 116//US our screen is so small, that we better hide the detailscreen, just in case.
117 mCore->setDetailsToState( ); 117//US mCore->setDetailsToState( );
118#endif //KAB_EMBEDDED 118#endif //KAB_EMBEDDED
119 } else if ( id > 0 ) { 119 } else if ( id > 0 ) {
120 if ( mCurrentExtensionWidget ) 120 if ( mCurrentExtensionWidget )
@@ -122,11 +122,11 @@ void ExtensionManager::setActiveExtension( int id )
122 122
123 mCurrentExtensionWidget = mExtensionWidgetList.at( id - 1 ); 123 mCurrentExtensionWidget = mExtensionWidgetList.at( id - 1 );
124 124
125 if ( mCurrentExtensionWidget ) { 125 if ( mCurrentExtensionWidget ) {
126#ifndef DESKTOP_VERSION 126#ifndef DESKTOP_VERSION
127//US our screen is so small, that we better hide the detailscreen, just in case. 127//US our screen is so small, that we better hide the detailscreen, just in case.
128 mCore->setDetailsVisible( false ); 128//US mCore->setDetailsVisible( false );
129#endif //KAB_EMBEDDED 129#endif //KAB_EMBEDDED
130 show(); 130 show();
131 mWidgetBox->show(); 131 mWidgetBox->show();
132 mCurrentExtensionWidget->show(); 132 mCurrentExtensionWidget->show();
@@ -134,10 +134,12 @@ void ExtensionManager::setActiveExtension( int id )
134 hide(); 134 hide();
135 mCurrentExtensionWidget = 0; 135 mCurrentExtensionWidget = 0;
136#ifndef DESKTOP_VERSION 136#ifndef DESKTOP_VERSION
137//US our screen is so small, that we better hide the detailscreen, just in case. 137//US our screen is so small, that we better hide the detailscreen, just in case.
138 mCore->setDetailsToState( ); 138//US mCore->setDetailsToState( );
139#endif //KAB_EMBEDDED 139#endif //KAB_EMBEDDED
140 } 140 }
141 } 141 }
142
143 emit changedActiveExtension( id );
142} 144}
143 145
@@ -170,5 +172,5 @@ void ExtensionManager::createExtensionWidgets()
170 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 172 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
171 173
172#ifndef KAB_EMBEDDED 174#ifndef KAB_EMBEDDED
173 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); 175 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" );
174 KTrader::OfferList::ConstIterator it; 176 KTrader::OfferList::ConstIterator it;
@@ -217,5 +219,5 @@ void ExtensionManager::createExtensionWidgets()
217 } 219 }
218 } 220 }
219 221
220 //load DistributionListfactory/extension 222 //load DistributionListfactory/extension
221 extensionFactory = new DistributionListFactory(); 223 extensionFactory = new DistributionListFactory();
@@ -232,15 +234,15 @@ void ExtensionManager::createExtensionWidgets()
232 } 234 }
233 } 235 }
234 236
235 hbl->addStretch(); 237 hbl->addStretch();
236 238
237#endif //KAB_EMBEDDED 239#endif //KAB_EMBEDDED
238 240
239 241
240 mActionExtensions->setItems( extensionNames ); 242 mActionExtensions->setItems( extensionNames );
241 mCurrentExtensionWidget = 0; 243 mCurrentExtensionWidget = 0;
242} 244}
243 245
244#ifndef KAB_EMBEDDED 246#ifndef KAB_EMBEDDED
245#include "extensionmanager.moc" 247#include "extensionmanager.moc"
246#endif //KAB_EMBEDDED 248#endif //KAB_EMBEDDED
diff --git a/kaddressbook/extensionmanager.h b/kaddressbook/extensionmanager.h
index 8f64a50..611a037 100644
--- a/kaddressbook/extensionmanager.h
+++ b/kaddressbook/extensionmanager.h
@@ -69,4 +69,5 @@ class ExtensionManager : public QScrollView
69 signals: 69 signals:
70 void modified( const KABC::Addressee::List& ); 70 void modified( const KABC::Addressee::List& );
71 void changedActiveExtension( int id );
71 72
72 private slots: 73 private slots:
@@ -83,5 +84,5 @@ class ExtensionManager : public QScrollView
83 84
84 KSelectAction *mActionExtensions; 85 KSelectAction *mActionExtensions;
85 86
86}; 87};
87 88