From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/dialogs/settings/parseroptions.cpp | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 quanta/dialogs/settings/parseroptions.cpp (limited to 'quanta/dialogs/settings/parseroptions.cpp') diff --git a/quanta/dialogs/settings/parseroptions.cpp b/quanta/dialogs/settings/parseroptions.cpp new file mode 100644 index 00000000..0ad00d73 --- /dev/null +++ b/quanta/dialogs/settings/parseroptions.cpp @@ -0,0 +1,86 @@ +/*************************************************************************** + parseroptions.cpp - description + ------------------- + begin : Fri Aug 23 2002 + copyright : (C) 2002 by Andras Mantia + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; version 2 of the License. * + * * + ***************************************************************************/ + +#include "parseroptions.h" +#include "parseroptions.moc" +#include +#include + +#include +#include + +/* + * Constructs a ParserOptions which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +ParserOptions::ParserOptions( KConfig *a_config, QWidget* parent, const char* name ) + : ParserOptionsUI( parent, name ) +{ + config = a_config; + config->setGroup("Parser options"); + + QString handleLBM = config->readEntry("LBM", i18n("Find Tag & Open Tree")); + QString handleMBM = config->readEntry("MBM", i18n("Nothing")); + QString handleRBM = config->readEntry("RBM", i18n("Popup Menu")); + QString handleDoubleClick = config->readEntry("Double click", i18n("Select Tag Area")); + + + if ( !name ) + setName( "ParserOptions" ); + + if ( handleLBM == i18n("Find Tag & Open Tree") ) + { + comboLBM->setCurrentItem(1); + } + else + { + comboLBM->setCurrentItem(0); + } + + if ( handleMBM == i18n("Find Tag & Open Tree") ) comboMBM->setCurrentItem(0); + if ( handleMBM == i18n("Find Tag") ) comboMBM->setCurrentItem(1); + if ( handleMBM == i18n("Go to End of Tag") ) comboMBM->setCurrentItem(2); + if ( handleMBM == i18n("Select Tag Area") ) comboMBM->setCurrentItem(3); + if ( handleMBM == i18n("Nothing")) comboMBM->setCurrentItem(4); + + if ( handleDoubleClick == i18n("Select Tag Area") ) + { + comboDoubleClick->setCurrentItem(0); + } + else + { + comboDoubleClick->setCurrentItem(1); + } +} + +/* + * Destroys the object and frees any allocated resources + */ +ParserOptions::~ParserOptions() +{ + // no need to delete child widgets, Qt does it all for us +} + + +void ParserOptions::updateConfig() +{ + + config->setGroup("Parser options"); + + config->writeEntry("MBM",comboMBM->currentText()); + config->writeEntry("LBM",comboLBM->currentText()); + config->writeEntry("RBM",comboRBM->currentText()); + config->writeEntry("Double click",comboDoubleClick->currentText()); +} -- cgit v1.2.3