summaryrefslogtreecommitdiffabout
path: root/kmicromail/addresspicker.cpp
Unidiff
Diffstat (limited to 'kmicromail/addresspicker.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/addresspicker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kmicromail/addresspicker.cpp b/kmicromail/addresspicker.cpp
index ec6da49..f4234b4 100644
--- a/kmicromail/addresspicker.cpp
+++ b/kmicromail/addresspicker.cpp
@@ -17,100 +17,100 @@
17 17
18AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags ) 18AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags )
19 : AddressPickerUI( parent, name, modal, flags ) 19 : AddressPickerUI( parent, name, modal, flags )
20{ 20{
21 okButton->setIconSet( Resource::loadPixmap( "enter" ) ); 21 okButton->setIconSet( Resource::loadPixmap( "enter" ) );
22 cancelButton->setIconSet( Resource::loadPixmap( "editdelete" ) ); 22 cancelButton->setIconSet( Resource::loadPixmap( "editdelete" ) );
23 23
24 connect(okButton, SIGNAL(clicked()), SLOT(accept())); 24 connect(okButton, SIGNAL(clicked()), SLOT(accept()));
25 connect(cancelButton, SIGNAL(clicked()), SLOT(close())); 25 connect(cancelButton, SIGNAL(clicked()), SLOT(close()));
26 qDebug("AddressPicker::AddressPicker pending access KA/PI "); 26 qDebug("AddressPicker::AddressPicker pending access KA/PI ");
27#if 0 27#if 0
28 Opie::OPimContactAccess::List::Iterator it; 28 Opie::OPimContactAccess::List::Iterator it;
29 29
30 QString lineEmail, lineName, contactLine; 30 QString lineEmail, lineName, contactLine;
31 /* what name has to set here???? */ 31 /* what name has to set here???? */
32 Opie::OPimContactAccess m_contactdb("opiemail"); 32 Opie::OPimContactAccess m_contactdb("opiemail");
33 33
34 QStringList mails; 34 QStringList mails;
35 QString pre,suf; 35 QString pre,suf;
36 Opie::OPimContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); 36 Opie::OPimContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
37 for ( it = m_list.begin(); it != m_list.end(); ++it ) 37 for ( it = m_list.begin(); it != m_list.end(); ++it )
38 { 38 {
39 if ((*it).defaultEmail().length()!=0) 39 if ((*it).defaultEmail().length()!=0)
40 { 40 {
41 mails = (*it).emailList(); 41 mails = (*it).emailList();
42 if ((*it).fileAs().length()>0) 42 if ((*it).fileAs().length()>0)
43 { 43 {
44 pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; 44 pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <";
45 suf = ">"; 45 suf = ">";
46 } 46 }
47 else 47 else
48 { 48 {
49 pre = ""; 49 pre = "";
50 suf = ""; 50 suf = "";
51 } 51 }
52 QStringList::ConstIterator sit = mails.begin(); 52 QStringList::ConstIterator sit = mails.begin();
53 for (;sit!=mails.end();++sit) 53 for (;sit!=mails.end();++sit)
54 { 54 {
55 contactLine=pre+(*sit)+suf; 55 contactLine=pre+(*sit)+suf;
56 addressList->insertItem(contactLine); 56 addressList->insertItem(contactLine);
57 } 57 }
58 } 58 }
59 } 59 }
60 if ( addressList->count() <= 0 ) 60 if ( addressList->count() <= 0 )
61 { 61 {
62#if 0 62#if 0
63 // makes this realy sense?? 63 // makes this realy sense??
64 addressList->insertItem( 64 addressList->insertItem(
65 tr( "There are no entries in the addressbook." ) ); 65 i18n( "There are no entries in the addressbook." ) );
66#endif 66#endif
67 addressList->setEnabled( false ); 67 addressList->setEnabled( false );
68 okButton->setEnabled( false ); 68 okButton->setEnabled( false );
69 } 69 }
70 else 70 else
71 { 71 {
72 // addressList->sort(); 72 // addressList->sort();
73 } 73 }
74#endif 74#endif
75} 75}
76 76
77void AddressPicker::accept() 77void AddressPicker::accept()
78{ 78{
79 QListBoxItem *item = addressList->firstItem(); 79 QListBoxItem *item = addressList->firstItem();
80 QString names; 80 QString names;
81 81
82 while ( item ) 82 while ( item )
83 { 83 {
84 if ( item->selected() ) 84 if ( item->selected() )
85 names += item->text() + ", "; 85 names += item->text() + ", ";
86 item = item->next(); 86 item = item->next();
87 } 87 }
88 names.replace( names.length() - 2, 2, "" ); 88 names.replace( names.length() - 2, 2, "" );
89 89
90 if ( names.isEmpty() ) 90 if ( names.isEmpty() )
91 { 91 {
92 QMessageBox::information(this, tr("Error"), tr("<p>You have to select" 92 QMessageBox::information(this, i18n("Error"), i18n("<p>You have to select"
93 " at least one address entry.</p>"), tr("Ok")); 93 " at least one address entry.</p>"), i18n("Ok"));
94 return; 94 return;
95 } 95 }
96 96
97 selectedNames = names; 97 selectedNames = names;
98 QDialog::accept(); 98 QDialog::accept();
99} 99}
100 100
101QString AddressPicker::getNames() 101QString AddressPicker::getNames()
102{ 102{
103 QString names = 0; 103 QString names = 0;
104 104
105 AddressPicker picker(0, 0, true); 105 AddressPicker picker(0, 0, true);
106 106
107 picker.showMaximized(); 107 picker.showMaximized();
108 int ret = picker.exec(); 108 int ret = picker.exec();
109 if ( QDialog::Accepted == ret ) 109 if ( QDialog::Accepted == ret )
110 { 110 {
111 return picker.selectedNames; 111 return picker.selectedNames;
112 } 112 }
113 113
114 return 0; 114 return 0;
115} 115}
116 116