summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index bbed38d..5cd845e 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -114,68 +114,75 @@ void KDEPIMConfigWidget::showTimeZoneTab()
114{ 114{
115 tabWidget->setCurrentPage ( 3 ) ; 115 tabWidget->setCurrentPage ( 3 ) ;
116} 116}
117void KDEPIMConfigWidget::setupStoreTab() 117void KDEPIMConfigWidget::setupStoreTab()
118{ 118{
119 QVBox *storePage = new QVBox( this ); 119 QVBox *storePage = new QVBox( this );
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 ); 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("<b>New data storage dir:</b>"), storePage ); 121 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
122 mStoreUrl = new KURLRequester( storePage ); 122 mStoreUrl = new KURLRequester( storePage );
123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
124 new QLabel( i18n("New dirs are created automatically"), storePage ); 124 new QLabel( i18n("New dirs are created automatically"), storePage );
125 QHBox *bb = new QHBox( storePage ); 125 QHBox *bb = new QHBox( storePage );
126 QPushButton * pb; 126 QPushButton * pb;
127 if ( QApplication::desktop()->width() < 640 ) 127 if ( QApplication::desktop()->width() < 640 )
128 pb = new QPushButton ( i18n("Save"), bb ); 128 pb = new QPushButton ( i18n("Save"), bb );
129 else 129 else
130 pb = new QPushButton ( i18n("Save settings"), bb ); 130 pb = new QPushButton ( i18n("Save settings"), bb );
131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
132 pb = new QPushButton ( i18n("Save standard"), bb ); 132 pb = new QPushButton ( i18n("Save standard"), bb );
133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 134 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 ); 135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
136 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 136 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
137} 137}
138void KDEPIMConfigWidget::setStandardStore() 138void KDEPIMConfigWidget::setStandardStore()
139{ 139{
140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
141 saveStoreSettings(); 141 saveStoreSettings();
142} 142}
143void KDEPIMConfigWidget::saveStoreSettings() 143void KDEPIMConfigWidget::saveStoreSettings()
144{ 144{
145 if ( !mStoreUrl->url().isEmpty() ) { 145 if ( !mStoreUrl->url().isEmpty() ) {
146 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); 146 QString path = QDir::homeDirPath();
147 QString url = mStoreUrl->url();
148#ifdef DESKTOP_VERSION
149 if ( url.startsWith( "LOCAL:" ) ) {
150 path = qApp->applicationDirPath () ;
151 }
152#endif
153 KConfig cfg ( path + "/.microkdehome" );
147 cfg.setGroup("Global"); 154 cfg.setGroup("Global");
148 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); 155 cfg.writeEntry( "MICROKDEHOME", url );
149 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); 156 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
150 cfg.sync(); 157 cfg.sync();
151 } else { 158 } else {
152 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 159 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
153 saveStoreSettings(); 160 saveStoreSettings();
154 } 161 }
155} 162}
156void KDEPIMConfigWidget::setupExternalAppTab() 163void KDEPIMConfigWidget::setupExternalAppTab()
157{ 164{
158 QWidget *externalAppsPage = new QWidget( this ); 165 QWidget *externalAppsPage = new QWidget( this );
159 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 166 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
160 KDialog::spacingHintSmall() ); 167 KDialog::spacingHintSmall() );
161 168
162 mExternalApps = new QComboBox( externalAppsPage ); 169 mExternalApps = new QComboBox( externalAppsPage );
163 170
164 QMap<ExternalAppHandler::Types, QString>::Iterator it; 171 QMap<ExternalAppHandler::Types, QString>::Iterator it;
165 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 172 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
166 mExternalApps->insertItem( it.data(), it.key() ); 173 mExternalApps->insertItem( it.data(), it.key() );
167 174
168 layout->addWidget( mExternalApps ); 175 layout->addWidget( mExternalApps );
169 176
170 connect( mExternalApps, SIGNAL( activated( int ) ), 177 connect( mExternalApps, SIGNAL( activated( int ) ),
171 this, SLOT (externalapp_changed( int ) ) ); 178 this, SLOT (externalapp_changed( int ) ) );
172 179
173 180
174 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 181 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
175 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 182 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
176 mExternalAppGroupBox->layout()->setMargin(5); 183 mExternalAppGroupBox->layout()->setMargin(5);
177 184
178 mClient = new QComboBox( mExternalAppGroupBox ); 185 mClient = new QComboBox( mExternalAppGroupBox );
179 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 186 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
180 187
181 connect( mClient, SIGNAL( activated( int ) ), 188 connect( mClient, SIGNAL( activated( int ) ),