X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-window.c;h=29b6a039b17b6987ac0df4487897b95be378bd2a;hb=3975d110064cd88af69d393f956f8158aae1878f;hp=d30e9cb4d784c822fb7a0b970c1c71143d8166a2;hpb=70f641411b2fbab930b481ac844984819b48805d;p=evince.git diff --git a/shell/ev-window.c b/shell/ev-window.c index d30e9cb4..29b6a039 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -616,7 +616,6 @@ setup_chrome_from_metadata (EvWindow *window) window->priv->chrome = chrome; } - static void setup_sidebar_from_metadata (EvWindow *window, EvDocument *document) { @@ -633,8 +632,8 @@ setup_sidebar_from_metadata (EvWindow *window, EvDocument *document) gtk_paned_set_position (GTK_PANED (window->priv->hpaned), g_value_get_int (&sidebar_size)); } - - if (ev_metadata_manager_get (uri, "sidebar_page", &sidebar_page, FALSE)) { + + if (document && ev_metadata_manager_get (uri, "sidebar_page", &sidebar_page, FALSE)) { const char *page_id = g_value_get_string (&sidebar_page); if (strcmp (page_id, LINKS_SIDEBAR_ID) == 0 && ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (links), document)) { @@ -644,10 +643,8 @@ setup_sidebar_from_metadata (EvWindow *window, EvDocument *document) } else if (strcmp (page_id, ATTACHMENTS_SIDEBAR_ID) && ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (attachments), document)) { ev_sidebar_set_page (EV_SIDEBAR (sidebar), thumbs); } - } else { - if (ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (links), document)) { - ev_sidebar_set_page (EV_SIDEBAR (sidebar), links); - } + } else if (document && ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (links), document)) { + ev_sidebar_set_page (EV_SIDEBAR (sidebar), links); } if (ev_metadata_manager_get (uri, "sidebar_visibility", &sidebar_visibility, FALSE)) { @@ -1655,7 +1652,7 @@ ev_window_create_fullscreen_popup (EvWindow *window) GdkScreen *screen; window->priv->fullscreen_toolbar = egg_editable_toolbar_new_with_model - (window->priv->ui_manager, ev_application_get_toolbars_model (EV_APP)); + (window->priv->ui_manager, ev_application_get_toolbars_model (EV_APP), NULL); popup = gtk_window_new (GTK_WINDOW_POPUP); hbox = gtk_hbox_new (FALSE, 0); @@ -1991,8 +1988,6 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window) gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor); - egg_toolbar_editor_load_actions (EGG_TOOLBAR_EDITOR (editor), - DATADIR "/evince-toolbar.xml"); egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (ev_window->priv->toolbar), TRUE); @@ -2373,16 +2368,16 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window) }; const char *license[] = { - N_("Evince is free software; you can redistribute it and/or modify\n" - "it under the terms of the GNU General Public License as published by\n" - "the Free Software Foundation; either version 2 of the License, or\n" + N_("Evince is free software; you can redistribute it and/or modify " + "it under the terms of the GNU General Public License as published by " + "the Free Software Foundation; either version 2 of the License, or " "(at your option) any later version.\n"), - N_("Evince is distributed in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + N_("Evince is distributed in the hope that it will be useful, " + "but WITHOUT ANY WARRANTY; without even the implied warranty of " + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " "GNU General Public License for more details.\n"), - N_("You should have received a copy of the GNU General Public License\n" - "along with Evince; if not, write to the Free Software Foundation, Inc.,\n" + N_("You should have received a copy of the GNU General Public License " + "along with Evince; if not, write to the Free Software Foundation, Inc., " "59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n") }; @@ -2416,6 +2411,7 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window) "documenters", documenters, "translator-credits", _("translator-credits"), "logo-icon-name", "evince", + "wrap-license", TRUE, NULL); g_free (comments); @@ -2478,8 +2474,7 @@ ev_window_sidebar_visibility_changed_cb (EvSidebar *ev_sidebar, GTK_WIDGET_VISIBLE (ev_sidebar)); if (!ev_view_get_presentation (view) && - !ev_view_get_fullscreen (view) && - !ev_window_is_empty (ev_window)) { + !ev_view_get_fullscreen (view)) { ev_metadata_manager_set_boolean (ev_window->priv->uri, "sidebar_visibility", GTK_WIDGET_VISIBLE (ev_sidebar)); } @@ -3551,7 +3546,7 @@ ev_window_init (EvWindow *ev_window) gtk_widget_show (toolbar_dock); ev_window->priv->toolbar = egg_editable_toolbar_new_with_model - (ev_window->priv->ui_manager, ev_application_get_toolbars_model (EV_APP)); + (ev_window->priv->ui_manager, ev_application_get_toolbars_model (EV_APP), NULL); egg_editable_toolbar_show (EGG_EDITABLE_TOOLBAR (ev_window->priv->toolbar), "DefaultToolBar"); gtk_box_pack_start (GTK_BOX (toolbar_dock), ev_window->priv->toolbar, @@ -3758,6 +3753,7 @@ ev_window_init (EvWindow *ev_window) gtk_window_set_default_size (GTK_WINDOW (ev_window), 600, 600); setup_view_from_metadata (ev_window); + setup_sidebar_from_metadata (ev_window, NULL); ev_window_sizing_mode_changed_cb (EV_VIEW (ev_window->priv->view), NULL, ev_window); ev_window_setup_action_sensitivity (ev_window);