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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Sep 25 18:05:49 UTC 2012


Revision: 4308
          http://rkward.svn.sourceforge.net/rkward/?rev=4308&view=rev
Author:   tfry
Date:     2012-09-25 18:05:49 +0000 (Tue, 25 Sep 2012)
Log Message:
-----------
Add option to control pkgType on Windows and Mac (untested)

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    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	2012-09-25 10:38:10 UTC (rev 4307)
+++ trunk/rkward/ChangeLog	2012-09-25 18:05:49 UTC (rev 4308)
@@ -1,3 +1,4 @@
+- Add option for installing packages from source (implicitly enabled on Unixoid platforms)
 - Fixed: Wrong handling of carriage returns ('\r') in the console window				TODO: also fix for the command log and other places
 - Fixed: Spinboxes had wrong initial values
 - Omit comments on missing function calls in dialog code windows (e.g., if prepare() is unused, there's no "## Prepare" in the output either)

Modified: trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp
===================================================================
--- trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2012-09-25 10:38:10 UTC (rev 4307)
+++ trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2012-09-25 18:05:49 UTC (rev 4308)
@@ -285,6 +285,8 @@
 	}
 	repos_string.append ("))\n");
 
+	repos_string.append (RKSettingsModuleRPackages::pkgTypeOption ());
+
 	if (as_root) {
 		KUser user;
 		command_string.append ("system (\"chown " + user.loginName() + ' ' + downloaddir + "/*\")\n");

Modified: trunk/rkward/rkward/settings/rksettingsmoduler.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduler.cpp	2012-09-25 10:38:10 UTC (rev 4307)
+++ trunk/rkward/rkward/settings/rksettingsmoduler.cpp	2012-09-25 18:05:49 UTC (rev 4308)
@@ -2,7 +2,7 @@
                           rksettingsmoduler  -  description
                              -------------------
     begin                : Wed Jul 28 2004
-    copyright            : (C) 2004, 2007, 2009, 2010, 2011 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2007, 2009, 2010, 2011, 2012 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -316,6 +316,7 @@
 QStringList RKSettingsModuleRPackages::liblocs;
 QStringList RKSettingsModuleRPackages::defaultliblocs;
 bool RKSettingsModuleRPackages::archive_packages;
+bool RKSettingsModuleRPackages::source_packages;
 QStringList RKSettingsModuleRPackages::package_repositories;
 QString RKSettingsModuleRPackages::essential_packages = QString ("base\nmethods\nutils\ngrDevices\ngraphics\nrkward");
 QString RKSettingsModuleRPackages::cran_mirror_url;
@@ -347,8 +348,19 @@
 	archive_packages_box = new QCheckBox (i18n ("Archive downloaded packages"), this);
 	archive_packages_box->setChecked (archive_packages);
 	connect (archive_packages_box, SIGNAL (stateChanged (int)), this, SLOT (settingChanged()));
-	main_vbox->addWidget (archive_packages_box);	
+	main_vbox->addWidget (archive_packages_box);
 
+#if defined Q_WS_WIN || defined Q_WS_MAC
+	source_packages_box = new QCheckBox (i18n ("Build packages from source"), this);
+	source_packages_box->setChecked (source_packages);
+#else
+	source_packages_box = new QCheckBox (i18n ("Build packages from source (not configurable on this platform)"), this);
+	source_packages_box->setChecked (true);
+	source_packages_box->setEnabled (false);
+#endif
+	connect (source_packages_box, SIGNAL (stateChanged (int)), this, SLOT (settingChanged()));
+	main_vbox->addWidget (source_packages_box);
+
 	main_vbox->addStretch ();
 
 	libloc_selector = new MultiStringSelector (i18n ("R Library locations (where libraries get installed to, locally)"), this);
@@ -447,6 +459,22 @@
 }
 
 //static
+QString RKSettingsModuleRPackages::pkgTypeOption () {
+	QString ret;
+#if defined Q_WS_WIN || defined Q_WS_MAC
+	ret.append ("options (pkgType=\"");
+	if (source_packages) ret.append ("source");
+#	if defined Q_WS_WIN
+	else ret.append ("win.binary");
+#	else
+	else ret.append ("mac.binary.leopard");
+#	endif
+	ret.append ("\")\n");
+#endif
+	return ret;
+}
+
+//static
 QStringList RKSettingsModuleRPackages::makeRRunTimeOptionCommands () {
 	RK_TRACE (SETTINGS);
 	QStringList list;
@@ -458,6 +486,8 @@
 	}
 	list.append (command + "))\n");
 
+	
+	
 // library locations
 	list.append (libLocsCommand ());
 
@@ -471,6 +501,7 @@
 	if (cran_mirror_url.isEmpty ()) cran_mirror_url = "@CRAN@";
 
 	archive_packages = archive_packages_box->isChecked ();
+	source_packages = source_packages_box->isChecked ();
 	package_repositories = repository_selector->getValues ();
 	liblocs = libloc_selector->getValues ();
 
@@ -493,6 +524,7 @@
 	KConfigGroup cg = config->group ("R Settings");
 	cg.writeEntry ("CRAN mirror url", cran_mirror_url);
 	cg.writeEntry ("archive packages", archive_packages);
+	cg.writeEntry ("source_packages", source_packages);
 	cg.writeEntry ("Repositories", package_repositories);
 	cg.writeEntry ("LibraryLocations", liblocs);
 }
@@ -512,6 +544,11 @@
 
 	liblocs = cg.readEntry ("LibraryLocations", QStringList ());
 	archive_packages = cg.readEntry ("archive packages", false);
+#if defined Q_WS_WIN || defined Q_WS_MAC
+	source_packages = cg.readEntry ("source packages", false);
+#else
+	source_packages = true;
+#endif
 }
 
 #include "rksettingsmoduler.moc"

Modified: trunk/rkward/rkward/settings/rksettingsmoduler.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduler.h	2012-09-25 10:38:10 UTC (rev 4307)
+++ trunk/rkward/rkward/settings/rksettingsmoduler.h	2012-09-25 18:05:49 UTC (rev 4308)
@@ -2,7 +2,7 @@
                           rksettingsmoduler  -  description
                              -------------------
     begin                : Wed Jul 28 2004
-    copyright            : (C) 2004, 2007, 2009, 2010, 2011 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2007, 2009, 2010, 2011, 2012 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -121,6 +121,7 @@
 	static QStringList makeRRunTimeOptionCommands ();
 
 	static bool archivePackages () { return archive_packages; }
+	static QString pkgTypeOption ();
 	static void addLibraryLocation (const QString& new_loc, RCommandChain *chain);
 	static QStringList libraryLocations () { return (liblocs + defaultliblocs); };
 
@@ -140,12 +141,14 @@
 
 	MultiStringSelector *libloc_selector;
 	QCheckBox *archive_packages_box;
+	QCheckBox *source_packages_box;
 	MultiStringSelector *repository_selector;
 	QLineEdit* cran_mirror_input;
 
 	static QString cran_mirror_url;
 	static QStringList liblocs;
 	static bool archive_packages;
+	static bool source_packages;
 	static QStringList package_repositories;
 
 	friend class RInterface;

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