[rkward-cvs] SF.net SVN: rkward: [1959] trunk/rkward/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Mon Sep 17 15:09:41 UTC 2007
Revision: 1959
http://rkward.svn.sourceforge.net/rkward/?rev=1959&view=rev
Author: tfry
Date: 2007-09-17 08:09:41 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
Make filesystem browser tool window toggleable via shortcut
Modified Paths:
--------------
trunk/rkward/rkward/rkward.cpp
trunk/rkward/rkward/windows/rkfilebrowser.cpp
trunk/rkward/rkward/windows/rkfilebrowser.h
trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp
trunk/rkward/rkward/windows/rktoplevelwindowgui.h
trunk/rkward/rkward/windows/rktoplevelwindowgui.rc
Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp 2007-09-17 13:57:46 UTC (rev 1958)
+++ trunk/rkward/rkward/rkward.cpp 2007-09-17 15:09:41 UTC (rev 1959)
@@ -214,10 +214,10 @@
RObjectBrowser::mainBrowser ()->setToolWrapper (addToolWindow(RObjectBrowser::mainBrowser (), KDockWidget::DockLeft, getMainDockWidget(), 30, i18n ("Existing objects in your workspace."), i18n ("Workspace")));
RKWorkplace::mainWorkplace ()->registerToolWindow (RObjectBrowser::mainBrowser ());
- RKFileBrowser *file_browser = new RKFileBrowser (0, true, "file_browser");
- file_browser->setIcon (SmallIcon ("fileopen"));
- file_browser->setToolWrapper (addToolWindow (file_browser, KDockWidget::DockLeft, getMainDockWidget (), 10, i18n ("File-system Browser"), i18n ("Files")));
- RKWorkplace::mainWorkplace ()->registerToolWindow (file_browser);
+ RKFileBrowser::main_browser = new RKFileBrowser (0, true, "file_browser");
+ RKFileBrowser::main_browser->setIcon (SmallIcon ("fileopen"));
+ RKFileBrowser::main_browser->setToolWrapper (addToolWindow (RKFileBrowser::main_browser, KDockWidget::DockLeft, getMainDockWidget (), 10, i18n ("File-system Browser"), i18n ("Files")));
+ RKWorkplace::mainWorkplace ()->registerToolWindow (RKFileBrowser::main_browser);
RControlWindow::getControl ()->setCaption (i18n ("Pending Jobs"));
RControlWindow::getControl ()->setToolWrapper (addToolWindow (RControlWindow::getControl (), KDockWidget::DockBottom, getMainDockWidget (), 10));
Modified: trunk/rkward/rkward/windows/rkfilebrowser.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkfilebrowser.cpp 2007-09-17 13:57:46 UTC (rev 1958)
+++ trunk/rkward/rkward/windows/rkfilebrowser.cpp 2007-09-17 15:09:41 UTC (rev 1959)
@@ -34,6 +34,9 @@
#include "../debug.h"
+// static
+RKFileBrowser *RKFileBrowser::main_browser = 0;
+
RKFileBrowser::RKFileBrowser (QWidget *parent, bool tool_window, char *name) : RKMDIWindow (parent, FileBrowserWindow, tool_window, name) {
RK_TRACE (APP);
Modified: trunk/rkward/rkward/windows/rkfilebrowser.h
===================================================================
--- trunk/rkward/rkward/windows/rkfilebrowser.h 2007-09-17 13:57:46 UTC (rev 1958)
+++ trunk/rkward/rkward/windows/rkfilebrowser.h 2007-09-17 15:09:41 UTC (rev 1959)
@@ -36,11 +36,14 @@
/** reimplemented to create the real file browser widget only when the file browser is shown for the first time */
void show ();
+ static RKFileBrowser *getMainBrowser() { return main_browser; };
public slots:
void currentWDChanged ();
private:
RKFileBrowserWidget *real_widget;
QVBox *layout_widget;
+friend class RKWardMainWindow;
+ static RKFileBrowser *main_browser;
};
/** The internal widget used in RKFileBrowser
Modified: trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp
===================================================================
--- trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp 2007-09-17 13:57:46 UTC (rev 1958)
+++ trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp 2007-09-17 15:09:41 UTC (rev 1959)
@@ -23,6 +23,7 @@
#include "../rkconsole.h"
#include "../robjectbrowser.h"
+#include "../windows/rkfilebrowser.h"
#include "../windows/rcontrolwindow.h"
#include "../windows/rkhtmlwindow.h"
#include "../windows/rkworkplaceview.h"
@@ -59,10 +60,11 @@
// window menu
new KAction (i18n ("Show/Hide Workspace Browser"), 0, KShortcut ("Alt+1"), this, SLOT (toggleWorkspace()), actionCollection (), "window_show_workspace");
- new KAction (i18n ("Show/Hide Command Log"), 0, KShortcut ("Alt+2"), this, SLOT (toggleCommandLog()), actionCollection (), "window_show_commandlog");
- new KAction (i18n ("Show/Hide Pending Jobs"), 0, KShortcut ("Alt+3"), this, SLOT (togglePendingJobs()), actionCollection (), "window_show_pendingjobs");
- new KAction (i18n ("Show/Hide Console"), 0, KShortcut ("Alt+4"), this, SLOT (toggleConsole()), actionCollection (), "window_show_console");
- new KAction (i18n ("Show/Hide R Help Search"), 0, KShortcut ("Alt+5"), this, SLOT (toggleHelpSearch()), actionCollection (), "window_show_helpsearch");
+ new KAction (i18n ("Show/Hide Filesystem Browser"), 0, KShortcut ("Alt+2"), this, SLOT (toggleFilebrowser()), actionCollection (), "window_show_filebrowser");
+ new KAction (i18n ("Show/Hide Command Log"), 0, KShortcut ("Alt+3"), this, SLOT (toggleCommandLog()), actionCollection (), "window_show_commandlog");
+ new KAction (i18n ("Show/Hide Pending Jobs"), 0, KShortcut ("Alt+4"), this, SLOT (togglePendingJobs()), actionCollection (), "window_show_pendingjobs");
+ new KAction (i18n ("Show/Hide Console"), 0, KShortcut ("Alt+5"), this, SLOT (toggleConsole()), actionCollection (), "window_show_console");
+ new KAction (i18n ("Show/Hide R Help Search"), 0, KShortcut ("Alt+6"), this, SLOT (toggleHelpSearch()), actionCollection (), "window_show_helpsearch");
new KAction (i18n ("Activate Document view"), 0, KShortcut ("Alt+0"), this, SLOT (activateDocumentView()), actionCollection (), "window_activate_docview");
new KAction (i18n ("Show &Output"), 0, 0, this, SLOT (slotOutputShow ()), actionCollection (), "output_show");
@@ -151,6 +153,12 @@
toggleToolView (RObjectBrowser::mainBrowser ());
}
+void RKTopLevelWindowGUI::toggleFilebrowser () {
+ RK_TRACE (APP);
+
+ toggleToolView (RKFileBrowser::getMainBrowser ());
+}
+
void RKTopLevelWindowGUI::activateDocumentView () {
RK_TRACE (APP);
Modified: trunk/rkward/rkward/windows/rktoplevelwindowgui.h
===================================================================
--- trunk/rkward/rkward/windows/rktoplevelwindowgui.h 2007-09-17 13:57:46 UTC (rev 1958)
+++ trunk/rkward/rkward/windows/rktoplevelwindowgui.h 2007-09-17 15:09:41 UTC (rev 1959)
@@ -45,6 +45,8 @@
void togglePendingJobs ();
/** Toggle the workspace browser window */
void toggleWorkspace ();
+ /** Toggle the filesystem browser window */
+ void toggleFilebrowser ();
/** Activate the current (non tools) window in the workspace */
void activateDocumentView ();
/** ensure output window is shown. */
Modified: trunk/rkward/rkward/windows/rktoplevelwindowgui.rc
===================================================================
--- trunk/rkward/rkward/windows/rktoplevelwindowgui.rc 2007-09-17 13:57:46 UTC (rev 1958)
+++ trunk/rkward/rkward/windows/rktoplevelwindowgui.rc 2007-09-17 15:09:41 UTC (rev 1959)
@@ -8,6 +8,7 @@
<Separator/>
<Menu name="window_activate"><text>&Activate</text>
<Action name="window_show_workspace"/>
+ <Action name="window_show_filebrowser"/>
<Action name="window_show_commandlog"/>
<Action name="window_show_pendingjobs"/>
<Action name="window_show_console"/>
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