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 @@ -1,71 +1,71 @@ Stuff todo until OPIE 1.0 : =========================== 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): ------------------------------------------------------------- Fixed/Ready: ------- - Syncing: abtable not reloaded after sync. - Find widget should be replaced by something like qpdf has. - Adding a configuration dialog - Picker: Activated letter schould be more visible - Advanced handling of cursor keys (search..) - Mail-Icon is missing - Use opie-mail insted of qt-mail if possible. - Font menu is invisible using german translation - Personal contact editor: Disable categories - "Nonenglish" translation bug has to be fixed. - contacteditor: Birthday, annyversary, ... : Use Dateselector - The names of the countries are sorted by there english names, only.. Even if they are translated.. :S - Cursor keys should work in detail-view (ablabel) -> Ablabel should be removed and Abtable should be increased with different views (as started by darwin zins).. - Use advanced database functions in abtable to decrease memory footprint and to make everything more easy ! (abtable should store Iterator for selected Category) - Abtable: Configure Contact column (internally already available, need configuration) @@ -81,32 +81,35 @@ Fixed/Ready: - Unfiled shown just in Category "All" and "Unfiled". - After finising search and after Edit: Clear Picker - After Edit: Table position back to edited entry. - Optimize Table Update... - Change MyDialog to Config - Store position and state of toolbar - Searchwidget closed: Selected user is jumping - Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) zu lange.. - VCARD: Import of Anniversary does not work correctly (currently disabled) - Name order selected in "contacteditor" not used in list view. - OK-Key does not switch from Detailview (ablable) to Listview - Receiving of beams should open a dialog - Fix start of opie-mail - Implement Button Pics - Add a dialog to accept and optionally edit received contacts by IRDA. - Language not English (tested with german opie-translation): 1. Configure nicht übersetzt (alles leer). 2. Contacteditor nur teilweise übersetzt. 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 - 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 @@ -1,198 +1,213 @@ #include "abconfig.h" #include "version.h" #include <qpe/config.h> #include <qpe/recordfields.h> 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() { } bool AbConfig::useRegExp() const { return m_useRegExp; } bool AbConfig::useWildCards() const { return !m_useRegExp; } bool AbConfig::useQtMail() const { return m_useQtMail; } bool AbConfig::useOpieMail() const { return m_useOpieMail; } bool AbConfig::beCaseSensitive() const { return m_beCaseSensitive; } int AbConfig::fontSize() const { return m_fontSize; } QValueList<int> AbConfig::orderList() const { return m_ordered; } 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; m_changed = true; } void AbConfig::setBeCaseSensitive( bool v ) { m_beCaseSensitive = v; m_changed = true; } void AbConfig::setUseQtMail( bool v ) { m_useQtMail = v; m_changed = true; } void AbConfig::setUseOpieMail( bool v ) { m_useOpieMail = v; m_changed = true; } void AbConfig::setFontSize( int v ) { m_fontSize = v; m_changed = true; } void AbConfig::setOrderList( const QValueList<int>& list ) { m_ordered = list; m_changed = true; } void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) { m_barPos = v; m_changed = true; } 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; ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); while ( ID != 0 ){ m_ordered.append( ID ); ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); } // If no contact order is defined, we set the default if ( m_ordered.count() == 0 ) { m_ordered.append( Qtopia::DefaultEmail ); m_ordered.append( Qtopia::HomePhone); m_ordered.append( Qtopia::HomeMobile); m_ordered.append( Qtopia::BusinessPhone); } cfg.setGroup("ToolBar"); m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); m_changed = false; } 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++ ){ cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); } cfg.setGroup("ToolBar"); cfg.writeEntry( "Position", m_barPos ); cfg.writeEntry( "fixedBars", m_fixedBars ); cfg.setGroup("Version"); cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); cfg.writeEntry( "Mainversion", MAINVERSION ); cfg.writeEntry( "SubVersion", SUBVERSION ); cfg.writeEntry( "PatchVersion", PATCHVERSION ); } } 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 @@ -1,58 +1,69 @@ #ifndef _ABCONFIG_H_ #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(); */ /* virtual void itemDown(); */ QStringList contFields; 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 @@ -1,56 +1,58 @@ /********************************************************************** ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) ** ** This file is part of Qt Palmtop Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** **********************************************************************/ #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"); return filename; } AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): QWidget(parent), mCat(0), m_inSearch( false ), m_inPersonal( false ), m_curr_category( -1 ), m_curr_View( TableView ), m_prev_View( TableView ), m_curr_Contact ( 0 ), m_contactdb ( 0l ), m_storedDB ( 0l ), m_viewStack( 0l ), m_abTable( 0l ), m_orderedFields( ordered ) { // Load default database and handle syncing myself.. ! m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ), mCat.load( categoryFileName() ); // Create Layout and put WidgetStack into it. @@ -131,137 +133,151 @@ OContact AbView::currentEntry() currentContact = m_abTable -> currentEntry(); break; case CardView: currentContact = m_ablabel -> currentEntry(); break; } m_curr_Contact = currentContact.uid(); return currentContact; } bool AbView::save() { // qWarning("abView:Save data"); return m_contactdb->save(); } void AbView::load() { // qWarning("abView:Load data"); // Letter Search is stopped at this place emit signalClearLetterPicker(); 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()" ); m_contactdb->reload(); load(); } void AbView::clear() { // :SX } void AbView::setShowByCategory( const QString& cat ) { // qWarning("AbView::setShowCategory( const QString& cat )"); int intCat = 0; // All (cat == NULL) will be stored as -1 if ( cat.isNull() ) intCat = -1; else intCat = mCat.id("Contacts", cat ); // Just do anything if we really change the category if ( intCat != m_curr_category ){ // qWarning ("Categories: Selected %s.. Number: %d", cat.latin1(), m_curr_category); m_curr_category = intCat; emit signalClearLetterPicker(); load(); } } void AbView::setShowToView( Views view ) { // qWarning("void AbView::setShowToView( View %d )", view); // qWarning ("Change the View (Category is: %d)", m_curr_category); if ( m_curr_View != 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 ) { m_orderedFields = ordered; if ( m_abTable ){ m_abTable->setOrderedList( ordered ); m_abTable->refresh(); } updateView(); } QString AbView::showCategory() const { return mCat.label( "Contacts", m_curr_category ); } void AbView::showPersonal( bool personal ) { // qWarning ("void AbView::showPersonal( %d )", personal); if ( personal ){ if ( m_inPersonal ) return; 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 @@ -1,67 +1,68 @@ #ifndef _ABVIEW_H_ #define _ABVIEW_H_ #include <qwidget.h> #include <qwidgetstack.h> #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 }; AbView( QWidget* parent, const QValueList<int>& ordered ); ~AbView(); bool save(); void load(); 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(); void inSearch() { m_inSearch = true; } void offSearch(); QString showCategory() const; QStringList categories(); signals: void signalNotFound(); void signalClearLetterPicker(); void signalViewSwitched ( int ); public slots: void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, bool backwards, QString category = QString::null ); void slotSwitch(); private: void updateListinViews(); void updateView( bool newdata = false ); void clearForCategory(); bool contactCompare( const OContact &cnt, int category ); void parseName( const QString& name, QString *first, QString *middle, QString * last ); 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 @@ -723,64 +723,65 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) // Reset category and edit.. m_abView -> setShowByCategory( QString::null ); m_abView -> setCurrentUid( uid ); slotViewEdit(); } } void AddressbookWindow::editEntry( EntryMode entryMode ) { OContact entry; if ( !abEditor ) { abEditor = new ContactEditor( entry, this, "editor" ); } if ( entryMode == EditEntry ) abEditor->setEntry( m_abView -> currentEntry() ); else if ( entryMode == NewEntry ) abEditor->setEntry( entry ); // other things may change the caption. abEditor->setCaption( tr("Edit Address") ); #if defined(Q_WS_QWS) || defined(_WS_QWS_) abEditor->showMaximized(); #endif // 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 ); } } // populateCategories(); } void AddressbookWindow::editPersonal() { OContact entry; // Switch to personal view if not selected // but take care of the menu, too if ( ! actionPersonal->isOn() ){ qWarning("*** ++++"); actionPersonal->setOn( true ); slotPersonalView(); } if ( !abEditor ) { abEditor = new ContactEditor( entry, this, "editor" ); } abEditor->setCaption(tr("Edit My Personal Details")); abEditor->setPersonalView( true ); editEntry( EditEntry ); @@ -982,65 +983,65 @@ void AddressbookWindow::slotViewSwitched( int view ) m_tableViewButton->setOn(true); m_cardViewButton->setOn(false); break; case AbView::CardView: menu = 2; m_tableViewButton->setOn(false); m_cardViewButton->setOn(true); break; } for ( unsigned int i = 1; i < 3; i++ ){ if ( catMenu ) catMenu->setItemChecked( i, menu == (int)i ); } // Tell the view about the selected view m_abView -> setShowToView ( (AbView::Views) view ); active_view = view; } void AddressbookWindow::slotListView() { slotViewSwitched( AbView::TableView ); } 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(); int id, rememberId; id = 1; rememberId = 0; catMenu->insertItem( Resource::loadPixmap( "datebook/weeklst" ), tr( "List" ), id++ ); catMenu->insertItem( Resource::loadPixmap( "day" ), tr( "Cards" ), id++ ); // catMenu->insertItem( tr( "Personal" ), id++ ); catMenu->insertSeparator(); catMenu->insertItem( tr( "All" ), id++ ); QStringList categories = m_abView->categories(); categories.append( tr( "Unfiled" ) ); for ( QStringList::Iterator it = categories.begin(); it != categories.end(); ++it ) { catMenu->insertItem( *it, id ); if ( *it == m_abView -> showCategory() ) rememberId = id; ++id; } if ( m_abView -> showCategory().isEmpty() ) { slotSetCategory( 3 ); } 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 @@ -276,65 +276,65 @@ </property> <widget> <class>QRadioButton</class> <property stdset="1"> <name>name</name> <cstring>m_fixedBars</cstring> </property> <property stdset="1"> <name>text</name> <string>Fixed</string> </property> <property stdset="1"> <name>checked</name> <bool>true</bool> </property> <property> <name>toolTip</name> <string></string> </property> <property> <name>whatsThis</name> <string>Switch to fixed menu-/toolbars after restarting application !</string> </property> </widget> <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> <spacer> <property> <name>name</name> <cstring>Spacer3</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Vertical</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> </vbox> </widget> <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 @@ -627,68 +627,70 @@ void ContactEditor::init() { gl->addWidget( txtFirstName, 0, 1 ); l = new QLabel( tr("Middle Name"), dlgName ); gl->addWidget( l, 1, 0 ); txtMiddleName = new QLineEdit( dlgName ); gl->addWidget( txtMiddleName, 1, 1 ); l = new QLabel( tr("Last Name"), dlgName ); gl->addWidget( l, 2, 0 ); txtLastName = new QLineEdit( dlgName ); gl->addWidget( txtLastName, 2, 1 ); // l = new QLabel( tr("Suffix"), dlgName ); // gl->addWidget( l, 3, 0 ); // txtSuffix = new QLineEdit( dlgName ); // gl->addWidget( txtSuffix, 3, 1 ); space = new QSpacerItem(1,1, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ); gl->addItem( space, 4, 0 ); cmbChooserField1->insertStringList( trlChooserNames ); cmbChooserField2->insertStringList( trlChooserNames ); cmbChooserField3->insertStringList( trlChooserNames ); 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 &)) ); connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) ); connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) ); connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) ); connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) ); connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) ); connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); connect( cmbChooserField4, SIGNAL(activated(int)), this, SLOT(slotCmbChooser4Change(int)) ); connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); new QPEDialogListener(this); @@ -1028,64 +1030,74 @@ void ContactEditor::slotAddressTypeChange( int index ) { QLineEdit *txtTmp = cmbCountry->lineEdit(); txtTmp->setText( slHomeAddress[6] ); } } void ContactEditor::slotFullNameChange( const QString &textChanged ) { qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); int index = cmbFileAs->currentItem(); cmbFileAs->clear(); cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); if ( ! txtSuffix->text().isEmpty() ) cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); cmbFileAs->setCurrentItem( index ); } 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(); QDialog::accept(); } } void ContactEditor::slotNote() { dlgNote->showMaximized(); if ( !dlgNote->exec() ) { txtNote->setText( ent.notes() ); } } void ContactEditor::slotName() { QString tmpName; txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); dlgName->showMaximized(); if ( dlgName->exec() ) { 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 @@ -72,64 +72,65 @@ class ContactEditor : public QDialog { void setEntry(const OContact &entry); protected slots: void accept(); private: void init(); void saveEntry(); bool isEmpty(); void cleanupFields(); void updateDatePicker(); QString parseName( QString fullName, int type ); void chooserError( int index ); private slots: void slotChooser1Change( const QString &textChanged ); void slotChooser2Change( const QString &textChanged ); void slotChooser3Change( const QString &textChanged ); void slotChooser4Change( const QString &textChanged ); void slotCmbChooser1Change( int index ); void slotCmbChooser2Change( int index ); void slotCmbChooser3Change( int index ); void slotCmbChooser4Change( int index ); void slotAddressTypeChange( int index ); void slotAddressChange( const QString &textChanged ); 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 }; int defaultEmailChooserPosition; void populateDefaultEmailCmb(); void chooserChange( const QString&, int , QLineEdit*, int ); bool cmbChooserChange( int , QWidgetStack*, int ); OContactFields contactfields; OContact ent; QDialog *dlgNote; QDialog *dlgName; QList<QLineEdit> listValue; QList<QLabel> listName; QStringList slDynamicEntries; QStringList trlDynamicEntries; bool m_personalView; QStringList slHomeAddress; QStringList slBusinessAddress; QStringList slChooserNames; QStringList slChooserValues; QStringList emails; 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 |