summaryrefslogtreecommitdiff
authoreilers <eilers>2003-02-23 15:29:19 (UTC)
committer eilers <eilers>2003-02-23 15:29:19 (UTC)
commit3756fa1506f6cbf782a9ea38036fd7ea965a83d8 (patch) (unidiff)
tree41ca42c2606ada15ecaebfde033de2eefab42c00
parent20224076b50a7426e9c6c88ed245f54283108eff (diff)
downloadopie-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 ?
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO5
-rw-r--r--core/pim/addressbook/abtable.cpp137
-rw-r--r--core/pim/addressbook/abtable.h12
-rw-r--r--core/pim/addressbook/addressbook.cpp5
-rw-r--r--core/pim/addressbook/configdlg.cpp11
-rw-r--r--core/pim/addressbook/contacteditor.cpp3
-rw-r--r--core/pim/addressbook/ocontactfields.cpp14
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
@@ -20,3 +20,4 @@ Known Bugs:
20----------- 20-----------
21- Email-button: A lot of problems.. :( 21- Default Email-button: A lot of problems:
22 If on second tab: The combo chooser is on the top left of the screen ! :(
22- Default Email-Button: Sometimes not hiding the textfields completely 23- Default Email-Button: Sometimes not hiding the textfields completely
@@ -38,3 +39,2 @@ ContactEditor:
38 39
39- Personal and Business Web-page is not editable
40 40
@@ -117 +117,2 @@ Fixed/Ready:
117- Store last settings of combo-boxes 117- Store last settings of combo-boxes
118- 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
@@ -27,2 +27,3 @@
27#include <qpe/timestring.h> 27#include <qpe/timestring.h>
28#include <qpe/resource.h>
28 29
@@ -216,13 +217,15 @@ void AbTable::insertIntoTable( const OContact& cnt, int row )
216 //qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); 217 //qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row );
217 QString strName, 218 QString strName;
218 strContact; 219 ContactItem contactItem;
219 220
220 strName = findContactName( cnt ); 221 strName = findContactName( cnt );
221 strContact = findContactContact( cnt, row ); 222 contactItem = findContactContact( cnt, row );
222 223
223 AbTableItem *ati; 224 AbTableItem *ati;
224 ati = new AbTableItem( this, QTableItem::Never, strName, strContact); 225 ati = new AbTableItem( this, QTableItem::Never, strName, contactItem.value );
225 contactList.insert( ati, cnt ); 226 contactList.insert( ati, cnt );
226 setItem( row, 0, ati ); 227 setItem( row, 0, ati );
227 ati = new AbTableItem( this, QTableItem::Never, strContact, strName); 228 ati = new AbTableItem( this, QTableItem::Never, contactItem.value, strName);
229 if ( !contactItem.icon.isNull() )
230 ati->setPixmap( contactItem.icon );
228 setItem( row, 1, ati ); 231 setItem( row, 1, ati );
@@ -308,4 +311,4 @@ void AbTable::refresh()
308 int rows = numRows(); 311 int rows = numRows();
309 QString value;
310 AbTableItem *abi; 312 AbTableItem *abi;
313 ContactItem contactItem;
311 314
@@ -314,4 +317,8 @@ void AbTable::refresh()
314 abi = static_cast<AbTableItem*>( item(r, 0) ); 317 abi = static_cast<AbTableItem*>( item(r, 0) );
315 value = findContactContact( contactList[abi], r ); 318 contactItem = findContactContact( contactList[abi], r );
316 static_cast<AbTableItem*>( item(r, 1) )->setItem( value, abi->text() ); 319 static_cast<AbTableItem*>( item(r, 1) )->setItem( contactItem.value, abi->text() );
320 if ( !contactItem.icon.isNull() )
321 static_cast<AbTableItem*>( item(r, 1) )->
322 setPixmap( contactItem.icon );
323
317 } 324 }
@@ -620,6 +627,9 @@ void AbTable::rowHeightChanged( int row )
620} 627}
621QString AbTable::findContactContact( const OContact &entry, int /* row */ ) 628ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ )
622{ 629{
623 QString value; 630
624 value = ""; 631 ContactItem item;
632
633 item.value = "";
634
625 for ( QValueList<int>::ConstIterator it = intFields.begin(); 635 for ( QValueList<int>::ConstIterator it = intFields.begin();
@@ -630,118 +640,141 @@ QString AbTable::findContactContact( const OContact &entry, int /* row */ )
630 case Qtopia::Title: 640 case Qtopia::Title:
631 value = entry.title(); 641 item.value = entry.title();
632 break; 642 break;
633 case Qtopia::Suffix: 643 case Qtopia::Suffix:
634 value = entry.suffix(); 644 item.value = entry.suffix();
635 break; 645 break;
636 case Qtopia::FileAs: 646 case Qtopia::FileAs:
637 value = entry.fileAs(); 647 item.value = entry.fileAs();
638 break; 648 break;
639 case Qtopia::DefaultEmail: 649 case Qtopia::DefaultEmail:
640 value = entry.defaultEmail(); 650 item.value = entry.defaultEmail();
651 if ( !item.value.isEmpty() )
652 item.icon = Resource::loadPixmap( "addressbook/email" );
653 break;
641 case Qtopia::Emails: 654 case Qtopia::Emails:
642 value = entry.emails(); 655 item.value = entry.emails();
656 if ( !item.value.isEmpty() )
657 item.icon = Resource::loadPixmap( "addressbook/email" );
643 break; 658 break;
644 case Qtopia::HomeStreet: 659 case Qtopia::HomeStreet:
645 value = entry.homeStreet(); 660 item.value = entry.homeStreet();
646 break; 661 break;
647 case Qtopia::HomeCity: 662 case Qtopia::HomeCity:
648 value = entry.homeCity(); 663 item.value = entry.homeCity();
649 break; 664 break;
650 case Qtopia::HomeState: 665 case Qtopia::HomeState:
651 value = entry.homeState(); 666 item.value = entry.homeState();
652 break; 667 break;
653 case Qtopia::HomeZip: 668 case Qtopia::HomeZip:
654 value = entry.homeZip(); 669 item.value = entry.homeZip();
655 break; 670 break;
656 case Qtopia::HomeCountry: 671 case Qtopia::HomeCountry:
657 value = entry.homeCountry(); 672 item.value = entry.homeCountry();
658 break; 673 break;
659 case Qtopia::HomePhone: 674 case Qtopia::HomePhone:
660 value = entry.homePhone(); 675 item.value = entry.homePhone();
676 if ( !item.value.isEmpty() )
677 item.icon = Resource::loadPixmap( "addressbook/phonehome" );
661 break; 678 break;
662 case Qtopia::HomeFax: 679 case Qtopia::HomeFax:
663 value = entry.homeFax(); 680 item.value = entry.homeFax();
681 if ( !item.value.isEmpty() )
682 item.icon = Resource::loadPixmap( "addressbook/faxhome" );
664 break; 683 break;
665 case Qtopia::HomeMobile: 684 case Qtopia::HomeMobile:
666 value = entry.homeMobile(); 685 item.value = entry.homeMobile();
686 if ( !item.value.isEmpty() )
687 item.icon = Resource::loadPixmap( "addressbook/mobilehome" );
667 break; 688 break;
668 case Qtopia::HomeWebPage: 689 case Qtopia::HomeWebPage:
669 value = entry.homeWebpage(); 690 item.value = entry.homeWebpage();
691 if ( !item.value.isEmpty() )
692 item.icon = Resource::loadPixmap( "addressbook/webpagehome" );
670 break; 693 break;
671 case Qtopia::Company: 694 case Qtopia::Company:
672 value = entry.company(); 695 item.value = entry.company();
673 break; 696 break;
674 case Qtopia::BusinessCity: 697 case Qtopia::BusinessCity:
675 value = entry.businessCity(); 698 item.value = entry.businessCity();
676 break; 699 break;
677 case Qtopia::BusinessStreet: 700 case Qtopia::BusinessStreet:
678 value = entry.businessStreet(); 701 item.value = entry.businessStreet();
679 break; 702 break;
680 case Qtopia::BusinessZip: 703 case Qtopia::BusinessZip:
681 value = entry.businessZip(); 704 item.value = entry.businessZip();
682 break; 705 break;
683 case Qtopia::BusinessCountry: 706 case Qtopia::BusinessCountry:
684 value = entry.businessCountry(); 707 item.value = entry.businessCountry();
685 break; 708 break;
686 case Qtopia::BusinessWebPage: 709 case Qtopia::BusinessWebPage:
687 value = entry.businessWebpage(); 710 item.value = entry.businessWebpage();
711 if ( !item.value.isEmpty() )
712 item.icon = Resource::loadPixmap( "addressbook/webpagework" );
688 break; 713 break;
689 case Qtopia::JobTitle: 714 case Qtopia::JobTitle:
690 value = entry.jobTitle(); 715 item.value = entry.jobTitle();
691 break; 716 break;
692 case Qtopia::Department: 717 case Qtopia::Department:
693 value = entry.department(); 718 item.value = entry.department();
694 break; 719 break;
695 case Qtopia::Office: 720 case Qtopia::Office:
696 value = entry.office(); 721 item.value = entry.office();
697 break; 722 break;
698 case Qtopia::BusinessPhone: 723 case Qtopia::BusinessPhone:
699 value = entry.businessPhone(); 724 item.value = entry.businessPhone();
725 if ( !item.value.isEmpty() )
726 item.icon = Resource::loadPixmap( "addressbook/phonework" );
700 break; 727 break;
701 case Qtopia::BusinessFax: 728 case Qtopia::BusinessFax:
702 value = entry.businessFax(); 729 item.value = entry.businessFax();
730 if ( !item.value.isEmpty() )
731 item.icon = Resource::loadPixmap( "addressbook/faxwork" );
703 break; 732 break;
704 case Qtopia::BusinessMobile: 733 case Qtopia::BusinessMobile:
705 value = entry.businessMobile(); 734 item.value = entry.businessMobile();
735 if ( !item.value.isEmpty() )
736 item.icon = Resource::loadPixmap( "addressbook/mobilework" );
706 break; 737 break;
707 case Qtopia::BusinessPager: 738 case Qtopia::BusinessPager:
708 value = entry.businessPager(); 739 item.value = entry.businessPager();
709 break; 740 break;
710 case Qtopia::Profession: 741 case Qtopia::Profession:
711 value = entry.profession(); 742 item.value = entry.profession();
712 break; 743 break;
713 case Qtopia::Assistant: 744 case Qtopia::Assistant:
714 value = entry.assistant(); 745 item.value = entry.assistant();
715 break; 746 break;
716 case Qtopia::Manager: 747 case Qtopia::Manager:
717 value = entry.manager(); 748 item.value = entry.manager();
718 break; 749 break;
719 case Qtopia::Spouse: 750 case Qtopia::Spouse:
720 value = entry.spouse(); 751 item.value = entry.spouse();
721 break; 752 break;
722 case Qtopia::Gender: 753 case Qtopia::Gender:
723 value = entry.gender(); 754 item.value = entry.gender();
724 break; 755 break;
725 case Qtopia::Birthday: 756 case Qtopia::Birthday:
726 if ( ! entry.birthday().isNull() ) 757 if ( ! entry.birthday().isNull() ){
727 value = TimeString::numberDateString( entry.birthday() ); 758 item.value = TimeString::numberDateString( entry.birthday() );
759 }
728 break; 760 break;
729 case Qtopia::Anniversary: 761 case Qtopia::Anniversary:
730 if ( ! entry.anniversary().isNull() ) 762 if ( ! entry.anniversary().isNull() ){
731 value = TimeString::numberDateString( entry.anniversary() ); 763 item.value = TimeString::numberDateString( entry.anniversary() );
764 }
732 break; 765 break;
733 case Qtopia::Nickname: 766 case Qtopia::Nickname:
734 value = entry.nickname(); 767 item.value = entry.nickname();
735 break; 768 break;
736 case Qtopia::Children: 769 case Qtopia::Children:
737 value = entry.children(); 770 item.value = entry.children();
738 break; 771 break;
739 case Qtopia::Notes: 772 case Qtopia::Notes:
740 value = entry.notes(); 773 item.value = entry.notes();
741 break; 774 break;
742 } 775 }
743 if ( !value.isEmpty() ) 776 if ( !item.value.isEmpty() )
744 break; 777 break;
745 } 778 }
746 return value; 779 return item;
747} 780}
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
@@ -32,2 +32,3 @@
32#include <qcombobox.h> 32#include <qcombobox.h>
33#include <qpixmap.h>
33 34
@@ -48,2 +49,11 @@ private:
48 49
50// This is a simple container, storing all contact
51// information
52class ContactItem
53{
54 public:
55 QPixmap icon;
56 QString value;
57};
58
49class AbPickItem : public QTableItem 59class AbPickItem : public QTableItem
@@ -117,3 +127,3 @@ private:
117 void insertIntoTable( const OContact &cnt, int row ); 127 void insertIntoTable( const OContact &cnt, int row );
118 QString findContactContact( const OContact &entry, int row ); 128 ContactItem findContactContact( const OContact &entry, int row );
119 void fitColumns(); 129 void fitColumns();
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
@@ -203,3 +203,4 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
203 203
204 a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); 204 a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ),
205 QString::null, 0, this, 0 );
205 actionPersonal = a; 206 actionPersonal = a;
@@ -216,3 +217,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
216#endif 217#endif
217 a = new QAction( tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 218 a = new QAction( tr( "Config" ), Resource::loadPixmap( "addressbook/configure" ), QString::null,
218 0, this, 0 ); 219 0, this, 0 );
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
@@ -2,2 +2,3 @@
2#include "ocontactfields.h" 2#include "ocontactfields.h"
3
3#include <qcheckbox.h> 4#include <qcheckbox.h>
@@ -6,2 +7,5 @@
6#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qiconset.h>
9
10#include <qpe/resource.h>
7 11
@@ -19,2 +23,9 @@ ConfigDlg::ConfigDlg( QWidget *parent, const char *name):
19 23
24 // Set Pics to Buttons and Tabs
25 m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) );
26 m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) );
27 m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) );
28 m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) );
29
30
20 // Get the translation maps between Field ID and translated strings 31 // Get the translation maps between Field ID and translated strings
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
@@ -550,6 +550,5 @@ void ContactEditor::init() {
550 QStringList::ConstIterator it = slDynamicEntries.begin(); 550 QStringList::ConstIterator it = slDynamicEntries.begin();
551 QStringList::ConstIterator trit = trlDynamicEntries.begin();
552 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); 551 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId();
553 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); 552 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields();
554 for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { 553 for (i = counter; it != slDynamicEntries.end(); i++, ++it ) {
555 554
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
@@ -74,2 +74,4 @@ QStringList OContactFields::trphonefields( bool sorted )
74 list.append( mapIdToStr[Qtopia::BusinessMobile] ); 74 list.append( mapIdToStr[Qtopia::BusinessMobile] );
75 list.append( mapIdToStr[Qtopia::BusinessPager] );
76 list.append( mapIdToStr[Qtopia::BusinessWebPage] );
75 77
@@ -81,2 +83,4 @@ QStringList OContactFields::trphonefields( bool sorted )
81 list.append( mapIdToStr[Qtopia::HomeMobile] ); 83 list.append( mapIdToStr[Qtopia::HomeMobile] );
84 // list.append( mapIdToStr[Qtopia::HomePager] );
85 list.append( mapIdToStr[Qtopia::HomeWebPage] );
82 86
@@ -100,2 +104,4 @@ QStringList OContactFields::untrphonefields( bool sorted )
100 list.append( mapIdToStr[ Qtopia::BusinessMobile ] ); 104 list.append( mapIdToStr[ Qtopia::BusinessMobile ] );
105 list.append( mapIdToStr[ Qtopia::BusinessPager ] );
106 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] );
101 107
@@ -107,2 +113,4 @@ QStringList OContactFields::untrphonefields( bool sorted )
107 list.append( mapIdToStr[ Qtopia::HomeMobile ] ); 113 list.append( mapIdToStr[ Qtopia::HomeMobile ] );
114 //list.append( mapIdToStr[Qtopia::HomePager] );
115 list.append( mapIdToStr[Qtopia::HomeWebPage] );
108 116
@@ -141,4 +149,2 @@ QStringList OContactFields::trfields( bool sorted )
141 list.append( mapIdToStr[Qtopia::BusinessCountry] ); 149 list.append( mapIdToStr[Qtopia::BusinessCountry] );
142 list.append( mapIdToStr[Qtopia::BusinessPager] );
143 list.append( mapIdToStr[Qtopia::BusinessWebPage] );
144 150
@@ -149,3 +155,2 @@ QStringList OContactFields::trfields( bool sorted )
149 list.append( mapIdToStr[Qtopia::HomeCountry] ); 155 list.append( mapIdToStr[Qtopia::HomeCountry] );
150 list.append( mapIdToStr[Qtopia::HomeWebPage] );
151 156
@@ -188,4 +193,2 @@ QStringList OContactFields::untrfields( bool sorted )
188 list.append( mapIdToStr[ Qtopia::BusinessCountry ] ); 193 list.append( mapIdToStr[ Qtopia::BusinessCountry ] );
189 list.append( mapIdToStr[ Qtopia::BusinessPager ] );
190 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] );
191 194
@@ -196,3 +199,2 @@ QStringList OContactFields::untrfields( bool sorted )
196 list.append( mapIdToStr[ Qtopia::HomeCountry ] ); 199 list.append( mapIdToStr[ Qtopia::HomeCountry ] );
197 list.append( mapIdToStr[ Qtopia::HomeWebPage] );
198 200