kformula

kfconfig.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
3 Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#include <kdebug.h>
22#include <kiconloader.h>
23#include <tdeinstance.h>
24#include <tdelocale.h>
25
26#include "kfconfig.h"
27#include "kformula_factory.h"
28#include "kformula_doc.h"
29#include "kformula_view.h"
30
31
32KFConfig::KFConfig( KFormulaPartView* parent )
33 : KDialogBase( KDialogBase::IconList, i18n( "Configure KFormula" ),
34 KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel | KDialogBase::Default,
35 KDialogBase::Ok, parent )
36{
37 //kdDebug( 40000 ) << "KFConfig::KFConfig" << endl;
38 TQVBox* page1 = addVBoxPage( i18n( "Formula" ), i18n( "Formula Settings" ),
39 BarIcon( "kformula", TDEIcon::SizeMedium ) );
40 _page = new KFormula::ConfigurePage( parent->document()->getDocument(), this,
41 KFormulaFactory::global()->config(),
42 page1 );
43// TQVBox* page2 = addVBoxPage( i18n( "Math Fonts" ), i18n( "Math Fonts Settings" ),
44// BarIcon( "kformula", TDEIcon::SizeMedium ) );
45// _mathFontPage = new KFormula::MathFontsConfigurePage( parent->document()->getDocument(), this,
46// KFormulaFactory::global()->config(),
47// page2 );
48
49 connect( this, TQ_SIGNAL( okClicked() ), this, TQ_SLOT( slotApply() ) );
50}
51
52void KFConfig::slotApply()
53{
54// _mathFontPage->apply();
55
56 // The "normal" page triggers the recalc and must be called last
57 // for this reason.
58 _page->apply();
59}
60
61void KFConfig::slotDefault()
62{
63 switch(activePageIndex())
64 {
65 case 0:
66 _page->slotDefault();
67 break;
68// case 1:
69// _mathFontPage->slotDefault();
70// break;
71 default:
72 break;
73 }
74}
75
76#include "kfconfig.moc"
The parts view.