kformula

kfconfig.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
00003                   Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include <kdebug.h>
00022 #include <kiconloader.h>
00023 #include <kinstance.h>
00024 #include <klocale.h>
00025 
00026 #include "kfconfig.h"
00027 #include "kformula_factory.h"
00028 #include "kformula_doc.h"
00029 #include "kformula_view.h"
00030 
00031 
00032 KFConfig::KFConfig( KFormulaPartView* parent )
00033     : KDialogBase( KDialogBase::IconList, i18n( "Configure KFormula" ),
00034                    KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel | KDialogBase::Default,
00035                    KDialogBase::Ok, parent )
00036 {
00037     //kdDebug( 40000 ) << "KFConfig::KFConfig" << endl;
00038     QVBox* page1 = addVBoxPage( i18n( "Formula" ), i18n( "Formula Settings" ),
00039                                BarIcon( "kformula", KIcon::SizeMedium ) );
00040     _page = new KFormula::ConfigurePage( parent->document()->getDocument(), this,
00041                                          KFormulaFactory::global()->config(),
00042                                          page1 );
00043 //     QVBox* page2 = addVBoxPage( i18n( "Math Fonts" ), i18n( "Math Fonts Settings" ),
00044 //                                BarIcon( "kformula", KIcon::SizeMedium ) );
00045 //     _mathFontPage = new KFormula::MathFontsConfigurePage( parent->document()->getDocument(), this,
00046 //                                          KFormulaFactory::global()->config(),
00047 //                                          page2 );
00048 
00049     connect( this, SIGNAL( okClicked() ), this, SLOT( slotApply() ) );
00050 }
00051 
00052 void KFConfig::slotApply()
00053 {
00054 //     _mathFontPage->apply();
00055 
00056     // The "normal" page triggers the recalc and must be called last
00057     // for this reason.
00058     _page->apply();
00059 }
00060 
00061 void KFConfig::slotDefault()
00062 {
00063     switch(activePageIndex())
00064     {
00065     case 0:
00066         _page->slotDefault();
00067         break;
00068 //     case 1:
00069 //         _mathFontPage->slotDefault();
00070 //         break;
00071     default:
00072         break;
00073     }
00074 }
00075 
00076 #include "kfconfig.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys