author | eilers <eilers> | 2003-02-23 15:29:19 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-02-23 15:29:19 (UTC) |
commit | 3756fa1506f6cbf782a9ea38036fd7ea965a83d8 (patch) (side-by-side diff) | |
tree | 41ca42c2606ada15ecaebfde033de2eefab42c00 | |
parent | 20224076b50a7426e9c6c88ed245f54283108eff (diff) | |
download | opie-3756fa1506f6cbf782a9ea38036fd7ea965a83d8.zip opie-3756fa1506f6cbf782a9ea38036fd7ea965a83d8.tar.gz opie-3756fa1506f6cbf782a9ea38036fd7ea965a83d8.tar.bz2 |
Added icons. Especially the main-contact table has an icon
to show whether it is a work-, home- number or if it
is a mobile...
The pictures may need improvements due to my incompetence in creating pictures..
Do we have anyone who may paint such stuff ?
-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 @@ -15,13 +15,14 @@ Feature requests: - 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.. @@ -33,13 +34,12 @@ 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 ! @@ -112,6 +112,7 @@ Fixed/Ready: 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 @@ -22,12 +22,13 @@ #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> @@ -211,23 +212,25 @@ bool AbTable::selectContact( int UID ) 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 ) ); } @@ -303,20 +306,24 @@ void AbTable::clear() // 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 ) @@ -615,133 +622,159 @@ void AbTable::viewportPaintEvent( QPaintEvent* 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 @@ -27,12 +27,13 @@ #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); @@ -43,12 +44,21 @@ public: 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; @@ -112,13 +122,13 @@ protected slots: 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(); 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 @@ -198,26 +198,27 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 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 ); 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,12 +1,16 @@ #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 ) { @@ -14,12 +18,19 @@ ConfigDlg::ConfigDlg( QWidget *parent, const char *name): // 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() ) ); 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 @@ -545,16 +545,15 @@ void ContactEditor::init() { 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 ); 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 @@ -69,19 +69,23 @@ 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; } @@ -95,19 +99,23 @@ 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; } @@ -136,21 +144,18 @@ QStringList OContactFields::trfields( bool 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] ); @@ -183,21 +188,18 @@ QStringList OContactFields::untrfields( bool 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 ] ); |