summaryrefslogtreecommitdiffabout
path: root/kaddressbook/phoneeditwidget.h
authorzautrix <zautrix>2005-10-28 13:24:38 (UTC)
committer zautrix <zautrix>2005-10-28 13:24:38 (UTC)
commit61a52cfdb0eda075dabde46984cf05b37856bbc2 (patch) (unidiff)
treecd587a374d62fa9b50143305f762c0ed995bd50c /kaddressbook/phoneeditwidget.h
parentcee83f70d8e4a6945f4456c55ab1b280d3425f0f (diff)
downloadkdepimpi-61a52cfdb0eda075dabde46984cf05b37856bbc2.zip
kdepimpi-61a52cfdb0eda075dabde46984cf05b37856bbc2.tar.gz
kdepimpi-61a52cfdb0eda075dabde46984cf05b37856bbc2.tar.bz2
commit
Diffstat (limited to 'kaddressbook/phoneeditwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/phoneeditwidget.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index c730c7b..df5aff9 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -26,8 +26,9 @@
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpopupmenu.h>
30 31
31#include <qptrlist.h> 32#include <qptrlist.h>
32#include <qscrollview.h> 33#include <qscrollview.h>
33 34
@@ -46,9 +47,9 @@ typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo;
46 47
47/** 48/**
48 Widget for editing phone numbers. 49 Widget for editing phone numbers.
49*/ 50*/
50class PhoneEditWidget : public QScrollView 51class PhoneEditWidget : public QWidget
51{ 52{
52 Q_OBJECT 53 Q_OBJECT
53 54
54 public: 55 public:
@@ -65,14 +66,19 @@ class PhoneEditWidget : public QScrollView
65 void modified(); 66 void modified();
66 void typeChange( int oldType, int newType ); 67 void typeChange( int oldType, int newType );
67 68
68 private slots: 69 private slots:
70 void bottomVisible();
71 void addNumberInt( int );
69 void deleteEdit( PhoneTypeNumberEdit* ew ); 72 void deleteEdit( PhoneTypeNumberEdit* ew );
70 void addNumber(); 73 void addNumber();
71 void pendingDelete(); 74 void pendingDelete();
72 protected: 75 protected:
73 76
74 private: 77 private:
78 QScrollView* sv;
79 QPopupMenu *mPopup;
80 int mPopupCount;
75 PhoneTypeNumberEdit* mPendingDelete; 81 PhoneTypeNumberEdit* mPendingDelete;
76 void setDefaults(); 82 void setDefaults();
77 PhoneTypeNumberEdit* appendEditCombo(); 83 PhoneTypeNumberEdit* appendEditCombo();
78 QWidget* mw; 84 QWidget* mw;
@@ -225,9 +231,9 @@ public:
225 int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() ); 231 int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() );
226 mCombo->setCurrentItem( index ); 232 mCombo->setCurrentItem( index );
227 mNumber->setText( mPhoneNumber.number() ); 233 mNumber->setText( mPhoneNumber.number() );
228 show(); 234 show();
229 235 mNumber->setFocus();
230 } 236 }
231 KABC::PhoneNumber phoneNumber() 237 KABC::PhoneNumber phoneNumber()
232 { 238 {
233 mPhoneNumber.setNumber( mNumber->text() ); 239 mPhoneNumber.setNumber( mNumber->text() );
@@ -239,8 +245,12 @@ public:
239 { 245 {
240 if ( mNumber->text().isEmpty() )return false; 246 if ( mNumber->text().isEmpty() )return false;
241 return true; 247 return true;
242 } 248 }
249 int currentType()
250 {
251 return mCombo->currentItem();
252 }
243 private slots: 253 private slots:
244 void typeExternalChanged( int oldType, int newType ) 254 void typeExternalChanged( int oldType, int newType )
245 { 255 {
246 if ( mPhoneNumber.type() == newType ) { 256 if ( mPhoneNumber.type() == newType ) {
@@ -258,17 +268,14 @@ public:
258 int old = mPhoneNumber.type(); 268 int old = mPhoneNumber.type();
259 int newT = PhoneNumber::supportedTypeList()[index]; 269 int newT = PhoneNumber::supportedTypeList()[index];
260 if ( old != newT ) { 270 if ( old != newT ) {
261 emit modified(); 271 emit modified();
262 emit typeChange ( old, newT ); 272 if ( newT != PhoneNumber::Voice )
273 emit typeChange ( old, newT );
263 mPhoneNumber.setType(newT ); 274 mPhoneNumber.setType(newT );
264 } 275 }
265 276
266 } 277 }
267 int currentType()
268 {
269 return mCombo->currentItem();
270 }
271 void textChanged ( const QString & ) 278 void textChanged ( const QString & )
272 { 279 {
273 emit modified(); 280 emit modified();
274 } 281 }