Browse Source

update valadocs

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

+ 2
- 1
doc/meson.build View File

@@ -16,8 +16,9 @@ if docs_enabled
16 16
 		output: 'valadoc',
17 17
 		command: [ valadoc,
18 18
 			docs_deps,
19
-			'--use-svg-images',
20 19
 			'--doclet=html',
20
+			'--internal',
21
+			'--private',
21 22
 			'--force',
22 23
 			'--package-name=@0@'.format(meson.project_name()),
23 24
 			'--package-version=@0@'.format(meson.project_version()),

+ 27
- 0
lib/db/arrienda.vala View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Arrienda class based on the database table
22
+		 */
20 23
 		public class Arrienda : GLib.Object {
24
+			/**
25
+			 * The price
26
+			 */
21 27
 			public uint precio { get; set; default = 0; }
28
+			/**
29
+			 * The date the vehicle needs to be returned
30
+			 */
22 31
 			public string fecha_devolucion { get; set; default = ""; }
32
+			/**
33
+			 * The vehicle
34
+			 */
23 35
 			public Vehiculo vehiculo { get; set; default = null; }
36
+			/**
37
+			 * The compnay
38
+			 */
24 39
 			public Empresa empresa { get; set; default = null; }
25 40
 
41
+			/**
42
+			 * Initialize the Arrienda class
43
+			 * @param precio The price
44
+			 * @param fecha_devolucion The date when the vehicle has to be returned
45
+			 * @param vehiculo The Vehicle
46
+			 * @param empresa The company
47
+			 */
26 48
 			public Arrienda (uint precio = 0, string fecha_devolucion = "", Vehiculo? vehiculo = null, Empresa? empresa = null) {
27 49
 				this.precio = precio;
28 50
 				this.fecha_devolucion = fecha_devolucion;
@@ -30,6 +52,11 @@ namespace LibSernatur {
30 52
 				this.empresa = empresa;
31 53
 			}
32 54
 
55
+			/**
56
+			 * Get all tuples and fields from database
57
+			 * @param conn The database connection to use
58
+			 * @return Returns an array of Arrienda
59
+			 */
33 60
 			public static Arrienda[]? get_all_arriendas(Database conn) {
34 61
 				var res = conn.exec ("
35 62
 SELECT A.precio, A.fecha_devolucion,

+ 19
- 0
lib/db/asociado.vala View File

@@ -17,6 +17,9 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Asociado class based on the database table
22
+		 */
20 23
 		public class Asociado : GLib.Object {
21 24
 			public string fecha_llegada { get; set; default = ""; }
22 25
 			public string hora_llegada { get; set; default = ""; }
@@ -25,13 +28,29 @@ namespace LibSernatur {
25 28
 			public Tour tour { get; set; default = null; }
26 29
 			public Lugar lugar { get; set; default = null; }
27 30
 
31
+			/**
32
+			 * Initialize the Asociado class
33
+			 * @param fecha_llegada The date of arrival
34
+			 * @param hora_llegada The time of arrival
35
+			 * @param fecha_salida The date of departure
36
+			 * @param hora_salida The time of departure
37
+			 * @param tour The tour taken
38
+			 * @param lugar The place visisted
39
+			 */
28 40
 			public Asociado (string fecha_llegada = "", string hora_llegada = "", string fecha_salida = "", string hora_salida = "", Tour? tour = null, Lugar? lugar = null) {
29 41
 				this.fecha_llegada = fecha_llegada;
30 42
 				this.hora_llegada = hora_llegada;
31 43
 				this.fecha_salida = fecha_salida;
32 44
 				this.hora_salida = hora_salida;
45
+				this.tour = tour;
46
+				this.lugar = lugar;
33 47
 			}
34 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of Asociado
53
+			 */
35 54
 			public static Asociado[]? get_all_asociados(Database conn) {
36 55
 				var res = conn.exec ("
37 56
 SELECT A.fecha_llegada, A.hora_llegada, A.fecha_salida, A.hora_salida

+ 19
- 0
lib/db/categoria.vala View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Categoria class based on the database table
22
+		 */
20 23
 		public class Categoria : GLib.Object {
24
+			/**
25
+			 * The id of the category
26
+			 */
21 27
 			public uint id_categoria { get; set; default = 0; }
28
+			/**
29
+			 * The description of the category
30
+			 */
22 31
 			public string descripcion_categoria { get; set; default = ""; }
23 32
 
33
+			/**
34
+			 * Initialize the Categoria class
35
+			 * @param id_categoria The id of the category
36
+			 * @param descripcion_categoria The description of the category
37
+			 */
24 38
 			public Categoria (uint id_categoria = 0, string descripcion_categoria = "") {
25 39
 				this.id_categoria = id_categoria;
26 40
 				this.descripcion_categoria = descripcion_categoria;
27 41
 			}
28 42
 
43
+			/**
44
+			 * Get all tuples and fields from database
45
+			 * @param conn The database connection to use
46
+			 * @return Returns an array of Categoria
47
+			 */
29 48
 			public static Categoria[]? get_all_categorias(Database conn) {
30 49
 				var res = conn.exec ("
31 50
 SELECT id_categoria, descripcion_categoria FROM categoria

+ 23
- 0
lib/db/ciudad.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Ciudad class based on the database table
22
+		 */
20 23
 		public class Ciudad : GLib.Object {
24
+			/**
25
+			 * The id of the city
26
+			 */
21 27
 			public uint id_ciudad { get; set; default = 0; }
28
+			/**
29
+			 * The name of the city
30
+			 */
22 31
 			public string nombre_ciudad { get; set; default = ""; }
32
+			/**
33
+			 * The region
34
+			 */
23 35
 			public Region region { get; set; default = null; }
24 36
 
37
+			/**
38
+			 * Initialize the Ciudad class
39
+			 * @param id_ciudad The id of the city
40
+			 * @param nombre_ciudad The name of the city
41
+			 * @param region The region
42
+			 * */
25 43
 			public Ciudad (uint id_ciudad = 0, string nombre_ciudad = "", Region? region = null) {
26 44
 				this.id_ciudad = id_ciudad;
27 45
 				this.nombre_ciudad = nombre_ciudad;
28 46
 				this.region = region;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of Ciudad
53
+			 */
31 54
 			public static Ciudad[]? get_all_ciudades(Database conn) {
32 55
 				var res = conn.exec ("
33 56
 SELECT C.id_ciudad, C.nombre_ciudad,

+ 23
- 0
lib/db/contacto_emergencia.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The ContactoEmergencia class based on the database table
22
+		 */
20 23
 		public class ContactoEmergencia : GLib.Object {
24
+			/**
25
+			 * The id of the contact
26
+			 */
21 27
 			public uint id_contacto { get; set; default = 0; }
28
+			/**
29
+			 * The contact's phone number
30
+			 */
22 31
 			public uint telefono_emergencia { get; set; default = 0; }
32
+			/**
33
+			 * The contact's name
34
+			 */
23 35
 			public string nombre_emergencia { get; set; default = ""; }
24 36
 
37
+			/**
38
+			 * Initialize the ContactoEmergencia class
39
+			 * @param id_contacto The id of the contact
40
+			 * @param telefono_emergencia The contact's phone number
41
+			 * @param nombre_emergencia The contact's name
42
+			 */
25 43
 			public ContactoEmergencia (uint id_contacto = 0, uint telefono_emergencia = 0, string nombre_emergencia = "") {
26 44
 				this.id_contacto = id_contacto;
27 45
 				this.telefono_emergencia = telefono_emergencia;
28 46
 				this.nombre_emergencia = nombre_emergencia;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of ContactoEmergencia
53
+			 */
31 54
 			public static ContactoEmergencia[]? get_all_contactos(Database conn) {
32 55
 				var res = conn.exec ("SELECT id_contacto, telefono_emergencia, nombre_emergencia FROM contacto_emergencia");
33 56
 				if (res.get_status () != ExecStatus.TUPLES_OK) {

+ 23
- 0
lib/db/descuento.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Descuento class based on the database table
22
+		 */
20 23
 		public class Descuento : GLib.Object {
24
+			/**
25
+			 * The id of the discount
26
+			 */
21 27
 			public uint id_descuento { get; set; default = 0; }
28
+			/**
29
+			 * The description of the discount
30
+			 */
22 31
 			public string descripcion_descuento { get; set; default = ""; }
32
+			/**
33
+			 * The percentage of the discount
34
+			 */
23 35
 			public float porcentaje { get; set; default = 0; }
24 36
 
37
+			/**
38
+			 * Initialize the Descuento class
39
+			 * @param id_descuento The id of the discount
40
+			 * @param descripcion_descuento The description of the discount
41
+			 * @param porcentaje The percentage of the discount
42
+			 */
25 43
 			public Descuento (uint id_descuento = 0, string descripcion_descuento = "", float porcentaje = 0) {
26 44
 				this.id_descuento = id_descuento;
27 45
 				this.descripcion_descuento = descripcion_descuento;
28 46
 				this.porcentaje = porcentaje;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of Descuento
53
+			 */
31 54
 			public static Descuento[]? get_all_descuentos(Database conn) {
32 55
 				var res = conn.exec ("
33 56
 SELECT id_descuento, descripcion_descuento, porcentaje FROM descuento

+ 27
- 0
lib/db/empresa.vala View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Empresa class based on the database table
22
+		 */
20 23
 		public class Empresa : GLib.Object {
24
+			/**
25
+			 * The RUT of the company
26
+			 */
21 27
 			public string rut_empresa { get; set; default = ""; }
28
+			/**
29
+			 * The name of the company
30
+			 */
22 31
 			public string nombre_empresa { get; set; default = ""; }
32
+			/**
33
+			 * The name of the contact in the company
34
+			 */
23 35
 			public string contacto { get; set; default = ""; }
36
+			/**
37
+			 * The phone number of the contact
38
+			 */
24 39
 			public uint telefono { get; set; default = 0; }
25 40
 
41
+			/**
42
+			 * Initialize the Empresa class
43
+			 * @param rut_empresa The RUT of the company
44
+			 * @param nombre_empresa The name of the company
45
+			 * @param contacto The name of the contact in the company
46
+			 * @param telefono The phone number of the contact
47
+			 */
26 48
 			public Empresa (string rut_empresa = "", string nombre_empresa = "", string contacto = "", uint telefono = 0) {
27 49
 				this.rut_empresa = rut_empresa;
28 50
 				this.nombre_empresa = nombre_empresa;
@@ -30,6 +52,11 @@ namespace LibSernatur {
30 52
 				this.telefono = telefono;
31 53
 			}
32 54
 
55
+			/**
56
+			 * Get all tuples and fields from database
57
+			 * @param conn The database connection to use
58
+			 * @return Returns an array of Empresa
59
+			 */
33 60
 			public static Empresa[]? get_all_empresas(Database conn) {
34 61
 				var res = conn.exec ("
35 62
 SELECT rut_empresa, nombre_empresa, contacto, telefono FROM empresa

+ 19
- 0
lib/db/enfermedad.vala View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Enfermedad class based on the database table
22
+		 */
20 23
 		public class Enfermedad : GLib.Object {
24
+			/**
25
+			 * The id of the illness
26
+			 */
21 27
 			public uint id_enfermedad { get; set; default = 0; }
28
+			/**
29
+			 * The description of the illness
30
+			 */
22 31
 			public string descripcion_enfermedad { get; set; default = ""; }
23 32
 
33
+			/**
34
+			 * Initialize the Enfermedad class
35
+			 * @param id_enfermedad The id of the illness
36
+			 * @param descripcion_enfermedad The description of the illness
37
+			 */
24 38
 			public Enfermedad (uint id_enfermedad = 0, string descripcion_enfermedad = "") {
25 39
 				this.id_enfermedad = id_enfermedad;
26 40
 				this.descripcion_enfermedad = descripcion_enfermedad;
27 41
 			}
28 42
 
43
+			/**
44
+			 * Get all tuples and fields from database
45
+			 * @param conn The database connection to use
46
+			 * @return Returns an array of Enfermedad
47
+			 */
29 48
 			public static Enfermedad[]? get_all_enfermedades(Database conn) {
30 49
 				var res = conn.exec ("
31 50
 SELECT id_enfermedad, descripcion_enfermedad FROM enfermedad

+ 19
- 0
lib/db/especialidad.vala View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Esepcialidad class based on the database table
22
+		 */
20 23
 		public class Especialidad : GLib.Object {
24
+			/**
25
+			 * The id of the specialty
26
+			 */
21 27
 			public uint id_especialidad { get; set; default = 0; }
28
+			/**
29
+			 * The description of the specialty
30
+			 */
22 31
 			public string descripcion_especialidad { get; set; default = ""; }
23 32
 
33
+			/**
34
+			 * Initialize the Especialidad class
35
+			 * @param id_especialidad The specialty id
36
+			 * @param descripcion_especialidad The description of the specialty
37
+			 */
24 38
 			public Especialidad (uint id_especialidad = 0, string descripcion_especialidad = "") {
25 39
 				this.id_especialidad = id_especialidad;
26 40
 				this.descripcion_especialidad = descripcion_especialidad;
27 41
 			}
28 42
 
43
+			/**
44
+			 * Get all tuples and fields from database
45
+			 * @param conn The database connection to use
46
+			 * @return Returns an array of Especialidad
47
+			 */
29 48
 			public static Especialidad[]? get_all_especialidades(Database conn) {
30 49
 				var res = conn.exec ("
31 50
 SELECT id_especialidad, descripcion_especialidad FROM especialidad

+ 31
- 0
lib/db/guia.vala View File

@@ -17,13 +17,39 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Guia class based on the database table
22
+		 */
20 23
 		public class Guia : GLib.Object {
24
+			/**
25
+			 * The RUT of the guide
26
+			 */
21 27
 			public string rut_guia { get; set; default = ""; }
28
+			/**
29
+			 * The name of the guide
30
+			 **/
22 31
 			public string nombre_guia { get; set; default = ""; }
32
+			/**
33
+			 * The stree name
34
+			 */
23 35
 			public string calle { get; set; default = ""; }
36
+			/**
37
+			 * The street number
38
+			 */
24 39
 			public uint numero { get; set; default = 0; }
40
+			/**
41
+			 * The city
42
+			 */
25 43
 			public Ciudad ciudad { get; set; default = null; }
26 44
 
45
+			/**
46
+			 * Initialize the Guia class
47
+			 * @param rut_guia The RUT of the guide
48
+			 * @param nombre_guia The name of the guide
49
+			 * @param calle The street name
50
+			 * @param numero The street number
51
+			 * @param ciudad The city
52
+			 */
27 53
 			public Guia (string rut_guia = "", string nombre_guia = "", string calle = "", uint numero = 0, Ciudad? ciudad = null) {
28 54
 				this.rut_guia = rut_guia;
29 55
 				this.nombre_guia = nombre_guia;
@@ -32,6 +58,11 @@ namespace LibSernatur {
32 58
 				this.ciudad = ciudad;
33 59
 			}
34 60
 
61
+			/**
62
+			 * Get all tuples and fields from database
63
+			 * @param conn The database connection to use
64
+			 * @return Returns an array of Guia
65
+			 */
35 66
 			public static Guia[]? get_all_guias(Database conn) {
36 67
 				var res = conn.exec ("
37 68
 SELECT G.rut_guia, G.nombre_guia, G.calle, G.numero,

+ 31
- 0
lib/db/lugar.vala View File

@@ -17,13 +17,39 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Lugar class based on the database table
22
+		 */
20 23
 		public class Lugar : GLib.Object {
24
+			/**
25
+			 * The id of the place
26
+			 */
21 27
 			public uint id_lugar { get; set; default = 0; }
28
+			/**
29
+			 * The name of the place
30
+			 */
22 31
 			public string nombre_lugar { get; set; default = ""; }
32
+			/**
33
+			 * The cost to enter
34
+			 */
23 35
 			public uint valor_entrada { get; set; default = 0; }
36
+			/**
37
+			 * The level of difficulty
38
+			 */
24 39
 			public uint nivel { get; set; default = 0; }
40
+			/**
41
+			 * The city
42
+			 */
25 43
 			public Ciudad ciudad { get; set; default = null; }
26 44
 
45
+			/**
46
+			 * Initialize the Lugar class
47
+			 * @param id_lugar The id of the place
48
+			 * @param nombre_lugar The name of the place
49
+			 * @param valor_entrada The cost to enter
50
+			 * @param nivel The level of difficulty
51
+			 * @param ciudad The city
52
+			 */
27 53
 			public Lugar (uint id_lugar = 0, string nombre_lugar = "", uint valor_entrada = 0, uint nivel = 0, Ciudad? ciudad = null) {
28 54
 				this.id_lugar = id_lugar;
29 55
 				this.nombre_lugar = nombre_lugar;
@@ -32,6 +58,11 @@ namespace LibSernatur {
32 58
 				this.ciudad = ciudad;
33 59
 			}
34 60
 
61
+			/**
62
+			 * Get all tuples and fields from database
63
+			 * @param conn The database connection to use
64
+			 * @return Returns an array of Lugar
65
+			 */
35 66
 			public static Lugar[]? get_all_lugares(Database conn) {
36 67
 				var res = conn.exec ("
37 68
 SELECT L.id_lugar, L.nombre_lugar, L.valor_entrada, L.nivel,

+ 23
- 0
lib/db/participa.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Participa class based on the database table
22
+		 */
20 23
 		public class Participa : GLib.Object {
24
+			/**
25
+			 * The tour
26
+			 */
21 27
 			public Tour tour { get; set; default = null; }
28
+			/**
29
+			 * The guide
30
+			 */
22 31
 			public Guia guia { get; set; default = null; }
32
+			/**
33
+			 * The category
34
+			 */
23 35
 			public Categoria categoria { get; set; default = null; }
24 36
 
37
+			/**
38
+			 * Initialize the Participa class
39
+			 * @param tour The tour
40
+			 * @param guia The guide
41
+			 * @param categoria The category
42
+			 */
25 43
 			public Participa (Tour? tour = null, Guia? guia = null, Categoria? categoria = null) {
26 44
 				this.tour = tour;
27 45
 				this.guia = guia;
28 46
 				this.categoria = categoria;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of Participa
53
+			 */
31 54
 			public static Participa[]? get_all_participas(Database conn) {
32 55
 				var res = conn.exec ("
33 56
 SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,

+ 23
- 0
lib/db/posee.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Posee class based on the database table
22
+		 */
20 23
 		public class Posee : GLib.Object {
24
+			/**
25
+			 * The specialty level
26
+			 */
21 27
 			public uint nivel_especialidad { get; set; default = 0; }
28
+			/**
29
+			 * The guide
30
+			 */
22 31
 			public Guia guia { get; set; default = null; }
32
+			/**
33
+			 * The speciality
34
+			 */
23 35
 			public Especialidad especialidad { get; set; default = null; }
24 36
 
37
+			/**
38
+			 * Initialize the Posee class
39
+			 * @param nivel_especialidad The specialty level
40
+			 * @param guia The guide
41
+			 * @param especialidad The specialty
42
+			 */
25 43
 			public Posee (uint nivel_especialidad = 0, Guia? guia = null, Especialidad? especialidad = null) {
26 44
 				this.nivel_especialidad = nivel_especialidad;
27 45
 				this.guia = guia;
28 46
 				this.especialidad = especialidad;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of Posee
53
+			 */
31 54
 			public static Posee[]? get_all_posees(Database conn) {
32 55
 				var res = conn.exec ("
33 56
 SELECT P.nivel_especialidad,

+ 23
- 0
lib/db/realiza.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Realiza class based on the database table
22
+		 */
20 23
 		public class Realiza : GLib.Object {
24
+			/**
25
+			 * The tour
26
+			 */
21 27
 			public Tour tour { get; set; default = null; }
28
+			/**
29
+			 * The tourist
30
+			 */
22 31
 			public Turista turista { get; set; default = null; }
32
+			/**
33
+			 * The discount
34
+			 */
23 35
 			public Descuento descuento { get; set; default = null; }
24 36
 
37
+			/**
38
+			 * Initialize the Realiza class
39
+			 * @param tour The tour
40
+			 * @param turista The tourist
41
+			 * @param descuento The discount
42
+			 */
25 43
 			public Realiza (Tour? tour = null, Turista? turista = null, Descuento? descuento = null) {
26 44
 				this.tour = tour;
27 45
 				this.turista = turista;
28 46
 				this.descuento = descuento;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of Realiza
53
+			 */
31 54
 			public static Realiza[]? get_all_realizas(Database conn) {
32 55
 				var res = conn.exec ("
33 56
 SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,

+ 19
- 0
lib/db/region.vala View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Region class based on the database table
22
+		 */
20 23
 		public class Region : GLib.Object {
24
+			/**
25
+			 * The id of the region
26
+			 */
21 27
 			public uint id_region { get; set; default = 0; }
28
+			/**
29
+			 * The name of the region
30
+			 */
22 31
 			public string nombre_region { get; set; default = ""; }
23 32
 
33
+			/**
34
+			 * Initialize the Region class
35
+			 * @param id_region The region id
36
+			 * @param nombre_region The region name
37
+			 */
24 38
 			public Region (uint id_region = 0, string nombre_region = "") {
25 39
 				this.id_region = id_region;
26 40
 				this.nombre_region = nombre_region;
27 41
 			}
28 42
 
43
+			/**
44
+			 * Get all tuples and fields from database
45
+			 * @param conn The database connection to use
46
+			 * @return Returns an array of Region
47
+			 */
29 48
 			public static Region[]? get_all_regiones(Database conn) {
30 49
 				var res = conn.exec ("
31 50
 SELECT id_region, nombre_region FROM region

+ 23
- 0
lib/db/requerir_auto.vala View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The RequerirAuto class based on the database table
22
+		 */
20 23
 		public class RequerirAuto : GLib.Object {
24
+			/**
25
+			 * The chofer
26
+			 */
21 27
 			public string chofer { get; set; default = ""; }
28
+			/**
29
+			 * The tour
30
+			 */
22 31
 			public Tour tour { get; set; default = null; }
32
+			/**
33
+			 * The vehicle
34
+			 */
23 35
 			public Vehiculo vehiculo { get; set; default = null; }
24 36
 
37
+			/**
38
+			 * Initialize the RequerirAuto class
39
+			 * @param chofer The chofer
40
+			 * @param tour The tour
41
+			 * @param vehiculo The vehicle
42
+			 */
25 43
 			public RequerirAuto (string chofer = "", Tour? tour = null, Vehiculo? vehiculo = null) {
26 44
 				this.chofer = chofer;
27 45
 				this.tour = tour;
28 46
 				this.vehiculo = vehiculo;
29 47
 			}
30 48
 
49
+			/**
50
+			 * Get all tuples and fields from database
51
+			 * @param conn The database connection to use
52
+			 * @return Returns an array of RequerirAuto
53
+			 */
31 54
 			public static RequerirAuto[]? get_all_requerir_autos(Database conn) {
32 55
 				var res = conn.exec ("
33 56
 SELECT R.chofer,

+ 19
- 0
lib/db/tiene_enfermedad.vala View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The TieneEnfermedad class based on the database table
22
+		 */
20 23
 		public class TieneEnfermedad : GLib.Object {
24
+			/**
25
+			 * The tourist
26
+			 */
21 27
 			public Turista turista { get; set; default = null; }
28
+			/**
29
+			 * The illness
30
+			 */
22 31
 			public Enfermedad enfermedad { get; set; default = null; }
23 32
 
33
+			/**
34
+			 * Initialize the TieneEnfermedad class
35
+			 * @param turista The tourist
36
+			 * @param enfermedad The illness
37
+			 */
24 38
 			public TieneEnfermedad (Turista? turista = null, Enfermedad? enfermedad = null) {
25 39
 				this.turista = turista;
26 40
 				this.enfermedad = enfermedad;
27 41
 			}
28 42
 
43
+			/**
44
+			 * Get all tuples and fields from database
45
+			 * @param conn The database connection to use
46
+			 * @return Returns an array of TieneEnfermedad
47
+			 */
29 48
 			public static TieneEnfermedad[]? get_all_tiene_enfermedades(Database conn) {
30 49
 				var res = conn.exec ("
31 50
 SELECT T.rut_turista, T.nombre_turista, T.fecha_nacimento,

+ 35
- 0
lib/db/tour.vala View File

@@ -17,14 +17,44 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Tour class based on the database table
22
+		 */
20 23
 		public class Tour : GLib.Object {
24
+			/**
25
+			 * The tour id
26
+			 */
21 27
 			public uint id_tour { get; set; default = 0; }
28
+			/**
29
+			 * The tour name
30
+			 */
22 31
 			public string nombre_tour { get; set; default = ""; }
32
+			/**
33
+			 * The individual cost
34
+			 */
23 35
 			public uint costo_indiv { get; set; default = 0; }
36
+			/**
37
+			 * The group cost
38
+			 */
24 39
 			public uint costo_grupal { get; set; default = 0; }
40
+			/**
41
+			 * The minimum number of people
42
+			 */
25 43
 			public uint minima_personas { get; set; default = 0; }
44
+			/**
45
+			 * The city
46
+			 */
26 47
 			public Ciudad ciudad { get; set; default = null; }
27 48
 
49
+			/**
50
+			 * Initialize the Tour class
51
+			 * @param id_tour The tour id
52
+			 * @param nombre_tour The tour name
53
+			 * @param costo_indiv The individual cost
54
+			 * @param costo_grupal The group cost
55
+			 * @param minima_personas The minimum number of people
56
+			 * @param ciudad The city
57
+			 */
28 58
 			public Tour (uint id_tour = 0, string nombre_tour = "", uint costo_indiv = 0, uint costo_grupal = 0, uint minima_personas = 0, Ciudad? ciudad = null) {
29 59
 				this.id_tour = id_tour;
30 60
 				this.nombre_tour = nombre_tour;
@@ -34,6 +64,11 @@ namespace LibSernatur {
34 64
 				this.ciudad = ciudad;
35 65
 			}
36 66
 
67
+			/**
68
+			 * Get all tuples and fields from database
69
+			 * @param conn The database connection to use
70
+			 * @return Returns an array of Tour
71
+			 */
37 72
 			public static Tour[]? get_all_tours(Database conn) {
38 73
 				var res = conn.exec ("
39 74
 SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,

+ 28
- 0
lib/db/turista.vala View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Turista class based on the database table
22
+		 */
20 23
 		public class Turista : GLib.Object {
24
+			/**
25
+			 * The RUT of the tourist
26
+			 */
21 27
 			public string rut_turista { get; set; default = ""; }
28
+			/**
29
+			 * The tourist name
30
+			 */
22 31
 			public string nombre_turista { get; set; default = ""; }
32
+			/**
33
+			 * The birth date of the tourist
34
+			 */
23 35
 			public string fecha_nacimento { get; set; default = ""; }
36
+			/**
37
+			 * The emergency contact
38
+			 */
24 39
 			public ContactoEmergencia contacto_emergencia { get; set; default = null; }
25 40
 
41
+			/**
42
+			 * Initilize the Turista class
43
+			 * @param rut_turista The RUT of the tourist
44
+			 * @param nombre_turista The tourist name
45
+			 * @param fecha_nacimento The birth date of the tourist
46
+			 * @param contacto_emergencia The emergency contact
47
+			 */
26 48
 			public Turista (string rut_turista = "", string nombre_turista = "", string fecha_nacimento = "", ContactoEmergencia? contacto_emergencia = null) {
27 49
 				this.rut_turista = rut_turista;
28 50
 				this.nombre_turista = nombre_turista;
@@ -30,6 +52,12 @@ namespace LibSernatur {
30 52
 				this.contacto_emergencia = contacto_emergencia;
31 53
 			}
32 54
 
55
+
56
+			/**
57
+			 * Get all tuples and fields from database
58
+			 * @param conn The database connection to use
59
+			 * @return Returns an array of Turista
60
+			 */
33 61
 			public static Turista[]? get_all_turistas(Database conn) {
34 62
 				var res = conn.exec ("
35 63
 SELECT T.rut_turista, T.nombre_turista, T.fecha_nacimento,

+ 27
- 0
lib/db/vehiculo.vala View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
17 17
 		using Postgres;
18 18
 		using Wrapper;
19 19
 
20
+		/**
21
+		 * The Vehiculo class based on the database table
22
+		 */
20 23
 		public class Vehiculo : GLib.Object {
24
+			/**
25
+			 * The license plate
26
+			 */
21 27
 			public string patente { get; set; default = ""; }
28
+			/**
29
+			 * The year of the vehicle
30
+			 */
22 31
 			public uint ano_vehiculo { get; set; default = 0; }
32
+			/**
33
+			 * The make of the vehicle
34
+			 */
23 35
 			public string marca { get; set; default = ""; }
36
+			/**
37
+			 * The capacity of the vehicle
38
+			 */
24 39
 			public uint capacidad { get; set; default = 0; }
25 40
 
41
+			/**
42
+			 * Initialize the Vehiculo class
43
+			 * @param patente The license plate
44
+			 * @param ano_vehiculo The year of the vehicle
45
+			 * @param marca The make of the vehicle
46
+			 * @param capacidad The capacity of the vehicle
47
+			 */
26 48
 			public Vehiculo (string patente = "", uint ano_vehiculo = 0, string marca = "", uint capacidad = 0) {
27 49
 				this.patente = patente;
28 50
 				this.ano_vehiculo = ano_vehiculo;
@@ -30,6 +52,11 @@ namespace LibSernatur {
30 52
 				this.capacidad = capacidad;
31 53
 			}
32 54
 
55
+			/**
56
+			 * Get all tuples and fields from database
57
+			 * @param conn The database connection to use
58
+			 * @return Returns an array of Vehiculo
59
+			 */
33 60
 			public static Vehiculo[]? get_all_vehiculos(Database conn) {
34 61
 				var res = conn.exec ("
35 62
 SELECT patente, ano_vehiculo, marca, capacidad FROM vehiculo

+ 70
- 0
lib/dbwrapper.vala View File

@@ -12,6 +12,9 @@
12 12
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 13
  */
14 14
 
15
+/**
16
+ * The main sernatur library namespace
17
+ */
15 18
 namespace LibSernatur {
16 19
 	/**
17 20
 	 * This is the database namespace for Sernatur
@@ -23,49 +26,116 @@ namespace LibSernatur {
23 26
 		namespace Wrapper {
24 27
 			using Postgres;
25 28
 
29
+			/**
30
+			 * The errors that can be thrown by fields in the database
31
+			 */
26 32
 			public errordomain Field {
27 33
 				NOTFOUND
28 34
 			}
29 35
 
36
+			/**
37
+			 * This is a wrapper for Postgresql results
38
+			 */
30 39
 			public class ResultWrapper : GLib.Object {
40
+				/**
41
+				 * The result that this is wrapped around
42
+				 */
31 43
 				public unowned Result result { get; set; default = null; }
32 44
 
45
+				/**
46
+				 * Initialize the result wrapper
47
+				 * @param result The result to wrap around
48
+				 */
33 49
 				public ResultWrapper (Result? result = null) {
34 50
 					this.result = result;
35 51
 				}
36 52
 
53
+				/**
54
+				 * Return the string value based on tuple and field number
55
+				 * @param tup_num The tuple number
56
+				 * @param field_num The field number
57
+				 * @return Returns a string of the value
58
+				 */
37 59
 				public string get_string_v (int tup_num, int field_num) {
38 60
 					return result.get_value (tup_num, field_num);
39 61
 				}
40 62
 
63
+				/**
64
+				 * Return the int value based on tuple and field number
65
+				 * @param tup_num The tuple number
66
+				 * @param field_num The field number
67
+				 * @return Returns an int of the value
68
+				 */
41 69
 				public int get_int_v (int tup_num, int field_num) {
42 70
 					return int.parse (result.get_value (tup_num, field_num));
43 71
 				}
44 72
 
73
+				/**
74
+				 * Return the float value based on tuple and field number
75
+				 * @param tup_num The tuple number
76
+				 * @param field_num The field number
77
+				 * @return Returns a float of the value
78
+				 */
45 79
 				public float get_float_v (int tup_num, int field_num) {
46 80
 					return float.parse(result.get_value (tup_num, field_num));
47 81
 				}
48 82
 
83
+				/**
84
+				 * Return the double value based on tuple and field number
85
+				 * @param tup_num The tuple number
86
+				 * @param field_num The field number
87
+				 * @return Returns a double of the value
88
+				 */
49 89
 				public double get_double_v (int tup_num, int field_num) {
50 90
 					return double.parse (result.get_value (tup_num, field_num));
51 91
 				}
52 92
 
93
+				/**
94
+				 * Return the string value based on tuple number and field name
95
+				 * @param tup_num The tuple number
96
+				 * @param name The field name
97
+				 * @return Returns a string of the value
98
+				 */
53 99
 				public string get_string_n (int tup_num, string name) throws Field {
54 100
 					return get_string_v (tup_num, check_field_found (result.get_field_number (name), name));
55 101
 				}
56 102
 
103
+				/**
104
+				 * Return the int value based on tuple number and field name
105
+				 * @param tup_num The tuple number
106
+				 * @param name The field name
107
+				 * @return Returns an int of the value
108
+				 */
57 109
 				public int get_int_n (int tup_num, string name) throws Field {
58 110
 					return get_int_v (tup_num, check_field_found (result.get_field_number (name), name));
59 111
 				}
60 112
 
113
+				/**
114
+				 * Return the float value based on tuple number and field name
115
+				 * @param tup_num The tuple number
116
+				 * @param name The field name
117
+				 * @return Returns a float of the value
118
+				 */
61 119
 				public float get_float_n (int tup_num, string name) throws Field {
62 120
 					return get_float_v (tup_num, check_field_found (result.get_field_number (name), name));
63 121
 				}
64 122
 
123
+				/**
124
+				 * Return the double value based on tuple number and field name
125
+				 * @param tup_num The tuple number
126
+				 * @param name The field name
127
+				 * @return Returns a double of the value
128
+				 */
65 129
 				public double get_double_n (int tup_num, string name) throws Field {
66 130
 					return get_double_v (tup_num, check_field_found (result.get_field_number (name), name));
67 131
 				}
68 132
 
133
+				/**
134
+				 * Check if the field is found in the results, if not throw a Field error
135
+				 * @param field_num The field number to check for
136
+				 * @param name The field name we were looking for
137
+				 * @return The field number that corresponds to the field name
138
+				 */
69 139
 				private int check_field_found (int field_num, string name) throws Field {
70 140
 					if (field_num == -1) {
71 141
 						throw new Field.NOTFOUND (dgettext (null, "The field %s was not found in the query results!"), name);

+ 63
- 0
lib/rut.vala View File

@@ -15,26 +15,69 @@
15 15
 namespace LibSernatur {
16 16
 	namespace Person {
17 17
 
18
+		/**
19
+		 * The errors that can be thrown by the Rut class
20
+		 */
18 21
 		public errordomain InvalidRut {
22
+			/**
23
+			 * The RUT is invalid
24
+			 */
19 25
 			INVALID,
26
+			/**
27
+			 * The RUT is too large, larger than 100.000.000
28
+			 */
20 29
 			TOOLARGE,
30
+			/**
31
+			 * The verifier is incorrect
32
+			 */
21 33
 			INVALIDVERIFIER
22 34
 		}
23 35
 
36
+		/**
37
+		 * This class handles parsing and validation of RUTs
38
+		 */
24 39
 		public class Rut : GLib.Object {
40
+			/**
41
+			 * The cleaned RUT
42
+			 */
25 43
 			private string clean_rut;
44
+			/**
45
+			 * The pretty RUT, e.g. with periods and dash
46
+			 */
26 47
 			private string pretty_rut;
48
+			/**
49
+			 * The verifier
50
+			 */
27 51
 			private unichar verifier;
28 52
 
53
+			/**
54
+			 * The type of identifier
55
+			 */
29 56
 			public enum Type {
57
+				/**
58
+				 * Company
59
+				 */
30 60
 				RUN,
61
+				/**
62
+				 * Person
63
+				 */
31 64
 				RUT
32 65
 			}
33 66
 
67
+			/**
68
+			 * Initialize the Rut class
69
+			 * @param rut The RUT to parse
70
+			 * @throws InvalidRut Thrown if the RUT is invalid in any way
71
+			 */
34 72
 			public Rut (string rut) throws InvalidRut {
35 73
 				parse (rut);
36 74
 			}
37 75
 
76
+			/**
77
+			 * Parse the rut that was passed to the constructor
78
+			 * @param rut The RUT to parse
79
+			 * @throws InvalidRut Thrown if the RUT is invalid in any way
80
+			 */
38 81
 			private void parse (string rut) throws InvalidRut {
39 82
 				try {
40 83
 					var regex = new Regex ("^[ ]*([0-9.]{0,11}[\\-]?[0-9kK])?[ ]*$");
@@ -73,6 +116,9 @@ namespace LibSernatur {
73 116
 				}
74 117
 			}
75 118
 
119
+			/**
120
+			 * Add periods and dash to the RUT to make it look pretty
121
+			 */
76 122
 			private void pretty () {
77 123
 				string new_rut = "";
78 124
 				string temp_rut = this.clean_rut.reverse ();
@@ -87,6 +133,11 @@ namespace LibSernatur {
87 133
 				this.pretty_rut = new_rut + "-" + this.verifier.to_string ();
88 134
 			}
89 135
 
136
+			/**
137
+			 * Generate a verifier based off the RUT
138
+			 * @param rut The RUT used to generate the verifier
139
+			 * @return Returns the verifier
140
+			 */
90 141
 			private unichar generate_verfifier (string rut) {
91 142
 				/**
92 143
 				 * 1. Multiply each digit of the RUT by 2, 3, ..., 7, 2, 3, ... from the end of the RUT moving forward.
@@ -130,14 +181,26 @@ namespace LibSernatur {
130 181
 				}
131 182
 			}
132 183
 
184
+			/**
185
+			 * Get the clean RUT
186
+			 * @return Returns the cleaned up RUT
187
+			 */
133 188
 			public string get_clean_rut () {
134 189
 				return this.clean_rut + this.verifier.to_string ();
135 190
 			}
136 191
 
192
+			/**
193
+			 * Get the RUT
194
+			 * @return Returns the RUT with periods and dash
195
+			 */
137 196
 			public string get_rut () {
138 197
 				return this.pretty_rut;
139 198
 			}
140 199
 
200
+			/**
201
+			 * Check the type of identifier
202
+			 * @return Returns the type of identifier, Type.RUT if it's a company or Type.RUN if it's a person
203
+			 */
141 204
 			public Type type () {
142 205
 				uint rut = int.parse (this.clean_rut);
143 206
 				if (rut < 100000000 && rut > 50000000) {

+ 6
- 0
src/config.vala.in View File

@@ -14,7 +14,13 @@
14 14
 
15 15
 namespace Sernatur {
16 16
 	namespace Constants {
17
+		/**
18
+		 * The package name used for translations
19
+		 */
17 20
 		public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
21
+		/**
22
+		 * The version of the application
23
+		 */
18 24
 		public const string VERSION = "@VERSION@";
19 25
 	}
20 26
 }

+ 21
- 4
src/main_window.vala View File

@@ -12,9 +12,6 @@
12 12
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 13
  */
14 14
 
15
-/**
16
- * The main Sernatur namespace
17
- */
18 15
 namespace Sernatur {
19 16
 	using LibSernatur.Person;
20 17
 	using LibSernatur.DB;
@@ -24,12 +21,24 @@ namespace Sernatur {
24 21
 	 */
25 22
 	[GtkTemplate (ui = "/cl/cromer/ubb/sernatur/main.window.ui")]
26 23
 	public class MainWindow : Gtk.ApplicationWindow {
24
+		/**
25
+		 * The opened database connection
26
+		 */
27 27
 		private Postgres.Database conn;
28
-
28
+		/**
29
+		 * The content grid to fill
30
+		 */
29 31
 		private Gtk.Grid content;
32
+		/**
33
+		 * The mainbox of the window
34
+		 */
30 35
 		[GtkChild]
31 36
 		private Gtk.Box mainbox;
32 37
 
38
+		/**
39
+		 * This is a callback for when the close button is pressed on the window
40
+		 * @param widget The widget that called this GtkCallback
41
+		 */
33 42
 		[GtkCallback]
34 43
 		private void window_quit(Gtk.Widget widget) {
35 44
 			application.quit ();
@@ -75,6 +84,10 @@ namespace Sernatur {
75 84
 			return false;
76 85
 		}
77 86
 
87
+		/**
88
+		 * This is a callback for when the tours option in the menu is clicked
89
+		 * @param menu_item The menu item that was clicked
90
+		 */
78 91
 		[GtkCallback]
79 92
 		private void menu_tours(Gtk.MenuItem menu_item) {
80 93
 			var tour_window = new TourWindow (application, conn);
@@ -82,6 +95,10 @@ namespace Sernatur {
82 95
 			tour_window.show_all ();
83 96
 		}
84 97
 
98
+		/**
99
+		 * This is a callback for when the quit option in the menu is clicked
100
+		 * @param menu_item The menu item that was clicked
101
+		 */
85 102
 		[GtkCallback]
86 103
 		private void menu_quit(Gtk.MenuItem menu_item) {
87 104
 			application.quit ();

+ 7
- 8
src/sernatur.vala View File

@@ -18,9 +18,13 @@
18 18
 namespace Sernatur {
19 19
 	using Constants;
20 20
 	using Gtk;
21
-
21
+	/**
22
+	 * If version is passed as an option on the console line
23
+	 */
22 24
 	private static bool version = false;
23
-
25
+	/**
26
+	 * The valid options that can be used on the console line
27
+	 */
24 28
 	private const GLib.OptionEntry[] options = {
25 29
 		{ "version", 'v', 0, OptionArg.NONE, ref version, "Display version number", null },
26 30
 		{ null }
@@ -31,11 +35,6 @@ namespace Sernatur {
31 35
 	 */
32 36
 	public class Application : global::Gtk.Application {
33 37
 		/**
34
-		 * The main application window
35
-		 */
36
-		private MainWindow window;
37
-
38
-		/**
39 38
 		 * Initialize the application
40 39
 		 */
41 40
 		public Application () {
@@ -46,7 +45,7 @@ namespace Sernatur {
46 45
 		 * Run when the application is activated
47 46
 		 */
48 47
 		public override void activate () {
49
-			window = new MainWindow (this);
48
+			var window = new MainWindow (this);
50 49
 			var settings = new GLib.Settings ("cl.cromer.ubb.sernatur.window");
51 50
 
52 51
 			window.set_default_size (settings.get_int("width"), settings.get_int("height"));

+ 43
- 7
src/tour_window.vala View File

@@ -12,9 +12,6 @@
12 12
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 13
  */
14 14
 
15
-/**
16
- * The main Sernatur namespace
17
- */
18 15
 namespace Sernatur {
19 16
 	using LibSernatur.Person;
20 17
 	using LibSernatur.DB;
@@ -24,24 +21,62 @@ namespace Sernatur {
24 21
 	 */
25 22
 	[GtkTemplate (ui = "/cl/cromer/ubb/sernatur/tour.window.ui")]
26 23
 	public class TourWindow : Gtk.ApplicationWindow {
24
+		/**
25
+		 * The open database connection
26
+		 */
27 27
 		private unowned Postgres.Database conn;
28
-
28
+		/**
29
+		 * The columns of the tree view
30
+		 */
29 31
 		private enum Columns {
32
+			/**
33
+			 * The toggle
34
+			 */
30 35
 			TOGGLE,
36
+			/**
37
+			 * The tour name
38
+			 */
31 39
 			TOUR_NAME,
40
+			/**
41
+			 * The individual cost
42
+			 */
32 43
 			INDIV_COST,
44
+			/**
45
+			 * The group cost
46
+			 */
33 47
 			GROUP_COST,
48
+			/**
49
+			 * The minimum people
50
+			 */
34 51
 			MINIMUM_PEOPLE,
52
+			/**
53
+			 * The name of the city
54
+			 */
35 55
 			CITY,
56
+			/**
57
+			 * The name of the region
58
+			 */
36 59
 			REGION,
60
+			/**
61
+			 * The number of colums in this enum
62
+			 */
37 63
 			N_COLUMNS
38 64
 		}
39
-
65
+		/**
66
+		 * The list that stores the contents in the tree view
67
+		 */
40 68
 		private Gtk.ListStore list_store;
41
-
69
+		/**
70
+		 * The tree view widget
71
+		 */
42 72
 		[GtkChild]
43 73
 		private Gtk.TreeView tour_tree;
44 74
 
75
+		/**
76
+		 * This callback is called when the user clicks a radio button next to a row
77
+		 * @param toggle The toggle clicked
78
+		 * @param path The row clicked
79
+		 */
45 80
 		[GtkCallback]
46 81
 		private void toggled(Gtk.CellRendererToggle toggle, string path) {
47 82
 			Gtk.TreeModelForeachFunc deselect_all = (model, path, iter) => {
@@ -65,8 +100,9 @@ namespace Sernatur {
65 100
 		}
66 101
 
67 102
 		/**
68
-		* Initialize the main window class
103
+		* Initialize the tour window class
69 104
 		* @param application The application used to make the GLib object
105
+		* @param conn The database connection to use
70 106
 		*/
71 107
 		public TourWindow (Gtk.Application application, Postgres.Database conn) {
72 108
 			GLib.Object (application: application);

Loading…
Cancel
Save