Skip to content

Commit a36329d

Browse files
committed
Don't use error dialogs
1 parent cc25b6a commit a36329d

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/Widgets/BackgroundMenu.vala

+3-27
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ public class Gala.BackgroundMenu : Menu {
1414
try {
1515
AppInfo.launch_default_for_uri ("settings://desktop/appearance/wallpaper", null);
1616
} catch (Error e) {
17-
var message_dialog = new Granite.MessageDialog.with_image_from_icon_name (
18-
"Failed to Open Wallpaper Settings",
19-
"Unable to open System Settings. A handler for the `settings://` URI scheme must be installed.",
20-
"dialog-error",
21-
Gtk.ButtonsType.CLOSE
22-
);
23-
message_dialog.show_error_details (e.message);
24-
message_dialog.run ();
25-
message_dialog.destroy ();
17+
warning ("Failed to open Wallpaper Settings: %s", e.message);
2618
}
2719
});
2820

@@ -31,15 +23,7 @@ public class Gala.BackgroundMenu : Menu {
3123
try {
3224
AppInfo.launch_default_for_uri ("settings://display", null);
3325
} catch (Error e) {
34-
var message_dialog = new Granite.MessageDialog.with_image_from_icon_name (
35-
"Failed to Open Display Settings",
36-
"Unable to open System Settings. A handler for the `settings://` URI scheme must be installed.",
37-
"dialog-warning",
38-
Gtk.ButtonsType.CLOSE
39-
);
40-
message_dialog.show_error_details (e.message);
41-
message_dialog.run ();
42-
message_dialog.destroy ();
26+
warning ("Failed to open Display Settings: %s", e.message);
4327
}
4428
});
4529

@@ -48,15 +32,7 @@ public class Gala.BackgroundMenu : Menu {
4832
try {
4933
AppInfo.launch_default_for_uri ("settings://", null);
5034
} catch (Error e) {
51-
var message_dialog = new Granite.MessageDialog.with_image_from_icon_name (
52-
"Failed to Open System Settings",
53-
"Unable to open System Settings. A handler for the `settings://` URI scheme must be installed.",
54-
"dialog-warning",
55-
Gtk.ButtonsType.CLOSE
56-
);
57-
message_dialog.show_error_details (e.message);
58-
message_dialog.run ();
59-
message_dialog.destroy ();
35+
warning ("Failed to open System Settings: %s", e.message);
6036
}
6137
});
6238

src/Widgets/Menu/Menu.vala

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/*
2-
* Copyright 2021 Aral Balkan <[email protected]>
3-
* Copyright 2020 Mark Story <[email protected]>
4-
* Copyright 2017 Popye <[email protected]>
5-
* Copyright 2014 Tom Beckmann
62
* Copyright 2023 elementary, Inc. <https://elementary.io>
73
* SPDX-License-Identifier: GPL-3.0-or-later
84
*/

0 commit comments

Comments
 (0)