KNewStuff
knewstuffaction.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <kaction.h>
00020 #include <kicon.h>
00021 #include <klocale.h>
00022 #include <kactioncollection.h>
00023
00024 #include "knewstuff2/ui/knewstuffaction.h"
00025
00026 using namespace KNS;
00027
00028 KAction* KNS::standardAction(const QString& what,
00029 const QObject *recvr,
00030 const char *slot, KActionCollection* parent,
00031 const char *name)
00032 {
00033 QString data = what;
00034 if (data.isEmpty()) {
00035 data = i18nc("Hot new stuff offers to Download New Data. Apps can fill in an individual string here, but Data is the default. This is in an action that gets displayed in the menu or toolbar for example.", "Download New Data...");
00036 }
00037 KAction *action = new KAction(data, parent);
00038 parent->addAction(name, action);
00039 action->setIcon(KIcon("get-hot-new-stuff"));
00040 QObject::connect(action, SIGNAL(triggered(bool)), recvr, slot);
00041
00042 return action;
00043 }
00044