-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 26 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 2 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 1 |
3 files changed, 25 insertions, 4 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index ff1e240..764c495 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -177,94 +177,112 @@ void KDEPIMConfigWidget::setupStoreTab() | |||
177 | topLayout->addWidget(holidayColor->label()); | 177 | topLayout->addWidget(holidayColor->label()); |
178 | topLayout->addWidget( (QWidget* )holidayColor->button()); | 178 | topLayout->addWidget( (QWidget* )holidayColor->button()); |
179 | 179 | ||
180 | 180 | ||
181 | QVBox *storePage = new QVBox( this ); | 181 | QVBox *storePage = new QVBox( this ); |
182 | if ( QApplication::desktop()->height() > 240 ) | 182 | if ( QApplication::desktop()->height() > 240 ) |
183 | 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 ); | 183 | 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 ); |
184 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 184 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
185 | mStoreUrl = new KURLRequester( storePage ); | 185 | mStoreUrl = new KURLRequester( storePage ); |
186 | mStoreUrl->setPathIsDir(); | 186 | mStoreUrl->setPathIsDir(); |
187 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 187 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
188 | #ifdef DESKTOP_VERSION | 188 | #ifdef DESKTOP_VERSION |
189 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; | 189 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; |
190 | QFileInfo fi ( confFile ); | 190 | QFileInfo fi ( confFile ); |
191 | if ( fi.exists() ) { | 191 | if ( fi.exists() ) { |
192 | KConfig cfg ( confFile ); | 192 | KConfig cfg ( confFile ); |
193 | cfg.setGroup("Global"); | 193 | cfg.setGroup("Global"); |
194 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); | 194 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); |
195 | if ( localKdeDir != "x_x_x" ) { | 195 | if ( localKdeDir != "x_x_x" ) { |
196 | mStoreUrl->setURL( localKdeDir ); | 196 | mStoreUrl->setURL( localKdeDir ); |
197 | qDebug("Reading config from %s ", confFile.latin1()); | 197 | qDebug("Reading config from %s ", confFile.latin1()); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | #endif | 201 | #endif |
202 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 202 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
203 | QHBox *bb = new QHBox( storePage ); | 203 | QHBox *bb = new QHBox( storePage ); |
204 | QPushButton * pb; | 204 | QPushButton * pb; |
205 | if ( QApplication::desktop()->width() < 640 ) | 205 | if ( QApplication::desktop()->width() < 640 ) |
206 | pb = new QPushButton ( i18n("Save"), bb ); | 206 | pb = new QPushButton ( i18n("Save"), bb ); |
207 | else | 207 | else |
208 | pb = new QPushButton ( i18n("Save settings"), bb ); | 208 | pb = new QPushButton ( i18n("Save settings"), bb ); |
209 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 209 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
210 | pb = new QPushButton ( i18n("Save standard"), bb ); | 210 | pb = new QPushButton ( i18n("Save standard"), bb ); |
211 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); | 211 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); |
212 | #ifdef DESKTOP_VERSION | 212 | #ifdef DESKTOP_VERSION |
213 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); | 213 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); |
214 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); | 214 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); |
215 | #endif | 215 | #endif |
216 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 216 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
217 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 217 | mDataStoragePath = new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
218 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 218 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
219 | |||
220 | #ifdef DESKTOP_VERSION | ||
221 | if ( mStoreUrl->url().startsWith( "LOCAL:" ) ) { | ||
222 | mDataStoragePath->setText( i18n("Settings are stored in\n%1").arg( qApp->applicationDirPath ()+"/.microkdehome" )); | ||
223 | } | ||
224 | #endif | ||
219 | } | 225 | } |
220 | void KDEPIMConfigWidget::setLocalStore() | 226 | void KDEPIMConfigWidget::setLocalStore() |
221 | { | 227 | { |
222 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); | 228 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); |
223 | saveStoreSettings(); | 229 | saveStoreSettings(); |
224 | QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); | 230 | QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); |
225 | KMessageBox::information( this, message); | 231 | KMessageBox::information( this, message); |
226 | } | 232 | } |
227 | void KDEPIMConfigWidget::setStandardStore() | 233 | void KDEPIMConfigWidget::setStandardStore() |
228 | { | 234 | { |
229 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 235 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
230 | saveStoreSettings(); | 236 | saveStoreSettings(); |
231 | } | 237 | } |
232 | void KDEPIMConfigWidget::saveStoreSettings() | 238 | void KDEPIMConfigWidget::saveStoreSettings() |
233 | { | 239 | { |
240 | #ifdef DESKTOP_VERSION | ||
241 | if ( !mStoreUrl->url().startsWith( "LOCAL:" ) ) { | ||
242 | QString file = qApp->applicationDirPath ()+"/.microkdehome"; | ||
243 | QFileInfo fi ( file ); | ||
244 | if ( fi.exists() ) { | ||
245 | bool res = QFile::remove( file ); | ||
246 | if ( ! res ) | ||
247 | KMessageBox::information( this, i18n("ERROR: Cannot remove file\n%1\nPlease remove it manually.").arg( file )); | ||
248 | } | ||
249 | } | ||
250 | #endif | ||
234 | if ( !mStoreUrl->url().isEmpty() ) { | 251 | if ( !mStoreUrl->url().isEmpty() ) { |
235 | QString path = QDir::homeDirPath(); | 252 | QString path = QDir::homeDirPath(); |
236 | QString url = mStoreUrl->url(); | 253 | QString url = mStoreUrl->url(); |
237 | #ifdef DESKTOP_VERSION | 254 | #ifdef DESKTOP_VERSION |
238 | if ( url.startsWith( "LOCAL:" ) ) { | 255 | if ( url.startsWith( "LOCAL:" ) ) { |
239 | path = qApp->applicationDirPath () ; | 256 | path = qApp->applicationDirPath () ; |
240 | } | 257 | } |
241 | #endif | 258 | #endif |
242 | KConfig cfg ( path + "/.microkdehome" ); | 259 | KConfig cfg ( path + "/.microkdehome" ); |
243 | cfg.setGroup("Global"); | 260 | cfg.setGroup("Global"); |
244 | cfg.writeEntry( "MICROKDEHOME", url ); | 261 | cfg.writeEntry( "MICROKDEHOME", url ); |
245 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); | 262 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); |
246 | cfg.sync(); | 263 | cfg.sync(); |
264 | mDataStoragePath->setText( i18n("Settings are stored in\n%1").arg( path+"/.microkdehome" )); | ||
247 | } else { | 265 | } else { |
248 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 266 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
249 | saveStoreSettings(); | 267 | saveStoreSettings(); |
250 | } | 268 | } |
251 | } | 269 | } |
252 | void KDEPIMConfigWidget::setupExternalAppTab() | 270 | void KDEPIMConfigWidget::setupExternalAppTab() |
253 | { | 271 | { |
254 | QWidget *externalAppsPage = new QWidget( this ); | 272 | QWidget *externalAppsPage = new QWidget( this ); |
255 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 273 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
256 | KDialog::spacingHintSmall() ); | 274 | KDialog::spacingHintSmall() ); |
257 | 275 | ||
258 | mExternalApps = new QComboBox( externalAppsPage ); | 276 | mExternalApps = new QComboBox( externalAppsPage ); |
259 | 277 | ||
260 | QMap<ExternalAppHandler::Types, QString>::Iterator it; | 278 | QMap<ExternalAppHandler::Types, QString>::Iterator it; |
261 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) | 279 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) |
262 | mExternalApps->insertItem( it.data(), it.key() ); | 280 | mExternalApps->insertItem( it.data(), it.key() ); |
263 | 281 | ||
264 | layout->addWidget( mExternalApps ); | 282 | layout->addWidget( mExternalApps ); |
265 | 283 | ||
266 | connect( mExternalApps, SIGNAL( activated( int ) ), | 284 | connect( mExternalApps, SIGNAL( activated( int ) ), |
267 | this, SLOT (externalapp_changed( int ) ) ); | 285 | this, SLOT (externalapp_changed( int ) ) ); |
268 | 286 | ||
269 | 287 | ||
270 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 288 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
@@ -820,50 +838,52 @@ void KDEPIMConfigWidget::updateClientWidgets() | |||
820 | mParameters2->setText( "" ); | 838 | mParameters2->setText( "" ); |
821 | } | 839 | } |
822 | 840 | ||
823 | if (enabled == true) { | 841 | if (enabled == true) { |
824 | if ( mMessage2 ) | 842 | if ( mMessage2 ) |
825 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 843 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
826 | if ( mParameters2 ) | 844 | if ( mParameters2 ) |
827 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 845 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
828 | } | 846 | } |
829 | 847 | ||
830 | 848 | ||
831 | blockSignals( blocked ); | 849 | blockSignals( blocked ); |
832 | 850 | ||
833 | } | 851 | } |
834 | 852 | ||
835 | void KDEPIMConfigWidget::usrReadConfig() | 853 | void KDEPIMConfigWidget::usrReadConfig() |
836 | { | 854 | { |
837 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 855 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
838 | 856 | ||
839 | bool blocked = signalsBlocked(); | 857 | bool blocked = signalsBlocked(); |
840 | blockSignals( true ); | 858 | blockSignals( true ); |
841 | 859 | ||
842 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) | 860 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) |
843 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 861 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
844 | else | 862 | else { |
845 | mBackupUrl->setURL(prefs->mBackupDatadir); | 863 | mBackupUrl->setURL(prefs->mBackupDatadir); |
864 | |||
865 | } | ||
846 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); | 866 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); |
847 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); | 867 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); |
848 | 868 | ||
849 | QString dummy = prefs->mUserDateFormatLong; | 869 | QString dummy = prefs->mUserDateFormatLong; |
850 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 870 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
851 | dummy = prefs->mUserDateFormatShort; | 871 | dummy = prefs->mUserDateFormatShort; |
852 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 872 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
853 | 873 | ||
854 | QDate current ( 2001, 1,1); | 874 | QDate current ( 2001, 1,1); |
855 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); | 875 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); |
856 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); | 876 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); |
857 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); | 877 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); |
858 | 878 | ||
859 | mEmailClient = prefs->mEmailClient; | 879 | mEmailClient = prefs->mEmailClient; |
860 | mEmailOtherChannel = prefs->mEmailOtherChannel; | 880 | mEmailOtherChannel = prefs->mEmailOtherChannel; |
861 | mEmailOtherMessage = prefs->mEmailOtherMessage; | 881 | mEmailOtherMessage = prefs->mEmailOtherMessage; |
862 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; | 882 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; |
863 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; | 883 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; |
864 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; | 884 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; |
865 | 885 | ||
866 | mPhoneClient = prefs->mPhoneClient; | 886 | mPhoneClient = prefs->mPhoneClient; |
867 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; | 887 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; |
868 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; | 888 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; |
869 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; | 889 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; |
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index c0b92a9..824ef79 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h | |||
@@ -131,33 +131,33 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
131 | QString mPhoneOtherChannel; | 131 | QString mPhoneOtherChannel; |
132 | QString mPhoneOtherMessage; | 132 | QString mPhoneOtherMessage; |
133 | QString mPhoneOtherMessageParameters; | 133 | QString mPhoneOtherMessageParameters; |
134 | 134 | ||
135 | int mFaxClient; | 135 | int mFaxClient; |
136 | QString mFaxOtherChannel; | 136 | QString mFaxOtherChannel; |
137 | QString mFaxOtherMessage; | 137 | QString mFaxOtherMessage; |
138 | QString mFaxOtherMessageParameters; | 138 | QString mFaxOtherMessageParameters; |
139 | 139 | ||
140 | int mSMSClient; | 140 | int mSMSClient; |
141 | QString mSMSOtherChannel; | 141 | QString mSMSOtherChannel; |
142 | QString mSMSOtherMessage; | 142 | QString mSMSOtherMessage; |
143 | QString mSMSOtherMessageParameters; | 143 | QString mSMSOtherMessageParameters; |
144 | 144 | ||
145 | int mPagerClient; | 145 | int mPagerClient; |
146 | QString mPagerOtherChannel; | 146 | QString mPagerOtherChannel; |
147 | QString mPagerOtherMessage; | 147 | QString mPagerOtherMessage; |
148 | QString mPagerOtherMessageParameters; | 148 | QString mPagerOtherMessageParameters; |
149 | 149 | ||
150 | int mSipClient; | 150 | int mSipClient; |
151 | QString mSipOtherChannel; | 151 | QString mSipOtherChannel; |
152 | QString mSipOtherMessage; | 152 | QString mSipOtherMessage; |
153 | QString mSipOtherMessageParameters; | 153 | QString mSipOtherMessageParameters; |
154 | 154 | ||
155 | 155 | QLabel* mDataStoragePath; | |
156 | KURLRequester* mBackupUrl; | 156 | KURLRequester* mBackupUrl; |
157 | QSpinBox* mBackupDayCountSpin, *mBackupNumbersSpin ; | 157 | QSpinBox* mBackupDayCountSpin, *mBackupNumbersSpin ; |
158 | QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; | 158 | QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; |
159 | 159 | ||
160 | // AddresseeWidget *mAddresseeWidget; | 160 | // AddresseeWidget *mAddresseeWidget; |
161 | }; | 161 | }; |
162 | 162 | ||
163 | #endif | 163 | #endif |
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 7f352d6..25b4e81 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -456,34 +456,35 @@ KDatePicker::setFontSize(int s) | |||
456 | void KDatePicker::virtual_hook( int id, void* data ) | 456 | void KDatePicker::virtual_hook( int id, void* data ) |
457 | { /*BASE::virtual_hook( id, data );*/ } | 457 | { /*BASE::virtual_hook( id, data );*/ } |
458 | 458 | ||
459 | void KDatePicker::keyPressEvent ( QKeyEvent * e ) | 459 | void KDatePicker::keyPressEvent ( QKeyEvent * e ) |
460 | { | 460 | { |
461 | switch ( e->key() ) { | 461 | switch ( e->key() ) { |
462 | case Qt::Key_Right: | 462 | case Qt::Key_Right: |
463 | monthForwardClicked(); | 463 | monthForwardClicked(); |
464 | break; | 464 | break; |
465 | case Qt::Key_Left: | 465 | case Qt::Key_Left: |
466 | monthBackwardClicked(); | 466 | monthBackwardClicked(); |
467 | break; | 467 | break; |
468 | 468 | ||
469 | case Qt::Key_Down: | 469 | case Qt::Key_Down: |
470 | yearForwardClicked(); | 470 | yearForwardClicked(); |
471 | 471 | ||
472 | break; | 472 | break; |
473 | 473 | ||
474 | case Qt::Key_Up: | 474 | case Qt::Key_Up: |
475 | yearBackwardClicked(); | 475 | yearBackwardClicked(); |
476 | break; | 476 | break; |
477 | 477 | ||
478 | case Qt::Key_Return: | 478 | case Qt::Key_Return: |
479 | case Qt::Key_Enter: | 479 | case Qt::Key_Enter: |
480 | case Qt::Key_Space: | ||
480 | tableClickedSlot(); | 481 | tableClickedSlot(); |
481 | break; | 482 | break; |
482 | case Qt::Key_Escape: | 483 | case Qt::Key_Escape: |
483 | e->ignore(); | 484 | e->ignore(); |
484 | break; | 485 | break; |
485 | default: | 486 | default: |
486 | break; | 487 | break; |
487 | } | 488 | } |
488 | 489 | ||
489 | } | 490 | } |