summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
Unidiff
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 20594c6..d097078 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -38,2 +38,4 @@ $Id$
38#include <qfile.h> 38#include <qfile.h>
39#include <qvbox.h>
40#include <qdir.h>
39#include <qregexp.h> 41#include <qregexp.h>
@@ -105,2 +107,3 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent,
105 setupExternalAppTab(); 107 setupExternalAppTab();
108 setupStoreTab();
106 109
@@ -111,2 +114,37 @@ void KDEPIMConfigWidget::showTimeZoneTab()
111} 114}
115void KDEPIMConfigWidget::setupStoreTab()
116{
117 QVBox *storePage = new QVBox( this );
118 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 );
119 new QLabel( i18n("<b>Set new data storage dir:</b>"), storePage );
120 mStoreUrl = new KURLRequester( storePage );
121 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
122 new QLabel( i18n("Not existing dirs are created automatically"), storePage );
123 QHBox *bb = new QHBox( storePage );
124 QPushButton * pb = new QPushButton ( i18n("Save settings"), bb );
125 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
126 pb = new QPushButton ( i18n("Save standard"), bb );
127 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
128 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
129 new QLabel( i18n("The settings of the storage\ndir is saved in the file\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
130 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
131}
132void KDEPIMConfigWidget::setStandardStore()
133{
134 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
135 saveStoreSettings();
136}
137void KDEPIMConfigWidget::saveStoreSettings()
138{
139 if ( !mStoreUrl->url().isEmpty() ) {
140 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
141 cfg.setGroup("Global");
142 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() );
143 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); ");
144 cfg.sync();
145 } else {
146 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
147 saveStoreSettings();
148 }
149}
112void KDEPIMConfigWidget::setupExternalAppTab() 150void KDEPIMConfigWidget::setupExternalAppTab()