diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-01-23 08:34:12 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-01-23 08:34:12 +0800 |
commit | 7fe73f1990a361a3c794ef5517e2cb4d3188466e (patch) | |
tree | c1b0382e254dd9dd3c53072f397f40bb60675738 /src/ppview-toolbar.c | |
parent | 5d0ba75eb24a3acee481ce987b6003ef36195c94 (diff) | |
download | gsoc2013-epiphany-7fe73f1990a361a3c794ef5517e2cb4d3188466e.tar.gz gsoc2013-epiphany-7fe73f1990a361a3c794ef5517e2cb4d3188466e.tar.zst gsoc2013-epiphany-7fe73f1990a361a3c794ef5517e2cb4d3188466e.zip |
Fix autocompletion to not show duped entries. Complete print preview impl.
2003-01-23 Marco Pesenti Gritti <marco@it.gnome.org>
* TODO:
* lib/ephy-autocompletion.c: (ephy_autocompletion_reset),
(ephy_autocompletion_set_key),
(ephy_autocompletion_update_matches_full):
* lib/widgets/ephy-location-entry.c:
(get_editable_number_of_chars), (position_is_at_end),
(ephy_location_entry_key_press_event_cb):
* src/ephy-favicon-action.c: (ephy_favicon_action_finalize):
* src/ephy-favorites-menu.c: (ephy_favorites_menu_finalize_impl),
(ephy_favorites_menu_rebuild):
* src/ephy-window.c: (add_widget), (setup_window),
(ephy_window_finalize), (ephy_window_set_chrome):
* src/ppview-toolbar.c: (toolbar_update_sensitivity),
(ppview_toolbar_set_window), (toolbar_cmd_ppv_close):
* src/toolbar.c: (toolbar_setup_widgets), (toolbar_finalize):
Fix autocompletion to not show duped entries.
Complete print preview impl.
Fix actions referencing, a bug in egg still blocking it though.
Diffstat (limited to 'src/ppview-toolbar.c')
-rwxr-xr-x | src/ppview-toolbar.c | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c index fea06c2d7..78b3b33d9 100755 --- a/src/ppview-toolbar.c +++ b/src/ppview-toolbar.c @@ -33,11 +33,6 @@ #include <gtk/gtkentry.h> #include <gtk/gtkmenu.h> -#define PPV_GOTO_FIRST_PATH "/commands/PPVGotoFirst" -#define PPV_GOTO_LAST_PATH "/commands/PPVGotoLast" -#define PPV_GO_BACK_PATH "/commands/PPVGoBack" -#define PPV_GO_FORWARD_PATH "/commands/PPVGoForward" - static void ppview_toolbar_class_init (PPViewToolbarClass *klass); static void ppview_toolbar_init (PPViewToolbar *t); static void ppview_toolbar_finalize (GObject *object); @@ -64,6 +59,7 @@ static GObjectClass *parent_class = NULL; struct PPViewToolbarPrivate { EphyWindow *window; + EmbedChromeMask original_mask; EggMenuMerge *ui_merge; EggActionGroup *action_group; guint ui_id; @@ -208,6 +204,31 @@ ppview_toolbar_get_property (GObject *object, } static void +toolbar_update_sensitivity (PPViewToolbar *t) +{ + int pages, c_page; + EphyWindow *window = t->priv->window; + EphyEmbed *embed; + EggAction *action; + EggActionGroup *action_group = t->priv->action_group; + + embed = ephy_window_get_active_embed (window); + g_return_if_fail (embed != NULL); + + ephy_embed_print_preview_num_pages (embed, &pages); + c_page = t->priv->current_page; + + action = egg_action_group_get_action (action_group, "PPVGoBack"); + g_object_set (action, "sensitive", c_page > 1, NULL); + action = egg_action_group_get_action (action_group, "PPVGotoFirst"); + g_object_set (action, "sensitive", c_page > 1, NULL); + action = egg_action_group_get_action (action_group, "PPVGoForward"); + g_object_set (action, "sensitive", c_page < pages, NULL); + action = egg_action_group_get_action (action_group, "PPVGotoLast"); + g_object_set (action, "sensitive", c_page < pages, NULL); +} + +static void ppview_toolbar_set_window (PPViewToolbar *t, EphyWindow *window) { g_return_if_fail (t->priv->window == NULL); @@ -215,12 +236,16 @@ ppview_toolbar_set_window (PPViewToolbar *t, EphyWindow *window) t->priv->window = window; t->priv->ui_merge = EGG_MENU_MERGE (t->priv->window->ui_merge); + t->priv->original_mask = ephy_window_get_chrome (window); + t->priv->action_group = egg_action_group_new ("PPViewActions"); egg_action_group_add_actions (t->priv->action_group, entries, n_entries); egg_menu_merge_insert_action_group (t->priv->ui_merge, t->priv->action_group, 0); t->priv->ui_id = egg_menu_merge_add_ui_from_string (t->priv->ui_merge, ui_info, -1, NULL); + + toolbar_update_sensitivity (t); } static void @@ -273,30 +298,6 @@ ppview_toolbar_new (EphyWindow *window) } static void -toolbar_update_sensitivity (PPViewToolbar *t) -{ - int pages, c_page; - EphyWindow *window = t->priv->window; - EphyEmbed *embed; - - embed = ephy_window_get_active_embed (window); - g_return_if_fail (embed != NULL); - - ephy_embed_print_preview_num_pages (embed, &pages); - c_page = t->priv->current_page; -/* - ephy_bonobo_set_sensitive (t->priv->ui_component, - PPV_GO_BACK_PATH, c_page > 1); - ephy_bonobo_set_sensitive (t->priv->ui_component, - PPV_GOTO_FIRST_PATH, c_page > 1); - ephy_bonobo_set_sensitive (t->priv->ui_component, - PPV_GO_FORWARD_PATH, c_page < pages); - ephy_bonobo_set_sensitive (t->priv->ui_component, - PPV_GOTO_LAST_PATH, c_page < pages); - */ -} - -static void toolbar_cmd_ppv_goto_first (EggMenuMerge *merge, PPViewToolbar *t) { @@ -375,5 +376,14 @@ static void toolbar_cmd_ppv_close (EggMenuMerge *merge, PPViewToolbar *t) { + EphyWindow *window = t->priv->window; + EphyEmbed *embed; + + embed = ephy_window_get_active_embed (window); + g_return_if_fail (embed != NULL); + + ephy_window_set_chrome (t->priv->window, t->priv->original_mask); + + ephy_embed_print_preview_close (embed); } |