-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 @@ -6,42 +6,42 @@ Feature requests: - Dial by mobile phone by tapping the number.. (Maybe using gsmtool. And we may add a library class for this) - dial with dtmfdial in case it's installed and there's no mobile - 3rd column for 2. Contact - Implementing additional Views (Phonebook, ...) - 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. Known Bugs: ----------- Urgent: -------- - Category is on the wrong position after changing to personal and back to normal ( Temporarily workaround: Category is never deactivated.. :S ) 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: --------------- - 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 +- Find a smart solution for activating/deactivating the "send email" event ContactEditor: - Redesign of Contacteditor Should be Fixed (not absolute sure, need further validation): ------------------------------------------------------------- @@ -105,8 +105,11 @@ Fixed/Ready: - 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 - Fix handling of 3 Firstnames - Cursor-UP/Down: Should additionally scroll cardview if it is too large (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 @@ -7,16 +7,17 @@ AbConfig::AbConfig( ): m_useQtMail( true ), m_useOpieMail( false ), m_useRegExp( false ), m_beCaseSensitive( false ), m_fontSize( 1 ), m_barPos( QMainWindow::Top ), m_fixedBars( true ), + m_lpSearchMode( LastName ), m_changed( false ) { } AbConfig::~AbConfig() { } @@ -55,16 +56,21 @@ QMainWindow::ToolBarDock AbConfig::getToolBarPos() const return (QMainWindow::ToolBarDock) m_barPos; } bool AbConfig::fixedBars() const { return m_fixedBars; } +AbConfig::LPSearchMode AbConfig::letterPickerSearch() const +{ + return ( AbConfig::LPSearchMode ) m_lpSearchMode; +} + void AbConfig::setUseRegExp( bool v ) { m_useRegExp = v ; m_changed = true; } void AbConfig::setUseWildCards( bool v ) { m_useRegExp = !v; @@ -104,27 +110,34 @@ void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) } void AbConfig::setFixedBars( const bool fixed ) { m_fixedBars = fixed; m_changed = true; } +void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) +{ + m_lpSearchMode = mode; + m_changed = true; +} + void AbConfig::load() { // Read Config settings Config cfg("AddressBook"); cfg.setGroup("Font"); m_fontSize = cfg.readNumEntry( "fontSize", 1 ); 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"); m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); cfg.setGroup("ContactOrder"); int ID = 0; int i = 0; @@ -154,16 +167,17 @@ void AbConfig::save() if ( m_changed ){ Config cfg("AddressBook"); cfg.setGroup("Font"); cfg.writeEntry("fontSize", m_fontSize); cfg.setGroup("Search"); cfg.writeEntry("useRegExp", m_useRegExp); cfg.writeEntry("caseSensitive", m_beCaseSensitive); + cfg.writeEntry("lpSearchMode", m_lpSearchMode ); cfg.setGroup("Mail"); cfg.writeEntry( "useQtMail", m_useQtMail ); cfg.writeEntry( "useOpieMail", m_useOpieMail); cfg.setGroup("ContactOrder"); cfg.clearGroup(); for ( uint i = 0; i < m_ordered.count(); i++ ){ @@ -189,10 +203,11 @@ void AbConfig::operator= ( const AbConfig& cnf ) m_useQtMail = cnf.m_useQtMail; m_useOpieMail = cnf.m_useOpieMail; m_useRegExp = cnf.m_useRegExp; m_beCaseSensitive = cnf.m_beCaseSensitive; m_fontSize = cnf.m_fontSize; m_ordered = cnf.m_ordered; 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 @@ -2,39 +2,49 @@ #define _ABCONFIG_H_ #include <qstringlist.h> #include <qmainwindow.h> class AbConfig { public: + enum LPSearchMode{ + LastName = 0, + FullName, + LASTELEMENT + }; + + + AbConfig(); ~AbConfig(); // Search Settings bool useRegExp() const; bool useWildCards() const; bool beCaseSensitive() const; bool useQtMail() const; bool useOpieMail() const; int fontSize() const; QValueList<int> orderList() const; QMainWindow::ToolBarDock getToolBarPos() const; bool fixedBars() const; + LPSearchMode letterPickerSearch() const; void setUseRegExp( bool v ); void setUseWildCards( bool v ); void setBeCaseSensitive( bool v ); void setUseQtMail( bool v ); void setUseOpieMail( bool v ); void setFontSize( int v ); void setOrderList( const QValueList<int>& list ); void setToolBarDock( const QMainWindow::ToolBarDock v ); void setFixedBars( const bool fixed ); + void setLetterPickerSearch( const LPSearchMode mode ); void operator= ( const AbConfig& cnf ); void load(); void save(); protected: /* virtual void itemUp(); */ @@ -45,14 +55,15 @@ protected: bool m_useQtMail; bool m_useOpieMail; bool m_useRegExp; bool m_beCaseSensitive; int m_fontSize; QValueList<int> m_ordered; int m_barPos; bool m_fixedBars; + int m_lpSearchMode; bool m_changed; }; #endif 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 @@ -17,16 +17,18 @@ #include "abview.h" #include <qlayout.h> #include <qpe/global.h> #include <opie/ocontactaccessbackend_vcard.h> +#include <assert.h> + // Is defined in LibQPE extern QString categoryFileName(); QString addressbookPersonalVCardName() { QString filename = Global::applicationFileName("addressbook", "businesscard.vcf"); @@ -155,17 +157,17 @@ void AbView::load() if ( m_inPersonal ) // VCard Backend does not sort.. m_list = m_contactdb->allRecords(); else{ m_list = m_contactdb->sorted( true, 0, 0, 0 ); clearForCategory(); } - // qWarning ("Number of contacts: %d", m_list.count()); + qWarning ("Number of contacts: %d", m_list.count()); updateView( true ); } void AbView::reload() { // qWarning( "void AbView::reload()" ); @@ -213,31 +215,45 @@ void AbView::setShowToView( Views view ) m_prev_View = m_curr_View; m_curr_View = view; updateView(); } } -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 ){ load(); return; }else{ // If the current Backend is unable to solve the query, we will // ignore the request .. if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ return; } - 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(); m_curr_Contact = 0; } updateView( true ); } void AbView::setListOrder( const QValueList<int>& ordered ) 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 @@ -6,16 +6,17 @@ #include <qpe/categories.h> #include <opie/ocontact.h> #include <opie/ocontactaccess.h> #include "contacteditor.h" #include "abtable.h" #include "ablabel.h" +#include "abconfig.h" class AbView: public QWidget { Q_OBJECT public: enum Views{ TableView=0, CardView, PersonalView }; @@ -27,17 +28,17 @@ public: void reload(); void clear(); void setView( Views view ); void showPersonal( bool personal ); void setCurrentUid( int uid ); 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 ); // Add Entry and put to current void addEntry( const OContact &newContact ); void removeEntry( const int UID ); void replaceEntry( const OContact &contact ); OContact currentEntry(); 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 @@ -747,16 +747,17 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) // fix the foxus... abEditor->setNameFocus(); if ( abEditor->exec() ) { setFocus(); if ( entryMode == NewEntry ) { OContact insertEntry = abEditor->entry(); insertEntry.assignUid(); m_abView -> addEntry( insertEntry ); + m_abView -> setCurrentUid( insertEntry.uid() ); } else { OContact replEntry = abEditor->entry(); if ( !replEntry.isValidUid() ) replEntry.assignUid(); m_abView -> replaceEntry( replEntry ); } @@ -1006,17 +1007,17 @@ void AddressbookWindow::slotListView() void AddressbookWindow::slotCardView() { slotViewSwitched( AbView::CardView ); } void AddressbookWindow::slotSetLetter( char c ) { - m_abView->setShowByLetter( c ); + m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); } void AddressbookWindow::populateCategories() { catMenu->clear(); 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 @@ -300,17 +300,17 @@ <widget> <class>QRadioButton</class> <property stdset="1"> <name>name</name> <cstring>m_moveBars</cstring> </property> <property stdset="1"> <name>text</name> - <string>Movable</string> + <string>Moveable</string> </property> <property> <name>whatsThis</name> <string>Switch to moveable menu-/toolbars after restarting application !</string> </property> </widget> </hbox> </widget> 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 @@ -651,20 +651,22 @@ void ContactEditor::init() { cmbChooserField4->insertStringList( trlChooserNames ); cmbChooserField1->setCurrentItem( 0 ); cmbChooserField2->setCurrentItem( 1 ); cmbChooserField3->setCurrentItem( 2 ); 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 &)) ); connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) ); connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) ); connect( txtChooserField4, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser4Change(const QString &)) ); @@ -1052,16 +1054,26 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) { } void ContactEditor::slotSuffixChange( const QString& ) { // Just want to update the FileAs combo if the suffix was changed.. slotFullNameChange( txtFullName->text() ); } +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() { if ( isEmpty() ) { cleanupFields(); reject(); } else { saveEntry(); cleanupFields(); 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 @@ -96,16 +96,17 @@ class ContactEditor : public QDialog { void slotAddress2Change( const QString &textChanged ); void slotPOBoxChange( const QString &textChanged ); void slotCityChange( const QString &textChanged ); void slotStateChange( const QString &textChanged ); void slotZipChange( const QString &textChanged ); void slotCountryChange( const QString &textChanged ); 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); void slotRemoveBirthday(); void slotRemoveAnniversary(); void defaultEmailChanged(int); private: enum StackWidgets { TextField = 1, Combo }; 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 @@ -1,10 +1,10 @@ #ifndef _VERSION_H_ #define _VERSION_H_ #define MAINVERSION "0" #define SUBVERSION "9" -#define PATCHVERSION "4" +#define PATCHVERSION "5" #define APPNAME "OPIE_ADDRESSBOOK" #endif |