restructuring and queries

This commit is contained in:
Chris Cromer 2019-01-14 11:38:38 -03:00
parent d0508ab4ca
commit 0f6ddb8075
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
10 changed files with 682 additions and 266 deletions

View File

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1
Copyright 2018-2019 Chris Cromer
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
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.
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.
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.
-->
<interface domain="sernatur">
<requires lib="gtk+" version="3.20"/>
<object class="GtkListStore" id="liststore1"/>
<object class="GtkTreeView" id="query_tree">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscroll_policy">natural</property>
<property name="vscroll_policy">natural</property>
<property name="model">liststore1</property>
<property name="fixed_height_mode">True</property>
<property name="enable_grid_lines">both</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="region_name">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Region Name</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="markup">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="quantity">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Quantity</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="markup">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</interface>

View File

@ -15,6 +15,6 @@
<gresources> <gresources>
<gresource prefix="/cl/cromer/ubb/sernatur"> <gresource prefix="/cl/cromer/ubb/sernatur">
<file preprocess="xml-stripblanks">query.window.ui</file> <file preprocess="xml-stripblanks">query.window.ui</file>
<file preprocess="xml-stripblanks">query.1.ui</file> <file preprocess="xml-stripblanks">query.tree.ui</file>
</gresource> </gresource>
</gresources> </gresources>

168
data/ui/query.tree.ui Normal file
View File

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1
Copyright 2018-2019 Chris Cromer
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
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.
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.
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.
-->
<interface domain="sernatur">
<requires lib="gtk+" version="3.20"/>
<object class="GtkListStore" id="liststore1"/>
<object class="GtkTreeView" id="query_tree_q1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore1</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="enable_grid_lines">both</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="region_name">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Region Name</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="markup">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="quantity">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Quantity</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="markup">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
<object class="GtkTreeView" id="query_tree_q2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">liststore1</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="enable_grid_lines">both</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="tour_name_q2">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Tour Name</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="total_value">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Total Value</property>
</object>
</child>
</object>
<object class="GtkTreeView" id="query_tree_q3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">liststore1</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="enable_grid_lines">both</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="tour_name_q3">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Tour Name</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="coordinator_total">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Coordinator Total</property>
</object>
</child>
</object>
<object class="GtkTreeView" id="query_tree_q4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">liststore1</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="enable_grid_lines">both</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="tour_name_q">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Tour Name</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="tourist_total">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Tourist Total</property>
</object>
</child>
</object>
<object class="GtkTreeView" id="query_tree_q5">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">liststore1</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="enable_grid_lines">both</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="percentage">
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Percentage</property>
</object>
</child>
</object>
</interface>

View File

@ -186,6 +186,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<property name="margin_right">5</property> <property name="margin_right">5</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
<property name="wrap">True</property>
<attributes> <attributes>
<attribute name="font-desc" value="Sans 6"/> <attribute name="font-desc" value="Sans 6"/>
</attributes> </attributes>

View File

@ -32,6 +32,6 @@ data/ui/main.splash.ui
data/ui/tour.list.ui data/ui/tour.list.ui
data/ui/tour.editor.ui data/ui/tour.editor.ui
data/ui/query.window.ui data/ui/query.window.ui
data/ui/query.1.ui data/ui/query.tree.ui
data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml
data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml

319
po/es.po
View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: sernatur\n" "Project-Id-Version: sernatur\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-13 19:14-0300\n" "POT-Creation-Date: 2019-01-14 11:35-0300\n"
"PO-Revision-Date: 2019-01-13 19:15-0300\n" "PO-Revision-Date: 2019-01-14 11:37-0300\n"
"Last-Translator: Chris Cromer <chris@cromer.cl>\n" "Last-Translator: Chris Cromer <chris@cromer.cl>\n"
"Language-Team: none\n" "Language-Team: none\n"
"Language: es\n" "Language: es\n"
@ -20,15 +20,80 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n" "X-Poedit-Basepath: .\n"
#: data/ui/main.splash.ui:46 #: lib/db.vala:67
msgid "Christopher Cromer" msgid "Postgresql server version:"
msgstr "Christopher Cromer" msgstr "Versión del servidor Postgresql:"
#: lib/dbwrapper.vala:138
#, c-format
msgid "The field %s was not found in the query results!"
msgstr "La campo %s no estaba en los resultados de la consulta!"
#: lib/misc.vala:138
#, c-format
msgid "The RUT %s has an invalid character!"
msgstr "El RUT %s tiene un carácter invalido!"
#: lib/misc.vala:154
#, c-format
msgid "The RUT %s is too big!"
msgstr "El RUT %s es demasiado grande!"
#: lib/misc.vala:159
#, c-format
msgid "The verifier %C is invalid!"
msgstr "El verificador %C es invalido!"
#: src/sernatur.vala:88
#, c-format
msgid "Error: %s\n"
msgstr "Error %s\n"
#: src/sernatur.vala:89
#, c-format
msgid ""
"Run '%s --help' to see a full list of available command line options.\n"
msgstr ""
"Correr '%s --help' para ver una lista completa de las opciones de la "
"consola.\n"
#: src/sernatur.vala:94
msgid "SERNATUR version: "
msgstr "Versión de SERNATUR: "
#: src/main_window.vala:216
msgid "Error: Could not connect to the database!"
msgstr "Error: No se puede conectar al base de datos!"
#: src/main_window.vala:228
msgid "Error"
msgstr "Error"
#: src/query_window.vala:232 data/ui/main.window.ui:143
msgid "(Q1) Regions with discounts"
msgstr "(Q1) Regiones sin descuentos"
#: src/query_window.vala:245 data/ui/main.window.ui:151
msgid "(Q2) Tour values"
msgstr "(Q2) Valores tour"
#: src/query_window.vala:258 data/ui/main.window.ui:159
msgid "(Q3) Coordinator total"
msgstr "(Q3) Total de coordinadores"
#: src/query_window.vala:271 data/ui/main.window.ui:167
msgid "(Q4) Tourist total"
msgstr "(Q4) Total de turistas"
#: src/query_window.vala:284 data/ui/main.window.ui:175
msgid "(Q5) Vehicle total"
msgstr "(Q5) Total de vehículos"
#: data/ui/main.window.ui:44 #: data/ui/main.window.ui:44
msgid "_Menu" msgid "_Menu"
msgstr "_Menú" msgstr "_Menú"
#: data/ui/main.window.ui:54 data/ui/query.window.ui:22 data/ui/tour.list.ui:22 #: data/ui/main.window.ui:54 data/ui/tour.list.ui:23
msgid "Tours" msgid "Tours"
msgstr "Tours" msgstr "Tours"
@ -64,78 +129,67 @@ msgstr "Salir"
msgid "_Views" msgid "_Views"
msgstr "_Vistas" msgstr "_Vistas"
#: data/ui/main.window.ui:143 #: data/ui/main.splash.ui:46
msgid "(Q1) Regions with discounts" msgid "Christopher Cromer"
msgstr "(Q1) Regiones sin descuentos" msgstr "Christopher Cromer"
#: data/ui/main.window.ui:151 #: data/ui/tour.list.ui:68 data/ui/tour.editor.ui:54 data/ui/query.tree.ui:80
msgid "(Q2) Tour values" #: data/ui/query.tree.ui:108 data/ui/query.tree.ui:136
msgstr "(Q2) Valores tour" msgid "Tour Name"
msgstr "Nombre del Tour"
#: data/ui/main.window.ui:159 #: data/ui/tour.list.ui:82 data/ui/tour.editor.ui:87
msgid "(Q3) Coordinator total" msgid "Individual Cost"
msgstr "(Q3) Total de coordinadores" msgstr "Costo Individual"
#: data/ui/main.window.ui:167 #: data/ui/tour.list.ui:96 data/ui/tour.editor.ui:103
msgid "(Q4) Tourist total" msgid "Group Cost"
msgstr "(Q4) Total de turistas" msgstr "Costo Grupal"
#: data/ui/main.window.ui:175 #: data/ui/tour.list.ui:110 data/ui/tour.editor.ui:119
msgid "(Q5) Vehicle total" msgid "Minimum People"
msgstr "(Q5) Total de vehículos" msgstr "Mínima Personas"
#: data/ui/query.1.ui:37 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:187
msgid "Region Name" msgid "City"
msgstr "Nombre de Región" msgstr "Ciudad"
#: data/ui/query.1.ui:49 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:135
msgid "Quantity" msgid "Region"
msgstr "Cantidad" msgstr "Región"
#: data/ui/query.window.ui:67 data/ui/tour.list.ui:212 #: data/ui/tour.list.ui:170
msgid "Edit"
msgstr "Editar"
#: data/ui/tour.list.ui:175
msgid "Edit selected tour."
msgstr "Editar el tour seleccionado."
#: data/ui/tour.list.ui:185
msgid "New"
msgstr "Nuevo"
#: data/ui/tour.list.ui:189
msgid "Create a new tour."
msgstr "Crear un tour nuevo."
#: data/ui/tour.list.ui:199
msgid "Delete"
msgstr "Borrar"
#: data/ui/tour.list.ui:203
msgid "Delete selected tour."
msgstr "Borrar el tour seleccionado."
#: data/ui/tour.list.ui:214 data/ui/query.window.ui:67
msgid "Close" msgid "Close"
msgstr "Cerrar" msgstr "Cerrar"
#: data/ui/query.window.ui:85
msgid "Run"
msgstr "Correr"
#: data/ui/query.window.ui:127
msgid "Statement"
msgstr "Enunciado"
#: data/ui/query.window.ui:157
msgid "View and Query"
msgstr "Vista y Consulta"
#: data/ui/tour.editor.ui:29 #: data/ui/tour.editor.ui:29
msgid "Tour Editor" msgid "Tour Editor"
msgstr "Editor de Tour" msgstr "Editor de Tour"
#: data/ui/tour.editor.ui:54 data/ui/tour.list.ui:66
msgid "Tour Name"
msgstr "Nombre del Tour"
#: data/ui/tour.editor.ui:87 data/ui/tour.list.ui:80
msgid "Individual Cost"
msgstr "Costo Individual"
#: data/ui/tour.editor.ui:103 data/ui/tour.list.ui:94
msgid "Group Cost"
msgstr "Costo Grupal"
#: data/ui/tour.editor.ui:119 data/ui/tour.list.ui:108
msgid "Minimum People"
msgstr "Mínima Personas"
#: data/ui/tour.editor.ui:135 data/ui/tour.list.ui:136
msgid "Region"
msgstr "Región"
#: data/ui/tour.editor.ui:187 data/ui/tour.list.ui:122
msgid "City"
msgstr "Ciudad"
#: data/ui/tour.editor.ui:234 #: data/ui/tour.editor.ui:234
msgid "Create a new region by typing here." msgid "Create a new region by typing here."
msgstr "Crear una nueva región con escribir aquí." msgstr "Crear una nueva región con escribir aquí."
@ -160,91 +214,88 @@ msgstr "Guardar"
msgid "Save this tour." msgid "Save this tour."
msgstr "Guardar este tour." msgstr "Guardar este tour."
#: data/ui/tour.list.ui:168 #: data/ui/query.window.ui:85
msgid "Edit" msgid "Run"
msgstr "Editar" msgstr "Correr"
#: data/ui/tour.list.ui:173 #: data/ui/query.window.ui:127
msgid "Edit selected tour." msgid "Statement"
msgstr "Editar el tour seleccionado." msgstr "Enunciado"
#: data/ui/tour.list.ui:183 #: data/ui/query.window.ui:157
msgid "New" msgid "View and Query"
msgstr "Nuevo" msgstr "Vista y Consulta"
#: data/ui/tour.list.ui:187 #: data/ui/query.tree.ui:40
msgid "Create a new tour." msgid "Region Name"
msgstr "Crear un tour nuevo." msgstr "Nombre de Región"
#: data/ui/tour.list.ui:197 #: data/ui/query.tree.ui:52
msgid "Delete" msgid "Quantity"
msgstr "Borrar" msgstr "Cantidad"
#: data/ui/tour.list.ui:201 #: data/ui/query.tree.ui:86
msgid "Delete selected tour." msgid "Total Value"
msgstr "Borrar el tour seleccionado." msgstr "Valor Total"
#: src/main_window.vala:184 #: data/ui/query.tree.ui:114
msgid "Error" msgid "Coordinator Total"
msgstr "Error" msgstr "Total de Coordinadores"
#: src/sernatur.vala:88 #: data/ui/query.tree.ui:142
#, c-format msgid "Tourist Total"
msgid "Error: %s\n" msgstr "Total de Turistas"
msgstr "Error %s\n"
#: src/sernatur.vala:89 #: data/ui/query.tree.ui:164
#, c-format msgid "Percentage"
msgid "Run '%s --help' to see a full list of available command line options.\n" msgstr "Porcentaje"
msgstr ""
"Correr '%s --help' para ver una lista completa de las opciones de la "
"consola.\n"
#: src/sernatur.vala:94 #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:5
msgid "SERNATUR version: " #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:6
msgstr "Versión de SERNATUR: " msgid "Host to connect to"
msgstr "Servidor a conectar"
#~ msgid "Postgresql server version:" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:12
#~ msgstr "Versión del servidor Postgresql:" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:13
msgid "Port number to use"
msgstr "Número de puerto a usar"
#~ msgid "The field %s was not found in the query results!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:19
#~ msgstr "La campo %s no estaba en los resultados de la consulta!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:20
msgid "Options to use"
msgstr "Opciones a usar"
#~ msgid "The RUT %s has an invalid character!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:26
#~ msgstr "El RUT %s tiene un carácter invalido!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:27
msgid "tty to send debug info (ignored)"
msgstr "tty para enviar datos de depuración (ignorado)"
#~ msgid "The RUT %s is too big!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:33
#~ msgstr "El RUT %s es demasiado grande!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:34
msgid "Database to use"
msgstr "Base de dato a usar"
#~ msgid "The verifier %C is invalid!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:40
#~ msgstr "El verificador %C es invalido!" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:41
msgid "Username to use"
msgstr "Nombre de usuario a usar"
#~ msgid "Host to connect to" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:47
#~ msgstr "Servidor a conectar" #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:48
msgid "Password to use"
msgstr "Contraseña a usar"
#~ msgid "Port number to use" #: data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml:5
#~ msgstr "Número de puerto a usar" #: data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml:6
msgid "Should the program open maximized or not"
msgstr "Si el programa debe abrir maximizado ó no"
#~ msgid "Options to use" #: data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml:12
#~ msgstr "Opciones a usar" #: data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml:13
msgid "Window width"
msgstr "El ancho de la ventana"
#~ msgid "tty to send debug info (ignored)" #: data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml:19
#~ msgstr "tty para enviar datos de depuración (ignorado)" #: data/gschema/cl.cromer.ubb.sernatur.window.gschema.xml:20
msgid "Window height"
#~ msgid "Database to use" msgstr "La altura de la venta"
#~ msgstr "Base de dato a usar"
#~ msgid "Username to use"
#~ msgstr "Nombre de usuario a usar"
#~ msgid "Password to use"
#~ msgstr "Contraseña a usar"
#~ msgid "Should the program open maximized or not"
#~ msgstr "Si el programa debe abrir maximizado ó no"
#~ msgid "Window width"
#~ msgstr "El ancho de la ventana"
#~ msgid "Window height"
#~ msgstr "La altura de la venta"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: sernatur\n" "Project-Id-Version: sernatur\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-13 19:10-0300\n" "POT-Creation-Date: 2019-01-14 11:35-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -55,15 +55,39 @@ msgstr ""
msgid "SERNATUR version: " msgid "SERNATUR version: "
msgstr "" msgstr ""
#: src/main_window.vala:184 #: src/main_window.vala:216
msgid "Error: Could not connect to the database!"
msgstr ""
#: src/main_window.vala:228
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: src/query_window.vala:232 data/ui/main.window.ui:143
msgid "(Q1) Regions with discounts"
msgstr ""
#: src/query_window.vala:245 data/ui/main.window.ui:151
msgid "(Q2) Tour values"
msgstr ""
#: src/query_window.vala:258 data/ui/main.window.ui:159
msgid "(Q3) Coordinator total"
msgstr ""
#: src/query_window.vala:271 data/ui/main.window.ui:167
msgid "(Q4) Tourist total"
msgstr ""
#: src/query_window.vala:284 data/ui/main.window.ui:175
msgid "(Q5) Vehicle total"
msgstr ""
#: data/ui/main.window.ui:44 #: data/ui/main.window.ui:44
msgid "_Menu" msgid "_Menu"
msgstr "" msgstr ""
#: data/ui/main.window.ui:54 data/ui/tour.list.ui:22 data/ui/query.window.ui:22 #: data/ui/main.window.ui:54 data/ui/tour.list.ui:23
msgid "Tours" msgid "Tours"
msgstr "" msgstr ""
@ -99,79 +123,60 @@ msgstr ""
msgid "_Views" msgid "_Views"
msgstr "" msgstr ""
#: data/ui/main.window.ui:143
msgid "(Q1) Regions with discounts"
msgstr ""
#: data/ui/main.window.ui:151
msgid "(Q2) Tour values"
msgstr ""
#: data/ui/main.window.ui:159
msgid "(Q3) Coordinator total"
msgstr ""
#: data/ui/main.window.ui:167
msgid "(Q4) Tourist total"
msgstr ""
#: data/ui/main.window.ui:175
msgid "(Q5) Vehicle total"
msgstr ""
#: data/ui/main.splash.ui:46 #: data/ui/main.splash.ui:46
msgid "Christopher Cromer" msgid "Christopher Cromer"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:66 data/ui/tour.editor.ui:54 #: data/ui/tour.list.ui:68 data/ui/tour.editor.ui:54 data/ui/query.tree.ui:80
#: data/ui/query.tree.ui:108 data/ui/query.tree.ui:136
msgid "Tour Name" msgid "Tour Name"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:80 data/ui/tour.editor.ui:87 #: data/ui/tour.list.ui:82 data/ui/tour.editor.ui:87
msgid "Individual Cost" msgid "Individual Cost"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:94 data/ui/tour.editor.ui:103 #: data/ui/tour.list.ui:96 data/ui/tour.editor.ui:103
msgid "Group Cost" msgid "Group Cost"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:108 data/ui/tour.editor.ui:119 #: data/ui/tour.list.ui:110 data/ui/tour.editor.ui:119
msgid "Minimum People" msgid "Minimum People"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:122 data/ui/tour.editor.ui:187 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:187
msgid "City" msgid "City"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:136 data/ui/tour.editor.ui:135 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:135
msgid "Region" msgid "Region"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:168 #: data/ui/tour.list.ui:170
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:173 #: data/ui/tour.list.ui:175
msgid "Edit selected tour." msgid "Edit selected tour."
msgstr "" msgstr ""
#: data/ui/tour.list.ui:183 #: data/ui/tour.list.ui:185
msgid "New" msgid "New"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:187 #: data/ui/tour.list.ui:189
msgid "Create a new tour." msgid "Create a new tour."
msgstr "" msgstr ""
#: data/ui/tour.list.ui:197 #: data/ui/tour.list.ui:199
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:201 #: data/ui/tour.list.ui:203
msgid "Delete selected tour." msgid "Delete selected tour."
msgstr "" msgstr ""
#: data/ui/tour.list.ui:212 data/ui/query.window.ui:67 #: data/ui/tour.list.ui:214 data/ui/query.window.ui:67
msgid "Close" msgid "Close"
msgstr "" msgstr ""
@ -215,14 +220,30 @@ msgstr ""
msgid "View and Query" msgid "View and Query"
msgstr "" msgstr ""
#: data/ui/query.1.ui:37 #: data/ui/query.tree.ui:40
msgid "Region Name" msgid "Region Name"
msgstr "" msgstr ""
#: data/ui/query.1.ui:49 #: data/ui/query.tree.ui:52
msgid "Quantity" msgid "Quantity"
msgstr "" msgstr ""
#: data/ui/query.tree.ui:86
msgid "Total Value"
msgstr ""
#: data/ui/query.tree.ui:114
msgid "Coordinator Total"
msgstr ""
#: data/ui/query.tree.ui:142
msgid "Tourist Total"
msgstr ""
#: data/ui/query.tree.ui:164
msgid "Percentage"
msgstr ""
#: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:5 #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:5
#: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:6 #: data/gschema/cl.cromer.ubb.sernatur.db.gschema.xml:6
msgid "Host to connect to" msgid "Host to connect to"

View File

@ -39,10 +39,30 @@ namespace Sernatur {
[GtkChild] [GtkChild]
private Gtk.MenuItem tours; private Gtk.MenuItem tours;
/** /**
* The q1 menu item * The Q1 menu item
*/ */
[GtkChild] [GtkChild]
private Gtk.MenuItem q1; private Gtk.MenuItem q1;
/**
* The Q2 menu item
*/
[GtkChild]
private Gtk.MenuItem q2;
/**
* The Q3 menu item
*/
[GtkChild]
private Gtk.MenuItem q3;
/**
* The Q4 menu item
*/
[GtkChild]
private Gtk.MenuItem q4;
/**
* The Q5 menu item
*/
[GtkChild]
private Gtk.MenuItem q5;
/** /**
* The quit menu item * The quit menu item
*/ */
@ -111,7 +131,31 @@ namespace Sernatur {
tour_list.show_all (); tour_list.show_all ();
} }
else if (menu_item == q1) { else if (menu_item == q1) {
var query_window = new QueryWindow (application, conn); var query_window = new QueryWindow (application, conn, Query.Q1);
query_window.set_transient_for (this); // Set this window as the parent of the new window
query_window.initialize ();
query_window.show_all ();
}
else if (menu_item == q2) {
var query_window = new QueryWindow (application, conn, Query.Q2);
query_window.set_transient_for (this); // Set this window as the parent of the new window
query_window.initialize ();
query_window.show_all ();
}
else if (menu_item == q3) {
var query_window = new QueryWindow (application, conn, Query.Q3);
query_window.set_transient_for (this); // Set this window as the parent of the new window
query_window.initialize ();
query_window.show_all ();
}
else if (menu_item == q4) {
var query_window = new QueryWindow (application, conn, Query.Q4);
query_window.set_transient_for (this); // Set this window as the parent of the new window
query_window.initialize ();
query_window.show_all ();
}
else if (menu_item == q5) {
var query_window = new QueryWindow (application, conn, Query.Q5);
query_window.set_transient_for (this); // Set this window as the parent of the new window query_window.set_transient_for (this); // Set this window as the parent of the new window
query_window.initialize (); query_window.initialize ();
query_window.show_all (); query_window.show_all ();
@ -169,7 +213,7 @@ namespace Sernatur {
Gtk.DialogFlags.MODAL, Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR, Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE, Gtk.ButtonsType.CLOSE,
e.message); dgettext(null, "Error: Could not connect to the database!"));
msg.response.connect ((response_id) => { msg.response.connect ((response_id) => {
switch (response_id) { switch (response_id) {
case Gtk.ResponseType.CLOSE: case Gtk.ResponseType.CLOSE:

View File

@ -17,13 +17,25 @@ namespace Sernatur {
/** /**
* The Q1 statement * The Q1 statement
*/ */
public const string Q1_STATEMENT = "Genere la vista REGIONES SINDESCUENTO(nombreRegion, cantidad) que contiene el nombre public const string Q1_STATEMENT = "Genere la vista REGIONES_SINDESCUENTO(nombreRegion, cantidad) que contiene el nombre de cada región y la cantidad de personas a las que no se les ha aplicado descuento y que han visitado algún lugar de la región en algún tour, durante el mes de noviembre del presente año. Luego utilizando la vista, muestre las regiones que han recibido la mayor cantidad de turistas sin descuento.";
de cada región y la cantidad de personas a las que no se les ha aplicado descuento y que han
visitado algún lugar de la región en algún tour, durante el mes de noviembre del presente año.
Luego utilizando la vista, muestre las regiones que han recibido la mayor cantidad de turistas
sin descuento.";
/** /**
* The Q1 sql * The Q2 statement
*/
public const string Q2_STATEMENT = "Genere la vista VALORES_TOURS(idT, nombreT, TotalVentas) que contiene el identificador y nombre de cada tour, además del total de ventas de cada tour. Par ello debe considerar todas las ventas realizadas del tour. Genere la vista TOUR_DESCUENTOS(idT, nombreT, TotalDescuentos) que contiene el identificador y nombre de cada tour, además del total de descuentos aplicados en todas las ventas de cada tour. Luego utilizando las vistas, muestre el nombre de los tours y valor total recibido, considerando el dinero recibido menos los descuentos.";
/**
* The Q3 statement
*/
public const string Q3_STATEMENT = "Genere la vista TOTAL_COORDINADORES(idT, nombreT, TotalCoordinadores) que almacena el identificador y nombre de los tour que poseen guı́as coordinadores con más de tres especialidades y que han participado en tours que visitan lugares con nivel de esfuerzo medio. Luego, utilizando la vista, muestre los tours que poseen la mayor cantidad de coordinadores con las caracterı́sticas mencionadas.";
/**
* The Q4 statement
*/
public const string Q4_STATEMENT = "Genere la vista TOTAL_TURISTAS(idT, nombreT, TotalTuristas) que contiene el identificador y nombre de los tours, y la cantidad de turistas que no tienen enfermedades cardı́acas ni respiratorias y que han visitado lugares cuyo nivel de exigencia es experto durante el mes de octubre del presente año. Luego, utilizando la vista, muestre los tours que poseen la mayor cantidad de turistas que han visitado lugares con exigencia experto y que cumplan el requisito de no tener las enfermedades mencionadas.";
/**
* The Q5 statement
*/
public const string Q5_STATEMENT = "Genere la vista TOTAL_ARRIENDOS(TotalArriendo) que almacena el total de arriendos de vehı́culos (no precio) realizados por SERNATUR durante los meses de Enero y Febrero del presente año y la vista TOTAL_VEHICULOS(TotalVeh) que contiene el total de vehı́culos que posee SERNATUR. Luego, utilizando las vistas muestre el porcentaje de arriendo de vehı́culos realizados por SERNATUR (número de vehı́culos arrendados/número total de vehı́culos).";
/**
* The Q1 SQL
*/ */
public const string Q1_SQL = "CREATE VIEW REGIONES_SINDESCUENTO(nombreRegion, cantidad) public const string Q1_SQL = "CREATE VIEW REGIONES_SINDESCUENTO(nombreRegion, cantidad)
AS ( AS (
@ -40,5 +52,21 @@ AS (
GROUP BY (R.nombre_region) GROUP BY (R.nombre_region)
); );
SELECT nombreRegion, cantidad FROM REGIONES_SINDESCUENTO WHERE (cantidad = (SELECT MAX(cantidad) FROM REGIONES_SINDESCUENTO));"; SELECT nombreRegion, cantidad FROM REGIONES_SINDESCUENTO WHERE (cantidad = (SELECT MAX(cantidad) FROM REGIONES_SINDESCUENTO));";
/**
* The Q2 SQL
*/
public const string Q2_SQL = "";
/**
* The Q3 SQL
*/
public const string Q3_SQL = "";
/**
* The Q4 SQL
*/
public const string Q4_SQL = "";
/**
* The Q5 SQL
*/
public const string Q5_SQL = "";
} }
} }

View File

@ -27,15 +27,29 @@ namespace Sernatur {
*/ */
private Connection conn; private Connection conn;
/** /**
* The columns of the tree view * The queries that can be called
*/ */
private enum Column { public enum Query {
Q1,
Q2,
Q3,
Q4,
Q5
}
/** /**
* The tour name * The query to use in the object
*/
private Query query;
/**
* The columns of the Q1 tree view
*/
private enum Q1Column {
/**
* The region name
*/ */
REGION_NAME, REGION_NAME,
/** /**
* The individual cost * The quantity
*/ */
QUANTITY, QUANTITY,
/** /**
@ -43,6 +57,70 @@ namespace Sernatur {
*/ */
N_COLUMNS N_COLUMNS
} }
/**
* The columns of the Q2 tree view
*/
private enum Q2Column {
/**
* The tour name
*/
TOUR_NAME,
/**
* The total value
*/
TOTAL_VALUE,
/**
* The number of colums in this enum
*/
N_COLUMNS
}
/**
* The columns of the Q3 tree view
*/
private enum Q3Column {
/**
* The tour name
*/
TOUR_NAME,
/**
* The total of coordinators
*/
COORDINATOR_TOTAL,
/**
* The number of colums in this enum
*/
N_COLUMNS
}
/**
* The columns of the Q4 tree view
*/
private enum Q4Column {
/**
* The tour name
*/
TOUR_NAME,
/**
* The total of turists
*/
TOURIST_TOTAL,
/**
* The number of colums in this enum
*/
N_COLUMNS
}
/**
* The columns of the Q5 tree view
*/
private enum Q5Column {
/**
* The percentage
*/
PERCENTAGE,
/**
* The number of colums in this enum
*/
N_COLUMNS
}
/** /**
* The list that stores the contents in the tree view * The list that stores the contents in the tree view
*/ */
@ -52,14 +130,29 @@ namespace Sernatur {
*/ */
[GtkChild] [GtkChild]
private Gtk.ScrolledWindow scroll_window; private Gtk.ScrolledWindow scroll_window;
/**
* The statement label
*/
[GtkChild] [GtkChild]
private Gtk.Label statement; private Gtk.Label statement;
/**
* The sql label
*/
[GtkChild] [GtkChild]
private Gtk.Label sql; private Gtk.Label sql;
/**
* The run button
*/
[GtkChild] [GtkChild]
private Gtk.Button run_query; private Gtk.Button run_query;
/**
* The close button
*/
[GtkChild] [GtkChild]
private Gtk.Button close_query; private Gtk.Button close_query;
/**
* The query tree
*/
private Gtk.TreeView query_tree; private Gtk.TreeView query_tree;
/** /**
@ -70,16 +163,18 @@ namespace Sernatur {
public void on_clicked_button (Gtk.Button button) { public void on_clicked_button (Gtk.Button button) {
if (button == run_query) { if (button == run_query) {
list_store.clear (); list_store.clear ();
if (query == Query.Q1) {
var region_list = RegionesSinDescuento.get_regions (conn.db); var region_list = RegionesSinDescuento.get_regions (conn.db);
region_list.foreach ((entry) => { region_list.foreach ((entry) => {
Gtk.TreeIter iter; Gtk.TreeIter iter;
list_store.append (out iter); list_store.append (out iter);
list_store.set (iter, list_store.set (iter,
Column.REGION_NAME, entry.nombre_region, Q1Column.REGION_NAME, entry.nombre_region,
Column.QUANTITY, entry.cantidad); Q1Column.QUANTITY, entry.cantidad);
}); });
} }
}
else if (button == close_query) { else if (button == close_query) {
this.close (); this.close ();
} }
@ -89,17 +184,33 @@ namespace Sernatur {
* Initialize the tour list class * Initialize the tour list class
* @param application The application used to make the GLib object * @param application The application used to make the GLib object
* @param conn The database connection to use * @param conn The database connection to use
* @param query The query to show
*/ */
public QueryWindow (Gtk.Application application, Connection conn) { public QueryWindow (Gtk.Application application, Connection conn, Query query) {
GLib.Object (application: application); GLib.Object (application: application);
this.conn = conn; this.conn = conn;
this.query = query;
// Load scroll window's content // Load scroll window's content
var builder = new Gtk.Builder (); var builder = new Gtk.Builder ();
try { try {
builder.add_from_resource ("/cl/cromer/ubb/sernatur/query.1.ui"); builder.add_from_resource ("/cl/cromer/ubb/sernatur/query.tree.ui");
builder.connect_signals (null); builder.connect_signals (null);
query_tree = builder.get_object ("query_tree") as Gtk.TreeView; if (query == Query.Q1) {
query_tree = builder.get_object ("query_tree_q1") as Gtk.TreeView;
}
else if (query == Query.Q2) {
query_tree = builder.get_object ("query_tree_q2") as Gtk.TreeView;
}
else if (query == Query.Q3) {
query_tree = builder.get_object ("query_tree_q3") as Gtk.TreeView;
}
else if (query == Query.Q4) {
query_tree = builder.get_object ("query_tree_q4") as Gtk.TreeView;
}
else if (query == Query.Q5) {
query_tree = builder.get_object ("query_tree_q5") as Gtk.TreeView;
}
query_tree.set_visible (true); query_tree.set_visible (true);
// Add logo to scroll window // Add logo to scroll window
@ -117,9 +228,10 @@ namespace Sernatur {
* Initialize what is needed for this window * Initialize what is needed for this window
*/ */
public void initialize () { public void initialize () {
this.set_title ("Test"); if (query == Query.Q1) {
this.set_title (dgettext (null, "(Q1) Regions with discounts"));
list_store = new Gtk.ListStore (Column.N_COLUMNS, list_store = new Gtk.ListStore (Q1Column.N_COLUMNS,
typeof (string), typeof (string),
typeof (uint)); typeof (uint));
@ -129,5 +241,57 @@ namespace Sernatur {
sql.set_text (Q1_SQL); sql.set_text (Q1_SQL);
} }
else if (query == Query.Q2) {
this.set_title (dgettext (null, "(Q2) Tour values"));
list_store = new Gtk.ListStore (Q2Column.N_COLUMNS,
typeof (string),
typeof (uint));
query_tree.set_model (list_store);
statement.set_text (Q2_STATEMENT);
sql.set_text (Q2_SQL);
}
else if (query == Query.Q3) {
this.set_title (dgettext (null, "(Q3) Coordinator total"));
list_store = new Gtk.ListStore (Q3Column.N_COLUMNS,
typeof (string),
typeof (uint));
query_tree.set_model (list_store);
statement.set_text (Q3_STATEMENT);
sql.set_text (Q3_SQL);
}
else if (query == Query.Q4) {
this.set_title (dgettext (null, "(Q4) Tourist total"));
list_store = new Gtk.ListStore (Q4Column.N_COLUMNS,
typeof (string),
typeof (uint));
query_tree.set_model (list_store);
statement.set_text (Q4_STATEMENT);
sql.set_text (Q4_SQL);
}
else if (query == Query.Q5) {
this.set_title (dgettext (null, "(Q5) Vehicle total"));
list_store = new Gtk.ListStore (Q5Column.N_COLUMNS,
typeof (float));
query_tree.set_model (list_store);
statement.set_text (Q5_STATEMENT);
sql.set_text (Q5_SQL);
}
}
} }
} }