diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
commit | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch) | |
tree | 99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/dialogs/settings/ksettingsregister.cpp | |
download | kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.tar.gz kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.zip |
Added kmymoney
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/dialogs/settings/ksettingsregister.cpp')
-rw-r--r-- | kmymoney2/dialogs/settings/ksettingsregister.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/kmymoney2/dialogs/settings/ksettingsregister.cpp b/kmymoney2/dialogs/settings/ksettingsregister.cpp new file mode 100644 index 0000000..9f1fda2 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsregister.cpp @@ -0,0 +1,75 @@ +/*************************************************************************** + ksettingsregister.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * 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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <ktextedit.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsregister.h" +#include <kmymoney/transactionsortoption.h> + +KSettingsRegister::KSettingsRegister(QWidget* parent, const char* name) : + KSettingsRegisterDecl(parent, name) +{ + // hide the internally used text fields + kcfg_sortNormalView->hide(); + kcfg_sortReconcileView->hide(); + kcfg_sortSearchView->hide(); + + // setup connections, so that the sort optios get loaded once the edit fields are filled + connect(kcfg_sortNormalView, SIGNAL(textChanged()), this, SLOT(slotLoadNormal())); + connect(kcfg_sortReconcileView, SIGNAL(textChanged()), this, SLOT(slotLoadReconcile())); + connect(kcfg_sortSearchView, SIGNAL(textChanged()), this, SLOT(slotLoadSearch())); + + // setup connections, so that changes by the user are forwarded to the (hidden) edit fields + connect(m_sortNormalView, SIGNAL(settingsChanged(const QString&)), kcfg_sortNormalView, SLOT(setText(const QString&))); + connect(m_sortReconcileView, SIGNAL(settingsChanged(const QString&)), kcfg_sortReconcileView, SLOT(setText(const QString&))); + connect(m_sortSearchView, SIGNAL(settingsChanged(const QString&)), kcfg_sortSearchView, SLOT(setText(const QString&))); +} + +KSettingsRegister::~KSettingsRegister() +{ +} + +void KSettingsRegister::slotLoadNormal(void) +{ + // only need this once + disconnect(kcfg_sortNormalView, SIGNAL(textChanged()), this, SLOT(slotLoadNormal())); + m_sortNormalView->setSettings(kcfg_sortNormalView->text()); +} + +void KSettingsRegister::slotLoadReconcile(void) +{ + // only need this once + disconnect(kcfg_sortReconcileView, SIGNAL(textChanged()), this, SLOT(slotLoadReconcile())); + m_sortReconcileView->setSettings(kcfg_sortReconcileView->text()); +} + +void KSettingsRegister::slotLoadSearch(void) +{ + // only need this once + disconnect(kcfg_sortSearchView, SIGNAL(textChanged()), this, SLOT(slotLoadSearch())); + m_sortSearchView->setSettings(kcfg_sortSearchView->text()); +} + +#include "ksettingsregister.moc" |