[epiphany/wip/ephy-sync] ephy-sync: Rename ephy-fx-password-notification to ephy-password-notification and move it to lib/wid



commit b04df4bcfa6b2ec27933c6781ddd9c965853a563
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Sun Aug 28 18:26:14 2016 +0300

    ephy-sync: Rename ephy-fx-password-notification to ephy-password-notification and move it to lib/widgets

 embed/Makefile.am                                  |    2 -
 lib/widgets/Makefile.am                            |    2 +
 .../widgets/ephy-password-notification.c           |   65 ++++++++++----------
 .../widgets/ephy-password-notification.h           |   24 ++++----
 src/ephy-sync-service.c                            |    8 +-
 5 files changed, 51 insertions(+), 50 deletions(-)
---
diff --git a/embed/Makefile.am b/embed/Makefile.am
index 1503ace..2e0feeb 100644
--- a/embed/Makefile.am
+++ b/embed/Makefile.am
@@ -43,8 +43,6 @@ libephyembed_la_SOURCES = \
        ephy-file-monitor.h             \
        ephy-find-toolbar.c             \
        ephy-find-toolbar.h             \
-       ephy-fx-password-notification.c \
-       ephy-fx-password-notification.h \
        ephy-notification-manager.c     \
        ephy-notification-manager.h     \
        ephy-embed-prefs.c              \
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
index 090c36a..214c8dc 100644
--- a/lib/widgets/Makefile.am
+++ b/lib/widgets/Makefile.am
@@ -77,6 +77,8 @@ libephywidgets_la_SOURCES = \
        ephy-middle-clickable-button.h          \
        ephy-node-view.c                        \
        ephy-node-view.h                        \
+       ephy-password-notification.c            \
+       ephy-password-notification.h            \
        ephy-security-popover.c                 \
        ephy-security-popover.h                 \
        ephy-tree-model-node.c                  \
diff --git a/embed/ephy-fx-password-notification.c b/lib/widgets/ephy-password-notification.c
similarity index 61%
rename from embed/ephy-fx-password-notification.c
rename to lib/widgets/ephy-password-notification.c
index 9796b46..13644e2 100644
--- a/embed/ephy-fx-password-notification.c
+++ b/lib/widgets/ephy-password-notification.c
@@ -17,13 +17,13 @@
  */
 
 #include "config.h"
-#include "ephy-fx-password-notification.h"
+#include "ephy-password-notification.h"
 
 #include "ephy-notification-manager.h"
 
 #include <glib/gi18n.h>
 
-struct _EphyFxPasswordNotification {
+struct _EphyPasswordNotification {
   GtkGrid                  parent_instance;
 
   GtkWidget               *note;
@@ -32,7 +32,7 @@ struct _EphyFxPasswordNotification {
   const char              *user;
 };
 
-struct _EphyFxPasswordNotificationClass {
+struct _EphyPasswordNotificationClass {
   GtkGridClass parent_class;
 };
 
@@ -41,12 +41,13 @@ enum {
   PROP_USER
 };
 
-G_DEFINE_TYPE (EphyFxPasswordNotification, ephy_fx_password_notification, GTK_TYPE_GRID);
+G_DEFINE_TYPE (EphyPasswordNotification, ephy_password_notification, GTK_TYPE_GRID);
 
 static void
-ephy_fx_password_notification_constructed (GObject *object)
+ephy_password_notification_constructed (GObject *object)
 {
-  EphyFxPasswordNotification *self = EPHY_FX_PASSWORD_NOTIFICATION (object);
+  EphyPasswordNotification *self = EPHY_PASSWORD_NOTIFICATION (object);
+  char *account;
   char *text;
 
   text = g_strdup_printf (_("We noticed that the password of your Firefox "
@@ -58,26 +59,26 @@ ephy_fx_password_notification_constructed (GObject *object)
                         "password to continue the sync process."));
   g_free (text);
 
-  G_OBJECT_CLASS (ephy_fx_password_notification_parent_class)->constructed (object);
+  G_OBJECT_CLASS (ephy_password_notification_parent_class)->constructed (object);
 }
 
 static void
-ephy_fx_password_notification_dispose (GObject *object)
+ephy_password_notification_dispose (GObject *object)
 {
-  EphyFxPasswordNotification *self = EPHY_FX_PASSWORD_NOTIFICATION (object);
+  EphyPasswordNotification *self = EPHY_PASSWORD_NOTIFICATION (object);
 
   g_clear_pointer (&self->user, g_free);
 
-  G_OBJECT_CLASS (ephy_fx_password_notification_parent_class)->dispose (object);
+  G_OBJECT_CLASS (ephy_password_notification_parent_class)->dispose (object);
 }
 
 static void
-ephy_fx_password_notification_set_property (GObject      *object,
-                                            guint         prop_id,
-                                            const GValue *value,
-                                            GParamSpec   *pspec)
+ephy_password_notification_set_property (GObject      *object,
+                                         guint         prop_id,
+                                         const GValue *value,
+                                         GParamSpec   *pspec)
 {
-  EphyFxPasswordNotification *self = EPHY_FX_PASSWORD_NOTIFICATION (object);
+  EphyPasswordNotification *self = EPHY_PASSWORD_NOTIFICATION (object);
 
   switch (prop_id) {
     case PROP_USER:
@@ -90,12 +91,12 @@ ephy_fx_password_notification_set_property (GObject      *object,
 }
 
 static void
-ephy_fx_password_notification_get_property (GObject      *object,
-                                            guint         prop_id,
-                                            GValue       *value,
-                                            GParamSpec   *pspec)
+ephy_password_notification_get_property (GObject      *object,
+                                         guint         prop_id,
+                                         GValue       *value,
+                                         GParamSpec   *pspec)
 {
-  EphyFxPasswordNotification *self = EPHY_FX_PASSWORD_NOTIFICATION (object);
+  EphyPasswordNotification *self = EPHY_PASSWORD_NOTIFICATION (object);
 
   switch (prop_id) {
     case PROP_USER:
@@ -108,9 +109,9 @@ ephy_fx_password_notification_get_property (GObject      *object,
 }
 
 static void
-ephy_fx_password_notification_init (EphyFxPasswordNotification *self)
+ephy_password_notification_init (EphyPasswordNotification *self)
 {
-  g_return_if_fail (EPHY_IS_FX_PASSWORD_NOTIFICATION (self));
+  g_return_if_fail (EPHY_IS_PASSWORD_NOTIFICATION (self));
 
   self->note = gtk_label_new (NULL);
   gtk_widget_set_halign (self->note, GTK_ALIGN_CENTER);
@@ -124,14 +125,14 @@ ephy_fx_password_notification_init (EphyFxPasswordNotification *self)
 }
 
 static void
-ephy_fx_password_notification_class_init (EphyFxPasswordNotificationClass *klass)
+ephy_password_notification_class_init (EphyPasswordNotificationClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->constructed = ephy_fx_password_notification_constructed;
-  object_class->dispose = ephy_fx_password_notification_dispose;
-  object_class->set_property = ephy_fx_password_notification_set_property;
-  object_class->get_property = ephy_fx_password_notification_get_property;
+  object_class->constructed = ephy_password_notification_constructed;
+  object_class->dispose = ephy_password_notification_dispose;
+  object_class->set_property = ephy_password_notification_set_property;
+  object_class->get_property = ephy_password_notification_get_property;
 
   g_object_class_install_property (object_class,
                                    PROP_USER,
@@ -142,10 +143,10 @@ ephy_fx_password_notification_class_init (EphyFxPasswordNotificationClass *klass
                                                         G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
 }
 
-EphyFxPasswordNotification *
-ephy_fx_password_notification_new (const char *user)
+EphyPasswordNotification *
+ephy_password_notification_new (const char *user)
 {
-  return g_object_new (EPHY_TYPE_FX_PASSWORD_NOTIFICATION,
+  return g_object_new (EPHY_TYPE_PASSWORD_NOTIFICATION,
                        "column-spacing", 12,
                        "orientation", GTK_ORIENTATION_HORIZONTAL,
                        "user", user,
@@ -153,9 +154,9 @@ ephy_fx_password_notification_new (const char *user)
 }
 
 void
-ephy_fx_password_notification_show (EphyFxPasswordNotification *self)
+ephy_password_notification_show (EphyPasswordNotification *self)
 {
-  g_return_if_fail (EPHY_IS_FX_PASSWORD_NOTIFICATION (self));
+  g_return_if_fail (EPHY_IS_PASSWORD_NOTIFICATION (self));
 
   ephy_notification_manager_add_notification (ephy_notification_manager_dup_singleton (),
                                               GTK_WIDGET (self));
diff --git a/embed/ephy-fx-password-notification.h b/lib/widgets/ephy-password-notification.h
similarity index 53%
rename from embed/ephy-fx-password-notification.h
rename to lib/widgets/ephy-password-notification.h
index 0d28aab..460ecf5 100644
--- a/embed/ephy-fx-password-notification.h
+++ b/lib/widgets/ephy-password-notification.h
@@ -16,31 +16,31 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef EPHY_FX_PASSWORD_NOTIFICATION_H
-#define EPHY_FX_PASSWORD_NOTIFICATION_H
+#ifndef EPHY_PASSWORD_NOTIFICATION_H
+#define EPHY_PASSWORD_NOTIFICATION_H
 
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
-#define EPHY_TYPE_FX_PASSWORD_NOTIFICATION (ephy_fx_password_notification_get_type ())
+#define EPHY_TYPE_PASSWORD_NOTIFICATION (ephy_password_notification_get_type ())
 
-#define EPHY_FX_PASSWORD_NOTIFICATION(obj) \
+#define EPHY_PASSWORD_NOTIFICATION(obj) \
   (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
-   EPHY_TYPE_FX_PASSWORD_NOTIFICATION, EphyFxPasswordNotification))
+   EPHY_TYPE_PASSWORD_NOTIFICATION, EphyPasswordNotification))
 
-#define EPHY_IS_FX_PASSWORD_NOTIFICATION(obj) \
+#define EPHY_IS_PASSWORD_NOTIFICATION(obj) \
   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
-   EPHY_TYPE_FX_PASSWORD_NOTIFICATION))
+   EPHY_TYPE_PASSWORD_NOTIFICATION))
 
-typedef struct _EphyFxPasswordNotification      EphyFxPasswordNotification;
-typedef struct _EphyFxPasswordNotificationClass EphyFxPasswordNotificationClass;
+typedef struct _EphyPasswordNotification      EphyPasswordNotification;
+typedef struct _EphyPasswordNotificationClass EphyPasswordNotificationClass;
 
-GType                       ephy_fx_password_notification_get_type (void) G_GNUC_CONST;
+GType                     ephy_password_notification_get_type (void) G_GNUC_CONST;
 
-EphyFxPasswordNotification *ephy_fx_password_notification_new      (const char *user);
+EphyPasswordNotification *ephy_password_notification_new      (const char *user);
 
-void                        ephy_fx_password_notification_show     (EphyFxPasswordNotification *self);
+void                      ephy_password_notification_show     (EphyPasswordNotification *self);
 
 G_END_DECLS
 
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index 83c76b4..0c19df8 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -22,7 +22,7 @@
 #include "ephy-bookmark.h"
 #include "ephy-bookmarks-manager.h"
 #include "ephy-debug.h"
-#include "ephy-fx-password-notification.h"
+#include "ephy-password-notification.h"
 #include "ephy-settings.h"
 #include "ephy-shell.h"
 #include "ephy-sync-crypto.h"
@@ -442,7 +442,7 @@ obtain_signed_certificate_response_cb (SoupSession *session,
 {
   StorageServerRequestAsyncData *data;
   EphySyncService *service;
-  EphyFxPasswordNotification *notification;
+  EphyPasswordNotification *notification;
   JsonParser *parser;
   JsonObject *json;
   const char *certificate;
@@ -459,8 +459,8 @@ obtain_signed_certificate_response_cb (SoupSession *session,
    * if the user has changed his password since the last time he signed in.
    * When this happens, notify the user to sign in with the new password. */
   if (msg->status_code == 401 && json_object_get_int_member (json, "errno") == 110) {
-    notification = ephy_fx_password_notification_new (ephy_sync_service_get_user_email (service));
-    ephy_fx_password_notification_show (notification);
+    notification = ephy_password_notification_new (ephy_sync_service_get_user_email (service));
+    ephy_password_notification_show (notification);
     storage_server_request_async_data_free (data);
     service->locked = FALSE;
     goto out;


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