[chronojump] CSV support 50%
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] CSV support 50%
- Date: Wed, 9 Apr 2014 13:18:32 +0000 (UTC)
commit f58c360c431720ba95245e157309e3ac88baa8b3
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Apr 9 15:17:48 2014 +0200
CSV support 50%
glade/chronojump.glade | 329 +++++++++++++++++++++++++++++++++++++--
images/import-csv-headers.png | Bin 0 -> 269 bytes
images/import-csv-noheaders.png | Bin 0 -> 266 bytes
images/svg/icons.svg | 189 ++++++++++++++++++++---
src/Makefile.am | 2 +
src/constants.cs | 2 +
src/gui/person.cs | 79 +++++++++-
7 files changed, 555 insertions(+), 46 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 46ecf2b..f6017be 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -5236,6 +5236,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -5850,6 +5853,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
@@ -6600,6 +6606,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -7109,6 +7118,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -16411,6 +16423,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -16828,6 +16843,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -17676,6 +17694,12 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -24217,15 +24241,15 @@ options</property>
<property name="border_width">10</property>
<property name="title" translatable="yes">Add/Edit multiple persons</property>
<property name="modal">True</property>
- <property name="default_width">400</property>
- <property name="default_height">450</property>
+ <property name="default_width">500</property>
+ <property name="default_height">500</property>
<property name="type_hint">dialog</property>
<signal name="delete_event" handler="on_delete_event" swapped="no"/>
<child>
<widget class="GtkVBox" id="vbox_main">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">10</property>
+ <property name="spacing">20</property>
<child>
<widget class="GtkLabel" id="label502">
<property name="visible">True</property>
@@ -24239,6 +24263,244 @@ options</property>
</packing>
</child>
<child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkRadioButton" id="radio_csv">
+ <property name="label" translatable="yes">Add entries from CSV (spreadsheet)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_radio_csv_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox_csv">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkCheckButton" id="check_headers">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">False</property>
+ <signal name="toggled" handler="on_check_headers_toggled" swapped="no"/>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkImage" id="image_csv_headers">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip" translatable="yes">CSV file has headers</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon-size">2</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkImage" id="image_csv_noheaders">
+ <property name="width_request">16</property>
+ <property name="height_request">16</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip" translatable="yes">CSV file does not have
headers</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon-size">2</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_csv_load">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_button_csv_load_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-open</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_csv_help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_button_csv_help_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-info</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkRadioButton" id="radio_manually">
+ <property name="label" translatable="yes">Add entries manually</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_csv</property>
+ <signal name="toggled" handler="on_radio_manually_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox_manually">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkSpinButton" id="spin_manually">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="width_chars">2</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">40 1 40 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_manually_create">
+ <property name="label" translatable="yes">Create</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_button_manually_create_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_manually_help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_button_manually_help_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-info</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkScrolledWindow" id="scrolledwindow33">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -24413,6 +24675,24 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -24421,7 +24701,19 @@ options</property>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label_sport_stuff">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -24465,19 +24757,7 @@ options</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label_sport_stuff">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
</widget>
@@ -25402,6 +25682,9 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -25878,6 +26161,9 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -27659,6 +27945,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -27740,6 +28029,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -27836,6 +28128,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/images/import-csv-headers.png b/images/import-csv-headers.png
new file mode 100644
index 0000000..67f493f
Binary files /dev/null and b/images/import-csv-headers.png differ
diff --git a/images/import-csv-noheaders.png b/images/import-csv-noheaders.png
new file mode 100644
index 0000000..376baf1
Binary files /dev/null and b/images/import-csv-noheaders.png differ
diff --git a/images/svg/icons.svg b/images/svg/icons.svg
index 720f0ba..0016826 100644
--- a/images/svg/icons.svg
+++ b/images/svg/icons.svg
@@ -9,8 +9,8 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="124.24907"
- height="161.54089"
+ width="124.29959"
+ height="189.69408"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
@@ -27,9 +27,9 @@
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
- inkscape:zoom="3.0977285"
- inkscape:cx="63.66256"
- inkscape:cy="72.120534"
+ inkscape:zoom="2.9573933"
+ inkscape:cx="62.149796"
+ inkscape:cy="96.030513"
inkscape:document-units="px"
inkscape:current-layer="capa1"
showgrid="false"
@@ -42,39 +42,39 @@
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
- showguides="true"
+ showguides="false"
inkscape:guide-bbox="true">
<sodipodi:guide
orientation="1,0"
- position="82.683664,-4.558999"
+ position="82.734186,23.594188"
id="guide5151" />
<sodipodi:guide
orientation="1,0"
- position="66.67536,6.6830781"
+ position="66.725882,34.836265"
id="guide3927" />
<sodipodi:guide
orientation="0,1"
- position="68.867133,14.638695"
+ position="68.917655,42.791882"
id="guide4203" />
<sodipodi:guide
orientation="0,1"
- position="76.882085,16.007244"
+ position="76.932607,44.160431"
id="guide4353" />
<sodipodi:guide
orientation="0,1"
- position="74.161642,1.4193616"
+ position="74.212164,29.572549"
id="guide4379" />
<sodipodi:guide
orientation="1,0"
- position="101.00718,-0.52367246"
+ position="101.0577,27.629515"
id="guide4687" />
<sodipodi:guide
orientation="1,0"
- position="90.53604,-19.990189"
+ position="90.586562,8.1629982"
id="guide4689" />
<sodipodi:guide
orientation="1,0"
- position="111.32512,3.8890873"
+ position="111.37564,32.042275"
id="guide4885" />
</sodipodi:namedview>
<metadata
@@ -93,7 +93,7 @@
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="capa1"
- transform="translate(63.113403,-966.91272)">
+ transform="translate(63.163925,-966.91272)">
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
@@ -896,15 +896,15 @@
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
- x="-61.646904"
- y="1106.1874"
+ x="-63.352402"
+ y="1140.8658"
id="text3938-3-00-9"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3940-6-5-3"
- x="-61.646904"
- y="1106.1874"
- style="font-size:2px">encoder-analyze-mean.png</tspan></text>
+ x="-63.352402"
+ y="1140.8658"
+ style="font-size:2px">import-csv-noheaders.png</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
@@ -922,7 +922,7 @@
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/encoder-analyze-time-to-pp.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- transform="translate(12.811082,19.559548)">
+ transform="translate(5.3072664,27.063364)">
<rect
y="1112.4536"
x="35.400635"
@@ -1266,5 +1266,152 @@
</g>
</g>
</g>
+ <g
+ id="g4280"
+ transform="translate(124.31005,2.7630508)"
+
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/import-csv-headers.png"
+ inkscape:export-xdpi="131.28"
+ inkscape:export-ydpi="131.28">
+ <rect
+ y="1143.0758"
+ x="-148.87717"
+ height="10.513939"
+ width="10.459879"
+ id="rect4237-8"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <g
+ id="g4257">
+ <rect
+ style="fill:#ff0300;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="rect4175"
+ width="10.317783"
+ height="3.4327226"
+ x="-85.719986"
+ y="176.25256"
+ transform="translate(-63.113403,966.91272)" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.676;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -148.79357,1143.6018 0,9.3133"
+ id="path3202-61"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.57188946;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -145.34557,1143.7165 0,9.399"
+ id="path3202-6-1"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.57188946;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -141.94964,1143.7165 0,9.399"
+ id="path3202-9-49"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.676;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -138.50165,1143.7686 0,9.2948"
+ id="path3202-4-8"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.70920277;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -138.5175,1143.1852 -10.25645,0"
+ id="path3202-46-5"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.59722948;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -138.46227,1146.6354 -10.36734,0"
+ id="path3202-6-2-0"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.59722948;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -138.46227,1150.0295 -10.36734,0"
+ id="path3202-9-4-8"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.70985222;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -138.51858,1153.48 -10.25472,0"
+ id="path3202-4-3-2"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <g
+ id="g4268"
+ transform="translate(109.15005,2.3989023)"
+
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/import-csv-noheaders.png"
+ inkscape:export-xdpi="131.28"
+ inkscape:export-ydpi="131.28">
+ <rect
+ y="1143.4399"
+ x="-163.93736"
+ height="10.513939"
+ width="10.459879"
+ id="rect4237"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <g
+ transform="translate(0.0514411,4.8495102e-5)"
+ id="g4227">
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.676;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -163.9052,1143.9659 0,9.3133"
+ id="path3202-61-1"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.57188946;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -160.4572,1144.0806 0,9.399"
+ id="path3202-6-1-3"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.57188946;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -157.06127,1144.0806 0,9.399"
+ id="path3202-9-49-1"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:none;stroke:#000000;stroke-width:0.676;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -153.61328,1144.1327 0,9.2948"
+ id="path3202-4-8-3"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.70920277;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -153.62913,1143.5493 -10.25645,0"
+ id="path3202-46-5-7"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.59722948;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -153.5739,1146.9995 -10.36734,0"
+ id="path3202-6-2-0-6"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.59722948;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -153.5739,1150.3936 -10.36734,0"
+ id="path3202-9-4-8-9"
+ inkscape:connector-curvature="0" />
+ <path
+
style="fill:#f4e12e;fill-opacity:1;stroke:#000000;stroke-width:0.70985222;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m -153.63021,1153.8441 -10.25472,0"
+ id="path3202-4-3-2-9"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <text
+ xml:space="preserve"
+
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="-58.739815"
+ y="1104.9388"
+ id="text3938-3-00-9-1"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3940-6-5-3-3"
+ x="-58.739815"
+ y="1104.9388"
+ style="font-size:2px">encoder-analyze-mean.png</tspan></text>
+ <text
+ xml:space="preserve"
+
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="-28.920055"
+ y="1141.1334"
+ id="text3938-3-00-9-17"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3940-6-5-3-9"
+ x="-28.920055"
+ y="1141.1334"
+ style="font-size:2px">import-csv-headers.png</tspan></text>
</g>
</svg>
diff --git a/src/Makefile.am b/src/Makefile.am
index 2961cff..1801f74 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -263,6 +263,8 @@ RESOURCES = \
../images/gtk-open.png,gtk-open.png \
../images/gtk-open-1.png,gtk-open-1.png \
../images/gtk-open-plus.png,gtk-open-plus.png \
+ ../images/import-csv-noheaders.png,import-csv-noheaders.png \
+ ../images/import-csv-headers.png,import-csv-headers.png \
../images/calendar.png,calendar.png \
../images/chronojump-logo-2013_320.png,chronojump-logo-2013_320.png \
../images/chronojump-logo-2013.png,chronojump-logo-2013.png \
diff --git a/src/constants.cs b/src/constants.cs
index 2c2efbb..d5977bc 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -370,6 +370,8 @@ public class Constants
public static string FileNameOpen = "gtk-open.png";
public static string FileNameOpen1 = "gtk-open-1.png";
public static string FileNameOpenPlus = "gtk-open-plus.png";
+ public static string FileNameCSVHeadersIcon = "import-csv-headers.png";
+ public static string FileNameCSVNoHeadersIcon = "import-csv-noheaders.png";
public static string FileNameJumps = "stock_up.png";
public static string FileNameJumpsRJ = "stock_up_down.png";
diff --git a/src/gui/person.cs b/src/gui/person.cs
index f735e49..bf91841 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -1775,6 +1775,17 @@ public class PersonAddModifyWindow
public class PersonAddMultipleWindow {
[Widget] Gtk.Window person_multiple_infinite;
+
+ [Widget] Gtk.RadioButton radio_csv;
+ [Widget] Gtk.RadioButton radio_manually;
+ [Widget] Gtk.Box hbox_csv;
+ [Widget] Gtk.Box hbox_manually;
+
+ [Widget] Gtk.Image image_csv_headers;
+ [Widget] Gtk.Image image_csv_noheaders;
+ [Widget] Gtk.CheckButton check_headers;
+ [Widget] Gtk.Button button_csv_load;
+ [Widget] Gtk.Button button_csv_help;
ArrayList entries;
ArrayList radiosM;
@@ -1814,6 +1825,9 @@ public class PersonAddMultipleWindow {
if (PersonAddMultipleWindowBox == null) {
PersonAddMultipleWindowBox = new PersonAddMultipleWindow (parent, currentSession);
}
+
+ PersonAddMultipleWindowBox.putNonStandardIcons ();
+
PersonAddMultipleWindowBox.rows = rows;
PersonAddMultipleWindowBox.create ();
@@ -1833,7 +1847,47 @@ public class PersonAddMultipleWindow {
PersonAddMultipleWindowBox.person_multiple_infinite.Hide();
PersonAddMultipleWindowBox = null;
}
+
+ void putNonStandardIcons() {
+ Pixbuf pixbuf;
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameCSVHeadersIcon);
+ image_csv_headers.Pixbuf = pixbuf;
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameCSVNoHeadersIcon);
+ image_csv_noheaders.Pixbuf = pixbuf;
+ }
+
+ void on_check_headers_toggled (object obj, EventArgs args) {
+ image_csv_headers.Visible = (check_headers.Active == true);
+ image_csv_noheaders.Visible = (check_headers.Active == false);
+ }
+ void on_radio_csv_toggled (object obj, EventArgs args) {
+ if(radio_csv.Active) {
+ hbox_csv.Sensitive = true;
+ hbox_manually.Sensitive = false;
+ }
+ }
+ void on_radio_manually_toggled (object obj, EventArgs args) {
+ if(radio_manually.Active) {
+ hbox_csv.Sensitive = false;
+ hbox_manually.Sensitive = true;
+ }
+ }
+
+ void on_button_csv_load_clicked (object obj, EventArgs args) {
+ Log.WriteLine("csv load");
+ }
+ void on_button_csv_help_clicked (object obj, EventArgs args) {
+ Log.WriteLine("csv help");
+ }
+ void on_button_manually_create_clicked (object obj, EventArgs args) {
+ Log.WriteLine("manually create");
+ }
+ void on_button_manually_help_clicked (object obj, EventArgs args) {
+ Log.WriteLine("manually help");
+ }
+
+
void create() {
entries = new ArrayList();
radiosM = new ArrayList();
@@ -1856,20 +1910,27 @@ public class PersonAddMultipleWindow {
weightLabel.Show();
nameLabel.Show();
sexLabel.Show();
-
+
+ uint padding = 4;
- table_main.Attach (nameLabel, (uint) 1, (uint) 2, 0, 1);
- table_main.Attach (sexLabel, (uint) 2, (uint) 3, 0, 1);
- table_main.Attach (weightLabel, (uint) 3, (uint) 4, 0, 1);
+ table_main.Attach (nameLabel, (uint) 1, (uint) 2, 0, 1,
+ Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand , Gtk.AttachOptions.Shrink,
padding, padding);
+ table_main.Attach (sexLabel, (uint) 2, (uint) 3, 0, 1,
+ Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
+ table_main.Attach (weightLabel, (uint) 3, (uint) 4, 0, 1,
+ Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
for (int count=1; count <= rows; count ++) {
Gtk.Label myLabel = new Gtk.Label((count).ToString());
- table_main.Attach (myLabel, (uint) 0, (uint) 1, (uint) count, (uint) count +1);
+ table_main.Attach (myLabel, (uint) 0, (uint) 1, (uint) count, (uint) count +1,
+ Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
myLabel.Show();
//labels.Add(myLabel);
Gtk.Entry myEntry = new Gtk.Entry();
- table_main.Attach (myEntry, (uint) 1, (uint) 2, (uint) count, (uint) count +1);
+// myEntry.WidthRequest = 250;
+ table_main.Attach (myEntry, (uint) 1, (uint) 2, (uint) count, (uint) count +1,
+ Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand ,
Gtk.AttachOptions.Shrink, padding, padding);
myEntry.Show();
entries.Add(myEntry);
@@ -1886,11 +1947,13 @@ public class PersonAddMultipleWindow {
sexBox.PackStart(myRadioM, false, false, 4);
sexBox.PackStart(myRadioF, false, false, 4);
sexBox.Show();
- table_main.Attach (sexBox, (uint) 2, (uint) 3, (uint) count, (uint) count +1);
+ table_main.Attach (sexBox, (uint) 2, (uint) 3, (uint) count, (uint) count +1,
+ Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
Gtk.SpinButton mySpin = new Gtk.SpinButton(0, 300, .1);
- table_main.Attach (mySpin, (uint) 3, (uint) 4, (uint) count, (uint) count +1);
+ table_main.Attach (mySpin, (uint) 3, (uint) 4, (uint) count, (uint) count +1,
+ Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
mySpin.Show();
spins.Add(mySpin);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]