From 370874c6ca4c695eeba57ec7f7d059830287e637 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 20 Jul 2003 11:05:16 +0000 Subject: Rework find implementation to integrate better with type ahead and to 2003-07-20 Marco Pesenti Gritti * embed/ephy-embed.c: (ephy_embed_find_set_properties), (ephy_embed_find_next): * embed/ephy-embed.h: * embed/find-dialog.c: (update_navigation_controls), (impl_show), (find_dialog_class_init), (set_properties), (sync_page_change), (sync_embed), (find_dialog_init), (find_dialog_finalize), (find_dialog_go_next), (find_dialog_go_prev), (find_close_button_clicked_cb), (find_next_button_clicked_cb), (find_prev_button_clicked_cb), (find_entry_changed_cb), (find_check_toggled_cb): * embed/find-dialog.h: * embed/mozilla/EphyWrapper.cpp: * embed/mozilla/EphyWrapper.h: * embed/mozilla/Makefile.am: * embed/mozilla/mozilla-embed.cpp: * lib/ephy-dialog.h: * src/ephy-window.c: (ephy_window_find): * src/ephy-window.h: * src/window-commands.c: (window_cmd_edit_find), (window_cmd_edit_find_next), (window_cmd_edit_find_prev): Rework find implementation to integrate better with type ahead and to simplify the code. Do not try to set menus sensitivity because mozilla doesnt provide an api for it and it breaks with type ahead. * lib/ephy-dialog.c: (ephy_dialog_class_init), (ephy_dialog_finalize), (dialog_destroy_cb), (impl_construct), (ephy_dialog_construct): Remove no more used destruct crap. --- lib/ephy-dialog.c | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) (limited to 'lib/ephy-dialog.c') diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index aa5ed1a16..1b182e0aa 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -51,10 +51,6 @@ impl_construct (EphyDialog *dialog, const EphyDialogProperty *properties, const char *file, const char *name); - -static void -impl_destruct (EphyDialog *dialog); - static GtkWidget * impl_get_control (EphyDialog *dialog, int property_id); @@ -161,7 +157,6 @@ ephy_dialog_class_init (EphyDialogClass *klass) klass->get_value = impl_get_value; klass->run = impl_run; klass->show = impl_show; - klass->destruct = impl_destruct; g_object_class_install_property (object_class, PROP_PARENT_WINDOW, @@ -939,7 +934,7 @@ ephy_dialog_finalize (GObject *object) if (dialog->priv->dialog) { - ephy_dialog_destruct (dialog); + gtk_widget_destroy (dialog->priv->dialog); } free_props (dialog->priv->props); @@ -1064,15 +1059,6 @@ init_props (const EphyDialogProperty *properties, GladeXML *gxml) return props; } -static void -dialog_destruction_notify (EphyDialog *dialog, - GObject *where_the_object_was) -{ - dialog->priv->dialog = NULL; - ephy_dialog_destruct (dialog); - g_object_unref (dialog); -} - static void dialog_destroy_cb (GtkWidget *widget, EphyDialog *dialog) { @@ -1081,6 +1067,8 @@ dialog_destroy_cb (GtkWidget *widget, EphyDialog *dialog) { save_props (dialog->priv->props); } + + g_object_unref (dialog); } static void @@ -1110,23 +1098,6 @@ impl_construct (EphyDialog *dialog, dialog); g_object_unref (gxml); - - g_object_weak_ref (G_OBJECT(dialog->priv->dialog), - (GWeakNotify)dialog_destruction_notify, - dialog); -} - -static void -impl_destruct (EphyDialog *dialog) -{ - if (dialog->priv->dialog) - { - g_object_weak_unref (G_OBJECT(dialog->priv->dialog), - (GWeakNotify)dialog_destruction_notify, - dialog); - gtk_widget_destroy (dialog->priv->dialog); - dialog->priv->dialog = NULL; - } } static GtkWidget * @@ -1245,13 +1216,6 @@ ephy_dialog_construct (EphyDialog *dialog, return klass->construct (dialog, properties, file, name); } -void -ephy_dialog_destruct (EphyDialog *dialog) -{ - EphyDialogClass *klass = EPHY_DIALOG_GET_CLASS (dialog); - klass->destruct (dialog); -} - gint ephy_dialog_run (EphyDialog *dialog) { -- cgit