From f72d65e6cb8aa1d1003d9b1970b43d0dff9fc2f7 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 5 Aug 2020 14:56:30 -0400 Subject: [PATCH] cleanup files --- README.md | 4 ++-- data/polkit/org.tuf.manager.policy.in | 4 ++-- meson.build | 2 +- po/POTFILES | 4 ++-- src/cli.vala | 20 ++++++++++---------- src/common.vala | 22 +++++++++++----------- src/error.vala | 3 +++ src/gui-window.vala | 4 ++-- 8 files changed, 33 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 1090e47..b683676 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ ## Screenshots - + - + ## Build requirements To build TUF Manager the following is needed: diff --git a/data/polkit/org.tuf.manager.policy.in b/data/polkit/org.tuf.manager.policy.in index 2556f80..348f486 100644 --- a/data/polkit/org.tuf.manager.policy.in +++ b/data/polkit/org.tuf.manager.policy.in @@ -1,7 +1,7 @@ + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> TUF Manager https://git.cromer.cl/cromer/tuf-manager/ diff --git a/meson.build b/meson.build index 088b7ad..fcd918c 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project( ], version: '0.1.0', license: 'BSD-3', - default_options: + default_options: [ 'b_ndebug=if-release', 'c_std=c18', diff --git a/po/POTFILES b/po/POTFILES index 6abbf0e..aa4a0e7 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,7 +1,7 @@ src/cli.vala +src/common.vala src/config.vala.in src/error.vala -src/common.vala src/gui.vala src/gui-window.vala src/main.vala.in @@ -9,6 +9,6 @@ src/server.vala src/server-interface.vala src/server-main.vala data/tuf-manager.desktop.in -data/polkit/org.tuf.manager.policy.in data/gschema/org.tuf.manager.gschema.xml +data/polkit/org.tuf.manager.policy.in data/ui/tuf.manager.window.ui diff --git a/src/cli.vala b/src/cli.vala index 5fc5a8e..32a8d96 100644 --- a/src/cli.vala +++ b/src/cli.vala @@ -65,12 +65,12 @@ namespace TUFManager { private bool color = false; private Gdk.RGBA? rgba = null; - + public TUFManagerApp () { Object (application_id: "cl.cromer.tuf.manager", flags: ApplicationFlags.HANDLES_COMMAND_LINE); set_inactivity_timeout (1000); } - + public override void activate () { this.hold (); this.release (); @@ -228,7 +228,7 @@ namespace TUFManager { return 0; } else if (info) { - command_line.print (_ ("Client version: ") + VERSION + "\n"); + command_line.print (_ ("Client version: ") + VERSION + "\n"); command_line.print (_ ("Server version: ") + get_server_version () + "\n"); var current_setting = get_fan_mode (); switch (current_setting) { @@ -308,7 +308,7 @@ namespace TUFManager { } #endif - return 0; + return 0; } else if (lighting) { #if ALWAYS_AUTHENTICATED @@ -318,7 +318,7 @@ namespace TUFManager { #else try { pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE); - + Timeout.add (200, () => { int mode = keyboard_mode; tuf_server.procedure_finished.connect (release_cli); @@ -330,7 +330,7 @@ namespace TUFManager { command_line.printerr (_ ("Error: ") + e.message + "\n"); } #endif - return 0; + return 0; } else if (speed) { #if ALWAYS_AUTHENTICATED @@ -340,7 +340,7 @@ namespace TUFManager { #else try { pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE); - + Timeout.add (200, () => { int set_speed = keyboard_speed; tuf_server.procedure_finished.connect (release_cli); @@ -352,7 +352,7 @@ namespace TUFManager { command_line.printerr (_ ("Error: ") + e.message + "\n"); } #endif - return 0; + return 0; } else if (color) { #if ALWAYS_AUTHENTICATED @@ -361,7 +361,7 @@ namespace TUFManager { #else try { pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE); - + Timeout.add (200, () => { tuf_server.procedure_finished.connect (release_cli); set_keyboard_color (rgba); @@ -372,7 +372,7 @@ namespace TUFManager { command_line.printerr (_ ("Error: ") + e.message + "\n"); } #endif - return 0; + return 0; } return 0; } diff --git a/src/common.vala b/src/common.vala index c18d32e..2a666d6 100644 --- a/src/common.vala +++ b/src/common.vala @@ -52,11 +52,11 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } - return -3; + return -3; } private void set_fan_mode (int mode) { @@ -65,7 +65,7 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } @@ -77,7 +77,7 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } @@ -90,7 +90,7 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } @@ -102,11 +102,11 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } - return -3; + return -3; } private void set_keyboard_mode (int mode) { @@ -115,7 +115,7 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } @@ -127,11 +127,11 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } - return -3; + return -3; } private void set_keyboard_speed (int speed) { @@ -140,7 +140,7 @@ namespace TUFManager { } catch (TUFError e) { stderr.printf ("Error: %s\n", e.message); - } + } catch (Error e) { stderr.printf ("Error: %s\n", e.message); } diff --git a/src/error.vala b/src/error.vala index 5102d35..1c91436 100644 --- a/src/error.vala +++ b/src/error.vala @@ -36,6 +36,9 @@ namespace TUFManager { * The client and serer version don't match */ UNMATCHED_VERSIONS, + /** + * The user is unauthorized to perform that action + */ UNAUTHORIZED } } diff --git a/src/gui-window.vala b/src/gui-window.vala index 02731be..ce2324e 100644 --- a/src/gui-window.vala +++ b/src/gui-window.vala @@ -79,7 +79,7 @@ namespace TUFManager { } } finally { - print (_ ("Client version: ") + VERSION + "\n"); + print (_ ("Client version: ") + VERSION + "\n"); print (_ ("Server version: ") + get_server_version () + "\n"); if (settings.get_boolean ("restore")) { @@ -181,7 +181,7 @@ namespace TUFManager { /** * Called when the user changes the fan mode - * + * * * 1 - normal mode * * 2 - boost mode * * 3 - silent mode