summaryrefslogtreecommitdiff
authoreilers <eilers>2003-05-11 12:36:30 (UTC)
committer eilers <eilers>2003-05-11 12:36:30 (UTC)
commit37084d3961026893840ef9891132bdf193a312b3 (patch) (side-by-side diff)
tree342792abd777eb11a378cc5e06e0436ab48f6d89
parentb068a42c89af19f5642b68060c1d085afa78e7b1 (diff)
downloadopie-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..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO13
-rw-r--r--core/pim/addressbook/abconfig.cpp19
-rw-r--r--core/pim/addressbook/abconfig.h11
-rw-r--r--core/pim/addressbook/abview.cpp24
-rw-r--r--core/pim/addressbook/abview.h3
-rw-r--r--core/pim/addressbook/addressbook.cpp3
-rw-r--r--core/pim/addressbook/configdlg_base.ui2
-rw-r--r--core/pim/addressbook/contacteditor.cpp20
-rw-r--r--core/pim/addressbook/contacteditor.h1
-rw-r--r--core/pim/addressbook/version.h2
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
@@ -13,3 +13,2 @@ Feature requests:
- Beaming of multiple contacts (current list/ by search or by category)
-- Configure the letter-picker: lastname/fullname search
- Optionally put scrollbars left.
@@ -28,3 +27,6 @@ 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.. :(
@@ -35,6 +37,4 @@ Less important:
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
@@ -112 +112,4 @@ Fixed/Ready:
- 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
@@ -14,2 +14,3 @@ AbConfig::AbConfig( ):
m_fixedBars( true ),
+ m_lpSearchMode( LastName ),
m_changed( false )
@@ -62,2 +63,7 @@ bool AbConfig::fixedBars() const
+AbConfig::LPSearchMode AbConfig::letterPickerSearch() const
+{
+ return ( AbConfig::LPSearchMode ) m_lpSearchMode;
+}
+
void AbConfig::setUseRegExp( bool v )
@@ -111,2 +117,8 @@ void AbConfig::setFixedBars( const bool fixed )
+void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode )
+{
+ m_lpSearchMode = mode;
+ m_changed = true;
+}
+
void AbConfig::load()
@@ -120,4 +132,5 @@ 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 );
@@ -161,2 +174,3 @@ void AbConfig::save()
cfg.writeEntry("caseSensitive", m_beCaseSensitive);
+ cfg.writeEntry("lpSearchMode", m_lpSearchMode );
@@ -196,2 +210,3 @@ void AbConfig::operator= ( const AbConfig& cnf )
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
@@ -9,2 +9,10 @@ class AbConfig
public:
+ enum LPSearchMode{
+ LastName = 0,
+ FullName,
+ LASTELEMENT
+ };
+
+
+
AbConfig();
@@ -22,2 +30,3 @@ public:
bool fixedBars() const;
+ LPSearchMode letterPickerSearch() const;
@@ -32,2 +41,3 @@ public:
void setFixedBars( const bool fixed );
+ void setLetterPickerSearch( const LPSearchMode mode );
@@ -52,2 +62,3 @@ protected:
bool m_fixedBars;
+ int m_lpSearchMode;
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
@@ -24,2 +24,4 @@
+#include <assert.h>
+
@@ -162,3 +164,3 @@ void AbView::load()
- // qWarning ("Number of contacts: %d", m_list.count());
+ qWarning ("Number of contacts: %d", m_list.count());
@@ -220,5 +222,8 @@ 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;
@@ -234,3 +239,14 @@ 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 );
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
@@ -13,2 +13,3 @@
#include "ablabel.h"
+#include "abconfig.h"
@@ -34,3 +35,3 @@ public:
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
@@ -754,2 +754,3 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
m_abView -> addEntry( insertEntry );
+ m_abView -> setCurrentUid( insertEntry.uid() );
} else {
@@ -1013,3 +1014,3 @@ 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
@@ -307,3 +307,3 @@
<name>text</name>
- <string>Movable</string>
+ <string>Moveable</string>
</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
@@ -658,6 +658,8 @@ void ContactEditor::init() {
- 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 &)),
@@ -1059,2 +1061,12 @@ 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
@@ -103,2 +103,3 @@ class ContactEditor : public QDialog {
void slotSuffixChange( const QString &textChanged );
+ void slotOrganizationChange( const QString &textChanged );
void slotAnniversaryDateChanged( 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
@@ -5,3 +5,3 @@
#define SUBVERSION "9"
-#define PATCHVERSION "4"
+#define PATCHVERSION "5"