summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp42
1 files changed, 18 insertions, 24 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 8d08713..b06e1bc 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -63,6 +63,7 @@
#include "printing/printingwizard.h"
#else // KAB_EMBEDDED
+#include <kapplication.h>
#include "KDGanttMinimizeSplitter.h"
#include "kaddressbookmain.h"
#include "kactioncollection.h"
@@ -198,7 +199,8 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
mAddressBookService = new KAddressBookService( this );
#endif //KAB_EMBEDDED
-
+ mEditorDialog = 0;
+ createAddresseeEditorDialog( this );
setModified( false );
}
@@ -790,13 +792,13 @@ void KABCore::newContact()
if ( resource ) {
KABC::Addressee addr;
addr.setResource( resource );
- dialog = createAddresseeEditorDialog( this );
- dialog->setAddressee( addr );
+ mEditorDialog->setAddressee( addr );
+ KApplication::execDialog ( mEditorDialog );
} else
return;
- mEditorDict.insert( dialog->addressee().uid(), dialog );
+ // mEditorDict.insert( dialog->addressee().uid(), dialog );
dialog->show();
@@ -867,17 +869,8 @@ void KABCore::editContact( const QString &uid )
KABC::Addressee addr = mAddressBook->findByUid( localUID );
if ( !addr.isEmpty() ) {
- AddresseeEditorDialog *dialog = mEditorDict.find( addr.uid() );
- if ( !dialog ) {
- dialog = createAddresseeEditorDialog( this );
-
- mEditorDict.insert( addr.uid(), dialog );
-
- dialog->setAddressee( addr );
- }
-
- dialog->raise();
- dialog->show();
+ mEditorDialog->setAddressee( addr );
+ KApplication::execDialog ( mEditorDialog );
}
}
@@ -1088,24 +1081,25 @@ void KABCore::addressBookChanged()
AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
const char *name )
{
- AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, parent,
+
+ if ( mEditorDialog == 0 ) {
+ mEditorDialog = new AddresseeEditorDialog( this, parent,
name ? name : "editorDialog" );
-//US
- dialog->setMaximumSize( 640, 480 );
- dialog->showMaximized();
- connect( dialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
+ connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
SLOT( contactModified( const KABC::Addressee& ) ) );
- connect( dialog, SIGNAL( editorDestroyed( const QString& ) ),
- SLOT( slotEditorDestroyed( const QString& ) ) );
+ //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
+ // SLOT( slotEditorDestroyed( const QString& ) ) );
+ }
- return dialog;
+ return mEditorDialog;
}
void KABCore::slotEditorDestroyed( const QString &uid )
{
- mEditorDict.remove( uid );
+ qDebug("KABCore::slotEditorDestroyed called. maybe a problem! ");
+ //mEditorDict.remove( uid );
}
void KABCore::initGUI()