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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Sep 14 08:12:47 UTC 2010


Revision: 3031
          http://rkward.svn.sourceforge.net/rkward/?rev=3031&view=rev
Author:   tfry
Date:     2010-09-14 08:12:46 +0000 (Tue, 14 Sep 2010)

Log Message:
-----------
Clean the moved options from the output settings page, and allow to specify default dimensions more precisely.

Modified Paths:
--------------
    trunk/rkward/rkward/settings/rksettingsmodulegraphics.cpp
    trunk/rkward/rkward/settings/rksettingsmodulegraphics.h
    trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp
    trunk/rkward/rkward/settings/rksettingsmoduleoutput.h

Modified: trunk/rkward/rkward/settings/rksettingsmodulegraphics.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmodulegraphics.cpp	2010-09-14 06:09:50 UTC (rev 3030)
+++ trunk/rkward/rkward/settings/rksettingsmodulegraphics.cpp	2010-09-14 08:12:46 UTC (rev 3031)
@@ -26,15 +26,15 @@
 #include <QGroupBox>
 #include <qcheckbox.h>
 #include <QVBoxLayout>
-#include <QComboBox>
 
 #include "../rkglobals.h"
 #include "../rbackend/rinterface.h"
+#include "../misc/rkspinbox.h"
 #include "../debug.h"
 
 // static members
-int RKSettingsModuleGraphics::graphics_width;
-int RKSettingsModuleGraphics::graphics_height;
+double RKSettingsModuleGraphics::graphics_width;
+double RKSettingsModuleGraphics::graphics_height;
 bool RKSettingsModuleGraphics::graphics_hist_enable;
 int RKSettingsModuleGraphics::graphics_hist_max_length;
 int RKSettingsModuleGraphics::graphics_hist_max_plotsize;
@@ -47,10 +47,12 @@
 	QGroupBox *group = new QGroupBox (i18n ("Default window size"), this);
 	QVBoxLayout* group_layout = new QVBoxLayout (group);
 	group_layout->addWidget (new QLabel (i18n ("Default width (inches):"), group));
-	group_layout->addWidget (graphics_width_box = new KIntSpinBox (1, 100, 1, graphics_width, group));
+	group_layout->addWidget (graphics_width_box = new RKSpinBox (group));
+	graphics_width_box->setRealMode (1, 100.0, graphics_width, 1, 3);
 	group_layout->addSpacing (2*RKGlobals::spacingHint ());
 	group_layout->addWidget (new QLabel (i18n ("Default height (inches)"), group));
-	group_layout->addWidget (graphics_height_box = new KIntSpinBox (1, 100, 1, graphics_height, group));
+	group_layout->addWidget (graphics_height_box = new RKSpinBox (group));
+	graphics_height_box->setRealMode (1, 100.0, graphics_height, 1, 3);
 	connect (graphics_width_box, SIGNAL (valueChanged (int)), this, SLOT (boxChanged ()));
 	connect (graphics_height_box, SIGNAL (valueChanged (int)), this, SLOT (boxChanged ()));
 	main_vbox->addWidget (group);
@@ -100,8 +102,8 @@
 void RKSettingsModuleGraphics::applyChanges () {
 	RK_TRACE (SETTINGS);
 
-	graphics_width = graphics_width_box->value ();
-	graphics_height = graphics_height_box->value ();
+	graphics_width = graphics_width_box->realValue ();
+	graphics_height = graphics_height_box->realValue ();
 
 	graphics_hist_enable = graphics_hist_box->isChecked ();
 	graphics_hist_max_length = graphics_hist_max_length_box->value ();
@@ -134,8 +136,8 @@
 	RK_TRACE (SETTINGS);
 
 	KConfigGroup cg = config->group ("Graphics Device Windows");
-	graphics_width = cg.readEntry ("graphics_width", 7);
-	graphics_height = cg.readEntry ("graphics_height", 7);
+	graphics_width = cg.readEntry ("graphics_width", 7.0);
+	graphics_height = cg.readEntry ("graphics_height", 7.0);
 	graphics_hist_enable = cg.readEntry ("graphics_hist_enable", true);
 	graphics_hist_max_length = cg.readEntry ("graphics_hist_max_length", 20);
 	graphics_hist_max_plotsize = cg.readEntry ("graphics_hist_max_plotsize", 1024);

Modified: trunk/rkward/rkward/settings/rksettingsmodulegraphics.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmodulegraphics.h	2010-09-14 06:09:50 UTC (rev 3030)
+++ trunk/rkward/rkward/settings/rksettingsmodulegraphics.h	2010-09-14 08:12:46 UTC (rev 3031)
@@ -22,6 +22,7 @@
 #include <QStringList>
 
 class QGroupBox;
+class RKSpinBox;
 class KIntSpinBox;
 
 /**
@@ -53,15 +54,15 @@
 	KIntSpinBox *graphics_hist_max_length_box;
 	KIntSpinBox *graphics_hist_max_plotsize_box;
 
-	KIntSpinBox *graphics_height_box;
-	KIntSpinBox *graphics_width_box;
+	RKSpinBox *graphics_height_box;
+	RKSpinBox *graphics_width_box;
 
 	static bool graphics_hist_enable;
 	static int graphics_hist_max_length;
 	static int graphics_hist_max_plotsize;
 
-	static int graphics_height;
-	static int graphics_width;
+	static double graphics_height;
+	static double graphics_width;
 };
 
 #endif

Modified: trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp	2010-09-14 06:09:50 UTC (rev 3030)
+++ trunk/rkward/rkward/settings/rksettingsmoduleoutput.cpp	2010-09-14 08:12:46 UTC (rev 3031)
@@ -39,9 +39,6 @@
 int RKSettingsModuleOutput::graphics_width;
 int RKSettingsModuleOutput::graphics_height;
 int RKSettingsModuleOutput::graphics_jpg_quality;
-bool RKSettingsModuleOutput::graphics_hist_enable;
-int RKSettingsModuleOutput::graphics_hist_max_length;
-int RKSettingsModuleOutput::graphics_hist_max_plotsize;
 
 RKSettingsModuleOutput::RKSettingsModuleOutput (RKSettings *gui, QWidget *parent) : RKSettingsModule(gui, parent) {
 	RK_TRACE (SETTINGS);
@@ -93,26 +90,6 @@
 
 	main_vbox->addWidget (group);
 
-	group = new QGroupBox (i18n ("Screen device history"), this);
-	group_layout = new QVBoxLayout (group);
-	group_layout->addWidget (graphics_hist_enable_box = new QCheckBox (i18n ("enable screen device history"), group));
-	graphics_hist_enable_box->setChecked (graphics_hist_enable);
-	connect (graphics_hist_enable_box, SIGNAL (stateChanged (int)), this, SLOT (boxChanged (int)));
-	h_layout = new QHBoxLayout (group);
-	group_layout->addLayout (h_layout);
-	h_layout->addWidget (new QLabel (i18n ("Maximum number of recorded plots:"), group));
-	h_layout->addWidget (graphics_hist_max_length_box = new KIntSpinBox (1, 200, 1, graphics_hist_max_length, group));
-	graphics_hist_max_length_box->setEnabled (graphics_hist_enable);
-	h_layout = new QHBoxLayout (group);
-	group_layout->addLayout (h_layout);
-	h_layout->addWidget (new QLabel (i18n ("Maximum size of a single recorded plot (in KB):"), group));
-	h_layout->addWidget (graphics_hist_max_plotsize_box = new KIntSpinBox (4, 20000, 4, graphics_hist_max_plotsize, group)); // in KB
-	graphics_hist_max_plotsize_box->setEnabled (graphics_hist_enable);
-	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,8 +101,6 @@
 	RK_TRACE (SETTINGS);
 	change ();
 	auto_raise_box->setEnabled (auto_show_box->isChecked ());
-	graphics_hist_max_length_box->setEnabled (graphics_hist_enable_box->isChecked ());
-	graphics_hist_max_plotsize_box->setEnabled (graphics_hist_enable_box->isChecked ());
 	graphics_jpg_quality_box->setEnabled (graphics_type_box->itemData (graphics_type_box->currentIndex ()).toString () == "\"JPG\"");
 }
 
@@ -150,10 +125,6 @@
 	graphics_height = graphics_height_box->value ();
 	graphics_jpg_quality = graphics_jpg_quality_box->value ();
 
-	graphics_hist_enable = graphics_hist_enable_box->isChecked ();
-	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 ());
@@ -176,9 +147,6 @@
 	cg.writeEntry ("graphics_width", graphics_width);
 	cg.writeEntry ("graphics_height", graphics_height);
 	cg.writeEntry ("graphics_jpg_quality", graphics_jpg_quality);
-	cg.writeEntry ("graphics_hist_enable", graphics_hist_enable);
-	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) {
@@ -191,9 +159,6 @@
 	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_enable = cg.readEntry ("graphics_hist_enable", true);
-	graphics_hist_max_length = cg.readEntry ("graphics_hist_max_length", 20);
-	graphics_hist_max_plotsize = cg.readEntry ("graphics_hist_max_plotsize", 1024);
 }
 
 //static
@@ -205,10 +170,7 @@
 	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));
-	command.append (")\nrk.toggle.plot.history (" + QString (graphics_hist_enable?"TRUE":"FALSE") + ")\n");
-	list.append (command + "rk.verify.plot.hist.limits (" + QString::number (graphics_hist_max_length) + ")\n");
+	list.append (command + ")\n");
 	
 	return (list);
 }

Modified: trunk/rkward/rkward/settings/rksettingsmoduleoutput.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduleoutput.h	2010-09-14 06:09:50 UTC (rev 3030)
+++ trunk/rkward/rkward/settings/rksettingsmoduleoutput.h	2010-09-14 08:12:46 UTC (rev 3031)
@@ -48,7 +48,6 @@
 	
 	static bool autoShow () { return auto_show; };
 	static bool autoRaise () { return auto_raise; };
-	static bool plotHistoryEnabled () { return graphics_hist_enable; };
 public slots:
 	void boxChanged (int);
 private:
@@ -58,9 +57,6 @@
 	KIntSpinBox *graphics_width_box;
 	KIntSpinBox *graphics_height_box;
 	KIntSpinBox *graphics_jpg_quality_box;
-	QCheckBox *graphics_hist_enable_box;
-	KIntSpinBox *graphics_hist_max_length_box;
-	KIntSpinBox *graphics_hist_max_plotsize_box;
 
 	static bool auto_show;
 	static bool auto_raise;
@@ -68,9 +64,6 @@
 	static int graphics_width;
 	static int graphics_height;
 	static int graphics_jpg_quality;
-	static bool graphics_hist_enable;
-	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