diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-09-21 23:59:48 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-09-21 23:59:48 +0200 |
commit | ce5fa07af99ac9d53e38213fd286fe8ac208e789 (patch) | |
tree | 1b203e7b677d78fabf431ce986cc09ff0b0ecd5c /src/indicator-printer-state-notifier.c | |
parent | 4e646dac54541c70532374463767428e3f22cbd2 (diff) | |
parent | 0c689d5662beef6b90a0104ab3933058f23ce7f9 (diff) | |
download | ayatana-indicator-printers-ce5fa07af99ac9d53e38213fd286fe8ac208e789.tar.gz ayatana-indicator-printers-ce5fa07af99ac9d53e38213fd286fe8ac208e789.tar.bz2 ayatana-indicator-printers-ce5fa07af99ac9d53e38213fd286fe8ac208e789.zip |
Merge branch 'tari01-pr/indicator-ng'
Attributes GH PR #18: https://github.com/AyatanaIndicators/ayatana-indicator-printers/pull/18
Diffstat (limited to 'src/indicator-printer-state-notifier.c')
-rw-r--r-- | src/indicator-printer-state-notifier.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/indicator-printer-state-notifier.c b/src/indicator-printer-state-notifier.c index 7a587a0..12f77c6 100644 --- a/src/indicator-printer-state-notifier.c +++ b/src/indicator-printer-state-notifier.c @@ -1,7 +1,9 @@ /* * Copyright 2012 Canonical Ltd. + * Copyright 2022 Robert Tari * * Authors: Lars Uebernickel <lars.uebernickel@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -17,9 +19,8 @@ */ #include "indicator-printer-state-notifier.h" - +#include <ayatana/common/utils.h> #include <glib/gi18n.h> -#include <gtk/gtk.h> #include <cups/cups.h> #include <string.h> #include <stdarg.h> @@ -27,9 +28,6 @@ #include "cups-notifier.h" #include "spawn-printer-settings.h" - -#define RESPONSE_SHOW_SYSTEM_SETTINGS 1 - struct _IndicatorPrinterStateNotifierPrivate { CupsNotifier *cups_notifier; @@ -95,12 +93,9 @@ show_alert_box (const gchar *printer, const gchar *reason, int njobs) { - GtkWidget *dialog; - GtkWidget *image; gchar *primary_text; gchar *secondary_text; - image = gtk_image_new_from_icon_name ("printer", GTK_ICON_SIZE_DIALOG); primary_text = g_strdup_printf (reason, printer); secondary_text = g_strdup_printf (ngettext( @@ -108,31 +103,14 @@ show_alert_box (const gchar *printer, "You have %d jobs queued to print on this printer.", njobs), njobs); - dialog = g_object_new (GTK_TYPE_MESSAGE_DIALOG, - "title", _("Printing Problem"), - "icon-name", "printer", - "image", image, - "text", primary_text, - "secondary-text", secondary_text, - "urgency-hint", TRUE, - "focus-on-map", FALSE, - "window-position", GTK_WIN_POS_CENTER, - "skip-taskbar-hint", FALSE, - "deletable", FALSE, - NULL); - + gchar *sText = g_strdup_printf("<b>%s</b>\n\n%s", primary_text, secondary_text); g_free (primary_text); g_free (secondary_text); - gtk_dialog_add_buttons(GTK_DIALOG (dialog), _("_Settingsā¦"), RESPONSE_SHOW_SYSTEM_SETTINGS, _("_OK"), GTK_RESPONSE_OK, NULL); - gtk_dialog_set_default_response (GTK_DIALOG (dialog), - GTK_RESPONSE_OK); - gtk_widget_show_all (dialog); - - if (gtk_dialog_run (GTK_DIALOG (dialog)) == RESPONSE_SHOW_SYSTEM_SETTINGS) - spawn_printer_settings (); + ayatana_common_utils_zenity_warning ("printer", _("Printing Problem"), sText); + g_free (sText); - gtk_widget_destroy (dialog); + spawn_printer_settings (); } |