[Sciviews-commits] r416 - komodo/SciViews-K-dev/content/js

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 16 00:41:50 CET 2011


Author: prezez
Date: 2011-12-16 00:41:49 +0100 (Fri, 16 Dec 2011)
New Revision: 416

Modified:
   komodo/SciViews-K-dev/content/js/r.js
   komodo/SciViews-K-dev/content/js/robjects.js
Log:
SciViews-K-dev: object browser: 
fixed: help menu item was disabled;
detaching packages now uses "unload = TRUE".

Modified: komodo/SciViews-K-dev/content/js/r.js
===================================================================
--- komodo/SciViews-K-dev/content/js/r.js	2011-12-12 22:15:34 UTC (rev 415)
+++ komodo/SciViews-K-dev/content/js/r.js	2011-12-15 23:41:49 UTC (rev 416)
@@ -1044,7 +1044,7 @@
 		var topic = ko.dialogs.selectFromList("Unload R package",
 		"Select one R package to unload:", items, "one");
 		if (topic != null)
-		res = sv.r.eval("detach(\"package:" + topic[0].trim()+ "\")");
+		res = sv.r.eval("detach(\"package:" + topic[0].trim()+ "\", unload = TRUE)");
 	}
 	return(res);
 }

Modified: komodo/SciViews-K-dev/content/js/robjects.js
===================================================================
--- komodo/SciViews-K-dev/content/js/robjects.js	2011-12-12 22:15:34 UTC (rev 415)
+++ komodo/SciViews-K-dev/content/js/robjects.js	2011-12-15 23:41:49 UTC (rev 416)
@@ -1064,7 +1064,7 @@
 	}
 
 	for (var i in envToDetach) {
-		cmd.push('detach("' + envToDetach[i].addslashes() + '")');
+		cmd.push('detach("' + envToDetach[i].addslashes() + '", unload = TRUE)');
 		for (var j in _this.treeData) {
 			if (_this.treeData[j].name == envToDetach[i]) {
 				_this.treeData.splice(j, 1);
@@ -1212,7 +1212,7 @@
 	var multipleSelection = _this.selection.count > 1;
 
 	// Help can be shown only for one object:
-	var noHelp = !isPackage || !isInPackage;
+	var noHelp = isPackage || !isInPackage;
 
 	//var menuNode = document.getElementById("rObjectsContext");
 	var menuItems = event.target.childNodes;
@@ -1460,9 +1460,8 @@
 				} else {
 					_this.getPackageList();
 				}
-				if (message) {
+				if (message)
 					sv.alert(sv.translate("Load library, R said:"), message);
-				}
 			}
 			);
 		}
@@ -1513,15 +1512,15 @@
 
 		sv.r.evalCallback(
 		'tryCatch(detach("' + pkg.addslashes() +
-		'"), error=function(e) cat("<error>"));',
+		'", unload=TRUE), error=function(e) cat("<error>"));',
 		function _packageListKeyEvent_callback (data) {
 			sv.log.debug(data);
 			if (data.trim() != "<error>") {
 				_removeObjectList(pkg);
 				listbox.removeChild(listItem);
-				print(sv.translate("Namespace \"%S\" detached.", pkg));
+				print(sv.translate("Database \"%S\" detached.", pkg));
 			} else {
-				print(sv.translate("Namespace \"%S\" could not be detached.", pkg));
+				print(sv.translate("Database \"%S\" could not be detached.", pkg));
 			}
 		});
 		return;



More information about the Sciviews-commits mailing list