From a1c05d93bbb3c1bdb0c0fed9d7110804037cfd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 May 2015 07:25:37 +0200 Subject: Imported Upstream version 0.6.2 --- src/deamon.vala | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'src/deamon.vala') diff --git a/src/deamon.vala b/src/deamon.vala index ff7e764..a35e666 100644 --- a/src/deamon.vala +++ b/src/deamon.vala @@ -31,12 +31,19 @@ public class Deamon : GLib.Object { public static string version; + ///////////////////////////////////////////////////////////////////// + /// Varaibles set by the commend line parser. + ///////////////////////////////////////////////////////////////////// + + public static bool header_bar = false; + public static bool stack_switcher = false; + ///////////////////////////////////////////////////////////////////// /// The beginning of everything. ///////////////////////////////////////////////////////////////////// public static int main(string[] args) { - version = "0.6.1"; + version = "0.6.2"; Logger.init(); Gtk.init(ref args); @@ -71,6 +78,10 @@ public class Deamon : GLib.Object { "Open the Pie with the given ID", "ID" }, { "reset", 'r', 0, GLib.OptionArg.NONE, out reset, "Reset all options to default values" }, + { "header-bar", 'b', 0, GLib.OptionArg.NONE, out header_bar, + "Uses the new GTK.HeaderBar" }, + { "stack-switcher", 's', 0, GLib.OptionArg.NONE, out stack_switcher, + "Uses the new GTK.StackSwitcher" }, { null } }; @@ -102,24 +113,25 @@ public class Deamon : GLib.Object { Intl.bindtextdomain ("gnomepie", Paths.locales); Intl.textdomain ("gnomepie"); - // init toolkits and static stuff - ActionRegistry.init(); - GroupRegistry.init(); + if (handle_command_line(args, false)) { + + // init toolkits and static stuff + ActionRegistry.init(); + GroupRegistry.init(); - PieManager.init(); - Icon.init(); + PieManager.init(); + Icon.init(); - // launch the indicator - this.indicator = new Indicator(); + // launch the indicator + this.indicator = new Indicator(); - // connect SigHandlers - Posix.signal(Posix.SIGINT, sig_handler); - Posix.signal(Posix.SIGTERM, sig_handler); + // connect SigHandlers + Posix.signal(Posix.SIGINT, sig_handler); + Posix.signal(Posix.SIGTERM, sig_handler); - // finished loading... so run the prog! - message("Started happily..."); + // finished loading... so run the prog! + message("Started happily..."); - if (handle_command_line(args, false)) { Gtk.main(); } }); @@ -143,10 +155,9 @@ public class Deamon : GLib.Object { private bool handle_command_line(string[] args, bool show_preferences) { // create command line options - var context = new GLib.OptionContext(""); - context.set_help_enabled(true); + var context = new GLib.OptionContext(" - the pie menu for linux"); context.add_main_entries(options, null); - context.add_group(Gtk.get_option_group (false)); + context.add_group(Gtk.get_option_group(false)); try { context.parse(ref args); -- cgit v1.2.3