-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 26 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 5cd845e..4fe1e66 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -82,8 +82,9 @@ $Id$ | |||
82 | #include "kpimglobalprefs.h" | 82 | #include "kpimglobalprefs.h" |
83 | 83 | ||
84 | #include "kdepimconfigwidget.h" | 84 | #include "kdepimconfigwidget.h" |
85 | #include <kprefs.h> | 85 | #include <kprefs.h> |
86 | #include <kmessagebox.h> | ||
86 | 87 | ||
87 | 88 | ||
88 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) | 89 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
89 | : KPrefsWidget(prefs, parent, name ) | 90 | : KPrefsWidget(prefs, parent, name ) |
@@ -120,8 +121,22 @@ void KDEPIMConfigWidget::setupStoreTab() | |||
120 | 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 ); | 121 | 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 ); |
121 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 122 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
122 | mStoreUrl = new KURLRequester( storePage ); | 123 | mStoreUrl = new KURLRequester( storePage ); |
123 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 124 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
125 | #ifdef DESKTOP_VERSION | ||
126 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; | ||
127 | QFileInfo fi ( confFile ); | ||
128 | if ( fi.exists() ) { | ||
129 | KConfig cfg ( confFile ); | ||
130 | cfg.setGroup("Global"); | ||
131 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); | ||
132 | if ( localKdeDir != "x_x_x" ) { | ||
133 | mStoreUrl->setURL( localKdeDir ); | ||
134 | qDebug("Reading config from %s ", confFile.latin1()); | ||
135 | } | ||
136 | } | ||
137 | |||
138 | #endif | ||
124 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 139 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
125 | QHBox *bb = new QHBox( storePage ); | 140 | QHBox *bb = new QHBox( storePage ); |
126 | QPushButton * pb; | 141 | QPushButton * pb; |
127 | if ( QApplication::desktop()->width() < 640 ) | 142 | if ( QApplication::desktop()->width() < 640 ) |
@@ -130,12 +145,23 @@ void KDEPIMConfigWidget::setupStoreTab() | |||
130 | pb = new QPushButton ( i18n("Save settings"), bb ); | 145 | pb = new QPushButton ( i18n("Save settings"), bb ); |
131 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 146 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
132 | pb = new QPushButton ( i18n("Save standard"), bb ); | 147 | pb = new QPushButton ( i18n("Save standard"), bb ); |
133 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); | 148 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); |
149 | #ifdef DESKTOP_VERSION | ||
150 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); | ||
151 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); | ||
152 | #endif | ||
134 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 153 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
135 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 154 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
136 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 155 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
137 | } | 156 | } |
157 | void KDEPIMConfigWidget::setLocalStore() | ||
158 | { | ||
159 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); | ||
160 | saveStoreSettings(); | ||
161 | 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."); | ||
162 | KMessageBox::information( this, message); | ||
163 | } | ||
138 | void KDEPIMConfigWidget::setStandardStore() | 164 | void KDEPIMConfigWidget::setStandardStore() |
139 | { | 165 | { |
140 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 166 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
141 | saveStoreSettings(); | 167 | saveStoreSettings(); |
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index c545207..984e4e0 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h | |||
@@ -70,8 +70,9 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
70 | void client_changed( int newClient ); | 70 | void client_changed( int newClient ); |
71 | void externalapp_changed( int newApp ); | 71 | void externalapp_changed( int newApp ); |
72 | void saveStoreSettings(); | 72 | void saveStoreSettings(); |
73 | void setStandardStore(); | 73 | void setStandardStore(); |
74 | void setLocalStore(); | ||
74 | 75 | ||
75 | private: | 76 | private: |
76 | void setupExternalAppTab(); | 77 | void setupExternalAppTab(); |
77 | void setupLocaleDateTab(); | 78 | void setupLocaleDateTab(); |