summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt5
-rw-r--r--kaddressbook/incsearchwidget.cpp24
-rw-r--r--kaddressbook/incsearchwidget.h1
-rw-r--r--kaddressbook/kabcore.cpp37
-rw-r--r--kaddressbook/kabprefs.cpp2
-rw-r--r--kaddressbook/kabprefs.h2
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp15
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h2
-rw-r--r--kaddressbook/viewmanager.cpp4
9 files changed, 68 insertions, 24 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index a3d465f..6721d5f 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -393,65 +393,65 @@
393{ "Honorific suffixes:","Namenssuffixe:" }, 393{ "Honorific suffixes:","Namenssuffixe:" },
394{ "Parse name automatically","Setze Namen automatisch" }, 394{ "Parse name automatically","Setze Namen automatisch" },
395{ "Edit Phone Numbers","Bearbeite Telefonnummern" }, 395{ "Edit Phone Numbers","Bearbeite Telefonnummern" },
396{ "Number","Nummer" }, 396{ "Number","Nummer" },
397{ "Type","Typ" }, 397{ "Type","Typ" },
398{ "Edit Phone Number","Bearbeite Telefonnummer" }, 398{ "Edit Phone Number","Bearbeite Telefonnummer" },
399{ "Number:","Nummer:" }, 399{ "Number:","Nummer:" },
400{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, 400{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" },
401{ "Types","Typen" }, 401{ "Types","Typen" },
402{ "Messenger","Messenger" }, 402{ "Messenger","Messenger" },
403{ "Other","Anderes" }, 403{ "Other","Anderes" },
404{ "Video","Video" }, 404{ "Video","Video" },
405{ "Mailbox","Mailbox" }, 405{ "Mailbox","Mailbox" },
406{ "Modem","Modem" }, 406{ "Modem","Modem" },
407{ "Car","Auto" }, 407{ "Car","Auto" },
408{ "PCS","PCS" }, 408{ "PCS","PCS" },
409{ "Category","Kategorie" }, 409{ "Category","Kategorie" },
410{ "Select Categories","Wähle Kategorien" }, 410{ "Select Categories","Wähle Kategorien" },
411{ " &Deselect All "," &Deselektiere alle " }, 411{ " &Deselect All "," &Deselektiere alle " },
412{ " &Edit Categories "," B&earbeite Kategorien " }, 412{ " &Edit Categories "," B&earbeite Kategorien " },
413{ "&OK","&OK" }, 413{ "&OK","&OK" },
414{ "&Cancel","Abbre&chen" }, 414{ "&Cancel","Abbre&chen" },
415{ "Configure","Konfiguriere" }, 415{ "Configure","Konfiguriere" },
416{ "Default","Voreinstellungen" }, 416{ "Default","Voreinstellungen" },
417{ "Addressbook","Adressbuch" }, 417{ "Addressbook","Adressbuch" },
418{ "Details view font","Schriftart Detailansicht" }, 418{ "Details view font","Schriftart Detailansicht" },
419{ "phone:123","phone:123" }, 419{ "phone:123","phone:123" },
420{ "Search only after <return> key pressed","Suche nur nach <return> Taste" }, 420{ "Search only after <return> key pressed","Suche nur nach <return> Taste" },
421{ "Honor KDE single click","Benutze KDE Einzelklick" }, 421{ "Honor KDE single click","Benutze KDE Einzelklick" },
422{ "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, 422{ "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" },
423{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, 423{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" },
424{ "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, 424{ "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" },
425{ "General","Algemein" }, 425{ "General","Allgemein" },
426{ "Extensions (restart)","Extensions (restart)" }, 426{ "Extensions (restart)","Extensions (restart)" },
427{ "Description","Beschreibungen" }, 427{ "Description","Beschreibungen" },
428{ "Extensions","Extensions" }, 428{ "Extensions","Extensions" },
429{ "Prefixes","Prefixe" }, 429{ "Prefixes","Prefixe" },
430{ "Inclusions","Inclusions" }, 430{ "Inclusions","Inclusions" },
431{ "Suffixes","Suffixe" }, 431{ "Suffixes","Suffixe" },
432{ "Default formatted name:","Default format. Name:" }, 432{ "Default formatted name:","Default format. Name:" },
433{ "Empty","Leer" }, 433{ "Empty","Leer" },
434{ "Simple Name","Einfacher Name" }, 434{ "Simple Name","Einfacher Name" },
435{ "Full Name","Voller Name" }, 435{ "Full Name","Voller Name" },
436{ "Reverse Name","Namen umdrehen" }, 436{ "Reverse Name","Namen umdrehen" },
437{ "Contact","Kontakt" }, 437{ "Contact","Kontakt" },
438{ "Global","Allgemein" }, 438{ "Global","Allgemein" },
439{ "Phone","Telefon" }, 439{ "Phone","Telefon" },
440{ "SMS","SMS" }, 440{ "SMS","SMS" },
441{ "Language:(needs restart)","Sprache:(Neustart)" }, 441{ "Language:(needs restart)","Sprache:(Neustart)" },
442{ "English","English" }, 442{ "English","English" },
443{ "German","Deutsch" }, 443{ "German","Deutsch" },
444{ "French","Französisch" }, 444{ "French","Französisch" },
445{ "Italian","Italienisch" }, 445{ "Italian","Italienisch" },
446{ "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, 446{ "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" },
447{ "Time Format(nr):","Zeit Format(nr):" }, 447{ "Time Format(nr):","Zeit Format(nr):" },
448{ "24:00","24:00" }, 448{ "24:00","24:00" },
449{ "12:00am","12:00am" }, 449{ "12:00am","12:00am" },
450{ "Week starts on Sunday","Woche beginnt Sonntags" }, 450{ "Week starts on Sunday","Woche beginnt Sonntags" },
451{ "Locale","Locale" }, 451{ "Locale","Locale" },
452{ "Date Format:","Datums Format:" }, 452{ "Date Format:","Datums Format:" },
453{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 453{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
454{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 454{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
455{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 455{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
456{ "User defined","Benutzerdefiniert" }, 456{ "User defined","Benutzerdefiniert" },
457{ "User long date:","Format langes Datum:" }, 457{ "User long date:","Format langes Datum:" },
@@ -718,40 +718,41 @@
718{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 718{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
719{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 719{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
720{ "Warning","Warnung" }, 720{ "Warning","Warnung" },
721{ "Select week number","Wähle Wochen Nummer" }, 721{ "Select week number","Wähle Wochen Nummer" },
722{ "Februar","Februar" }, 722{ "Februar","Februar" },
723{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 723{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
724{ "Password for remote access:","Passwort für fernen Zugriff:" }, 724{ "Password for remote access:","Passwort für fernen Zugriff:" },
725{ "Remote IP address:","Ferne IP Adresse:" }, 725{ "Remote IP address:","Ferne IP Adresse:" },
726{ "Remote port number:","Ferne Port Nummer:" }, 726{ "Remote port number:","Ferne Port Nummer:" },
727{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 727{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
728{ "Remote from: ","Fern von: " }, 728{ "Remote from: ","Fern von: " },
729{ "Local from: ","Lokal von: " }, 729{ "Local from: ","Lokal von: " },
730{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, 730{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" },
731{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 731{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
732{ "Write back","Schreibe zurück" }, 732{ "Write back","Schreibe zurück" },
733{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 733{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
734{ "Received sync request","Sync Anfrage erhalten" }, 734{ "Received sync request","Sync Anfrage erhalten" },
735{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, 735{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
736{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 736{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
737{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 737{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
738{ "Sending file...","Sende Datei..." }, 738{ "Sending file...","Sende Datei..." },
739{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 739{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
740{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 740{ "Receiving synced file...","Gesyncte Daten erhalten..." },
741{ "Received %1 bytes","%1 Bytes erhalten" }, 741{ "Received %1 bytes","%1 Bytes erhalten" },
742{ "Writing file to disk...","Speichere Datei..." }, 742{ "Writing file to disk...","Speichere Datei..." },
743{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 743{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
744{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 744{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
745{ "Synchronize!","Synchronisiere!" }, 745{ "Synchronize!","Synchronisiere!" },
746{ "High clock skew!","Großer Uhrzeitunterschied!" }, 746{ "High clock skew!","Großer Uhrzeitunterschied!" },
747{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 747{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
748{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 748{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
749{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, 749{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" },
750{ "","" }, 750{ "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" },
751{ "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" },
751{ "","" }, 752{ "","" },
752{ "","" }, 753{ "","" },
753{ "","" }, 754{ "","" },
754{ "","" }, 755{ "","" },
755{ "","" }, 756{ "","" },
756{ "","" }, 757{ "","" },
757{ "","" }, \ No newline at end of file 758{ "","" }, \ No newline at end of file
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index dd2121a..cd198c4 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -85,84 +85,90 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
85 85
86 86
87 connect( mSearchText, SIGNAL( scrollUP() ), this, SIGNAL( scrollUP() )); 87 connect( mSearchText, SIGNAL( scrollUP() ), this, SIGNAL( scrollUP() ));
88 connect( mSearchText, SIGNAL( scrollDOWN() ), this, SIGNAL( scrollDOWN() )); 88 connect( mSearchText, SIGNAL( scrollDOWN() ), this, SIGNAL( scrollDOWN() ));
89 89
90 90
91 setFocusProxy( mSearchText ); 91 setFocusProxy( mSearchText );
92} 92}
93 93
94IncSearchWidget::~IncSearchWidget() 94IncSearchWidget::~IncSearchWidget()
95{ 95{
96 96
97} 97}
98void IncSearchWidget::announceDoSearch2() 98void IncSearchWidget::announceDoSearch2()
99{ 99{
100 if ( KABPrefs::instance()->mSearchWithReturn ) 100 if ( KABPrefs::instance()->mSearchWithReturn )
101 return; 101 return;
102 emit doSearch( mSearchText->text() ); 102 emit doSearch( mSearchText->text() );
103 //qDebug("emit dosreach "); 103 //qDebug("emit dosreach ");
104} 104}
105 105
106void IncSearchWidget::announceDoSearch() 106void IncSearchWidget::announceDoSearch()
107{ 107{
108 108
109 emit doSearch( mSearchText->text() ); 109 emit doSearch( mSearchText->text() );
110 // qDebug("emit dosreach "); 110 // qDebug("emit dosreach ");
111} 111}
112 112
113void IncSearchWidget::announceFieldChanged() 113void IncSearchWidget::announceFieldChanged()
114{ 114{
115 emit fieldChanged(); 115 emit fieldChanged();
116} 116}
117 117void IncSearchWidget::setSize()
118{
119 if ( KABPrefs::instance()->mHideSearchOnSwitch && QApplication::desktop()->width() == 480) {
120 mFieldCombo->setMaximumWidth( 40 );
121 mSearchText->setMaximumWidth( 30 );
122 } else {
123 QFontMetrics fm ( mFieldCombo->font() );
124 int wid = fm.width(i18n( "All Fields" ) );
125 int max = wid;
126 mFieldCombo->setMaximumWidth( wid+60 );
127 mSearchText->setMaximumWidth( 1024 );
128 }
129}
118void IncSearchWidget::setFields( const KABC::Field::List &list ) 130void IncSearchWidget::setFields( const KABC::Field::List &list )
119{ 131{
120 132
121 mFieldCombo->clear(); 133 mFieldCombo->clear();
122 mFieldCombo->insertItem( i18n( "All Fields" ) ); 134 mFieldCombo->insertItem( i18n( "All Fields" ) );
123 QFontMetrics fm ( mFieldCombo->font() ); 135
124 int wid = fm.width(i18n( "All Fields" ) );
125 int max = wid;
126
127 KABC::Field::List::ConstIterator it; 136 KABC::Field::List::ConstIterator it;
128 for ( it = list.begin(); it != list.end(); ++it ) { 137 for ( it = list.begin(); it != list.end(); ++it ) {
129 mFieldCombo->insertItem( (*it)->label() ); 138 mFieldCombo->insertItem( (*it)->label() );
130 // wid = fm.width((*it)->label() );
131 //if ( wid > max )
132 // max = wid;
133 } 139 }
134 140
135 mFieldList = list; 141 mFieldList = list;
136 142
137 announceDoSearch(); 143 announceDoSearch();
138 announceFieldChanged(); 144 announceFieldChanged();
139 mFieldCombo->setMaximumWidth( wid+60 ); 145 setSize();
140} 146}
141 147
142KABC::Field::List IncSearchWidget::fields() const 148KABC::Field::List IncSearchWidget::fields() const
143{ 149{
144 return mFieldList; 150 return mFieldList;
145} 151}
146 152
147KABC::Field *IncSearchWidget::currentField()const 153KABC::Field *IncSearchWidget::currentField()const
148{ 154{
149 if ( mFieldCombo->currentItem() == -1 || mFieldCombo->currentItem() == 0 ) 155 if ( mFieldCombo->currentItem() == -1 || mFieldCombo->currentItem() == 0 )
150 return 0; // for error or 'use all fields' 156 return 0; // for error or 'use all fields'
151 else 157 else
152 return mFieldList[ mFieldCombo->currentItem() - 1 ]; 158 return mFieldList[ mFieldCombo->currentItem() - 1 ];
153} 159}
154 160
155void IncSearchWidget::setCurrentItem( int pos ) 161void IncSearchWidget::setCurrentItem( int pos )
156{ 162{
157 mFieldCombo->setCurrentItem( pos ); 163 mFieldCombo->setCurrentItem( pos );
158 announceFieldChanged(); 164 announceFieldChanged();
159} 165}
160 166
161int IncSearchWidget::currentItem() const 167int IncSearchWidget::currentItem() const
162{ 168{
163 169
164 return mFieldCombo->currentItem(); 170 return mFieldCombo->currentItem();
165} 171}
166#ifndef KAB_EMBEDDED 172#ifndef KAB_EMBEDDED
167#include "incsearchwidget.moc" 173#include "incsearchwidget.moc"
168#endif //KAB_EMBEDDED 174#endif //KAB_EMBEDDED
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 1546a51..cae55cd 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -17,60 +17,61 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef INCSEARCHWIDGET_H 24#ifndef INCSEARCHWIDGET_H
25#define INCSEARCHWIDGET_H 25#define INCSEARCHWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29#include <kabc/field.h> 29#include <kabc/field.h>
30 30
31class QComboBox; 31class QComboBox;
32class KLineEdit; 32class KLineEdit;
33 33
34class IncSearchWidget : public QWidget 34class IncSearchWidget : public QWidget
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 37
38 public: 38 public:
39 IncSearchWidget( QWidget *parent, const char *name = 0 ); 39 IncSearchWidget( QWidget *parent, const char *name = 0 );
40 ~IncSearchWidget(); 40 ~IncSearchWidget();
41 41
42 void setFields( const KABC::Field::List &list ); 42 void setFields( const KABC::Field::List &list );
43 KABC::Field::List fields() const; 43 KABC::Field::List fields() const;
44 44
45 KABC::Field *currentField() const; 45 KABC::Field *currentField() const;
46 46
47 void setCurrentItem( int pos ); 47 void setCurrentItem( int pos );
48 int currentItem() const; 48 int currentItem() const;
49 void setSize();
49 50
50 signals: 51 signals:
51 void scrollUP(); 52 void scrollUP();
52 void scrollDOWN(); 53 void scrollDOWN();
53 /** 54 /**
54 This signal is emmited whenever the text in the input 55 This signal is emmited whenever the text in the input
55 widget is changed. You can get the sorting field by 56 widget is changed. You can get the sorting field by
56 @ref currentField. 57 @ref currentField.
57 */ 58 */
58 void doSearch( const QString& text ); 59 void doSearch( const QString& text );
59 60
60 /** 61 /**
61 This signal is emmited whenever the search field changes. 62 This signal is emmited whenever the search field changes.
62 */ 63 */
63 void fieldChanged(); 64 void fieldChanged();
64 65
65 private slots: 66 private slots:
66 void announceDoSearch(); 67 void announceDoSearch();
67 void announceDoSearch2(); 68 void announceDoSearch2();
68 void announceFieldChanged(); 69 void announceFieldChanged();
69 70
70 private: 71 private:
71 QComboBox* mFieldCombo; 72 QComboBox* mFieldCombo;
72 KLineEdit* mSearchText; 73 KLineEdit* mSearchText;
73 KABC::Field::List mFieldList; 74 KABC::Field::List mFieldList;
74}; 75};
75 76
76#endif 77#endif
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 59aa5a5..09d8523 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -269,64 +269,65 @@ class KAex2phonePrefs : public QDialog
269 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 269 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
270 lay->addWidget( ok ); 270 lay->addWidget( ok );
271 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 271 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
272 lay->addWidget( cancel ); 272 lay->addWidget( cancel );
273 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 273 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
274 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 274 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
275 resize( 220, 240 ); 275 resize( 220, 240 );
276 276
277 } 277 }
278 278
279public: 279public:
280 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 280 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
281 QCheckBox* mWriteToSim; 281 QCheckBox* mWriteToSim;
282}; 282};
283 283
284 284
285bool pasteWithNewUid = true; 285bool pasteWithNewUid = true;
286 286
287#ifdef KAB_EMBEDDED 287#ifdef KAB_EMBEDDED
288KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 288KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
292#else //KAB_EMBEDDED 292#else //KAB_EMBEDDED
293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
296 mReadWrite( readWrite ), mModified( false ) 296 mReadWrite( readWrite ), mModified( false )
297#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
298{ 298{
299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
300 // syncManager->setBlockSave(false); 300 // syncManager->setBlockSave(false);
301 mIncSearchWidget = 0;
301 mMiniSplitter = 0; 302 mMiniSplitter = 0;
302 mExtensionBarSplitter = 0; 303 mExtensionBarSplitter = 0;
303 mIsPart = !parent->inherits( "KAddressBookMain" ); 304 mIsPart = !parent->inherits( "KAddressBookMain" );
304 mAddressBook = KABC::StdAddressBook::self(); 305 mAddressBook = KABC::StdAddressBook::self();
305 KABC::StdAddressBook::setAutomaticSave( false ); 306 KABC::StdAddressBook::setAutomaticSave( false );
306 307
307#ifndef KAB_EMBEDDED 308#ifndef KAB_EMBEDDED
308 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
309#endif //KAB_EMBEDDED 310#endif //KAB_EMBEDDED
310 311
311 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
312 SLOT( addressBookChanged() ) ); 313 SLOT( addressBookChanged() ) );
313 314
314#if 0 315#if 0
315 // LP moved to addressbook init method 316 // LP moved to addressbook init method
316 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
317 "X-Department", "KADDRESSBOOK" ); 318 "X-Department", "KADDRESSBOOK" );
318 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
319 "X-Profession", "KADDRESSBOOK" ); 320 "X-Profession", "KADDRESSBOOK" );
320 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
321 "X-AssistantsName", "KADDRESSBOOK" ); 322 "X-AssistantsName", "KADDRESSBOOK" );
322 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
323 "X-ManagersName", "KADDRESSBOOK" ); 324 "X-ManagersName", "KADDRESSBOOK" );
324 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
325 "X-SpousesName", "KADDRESSBOOK" ); 326 "X-SpousesName", "KADDRESSBOOK" );
326 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
327 "X-Office", "KADDRESSBOOK" ); 328 "X-Office", "KADDRESSBOOK" );
328 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
329 "X-IMAddress", "KADDRESSBOOK" ); 330 "X-IMAddress", "KADDRESSBOOK" );
330 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
331 "X-Anniversary", "KADDRESSBOOK" ); 332 "X-Anniversary", "KADDRESSBOOK" );
332 333
@@ -790,94 +791,102 @@ void KABCore::mailVCard( const QStringList& uids )
790 791
791 792
792/*US 793/*US
793 kapp->invokeMailer( QString::null, QString::null, QString::null, 794 kapp->invokeMailer( QString::null, QString::null, QString::null,
794 QString::null, // subject 795 QString::null, // subject
795 QString::null, // body 796 QString::null, // body
796 QString::null, 797 QString::null,
797 urls ); // attachments 798 urls ); // attachments
798*/ 799*/
799 800
800} 801}
801 802
802/** 803/**
803 Beams the "WhoAmI contact. 804 Beams the "WhoAmI contact.
804*/ 805*/
805void KABCore::beamMySelf() 806void KABCore::beamMySelf()
806{ 807{
807 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 808 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
808 if (!a.isEmpty()) 809 if (!a.isEmpty())
809 { 810 {
810 QStringList uids; 811 QStringList uids;
811 uids << a.uid(); 812 uids << a.uid();
812 813
813 beamVCard(uids); 814 beamVCard(uids);
814 } else { 815 } else {
815 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 816 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
816 817
817 818
818 } 819 }
819} 820}
820void KABCore::updateMainWindow() 821void KABCore::updateMainWindow()
821{ 822{
822
823 mMainWindow->showMaximized(); 823 mMainWindow->showMaximized();
824 mMainWindow->update(); 824 mMainWindow->update();
825} 825}
826void KABCore::resizeEvent(QResizeEvent* e ) 826void KABCore::resizeEvent(QResizeEvent* e )
827{ 827{
828 if ( !mMiniSplitter ) 828 if ( !mMiniSplitter )
829 return; 829 return;
830 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); 830 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
831 if ( QApplication::desktop()->width() >= 480 ) { 831 if ( QApplication::desktop()->width() >= 480 ) {
832 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 832 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
833 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 833 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
834 mMiniSplitter->setOrientation( Qt::Horizontal); 834 mMiniSplitter->setOrientation( Qt::Horizontal);
835 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 835 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
836 if ( QApplication::desktop()->width() <= 640 ) {
837 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
838 mViewManager->getFilterAction()->setComboWidth( 150 );
839 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
840 }
841 } 836 }
837 if ( QApplication::desktop()->width() <= 640 ) {
838 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
839 mViewManager->getFilterAction()->setComboWidth( 150 );
840 if ( mIncSearchWidget )
841 mIncSearchWidget->setSize();
842 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
843 }
844
842 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 845 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
843 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 846 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
844 mMiniSplitter->setOrientation( Qt::Vertical ); 847 mMiniSplitter->setOrientation( Qt::Vertical );
845 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 848 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
846 if ( QApplication::desktop()->width() <= 640 ) { 849 }
847 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 850 if ( QApplication::desktop()->width() <= 640 ) {
848 mMainWindow->showMinimized(); 851 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
852 mMainWindow->showMinimized();
853 if ( KABPrefs::instance()->mHideSearchOnSwitch ) {
854 if ( mIncSearchWidget ) {
855 mIncSearchWidget->setSize();
856 }
857 } else {
849 mViewManager->getFilterAction()->setComboWidth( 0 ); 858 mViewManager->getFilterAction()->setComboWidth( 0 );
850 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
851 } 859 }
860 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
852 } 861 }
853 } 862 }
854 } 863 }
855 864
856} 865}
857void KABCore::export2phone() 866void KABCore::export2phone()
858{ 867{
859 868
860 QStringList uids; 869 QStringList uids;
861 XXPortSelectDialog dlg( this, false, this ); 870 XXPortSelectDialog dlg( this, false, this );
862 if ( dlg.exec() ) 871 if ( dlg.exec() )
863 uids = dlg.uids(); 872 uids = dlg.uids();
864 else 873 else
865 return; 874 return;
866 if ( uids.isEmpty() ) 875 if ( uids.isEmpty() )
867 return; 876 return;
868 // qDebug("count %d ", uids.count()); 877 // qDebug("count %d ", uids.count());
869 878
870 KAex2phonePrefs ex2phone; 879 KAex2phonePrefs ex2phone;
871 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 880 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
872 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 881 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
873 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 882 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
874 883
875 if ( !ex2phone.exec() ) { 884 if ( !ex2phone.exec() ) {
876 return; 885 return;
877 } 886 }
878 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 887 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
879 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 888 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
880 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 889 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
881 890
882 891
883 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 892 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
@@ -1124,65 +1133,71 @@ void KABCore::setCategories()
1124 //QStringList uids = mViewManager->selectedUids(); 1133 //QStringList uids = mViewManager->selectedUids();
1125 QStringList::Iterator it; 1134 QStringList::Iterator it;
1126 for ( it = uids.begin(); it != uids.end(); ++it ) { 1135 for ( it = uids.begin(); it != uids.end(); ++it ) {
1127 KABC::Addressee addr = mAddressBook->findByUid( *it ); 1136 KABC::Addressee addr = mAddressBook->findByUid( *it );
1128 if ( !addr.isEmpty() ) { 1137 if ( !addr.isEmpty() ) {
1129 if ( !merge ) 1138 if ( !merge )
1130 addr.setCategories( categories ); 1139 addr.setCategories( categories );
1131 else { 1140 else {
1132 QStringList addrCategories = addr.categories(); 1141 QStringList addrCategories = addr.categories();
1133 QStringList::Iterator catIt; 1142 QStringList::Iterator catIt;
1134 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { 1143 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
1135 if ( !addrCategories.contains( *catIt ) ) 1144 if ( !addrCategories.contains( *catIt ) )
1136 addrCategories.append( *catIt ); 1145 addrCategories.append( *catIt );
1137 } 1146 }
1138 addr.setCategories( addrCategories ); 1147 addr.setCategories( addrCategories );
1139 } 1148 }
1140 mAddressBook->insertAddressee( addr ); 1149 mAddressBook->insertAddressee( addr );
1141 } 1150 }
1142 } 1151 }
1143 1152
1144 if ( uids.count() > 0 ) 1153 if ( uids.count() > 0 )
1145 setModified( true ); 1154 setModified( true );
1146 message( i18n("Setting categories completed!") ); 1155 message( i18n("Setting categories completed!") );
1147} 1156}
1148 1157
1149void KABCore::setSearchFields( const KABC::Field::List &fields ) 1158void KABCore::setSearchFields( const KABC::Field::List &fields )
1150{ 1159{
1151 mIncSearchWidget->setFields( fields ); 1160 mIncSearchWidget->setFields( fields );
1152} 1161}
1153 1162
1154void KABCore::incrementalSearch( const QString& text ) 1163void KABCore::incrementalSearch( const QString& text )
1155{ 1164{
1156 mViewManager->doSearch( text, mIncSearchWidget->currentField() ); 1165 QString stext;
1166 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) {
1167 stext = "*" + text;
1168 } else {
1169 stext = text;
1170 }
1171 mViewManager->doSearch( stext, mIncSearchWidget->currentField() );
1157} 1172}
1158 1173
1159void KABCore::setModified() 1174void KABCore::setModified()
1160{ 1175{
1161 setModified( true ); 1176 setModified( true );
1162} 1177}
1163 1178
1164void KABCore::setModifiedWOrefresh() 1179void KABCore::setModifiedWOrefresh()
1165{ 1180{
1166 // qDebug("KABCore::setModifiedWOrefresh() "); 1181 // qDebug("KABCore::setModifiedWOrefresh() ");
1167 mModified = true; 1182 mModified = true;
1168 mActionSave->setEnabled( mModified ); 1183 mActionSave->setEnabled( mModified );
1169 1184
1170 1185
1171} 1186}
1172void KABCore::setModified( bool modified ) 1187void KABCore::setModified( bool modified )
1173{ 1188{
1174 mModified = modified; 1189 mModified = modified;
1175 mActionSave->setEnabled( mModified ); 1190 mActionSave->setEnabled( mModified );
1176 1191
1177 if ( modified ) 1192 if ( modified )
1178 mJumpButtonBar->recreateButtons(); 1193 mJumpButtonBar->recreateButtons();
1179 1194
1180 mViewManager->refreshView(); 1195 mViewManager->refreshView();
1181 1196
1182} 1197}
1183 1198
1184bool KABCore::modified() const 1199bool KABCore::modified() const
1185{ 1200{
1186 return mModified; 1201 return mModified;
1187} 1202}
1188 1203
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index b96d28a..ea254b7 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -31,64 +31,66 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
33 33
34#include <kconfig.h> 34#include <kconfig.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
37#include <kglobalsettings.h> 37#include <kglobalsettings.h>
38//US#include <kdebug.h> // defines kdDebug() 38//US#include <kdebug.h> // defines kdDebug()
39 39
40#include "kabprefs.h" 40#include "kabprefs.h"
41 41
42#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
43#include <qapplication.h> 43#include <qapplication.h>
44#endif 44#endif
45 45
46KABPrefs *KABPrefs::sInstance = 0; 46KABPrefs *KABPrefs::sInstance = 0;
47static KStaticDeleter<KABPrefs> staticDeleterAB; 47static KStaticDeleter<KABPrefs> staticDeleterAB;
48 48
49KABPrefs::KABPrefs() 49KABPrefs::KABPrefs()
50 : KPimPrefs("kaddressbookrc") 50 : KPimPrefs("kaddressbookrc")
51{ 51{
52 KPrefs::setCurrentGroup( "Views" ); 52 KPrefs::setCurrentGroup( "Views" );
53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); 53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
54 54
55 KPrefs::setCurrentGroup( "General" ); 55 KPrefs::setCurrentGroup( "General" );
56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
58#ifdef KAB_EMBEDDED 58#ifdef KAB_EMBEDDED
59 addItemBool("AskForQuit",&mAskForQuit,true); 59 addItemBool("AskForQuit",&mAskForQuit,true);
60 addItemBool("ToolBarHor",&mToolBarHor, true ); 60 addItemBool("ToolBarHor",&mToolBarHor, true );
61 addItemBool("ToolBarUp",&mToolBarUp, false ); 61 addItemBool("ToolBarUp",&mToolBarUp, false );
62 addItemBool("SearchWithReturn",&mSearchWithReturn, false ); 62 addItemBool("SearchWithReturn",&mSearchWithReturn, false );
63 addItemBool("AutoSearchWithWildcard",&mAutoSearchWithWildcard, false );
64 addItemBool("HideSearchOnSwitch",&mHideSearchOnSwitch, false );
63 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); 65 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont());
64 66
65 67
66#endif //KAB_EMBEDDED 68#endif //KAB_EMBEDDED
67 69
68 KPrefs::setCurrentGroup( "MainWindow" ); 70 KPrefs::setCurrentGroup( "MainWindow" );
69 bool m_visible = false; 71 bool m_visible = false;
70#ifdef DESKTOP_VERSION 72#ifdef DESKTOP_VERSION
71 m_visible = true; 73 m_visible = true;
72#endif 74#endif
73 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); 75 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible );
74 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); 76 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
75 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); 77 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
76 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); 78 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
77 addItemIntList( "DetailsSplitter", &mDetailsSplitter ); 79 addItemIntList( "DetailsSplitter", &mDetailsSplitter );
78 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); 80 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
79 81
80 82
81 KPrefs::setCurrentGroup( "Extensions_General" ); 83 KPrefs::setCurrentGroup( "Extensions_General" );
82 QStringList defaultExtensions; 84 QStringList defaultExtensions;
83 defaultExtensions << "merge"; 85 defaultExtensions << "merge";
84 defaultExtensions << "distribution_list_editor"; 86 defaultExtensions << "distribution_list_editor";
85 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 87 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
86 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 88 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
87 89
88 KPrefs::setCurrentGroup( "Views" ); 90 KPrefs::setCurrentGroup( "Views" );
89 QString defaultView = i18n( "Default Table View" ); 91 QString defaultView = i18n( "Default Table View" );
90 addItemString( "CurrentView", &mCurrentView, defaultView ); 92 addItemString( "CurrentView", &mCurrentView, defaultView );
91 addItemStringList( "ViewNames", &mViewNames, defaultView ); 93 addItemStringList( "ViewNames", &mViewNames, defaultView );
92 94
93 KPrefs::setCurrentGroup( "Filters" ); 95 KPrefs::setCurrentGroup( "Filters" );
94 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 96 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 1e3b48f..2bb173d 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -41,56 +41,58 @@ class KABPrefs : public KPimPrefs
41 // General 41 // General
42 bool mHonorSingleClick; 42 bool mHonorSingleClick;
43 bool mAutomaticNameParsing; 43 bool mAutomaticNameParsing;
44 int mCurrentIncSearchField; 44 int mCurrentIncSearchField;
45 45
46#ifdef KAB_EMBEDDED 46#ifdef KAB_EMBEDDED
47 // US introduce a nonconst way to return the config object. 47 // US introduce a nonconst way to return the config object.
48 KConfig* getConfig(); 48 KConfig* getConfig();
49 49
50 bool mToolBarHor; 50 bool mToolBarHor;
51 bool mToolBarUp; 51 bool mToolBarUp;
52 bool mAskForQuit; 52 bool mAskForQuit;
53 53
54 54
55 /** Set preferences to default values */ 55 /** Set preferences to default values */
56// void usrSetDefaults(); 56// void usrSetDefaults();
57 57
58 /** Read preferences from config file */ 58 /** Read preferences from config file */
59// void usrReadConfig(); 59// void usrReadConfig();
60 60
61 /** Write preferences to config file */ 61 /** Write preferences to config file */
62// void usrWriteConfig(); 62// void usrWriteConfig();
63#endif //KAB_EMBEDDED 63#endif //KAB_EMBEDDED
64 void usrReadConfig(); 64 void usrReadConfig();
65 65
66 66
67 // GUI 67 // GUI
68 bool mFullMenuBarVisible; 68 bool mFullMenuBarVisible;
69 bool mJumpButtonBarVisible; 69 bool mJumpButtonBarVisible;
70 bool mDetailsPageVisible; 70 bool mDetailsPageVisible;
71 bool mMultipleViewsAtOnce; 71 bool mMultipleViewsAtOnce;
72 bool mSearchWithReturn; 72 bool mSearchWithReturn;
73 bool mAutoSearchWithWildcard;
74 bool mHideSearchOnSwitch;
73 QValueList<int> mExtensionsSplitter; 75 QValueList<int> mExtensionsSplitter;
74 QValueList<int> mDetailsSplitter; 76 QValueList<int> mDetailsSplitter;
75 77
76 // Extensions stuff 78 // Extensions stuff
77 int mCurrentExtension; 79 int mCurrentExtension;
78 QStringList mActiveExtensions; 80 QStringList mActiveExtensions;
79 81
80 // Views stuff 82 // Views stuff
81 QString mCurrentView; 83 QString mCurrentView;
82 QStringList mViewNames; 84 QStringList mViewNames;
83 85
84 // Filter 86 // Filter
85 int mCurrentFilter; 87 int mCurrentFilter;
86 88
87 void setCategoryDefaults(); 89 void setCategoryDefaults();
88 QFont mDetailsFont; 90 QFont mDetailsFont;
89 91
90 private: 92 private:
91 KABPrefs(); 93 KABPrefs();
92 94
93 static KABPrefs *sInstance; 95 static KABPrefs *sInstance;
94}; 96};
95 97
96#endif 98#endif
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 3ad2f74..986c9b8 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -94,158 +94,173 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
94 QTabWidget *tabWidget = new QTabWidget( this ); 94 QTabWidget *tabWidget = new QTabWidget( this );
95 topLayout->addWidget( tabWidget ); 95 topLayout->addWidget( tabWidget );
96 96
97 // General page 97 // General page
98 QWidget *generalPage = new QWidget( this ); 98 QWidget *generalPage = new QWidget( this );
99 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 99 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(),
100 KDialog::spacingHintSmall() ); 100 KDialog::spacingHintSmall() );
101 101
102 102
103 QWidget *hBox = new QWidget( generalPage, "qhbox" ); 103 QWidget *hBox = new QWidget( generalPage, "qhbox" );
104 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); 104 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox);
105 KPrefsWidFont *detailsFont = 105 KPrefsWidFont *detailsFont =
106 addWidFont(i18n("phone:123"),i18n("Details view font"), 106 addWidFont(i18n("phone:123"),i18n("Details view font"),
107 &(KABPrefs::instance()->mDetailsFont),hBox); 107 &(KABPrefs::instance()->mDetailsFont),hBox);
108 hboxLayout->addWidget(detailsFont->label()); 108 hboxLayout->addWidget(detailsFont->label());
109 hboxLayout->addWidget(detailsFont->preview()); 109 hboxLayout->addWidget(detailsFont->preview());
110 hboxLayout->addWidget(detailsFont->button()); 110 hboxLayout->addWidget(detailsFont->button());
111 hboxLayout->setMargin(KDialog::marginHintSmall() ); 111 hboxLayout->setMargin(KDialog::marginHintSmall() );
112 hboxLayout->setSpacing(KDialog::spacingHintSmall()); 112 hboxLayout->setSpacing(KDialog::spacingHintSmall());
113 //hBox->setBackgroundColor( black); 113 //hBox->setBackgroundColor( black);
114 layout->addWidget( hBox ); 114 layout->addWidget( hBox );
115 115
116 //general groupbox 116 //general groupbox
117 QWidget *vBox = new QWidget( generalPage, "qvbox" ); 117 QWidget *vBox = new QWidget( generalPage, "qvbox" );
118 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 118 QVBoxLayout *boxLayout = new QVBoxLayout( vBox );
119 boxLayout->setAlignment( Qt::AlignTop ); 119 boxLayout->setAlignment( Qt::AlignTop );
120 boxLayout->setMargin(KDialog::marginHintSmall() ); 120 boxLayout->setMargin(KDialog::marginHintSmall() );
121 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 121 boxLayout->setSpacing( KDialog::spacingHintSmall() );
122 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 122 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
123 boxLayout->addWidget( mMenuBarBox ); 123 boxLayout->addWidget( mMenuBarBox );
124 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 124 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
125 boxLayout->addWidget( mSearchReturnBox ); 125 boxLayout->addWidget( mSearchReturnBox );
126 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
127 boxLayout->addWidget( mAutoSearchWithWildcardBox);
128 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
129 boxLayout->addWidget( mHideSearchOnSwitchBox );
130
131#ifdef DESKTOP_VERSION
132 mHideSearchOnSwitchBox->hide();
133#endif
126 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); 134 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" );
127 boxLayout->addWidget( mViewsSingleClickBox ); 135 boxLayout->addWidget( mViewsSingleClickBox );
128 136
129 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" ); 137 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" );
130 boxLayout->addWidget( mNameParsing ); 138 boxLayout->addWidget( mNameParsing );
131 139
132 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); 140 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
133 boxLayout->addWidget( mMultipleViewsAtOnce ); 141 boxLayout->addWidget( mMultipleViewsAtOnce );
134 142
135 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" ); 143 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" );
136 boxLayout->addWidget( mAskForQuit ); 144 boxLayout->addWidget( mAskForQuit );
137 145
138 layout->addWidget( vBox ); 146 layout->addWidget( vBox );
139 147
140 tabWidget->addTab( generalPage, i18n( "General" ) ); 148 tabWidget->addTab( generalPage, i18n( "General" ) );
141 149
142 // Extension page 150 // Extension page
143 QWidget *extensionPage = new QWidget( this ); 151 QWidget *extensionPage = new QWidget( this );
144 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), 152 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(),
145 KDialog::spacingHintSmall() ); 153 KDialog::spacingHintSmall() );
146 154
147 //extensions groupbox 155 //extensions groupbox
148 156
149 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); 157 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
150 boxLayout = new QVBoxLayout( groupBox->layout() ); 158 boxLayout = new QVBoxLayout( groupBox->layout() );
151 boxLayout->setAlignment( Qt::AlignTop ); 159 boxLayout->setAlignment( Qt::AlignTop );
152 boxLayout->setMargin(KDialog::marginHintSmall()); 160 boxLayout->setMargin(KDialog::marginHintSmall());
153 boxLayout->setSpacing(KDialog::spacingHintSmall()); 161 boxLayout->setSpacing(KDialog::spacingHintSmall());
154 groupBox->layout()->setMargin(1) ; 162 groupBox->layout()->setMargin(1) ;
155 groupBox->layout()->setSpacing(0); 163 groupBox->layout()->setSpacing(0);
156 mExtensionView = new KListView( groupBox ); 164 mExtensionView = new KListView( groupBox );
157 mExtensionView->setAllColumnsShowFocus( true ); 165 mExtensionView->setAllColumnsShowFocus( true );
158 mExtensionView->addColumn( i18n( "Name" ) ); 166 mExtensionView->addColumn( i18n( "Name" ) );
159 mExtensionView->addColumn( i18n( "Description" ) ); 167 mExtensionView->addColumn( i18n( "Description" ) );
160 //mExtensionView->setMaximumHeight(80); 168 //mExtensionView->setMaximumHeight(80);
161 169
162 boxLayout->addWidget( mExtensionView ); 170 boxLayout->addWidget( mExtensionView );
163 171
164 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); 172 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
165 mConfigureButton->setEnabled( false ); 173 mConfigureButton->setEnabled( false );
166 boxLayout->addWidget( mConfigureButton ); 174 boxLayout->addWidget( mConfigureButton );
167 175
168 extensionLayout->addWidget( groupBox ); 176 extensionLayout->addWidget( groupBox );
169 177
170 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 178 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
171 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 179 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
172 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 180 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
173 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 181 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
182 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
183 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
174 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 184 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
175 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 185 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
176 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 186 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
177 SLOT( selectionChanged( QListViewItem* ) ) ); 187 SLOT( selectionChanged( QListViewItem* ) ) );
178 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 188 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
179 SLOT( itemClicked( QListViewItem* ) ) ); 189 SLOT( itemClicked( QListViewItem* ) ) );
180 connect( mConfigureButton, SIGNAL( clicked() ), 190 connect( mConfigureButton, SIGNAL( clicked() ),
181 SLOT( configureExtension() ) ); 191 SLOT( configureExtension() ) );
182 192
183 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 193 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
184 194
185 // Addressee page 195 // Addressee page
186 mAddresseeWidget = new AddresseeWidget( this ); 196 mAddresseeWidget = new AddresseeWidget( this );
187 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 197 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
188 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 198 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
189 199
190} 200}
191 201
192void KABConfigWidget::usrReadConfig() 202void KABConfigWidget::usrReadConfig()
193{ 203{
194 KABPrefs* prefs = KABPrefs::instance(); 204 KABPrefs* prefs = KABPrefs::instance();
195 205
196 bool blocked = signalsBlocked(); 206 bool blocked = signalsBlocked();
197 blockSignals( true ); 207 blockSignals( true );
198 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); 208 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible);
199 mNameParsing->setChecked( prefs->mAutomaticNameParsing ); 209 mNameParsing->setChecked( prefs->mAutomaticNameParsing );
200 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); 210 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
201 mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); 211 mSearchReturnBox->setChecked( prefs->mSearchWithReturn );
212 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard );
213 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch );
202 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); 214 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
203 mAskForQuit->setChecked( prefs->mAskForQuit ); 215 mAskForQuit->setChecked( prefs->mAskForQuit );
204 216
205 mAddresseeWidget->restoreSettings(); 217 mAddresseeWidget->restoreSettings();
206 218
207 restoreExtensionSettings(); 219 restoreExtensionSettings();
208 220
209 blockSignals( blocked ); 221 blockSignals( blocked );
210 222
211} 223}
212 224
213void KABConfigWidget::usrWriteConfig() 225void KABConfigWidget::usrWriteConfig()
214{ 226{
215 KABPrefs* prefs = KABPrefs::instance(); 227 KABPrefs* prefs = KABPrefs::instance();
216 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); 228 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked();
217 prefs->mAutomaticNameParsing = mNameParsing->isChecked(); 229 prefs->mAutomaticNameParsing = mNameParsing->isChecked();
218 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 230 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
219 prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); 231 prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
232 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked();
233 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked();
234
220 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); 235 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
221 prefs->mAskForQuit = mAskForQuit->isChecked(); 236 prefs->mAskForQuit = mAskForQuit->isChecked();
222 237
223 mAddresseeWidget->saveSettings(); 238 mAddresseeWidget->saveSettings();
224 239
225 saveExtensionSettings(); 240 saveExtensionSettings();
226 241
227} 242}
228 243
229void KABConfigWidget::restoreExtensionSettings() 244void KABConfigWidget::restoreExtensionSettings()
230{ 245{
231 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 246 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
232 247
233 mExtensionView->clear(); 248 mExtensionView->clear();
234 249
235#ifndef KAB_EMBEDDED 250#ifndef KAB_EMBEDDED
236 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); 251 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" );
237 KTrader::OfferList::ConstIterator it; 252 KTrader::OfferList::ConstIterator it;
238 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 253 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
239 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) 254 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) )
240 continue; 255 continue;
241 256
242 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); 257 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() );
243 item->setService( *it ); 258 item->setService( *it );
244 if ( activeExtensions.contains( item->factory()->identifier() ) ) 259 if ( activeExtensions.contains( item->factory()->identifier() ) )
245 item->setOn( true ); 260 item->setOn( true );
246 } 261 }
247#else //KAB_EMBEDDED 262#else //KAB_EMBEDDED
248 ExtensionFactory *extensionFactory = new MergeFactory(); 263 ExtensionFactory *extensionFactory = new MergeFactory();
249 264
250 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); 265 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts");
251 266
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index 08d71b4..a172e97 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -35,41 +35,43 @@ class KListView;
35class KABPrefs; 35class KABPrefs;
36 36
37class AddresseeWidget; 37class AddresseeWidget;
38 38
39class KABConfigWidget : public KPrefsWidget 39class KABConfigWidget : public KPrefsWidget
40{ 40{
41 Q_OBJECT 41 Q_OBJECT
42 42
43 public: 43 public:
44 KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 ); 44 KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 );
45 45
46 protected: 46 protected:
47 /** Implement this to read custom configuration widgets. */ 47 /** Implement this to read custom configuration widgets. */
48 virtual void usrReadConfig(); 48 virtual void usrReadConfig();
49 /** Implement this to write custom configuration widgets. */ 49 /** Implement this to write custom configuration widgets. */
50 virtual void usrWriteConfig(); 50 virtual void usrWriteConfig();
51 51
52 52
53 53
54 private slots: 54 private slots:
55 void configureExtension(); 55 void configureExtension();
56 void selectionChanged( QListViewItem* ); 56 void selectionChanged( QListViewItem* );
57 void itemClicked( QListViewItem* ); 57 void itemClicked( QListViewItem* );
58 58
59 private: 59 private:
60 void restoreExtensionSettings(); 60 void restoreExtensionSettings();
61 void saveExtensionSettings(); 61 void saveExtensionSettings();
62 62
63 KListView *mExtensionView; 63 KListView *mExtensionView;
64 QCheckBox *mSearchReturnBox; 64 QCheckBox *mSearchReturnBox;
65 QCheckBox *mNameParsing; 65 QCheckBox *mNameParsing;
66 QCheckBox *mViewsSingleClickBox; 66 QCheckBox *mViewsSingleClickBox;
67 QCheckBox *mAutoSearchWithWildcardBox;
68 QCheckBox *mHideSearchOnSwitchBox;
67 QCheckBox *mMultipleViewsAtOnce; 69 QCheckBox *mMultipleViewsAtOnce;
68 QCheckBox *mAskForQuit; 70 QCheckBox *mAskForQuit;
69 QCheckBox *mMenuBarBox; 71 QCheckBox *mMenuBarBox;
70 QPushButton *mConfigureButton; 72 QPushButton *mConfigureButton;
71 73
72 AddresseeWidget *mAddresseeWidget; 74 AddresseeWidget *mAddresseeWidget;
73}; 75};
74 76
75#endif 77#endif
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 04759a7..c2b1bb0 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -79,65 +79,65 @@ ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name )
79 mViewDict.setAutoDelete( true ); 79 mViewDict.setAutoDelete( true );
80 80
81 createViewFactories(); 81 createViewFactories();
82} 82}
83 83
84ViewManager::~ViewManager() 84ViewManager::~ViewManager()
85{ 85{
86 unloadViews(); 86 unloadViews();
87 mViewFactoryDict.clear(); 87 mViewFactoryDict.clear();
88} 88}
89void ViewManager::scrollUP() 89void ViewManager::scrollUP()
90{ 90{
91 if ( mActiveView ) 91 if ( mActiveView )
92 mActiveView->scrollUP(); 92 mActiveView->scrollUP();
93} 93}
94void ViewManager::scrollDOWN() 94void ViewManager::scrollDOWN()
95{ 95{
96 if ( mActiveView ) 96 if ( mActiveView )
97 mActiveView->scrollDOWN(); 97 mActiveView->scrollDOWN();
98} 98}
99void ViewManager::restoreSettings() 99void ViewManager::restoreSettings()
100{ 100{
101 mViewNameList = KABPrefs::instance()->mViewNames; 101 mViewNameList = KABPrefs::instance()->mViewNames;
102 QString activeViewName = KABPrefs::instance()->mCurrentView; 102 QString activeViewName = KABPrefs::instance()->mCurrentView;
103 103
104 mActionSelectView->setItems( mViewNameList ); 104 mActionSelectView->setItems( mViewNameList );
105 105
106 // Filter 106 // Filter
107 mFilterList = Filter::restore( mCore->config(), "Filter" ); 107 mFilterList = Filter::restore( mCore->config(), "Filter" );
108 mActionSelectFilter->setItems( filterNames() ); 108 mActionSelectFilter->setItems( filterNames() );
109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
110 int cw = 150; 110 int cw = 150;
111 if (QApplication::desktop()->width() == 480 ) 111 if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch)
112 cw = 0; 112 cw = 0;
113 mActionSelectFilter->setComboWidth( cw ); 113 mActionSelectFilter->setComboWidth( cw );
114 // Tell the views to reread their config, since they may have 114 // Tell the views to reread their config, since they may have
115 // been modified by global settings 115 // been modified by global settings
116 QString _oldgroup = mCore->config()->group(); 116 QString _oldgroup = mCore->config()->group();
117 117
118 QDictIterator<KAddressBookView> it( mViewDict ); 118 QDictIterator<KAddressBookView> it( mViewDict );
119 for ( it.toFirst(); it.current(); ++it ) { 119 for ( it.toFirst(); it.current(); ++it ) {
120 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 120 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
121 it.current()->readConfig( mCore->config() ); 121 it.current()->readConfig( mCore->config() );
122 } 122 }
123 setActiveView( activeViewName ); 123 setActiveView( activeViewName );
124 124
125 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 125 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
126} 126}
127 127
128void ViewManager::saveSettings() 128void ViewManager::saveSettings()
129{ 129{
130 QString _oldgroup = mCore->config()->group(); 130 QString _oldgroup = mCore->config()->group();
131 131
132 QDictIterator<KAddressBookView> it( mViewDict ); 132 QDictIterator<KAddressBookView> it( mViewDict );
133 for ( it.toFirst(); it.current(); ++it ) { 133 for ( it.toFirst(); it.current(); ++it ) {
134 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 134 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
135#ifdef DESKTOP_VERSION 135#ifdef DESKTOP_VERSION
136 (*it)->writeConfig( mCore->config() ); 136 (*it)->writeConfig( mCore->config() );
137#else 137#else
138 (*it).writeConfig( mCore->config() ); 138 (*it).writeConfig( mCore->config() );
139#endif 139#endif
140 } 140 }
141 141
142 Filter::save( mCore->config(), "Filter", mFilterList ); 142 Filter::save( mCore->config(), "Filter", mFilterList );
143 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem(); 143 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem();
@@ -575,65 +575,65 @@ void ViewManager::doSearch( const QString& s,KABC::Field *field )
575void ViewManager::setActiveFilter( int index ) 575void ViewManager::setActiveFilter( int index )
576{ 576{
577 Filter currentFilter; 577 Filter currentFilter;
578 578
579 if ( ( index - 1 ) < 0 ) 579 if ( ( index - 1 ) < 0 )
580 currentFilter = Filter(); 580 currentFilter = Filter();
581 else 581 else
582 currentFilter = mFilterList[ index - 1 ]; 582 currentFilter = mFilterList[ index - 1 ];
583 583
584 // Check if we have a view. Since the filter combo is created before 584 // Check if we have a view. Since the filter combo is created before
585 // the view, this slot could be called before there is a valid view. 585 // the view, this slot could be called before there is a valid view.
586 if ( mActiveView ) { 586 if ( mActiveView ) {
587 mActiveView->setFilter( currentFilter ); 587 mActiveView->setFilter( currentFilter );
588 mActiveView->refresh(); 588 mActiveView->refresh();
589 emit selected( QString::null ); 589 emit selected( QString::null );
590 } 590 }
591} 591}
592 592
593void ViewManager::configureFilters() 593void ViewManager::configureFilters()
594{ 594{
595 FilterDialog dlg( this ); 595 FilterDialog dlg( this );
596 596
597 dlg.setFilters( mFilterList ); 597 dlg.setFilters( mFilterList );
598 598
599 if ( dlg.exec() ) 599 if ( dlg.exec() )
600 mFilterList = dlg.filters(); 600 mFilterList = dlg.filters();
601 601
602 uint pos = mActionSelectFilter->currentItem(); 602 uint pos = mActionSelectFilter->currentItem();
603 mActionSelectFilter->setItems( filterNames() ); 603 mActionSelectFilter->setItems( filterNames() );
604 mActionSelectFilter->setCurrentItem( pos ); 604 mActionSelectFilter->setCurrentItem( pos );
605 setActiveFilter( pos ); 605 setActiveFilter( pos );
606 int cw = 150; 606 int cw = 150;
607 if (QApplication::desktop()->width() == 480 ) 607 if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch)
608 cw = 0; 608 cw = 0;
609 mActionSelectFilter->setComboWidth( cw ); 609 mActionSelectFilter->setComboWidth( cw );
610 saveSettings(); 610 saveSettings();
611} 611}
612 612
613QStringList ViewManager::filterNames() const 613QStringList ViewManager::filterNames() const
614{ 614{
615 QStringList names( i18n( "No Filter" ) ); 615 QStringList names( i18n( "No Filter" ) );
616 616
617 Filter::List::ConstIterator it; 617 Filter::List::ConstIterator it;
618 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 618 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
619 names.append( (*it).name() ); 619 names.append( (*it).name() );
620 620
621 return names; 621 return names;
622} 622}
623Filter ViewManager::getFilterByName( const QString &name ) const 623Filter ViewManager::getFilterByName( const QString &name ) const
624{ 624{
625 Filter::List::ConstIterator it; 625 Filter::List::ConstIterator it;
626 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 626 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
627 if ( name == (*it).name() ) 627 if ( name == (*it).name() )
628 return (*it); 628 return (*it);
629 629
630 return Filter(); 630 return Filter();
631} 631}
632 632
633int ViewManager::filterPosition( const QString &name ) const 633int ViewManager::filterPosition( const QString &name ) const
634{ 634{
635 int pos = 0; 635 int pos = 0;
636 636
637 Filter::List::ConstIterator it; 637 Filter::List::ConstIterator it;
638 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos ) 638 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
639 if ( name == (*it).name() ) 639 if ( name == (*it).name() )