finish city and region text entry

This commit is contained in:
Chris Cromer 2019-01-19 17:42:43 -03:00
parent 5bd896b153
commit 9ff7178ed5
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
12 changed files with 460 additions and 252 deletions

View File

@ -50,24 +50,10 @@ namespace LibSernatur {
* Get all tuples and fields from database * Get all tuples and fields from database
* @param conn The database connection to use * @param conn The database connection to use
* @return Returns a list of Asociado * @return Returns a list of Asociado
* @throws PostgresError Thrown if there is a problem with escaping strings
*/ */
public static List<Asociado> get_all_asociados (Connection conn) { public static List<Asociado> get_all_asociados (Connection conn) throws PostgresError {
var res = conn.db.exec (" var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_ASSOCIATED, null));
SELECT A.fecha_llegada, A.hora_llegada, A.fecha_salida, A.hora_salida,
T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
C.id_ciudad, C.nombre_ciudad,
R.id_region, R.nombre_region,
L.id_lugar, L.nombre_lugar, L.valor_entrada, L.nivel,
C2.id_ciudad AS id_ciudad_lugar, C2.nombre_ciudad AS nombre_ciudad_lugar,
R2.id_region AS id_region_lugar, R2.nombre_region AS nombre_region_lugar
FROM asociado A
JOIN tour T ON (A.id_tour = T.id_tour)
JOIN ciudad C ON (T.id_ciudad = C.id_ciudad)
JOIN region R ON (C.id_region = R.id_region)
JOIN lugar L ON (A.id_lugar = L.id_lugar)
JOIN ciudad C2 ON (L.id_ciudad = C2.id_ciudad)
JOIN region R2 ON (C2.id_region = R2.id_region)
");
if (res.get_status () != ExecStatus.TUPLES_OK) { if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG #if DEBUG
error (conn.db.get_error_message ()); error (conn.db.get_error_message ());
@ -132,7 +118,7 @@ JOIN region R2 ON (C2.id_region = R2.id_region)
*/ */
public static List<Asociado> get_all_asociados_by_tour (Connection conn, Tour tour) throws PostgresError, DBError { public static List<Asociado> get_all_asociados_by_tour (Connection conn, Tour tour) throws PostgresError, DBError {
if (tour.id_tour == 0) { if (tour.id_tour == 0) {
throw new DBError.INVALID_VALUE (dgettext (null, "The id of the tour is invalid!")); throw new DBError.INVALID_VALUE (_ ("The id of the tour is invalid!"));
} }
var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_ASSOCIATED_BY_TOUR, tour)); var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_ASSOCIATED_BY_TOUR, tour));
if (res.get_status () != ExecStatus.TUPLES_OK) { if (res.get_status () != ExecStatus.TUPLES_OK) {

View File

@ -50,14 +50,10 @@ namespace LibSernatur {
* Get all tuples and fields from database * Get all tuples and fields from database
* @param conn The database connection to use * @param conn The database connection to use
* @return Returns a list of Ciudad * @return Returns a list of Ciudad
* @throws PostgresError If there is a problem with with escaping strings
*/ */
public static List<Ciudad> get_all_ciudades (Connection conn) { public static List<Ciudad> get_all_ciudades (Connection conn) throws PostgresError {
var res = conn.db.exec (" var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_CITIES, null));
SELECT C.id_ciudad, C.nombre_ciudad,
R.id_region, R.nombre_region
FROM ciudad C
JOIN region R ON (C.id_region = R.id_region)
");
if (res.get_status () != ExecStatus.TUPLES_OK) { if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG #if DEBUG
error (conn.db.get_error_message ()); error (conn.db.get_error_message ());
@ -96,15 +92,10 @@ JOIN region R ON (C.id_region = R.id_region)
* @param conn The database connection to use * @param conn The database connection to use
* @param region_id The id of the region to filter that results * @param region_id The id of the region to filter that results
* @return Returns a list of Ciudad * @return Returns a list of Ciudad
* @throws PostgresError If there is a problem with with escaping strings
*/ */
public static List<Ciudad> get_all_ciudades_in_region(Connection conn, uint region_id) { public static List<Ciudad> get_all_ciudades_in_region(Connection conn, uint region_id) throws PostgresError {
var res = conn.db.exec (" var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_CITIES_BY_REGION, region_id));
SELECT C.id_ciudad, C.nombre_ciudad,
R.id_region, R.nombre_region
FROM ciudad C
JOIN region R ON (C.id_region = R.id_region)
WHERE (R.id_region = " + region_id.to_string () + ")
");
if (res.get_status () != ExecStatus.TUPLES_OK) { if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG #if DEBUG
error (conn.db.get_error_message ()); error (conn.db.get_error_message ());
@ -137,6 +128,42 @@ WHERE (R.id_region = " + region_id.to_string () + ")
} }
return list; return list;
} }
/**
* Insert a city in the database
* @param conn The database connection
* @param ciudad The city to insert
* @return Returns the id of the tuple inserted
* @throws PostgresError Thrown if there is a problem with escaping strings
* @throws DBError Thrown if an invalid value is passed
*/
public static uint insert_city (Connection conn, Ciudad ciudad) throws PostgresError, DBError {
if (ciudad.id_ciudad != 0) {
throw new DBError.INVALID_VALUE (_ ("The id of the city is invalid!"));
}
var res = conn.db.exec (Query.get_query (conn, Query.Type.INSERT_CITY, ciudad));
// This uses TUPLES_OK because it returns a result which is the id of the inserted city
if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG
error (conn.db.get_error_message ());
#else
warning (conn.db.get_error_message ());
#endif
}
var wra = new ResultWrapper (res);
try {
return wra.get_int_n (0, "id_ciudad");
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
return 0;
#endif
}
}
} }
} }
} }

View File

@ -44,11 +44,10 @@ namespace LibSernatur {
* Get all tuples and fields from database * Get all tuples and fields from database
* @param conn The database connection to use * @param conn The database connection to use
* @return Returns a list of Region * @return Returns a list of Region
* @throws PostgresError If there is a problem with with escaping strings
*/ */
public static List<Region> get_all_regiones (Connection conn) { public static List<Region> get_all_regiones (Connection conn) throws PostgresError {
var res = conn.db.exec (" var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_REGIONS, null));
SELECT id_region, nombre_region FROM region
");
if (res.get_status () != ExecStatus.TUPLES_OK) { if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG #if DEBUG
error (conn.db.get_error_message ()); error (conn.db.get_error_message ());
@ -78,6 +77,42 @@ SELECT id_region, nombre_region FROM region
} }
return list; return list;
} }
/**
* Insert a region in the database
* @param conn The database connection
* @param region The region to insert
* @return Returns the id of the tuple inserted
* @throws PostgresError Thrown if there is a problem with escaping strings
* @throws DBError Thrown if an invalid value is passed
*/
public static uint insert_region (Connection conn, Region region) throws PostgresError, DBError {
if (region.id_region != 0) {
throw new DBError.INVALID_VALUE (_ ("The id of the region is invalid!"));
}
var res = conn.db.exec (Query.get_query (conn, Query.Type.INSERT_REGION, region));
// This uses TUPLES_OK because it returns a result which is the id of the inserted region
if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG
error (conn.db.get_error_message ());
#else
warning (conn.db.get_error_message ());
#endif
}
var wra = new ResultWrapper (res);
try {
return wra.get_int_n (0, "id_region");
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
return 0;
#endif
}
}
} }
} }
} }

View File

@ -120,7 +120,7 @@ namespace LibSernatur {
*/ */
public static void update_tour (Connection conn, Tour tour) throws PostgresError, DBError { public static void update_tour (Connection conn, Tour tour) throws PostgresError, DBError {
if (tour.id_tour == 0) { if (tour.id_tour == 0) {
throw new DBError.INVALID_VALUE (dgettext (null, "The id of the tour is invalid!")); throw new DBError.INVALID_VALUE (_ ("The id of the tour is invalid!"));
} }
var res = conn.db.exec (Query.get_query (conn, Query.Type.UPDATE_TOUR, tour)); var res = conn.db.exec (Query.get_query (conn, Query.Type.UPDATE_TOUR, tour));
if (res.get_status () != ExecStatus.COMMAND_OK) { if (res.get_status () != ExecStatus.COMMAND_OK) {
@ -142,10 +142,10 @@ namespace LibSernatur {
*/ */
public static uint insert_tour (Connection conn, Tour tour) throws PostgresError, DBError { public static uint insert_tour (Connection conn, Tour tour) throws PostgresError, DBError {
if (tour.id_tour != 0) { if (tour.id_tour != 0) {
throw new DBError.INVALID_VALUE (dgettext (null, "The id of the tour is invalid!")); throw new DBError.INVALID_VALUE (_ ("The id of the tour is invalid!"));
} }
var res = conn.db.exec (Query.get_query (conn, Query.Type.INSERT_TOUR, tour)); var res = conn.db.exec (Query.get_query (conn, Query.Type.INSERT_TOUR, tour));
// This uses TUPLES_OK because it returns a result which is hte id of the inserted tour // This uses TUPLES_OK because it returns a result which is the id of the inserted tour
if (res.get_status () != ExecStatus.TUPLES_OK) { if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG #if DEBUG
error (conn.db.get_error_message ()); error (conn.db.get_error_message ());
@ -177,7 +177,7 @@ namespace LibSernatur {
*/ */
public static void delete_tour (Connection conn, Tour tour) throws PostgresError, DBError { public static void delete_tour (Connection conn, Tour tour) throws PostgresError, DBError {
if (tour.id_tour == 0) { if (tour.id_tour == 0) {
throw new DBError.INVALID_VALUE (dgettext (null, "The id of the tour is invalid!")); throw new DBError.INVALID_VALUE (_ ("The id of the tour is invalid!"));
} }
var res = conn.db.exec (Query.get_query (conn, Query.Type.DELETE_TOUR, tour)); var res = conn.db.exec (Query.get_query (conn, Query.Type.DELETE_TOUR, tour));
if (res.get_status () != ExecStatus.COMMAND_OK) { if (res.get_status () != ExecStatus.COMMAND_OK) {

View File

@ -19,15 +19,64 @@ namespace LibSernatur {
*/ */
public class Query < T > : Object { public class Query < T > : Object {
public enum Type { public enum Type {
SELECT_ALL_CITIES,
SELECT_ALL_CITIES_BY_REGION,
INSERT_CITY,
SELECT_ALL_REGIONS,
INSERT_REGION,
SELECT_ALL_TOURS, SELECT_ALL_TOURS,
INSERT_TOUR, INSERT_TOUR,
UPDATE_TOUR, UPDATE_TOUR,
DELETE_TOUR, DELETE_TOUR,
SELECT_ALL_ASSOCIATED,
SELECT_ALL_ASSOCIATED_BY_TOUR SELECT_ALL_ASSOCIATED_BY_TOUR
} }
public static string get_query (Connection conn, Type type, T? t) throws PostgresError { public static string get_query (Connection conn, Type type, T? t) throws PostgresError {
switch (type) { switch (type) {
case SELECT_ALL_CITIES:
return "
SELECT C.id_ciudad, C.nombre_ciudad,
R.id_region, R.nombre_region
FROM ciudad C
JOIN region R ON (C.id_region = R.id_region)";
case SELECT_ALL_CITIES_BY_REGION:
uint region_id = (uint) t;
return "
SELECT C.id_ciudad, C.nombre_ciudad,
R.id_region, R.nombre_region
FROM ciudad C
JOIN region R ON (C.id_region = R.id_region)
WHERE (R.id_region = " + region_id.to_string () + ")";
case INSERT_CITY:
Ciudad ciudad = (Ciudad) t;
return "
INSERT INTO ciudad
(nombre_ciudad, id_region)
VALUES
(
'" + conn.escape (ciudad.nombre_ciudad) + "',
" + ciudad.region.id_region.to_string () + "
)
RETURNING id_ciudad";
case SELECT_ALL_REGIONS:
return "
SELECT id_region, nombre_region FROM region";
case INSERT_REGION:
Region region = (Region) t;
return "
INSERT INTO region
(nombre_region)
VALUES
(
'" + conn.escape (region.nombre_region) + "'
)
RETURNING id_region";
case SELECT_ALL_TOURS: case SELECT_ALL_TOURS:
return " return "
SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas, SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
@ -36,6 +85,7 @@ R.id_region, R.nombre_region
FROM tour T FROM tour T
JOIN ciudad C ON (T.id_ciudad = C.id_ciudad) JOIN ciudad C ON (T.id_ciudad = C.id_ciudad)
JOIN region R ON (C.id_region = R.id_region)"; JOIN region R ON (C.id_region = R.id_region)";
case UPDATE_TOUR: case UPDATE_TOUR:
Tour tour = (Tour) t; Tour tour = (Tour) t;
return " return "
@ -46,6 +96,7 @@ UPDATE tour SET
minima_personas = " + tour.minima_personas.to_string () + ", minima_personas = " + tour.minima_personas.to_string () + ",
id_ciudad = " + tour.ciudad.id_ciudad.to_string () + " id_ciudad = " + tour.ciudad.id_ciudad.to_string () + "
WHERE id_tour = " + tour.id_tour.to_string (); WHERE id_tour = " + tour.id_tour.to_string ();
case INSERT_TOUR: case INSERT_TOUR:
Tour tour = (Tour) t; Tour tour = (Tour) t;
return " return "
@ -60,11 +111,30 @@ VALUES
" + tour.ciudad.id_ciudad.to_string () + " " + tour.ciudad.id_ciudad.to_string () + "
) )
RETURNING id_tour"; RETURNING id_tour";
case DELETE_TOUR: case DELETE_TOUR:
Tour tour = (Tour) t; Tour tour = (Tour) t;
return " return "
DELETE FROM tour DELETE FROM tour
WHERE id_tour = " + tour.id_tour.to_string (); WHERE id_tour = " + tour.id_tour.to_string ();
case SELECT_ALL_ASSOCIATED:
return "
SELECT A.fecha_llegada, A.hora_llegada, A.fecha_salida, A.hora_salida,
T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
C.id_ciudad, C.nombre_ciudad,
R.id_region, R.nombre_region,
L.id_lugar, L.nombre_lugar, L.valor_entrada, L.nivel,
C2.id_ciudad AS id_ciudad_lugar, C2.nombre_ciudad AS nombre_ciudad_lugar,
R2.id_region AS id_region_lugar, R2.nombre_region AS nombre_region_lugar
FROM asociado A
JOIN tour T ON (A.id_tour = T.id_tour)
JOIN ciudad C ON (T.id_ciudad = C.id_ciudad)
JOIN region R ON (C.id_region = R.id_region)
JOIN lugar L ON (A.id_lugar = L.id_lugar)
JOIN ciudad C2 ON (L.id_ciudad = C2.id_ciudad)
JOIN region R2 ON (C2.id_region = R2.id_region)";
case SELECT_ALL_ASSOCIATED_BY_TOUR: case SELECT_ALL_ASSOCIATED_BY_TOUR:
Tour tour = (Tour) t; Tour tour = (Tour) t;
return " return "
@ -83,6 +153,7 @@ JOIN lugar L ON (A.id_lugar = L.id_lugar)
JOIN ciudad C2 ON (L.id_ciudad = C2.id_ciudad) JOIN ciudad C2 ON (L.id_ciudad = C2.id_ciudad)
JOIN region R2 ON (C2.id_region = R2.id_region) JOIN region R2 ON (C2.id_region = R2.id_region)
WHERE t.id_tour = " + tour.id_tour.to_string (); WHERE t.id_tour = " + tour.id_tour.to_string ();
default: default:
return ""; return "";
} }

View File

@ -1,6 +1,10 @@
lib/db.vala lib/db.vala
lib/dbwrapper.vala lib/dbwrapper.vala
lib/misc.vala lib/misc.vala
lib/db/asociado.vala
lib/db/ciudad.vala
lib/db/region.vala
lib/db/tour.vala
src/sernatur.vala src/sernatur.vala
src/main_window.vala src/main_window.vala
src/tour_list.vala src/tour_list.vala

144
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-18 17:59-0300\n" "POT-Creation-Date: 2019-01-19 17:42-0300\n"
"PO-Revision-Date: 2019-01-18 18:02-0300\n" "PO-Revision-Date: 2019-01-19 17:41-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,7 +20,7 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n" "X-Poedit-Basepath: .\n"
#: lib/db.vala:74 #: lib/db.vala:78
msgid "Postgresql server version:" msgid "Postgresql server version:"
msgstr "Versión del servidor Postgresql:" msgstr "Versión del servidor Postgresql:"
@ -44,20 +44,32 @@ msgstr "El RUT %s es demasiado grande!"
msgid "The verifier %C is invalid!" msgid "The verifier %C is invalid!"
msgstr "El verificador %C es invalido!" msgstr "El verificador %C es invalido!"
#: src/sernatur.vala:88 #: lib/db/asociado.vala:121 lib/db/tour.vala:123 lib/db/tour.vala:145
#: lib/db/tour.vala:180
msgid "The id of the tour is invalid!"
msgstr "El id del tour es invalido!"
#: lib/db/ciudad.vala:142
msgid "The id of the city is invalid!"
msgstr "El id de la ciudad es invalida!"
#: lib/db/region.vala:91
msgid "The id of the region is invalid!"
msgstr "El id de la región es invalida!"
#: src/sernatur.vala:87
#, c-format #, c-format
msgid "Error: %s\n" msgid "Error: %s\n"
msgstr "Error: %s\n" msgstr "Error: %s\n"
#: src/sernatur.vala:89 #: src/sernatur.vala:88
#, c-format #, c-format
msgid "" msgid "Run '%s --help' to see a full list of available command line options.\n"
"Run '%s --help' to see a full list of available command line options.\n"
msgstr "" msgstr ""
"Correr '%s --help' para ver una lista completa de las opciones de la " "Correr '%s --help' para ver una lista completa de las opciones de la "
"consola.\n" "consola.\n"
#: src/sernatur.vala:94 #: src/sernatur.vala:93
msgid "SERNATUR version: " msgid "SERNATUR version: "
msgstr "Versión de SERNATUR: " msgstr "Versión de SERNATUR: "
@ -65,80 +77,80 @@ msgstr "Versión de SERNATUR: "
msgid "Error: Could not connect to the database!" msgid "Error: Could not connect to the database!"
msgstr "Error: No se puede conectar al base de datos!" msgstr "Error: No se puede conectar al base de datos!"
#: src/main_window.vala:228 src/tour_list.vala:215 src/tour_list.vala:231 #: src/main_window.vala:228 src/tour_list.vala:233 src/tour_list.vala:256
msgid "Error" msgid "Error"
msgstr "Error" msgstr "Error"
#: src/tour_list.vala:185 #: src/tour_list.vala:191
msgid "Are you sure you wish to delete this tour?" msgid "Are you sure you wish to delete this tour?"
msgstr "¿Usted está seguro que quiere borrar este tour?" msgstr "¿Usted está seguro que quiere borrar este tour?"
#: src/tour_list.vala:192 #: src/tour_list.vala:198
msgid "Are you sure you wish to delete these tours?" msgid "Are you sure you wish to delete these tours?"
msgstr "¿Usted está seguro que quiere borrar estos tour?" msgstr "¿Usted está seguro que quiere borrar estos tour?"
#: src/tour_list.vala:211 #: src/tour_list.vala:229
#, c-format #, c-format
msgid "" msgid ""
"Error: Could not delete tour \"%s\" because either this tour has been taken " "Error: Could not delete tour \"%s\" because either this tour has been taken "
"or is still associated with a place or vehicle!" "or is still associated with a place or vehicle!"
msgstr "" msgstr ""
"Error: No se puede borrar el tour \"%s\" porque este tour ya fue realizado " "Error: No se puede borrar el tour \"%s\" porque este tour ya fue realizado o "
"o todavía esta asociado con lugares ó vehículos!" "todavía esta asociado con lugares ó vehículos!"
#: src/query_window.vala:290 data/ui/main.window.ui:136 #: src/query_window.vala:290 data/ui/main.window.ui:135
msgid "(Q1) Regions with discounts" msgid "(Q1) Regions with discounts"
msgstr "(Q1) Regiones sin descuentos" msgstr "(Q1) Regiones sin descuentos"
#: src/query_window.vala:303 data/ui/main.window.ui:144 #: src/query_window.vala:303 data/ui/main.window.ui:143
msgid "(Q2) Tour values" msgid "(Q2) Tour values"
msgstr "(Q2) Valores tour" msgstr "(Q2) Valores tour"
#: src/query_window.vala:316 data/ui/main.window.ui:152 #: src/query_window.vala:316 data/ui/main.window.ui:151
msgid "(Q3) Coordinator total" msgid "(Q3) Coordinator total"
msgstr "(Q3) Total de coordinadores" msgstr "(Q3) Total de coordinadores"
#: src/query_window.vala:329 data/ui/main.window.ui:160 #: src/query_window.vala:329 data/ui/main.window.ui:159
msgid "(Q4) Tourist total" msgid "(Q4) Tourist total"
msgstr "(Q4) Total de turistas" msgstr "(Q4) Total de turistas"
#: src/query_window.vala:342 data/ui/main.window.ui:168 #: src/query_window.vala:342 data/ui/main.window.ui:167
msgid "(Q5) Vehicle total" msgid "(Q5) Vehicle total"
msgstr "(Q5) Total de vehículos" msgstr "(Q5) Total de vehículos"
#: data/ui/main.window.ui:44 #: data/ui/main.window.ui:43
msgid "_Menu" msgid "_Menu"
msgstr "_Menú" msgstr "_Menú"
#: data/ui/main.window.ui:54 data/ui/tour.list.ui:23 #: data/ui/main.window.ui:53 data/ui/tour.list.ui:23
msgid "Tours" msgid "Tours"
msgstr "Tours" msgstr "Tours"
#: data/ui/main.window.ui:62 #: data/ui/main.window.ui:61
msgid "Staff" msgid "Staff"
msgstr "Empleados" msgstr "Empleados"
#: data/ui/main.window.ui:70 #: data/ui/main.window.ui:69
msgid "Tourists" msgid "Tourists"
msgstr "Turistas" msgstr "Turistas"
#: data/ui/main.window.ui:80 #: data/ui/main.window.ui:79
msgid "Illnesses" msgid "Illnesses"
msgstr "Enfermedades" msgstr "Enfermedades"
#: data/ui/main.window.ui:88 #: data/ui/main.window.ui:87
msgid "Participate" msgid "Participate"
msgstr "Participar" msgstr "Participar"
#: data/ui/main.window.ui:100 #: data/ui/main.window.ui:99
msgid "Vehicles" msgid "Vehicles"
msgstr "Vehículos" msgstr "Vehículos"
#: data/ui/main.window.ui:114 #: data/ui/main.window.ui:113
msgid "Quit" msgid "Quit"
msgstr "Salir" msgstr "Salir"
#: data/ui/main.window.ui:126 #: data/ui/main.window.ui:125
msgid "_Views" msgid "_Views"
msgstr "_Vistas" msgstr "_Vistas"
@ -146,61 +158,61 @@ msgstr "_Vistas"
msgid "Christopher Cromer" msgid "Christopher Cromer"
msgstr "Christopher Cromer" msgstr "Christopher Cromer"
#: data/ui/tour.list.ui:69 data/ui/tour.editor.ui:54 data/ui/query.tree.ui:80 #: data/ui/tour.list.ui:68 data/ui/tour.editor.ui:53 data/ui/query.tree.ui:80
#: data/ui/query.tree.ui:120 data/ui/query.tree.ui:160 #: data/ui/query.tree.ui:120 data/ui/query.tree.ui:160
msgid "Tour Name" msgid "Tour Name"
msgstr "Nombre del Tour" msgstr "Nombre del Tour"
#: data/ui/tour.list.ui:83 data/ui/tour.editor.ui:87 #: data/ui/tour.list.ui:82 data/ui/tour.editor.ui:86
msgid "Individual Cost" msgid "Individual Cost"
msgstr "Costo Individual" msgstr "Costo Individual"
#: data/ui/tour.list.ui:97 data/ui/tour.editor.ui:103 #: data/ui/tour.list.ui:96 data/ui/tour.editor.ui:102
msgid "Group Cost" msgid "Group Cost"
msgstr "Costo Grupal" msgstr "Costo Grupal"
#: data/ui/tour.list.ui:111 data/ui/tour.editor.ui:119 #: data/ui/tour.list.ui:110 data/ui/tour.editor.ui:118
msgid "Minimum People" msgid "Minimum People"
msgstr "Mínima Personas" msgstr "Mínima Personas"
#: data/ui/tour.list.ui:125 data/ui/tour.editor.ui:187 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:186
msgid "City" msgid "City"
msgstr "Ciudad" msgstr "Ciudad"
#: data/ui/tour.list.ui:139 data/ui/tour.editor.ui:135 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:134
msgid "Region" msgid "Region"
msgstr "Región" msgstr "Región"
#: data/ui/tour.list.ui:171 data/ui/tour.places.ui:185 #: data/ui/tour.list.ui:170 data/ui/tour.places.ui:184
msgid "Edit" msgid "Edit"
msgstr "Editar" msgstr "Editar"
#: data/ui/tour.list.ui:176 #: data/ui/tour.list.ui:175
msgid "Edit selected tour." msgid "Edit selected tour."
msgstr "Editar el tour seleccionado." msgstr "Editar el tour seleccionado."
#: data/ui/tour.list.ui:186 data/ui/tour.places.ui:243 #: data/ui/tour.list.ui:185 data/ui/tour.places.ui:242
msgid "New" msgid "New"
msgstr "Nuevo" msgstr "Nuevo"
#: data/ui/tour.list.ui:190 #: data/ui/tour.list.ui:189
msgid "Create a new tour." msgid "Create a new tour."
msgstr "Crear un tour nuevo." msgstr "Crear un tour nuevo."
#: data/ui/tour.list.ui:200 data/ui/tour.places.ui:214 #: data/ui/tour.list.ui:199 data/ui/tour.places.ui:213
msgid "Delete" msgid "Delete"
msgstr "Borrar" msgstr "Borrar"
#: data/ui/tour.list.ui:205 #: data/ui/tour.list.ui:204
msgid "Delete selected tour." msgid "Delete selected tour."
msgstr "Borrar el tour seleccionado." msgstr "Borrar el tour seleccionado."
#: data/ui/tour.list.ui:215 data/ui/tour.places.ui:229 #: data/ui/tour.list.ui:214 data/ui/tour.places.ui:228
#: data/ui/query.window.ui:67 #: data/ui/query.window.ui:66
msgid "Close" msgid "Close"
msgstr "Cerrar" msgstr "Cerrar"
#: data/ui/tour.list.ui:219 data/ui/tour.places.ui:233 #: data/ui/tour.list.ui:218 data/ui/tour.places.ui:232
msgid "Close this window." msgid "Close this window."
msgstr "Cerrar esta ventana." msgstr "Cerrar esta ventana."
@ -208,95 +220,95 @@ msgstr "Cerrar esta ventana."
msgid "Tour Editor" msgid "Tour Editor"
msgstr "Editor de Tour" msgstr "Editor de Tour"
#: data/ui/tour.editor.ui:234 #: data/ui/tour.editor.ui:233
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í."
#: data/ui/tour.editor.ui:262 #: data/ui/tour.editor.ui:261
msgid "Create a new city by typing here." msgid "Create a new city by typing here."
msgstr "Crear una nueva ciudad con escribir aquí." msgstr "Crear una nueva ciudad con escribir aquí."
#: data/ui/tour.editor.ui:287 #: data/ui/tour.editor.ui:286
msgid "Cancel" msgid "Cancel"
msgstr "Cancelar" msgstr "Cancelar"
#: data/ui/tour.editor.ui:291 #: data/ui/tour.editor.ui:290
msgid "Cancel the modification of this tour." msgid "Cancel the modification of this tour."
msgstr "Cancelar la modificación de este tour." msgstr "Cancelar la modificación de este tour."
#: data/ui/tour.editor.ui:306 data/ui/tour.places.ui:23 #: data/ui/tour.editor.ui:305 data/ui/tour.places.ui:23
msgid "Places" msgid "Places"
msgstr "Lugares" msgstr "Lugares"
#: data/ui/tour.editor.ui:310 #: data/ui/tour.editor.ui:309
msgid "Add or edit places." msgid "Add or edit places."
msgstr "Agregar o editar places." msgstr "Agregar o editar places."
#: data/ui/tour.editor.ui:325 #: data/ui/tour.editor.ui:324
msgid "Save" msgid "Save"
msgstr "Guardar" msgstr "Guardar"
#: data/ui/tour.editor.ui:329 #: data/ui/tour.editor.ui:328
msgid "Save this tour." msgid "Save this tour."
msgstr "Guardar este tour." msgstr "Guardar este tour."
#: data/ui/tour.places.ui:69 #: data/ui/tour.places.ui:68
msgid "Place Name" msgid "Place Name"
msgstr "Nombre de Lugar" msgstr "Nombre de Lugar"
#: data/ui/tour.places.ui:83 #: data/ui/tour.places.ui:82
msgid "Ticket Price" msgid "Ticket Price"
msgstr "Valor Entrada" msgstr "Valor Entrada"
#: data/ui/tour.places.ui:97 #: data/ui/tour.places.ui:96
msgid "Difficulty" msgid "Difficulty"
msgstr "Dificultad" msgstr "Dificultad"
#: data/ui/tour.places.ui:111 #: data/ui/tour.places.ui:110
msgid "Arrival Date" msgid "Arrival Date"
msgstr "Fecha de Llegada" msgstr "Fecha de Llegada"
#: data/ui/tour.places.ui:125 #: data/ui/tour.places.ui:124
msgid "Arrival Time" msgid "Arrival Time"
msgstr "Hora de Llegada" msgstr "Hora de Llegada"
#: data/ui/tour.places.ui:139 #: data/ui/tour.places.ui:138
msgid "Departure Date" msgid "Departure Date"
msgstr "Fecha de Salida" msgstr "Fecha de Salida"
#: data/ui/tour.places.ui:153 #: data/ui/tour.places.ui:152
msgid "Departure Time" msgid "Departure Time"
msgstr "Hora de Salida" msgstr "Hora de Salida"
#: data/ui/tour.places.ui:190 #: data/ui/tour.places.ui:189
msgid "Edit associated place." msgid "Edit associated place."
msgstr "Edit lugar asociado." msgstr "Edit lugar asociado."
#: data/ui/tour.places.ui:200 #: data/ui/tour.places.ui:199
msgid "Add" msgid "Add"
msgstr "Agregar" msgstr "Agregar"
#: data/ui/tour.places.ui:204 #: data/ui/tour.places.ui:203
msgid "Associate this tour with an existing place." msgid "Associate this tour with an existing place."
msgstr "Asociar este tour con un lugar que ya existe." msgstr "Asociar este tour con un lugar que ya existe."
#: data/ui/tour.places.ui:219 #: data/ui/tour.places.ui:218
msgid "Delete associated place." msgid "Delete associated place."
msgstr "Borrar lugar asociado." msgstr "Borrar lugar asociado."
#: data/ui/tour.places.ui:247 #: data/ui/tour.places.ui:246
msgid "Create a new place to associate." msgid "Create a new place to associate."
msgstr "Crear un lugar nuevo para asociar con el tour." msgstr "Crear un lugar nuevo para asociar con el tour."
#: data/ui/query.window.ui:85 #: data/ui/query.window.ui:84
msgid "Run" msgid "Run"
msgstr "Correr" msgstr "Correr"
#: data/ui/query.window.ui:127 #: data/ui/query.window.ui:126
msgid "Statement" msgid "Statement"
msgstr "Enunciado" msgstr "Enunciado"
#: data/ui/query.window.ui:157 #: data/ui/query.window.ui:156
msgid "View and Query" msgid "View and Query"
msgstr "Vista y Consulta" msgstr "Vista y Consulta"

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-18 17:59-0300\n" "POT-Creation-Date: 2019-01-19 17:42-0300\n"
"PO-Revision-Date: 2019-01-18 18:02-0300\n" "PO-Revision-Date: 2019-01-19 17:41-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,7 +20,7 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n" "X-Poedit-Basepath: .\n"
#: lib/db.vala:74 #: lib/db.vala:78
msgid "Postgresql server version:" msgid "Postgresql server version:"
msgstr "Versión de la wea de Postgresql:" msgstr "Versión de la wea de Postgresql:"
@ -44,19 +44,32 @@ msgstr "La wea %s es demasiado grande!"
msgid "The verifier %C is invalid!" msgid "The verifier %C is invalid!"
msgstr "La wea %C es invalido!" msgstr "La wea %C es invalido!"
#: src/sernatur.vala:88 #: lib/db/asociado.vala:121 lib/db/tour.vala:123 lib/db/tour.vala:145
#: lib/db/tour.vala:180
msgid "The id of the tour is invalid!"
msgstr "El id de la wea es invalida!"
#: lib/db/ciudad.vala:142
msgid "The id of the city is invalid!"
msgstr "El id de la wea es invalida!"
#: lib/db/region.vala:91
msgid "The id of the region is invalid!"
msgstr "El id de la wea es invalida!"
#: src/sernatur.vala:87
#, c-format #, c-format
msgid "Error: %s\n" msgid "Error: %s\n"
msgstr "Puta la wea: %s\n" msgstr "Puta la wea: %s\n"
#: src/sernatur.vala:89 #: src/sernatur.vala:88
#, c-format #, c-format
msgid "Run '%s --help' to see a full list of available command line options.\n" msgid "Run '%s --help' to see a full list of available command line options.\n"
msgstr "" msgstr ""
"Correr '%s --help' para ver una lista completa de las weas que se puede usar " "Correr '%s --help' para ver una lista completa de las weas que se puede usar "
"en la consola.\n" "en la consola.\n"
#: src/sernatur.vala:94 #: src/sernatur.vala:93
msgid "SERNATUR version: " msgid "SERNATUR version: "
msgstr "Versión de SERNATUR: " msgstr "Versión de SERNATUR: "
@ -64,19 +77,19 @@ msgstr "Versión de SERNATUR: "
msgid "Error: Could not connect to the database!" msgid "Error: Could not connect to the database!"
msgstr "Puta la wea: No se puede conectar al base de datos!" msgstr "Puta la wea: No se puede conectar al base de datos!"
#: src/main_window.vala:228 src/tour_list.vala:215 src/tour_list.vala:231 #: src/main_window.vala:228 src/tour_list.vala:233 src/tour_list.vala:256
msgid "Error" msgid "Error"
msgstr "Puta la wea" msgstr "Puta la wea"
#: src/tour_list.vala:185 #: src/tour_list.vala:191
msgid "Are you sure you wish to delete this tour?" msgid "Are you sure you wish to delete this tour?"
msgstr "¿Weon, está seguro que quiere borrar esta wea?" msgstr "¿Weon, está seguro que quiere borrar esta wea?"
#: src/tour_list.vala:192 #: src/tour_list.vala:198
msgid "Are you sure you wish to delete these tours?" msgid "Are you sure you wish to delete these tours?"
msgstr "¿Weon, está seguro que quiere borrar estas weas?" msgstr "¿Weon, está seguro que quiere borrar estas weas?"
#: src/tour_list.vala:211 #: src/tour_list.vala:229
#, c-format #, c-format
msgid "" msgid ""
"Error: Could not delete tour \"%s\" because either this tour has been taken " "Error: Could not delete tour \"%s\" because either this tour has been taken "
@ -85,59 +98,59 @@ msgstr ""
"Puta la wea: No se puede borrar la wea \"%s\" porque esta wea ya fue " "Puta la wea: No se puede borrar la wea \"%s\" porque esta wea ya fue "
"realizada o la wea todavía esta asociado con lugares ó vehículos!" "realizada o la wea todavía esta asociado con lugares ó vehículos!"
#: src/query_window.vala:290 data/ui/main.window.ui:136 #: src/query_window.vala:290 data/ui/main.window.ui:135
msgid "(Q1) Regions with discounts" msgid "(Q1) Regions with discounts"
msgstr "(Q1) Regiones sin descuentos" msgstr "(Q1) Regiones sin descuentos"
#: src/query_window.vala:303 data/ui/main.window.ui:144 #: src/query_window.vala:303 data/ui/main.window.ui:143
msgid "(Q2) Tour values" msgid "(Q2) Tour values"
msgstr "(Q2) Valores tour" msgstr "(Q2) Valores tour"
#: src/query_window.vala:316 data/ui/main.window.ui:152 #: src/query_window.vala:316 data/ui/main.window.ui:151
msgid "(Q3) Coordinator total" msgid "(Q3) Coordinator total"
msgstr "(Q3) Total de coordinadores" msgstr "(Q3) Total de coordinadores"
#: src/query_window.vala:329 data/ui/main.window.ui:160 #: src/query_window.vala:329 data/ui/main.window.ui:159
msgid "(Q4) Tourist total" msgid "(Q4) Tourist total"
msgstr "(Q4) Total de turistas" msgstr "(Q4) Total de turistas"
#: src/query_window.vala:342 data/ui/main.window.ui:168 #: src/query_window.vala:342 data/ui/main.window.ui:167
msgid "(Q5) Vehicle total" msgid "(Q5) Vehicle total"
msgstr "(Q5) Total de vehículos" msgstr "(Q5) Total de vehículos"
#: data/ui/main.window.ui:44 #: data/ui/main.window.ui:43
msgid "_Menu" msgid "_Menu"
msgstr "_Menú" msgstr "_Menú"
#: data/ui/main.window.ui:54 data/ui/tour.list.ui:23 #: data/ui/main.window.ui:53 data/ui/tour.list.ui:23
msgid "Tours" msgid "Tours"
msgstr "Tours" msgstr "Tours"
#: data/ui/main.window.ui:62 #: data/ui/main.window.ui:61
msgid "Staff" msgid "Staff"
msgstr "Weones flojos" msgstr "Weones flojos"
#: data/ui/main.window.ui:70 #: data/ui/main.window.ui:69
msgid "Tourists" msgid "Tourists"
msgstr "Weones visitores" msgstr "Weones visitores"
#: data/ui/main.window.ui:80 #: data/ui/main.window.ui:79
msgid "Illnesses" msgid "Illnesses"
msgstr "Enfermedades" msgstr "Enfermedades"
#: data/ui/main.window.ui:88 #: data/ui/main.window.ui:87
msgid "Participate" msgid "Participate"
msgstr "Participar" msgstr "Participar"
#: data/ui/main.window.ui:100 #: data/ui/main.window.ui:99
msgid "Vehicles" msgid "Vehicles"
msgstr "Vehículos" msgstr "Vehículos"
#: data/ui/main.window.ui:114 #: data/ui/main.window.ui:113
msgid "Quit" msgid "Quit"
msgstr "Salir de la wea" msgstr "Salir de la wea"
#: data/ui/main.window.ui:126 #: data/ui/main.window.ui:125
msgid "_Views" msgid "_Views"
msgstr "_Vistas" msgstr "_Vistas"
@ -145,61 +158,61 @@ msgstr "_Vistas"
msgid "Christopher Cromer" msgid "Christopher Cromer"
msgstr "Christopher Cromer (El Weon Gringo)" msgstr "Christopher Cromer (El Weon Gringo)"
#: data/ui/tour.list.ui:69 data/ui/tour.editor.ui:54 data/ui/query.tree.ui:80 #: data/ui/tour.list.ui:68 data/ui/tour.editor.ui:53 data/ui/query.tree.ui:80
#: data/ui/query.tree.ui:120 data/ui/query.tree.ui:160 #: data/ui/query.tree.ui:120 data/ui/query.tree.ui:160
msgid "Tour Name" msgid "Tour Name"
msgstr "Nombre de la Wea" msgstr "Nombre de la Wea"
#: data/ui/tour.list.ui:83 data/ui/tour.editor.ui:87 #: data/ui/tour.list.ui:82 data/ui/tour.editor.ui:86
msgid "Individual Cost" msgid "Individual Cost"
msgstr "Costo Individual" msgstr "Costo Individual"
#: data/ui/tour.list.ui:97 data/ui/tour.editor.ui:103 #: data/ui/tour.list.ui:96 data/ui/tour.editor.ui:102
msgid "Group Cost" msgid "Group Cost"
msgstr "Costo Grupal" msgstr "Costo Grupal"
#: data/ui/tour.list.ui:111 data/ui/tour.editor.ui:119 #: data/ui/tour.list.ui:110 data/ui/tour.editor.ui:118
msgid "Minimum People" msgid "Minimum People"
msgstr "Mínima de Weones" msgstr "Mínima de Weones"
#: data/ui/tour.list.ui:125 data/ui/tour.editor.ui:187 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:186
msgid "City" msgid "City"
msgstr "Ciudad" msgstr "Ciudad"
#: data/ui/tour.list.ui:139 data/ui/tour.editor.ui:135 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:134
msgid "Region" msgid "Region"
msgstr "Región" msgstr "Región"
#: data/ui/tour.list.ui:171 data/ui/tour.places.ui:185 #: data/ui/tour.list.ui:170 data/ui/tour.places.ui:184
msgid "Edit" msgid "Edit"
msgstr "Editar la wea" msgstr "Editar la wea"
#: data/ui/tour.list.ui:176 #: data/ui/tour.list.ui:175
msgid "Edit selected tour." msgid "Edit selected tour."
msgstr "Editar la wea seleccionado." msgstr "Editar la wea seleccionado."
#: data/ui/tour.list.ui:186 data/ui/tour.places.ui:243 #: data/ui/tour.list.ui:185 data/ui/tour.places.ui:242
msgid "New" msgid "New"
msgstr "Nueva wea" msgstr "Nueva wea"
#: data/ui/tour.list.ui:190 #: data/ui/tour.list.ui:189
msgid "Create a new tour." msgid "Create a new tour."
msgstr "Crear una wea nueva." msgstr "Crear una wea nueva."
#: data/ui/tour.list.ui:200 data/ui/tour.places.ui:214 #: data/ui/tour.list.ui:199 data/ui/tour.places.ui:213
msgid "Delete" msgid "Delete"
msgstr "Borrar la wea" msgstr "Borrar la wea"
#: data/ui/tour.list.ui:205 #: data/ui/tour.list.ui:204
msgid "Delete selected tour." msgid "Delete selected tour."
msgstr "Borrar la wea seleccionado." msgstr "Borrar la wea seleccionado."
#: data/ui/tour.list.ui:215 data/ui/tour.places.ui:229 #: data/ui/tour.list.ui:214 data/ui/tour.places.ui:228
#: data/ui/query.window.ui:67 #: data/ui/query.window.ui:66
msgid "Close" msgid "Close"
msgstr "Cerrar la wea" msgstr "Cerrar la wea"
#: data/ui/tour.list.ui:219 data/ui/tour.places.ui:233 #: data/ui/tour.list.ui:218 data/ui/tour.places.ui:232
msgid "Close this window." msgid "Close this window."
msgstr "Cerrar la wea." msgstr "Cerrar la wea."
@ -207,95 +220,95 @@ msgstr "Cerrar la wea."
msgid "Tour Editor" msgid "Tour Editor"
msgstr "Editor de la Wea" msgstr "Editor de la Wea"
#: data/ui/tour.editor.ui:234 #: data/ui/tour.editor.ui:233
msgid "Create a new region by typing here." msgid "Create a new region by typing here."
msgstr "Crear una nueva wea con escribir aquí." msgstr "Crear una nueva wea con escribir aquí."
#: data/ui/tour.editor.ui:262 #: data/ui/tour.editor.ui:261
msgid "Create a new city by typing here." msgid "Create a new city by typing here."
msgstr "Crear una nueva wea con escribir aquí." msgstr "Crear una nueva wea con escribir aquí."
#: data/ui/tour.editor.ui:287 #: data/ui/tour.editor.ui:286
msgid "Cancel" msgid "Cancel"
msgstr "Cancelar la wea" msgstr "Cancelar la wea"
#: data/ui/tour.editor.ui:291 #: data/ui/tour.editor.ui:290
msgid "Cancel the modification of this tour." msgid "Cancel the modification of this tour."
msgstr "Cancelar la modificación de esta wea." msgstr "Cancelar la modificación de esta wea."
#: data/ui/tour.editor.ui:306 data/ui/tour.places.ui:23 #: data/ui/tour.editor.ui:305 data/ui/tour.places.ui:23
msgid "Places" msgid "Places"
msgstr "Lugares" msgstr "Lugares"
#: data/ui/tour.editor.ui:310 #: data/ui/tour.editor.ui:309
msgid "Add or edit places." msgid "Add or edit places."
msgstr "Agregar o editar places." msgstr "Agregar o editar places."
#: data/ui/tour.editor.ui:325 #: data/ui/tour.editor.ui:324
msgid "Save" msgid "Save"
msgstr "Guardar la wea" msgstr "Guardar la wea"
#: data/ui/tour.editor.ui:329 #: data/ui/tour.editor.ui:328
msgid "Save this tour." msgid "Save this tour."
msgstr "Guardar esta wea." msgstr "Guardar esta wea."
#: data/ui/tour.places.ui:69 #: data/ui/tour.places.ui:68
msgid "Place Name" msgid "Place Name"
msgstr "Nombre de la Wea" msgstr "Nombre de la Wea"
#: data/ui/tour.places.ui:83 #: data/ui/tour.places.ui:82
msgid "Ticket Price" msgid "Ticket Price"
msgstr "Valor de la Wea" msgstr "Valor de la Wea"
#: data/ui/tour.places.ui:97 #: data/ui/tour.places.ui:96
msgid "Difficulty" msgid "Difficulty"
msgstr "Dificultad" msgstr "Dificultad"
#: data/ui/tour.places.ui:111 #: data/ui/tour.places.ui:110
msgid "Arrival Date" msgid "Arrival Date"
msgstr "Fecha de Llegada" msgstr "Fecha de Llegada"
#: data/ui/tour.places.ui:125 #: data/ui/tour.places.ui:124
msgid "Arrival Time" msgid "Arrival Time"
msgstr "Hora de Llegada" msgstr "Hora de Llegada"
#: data/ui/tour.places.ui:139 #: data/ui/tour.places.ui:138
msgid "Departure Date" msgid "Departure Date"
msgstr "Fecha de Salida" msgstr "Fecha de Salida"
#: data/ui/tour.places.ui:153 #: data/ui/tour.places.ui:152
msgid "Departure Time" msgid "Departure Time"
msgstr "Hora de Salida" msgstr "Hora de Salida"
#: data/ui/tour.places.ui:190 #: data/ui/tour.places.ui:189
msgid "Edit associated place." msgid "Edit associated place."
msgstr "Edit lugar asociado." msgstr "Edit lugar asociado."
#: data/ui/tour.places.ui:200 #: data/ui/tour.places.ui:199
msgid "Add" msgid "Add"
msgstr "Agregar una wea" msgstr "Agregar una wea"
#: data/ui/tour.places.ui:204 #: data/ui/tour.places.ui:203
msgid "Associate this tour with an existing place." msgid "Associate this tour with an existing place."
msgstr "Asociar esta wea con un lugar que ya existe." msgstr "Asociar esta wea con un lugar que ya existe."
#: data/ui/tour.places.ui:219 #: data/ui/tour.places.ui:218
msgid "Delete associated place." msgid "Delete associated place."
msgstr "Borrar la wea asociado." msgstr "Borrar la wea asociado."
#: data/ui/tour.places.ui:247 #: data/ui/tour.places.ui:246
msgid "Create a new place to associate." msgid "Create a new place to associate."
msgstr "Crear una wea nueva para asociar con el tour." msgstr "Crear una wea nueva para asociar con el tour."
#: data/ui/query.window.ui:85 #: data/ui/query.window.ui:84
msgid "Run" msgid "Run"
msgstr "Correr la wea" msgstr "Correr la wea"
#: data/ui/query.window.ui:127 #: data/ui/query.window.ui:126
msgid "Statement" msgid "Statement"
msgstr "Enunciado" msgstr "Enunciado"
#: data/ui/query.window.ui:157 #: data/ui/query.window.ui:156
msgid "View and Query" msgid "View and Query"
msgstr "Vista y Consulta" msgstr "Vista y Consulta"

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-18 17:59-0300\n" "POT-Creation-Date: 2019-01-19 17:42-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"
@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: lib/db.vala:74 #: lib/db.vala:78
msgid "Postgresql server version:" msgid "Postgresql server version:"
msgstr "" msgstr ""
@ -41,17 +41,30 @@ msgstr ""
msgid "The verifier %C is invalid!" msgid "The verifier %C is invalid!"
msgstr "" msgstr ""
#: src/sernatur.vala:88 #: lib/db/asociado.vala:121 lib/db/tour.vala:123 lib/db/tour.vala:145
#: lib/db/tour.vala:180
msgid "The id of the tour is invalid!"
msgstr ""
#: lib/db/ciudad.vala:142
msgid "The id of the city is invalid!"
msgstr ""
#: lib/db/region.vala:91
msgid "The id of the region is invalid!"
msgstr ""
#: src/sernatur.vala:87
#, c-format #, c-format
msgid "Error: %s\n" msgid "Error: %s\n"
msgstr "" msgstr ""
#: src/sernatur.vala:89 #: src/sernatur.vala:88
#, c-format #, c-format
msgid "Run '%s --help' to see a full list of available command line options.\n" msgid "Run '%s --help' to see a full list of available command line options.\n"
msgstr "" msgstr ""
#: src/sernatur.vala:94 #: src/sernatur.vala:93
msgid "SERNATUR version: " msgid "SERNATUR version: "
msgstr "" msgstr ""
@ -59,78 +72,78 @@ msgstr ""
msgid "Error: Could not connect to the database!" msgid "Error: Could not connect to the database!"
msgstr "" msgstr ""
#: src/main_window.vala:228 src/tour_list.vala:215 src/tour_list.vala:231 #: src/main_window.vala:228 src/tour_list.vala:233 src/tour_list.vala:256
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: src/tour_list.vala:185 #: src/tour_list.vala:191
msgid "Are you sure you wish to delete this tour?" msgid "Are you sure you wish to delete this tour?"
msgstr "" msgstr ""
#: src/tour_list.vala:192 #: src/tour_list.vala:198
msgid "Are you sure you wish to delete these tours?" msgid "Are you sure you wish to delete these tours?"
msgstr "" msgstr ""
#: src/tour_list.vala:211 #: src/tour_list.vala:229
#, c-format #, c-format
msgid "" msgid ""
"Error: Could not delete tour \"%s\" because either this tour has been taken " "Error: Could not delete tour \"%s\" because either this tour has been taken "
"or is still associated with a place or vehicle!" "or is still associated with a place or vehicle!"
msgstr "" msgstr ""
#: src/query_window.vala:290 data/ui/main.window.ui:136 #: src/query_window.vala:290 data/ui/main.window.ui:135
msgid "(Q1) Regions with discounts" msgid "(Q1) Regions with discounts"
msgstr "" msgstr ""
#: src/query_window.vala:303 data/ui/main.window.ui:144 #: src/query_window.vala:303 data/ui/main.window.ui:143
msgid "(Q2) Tour values" msgid "(Q2) Tour values"
msgstr "" msgstr ""
#: src/query_window.vala:316 data/ui/main.window.ui:152 #: src/query_window.vala:316 data/ui/main.window.ui:151
msgid "(Q3) Coordinator total" msgid "(Q3) Coordinator total"
msgstr "" msgstr ""
#: src/query_window.vala:329 data/ui/main.window.ui:160 #: src/query_window.vala:329 data/ui/main.window.ui:159
msgid "(Q4) Tourist total" msgid "(Q4) Tourist total"
msgstr "" msgstr ""
#: src/query_window.vala:342 data/ui/main.window.ui:168 #: src/query_window.vala:342 data/ui/main.window.ui:167
msgid "(Q5) Vehicle total" msgid "(Q5) Vehicle total"
msgstr "" msgstr ""
#: data/ui/main.window.ui:44 #: data/ui/main.window.ui:43
msgid "_Menu" msgid "_Menu"
msgstr "" msgstr ""
#: data/ui/main.window.ui:54 data/ui/tour.list.ui:23 #: data/ui/main.window.ui:53 data/ui/tour.list.ui:23
msgid "Tours" msgid "Tours"
msgstr "" msgstr ""
#: data/ui/main.window.ui:62 #: data/ui/main.window.ui:61
msgid "Staff" msgid "Staff"
msgstr "" msgstr ""
#: data/ui/main.window.ui:70 #: data/ui/main.window.ui:69
msgid "Tourists" msgid "Tourists"
msgstr "" msgstr ""
#: data/ui/main.window.ui:80 #: data/ui/main.window.ui:79
msgid "Illnesses" msgid "Illnesses"
msgstr "" msgstr ""
#: data/ui/main.window.ui:88 #: data/ui/main.window.ui:87
msgid "Participate" msgid "Participate"
msgstr "" msgstr ""
#: data/ui/main.window.ui:100 #: data/ui/main.window.ui:99
msgid "Vehicles" msgid "Vehicles"
msgstr "" msgstr ""
#: data/ui/main.window.ui:114 #: data/ui/main.window.ui:113
msgid "Quit" msgid "Quit"
msgstr "" msgstr ""
#: data/ui/main.window.ui:126 #: data/ui/main.window.ui:125
msgid "_Views" msgid "_Views"
msgstr "" msgstr ""
@ -138,61 +151,61 @@ msgstr ""
msgid "Christopher Cromer" msgid "Christopher Cromer"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:69 data/ui/tour.editor.ui:54 data/ui/query.tree.ui:80 #: data/ui/tour.list.ui:68 data/ui/tour.editor.ui:53 data/ui/query.tree.ui:80
#: data/ui/query.tree.ui:120 data/ui/query.tree.ui:160 #: data/ui/query.tree.ui:120 data/ui/query.tree.ui:160
msgid "Tour Name" msgid "Tour Name"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:83 data/ui/tour.editor.ui:87 #: data/ui/tour.list.ui:82 data/ui/tour.editor.ui:86
msgid "Individual Cost" msgid "Individual Cost"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:97 data/ui/tour.editor.ui:103 #: data/ui/tour.list.ui:96 data/ui/tour.editor.ui:102
msgid "Group Cost" msgid "Group Cost"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:111 data/ui/tour.editor.ui:119 #: data/ui/tour.list.ui:110 data/ui/tour.editor.ui:118
msgid "Minimum People" msgid "Minimum People"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:125 data/ui/tour.editor.ui:187 #: data/ui/tour.list.ui:124 data/ui/tour.editor.ui:186
msgid "City" msgid "City"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:139 data/ui/tour.editor.ui:135 #: data/ui/tour.list.ui:138 data/ui/tour.editor.ui:134
msgid "Region" msgid "Region"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:171 data/ui/tour.places.ui:185 #: data/ui/tour.list.ui:170 data/ui/tour.places.ui:184
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:176 #: data/ui/tour.list.ui:175
msgid "Edit selected tour." msgid "Edit selected tour."
msgstr "" msgstr ""
#: data/ui/tour.list.ui:186 data/ui/tour.places.ui:243 #: data/ui/tour.list.ui:185 data/ui/tour.places.ui:242
msgid "New" msgid "New"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:190 #: data/ui/tour.list.ui:189
msgid "Create a new tour." msgid "Create a new tour."
msgstr "" msgstr ""
#: data/ui/tour.list.ui:200 data/ui/tour.places.ui:214 #: data/ui/tour.list.ui:199 data/ui/tour.places.ui:213
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:205 #: data/ui/tour.list.ui:204
msgid "Delete selected tour." msgid "Delete selected tour."
msgstr "" msgstr ""
#: data/ui/tour.list.ui:215 data/ui/tour.places.ui:229 #: data/ui/tour.list.ui:214 data/ui/tour.places.ui:228
#: data/ui/query.window.ui:67 #: data/ui/query.window.ui:66
msgid "Close" msgid "Close"
msgstr "" msgstr ""
#: data/ui/tour.list.ui:219 data/ui/tour.places.ui:233 #: data/ui/tour.list.ui:218 data/ui/tour.places.ui:232
msgid "Close this window." msgid "Close this window."
msgstr "" msgstr ""
@ -200,95 +213,95 @@ msgstr ""
msgid "Tour Editor" msgid "Tour Editor"
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:234 #: data/ui/tour.editor.ui:233
msgid "Create a new region by typing here." msgid "Create a new region by typing here."
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:262 #: data/ui/tour.editor.ui:261
msgid "Create a new city by typing here." msgid "Create a new city by typing here."
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:287 #: data/ui/tour.editor.ui:286
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:291 #: data/ui/tour.editor.ui:290
msgid "Cancel the modification of this tour." msgid "Cancel the modification of this tour."
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:306 data/ui/tour.places.ui:23 #: data/ui/tour.editor.ui:305 data/ui/tour.places.ui:23
msgid "Places" msgid "Places"
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:310 #: data/ui/tour.editor.ui:309
msgid "Add or edit places." msgid "Add or edit places."
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:325 #: data/ui/tour.editor.ui:324
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: data/ui/tour.editor.ui:329 #: data/ui/tour.editor.ui:328
msgid "Save this tour." msgid "Save this tour."
msgstr "" msgstr ""
#: data/ui/tour.places.ui:69 #: data/ui/tour.places.ui:68
msgid "Place Name" msgid "Place Name"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:83 #: data/ui/tour.places.ui:82
msgid "Ticket Price" msgid "Ticket Price"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:97 #: data/ui/tour.places.ui:96
msgid "Difficulty" msgid "Difficulty"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:111 #: data/ui/tour.places.ui:110
msgid "Arrival Date" msgid "Arrival Date"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:125 #: data/ui/tour.places.ui:124
msgid "Arrival Time" msgid "Arrival Time"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:139 #: data/ui/tour.places.ui:138
msgid "Departure Date" msgid "Departure Date"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:153 #: data/ui/tour.places.ui:152
msgid "Departure Time" msgid "Departure Time"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:190 #: data/ui/tour.places.ui:189
msgid "Edit associated place." msgid "Edit associated place."
msgstr "" msgstr ""
#: data/ui/tour.places.ui:200 #: data/ui/tour.places.ui:199
msgid "Add" msgid "Add"
msgstr "" msgstr ""
#: data/ui/tour.places.ui:204 #: data/ui/tour.places.ui:203
msgid "Associate this tour with an existing place." msgid "Associate this tour with an existing place."
msgstr "" msgstr ""
#: data/ui/tour.places.ui:219 #: data/ui/tour.places.ui:218
msgid "Delete associated place." msgid "Delete associated place."
msgstr "" msgstr ""
#: data/ui/tour.places.ui:247 #: data/ui/tour.places.ui:246
msgid "Create a new place to associate." msgid "Create a new place to associate."
msgstr "" msgstr ""
#: data/ui/query.window.ui:85 #: data/ui/query.window.ui:84
msgid "Run" msgid "Run"
msgstr "" msgstr ""
#: data/ui/query.window.ui:127 #: data/ui/query.window.ui:126
msgid "Statement" msgid "Statement"
msgstr "" msgstr ""
#: data/ui/query.window.ui:157 #: data/ui/query.window.ui:156
msgid "View and Query" msgid "View and Query"
msgstr "" msgstr ""

View File

@ -213,7 +213,7 @@ namespace Sernatur {
Gtk.DialogFlags.MODAL, Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR, Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE, Gtk.ButtonsType.CLOSE,
dgettext(null, "Error: Could not connect to the database!")); _ ("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

@ -140,6 +140,7 @@ namespace Sernatur {
region.get_active_iter (out iter); region.get_active_iter (out iter);
Region temp_region; Region temp_region;
if (region_list_store.iter_is_valid (iter)) { if (region_list_store.iter_is_valid (iter)) {
// The region is from the list, not typed
region_list_store.get (iter, region_list_store.get (iter,
RegionColumn.REGION, out temp_region); RegionColumn.REGION, out temp_region);
tour.ciudad.region = temp_region; tour.ciudad.region = temp_region;
@ -147,9 +148,6 @@ namespace Sernatur {
reset_city (); reset_city ();
} }
} }
else {
// New region to be created
}
} }
} }
@ -195,9 +193,6 @@ namespace Sernatur {
public void on_clicked_button (Gtk.Button button) { public void on_clicked_button (Gtk.Button button) {
if (button == save) { if (button == save) {
if (tour.id_tour == 0) { if (tour.id_tour == 0) {
// This is if they typed a new city, TODO
/*print (city.get_active_text () + "\n");*/
update_tour_instance (); update_tour_instance ();
try { try {
Tour.insert_tour (conn, tour); Tour.insert_tour (conn, tour);
@ -243,25 +238,77 @@ namespace Sernatur {
} }
} }
/**
* Update the the tour object with new info from the editor
*/
private void update_tour_instance () { private void update_tour_instance () {
tour.nombre_tour = tour_name.get_text (); tour.nombre_tour = tour_name.get_text ();
tour.costo_indiv = (uint) int.parse (indiv_cost.get_text ()); tour.costo_indiv = (uint) int.parse (indiv_cost.get_text ());
tour.costo_grupal = (uint) int.parse (group_cost.get_text ()); tour.costo_grupal = (uint) int.parse (group_cost.get_text ());
tour.minima_personas = (uint) minimum_people.get_value_as_int (); tour.minima_personas = (uint) minimum_people.get_value_as_int ();
Gtk.TreeIter iter; if (region.get_active () == -1) {
Ciudad ciudad; Region new_region = new Region (0, region.get_active_text ());
city.get_active_iter (out iter); try {
if (city_list_store.iter_is_valid (iter)) { new_region.id_region = Region.insert_region (conn, new_region);
city_list_store.get (iter, }
CityColumn.CITY, out ciudad); catch (Error e) {
tour.ciudad = ciudad; #if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
finally {
update_tour_instance_city (new_region);
}
} }
Region new_region; else {
region.get_active_iter (out iter); Region new_region;
if (region_list_store.iter_is_valid (iter)) { Gtk.TreeIter iter;
region_list_store.get (iter, region.get_active_iter (out iter);
RegionColumn.REGION, out new_region); if (region_list_store.iter_is_valid (iter)) {
tour.ciudad.region = new_region; region_list_store.get (iter,
RegionColumn.REGION, out new_region);
}
else {
new_region = new Region ();
}
update_tour_instance_city (new_region);
}
}
/**
* This method updates the city part of the tour instance
* @param new_region The region to insert into the city object
*/
private void update_tour_instance_city (Region new_region) {
Ciudad ciudad;
if (city.get_active () == -1) {
ciudad = new Ciudad (0, city.get_active_text ());
ciudad.region = new_region;
try {
ciudad.id_ciudad = Ciudad.insert_city (conn, ciudad);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
finally {
tour.ciudad = ciudad;
}
}
else {
Gtk.TreeIter iter;
city.get_active_iter (out iter);
if (city_list_store.iter_is_valid (iter)) {
city_list_store.get (iter,
CityColumn.CITY, out ciudad);
ciudad.region = new_region;
tour.ciudad = ciudad;
}
} }
} }

View File

@ -207,7 +207,7 @@ namespace Sernatur {
Gtk.DialogFlags.MODAL, Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR, Gtk.MessageType.ERROR,
Gtk.ButtonsType.YES_NO, Gtk.ButtonsType.YES_NO,
dgettext(null, "Are you sure you wish to delete this tour?")); _ ("Are you sure you wish to delete this tour?"));
msg.response.connect ((response_id) => { msg.response.connect ((response_id) => {
switch (response_id) { switch (response_id) {
case Gtk.ResponseType.YES: case Gtk.ResponseType.YES:
@ -227,7 +227,7 @@ namespace Sernatur {
Gtk.DialogFlags.MODAL, Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR, Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE, Gtk.ButtonsType.CLOSE,
dgettext(null, "Error: Could not delete tour because there are still associated arrival and departure dates and times!")); _ ("Error: Could not delete tour because there are still associated arrival and departure dates and times!"));
msg2.response.connect ((response_id) => { msg2.response.connect ((response_id) => {
msg2.destroy (); msg2.destroy ();
}); });