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
00020
00021 #include <kaction.h>
00022 #include <kicon.h>
00023 #include <klocale.h>
00024 #include <kactioncollection.h>
00025
00026 #include "knewstuff2/ui/knewstuffaction.h"
00027
00028 using namespace KNS;
00029
00030 KAction* KNS::standardAction(const QString& what,
00031 const QObject *recvr,
00032 const char *slot, KActionCollection* parent,
00033 const char *name)
00034 {
00035 QString data = what;
00036 if (data.isEmpty()) {
00037 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...");
00038 }
00039 KAction *action = new KAction(data, parent);
00040 parent->addAction(name, action);
00041 action->setIcon(KIcon("get-hot-new-stuff"));
00042 QObject::connect(action, SIGNAL(triggered(bool)), recvr, slot);
00043
00044 return action;
00045 }
00046