[rkward-cvs] SF.net SVN: rkward:[2935] trunk/rkward/rkward
kapatp at users.sourceforge.net
kapatp at users.sourceforge.net
Sun Jul 4 18:59:13 UTC 2010
Revision: 2935
http://rkward.svn.sourceforge.net/rkward/?rev=2935&view=rev
Author: kapatp
Date: 2010-07-04 18:59:13 +0000 (Sun, 04 Jul 2010)
Log Message:
-----------
Create settings for graphics history limit
Modified Paths:
--------------
trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp
trunk/rkward/rkward/settings/rksettingsmoduleoutput.h
Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R 2010-07-04 08:15:12 UTC (rev 2934)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R 2010-07-04 18:59:13 UTC (rev 2935)
@@ -55,14 +55,12 @@
rk.record.plot$.set.isDuplicate (FALSE)
}
-# create a (global) history of various graphics calls - a rudimentary attempt
+# A global history of various graphics calls; trellis / grid graphics is not supported yet
"rk.record.plot" <- function ()
{
# TODO:
# - add a length and size limit to recorded () list
- # - add option to delete a plot from history
# - add one or more tests to rkward_application_tests.R
- # - .rk.graph.history.gui () add option to update only one deviceId
# - .... ?
env <- environment()
@@ -316,4 +314,3 @@
rk.record.plot$remove (deviceId)
rk.record.plot$printPars ()
}
-
Modified: trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp 2010-07-04 08:15:12 UTC (rev 2934)
+++ trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp 2010-07-04 18:59:13 UTC (rev 2935)
@@ -39,6 +39,8 @@
int RKSettingsModuleOutput::graphics_width;
int RKSettingsModuleOutput::graphics_height;
int RKSettingsModuleOutput::graphics_jpg_quality;
+int RKSettingsModuleOutput::graphics_hist_max_length;
+int RKSettingsModuleOutput::graphics_hist_max_plotsize;
RKSettingsModuleOutput::RKSettingsModuleOutput (RKSettings *gui, QWidget *parent) : RKSettingsModule(gui, parent) {
RK_TRACE (SETTINGS);
@@ -88,6 +90,18 @@
connect (graphics_width_box, SIGNAL (valueChanged (int)), this, SLOT (boxChanged (int)));
connect (graphics_height_box, SIGNAL (valueChanged (int)), this, SLOT (boxChanged (int)));
+ h_layout = new QHBoxLayout (group);
+ group_layout->addLayout (h_layout);
+ h_layout->addWidget (new QLabel (i18n ("History length:"), group));
+ h_layout->addWidget (graphics_hist_max_length_box = new KIntSpinBox (2, 25, 1, graphics_hist_max_length, group));
+ h_layout->addSpacing (2*RKGlobals::spacingHint ());
+ h_layout->addWidget (new QLabel (i18n ("History size:"), group));
+ h_layout->addWidget (graphics_hist_max_plotsize_box = new KIntSpinBox (4, 2048, 4, graphics_hist_max_plotsize, group)); // in KB
+ h_layout->addWidget (new QLabel (i18n ("KiB"), group));
+ h_layout->addStretch ();
+ connect (graphics_hist_max_length_box, SIGNAL (valueChanged (int)), this, SLOT (boxChanged (int)));
+ connect (graphics_hist_max_plotsize_box, SIGNAL (valueChanged (int)), this, SLOT (boxChanged (int)));
+
main_vbox->addWidget (group);
main_vbox->addStretch ();
@@ -124,6 +138,10 @@
graphics_width = graphics_width_box->value ();
graphics_height = graphics_height_box->value ();
graphics_jpg_quality = graphics_jpg_quality_box->value ();
+
+ graphics_hist_max_length = graphics_hist_max_length_box->value ();
+ graphics_hist_max_plotsize = graphics_hist_max_plotsize_box->value ();
+
QStringList commands = makeRRunTimeOptionCommands ();
for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {
RKGlobals::rInterface ()->issueCommand (*it, RCommand::App, QString::null, 0, 0, commandChain ());
@@ -146,6 +164,8 @@
cg.writeEntry ("graphics_width", graphics_width);
cg.writeEntry ("graphics_height", graphics_height);
cg.writeEntry ("graphics_jpg_quality", graphics_jpg_quality);
+ cg.writeEntry ("graphics_hist_max_length", graphics_hist_max_length);
+ cg.writeEntry ("graphics_hist_max_plotsize", graphics_hist_max_plotsize);
}
void RKSettingsModuleOutput::loadSettings (KConfig *config) {
@@ -158,6 +178,8 @@
graphics_width = cg.readEntry ("graphics_width", 480);
graphics_height = cg.readEntry ("graphics_height", 480);
graphics_jpg_quality = cg.readEntry ("graphics_jpg_quality", 75);
+ graphics_hist_max_length = cg.readEntry ("graphics_hist_max_length", 20);
+ graphics_hist_max_plotsize = cg.readEntry ("graphics_hist_max_plotsize", 52);
}
//static
@@ -169,6 +191,8 @@
command.append (", \"rk.graphics.width\"=" + QString::number (graphics_width));
command.append (", \"rk.graphics.height\"=" + QString::number (graphics_height));
if (graphics_type == "\"JPG\"") command.append (", \"rk.graphics.jpg.quality\"=" + QString::number (graphics_jpg_quality));
+ command.append (", \"rk.graphics.hist.max.length\"=" + QString::number (graphics_hist_max_length));
+ command.append (", \"rk.graphics.hist.max.plotsize\"=" + QString::number (graphics_hist_max_plotsize));
list.append (command + ")\n");
return (list);
Modified: trunk/rkward/rkward/settings/rksettingsmoduleoutput.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduleoutput.h 2010-07-04 08:15:12 UTC (rev 2934)
+++ trunk/rkward/rkward/settings/rksettingsmoduleoutput.h 2010-07-04 18:59:13 UTC (rev 2935)
@@ -57,6 +57,8 @@
KIntSpinBox *graphics_width_box;
KIntSpinBox *graphics_height_box;
KIntSpinBox *graphics_jpg_quality_box;
+ KIntSpinBox *graphics_hist_max_length_box;
+ KIntSpinBox *graphics_hist_max_plotsize_box;
static bool auto_show;
static bool auto_raise;
@@ -64,6 +66,8 @@
static int graphics_width;
static int graphics_height;
static int graphics_jpg_quality;
+ static int graphics_hist_max_length;
+ static int graphics_hist_max_plotsize;
};
#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