summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-06-25 02:23:09 (UTC)
committer zautrix <zautrix>2005-06-25 02:23:09 (UTC)
commit1d0b53abc70e66708d93b7081a21a7689b1a1303 (patch) (unidiff)
tree2a79eab02c3560af43af16162e2004adf507fb0f /kaddressbook
parentab93fa0a7cd97beada9475f6099bf6083547f0d6 (diff)
downloadkdepimpi-1d0b53abc70e66708d93b7081a21a7689b1a1303.zip
kdepimpi-1d0b53abc70e66708d93b7081a21a7689b1a1303.tar.gz
kdepimpi-1d0b53abc70e66708d93b7081a21a7689b1a1303.tar.bz2
fixx
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 8a4dd3d..1b4652a 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -40,202 +40,202 @@
40#include <klocale.h> 40#include <klocale.h>
41#include <kglobal.h> 41#include <kglobal.h>
42#include <kmessagebox.h> 42#include <kmessagebox.h>
43#include <kstandarddirs.h> 43#include <kstandarddirs.h>
44 44
45#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
46#include <ktrader.h> 46#include <ktrader.h>
47#else // KAB_EMBEDDED 47#else // KAB_EMBEDDED
48#include <mergewidget.h> 48#include <mergewidget.h>
49#include <distributionlistwidget.h> 49#include <distributionlistwidget.h>
50#endif // KAB_EMBEDDED 50#endif // KAB_EMBEDDED
51 51
52#include "addresseewidget.h" 52#include "addresseewidget.h"
53#include "extensionconfigdialog.h" 53#include "extensionconfigdialog.h"
54#include "extensionwidget.h" 54#include "extensionwidget.h"
55#include "kabprefs.h" 55#include "kabprefs.h"
56 56
57#include "kabconfigwidget.h" 57#include "kabconfigwidget.h"
58#include <kglobalsettings.h> 58#include <kglobalsettings.h>
59 59
60class ExtensionItem : public QCheckListItem 60class ExtensionItem : public QCheckListItem
61{ 61{
62 public: 62 public:
63 63
64#ifndef KAB_EMBEDDED 64#ifndef KAB_EMBEDDED
65 ExtensionItem( QListView *parent, const QString &text ); 65 ExtensionItem( QListView *parent, const QString &text );
66 void setService( const KService::Ptr &ptr ); 66 void setService( const KService::Ptr &ptr );
67#else //KAB_EMBEDDED 67#else //KAB_EMBEDDED
68 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); 68 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment );
69 void setFactory( ExtensionFactory* fac ); 69 void setFactory( ExtensionFactory* fac );
70#endif //KAB_EMBEDDED 70#endif //KAB_EMBEDDED
71 71
72 bool configWidgetAvailable() const; 72 bool configWidgetAvailable() const;
73 ExtensionFactory *factory() const; 73 ExtensionFactory *factory() const;
74 74
75 virtual QString text( int column ) const; 75 virtual QString text( int column ) const;
76 76
77 private: 77 private:
78#ifndef KAB_EMBEDDED 78#ifndef KAB_EMBEDDED
79 KService::Ptr mPtr; 79 KService::Ptr mPtr;
80#else //KAB_EMBEDDED 80#else //KAB_EMBEDDED
81 ExtensionFactory* mFactory; 81 ExtensionFactory* mFactory;
82 QString mName; 82 QString mName;
83 QString mComment; 83 QString mComment;
84 84
85#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
86 86
87}; 87};
88 88
89KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) 89KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
90 : KPrefsWidget( prefs, parent, name ) 90 : KPrefsWidget( prefs, parent, name )
91{ 91{
92 92
93 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 93 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
94 KDialog::spacingHintSmall() ); 94 KDialog::spacingHintSmall() );
95 95
96 QTabWidget *tabWidget = new QTabWidget( this ); 96 QTabWidget *tabWidget = new QTabWidget( this );
97 topLayout->addWidget( tabWidget ); 97 topLayout->addWidget( tabWidget );
98 98
99 // General page 99 // General page
100 QWidget *generalPage = new QWidget( this ); 100 QWidget *generalPage = new QWidget( this );
101 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 101 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(),
102 KDialog::spacingHintSmall() ); 102 KDialog::spacingHintSmall() );
103 103
104 104
105 QWidget *hBox = new QWidget( generalPage, "qhbox" ); 105 QWidget *hBox = new QWidget( generalPage, "qhbox" );
106 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); 106 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox);
107 KPrefsWidFont *detailsFont = 107 KPrefsWidFont *detailsFont =
108 addWidFont(i18n("phone:123"),i18n("Details view font"), 108 addWidFont(i18n("phone:123"),i18n("Details view font"),
109 &(KABPrefs::instance()->mDetailsFont),hBox); 109 &(KABPrefs::instance()->mDetailsFont),hBox);
110 hboxLayout->addWidget(detailsFont->label()); 110 hboxLayout->addWidget(detailsFont->label());
111 hboxLayout->addWidget(detailsFont->preview()); 111 hboxLayout->addWidget(detailsFont->preview());
112 hboxLayout->addWidget(detailsFont->button()); 112 hboxLayout->addWidget(detailsFont->button());
113 hboxLayout->setMargin(KDialog::marginHintSmall() ); 113 hboxLayout->setMargin(KDialog::marginHintSmall() );
114 hboxLayout->setSpacing(KDialog::spacingHintSmall()); 114 hboxLayout->setSpacing(KDialog::spacingHintSmall());
115 //hBox->setBackgroundColor( black); 115 //hBox->setBackgroundColor( black);
116 layout->addWidget( hBox ); 116 layout->addWidget( hBox );
117 117
118 //general groupbox 118 //general groupbox
119 QWidget *vBox = new QWidget( generalPage, "qvbox" ); 119 QWidget *vBox = new QWidget( generalPage, "qvbox" );
120 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 120 QVBoxLayout *boxLayout = new QVBoxLayout( vBox );
121 boxLayout->setAlignment( Qt::AlignTop ); 121 boxLayout->setAlignment( Qt::AlignTop );
122 boxLayout->setMargin(KDialog::marginHintSmall() ); 122 boxLayout->setMargin(KDialog::marginHintSmall() );
123 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 123 boxLayout->setSpacing( KDialog::spacingHintSmall() );
124 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 124 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
125 boxLayout->addWidget( mMenuBarBox ); 125 boxLayout->addWidget( mMenuBarBox );
126 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 126 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
127 boxLayout->addWidget( mSearchReturnBox ); 127 boxLayout->addWidget( mSearchReturnBox );
128 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); 128 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
129 boxLayout->addWidget( mAutoSearchWithWildcardBox); 129 boxLayout->addWidget( mAutoSearchWithWildcardBox);
130 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); 130 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
131 boxLayout->addWidget( mHideSearchOnSwitchBox ); 131 boxLayout->addWidget( mHideSearchOnSwitchBox );
132 132
133#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
134 mHideSearchOnSwitchBox->hide(); 134 mHideSearchOnSwitchBox->hide();
135#endif 135#endif
136 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); 136 mViewsSingleClickBox = new QCheckBox( i18n( "Show edit dialog on single click" ), vBox, "msingle" );
137 boxLayout->addWidget( mViewsSingleClickBox ); 137 boxLayout->addWidget( mViewsSingleClickBox );
138 138
139 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" ); 139 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new contacts" ), vBox, "mparse" );
140 boxLayout->addWidget( mNameParsing ); 140 boxLayout->addWidget( mNameParsing );
141 141
142 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); 142 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
143 boxLayout->addWidget( mMultipleViewsAtOnce ); 143 boxLayout->addWidget( mMultipleViewsAtOnce );
144 144
145 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" ); 145 mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" );
146 boxLayout->addWidget( mAskForQuit ); 146 boxLayout->addWidget( mAskForQuit );
147 147
148 layout->addWidget( vBox ); 148 layout->addWidget( vBox );
149 149
150 tabWidget->addTab( generalPage, i18n( "General" ) ); 150 tabWidget->addTab( generalPage, i18n( "General" ) );
151 151
152 // Extension page 152 // Extension page
153 QWidget *extensionPage = new QWidget( this ); 153 QWidget *extensionPage = new QWidget( this );
154 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), 154 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(),
155 KDialog::spacingHintSmall() ); 155 KDialog::spacingHintSmall() );
156 156
157 //extensions groupbox 157 //extensions groupbox
158 158
159 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); 159 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
160 boxLayout = new QVBoxLayout( groupBox->layout() ); 160 boxLayout = new QVBoxLayout( groupBox->layout() );
161 boxLayout->setAlignment( Qt::AlignTop ); 161 boxLayout->setAlignment( Qt::AlignTop );
162 boxLayout->setMargin(KDialog::marginHintSmall()); 162 boxLayout->setMargin(KDialog::marginHintSmall());
163 boxLayout->setSpacing(KDialog::spacingHintSmall()); 163 boxLayout->setSpacing(KDialog::spacingHintSmall());
164 groupBox->layout()->setMargin(1) ; 164 groupBox->layout()->setMargin(1) ;
165 groupBox->layout()->setSpacing(0); 165 groupBox->layout()->setSpacing(0);
166 mExtensionView = new KListView( groupBox ); 166 mExtensionView = new KListView( groupBox );
167 mExtensionView->setAllColumnsShowFocus( true ); 167 mExtensionView->setAllColumnsShowFocus( true );
168 mExtensionView->addColumn( i18n( "Name" ) ); 168 mExtensionView->addColumn( i18n( "Name" ) );
169 mExtensionView->addColumn( i18n( "Description" ) ); 169 mExtensionView->addColumn( i18n( "Description" ) );
170 //mExtensionView->setMaximumHeight(80); 170 //mExtensionView->setMaximumHeight(80);
171 171
172 boxLayout->addWidget( mExtensionView ); 172 boxLayout->addWidget( mExtensionView );
173 173
174 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); 174 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
175 mConfigureButton->setEnabled( false ); 175 mConfigureButton->setEnabled( false );
176 boxLayout->addWidget( mConfigureButton ); 176 boxLayout->addWidget( mConfigureButton );
177 177
178 extensionLayout->addWidget( groupBox ); 178 extensionLayout->addWidget( groupBox );
179 179
180 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 180 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
181 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 181 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
182 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 182 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
183 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 183 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
184 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 184 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
185 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 185 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
186 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 186 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
187 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 187 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
188 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 188 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
189 SLOT( selectionChanged( QListViewItem* ) ) ); 189 SLOT( selectionChanged( QListViewItem* ) ) );
190 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 190 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
191 SLOT( itemClicked( QListViewItem* ) ) ); 191 SLOT( itemClicked( QListViewItem* ) ) );
192 connect( mConfigureButton, SIGNAL( clicked() ), 192 connect( mConfigureButton, SIGNAL( clicked() ),
193 SLOT( configureExtension() ) ); 193 SLOT( configureExtension() ) );
194 194
195 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 195 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
196 196
197 // Addressee page 197 // Addressee page
198 mAddresseeWidget = new AddresseeWidget( this ); 198 mAddresseeWidget = new AddresseeWidget( this );
199 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 199 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
200 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 200 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
201 201
202} 202}
203 203
204void KABConfigWidget::usrReadConfig() 204void KABConfigWidget::usrReadConfig()
205{ 205{
206 KABPrefs* prefs = KABPrefs::instance(); 206 KABPrefs* prefs = KABPrefs::instance();
207 207
208 bool blocked = signalsBlocked(); 208 bool blocked = signalsBlocked();
209 blockSignals( true ); 209 blockSignals( true );
210 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); 210 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible);
211 mNameParsing->setChecked( prefs->mAutomaticNameParsing ); 211 mNameParsing->setChecked( prefs->mAutomaticNameParsing );
212 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); 212 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
213 mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); 213 mSearchReturnBox->setChecked( prefs->mSearchWithReturn );
214 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard ); 214 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard );
215 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch ); 215 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch );
216 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); 216 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
217 mAskForQuit->setChecked( prefs->mAskForQuit ); 217 mAskForQuit->setChecked( prefs->mAskForQuit );
218 218
219 mAddresseeWidget->restoreSettings(); 219 mAddresseeWidget->restoreSettings();
220 220
221 restoreExtensionSettings(); 221 restoreExtensionSettings();
222 222
223 blockSignals( blocked ); 223 blockSignals( blocked );
224 224
225} 225}
226 226
227void KABConfigWidget::usrWriteConfig() 227void KABConfigWidget::usrWriteConfig()
228{ 228{
229 KABPrefs* prefs = KABPrefs::instance(); 229 KABPrefs* prefs = KABPrefs::instance();
230 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); 230 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked();
231 prefs->mAutomaticNameParsing = mNameParsing->isChecked(); 231 prefs->mAutomaticNameParsing = mNameParsing->isChecked();
232 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 232 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
233 prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); 233 prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
234 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked(); 234 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked();
235 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked(); 235 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked();
236 236
237 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); 237 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
238 prefs->mAskForQuit = mAskForQuit->isChecked(); 238 prefs->mAskForQuit = mAskForQuit->isChecked();
239 239
240 mAddresseeWidget->saveSettings(); 240 mAddresseeWidget->saveSettings();
241 241