aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-08-22 00:33:59 +0800
committerChristian Persch <chpe@src.gnome.org>2004-08-22 00:33:59 +0800
commit6bb4c6468a602920f04f7d38f4de7247d8719de5 (patch)
tree186b443aa7a08203c9b081e4b04fcc459856753a /embed
parenteaa082e9d2e5ac4fb69799596ce234c35f32aeab (diff)
downloadgsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.tar
gsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.tar.gz
gsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.tar.bz2
gsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.tar.lz
gsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.tar.xz
gsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.tar.zst
gsoc2013-epiphany-6bb4c6468a602920f04f7d38f4de7247d8719de5.zip
Keep the passwords list in the pdm dialogue up-to-date wrt. new passwords
2004-08-21 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-password-manager.c: (ephy_password_manager_get_type), (ephy_password_manager_base_init): * embed/ephy-password-manager.h: * embed/mozilla/EphySingle.cpp: * src/pdm-dialog.c: (cookies_cleared_cb), (pdm_dialog_fill_cookies_list), (passwords_changed_cb), (pdm_dialog_fill_passwords_list), (pdm_dialog_password_remove), (pdm_dialog_finalize): Keep the passwords list in the pdm dialogue up-to-date wrt. new passwords saved from web pages. Fixes bug #150296.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-password-manager.c31
-rw-r--r--embed/ephy-password-manager.h3
-rw-r--r--embed/mozilla/EphySingle.cpp10
3 files changed, 43 insertions, 1 deletions
diff --git a/embed/ephy-password-manager.c b/embed/ephy-password-manager.c
index b1b4a5b02..c0f1e7838 100644
--- a/embed/ephy-password-manager.c
+++ b/embed/ephy-password-manager.c
@@ -106,6 +106,8 @@ ephy_password_info_free (EphyPasswordInfo *info)
/* EphyPasswordManager */
+static void ephy_password_manager_base_init (gpointer g_class);
+
GType
ephy_password_manager_get_type (void)
{
@@ -116,7 +118,7 @@ ephy_password_manager_get_type (void)
static const GTypeInfo our_info =
{
sizeof (EphyPasswordManagerIface),
- NULL,
+ ephy_password_manager_base_init,
NULL,
};
@@ -129,6 +131,33 @@ ephy_password_manager_get_type (void)
return type;
}
+static void
+ephy_password_manager_base_init (gpointer g_class)
+{
+ static gboolean initialised = FALSE;
+
+ if (initialised == FALSE)
+ {
+ /**
+ * EphyPasswordManager::changed
+ * @manager: the #EphyPermissionManager
+ *
+ * The ::passwords-changed signal is emitted when the list of passwords
+ * has changed.
+ */
+ g_signal_new ("passwords-changed",
+ EPHY_TYPE_PASSWORD_MANAGER,
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EphyPasswordManagerIface, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
+ initialised = TRUE;
+ }
+}
+
/**
* ephy_password_manager_add:
* @manager: the #EphyPasswordManager
diff --git a/embed/ephy-password-manager.h b/embed/ephy-password-manager.h
index 1d0d5c0f4..a9ae67f21 100644
--- a/embed/ephy-password-manager.h
+++ b/embed/ephy-password-manager.h
@@ -50,6 +50,9 @@ struct EphyPasswordManagerIface
{
GTypeInterface base_iface;
+ /* Signals */
+ void (* changed) (EphyPasswordManager *manager);
+
/* Methods */
void (* add) (EphyPasswordManager *manager,
EphyPasswordInfo *info);
diff --git a/embed/mozilla/EphySingle.cpp b/embed/mozilla/EphySingle.cpp
index e8f2d4ee4..bd7f0a718 100644
--- a/embed/mozilla/EphySingle.cpp
+++ b/embed/mozilla/EphySingle.cpp
@@ -60,6 +60,7 @@ EphySingle::Init (EphyEmbedSingle *aOwner)
rv |= mObserverService->AddObserver (this, "cookie-rejected", PR_FALSE);
rv |= mObserverService->AddObserver (this, "perm-changed", PR_FALSE);
rv |= mObserverService->AddObserver (this, "network:offline-status-changed", PR_FALSE);
+ rv |= mObserverService->AddObserver (this, "signonChanged", PR_FALSE);
NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
mOwner = aOwner;
@@ -79,6 +80,7 @@ EphySingle::Detach ()
mObserverService->RemoveObserver (this, "cookie-changed");
mObserverService->RemoveObserver (this, "cookie-rejected");
mObserverService->RemoveObserver (this, "perm-changed");
+ mObserverService->RemoveObserver (this, "signonChanged");
mObserverService->RemoveObserver (this, "network:offline-status-changed");
}
@@ -215,6 +217,14 @@ NS_IMETHODIMP EphySingle::Observe(nsISupports *aSubject,
rv = NS_ERROR_FAILURE;
}
}
+ else if (strcmp (aTopic, "signonChanged") == 0)
+ {
+ /* aData can be PRUnichar[] "signons", "rejects", "nocaptures" and "nopreviews" */
+ if (aData[0] == 's')
+ {
+ g_signal_emit_by_name (mOwner, "passwords-changed");
+ }
+ }
else if (strcmp (aTopic, "network:offline-status-changed") == 0)
{
/* aData is either (PRUnichar[]) "offline" or "online" */