diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/plugins/latex/latexpreferences.cpp | |
download | tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip |
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/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/latex/latexpreferences.cpp')
-rw-r--r-- | kopete/plugins/latex/latexpreferences.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/kopete/plugins/latex/latexpreferences.cpp b/kopete/plugins/latex/latexpreferences.cpp new file mode 100644 index 00000000..1727ae49 --- /dev/null +++ b/kopete/plugins/latex/latexpreferences.cpp @@ -0,0 +1,76 @@ +/* + Kopete Latex Plugin + + Copyright (c) 2004 by Duncan Mac-Vicar Prett <duncan@kde.org> + + Kopete (c) 2001-2004 by the Kopete developers <kopete-devel@kde.org> + + ************************************************************************* + * * + * 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. * + * * + ************************************************************************* +*/ + +#include <qlayout.h> +#include <kparts/componentfactory.h> +#include <klocale.h> +#include <kgenericfactory.h> +#include <kdebug.h> +#include <knuminput.h> + +#include "latexplugin.h" +#include "latexconfig.h" +#include "latexprefsbase.h" +#include "latexpreferences.h" + +typedef KGenericFactory<LatexPreferences> LatexPreferencesFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_kopete_latex, LatexPreferencesFactory( "kcm_kopete_latex" ) ) + +LatexPreferences::LatexPreferences(QWidget *parent, const char* /*name*/, const QStringList &args) + : KCModule(LatexPreferencesFactory::instance(), parent, args) +{ + ( new QVBoxLayout( this ) )->setAutoAdd( true ); + m_preferencesDialog = new LatexPrefsUI(this); + // connect widget signals here + m_preferencesDialog->horizontalDPI->setMinValue(1); + m_preferencesDialog->verticalDPI->setMinValue(1); + + connect(m_preferencesDialog->horizontalDPI, SIGNAL(valueChanged(int)), this, SLOT(slotModified())); + connect(m_preferencesDialog->verticalDPI, SIGNAL(valueChanged(int)), this, SLOT(slotModified())); + + load(); +} + +LatexPreferences::~LatexPreferences() +{ +} + +void LatexPreferences::load() +{ + LatexConfig::self()->readConfig(); + // load widgets here + m_preferencesDialog->horizontalDPI->setValue(LatexConfig::self()->horizontalDPI()); + m_preferencesDialog->verticalDPI->setValue(LatexConfig::self()->verticalDPI()); + emit KCModule::changed(false); +} + +void LatexPreferences::slotModified() +{ + emit KCModule::changed(true); +} + +void LatexPreferences::save() +{ + LatexConfig::self()->setHorizontalDPI(m_preferencesDialog->horizontalDPI->value()); + LatexConfig::self()->setVerticalDPI(m_preferencesDialog->verticalDPI->value()); + LatexConfig::self()->writeConfig(); + emit KCModule::changed(false); +} + +#include "latexpreferences.moc" + +// vim: set noet ts=4 sts=4 sw=4: |