libactionwidget.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at>
3 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
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
23#include "libactionwidget.h"
24#include "widgetfactory.h"
25
26using namespace KFormDesigner;
27
29 : TDEToggleAction(w->name(), w->pixmap(), 0/*Key_F5*/, 0, 0 /*TQ_SLOT(slotWidget())*/,
30 c, TQString("library_widget_" + w->className()).latin1())
31{
32// kdDebug() << "LibActionWidget::LibActionWidget(): " << TQString("library_widget_" + w->className()).latin1() << endl;
33 m_className = w->className();
34 setExclusiveGroup("LibActionWidgets");
35 setToolTip(w->name());
36 setWhatsThis(w->description());
37// connect(this, TQ_SIGNAL(activated()), this, TQ_SLOT(slotWidget()));
38}
39
40void
42{
43 TDEToggleAction::slotActivated();
44 if (isChecked())
45 emit prepareInsert(m_className);
46}
47
48LibActionWidget::~LibActionWidget()
49{
50}
51
52#include "libactionwidget.moc"
virtual void slotActivated()
reimplemented from TDEToggleAction
LibActionWidget(WidgetInfo *, TDEActionCollection *collection)
LibActionWidget object is initialized to be mutually exclusive with all other LibActionWidget objects...
void prepareInsert(const TQCString &className)
emits a signal containing the class name
This class holds properties of widget classes provided by a factory.
type * findParent(TQObject *o, const char *className, TQObject *&prevPrev)