diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-02-12 14:58:57 +0100 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-02-12 14:58:57 +0100 |
commit | 918a2b8d3f34b5d0a9fee974c191ec2a40e3cebc (patch) | |
tree | 9f533bf684963467753f796ec48877d62bb450ae /src/indicator-printers-menu.c | |
parent | b2f09063dad96d18f75b779b00e9e466e8b4ee19 (diff) | |
download | ayatana-indicator-printers-918a2b8d3f34b5d0a9fee974c191ec2a40e3cebc.tar.gz ayatana-indicator-printers-918a2b8d3f34b5d0a9fee974c191ec2a40e3cebc.tar.bz2 ayatana-indicator-printers-918a2b8d3f34b5d0a9fee974c191ec2a40e3cebc.zip |
Show printer settings when "Settings..." is clicked on an alert dialog
Diffstat (limited to 'src/indicator-printers-menu.c')
-rw-r--r-- | src/indicator-printers-menu.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/indicator-printers-menu.c b/src/indicator-printers-menu.c index a558c20..eb88f97 100644 --- a/src/indicator-printers-menu.c +++ b/src/indicator-printers-menu.c @@ -20,6 +20,8 @@ #include <cups/cups.h> +#include "spawn-printer-settings.h" + G_DEFINE_TYPE (IndicatorPrintersMenu, indicator_printers_menu, G_TYPE_OBJECT) @@ -120,37 +122,12 @@ indicator_printers_menu_class_init (IndicatorPrintersMenuClass *klass) static void -spawn_command_line_async_f (const gchar *fmt, - ...) -{ - va_list args; - gchar *cmdline; - GError *err = NULL; - - va_start (args, fmt); - cmdline = g_strdup_vprintf (fmt, args); - va_end (args); - - g_spawn_command_line_async (cmdline, &err); - if (err) { - g_warning ("Couldn't execute command `%s`: %s", - cmdline, err->message); - g_error_free (err); - } - - g_free (cmdline); -} - - -static void on_printer_item_activated (DbusmenuMenuitem *menuitem, guint timestamp, gpointer user_data) { const gchar *printer = user_data; - - spawn_command_line_async_f ("gnome-control-center printers show-printer %s", - printer); + spawn_printer_settings_with_args ("show-printer %s", printer); } |