-rw-r--r-- | core/pim/addressbook/TODO | 5 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 137 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.h | 12 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 5 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 11 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 3 | ||||
-rw-r--r-- | core/pim/addressbook/ocontactfields.cpp | 14 |
7 files changed, 122 insertions, 65 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index f62b075..906b462 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO @@ -1,117 +1,118 @@ 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 - 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: ----------- -- Email-button: A lot of problems.. :( +- 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 ) -- Personal and Business Web-page is not editable 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 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) - Select of primary contact (see #274 on mantis) - Category-select does not work completely: "Unfiled" is always in listview .. - Return from Contacteditor: Category resettet to all - Personal Details not working - If category changed, the letterpicker should be resetted - There should be some icons for List and Cardview - If in Cardview and a category change removes all entries: There are already entries in Cardview after up/down - Personal Details: Anniversary zeigt Fantasie-Werte - 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 diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index aec390d..55b1ba1 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -1,412 +1,419 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qpe/categoryselect.h> #include <qpe/config.h> #include <qpe/stringutil.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/timestring.h> +#include <qpe/resource.h> #include <opie/orecordlist.h> #include <qasciidict.h> #include <qdatetime.h> #include <qfile.h> #include <qregexp.h> #include <qmessagebox.h> #include "abtable.h" #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> #include <ctype.h> //toupper() for key hack /*! \class AbTableItem abtable.h \brief QTableItem based class for showing a field of an entry */ AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s, const QString &secondSortKey) : QTableItem( t, et, s ) { // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower(); sortKey = Qtopia::buildSortKey( s, secondSortKey ); } int AbTableItem::alignment() const { return AlignLeft|AlignVCenter; } QString AbTableItem::key() const { return sortKey; } // A way to reset the item, without out doing a delete or a new... void AbTableItem::setItem( const QString &txt, const QString &secondKey ) { setText( txt ); sortKey = Qtopia::buildSortKey( txt, secondKey ); // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); } /*! \class AbPickItem abtable.h \brief QTableItem based class for showing slection of an entry */ AbPickItem::AbPickItem( QTable *t ) : QTableItem(t, WhenCurrent, "?") { } QWidget *AbPickItem::createEditor() const { QComboBox* combo = new QComboBox( table()->viewport() ); ( (AbPickItem*)this )->cb = combo; AbTable* t = static_cast<AbTable*>(table()); QStringList c = t->choiceNames(); int cur = 0; for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) { if ( *it == text() ) cur = combo->count(); combo->insertItem(*it); } combo->setCurrentItem(cur); return combo; } void AbPickItem::setContentFromEditor( QWidget *w ) { if ( w->inherits("QComboBox") ) setText( ( (QComboBox*)w )->currentText() ); else QTableItem::setContentFromEditor( w ); } /*! \class AbTable abtable.h \brief QTable based class for showing a list of entries */ AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name ) : QTable( parent, name ), lastSortCol( -1 ), asc( TRUE ), intFields( order ), enablePainting( true ), columnVisible( true ), countNested( 0 ) { // qWarning("C'tor start"); setSelectionMode( NoSelection ); init(); setSorting( TRUE ); connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), this, SLOT(itemClicked(int,int)) ); contactList.clear(); // qWarning("C'tor end"); } AbTable::~AbTable() { } void AbTable::init() { // :SX showChar = '\0'; setNumRows( 0 ); setNumCols( 2 ); horizontalHeader()->setLabel( 0, tr( "Full Name" )); horizontalHeader()->setLabel( 1, tr( "Contact" )); setLeftMargin( 0 ); verticalHeader()->hide(); columnVisible = true; } void AbTable::setContacts( const OContactAccess::List& viewList ) { // qWarning("AbTable::setContacts()"); clear(); m_viewList = viewList; setSorting( false ); setPaintingEnabled( FALSE ); OContactAccess::List::Iterator it; setNumRows( m_viewList.count() ); int row = 0; for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) insertIntoTable( *it, row++ ); setSorting( true ); resort(); updateVisible(); setPaintingEnabled( TRUE ); } bool AbTable::selectContact( int UID ) { // qWarning( "AbTable::selectContact( %d )", UID ); int rows = numRows(); AbTableItem *abi; OContact* foundContact = 0l; bool found = false; setPaintingEnabled( FALSE ); for ( int r = 0; r < rows; ++r ) { abi = static_cast<AbTableItem*>( item(r, 0) ); foundContact = &contactList[abi]; if ( foundContact -> uid() == UID ){ ensureCellVisible( r, 0 ); setCurrentCell( r, 0 ); found = true; break; } } if ( !found ){ ensureCellVisible( 0,0 ); setCurrentCell( 0, 0 ); } setPaintingEnabled( TRUE ); return true; } void AbTable::insertIntoTable( const OContact& cnt, int row ) { // qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); - QString strName, - strContact; + QString strName; + ContactItem contactItem; strName = findContactName( cnt ); - strContact = findContactContact( cnt, row ); + contactItem = findContactContact( cnt, row ); AbTableItem *ati; - ati = new AbTableItem( this, QTableItem::Never, strName, strContact); + ati = new AbTableItem( this, QTableItem::Never, strName, contactItem.value ); contactList.insert( ati, cnt ); setItem( row, 0, ati ); - ati = new AbTableItem( this, QTableItem::Never, strContact, strName); + ati = new AbTableItem( this, QTableItem::Never, contactItem.value, strName); + if ( !contactItem.icon.isNull() ) + ati->setPixmap( contactItem.icon ); setItem( row, 1, ati ); //### cannot do this; table only has two columns at this point // setItem( row, 2, new AbPickItem( this ) ); } void AbTable::columnClicked( int col ) { if ( !sorting() ) return; if ( lastSortCol == -1 ) lastSortCol = col; if ( col == lastSortCol ) { asc = !asc; } else { lastSortCol = col; asc = TRUE; } //QMessageBox::information( this, "resort", "columnClicked" ); resort(); } void AbTable::resort() { // qWarning( "void AbTable::resort()" ); setPaintingEnabled( FALSE ); if ( sorting() ) { if ( lastSortCol == -1 ) lastSortCol = 0; sortColumn( lastSortCol, asc, TRUE ); //QMessageBox::information( this, "resort", "resort" ); updateVisible(); } setPaintingEnabled( TRUE ); } OContact AbTable::currentEntry() { // qWarning( "OContact AbTable::currentEntry()" ); OContact cnt; AbTableItem *abItem; abItem = static_cast<AbTableItem*>(item( currentRow(), 0 )); if ( abItem ) { cnt = contactList[abItem]; //cnt = contactList[currentRow()]; } return cnt; } int AbTable::currentEntry_UID() { return ( currentEntry().uid() ); } void AbTable::clear() { // qWarning( "void AbTable::clear()" ); contactList.clear(); setPaintingEnabled( FALSE ); for ( int r = 0; r < numRows(); ++r ) { for ( int c = 0; c < numCols(); ++c ) { if ( cellWidget( r, c ) ) clearCellWidget( r, c ); clearCell( r, c ); } } setNumRows( 0 ); setPaintingEnabled( TRUE ); } // Refresh updates column 2 if the contactsettings changed void AbTable::refresh() { // qWarning( "void AbTable::refresh()" ); int rows = numRows(); - QString value; AbTableItem *abi; + ContactItem contactItem; setPaintingEnabled( FALSE ); for ( int r = 0; r < rows; ++r ) { abi = static_cast<AbTableItem*>( item(r, 0) ); - value = findContactContact( contactList[abi], r ); - static_cast<AbTableItem*>( item(r, 1) )->setItem( value, abi->text() ); + contactItem = findContactContact( contactList[abi], r ); + static_cast<AbTableItem*>( item(r, 1) )->setItem( contactItem.value, abi->text() ); + if ( !contactItem.icon.isNull() ) + static_cast<AbTableItem*>( item(r, 1) )-> + setPixmap( contactItem.icon ); + } resort(); setPaintingEnabled( TRUE ); } void AbTable::keyPressEvent( QKeyEvent *e ) { char key = toupper( e->ascii() ); if ( key >= 'A' && key <= 'Z' ) moveTo( key ); // qWarning("Received key .."); switch( e->key() ) { case Qt::Key_Space: case Qt::Key_Return: case Qt::Key_Enter: emit signalSwitch(); break; // case Qt::Key_Up: // qWarning("a"); // emit signalKeyUp(); // break; // case Qt::Key_Down: // qWarning("b"); // emit signalKeyDown(); // break; default: QTable::keyPressEvent( e ); } } void AbTable::moveTo( char c ) { qWarning( "void AbTable::moveTo( char c )" ); int rows = numRows(); QString value; AbTableItem *abi; int r; if ( asc ) { r = 0; while ( r < rows-1) { abi = static_cast<AbTableItem*>( item(r, 0) ); QChar first = abi->key()[0]; //### is there a bug in QChar to char comparison??? if ( first.row() || first.cell() >= c ) break; r++; } } else { //### should probably disable reverse sorting instead r = rows - 1; while ( r > 0 ) { abi = static_cast<AbTableItem*>( item(r, 0) ); QChar first = abi->key()[0]; //### is there a bug in QChar to char comparison??? if ( first.row() || first.cell() >= c ) break; r--; } } setCurrentCell( r, currentColumn() ); } QString AbTable::findContactName( const OContact &entry ) { // We use the fileAs, then company, defaultEmail QString str; str = entry.fileAs(); if ( str.isEmpty() ) { str = entry.company(); if ( str.isEmpty() ) { str = entry.defaultEmail(); } } return str; } void AbTable::resizeRows() { /* if (numRows()) { for (int i = 0; i < numRows(); i++) { setRowHeight( i, size ); } } updateVisible(); */ } void AbTable::realignTable() @@ -525,223 +532,249 @@ void AbTable::setChoiceSelection( const QValueList<int>& list ) { intFields = list; } QStringList AbTable::choiceSelection(int /*index*/) const { QStringList r; /* ###### QString selname = choicenames.at(index); for (each row) { OContact *c = contactForRow(row); if ( text(row,2) == selname ) { r.append(c->email); } } */ return r; } void AbTable::updateVisible() { // qWarning("void AbTable::updateVisible()"); int visible, totalRows, row, selectedRow = 0; visible = 0; setPaintingEnabled( FALSE ); realignTable(); totalRows = numRows(); for ( row = 0; row < totalRows; row++ ) { if ( rowHeight(row) == 0 ) { showRow( row ); adjustRow( row ); if ( isSelected( row,0 ) || isSelected( row,1 ) ) selectedRow = row; } visible++; } if ( selectedRow ) setCurrentCell( selectedRow, 0 ); if ( !visible ) setCurrentCell( -1, 0 ); setPaintingEnabled( TRUE ); } void AbTable::setPaintingEnabled( bool e ) { // qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); if ( e ) { if ( countNested > 0 ) --countNested; if ( ! countNested ){ setUpdatesEnabled( true ); enablePainting = true; rowHeightChanged( 0 ); viewport()->update(); } } else { ++countNested; enablePainting = false; setUpdatesEnabled( false ); } // qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); } void AbTable::viewportPaintEvent( QPaintEvent* e ) { // qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); if ( enablePainting ) QTable::viewportPaintEvent( e ); } void AbTable::rowHeightChanged( int row ) { if ( enablePainting ) QTable::rowHeightChanged( row ); } -QString AbTable::findContactContact( const OContact &entry, int /* row */ ) +ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) { - QString value; - value = ""; + + ContactItem item; + + item.value = ""; + for ( QValueList<int>::ConstIterator it = intFields.begin(); it != intFields.end(); ++it ) { switch ( *it ) { default: break; case Qtopia::Title: - value = entry.title(); + item.value = entry.title(); break; case Qtopia::Suffix: - value = entry.suffix(); + item.value = entry.suffix(); break; case Qtopia::FileAs: - value = entry.fileAs(); + item.value = entry.fileAs(); break; case Qtopia::DefaultEmail: - value = entry.defaultEmail(); + item.value = entry.defaultEmail(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/email" ); + break; case Qtopia::Emails: - value = entry.emails(); + item.value = entry.emails(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/email" ); break; case Qtopia::HomeStreet: - value = entry.homeStreet(); + item.value = entry.homeStreet(); break; case Qtopia::HomeCity: - value = entry.homeCity(); + item.value = entry.homeCity(); break; case Qtopia::HomeState: - value = entry.homeState(); + item.value = entry.homeState(); break; case Qtopia::HomeZip: - value = entry.homeZip(); + item.value = entry.homeZip(); break; case Qtopia::HomeCountry: - value = entry.homeCountry(); + item.value = entry.homeCountry(); break; case Qtopia::HomePhone: - value = entry.homePhone(); + item.value = entry.homePhone(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/phonehome" ); break; case Qtopia::HomeFax: - value = entry.homeFax(); + item.value = entry.homeFax(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/faxhome" ); break; case Qtopia::HomeMobile: - value = entry.homeMobile(); + item.value = entry.homeMobile(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/mobilehome" ); break; case Qtopia::HomeWebPage: - value = entry.homeWebpage(); + item.value = entry.homeWebpage(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/webpagehome" ); break; case Qtopia::Company: - value = entry.company(); + item.value = entry.company(); break; case Qtopia::BusinessCity: - value = entry.businessCity(); + item.value = entry.businessCity(); break; case Qtopia::BusinessStreet: - value = entry.businessStreet(); + item.value = entry.businessStreet(); break; case Qtopia::BusinessZip: - value = entry.businessZip(); + item.value = entry.businessZip(); break; case Qtopia::BusinessCountry: - value = entry.businessCountry(); + item.value = entry.businessCountry(); break; case Qtopia::BusinessWebPage: - value = entry.businessWebpage(); + item.value = entry.businessWebpage(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/webpagework" ); break; case Qtopia::JobTitle: - value = entry.jobTitle(); + item.value = entry.jobTitle(); break; case Qtopia::Department: - value = entry.department(); + item.value = entry.department(); break; case Qtopia::Office: - value = entry.office(); + item.value = entry.office(); break; case Qtopia::BusinessPhone: - value = entry.businessPhone(); + item.value = entry.businessPhone(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/phonework" ); break; case Qtopia::BusinessFax: - value = entry.businessFax(); + item.value = entry.businessFax(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/faxwork" ); break; case Qtopia::BusinessMobile: - value = entry.businessMobile(); + item.value = entry.businessMobile(); + if ( !item.value.isEmpty() ) + item.icon = Resource::loadPixmap( "addressbook/mobilework" ); break; case Qtopia::BusinessPager: - value = entry.businessPager(); + item.value = entry.businessPager(); break; case Qtopia::Profession: - value = entry.profession(); + item.value = entry.profession(); break; case Qtopia::Assistant: - value = entry.assistant(); + item.value = entry.assistant(); break; case Qtopia::Manager: - value = entry.manager(); + item.value = entry.manager(); break; case Qtopia::Spouse: - value = entry.spouse(); + item.value = entry.spouse(); break; case Qtopia::Gender: - value = entry.gender(); + item.value = entry.gender(); break; case Qtopia::Birthday: - if ( ! entry.birthday().isNull() ) - value = TimeString::numberDateString( entry.birthday() ); + if ( ! entry.birthday().isNull() ){ + item.value = TimeString::numberDateString( entry.birthday() ); + } break; case Qtopia::Anniversary: - if ( ! entry.anniversary().isNull() ) - value = TimeString::numberDateString( entry.anniversary() ); + if ( ! entry.anniversary().isNull() ){ + item.value = TimeString::numberDateString( entry.anniversary() ); + } break; case Qtopia::Nickname: - value = entry.nickname(); + item.value = entry.nickname(); break; case Qtopia::Children: - value = entry.children(); + item.value = entry.children(); break; case Qtopia::Notes: - value = entry.notes(); + item.value = entry.notes(); break; } - if ( !value.isEmpty() ) + if ( !item.value.isEmpty() ) break; } - return value; + return item; } diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index 9825665..092e86f 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h @@ -1,137 +1,147 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef ABTABLE_H #define ABTABLE_H #include <qpe/categories.h> #include <opie/ocontact.h> #include <opie/ocontactaccess.h> #include <qmap.h> #include <qtable.h> #include <qstringlist.h> #include <qcombobox.h> +#include <qpixmap.h> class AbTableItem : public QTableItem { public: AbTableItem( QTable *t, EditType et, const QString &s, const QString &secondSortKey); QString entryKey() const; void setEntryKey( const QString & k ); virtual int alignment() const; virtual QString key() const; void setItem( const QString &txt, const QString &secondKey ); private: QString sortKey; }; +// This is a simple container, storing all contact +// information +class ContactItem +{ + public: + QPixmap icon; + QString value; +}; + class AbPickItem : public QTableItem { public: AbPickItem( QTable *t ); QWidget *createEditor() const; void setContentFromEditor( QWidget *w ); private: QGuardedPtr<QComboBox> cb; }; class AbTable : public QTable { Q_OBJECT public: AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); ~AbTable(); // Set the contacts shown in the table void setContacts( const OContactAccess::List& viewList ); // Selects a contact of a specific UID bool selectContact( int UID ); // Get the current selected entry OContact currentEntry(); // Get the UID of the current selected Entry int currentEntry_UID(); QString findContactName( const OContact &entry ); void init(); void clear(); void refresh(); void show(); void setPaintingEnabled( bool e ); void viewportPaintEvent( QPaintEvent* e); // addresspicker mode (What's that ? se) void setChoiceNames( const QStringList& list); QStringList choiceNames() const; void setChoiceSelection( const QValueList<int>& list ); QStringList choiceSelection(int index) const; signals: void signalSwitch(); void signalEditor(); void signalKeyDown(); void signalKeyUp(); protected: virtual void keyPressEvent( QKeyEvent *e ); // int rowHeight( int ) const; // int rowPos( int row ) const; // virtual int rowAt( int pos ) const; protected slots: void moveTo( char ); virtual void columnClicked( int col ); void itemClicked(int,int col); void rowHeightChanged( int row ); private: void insertIntoTable( const OContact &cnt, int row ); - QString findContactContact( const OContact &entry, int row ); + ContactItem findContactContact( const OContact &entry, int row ); void fitColumns(); void resizeRows(); void realignTable(); void resort(); void updateVisible(); int lastSortCol; bool asc; QMap<AbTableItem*, OContact> contactList; QValueList<int> intFields; QStringList choicenames; bool enablePainting; bool columnVisible; int countNested; OContactAccess::List m_viewList; }; #endif // ABTABLE_H diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index ad8315d..881b839 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -108,206 +108,207 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, QString::null, 0, this, 0 ); connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); m_tableViewButton->setToggleAction( true ); m_tableViewButton->addTo( listTools ); m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 ); connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); m_cardViewButton->setToggleAction( true ); m_cardViewButton->addTo( listTools ); listTools->addSeparator(); // Other Buttons QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); actionNew = a; connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) ); a->addTo( edit ); a->addTo( listTools ); a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); actionEdit = a; connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); a->addTo( edit ); a->addTo( listTools ); a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 0, this, 0 ); actionTrash = a; connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); a->addTo( edit ); a->addTo( listTools ); // make it possible to go directly to businesscard via qcop call //#if defined(Q_WS_QWS) // Why this ? (se) #if !defined(QT_NO_COP) QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); #endif // #endif a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 ); actionFind = a; connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); a->addTo( edit ); a->addTo( listTools ); // Much better search widget, taken from QTReader.. (se) searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); searchBar->setHorizontalStretchable( TRUE ); searchBar->hide(); searchEdit = new QLineEdit( searchBar, "searchEdit" ); // QFont f("unifont", 16 /*, QFont::Bold*/); // searchEdit->setFont( f ); searchBar->setStretchableWidget( searchEdit ); connect( searchEdit, SIGNAL( returnPressed( ) ), this, SLOT( slotFind( ) ) ); a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); a->addTo( searchBar ); a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); a->addTo( searchBar ); a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), QString::null, 0, this, 0 ); //a->setEnabled( FALSE ); we got support for it now :) zecke actionMail = a; connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) ); a->addTo( edit ); a->addTo( listTools ); if ( Ir::supported() ) { a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); actionBeam = a; connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); a->addTo( edit ); a->addTo( listTools ); } edit->insertSeparator(); a = new QAction( tr("Import vCard"), QString::null, 0, 0); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); a->addTo( edit ); edit->insertSeparator(); - a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); + a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), + QString::null, 0, this, 0 ); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); a->addTo( edit ); #ifdef __DEBUG_RELEASE // Remove this function for public Release ! This is only // for debug purposes .. a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); a->addTo( edit ); #endif - a = new QAction( tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, + a = new QAction( tr( "Config" ), Resource::loadPixmap( "addressbook/configure" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); a->addTo( edit ); // Create Views listContainer = new QWidget( this ); QVBoxLayout *vb = new QVBoxLayout( listContainer ); m_abView = new AbView( listContainer, m_config.orderList() ); vb->addWidget( m_abView ); // abList->setHScrollBarMode( QScrollView::AlwaysOff ); connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), this, SLOT( slotViewSwitched( int ) ) ); QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); m_abView->load(); // Letter Picker pLabel = new LetterPicker( listContainer ); connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); vb->addWidget( pLabel ); // Category Menu catMenu = new QPopupMenu( this ); catMenu->setCheckable( TRUE ); connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); populateCategories(); mbList->insertItem( tr("View"), catMenu ); defaultFont = new QFont( m_abView->font() ); slotSetFont(m_config.fontSize()); m_curFontSize = m_config.fontSize(); setCentralWidget(listContainer); // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); isLoading = false; } void AddressbookWindow::slotConfig() { ConfigDlg* dlg = new ConfigDlg( this, "Config" ); dlg -> setConfig( m_config ); dlg -> showMaximized(); if ( dlg -> exec() ) { qWarning ("Config Dialog accepted!"); m_config = dlg -> getConfig(); if ( m_curFontSize != m_config.fontSize() ){ qWarning("Font was changed!"); m_curFontSize = m_config.fontSize(); emit slotSetFont( m_curFontSize ); } m_abView -> setListOrder( m_config.orderList() ); } delete dlg; } void AddressbookWindow::slotSetFont( int size ) { qWarning("void AddressbookWindow::slotSetFont( %d )", size); if (size > 2 || size < 0) size = 1; m_config.setFontSize( size ); QFont *currentFont; switch (size) { case 0: m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); currentFont = new QFont (m_abView->font()); // abList->resizeRows(currentFont->pixelSize() + 7); :SX // abList->resizeRows(); break; case 1: m_abView->setFont( *defaultFont ); currentFont = new QFont (m_abView->font()); // // abList->resizeRows(currentFont->pixelSize() + 7); // abList->resizeRows(); break; case 2: m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); currentFont = new QFont (m_abView->font()); // //abList->resizeRows(currentFont->pixelSize() + 7); // abList->resizeRows(); break; diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index afba688..f5c0c5b 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp @@ -1,115 +1,126 @@ #include "configdlg.h" #include "ocontactfields.h" + #include <qcheckbox.h> #include <qradiobutton.h> #include <qlistbox.h> #include <qpushbutton.h> +#include <qiconset.h> + +#include <qpe/resource.h> #include <opie/ocontact.h> ConfigDlg::ConfigDlg( QWidget *parent, const char *name): ConfigDlg_Base(parent, name, true ) { contFields = OContactFields::trfields(); // We add all Fields into the Listbox for (uint i=0; i < contFields.count(); i++) { allFieldListBox->insertItem( contFields[i] ); } + // Set Pics to Buttons and Tabs + m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); + m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); + m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); + m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); + + // Get the translation maps between Field ID and translated strings m_mapStrToID = OContactFields::trFieldsToId(); m_mapIDToStr = OContactFields::idToTrFields(); connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); } void ConfigDlg::slotItemUp() { qWarning( "void ConfigDlg::slotItemUp()" ); int i = fieldListBox->currentItem(); if ( i > 0 ) { QString item = fieldListBox->currentText(); fieldListBox->removeItem( i ); fieldListBox->insertItem( item, i-1 ); fieldListBox->setCurrentItem( i-1 ); } } void ConfigDlg::slotItemDown() { qWarning( "void ConfigDlg::slotItemDown()" ); int i = fieldListBox->currentItem(); if ( i < (int)fieldListBox->count() - 1 ) { QString item = fieldListBox->currentText(); fieldListBox->removeItem( i ); fieldListBox->insertItem( item, i+1 ); fieldListBox->setCurrentItem( i+1 ); } } void ConfigDlg::slotItemAdd() { qWarning( "void ConfigDlg::slotItemAdd()" ); int i = allFieldListBox->currentItem(); if ( i > 0 ) { QString item = allFieldListBox->currentText(); qWarning("ADding %s", item.latin1()); fieldListBox->insertItem( item ); } } void ConfigDlg::slotItemRemove() { qWarning( "void ConfigDlg::slotItemRemove()" ); int i = fieldListBox->currentItem(); if ( i > 0 ) { fieldListBox->removeItem( i ); } } void ConfigDlg::setConfig( const AbConfig& cnf ) { m_config = cnf; m_useRegExp->setChecked( m_config.useRegExp() ); m_useWildCard->setChecked( m_config.useWildCards() ); m_useQtMail->setChecked( m_config.useQtMail() ); m_useOpieMail->setChecked( m_config.useOpieMail() ); m_useCaseSensitive->setChecked( m_config.beCaseSensitive() ); switch( m_config.fontSize() ){ case 0: m_smallFont->setChecked( true ); m_normalFont->setChecked( false ); m_largeFont->setChecked( false ); break; case 1: m_smallFont->setChecked( false ); m_normalFont->setChecked( true ); m_largeFont->setChecked( false ); break; case 2: m_smallFont->setChecked( false ); m_normalFont->setChecked( false ); m_largeFont->setChecked( true ); break; } for( uint i = 0; i < m_config.orderList().count(); i++ ) { fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); } } AbConfig ConfigDlg::getConfig() { diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 9efb8c0..97573af 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -455,196 +455,195 @@ void ContactEditor::init() { cmbCountry->setMaximumWidth( 135 ); gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); cmbChooserField4 = new QComboBox( FALSE, container ); cmbChooserField4->setMaximumWidth( 90 ); gl->addWidget( cmbChooserField4, 6, 0 ); txtChooserField4 = new QLineEdit( container ); gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); QSpacerItem *space = new QSpacerItem(1,1, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ); gl->addItem( space, 7, 0 ); tabMain->insertTab( tabViewport, tr( "Address" ) ); tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svDetails = new QScrollView( tabViewport ); vb->addWidget( svDetails, 0, 0 ); svDetails->setResizePolicy( QScrollView::AutoOneFit ); svDetails->setFrameStyle( QFrame::NoFrame ); container = new QWidget( svDetails->viewport() ); svDetails->addChild( container ); gl = new QGridLayout( container, 1, 2, 2, 4 ); int counter = 0; // Birthday QHBox* hBox = new QHBox( container ); l = new QLabel( tr("Birthday"), container ); gl->addWidget( l, counter, 0 ); QPopupMenu* m1 = new QPopupMenu( container ); birthdayPicker = new DateBookMonth( m1, 0, TRUE ); m1->insertItem( birthdayPicker ); birthdayButton= new QToolButton( hBox, "buttonStart" ); birthdayButton->setPopup( m1 ); birthdayButton->setPopupDelay(0); QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), tr( "Delete" ), hBox, 0 ); gl->addWidget( hBox, counter , 1 ); connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); ++counter; // Anniversary hBox = new QHBox( container ); l = new QLabel( tr("Anniversary"), container ); gl->addWidget( l, counter, 0 ); m1 = new QPopupMenu( container ); anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); m1->insertItem( anniversaryPicker ); anniversaryButton= new QToolButton( hBox, "buttonStart" ); anniversaryButton->setPopup( m1 ); anniversaryButton->setPopupDelay(0); deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), tr( "Delete" ), hBox, 0 ); gl->addWidget( hBox, counter , 1 ); connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); ++counter; // Gender l = new QLabel( tr("Gender"), container ); gl->addWidget( l, counter, 0 ); cmbGender = new QComboBox( container ); cmbGender->insertItem( "", 0 ); cmbGender->insertItem( tr("Male"), 1); cmbGender->insertItem( tr("Female"), 2); gl->addWidget( cmbGender, counter, 1 ); ++counter; // Create Labels and lineedit fields for every dynamic entry QStringList::ConstIterator it = slDynamicEntries.begin(); - QStringList::ConstIterator trit = trlDynamicEntries.begin(); QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); - for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { + for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { if (((*it) == "Anniversary") || ((*it) == "Birthday")|| ((*it) == "Gender")) continue; l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); listName.append( l ); gl->addWidget( l, i, 0 ); QLineEdit *e = new QLineEdit( container ); listValue.append( e ); gl->addWidget( e, i, 1); } // Fill labels with names.. // loadFields(); tabMain->insertTab( tabViewport, tr( "Details" ) ); dlgNote = new QDialog( this, "Note Dialog", TRUE ); dlgNote->setCaption( tr("Enter Note") ); QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); txtNote = new QMultiLineEdit( dlgNote ); vbNote->addWidget( txtNote ); connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); dlgName = new QDialog( this, "Name Dialog", TRUE ); dlgName->setCaption( tr("Edit Name") ); gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); l = new QLabel( tr("First Name"), dlgName ); gl->addWidget( l, 0, 0 ); txtFirstName = new QLineEdit( dlgName ); 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( 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)) ); diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp index 18b68c4..ffb88e8 100644 --- a/core/pim/addressbook/ocontactfields.cpp +++ b/core/pim/addressbook/ocontactfields.cpp @@ -1,293 +1,295 @@ #include "ocontactfields.h" #include <qstringlist.h> #include <qobject.h> // We should use our own enum in the future .. #include <qpe/recordfields.h> #include <qpe/config.h> #include <opie/ocontact.h> /*! \internal Returns a list of details field names for a contact. */ QStringList OContactFields::untrdetailsfields( bool sorted ) { QStringList list; QMap<int, QString> mapIdToStr = idToUntrFields(); list.append( mapIdToStr[ Qtopia::Office ] ); list.append( mapIdToStr[ Qtopia::Profession ] ); list.append( mapIdToStr[ Qtopia::Assistant ] ); list.append( mapIdToStr[ Qtopia::Manager ] ); list.append( mapIdToStr[ Qtopia::Spouse ] ); list.append( mapIdToStr[ Qtopia::Gender ] ); list.append( mapIdToStr[ Qtopia::Birthday ] ); list.append( mapIdToStr[ Qtopia::Anniversary ] ); list.append( mapIdToStr[ Qtopia::Nickname ] ); list.append( mapIdToStr[ Qtopia::Children ] ); if (sorted) list.sort(); return list; } /*! \internal Returns a translated list of details field names for a contact. */ QStringList OContactFields::trdetailsfields( bool sorted ) { QStringList list; QMap<int, QString> mapIdToStr = idToTrFields(); list.append( mapIdToStr[Qtopia::Office] ); list.append( mapIdToStr[Qtopia::Profession] ); list.append( mapIdToStr[Qtopia::Assistant] ); list.append( mapIdToStr[Qtopia::Manager] ); list.append( mapIdToStr[Qtopia::Spouse] ); list.append( mapIdToStr[Qtopia::Gender] ); list.append( mapIdToStr[Qtopia::Birthday] ); list.append( mapIdToStr[Qtopia::Anniversary] ); list.append( mapIdToStr[Qtopia::Nickname] ); list.append( mapIdToStr[Qtopia::Children] ); if (sorted) list.sort(); return list; } /*! \internal Returns a translated list of phone field names for a contact. */ QStringList OContactFields::trphonefields( bool sorted ) { QStringList list; QMap<int, QString> mapIdToStr = idToTrFields(); list.append( mapIdToStr[Qtopia::BusinessPhone] ); list.append( mapIdToStr[Qtopia::BusinessFax] ); list.append( mapIdToStr[Qtopia::BusinessMobile] ); + list.append( mapIdToStr[Qtopia::BusinessPager] ); + list.append( mapIdToStr[Qtopia::BusinessWebPage] ); list.append( mapIdToStr[Qtopia::DefaultEmail] ); list.append( mapIdToStr[Qtopia::Emails] ); list.append( mapIdToStr[Qtopia::HomePhone] ); list.append( mapIdToStr[Qtopia::HomeFax] ); list.append( mapIdToStr[Qtopia::HomeMobile] ); + // list.append( mapIdToStr[Qtopia::HomePager] ); + list.append( mapIdToStr[Qtopia::HomeWebPage] ); if (sorted) list.sort(); return list; } /*! \internal Returns a list of phone field names for a contact. */ QStringList OContactFields::untrphonefields( bool sorted ) { QStringList list; QMap<int, QString> mapIdToStr = idToUntrFields(); list.append( mapIdToStr[ Qtopia::BusinessPhone ] ); list.append( mapIdToStr[ Qtopia::BusinessFax ] ); list.append( mapIdToStr[ Qtopia::BusinessMobile ] ); + list.append( mapIdToStr[ Qtopia::BusinessPager ] ); + list.append( mapIdToStr[ Qtopia::BusinessWebPage ] ); list.append( mapIdToStr[ Qtopia::DefaultEmail ] ); list.append( mapIdToStr[ Qtopia::Emails ] ); list.append( mapIdToStr[ Qtopia::HomePhone ] ); list.append( mapIdToStr[ Qtopia::HomeFax ] ); list.append( mapIdToStr[ Qtopia::HomeMobile ] ); + //list.append( mapIdToStr[Qtopia::HomePager] ); + list.append( mapIdToStr[Qtopia::HomeWebPage] ); if (sorted) list.sort(); return list; } /*! \internal Returns a translated list of field names for a contact. */ QStringList OContactFields::trfields( bool sorted ) { QStringList list; QMap<int, QString> mapIdToStr = idToTrFields(); list.append( mapIdToStr[Qtopia::Title]); list.append( mapIdToStr[Qtopia::FirstName] ); list.append( mapIdToStr[Qtopia::MiddleName] ); list.append( mapIdToStr[Qtopia::LastName] ); list.append( mapIdToStr[Qtopia::Suffix] ); list.append( mapIdToStr[Qtopia::FileAs] ); list.append( mapIdToStr[Qtopia::JobTitle] ); list.append( mapIdToStr[Qtopia::Department] ); list.append( mapIdToStr[Qtopia::Company] ); list += trphonefields( sorted ); list.append( mapIdToStr[Qtopia::BusinessStreet] ); list.append( mapIdToStr[Qtopia::BusinessCity] ); list.append( mapIdToStr[Qtopia::BusinessState] ); list.append( mapIdToStr[Qtopia::BusinessZip] ); list.append( mapIdToStr[Qtopia::BusinessCountry] ); - list.append( mapIdToStr[Qtopia::BusinessPager] ); - list.append( mapIdToStr[Qtopia::BusinessWebPage] ); list.append( mapIdToStr[Qtopia::HomeStreet] ); list.append( mapIdToStr[Qtopia::HomeCity] ); list.append( mapIdToStr[Qtopia::HomeState] ); list.append( mapIdToStr[Qtopia::HomeZip] ); list.append( mapIdToStr[Qtopia::HomeCountry] ); - list.append( mapIdToStr[Qtopia::HomeWebPage] ); list += trdetailsfields( sorted ); list.append( mapIdToStr[Qtopia::Notes] ); list.append( mapIdToStr[Qtopia::Groups] ); if (sorted) list.sort(); return list; } /*! \internal Returns an untranslated list of field names for a contact. */ QStringList OContactFields::untrfields( bool sorted ) { QStringList list; QMap<int, QString> mapIdToStr = idToUntrFields(); list.append( mapIdToStr[ Qtopia::Title ] ); list.append( mapIdToStr[ Qtopia::FirstName ] ); list.append( mapIdToStr[ Qtopia::MiddleName ] ); list.append( mapIdToStr[ Qtopia::LastName ] ); list.append( mapIdToStr[ Qtopia::Suffix ] ); list.append( mapIdToStr[ Qtopia::FileAs ] ); list.append( mapIdToStr[ Qtopia::JobTitle ] ); list.append( mapIdToStr[ Qtopia::Department ] ); list.append( mapIdToStr[ Qtopia::Company ] ); list += untrphonefields( sorted ); list.append( mapIdToStr[ Qtopia::BusinessStreet ] ); list.append( mapIdToStr[ Qtopia::BusinessCity ] ); list.append( mapIdToStr[ Qtopia::BusinessState ] ); list.append( mapIdToStr[ Qtopia::BusinessZip ] ); list.append( mapIdToStr[ Qtopia::BusinessCountry ] ); - list.append( mapIdToStr[ Qtopia::BusinessPager ] ); - list.append( mapIdToStr[ Qtopia::BusinessWebPage ] ); list.append( mapIdToStr[ Qtopia::HomeStreet ] ); list.append( mapIdToStr[ Qtopia::HomeCity ] ); list.append( mapIdToStr[ Qtopia::HomeState ] ); list.append( mapIdToStr[ Qtopia::HomeZip ] ); list.append( mapIdToStr[ Qtopia::HomeCountry ] ); - list.append( mapIdToStr[ Qtopia::HomeWebPage] ); list += untrdetailsfields( sorted ); list.append( mapIdToStr[ Qtopia::Notes ] ); list.append( mapIdToStr[ Qtopia::Groups ] ); if (sorted) list.sort(); return list; } QMap<int, QString> OContactFields::idToTrFields() { QMap<int, QString> ret_map; ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") ); ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" )); ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) ); ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) ); ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) ); ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) ); ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) ); ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) ); ret_map.insert( Qtopia::BusinessMobile, QObject::tr( "Business Mobile" )); // email ret_map.insert( Qtopia::DefaultEmail, QObject::tr( "Default Email" ) ); ret_map.insert( Qtopia::Emails, QObject::tr( "Emails" ) ); ret_map.insert( Qtopia::HomePhone, QObject::tr( "Home Phone" ) ); ret_map.insert( Qtopia::HomeFax, QObject::tr( "Home Fax" ) ); ret_map.insert( Qtopia::HomeMobile, QObject::tr( "Home Mobile" ) ); // business ret_map.insert( Qtopia::BusinessStreet, QObject::tr( "Business Street" ) ); ret_map.insert( Qtopia::BusinessCity, QObject::tr( "Business City" ) ); ret_map.insert( Qtopia::BusinessState, QObject::tr( "Business State" ) ); ret_map.insert( Qtopia::BusinessZip, QObject::tr( "Business Zip" ) ); ret_map.insert( Qtopia::BusinessCountry, QObject::tr( "Business Country" ) ); ret_map.insert( Qtopia::BusinessPager, QObject::tr( "Business Pager" ) ); ret_map.insert( Qtopia::BusinessWebPage, QObject::tr( "Business WebPage" ) ); ret_map.insert( Qtopia::Office, QObject::tr( "Office" ) ); ret_map.insert( Qtopia::Profession, QObject::tr( "Profession" ) ); ret_map.insert( Qtopia::Assistant, QObject::tr( "Assistant" ) ); ret_map.insert( Qtopia::Manager, QObject::tr( "Manager" ) ); // home ret_map.insert( Qtopia::HomeStreet, QObject::tr( "Home Street" ) ); ret_map.insert( Qtopia::HomeCity, QObject::tr( "Home City" ) ); ret_map.insert( Qtopia::HomeState, QObject::tr( "Home State" ) ); ret_map.insert( Qtopia::HomeZip, QObject::tr( "Home Zip" ) ); ret_map.insert( Qtopia::HomeCountry, QObject::tr( "Home Country" ) ); ret_map.insert( Qtopia::HomeWebPage, QObject::tr( "Home Web Page" ) ); //personal ret_map.insert( Qtopia::Spouse, QObject::tr( "Spouse" ) ); ret_map.insert( Qtopia::Gender, QObject::tr( "Gender" ) ); ret_map.insert( Qtopia::Birthday, QObject::tr( "Birthday" ) ); ret_map.insert( Qtopia::Anniversary, QObject::tr( "Anniversary" ) ); ret_map.insert( Qtopia::Nickname, QObject::tr( "Nickname" ) ); ret_map.insert( Qtopia::Children, QObject::tr( "Children" ) ); // other ret_map.insert( Qtopia::Notes, QObject::tr( "Notes" ) ); return ret_map; } QMap<int, QString> OContactFields::idToUntrFields() { QMap<int, QString> ret_map; ret_map.insert( Qtopia::Title, "Name Title" ); ret_map.insert( Qtopia::FirstName, "First Name" ); ret_map.insert( Qtopia::MiddleName, "Middle Name" ); ret_map.insert( Qtopia::LastName, "Last Name" ); ret_map.insert( Qtopia::Suffix, "Suffix" ); ret_map.insert( Qtopia::FileAs, "File As" ); ret_map.insert( Qtopia::JobTitle, "Job Title" ); ret_map.insert( Qtopia::Department, "Department" ); ret_map.insert( Qtopia::Company, "Company" ); ret_map.insert( Qtopia::BusinessPhone, "Business Phone" ); ret_map.insert( Qtopia::BusinessFax, "Business Fax" ); ret_map.insert( Qtopia::BusinessMobile, "Business Mobile" ); // email ret_map.insert( Qtopia::DefaultEmail, "Default Email" ); ret_map.insert( Qtopia::Emails, "Emails" ); ret_map.insert( Qtopia::HomePhone, "Home Phone" ); |