author | zautrix <zautrix> | 2005-04-15 20:51:58 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-15 20:51:58 (UTC) |
commit | 85bdc33419eef0ffa9f00eb7222944518fe39b6c (patch) (side-by-side diff) | |
tree | 57000de41f5e29c5ebd07f3ed2951a7b89730fb1 /libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |
parent | e1d62b2afac2b625a3e0b8d4df137647de34e04f (diff) | |
download | kdepimpi-85bdc33419eef0ffa9f00eb7222944518fe39b6c.zip kdepimpi-85bdc33419eef0ffa9f00eb7222944518fe39b6c.tar.gz kdepimpi-85bdc33419eef0ffa9f00eb7222944518fe39b6c.tar.bz2 |
fixxx
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 759b29d..753d90a 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -28,193 +28,193 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ #include <qlayout.h> #include <qtabwidget.h> #include <qcombobox.h> #include <qgroupbox.h> #include <qlabel.h> #include <qlineedit.h> #include <qbuttongroup.h> #include <qfile.h> #include <qvbox.h> #include <qdir.h> #include <qregexp.h> #include <kdialog.h> #include <kprefsdialog.h> #include <klocale.h> #include <kdateedit.h> #include <kglobal.h> #include <stdlib.h> /*US #include <qcheckbox.h> #include <qframe.h> #include <qpushbutton.h> #include <qcombobox.h> #include <qlineedit.h> #include <qlabel.h> #include <qfile.h> #include <kconfig.h> #include <kdebug.h> #include <kdialog.h> #include <klistview.h> #include <klocale.h> #include <kglobal.h> #include <kmessagebox.h> #include <kstandarddirs.h> #ifndef KAB_EMBEDDED #include <ktrader.h> #else // KAB_EMBEDDED #include <mergewidget.h> #include <distributionlistwidget.h> #endif // KAB_EMBEDDED #include "addresseewidget.h" #include "extensionconfigdialog.h" #include "extensionwidget.h" */ #include "qapplication.h" #include "kpimglobalprefs.h" #include "kdepimconfigwidget.h" #include <kprefs.h> #include <kmessagebox.h> KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) : KPrefsWidget(prefs, parent, name ) { mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); tabWidget = new QTabWidget( this ); topLayout->addWidget( tabWidget ); setupLocaleTab(); setupLocaleDateTab(); setupTimeZoneTab(); setupExternalAppTab(); setupStoreTab(); } void KDEPIMConfigWidget::showTimeZoneTab() { tabWidget->setCurrentPage ( 3 ) ; } void KDEPIMConfigWidget::setupStoreTab() { QVBox *colorPage = new QVBox( this ); tabWidget->addTab( colorPage, i18n( "Colors" ) ); QWidget* cw = new QWidget( colorPage ); KPrefsWidColor *holidayColor = - addWidColor(i18n("Alternate background"), + addWidColor(i18n("Alternating background of list views"), &(KPimGlobalPrefs::instance()->mAlternateColor),cw); QHBoxLayout *topLayout = new QHBoxLayout(cw); topLayout->addWidget(holidayColor->label()); topLayout->addWidget( (QWidget* )holidayColor->button()); QVBox *storePage = new QVBox( this ); 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 ); new QLabel( i18n("<b>New data storage dir:</b>"), 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; if ( QApplication::desktop()->width() < 640 ) pb = new QPushButton ( i18n("Save"), bb ); else pb = new QPushButton ( i18n("Save settings"), bb ); 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("<b>New settings are used\nafter a restart</b>"), 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 <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() { mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); saveStoreSettings(); } void KDEPIMConfigWidget::saveStoreSettings() { if ( !mStoreUrl->url().isEmpty() ) { QString path = QDir::homeDirPath(); QString url = mStoreUrl->url(); #ifdef DESKTOP_VERSION if ( url.startsWith( "LOCAL:" ) ) { path = qApp->applicationDirPath () ; } #endif KConfig cfg ( path + "/.microkdehome" ); cfg.setGroup("Global"); cfg.writeEntry( "MICROKDEHOME", url ); qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); cfg.sync(); } else { mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); saveStoreSettings(); } } void KDEPIMConfigWidget::setupExternalAppTab() { QWidget *externalAppsPage = new QWidget( this ); QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); mExternalApps = new QComboBox( externalAppsPage ); QMap<ExternalAppHandler::Types, QString>::Iterator it; for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) mExternalApps->insertItem( it.data(), it.key() ); layout->addWidget( mExternalApps ); connect( mExternalApps, SIGNAL( activated( int ) ), this, SLOT (externalapp_changed( int ) ) ); mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); mExternalAppGroupBox->layout()->setMargin(4); |