4 Copyright (c) 2004 by Duncan Mac-Vicar Prett <duncan@kde.org>
6 Kopete (c) 2001-2004 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 *************************************************************************
20 #include <kparts/componentfactory.h>
22 #include <kgenericfactory.h>
24 #include <knuminput.h>
26 #include "latexplugin.h"
27 #include "latexconfig.h"
28 #include "ui_latexprefsbase.h"
29 #include "latexpreferences.h"
31 K_PLUGIN_FACTORY(LatexPreferencesFactory
, registerPlugin
<LatexPreferences
>();)
32 K_EXPORT_PLUGIN(LatexPreferencesFactory( "kcm_kopete_latex" ))
35 LatexPreferences::LatexPreferences(QWidget
*parent
, const QVariantList
&args
)
36 : KCModule(LatexPreferencesFactory::componentData(), parent
, args
)
38 QVBoxLayout
* l
= new QVBoxLayout( this );
39 QWidget
* w
= new QWidget
;
40 m_preferencesDialog
= new Ui::LatexPrefsUI
;
41 m_preferencesDialog
->setupUi( w
);
44 // connect widget signals here
45 m_preferencesDialog
->horizontalDPI
->setMinimum(1);
46 m_preferencesDialog
->verticalDPI
->setMinimum(1);
48 connect(m_preferencesDialog
->horizontalDPI
, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
49 connect(m_preferencesDialog
->verticalDPI
, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
54 LatexPreferences::~LatexPreferences()
56 delete m_preferencesDialog
;
59 void LatexPreferences::load()
61 LatexConfig::self()->readConfig();
63 m_preferencesDialog
->horizontalDPI
->setValue(LatexConfig::self()->horizontalDPI());
64 m_preferencesDialog
->verticalDPI
->setValue(LatexConfig::self()->verticalDPI());
65 emit
KCModule::changed(false);
68 void LatexPreferences::slotModified()
70 emit
KCModule::changed(true);
73 void LatexPreferences::save()
75 LatexConfig::self()->setHorizontalDPI(m_preferencesDialog
->horizontalDPI
->value());
76 LatexConfig::self()->setVerticalDPI(m_preferencesDialog
->verticalDPI
->value());
77 LatexConfig::self()->writeConfig();
78 emit
KCModule::changed(false);
81 #include "latexpreferences.moc"
83 // vim: set noet ts=4 sts=4 sw=4: