[rkward-cvs] SF.net SVN: rkward: [1123] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu Jan 11 18:15:11 UTC 2007
Revision: 1123
http://svn.sourceforge.net/rkward/?rev=1123&view=rev
Author: tfry
Date: 2007-01-11 10:15:11 -0800 (Thu, 11 Jan 2007)
Log Message:
-----------
Fixes to loading of workspaces, and show less dupes of help pages
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/rkward/agents/rkloadagent.cpp
trunk/rkward/rkward/main.cpp
trunk/rkward/rkward/rkward.cpp
trunk/rkward/rkward/windows/rkhtmlwindow.cpp
trunk/rkward/rkward/windows/rkhtmlwindow.h
trunk/rkward/rkward/windows/rkworkplace.cpp
trunk/rkward/rkward/windows/rkworkplace.h
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/ChangeLog 2007-01-11 18:15:11 UTC (rev 1123)
@@ -1,6 +1,8 @@
--- Version 0.4.5 - DATE
- TODO: test auto-detection of pluginmap path!
+- fixed: non-local workspaces would not be loaded
+- fixed: specifying a workspace to load on the command line would only work for full urls
- new Console RMB actions: "copy selection cleaned" and "run selection"
- added a basic help system, and some introductory help pages
- plug-in for skewness and kurtosis added
Modified: trunk/rkward/rkward/agents/rkloadagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rkloadagent.cpp 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/agents/rkloadagent.cpp 2007-01-11 18:15:11 UTC (rev 1123)
@@ -2,7 +2,7 @@
rkloadagent - description
-------------------
begin : Sun Sep 5 2004
- copyright : (C) 2004 by Thomas Friedrichsmeier
+ copyright : (C) 2004, 2007 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -37,11 +37,18 @@
RK_TRACE (APP);
RKWardMainWindow::getMain ()->slotSetStatusBarText (i18n ("Loading Workspace ..."));
+ QString filename;
+ if (!url.isLocalFile ()) {
#if !KDE_IS_VERSION (3, 2, 0)
- KIO::NetAccess::download (url, tmpfile);
+ KIO::NetAccess::download (url, tmpfile);
#else
- KIO::NetAccess::download (url, tmpfile, RKWardMainWindow::getMain ());
+ KIO::NetAccess::download (url, tmpfile, RKWardMainWindow::getMain ());
#endif
+ filename = tmpfile;
+ } else {
+ filename = url.path ();
+ }
+
RCommand *command;
@@ -51,7 +58,7 @@
RKGlobals::rInterface ()->issueCommand (command);
}
- command = new RCommand ("load (\"" + url.path () + "\")", RCommand::App | RCommand::ObjectListUpdate, QString::null, this, WORKSPACE_LOAD_COMMAND);
+ command = new RCommand ("load (\"" + filename + "\")", RCommand::App | RCommand::ObjectListUpdate, QString::null, this, WORKSPACE_LOAD_COMMAND);
RKGlobals::rInterface ()->issueCommand (command);
RObjectList::getObjectList ()->setWorkspaceURL (url);
@@ -65,7 +72,7 @@
RK_TRACE (APP);
if (command->getFlags () == WORKSPACE_LOAD_COMMAND) {
- KIO::NetAccess::removeTempFile (tmpfile);
+ if (!tmpfile.isEmpty ()) KIO::NetAccess::removeTempFile (tmpfile);
if (command->failed ()) {
KMessageBox::error (0, i18n ("There has been an error opening file '%1':\n%2").arg (RObjectList::getObjectList ()->getWorkspaceURL ().path ()).arg (command->error ()), i18n ("Error loading workspace"));
RObjectList::getObjectList ()->setWorkspaceURL (QString::null);
Modified: trunk/rkward/rkward/main.cpp
===================================================================
--- trunk/rkward/rkward/main.cpp 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/main.cpp 2007-01-11 18:15:11 UTC (rev 1123)
@@ -112,7 +112,7 @@
KURL *open_url = 0;
if (args->count ()) {
- open_url = new KURL (args->arg (0));
+ open_url = new KURL (args->makeURL (args->arg (0)));
}
args->clear();
Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/rkward.cpp 2007-01-11 18:15:11 UTC (rev 1123)
@@ -2,7 +2,7 @@
rkward.cpp - description
-------------------
begin : Tue Oct 29 20:06:08 CET 2002
- copyright : (C) 2002, 2005, 2006 by Thomas Friedrichsmeier
+ copyright : (C) 2002, 2005, 2006, 2007 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -569,7 +569,7 @@
void RKWardMainWindow::showRKWardHelp () {
RK_TRACE (APP);
- RKWorkplace::mainWorkplace ()->openHelpWindow ("rkward://page/rkward_welcome");
+ RKWorkplace::mainWorkplace ()->openHelpWindow ("rkward://page/rkward_welcome", true);
topLevelWidget ()->raise ();
}
Modified: trunk/rkward/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkhtmlwindow.cpp 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/windows/rkhtmlwindow.cpp 2007-01-11 18:15:11 UTC (rev 1123)
@@ -144,6 +144,15 @@
return true;
}
+KURL RKHTMLWindow::url () {
+ if (khtmlpart) {
+ return khtmlpart->url ();
+ } else {
+ RK_ASSERT (false);
+ return KURL ();
+ }
+}
+
void RKHTMLWindow::changeURL (const KURL &url) {
updateCaption (url);
Modified: trunk/rkward/rkward/windows/rkhtmlwindow.h
===================================================================
--- trunk/rkward/rkward/windows/rkhtmlwindow.h 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/windows/rkhtmlwindow.h 2007-01-11 18:15:11 UTC (rev 1123)
@@ -59,6 +59,8 @@
QString getDescription ();
bool isModified ();
KParts::Part *getPart ();
+/** Return current url */
+ KURL url ();
public slots:
/** this is used for browsing only. Use openURL instead, when calling from outside. */
void slotOpenURLRequest (const KURL &url, const KParts::URLArgs &);
Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp 2007-01-11 18:15:11 UTC (rev 1123)
@@ -2,7 +2,7 @@
rkworkplace - description
-------------------
begin : Thu Sep 21 2006
- copyright : (C) 2006 by Thomas Friedrichsmeier
+ copyright : (C) 2006, 2007 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -130,11 +130,20 @@
return true;
}
-void RKWorkplace::openHelpWindow (const KURL &url) {
+void RKWorkplace::openHelpWindow (const KURL &url, bool only_once) {
RK_TRACE (APP);
RKHelpWindow *hw = new RKHelpWindow (view ());
if (!url.isEmpty ()) {
+ if (only_once) {
+ RKWorkplaceObjectList help_windows = getObjectList (RKMDIWindow::HelpWindow, RKMDIWindow::AnyState);
+ for (RKWorkplaceObjectList::const_iterator it = help_windows.constBegin (); it != help_windows.constEnd (); ++it) {
+ if (static_cast<RKHelpWindow *> (*it)->url ().equals (url, true)) {
+ (*it)->activate ();
+ return;
+ }
+ }
+ }
hw->openURL (url);
}
@@ -357,7 +366,7 @@
} else if (type == "output") {
openOutputWindow (specification);
} else if (type == "help") {
- openHelpWindow (specification);
+ openHelpWindow (specification, true);
} else {
RK_ASSERT (false);
}
Modified: trunk/rkward/rkward/windows/rkworkplace.h
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.h 2007-01-11 17:05:29 UTC (rev 1122)
+++ trunk/rkward/rkward/windows/rkworkplace.h 2007-01-11 18:15:11 UTC (rev 1123)
@@ -2,7 +2,7 @@
rkworkplace - description
-------------------
begin : Thu Sep 21 2006
- copyright : (C) 2006 by Thomas Friedrichsmeier
+ copyright : (C) 2006, 2007 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -67,8 +67,9 @@
@returns false if a local url could not be opened, true for all remote urls, and on success */
bool openScriptEditor (const KURL &url=KURL (), bool use_r_highlighting=true, bool read_only=false, const QString &force_caption = QString::null);
/** Opens a new help window, starting at the given url
- at param url URL to open */
- void openHelpWindow (const KURL &url=KURL ());
+ at param url URL to open
+ at param only_once if true, checks whether any help window already shows this URL. If so, raise it, but do not open a new window. Else show the new window */
+ void openHelpWindow (const KURL &url=KURL (), bool only_once=false);
/** Opens a new output window. Currently only a single output window will ever be created. Subsequent calls to the function will not create additional windows right now (but will raise / refresh the output window
@param url currently ignored! */
void openOutputWindow (const KURL &url=KURL ());
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