diff options
Diffstat (limited to 'src/ephy-encoding-dialog.c')
-rw-r--r-- | src/ephy-encoding-dialog.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c index 261b8f4b5..79d1a7621 100644 --- a/src/ephy-encoding-dialog.c +++ b/src/ephy-encoding-dialog.c @@ -107,7 +107,7 @@ ephy_encoding_dialog_get_type (void) } static void -sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy) +sync_encoding_against_embed (EphyEncodingDialog *dialog) { EphyEmbed *embed; EphyNode *node; @@ -160,6 +160,33 @@ sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy) dialog->priv->update_tag = FALSE; } + +static void +embed_net_stop_cb (EphyEmbed *embed, EphyEncodingDialog *dialog) +{ + sync_encoding_against_embed (dialog); +} + +static void +sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy) +{ + EphyEmbed *embed; + embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog)); + + if (dialog->priv->embed != NULL) + { + g_signal_handlers_disconnect_by_func (dialog->priv->embed, + G_CALLBACK (embed_net_stop_cb), + dialog); + } + + g_signal_connect (G_OBJECT (embed), "net_stop", + G_CALLBACK (embed_net_stop_cb), dialog); + dialog->priv->embed = embed; + + sync_encoding_against_embed (dialog); +} + static void sync_active_tab (EphyWindow *window, GParamSpec *pspec, EphyEncodingDialog *dialog) { @@ -367,6 +394,13 @@ ephy_encoding_dialog_finalize (GObject *object) dialog); } + if (dialog->priv->embed) + { + g_signal_handlers_disconnect_by_func (dialog->priv->embed, + G_CALLBACK (embed_net_stop_cb), + dialog); + } + g_object_unref (dialog->priv->filter); G_OBJECT_CLASS (parent_class)->finalize (object); |