summaryrefslogtreecommitdiffabout
path: root/kaddressbook/phoneeditwidget.h
Side-by-side diff
Diffstat (limited to 'kaddressbook/phoneeditwidget.h') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/phoneeditwidget.h19
1 files changed, 13 insertions, 6 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 @@
#include <kdialogbase.h>
#include <kiconloader.h>
#include <qpushbutton.h>
#include <qlayout.h>
+#include <qpopupmenu.h>
#include <qptrlist.h>
#include <qscrollview.h>
@@ -46,9 +47,9 @@ typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo;
/**
Widget for editing phone numbers.
*/
-class PhoneEditWidget : public QScrollView
+class PhoneEditWidget : public QWidget
{
Q_OBJECT
public:
@@ -65,14 +66,19 @@ class PhoneEditWidget : public QScrollView
void modified();
void typeChange( int oldType, int newType );
private slots:
+ void bottomVisible();
+ void addNumberInt( int );
void deleteEdit( PhoneTypeNumberEdit* ew );
void addNumber();
void pendingDelete();
protected:
private:
+ QScrollView* sv;
+ QPopupMenu *mPopup;
+ int mPopupCount;
PhoneTypeNumberEdit* mPendingDelete;
void setDefaults();
PhoneTypeNumberEdit* appendEditCombo();
QWidget* mw;
@@ -225,9 +231,9 @@ public:
int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() );
mCombo->setCurrentItem( index );
mNumber->setText( mPhoneNumber.number() );
show();
-
+ mNumber->setFocus();
}
KABC::PhoneNumber phoneNumber()
{
mPhoneNumber.setNumber( mNumber->text() );
@@ -239,8 +245,12 @@ public:
{
if ( mNumber->text().isEmpty() )return false;
return true;
}
+ int currentType()
+ {
+ return mCombo->currentItem();
+ }
private slots:
void typeExternalChanged( int oldType, int newType )
{
if ( mPhoneNumber.type() == newType ) {
@@ -258,17 +268,14 @@ public:
int old = mPhoneNumber.type();
int newT = PhoneNumber::supportedTypeList()[index];
if ( old != newT ) {
emit modified();
+ if ( newT != PhoneNumber::Voice )
emit typeChange ( old, newT );
mPhoneNumber.setType(newT );
}
}
- int currentType()
- {
- return mCombo->currentItem();
- }
void textChanged ( const QString & )
{
emit modified();
}