summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
authoreilers <eilers>2003-03-01 18:06:49 (UTC)
committer eilers <eilers>2003-03-01 18:06:49 (UTC)
commita0ae7d2b8cfef3f643c4aa536bdf25d7da510142 (patch) (side-by-side diff)
tree7658121cba0f106d019ecf34682fe9cc079cbf73 /core/pim/addressbook/contacteditor.cpp
parent7dd36872a3eb63eb1c3c7a17549f3eeba92f1b32 (diff)
downloadopie-a0ae7d2b8cfef3f643c4aa536bdf25d7da510142.zip
opie-a0ae7d2b8cfef3f643c4aa536bdf25d7da510142.tar.gz
opie-a0ae7d2b8cfef3f643c4aa536bdf25d7da510142.tar.bz2
Fixing following bugs:
default email chooser jumped sometimes through the widget default email chooser not completely hiding the textfield storing the position of the chooser for the home webpage failed
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp107
1 files changed, 63 insertions, 44 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index b60f2dd..d1338f6 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -164,2 +164,3 @@ void ContactEditor::init() {
+ // Chooser 1
cmbChooserField1 = new QComboBox( FALSE, container );
@@ -167,5 +168,11 @@ void ContactEditor::init() {
gl->addWidget( cmbChooserField1, 3, 0 );
- txtChooserField1 = new QLineEdit( container );
- gl->addWidget( txtChooserField1, 3, 1 );
-
+ // Textfield for chooser 1.
+ // Now use Widgetstack to contain the textfield and the default-email combo !
+ m_widgetStack1 = new QWidgetStack( container );
+ txtChooserField1 = new QLineEdit( m_widgetStack1 );
+ m_widgetStack1 -> addWidget( txtChooserField1, TextField );
+ gl->addWidget( m_widgetStack1, 3, 1 );
+ m_widgetStack1 -> raiseWidget( TextField );
+
+ // Chooser 2
cmbChooserField2 = new QComboBox( FALSE, container );
@@ -173,5 +180,11 @@ void ContactEditor::init() {
gl->addWidget( cmbChooserField2, 4, 0 );
- txtChooserField2 = new QLineEdit( container );
- gl->addWidget( txtChooserField2, 4, 1 );
-
+ // Textfield for chooser 2
+ // Now use WidgetStack to contain the textfield and the default-email combo!
+ m_widgetStack2 = new QWidgetStack( container );
+ txtChooserField2 = new QLineEdit( m_widgetStack2 );
+ m_widgetStack2 -> addWidget( txtChooserField2, TextField );
+ gl->addWidget( m_widgetStack2, 4, 1 );
+ m_widgetStack2 -> raiseWidget( TextField );
+
+ // Chooser 3
cmbChooserField3 = new QComboBox( FALSE, container );
@@ -179,4 +192,9 @@ void ContactEditor::init() {
gl->addWidget( cmbChooserField3, 5, 0 );
- txtChooserField3 = new QLineEdit( container );
- gl->addWidget( txtChooserField3, 5, 1 );
+ // Textfield for chooser 2
+ // Now use WidgetStack to contain the textfield and the default-email combo!
+ m_widgetStack3 = new QWidgetStack( container );
+ txtChooserField3 = new QLineEdit( m_widgetStack3 );
+ m_widgetStack3 -> addWidget( txtChooserField3, TextField );
+ gl->addWidget( m_widgetStack3, 5, 1 );
+ m_widgetStack3 -> raiseWidget( TextField );
@@ -459,2 +477,3 @@ void ContactEditor::init() {
+ // Chooser 4
cmbChooserField4 = new QComboBox( FALSE, container );
@@ -462,4 +481,9 @@ void ContactEditor::init() {
gl->addWidget( cmbChooserField4, 6, 0 );
- txtChooserField4 = new QLineEdit( container );
- gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 );
+ // Textfield for chooser 2
+ // Now use WidgetStack to contain the textfield and the default-email combo!
+ m_widgetStack4 = new QWidgetStack( container );
+ txtChooserField4 = new QLineEdit( m_widgetStack4 );
+ m_widgetStack4 -> addWidget( txtChooserField4, TextField );
+ gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 );
+ m_widgetStack4 -> raiseWidget( TextField );
@@ -702,3 +726,3 @@ void ContactEditor::populateDefaultEmailCmb(){
// be handled by something else..
-bool ContactEditor::cmbChooserChange( int index, QLineEdit *inputWid, int widgetPos ) {
+bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) {
QString type = slChooserNames[index];
@@ -713,3 +737,3 @@ bool ContactEditor::cmbChooserChange( int index, QLineEdit *inputWid, int widget
- // More than one defaul-email chooser is not allowed !
+ // More than one default-email chooser is not allowed !
if ( ( defaultEmailChooserPosition != -1 ) &&
@@ -720,23 +744,19 @@ bool ContactEditor::cmbChooserChange( int index, QLineEdit *inputWid, int widget
- if ( cmbDefaultEmail ){
- delete cmbDefaultEmail;
- cmbDefaultEmail = 0l;
+ QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
+ if ( cmbo ){
+ inputStack->raiseWidget( TextField );
+ inputStack -> removeWidget( cmbo );
+ delete cmbo;
}
- cmbDefaultEmail = new QComboBox(inputWid->parentWidget());
- cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); /* :SX */
-
- QRect rect = inputWid->frameGeometry();
- qWarning("Geometrie: X=%d, Y=%d, Left=%d, Top=%d, Right=%d, Bottom=%d",
- rect.x(), rect.y(), rect.left(), rect.top(), rect.right(), rect.bottom());
- QPoint pnt = inputWid->pos();
- qWarning("Position : X=%d, Y=%d", pnt.x(), pnt.y() );
-
- connect( cmbDefaultEmail,SIGNAL( activated(int) ),
- SLOT( defaultEmailChanged(int) ) );
+ cmbo = new QComboBox( inputStack );
+ cmbo -> insertStringList( emails );
- cmbDefaultEmail->clear();
- cmbDefaultEmail->insertStringList( emails );
- cmbDefaultEmail->show();
+ inputStack -> addWidget( cmbo, Combo );
+ inputStack -> raiseWidget( Combo );
defaultEmailChooserPosition = widgetPos;
+ cmbDefaultEmail = cmbo;
+
+ connect( cmbo,SIGNAL( activated(int) ),
+ SLOT( defaultEmailChanged(int) ) );
@@ -751,4 +771,9 @@ bool ContactEditor::cmbChooserChange( int index, QLineEdit *inputWid, int widget
defaultEmailChooserPosition = -1;
- if ( cmbDefaultEmail )
- cmbDefaultEmail->hide();
+ QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
+ if ( cmbo ){
+ inputStack->raiseWidget( TextField );
+ inputStack -> removeWidget( cmbo );
+ cmbDefaultEmail = 0l;
+ delete cmbo;
+ }
@@ -804,3 +829,3 @@ void ContactEditor::chooserChange( const QString &textChanged, int index,
- QString type = slChooserNames[index];
+ QString type = slChooserNames[index]; // :SX
qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",
@@ -814,9 +839,3 @@ void ContactEditor::chooserChange( const QString &textChanged, int index,
- }else if (defaultEmailChooserPosition == widgetPos){
- qDebug("cmbDefaultEmail->hide()");
-
- if (cmbDefaultEmail) cmbDefaultEmail->hide();
- widgetPos=-1;
-
- }else if (type == "Emails"){
+ }else if (type == "Emails"){
qDebug("emails");
@@ -921,4 +940,4 @@ void ContactEditor::slotCmbChooser1Change( int index ) {
qWarning("ContactEditor::slotCmbChooser1Change( %d )", index);
- if ( !cmbChooserChange( cmbChooserField1->currentItem(), txtChooserField1, 1) ){
-
+ if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){
+
txtChooserField1->setText( slChooserValues[index] );
@@ -933,3 +952,3 @@ void ContactEditor::slotCmbChooser2Change( int index ) {
- if ( !cmbChooserChange( cmbChooserField2->currentItem(), txtChooserField2, 2) ){
+ if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){
@@ -944,3 +963,3 @@ void ContactEditor::slotCmbChooser3Change( int index ) {
- if ( !cmbChooserChange( cmbChooserField3->currentItem(), txtChooserField3, 3) ){
+ if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){
@@ -955,3 +974,3 @@ void ContactEditor::slotCmbChooser4Change( int index ) {
- if ( !cmbChooserChange( cmbChooserField4->currentItem(), txtChooserField4, 4) ){
+ if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){