summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp2
-rw-r--r--kaddressbook/phoneeditwidget.cpp80
-rw-r--r--kaddressbook/phoneeditwidget.h21
-rw-r--r--version2
5 files changed, 75 insertions, 32 deletions
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm
index 2b5b390..9076943 100644
--- a/desktop/rpm/kdepim_rpm
+++ b/desktop/rpm/kdepim_rpm
@@ -2,3 +2,3 @@ Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.2.5 3Version: 2.2.6
4Release: SuSE_9.2 4Release: SuSE_9.2
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 9814cd5..966efa5 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1190,3 +1190,3 @@ void AddresseeEditorWidget::save()
1190 mAddressee.insertPhoneNumber( *phoneIter ); 1190 mAddressee.insertPhoneNumber( *phoneIter );
1191 1191 mAddressee.makePhoneNumbersOLcompatible();
1192 // Save the addresses 1192 // Save the addresses
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index 997fc05..9e7e221 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -33,2 +33,3 @@
33#include <qhbox.h> 33#include <qhbox.h>
34#include <qcursor.h>
34 35
@@ -53,10 +54,23 @@
53PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) 54PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
54 : QScrollView(parent,name) 55 : QWidget(parent,name)
55{ 56{
56 setFrameStyle ( QFrame::Panel | QFrame::Plain ); 57 QGridLayout* gridLayout = new QGridLayout ( this, 2,2 );
57 setLineWidth ( 1 ); 58
58 setMidLineWidth ( 1 ); 59 QLabel *temp = new QLabel( "", this );
59 mw = new QWidget ( viewport() ); 60 temp->setAlignment( Qt::AlignCenter );
60 addChild(mw); 61 temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
61 setResizePolicy( AutoOneFit ); 62 gridLayout->addWidget( temp, 1, 0 );
63 QPushButton *addBut = new QPushButton ( "add", this );
64 addBut->setPixmap ( SmallIcon("plus"));
65 addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() );
66 connect(addBut,SIGNAL(clicked ()),SLOT(addNumber()));
67 gridLayout->addWidget( addBut, 0, 0 );
68
69 sv = new QScrollView( this );
70 sv->setFrameStyle ( QFrame::Panel | QFrame::Plain );
71 sv->setLineWidth ( 1 );
72 sv->setMidLineWidth ( 1 );
73 mw = new QWidget ( sv->viewport() );
74 sv->addChild(mw);
75 sv->setResizePolicy( QScrollView::AutoOneFit );
62 mainLayout = new QVBoxLayout ( mw ); 76 mainLayout = new QVBoxLayout ( mw );
@@ -64,17 +78,15 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
64 mainLayout->setSpacing( 2 ); 78 mainLayout->setSpacing( 2 );
65 QWidget* hb = new QWidget ( mw ); 79 gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 );
66 mainLayout->add( hb );
67 QHBoxLayout* hbLayout = new QHBoxLayout ( hb );
68 QPushButton *addBut = new QPushButton ( "add", hb );
69 hbLayout->add( addBut );
70 addBut->setPixmap ( SmallIcon("plus"));
71 addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() );
72 connect(addBut,SIGNAL(clicked()),SLOT(addNumber()));
73 //QLabel * temp = new QLabel( i18n("Phone Type"), hb );
74 QLabel *temp = new QLabel( i18n("Phone Number"),hb );
75 temp->setAlignment( Qt::AlignCenter );
76 temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
77 hbLayout->add( temp );
78 setDefaults(); 80 setDefaults();
79 mTypeNumberEditList.setAutoDelete( true ); 81 mTypeNumberEditList.setAutoDelete( true );
82 mPopup = new QPopupMenu( this );
83 QStringList list = PhoneNumber::supportedTypeListNames();
84 mPopupCount = list.count();
85 int i = 0;
86 while ( i < mPopupCount ) {
87 mPopup->insertItem( list[ i ], i );
88 ++i;
89 }
90 connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int)));
91
80} 92}
@@ -99,5 +111,29 @@ void PhoneEditWidget::setDefaults()
99} 111}
112void PhoneEditWidget::addNumberInt( int index )
113{
114 PhoneTypeNumberEdit* edit = appendEditCombo();
115 KABC::PhoneNumber phoneNumber;
116 phoneNumber.setType( PhoneNumber::supportedTypeList()[index] );
117 edit->setPhoneNumber( phoneNumber );
118 //verticalScrollBar()->setValue( 1024);
119 QTimer::singleShot( 0, this, SLOT ( bottomVisible() ) );
120}
121void PhoneEditWidget::bottomVisible()
122{
123 sv->setContentsPos ( 0, 1024 );
124}
100void PhoneEditWidget::addNumber() 125void PhoneEditWidget::addNumber()
101{ 126{
102 127 int i = 0;
128 while ( i < mPopupCount ) {
129 mPopup->setItemEnabled( i, true );
130 ++i;
131 }
132 PhoneTypeNumberEdit* edit = mTypeNumberEditList.first();
133 while ( edit ) {
134 if ( edit->currentType() < mPopupCount -1 )
135 mPopup->setItemEnabled( edit->currentType(), false );
136 edit = mTypeNumberEditList.next();
137 }
138 mPopup->popup( QCursor::pos() );
103} 139}
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index c730c7b..df5aff9 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -29,2 +29,3 @@
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpopupmenu.h>
30 31
@@ -49,3 +50,3 @@ typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo;
49*/ 50*/
50class PhoneEditWidget : public QScrollView 51class PhoneEditWidget : public QWidget
51{ 52{
@@ -68,2 +69,4 @@ class PhoneEditWidget : public QScrollView
68 private slots: 69 private slots:
70 void bottomVisible();
71 void addNumberInt( int );
69 void deleteEdit( PhoneTypeNumberEdit* ew ); 72 void deleteEdit( PhoneTypeNumberEdit* ew );
@@ -74,2 +77,5 @@ class PhoneEditWidget : public QScrollView
74 private: 77 private:
78 QScrollView* sv;
79 QPopupMenu *mPopup;
80 int mPopupCount;
75 PhoneTypeNumberEdit* mPendingDelete; 81 PhoneTypeNumberEdit* mPendingDelete;
@@ -228,3 +234,3 @@ public:
228 show(); 234 show();
229 235 mNumber->setFocus();
230 } 236 }
@@ -242,2 +248,6 @@ public:
242 } 248 }
249 int currentType()
250 {
251 return mCombo->currentItem();
252 }
243 private slots: 253 private slots:
@@ -261,3 +271,4 @@ public:
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 );
@@ -266,6 +277,2 @@ public:
266 } 277 }
267 int currentType()
268 {
269 return mCombo->currentItem();
270 }
271 void textChanged ( const QString & ) 278 void textChanged ( const QString & )
diff --git a/version b/version
index 6c3e9c6..4f24d24 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.2.5"; version = "2.2.6";