Browse Source

final push

Chris Cromer 5 months ago
parent
commit
d42035e620
Signed by: Chris Cromer <chris@cromer.cl> GPG Key ID: 39CC813FF3C8708A

+ 6
- 0
data/ui/meson.build View File

@@ -17,6 +17,12 @@ tourist_gresource = gnome.compile_resources('tourist_gresource',
17 17
 	c_name: meson.project_name() + '_resource_tourist',
18 18
 	export: true,
19 19
 	install_header: true)
20
+staff_gresource = gnome.compile_resources('staff_gresource',
21
+	'staff.gresource.xml',
22
+	source_dir: '.',
23
+	c_name: meson.project_name() + '_resource_staff',
24
+	export: true,
25
+	install_header: true)
20 26
 place_gresource = gnome.compile_resources('place_gresource',
21 27
 	'place.gresource.xml',
22 28
 	source_dir: '.',

+ 337
- 0
data/ui/staff.editor.ui View File

@@ -0,0 +1,337 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!-- Generated with glade 3.22.1 
3
+
4
+Copyright 2018-2019 Chris Cromer
5
+
6
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+
10
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13
+
14
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
+
16
+-->
17
+<interface domain="sernatur">
18
+  <requires lib="gtk+" version="3.20"/>
19
+  <template class="SernaturStaffEditor" parent="GtkApplicationWindow">
20
+    <property name="can_focus">False</property>
21
+    <property name="type">popup</property>
22
+    <property name="title" translatable="yes">Staff Editor</property>
23
+    <property name="modal">True</property>
24
+    <property name="window_position">center-on-parent</property>
25
+    <property name="destroy_with_parent">True</property>
26
+    <property name="type_hint">dialog</property>
27
+    <property name="skip_taskbar_hint">True</property>
28
+    <property name="skip_pager_hint">True</property>
29
+    <property name="show_menubar">False</property>
30
+    <child>
31
+      <placeholder/>
32
+    </child>
33
+    <child>
34
+      <object class="GtkGrid">
35
+        <property name="visible">True</property>
36
+        <property name="can_focus">False</property>
37
+        <child>
38
+          <object class="GtkLabel">
39
+            <property name="visible">True</property>
40
+            <property name="can_focus">False</property>
41
+            <property name="halign">end</property>
42
+            <property name="margin_left">5</property>
43
+            <property name="margin_right">5</property>
44
+            <property name="margin_top">5</property>
45
+            <property name="margin_bottom">5</property>
46
+            <property name="label" translatable="yes">RUN</property>
47
+          </object>
48
+          <packing>
49
+            <property name="left_attach">0</property>
50
+            <property name="top_attach">0</property>
51
+          </packing>
52
+        </child>
53
+        <child>
54
+          <object class="GtkEntry" id="run">
55
+            <property name="visible">True</property>
56
+            <property name="can_focus">True</property>
57
+            <property name="margin_left">5</property>
58
+            <property name="margin_right">5</property>
59
+            <property name="margin_top">5</property>
60
+            <property name="margin_bottom">5</property>
61
+            <property name="hexpand">True</property>
62
+            <property name="max_length">50</property>
63
+            <property name="caps_lock_warning">False</property>
64
+          </object>
65
+          <packing>
66
+            <property name="left_attach">1</property>
67
+            <property name="top_attach">0</property>
68
+          </packing>
69
+        </child>
70
+        <child>
71
+          <object class="GtkLabel">
72
+            <property name="visible">True</property>
73
+            <property name="can_focus">False</property>
74
+            <property name="halign">end</property>
75
+            <property name="margin_left">5</property>
76
+            <property name="margin_right">5</property>
77
+            <property name="margin_top">5</property>
78
+            <property name="margin_bottom">5</property>
79
+            <property name="label" translatable="yes">Name</property>
80
+          </object>
81
+          <packing>
82
+            <property name="left_attach">0</property>
83
+            <property name="top_attach">1</property>
84
+          </packing>
85
+        </child>
86
+        <child>
87
+          <object class="GtkLabel">
88
+            <property name="visible">True</property>
89
+            <property name="can_focus">False</property>
90
+            <property name="halign">end</property>
91
+            <property name="margin_left">5</property>
92
+            <property name="margin_right">5</property>
93
+            <property name="margin_top">5</property>
94
+            <property name="margin_bottom">5</property>
95
+            <property name="label" translatable="yes">Street</property>
96
+          </object>
97
+          <packing>
98
+            <property name="left_attach">0</property>
99
+            <property name="top_attach">2</property>
100
+          </packing>
101
+        </child>
102
+        <child>
103
+          <object class="GtkLabel">
104
+            <property name="visible">True</property>
105
+            <property name="can_focus">False</property>
106
+            <property name="halign">end</property>
107
+            <property name="margin_left">5</property>
108
+            <property name="margin_right">5</property>
109
+            <property name="margin_top">5</property>
110
+            <property name="margin_bottom">5</property>
111
+            <property name="label" translatable="yes">Region</property>
112
+          </object>
113
+          <packing>
114
+            <property name="left_attach">0</property>
115
+            <property name="top_attach">4</property>
116
+          </packing>
117
+        </child>
118
+        <child>
119
+          <object class="GtkEntry" id="guide_name">
120
+            <property name="visible">True</property>
121
+            <property name="can_focus">True</property>
122
+            <property name="margin_left">5</property>
123
+            <property name="margin_right">5</property>
124
+            <property name="margin_top">5</property>
125
+            <property name="margin_bottom">5</property>
126
+            <property name="hexpand">True</property>
127
+            <property name="max_length">50</property>
128
+            <property name="caps_lock_warning">False</property>
129
+          </object>
130
+          <packing>
131
+            <property name="left_attach">1</property>
132
+            <property name="top_attach">1</property>
133
+          </packing>
134
+        </child>
135
+        <child>
136
+          <object class="GtkEntry" id="street">
137
+            <property name="visible">True</property>
138
+            <property name="can_focus">True</property>
139
+            <property name="margin_left">5</property>
140
+            <property name="margin_right">5</property>
141
+            <property name="margin_top">5</property>
142
+            <property name="margin_bottom">5</property>
143
+            <property name="hexpand">True</property>
144
+            <property name="max_length">50</property>
145
+            <property name="caps_lock_warning">False</property>
146
+          </object>
147
+          <packing>
148
+            <property name="left_attach">1</property>
149
+            <property name="top_attach">2</property>
150
+          </packing>
151
+        </child>
152
+        <child>
153
+          <object class="GtkLabel">
154
+            <property name="visible">True</property>
155
+            <property name="can_focus">False</property>
156
+            <property name="halign">end</property>
157
+            <property name="margin_left">5</property>
158
+            <property name="margin_right">5</property>
159
+            <property name="margin_top">5</property>
160
+            <property name="margin_bottom">5</property>
161
+            <property name="label" translatable="yes">City</property>
162
+          </object>
163
+          <packing>
164
+            <property name="left_attach">0</property>
165
+            <property name="top_attach">5</property>
166
+          </packing>
167
+        </child>
168
+        <child>
169
+          <object class="GtkComboBoxText" id="region">
170
+            <property name="visible">True</property>
171
+            <property name="can_focus">True</property>
172
+            <property name="focus_on_click">False</property>
173
+            <property name="margin_left">5</property>
174
+            <property name="margin_right">5</property>
175
+            <property name="margin_top">5</property>
176
+            <property name="margin_bottom">5</property>
177
+            <property name="hexpand">True</property>
178
+            <property name="has_entry">True</property>
179
+            <property name="popup_fixed_width">False</property>
180
+            <signal name="changed" handler="on_changed_combobox" swapped="no"/>
181
+            <child internal-child="entry">
182
+              <object class="GtkEntry">
183
+                <property name="visible">True</property>
184
+                <property name="can_focus">True</property>
185
+                <property name="tooltip_text" translatable="yes">Create a new region by typing here.</property>
186
+                <property name="hexpand">True</property>
187
+                <property name="max_length">50</property>
188
+                <property name="caps_lock_warning">False</property>
189
+              </object>
190
+            </child>
191
+          </object>
192
+          <packing>
193
+            <property name="left_attach">1</property>
194
+            <property name="top_attach">4</property>
195
+          </packing>
196
+        </child>
197
+        <child>
198
+          <object class="GtkComboBoxText" id="city">
199
+            <property name="visible">True</property>
200
+            <property name="can_focus">True</property>
201
+            <property name="focus_on_click">False</property>
202
+            <property name="margin_left">5</property>
203
+            <property name="margin_right">5</property>
204
+            <property name="margin_top">5</property>
205
+            <property name="margin_bottom">5</property>
206
+            <property name="hexpand">True</property>
207
+            <property name="has_entry">True</property>
208
+            <property name="popup_fixed_width">False</property>
209
+            <child internal-child="entry">
210
+              <object class="GtkEntry" id="city_entry">
211
+                <property name="visible">True</property>
212
+                <property name="can_focus">True</property>
213
+                <property name="tooltip_text" translatable="yes">Create a new city by typing here.</property>
214
+                <property name="hexpand">True</property>
215
+                <property name="max_length">50</property>
216
+                <property name="caps_lock_warning">False</property>
217
+              </object>
218
+            </child>
219
+          </object>
220
+          <packing>
221
+            <property name="left_attach">1</property>
222
+            <property name="top_attach">5</property>
223
+          </packing>
224
+        </child>
225
+        <child>
226
+          <object class="GtkBox">
227
+            <property name="visible">True</property>
228
+            <property name="can_focus">False</property>
229
+            <property name="margin_left">5</property>
230
+            <property name="margin_right">5</property>
231
+            <property name="margin_top">5</property>
232
+            <property name="margin_bottom">5</property>
233
+            <property name="hexpand">True</property>
234
+            <property name="spacing">25</property>
235
+            <property name="homogeneous">True</property>
236
+            <child>
237
+              <object class="GtkButton" id="cancel">
238
+                <property name="label" translatable="yes">Cancel</property>
239
+                <property name="visible">True</property>
240
+                <property name="can_focus">True</property>
241
+                <property name="receives_default">True</property>
242
+                <property name="tooltip_text" translatable="yes">Cancel the modification of this guide.</property>
243
+                <property name="margin_left">5</property>
244
+                <property name="margin_right">5</property>
245
+                <property name="margin_top">5</property>
246
+                <property name="margin_bottom">5</property>
247
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
248
+              </object>
249
+              <packing>
250
+                <property name="expand">False</property>
251
+                <property name="fill">True</property>
252
+                <property name="position">0</property>
253
+              </packing>
254
+            </child>
255
+            <child>
256
+              <object class="GtkButton" id="specialties">
257
+                <property name="label" translatable="yes">Specialties</property>
258
+                <property name="visible">True</property>
259
+                <property name="can_focus">True</property>
260
+                <property name="receives_default">True</property>
261
+                <property name="tooltip_text" translatable="yes">Add specialties to this guide.</property>
262
+                <property name="margin_left">5</property>
263
+                <property name="margin_right">5</property>
264
+                <property name="margin_top">5</property>
265
+                <property name="margin_bottom">5</property>
266
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
267
+              </object>
268
+              <packing>
269
+                <property name="expand">False</property>
270
+                <property name="fill">True</property>
271
+                <property name="position">1</property>
272
+              </packing>
273
+            </child>
274
+            <child>
275
+              <object class="GtkButton" id="save">
276
+                <property name="label" translatable="yes">Save</property>
277
+                <property name="visible">True</property>
278
+                <property name="can_focus">True</property>
279
+                <property name="receives_default">True</property>
280
+                <property name="tooltip_text" translatable="yes">Save this guide.</property>
281
+                <property name="margin_left">5</property>
282
+                <property name="margin_right">5</property>
283
+                <property name="margin_top">5</property>
284
+                <property name="margin_bottom">5</property>
285
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
286
+              </object>
287
+              <packing>
288
+                <property name="expand">False</property>
289
+                <property name="fill">True</property>
290
+                <property name="position">2</property>
291
+              </packing>
292
+            </child>
293
+          </object>
294
+          <packing>
295
+            <property name="left_attach">0</property>
296
+            <property name="top_attach">6</property>
297
+            <property name="width">2</property>
298
+          </packing>
299
+        </child>
300
+        <child>
301
+          <object class="GtkLabel">
302
+            <property name="visible">True</property>
303
+            <property name="can_focus">False</property>
304
+            <property name="halign">end</property>
305
+            <property name="margin_left">5</property>
306
+            <property name="margin_right">5</property>
307
+            <property name="margin_top">5</property>
308
+            <property name="margin_bottom">5</property>
309
+            <property name="label" translatable="yes">Number</property>
310
+          </object>
311
+          <packing>
312
+            <property name="left_attach">0</property>
313
+            <property name="top_attach">3</property>
314
+          </packing>
315
+        </child>
316
+        <child>
317
+          <object class="GtkEntry" id="number">
318
+            <property name="visible">True</property>
319
+            <property name="can_focus">True</property>
320
+            <property name="margin_left">5</property>
321
+            <property name="margin_right">5</property>
322
+            <property name="margin_top">5</property>
323
+            <property name="margin_bottom">5</property>
324
+            <property name="hexpand">True</property>
325
+            <property name="max_length">10</property>
326
+            <property name="caps_lock_warning">False</property>
327
+            <property name="input_purpose">number</property>
328
+          </object>
329
+          <packing>
330
+            <property name="left_attach">1</property>
331
+            <property name="top_attach">3</property>
332
+          </packing>
333
+        </child>
334
+      </object>
335
+    </child>
336
+  </template>
337
+</interface>

+ 22
- 0
data/ui/staff.gresource.xml View File

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!--
3
+  ~ Copyright 2018-2019 Chris Cromer
4
+  ~
5
+  ~ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+  ~
7
+  ~ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+  ~
9
+  ~ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+  ~
11
+  ~ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
+  ~
13
+  ~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
+  -->
15
+<gresources>
16
+	<gresource prefix="/cl/cromer/ubb/sernatur">
17
+		<file preprocess="xml-stripblanks">staff.list.ui</file>
18
+		<file preprocess="xml-stripblanks">staff.editor.ui</file>
19
+		<file preprocess="xml-stripblanks">staff.specialties.ui</file>
20
+		<file preprocess="xml-stripblanks">staff.specialty.editor.ui</file>
21
+	</gresource>
22
+</gresources>

+ 235
- 0
data/ui/staff.list.ui View File

@@ -0,0 +1,235 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!-- Generated with glade 3.22.1 
3
+
4
+Copyright 2018-2019 Chris Cromer
5
+
6
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+
10
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13
+
14
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
+
16
+-->
17
+<interface domain="sernatur">
18
+  <requires lib="gtk+" version="3.20"/>
19
+  <object class="GtkListStore" id="liststore1"/>
20
+  <template class="SernaturStaffList" parent="GtkApplicationWindow">
21
+    <property name="can_focus">False</property>
22
+    <property name="type">popup</property>
23
+    <property name="title" translatable="yes">Staff</property>
24
+    <property name="modal">True</property>
25
+    <property name="window_position">center-on-parent</property>
26
+    <property name="default_height">480</property>
27
+    <property name="destroy_with_parent">True</property>
28
+    <property name="type_hint">dialog</property>
29
+    <property name="skip_taskbar_hint">True</property>
30
+    <property name="skip_pager_hint">True</property>
31
+    <property name="show_menubar">False</property>
32
+    <child type="titlebar">
33
+      <placeholder/>
34
+    </child>
35
+    <child>
36
+      <object class="GtkGrid">
37
+        <property name="visible">True</property>
38
+        <property name="can_focus">True</property>
39
+        <child>
40
+          <object class="GtkScrolledWindow">
41
+            <property name="visible">True</property>
42
+            <property name="can_focus">True</property>
43
+            <property name="hexpand">True</property>
44
+            <property name="vexpand">True</property>
45
+            <property name="hscrollbar_policy">never</property>
46
+            <property name="shadow_type">in</property>
47
+            <child>
48
+              <object class="GtkTreeView" id="staff_tree">
49
+                <property name="visible">True</property>
50
+                <property name="can_focus">True</property>
51
+                <property name="hexpand">True</property>
52
+                <property name="vexpand">True</property>
53
+                <property name="hscroll_policy">natural</property>
54
+                <property name="vscroll_policy">natural</property>
55
+                <property name="model">liststore1</property>
56
+                <property name="fixed_height_mode">True</property>
57
+                <property name="enable_grid_lines">both</property>
58
+                <property name="enable_tree_lines">True</property>
59
+                <child internal-child="selection">
60
+                  <object class="GtkTreeSelection" id="selection">
61
+                    <property name="mode">multiple</property>
62
+                    <signal name="changed" handler="on_changed_selection" swapped="no"/>
63
+                  </object>
64
+                </child>
65
+                <child>
66
+                  <object class="GtkTreeViewColumn" id="run">
67
+                    <property name="sizing">fixed</property>
68
+                    <property name="title" translatable="yes">RUN</property>
69
+                    <property name="clickable">True</property>
70
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
71
+                    <child>
72
+                      <object class="GtkCellRendererText"/>
73
+                      <attributes>
74
+                        <attribute name="markup">0</attribute>
75
+                      </attributes>
76
+                    </child>
77
+                  </object>
78
+                </child>
79
+                <child>
80
+                  <object class="GtkTreeViewColumn" id="guide_name">
81
+                    <property name="sizing">fixed</property>
82
+                    <property name="title" translatable="yes">Name</property>
83
+                    <property name="clickable">True</property>
84
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
85
+                    <child>
86
+                      <object class="GtkCellRendererText"/>
87
+                      <attributes>
88
+                        <attribute name="markup">1</attribute>
89
+                      </attributes>
90
+                    </child>
91
+                  </object>
92
+                </child>
93
+                <child>
94
+                  <object class="GtkTreeViewColumn" id="street">
95
+                    <property name="sizing">fixed</property>
96
+                    <property name="title" translatable="yes">Street</property>
97
+                    <property name="clickable">True</property>
98
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
99
+                    <child>
100
+                      <object class="GtkCellRendererText"/>
101
+                      <attributes>
102
+                        <attribute name="markup">2</attribute>
103
+                      </attributes>
104
+                    </child>
105
+                  </object>
106
+                </child>
107
+                <child>
108
+                  <object class="GtkTreeViewColumn" id="number">
109
+                    <property name="sizing">fixed</property>
110
+                    <property name="title" translatable="yes">Number</property>
111
+                    <property name="clickable">True</property>
112
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
113
+                    <child>
114
+                      <object class="GtkCellRendererText"/>
115
+                      <attributes>
116
+                        <attribute name="markup">3</attribute>
117
+                      </attributes>
118
+                    </child>
119
+                  </object>
120
+                </child>
121
+                <child>
122
+                  <object class="GtkTreeViewColumn" id="city">
123
+                    <property name="sizing">fixed</property>
124
+                    <property name="title" translatable="yes">City</property>
125
+                    <property name="clickable">True</property>
126
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
127
+                    <child>
128
+                      <object class="GtkCellRendererText"/>
129
+                      <attributes>
130
+                        <attribute name="markup">4</attribute>
131
+                      </attributes>
132
+                    </child>
133
+                  </object>
134
+                </child>
135
+                <child>
136
+                  <object class="GtkTreeViewColumn" id="region">
137
+                    <property name="sizing">fixed</property>
138
+                    <property name="title" translatable="yes">Region</property>
139
+                    <property name="clickable">True</property>
140
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
141
+                    <child>
142
+                      <object class="GtkCellRendererText"/>
143
+                      <attributes>
144
+                        <attribute name="markup">5</attribute>
145
+                      </attributes>
146
+                    </child>
147
+                  </object>
148
+                </child>
149
+              </object>
150
+            </child>
151
+          </object>
152
+          <packing>
153
+            <property name="left_attach">0</property>
154
+            <property name="top_attach">0</property>
155
+          </packing>
156
+        </child>
157
+        <child>
158
+          <object class="GtkGrid">
159
+            <property name="visible">True</property>
160
+            <property name="can_focus">True</property>
161
+            <property name="margin_left">5</property>
162
+            <property name="margin_right">5</property>
163
+            <property name="margin_top">5</property>
164
+            <property name="margin_bottom">5</property>
165
+            <property name="hexpand">True</property>
166
+            <property name="column_spacing">25</property>
167
+            <property name="column_homogeneous">True</property>
168
+            <child>
169
+              <object class="GtkButton" id="edit_staff">
170
+                <property name="label" translatable="yes">Edit</property>
171
+                <property name="visible">True</property>
172
+                <property name="sensitive">False</property>
173
+                <property name="can_focus">True</property>
174
+                <property name="receives_default">True</property>
175
+                <property name="tooltip_text" translatable="yes">Edit selected staff member.</property>
176
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
177
+              </object>
178
+              <packing>
179
+                <property name="left_attach">1</property>
180
+                <property name="top_attach">0</property>
181
+              </packing>
182
+            </child>
183
+            <child>
184
+              <object class="GtkButton" id="new_staff">
185
+                <property name="label" translatable="yes">New</property>
186
+                <property name="visible">True</property>
187
+                <property name="can_focus">True</property>
188
+                <property name="receives_default">True</property>
189
+                <property name="tooltip_text" translatable="yes">Create a new staff member.</property>
190
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
191
+              </object>
192
+              <packing>
193
+                <property name="left_attach">0</property>
194
+                <property name="top_attach">0</property>
195
+              </packing>
196
+            </child>
197
+            <child>
198
+              <object class="GtkButton" id="delete_staff">
199
+                <property name="label" translatable="yes">Delete</property>
200
+                <property name="visible">True</property>
201
+                <property name="sensitive">False</property>
202
+                <property name="can_focus">True</property>
203
+                <property name="receives_default">True</property>
204
+                <property name="tooltip_text" translatable="yes">Delete selected staff member.</property>
205
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
206
+              </object>
207
+              <packing>
208
+                <property name="left_attach">2</property>
209
+                <property name="top_attach">0</property>
210
+              </packing>
211
+            </child>
212
+            <child>
213
+              <object class="GtkButton" id="close_staff">
214
+                <property name="label" translatable="yes">Close</property>
215
+                <property name="visible">True</property>
216
+                <property name="can_focus">True</property>
217
+                <property name="receives_default">True</property>
218
+                <property name="tooltip_text" translatable="yes">Close this window.</property>
219
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
220
+              </object>
221
+              <packing>
222
+                <property name="left_attach">3</property>
223
+                <property name="top_attach">0</property>
224
+              </packing>
225
+            </child>
226
+          </object>
227
+          <packing>
228
+            <property name="left_attach">0</property>
229
+            <property name="top_attach">1</property>
230
+          </packing>
231
+        </child>
232
+      </object>
233
+    </child>
234
+  </template>
235
+</interface>

+ 149
- 0
data/ui/staff.specialties.ui View File

@@ -0,0 +1,149 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!-- Generated with glade 3.22.1 
3
+
4
+Copyright 2018-2019 Chris Cromer
5
+
6
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+
10
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13
+
14
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
+
16
+-->
17
+<interface domain="sernatur">
18
+  <requires lib="gtk+" version="3.20"/>
19
+  <object class="GtkListStore" id="liststore1"/>
20
+  <template class="SernaturTouristIllnesses" parent="GtkApplicationWindow">
21
+    <property name="can_focus">False</property>
22
+    <property name="type">popup</property>
23
+    <property name="title" translatable="yes">Illnesses</property>
24
+    <property name="modal">True</property>
25
+    <property name="window_position">center-on-parent</property>
26
+    <property name="default_height">480</property>
27
+    <property name="destroy_with_parent">True</property>
28
+    <property name="type_hint">dialog</property>
29
+    <property name="skip_taskbar_hint">True</property>
30
+    <property name="skip_pager_hint">True</property>
31
+    <property name="show_menubar">False</property>
32
+    <child type="titlebar">
33
+      <placeholder/>
34
+    </child>
35
+    <child>
36
+      <object class="GtkGrid">
37
+        <property name="visible">True</property>
38
+        <property name="can_focus">True</property>
39
+        <child>
40
+          <object class="GtkScrolledWindow">
41
+            <property name="visible">True</property>
42
+            <property name="can_focus">True</property>
43
+            <property name="hexpand">True</property>
44
+            <property name="vexpand">True</property>
45
+            <property name="hscrollbar_policy">never</property>
46
+            <property name="shadow_type">in</property>
47
+            <child>
48
+              <object class="GtkTreeView" id="illness_tree">
49
+                <property name="visible">True</property>
50
+                <property name="can_focus">True</property>
51
+                <property name="hexpand">True</property>
52
+                <property name="vexpand">True</property>
53
+                <property name="hscroll_policy">natural</property>
54
+                <property name="vscroll_policy">natural</property>
55
+                <property name="model">liststore1</property>
56
+                <property name="fixed_height_mode">True</property>
57
+                <property name="enable_grid_lines">both</property>
58
+                <property name="enable_tree_lines">True</property>
59
+                <child internal-child="selection">
60
+                  <object class="GtkTreeSelection" id="selection">
61
+                    <property name="mode">multiple</property>
62
+                    <signal name="changed" handler="on_changed_selection" swapped="no"/>
63
+                  </object>
64
+                </child>
65
+                <child>
66
+                  <object class="GtkTreeViewColumn" id="illness">
67
+                    <property name="sizing">fixed</property>
68
+                    <property name="title" translatable="yes">Illness</property>
69
+                    <property name="clickable">True</property>
70
+                    <signal name="clicked" handler="on_clicked_column" swapped="no"/>
71
+                    <child>
72
+                      <object class="GtkCellRendererText"/>
73
+                      <attributes>
74
+                        <attribute name="markup">0</attribute>
75
+                      </attributes>
76
+                    </child>
77
+                  </object>
78
+                </child>
79
+              </object>
80
+            </child>
81
+          </object>
82
+          <packing>
83
+            <property name="left_attach">0</property>
84
+            <property name="top_attach">0</property>
85
+          </packing>
86
+        </child>
87
+        <child>
88
+          <object class="GtkGrid">
89
+            <property name="visible">True</property>
90
+            <property name="can_focus">True</property>
91
+            <property name="margin_left">5</property>
92
+            <property name="margin_right">5</property>
93
+            <property name="margin_top">5</property>
94
+            <property name="margin_bottom">5</property>
95
+            <property name="hexpand">True</property>
96
+            <property name="column_spacing">25</property>
97
+            <property name="column_homogeneous">True</property>
98
+            <child>
99
+              <object class="GtkButton" id="add_illness">
100
+                <property name="label" translatable="yes">Add</property>
101
+                <property name="visible">True</property>
102
+                <property name="can_focus">True</property>
103
+                <property name="receives_default">True</property>
104
+                <property name="tooltip_text" translatable="yes">Add new illnesses.</property>
105
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
106
+              </object>
107
+              <packing>
108
+                <property name="left_attach">0</property>
109
+                <property name="top_attach">0</property>
110
+              </packing>
111
+            </child>
112
+            <child>
113
+              <object class="GtkButton" id="close_illness">
114
+                <property name="label" translatable="yes">Close</property>
115
+                <property name="visible">True</property>
116
+                <property name="can_focus">True</property>
117
+                <property name="receives_default">True</property>
118
+                <property name="tooltip_text" translatable="yes">Close this window.</property>
119
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
120
+              </object>
121
+              <packing>
122
+                <property name="left_attach">2</property>
123
+                <property name="top_attach">0</property>
124
+              </packing>
125
+            </child>
126
+            <child>
127
+              <object class="GtkButton" id="delete_illness">
128
+                <property name="label" translatable="yes">Delete</property>
129
+                <property name="visible">True</property>
130
+                <property name="can_focus">True</property>
131
+                <property name="receives_default">True</property>
132
+                <property name="tooltip_text" translatable="yes">Delete illnesses.</property>
133
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
134
+              </object>
135
+              <packing>
136
+                <property name="left_attach">1</property>
137
+                <property name="top_attach">0</property>
138
+              </packing>
139
+            </child>
140
+          </object>
141
+          <packing>
142
+            <property name="left_attach">0</property>
143
+            <property name="top_attach">1</property>
144
+          </packing>
145
+        </child>
146
+      </object>
147
+    </child>
148
+  </template>
149
+</interface>

+ 129
- 0
data/ui/staff.specialty.editor.ui View File

@@ -0,0 +1,129 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!-- Generated with glade 3.22.1 
3
+
4
+Copyright 2018-2019 Chris Cromer
5
+
6
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+
10
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13
+
14
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
+
16
+-->
17
+<interface domain="sernatur">
18
+  <requires lib="gtk+" version="3.20"/>
19
+  <template class="SernaturTouristIllnessEditor" parent="GtkApplicationWindow">
20
+    <property name="can_focus">False</property>
21
+    <property name="type">popup</property>
22
+    <property name="title" translatable="yes">Add Illness</property>
23
+    <property name="resizable">False</property>
24
+    <property name="modal">True</property>
25
+    <property name="window_position">center-on-parent</property>
26
+    <property name="destroy_with_parent">True</property>
27
+    <property name="type_hint">dialog</property>
28
+    <property name="skip_taskbar_hint">True</property>
29
+    <property name="skip_pager_hint">True</property>
30
+    <property name="show_menubar">False</property>
31
+    <child>
32
+      <placeholder/>
33
+    </child>
34
+    <child>
35
+      <object class="GtkGrid">
36
+        <property name="visible">True</property>
37
+        <property name="can_focus">False</property>
38
+        <property name="margin_left">5</property>
39
+        <property name="margin_right">5</property>
40
+        <property name="margin_top">5</property>
41
+        <property name="margin_bottom">5</property>
42
+        <property name="row_spacing">5</property>
43
+        <property name="column_spacing">5</property>
44
+        <child>
45
+          <object class="GtkLabel">
46
+            <property name="visible">True</property>
47
+            <property name="can_focus">False</property>
48
+            <property name="halign">end</property>
49
+            <property name="margin_left">5</property>
50
+            <property name="margin_right">5</property>
51
+            <property name="margin_top">5</property>
52
+            <property name="margin_bottom">5</property>
53
+            <property name="label" translatable="yes">Illness</property>
54
+          </object>
55
+          <packing>
56
+            <property name="left_attach">0</property>
57
+            <property name="top_attach">0</property>
58
+          </packing>
59
+        </child>
60
+        <child>
61
+          <object class="GtkBox" id="button_bar">
62
+            <property name="visible">True</property>
63
+            <property name="can_focus">False</property>
64
+            <property name="margin_left">5</property>
65
+            <property name="margin_right">5</property>
66
+            <property name="margin_top">5</property>
67
+            <property name="margin_bottom">5</property>
68
+            <property name="hexpand">True</property>
69
+            <property name="spacing">25</property>
70
+            <property name="homogeneous">True</property>
71
+            <child>
72
+              <object class="GtkButton" id="close_illness">
73
+                <property name="label" translatable="yes">Close</property>
74
+                <property name="visible">True</property>
75
+                <property name="can_focus">True</property>
76
+                <property name="receives_default">True</property>
77
+                <property name="tooltip_text" translatable="yes">Close this window.</property>
78
+                <property name="margin_left">5</property>
79
+                <property name="margin_right">5</property>
80
+                <property name="margin_top">5</property>
81
+                <property name="margin_bottom">5</property>
82
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
83
+              </object>
84
+              <packing>
85
+                <property name="expand">False</property>
86
+                <property name="fill">True</property>
87
+                <property name="position">0</property>
88
+              </packing>
89
+            </child>
90
+            <child>
91
+              <object class="GtkButton" id="add_illness">
92
+                <property name="label" translatable="yes">Add</property>
93
+                <property name="visible">True</property>
94
+                <property name="can_focus">True</property>
95
+                <property name="receives_default">True</property>
96
+                <property name="tooltip_text" translatable="yes">Save this place.</property>
97
+                <property name="margin_left">5</property>
98
+                <property name="margin_right">5</property>
99
+                <property name="margin_top">5</property>
100
+                <property name="margin_bottom">5</property>
101
+                <signal name="clicked" handler="on_clicked_button" swapped="no"/>
102
+              </object>
103
+              <packing>
104
+                <property name="expand">False</property>
105
+                <property name="fill">True</property>
106
+                <property name="position">1</property>
107
+              </packing>
108
+            </child>
109
+          </object>
110
+          <packing>
111
+            <property name="left_attach">0</property>
112
+            <property name="top_attach">1</property>
113
+            <property name="width">2</property>
114
+          </packing>
115
+        </child>
116
+        <child>
117
+          <object class="GtkComboBoxText" id="illness">
118
+            <property name="visible">True</property>
119
+            <property name="can_focus">False</property>
120
+          </object>
121
+          <packing>
122
+            <property name="left_attach">1</property>
123
+            <property name="top_attach">0</property>
124
+          </packing>
125
+        </child>
126
+      </object>
127
+    </child>
128
+  </template>
129
+</interface>

+ 105
- 1
lib/db/guia.vala View File

@@ -62,8 +62,9 @@ namespace LibSernatur {
62 62
 			 * Get all tuples and fields from database
63 63
 			 * @param conn The database connection to use
64 64
 			 * @return Returns a list of Guia
65
+			 * @throws PostgresError If there is a problem with with escaping strings
65 66
 			 */
66
-			public static List<Guia> get_all_guias (Connection conn) {
67
+			public static List<Guia> get_all_guias (Connection conn) throws PostgresError {
67 68
 				var res = conn.db.exec ("
68 69
 SELECT G.rut_guia, G.nombre_guia, G.calle, G.numero,
69 70
 C.id_ciudad, C.nombre_ciudad,
@@ -109,6 +110,109 @@ JOIN region R ON (C.id_region = R.id_region)
109 110
 				}
110 111
 				return list;
111 112
 			}
113
+
114
+			/**
115
+			 * Get a tuple and fields from database
116
+			 * @param conn The database connection to use
117
+			 * @return Returns a Guia
118
+			 * @throws PostgresError If there is a problem with with escaping strings
119
+			 */
120
+			public static Guia? get_guia_by_run (Connection conn, string run) throws PostgresError {
121
+				var res = conn.db.exec ("
122
+SELECT G.rut_guia, G.nombre_guia, G.calle, G.numero,
123
+C.id_ciudad, C.nombre_ciudad,
124
+R.id_region, R.nombre_region
125
+FROM guia G
126
+JOIN ciudad C ON (G.id_ciudad = C.id_ciudad)
127
+JOIN region R ON (C.id_region = R.id_region)
128
+WHERE rut_guia = '" + conn.escape (run) + "'
129
+				");
130
+				if (res.get_status () != ExecStatus.TUPLES_OK) {
131
+					#if DEBUG
132
+						error (conn.db.get_error_message ());
133
+					#else
134
+						warning (conn.db.get_error_message ());
135
+						return null;
136
+					#endif
137
+				}
138
+
139
+				var wra = new ResultWrapper (res);
140
+				Guia guia = null;
141
+				int n = res.get_n_tuples ();
142
+				for (int i = 0; i < n; i++) {
143
+					try {
144
+						guia = new Guia	(wra.get_string_n (i, "rut_guia"),
145
+							wra.get_string_n (i, "nombre_guia"),
146
+							wra.get_string_n (i, "calle"),
147
+							wra.get_int_n (i, "numero"),
148
+							new Ciudad (wra.get_int_n (i, "id_ciudad"),
149
+								wra.get_string_n (i, "nombre_ciudad"),
150
+								new Region (wra.get_int_n (i, "id_region"),
151
+									wra.get_string_n (i, "nombre_region")
152
+								)
153
+							)
154
+						);
155
+					}
156
+					catch (Error e) {
157
+						#if DEBUG
158
+							error (e.message);
159
+						#else
160
+							warning (e.message);
161
+						#endif
162
+					}
163
+				}
164
+				return guia;
165
+			}
166
+
167
+			/**
168
+			 * Insert a staff member in the database
169
+			 * @param conn The database connection
170
+			 * @param guia The staff member to insert
171
+			 * @throws PostgresError Thrown if there is a problem with escaping strings
172
+			 */
173
+			public static void insert_illness (Connection conn, Guia guia) throws PostgresError {
174
+				var res = conn.db.exec ("
175
+INSERT INTO guia
176
+(rut_guia, nombre_guia, calle, numero, id_ciudad)
177
+VALUES
178
+(
179
+'" + conn.escape (guia.rut_guia) + "',
180
+'" + conn.escape (guia.nombre_guia) + "',
181
+'" + conn.escape (guia.calle) + "',
182
+" + guia.numero.to_string () + ",
183
+" + guia.ciudad.id_ciudad.to_string () + "
184
+)
185
+				");
186
+				if (res.get_status () != ExecStatus.COMMAND_OK) {
187
+					#if DEBUG
188
+						error (conn.db.get_error_message ());
189
+					#else
190
+						warning (conn.db.get_error_message ());
191
+					#endif
192
+				}
193
+			}
194
+
195
+			/**
196
+			 * Delete a staff member in the database
197
+			 * @param conn The database connection
198
+			 * @param guia The staff member to delete
199
+			 * @throws PostgresError Thrown if there is a problem with escaping strings
200
+			 */
201
+			public static void delete_staff (Connection conn, Guia guia) throws PostgresError {
202
+				var res = conn.db.exec ("
203
+DELETE FROM guia
204
+WHERE (
205
+rut_guia = '" + conn.escape (guia.rut_guia) + "'
206
+)
207
+				");
208
+				if (res.get_status () != ExecStatus.COMMAND_OK) {
209
+					#if DEBUG
210
+						error (conn.db.get_error_message ());
211
+					#else
212
+						warning (conn.db.get_error_message ());
213
+					#endif
214
+				}
215
+			}
112 216
 		}
113 217
 	}
114 218
 }

+ 8
- 0
po/POTFILES View File

@@ -18,6 +18,10 @@ src/tourist_list.vala
18 18
 src/tourist_editor.vala
19 19
 src/tourist_illnesses.vala
20 20
 src/tourist_illness_editor.vala
21
+src/staff_list.vala
22
+src/staff_editor.vala
23
+#src/staff_specialties.vala
24
+#src/staff_specialty_editor.vala
21 25
 src/query_window.vala
22 26
 data/ui/main.window.ui
23 27
 data/ui/main.splash.ui
@@ -30,6 +34,10 @@ data/ui/tourist.list.ui
30 34
 data/ui/tourist.editor.ui
31 35
 data/ui/tourist.illnesses.ui
32 36
 data/ui/tourist.illness.editor.ui
37
+data/ui/staff.list.ui
38
+data/ui/staff.editor.ui
39
+data/ui/staff.specialties.ui
40
+data/ui/staff.specialty.editor.ui
33 41
 data/ui/place.editor.ui
34 42
 data/ui/query.window.ui
35 43
 data/ui/query.tree.ui

+ 99
- 24
po/es.po View File

@@ -7,8 +7,8 @@ msgid ""
7 7
 msgstr ""
8 8
 "Project-Id-Version: sernatur\n"
9 9
 "Report-Msgid-Bugs-To: \n"
10
-"POT-Creation-Date: 2019-01-21 00:47-0300\n"
11
-"PO-Revision-Date: 2019-01-21 00:57-0300\n"
10
+"POT-Creation-Date: 2019-01-21 03:25-0300\n"
11
+"PO-Revision-Date: 2019-01-21 03:28-0300\n"
12 12
 "Last-Translator: Chris Cromer <chris@cromer.cl>\n"
13 13
 "Language-Team: none\n"
14 14
 "Language: es\n"
@@ -93,16 +93,20 @@ msgstr ""
93 93
 msgid "SERNATUR version: "
94 94
 msgstr "Versión de SERNATUR: "
95 95
 
96
-#: src/main_window.vala:227
96
+#: src/main_window.vala:238
97 97
 msgid "Error: Could not connect to the database!"
98 98
 msgstr "Error: No se puede conectar al base de datos!"
99 99
 
100
-#: src/main_window.vala:239 src/tour_list.vala:233 src/tour_editor.vala:231
100
+#: src/main_window.vala:250 src/tour_list.vala:233 src/tour_editor.vala:231
101 101
 #: src/tour_editor.vala:248 src/tour_editor.vala:280 src/tour_editor.vala:297
102 102
 #: src/tour_editor.vala:329 src/tour_editor.vala:346
103 103
 #: src/tour_assign_vehicle.vala:99 src/tourist_list.vala:206
104 104
 #: src/tourist_editor.vala:99 src/tourist_editor.vala:112
105 105
 #: src/tourist_editor.vala:128 src/tourist_editor.vala:141
106
+#: src/staff_editor.vala:227 src/staff_editor.vala:240
107
+#: src/staff_editor.vala:256 src/staff_editor.vala:269
108
+#: src/staff_editor.vala:291 src/staff_editor.vala:308
109
+#: src/staff_editor.vala:340 src/staff_editor.vala:357
106 110
 msgid "Error"
107 111
 msgstr "Error"
108 112
 
@@ -132,20 +136,20 @@ msgstr "Error: El nombre del tour no puede estar en blanco!"
132 136
 msgid "Error: A tour named \"%s\" already exists!"
133 137
 msgstr "Error: Un tour con el nombre \"%s\" ya existe!"
134 138
 
135
-#: src/tour_editor.vala:276
139
+#: src/tour_editor.vala:276 src/staff_editor.vala:287
136 140
 msgid "Error: City name cannot be left blank!"
137 141
 msgstr "Error: El nombre de la ciudad no puede estar en blanco!"
138 142
 
139
-#: src/tour_editor.vala:293
143
+#: src/tour_editor.vala:293 src/staff_editor.vala:304
140 144
 #, c-format
141 145
 msgid "Error: A city named \"%s\" already exists!"
142 146
 msgstr "Error: Una ciudad con el nombre \"%s\" ya existe!"
143 147
 
144
-#: src/tour_editor.vala:325
148
+#: src/tour_editor.vala:325 src/staff_editor.vala:336
145 149
 msgid "Error: Region name cannot be left blank!"
146 150
 msgstr "Error: El nombre de la región no puede estar en blanco!"
147 151
 
148
-#: src/tour_editor.vala:342
152
+#: src/tour_editor.vala:342 src/staff_editor.vala:353
149 153
 #, c-format
150 154
 msgid "Error: A region named \"%s\" already exists!"
151 155
 msgstr "Error: Una región con el nombre \"%s\" ya existe!"
@@ -175,7 +179,7 @@ msgstr ""
175 179
 "Error: No se puede borrar la turista \"%s\" porque hay información asociado "
176 180
 "con la turista!"
177 181
 
178
-#: src/tourist_editor.vala:95
182
+#: src/tourist_editor.vala:95 src/staff_editor.vala:223
179 183
 msgid "Error: Tourist name cannot be left blank!"
180 184
 msgstr "Error: El nombre de la turista no puede estar en blanco!"
181 185
 
@@ -183,7 +187,7 @@ msgstr "Error: El nombre de la turista no puede estar en blanco!"
183 187
 msgid "Error: Tourist RUN cannot be left blank!"
184 188
 msgstr "Error: El RUN de la turista no puede estar en blanco!"
185 189
 
186
-#: src/tourist_editor.vala:124
190
+#: src/tourist_editor.vala:124 src/staff_editor.vala:252
187 191
 msgid "Error: The RUN entered is invalid!"
188 192
 msgstr "Error: El RUN ingresado es invalido!"
189 193
 
@@ -201,6 +205,23 @@ msgid "Are you sure you wish to delete these illnesses from this tourist?"
201 205
 msgstr ""
202 206
 "¿Usted está seguro que quiere borrar estos enfermedades de esta turista?"
203 207
 
208
+#: src/staff_list.vala:190
209
+msgid "Are you sure you wish to delete this staff member?"
210
+msgstr "¿Usted está seguro que quiere borrar esta guía?"
211
+
212
+#: src/staff_list.vala:197
213
+msgid "Are you sure you wish to delete these staff members?"
214
+msgstr "¿Usted está seguro que quiere borrar estas guías?"
215
+
216
+#: src/staff_editor.vala:236
217
+msgid "Error: Staff member RUN cannot be left blank!"
218
+msgstr "Error: El RUN de la guía no puede estar en blanco!"
219
+
220
+#: src/staff_editor.vala:265
221
+#, c-format
222
+msgid "Error: A staff member with the RUN \"%s\" already exists!"
223
+msgstr "Error: Una guía con el RUN \"%s\" ya existe!"
224
+
204 225
 #: src/query_window.vala:290 data/ui/main.window.ui:105
205 226
 msgid "(Q1) Regions with discounts"
206 227
 msgstr "(Q1) Regiones sin descuentos"
@@ -229,7 +250,7 @@ msgstr "_Menú"
229 250
 msgid "Tours"
230 251
 msgstr "Tours"
231 252
 
232
-#: data/ui/main.window.ui:61
253
+#: data/ui/main.window.ui:61 data/ui/staff.list.ui:23
233 254
 msgid "Staff"
234 255
 msgstr "Empleados"
235 256
 
@@ -267,16 +288,19 @@ msgid "Minimum People"
267 288
 msgstr "Mínima Personas"
268 289
 
269 290
 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:186
291
+#: data/ui/staff.list.ui:124 data/ui/staff.editor.ui:161
270 292
 #: data/ui/place.editor.ui:150
271 293
 msgid "City"
272 294
 msgstr "Ciudad"
273 295
 
274 296
 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:134
297
+#: data/ui/staff.list.ui:138 data/ui/staff.editor.ui:111
275 298
 #: data/ui/place.editor.ui:116
276 299
 msgid "Region"
277 300
 msgstr "Región"
278 301
 
279 302
 #: data/ui/tour.list.ui:170 data/ui/tourist.list.ui:128
303
+#: data/ui/staff.list.ui:170
280 304
 msgid "Edit"
281 305
 msgstr "Editar"
282 306
 
@@ -285,7 +309,7 @@ msgid "Edit selected tour."
285 309
 msgstr "Editar el tour seleccionado."
286 310
 
287 311
 #: data/ui/tour.list.ui:185 data/ui/tour.places.ui:212
288
-#: data/ui/tourist.list.ui:143
312
+#: data/ui/tourist.list.ui:143 data/ui/staff.list.ui:185
289 313
 msgid "New"
290 314
 msgstr "Nuevo"
291 315
 
@@ -294,7 +318,8 @@ msgid "Create a new tour."
294 318
 msgstr "Crear un tour nuevo."
295 319
 
296 320
 #: data/ui/tour.list.ui:199 data/ui/tourist.list.ui:157
297
-#: data/ui/tourist.illnesses.ui:128
321
+#: data/ui/tourist.illnesses.ui:128 data/ui/staff.list.ui:199
322
+#: data/ui/staff.specialties.ui:128
298 323
 msgid "Delete"
299 324
 msgstr "Borrar"
300 325
 
@@ -304,13 +329,16 @@ msgstr "Borrar el tour seleccionado."
304 329
 
305 330
 #: data/ui/tour.list.ui:214 data/ui/tour.places.ui:198
306 331
 #: data/ui/tourist.list.ui:172 data/ui/tourist.illnesses.ui:114
307
-#: data/ui/tourist.illness.editor.ui:73 data/ui/query.window.ui:66
332
+#: data/ui/tourist.illness.editor.ui:73 data/ui/staff.list.ui:214
333
+#: data/ui/staff.specialties.ui:114 data/ui/staff.specialty.editor.ui:73
334
+#: data/ui/query.window.ui:66
308 335
 msgid "Close"
309 336
 msgstr "Cerrar"
310 337
 
311 338
 #: data/ui/tour.list.ui:218 data/ui/tour.places.ui:202
312 339
 #: data/ui/tourist.list.ui:176 data/ui/tourist.illnesses.ui:118
313
-#: data/ui/tourist.illness.editor.ui:77
340
+#: data/ui/tourist.illness.editor.ui:77 data/ui/staff.list.ui:218
341
+#: data/ui/staff.specialties.ui:118 data/ui/staff.specialty.editor.ui:77
314 342
 msgid "Close this window."
315 343
 msgstr "Cerrar esta ventana."
316 344
 
@@ -318,17 +346,19 @@ msgstr "Cerrar esta ventana."
318 346
 msgid "Tour Editor"
319 347
 msgstr "Editor de Tour"
320 348
 
321
-#: data/ui/tour.editor.ui:233 data/ui/place.editor.ui:197
349
+#: data/ui/tour.editor.ui:233 data/ui/staff.editor.ui:185
350
+#: data/ui/place.editor.ui:197
322 351
 msgid "Create a new region by typing here."
323 352
 msgstr "Crear una nueva región con escribir aquí."
324 353
 
325
-#: data/ui/tour.editor.ui:261 data/ui/place.editor.ui:225
354
+#: data/ui/tour.editor.ui:261 data/ui/staff.editor.ui:213
355
+#: data/ui/place.editor.ui:225
326 356
 msgid "Create a new city by typing here."
327 357
 msgstr "Crear una nueva ciudad con escribir aquí."
328 358
 
329 359
 #: data/ui/tour.editor.ui:286 data/ui/tour.place.editor.ui:149
330 360
 #: data/ui/tour.assign.vehicle.ui:67 data/ui/tourist.editor.ui:131
331
-#: data/ui/place.editor.ui:250
361
+#: data/ui/staff.editor.ui:238 data/ui/place.editor.ui:250
332 362
 msgid "Cancel"
333 363
 msgstr "Cancelar"
334 364
 
@@ -354,7 +384,7 @@ msgstr "Asignar un vehículo a este tour."
354 384
 
355 385
 #: data/ui/tour.editor.ui:343 data/ui/tour.place.editor.ui:168
356 386
 #: data/ui/tour.assign.vehicle.ui:86 data/ui/tourist.editor.ui:169
357
-#: data/ui/place.editor.ui:269
387
+#: data/ui/staff.editor.ui:276 data/ui/place.editor.ui:269
358 388
 msgid "Save"
359 389
 msgstr "Guardar"
360 390
 
@@ -391,7 +421,8 @@ msgid "Departure Time"
391 421
 msgstr "Hora de Salida"
392 422
 
393 423
 #: data/ui/tour.places.ui:184 data/ui/tourist.illnesses.ui:100
394
-#: data/ui/tourist.illness.editor.ui:92
424
+#: data/ui/tourist.illness.editor.ui:92 data/ui/staff.specialties.ui:100
425
+#: data/ui/staff.specialty.editor.ui:92
395 426
 msgid "Add"
396 427
 msgstr "Agregar"
397 428
 
@@ -424,7 +455,7 @@ msgid "Cancel the modification of this place."
424 455
 msgstr "Cancelar la modificación de este lugar."
425 456
 
426 457
 #: data/ui/tour.place.editor.ui:172 data/ui/tourist.illness.editor.ui:96
427
-#: data/ui/place.editor.ui:273
458
+#: data/ui/staff.specialty.editor.ui:96 data/ui/place.editor.ui:273
428 459
 msgid "Save this place."
429 460
 msgstr "Guardar este lugar."
430 461
 
@@ -520,10 +551,12 @@ msgid "The licence plate, make, year, and capacity of the vehicle."
520 551
 msgstr "La patente, marca, año y capacidad del vehículo."
521 552
 
522 553
 #: data/ui/tourist.list.ui:68 data/ui/tourist.editor.ui:60
554
+#: data/ui/staff.list.ui:68 data/ui/staff.editor.ui:46
523 555
 msgid "RUN"
524 556
 msgstr "RUN"
525 557
 
526 558
 #: data/ui/tourist.list.ui:82 data/ui/tourist.editor.ui:93
559
+#: data/ui/staff.list.ui:82 data/ui/staff.editor.ui:79
527 560
 msgid "Name"
528 561
 msgstr "Nombre"
529 562
 
@@ -552,6 +585,7 @@ msgid "Cancel the modification of this tourist."
552 585
 msgstr "Cancelar la modificación de esta turista."
553 586
 
554 587
 #: data/ui/tourist.editor.ui:150 data/ui/tourist.illnesses.ui:23
588
+#: data/ui/staff.specialties.ui:23
555 589
 msgid "Illnesses"
556 590
 msgstr "Enfermedades"
557 591
 
@@ -564,21 +598,62 @@ msgid "Save this tourist."
564 598
 msgstr "Guardar esta turista."
565 599
 
566 600
 #: data/ui/tourist.illnesses.ui:68 data/ui/tourist.illness.editor.ui:53
601
+#: data/ui/staff.specialties.ui:68 data/ui/staff.specialty.editor.ui:53
567 602
 msgid "Illness"
568 603
 msgstr "Enfermedad"
569 604
 
570
-#: data/ui/tourist.illnesses.ui:104
605
+#: data/ui/tourist.illnesses.ui:104 data/ui/staff.specialties.ui:104
571 606
 msgid "Add new illnesses."
572 607
 msgstr "Agregar nuevo enfermedades."
573 608
 
574
-#: data/ui/tourist.illnesses.ui:132
609
+#: data/ui/tourist.illnesses.ui:132 data/ui/staff.specialties.ui:132
575 610
 msgid "Delete illnesses."
576 611
 msgstr "Borrar enfermedades."
577 612
 
578
-#: data/ui/tourist.illness.editor.ui:22
613
+#: data/ui/tourist.illness.editor.ui:22 data/ui/staff.specialty.editor.ui:22
579 614
 msgid "Add Illness"
580 615
 msgstr "Agregar Enfermedad"
581 616
 
617
+#: data/ui/staff.list.ui:96 data/ui/staff.editor.ui:95
618
+msgid "Street"
619
+msgstr "Calle"
620
+
621
+#: data/ui/staff.list.ui:110 data/ui/staff.editor.ui:309
622
+msgid "Number"
623
+msgstr "Numero"
624
+
625
+#: data/ui/staff.list.ui:175
626
+msgid "Edit selected staff member."
627
+msgstr "Editar la guía seleccionada."
628
+
629
+#: data/ui/staff.list.ui:189
630
+msgid "Create a new staff member."
631
+msgstr "Crear una guía nueva."
632
+
633
+#: data/ui/staff.list.ui:204
634
+msgid "Delete selected staff member."
635
+msgstr "Borrar la guía seleccionada."
636
+
637
+#: data/ui/staff.editor.ui:22
638
+msgid "Staff Editor"
639
+msgstr "Editor de Staff"
640
+
641
+#: data/ui/staff.editor.ui:242
642
+msgid "Cancel the modification of this guide."
643
+msgstr "Cancelar la modificación de esta guia."
644
+
645
+#: data/ui/staff.editor.ui:257
646
+msgid "Specialties"
647
+msgstr "Especialidades"
648
+
649
+#: data/ui/staff.editor.ui:261
650
+msgid "Add specialties to this guide."
651
+msgstr "Agregar especialidades a este guia."
652
+
653
+#: data/ui/staff.editor.ui:280
654
+msgid "Save this guide."
655
+msgstr "Guardar esta guia."
656
+
582 657
 #: data/ui/place.editor.ui:27
583 658
 msgid "Place Editor"
584 659
 msgstr "Editor de Lugar"

+ 99
- 24
po/es_CL.po View File

@@ -7,8 +7,8 @@ msgid ""
7 7
 msgstr ""
8 8
 "Project-Id-Version: sernatur\n"
9 9
 "Report-Msgid-Bugs-To: \n"
10
-"POT-Creation-Date: 2019-01-21 00:47-0300\n"
11
-"PO-Revision-Date: 2019-01-21 00:57-0300\n"
10
+"POT-Creation-Date: 2019-01-21 03:25-0300\n"
11
+"PO-Revision-Date: 2019-01-21 03:29-0300\n"
12 12
 "Last-Translator: Chris Cromer <chris@cromer.cl>\n"
13 13
 "Language-Team: none\n"
14 14
 "Language: es\n"
@@ -93,16 +93,20 @@ msgstr ""
93 93
 msgid "SERNATUR version: "
94 94
 msgstr "Versión de SERNATUR: "
95 95
 
96
-#: src/main_window.vala:227
96
+#: src/main_window.vala:238
97 97
 msgid "Error: Could not connect to the database!"
98 98
 msgstr "Puta la wea: No se puede conectar al base de datos!"
99 99
 
100
-#: src/main_window.vala:239 src/tour_list.vala:233 src/tour_editor.vala:231
100
+#: src/main_window.vala:250 src/tour_list.vala:233 src/tour_editor.vala:231
101 101
 #: src/tour_editor.vala:248 src/tour_editor.vala:280 src/tour_editor.vala:297
102 102
 #: src/tour_editor.vala:329 src/tour_editor.vala:346
103 103
 #: src/tour_assign_vehicle.vala:99 src/tourist_list.vala:206
104 104
 #: src/tourist_editor.vala:99 src/tourist_editor.vala:112
105 105
 #: src/tourist_editor.vala:128 src/tourist_editor.vala:141
106
+#: src/staff_editor.vala:227 src/staff_editor.vala:240
107
+#: src/staff_editor.vala:256 src/staff_editor.vala:269
108
+#: src/staff_editor.vala:291 src/staff_editor.vala:308
109
+#: src/staff_editor.vala:340 src/staff_editor.vala:357
106 110
 msgid "Error"
107 111
 msgstr "Puta la wea"
108 112
 
@@ -132,20 +136,20 @@ msgstr "Error: El nombre de la wea no puede estar en blanco!"
132 136
 msgid "Error: A tour named \"%s\" already exists!"
133 137
 msgstr "Error: Una wea con el nombre \"%s\" ya existe!"
134 138
 
135
-#: src/tour_editor.vala:276
139
+#: src/tour_editor.vala:276 src/staff_editor.vala:287
136 140
 msgid "Error: City name cannot be left blank!"
137 141
 msgstr "Error: El nombre de la wea no puede estar en blanco!"
138 142
 
139
-#: src/tour_editor.vala:293
143
+#: src/tour_editor.vala:293 src/staff_editor.vala:304
140 144
 #, c-format
141 145
 msgid "Error: A city named \"%s\" already exists!"
142 146
 msgstr "Error: Una wea con el nombre \"%s\" ya existe!"
143 147
 
144
-#: src/tour_editor.vala:325
148
+#: src/tour_editor.vala:325 src/staff_editor.vala:336
145 149
 msgid "Error: Region name cannot be left blank!"
146 150
 msgstr "Error: El nombre de la wea no puede estar en blanco!"
147 151
 
148
-#: src/tour_editor.vala:342
152
+#: src/tour_editor.vala:342 src/staff_editor.vala:353
149 153
 #, c-format
150 154
 msgid "Error: A region named \"%s\" already exists!"
151 155
 msgstr "Error: Una wea con el nombre \"%s\" ya existe!"
@@ -175,7 +179,7 @@ msgstr ""
175 179
 "Error: No se puede borrar la turista \"%s\" porque hay información asociado "
176 180
 "con la turista!"
177 181
 
178
-#: src/tourist_editor.vala:95
182
+#: src/tourist_editor.vala:95 src/staff_editor.vala:223
179 183
 msgid "Error: Tourist name cannot be left blank!"
180 184
 msgstr "Error: El nombre de la turista no puede estar en blanco!"
181 185
 
@@ -183,7 +187,7 @@ msgstr "Error: El nombre de la turista no puede estar en blanco!"
183 187
 msgid "Error: Tourist RUN cannot be left blank!"
184 188
 msgstr "Error: El RUN de la turista no puede estar en blanco!"
185 189
 
186
-#: src/tourist_editor.vala:124
190
+#: src/tourist_editor.vala:124 src/staff_editor.vala:252
187 191
 msgid "Error: The RUN entered is invalid!"
188 192
 msgstr "Error: El RUN ingresado es invalido!"
189 193
 
@@ -201,6 +205,23 @@ msgid "Are you sure you wish to delete these illnesses from this tourist?"
201 205
 msgstr ""
202 206
 "¿Usted está seguro que quiere borrar estos enfermedades de esta turista?"
203 207
 
208
+#: src/staff_list.vala:190
209
+msgid "Are you sure you wish to delete this staff member?"
210
+msgstr "¿Usted está seguro que quiere borrar esta guía?"
211
+
212
+#: src/staff_list.vala:197
213
+msgid "Are you sure you wish to delete these staff members?"
214
+msgstr "¿Usted está seguro que quiere borrar estas guías?"
215
+
216
+#: src/staff_editor.vala:236
217
+msgid "Error: Staff member RUN cannot be left blank!"
218
+msgstr "Error: El RUN de la guía no puede estar en blanco!"
219
+
220
+#: src/staff_editor.vala:265
221
+#, c-format
222
+msgid "Error: A staff member with the RUN \"%s\" already exists!"
223
+msgstr "Error: Una guía con el RUN \"%s\" ya existe!"
224
+
204 225
 #: src/query_window.vala:290 data/ui/main.window.ui:105
205 226
 msgid "(Q1) Regions with discounts"
206 227
 msgstr "(Q1) Regiones sin descuentos"
@@ -229,7 +250,7 @@ msgstr "_Menú"
229 250
 msgid "Tours"
230 251
 msgstr "Tours"
231 252
 
232
-#: data/ui/main.window.ui:61
253
+#: data/ui/main.window.ui:61 data/ui/staff.list.ui:23
233 254
 msgid "Staff"
234 255
 msgstr "Weones flojos"
235 256
 
@@ -267,16 +288,19 @@ msgid "Minimum People"
267 288
 msgstr "Mínima de Weones"
268 289
 
269 290
 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:186
291
+#: data/ui/staff.list.ui:124 data/ui/staff.editor.ui:161
270 292
 #: data/ui/place.editor.ui:150
271 293
 msgid "City"
272 294
 msgstr "Ciudad"
273 295
 
274 296
 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:134
297
+#: data/ui/staff.list.ui:138 data/ui/staff.editor.ui:111
275 298
 #: data/ui/place.editor.ui:116
276 299
 msgid "Region"
277 300
 msgstr "Región"
278 301
 
279 302
 #: data/ui/tour.list.ui:170 data/ui/tourist.list.ui:128
303
+#: data/ui/staff.list.ui:170
280 304
 msgid "Edit"
281 305
 msgstr "Editar la wea"
282 306
 
@@ -285,7 +309,7 @@ msgid "Edit selected tour."
285 309
 msgstr "Editar la wea seleccionado."
286 310
 
287 311
 #: data/ui/tour.list.ui:185 data/ui/tour.places.ui:212
288
-#: data/ui/tourist.list.ui:143
312
+#: data/ui/tourist.list.ui:143 data/ui/staff.list.ui:185
289 313
 msgid "New"
290 314
 msgstr "Nueva wea"
291 315
 
@@ -294,7 +318,8 @@ msgid "Create a new tour."
294 318
 msgstr "Crear una wea nueva."
295 319
 
296 320
 #: data/ui/tour.list.ui:199 data/ui/tourist.list.ui:157
297
-#: data/ui/tourist.illnesses.ui:128
321
+#: data/ui/tourist.illnesses.ui:128 data/ui/staff.list.ui:199
322
+#: data/ui/staff.specialties.ui:128
298 323
 msgid "Delete"
299 324
 msgstr "Borrar la wea"
300 325
 
@@ -304,13 +329,16 @@ msgstr "Borrar la wea seleccionado."
304 329
 
305 330
 #: data/ui/tour.list.ui:214 data/ui/tour.places.ui:198
306 331
 #: data/ui/tourist.list.ui:172 data/ui/tourist.illnesses.ui:114
307
-#: data/ui/tourist.illness.editor.ui:73 data/ui/query.window.ui:66
332
+#: data/ui/tourist.illness.editor.ui:73 data/ui/staff.list.ui:214
333
+#: data/ui/staff.specialties.ui:114 data/ui/staff.specialty.editor.ui:73
334
+#: data/ui/query.window.ui:66
308 335
 msgid "Close"
309 336
 msgstr "Cerrar la wea"
310 337
 
311 338
 #: data/ui/tour.list.ui:218 data/ui/tour.places.ui:202
312 339
 #: data/ui/tourist.list.ui:176 data/ui/tourist.illnesses.ui:118
313
-#: data/ui/tourist.illness.editor.ui:77
340
+#: data/ui/tourist.illness.editor.ui:77 data/ui/staff.list.ui:218
341
+#: data/ui/staff.specialties.ui:118 data/ui/staff.specialty.editor.ui:77
314 342
 msgid "Close this window."
315 343
 msgstr "Cerrar la wea."
316 344
 
@@ -318,17 +346,19 @@ msgstr "Cerrar la wea."
318 346
 msgid "Tour Editor"
319 347
 msgstr "Editor de la Wea"
320 348
 
321
-#: data/ui/tour.editor.ui:233 data/ui/place.editor.ui:197
349
+#: data/ui/tour.editor.ui:233 data/ui/staff.editor.ui:185
350
+#: data/ui/place.editor.ui:197
322 351
 msgid "Create a new region by typing here."
323 352
 msgstr "Crear una nueva wea con escribir aquí."
324 353
 
325
-#: data/ui/tour.editor.ui:261 data/ui/place.editor.ui:225
354
+#: data/ui/tour.editor.ui:261 data/ui/staff.editor.ui:213
355
+#: data/ui/place.editor.ui:225
326 356
 msgid "Create a new city by typing here."
327 357
 msgstr "Crear una nueva wea con escribir aquí."
328 358
 
329 359
 #: data/ui/tour.editor.ui:286 data/ui/tour.place.editor.ui:149
330 360
 #: data/ui/tour.assign.vehicle.ui:67 data/ui/tourist.editor.ui:131
331
-#: data/ui/place.editor.ui:250
361
+#: data/ui/staff.editor.ui:238 data/ui/place.editor.ui:250
332 362
 msgid "Cancel"
333 363
 msgstr "Cancelar la wea"
334 364
 
@@ -354,7 +384,7 @@ msgstr "Asignar un vehículo a esta wea."
354 384
 
355 385
 #: data/ui/tour.editor.ui:343 data/ui/tour.place.editor.ui:168
356 386
 #: data/ui/tour.assign.vehicle.ui:86 data/ui/tourist.editor.ui:169
357
-#: data/ui/place.editor.ui:269
387
+#: data/ui/staff.editor.ui:276 data/ui/place.editor.ui:269
358 388
 msgid "Save"
359 389
 msgstr "Guardar la wea"
360 390
 
@@ -391,7 +421,8 @@ msgid "Departure Time"
391 421
 msgstr "Hora de Salida"
392 422
 
393 423
 #: data/ui/tour.places.ui:184 data/ui/tourist.illnesses.ui:100
394
-#: data/ui/tourist.illness.editor.ui:92
424
+#: data/ui/tourist.illness.editor.ui:92 data/ui/staff.specialties.ui:100
425
+#: data/ui/staff.specialty.editor.ui:92
395 426
 msgid "Add"
396 427
 msgstr "Agregar una wea"
397 428
 
@@ -424,7 +455,7 @@ msgid "Cancel the modification of this place."
424 455
 msgstr "Cancelar la modificación de esta wea."
425 456
 
426 457
 #: data/ui/tour.place.editor.ui:172 data/ui/tourist.illness.editor.ui:96
427
-#: data/ui/place.editor.ui:273
458
+#: data/ui/staff.specialty.editor.ui:96 data/ui/place.editor.ui:273
428 459
 msgid "Save this place."
429 460
 msgstr "Guardar esta wea."
430 461
 
@@ -520,10 +551,12 @@ msgid "The licence plate, make, year, and capacity of the vehicle."
520 551
 msgstr "La patente, marca, año y capacidad de la wea."
521 552
 
522 553
 #: data/ui/tourist.list.ui:68 data/ui/tourist.editor.ui:60
554
+#: data/ui/staff.list.ui:68 data/ui/staff.editor.ui:46
523 555
 msgid "RUN"
524 556
 msgstr "RUN"
525 557
 
526 558
 #: data/ui/tourist.list.ui:82 data/ui/tourist.editor.ui:93
559
+#: data/ui/staff.list.ui:82 data/ui/staff.editor.ui:79
527 560
 msgid "Name"
528 561
 msgstr "Nombre"
529 562
 
@@ -552,6 +585,7 @@ msgid "Cancel the modification of this tourist."
552 585
 msgstr "Cancelar la modificación de esta turista."
553 586
 
554 587
 #: data/ui/tourist.editor.ui:150 data/ui/tourist.illnesses.ui:23
588
+#: data/ui/staff.specialties.ui:23
555 589
 msgid "Illnesses"
556 590
 msgstr "Enfermedades"
557 591
 
@@ -564,21 +598,62 @@ msgid "Save this tourist."
564 598
 msgstr "Guardar esta turista."
565 599
 
566 600
 #: data/ui/tourist.illnesses.ui:68 data/ui/tourist.illness.editor.ui:53
601
+#: data/ui/staff.specialties.ui:68 data/ui/staff.specialty.editor.ui:53
567 602
 msgid "Illness"
568 603
 msgstr "Enfermedad"
569 604
 
570
-#: data/ui/tourist.illnesses.ui:104
605
+#: data/ui/tourist.illnesses.ui:104 data/ui/staff.specialties.ui:104
571 606
 msgid "Add new illnesses."
572 607
 msgstr "Agregar nuevo enfermedades."
573 608
 
574
-#: data/ui/tourist.illnesses.ui:132
609
+#: data/ui/tourist.illnesses.ui:132 data/ui/staff.specialties.ui:132
575 610
 msgid "Delete illnesses."
576 611
 msgstr "Borrar enfermedades."
577 612
 
578
-#: data/ui/tourist.illness.editor.ui:22
613
+#: data/ui/tourist.illness.editor.ui:22 data/ui/staff.specialty.editor.ui:22
579 614
 msgid "Add Illness"
580 615
 msgstr "Agregar Enfermedad"
581 616
 
617
+#: data/ui/staff.list.ui:96 data/ui/staff.editor.ui:95
618
+msgid "Street"
619
+msgstr "Calle"
620
+
621
+#: data/ui/staff.list.ui:110 data/ui/staff.editor.ui:309
622
+msgid "Number"
623
+msgstr "Numero"
624
+
625
+#: data/ui/staff.list.ui:175
626
+msgid "Edit selected staff member."
627
+msgstr "Editar la guía seleccionada."
628
+
629
+#: data/ui/staff.list.ui:189
630
+msgid "Create a new staff member."
631
+msgstr "Crear una guía nueva."
632
+
633
+#: data/ui/staff.list.ui:204
634
+msgid "Delete selected staff member."
635
+msgstr "Borrar la guía seleccionada."
636
+
637
+#: data/ui/staff.editor.ui:22
638
+msgid "Staff Editor"
639
+msgstr "Editor de Staff"
640
+
641
+#: data/ui/staff.editor.ui:242
642
+msgid "Cancel the modification of this guide."
643
+msgstr "Cancelar la modificación de esta guia."
644
+
645
+#: data/ui/staff.editor.ui:257
646
+msgid "Specialties"
647
+msgstr "Especialidades"
648
+
649
+#: data/ui/staff.editor.ui:261
650
+msgid "Add specialties to this guide."
651
+msgstr "Agregar especialidades a este guia."
652
+
653
+#: data/ui/staff.editor.ui:280
654
+msgid "Save this guide."
655
+msgstr "Guardar esta guia."
656
+
582 657
 #: data/ui/place.editor.ui:27
583 658
 msgid "Place Editor"
584 659
 msgstr "Editor de la Wea"

+ 98
- 23
po/sernatur.pot View File

@@ -8,7 +8,7 @@ msgid ""
8 8
 msgstr ""
9 9
 "Project-Id-Version: sernatur\n"
10 10
 "Report-Msgid-Bugs-To: \n"
11
-"POT-Creation-Date: 2019-01-21 00:47-0300\n"
11
+"POT-Creation-Date: 2019-01-21 03:25-0300\n"
12 12
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -88,16 +88,20 @@ msgstr ""
88 88
 msgid "SERNATUR version: "
89 89
 msgstr ""
90 90
 
91
-#: src/main_window.vala:227
91
+#: src/main_window.vala:238
92 92
 msgid "Error: Could not connect to the database!"
93 93
 msgstr ""
94 94
 
95
-#: src/main_window.vala:239 src/tour_list.vala:233 src/tour_editor.vala:231
95
+#: src/main_window.vala:250 src/tour_list.vala:233 src/tour_editor.vala:231
96 96
 #: src/tour_editor.vala:248 src/tour_editor.vala:280 src/tour_editor.vala:297
97 97
 #: src/tour_editor.vala:329 src/tour_editor.vala:346
98 98
 #: src/tour_assign_vehicle.vala:99 src/tourist_list.vala:206
99 99
 #: src/tourist_editor.vala:99 src/tourist_editor.vala:112
100 100
 #: src/tourist_editor.vala:128 src/tourist_editor.vala:141
101
+#: src/staff_editor.vala:227 src/staff_editor.vala:240
102
+#: src/staff_editor.vala:256 src/staff_editor.vala:269
103
+#: src/staff_editor.vala:291 src/staff_editor.vala:308
104
+#: src/staff_editor.vala:340 src/staff_editor.vala:357
101 105
 msgid "Error"
102 106
 msgstr ""
103 107
 
@@ -125,20 +129,20 @@ msgstr ""
125 129
 msgid "Error: A tour named \"%s\" already exists!"
126 130
 msgstr ""
127 131
 
128
-#: src/tour_editor.vala:276
132
+#: src/tour_editor.vala:276 src/staff_editor.vala:287
129 133
 msgid "Error: City name cannot be left blank!"
130 134
 msgstr ""
131 135
 
132
-#: src/tour_editor.vala:293
136
+#: src/tour_editor.vala:293 src/staff_editor.vala:304
133 137
 #, c-format
134 138
 msgid "Error: A city named \"%s\" already exists!"
135 139
 msgstr ""
136 140
 
137
-#: src/tour_editor.vala:325
141
+#: src/tour_editor.vala:325 src/staff_editor.vala:336
138 142
 msgid "Error: Region name cannot be left blank!"
139 143
 msgstr ""
140 144
 
141
-#: src/tour_editor.vala:342
145
+#: src/tour_editor.vala:342 src/staff_editor.vala:353
142 146
 #, c-format
143 147
 msgid "Error: A region named \"%s\" already exists!"
144 148
 msgstr ""
@@ -166,7 +170,7 @@ msgid ""
166 170
 "associated with them!"
167 171
 msgstr ""
168 172
 
169
-#: src/tourist_editor.vala:95
173
+#: src/tourist_editor.vala:95 src/staff_editor.vala:223
170 174
 msgid "Error: Tourist name cannot be left blank!"
171 175
 msgstr ""
172 176
 
@@ -174,7 +178,7 @@ msgstr ""
174 178
 msgid "Error: Tourist RUN cannot be left blank!"
175 179
 msgstr ""
176 180
 
177
-#: src/tourist_editor.vala:124
181
+#: src/tourist_editor.vala:124 src/staff_editor.vala:252
178 182
 msgid "Error: The RUN entered is invalid!"
179 183
 msgstr ""
180 184
 
@@ -191,6 +195,23 @@ msgstr ""
191 195
 msgid "Are you sure you wish to delete these illnesses from this tourist?"
192 196
 msgstr ""
193 197
 
198
+#: src/staff_list.vala:190
199
+msgid "Are you sure you wish to delete this staff member?"
200
+msgstr ""
201
+
202
+#: src/staff_list.vala:197
203
+msgid "Are you sure you wish to delete these staff members?"
204
+msgstr ""
205
+
206
+#: src/staff_editor.vala:236
207
+msgid "Error: Staff member RUN cannot be left blank!"
208
+msgstr ""
209
+
210
+#: src/staff_editor.vala:265
211
+#, c-format
212
+msgid "Error: A staff member with the RUN \"%s\" already exists!"
213
+msgstr ""
214
+
194 215
 #: src/query_window.vala:290 data/ui/main.window.ui:105
195 216
 msgid "(Q1) Regions with discounts"
196 217
 msgstr ""
@@ -219,7 +240,7 @@ msgstr ""
219 240
 msgid "Tours"
220 241
 msgstr ""
221 242
 
222
-#: data/ui/main.window.ui:61
243
+#: data/ui/main.window.ui:61 data/ui/staff.list.ui:23
223 244
 msgid "Staff"
224 245
 msgstr ""
225 246
 
@@ -257,16 +278,19 @@ msgid "Minimum People"
257 278
 msgstr ""
258 279
 
259 280
 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:186
281
+#: data/ui/staff.list.ui:124 data/ui/staff.editor.ui:161
260 282
 #: data/ui/place.editor.ui:150
261 283
 msgid "City"
262 284
 msgstr ""
263 285
 
264 286
 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:134
287
+#: data/ui/staff.list.ui:138 data/ui/staff.editor.ui:111
265 288
 #: data/ui/place.editor.ui:116
266 289
 msgid "Region"
267 290
 msgstr ""
268 291
 
269 292
 #: data/ui/tour.list.ui:170 data/ui/tourist.list.ui:128
293
+#: data/ui/staff.list.ui:170
270 294
 msgid "Edit"
271 295
 msgstr ""
272 296
 
@@ -275,7 +299,7 @@ msgid "Edit selected tour."
275 299
 msgstr ""
276 300
 
277 301
 #: data/ui/tour.list.ui:185 data/ui/tour.places.ui:212
278
-#: data/ui/tourist.list.ui:143
302
+#: data/ui/tourist.list.ui:143 data/ui/staff.list.ui:185
279 303
 msgid "New"
280 304
 msgstr ""
281 305
 
@@ -284,7 +308,8 @@ msgid "Create a new tour."
284 308
 msgstr ""
285 309
 
286 310
 #: data/ui/tour.list.ui:199 data/ui/tourist.list.ui:157
287
-#: data/ui/tourist.illnesses.ui:128
311
+#: data/ui/tourist.illnesses.ui:128 data/ui/staff.list.ui:199
312
+#: data/ui/staff.specialties.ui:128
288 313
 msgid "Delete"
289 314
 msgstr ""
290 315
 
@@ -294,13 +319,16 @@ msgstr ""
294 319
 
295 320
 #: data/ui/tour.list.ui:214 data/ui/tour.places.ui:198
296 321
 #: data/ui/tourist.list.ui:172 data/ui/tourist.illnesses.ui:114
297
-#: data/ui/tourist.illness.editor.ui:73 data/ui/query.window.ui:66
322
+#: data/ui/tourist.illness.editor.ui:73 data/ui/staff.list.ui:214
323
+#: data/ui/staff.specialties.ui:114 data/ui/staff.specialty.editor.ui:73
324
+#: data/ui/query.window.ui:66
298 325
 msgid "Close"
299 326
 msgstr ""
300 327
 
301 328
 #: data/ui/tour.list.ui:218 data/ui/tour.places.ui:202
302 329
 #: data/ui/tourist.list.ui:176 data/ui/tourist.illnesses.ui:118
303
-#: data/ui/tourist.illness.editor.ui:77
330
+#: data/ui/tourist.illness.editor.ui:77 data/ui/staff.list.ui:218
331
+#: data/ui/staff.specialties.ui:118 data/ui/staff.specialty.editor.ui:77
304 332
 msgid "Close this window."
305 333
 msgstr ""
306 334
 
@@ -308,17 +336,19 @@ msgstr ""
308 336
 msgid "Tour Editor"
309 337
 msgstr ""
310 338
 
311
-#: data/ui/tour.editor.ui:233 data/ui/place.editor.ui:197
339
+#: data/ui/tour.editor.ui:233 data/ui/staff.editor.ui:185
340
+#: data/ui/place.editor.ui:197
312 341
 msgid "Create a new region by typing here."
313 342
 msgstr ""
314 343
 
315
-#: data/ui/tour.editor.ui:261 data/ui/place.editor.ui:225
344
+#: data/ui/tour.editor.ui:261 data/ui/staff.editor.ui:213
345
+#: data/ui/place.editor.ui:225
316 346
 msgid "Create a new city by typing here."
317 347
 msgstr ""
318 348
 
319 349
 #: data/ui/tour.editor.ui:286 data/ui/tour.place.editor.ui:149
320 350
 #: data/ui/tour.assign.vehicle.ui:67 data/ui/tourist.editor.ui:131
321
-#: data/ui/place.editor.ui:250
351
+#: data/ui/staff.editor.ui:238 data/ui/place.editor.ui:250
322 352
 msgid "Cancel"
323 353
 msgstr ""
324 354
 
@@ -344,7 +374,7 @@ msgstr ""
344 374
 
345 375
 #: data/ui/tour.editor.ui:343 data/ui/tour.place.editor.ui:168
346 376
 #: data/ui/tour.assign.vehicle.ui:86 data/ui/tourist.editor.ui:169
347
-#: data/ui/place.editor.ui:269
377
+#: data/ui/staff.editor.ui:276 data/ui/place.editor.ui:269
348 378
 msgid "Save"
349 379
 msgstr ""
350 380
 
@@ -381,7 +411,8 @@ msgid "Departure Time"
381 411
 msgstr ""
382 412
 
383 413
 #: data/ui/tour.places.ui:184 data/ui/tourist.illnesses.ui:100
384
-#: data/ui/tourist.illness.editor.ui:92
414
+#: data/ui/tourist.illness.editor.ui:92 data/ui/staff.specialties.ui:100
415
+#: data/ui/staff.specialty.editor.ui:92
385 416
 msgid "Add"
386 417
 msgstr ""
387 418
 
@@ -414,7 +445,7 @@ msgid "Cancel the modification of this place."
414 445
 msgstr ""
415 446
 
416 447
 #: data/ui/tour.place.editor.ui:172 data/ui/tourist.illness.editor.ui:96
417
-#: data/ui/place.editor.ui:273
448
+#: data/ui/staff.specialty.editor.ui:96 data/ui/place.editor.ui:273
418 449
 msgid "Save this place."
419 450
 msgstr ""
420 451
 
@@ -510,10 +541,12 @@ msgid "The licence plate, make, year, and capacity of the vehicle."
510 541
 msgstr ""
511 542
 
512 543
 #: data/ui/tourist.list.ui:68 data/ui/tourist.editor.ui:60
544
+#: data/ui/staff.list.ui:68 data/ui/staff.editor.ui:46
513 545
 msgid "RUN"
514 546
 msgstr ""
515 547
 
516 548
 #: data/ui/tourist.list.ui:82 data/ui/tourist.editor.ui:93
549
+#: data/ui/staff.list.ui:82 data/ui/staff.editor.ui:79
517 550
 msgid "Name"
518 551
 msgstr ""
519 552
 
@@ -542,6 +575,7 @@ msgid "Cancel the modification of this tourist."
542 575
 msgstr ""
543 576
 
544 577
 #: data/ui/tourist.editor.ui:150 data/ui/tourist.illnesses.ui:23
578
+#: data/ui/staff.specialties.ui:23
545 579
 msgid "Illnesses"
546 580
 msgstr ""
547 581
 
@@ -554,21 +588,62 @@ msgid "Save this tourist."
554 588
 msgstr ""
555 589
 
556 590
 #: data/ui/tourist.illnesses.ui:68 data/ui/tourist.illness.editor.ui:53
591
+#: data/ui/staff.specialties.ui:68 data/ui/staff.specialty.editor.ui:53
557 592
 msgid "Illness"
558 593
 msgstr ""
559 594
 
560
-#: data/ui/tourist.illnesses.ui:104
595
+#: data/ui/tourist.illnesses.ui:104 data/ui/staff.specialties.ui:104
561 596
 msgid "Add new illnesses."
562 597
 msgstr ""
563 598
 
564
-#: data/ui/tourist.illnesses.ui:132
599
+#: data/ui/tourist.illnesses.ui:132 data/ui/staff.specialties.ui:132
565 600
 msgid "Delete illnesses."
566 601
 msgstr ""
567 602
 
568
-#: data/ui/tourist.illness.editor.ui:22
603
+#: data/ui/tourist.illness.editor.ui:22 data/ui/staff.specialty.editor.ui:22
569 604
 msgid "Add Illness"
570 605
 msgstr ""
571 606
 
607
+#: data/ui/staff.list.ui:96 data/ui/staff.editor.ui:95
608
+msgid "Street"
609
+msgstr ""
610
+
611
+#: data/ui/staff.list.ui:110 data/ui/staff.editor.ui:309
612
+msgid "Number"
613
+msgstr ""
614
+
615
+#: data/ui/staff.list.ui:175
616
+msgid "Edit selected staff member."
617
+msgstr ""
618
+
619
+#: data/ui/staff.list.ui:189
620
+msgid "Create a new staff member."
621
+msgstr ""
622
+
623
+#: data/ui/staff.list.ui:204
624
+msgid "Delete selected staff member."
625
+msgstr ""
626
+
627
+#: data/ui/staff.editor.ui:22
628
+msgid "Staff Editor"
629
+msgstr ""
630
+
631
+#: data/ui/staff.editor.ui:242
632
+msgid "Cancel the modification of this guide."
633
+msgstr ""
634
+
635
+#: data/ui/staff.editor.ui:257
636
+msgid "Specialties"
637
+msgstr ""
638
+
639
+#: data/ui/staff.editor.ui:261
640
+msgid "Add specialties to this guide."
641
+msgstr ""
642
+
643
+#: data/ui/staff.editor.ui:280
644
+msgid "Save this guide."
645
+msgstr ""
646
+
572 647
 #: data/ui/place.editor.ui:27
573 648
 msgid "Place Editor"
574 649
 msgstr ""

+ 12
- 1
src/main_window.vala View File

@@ -38,6 +38,11 @@ namespace Sernatur {
38 38
 		 */
39 39
 		[GtkChild]
40 40
 		private Gtk.MenuItem tours;
41
+		/**
42
+		 * The staff menu item
43
+		 */
44
+		[GtkChild]
45
+		private Gtk.MenuItem staff;
41 46
 		/**
42 47
 		 * The tourists menu item
43 48
 		 */
@@ -135,7 +140,13 @@ namespace Sernatur {
135 140
 				tour_list.initialize ();
136 141
 				tour_list.show_all ();
137 142
 			}
138
-			if (menu_item == tourists) {
143
+			else if (menu_item == staff) {
144
+				var staff_list = new StaffList (application, conn);
145
+				staff_list.set_transient_for (this); // Set this window as the parent of the new window
146
+				staff_list.initialize ();
147
+				staff_list.show_all ();
148
+			}
149
+			else if (menu_item == tourists) {
139 150
 				var tourist_list = new TouristList (application, conn);
140 151
 				tourist_list.set_transient_for (this); // Set this window as the parent of the new window
141 152
 				tourist_list.initialize ();

+ 4
- 0
src/meson.build View File

@@ -25,6 +25,8 @@ vala_sources = files(
25 25
 	'tourist_editor.vala',
26 26
 	'tourist_illnesses.vala',
27 27
 	'tourist_illness_editor.vala',
28
+	'staff_list.vala',
29
+	'staff_editor.vala',
28 30
 	'place_editor.vala',
29 31
 	'queries.vala',
30 32
 	'query_window.vala')
@@ -33,6 +35,7 @@ sources = vala_sources
33 35
 sources += main_gresource
34 36
 sources += tour_gresource
35 37
 sources += tourist_gresource
38
+sources += staff_gresource
36 39
 sources += place_gresource
37 40
 sources += query_gresource
38 41
 sources += config_data_file
@@ -41,6 +44,7 @@ vala_args = ['--vapidir=' + join_paths(meson.source_root(), 'vapi')]
41 44
 vala_args += ['--gresources=' + join_paths(meson.source_root(), 'data/ui/main.gresource.xml')]
42 45
 vala_args += ['--gresources=' + join_paths(meson.source_root(), 'data/ui/tour.gresource.xml')]
43 46
 vala_args += ['--gresources=' + join_paths(meson.source_root(), 'data/ui/tourist.gresource.xml')]
47
+vala_args += ['--gresources=' + join_paths(meson.source_root(), 'data/ui/staff.gresource.xml')]
44 48
 vala_args += ['--gresources=' + join_paths(meson.source_root(), 'data/ui/place.gresource.xml')]
45 49
 vala_args += ['--gresources=' + join_paths(meson.source_root(), 'data/ui/query.gresource.xml')]
46 50
 

+ 672
- 0
src/staff_editor.vala View File

@@ -0,0 +1,672 @@
1
+/*
2
+ * Copyright 2018-2019 Chris Cromer
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+ *
6
+ * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+ *
8
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+ *
10
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+ *
12
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13
+ */
14
+
15
+namespace Sernatur {
16
+	using LibSernatur.DB;
17
+	using LibSernatur.Misc;
18
+
19
+	/**
20
+	 * The staff editor window class
21
+	 */
22
+	[GtkTemplate (ui = "/cl/cromer/ubb/sernatur/staff.editor.ui")]
23
+	public class StaffEditor : Gtk.ApplicationWindow {
24
+		/**
25
+		 * The open database connection
26
+		 */
27
+		private Connection conn;
28
+		/**
29
+		 * The staff to edit
30
+		 */
31
+		private Guia staff;
32
+		/**
33
+		 * The city data stored in the list store
34
+		 */
35
+		private enum CityColumn {
36
+			/**
37
+			 * The city name
38
+			 */
39
+			CITY_NAME,
40
+			/**
41
+			 * The city object
42
+			 */
43
+			CITY,
44
+			/**
45
+			 * The number of colums in this enum
46
+			 */
47
+			N_COLUMNS
48
+		}
49
+		/**
50
+		 * The region data stored in the list store
51
+		 */
52
+		private enum RegionColumn {
53
+			/**
54
+			 * The region name
55
+			 */
56
+			REGION_NAME,
57
+			/**
58
+			 * The region object
59
+			 */
60
+			REGION,
61
+			/**
62
+			 * The number of colums in this enum
63
+			 */
64
+			N_COLUMNS
65
+		}
66
+		/**
67
+		 * The staff run
68
+		 */
69
+		[GtkChild]
70
+		private Gtk.Entry run;
71
+		/**
72
+		 * The staff name
73
+		 */
74
+		[GtkChild]
75
+		private Gtk.Entry guide_name;
76
+		/**
77
+		 * The street
78
+		 */
79
+		[GtkChild]
80
+		private Gtk.Entry street;
81
+		/**
82
+		 * The number
83
+		 */
84
+		[GtkChild]
85
+		private Gtk.Entry number;
86
+		/**
87
+		 * The region
88
+		 */
89
+		[GtkChild]
90
+		private Gtk.ComboBoxText region;
91
+		/**
92
+		 * The city
93
+		 */
94
+		[GtkChild]
95
+		private Gtk.ComboBoxText city;
96
+		/**
97
+		 * The city entry
98
+		 */
99
+		[GtkChild]
100
+		private Gtk.Entry city_entry;
101
+		/**
102
+		 * The save button
103
+		 */
104
+		[GtkChild]
105
+		private Gtk.Button save;
106
+		/**
107
+		 * The illnesses button
108
+		 */
109
+		[GtkChild]
110
+		private Gtk.Button specialties;
111
+		/**
112
+		 * The cancel button
113
+		 */
114
+		[GtkChild]
115
+		private Gtk.Button cancel;
116
+		/**
117
+		 * The list that stores the regions for the combo box
118
+		 */
119
+		private Gtk.ListStore region_list_store;
120
+		/**
121
+		 * The list that stores the cities for the combo box
122
+		 */
123
+		private Gtk.ListStore city_list_store = null;
124
+		/**
125
+		 * A list of associated places, this is only used in the case of a new staff
126
+		 */
127
+		//private List<Asociado> list_asociado = null;
128
+		/**
129
+		 * A saved copy of the original RUN
130
+		 */
131
+		private string original_run;
132
+		/**
133
+		 * A list of the cities from the database
134
+		 */
135
+		private List<Ciudad> cities;
136
+		/**
137
+		 * A list of the regions from the database
138
+		 */
139
+		private List<Region> regions;
140
+		/**
141
+		 * This signal is called when a staff is saved
142
+		 */
143
+		public signal void save_staff ();
144
+
145
+		/**
146
+		 * Called when a combobox changes
147
+		 * @param combobox The combobox that changed
148
+		 */
149
+		[GtkCallback]
150
+		public void on_changed_combobox (Gtk.ComboBox combobox) {
151
+			if (combobox == region) {
152
+				Gtk.TreeIter iter;
153
+				region.get_active_iter (out iter);
154
+				Region temp_region;
155
+				if (region_list_store.iter_is_valid (iter)) {
156
+					// The region is from the list, not typed
157
+					region_list_store.get (iter,
158
+						RegionColumn.REGION, out temp_region);
159
+					staff.ciudad.region = temp_region;
160
+					if (city_list_store != null && staff.ciudad.region.id_region != 0) {
161
+						reset_city ();
162
+					}
163
+				}
164
+			}
165
+		}
166
+
167
+		/**
168
+		 * Reset the city dropdown
169
+		 */
170
+		private void reset_city () {
171
+			try {
172
+				cities = Ciudad.get_all_ciudades_in_region (conn, staff.ciudad.region.id_region);
173
+			}
174
+			catch (Error e) {
175
+				#if DEBUG
176
+					error (e.message);
177
+				#else
178
+					warning (e.message);
179
+				#endif
180
+			}
181
+
182
+			if (cities.length () > 0) {
183
+				cities.sort_with_data ((a, b) => {
184
+					return strcmp (a.nombre_ciudad, b.nombre_ciudad);
185
+				});
186
+
187
+				if (city_list_store.iter_n_children (null) > 0) {
188
+					// If there are more than 0 rows clear it
189
+					city_list_store.clear ();
190
+				}
191
+				cities.foreach ((entry) => {
192
+					Gtk.TreeIter iter;
193
+					city_list_store.append (out iter);
194
+					city_list_store.set (iter,
195
+						CityColumn.CITY_NAME, entry.nombre_ciudad,
196
+						CityColumn.CITY, entry);
197
+					if (staff.ciudad.id_ciudad == 0) {
198
+						staff.ciudad.id_ciudad = entry.id_ciudad;
199
+						staff.ciudad.nombre_ciudad = entry.nombre_ciudad;
200
+					}
201
+					else {
202
+						if (entry.id_ciudad == staff.ciudad.id_ciudad) {
203
+							city.set_active_iter (iter);
204
+						}
205
+					}
206
+				});
207
+			}
208
+
209
+			city.set_active (-1);
210
+			city_entry.set_text ("");
211
+		}
212
+
213
+		/**
214
+		 * Validate the staff data before trying to insert it into the database
215
+		 * @return Returns true if the data is valid
216
+		 */
217
+		private bool validate_staff_data () {
218
+			if (staff.nombre_guia.strip () == "") {
219
+				var msg = new Gtk.MessageDialog (this,
220
+					Gtk.DialogFlags.MODAL,
221
+					Gtk.MessageType.ERROR,
222
+					Gtk.ButtonsType.CLOSE,
223
+					_ ("Error: Tourist name cannot be left blank!"));
224
+				msg.response.connect ((response_id) => {
225
+					msg.destroy ();
226
+				});
227
+				msg.set_title (_ ("Error"));
228
+				msg.run ();
229
+				return false;
230
+			}
231
+			if (staff.rut_guia.strip () == "") {
232
+				var msg = new Gtk.MessageDialog (this,
233
+					Gtk.DialogFlags.MODAL,
234
+					Gtk.MessageType.ERROR,
235
+					Gtk.ButtonsType.CLOSE,
236
+					_ ("Error: Staff member RUN cannot be left blank!"));
237
+				msg.response.connect ((response_id) => {
238
+					msg.destroy ();
239
+				});
240
+				msg.set_title (_ ("Error"));
241
+				msg.run ();
242
+				return false;
243
+			}
244
+			try {
245
+				new Rut (staff.rut_guia.strip ());
246
+			}
247
+			catch (Error e) {
248
+				var msg = new Gtk.MessageDialog (this,
249
+					Gtk.DialogFlags.MODAL,
250
+					Gtk.MessageType.ERROR,
251
+					Gtk.ButtonsType.CLOSE,
252
+					_ ("Error: The RUN entered is invalid!"));
253
+				msg.response.connect ((response_id) => {
254
+					msg.destroy ();
255
+				});
256
+				msg.set_title (_ ("Error"));
257
+				msg.run ();
258
+				return false;
259
+			}
260
+			if (staff_exists () && staff.rut_guia != original_run) {
261
+				var msg = new Gtk.MessageDialog (this,
262
+					Gtk.DialogFlags.MODAL,
263
+					Gtk.MessageType.ERROR,
264
+					Gtk.ButtonsType.CLOSE,
265
+					_ ("Error: A staff member with the RUN \"%s\" already exists!"), staff.rut_guia);
266
+				msg.response.connect ((response_id) => {
267
+					msg.destroy ();
268
+				});
269
+				msg.set_title (_ ("Error"));
270
+				msg.run ();
271
+				return false;
272
+			}
273
+			return true;
274
+		}
275
+
276
+		/**
277
+		 * Validate the city data before trying to insert it into the database
278
+		 * @param ciudad The city to validate
279
+		 * @return Returns true if the data is valid
280
+		 */
281
+		private bool validate_city_data (Ciudad ciudad) {
282
+			if (ciudad.nombre_ciudad.strip () == "") {
283
+				var msg = new Gtk.MessageDialog (this,
284
+					Gtk.DialogFlags.MODAL,
285
+					Gtk.MessageType.ERROR,
286
+					Gtk.ButtonsType.CLOSE,
287
+					_ ("Error: City name cannot be left blank!"));
288
+				msg.response.connect ((response_id) => {
289
+					msg.destroy ();
290
+				});
291
+				msg.set_title (_ ("Error"));
292
+				msg.run ();
293
+				return false;
294
+			}
295
+			bool list_success = true;
296
+			try {
297
+				List<Ciudad> list = Ciudad.get_all_ciudades (conn);
298
+				list.foreach ((entry) => {
299
+					if (ciudad.nombre_ciudad.down () == entry.nombre_ciudad.down ()) {
300
+						var msg = new Gtk.MessageDialog (this,
301
+							Gtk.DialogFlags.MODAL,
302
+							Gtk.MessageType.ERROR,
303
+							Gtk.ButtonsType.CLOSE,
304
+							_ ("Error: A city named \"%s\" already exists!"), entry.nombre_ciudad);
305
+						msg.response.connect ((response_id) => {
306
+							msg.destroy ();
307
+						});
308
+						msg.set_title (_ ("Error"));
309
+						msg.run ();
310
+						list_success = false;
311
+					}
312
+				});
313
+			}
314
+			catch (Error e) {
315
+				#if DEBUG
316
+					error (e.message);
317
+				#else
318
+					warning (e.message);
319
+					return false;
320
+				#endif
321
+			}
322
+			return list_success;
323
+		}
324
+
325
+		/**
326
+		 * Validate the region data before trying to insert it into the database
327
+		 * @param region The region to validate
328
+		 * @return Returns true if the data is valid
329
+		 */
330
+		private bool validate_region_data (Region region) {
331
+			if (region.nombre_region.strip () == "") {
332
+				var msg = new Gtk.MessageDialog (this,
333
+					Gtk.DialogFlags.MODAL,
334
+					Gtk.MessageType.ERROR,
335
+					Gtk.ButtonsType.CLOSE,
336
+					_ ("Error: Region name cannot be left blank!"));
337
+				msg.response.connect ((response_id) => {
338
+					msg.destroy ();
339
+				});
340
+				msg.set_title (_ ("Error"));
341
+				msg.run ();
342
+				return false;
343
+			}
344
+			bool list_success = true;
345
+			try {
346
+				List<Region> list = Region.get_all_regiones (conn);
347
+				list.foreach ((entry) => {
348
+					if (region.nombre_region.down () == entry.nombre_region.down ()) {
349
+						var msg = new Gtk.MessageDialog (this,
350
+							Gtk.DialogFlags.MODAL,
351
+							Gtk.MessageType.ERROR,
352
+							Gtk.ButtonsType.CLOSE,
353
+							_ ("Error: A region named \"%s\" already exists!"), entry.nombre_region);
354
+						msg.response.connect ((response_id) => {
355
+							msg.destroy ();
356
+						});
357
+						msg.set_title (_ ("Error"));
358
+						msg.run ();
359
+						list_success = false;
360
+					}
361
+				});
362
+			}
363
+			catch (Error e) {
364
+				#if DEBUG
365
+					error (e.message);
366
+				#else
367
+					warning (e.message);
368
+					return false;
369
+				#endif
370
+			}
371
+			return list_success;
372
+		}
373
+
374
+		private bool staff_exists () {
375
+			try {
376
+				staff.rut_guia = new Rut (run.get_text ().strip ()).get_clean_rut ();
377
+			}
378
+			catch (Error e) {
379
+				#if DEBUG
380
+					error (e.message);
381
+				#else
382
+					warning (e.message);
383
+				#endif
384
+			}
385
+			try {
386
+				Guia guia = Guia.get_guia_by_run (conn, staff.rut_guia);
387
+				if (guia == null) {
388
+					return false;
389
+				}
390
+				else {
391
+					return true;
392
+				}
393
+			}
394
+			catch (Error e) {
395
+				#if DEBUG
396
+					error (e.message);
397
+				#else
398
+					warning (e.message);
399
+					return false;
400
+				#endif
401
+			}
402
+		}
403
+
404
+		/**
405
+		 * This callback is called when a button is clicked
406
+		 * @param button The button that was clicked
407
+		 */
408
+		[GtkCallback]
409
+		public void on_clicked_button (Gtk.Button button) {
410
+			if (button == save) {
411
+				if (update_staff_instance () && validate_staff_data ()) {
412
+					if (!staff_exists () && original_run == null) {
413
+						/*try {
414
+							Guia.insert_staff (conn, staff);
415
+							save_staff (); // Signal the parent to update itself
416
+							this.close ();
417
+						}
418
+						catch (Error e) {
419
+							#if DEBUG
420
+								error (e.message);
421
+							#else
422
+								warning (e.message);
423
+							#endif
424
+						}*/
425
+					}
426
+					else {
427
+						/*try {
428
+							Guia.update_staff (conn, staff, original_run);
429
+						}
430
+						catch (Error e) {
431
+							#if DEBUG
432
+								error (e.message);
433
+							#else
434
+								warning (e.message);
435
+							#endif
436
+						}
437
+						finally {
438
+							save_staff (); // Signal the parent to update itself
439
+							this.close ();
440
+						}*/
441
+					}
442
+				}
443
+			}
444
+			else if (button == specialties) {
445
+				/*var staff_illnesses = new TouristIllnesses (application, conn, staff);
446
+				staff_illnesses.set_transient_for (this); // Set this window as the parent of the new window
447
+				staff_illnesses.initialize ();
448
+				staff_illnesses.show_all ();*/
449
+				//staff_illnesses.save_places.connect (on_save_places);
450
+			}
451
+			else if (button == cancel) {
452
+				this.close ();
453
+			}
454
+		}
455
+
456
+		/**
457
+		 * Called when some associated places are saved and a staff id doesn't exist yet
458
+		 * @param staff_places The TouristPlaces instance that called this signal
459
+		 * @param list_asociado The list of new associations
460
+		 */
461
+		/*private void on_save_places (TouristPlaces staff_places, List<Asociado> list_asociado) {
462
+			this.list_asociado = list_asociado.copy ();
463
+			places.sensitive = false;
464
+		}*/
465
+
466
+		/**
467
+		 * Called when a vehcile is assigned to the staff, and the staff is not in the database yet
468
+		 * @param staff_assign_vehicle The TouristAssignVehicle instance that called this signal
469
+		 * @param requerir_auto The vehicle to assign to this staff
470
+		 */
471
+		/*private void on_save_vehicle (TouristAssignVehicle staff_assign_vehicle, RequerirAuto? requerir_auto) {
472
+			if (requerir_auto != null) {
473
+				this.requerir_auto = requerir_auto;
474
+				vehicle.sensitive = false;
475
+			}
476
+		}*/
477
+
478
+		/**
479
+		 * Update the the staff object with new info from the editor
480
+		 * @return Returns false if the information is not valid
481
+		 */
482
+		private bool update_staff_instance () {
483
+			staff.rut_guia = run.get_text ().strip ();
484
+			staff.nombre_guia = guide_name.get_text ().strip ();
485
+
486
+			if (region.get_active () == -1) {
487
+				Region new_region = new Region (0, region.get_active_text ().strip ());
488
+				try {
489
+					if (validate_region_data (new_region)) {
490
+						new_region.id_region = Region.insert_region (conn, new_region);
491
+						return update_staff_instance_city (new_region);
492
+					}
493
+					else {
494
+						return false;
495
+					}
496
+				}
497
+				catch (Error e) {
498
+					#if DEBUG
499
+						error (e.message);
500
+					#else
501