Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/blankWindow/blankWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace SwayNotificationCenter {
try {
swaync_daemon.set_visibility (false);
} catch (Error e) {
stderr.printf ("ControlCenter BlankWindow Click Error: %s\n",
warning ("ControlCenter BlankWindow Click Error: %s",
e.message);
}
}
Expand Down Expand Up @@ -60,10 +60,10 @@ namespace SwayNotificationCenter {
});

if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n");
stderr.printf ("If running waylans session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
critical ("GTKLAYERSHELL IS NOT SUPPORTED!");
critical ("Swaync only works on Wayland!");
critical ("If running Wayland session, try running:");
critical ("\tGDK_BACKEND=wayland swaync");
Process.exit (1);
}
GtkLayerShell.init_for_window (this);
Expand Down
22 changes: 11 additions & 11 deletions src/client.vala
Original file line number Diff line number Diff line change
Expand Up @@ -227,28 +227,28 @@ public int command_line (ref string[] args, bool skip_wait) {
case "--inhibitor-add":
case "-Ia":
if (args.length < 2) {
stderr.printf ("Application ID needed!");
printerr ("Application ID needed!");
Process.exit (1);
}
used_args++;
if (cc_daemon.add_inhibitor (args[1])) {
print ("Added inhibitor: \"%s\"", args[1]);
break;
}
stderr.printf ("Inhibitor: \"%s\" already added!...", args[1]);
printerr ("Inhibitor: \"%s\" already added!...", args[1]);
break;
case "--inhibitor-remove":
case "-Ir":
if (args.length < 2) {
stderr.printf ("Application ID needed!");
printerr ("Application ID needed!");
Process.exit (1);
}
used_args++;
if (cc_daemon.remove_inhibitor (args[1])) {
print ("Removed inhibitor: \"%s\"", args[1]);
break;
}
stderr.printf ("Inhibitor: \"%s\" does not exist!...", args[1]);
printerr ("Inhibitor: \"%s\" does not exist!...", args[1]);
break;
case "inhibitors-clear":
case "-Ic":
Expand Down Expand Up @@ -289,35 +289,35 @@ public int command_line (ref string[] args, bool skip_wait) {
break;
case "--change-cc-monitor":
if (args.length < 2) {
stderr.printf ("Monitor connector name needed!");
printerr ("Monitor connector name needed!");
Process.exit (1);
}
used_args++;
if (cc_daemon.set_cc_monitor (args[1])) {
print ("Changed monitor to: \"%s\"", args[1]);
break;
}
stderr.printf ("Could not find monitor: \"%s\"!", args[1]);
printerr ("Could not find monitor: \"%s\"!", args[1]);
break;
case "--change-noti-monitor":
if (args.length < 2) {
stderr.printf ("Monitor connector name needed!");
printerr ("Monitor connector name needed!");
Process.exit (1);
}
used_args++;
if (cc_daemon.set_noti_window_monitor (args[1])) {
print ("Changed monitor to: \"%s\"", args[1]);
break;
}
stderr.printf ("Could not find monitor: \"%s\"!", args[1]);
printerr ("Could not find monitor: \"%s\"!", args[1]);
break;
default:
printerr ("Unknown command: \"%s\"\n", args[0]);
print_help (args);
break;
}
} catch (Error e) {
stderr.printf (e.message + "\n");
printerr (e.message + "\n");
if (skip_wait) {
Process.exit (1);
}
Expand All @@ -329,7 +329,7 @@ public int command_line (ref string[] args, bool skip_wait) {
}

void print_connection_error () {
stderr.printf (
printerr (
"Could not connect to CC service. Will wait for connection...\n");
}

Expand Down Expand Up @@ -359,7 +359,7 @@ int try_connect (owned string[] args) {
}
// Should only be reached if the args only contains --skip-wait or -sw
if (one_arg) {
stderr.printf ("Skipping wait, but with no action.");
printerr ("Skipping wait, but with no action.");
}
return 0;
} catch (Error e) {
Expand Down
8 changes: 3 additions & 5 deletions src/configModel/configModel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,7 @@ namespace SwayNotificationCenter {
var tmp_table = new OrderedHashTable<T> ();

if (node.get_node_type () != Json.NodeType.OBJECT) {
stderr.printf ("Node %s is not a json object!...\n",
property_name);
warning ("Node %s is not a json object!", property_name);
return tmp_table;
}

Expand Down Expand Up @@ -1222,8 +1221,7 @@ namespace SwayNotificationCenter {
GenericArray<T> tmp_array = new GenericArray<T> ();

if (node.get_node_type () != Json.NodeType.ARRAY) {
stderr.printf ("Node %s is not a json array!...\n",
property_name);
warning ("Node %s is not a json array!", property_name);
return tmp_array;
}

Expand Down Expand Up @@ -1397,7 +1395,7 @@ namespace SwayNotificationCenter {
FileCreateFlags.REPLACE_DESTINATION,
null);
} catch (Error e) {
stderr.printf (e.message + "\n");
warning ("%s", e.message);
return false;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/controlCenter/controlCenter.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace SwayNotificationCenter {

if (app.use_layer_shell) {
if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n");
stderr.printf ("If running wayland session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
critical ("GTKLAYERSHELL IS NOT SUPPORTED!");
critical ("Swaync only works on Wayland!");
critical ("If running wayland session, try running:");
critical ("\tGDK_BACKEND=wayland swaync");
Process.exit (1);
}
GtkLayerShell.init_for_window (this);
Expand Down
2 changes: 1 addition & 1 deletion src/controlCenter/widgets/shared/toggleButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace SwayNotificationCenter.Widgets {
}
GLib.SignalHandler.unblock (this, this.handler_id);
} catch (RegexError e) {
stderr.printf ("RegexError: %s\n", e.message);
warning ("RegexError: %s", e.message);
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/controlCenter/widgets/volume/pulseDaemon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace SwayNotificationCenter.Widgets {
private void get_context () {
var ctx = new Context (mainloop.get_api (), null);
ctx.set_state_callback ((ctx) => {
debug ("Pulse Status: %s\n", ctx.get_state ().to_string ());
debug ("Pulse Status: %s", ctx.get_state ().to_string ());
switch (ctx.get_state ()) {
case Context.State.CONNECTING :
case Context.State.AUTHORIZING :
Expand All @@ -83,20 +83,20 @@ namespace SwayNotificationCenter.Widgets {
quitting = false;
break;
}
stderr.printf (
"PulseAudio connection lost. Will retry connection.\n");
warning (
"PulseAudio connection lost. Will retry connection.");
get_context ();
break;
default:
running = false;
stderr.printf ("Connection failure: %s\n",
warning ("Connection failure: %s",
PulseAudio.strerror (ctx.errno ()));
break;
}
});
if (ctx.connect (
null, Context.Flags.NOFAIL, null) < 0) {
stdout.printf ("pa_context_connect() failed: %s\n",
stdout.printf ("pa_context_connect() failed: %s",
PulseAudio.strerror (ctx.errno ()));
}
this.context = ctx;
Expand Down Expand Up @@ -589,7 +589,7 @@ namespace SwayNotificationCenter.Widgets {
if (success == 1) {
set_bluetooth_card_profile.callback ();
} else {
stderr.printf ("setting the card %s profile to %s failed\n",
warning ("setting the card %s profile to %s failed",
device.card_name, profile.name);
}
});
Expand All @@ -606,7 +606,7 @@ namespace SwayNotificationCenter.Widgets {
if (success == 1) {
set_card_profile_by_index.callback ();
} else {
stderr.printf ("setting the card %s profile to %s failed\n",
warning ("setting the card %s profile to %s failed",
device.card_name, profile_name);
}
});
Expand All @@ -620,7 +620,7 @@ namespace SwayNotificationCenter.Widgets {
if (success == 1) {
set_sink_port_by_name.callback ();
} else {
stderr.printf ("setting sink port to %s failed\n",
warning ("setting sink port to %s failed",
device.port_name);
}
});
Expand All @@ -632,7 +632,7 @@ namespace SwayNotificationCenter.Widgets {
if (success == 1) {
set_default_sink.callback ();
} else {
stderr.printf ("setting default sink to %s failed\n",
warning ("setting default sink to %s failed",
device.device_name);
}
});
Expand Down
10 changes: 5 additions & 5 deletions src/functions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace SwayNotificationCenter {
Gdk.Texture texture = Gdk.Texture.for_pixbuf (pixbuf);
img.set_from_paintable (texture);
} catch (Error e) {
stderr.printf (e.message + "\n");
warning ("%s", e.message);
}
}

Expand Down Expand Up @@ -158,8 +158,8 @@ namespace SwayNotificationCenter {
}
}
if (path == "") {
stderr.printf (
"COULD NOT FIND CSS FILE! REINSTALL THE PACKAGE!\n");
critical (
"COULD NOT FIND CSS FILE! REINSTALL THE PACKAGE!");
Process.exit (1);
}
return path;
Expand Down Expand Up @@ -200,8 +200,8 @@ namespace SwayNotificationCenter {
}
}
if (path == "") {
stderr.printf (
"COULD NOT FIND CONFIG FILE! REINSTALL THE PACKAGE!\n");
critical (
"COULD NOT FIND CONFIG FILE! REINSTALL THE PACKAGE!");
Process.exit (1);
}
return path;
Expand Down
4 changes: 2 additions & 2 deletions src/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ namespace SwayNotificationCenter {
}
},
() => {
stderr.printf (
critical (
"Could not acquire notification name. " +
"Please close any other notification daemon " +
"like mako or dunst\n");
"like mako or dunst");
Process.exit (1);
});
yield;
Expand Down
8 changes: 4 additions & 4 deletions src/notiDaemon/notiDaemon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ namespace SwayNotificationCenter {
}

if (!ConfigModel.instance.script_fail_notify) {
stderr.printf (
"Failed to run script: \"%s\" with exec: \"%s\"\n",
warning (
"Failed to run script: \"%s\" with exec: \"%s\"",
key, script.exec);
} else {
// Send notification with error message
Expand All @@ -361,8 +361,8 @@ namespace SwayNotificationCenter {
_hints,
-1);
} catch (Error e) {
stderr.printf ("NOTIFING SCRIPT-FAIL ERROR: %s\n",
e.message);
critical ("Notifying script-fail error: %s",
e.message);
}
}
});
Expand Down
7 changes: 3 additions & 4 deletions src/notification/notification.vala
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ namespace SwayNotificationCenter {
tag_unescape_regex = new Regex ("&amp;(?=%s)".printf (unescaped));
img_tag_regex = new Regex ("<img[^>]* src=((\"([^\"]*)\")|(\'([^\']*)\'))[^>]*>");
} catch (Error e) {
stderr.printf ("Invalid regex: %s", e.message);
}
warning ("Invalid regex: %s", e.message); }

bind_property ("dismissed",
this, "sensitive",
Expand Down Expand Up @@ -358,7 +357,7 @@ namespace SwayNotificationCenter {
}
}
} catch (Error e) {
stderr.printf (e.message);
warning ("%s", e.message);
}
}

Expand Down Expand Up @@ -393,7 +392,7 @@ namespace SwayNotificationCenter {
this.body.set_attributes (attr);
}
} catch (Error e) {
stderr.printf ("Could not parse Pango markup %s: %s\n",
warning ("Could not parse Pango markup %s: %s",
text, e.message);
// Sets the original text
this.body.set_text (text);
Expand Down
8 changes: 4 additions & 4 deletions src/notificationWindow/notificationWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ namespace SwayNotificationCenter {
Object (css_name: "notificationwindow");
if (app.use_layer_shell) {
if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n");
stderr.printf ("If running waylans session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
critical ("GTKLAYERSHELL IS NOT SUPPORTED!");
critical ("Swaync only works on Wayland!");
critical ("If running waylans session, try running:");
critical ("\tGDK_BACKEND=wayland swaync");
Process.exit (1);
}
GtkLayerShell.init_for_window (this);
Expand Down
2 changes: 1 addition & 1 deletion src/swayncDaemon/swayncDaemon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace SwayNotificationCenter {
get_visibility (),
inhibited);
} catch (Error e) {
stderr.printf (e.message + "\n");
warning ("%s", e.message);
}
}

Expand Down
Loading