[gnome-control-center] printers: Introduce the "authentication-required" signal in PpHost



commit af9fd3e9956befcd55b473a3f68465da3f6caf39
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Nov 1 14:35:22 2016 +0100

    printers: Introduce the "authentication-required" signal in PpHost
    
    This signal should be emitted by hosts and derivated classes when
    it is required to authenticate hosts (ask for credentials).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760783

 panels/printers/pp-host.c |   15 +++++++++++++++
 panels/printers/pp-host.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/panels/printers/pp-host.c b/panels/printers/pp-host.c
index fbfb434..e54ba6d 100644
--- a/panels/printers/pp-host.c
+++ b/panels/printers/pp-host.c
@@ -38,6 +38,13 @@ enum {
   PROP_PORT,
 };
 
+enum {
+  AUTHENTICATION_REQUIRED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
 static void
 pp_host_finalize (GObject *object)
 {
@@ -125,6 +132,14 @@ pp_host_class_init (PpHostClass *klass)
                       "The port",
                       -1, G_MAXINT32, PP_HOST_UNSET_PORT,
                       G_PARAM_READWRITE));
+
+  signals[AUTHENTICATION_REQUIRED] =
+    g_signal_new ("authentication-required",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (PpHostClass, authentication_required),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 0);
 }
 
 static void
diff --git a/panels/printers/pp-host.h b/panels/printers/pp-host.h
index 5483d85..9cdbfdd 100644
--- a/panels/printers/pp-host.h
+++ b/panels/printers/pp-host.h
@@ -52,6 +52,8 @@ struct _PpHost
 struct _PpHostClass
 {
   GObjectClass parent_class;
+
+  void (*authentication_required) (PpHost *host);
 };
 
 GType          pp_host_get_type                       (void) G_GNUC_CONST;


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