[rkward-cvs] [rkward] rkward: Restructure element placement, and some wording, in CSV-import.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Sun Nov 23 11:16:05 UTC 2014


Git commit ecfb564f99429c305ece9587e7f3ea2f71112e8e by Thomas Friedrichsmeier.
Committed on 23/11/2014 at 11:14.
Pushed by tfry into branch 'master'.

Restructure element placement, and some wording, in CSV-import.
Should make the plugin more intuitive to use. Thanks for the pointer, Aaron!

M  +1    -0    rkward/plugin/rkabstractoptionselector.cpp
M  +3    -2    rkward/plugins/00saveload/import/import_csv.rkh
M  +36   -35   rkward/plugins/00saveload/import/import_csv.xml

http://commits.kde.org/rkward/ecfb564f99429c305ece9587e7f3ea2f71112e8e

diff --git a/rkward/plugin/rkabstractoptionselector.cpp b/rkward/plugin/rkabstractoptionselector.cpp
index 185be98..c8cd57d 100644
--- a/rkward/plugin/rkabstractoptionselector.cpp
+++ b/rkward/plugin/rkabstractoptionselector.cpp
@@ -175,6 +175,7 @@ void RKAbstractOptionSelector::ItemPropertyChanged (RKComponentPropertyBase *pro
 			}
 			if (settable_opt >= 0) itemSelected (settable_opt);
 			else RK_DEBUG (PLUGIN, DL_ERROR, "No option left enabled. Disable the entire component '%s', instead!", qPrintable (getIdInParent ()));
+			// TODO: Error message below can also trigger, if items first get disabled, then others enabled. Delay it, instead.
 		}
 	}
 
diff --git a/rkward/plugins/00saveload/import/import_csv.rkh b/rkward/plugins/00saveload/import/import_csv.rkh
index 95e5c94..44a8c30 100644
--- a/rkward/plugins/00saveload/import/import_csv.rkh
+++ b/rkward/plugins/00saveload/import/import_csv.rkh
@@ -11,13 +11,14 @@ Choose the CSV file to import. An R object containing the data will be created.
 	<settings>
 		<caption id="tab_general"/>
 		<setting id="file">The filename of the file to import</setting>
-		<setting id="name">The name of an R object to store the imported data in. If you choose an existing symbol name, you will be prompted, whether to overwrite this object.</setting>
-		<setting id="doedit">Whether the object should be opened for editing after it was imported</setting>
+		<setting id="quick">Select from one of the predefined (most common formats), or select "custom", to specify field separator and decimal separtor, below.</setting>
 		<setting id="header">Whether the first row of the file contains should be interpreted as column names</setting>
 		<setting id="dec">Decimal character used in the imported file</setting>
 		<setting id="custom_dec">If you selected "other" above, specify the character, here.</setting>
 		<setting id="sep">The separator character used in the imported file</setting>
 		<setting id="custom_sep">If you selected "other" above, specify the character, here.</setting>
+		<setting id="name">The name of an R object to store the imported data in. If you choose an existing symbol name, you will be prompted, whether to overwrite this object.</setting>
+		<setting id="doedit">Whether the object should be opened for editing after it was imported</setting>
 
 		<caption id="tab_rows"/>
 		<setting id="rowname">How to determine row names? Either the rows can be numbered 1...n. Or you can specify a single column containing the row names (typically the first). Or you can provide a character vector of names.</setting>
diff --git a/rkward/plugins/00saveload/import/import_csv.xml b/rkward/plugins/00saveload/import/import_csv.xml
index e3dc01a..8315890 100644
--- a/rkward/plugins/00saveload/import/import_csv.xml
+++ b/rkward/plugins/00saveload/import/import_csv.xml
@@ -51,7 +51,6 @@
 
 		<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="rownames.enabled" governor="customizerow" />
 
@@ -64,40 +63,42 @@
 		<tabbook>
 			<tab id="tab_general" label="General" >
 				<browser id="file" type="file" label="File name"/>
-				<row>
-					<saveobject id="name" initial="my.csv.data" label="Object to save to"/>
-					<checkbox id="doedit" value="1" value_unchecked="0" label="Edit Object" checked="true" />
-				</row>
-				<row>
-					<column>
-						<radio id="quick" label="Quick mode" >
-							<option value="table" label="None" checked="true"/>
-							<option value="csv" label="CSV" />
-							<option value="csv2" label="CSV2" />
-							<option value="delim" label="TAB" />
-							<option value="delim2" label="TAB2" />
-						</radio>
-					</column>
-					<column>
-						<checkbox id="header" value="TRUE" value_unchecked="FALSE" checked="false" label="Column names in first row"/>
-						<radio id="dec" label="Decimal point character" >
-							<option id="decPeriod" value="'.'" label="'.' (Period)" />
-							<option id="decComma" value="','" label="',' (Comma)" />
-							<option id="decOther" value="other" label="Other (specify below)" />
-						</radio>
-						<input id="custom_dec" label="Specify decimal point character" required="true"/>
-					</column>
-					<column>
-						<radio id="sep" label="Field separator character" >
-							<option id="sepTab" value="'\t'" label="Tab" />
-							<option id="sepSemiC" value="';'" label="';' (Semicolon)" />
-							<option id="sepComma" value="','" label="',' (Comma)" />
-							<option id="sepSpace" value="' '" label="Space" />
-							<option id="sepOther" value="other" label="Other (specify below)" />
-						</radio>
-						<input id="custom_sep" label="Specify field separator character" required="true"/>
-					</column>
-				</row>
+				<dropdown id="quick" label="Data format" >
+					<option value="csv" label="Comma separated values (CSV)" checked="true" />
+					<option value="csv2" label="Semicolo separated values, comma as decimal separator (CSV2)" />
+					<option value="delim" label="Tab separated values (TAB)" />
+					<option value="delim2" label="Tab separated values, comma as decimal separator (TAB2)" />
+					<option value="table" label="Custom"/>
+				</dropdown>
+				<frame>
+					<row>
+						<column>
+							<checkbox id="header" value="TRUE" value_unchecked="FALSE" checked="false" label="Column names in first row"/>
+							<radio id="dec" label="Decimal point character" >
+								<option id="decPeriod" value="'.'" label="'.' (Period)" />
+								<option id="decComma" value="','" label="',' (Comma)" />
+								<option id="decOther" value="other" label="Other (specify below)" />
+							</radio>
+							<input id="custom_dec" label="Specify decimal point character" required="true"/>
+						</column>
+						<column>
+							<radio id="sep" label="Field separator character" >
+								<option id="sepTab" value="'\t'" label="Tab" />
+								<option id="sepSemiC" value="';'" label="';' (Semicolon)" />
+								<option id="sepComma" value="','" label="',' (Comma)" />
+								<option id="sepSpace" value="' '" label="Space" />
+								<option id="sepOther" value="other" label="Other (specify below)" />
+							</radio>
+							<input id="custom_sep" label="Specify field separator character" required="true"/>
+						</column>
+					</row>
+				</frame>
+				<frame>
+					<row>
+						<saveobject id="name" initial="my.csv.data" label="Object to save to"/>
+						<checkbox id="doedit" value="1" value_unchecked="0" label="Edit Object" checked="true" />
+					</row>
+				</frame>
 			</tab>
 			<tab id="tab_rows" label="Rows and Columns" >
 				<row>




More information about the rkward-tracker mailing list