+2008-11-01 Carlos Garcia Campos <carlosgc@gnome.org>
+
+ * shell/ev-window.c: (ev_window_error_message),
+ (ev_window_warning_message), (ev_window_set_document),
+ (ev_window_load_job_cb), (ev_window_load_remote_failed),
+ (ev_window_cmd_file_open_copy_at_dest), (ev_window_save_job_cb),
+ (ev_window_cmd_help_contents), (launch_external_uri),
+ (image_save_dialog_response_cb),
+ (ev_attachment_popup_cmd_open_attachment),
+ (attachment_save_dialog_response_cb):
+
+ Change ev_window_error_message and ev_window_warning_message to
+ receive a EvWindow instead of a GtkWindow. It's more consistent
+ and avoids unneeded casts.
+
2008-11-01 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-window.c: (ev_window_cmd_help_contents):
}
static void
-ev_window_error_message (GtkWindow *window, const gchar *msg, GError *error)
+ev_window_error_message (EvWindow *window, const gchar *msg, GError *error)
{
GtkWidget *area;
- if (EV_WINDOW (window)->priv->message_area)
+ if (window->priv->message_area)
return;
area = ev_message_area_new (GTK_MESSAGE_ERROR,
G_CALLBACK (ev_window_message_area_response_cb),
window);
gtk_widget_show (area);
- ev_window_set_message_area (EV_WINDOW (window), area);
+ ev_window_set_message_area (window, area);
}
static void
-ev_window_warning_message (GtkWindow *window, const gchar *msg)
+ev_window_warning_message (EvWindow *window, const gchar *msg)
{
GtkWidget *area;
- if (EV_WINDOW (window)->priv->message_area)
+ if (window->priv->message_area)
return;
area = ev_message_area_new (GTK_MESSAGE_WARNING,
G_CALLBACK (ev_window_message_area_response_cb),
window);
gtk_widget_show (area);
- ev_window_set_message_area (EV_WINDOW (window), area);
+ ev_window_set_message_area (window, area);
}
static void
if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) > 0) {
ev_view_set_document (view, document);
} else {
- ev_window_warning_message (GTK_WINDOW (ev_window),
+ ev_window_warning_message (ev_window,
_("The document contains no pages"));
}
ev_window_popup_password_dialog (ev_window);
} else {
- ev_window_error_message (GTK_WINDOW (ev_window),
+ ev_window_error_message (ev_window,
_("Unable to open document"),
job->error);
ev_window_clear_load_job (ev_window);
{
ev_view_set_loading (EV_VIEW (ev_window->priv->view), FALSE);
ev_window->priv->in_reload = FALSE;
- ev_window_error_message (GTK_WINDOW (ev_window),
+ ev_window_error_message (ev_window,
_("Unable to open document"),
error);
g_free (ev_window->priv->local_uri);
new_filename = ev_window_create_tmp_symlink (old_filename, &error);
if (error) {
- ev_window_error_message (GTK_WINDOW (window),
+ ev_window_error_message (window,
_("Cannot open a copy."),
error);
msg = g_strdup_printf (_("The file could not be saved as ā%sā."),
EV_JOB_SAVE (job)->uri);
- ev_window_error_message (GTK_WINDOW (window), msg, job->error);
+ ev_window_error_message (window, msg, job->error);
g_free (msg);
}
GDK_CURRENT_TIME,
&error);
if (error) {
- ev_window_error_message (GTK_WINDOW (ev_window),
+ ev_window_error_message (ev_window,
_("There was an error displaying help"),
error);
g_error_free (error);
}
if (ret == FALSE) {
- ev_window_error_message (GTK_WINDOW (window),
+ ev_window_error_message (window,
_("Unable to open external link"),
error);
g_error_free (error);
}
if (format == NULL) {
- ev_window_error_message (GTK_WINDOW (ev_window),
+ ev_window_error_message (ev_window,
_("Couldn't find appropriate format to save image"),
NULL);
g_free (uri);
g_object_unref (pixbuf);
if (error) {
- ev_window_error_message (GTK_WINDOW (ev_window),
+ ev_window_error_message (ev_window,
_("The image could not be saved."),
error);
g_error_free (error);
ev_attachment_open (attachment, screen, GDK_CURRENT_TIME, &error);
if (error) {
- ev_window_error_message (GTK_WINDOW (window),
+ ev_window_error_message (window,
_("Unable to open attachment"),
error);
g_error_free (error);
ev_attachment_save (attachment, save_to, &error);
if (error) {
- ev_window_error_message (GTK_WINDOW (ev_window),
+ ev_window_error_message (ev_window,
_("The attachment could not be saved."),
error);
g_error_free (error);