KNewStuff
knewstuffaction.cpp
Go to the documentation of this file.
00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 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 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #include "knewstuffaction.h" 00020 00021 #include <kaction.h> 00022 #include <klocale.h> 00023 #include <kactioncollection.h> 00024 00025 using namespace KNS3; 00026 00027 KAction *KNS3::standardAction(const QString &what, 00028 const QObject *receiver, 00029 const char *slot, KActionCollection *parent, 00030 const char *name) 00031 { 00032 KAction *action = new KAction(what, parent); 00033 parent->addAction(QString(name), action); 00034 action->setIcon(KIcon("get-hot-new-stuff")); 00035 QObject::connect(action, SIGNAL(triggered(bool)), receiver, slot); 00036 00037 return action; 00038 } 00039 00040 KAction *KNS3::standardActionUpload(const QString &what, 00041 const QObject *receiver, 00042 const char *slot, KActionCollection *parent, 00043 const char *name) 00044 { 00045 KAction *action = new KAction(what, parent); 00046 parent->addAction(QString(name), action); 00047 // FIXME: Get a specific upload icon! 00048 action->setIcon(KIcon("get-hot-new-stuff")); 00049 QObject::connect(action, SIGNAL(triggered(bool)), receiver, slot); 00050 00051 return action; 00052 }
KDE 4.6 API Reference