Hiroyuki Ikezoe
ikezo****@users*****
Thu Jan 4 11:34:46 JST 2007
Index: kazehakase/src/kz-notebook.c diff -u kazehakase/src/kz-notebook.c:1.6 kazehakase/src/kz-notebook.c:1.7 --- kazehakase/src/kz-notebook.c:1.6 Thu Jan 4 11:12:17 2007 +++ kazehakase/src/kz-notebook.c Thu Jan 4 11:34:46 2007 @@ -321,6 +321,17 @@ } } +static gboolean +idle_focus_location_entry(gpointer data) +{ + KzWindow *kz = KZ_WINDOW(data); + g_return_val_if_fail(KZ_IS_WINDOW(kz), FALSE); + + kz_window_activate_action(kz, "FocusLocationEntry"); + + return FALSE; +} + static void switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num) { @@ -347,7 +358,18 @@ g_return_if_fail(tab); if(kz_tab_label_get_state(tab) == KZ_TAB_LABEL_STATE_LOADED) + { + const gchar *location; + gboolean focus; kz_tab_label_set_state(tab, KZ_TAB_LABEL_STATE_NORMAL); + location = kz_embed_get_location(kzembed); + if((!location || *location == 0) && + KZ_CONF_GET("Tab", "focus_loc_ent_new", focus, BOOL) && + focus) + { + g_idle_add(idle_focus_location_entry, KZ_NOTEBOOK(notebook)->kz); + } + } if (GTK_NOTEBOOK_CLASS(kz_notebook_parent_class)->switch_page) GTK_NOTEBOOK_CLASS(kz_notebook_parent_class)->switch_page(notebook, page, page_num); Index: kazehakase/src/kz-window.c diff -u kazehakase/src/kz-window.c:1.296 kazehakase/src/kz-window.c:1.297 --- kazehakase/src/kz-window.c:1.296 Thu Jan 4 11:29:05 2007 +++ kazehakase/src/kz-window.c Thu Jan 4 11:34:46 2007 @@ -1986,18 +1986,6 @@ } -static gboolean -idle_focus_location_entry(gpointer data) -{ - KzWindow *kz = KZ_WINDOW(data); - g_return_val_if_fail(KZ_IS_WINDOW(kz), FALSE); - - kz_window_activate_action(kz, "FocusLocationEntry"); - - return FALSE; -} - - static void cb_clipboard_get_text(GtkClipboard *clipboard, const gchar *text, gpointer data) { @@ -2015,7 +2003,6 @@ const gchar *location; GtkAction *action; KzTabLabel *tab; - gboolean focus; g_return_if_fail(KZ_IS_EMBED(cur)); g_return_if_fail(KZ_IS_EMBED(kzembed)); @@ -2057,14 +2044,6 @@ tab = KZ_TAB_LABEL(kz_window_get_tab_label(kz, GTK_WIDGET(kzembed))); g_return_if_fail(tab); - if((!location || *location == 0) && - KZ_CONF_GET("Tab", "focus_loc_ent_new", focus, BOOL) && - focus && - kz_tab_label_get_state(tab) == KZ_TAB_LABEL_STATE_LOADED) - { - g_idle_add(idle_focus_location_entry, kz); - } - kz_actions_set_sensitive(kz, kzembed); kz_actions_set_tab_sensitive(kz, kzembed);