update valadocs
This commit is contained in:
@@ -14,7 +14,13 @@
|
||||
|
||||
namespace Sernatur {
|
||||
namespace Constants {
|
||||
/**
|
||||
* The package name used for translations
|
||||
*/
|
||||
public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
|
||||
/**
|
||||
* The version of the application
|
||||
*/
|
||||
public const string VERSION = "@VERSION@";
|
||||
}
|
||||
}
|
||||
|
@@ -12,9 +12,6 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The main Sernatur namespace
|
||||
*/
|
||||
namespace Sernatur {
|
||||
using LibSernatur.Person;
|
||||
using LibSernatur.DB;
|
||||
@@ -24,12 +21,24 @@ namespace Sernatur {
|
||||
*/
|
||||
[GtkTemplate (ui = "/cl/cromer/ubb/sernatur/main.window.ui")]
|
||||
public class MainWindow : Gtk.ApplicationWindow {
|
||||
/**
|
||||
* The opened database connection
|
||||
*/
|
||||
private Postgres.Database conn;
|
||||
|
||||
/**
|
||||
* The content grid to fill
|
||||
*/
|
||||
private Gtk.Grid content;
|
||||
/**
|
||||
* The mainbox of the window
|
||||
*/
|
||||
[GtkChild]
|
||||
private Gtk.Box mainbox;
|
||||
|
||||
/**
|
||||
* This is a callback for when the close button is pressed on the window
|
||||
* @param widget The widget that called this GtkCallback
|
||||
*/
|
||||
[GtkCallback]
|
||||
private void window_quit(Gtk.Widget widget) {
|
||||
application.quit ();
|
||||
@@ -75,6 +84,10 @@ namespace Sernatur {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a callback for when the tours option in the menu is clicked
|
||||
* @param menu_item The menu item that was clicked
|
||||
*/
|
||||
[GtkCallback]
|
||||
private void menu_tours(Gtk.MenuItem menu_item) {
|
||||
var tour_window = new TourWindow (application, conn);
|
||||
@@ -82,6 +95,10 @@ namespace Sernatur {
|
||||
tour_window.show_all ();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a callback for when the quit option in the menu is clicked
|
||||
* @param menu_item The menu item that was clicked
|
||||
*/
|
||||
[GtkCallback]
|
||||
private void menu_quit(Gtk.MenuItem menu_item) {
|
||||
application.quit ();
|
||||
|
@@ -18,9 +18,13 @@
|
||||
namespace Sernatur {
|
||||
using Constants;
|
||||
using Gtk;
|
||||
|
||||
/**
|
||||
* If version is passed as an option on the console line
|
||||
*/
|
||||
private static bool version = false;
|
||||
|
||||
/**
|
||||
* The valid options that can be used on the console line
|
||||
*/
|
||||
private const GLib.OptionEntry[] options = {
|
||||
{ "version", 'v', 0, OptionArg.NONE, ref version, "Display version number", null },
|
||||
{ null }
|
||||
@@ -30,11 +34,6 @@ namespace Sernatur {
|
||||
* The application class
|
||||
*/
|
||||
public class Application : global::Gtk.Application {
|
||||
/**
|
||||
* The main application window
|
||||
*/
|
||||
private MainWindow window;
|
||||
|
||||
/**
|
||||
* Initialize the application
|
||||
*/
|
||||
@@ -46,7 +45,7 @@ namespace Sernatur {
|
||||
* Run when the application is activated
|
||||
*/
|
||||
public override void activate () {
|
||||
window = new MainWindow (this);
|
||||
var window = new MainWindow (this);
|
||||
var settings = new GLib.Settings ("cl.cromer.ubb.sernatur.window");
|
||||
|
||||
window.set_default_size (settings.get_int("width"), settings.get_int("height"));
|
||||
|
@@ -12,9 +12,6 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The main Sernatur namespace
|
||||
*/
|
||||
namespace Sernatur {
|
||||
using LibSernatur.Person;
|
||||
using LibSernatur.DB;
|
||||
@@ -24,24 +21,62 @@ namespace Sernatur {
|
||||
*/
|
||||
[GtkTemplate (ui = "/cl/cromer/ubb/sernatur/tour.window.ui")]
|
||||
public class TourWindow : Gtk.ApplicationWindow {
|
||||
/**
|
||||
* The open database connection
|
||||
*/
|
||||
private unowned Postgres.Database conn;
|
||||
|
||||
/**
|
||||
* The columns of the tree view
|
||||
*/
|
||||
private enum Columns {
|
||||
/**
|
||||
* The toggle
|
||||
*/
|
||||
TOGGLE,
|
||||
/**
|
||||
* The tour name
|
||||
*/
|
||||
TOUR_NAME,
|
||||
/**
|
||||
* The individual cost
|
||||
*/
|
||||
INDIV_COST,
|
||||
/**
|
||||
* The group cost
|
||||
*/
|
||||
GROUP_COST,
|
||||
/**
|
||||
* The minimum people
|
||||
*/
|
||||
MINIMUM_PEOPLE,
|
||||
/**
|
||||
* The name of the city
|
||||
*/
|
||||
CITY,
|
||||
/**
|
||||
* The name of the region
|
||||
*/
|
||||
REGION,
|
||||
/**
|
||||
* The number of colums in this enum
|
||||
*/
|
||||
N_COLUMNS
|
||||
}
|
||||
|
||||
/**
|
||||
* The list that stores the contents in the tree view
|
||||
*/
|
||||
private Gtk.ListStore list_store;
|
||||
|
||||
/**
|
||||
* The tree view widget
|
||||
*/
|
||||
[GtkChild]
|
||||
private Gtk.TreeView tour_tree;
|
||||
|
||||
/**
|
||||
* This callback is called when the user clicks a radio button next to a row
|
||||
* @param toggle The toggle clicked
|
||||
* @param path The row clicked
|
||||
*/
|
||||
[GtkCallback]
|
||||
private void toggled(Gtk.CellRendererToggle toggle, string path) {
|
||||
Gtk.TreeModelForeachFunc deselect_all = (model, path, iter) => {
|
||||
@@ -65,8 +100,9 @@ namespace Sernatur {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the main window class
|
||||
* Initialize the tour window class
|
||||
* @param application The application used to make the GLib object
|
||||
* @param conn The database connection to use
|
||||
*/
|
||||
public TourWindow (Gtk.Application application, Postgres.Database conn) {
|
||||
GLib.Object (application: application);
|
||||
|
Reference in New Issue
Block a user