aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-19 07:47:16 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-19 07:47:16 +0800
commit971fbdf5204f5e5588b437a1a4cc8386204037bd (patch)
treeca228287bee1f127ef5fa2dafd2f83f52dd94136
parent15cbf0f2d0ad71ed66edb1ca3d44d3beb96d49a0 (diff)
downloadgsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.tar
gsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.tar.gz
gsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.tar.bz2
gsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.tar.lz
gsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.tar.xz
gsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.tar.zst
gsoc2013-epiphany-971fbdf5204f5e5588b437a1a4cc8386204037bd.zip
Make encodings dialogue transient.
2003-11-19 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-dialog.c: (ephy_dialog_set_parent): * src/ephy-encoding-dialog.c: (sync_parent_window_cb), (ephy_encoding_dialog_init), (ephy_encoding_dialog_class_init), (ephy_encoding_dialog_new): Make encodings dialogue transient.
-rw-r--r--ChangeLog9
-rw-r--r--lib/ephy-dialog.c2
-rw-r--r--src/ephy-encoding-dialog.c65
3 files changed, 25 insertions, 51 deletions
diff --git a/ChangeLog b/ChangeLog
index dcd2ca79b..d7ba62828 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2003-11-19 Christian Persch <chpe@cvs.gnome.org>
+ * lib/ephy-dialog.c: (ephy_dialog_set_parent):
+ * src/ephy-encoding-dialog.c: (sync_parent_window_cb),
+ (ephy_encoding_dialog_init), (ephy_encoding_dialog_class_init),
+ (ephy_encoding_dialog_new):
+
+ Make encodings dialogue transient.
+
+2003-11-19 Christian Persch <chpe@cvs.gnome.org>
+
* embed/ephy-embed.c: (ephy_embed_base_init),
(ephy_embed_get_location), (ephy_embed_get_link_message),
(ephy_embed_get_js_status):
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index bd4ff0cd4..78e72af93 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -938,6 +938,8 @@ ephy_dialog_set_parent (EphyDialog *dialog,
gtk_window_set_transient_for (GTK_WINDOW (dialog->priv->dialog),
GTK_WINDOW (parent));
+
+ g_object_notify (G_OBJECT (dialog), "ParentWindow");
}
EphyDialog *
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index 02160cf69..6338c93a6 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -77,12 +77,6 @@ void ephy_encoding_dialog_response_cb (GtkWidget *widget,
gint response,
EphyEncodingDialog *dialog);
-enum
-{
- PROP_0,
- PROP_WINDOW
-};
-
static GObjectClass *parent_class = NULL;
GType
@@ -186,8 +180,18 @@ sync_active_tab (EphyWindow *window, GParamSpec *pspec, EphyEncodingDialog *dial
}
static void
-ephy_encoding_dialog_set_window (EphyEncodingDialog *dialog, EphyWindow *window)
+sync_parent_window_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy)
{
+ EphyWindow *window;
+ GValue value = { 0, };
+
+ g_return_if_fail (dialog->priv->window == NULL);
+
+ g_value_init (&value, GTK_TYPE_WIDGET);
+ g_object_get_property (G_OBJECT (dialog), "ParentWindow", &value);
+ window = EPHY_WINDOW (g_value_get_object (&value));
+ g_value_unset (&value);
+
g_return_if_fail (EPHY_IS_WINDOW (window));
dialog->priv->window = window;
@@ -359,6 +363,8 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
dialog->priv->enc_view = treeview;
+ g_signal_connect (G_OBJECT (dialog), "notify::ParentWindow",
+ G_CALLBACK (sync_parent_window_cb), NULL);
g_signal_connect (G_OBJECT (dialog), "notify::embed",
G_CALLBACK (sync_embed_cb), NULL);
}
@@ -381,38 +387,6 @@ ephy_encoding_dialog_finalize (GObject *object)
}
static void
-ephy_encoding_dialog_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EphyEncodingDialog *dialog = EPHY_ENCODING_DIALOG (object);
-
- switch (prop_id)
- {
- case PROP_WINDOW:
- ephy_encoding_dialog_set_window (dialog, g_value_get_object (value));
- break;
- }
-}
-
-static void
-ephy_encoding_dialog_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EphyEncodingDialog *dialog = EPHY_ENCODING_DIALOG (object);
-
- switch (prop_id)
- {
- case PROP_WINDOW:
- g_value_set_object (value, dialog->priv->window);
- break;
- }
-}
-
-static void
ephy_encoding_dialog_class_init (EphyEncodingDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -420,17 +394,6 @@ ephy_encoding_dialog_class_init (EphyEncodingDialogClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = ephy_encoding_dialog_finalize;
- object_class->get_property = ephy_encoding_dialog_get_property;
- object_class->set_property = ephy_encoding_dialog_set_property;
-
- g_object_class_install_property (object_class,
- PROP_WINDOW,
- g_param_spec_object ("window",
- "Window",
- "Parent window",
- EPHY_TYPE_WINDOW,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (object_class, sizeof(EphyEncodingDialogPrivate));
}
@@ -439,6 +402,6 @@ EphyEncodingDialog *
ephy_encoding_dialog_new (EphyWindow *parent)
{
return g_object_new (EPHY_TYPE_ENCODING_DIALOG,
- "window", parent,
+ "ParentWindow", parent,
NULL);
}