diff options
author | Robert Tari <robert@tari.in> | 2021-04-06 23:37:11 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-05-04 08:37:49 +0200 |
commit | f327003588cf2ed8568e1e5add1cd79bdab9b5a9 (patch) | |
tree | 5c8528a748d107fc119270de7f3d19caddf55968 | |
parent | 284da3fc55fb6e2beb6d0f9dd67b6e286d265ea3 (diff) | |
download | ayatana-indicator-power-f327003588cf2ed8568e1e5add1cd79bdab9b5a9.tar.gz ayatana-indicator-power-f327003588cf2ed8568e1e5add1cd79bdab9b5a9.tar.bz2 ayatana-indicator-power-f327003588cf2ed8568e1e5add1cd79bdab9b5a9.zip |
src/utils.(ch): Drop local zenity_warning and use libayatana-common.
Fixes AyatanaIndicators/ayatana-indicator-power#20
-rw-r--r-- | src/utils.c | 46 | ||||
-rw-r--r-- | src/utils.h | 2 |
2 files changed, 0 insertions, 48 deletions
diff --git a/src/utils.c b/src/utils.c index 9a5495f..992b84d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -27,52 +27,6 @@ # include <lomiri-url-dispatcher.h> #endif -gboolean -zenity_warning (const char * icon_name, - const char * title, - const char * text) -{ - char * command_line; - int exit_status; - GError * error; - gboolean confirmed; - char * zenity; - - confirmed = FALSE; - zenity = g_find_program_in_path ("zenity"); - - if (zenity) - { - command_line = g_strdup_printf ("%s" - " --warning" - " --icon-name=\"%s\"" - " --title=\"%s\"" - " --text=\"%s\"" - " --no-wrap", - zenity, - icon_name, - title, - text); - - /* Treat errors as user confirmation. - Otherwise how will the user ever log out? */ - exit_status = -1; - error = NULL; - if (!g_spawn_command_line_sync (command_line, NULL, NULL, &exit_status, &error)) - { - confirmed = TRUE; - } - else - { - confirmed = g_spawn_check_exit_status (exit_status, &error); - } - - g_free (command_line); - } - g_free (zenity); - return confirmed; -} - void utils_handle_settings_request (void) { diff --git a/src/utils.h b/src/utils.h index 2eb0de7..6dcf658 100644 --- a/src/utils.h +++ b/src/utils.h @@ -24,6 +24,4 @@ void utils_handle_settings_request(void); -gboolean zenity_warning (const char * icon_name, const char * title, const char * text); - #endif /* __INDICATOR_POWER_UTILS_H__ */ |