author | zautrix <zautrix> | 2005-01-18 12:06:27 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-18 12:06:27 (UTC) |
commit | 4b82a36d1b2479dd2e6f00aef45af848f6793099 (patch) (unidiff) | |
tree | 21e5077956085c33f57c4cb54c2b25d5d9a4dc20 /libkdepim | |
parent | fbc1ca53388337b66017973896725d51416aae1a (diff) | |
download | kdepimpi-4b82a36d1b2479dd2e6f00aef45af848f6793099.zip kdepimpi-4b82a36d1b2479dd2e6f00aef45af848f6793099.tar.gz kdepimpi-4b82a36d1b2479dd2e6f00aef45af848f6793099.tar.bz2 |
data dir
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 38 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 5 |
2 files changed, 43 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 | |||
@@ -36,6 +36,8 @@ $Id$ | |||
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
38 | #include <qfile.h> | 38 | #include <qfile.h> |
39 | #include <qvbox.h> | ||
40 | #include <qdir.h> | ||
39 | #include <qregexp.h> | 41 | #include <qregexp.h> |
40 | 42 | ||
41 | #include <kdialog.h> | 43 | #include <kdialog.h> |
@@ -103,12 +105,48 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, | |||
103 | setupLocaleDateTab(); | 105 | setupLocaleDateTab(); |
104 | setupTimeZoneTab(); | 106 | setupTimeZoneTab(); |
105 | setupExternalAppTab(); | 107 | setupExternalAppTab(); |
108 | setupStoreTab(); | ||
106 | 109 | ||
107 | } | 110 | } |
108 | void KDEPIMConfigWidget::showTimeZoneTab() | 111 | void KDEPIMConfigWidget::showTimeZoneTab() |
109 | { | 112 | { |
110 | tabWidget->setCurrentPage ( 3 ) ; | 113 | tabWidget->setCurrentPage ( 3 ) ; |
111 | } | 114 | } |
115 | void 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 | } | ||
132 | void KDEPIMConfigWidget::setStandardStore() | ||
133 | { | ||
134 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | ||
135 | saveStoreSettings(); | ||
136 | } | ||
137 | void 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 | } | ||
112 | void KDEPIMConfigWidget::setupExternalAppTab() | 150 | void KDEPIMConfigWidget::setupExternalAppTab() |
113 | { | 151 | { |
114 | QWidget *externalAppsPage = new QWidget( this ); | 152 | QWidget *externalAppsPage = new QWidget( this ); |
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index 619f3d7..c545207 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h | |||
@@ -32,6 +32,7 @@ $Id$ | |||
32 | #define KDEPIMCONFIGWIDGET_H | 32 | #define KDEPIMCONFIGWIDGET_H |
33 | 33 | ||
34 | #include <kprefswidget.h> | 34 | #include <kprefswidget.h> |
35 | #include <kio/kfile/kurlrequester.h> | ||
35 | #include <qmap.h> | 36 | #include <qmap.h> |
36 | 37 | ||
37 | #include "externalapphandler.h" | 38 | #include "externalapphandler.h" |
@@ -68,12 +69,16 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
68 | // void itemClicked( QListViewItem* ); | 69 | // void itemClicked( QListViewItem* ); |
69 | void client_changed( int newClient ); | 70 | void client_changed( int newClient ); |
70 | void externalapp_changed( int newApp ); | 71 | void externalapp_changed( int newApp ); |
72 | void saveStoreSettings(); | ||
73 | void setStandardStore(); | ||
71 | 74 | ||
72 | private: | 75 | private: |
73 | void setupExternalAppTab(); | 76 | void setupExternalAppTab(); |
74 | void setupLocaleDateTab(); | 77 | void setupLocaleDateTab(); |
75 | void setupLocaleTab(); | 78 | void setupLocaleTab(); |
76 | void setupTimeZoneTab(); | 79 | void setupTimeZoneTab(); |
80 | void setupStoreTab(); | ||
81 | KURLRequester* mStoreUrl; | ||
77 | 82 | ||
78 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); | 83 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); |
79 | 84 | ||