cleanup files

This commit is contained in:
Chris Cromer 2020-08-05 14:56:30 -04:00
parent db698f3183
commit f72d65e6cb
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
8 changed files with 33 additions and 30 deletions

View File

@ -5,9 +5,9 @@
## Screenshots ## Screenshots
<img src="screenshot/tuf-gui.png" /> <img src="screenshot/tuf-gui.png" />
<img src="screenshot/tuf-cli.png" /> <img src="screenshot/tuf-cli.png" />
## Build requirements ## Build requirements
To build TUF Manager the following is needed: To build TUF Manager the following is needed:

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC <!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig> <policyconfig>
<vendor>TUF Manager</vendor> <vendor>TUF Manager</vendor>
<vendor_url>https://git.cromer.cl/cromer/tuf-manager/</vendor_url> <vendor_url>https://git.cromer.cl/cromer/tuf-manager/</vendor_url>

View File

@ -6,7 +6,7 @@ project(
], ],
version: '0.1.0', version: '0.1.0',
license: 'BSD-3', license: 'BSD-3',
default_options: default_options:
[ [
'b_ndebug=if-release', 'b_ndebug=if-release',
'c_std=c18', 'c_std=c18',

View File

@ -1,7 +1,7 @@
src/cli.vala src/cli.vala
src/common.vala
src/config.vala.in src/config.vala.in
src/error.vala src/error.vala
src/common.vala
src/gui.vala src/gui.vala
src/gui-window.vala src/gui-window.vala
src/main.vala.in src/main.vala.in
@ -9,6 +9,6 @@ src/server.vala
src/server-interface.vala src/server-interface.vala
src/server-main.vala src/server-main.vala
data/tuf-manager.desktop.in data/tuf-manager.desktop.in
data/polkit/org.tuf.manager.policy.in
data/gschema/org.tuf.manager.gschema.xml data/gschema/org.tuf.manager.gschema.xml
data/polkit/org.tuf.manager.policy.in
data/ui/tuf.manager.window.ui data/ui/tuf.manager.window.ui

View File

@ -65,12 +65,12 @@ namespace TUFManager {
private bool color = false; private bool color = false;
private Gdk.RGBA? rgba = null; private Gdk.RGBA? rgba = null;
public TUFManagerApp () { public TUFManagerApp () {
Object (application_id: "cl.cromer.tuf.manager", flags: ApplicationFlags.HANDLES_COMMAND_LINE); Object (application_id: "cl.cromer.tuf.manager", flags: ApplicationFlags.HANDLES_COMMAND_LINE);
set_inactivity_timeout (1000); set_inactivity_timeout (1000);
} }
public override void activate () { public override void activate () {
this.hold (); this.hold ();
this.release (); this.release ();
@ -228,7 +228,7 @@ namespace TUFManager {
return 0; return 0;
} }
else if (info) { 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"); command_line.print (_ ("Server version: ") + get_server_version () + "\n");
var current_setting = get_fan_mode (); var current_setting = get_fan_mode ();
switch (current_setting) { switch (current_setting) {
@ -308,7 +308,7 @@ namespace TUFManager {
} }
#endif #endif
return 0; return 0;
} }
else if (lighting) { else if (lighting) {
#if ALWAYS_AUTHENTICATED #if ALWAYS_AUTHENTICATED
@ -318,7 +318,7 @@ namespace TUFManager {
#else #else
try { try {
pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE); pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE);
Timeout.add (200, () => { Timeout.add (200, () => {
int mode = keyboard_mode; int mode = keyboard_mode;
tuf_server.procedure_finished.connect (release_cli); tuf_server.procedure_finished.connect (release_cli);
@ -330,7 +330,7 @@ namespace TUFManager {
command_line.printerr (_ ("Error: ") + e.message + "\n"); command_line.printerr (_ ("Error: ") + e.message + "\n");
} }
#endif #endif
return 0; return 0;
} }
else if (speed) { else if (speed) {
#if ALWAYS_AUTHENTICATED #if ALWAYS_AUTHENTICATED
@ -340,7 +340,7 @@ namespace TUFManager {
#else #else
try { try {
pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE); pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE);
Timeout.add (200, () => { Timeout.add (200, () => {
int set_speed = keyboard_speed; int set_speed = keyboard_speed;
tuf_server.procedure_finished.connect (release_cli); tuf_server.procedure_finished.connect (release_cli);
@ -352,7 +352,7 @@ namespace TUFManager {
command_line.printerr (_ ("Error: ") + e.message + "\n"); command_line.printerr (_ ("Error: ") + e.message + "\n");
} }
#endif #endif
return 0; return 0;
} }
else if (color) { else if (color) {
#if ALWAYS_AUTHENTICATED #if ALWAYS_AUTHENTICATED
@ -361,7 +361,7 @@ namespace TUFManager {
#else #else
try { try {
pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE); pkttyagent = new Subprocess.newv ({"pkttyagent"}, SubprocessFlags.NONE);
Timeout.add (200, () => { Timeout.add (200, () => {
tuf_server.procedure_finished.connect (release_cli); tuf_server.procedure_finished.connect (release_cli);
set_keyboard_color (rgba); set_keyboard_color (rgba);
@ -372,7 +372,7 @@ namespace TUFManager {
command_line.printerr (_ ("Error: ") + e.message + "\n"); command_line.printerr (_ ("Error: ") + e.message + "\n");
} }
#endif #endif
return 0; return 0;
} }
return 0; return 0;
} }

View File

@ -52,11 +52,11 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
return -3; return -3;
} }
private void set_fan_mode (int mode) { private void set_fan_mode (int mode) {
@ -65,7 +65,7 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
@ -77,7 +77,7 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
@ -90,7 +90,7 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
@ -102,11 +102,11 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
return -3; return -3;
} }
private void set_keyboard_mode (int mode) { private void set_keyboard_mode (int mode) {
@ -115,7 +115,7 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
@ -127,11 +127,11 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
return -3; return -3;
} }
private void set_keyboard_speed (int speed) { private void set_keyboard_speed (int speed) {
@ -140,7 +140,7 @@ namespace TUFManager {
} }
catch (TUFError e) { catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }
catch (Error e) { catch (Error e) {
stderr.printf ("Error: %s\n", e.message); stderr.printf ("Error: %s\n", e.message);
} }

View File

@ -36,6 +36,9 @@ namespace TUFManager {
* The client and serer version don't match * The client and serer version don't match
*/ */
UNMATCHED_VERSIONS, UNMATCHED_VERSIONS,
/**
* The user is unauthorized to perform that action
*/
UNAUTHORIZED UNAUTHORIZED
} }
} }

View File

@ -79,7 +79,7 @@ namespace TUFManager {
} }
} }
finally { finally {
print (_ ("Client version: ") + VERSION + "\n"); print (_ ("Client version: ") + VERSION + "\n");
print (_ ("Server version: ") + get_server_version () + "\n"); print (_ ("Server version: ") + get_server_version () + "\n");
if (settings.get_boolean ("restore")) { if (settings.get_boolean ("restore")) {
@ -181,7 +181,7 @@ namespace TUFManager {
/** /**
* Called when the user changes the fan mode * Called when the user changes the fan mode
* *
* * 1 - normal mode * * 1 - normal mode
* * 2 - boost mode * * 2 - boost mode
* * 3 - silent mode * * 3 - silent mode