summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditordialog.cpp34
-rw-r--r--kaddressbook/addresseeeditordialog.h1
-rw-r--r--kaddressbook/kabcore.cpp44
-rw-r--r--kaddressbook/kabcore.h4
4 files changed, 35 insertions, 48 deletions
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp
index 102138e..790f148 100644
--- a/kaddressbook/addresseeeditordialog.cpp
+++ b/kaddressbook/addresseeeditordialog.cpp
@@ -24,2 +24,3 @@
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qapplication.h>
25 26
@@ -38,9 +39,5 @@ AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent,
38 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, 39 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply,
39 KDialogBase::Ok, parent, name, false ) 40 KDialogBase::Ok, parent, name, true )
40{ 41{
41#ifdef KAB_EMBEDDED
42 resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300));
43#endif //KAB_EMBEDDED
44 42
45 kdDebug(5720) << "AddresseeEditorDialog()" << endl;
46 43
@@ -56,2 +53,5 @@ AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent,
56 enableButton( KDialogBase::Apply, false ); 53 enableButton( KDialogBase::Apply, false );
54 if ( QApplication::desktop()->width() < 480 ) {
55 hideButtons();
56 }
57} 57}
@@ -60,5 +60,4 @@ AddresseeEditorDialog::~AddresseeEditorDialog()
60{ 60{
61 kdDebug(5720) << "~AddresseeEditorDialog()" << endl; 61 qDebug("----------------------------------------------- ");
62 62 //emit editorDestroyed( mEditorWidget->addressee().uid() );
63 emit editorDestroyed( mEditorWidget->addressee().uid() );
64} 63}
@@ -94,2 +93,7 @@ void AddresseeEditorDialog::slotApply()
94 93
94void AddresseeEditorDialog:: accept ()
95{
96 slotOk();
97
98}
95void AddresseeEditorDialog::slotOk() 99void AddresseeEditorDialog::slotOk()
@@ -100,8 +104,2 @@ void AddresseeEditorDialog::slotOk()
100 104
101 // Destroy this dialog
102#ifndef KAB_EMBEDDED
103 delayedDestruct();
104#else //KAB_EMBEDDED
105 delete this;
106#endif //KAB_EMBEDDED
107} 105}
@@ -117,9 +115,3 @@ void AddresseeEditorDialog::slotCancel()
117 115
118 // Destroy this dialog 116
119#ifndef KAB_EMBEDDED
120 delayedDestruct();
121#else //KAB_EMBEDDED
122 delete this;
123#endif //KAB_EMBEDDED
124
125} 117}
diff --git a/kaddressbook/addresseeeditordialog.h b/kaddressbook/addresseeeditordialog.h
index 1a00d3a..a1521e2 100644
--- a/kaddressbook/addresseeeditordialog.h
+++ b/kaddressbook/addresseeeditordialog.h
@@ -55,2 +55,3 @@ class AddresseeEditorDialog : public KDialogBase
55 virtual void slotCancel(); 55 virtual void slotCancel();
56 virtual void accept () ;
56 void widgetModified(); 57 void widgetModified();
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 8d08713..b06e1bc 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -65,2 +65,3 @@
65 65
66#include <kapplication.h>
66#include "KDGanttMinimizeSplitter.h" 67#include "KDGanttMinimizeSplitter.h"
@@ -200,3 +201,4 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
200#endif //KAB_EMBEDDED 201#endif //KAB_EMBEDDED
201 202 mEditorDialog = 0;
203 createAddresseeEditorDialog( this );
202 setModified( false ); 204 setModified( false );
@@ -792,4 +794,4 @@ void KABCore::newContact()
792 addr.setResource( resource ); 794 addr.setResource( resource );
793 dialog = createAddresseeEditorDialog( this ); 795 mEditorDialog->setAddressee( addr );
794 dialog->setAddressee( addr ); 796 KApplication::execDialog ( mEditorDialog );
795 797
@@ -798,3 +800,3 @@ void KABCore::newContact()
798 800
799 mEditorDict.insert( dialog->addressee().uid(), dialog ); 801 // mEditorDict.insert( dialog->addressee().uid(), dialog );
800 802
@@ -869,13 +871,4 @@ void KABCore::editContact( const QString &uid )
869 if ( !addr.isEmpty() ) { 871 if ( !addr.isEmpty() ) {
870 AddresseeEditorDialog *dialog = mEditorDict.find( addr.uid() ); 872 mEditorDialog->setAddressee( addr );
871 if ( !dialog ) { 873 KApplication::execDialog ( mEditorDialog );
872 dialog = createAddresseeEditorDialog( this );
873
874 mEditorDict.insert( addr.uid(), dialog );
875
876 dialog->setAddressee( addr );
877 }
878
879 dialog->raise();
880 dialog->show();
881 } 874 }
@@ -1090,15 +1083,15 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1090{ 1083{
1091 AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, parent, 1084
1085 if ( mEditorDialog == 0 ) {
1086 mEditorDialog = new AddresseeEditorDialog( this, parent,
1092 name ? name : "editorDialog" ); 1087 name ? name : "editorDialog" );
1093 1088
1094//US 1089
1095 dialog->setMaximumSize( 640, 480 ); 1090 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1096 dialog->showMaximized();
1097
1098 connect( dialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1099 SLOT( contactModified( const KABC::Addressee& ) ) ); 1091 SLOT( contactModified( const KABC::Addressee& ) ) );
1100 connect( dialog, SIGNAL( editorDestroyed( const QString& ) ), 1092 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1101 SLOT( slotEditorDestroyed( const QString& ) ) ); 1093 // SLOT( slotEditorDestroyed( const QString& ) ) );
1094 }
1102 1095
1103 return dialog; 1096 return mEditorDialog;
1104} 1097}
@@ -1107,3 +1100,4 @@ void KABCore::slotEditorDestroyed( const QString &uid )
1107{ 1100{
1108 mEditorDict.remove( uid ); 1101 qDebug("KABCore::slotEditorDestroyed called. maybe a problem! ");
1102 //mEditorDict.remove( uid );
1109} 1103}
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index b84ec22..c823f1f 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -361,4 +361,4 @@ class KABCore : public QWidget
361#endif //KAB_EMBEDDED 361#endif //KAB_EMBEDDED
362 QDict<AddresseeEditorDialog> mEditorDict; 362 // QDict<AddresseeEditorDialog> mEditorDict;
363 363 AddresseeEditorDialog *mEditorDialog;
364 bool mReadWrite; 364 bool mReadWrite;