author | zautrix <zautrix> | 2005-06-11 17:03:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-11 17:03:59 (UTC) |
commit | 81370a5f955c2710b6e9336b6c412c8d630ef72a (patch) (unidiff) | |
tree | 6252851fbafcbc3ff777e1af0171990124beb23e /libkdepim | |
parent | 0cfaf22fc5d8f511320813171be84ce3436990c6 (diff) | |
download | kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.zip kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.tar.gz kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.tar.bz2 |
fixes
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index d3797ae..a0f9d2e 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -114,94 +114,96 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, | |||
114 | setupStoreTab(); | 114 | setupStoreTab(); |
115 | setupBackupTab(); | 115 | setupBackupTab(); |
116 | } | 116 | } |
117 | void KDEPIMConfigWidget::showTimeZoneTab() | 117 | void KDEPIMConfigWidget::showTimeZoneTab() |
118 | { | 118 | { |
119 | tabWidget->setCurrentPage ( 3 ) ; | 119 | tabWidget->setCurrentPage ( 3 ) ; |
120 | } | 120 | } |
121 | void KDEPIMConfigWidget::setupBackupTab() | 121 | void KDEPIMConfigWidget::setupBackupTab() |
122 | { | 122 | { |
123 | QVBox *colorPage = new QVBox( this ); | 123 | QVBox *colorPage = new QVBox( this ); |
124 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); | 124 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); |
125 | QWidget* topFrame = new QWidget( colorPage ); | 125 | QWidget* topFrame = new QWidget( colorPage ); |
126 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 126 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
127 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), | 127 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), |
128 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); | 128 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); |
129 | topLayout->addWidget((QWidget*)sb->checkBox()); | 129 | topLayout->addWidget((QWidget*)sb->checkBox()); |
130 | QWidget* bupFrame = new QWidget( topFrame ); | 130 | QWidget* bupFrame = new QWidget( topFrame ); |
131 | topLayout->addWidget((bupFrame)); | 131 | topLayout->addWidget((bupFrame)); |
132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); | 132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); |
133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); | 133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); |
134 | sb = addWidBool(i18n("Use standard backup dir"), | 134 | sb = addWidBool(i18n("Use standard backup dir"), |
135 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); | 135 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); |
136 | bupLayout->addWidget((QWidget*)sb->checkBox()); | 136 | bupLayout->addWidget((QWidget*)sb->checkBox()); |
137 | mBackupUrl = new KURLRequester( bupFrame ); | 137 | mBackupUrl = new KURLRequester( bupFrame ); |
138 | mBackupUrl->setPathIsDir(); | ||
138 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 139 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
139 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); | 140 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); |
140 | bupLayout->addWidget( mBackupUrl ); | 141 | bupLayout->addWidget( mBackupUrl ); |
141 | 142 | ||
142 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); | 143 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); |
143 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); | 144 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); |
144 | QHBox *dummy = new QHBox(bupFrame); | 145 | QHBox *dummy = new QHBox(bupFrame); |
145 | new QLabel(i18n("Number of Backups:"),dummy); | 146 | new QLabel(i18n("Number of Backups:"),dummy); |
146 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); | 147 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); |
147 | new QLabel(i18n(" "),dummy); | 148 | new QLabel(i18n(" "),dummy); |
148 | bupLayout->addWidget( dummy ); | 149 | bupLayout->addWidget( dummy ); |
149 | 150 | ||
150 | dummy = new QHBox(bupFrame); | 151 | dummy = new QHBox(bupFrame); |
151 | new QLabel(i18n("Make backup every "),dummy); | 152 | new QLabel(i18n("Make backup every "),dummy); |
152 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); | 153 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); |
153 | new QLabel(i18n(" days"),dummy); | 154 | new QLabel(i18n(" days"),dummy); |
154 | new QLabel(i18n(" "),dummy); | 155 | new QLabel(i18n(" "),dummy); |
155 | bupLayout->addWidget( dummy ); | 156 | bupLayout->addWidget( dummy ); |
156 | QString localKdeDir; | 157 | QString localKdeDir; |
157 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | 158 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); |
158 | if ( ! localKdeDir.isEmpty() ) { | 159 | if ( ! localKdeDir.isEmpty() ) { |
159 | sb->checkBox()->setEnabled( false ); | 160 | sb->checkBox()->setEnabled( false ); |
160 | sb->checkBox()->setChecked( true ); | 161 | sb->checkBox()->setChecked( true ); |
161 | mBackupUrl->setEnabled( false ); | 162 | mBackupUrl->setEnabled( false ); |
162 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; | 163 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; |
163 | } | 164 | } |
164 | 165 | ||
165 | } | 166 | } |
166 | void KDEPIMConfigWidget::setupStoreTab() | 167 | void KDEPIMConfigWidget::setupStoreTab() |
167 | { | 168 | { |
168 | QVBox *colorPage = new QVBox( this ); | 169 | QVBox *colorPage = new QVBox( this ); |
169 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); | 170 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); |
170 | QWidget* cw = new QWidget( colorPage ); | 171 | QWidget* cw = new QWidget( colorPage ); |
171 | KPrefsWidColor *holidayColor = | 172 | KPrefsWidColor *holidayColor = |
172 | addWidColor(i18n("Alternating background of list views"), | 173 | addWidColor(i18n("Alternating background of list views"), |
173 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); | 174 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); |
174 | QHBoxLayout *topLayout = new QHBoxLayout(cw); | 175 | QHBoxLayout *topLayout = new QHBoxLayout(cw); |
175 | topLayout->addWidget(holidayColor->label()); | 176 | topLayout->addWidget(holidayColor->label()); |
176 | topLayout->addWidget( (QWidget* )holidayColor->button()); | 177 | topLayout->addWidget( (QWidget* )holidayColor->button()); |
177 | 178 | ||
178 | 179 | ||
179 | QVBox *storePage = new QVBox( this ); | 180 | QVBox *storePage = new QVBox( this ); |
180 | if ( QApplication::desktop()->height() > 240 ) | 181 | if ( QApplication::desktop()->height() > 240 ) |
181 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); | 182 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); |
182 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 183 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
183 | mStoreUrl = new KURLRequester( storePage ); | 184 | mStoreUrl = new KURLRequester( storePage ); |
185 | mStoreUrl->setPathIsDir(); | ||
184 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 186 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
185 | #ifdef DESKTOP_VERSION | 187 | #ifdef DESKTOP_VERSION |
186 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; | 188 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; |
187 | QFileInfo fi ( confFile ); | 189 | QFileInfo fi ( confFile ); |
188 | if ( fi.exists() ) { | 190 | if ( fi.exists() ) { |
189 | KConfig cfg ( confFile ); | 191 | KConfig cfg ( confFile ); |
190 | cfg.setGroup("Global"); | 192 | cfg.setGroup("Global"); |
191 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); | 193 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); |
192 | if ( localKdeDir != "x_x_x" ) { | 194 | if ( localKdeDir != "x_x_x" ) { |
193 | mStoreUrl->setURL( localKdeDir ); | 195 | mStoreUrl->setURL( localKdeDir ); |
194 | qDebug("Reading config from %s ", confFile.latin1()); | 196 | qDebug("Reading config from %s ", confFile.latin1()); |
195 | } | 197 | } |
196 | } | 198 | } |
197 | 199 | ||
198 | #endif | 200 | #endif |
199 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 201 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
200 | QHBox *bb = new QHBox( storePage ); | 202 | QHBox *bb = new QHBox( storePage ); |
201 | QPushButton * pb; | 203 | QPushButton * pb; |
202 | if ( QApplication::desktop()->width() < 640 ) | 204 | if ( QApplication::desktop()->width() < 640 ) |
203 | pb = new QPushButton ( i18n("Save"), bb ); | 205 | pb = new QPushButton ( i18n("Save"), bb ); |
204 | else | 206 | else |
205 | pb = new QPushButton ( i18n("Save settings"), bb ); | 207 | pb = new QPushButton ( i18n("Save settings"), bb ); |
206 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 208 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
207 | pb = new QPushButton ( i18n("Save standard"), bb ); | 209 | pb = new QPushButton ( i18n("Save standard"), bb ); |