summaryrefslogtreecommitdiffabout
path: root/kaddressbook/extensionmanager.cpp
Unidiff
Diffstat (limited to 'kaddressbook/extensionmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/extensionmanager.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp
index 46defa1..5356224 100644
--- a/kaddressbook/extensionmanager.cpp
+++ b/kaddressbook/extensionmanager.cpp
@@ -19,12 +19,14 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qapplication.h> 24#include <qapplication.h>
25//Added by qt3to4:
26#include <Q3HBoxLayout>
25#include <kactionclasses.h> 27#include <kactionclasses.h>
26#include <kconfig.h> 28#include <kconfig.h>
27#include <kdebug.h> 29#include <kdebug.h>
28#include <klocale.h> 30#include <klocale.h>
29 31
30#ifndef KAB_EMBEDDED 32#ifndef KAB_EMBEDDED
@@ -39,13 +41,13 @@
39#include "kabprefs.h" 41#include "kabprefs.h"
40 42
41#include "extensionmanager.h" 43#include "extensionmanager.h"
42 44
43ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, 45ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent,
44 const char *name ) 46 const char *name )
45 : QScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) 47 : Q3ScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 )
46{ 48{
47#ifdef KAB_EMBEDDED 49#ifdef KAB_EMBEDDED
48//US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 50//US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
49 QWidget *settingsmenu = (QWidget*)mCore->getViewMenu(); 51 QWidget *settingsmenu = (QWidget*)mCore->getViewMenu();
50#endif //KAB_EMBEDDED 52#endif //KAB_EMBEDDED
51 53
@@ -55,13 +57,13 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent,
55 57
56 mActionExtensions->plug( settingsmenu ,0); 58 mActionExtensions->plug( settingsmenu ,0);
57 59
58 connect( mActionExtensions, SIGNAL( activated( int ) ), 60 connect( mActionExtensions, SIGNAL( activated( int ) ),
59 SLOT( setActiveExtension( int ) ) ); 61 SLOT( setActiveExtension( int ) ) );
60 mWidgetBox = new QWidget( viewport() ); 62 mWidgetBox = new QWidget( viewport() );
61 new QHBoxLayout (mWidgetBox ); 63 new Q3HBoxLayout (mWidgetBox );
62 addChild( mWidgetBox ); 64 addChild( mWidgetBox );
63 setResizePolicy(AutoOneFit); 65 setResizePolicy(AutoOneFit);
64 createExtensionWidgets(); 66 createExtensionWidgets();
65 hide(); 67 hide();
66} 68}
67 69
@@ -145,24 +147,24 @@ void ExtensionManager::setActiveExtension( int id )
145} 147}
146 148
147void ExtensionManager::createExtensionWidgets() 149void ExtensionManager::createExtensionWidgets()
148{ 150{
149 // clear extension widget list 151 // clear extension widget list
150 mExtensionWidgetList.setAutoDelete( true ); 152 mExtensionWidgetList.setAutoDelete( true );
151 QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); 153 Q3PtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList );
152 ExtensionWidget *wdg = 0; 154 ExtensionWidget *wdg = 0;
153 while ( ( wdg = wdgIt.current() ) != 0 ) 155 while ( ( wdg = wdgIt.current() ) != 0 )
154 mExtensionWidgetList.remove( wdg ); 156 mExtensionWidgetList.remove( wdg );
155 157
156 mExtensionWidgetList.setAutoDelete( false ); 158 mExtensionWidgetList.setAutoDelete( false );
157 159
158 QStringList extensionNames( i18n( "None" ) ); 160 QStringList extensionNames( i18n( "None" ) );
159 161
160 // add addressee editor as default 162 // add addressee editor as default
161 163
162 QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; 164 Q3HBoxLayout *hbl = (Q3HBoxLayout *) mWidgetBox->layout();;
163 165
164 wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); 166 wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox );
165 hbl->addWidget( wdg ); 167 hbl->addWidget( wdg );
166 //wdg->hide(); 168 //wdg->hide();
167 connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), 169 connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ),
168 SIGNAL( modified( const KABC::Addressee::List& ) ) ); 170 SIGNAL( modified( const KABC::Addressee::List& ) ) );
@@ -241,9 +243,9 @@ void ExtensionManager::createExtensionWidgets()
241 243
242 244
243 mActionExtensions->setItems( extensionNames ); 245 mActionExtensions->setItems( extensionNames );
244 mCurrentExtensionWidget = 0; 246 mCurrentExtensionWidget = 0;
245} 247}
246 248
247#ifndef KAB_EMBEDDED 249#ifndef KAB_EMBEDDED_
248#include "extensionmanager.moc" 250#include "moc_extensionmanager.cpp"
249#endif //KAB_EMBEDDED 251#endif //KAB_EMBEDDED