[rkward-cvs] SF.net SVN: rkward:[2605] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Aug 7 16:06:00 UTC 2009


Revision: 2605
          http://rkward.svn.sourceforge.net/rkward/?rev=2605&view=rev
Author:   tfry
Date:     2009-08-07 16:05:59 +0000 (Fri, 07 Aug 2009)

Log Message:
-----------
Cleanups after r2604

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/core/robjectlist.cpp
    trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp
    trunk/rkward/rkward/settings/rksettingsmoduler.cpp
    trunk/rkward/rkward/settings/rksettingsmoduler.h

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2009-08-07 15:55:08 UTC (rev 2604)
+++ trunk/rkward/ChangeLog	2009-08-07 16:05:59 UTC (rev 2605)
@@ -1,3 +1,5 @@
+- Safeguard against removal of essential packages via the GUI
+- Add context menu action to unload packages in the object browser window
 - Add shortcut to the load / unload packages dialog also in the workspace menu
 - Make toolbar buttons configurable
 - Fixed: Console window would sometimes remain in partially active state after piping commands

Modified: trunk/rkward/rkward/core/robjectlist.cpp
===================================================================
--- trunk/rkward/rkward/core/robjectlist.cpp	2009-08-07 15:55:08 UTC (rev 2604)
+++ trunk/rkward/rkward/core/robjectlist.cpp	2009-08-07 16:05:59 UTC (rev 2605)
@@ -30,6 +30,7 @@
 #include "../rbackend/rinterface.h"
 #include "rkmodificationtracker.h"
 #include "../misc/rkprogresscontrol.h"
+#include "../settings/rksettingsmoduler.h"
 
 #include "../rkglobals.h"
 
@@ -66,7 +67,7 @@
 	for (int i = 0; i < packages.size(); ++i) {
 		QString shortname = packages[i];
 		shortname.remove ("package:");
-		if (shortname == "base" || shortname == "methods" || shortname == "utils" || shortname == "grDevices" || shortname == "graphics" || shortname == "rkward") {
+		if (RKSettingsModuleRPackages::essentialPackages ().contains (shortname)) {
 			reject.append (i18n ("Did not unload package %1. It is required in RKWard. If you really want to do this, do so on the R Console.", shortname));
 		} else if (!findChildByName (packages[i])) {
 			RK_ASSERT (false);

Modified: trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp
===================================================================
--- trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2009-08-07 15:55:08 UTC (rev 2604)
+++ trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2009-08-07 16:05:59 UTC (rev 2605)
@@ -278,9 +278,6 @@
 	
 	QVBoxLayout *mvbox = new QVBoxLayout (this);
 	mvbox->setContentsMargins (0, 0, 0, 0);
-	QLabel *label = new QLabel (i18n ("There are no safeguards against removing essential packages. For example, unloading \"rkward\" will prevent this application from running properly. Please be careful about the packages you unload."), this);
-	label->setWordWrap (true);
-	mvbox->addWidget (label);
 	
 	QHBoxLayout *hbox = new QHBoxLayout ();
 	mvbox->addLayout (hbox);
@@ -295,7 +292,7 @@
 	hbox->addLayout (loadedvbox);
 	loadedvbox->setContentsMargins (0, 0, 0, 0);
 	
-	label = new QLabel (i18n ("Installed packages"), this);
+	QLabel *label = new QLabel (i18n ("Installed packages"), this);
 	installed_view = new QTreeWidget (this);
 	installed_view->setHeaderLabels (QStringList () << i18n ("Name") << i18n ("Title") << i18n ("Version") << i18n ("Location"));
 	installed_view->setSelectionMode (QAbstractItemView::ExtendedSelection);

Modified: trunk/rkward/rkward/settings/rksettingsmoduler.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduler.cpp	2009-08-07 15:55:08 UTC (rev 2604)
+++ trunk/rkward/rkward/settings/rksettingsmoduler.cpp	2009-08-07 16:05:59 UTC (rev 2605)
@@ -316,6 +316,7 @@
 QStringList RKSettingsModuleRPackages::defaultliblocs;
 bool RKSettingsModuleRPackages::archive_packages;
 QStringList RKSettingsModuleRPackages::package_repositories;
+QString RKSettingsModuleRPackages::essential_packages = QString ("base\nmethods\nutils\ngrDevices\ngraphics\nrkward");
 
 RKSettingsModuleRPackages::RKSettingsModuleRPackages (RKSettings *gui, QWidget *parent) : RKSettingsModule(gui, parent) {
 	RK_TRACE (SETTINGS);

Modified: trunk/rkward/rkward/settings/rksettingsmoduler.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduler.h	2009-08-07 15:55:08 UTC (rev 2604)
+++ trunk/rkward/rkward/settings/rksettingsmoduler.h	2009-08-07 16:05:59 UTC (rev 2605)
@@ -115,6 +115,9 @@
 	static bool archivePackages () { return archive_packages; }
 //	static QStringList getPackageRepositories () { return package_repositories; };
 
+/** returns the list of packages which are essential to rkward. This is hard-coded. */
+	static QStringList essentialPackages () { return essential_packages.split ("\n"); };
+
 	QString caption ();
 public slots:
 	void listChanged ();
@@ -132,6 +135,7 @@
 
 	friend class RThread;
 	static QStringList defaultliblocs;
+	static QString essential_packages;
 };
 
 #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