From 056f171723a9301aea5a65340dffeda34e078abf Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 30 Mar 2005 13:24:56 +0000 Subject: fixes --- (limited to 'libkdepim') 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 @@ -83,6 +83,7 @@ $Id$ #include "kdepimconfigwidget.h" #include +#include KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) @@ -121,6 +122,20 @@ void KDEPIMConfigWidget::setupStoreTab() new QLabel( i18n("New data storage dir:"), storePage ); mStoreUrl = new KURLRequester( storePage ); 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 ); QHBox *bb = new QHBox( storePage ); QPushButton * pb; @@ -131,10 +146,21 @@ void KDEPIMConfigWidget::setupStoreTab() connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); pb = new QPushButton ( i18n("Save standard"), bb ); 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("New settings are used\nafter a restart"), storePage ); new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); tabWidget->addTab( storePage, i18n( "Data storage path" ) ); } +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 //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() { mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 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 @@ -71,6 +71,7 @@ class KDEPIMConfigWidget : public KPrefsWidget void externalapp_changed( int newApp ); void saveStoreSettings(); void setStandardStore(); + void setLocalStore(); private: void setupExternalAppTab(); -- cgit v0.9.0.2