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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Feb 1 15:30:09 UTC 2007


Revision: 1278
          http://svn.sourceforge.net/rkward/?rev=1278&view=rev
Author:   tfry
Date:     2007-02-01 07:30:08 -0800 (Thu, 01 Feb 2007)

Log Message:
-----------
Small corrections to CSV import plugin, and allow browsers to be required

Modified Paths:
--------------
    trunk/rkward/rkward/misc/getfilenamewidget.cpp
    trunk/rkward/rkward/misc/getfilenamewidget.h
    trunk/rkward/rkward/plugin/rkpluginbrowser.cpp
    trunk/rkward/rkward/plugin/rkpluginbrowser.h
    trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml
    trunk/rkward/rkward/plugins/Makefile.am

Modified: trunk/rkward/rkward/misc/getfilenamewidget.cpp
===================================================================
--- trunk/rkward/rkward/misc/getfilenamewidget.cpp	2007-02-01 15:13:30 UTC (rev 1277)
+++ trunk/rkward/rkward/misc/getfilenamewidget.cpp	2007-02-01 15:30:08 UTC (rev 1278)
@@ -2,7 +2,7 @@
                           getfilenamewidget  -  description
                              -------------------
     begin                : Tue Aug 24 2004
-    copyright            : (C) 2004 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -90,4 +90,10 @@
 	return location_edit->text ();
 }
 
+void GetFileNameWidget::setBackgroundColor (const QColor & color) {
+	RK_TRACE (MISC);
+
+	location_edit->setBackgroundColor (color);
+}
+
 #include "getfilenamewidget.moc"

Modified: trunk/rkward/rkward/misc/getfilenamewidget.h
===================================================================
--- trunk/rkward/rkward/misc/getfilenamewidget.h	2007-02-01 15:13:30 UTC (rev 1277)
+++ trunk/rkward/rkward/misc/getfilenamewidget.h	2007-02-01 15:30:08 UTC (rev 1278)
@@ -2,7 +2,7 @@
                           getfilenamewidget  -  description
                              -------------------
     begin                : Tue Aug 24 2004
-    copyright            : (C) 2004 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -32,7 +32,7 @@
 	Q_OBJECT
 public:
 	enum FileType { ExistingFile=0, ExistingDirectory=1, SaveFile=2 };
-    
+
 	GetFileNameWidget (QWidget *parent, FileType mode, const QString &label, const QString &caption, const QString &initial);
 	~GetFileNameWidget ();
 
@@ -41,6 +41,8 @@
 /** set the filename/location from outside */
 	void setLocation (const QString &new_location);
 
+	void setBackgroundColor (const QColor & color);
+
 /** retrieves the current location */
 	QString getLocation ();
 public slots:

Modified: trunk/rkward/rkward/plugin/rkpluginbrowser.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkpluginbrowser.cpp	2007-02-01 15:13:30 UTC (rev 1277)
+++ trunk/rkward/rkward/plugin/rkpluginbrowser.cpp	2007-02-01 15:30:08 UTC (rev 1278)
@@ -2,7 +2,7 @@
                           rkpluginbrowser  -  description
                              -------------------
     begin                : Sat Mar 10 2005
-    copyright            : (C) 2005, 2006 by Thomas Friedrichsmeier
+    copyright            : (C) 2005, 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -36,6 +36,9 @@
 	addChild ("selection", selection = new RKComponentPropertyBase (this, true));
 	connect (selection, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (textChanged (RKComponentPropertyBase *)));
 
+	setRequired (xml->getBoolAttribute (element, "required", true, DL_INFO));
+	connect (requirednessProperty (), SIGNAL (valueChanged(RKComponentPropertyBase*)), this, SLOT (requirednessChanged(RKComponentPropertyBase*)));
+
 	QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
 
 	int intmode = xml->getMultiChoiceAttribute (element, "type", "file;dir;savefile", 0, DL_INFO);
@@ -54,9 +57,8 @@
 	vbox->addWidget (selector);
 
 	// initialize
-	updating = true;
+	updating = false;
 	textChanged ();
-	updating = false;
 }
 
 RKPluginBrowser::~RKPluginBrowser () {
@@ -70,6 +72,7 @@
 	updating = true;
 
 	selector->setLocation (selection->value ());
+	updateColor ();
 
 	updating = false;
 	changed ();
@@ -81,4 +84,28 @@
 	selection->setValue (selector->getLocation ());
 }
 
+bool RKPluginBrowser::isValid () {
+	return (!(selection->value ().isEmpty ()));
+}
+
+void RKPluginBrowser::requirednessChanged (RKComponentPropertyBase *) {
+	RK_TRACE (PLUGIN);
+
+	updateColor ();
+}
+
+void RKPluginBrowser::updateColor () {
+	RK_TRACE (PLUGIN);
+
+	if (isEnabled ()) {
+		if (isSatisfied ()) {
+			selector->setBackgroundColor (QColor (255, 255, 255));
+		} else {
+			selector->setBackgroundColor (QColor (255, 0, 0));
+		}
+	} else {
+		selector->setBackgroundColor (QColor (200, 200, 200));
+	}
+}
+
 #include "rkpluginbrowser.moc"

Modified: trunk/rkward/rkward/plugin/rkpluginbrowser.h
===================================================================
--- trunk/rkward/rkward/plugin/rkpluginbrowser.h	2007-02-01 15:13:30 UTC (rev 1277)
+++ trunk/rkward/rkward/plugin/rkpluginbrowser.h	2007-02-01 15:30:08 UTC (rev 1278)
@@ -2,7 +2,7 @@
                           rkpluginbrowser  -  description
                              -------------------
     begin                : Sat Mar 10 2005
-    copyright            : (C) 2005, 2006 by Thomas Friedrichsmeier
+    copyright            : (C) 2005, 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -42,10 +42,13 @@
 	RKComponentPropertyBase *selection;
 	QString value (const QString &modifier) { return (selection->value (modifier)); };
 	int type () { return ComponentBrowser; };
+	bool isValid ();
 public slots:
 	void textChanged ();
 	void textChanged (RKComponentPropertyBase *);
+	void requirednessChanged (RKComponentPropertyBase *);
 private:
+	void updateColor ();
 	GetFileNameWidget *selector;
 	bool updating;
 };

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml	2007-02-01 15:13:30 UTC (rev 1277)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.xml	2007-02-01 15:30:08 UTC (rev 1278)
@@ -11,6 +11,7 @@
 
 		<convert id="userow" mode="equals" sources="rowname.string" standard="rowcol" />
 		<convert id="customizerow" mode="equals" sources="rowname.string" standard="custoRow" />
+		<convert id="customizerow2" mode="and" sources="isrow.state;customizerow" standard="custoRow" />
 		<connect client="nomrow.enabled" governor="userow" />
 		<connect client="nomrow.required" governor="userow" />
 		<connect client="rownames.enabled" governor="customizerow" />
@@ -62,7 +63,7 @@
 					<option value="" label="Default" />
 					<option value="custoClass" label="Use a character vector" />
 				</radio>
-				<input id="custClasses" label="Vector of column classes (quoted)" />
+				<input id="custoClasses" label="Vector of column classes (quoted)" />
 			</tab>
 			<tab label="Options" >
 				<row>

Modified: trunk/rkward/rkward/plugins/Makefile.am
===================================================================
--- trunk/rkward/rkward/plugins/Makefile.am	2007-02-01 15:13:30 UTC (rev 1277)
+++ trunk/rkward/rkward/plugins/Makefile.am	2007-02-01 15:30:08 UTC (rev 1278)
@@ -206,10 +206,6 @@
 	00saveload/load/source/description.xml
 
 pluginsX00saveloadXloadXreadtabledir = $(kde_datadir)/rkward/00saveload/load/readtable
-dist_pluginsX00saveloadXloadXreadtable_DATA = \
-	00saveload/load/readtable/code.php \
-	00saveload/load/readtable/description.xml
-
 pluginsX00saveloadXsavedir = $(kde_datadir)/rkward/00saveload/save
 pluginsX00saveloadXsaveXskeletondir = $(kde_datadir)/rkward/00saveload/save/skeleton
 dist_pluginsX00saveloadXsaveXskeleton_DATA = \
@@ -230,7 +226,9 @@
 dist_pluginsX00saveloadXimport_DATA = \
 	00saveload/import/import_spss.xml \
 	00saveload/import/import_spss.php \
-	00saveload/import/import_spss.rkh
+	00saveload/import/import_spss.rkh \
+	00saveload/import/import_csv.php \
+	00saveload/import/import_csv.xml
 
 pluginsXanalysisdir = $(kde_datadir)/rkward/analysis
 pluginsXanalysisXansariUbradleydir = $(kde_datadir)/rkward/analysis/ansari_bradley


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