From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- buildtools/autotools/autotoolsaction.cpp | 156 +++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 buildtools/autotools/autotoolsaction.cpp (limited to 'buildtools/autotools/autotoolsaction.cpp') diff --git a/buildtools/autotools/autotoolsaction.cpp b/buildtools/autotools/autotoolsaction.cpp new file mode 100644 index 00000000..63b38762 --- /dev/null +++ b/buildtools/autotools/autotoolsaction.cpp @@ -0,0 +1,156 @@ +/* + KDevelop Autotools Support + Copyright (c) 2005 by Matt Rogers + + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + *************************************************************************** +*/ +#include "autotoolsaction.h" + +#include +#include +#include +#include +#include +#include + +AutoToolsAction::~AutoToolsAction() +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const KShortcut& cut, + const QObject* receiver, const char* slot, + KActionCollection* parent, const char* name ) +: KAction( text, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const QIconSet& pix, const KShortcut& cut, + const QObject* receiver, const char* slot, + KActionCollection* parent, const char* name ) +: KAction( text, pix, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const QString& pix, const KShortcut& cut, + const QObject* receiver, const char* slot, + KActionCollection* parent, const char* name ) +: KAction( text, pix, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const KGuiItem& item, const KShortcut & cut, + const QObject* receiver, const char* slot, + KActionCollection* parent, const char* name ) +: KAction( item, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const KShortcut& cut, + QObject* parent, const char* name ) +: KAction( text, cut, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const KShortcut& cut, + const QObject* receiver, const char* slot, + QObject* parent, const char* name ) +: KAction( text, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const QIconSet& pix, + const KShortcut& cut, QObject* parent, const char* name ) +: KAction( text, pix, cut, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const QString& pix, + const KShortcut& cut, QObject* parent, const char* name ) +: KAction( text, pix, cut, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const QIconSet& pix, + const KShortcut& cut, const QObject* receiver, + const char* slot, QObject* parent, const char * name ) +: KAction( text, pix, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( const QString& text, const QString& pix, + const KShortcut & cut, const QObject* receiver, + const char* slot, QObject* parent, const char * name ) +: KAction( text, pix, cut, receiver, slot, parent, name ) +{ +} + +AutoToolsAction::AutoToolsAction( QObject * parent, const char * name ) +: KAction( parent, name ) +{ +} + +int AutoToolsAction::plug( QWidget* w, int index ) +{ + if ( !w ) { + kdWarning(129) << "KAction::plug called with 0 argument\n"; + return -1; + } + + // Check if action is permitted + if (kapp && !kapp->authorizeKAction(name())) + return -1; + + if ( ::qt_cast( w ) ) + { + QToolButton* tb = static_cast( w ); + connect( tb, SIGNAL( clicked() ), this, SLOT( activate() ) ); + int id = getToolButtonID(); + + if ( !icon().isEmpty() ) + tb->setPixmap( SmallIcon( icon() ) ); + else + tb->setText( text() ); + + if ( !isEnabled() ) + tb->setEnabled( false ); + + if ( !whatsThis().isEmpty() ) + { + QWhatsThis::remove( tb ); + QWhatsThis::add( tb, whatsThisWithIcon() ); + } + + if ( !toolTip().isEmpty() ) + { + QToolTip::remove( tb ); + QToolTip::add( tb, toolTip() ); + } + + addContainer( tb, id ); + + return containerCount() - 1; + } + + return KAction::plug( w, index ); +} + +void AutoToolsAction::updateEnabled( int i ) +{ + QWidget* w = container( i ); + + if ( ::qt_cast( w ) ) + static_cast( w )->setEnabled( isEnabled() ); + else + KAction::updateEnabled( i ) ; +} + + + +//kate: indent-mode csands; tab-width 4; -- cgit v1.2.3