summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp26
1 files changed, 26 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
@@ -85,2 +85,3 @@ $Id$
#include <kprefs.h>
+#include <kmessagebox.h>
@@ -123,2 +124,16 @@ void KDEPIMConfigWidget::setupStoreTab()
mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
+#ifdef DESKTOP_VERSION
+ QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
+ QFileInfo fi ( confFile );
+ if ( fi.exists() ) {
+ KConfig cfg ( confFile );
+ cfg.setGroup("Global");
+ QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
+ if ( localKdeDir != "x_x_x" ) {
+ mStoreUrl->setURL( localKdeDir );
+ qDebug("Reading config from %s ", confFile.latin1());
+ }
+ }
+
+#endif
new QLabel( i18n("New dirs are created automatically"), storePage );
@@ -133,2 +148,6 @@ void KDEPIMConfigWidget::setupStoreTab()
connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
+#ifdef DESKTOP_VERSION
+ pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
+ connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
+#endif
new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
@@ -137,2 +156,9 @@ void KDEPIMConfigWidget::setupStoreTab()
}
+void KDEPIMConfigWidget::setLocalStore()
+{
+ mStoreUrl->setURL( "LOCAL:kdepimpi" );
+ saveStoreSettings();
+ 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.");
+ KMessageBox::information( this, message);
+}
void KDEPIMConfigWidget::setStandardStore()