EvLinkDest *dest;
EvDocument *document;
- EvDocument *password_document;
+
EvPageCache *page_cache;
EvWindowPageMode page_mode;
EvWindowTitle *title;
static void ev_window_stop_presentation (EvWindow *window);
static void ev_window_cmd_view_presentation (GtkAction *action,
EvWindow *window);
+static void ev_window_run_preview (EvWindow *window);
static void ev_view_popup_cmd_open_link (GtkAction *action,
EvWindow *window);
static void ev_view_popup_cmd_copy_link_address (GtkAction *action,
}
}
-void
-ev_window_open_page_label (EvWindow *ev_window,
- const char *label)
-{
- if (ev_window->priv->page_cache) {
- ev_page_cache_set_page_label (ev_window->priv->page_cache,
- label);
- }
-}
-
gboolean
ev_window_is_empty (const EvWindow *ev_window)
{
window->priv->chrome = chrome;
}
-
static void
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)) {
} 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)) {
password = ev_password_dialog_get_password (EV_PASSWORD_DIALOG (password_dialog));
if (password) {
ev_document_doc_mutex_lock ();
- ev_document_security_set_password (EV_DOCUMENT_SECURITY (ev_window->priv->password_document),
+ ev_document_security_set_password (EV_DOCUMENT_SECURITY (ev_window->priv->xfer_job->document),
password);
ev_document_doc_mutex_unlock ();
}
ev_password_dialog_save_password (EV_PASSWORD_DIALOG (password_dialog));
- g_object_unref (ev_window->priv->password_document);
- ev_window->priv->password_document = NULL;
-
ev_window_title_set_type (ev_window->priv->title, EV_WINDOW_TITLE_DOCUMENT);
ev_job_queue_add_job (ev_window->priv->xfer_job, EV_JOB_PRIORITY_HIGH);
static void
ev_window_popup_password_dialog (EvWindow *ev_window)
{
- g_assert (ev_window->priv->password_document);
+ g_assert (ev_window->priv->xfer_job);
gtk_widget_set_sensitive (ev_window->priv->password_view, FALSE);
ev_view_set_loading (EV_VIEW (ev_window->priv->view), FALSE);
- if (ev_window->priv->password_document) {
- g_object_unref (ev_window->priv->password_document);
- ev_window->priv->password_document = NULL;
- }
-
/* Success! */
if (job->error == NULL) {
ev_window_setup_document (ev_window);
ev_window_add_recent (ev_window, ev_window->priv->uri);
- ev_window_clear_xfer_job (ev_window);
- if (ev_window->priv->dest)
- ev_window_goto_dest (ev_window, ev_window->priv->dest);
-
+ if (job->dest)
+ ev_window_goto_dest (ev_window, job->dest);
+
+ switch (job->mode) {
+ case EV_WINDOW_MODE_FULLSCREEN:
+ ev_window_run_fullscreen (ev_window);
+ break;
+ case EV_WINDOW_MODE_PRESENTATION:
+ ev_window_run_presentation (ev_window);
+ break;
+ case EV_WINDOW_MODE_PREVIEW:
+ ev_window_run_preview (ev_window);
+ break;
+ default:
+ break;
+ }
+
+ ev_window_clear_xfer_job (ev_window);
return;
}
ev_window->priv->uri = g_strdup (job->uri);
setup_view_from_metadata (ev_window);
- ev_window->priv->password_document = g_object_ref (document);
file_name = gnome_vfs_format_uri_for_display (job->uri);
base_name = g_path_get_basename (file_name);
}
void
-ev_window_open_uri (EvWindow *ev_window, const char *uri, EvLinkDest *dest)
+ev_window_open_uri (EvWindow *ev_window,
+ const char *uri,
+ EvLinkDest *dest,
+ EvWindowRunMode mode)
{
- g_free (ev_window->priv->uri);
- ev_window->priv->uri = NULL;
-
- if (ev_window->priv->dest)
- g_object_unref (ev_window->priv->dest);
- ev_window->priv->dest = dest ? g_object_ref (dest) : NULL;
-
ev_window_close_dialogs (ev_window);
ev_window_clear_xfer_job (ev_window);
ev_window_clear_local_uri (ev_window);
ev_view_set_loading (EV_VIEW (ev_window->priv->view), TRUE);
- ev_window->priv->xfer_job = ev_job_xfer_new (uri);
+ ev_window->priv->xfer_job = ev_job_xfer_new (uri, dest, mode);
g_signal_connect (ev_window->priv->xfer_job,
"finished",
G_CALLBACK (ev_window_xfer_job_cb),
if (err) {
gchar *msg;
- msg = g_strdup_printf (_("The file could not be saved as \"%s\"."), uri);
+ msg = g_strdup_printf (_("The file could not be saved as ā%sā."), uri);
ev_window_error_dialog (GTK_WINDOW (fc), msg, err);
g_free (msg);
}
ev_document_factory_add_filters (fc, ev_window->priv->document);
gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
-#ifdef HAVE_GTK_FILE_CHOOSER_SET_DO_OVERWRITE_CONFIRMATION
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (fc), TRUE);
-#endif
file_name = gnome_vfs_format_uri_for_display (ev_window->priv->uri);
base_name = g_path_get_basename (file_name);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (fc), base_name);
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
_("Printing is not supported on this printer."));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- _("You were trying to print to a printer using the \"%s\" driver. This program requires a PostScript printer driver."),
+ _("You were trying to print to a printer using the ā%sā driver. This program requires a PostScript printer driver."),
gnome_print_config_get (config, (guchar *)"Settings.Engine.Backend.Driver"));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
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);
}
}
+static void
+ev_window_run_preview (EvWindow *window)
+{
+ EggToolbarsModel *model;
+ EggTbModelFlags flags;
+
+ model = egg_toolbars_model_new ();
+
+ egg_toolbars_model_load_toolbars (model,
+ DATADIR"/evince-toolbar.xml");
+
+ flags = egg_toolbars_model_get_flags (model, 1);
+ egg_toolbars_model_set_flags (model, 1, flags &= ~(EGG_TB_MODEL_HIDDEN));
+
+ egg_editable_toolbar_set_model (EGG_EDITABLE_TOOLBAR (window->priv->toolbar),
+ model);
+
+ egg_editable_toolbar_hide (EGG_EDITABLE_TOOLBAR (window->priv->toolbar),
+ "DefaultToolBar");
+ egg_editable_toolbar_show (EGG_EDITABLE_TOOLBAR (window->priv->toolbar),
+ "PreviewToolBar");
+
+ ev_view_set_continuous (EV_VIEW (window->priv->view), FALSE);
+
+ update_chrome_flag (window, EV_CHROME_MENUBAR, FALSE);
+ update_chrome_flag (window, EV_CHROME_SIDEBAR, FALSE);
+ update_chrome_visibility (window);
+}
+
static gboolean
ev_window_focus_in_event (GtkWidget *widget, GdkEventFocus *event)
{
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);
ev_window_cmd_view_reload (GtkAction *action, EvWindow *ev_window)
{
char *uri;
- int page;
g_return_if_fail (EV_IS_WINDOW (ev_window));
- page = ev_page_cache_get_current_page (ev_window->priv->page_cache);
uri = g_strdup (ev_window->priv->uri);
- ev_window_open_uri (ev_window, uri, NULL);
-
- /* In case the number of pages in the document has changed. */
- page = CLAMP (page, 0, ev_page_cache_get_n_pages (ev_window->priv->page_cache) - 1);
-
- ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
+ ev_window_open_uri (ev_window, uri, NULL, 0);
g_free (uri);
}
};
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")
};
"documenters", documenters,
"translator-credits", _("translator-credits"),
"logo-icon-name", "evince",
+ "wrap-license", TRUE,
NULL);
g_free (comments);
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));
}
if (priv->local_uri) {
ev_window_clear_local_uri (window);
}
-
- if (priv->password_document) {
- g_object_unref (priv->password_document);
- priv->password_document = NULL;
- }
ev_window_close_dialogs (window);
ev_application_open_uri_at_dest (EV_APP, uri,
ev_link_action_get_dest (action),
+ 0,
GDK_CURRENT_TIME);
g_free (uri);
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
-
-#ifdef HAVE_GTK_FILE_CHOOSER_SET_DO_OVERWRITE_CONFIRMATION
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
-#endif
if (attachment)
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (fc),
ev_window->priv = EV_WINDOW_GET_PRIVATE (ev_window);
- ev_window->priv->dest = NULL;
-
ev_window->priv->page_mode = PAGE_MODE_DOCUMENT;
ev_window->priv->title = ev_window_title_new (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,
"popup",
G_CALLBACK (attachment_bar_menu_popup_cb),
ev_window, 0);
+ gtk_widget_show (sidebar_widget);
ev_sidebar_add_page (EV_SIDEBAR (ev_window->priv->sidebar),
sidebar_widget);
update_chrome_visibility (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);