summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-09-02 23:28:05 (UTC)
committer ulf69 <ulf69>2004-09-02 23:28:05 (UTC)
commit546841acf4cdfd83d576cdd2a5ddbcc94c3921f6 (patch) (unidiff)
tree8b3c70012f7c00e5585c91bd6e689ea784ed56f2
parenta2d8fcc8f1fcd64c01e41cb8ba31ae17a5ea5a8b (diff)
downloadkdepimpi-546841acf4cdfd83d576cdd2a5ddbcc94c3921f6.zip
kdepimpi-546841acf4cdfd83d576cdd2a5ddbcc94c3921f6.tar.gz
kdepimpi-546841acf4cdfd83d576cdd2a5ddbcc94c3921f6.tar.bz2
sourceforge 1014894: display contact name in Edit Contact dialog header
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditordialog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp
index 5e42640..a84fc61 100644
--- a/kaddressbook/addresseeeditordialog.cpp
+++ b/kaddressbook/addresseeeditordialog.cpp
@@ -21,96 +21,98 @@
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 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qapplication.h> 25#include <qapplication.h>
26 26
27#include <kdebug.h> 27#include <kdebug.h>
28#include <klocale.h> 28#include <klocale.h>
29#include <kglobal.h> 29#include <kglobal.h>
30 30
31#include "addresseeeditorwidget.h" 31#include "addresseeeditorwidget.h"
32#include "kabcore.h" 32#include "kabcore.h"
33 33
34#include "addresseeeditordialog.h" 34#include "addresseeeditordialog.h"
35 35
36AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, 36AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent,
37 const char *name ) 37 const char *name )
38 : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), 38 : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ),
39 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, 39 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply,
40 KDialogBase::Ok, parent, name, true ) 40 KDialogBase::Ok, parent, name, true )
41{ 41{
42 42
43 43
44 QWidget *page = plainPage(); 44 QWidget *page = plainPage();
45 45
46 QVBoxLayout *layout = new QVBoxLayout( page ); 46 QVBoxLayout *layout = new QVBoxLayout( page );
47 47
48 mEditorWidget = new AddresseeEditorWidget( core, false, page ); 48 mEditorWidget = new AddresseeEditorWidget( core, false, page );
49 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), 49 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ),
50 SLOT( widgetModified() ) ); 50 SLOT( widgetModified() ) );
51 layout->addWidget( mEditorWidget ); 51 layout->addWidget( mEditorWidget );
52 52
53 enableButton( KDialogBase::Apply, false ); 53 enableButton( KDialogBase::Apply, false );
54 if ( QApplication::desktop()->width() < 480 ) { 54 if ( QApplication::desktop()->width() < 480 ) {
55 hideButtons(); 55 hideButtons();
56 } 56 }
57} 57}
58 58
59AddresseeEditorDialog::~AddresseeEditorDialog() 59AddresseeEditorDialog::~AddresseeEditorDialog()
60{ 60{
61 //emit editorDestroyed( mEditorWidget->addressee().uid() ); 61 //emit editorDestroyed( mEditorWidget->addressee().uid() );
62} 62}
63 63
64void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) 64void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr )
65{ 65{
66 enableButton( KDialogBase::Apply, false ); 66 enableButton( KDialogBase::Apply, false );
67 67
68 mEditorWidget->setAddressee( addr ); 68 mEditorWidget->setAddressee( addr );
69
70 this->setCaption("Edit " + addr.formattedName());
69} 71}
70 72
71KABC::Addressee AddresseeEditorDialog::addressee() 73KABC::Addressee AddresseeEditorDialog::addressee()
72{ 74{
73 return mEditorWidget->addressee(); 75 return mEditorWidget->addressee();
74} 76}
75 77
76bool AddresseeEditorDialog::dirty() 78bool AddresseeEditorDialog::dirty()
77{ 79{
78 return mEditorWidget->dirty(); 80 return mEditorWidget->dirty();
79} 81}
80 82
81void AddresseeEditorDialog::slotApply() 83void AddresseeEditorDialog::slotApply()
82{ 84{
83 if ( mEditorWidget->dirty() ) { 85 if ( mEditorWidget->dirty() ) {
84 mEditorWidget->save(); 86 mEditorWidget->save();
85 emit contactModified( mEditorWidget->addressee() ); 87 emit contactModified( mEditorWidget->addressee() );
86 } 88 }
87 89
88 enableButton( KDialogBase::Apply, false ); 90 enableButton( KDialogBase::Apply, false );
89 91
90 KDialogBase::slotApply(); 92 KDialogBase::slotApply();
91} 93}
92 94
93void AddresseeEditorDialog:: accept () 95void AddresseeEditorDialog:: accept ()
94{ 96{
95 slotOk(); 97 slotOk();
96 98
97} 99}
98void AddresseeEditorDialog::slotOk() 100void AddresseeEditorDialog::slotOk()
99{ 101{
100 slotApply(); 102 slotApply();
101 103
102 //KDialogBase::slotOk(); 104 //KDialogBase::slotOk();
103 emit okClicked(); 105 emit okClicked();
104 QDialog::accept(); 106 QDialog::accept();
105} 107}
106 108
107void AddresseeEditorDialog::widgetModified() 109void AddresseeEditorDialog::widgetModified()
108{ 110{
109 enableButton( KDialogBase::Apply, true ); 111 enableButton( KDialogBase::Apply, true );
110} 112}
111 113
112void AddresseeEditorDialog::slotCancel() 114void AddresseeEditorDialog::slotCancel()
113{ 115{
114 KDialogBase::slotCancel(); 116 KDialogBase::slotCancel();
115 117
116 118