[rkward-cvs] SF.net SVN: rkward: [2276] branches/KDE4_port/rkward/windows
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu Nov 29 22:38:15 UTC 2007
Revision: 2276
http://rkward.svn.sourceforge.net/rkward/?rev=2276&view=rev
Author: tfry
Date: 2007-11-29 14:38:15 -0800 (Thu, 29 Nov 2007)
Log Message:
-----------
Merge RKCommandEditorWindowPart into rkcommandeditorwindow.h/.cpp. Prepare adding block actions
Modified Paths:
--------------
branches/KDE4_port/rkward/windows/CMakeLists.txt
branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
branches/KDE4_port/rkward/windows/rkcommandeditorwindow.h
branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.rc
Removed Paths:
-------------
branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h
Modified: branches/KDE4_port/rkward/windows/CMakeLists.txt
===================================================================
--- branches/KDE4_port/rkward/windows/CMakeLists.txt 2007-11-28 14:42:02 UTC (rev 2275)
+++ branches/KDE4_port/rkward/windows/CMakeLists.txt 2007-11-29 22:38:15 UTC (rev 2276)
@@ -4,7 +4,6 @@
SET(windows_STAT_SRCS
rkcommandeditorwindow.cpp
- rkcommandeditorwindowpart.cpp
rkhtmlwindow.cpp
rcontrolwindow.cpp
detachedwindowcontainer.cpp
Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp 2007-11-28 14:42:02 UTC (rev 2275)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp 2007-11-29 22:38:15 UTC (rev 2276)
@@ -43,10 +43,11 @@
#include <kaction.h>
#include <kstandardaction.h>
#include <klibloader.h>
-#include <kiconloader.h>
+#include <kactioncollection.h>
#include "../misc/rkcommonfunctions.h"
#include "../misc/rkstandardicons.h"
+#include "../misc/rkstandardactions.h"
#include "../core/robjectlist.h"
#include "../settings/rksettings.h"
#include "../settings/rksettingsmodulecommandeditor.h"
@@ -54,10 +55,22 @@
#include "../rkglobals.h"
#include "../rkward.h"
#include "rkhelpsearchwindow.h"
-#include "rkcommandeditorwindowpart.h"
#include "../debug.h"
+RKCommandEditorWindowPart::RKCommandEditorWindowPart (QWidget *parent, RKCommandEditorWindow *editor_widget) : KParts::Part (parent) {
+ RK_TRACE (COMMANDEDITOR);
+
+ setComponentData (KGlobal::mainComponent ());
+ setWidget (parent);
+ setXMLFile ("rkcommandeditorwindowpart.rc");
+ editor_widget->initializeActions (actionCollection ());
+}
+
+RKCommandEditorWindowPart::~RKCommandEditorWindowPart () {
+ RK_TRACE (COMMANDEDITOR);
+}
+
#define GET_HELP_URL 1
RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, bool use_r_highlighting) : RKMDIWindow (parent, RKMDIWindow::CommandEditorWindow) {
@@ -120,6 +133,19 @@
delete m_doc;
}
+void RKCommandEditorWindow::initializeActions (KActionCollection* ac) {
+ RK_TRACE (COMMANDEDITOR);
+
+ action_run_all = RKStandardActions::runAll (ac, "run_all", this, SLOT (runAll()));
+ action_run_selection = RKStandardActions::runSelection (ac, "run_selection", this, SLOT (runSelection()));
+ action_run_line = RKStandardActions::runLine (ac, "run_line", this, SLOT (runLine()));
+
+ action_help_function = RKStandardActions::functionHelp (ac, "function_reference", this, SLOT (showHelp()));
+
+ QAction* action_configure = ac->addAction ("configure_commandeditor", this, SLOT (configure()));
+ action_configure->setText (i18n ("Configure Script Editor"));
+}
+
void RKCommandEditorWindow::focusIn (KTextEditor::View* v) {
RK_TRACE (COMMANDEDITOR);
RK_ASSERT (v == m_view);
Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindow.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindow.h 2007-11-28 14:42:02 UTC (rev 2275)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindow.h 2007-11-29 22:38:15 UTC (rev 2276)
@@ -33,8 +33,22 @@
class QCloseEvent;
class QFrame;
class QLabel;
+class QAction;
class RKCommandEditorWindow;
+class KActionCollection;
+/** This class provides a KPart interface to RKCommandEditorWindow. The reason to use this, is so the required menus/menu-items can be merged in on the fly.
+
+ at author Thomas Friedrichsmeier
+*/
+class RKCommandEditorWindowPart : public KParts::Part {
+protected:
+friend class RKCommandEditorWindow;
+ RKCommandEditorWindowPart (QWidget *parent, RKCommandEditorWindow *editor_widget);
+
+ ~RKCommandEditorWindowPart ();
+};
+
/** classes wishing to use RKFunctionArgHinter should derive from this, and implement provideContext () */
class RKScriptContextProvider {
public:
@@ -155,6 +169,8 @@
void runAll ();
/** invoke the settings page for the command editor */
void configure ();
+
+ void initializeActions (KActionCollection* ac);
protected:
/** reimplemented from KMdiChildView: give the editor window a chance to object to being closed (if unsaved) */
void closeEvent (QCloseEvent *e);
@@ -168,6 +184,12 @@
QTimer *completion_timer;
/** set syntax highlighting-mode to R syntax */
void setRHighlighting ();
+
+ QAction* action_run_all;
+ QAction* action_run_selection;
+ QAction* action_run_line;
+
+ QAction* action_help_function;
};
#endif
Deleted: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp 2007-11-28 14:42:02 UTC (rev 2275)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp 2007-11-29 22:38:15 UTC (rev 2276)
@@ -1,59 +0,0 @@
-/***************************************************************************
- rkeditordataframepart - description
- -------------------
- begin : Wed Sep 14 2005
- copyright : (C) 2005, 2007 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * 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 "rkcommandeditorwindowpart.h"
-
-#include <klocale.h>
-#include <kaction.h>
-#include <kactioncollection.h>
-#include <kxmlguifactory.h>
-
-#include "rkcommandeditorwindow.h"
-#include "../misc/rkstandardactions.h"
-#include "../debug.h"
-
-RKCommandEditorWindowPart::RKCommandEditorWindowPart (QWidget *parent, RKCommandEditorWindow *editor_widget) : KParts::Part (parent) {
- RK_TRACE (COMMANDEDITOR);
-
- setComponentData (KGlobal::mainComponent ());
-
- command_editor = editor_widget;
- setWidget (parent);
-
- setXMLFile ("rkcommandeditorwindowpart.rc");
-
- initializeActions ();
-}
-
-RKCommandEditorWindowPart::~RKCommandEditorWindowPart () {
- RK_TRACE (COMMANDEDITOR);
-}
-
-void RKCommandEditorWindowPart::initializeActions () {
- RK_TRACE (COMMANDEDITOR);
-
- runAll = RKStandardActions::runAll (actionCollection (), "run_all", command_editor, SLOT (runAll()));
- runSelection = RKStandardActions::runSelection (actionCollection (), "run_selection", command_editor, SLOT (runSelection()));
- runLine = RKStandardActions::runLine (actionCollection (), "run_line", command_editor, SLOT (runLine()));
-
- helpFunction = RKStandardActions::functionHelp (actionCollection (), "function_reference", command_editor, SLOT (showHelp()));
-
- QAction* configure = actionCollection ()->addAction ("configure_commandeditor", command_editor, SLOT (configure()));
- configure->setText (i18n ("Configure Script Editor"));
-}
-
-#include "rkcommandeditorwindowpart.moc"
Deleted: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h 2007-11-28 14:42:02 UTC (rev 2275)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.h 2007-11-29 22:38:15 UTC (rev 2276)
@@ -1,48 +0,0 @@
-/***************************************************************************
- rkeditordataframepart - description
- -------------------
- begin : Wed Sep 14 2005
- copyright : (C) 2005, 2007 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * 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. *
- * *
- ***************************************************************************/
-
-#ifndef RKCOMMANDEDITORWINDOWPART_H
-#define RKCOMMANDEDITORWINDOWPART_H
-
-#include <kparts/part.h>
-
-class RKCommandEditorWindow;
-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.
-
- at author Thomas Friedrichsmeier
-*/
-class RKCommandEditorWindowPart : public KParts::Part {
- Q_OBJECT
-public:
- RKCommandEditorWindowPart (QWidget *parent, RKCommandEditorWindow *editor_widget);
-
- ~RKCommandEditorWindowPart ();
-private:
- RKCommandEditorWindow *command_editor;
-
- void initializeActions ();
-// TODO: move these to RKCommandEditorWindow as well, disable runSelection, when there is no selection
- QAction* runAll;
- QAction* runSelection;
- QAction* runLine;
-
- QAction* helpFunction;
-};
-
-#endif
Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.rc
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.rc 2007-11-28 14:42:02 UTC (rev 2275)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.rc 2007-11-29 22:38:15 UTC (rev 2276)
@@ -28,10 +28,13 @@
</ToolBar>
<Menu name="ktexteditor_popup">
<Merge/>
+ <Action name="mark_block"/>
+ <Action name="unmark_block"/>
<Separator/>
<Menu name="run"><text>&Run</text>
<Action name="run_line"/>
<Action name="run_selection"/>
+ <Action name="run_block"/>
<Action name="run_all"/>
</Menu>
<Action name="function_reference"/>
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