2 This file is part of Kig, a KDE program for Interactive Geometry...
3 Copyright (C) 2004 Dominique Devriese <devriese@kde.org>
4 Copyright (C) 2004 Pino Toscano <toscano.pino@tiscali.it>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 #include "edittype.moc"
26 #include <kapplication.h>
27 #include <kicondialog.h>
28 #include <klineedit.h>
30 #include <kmessagebox.h>
31 #include <kpushbutton.h>
32 #include <kstdguiitem.h>
34 EditType::EditType( QWidget
* parent
, QString name
, QString desc
, QString icon
)
35 : EditTypeBase( parent
, "edittype", true ), mname( name
), mdesc( desc
), micon( icon
)
37 // improving GUI look'n'feel...
38 buttonHelp
->setGuiItem( KStdGuiItem::help() );
39 buttonOk
->setGuiItem( KStdGuiItem::ok() );
40 buttonCancel
->setGuiItem( KStdGuiItem::cancel() );
42 editName
->setText( mname
);
43 editDescription
->setText( mdesc
);
44 typeIcon
->setIcon( !micon
.isEmpty() ? micon
: "gear" );
51 void EditType::helpSlot()
53 kapp
->invokeHelp( QString::fromLatin1( "working-with-types" ),
54 QString::fromLatin1( "kig" ) );
57 void EditType::okSlot()
59 QString tmp
= editName
->text();
62 KMessageBox::information( this, i18n( "The name of the macro can not be empty." ) );
66 bool namechanged
= false;
67 bool descchanged
= false;
68 bool iconchanged
= false;
74 tmp
= editDescription
->text();
80 tmp
= typeIcon
->icon();
86 done( namechanged
|| descchanged
|| iconchanged
);
89 void EditType::cancelSlot()
94 const QString
EditType::name() const
99 const QString
EditType::description() const
104 const QString
EditType::icon() const