summaryrefslogtreecommitdiff
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
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 (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO21
-rw-r--r--core/pim/addressbook/contacteditor.cpp107
-rw-r--r--core/pim/addressbook/contacteditor.h8
-rw-r--r--core/pim/addressbook/ocontactfields.cpp4
-rw-r--r--core/pim/addressbook/version.h2
5 files changed, 82 insertions, 60 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index 719b720..a0d50a3 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -15,48 +15,42 @@ Feature requests:
- User center of the joypad to switch back from card to listview !
- Cursor-UP/Down: Should additionally scroll cardview if it is too large
(behaviour should be selectable by configuration)
Known Bugs:
-----------
-- Default Email-button: A lot of problems:
- If on second tab: The combo chooser is on the top left of the screen ! :(
-- Default Email-Button: Sometimes not hiding the textfields completely
Bugs but not in addressbook:
-----------------------------
- VCARD: If umlaut (äöüß) in address, the parser gets confused..
-- Exporting and reimporting of Jobtitle was reported to fail (Could not reproduce this ! (se))
-
Urgent:
--------
-ContactEditor:
-- Contact-Editor is temporarely reenabled. Wait for replacement.
-- Redesign of Contacteditor
- Category is on the wrong position after changing to personal and back to normal
( Temporarily workaround: Category is never deactivated.. :S )
- Fix handling of 3 Firstnames
Important:
----------
-- If new contact is added (contacteditor closed): focus (table, card) to
- this entry !
-- After search (Started with Return): KeyFocus should be on Tabelle
-
- "What's this" should be added (Deleyed after Feature Freeze)
Less important:
---------------
- Reload if contacts were changed externally
- The picker (alphabetical sort widget) should be
placed verticaly or horizontally (configurable)
- Find a smart solution for activating/deactivating the "send email" event
+- If new contact is added (contacteditor closed): focus (table, card) to
+ this entry !
+- After search (Started with Return): KeyFocus should be on Tabelle
+
+ContactEditor:
+- Redesign of Contacteditor
Should be Fixed (not absolute sure, need further validation):
-------------------------------------------------------------
Fixed/Ready:
@@ -114,6 +108,9 @@ Fixed/Ready:
3. Kategorie-Picker geht nicht.
- Plugin for Today for Birthdays and Anniversaries
- Implement a picker/combo for the default email.
- Overview window cleanup needed..
- Store last settings of combo-boxes
- Personal and Business Web-page is not editable
+- Default Email-button: A lot of problems:
+ If on second tab: The combo chooser is on the top left of the screen ! :(
+- Default Email-Button: Sometimes not hiding the textfields completely
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
@@ -159,29 +159,47 @@ void ContactEditor::init() {
l = new QLabel( tr( "Organization" ), container );
gl->addWidget( l, 2, 0 );
txtOrganization = new QLineEdit( container );
gl->addWidget( txtOrganization, 2, 1 );
+ // Chooser 1
cmbChooserField1 = new QComboBox( FALSE, container );
cmbChooserField1->setMaximumWidth( 90 );
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 );
cmbChooserField2->setMaximumWidth( 90 );
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 );
cmbChooserField3->setMaximumWidth( 90 );
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 );
l = new QLabel( tr( "File As" ), container );
gl->addWidget( l, 6, 0 );
cmbFileAs = new QComboBox( TRUE, container );
gl->addWidget( cmbFileAs, 6, 1 );
@@ -454,17 +472,23 @@ void ContactEditor::init() {
cmbCountry->listBox()->sort();
cmbCountry->setMaximumWidth( 135 );
gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 );
+ // Chooser 4
cmbChooserField4 = new QComboBox( FALSE, container );
cmbChooserField4->setMaximumWidth( 90 );
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 );
QSpacerItem *space = new QSpacerItem(1,1,
QSizePolicy::Maximum,
QSizePolicy::MinimumExpanding );
gl->addItem( space, 7, 0 );
@@ -697,63 +721,64 @@ void ContactEditor::populateDefaultEmailCmb(){
defaultEmail = cmbDefaultEmail->text(0);
}
// Called when any combobox was changed.
// "true" returned if the change was chandled by this function, else it should
// 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];
qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos );
if ( !initializing )
contactfields.setFieldOrder( widgetPos-1, index );
// Create and connect combobox for selecting the default email
if ( type == "Default Email"){
qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition);
- // More than one defaul-email chooser is not allowed !
+ // More than one default-email chooser is not allowed !
if ( ( defaultEmailChooserPosition != -1 ) &&
defaultEmailChooserPosition != widgetPos && !initializing){
chooserError( widgetPos );
return true;
}
- 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) ) );
// Set current default email
populateDefaultEmailCmb();
} else {
// Something else was selected: Hide combo..
qWarning(" Hiding default-email combo" );
if ( defaultEmailChooserPosition == widgetPos ){
defaultEmailChooserPosition = -1;
- if ( cmbDefaultEmail )
- cmbDefaultEmail->hide();
+ QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
+ if ( cmbo ){
+ inputStack->raiseWidget( TextField );
+ inputStack -> removeWidget( cmbo );
+ cmbDefaultEmail = 0l;
+ delete cmbo;
+ }
}
// Caller should initialize the responsible textfield, therefore
// "false" is returned
return false;
@@ -799,29 +824,23 @@ void ContactEditor::chooserError( int index )
}
// Called when something was changed in a textfield (shouldn't it called textchanged? (se))
void ContactEditor::chooserChange( const QString &textChanged, int index,
QLineEdit* , int widgetPos ) {
- QString type = slChooserNames[index];
+ QString type = slChooserNames[index]; // :SX
qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",
type.latin1(),textChanged.latin1(), index, widgetPos );
if ( type == "Default Email"){
qWarning ("??? Wozu??: %s", textChanged.latin1());
defaultEmail = textChanged;
populateDefaultEmailCmb();
- }else if (defaultEmailChooserPosition == widgetPos){
- qDebug("cmbDefaultEmail->hide()");
-
- if (cmbDefaultEmail) cmbDefaultEmail->hide();
- widgetPos=-1;
-
- }else if (type == "Emails"){
+ }else if (type == "Emails"){
qDebug("emails");
QString de;
emails = QStringList::split (",", textChanged );
populateDefaultEmailCmb();
@@ -916,47 +935,47 @@ void ContactEditor::slotCountryChange( const QString &textChanged ) {
}
}
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] );
txtChooserField1->setFocus();
}
}
void ContactEditor::slotCmbChooser2Change( int index ) {
qWarning("ContactEditor::slotCmbChooser2Change( %d )", index);
- if ( !cmbChooserChange( cmbChooserField2->currentItem(), txtChooserField2, 2) ){
+ if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){
txtChooserField2->setText( slChooserValues[index] );
txtChooserField2->setFocus();
}
}
void ContactEditor::slotCmbChooser3Change( int index ) {
qWarning("ContactEditor::slotCmbChooser3Change( %d )", index);
- if ( !cmbChooserChange( cmbChooserField3->currentItem(), txtChooserField3, 3) ){
+ if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){
txtChooserField3->setText( slChooserValues[index] );
txtChooserField3->setFocus();
}
}
void ContactEditor::slotCmbChooser4Change( int index ) {
qWarning("ContactEditor::slotCmbChooser4Change( %d )", index);
- if ( !cmbChooserChange( cmbChooserField4->currentItem(), txtChooserField4, 4) ){
+ if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){
txtChooserField4->setText( slChooserValues[index] );
txtChooserField4->setFocus();
}
}
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h
index 95f9f2d..703e702 100644
--- a/core/pim/addressbook/contacteditor.h
+++ b/core/pim/addressbook/contacteditor.h
@@ -26,12 +26,13 @@
#include <qpe/datebookmonth.h>
#include <qdialog.h>
#include <qlist.h>
#include <qmap.h>
#include <qstringlist.h>
+#include <qwidgetstack.h>
#include "ocontactfields.h"
const int NAME_LF = 0;
const int NAME_LFM = 1;
const int NAME_FL = 2;
@@ -103,16 +104,17 @@ class ContactEditor : public QDialog {
void slotBirthdayDateChanged( int year, int month, int day);
void slotRemoveBirthday();
void slotRemoveAnniversary();
void defaultEmailChanged(int);
private:
+ enum StackWidgets { TextField = 1, Combo };
int defaultEmailChooserPosition;
void populateDefaultEmailCmb();
void chooserChange( const QString&, int , QLineEdit*, int );
- bool cmbChooserChange( int , QLineEdit*, int );
+ bool cmbChooserChange( int , QWidgetStack*, int );
OContactFields contactfields;
bool useFullName;
OContact ent;
@@ -151,12 +153,16 @@ class ContactEditor : public QDialog {
QLineEdit *txtJobTitle;
QLineEdit *txtOrganization;
QLineEdit *txtChooserField1;
QLineEdit *txtChooserField2;
QLineEdit *txtChooserField3;
QLineEdit *txtChooserField4;
+ QWidgetStack* m_widgetStack1;
+ QWidgetStack* m_widgetStack2;
+ QWidgetStack* m_widgetStack3;
+ QWidgetStack* m_widgetStack4;
QComboBox *cmbChooserField1;
QComboBox *cmbChooserField2;
QComboBox *cmbChooserField3;
QComboBox *cmbChooserField4;
QComboBox *cmbDefaultEmail;
QComboBox *cmbFileAs;
diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp
index ffb88e8..831a596 100644
--- a/core/pim/addressbook/ocontactfields.cpp
+++ b/core/pim/addressbook/ocontactfields.cpp
@@ -417,13 +417,13 @@ void OContactFields::loadFromRecord( const OContact &cnt ){
qDebug("effective fieldOrder in loadFromRecord >%s<",fieldOrder.latin1());
}
void OContactFields::setFieldOrder( int num, int index ){
qDebug("qcontactfields setfieldorder pos %i -> %i",num,index);
- fieldOrder[num] = QString::number( index )[0];
+ fieldOrder[num] = QString::number( index, 16 )[0];
// We will store this new fieldorder globally to
// remember it for contacts which have none
globalFieldOrder = fieldOrder;
changedFieldOrder = true;
@@ -438,13 +438,13 @@ int OContactFields::getFieldOrder( int num, int defIndex ){
QChar poschar = fieldOrder[num];
bool ok;
int ret = 0;
// Convert char to number..
if ( !( poschar == QChar::null ) )
- ret = QString( poschar ).toInt(&ok, 10);
+ ret = QString( poschar ).toInt(&ok, 16);
else
ok = false;
// Return default value if index for
// num was not set or if anything else happened..
if ( !ok ) ret = defIndex;
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h
index 3c1e5ee..3becfdc 100644
--- a/core/pim/addressbook/version.h
+++ b/core/pim/addressbook/version.h
@@ -1,10 +1,10 @@
#ifndef _VERSION_H_
#define _VERSION_H_
#define MAINVERSION "0"
#define SUBVERSION "2"
-#define PATCHVERSION "1"
+#define PATCHVERSION "2"
#define APPNAME "OPIE_ADDRESSBOOK"
#endif