[gnome-control-center] Printers: Detect disconnection of printer



commit af40a98f80d96d4ce15bfa1e849aa6910d018bd3
Author: Marek Kasik <mkasik redhat com>
Date:   Tue Nov 1 13:51:18 2011 +0100

    Printers: Detect disconnection of printer
    
    Connect to CUPS' "printer-stopped" event so the panel can change state
    of the printer when unplugged (rhbz #743884).

 panels/printers/cc-printers-panel.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index c416004..8314fe6 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -245,6 +245,7 @@ on_cups_notification (GDBusConnection *connection,
   if (g_strcmp0 (signal_name, "PrinterAdded") != 0 &&
       g_strcmp0 (signal_name, "PrinterDeleted") != 0 &&
       g_strcmp0 (signal_name, "PrinterStateChanged") != 0 &&
+      g_strcmp0 (signal_name, "PrinterStopped") != 0 &&
       g_strcmp0 (signal_name, "JobCreated") != 0 &&
       g_strcmp0 (signal_name, "JobCompleted") != 0)
     return;
@@ -279,7 +280,8 @@ on_cups_notification (GDBusConnection *connection,
 
   if (g_strcmp0 (signal_name, "PrinterAdded") == 0 ||
       g_strcmp0 (signal_name, "PrinterDeleted") == 0 ||
-      g_strcmp0 (signal_name, "PrinterStateChanged") == 0)
+      g_strcmp0 (signal_name, "PrinterStateChanged") == 0 ||
+      g_strcmp0 (signal_name, "PrinterStopped") == 0)
     actualize_printers_list (self);
   else if (g_strcmp0 (signal_name, "JobCreated") == 0 ||
            g_strcmp0 (signal_name, "JobCompleted") == 0)
@@ -336,6 +338,7 @@ renew_subscription (gpointer data)
   static const char * const events[] = {
           "printer-added",
           "printer-deleted",
+          "printer-stopped",
           "printer-state-changed",
           "job-created",
           "job-completed"};



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]