svnno****@sourc*****
svnno****@sourc*****
Wed Mar 28 10:14:22 JST 2007
Revision: 3068 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3068 Author: ikezoe Date: 2007-03-28 10:14:21 +0900 (Wed, 28 Mar 2007) Log Message: ----------- * src/dialogs/kz-links-dialog.[ch]: kz_links_dialog_new gets GtkWindow instead of KzWindow as an argument. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/dialogs/kz-links-dialog.c kazehakase/trunk/src/dialogs/kz-links-dialog.h Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2007-03-28 00:58:36 UTC (rev 3067) +++ kazehakase/trunk/ChangeLog 2007-03-28 01:14:21 UTC (rev 3068) @@ -6,6 +6,8 @@ gets GtkWindow instead of KzWindow as an argument. * src/dialogs/kz-password-manager-dialog.[ch]: kz_password_manager_dialog_new gets GtkWindow instead of KzWindow as an argument. + * src/dialogs/kz-links-dialog.[ch]: kz_links_dialog_new + gets GtkWindow instead of KzWindow as an argument. 2007-03-28 Kouhei Sutou <kou****@cozmi*****> Modified: kazehakase/trunk/src/dialogs/kz-links-dialog.c =================================================================== --- kazehakase/trunk/src/dialogs/kz-links-dialog.c 2007-03-28 00:58:36 UTC (rev 3067) +++ kazehakase/trunk/src/dialogs/kz-links-dialog.c 2007-03-28 01:14:21 UTC (rev 3068) @@ -25,12 +25,13 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> +#include "kz-window.h" #include "kz-bookmark-filter.h" #include "kz-icons.h" enum { PROP_0, - PROP_KZ_WINDOW, + PROP_PARENT_WINDOW, PROP_KZ_EMBED, PROP_SELECTED_ONLY }; @@ -99,11 +100,11 @@ g_object_class_install_property (gobject_class, - PROP_KZ_WINDOW, - g_param_spec_object("kz-window", - _("KzWindow"), + PROP_PARENT_WINDOW, + g_param_spec_object("parent-window", + _("ParentWindow"), _("The parent kazehakase window"), - KZ_TYPE_WINDOW, + GTK_TYPE_WINDOW, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property @@ -136,7 +137,7 @@ GtkTreeViewColumn *col; GtkTreeSelection *selection; - kzlinks->kz = NULL; + kzlinks->parent_window = NULL; kzlinks->kzembed = NULL; kzlinks->selected_only = FALSE; @@ -228,7 +229,7 @@ kzlinks = KZ_LINKS_DIALOG(object); widget = GTK_WIDGET(kzlinks); - g_signal_connect(kzlinks->kz, "destroy", + g_signal_connect(kzlinks->parent_window, "destroy", G_CALLBACK(cb_parent_destroy), kzlinks); g_signal_connect(kzlinks->kzembed, "destroy", G_CALLBACK(cb_parent_destroy), kzlinks); @@ -272,14 +273,14 @@ { KzLinksDialog *kzlinks = KZ_LINKS_DIALOG(object); - if (kzlinks->kz) + if (kzlinks->parent_window) { g_signal_handlers_disconnect_by_func - (kzlinks->kz, + (kzlinks->parent_window, G_CALLBACK(cb_parent_destroy), kzlinks); - g_object_unref(kzlinks->kz); - kzlinks->kz = NULL; + g_object_unref(kzlinks->parent_window); + kzlinks->parent_window = NULL; } if (kzlinks->kzembed) @@ -313,8 +314,8 @@ switch (prop_id) { - case PROP_KZ_WINDOW: - kzlinks->kz = g_object_ref(g_value_get_object(value)); + case PROP_PARENT_WINDOW: + kzlinks->parent_window = g_object_ref(g_value_get_object(value)); break; case PROP_KZ_EMBED: kzlinks->kzembed = g_object_ref(g_value_get_object(value)); @@ -339,8 +340,8 @@ switch (prop_id) { - case PROP_KZ_WINDOW: - g_value_set_object(value, kzlinks->kz); + case PROP_PARENT_WINDOW: + g_value_set_object(value, kzlinks->parent_window); break; case PROP_KZ_EMBED: g_value_set_object(value, kzlinks->kzembed); @@ -356,12 +357,12 @@ GtkWidget * -kz_links_dialog_new (KzWindow *kz, KzEmbed *kzembed, gboolean selected_only) +kz_links_dialog_new (GtkWindow *parent_window, KzEmbed *kzembed, gboolean selected_only) { GtkWidget *widget; widget = GTK_WIDGET(g_object_new(KZ_TYPE_LINKS_DIALOG, - "kz-window", kz, + "parent-window", parent_window, "kz-embed", kzembed, "selected-only", selected_only, NULL)); @@ -492,7 +493,7 @@ g_return_if_fail (KZ_IS_LINKS_DIALOG(dialog)); kzlinks = KZ_LINKS_DIALOG(dialog); - if (!kzlinks->kz || !kzlinks->kzembed) return; + if (!kzlinks->parent_window || !kzlinks->kzembed) return; switch (arg) { case GTK_RESPONSE_YES: @@ -529,13 +530,16 @@ gchar *url; g_return_if_fail(KZ_IS_LINKS_DIALOG(kzlinks)); + g_return_if_fail(KZ_IS_WINDOW(kzlinks->parent_window)); gtk_tree_model_get(GTK_TREE_MODEL(kzlinks->list_store), iter, 1, &url, -1); if (url && *url) - kz_window_open_new_tab_with_parent(kzlinks->kz, url, - GTK_WIDGET(kzlinks->kzembed)); + { + kz_window_open_new_tab_with_parent(KZ_WINDOW(kzlinks->parent_window), + url, GTK_WIDGET(kzlinks->kzembed)); + } g_free(url); } Modified: kazehakase/trunk/src/dialogs/kz-links-dialog.h =================================================================== --- kazehakase/trunk/src/dialogs/kz-links-dialog.h 2007-03-28 00:58:36 UTC (rev 3067) +++ kazehakase/trunk/src/dialogs/kz-links-dialog.h 2007-03-28 01:14:21 UTC (rev 3068) @@ -23,7 +23,6 @@ #include <gtk/gtk.h> -#include "kz-window.h" #include "kz-embed.h" G_BEGIN_DECLS @@ -43,7 +42,7 @@ { GtkDialog parent; - KzWindow *kz; + GtkWindow *parent_window; KzEmbed *kzembed; GtkWidget *scrolled_window; @@ -59,7 +58,7 @@ }; GType kz_links_dialog_get_type (void) G_GNUC_CONST; -GtkWidget *kz_links_dialog_new (KzWindow *kz, +GtkWidget *kz_links_dialog_new (GtkWindow *parent_window, KzEmbed *kzembed, gboolean selected_only);