author | zautrix <zautrix> | 2005-01-14 19:02:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-14 19:02:53 (UTC) |
commit | 620f8de219ee34c209960f02c8296c0568dd5d8b (patch) (unidiff) | |
tree | 772170b3b9ceaf8c204e2bdd9cbb333427de30cd | |
parent | 61c95ce0295f1397db6499c5b468a9fb3d32a0f4 (diff) | |
download | kdepimpi-620f8de219ee34c209960f02c8296c0568dd5d8b.zip kdepimpi-620f8de219ee34c209960f02c8296c0568dd5d8b.tar.gz kdepimpi-620f8de219ee34c209960f02c8296c0568dd5d8b.tar.bz2 |
formatted name fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/extensionmanager.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/filter.cpp | 21 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 87 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 3 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/addresseewidget.cpp | 11 | ||||
-rw-r--r-- | kaddressbook/nameeditdialog.cpp | 8 |
9 files changed, 118 insertions, 32 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index ff87423..5be1d28 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -4,24 +4,29 @@ Info about the changes in new versions of KDE-Pim/Pi | |||
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed that tooltips were not updated after moving an item in agenda view. | 6 | Fixed that tooltips were not updated after moving an item in agenda view. |
7 | Fixed a bug in sorting start date for recurring events in list view. | 7 | Fixed a bug in sorting start date for recurring events in list view. |
8 | 8 | ||
9 | KA/Pi: | 9 | KA/Pi: |
10 | All fields search does now actually search all the (possible) fields, | 10 | All fields search does now actually search all the (possible) fields, |
11 | not only those listed in the contact list. | 11 | not only those listed in the contact list. |
12 | Made is possible to inline a picture in a vcard on the Z. | 12 | Made is possible to inline a picture in a vcard on the Z. |
13 | This was only possible on the desktop, now is it possible on the Z as well. | 13 | This was only possible on the desktop, now is it possible on the Z as well. |
14 | Fixed of missing save settings after filter configuration. | 14 | Fixed of missing save settings after filter configuration. |
15 | Made saving of addressbook much faster. | 15 | Made saving of addressbook much faster. |
16 | Fixed extension widget layout problem. | ||
17 | Fixed saving of default formatted name settings. | ||
18 | Fixed formatted name handling in edit dialog. | ||
19 | Added an option for changing formatted names of many contacts | ||
20 | (menu: File - Change - Set formatted name). | ||
16 | 21 | ||
17 | QWhatsThis was not working on the Z ( only black rectangle was shown). | 22 | QWhatsThis was not working on the Z ( only black rectangle was shown). |
18 | This is Fixed. | 23 | This is Fixed. |
19 | 24 | ||
20 | KDE-Sync: | 25 | KDE-Sync: |
21 | Now readonly KDE resources are synced as well. | 26 | Now readonly KDE resources are synced as well. |
22 | (They are not changed in KDE itself, of course). | 27 | (They are not changed in KDE itself, of course). |
23 | 28 | ||
24 | 29 | ||
25 | 30 | ||
26 | ********** VERSION 1.9.16 ************ | 31 | ********** VERSION 1.9.16 ************ |
27 | 32 | ||
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 3397e06..c6993e9 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -972,29 +972,29 @@ void AddresseeEditorWidget::load() | |||
972 | { | 972 | { |
973 | 973 | ||
974 | // Block signals in case anything tries to emit modified | 974 | // Block signals in case anything tries to emit modified |
975 | // CS: This doesn't seem to work. | 975 | // CS: This doesn't seem to work. |
976 | bool block = signalsBlocked(); | 976 | bool block = signalsBlocked(); |
977 | blockSignals( true ); | 977 | blockSignals( true ); |
978 | mBlockSignals = true; // used for internal signal blocking | 978 | mBlockSignals = true; // used for internal signal blocking |
979 | 979 | ||
980 | mNameEdit->setText( mAddressee.assembledName() ); | 980 | mNameEdit->setText( mAddressee.assembledName() ); |
981 | 981 | ||
982 | if ( mAddressee.formattedName().isEmpty() ) { | 982 | if ( mAddressee.formattedName().isEmpty() ) { |
983 | //US KConfig config( "kaddressbookrc" ); | 983 | //US KConfig config( "kaddressbookrc" ); |
984 | KConfig config( locateLocal("config", "kaddressbookrc") ); | 984 | KConfig config( locateLocal("config", "kabcrc") ); |
985 | config.setGroup( "General" ); | 985 | config.setGroup( "General" ); |
986 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); | 986 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); |
987 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 987 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
988 | } else { | 988 | } else {; |
989 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) | 989 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) |
990 | mFormattedNameType = NameEditDialog::SimpleName; | 990 | mFormattedNameType = NameEditDialog::SimpleName; |
991 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) | 991 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) |
992 | mFormattedNameType = NameEditDialog::FullName; | 992 | mFormattedNameType = NameEditDialog::FullName; |
993 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) | 993 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) |
994 | mFormattedNameType = NameEditDialog::ReverseName; | 994 | mFormattedNameType = NameEditDialog::ReverseName; |
995 | else | 995 | else |
996 | mFormattedNameType = NameEditDialog::CustomName; | 996 | mFormattedNameType = NameEditDialog::CustomName; |
997 | } | 997 | } |
998 | 998 | ||
999 | mFormattedNameLabel->setText( mAddressee.formattedName() ); | 999 | mFormattedNameLabel->setText( mAddressee.formattedName() ); |
1000 | 1000 | ||
@@ -1176,24 +1176,26 @@ bool AddresseeEditorWidget::dirty() | |||
1176 | "%Y-%m-%d")) | 1176 | "%Y-%m-%d")) |
1177 | mDirty = true; | 1177 | mDirty = true; |
1178 | } | 1178 | } |
1179 | else { | 1179 | else { |
1180 | mAnniversaryPicker->clear(); | 1180 | mAnniversaryPicker->clear(); |
1181 | } | 1181 | } |
1182 | } | 1182 | } |
1183 | return mDirty; | 1183 | return mDirty; |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) | 1186 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) |
1187 | { | 1187 | { |
1188 | if ( mBlockSignals ) | ||
1189 | return; | ||
1188 | // use the addressee class to parse the name for us | 1190 | // use the addressee class to parse the name for us |
1189 | mAConfig->setUid( mAddressee.uid() ); | 1191 | mAConfig->setUid( mAddressee.uid() ); |
1190 | if ( mAConfig->automaticNameParsing() ) { | 1192 | if ( mAConfig->automaticNameParsing() ) { |
1191 | if ( !mAddressee.formattedName().isEmpty() ) { | 1193 | if ( !mAddressee.formattedName().isEmpty() ) { |
1192 | QString fn = mAddressee.formattedName(); | 1194 | QString fn = mAddressee.formattedName(); |
1193 | mAddressee.setNameFromString( text ); | 1195 | mAddressee.setNameFromString( text ); |
1194 | mAddressee.setFormattedName( fn ); | 1196 | mAddressee.setFormattedName( fn ); |
1195 | } else { | 1197 | } else { |
1196 | // use extra addressee to avoid a formatted name assignment | 1198 | // use extra addressee to avoid a formatted name assignment |
1197 | Addressee addr; | 1199 | Addressee addr; |
1198 | addr.setNameFromString( text ); | 1200 | addr.setNameFromString( text ); |
1199 | mAddressee.setPrefix( addr.prefix() ); | 1201 | mAddressee.setPrefix( addr.prefix() ); |
diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp index 98561dc..efbdf17 100644 --- a/kaddressbook/extensionmanager.cpp +++ b/kaddressbook/extensionmanager.cpp | |||
@@ -49,24 +49,25 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, | |||
49 | QWidget *settingsmenu = (QWidget*)mCore->getSettingsMenu(); | 49 | QWidget *settingsmenu = (QWidget*)mCore->getSettingsMenu(); |
50 | #endif //KAB_EMBEDDED | 50 | #endif //KAB_EMBEDDED |
51 | 51 | ||
52 | mActionExtensions = new KSelectAction( i18n( "Show Extension Bar" ), 0, | 52 | mActionExtensions = new KSelectAction( i18n( "Show Extension Bar" ), 0, |
53 | mCore->actionCollection(), | 53 | mCore->actionCollection(), |
54 | "options_show_extensions" ); | 54 | "options_show_extensions" ); |
55 | 55 | ||
56 | mActionExtensions->plug( settingsmenu ); | 56 | mActionExtensions->plug( settingsmenu ); |
57 | 57 | ||
58 | connect( mActionExtensions, SIGNAL( activated( int ) ), | 58 | connect( mActionExtensions, SIGNAL( activated( int ) ), |
59 | SLOT( setActiveExtension( int ) ) ); | 59 | SLOT( setActiveExtension( int ) ) ); |
60 | mWidgetBox = new QWidget( viewport() ); | 60 | mWidgetBox = new QWidget( viewport() ); |
61 | new QHBoxLayout (mWidgetBox ); | ||
61 | addChild( mWidgetBox ); | 62 | addChild( mWidgetBox ); |
62 | setResizePolicy(AutoOneFit); | 63 | setResizePolicy(AutoOneFit); |
63 | createExtensionWidgets(); | 64 | createExtensionWidgets(); |
64 | hide(); | 65 | hide(); |
65 | } | 66 | } |
66 | 67 | ||
67 | ExtensionManager::~ExtensionManager() | 68 | ExtensionManager::~ExtensionManager() |
68 | { | 69 | { |
69 | } | 70 | } |
70 | 71 | ||
71 | void ExtensionManager::restoreSettings() | 72 | void ExtensionManager::restoreSettings() |
72 | { | 73 | { |
@@ -149,54 +150,54 @@ void ExtensionManager::createExtensionWidgets() | |||
149 | mExtensionWidgetList.setAutoDelete( true ); | 150 | mExtensionWidgetList.setAutoDelete( true ); |
150 | QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); | 151 | QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); |
151 | ExtensionWidget *wdg = 0; | 152 | ExtensionWidget *wdg = 0; |
152 | while ( ( wdg = wdgIt.current() ) != 0 ) | 153 | while ( ( wdg = wdgIt.current() ) != 0 ) |
153 | mExtensionWidgetList.remove( wdg ); | 154 | mExtensionWidgetList.remove( wdg ); |
154 | 155 | ||
155 | mExtensionWidgetList.setAutoDelete( false ); | 156 | mExtensionWidgetList.setAutoDelete( false ); |
156 | 157 | ||
157 | QStringList extensionNames( i18n( "None" ) ); | 158 | QStringList extensionNames( i18n( "None" ) ); |
158 | 159 | ||
159 | // add addressee editor as default | 160 | // add addressee editor as default |
160 | 161 | ||
161 | QHBoxLayout *hbl = new QHBoxLayout (mWidgetBox ); | 162 | QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; |
162 | 163 | ||
163 | wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); | 164 | wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); |
164 | hbl->addWidget( wdg ); | 165 | hbl->addWidget( wdg ); |
165 | //wdg->hide(); | 166 | //wdg->hide(); |
166 | connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), | 167 | connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), |
167 | SIGNAL( modified( const KABC::Addressee::List& ) ) ); | 168 | SIGNAL( modified( const KABC::Addressee::List& ) ) ); |
168 | mExtensionWidgetList.append( wdg ); | 169 | mExtensionWidgetList.append( wdg ); |
169 | extensionNames.append( wdg->title() ); | 170 | extensionNames.append( wdg->title() ); |
170 | 171 | ||
171 | // load the other extensions | 172 | // load the other extensions |
172 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; | 173 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; |
173 | 174 | ||
174 | #ifndef KAB_EMBEDDED | 175 | #ifndef KAB_EMBEDDED |
175 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); | 176 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); |
176 | KTrader::OfferList::ConstIterator it; | 177 | KTrader::OfferList::ConstIterator it; |
177 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 178 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
178 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) | 179 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) |
179 | continue; | 180 | continue; |
180 | 181 | ||
181 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); | 182 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); |
182 | if ( !factory ) { | 183 | if ( !factory ) { |
183 | kdDebug(5720) << "ExtensionManager::loadExtensions(): Factory creation failed" << endl; | 184 | //kdDebug(5720) << "ExtensionManager::loadExtensions(): Factory creation failed" << endl; |
184 | continue; | 185 | continue; |
185 | } | 186 | } |
186 | 187 | ||
187 | ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); | 188 | ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); |
188 | 189 | ||
189 | if ( !extensionFactory ) { | 190 | if ( !extensionFactory ) { |
190 | kdDebug(5720) << "ExtensionManager::loadExtensions(): Cast failed" << endl; | 191 | //kdDebug(5720) << "ExtensionManager::loadExtensions(): Cast failed" << endl; |
191 | continue; | 192 | continue; |
192 | } | 193 | } |
193 | 194 | ||
194 | if ( !activeExtensions.contains( extensionFactory->identifier() ) ) | 195 | if ( !activeExtensions.contains( extensionFactory->identifier() ) ) |
195 | continue; | 196 | continue; |
196 | 197 | ||
197 | wdg = extensionFactory->extension( mCore, this ); | 198 | wdg = extensionFactory->extension( mCore, this ); |
198 | if ( wdg ) { | 199 | if ( wdg ) { |
199 | //wdg->hide(); | 200 | //wdg->hide(); |
200 | connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), | 201 | connect( wdg, SIGNAL( modified( const KABC::Addressee::List& ) ), |
201 | SIGNAL( modified( const KABC::Addressee::List& ) ) ); | 202 | SIGNAL( modified( const KABC::Addressee::List& ) ) ); |
202 | mExtensionWidgetList.append( wdg ); | 203 | mExtensionWidgetList.append( wdg ); |
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp index b0d04ca..39d2ae4 100644 --- a/kaddressbook/filter.cpp +++ b/kaddressbook/filter.cpp | |||
@@ -171,35 +171,36 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup ) | |||
171 | count = config->readNumEntry( "Count", 0 ); | 171 | count = config->readNumEntry( "Count", 0 ); |
172 | } | 172 | } |
173 | 173 | ||
174 | for ( int i = 0; i < count; i++ ) { | 174 | for ( int i = 0; i < count; i++ ) { |
175 | { | 175 | { |
176 | KConfigGroupSaver s( config, QString( "%1_%2" ).arg( baseGroup ).arg( i ) ); | 176 | KConfigGroupSaver s( config, QString( "%1_%2" ).arg( baseGroup ).arg( i ) ); |
177 | f.restore( config ); | 177 | f.restore( config ); |
178 | } | 178 | } |
179 | 179 | ||
180 | list.append( f ); | 180 | list.append( f ); |
181 | } | 181 | } |
182 | 182 | ||
183 | QStringList cats = KABPrefs::instance()->mCustomCategories; | 183 | if ( list.isEmpty()) { |
184 | for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { | 184 | QStringList cats = KABPrefs::instance()->mCustomCategories; |
185 | Filter filter; | 185 | for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { |
186 | filter.mName = *it; | 186 | Filter filter; |
187 | filter.mEnabled = true; | 187 | filter.mName = *it; |
188 | filter.mCategoryList = *it; | 188 | filter.mEnabled = true; |
189 | filter.mMatchRule = Matching; | 189 | filter.mCategoryList = *it; |
190 | filter.mInternal = true; | 190 | filter.mMatchRule = Matching; |
191 | list.append( filter ); | 191 | filter.mInternal = true; |
192 | list.append( filter ); | ||
193 | } | ||
192 | } | 194 | } |
193 | |||
194 | return list; | 195 | return list; |
195 | } | 196 | } |
196 | 197 | ||
197 | void Filter::setMatchRule( MatchRule rule ) | 198 | void Filter::setMatchRule( MatchRule rule ) |
198 | { | 199 | { |
199 | mMatchRule = rule; | 200 | mMatchRule = rule; |
200 | } | 201 | } |
201 | 202 | ||
202 | Filter::MatchRule Filter::matchRule() const | 203 | Filter::MatchRule Filter::matchRule() const |
203 | { | 204 | { |
204 | return mMatchRule; | 205 | return mMatchRule; |
205 | } | 206 | } |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index e14e579..c6288fa 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -142,24 +142,25 @@ $Id$ | |||
142 | 142 | ||
143 | #include "addresseeutil.h" | 143 | #include "addresseeutil.h" |
144 | #include "undocmds.h" | 144 | #include "undocmds.h" |
145 | #include "addresseeeditordialog.h" | 145 | #include "addresseeeditordialog.h" |
146 | #include "viewmanager.h" | 146 | #include "viewmanager.h" |
147 | #include "details/detailsviewcontainer.h" | 147 | #include "details/detailsviewcontainer.h" |
148 | #include "kabprefs.h" | 148 | #include "kabprefs.h" |
149 | #include "xxportmanager.h" | 149 | #include "xxportmanager.h" |
150 | #include "incsearchwidget.h" | 150 | #include "incsearchwidget.h" |
151 | #include "jumpbuttonbar.h" | 151 | #include "jumpbuttonbar.h" |
152 | #include "extensionmanager.h" | 152 | #include "extensionmanager.h" |
153 | #include "addresseeconfig.h" | 153 | #include "addresseeconfig.h" |
154 | #include "nameeditdialog.h" | ||
154 | #include <kcmultidialog.h> | 155 | #include <kcmultidialog.h> |
155 | 156 | ||
156 | #ifdef _WIN32_ | 157 | #ifdef _WIN32_ |
157 | 158 | ||
158 | #include "kaimportoldialog.h" | 159 | #include "kaimportoldialog.h" |
159 | #else | 160 | #else |
160 | #include <unistd.h> | 161 | #include <unistd.h> |
161 | #endif | 162 | #endif |
162 | // sync includes | 163 | // sync includes |
163 | #include <libkdepim/ksyncprofile.h> | 164 | #include <libkdepim/ksyncprofile.h> |
164 | #include <libkdepim/ksyncprefsdialog.h> | 165 | #include <libkdepim/ksyncprefsdialog.h> |
165 | 166 | ||
@@ -187,24 +188,59 @@ class KABCatPrefs : public QDialog | |||
187 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 188 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
188 | lay->addWidget( cancel ); | 189 | lay->addWidget( cancel ); |
189 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 190 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
190 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 191 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
191 | resize( 200, 200 ); | 192 | resize( 200, 200 ); |
192 | } | 193 | } |
193 | 194 | ||
194 | bool addCat() { return addCatBut->isChecked(); } | 195 | bool addCat() { return addCatBut->isChecked(); } |
195 | private: | 196 | private: |
196 | QRadioButton* addCatBut; | 197 | QRadioButton* addCatBut; |
197 | }; | 198 | }; |
198 | 199 | ||
200 | class KABFormatPrefs : public QDialog | ||
201 | { | ||
202 | public: | ||
203 | KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : | ||
204 | QDialog( parent, name, true ) | ||
205 | { | ||
206 | setCaption( i18n("Set formatted name") ); | ||
207 | QVBoxLayout* lay = new QVBoxLayout( this ); | ||
208 | lay->setSpacing( 3 ); | ||
209 | lay->setMargin( 3 ); | ||
210 | QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); | ||
211 | lay->addWidget( lab ); | ||
212 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); | ||
213 | lay->addWidget( format ); | ||
214 | format->setExclusive ( true ) ; | ||
215 | simple = new QRadioButton(i18n("Simple: James Bond"), format ); | ||
216 | full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); | ||
217 | reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); | ||
218 | company = new QRadioButton(i18n("Organization: MI6"), format ); | ||
219 | simple->setChecked( true ); | ||
220 | setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); | ||
221 | lay->addWidget( setCompany ); | ||
222 | QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); | ||
223 | lay->addWidget( ok ); | ||
224 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | ||
225 | lay->addWidget( cancel ); | ||
226 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | ||
227 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | ||
228 | resize( 200, 200 ); | ||
229 | } | ||
230 | public: | ||
231 | QRadioButton* simple, *full, *reverse, *company; | ||
232 | QCheckBox* setCompany; | ||
233 | }; | ||
234 | |||
199 | 235 | ||
200 | 236 | ||
201 | class KAex2phonePrefs : public QDialog | 237 | class KAex2phonePrefs : public QDialog |
202 | { | 238 | { |
203 | public: | 239 | public: |
204 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 240 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
205 | QDialog( parent, name, true ) | 241 | QDialog( parent, name, true ) |
206 | { | 242 | { |
207 | setCaption( i18n("Export to phone options") ); | 243 | setCaption( i18n("Export to phone options") ); |
208 | QVBoxLayout* lay = new QVBoxLayout( this ); | 244 | QVBoxLayout* lay = new QVBoxLayout( this ); |
209 | lay->setSpacing( 3 ); | 245 | lay->setSpacing( 3 ); |
210 | lay->setMargin( 3 ); | 246 | lay->setMargin( 3 ); |
@@ -1137,42 +1173,48 @@ void KABCore::setModified( bool modified ) | |||
1137 | if ( modified ) | 1173 | if ( modified ) |
1138 | mJumpButtonBar->recreateButtons(); | 1174 | mJumpButtonBar->recreateButtons(); |
1139 | 1175 | ||
1140 | mViewManager->refreshView(); | 1176 | mViewManager->refreshView(); |
1141 | 1177 | ||
1142 | } | 1178 | } |
1143 | 1179 | ||
1144 | bool KABCore::modified() const | 1180 | bool KABCore::modified() const |
1145 | { | 1181 | { |
1146 | return mModified; | 1182 | return mModified; |
1147 | } | 1183 | } |
1148 | 1184 | ||
1149 | void KABCore::contactModified( const KABC::Addressee &addr ) | 1185 | void KABCore::contactModified( const KABC::Addressee &addr ) |
1186 | { | ||
1187 | addrModified( addr ); | ||
1188 | } | ||
1189 | |||
1190 | void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) | ||
1150 | { | 1191 | { |
1151 | 1192 | ||
1152 | Command *command = 0; | 1193 | Command *command = 0; |
1153 | QString uid; | 1194 | QString uid; |
1154 | 1195 | ||
1155 | // check if it exists already | 1196 | // check if it exists already |
1156 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); | 1197 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); |
1157 | if ( origAddr.isEmpty() ) | 1198 | if ( origAddr.isEmpty() ) |
1158 | command = new PwNewCommand( mAddressBook, addr ); | 1199 | command = new PwNewCommand( mAddressBook, addr ); |
1159 | else { | 1200 | else { |
1160 | command = new PwEditCommand( mAddressBook, origAddr, addr ); | 1201 | command = new PwEditCommand( mAddressBook, origAddr, addr ); |
1161 | uid = addr.uid(); | 1202 | uid = addr.uid(); |
1162 | } | 1203 | } |
1163 | 1204 | ||
1164 | UndoStack::instance()->push( command ); | 1205 | UndoStack::instance()->push( command ); |
1165 | RedoStack::instance()->clear(); | 1206 | RedoStack::instance()->clear(); |
1166 | mDetails->setAddressee( addr ); | 1207 | if ( updateDetails ) |
1208 | mDetails->setAddressee( addr ); | ||
1167 | setModified( true ); | 1209 | setModified( true ); |
1168 | } | 1210 | } |
1169 | 1211 | ||
1170 | void KABCore::newContact() | 1212 | void KABCore::newContact() |
1171 | { | 1213 | { |
1172 | 1214 | ||
1173 | 1215 | ||
1174 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); | 1216 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); |
1175 | 1217 | ||
1176 | QPtrList<KRES::Resource> kresResources; | 1218 | QPtrList<KRES::Resource> kresResources; |
1177 | QPtrListIterator<KABC::Resource> it( kabcResources ); | 1219 | QPtrListIterator<KABC::Resource> it( kabcResources ); |
1178 | KABC::Resource *resource; | 1220 | KABC::Resource *resource; |
@@ -1532,25 +1574,25 @@ QString KABCore::getNameByPhone( const QString &phone ) | |||
1532 | 1574 | ||
1533 | } | 1575 | } |
1534 | 1576 | ||
1535 | void KABCore::openConfigDialog() | 1577 | void KABCore::openConfigDialog() |
1536 | { | 1578 | { |
1537 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1579 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); |
1538 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1580 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); |
1539 | ConfigureDialog->addModule(kabcfg ); | 1581 | ConfigureDialog->addModule(kabcfg ); |
1540 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); | 1582 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); |
1541 | ConfigureDialog->addModule(kdelibcfg ); | 1583 | ConfigureDialog->addModule(kdelibcfg ); |
1542 | 1584 | ||
1543 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1585 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
1544 | this, SLOT( configurationChanged() ) ); | 1586 | this, SLOT( configurationChanged() ) ); |
1545 | connect( ConfigureDialog, SIGNAL( okClicked() ), | 1587 | connect( ConfigureDialog, SIGNAL( okClicked() ), |
1546 | this, SLOT( configurationChanged() ) ); | 1588 | this, SLOT( configurationChanged() ) ); |
1547 | saveSettings(); | 1589 | saveSettings(); |
1548 | #ifndef DESKTOP_VERSION | 1590 | #ifndef DESKTOP_VERSION |
1549 | ConfigureDialog->showMaximized(); | 1591 | ConfigureDialog->showMaximized(); |
1550 | #endif | 1592 | #endif |
1551 | if ( ConfigureDialog->exec() ) | 1593 | if ( ConfigureDialog->exec() ) |
1552 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); | 1594 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); |
1553 | delete ConfigureDialog; | 1595 | delete ConfigureDialog; |
1554 | } | 1596 | } |
1555 | 1597 | ||
1556 | void KABCore::openLDAPDialog() | 1598 | void KABCore::openLDAPDialog() |
@@ -1987,24 +2029,27 @@ void KABCore::initActions() | |||
1987 | 2029 | ||
1988 | 2030 | ||
1989 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 2031 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1990 | SLOT( setCategories() ), actionCollection(), | 2032 | SLOT( setCategories() ), actionCollection(), |
1991 | "edit_set_categories" ); | 2033 | "edit_set_categories" ); |
1992 | mActionEditCategories = new KAction( i18n( "Edit Categories" ), 0, this, | 2034 | mActionEditCategories = new KAction( i18n( "Edit Categories" ), 0, this, |
1993 | SLOT( editCategories() ), actionCollection(), | 2035 | SLOT( editCategories() ), actionCollection(), |
1994 | "edit__categories" ); | 2036 | "edit__categories" ); |
1995 | 2037 | ||
1996 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 2038 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1997 | SLOT( removeVoice() ), actionCollection(), | 2039 | SLOT( removeVoice() ), actionCollection(), |
1998 | "remove_voice" ); | 2040 | "remove_voice" ); |
2041 | mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, | ||
2042 | SLOT( setFormattedName() ), actionCollection(), | ||
2043 | "set_formatted" ); | ||
1999 | 2044 | ||
2000 | mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, | 2045 | mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, |
2001 | SLOT( manageCategories() ), actionCollection(), | 2046 | SLOT( manageCategories() ), actionCollection(), |
2002 | "remove_voice" ); | 2047 | "remove_voice" ); |
2003 | 2048 | ||
2004 | 2049 | ||
2005 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, | 2050 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
2006 | SLOT( importFromOL() ), actionCollection(), | 2051 | SLOT( importFromOL() ), actionCollection(), |
2007 | "import_OL" ); | 2052 | "import_OL" ); |
2008 | #ifdef KAB_EMBEDDED | 2053 | #ifdef KAB_EMBEDDED |
2009 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 2054 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
2010 | this, SLOT( showLicence() ), actionCollection(), | 2055 | this, SLOT( showLicence() ), actionCollection(), |
@@ -2127,24 +2172,25 @@ void KABCore::addActionsManually() | |||
2127 | #endif | 2172 | #endif |
2128 | // edit menu | 2173 | // edit menu |
2129 | mActionUndo->plug( editMenu ); | 2174 | mActionUndo->plug( editMenu ); |
2130 | mActionRedo->plug( editMenu ); | 2175 | mActionRedo->plug( editMenu ); |
2131 | editMenu->insertSeparator(); | 2176 | editMenu->insertSeparator(); |
2132 | mActionCut->plug( editMenu ); | 2177 | mActionCut->plug( editMenu ); |
2133 | mActionCopy->plug( editMenu ); | 2178 | mActionCopy->plug( editMenu ); |
2134 | mActionPaste->plug( editMenu ); | 2179 | mActionPaste->plug( editMenu ); |
2135 | mActionDelete->plug( editMenu ); | 2180 | mActionDelete->plug( editMenu ); |
2136 | editMenu->insertSeparator(); | 2181 | editMenu->insertSeparator(); |
2137 | mActionSelectAll->plug( editMenu ); | 2182 | mActionSelectAll->plug( editMenu ); |
2138 | 2183 | ||
2184 | mActionSetFormattedName->plug( changeMenu ); | ||
2139 | mActionRemoveVoice->plug( changeMenu ); | 2185 | mActionRemoveVoice->plug( changeMenu ); |
2140 | // settings menu | 2186 | // settings menu |
2141 | //US special menuentry to configure the addressbook resources. On KDE | 2187 | //US special menuentry to configure the addressbook resources. On KDE |
2142 | // you do that through the control center !!! | 2188 | // you do that through the control center !!! |
2143 | mActionConfigResources->plug( settingsMenu ); | 2189 | mActionConfigResources->plug( settingsMenu ); |
2144 | settingsMenu->insertSeparator(); | 2190 | settingsMenu->insertSeparator(); |
2145 | 2191 | ||
2146 | mActionConfigKAddressbook->plug( settingsMenu ); | 2192 | mActionConfigKAddressbook->plug( settingsMenu ); |
2147 | 2193 | ||
2148 | if ( mIsPart ) { | 2194 | if ( mIsPart ) { |
2149 | //US not implemented yet | 2195 | //US not implemented yet |
2150 | //mActionConfigShortcuts->plug( settingsMenu ); | 2196 | //mActionConfigShortcuts->plug( settingsMenu ); |
@@ -2293,29 +2339,60 @@ void KABCore::removeVoice() | |||
2293 | { | 2339 | { |
2294 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) | 2340 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) |
2295 | return; | 2341 | return; |
2296 | KABC::Addressee::List list; | 2342 | KABC::Addressee::List list; |
2297 | XXPortSelectDialog dlg( this, false, this ); | 2343 | XXPortSelectDialog dlg( this, false, this ); |
2298 | if ( dlg.exec() ) | 2344 | if ( dlg.exec() ) |
2299 | list = dlg.contacts(); | 2345 | list = dlg.contacts(); |
2300 | else | 2346 | else |
2301 | return; | 2347 | return; |
2302 | KABC::Addressee::List::Iterator it; | 2348 | KABC::Addressee::List::Iterator it; |
2303 | for ( it = list.begin(); it != list.end(); ++it ) { | 2349 | for ( it = list.begin(); it != list.end(); ++it ) { |
2304 | if ( (*it).removeVoice() ) | 2350 | if ( (*it).removeVoice() ) |
2305 | contactModified((*it) ); | 2351 | addrModified((*it), false ); |
2306 | } | 2352 | } |
2307 | } | 2353 | } |
2308 | 2354 | ||
2309 | 2355 | void KABCore::setFormattedName() | |
2356 | { | ||
2357 | KABFormatPrefs setpref; | ||
2358 | if ( !setpref.exec() ) { | ||
2359 | return; | ||
2360 | } | ||
2361 | KABC::Addressee::List list; | ||
2362 | XXPortSelectDialog dlg( this, false, this ); | ||
2363 | if ( dlg.exec() ) | ||
2364 | list = dlg.contacts(); | ||
2365 | else | ||
2366 | return; | ||
2367 | KABC::Addressee::List::Iterator it; | ||
2368 | for ( it = list.begin(); it != list.end(); ++it ) { | ||
2369 | QString fName; | ||
2370 | if ( setpref.simple->isChecked() ) | ||
2371 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); | ||
2372 | else if ( setpref.full->isChecked() ) | ||
2373 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); | ||
2374 | else if ( setpref.reverse->isChecked() ) | ||
2375 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); | ||
2376 | else | ||
2377 | fName = (*it).organization(); | ||
2378 | if ( setpref.setCompany->isChecked() ) | ||
2379 | if ( fName.isEmpty() || fName =="," ) | ||
2380 | fName = (*it).organization(); | ||
2381 | (*it).setFormattedName( fName ); | ||
2382 | addrModified((*it),false ); | ||
2383 | } | ||
2384 | Addressee add; | ||
2385 | mDetails->setAddressee( add ); | ||
2386 | } | ||
2310 | 2387 | ||
2311 | void KABCore::clipboardDataChanged() | 2388 | void KABCore::clipboardDataChanged() |
2312 | { | 2389 | { |
2313 | 2390 | ||
2314 | if ( mReadWrite ) | 2391 | if ( mReadWrite ) |
2315 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2392 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2316 | 2393 | ||
2317 | } | 2394 | } |
2318 | 2395 | ||
2319 | void KABCore::updateActionMenu() | 2396 | void KABCore::updateActionMenu() |
2320 | { | 2397 | { |
2321 | UndoStack *undo = UndoStack::instance(); | 2398 | UndoStack *undo = UndoStack::instance(); |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 85ffbdb..0d5891e 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -269,24 +269,25 @@ class KABCore : public QWidget, public KSyncInterface | |||
269 | void setModified( bool modified ); | 269 | void setModified( bool modified ); |
270 | 270 | ||
271 | /** | 271 | /** |
272 | Returns whether the address book is modified. | 272 | Returns whether the address book is modified. |
273 | */ | 273 | */ |
274 | bool modified() const; | 274 | bool modified() const; |
275 | 275 | ||
276 | /** | 276 | /** |
277 | Called whenever an contact is modified in the contact editor | 277 | Called whenever an contact is modified in the contact editor |
278 | dialog or the quick edit. | 278 | dialog or the quick edit. |
279 | */ | 279 | */ |
280 | void contactModified( const KABC::Addressee &addr ); | 280 | void contactModified( const KABC::Addressee &addr ); |
281 | void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); | ||
281 | 282 | ||
282 | /** | 283 | /** |
283 | DCOP METHODS. | 284 | DCOP METHODS. |
284 | */ | 285 | */ |
285 | void addEmail( QString addr ); | 286 | void addEmail( QString addr ); |
286 | void importVCard( const KURL& url, bool showPreview ); | 287 | void importVCard( const KURL& url, bool showPreview ); |
287 | void importVCard( const QString& vCard, bool showPreview ); | 288 | void importVCard( const QString& vCard, bool showPreview ); |
288 | void newContact(); | 289 | void newContact(); |
289 | QString getNameByPhone( const QString& phone ); | 290 | QString getNameByPhone( const QString& phone ); |
290 | /** | 291 | /** |
291 | END DCOP METHODS | 292 | END DCOP METHODS |
292 | */ | 293 | */ |
@@ -364,24 +365,25 @@ class KABCore : public QWidget, public KSyncInterface | |||
364 | void receive( const QCString& cmsg, const QByteArray& data ); | 365 | void receive( const QCString& cmsg, const QByteArray& data ); |
365 | void toggleBeamReceive( ); | 366 | void toggleBeamReceive( ); |
366 | void disableBR(bool); | 367 | void disableBR(bool); |
367 | void setJumpButtonBarVisible( bool visible ); | 368 | void setJumpButtonBarVisible( bool visible ); |
368 | void setCaptionBack(); | 369 | void setCaptionBack(); |
369 | void importFromOL(); | 370 | void importFromOL(); |
370 | void extensionModified( const KABC::Addressee::List &list ); | 371 | void extensionModified( const KABC::Addressee::List &list ); |
371 | void extensionChanged( int id ); | 372 | void extensionChanged( int id ); |
372 | void clipboardDataChanged(); | 373 | void clipboardDataChanged(); |
373 | void updateActionMenu(); | 374 | void updateActionMenu(); |
374 | void configureKeyBindings(); | 375 | void configureKeyBindings(); |
375 | void removeVoice(); | 376 | void removeVoice(); |
377 | void setFormattedName(); | ||
376 | #ifdef KAB_EMBEDDED | 378 | #ifdef KAB_EMBEDDED |
377 | void configureResources(); | 379 | void configureResources(); |
378 | #endif //KAB_EMBEDDED | 380 | #endif //KAB_EMBEDDED |
379 | 381 | ||
380 | void slotEditorDestroyed( const QString &uid ); | 382 | void slotEditorDestroyed( const QString &uid ); |
381 | void configurationChanged(); | 383 | void configurationChanged(); |
382 | void addressBookChanged(); | 384 | void addressBookChanged(); |
383 | 385 | ||
384 | private: | 386 | private: |
385 | void resizeEvent(QResizeEvent* e ); | 387 | void resizeEvent(QResizeEvent* e ); |
386 | bool mBRdisabled; | 388 | bool mBRdisabled; |
387 | #ifndef DESKTOP_VERSION | 389 | #ifndef DESKTOP_VERSION |
@@ -468,24 +470,25 @@ class KABCore : public QWidget, public KSyncInterface | |||
468 | KAction *mActionDeleteView; | 470 | KAction *mActionDeleteView; |
469 | 471 | ||
470 | QPopupMenu *viewMenu; | 472 | QPopupMenu *viewMenu; |
471 | QPopupMenu *filterMenu; | 473 | QPopupMenu *filterMenu; |
472 | QPopupMenu *settingsMenu; | 474 | QPopupMenu *settingsMenu; |
473 | QPopupMenu *changeMenu; | 475 | QPopupMenu *changeMenu; |
474 | QPopupMenu *beamMenu; | 476 | QPopupMenu *beamMenu; |
475 | //US QAction *mActionSave; | 477 | //US QAction *mActionSave; |
476 | QPopupMenu *ImportMenu; | 478 | QPopupMenu *ImportMenu; |
477 | QPopupMenu *ExportMenu; | 479 | QPopupMenu *ExportMenu; |
478 | //LR additional methods | 480 | //LR additional methods |
479 | KAction *mActionRemoveVoice; | 481 | KAction *mActionRemoveVoice; |
482 | KAction *mActionSetFormattedName; | ||
480 | KAction * mActionImportOL; | 483 | KAction * mActionImportOL; |
481 | 484 | ||
482 | #ifndef KAB_EMBEDDED | 485 | #ifndef KAB_EMBEDDED |
483 | KAddressBookService *mAddressBookService; | 486 | KAddressBookService *mAddressBookService; |
484 | #endif //KAB_EMBEDDED | 487 | #endif //KAB_EMBEDDED |
485 | 488 | ||
486 | class KABCorePrivate; | 489 | class KABCorePrivate; |
487 | KABCorePrivate *d; | 490 | KABCorePrivate *d; |
488 | //US bool mBlockSaveFlag; | 491 | //US bool mBlockSaveFlag; |
489 | 492 | ||
490 | #ifdef KAB_EMBEDDED | 493 | #ifdef KAB_EMBEDDED |
491 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 494 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index db123da..a2095d4 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -51,25 +51,25 @@ KABPrefs::KABPrefs() | |||
51 | mDetailsFont = QFont("helvetica",12); | 51 | mDetailsFont = QFont("helvetica",12); |
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 | 58 | ||
59 | #ifdef KAB_EMBEDDED | 59 | #ifdef KAB_EMBEDDED |
60 | addItemBool("AskForQuit",&mAskForQuit,true); | 60 | addItemBool("AskForQuit",&mAskForQuit,true); |
61 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 61 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
62 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 62 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
63 | addItemBool("SearchWithReturn",&mSearchWithReturn, true ); | 63 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); |
64 | addItemFont("DetailsFont",&mDetailsFont); | 64 | addItemFont("DetailsFont",&mDetailsFont); |
65 | 65 | ||
66 | 66 | ||
67 | #endif //KAB_EMBEDDED | 67 | #endif //KAB_EMBEDDED |
68 | 68 | ||
69 | KPrefs::setCurrentGroup( "MainWindow" ); | 69 | KPrefs::setCurrentGroup( "MainWindow" ); |
70 | bool m_visible = false; | 70 | bool m_visible = false; |
71 | #ifdef DESKTOP_VERSION | 71 | #ifdef DESKTOP_VERSION |
72 | m_visible = true; | 72 | m_visible = true; |
73 | #endif | 73 | #endif |
74 | addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); | 74 | addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); |
75 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); | 75 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); |
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp index eb5bdd9..168d39e 100644 --- a/kaddressbook/kcmconfigs/addresseewidget.cpp +++ b/kaddressbook/kcmconfigs/addresseewidget.cpp | |||
@@ -209,35 +209,30 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) | |||
209 | AddresseeWidget::~AddresseeWidget() | 209 | AddresseeWidget::~AddresseeWidget() |
210 | { | 210 | { |
211 | } | 211 | } |
212 | 212 | ||
213 | void AddresseeWidget::restoreSettings() | 213 | void AddresseeWidget::restoreSettings() |
214 | { | 214 | { |
215 | KConfig config( locateLocal("config", "kabcrc") ); | 215 | KConfig config( locateLocal("config", "kabcrc") ); |
216 | config.setGroup( "General" ); | 216 | config.setGroup( "General" ); |
217 | 217 | ||
218 | mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); | 218 | mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); |
219 | mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); | 219 | mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); |
220 | mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); | 220 | mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); |
221 | 221 | mFormattedNameCombo->setCurrentItem( config.readNumEntry( "FormattedNameType", 1 ) ); | |
222 | KConfig cfg( locateLocal("config","kaddressbookrc") ); | ||
223 | cfg.setGroup( "General" ); | ||
224 | mFormattedNameCombo->setCurrentItem( cfg.readNumEntry( "FormattedNameType", 1 ) ); | ||
225 | } | 222 | } |
226 | 223 | ||
227 | void AddresseeWidget::saveSettings() | 224 | void AddresseeWidget::saveSettings() |
228 | { | 225 | { |
226 | qDebug("AddresseeWidget::saveSettings() "); | ||
229 | KConfig config( locateLocal("config","kabcrc") ); | 227 | KConfig config( locateLocal("config","kabcrc") ); |
230 | config.setGroup( "General" ); | 228 | config.setGroup( "General" ); |
231 | 229 | ||
232 | config.writeEntry( "Prefixes", mPrefix->nameParts() ); | 230 | config.writeEntry( "Prefixes", mPrefix->nameParts() ); |
233 | config.writeEntry( "Inclusions", mInclusion->nameParts() ); | 231 | config.writeEntry( "Inclusions", mInclusion->nameParts() ); |
234 | config.writeEntry( "Suffixes", mSuffix->nameParts() ); | 232 | config.writeEntry( "Suffixes", mSuffix->nameParts() ); |
235 | 233 | config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); | |
236 | KConfig cfg( locateLocal("config","kaddressbookrc") ); | ||
237 | cfg.setGroup( "General" ); | ||
238 | cfg.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); | ||
239 | } | 234 | } |
240 | 235 | ||
241 | #ifndef KAB_EMBEDDED | 236 | #ifndef KAB_EMBEDDED |
242 | #include "addresseewidget.moc" | 237 | #include "addresseewidget.moc" |
243 | #endif //KAB_EMBEDDED | 238 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp index 8213c2b..f5dba0f 100644 --- a/kaddressbook/nameeditdialog.cpp +++ b/kaddressbook/nameeditdialog.cpp | |||
@@ -216,40 +216,42 @@ QString NameEditDialog::customFormattedName() const | |||
216 | int NameEditDialog::formattedNameType() const | 216 | int NameEditDialog::formattedNameType() const |
217 | { | 217 | { |
218 | return mFormattedNameCombo->currentItem(); | 218 | return mFormattedNameCombo->currentItem(); |
219 | } | 219 | } |
220 | 220 | ||
221 | bool NameEditDialog::changed() const | 221 | bool NameEditDialog::changed() const |
222 | { | 222 | { |
223 | return mChanged; | 223 | return mChanged; |
224 | } | 224 | } |
225 | 225 | ||
226 | QString NameEditDialog::formattedName( const KABC::Addressee &addr, int type ) | 226 | QString NameEditDialog::formattedName( const KABC::Addressee &addr, int type ) |
227 | { | 227 | { |
228 | QString retval; | ||
228 | switch ( type ) { | 229 | switch ( type ) { |
229 | case SimpleName: | 230 | case SimpleName: |
230 | return addr.givenName() + " " + addr.familyName(); | 231 | retval = addr.givenName() + " " + addr.familyName(); |
231 | break; | 232 | break; |
232 | case FullName: | 233 | case FullName: |
233 | return addr.prefix() + " " + addr.givenName() + " " + | 234 | retval =addr.prefix() + " " + addr.givenName() + " " + |
234 | addr.additionalName() + " " + addr.familyName() + " " + | 235 | addr.additionalName() + " " + addr.familyName() + " " + |
235 | addr.suffix(); | 236 | addr.suffix(); |
236 | break; | 237 | break; |
237 | case ReverseName: | 238 | case ReverseName: |
238 | return addr.familyName() + ", " + addr.givenName(); | 239 | retval = addr.familyName() + ", " + addr.givenName(); |
239 | break; | 240 | break; |
240 | default: | 241 | default: |
241 | return ""; | 242 | return ""; |
242 | break; | 243 | break; |
243 | } | 244 | } |
245 | return retval.stripWhiteSpace (); | ||
244 | } | 246 | } |
245 | 247 | ||
246 | void NameEditDialog::parseBoxChanged( bool value ) | 248 | void NameEditDialog::parseBoxChanged( bool value ) |
247 | { | 249 | { |
248 | //AddresseeConfig::instance()->setUid( addr.uid() ); | 250 | //AddresseeConfig::instance()->setUid( addr.uid() ); |
249 | AddresseeConfig::instance()->setAutomaticNameParsing( value ); | 251 | AddresseeConfig::instance()->setAutomaticNameParsing( value ); |
250 | } | 252 | } |
251 | 253 | ||
252 | void NameEditDialog::typeChanged( int pos ) | 254 | void NameEditDialog::typeChanged( int pos ) |
253 | { | 255 | { |
254 | mFormattedNameEdit->setEnabled( pos == 0 ); | 256 | mFormattedNameEdit->setEnabled( pos == 0 ); |
255 | } | 257 | } |