kexi
libactionwidget.cpp
00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at> 00003 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl> 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 00023 #include "libactionwidget.h" 00024 #include "widgetfactory.h" 00025 00026 using namespace KFormDesigner; 00027 00028 LibActionWidget::LibActionWidget(WidgetInfo *w, KActionCollection *c) 00029 : KToggleAction(w->name(), w->pixmap(), 0/*Key_F5*/, 0, 0 /*SLOT(slotWidget())*/, 00030 c, QString("library_widget_" + w->className()).latin1()) 00031 { 00032 // kdDebug() << "LibActionWidget::LibActionWidget(): " << QString("library_widget_" + w->className()).latin1() << endl; 00033 m_className = w->className(); 00034 setExclusiveGroup("LibActionWidgets"); 00035 setToolTip(w->name()); 00036 setWhatsThis(w->description()); 00037 // connect(this, SIGNAL(activated()), this, SLOT(slotWidget())); 00038 } 00039 00040 void 00041 LibActionWidget::slotActivated() 00042 { 00043 KToggleAction::slotActivated(); 00044 if (isChecked()) 00045 emit prepareInsert(m_className); 00046 } 00047 00048 LibActionWidget::~LibActionWidget() 00049 { 00050 } 00051 00052 #include "libactionwidget.moc"