summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-20 06:01:55 (UTC)
committer zautrix <zautrix>2005-06-20 06:01:55 (UTC)
commit3876e95ff79298e9d95c506973c69790290b611e (patch) (unidiff)
tree654477f1cf73911d57fff86f0e087faf4021e113
parent19768fad9c35bd2611512dcdb426c879ad080493 (diff)
downloadkdepimpi-3876e95ff79298e9d95c506973c69790290b611e.zip
kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.tar.gz
kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.tar.bz2
fixes in contact selection
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--kabc/addresseedialog.cpp18
-rw-r--r--kabc/addresseedialog.h2
3 files changed, 18 insertions, 4 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 0ebd853..c4557ef 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,28 +1,30 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3 3
4********** VERSION 2.1.8 ************ 4********** VERSION 2.1.8 ************
5 5
6KO/Pi: 6KO/Pi:
7Added info about the completion state of a todo in the ListView/Searchdialog. 7Added info about the completion state of a todo in the ListView/Searchdialog.
8If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 8If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
9Fixed some updating problems when changing the filter. 9Fixed some updating problems when changing the filter.
10 10
11KA/Pi: 11KA/Pi:
12In the addressee selection dialog now the formatted name is shown, if not empty. 12In the addressee selection dialog now the formatted name is shown, if not empty.
13Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category.
14Now in the addressee selection dialog a selected contact is remove with a single click from the selected list.
13 15
14Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 16Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
15Fixed the sorting for size in the file selector on the Z. 17Fixed the sorting for size in the file selector on the Z.
16 18
17Changed the color selection dialog on the Zaurus to a more user friendly version. 19Changed the color selection dialog on the Zaurus to a more user friendly version.
18 20
19********** VERSION 2.1.7 ************ 21********** VERSION 2.1.7 ************
20 22
21KO/Pi: 23KO/Pi:
22Fixed several problems in the new Resource handling. 24Fixed several problems in the new Resource handling.
23Added more options to the search dialog. 25Added more options to the search dialog.
24Fixed a problem in the Month view. 26Fixed a problem in the Month view.
25Added more options to the dialog when setting a todo to stopped. 27Added more options to the dialog when setting a todo to stopped.
26 28
27Fixed two small problems in KO/Pi Alarm applet. 29Fixed two small problems in KO/Pi Alarm applet.
28 30
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp
index e89584d..3e7b72c 100644
--- a/kabc/addresseedialog.cpp
+++ b/kabc/addresseedialog.cpp
@@ -31,32 +31,33 @@
31#include <kglobalsettings.h> 31#include <kglobalsettings.h>
32 32
33#include "stdaddressbook.h" 33#include "stdaddressbook.h"
34 34
35#include "addresseedialog.h" 35#include "addresseedialog.h"
36#include "KDGanttMinimizeSplitter.h" 36#include "KDGanttMinimizeSplitter.h"
37//#include "addresseedialog.moc" 37//#include "addresseedialog.moc"
38 38
39using namespace KABC; 39using namespace KABC;
40 40
41AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : 41AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) :
42 QListViewItem( parent ), 42 QListViewItem( parent ),
43 mAddressee( addressee ) 43 mAddressee( addressee )
44{ 44{
45 setText( Name,addressee.realName()); 45 setText( Name,addressee.realName());
46 setText( Email, addressee.preferredEmail() ); 46 setText( Email, addressee.preferredEmail() );
47 setText( Category, addressee.categories().join(";") );
47} 48}
48 49
49QString AddresseeItem::key( int column, bool ) const 50QString AddresseeItem::key( int column, bool ) const
50{ 51{
51 52
52 if (column == Email) { 53 if (column == Email) {
53 QString value = text(Email); 54 QString value = text(Email);
54 int val = value.findRev("@"); 55 int val = value.findRev("@");
55 return value.mid( val) + value.left( val ); 56 return value.mid( val) + value.left( val );
56 } 57 }
57 return text(column).lower(); 58 return text(column).lower();
58} 59}
59 60
60AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : 61AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
61 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), 62 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"),
62 Ok|Cancel, No, parent ), mMultiple( multiple ) 63 Ok|Cancel, No, parent ), mMultiple( multiple )
@@ -67,65 +68,75 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
67 QBoxLayout *topLayout = new QHBoxLayout( topWidget ); 68 QBoxLayout *topLayout = new QHBoxLayout( topWidget );
68 69
69 70
70 KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); 71 KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget);
71 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 72 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
72 73
73 topLayout->addWidget(mMiniSplitter ); 74 topLayout->addWidget(mMiniSplitter );
74 75
75 QWidget *listWidget = new QWidget( mMiniSplitter ); 76 QWidget *listWidget = new QWidget( mMiniSplitter );
76 77
77 QBoxLayout *listLayout = new QVBoxLayout (listWidget) ; 78 QBoxLayout *listLayout = new QVBoxLayout (listWidget) ;
78 //topLayout->addLayout( listLayout ); 79 //topLayout->addLayout( listLayout );
79 80
80 mAddresseeList = new KListView( listWidget ); 81 mAddresseeList = new KListView( listWidget );
81 mAddresseeList->addColumn( i18n("Name") ); 82 mAddresseeList->addColumn( i18n("Name") );
82 mAddresseeList->addColumn( i18n("Email") ); 83 mAddresseeList->addColumn( i18n("Email") );
84 mAddresseeList->addColumn( i18n("Category") );
83 mAddresseeList->setAllColumnsShowFocus( true ); 85 mAddresseeList->setAllColumnsShowFocus( true );
84 mAddresseeList->setFullWidth( true ); 86 mAddresseeList->setFullWidth( true );
85 listLayout->addWidget( mAddresseeList ); 87 listLayout->addWidget( mAddresseeList );
86 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), 88 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ),
87 SLOT( slotOk() ) ); 89 SLOT( slotOk() ) );
88 90
89 mAddresseeEdit = new QLineEdit( listWidget ); 91 QHBox* searchBox = new QHBox ( listWidget );
92 mAddresseeEdit = new QLineEdit( searchBox );
90 connect( mAddresseeEdit, SIGNAL( returnPressed() ), 93 connect( mAddresseeEdit, SIGNAL( returnPressed() ),
91 SLOT( loadAddressBook() ) ); 94 SLOT( loadAddressBook() ) );
92 mAddresseeEdit->setFocus(); 95 mAddresseeEdit->setFocus();
96 QPushButton *searchButton = new QPushButton( i18n("Search!"), searchBox );
97 connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) );
93 98
94 listLayout->addWidget( mAddresseeEdit ); 99 listLayout->addWidget( searchBox );
95 100
96 if ( mMultiple ) { 101 if ( mMultiple ) {
97 //QBoxLayout *selectedLayout = new QVBoxLayout; 102 //QBoxLayout *selectedLayout = new QVBoxLayout;
98 //topLayout->addLayout( selectedLayout ); 103 //topLayout->addLayout( selectedLayout );
99 //topLayout->setSpacing( spacingHint() ); 104 //topLayout->setSpacing( spacingHint() );
100 105
101 QVBox *selectedGroup = new QVBox( mMiniSplitter ); 106 QVBox *selectedGroup = new QVBox( mMiniSplitter );
102 new QLabel ( i18n("Selected:"), selectedGroup ); 107 new QLabel ( i18n("Selected:"), selectedGroup );
103 //selectedLayout->addWidget( selectedGroup ); 108 //selectedLayout->addWidget( selectedGroup );
104 109
105 mSelectedList = new KListView( selectedGroup ); 110 mSelectedList = new KListView( selectedGroup );
106 mSelectedList->addColumn( i18n("Name") ); 111 mSelectedList->addColumn( i18n("Name") );
107 mSelectedList->addColumn( i18n("Email") ); 112 mSelectedList->addColumn( i18n("Email") );
108 mSelectedList->setAllColumnsShowFocus( true ); 113 mSelectedList->setAllColumnsShowFocus( true );
109 mSelectedList->setFullWidth( true ); 114 mSelectedList->setFullWidth( true );
110 connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), 115 //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
116 // SLOT( removeSelected() ) );
117 connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ),
118 SLOT( removeSelected() ) );
119 connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ),
111 SLOT( removeSelected() ) ); 120 SLOT( removeSelected() ) );
112 121
122#if 0
113 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); 123 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup );
114 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); 124 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) );
115 125
126#endif
116 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), 127 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ),
117 SLOT( addSelected( QListViewItem * ) ) ); 128 SLOT( addSelected( QListViewItem * ) ) );
118 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), 129 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ),
119 SLOT( selectNextItem( QListViewItem * ) ) ); 130 SLOT( selectNextItem( QListViewItem * ) ) );
120 131
121 } 132 }
122 133
123 mAddressBook = StdAddressBook::self( true ); 134 mAddressBook = StdAddressBook::self( true );
124 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), 135 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ),
125 SLOT( addressBookChanged() ) ); 136 SLOT( addressBookChanged() ) );
126#if 0 137#if 0
127 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), 138 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ),
128 SLOT( addressBookChanged() ) ); 139 SLOT( addressBookChanged() ) );
129#endif 140#endif
130 loadAddressBook(); 141 loadAddressBook();
131 QValueList<int> splitterSize; 142 QValueList<int> splitterSize;
@@ -151,32 +162,33 @@ void AddresseeDialog::loadAddressBook()
151 new AddresseeItem( mAddresseeList, (*it) ); 162 new AddresseeItem( mAddresseeList, (*it) );
152 } 163 }
153 return; 164 return;
154 } 165 }
155 //mAddresseeEdit->completionObject()->clear(); 166 //mAddresseeEdit->completionObject()->clear();
156 QRegExp re; 167 QRegExp re;
157 re.setWildcard(true); // most people understand these better. 168 re.setWildcard(true); // most people understand these better.
158 re.setCaseSensitive(false); 169 re.setCaseSensitive(false);
159 re.setPattern( "*"+ mAddresseeEdit->text() + "*"); 170 re.setPattern( "*"+ mAddresseeEdit->text() + "*");
160 171
161 AddressBook::Iterator it; 172 AddressBook::Iterator it;
162 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 173 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
163 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 174 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
164 continue; 175 continue;
165 QString name = (*it).realName(); 176 QString name = (*it).realName();
166 name += (*it).preferredEmail(); 177 name += (*it).preferredEmail();
178 name += (*it).categories().join(";");
167#if QT_VERSION >= 0x030000 179#if QT_VERSION >= 0x030000
168 if (re.search(name) != -1) 180 if (re.search(name) != -1)
169#else 181#else
170 if (re.match(name) != -1) 182 if (re.match(name) != -1)
171#endif 183#endif
172 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); 184 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) );
173 } 185 }
174} 186}
175 187
176void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) 188void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item )
177{ 189{
178 if ( str.isEmpty() ) return; 190 if ( str.isEmpty() ) return;
179 191
180 mItemDict.insert( str, item ); 192 mItemDict.insert( str, item );
181 //mAddresseeEdit->completionObject()->addItem( str ); 193 //mAddresseeEdit->completionObject()->addItem( str );
182} 194}
diff --git a/kabc/addresseedialog.h b/kabc/addresseedialog.h
index 99c74bd..6fab62d 100644
--- a/kabc/addresseedialog.h
+++ b/kabc/addresseedialog.h
@@ -30,33 +30,33 @@
30#include "addressbook.h" 30#include "addressbook.h"
31 31
32namespace KABC { 32namespace KABC {
33 33
34/** 34/**
35 @short Special ListViewItem, that is used by the AddresseeDialog. 35 @short Special ListViewItem, that is used by the AddresseeDialog.
36*/ 36*/
37class AddresseeItem : public QListViewItem 37class AddresseeItem : public QListViewItem
38{ 38{
39 public: 39 public:
40 40
41 /** 41 /**
42 Type of column 42 Type of column
43 @li @p Name - Name in Addressee 43 @li @p Name - Name in Addressee
44 @li @p Email - Email in Addressee 44 @li @p Email - Email in Addressee
45 */ 45 */
46 enum columns { Name = 0, Email = 1 }; 46 enum columns { Name = 0, Email = 1,Category = 2 };
47 47
48 /** 48 /**
49 Constructor. 49 Constructor.
50 50
51 @param parent The parent listview. 51 @param parent The parent listview.
52 @param addressee The associated addressee. 52 @param addressee The associated addressee.
53 */ 53 */
54 AddresseeItem( QListView *parent, const Addressee &addressee ); 54 AddresseeItem( QListView *parent, const Addressee &addressee );
55 55
56 /** 56 /**
57 Returns the addressee. 57 Returns the addressee.
58 */ 58 */
59 Addressee addressee() const { return mAddressee; } 59 Addressee addressee() const { return mAddressee; }
60 60
61 /** 61 /**
62 Method used by QListView to sort the items. 62 Method used by QListView to sort the items.