[rkward-cvs] SF.net SVN: rkward: [2046] branches/KDE4_port/rkward/windows
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Fri Oct 12 13:46:08 UTC 2007
Revision: 2046
http://rkward.svn.sourceforge.net/rkward/?rev=2046&view=rev
Author: tfry
Date: 2007-10-12 06:46:07 -0700 (Fri, 12 Oct 2007)
Log Message:
-----------
File number 2 compiles (mostly KAction changes)
Modified Paths:
--------------
branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h
Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp 2007-10-12 13:25:21 UTC (rev 2045)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp 2007-10-12 13:46:07 UTC (rev 2046)
@@ -17,13 +17,11 @@
#include "rkcommandeditorwindowpart.h"
-#include <kinstance.h>
#include <klocale.h>
#include <kaction.h>
+#include <kactioncollection.h>
#include <kxmlguifactory.h>
-#include <q3popupmenu.h>
-
#include "rkcommandeditorwindow.h"
#include "../misc/rkcommonfunctions.h"
#include "../debug.h"
@@ -31,8 +29,7 @@
RKCommandEditorWindowPart::RKCommandEditorWindowPart (QWidget *parent, RKCommandEditorWindow *editor_widget) : KParts::Part (parent) {
RK_TRACE (COMMANDEDITOR);
- KInstance* instance = new KInstance ("rkward");
- setInstance (instance);
+ setComponentData (KGlobal::mainComponent ());
command_editor = editor_widget;
@@ -48,11 +45,24 @@
void RKCommandEditorWindowPart::initializeActions () {
RK_TRACE (COMMANDEDITOR);
- runAll = new KAction (i18n ("Run all"), QIcon (RKCommonFunctions::getRKWardDataDir () + "icons/run_all.png"), KShortcut ("F9"), command_editor, SLOT (runAll()), actionCollection (), "run_all");
- runSelection = new KAction (i18n ("Run selection"), QIcon (RKCommonFunctions::getRKWardDataDir () + "icons/run_selection.png"), KShortcut ("F8"), command_editor, SLOT (runSelection()), actionCollection (), "run_selection");
- runLine = new KAction (i18n ("Run current line"), QIcon (RKCommonFunctions::getRKWardDataDir () + "icons/run_line.png"), KShortcut ("Ctrl+L"), command_editor, SLOT (runLine()), actionCollection (), "run_line");
+ runAll = actionCollection ()->addAction ("run_all", command_editor, SLOT (runAll()));
+ runAll->setText (i18n ("Run all"));
+ runAll->setIcon (QIcon (RKCommonFunctions::getRKWardDataDir () + "icons/run_all.png"));
+ runAll->setShortcut (Qt::Key_F9);
- helpFunction = new KAction (i18n ("&Function reference"), KShortcut ("F2"), command_editor, SLOT (showHelp()), actionCollection (), "function_reference");
+ runSelection = actionCollection ()->addAction ("run_selection", command_editor, SLOT (runSelection()));
+ runSelection->setText (i18n ("Run selection"));
+ runSelection->setIcon (QIcon (RKCommonFunctions::getRKWardDataDir () + "icons/run_selection.png"));
+ runSelection->setShortcut (Qt::Key_F9);
+
+ runLine = actionCollection ()->addAction ("run_line", command_editor, SLOT (runLine()));
+ runLine->setText (i18n ("Run current line"));
+ runLine->setIcon (QIcon (RKCommonFunctions::getRKWardDataDir () + "icons/run_line.png"));
+ runLine->setShortcut (Qt::ControlModifier + Qt::Key_L);
+
+ helpFunction = actionCollection ()->addAction ("function_reference", command_editor, SLOT (showHelp()));
+ helpFunction->setText (i18n ("&Function reference"));
+ helpFunction->setShortcut (Qt::Key_F2);
}
#include "rkcommandeditorwindowpart.moc"
Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h 2007-10-12 13:25:21 UTC (rev 2045)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h 2007-10-12 13:46:07 UTC (rev 2046)
@@ -21,7 +21,7 @@
#include <kparts/part.h>
class RKCommandEditorWindow;
-class KAction;
+class QAction;
/** This class provides a KPart interface to RKCommandEditorWindow. Basically, it is responsible for creating the menu-entries the RKCommandEditorWindow provides, and keeps the corresponding Actions. The reason to use this, is so the required menus/menu-items can be merged in on the fly.
@@ -38,11 +38,11 @@
void initializeActions ();
// TODO: move these to RKCommandEditorWindow as well, disable runSelection, when there is no selection
- KAction* runAll;
- KAction* runSelection;
- KAction* runLine;
+ QAction* runAll;
+ QAction* runSelection;
+ QAction* runLine;
- KAction* helpFunction;
+ QAction* helpFunction;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list