Browse Source

change warning method

master
Chris Cromer 1 year ago
parent
commit
130a131214
Signed by: cromer GPG Key ID: 39CC813FF3C8708A
  1. 149
      po/es.po
  2. 123
      po/tuf-manager.pot
  3. 20
      src/cli.vala
  4. 36
      src/common.vala
  5. 8
      src/gui-window.vala
  6. 4
      src/main.vala.in
  7. 8
      src/server-main.vala
  8. 38
      src/server.vala
  9. 10
      src/tray-icon.vala
  10. 4
      src/tray-main.vala

149
po/es.po

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: tuf-manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-06 20:34-0400\n"
"PO-Revision-Date: 2020-08-06 20:37-0400\n"
"POT-Creation-Date: 2020-08-07 01:13-0400\n"
"PO-Revision-Date: 2020-08-07 01:14-0400\n"
"Last-Translator: Chris Cromer <chris@cromer.cl>\n"
"Language-Team: none\n"
"Language: es\n"
@ -19,135 +19,125 @@ msgstr ""
"X-Generator: Poedit 2.3\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: src/cli.vala:180 src/cli.vala:287 src/cli.vala:344 src/cli.vala:362
#: src/cli.vala:377 src/cli.vala:406 src/cli.vala:429 src/cli.vala:451
#: src/cli.vala:471 src/gui-window.vala:109 src/gui-window.vala:125
#: src/gui-window.vala:135 src/main.vala.in:34 src/server.vala:50
#: src/server-main.vala:92 src/server-main.vala:122
msgid "Error: "
msgstr "Error: "
#: src/cli.vala:322
msgid "Invalid arguments!"
msgstr "¡Argumentos invalidos!"
#: src/cli.vala:314
msgid ""
"Invalid arguments!\n"
"\n"
msgstr "¡Argumentos invalidos!\n"
#: src/cli.vala:320
#: src/cli.vala:328
msgid "Version: "
msgstr "Versión: "
#: src/cli.vala:330 src/gui-window.vala:95
#: src/cli.vala:338 src/gui-window.vala:95
msgid "Client version: "
msgstr "Versión del cliente: "
#: src/cli.vala:331 src/gui-window.vala:96
#: src/cli.vala:339 src/gui-window.vala:96
msgid "Server version: "
msgstr "Versión del servidor: "
#: src/cli.vala:335 src/cli.vala:338 src/cli.vala:341 src/gui-window.vala:106
#: src/cli.vala:343 src/cli.vala:346 src/cli.vala:349 src/gui-window.vala:106
#: src/gui-window.vala:160
msgid "Current fan mode: "
msgstr "Modo de ventilador actual: "
#: src/cli.vala:335
#: src/cli.vala:343
msgid "Balanced\n"
msgstr "Balanceada\n"
#: src/cli.vala:338
#: src/cli.vala:346
msgid "Turbo\n"
msgstr "Turbo\n"
#: src/cli.vala:341
#: src/cli.vala:349
msgid "Silent\n"
msgstr "Silenciosa\n"
#: src/cli.vala:344
msgid "Could not get current fan mode!\n"
msgstr "¡No se pudo obtener el modo de ventilador actual!\n"
#: src/cli.vala:352 src/gui-window.vala:109
msgid "Could not get current fan mode!"
msgstr "¡No se pudo obtener el modo de ventilador actual!"
#: src/cli.vala:350 src/cli.vala:353 src/cli.vala:356 src/cli.vala:359
#: src/cli.vala:358 src/cli.vala:361 src/cli.vala:364 src/cli.vala:367
msgid "Current keyboard lighting: "
msgstr "Iluminación de teclado actual: "
#: src/cli.vala:350
#: src/cli.vala:358
msgid "Static\n"
msgstr "Estática\n"
#: src/cli.vala:353
#: src/cli.vala:361
msgid "Breathing\n"
msgstr "Respiración\n"
#: src/cli.vala:356
#: src/cli.vala:364
msgid "Color Cycle\n"
msgstr "Ciclo de Color\n"
#: src/cli.vala:359
#: src/cli.vala:367
msgid "Strobing\n"
msgstr "Estroboscópica\n"
#: src/cli.vala:362
msgid "Could not get current keyboard mode!\n"
msgstr "¡No se pudo obtener el modo de teclado actual!\n"
#: src/cli.vala:370 src/gui-window.vala:125
msgid "Could not get current keyboard mode!"
msgstr "¡No se pudo obtener el modo de teclado actual!"
#: src/cli.vala:368 src/cli.vala:371 src/cli.vala:374 src/gui-window.vala:132
#: src/cli.vala:376 src/cli.vala:379 src/cli.vala:382 src/gui-window.vala:132
#: src/gui-window.vala:184
msgid "Current keyboard speed: "
msgstr "Velocidad del teclado actual: "
#: src/cli.vala:368
#: src/cli.vala:376
msgid "Slow\n"
msgstr "Lenta\n"
#: src/cli.vala:371
#: src/cli.vala:379
msgid "Medium\n"
msgstr "Media\n"
#: src/cli.vala:374
#: src/cli.vala:382
msgid "Fast\n"
msgstr "Rapida\n"
#: src/cli.vala:377
msgid "Could not get current keyboard speed!\n"
msgstr "¡No se pudo obtener la velocidad actual del teclado!\n"
#: src/cli.vala:385 src/gui-window.vala:135
msgid "Could not get current keyboard speed!"
msgstr "¡No se pudo obtener la velocidad actual del teclado!"
#: src/cli.vala:386 src/gui-window.vala:141 src/gui-window.vala:193
#: src/cli.vala:394 src/gui-window.vala:141 src/gui-window.vala:193
msgid "Current keyboard color: "
msgstr "Color de teclado actual: "
#: src/cli.vala:497
#: src/cli.vala:513
msgid "Usage:"
msgstr "Uso:"
#: src/cli.vala:497
#: src/cli.vala:513
msgid "COMMAND [SUBCOMMAND]"
msgstr "COMANDO [SUBCOMANDO]"
#: src/cli.vala:498
#: src/cli.vala:514
msgid "Print the version of tuf-cli\n"
msgstr "Imprimir la versión del tuf-cli\n"
#: src/cli.vala:499
#: src/cli.vala:515
msgid "Show this help screen\n"
msgstr "Mostrar esta pantalla de ayuda\n"
#: src/cli.vala:500
#: src/cli.vala:516
msgid "Set the fan mode\n"
msgstr "Establecer el modo del ventilador:\n"
#: src/cli.vala:501
#: src/cli.vala:517
msgid "Set the keyboard lighting\n"
msgstr "Iluminación de teclado\n"
#: src/cli.vala:502
#: src/cli.vala:518
msgid "Set the keyboard lighting speed\n"
msgstr "Establecer la Iluminación de teclado\n"
#: src/cli.vala:503
#: src/cli.vala:519
msgid "Set the keyboard color\n"
msgstr "Color del teclado\n"
#: src/cli.vala:504
#: src/cli.vala:520
msgid ""
"Show the current config\n"
"\n"
@ -155,35 +145,18 @@ msgstr ""
"Mostrar la configuración actual\n"
"\n"
#: src/cli.vala:505
#: src/cli.vala:521
msgid "Examples:\n"
msgstr "Ejemplos:\n"
#: src/cli.vala:506
#: src/cli.vala:522
msgid "Silence fan:"
msgstr "Silenciar ventilador:"
#: src/cli.vala:507
#: src/cli.vala:523
msgid "Change RGB color:"
msgstr "Cambiar el color RGB:"
#: src/common.vala:41 src/common.vala:64 src/common.vala:79 src/common.vala:82
#: src/common.vala:97 src/common.vala:100 src/common.vala:114
#: src/common.vala:117 src/common.vala:132 src/common.vala:135
#: src/common.vala:149 src/common.vala:152 src/common.vala:167
#: src/common.vala:170 src/common.vala:184 src/common.vala:187
#: src/common.vala:202 src/common.vala:205 src/gui-window.vala:79
#: src/main.vala.in:31 src/server.vala:44 src/server.vala:140
#: src/server.vala:201 src/server.vala:204 src/server.vala:212
#: src/server.vala:215 src/server.vala:321 src/server.vala:324
#: src/server.vala:332 src/server.vala:335 src/server.vala:447
#: src/server.vala:450 src/server.vala:458 src/server.vala:461
#: src/server.vala:559 src/server.vala:562 src/server.vala:570
#: src/server.vala:573 src/server-main.vala:68 src/server-main.vala:88
#, c-format
msgid "Error: %s\n"
msgstr "Error: %s\n"
#: src/common.vala:50
msgid "The server and client versions do not match!"
msgstr "¡La versión del servidor y del cliente no coinciden!"
@ -192,29 +165,17 @@ msgstr "¡La versión del servidor y del cliente no coinciden!"
msgid "The current running tuf-server version doesn't match the GUI version!"
msgstr "¡La versión actual de tuf-server no coincide con la versión de GUI!"
#: src/gui-window.vala:109
msgid "Could not get current fan mode!"
msgstr "¡No se pudo obtener el modo de ventilador actual!"
#: src/gui-window.vala:122 src/gui-window.vala:175
msgid "Current keyboard mode: "
msgstr "Modo de teclado actual: "
#: src/gui-window.vala:125
msgid "Could not get current keyboard mode!"
msgstr "¡No se pudo obtener el modo de teclado actual!"
#: src/gui-window.vala:135
msgid "Could not get current keyboard speed!"
msgstr "¡No se pudo obtener la velocidad actual del teclado!"
#: src/main.vala.in:34
msgid "Another instance of TUF Manager is already running!\n"
msgstr "¡Ya se está ejecutando otra instancia de Administrador TUF!\n"
msgid "Another instance of TUF Manager is already running!"
msgstr "¡Ya se está ejecutando otra instancia de Administrador TUF!"
#: src/server.vala:50
msgid "Could not register service!\n"
msgstr "¡No se pudo registrar el servicio!\n"
msgid "Could not register service!"
msgstr "¡No se pudo registrar el servicio!"
#: src/server.vala:166 src/server.vala:238 src/server.vala:264
#: src/server.vala:277 src/server.vala:290 src/server.vala:365
@ -245,15 +206,17 @@ msgstr "Ejecuta el daemon en primer plano"
#: src/server-main.vala:69
#, c-format
msgid "Run '%s --help' to see a full list of available command line options.\n"
msgstr "Ejecute '% s --help' para ver una lista completa de las opciones de línea de comando disponibles.\n"
msgstr ""
"Ejecute '% s --help' para ver una lista completa de las opciones de línea de "
"comando disponibles.\n"
#: src/server-main.vala:92
msgid "Could not create pid file!\n"
msgstr "¡No se pudo crear el archivo pid!\n"
msgid "Could not create pid file!"
msgstr "¡No se pudo crear el archivo pid!"
#: src/server-main.vala:122
msgid "Could not acquire bus name!\n"
msgstr "¡No se pudo adquirir el bus name!\n"
msgid "Could not acquire bus name!"
msgstr "¡No se pudo adquirir el bus name!"
#: data/tuf-manager.desktop.in:4 data/tuf-manager.desktop.in:5
#: data/ui/tuf.manager.window.ui:41
@ -272,7 +235,9 @@ msgstr ""
#: data/gschema/org.tuf.manager.gschema.xml:5
#: data/gschema/org.tuf.manager.gschema.xml:6
msgid "Should TUF Manager restore previous settings when run?"
msgstr "¿Debe Administrador TUF restaurar la configuración anterior cuando se ejecuta?"
msgstr ""
"¿Debe Administrador TUF restaurar la configuración anterior cuando se "
"ejecuta?"
#: data/gschema/org.tuf.manager.gschema.xml:12
msgid "Fan mode"

123
po/tuf-manager.pot

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tuf-manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-06 20:34-0400\n"
"POT-Creation-Date: 2020-08-07 01:13-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,169 +17,142 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/cli.vala:180 src/cli.vala:287 src/cli.vala:344 src/cli.vala:362
#: src/cli.vala:377 src/cli.vala:406 src/cli.vala:429 src/cli.vala:451
#: src/cli.vala:471 src/gui-window.vala:109 src/gui-window.vala:125
#: src/gui-window.vala:135 src/main.vala.in:34 src/server.vala:50
#: src/server-main.vala:92 src/server-main.vala:122
msgid "Error: "
#: src/cli.vala:322
msgid "Invalid arguments!"
msgstr ""
#: src/cli.vala:314
msgid ""
"Invalid arguments!\n"
"\n"
msgstr ""
#: src/cli.vala:320
#: src/cli.vala:328
msgid "Version: "
msgstr ""
#: src/cli.vala:330 src/gui-window.vala:95
#: src/cli.vala:338 src/gui-window.vala:95
msgid "Client version: "
msgstr ""
#: src/cli.vala:331 src/gui-window.vala:96
#: src/cli.vala:339 src/gui-window.vala:96
msgid "Server version: "
msgstr ""
#: src/cli.vala:335 src/cli.vala:338 src/cli.vala:341 src/gui-window.vala:106
#: src/cli.vala:343 src/cli.vala:346 src/cli.vala:349 src/gui-window.vala:106
#: src/gui-window.vala:160
msgid "Current fan mode: "
msgstr ""
#: src/cli.vala:335
#: src/cli.vala:343
msgid "Balanced\n"
msgstr ""
#: src/cli.vala:338
#: src/cli.vala:346
msgid "Turbo\n"
msgstr ""
#: src/cli.vala:341
#: src/cli.vala:349
msgid "Silent\n"
msgstr ""
#: src/cli.vala:344
msgid "Could not get current fan mode!\n"
#: src/cli.vala:352 src/gui-window.vala:109
msgid "Could not get current fan mode!"
msgstr ""
#: src/cli.vala:350 src/cli.vala:353 src/cli.vala:356 src/cli.vala:359
#: src/cli.vala:358 src/cli.vala:361 src/cli.vala:364 src/cli.vala:367
msgid "Current keyboard lighting: "
msgstr ""
#: src/cli.vala:350
#: src/cli.vala:358
msgid "Static\n"
msgstr ""
#: src/cli.vala:353
#: src/cli.vala:361
msgid "Breathing\n"
msgstr ""
#: src/cli.vala:356
#: src/cli.vala:364
msgid "Color Cycle\n"
msgstr ""
#: src/cli.vala:359
#: src/cli.vala:367
msgid "Strobing\n"
msgstr ""
#: src/cli.vala:362
msgid "Could not get current keyboard mode!\n"
#: src/cli.vala:370 src/gui-window.vala:125
msgid "Could not get current keyboard mode!"
msgstr ""
#: src/cli.vala:368 src/cli.vala:371 src/cli.vala:374 src/gui-window.vala:132
#: src/cli.vala:376 src/cli.vala:379 src/cli.vala:382 src/gui-window.vala:132
#: src/gui-window.vala:184
msgid "Current keyboard speed: "
msgstr ""
#: src/cli.vala:368
#: src/cli.vala:376
msgid "Slow\n"
msgstr ""
#: src/cli.vala:371
#: src/cli.vala:379
msgid "Medium\n"
msgstr ""
#: src/cli.vala:374
#: src/cli.vala:382
msgid "Fast\n"
msgstr ""
#: src/cli.vala:377
msgid "Could not get current keyboard speed!\n"
#: src/cli.vala:385 src/gui-window.vala:135
msgid "Could not get current keyboard speed!"
msgstr ""
#: src/cli.vala:386 src/gui-window.vala:141 src/gui-window.vala:193
#: src/cli.vala:394 src/gui-window.vala:141 src/gui-window.vala:193
msgid "Current keyboard color: "
msgstr ""
#: src/cli.vala:497
#: src/cli.vala:513
msgid "Usage:"
msgstr ""
#: src/cli.vala:497
#: src/cli.vala:513
msgid "COMMAND [SUBCOMMAND]"
msgstr ""
#: src/cli.vala:498
#: src/cli.vala:514
msgid "Print the version of tuf-cli\n"
msgstr ""
#: src/cli.vala:499
#: src/cli.vala:515
msgid "Show this help screen\n"
msgstr ""
#: src/cli.vala:500
#: src/cli.vala:516
msgid "Set the fan mode\n"
msgstr ""
#: src/cli.vala:501
#: src/cli.vala:517
msgid "Set the keyboard lighting\n"
msgstr ""
#: src/cli.vala:502
#: src/cli.vala:518
msgid "Set the keyboard lighting speed\n"
msgstr ""
#: src/cli.vala:503
#: src/cli.vala:519
msgid "Set the keyboard color\n"
msgstr ""
#: src/cli.vala:504
#: src/cli.vala:520
msgid ""
"Show the current config\n"
"\n"
msgstr ""
#: src/cli.vala:505
#: src/cli.vala:521
msgid "Examples:\n"
msgstr ""
#: src/cli.vala:506
#: src/cli.vala:522
msgid "Silence fan:"
msgstr ""
#: src/cli.vala:507
#: src/cli.vala:523
msgid "Change RGB color:"
msgstr ""
#: src/common.vala:41 src/common.vala:64 src/common.vala:79 src/common.vala:82
#: src/common.vala:97 src/common.vala:100 src/common.vala:114
#: src/common.vala:117 src/common.vala:132 src/common.vala:135
#: src/common.vala:149 src/common.vala:152 src/common.vala:167
#: src/common.vala:170 src/common.vala:184 src/common.vala:187
#: src/common.vala:202 src/common.vala:205 src/gui-window.vala:79
#: src/main.vala.in:31 src/server.vala:44 src/server.vala:140
#: src/server.vala:201 src/server.vala:204 src/server.vala:212
#: src/server.vala:215 src/server.vala:321 src/server.vala:324
#: src/server.vala:332 src/server.vala:335 src/server.vala:447
#: src/server.vala:450 src/server.vala:458 src/server.vala:461
#: src/server.vala:559 src/server.vala:562 src/server.vala:570
#: src/server.vala:573 src/server-main.vala:68 src/server-main.vala:88
#, c-format
msgid "Error: %s\n"
msgstr ""
#: src/common.vala:50
msgid "The server and client versions do not match!"
msgstr ""
@ -188,28 +161,16 @@ msgstr ""
msgid "The current running tuf-server version doesn't match the GUI version!"
msgstr ""
#: src/gui-window.vala:109
msgid "Could not get current fan mode!"
msgstr ""
#: src/gui-window.vala:122 src/gui-window.vala:175
msgid "Current keyboard mode: "
msgstr ""
#: src/gui-window.vala:125
msgid "Could not get current keyboard mode!"
msgstr ""
#: src/gui-window.vala:135
msgid "Could not get current keyboard speed!"
msgstr ""
#: src/main.vala.in:34
msgid "Another instance of TUF Manager is already running!\n"
msgid "Another instance of TUF Manager is already running!"
msgstr ""
#: src/server.vala:50
msgid "Could not register service!\n"
msgid "Could not register service!"
msgstr ""
#: src/server.vala:166 src/server.vala:238 src/server.vala:264
@ -244,11 +205,11 @@ msgid "Run '%s --help' to see a full list of available command line options.\n"
msgstr ""
#: src/server-main.vala:92
msgid "Could not create pid file!\n"
msgid "Could not create pid file!"
msgstr ""
#: src/server-main.vala:122
msgid "Could not acquire bus name!\n"
msgid "Could not acquire bus name!"
msgstr ""
#: data/tuf-manager.desktop.in:4 data/tuf-manager.desktop.in:5

20
src/cli.vala

@ -183,7 +183,7 @@ namespace TUFManager {
connect_tuf_server ();
}
catch (TUFError e) {
command_line.printerr (_ ("Error: ") + e.message + "\n");
warning (e.message);
this.release ();
return 1;
}
@ -292,7 +292,7 @@ namespace TUFManager {
}
}
catch (RegexError e) {
command_line.printerr (_ ("Error: ") + e.message + "\n");
warning (e.message);
}
finally {
rgba = Gdk.RGBA ();
@ -319,7 +319,7 @@ namespace TUFManager {
}
if (invalid) {
command_line.printerr (_ ("Invalid arguments!\n\n"));
warning (_ ("Invalid arguments!"));
print_usage (command_line);
release_cli ();
return 1;
@ -349,7 +349,7 @@ namespace TUFManager {
command_line.print (_ ("Current fan mode: ") + _ ("Silent\n"));
break;
default:
command_line.printerr (_ ("Error: ") + _ ("Could not get current fan mode!\n"));
warning (_ ("Could not get current fan mode!"));
break;
}
current_setting = get_keyboard_mode ();
@ -367,7 +367,7 @@ namespace TUFManager {
command_line.print (_ ("Current keyboard lighting: ") + _ ("Strobing\n"));
break;
default:
command_line.printerr (_ ("Error: ") + _ ("Could not get current keyboard mode!\n"));
warning (_ ("Could not get current keyboard mode!"));
break;
}
current_setting = get_keyboard_speed ();
@ -382,7 +382,7 @@ namespace TUFManager {
command_line.print (_ ("Current keyboard speed: ") + _ ("Fast\n"));
break;
default:
command_line.printerr (_ ("Error: ") + _ ("Could not get current keyboard speed!\n"));
warning (_ ("Could not get current keyboard speed!"));
break;
}
var current_color = get_keyboard_color ();
@ -413,7 +413,7 @@ namespace TUFManager {
});
}
catch (Error e) {
command_line.printerr (_ ("Error: ") + e.message + "\n");
warning (e.message);
}
#endif
@ -438,7 +438,7 @@ namespace TUFManager {
});
}
catch (Error e) {
command_line.printerr (_ ("Error: ") + e.message + "\n");
warning (e.message);
}
#endif
return 0;
@ -462,7 +462,7 @@ namespace TUFManager {
});
}
catch (Error e) {
command_line.printerr (_ ("Error: ") + e.message + "\n");
warning (e.message);
}
#endif
return 0;
@ -484,7 +484,7 @@ namespace TUFManager {
});
}
catch (Error e) {
command_line.printerr (_ ("Error: ") + e.message + "\n");
warning (e.message);
}
#endif
return 0;

36
src/common.vala

@ -38,7 +38,7 @@ namespace TUFManager {
tuf_server = Bus.get_proxy_sync (BusType.SYSTEM, "org.tuf.manager.server", "/org/tuf/manager/server");
}
catch (IOError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
string? server_version = get_server_version ();
@ -61,7 +61,7 @@ namespace TUFManager {
return tuf_server.get_server_version ();
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
return null;
}
@ -76,10 +76,10 @@ namespace TUFManager {
return tuf_server.get_fan_mode ();
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
return -3;
}
@ -94,10 +94,10 @@ namespace TUFManager {
tuf_server.set_fan_mode (mode, bus_name);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
@ -111,10 +111,10 @@ namespace TUFManager {
return tuf_server.get_keyboard_color ();
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
return Gdk.RGBA ();
}
@ -129,10 +129,10 @@ namespace TUFManager {
tuf_server.set_keyboard_color (color, bus_name);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
@ -146,10 +146,10 @@ namespace TUFManager {
return tuf_server.get_keyboard_mode ();
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
return -3;
}
@ -164,10 +164,10 @@ namespace TUFManager {
tuf_server.set_keyboard_mode (mode, bus_name);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
@ -181,10 +181,10 @@ namespace TUFManager {
return tuf_server.get_keyboard_speed ();
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
return -3;
}
@ -199,10 +199,10 @@ namespace TUFManager {
tuf_server.set_keyboard_speed (speed, bus_name);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
}

8
src/gui-window.vala

@ -76,7 +76,7 @@ namespace TUFManager {
connect_tuf_server ();
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
if (e.code == TUFError.UNMATCHED_VERSIONS) {
Gtk.MessageDialog msg;
msg = new Gtk.MessageDialog (this,
@ -106,7 +106,7 @@ namespace TUFManager {
print (_ ("Current fan mode: ") + fan_mode.get_active_text () + "\n");
}
else {
stderr.printf ("%s\n", _ ("Error: ") + _ ("Could not get current fan mode!"));
warning (_ ("Could not get current fan mode!"));
}
// Get the keyboard mode
@ -122,7 +122,7 @@ namespace TUFManager {
print (_ ("Current keyboard mode: ") + keyboard_mode.get_active_text () + "\n");
}
else {
stderr.printf ("%s\n", _ ("Error: ") + _ ("Could not get current keyboard mode!"));
warning (_ ("Could not get current keyboard mode!"));
}
// Get the keyboard speed
@ -132,7 +132,7 @@ namespace TUFManager {
print (_ ("Current keyboard speed: ") + keyboard_speed.get_active_text () + "\n");
}
else {
stderr.printf ("%s\n", _ ("Error: ") + _ ("Could not get current keyboard speed!"));
warning (_ ("Could not get current keyboard speed!"));
}
// Get the keyboard color

4
src/main.vala.in

@ -28,10 +28,10 @@ namespace TUFManager {
application.register ();
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
if (application.get_is_remote ()) {
stderr.printf (_ ("Error: ") + _ ("Another instance of TUF Manager is already running!\n"));
warning (_ ("Another instance of TUF Manager is already running!"));
return -1;
}
return application.run (args);

8
src/server-main.vala

@ -65,7 +65,7 @@ namespace TUFManager {
opt_context.parse (ref args);
}
catch (OptionError e) {
print (_ ("Error: %s\n"), e.message);
warning (e.message);
print (_ ("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
return 1;
}
@ -85,11 +85,11 @@ namespace TUFManager {
file = null;
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
var stream = FileStream.open ("/run/tufmanager/pid", "w");
if (stream == null) {
stderr.printf (_ ("Error: ") + _ ("Could not create pid file!\n"));
warning (_ ("Could not create pid file!"));
}
else {
uint32 pidfile = pid;
@ -119,7 +119,7 @@ namespace TUFManager {
on_bus_acquired,
() => {},
() => {
stderr.printf (_ ("Error: ") + _ ("Could not acquire bus name!\n"));
warning (_ ("Could not acquire bus name!"));
});
loop = new MainLoop ();

38
src/server.vala

@ -41,13 +41,13 @@ namespace TUFManager {
tuf_server = new TUFManager.Server.TUFServer ();
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
try {
conn.register_object ("/org/tuf/manager/server", tuf_server);
}
catch (IOError e) {
stderr.printf (_ ("Error: ") + _ ("Could not register service!\n"));
warning (_ ("Could not register service!"));
if (loop != null) {
loop.quit ();
}
@ -137,7 +137,7 @@ namespace TUFManager {
authorized = result.get_is_authorized ();
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
return authorized;
#endif
@ -198,10 +198,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
if (authorized) {
@ -209,10 +209,10 @@ namespace TUFManager {
set_fan_mode_authorized (mode, sender);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
else {
@ -318,10 +318,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
if (authorized) {
@ -329,10 +329,10 @@ namespace TUFManager {
set_keyboard_color_authorized (color, sender);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
else {
@ -444,10 +444,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
if (authorized) {
@ -455,10 +455,10 @@ namespace TUFManager {
set_keyboard_mode_authorized (mode, sender);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
else {
@ -556,10 +556,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
if (authorized) {
@ -567,10 +567,10 @@ namespace TUFManager {
set_keyboard_speed_authorized (speed, sender);
}
catch (TUFError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
else {

10
src/tray-icon.vala

@ -46,7 +46,7 @@ namespace TUFManager {
indicator.set_title (_ ("TUF Manager"));
set_icon_visible (true);
Timeout.add (200, () => {
Timeout.add_seconds (30, () => {
indicator.set_status (AppIndicator.IndicatorStatus.ACTIVE);
return false;
});
@ -62,7 +62,7 @@ namespace TUFManager {
Process.spawn_command_line_async ("tuf-gui");
}
catch (SpawnError e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
@ -84,7 +84,7 @@ namespace TUFManager {
notification.show ();
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
@ -101,7 +101,7 @@ namespace TUFManager {
}
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}
@ -113,7 +113,7 @@ namespace TUFManager {
}
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
}

4
src/tray-main.vala

@ -33,10 +33,10 @@ namespace TUFManager {
application.register ();
}
catch (Error e) {
stderr.printf (_ ("Error: %s\n"), e.message);
warning (e.message);
}
if (application.get_is_remote ()) {
stderr.printf (_ ("Error: ") + _ ("Another instance of TUF Manager is already running!\n"));
warning (_ ("Another instance of TUF Manager is already running!"));
return -1;
}
return application.run ();

Loading…
Cancel
Save