okular/optionDialogFontsWidget.cpp
Stefan Kebekus bc3b74b17a make the option dialog more modular, for future interaction with kviewshell
svn path=/trunk/kdegraphics/kdvi/; revision=203637
2003-01-29 21:23:55 +00:00

58 lines
1.6 KiB
C++

// optionDiologWidget.cpp
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
//
// (C) 2003 Stefan Kebekus
// Distributed under the GPL
// Add header files alphabetically
#include <kdebug.h>
#include <kconfig.h>
#include <kcombobox.h>
#include <kinstance.h>
#include <klocale.h>
#include <qcheckbox.h>
#include "fontpool.h"
#include "optionDialogFontsWidget.h"
// Constructs a optionDialogWidget_base which is a child of 'parent', with
// the name 'name' and widget flags set to 'f'.
optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char* name, WFlags fl )
: optionDialogFontsWidget_base( parent, name, fl )
{
instance = 0;
config = 0;
instance = new KInstance("kdvi");
config = instance->config();
// Important! The default values here must be the same as in kdvi_multipage.cpp
for(int i=0; i<NumberOfMFModes; i++)
metafontMode->insertItem(QString("%1 dpi / %2").arg(MFResolutions[i]).arg(MFModenames[i]));
config->setGroup("kdvi");
metafontMode->setCurrentItem( config->readNumEntry( "MetafontMode" , DefaultMFMode ));
fontGenerationCheckBox->setChecked( config->readBoolEntry( "MakePK", true ) );
}
optionDialogFontsWidget::~optionDialogFontsWidget()
{
if (config != 0L)
delete config;
if (instance != 0L)
delete instance;
}
void optionDialogFontsWidget::apply(void)
{
config->setGroup("kdvi");
config->writeEntry( "MetafontMode", metafontMode->currentItem() );
config->writeEntry( "MakePK", fontGenerationCheckBox->isChecked() );
config->sync();
}
#include "optionDialogFontsWidget.moc"