author | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
commit | 37084d3961026893840ef9891132bdf193a312b3 (patch) (side-by-side diff) | |
tree | 342792abd777eb11a378cc5e06e0436ab48f6d89 | |
parent | b068a42c89af19f5642b68060c1d085afa78e7b1 (diff) | |
download | opie-37084d3961026893840ef9891132bdf193a312b3.zip opie-37084d3961026893840ef9891132bdf193a312b3.tar.gz opie-37084d3961026893840ef9891132bdf193a312b3.tar.bz2 |
Some improvements in handling of organizations:
- If you enter a organization name and no Fullname is entered, the
organization name will be used.
Thus, the organization is shown correctly in the listview..
- The letterpicker now searches for the SaveAs Entry (configurable)
instead for lastname. Ths guarantees that the organization is found
as expected..
This addresses bugreport #590 and #895..
-rw-r--r-- | core/pim/addressbook/TODO | 13 | ||||
-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 19 | ||||
-rw-r--r-- | core/pim/addressbook/abconfig.h | 11 | ||||
-rw-r--r-- | core/pim/addressbook/abview.cpp | 24 | ||||
-rw-r--r-- | core/pim/addressbook/abview.h | 3 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 3 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg_base.ui | 2 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 20 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 1 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 2 |
10 files changed, 79 insertions, 19 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index a3cffa7..383f8c5 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO @@ -12,5 +12,4 @@ Feature requests: - Birthday & Anniversary Reminder - Beaming of multiple contacts (current list/ by search or by category) -- Configure the letter-picker: lastname/fullname search - Optionally put scrollbars left. @@ -27,5 +26,8 @@ Important: ---------- -- "What's this" should be added (Deleyed after Feature Freeze) +- Configure the letter-picker: lastname/fullname search + -> Currently just behind the scenes .. +- Implement a correct handling of Organizations. They are currently + handled as normal persons.. :( Less important: @@ -34,8 +36,6 @@ Less important: - 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 +- Find a smart solution for activating/deactivating the "send email" event ContactEditor: @@ -111,2 +111,5 @@ Fixed/Ready: (behaviour should be selectable by configuration) - User center of the joypad to switch back from card to listview ! +- If new contact is added (contacteditor closed): focus (table, card) to + this entry ! +- Typo: Mov_e_able in Config-Dlg diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index 0b61614..4a0875b 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp @@ -13,4 +13,5 @@ AbConfig::AbConfig( ): m_barPos( QMainWindow::Top ), m_fixedBars( true ), + m_lpSearchMode( LastName ), m_changed( false ) { @@ -61,4 +62,9 @@ bool AbConfig::fixedBars() const } +AbConfig::LPSearchMode AbConfig::letterPickerSearch() const +{ + return ( AbConfig::LPSearchMode ) m_lpSearchMode; +} + void AbConfig::setUseRegExp( bool v ) { @@ -110,4 +116,10 @@ void AbConfig::setFixedBars( const bool fixed ) } +void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) +{ + m_lpSearchMode = mode; + m_changed = true; +} + void AbConfig::load() { @@ -119,6 +131,7 @@ void AbConfig::load() cfg.setGroup("Search"); - m_useRegExp = cfg.readBoolEntry( "useRegExp" ); - m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive" ); + m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); + m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); + m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FullName ); cfg.setGroup("Mail"); @@ -160,4 +173,5 @@ void AbConfig::save() cfg.writeEntry("useRegExp", m_useRegExp); cfg.writeEntry("caseSensitive", m_beCaseSensitive); + cfg.writeEntry("lpSearchMode", m_lpSearchMode ); cfg.setGroup("Mail"); @@ -195,4 +209,5 @@ void AbConfig::operator= ( const AbConfig& cnf ) m_barPos = cnf.m_barPos; m_fixedBars = cnf.m_fixedBars; + m_lpSearchMode = cnf.m_lpSearchMode; } diff --git a/core/pim/addressbook/abconfig.h b/core/pim/addressbook/abconfig.h index ce51b4c..93764f2 100644 --- a/core/pim/addressbook/abconfig.h +++ b/core/pim/addressbook/abconfig.h @@ -8,4 +8,12 @@ class AbConfig { public: + enum LPSearchMode{ + LastName = 0, + FullName, + LASTELEMENT + }; + + + AbConfig(); ~AbConfig(); @@ -21,4 +29,5 @@ public: QMainWindow::ToolBarDock getToolBarPos() const; bool fixedBars() const; + LPSearchMode letterPickerSearch() const; void setUseRegExp( bool v ); @@ -31,4 +40,5 @@ public: void setToolBarDock( const QMainWindow::ToolBarDock v ); void setFixedBars( const bool fixed ); + void setLetterPickerSearch( const LPSearchMode mode ); void operator= ( const AbConfig& cnf ); @@ -51,4 +61,5 @@ protected: int m_barPos; bool m_fixedBars; + int m_lpSearchMode; bool m_changed; diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index d3ca783..664bd3f 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -23,4 +23,6 @@ #include <opie/ocontactaccessbackend_vcard.h> +#include <assert.h> + // Is defined in LibQPE @@ -161,5 +163,5 @@ void AbView::load() } - // qWarning ("Number of contacts: %d", m_list.count()); + qWarning ("Number of contacts: %d", m_list.count()); updateView( true ); @@ -219,7 +221,10 @@ void AbView::setShowToView( Views view ) } -void AbView::setShowByLetter( char c ) +void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) { - // qWarning("void AbView::setShowByLetter( %c )", c ); + qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); + + assert( mode < AbConfig::LASTELEMENT ); + OContact query; if ( c == 0 ){ @@ -233,5 +238,16 @@ void AbView::setShowByLetter( char c ) } - query.setLastName( QString("%1*").arg(c) ); + switch( mode ){ + case AbConfig::LastName: + query.setLastName( QString("%1*").arg(c) ); + break; + case AbConfig::FullName: + query.setFileAs( QString("%1*").arg(c) ); + break; + default: + qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); + qWarning( "I will ignore it.." ); + return; + } m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); clearForCategory(); diff --git a/core/pim/addressbook/abview.h b/core/pim/addressbook/abview.h index 55c63cc..49bb4be 100644 --- a/core/pim/addressbook/abview.h +++ b/core/pim/addressbook/abview.h @@ -12,4 +12,5 @@ #include "abtable.h" #include "ablabel.h" +#include "abconfig.h" class AbView: public QWidget @@ -33,5 +34,5 @@ public: void setShowByCategory( const QString& cat ); void setShowToView( Views view ); - void setShowByLetter( char c ); + void setShowByLetter( char c, AbConfig::LPSearchMode mode = AbConfig::LastName ); void setListOrder( const QValueList<int>& ordered ); diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 25c6f3a..34bf7f1 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -753,4 +753,5 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) insertEntry.assignUid(); m_abView -> addEntry( insertEntry ); + m_abView -> setCurrentUid( insertEntry.uid() ); } else { OContact replEntry = abEditor->entry(); @@ -1012,5 +1013,5 @@ void AddressbookWindow::slotCardView() void AddressbookWindow::slotSetLetter( char c ) { - m_abView->setShowByLetter( c ); + m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); } diff --git a/core/pim/addressbook/configdlg_base.ui b/core/pim/addressbook/configdlg_base.ui index 1b5ac17..f892d08 100644 --- a/core/pim/addressbook/configdlg_base.ui +++ b/core/pim/addressbook/configdlg_base.ui @@ -306,5 +306,5 @@ <property stdset="1"> <name>text</name> - <string>Movable</string> + <string>Moveable</string> </property> <property> diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index f33ee0a..ce14f98 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -657,8 +657,10 @@ void ContactEditor::init() { connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); - connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); - - connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); - + connect( txtFullName, SIGNAL(textChanged(const QString &)), + this, SLOT(slotFullNameChange(const QString &)) ); + connect( txtSuffix, SIGNAL(textChanged(const QString &)), + this, SLOT(slotSuffixChange(const QString &)) ); + connect( txtOrganization, SIGNAL(textChanged(const QString &)), + this, SLOT(slotOrganizationChange(const QString &)) ); connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); @@ -1058,4 +1060,14 @@ void ContactEditor::slotSuffixChange( const QString& ) { } +void ContactEditor::slotOrganizationChange( const QString &textChanged ){ + qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); + // Special handling for storing Companies: + // If no Fullname is given, we store the Company-Name as lastname + // to handle it like a person.. + if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) + txtFullName->setText( textChanged ); + +} + void ContactEditor::accept() { diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index c6fa48f..e7432ee 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h @@ -102,4 +102,5 @@ class ContactEditor : public QDialog { void slotFullNameChange( const QString &textChanged ); void slotSuffixChange( const QString &textChanged ); + void slotOrganizationChange( const QString &textChanged ); void slotAnniversaryDateChanged( int year, int month, int day); void slotBirthdayDateChanged( int year, int month, int day); diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index c0465b5..4c93584 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h @@ -4,5 +4,5 @@ #define MAINVERSION "0" #define SUBVERSION "9" -#define PATCHVERSION "4" +#define PATCHVERSION "5" #define APPNAME "OPIE_ADDRESSBOOK" |