summaryrefslogtreecommitdiff
path: root/viewer
diff options
context:
space:
mode:
authorJens Finke <jens@triq.net>2003-03-02 13:22:15 +0000
committerJens Finke <jens@src.gnome.org>2003-03-02 13:22:15 +0000
commit39643ff270fd022ad32d07a8639ddddcd192fad8 (patch)
tree676edbbf4efe5556bb9f13878d3e5f4cd46f1977 /viewer
parentfc32029fb88b20f167ec2358e354f36bd0df6b98 (diff)
downloadeog-39643ff270fd022ad32d07a8639ddddcd192fad8.tar.gz
Re-enabled image saving.
2003-03-02 Jens Finke <jens@triq.net> Re-enabled image saving. * libeog/eog-file-selection.c (get_save_formats): Moved to eog-pixbuf-util. (eog_append_menu_entry), (check_extension), (is_filename_valid), (changed_cb): Free values from gdk_pixbuf_format calls. * libeog/eog-image.c: Changed "changed" signal name to "image_changed". (eog_image_save): Rely completely on GdkPixbuf for image saving and use GdkPixbufFormat information to determine the filetype. This removes xpm saving support from eog, but the right way should be to put this into gdk-pixbuf anyway. * libeog/eog-pixbuf-util.c (eog_pixbuf_get_savable_formats): New function, previously in eog-file-selection.c. * libeog/eog-scroll-view.c (eog_scroll_view_set_image): s/changed/image_changed. * viewer/eog-iamge-view.c (verb_SaveAs_cb): Reenabled. (item_factory_translate_cb): Use gettext again. (save_uri_cb): Use HIG dialogs.
Diffstat (limited to 'viewer')
-rw-r--r--viewer/eog-image-view.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/viewer/eog-image-view.c b/viewer/eog-image-view.c
index 092b5830..a7951ef8 100644
--- a/viewer/eog-image-view.c
+++ b/viewer/eog-image-view.c
@@ -38,6 +38,7 @@
#include "eog-scroll-view.h"
#include "eog-file-selection.h"
#include "eog-full-screen.h"
+#include "eog-hig-dialog.h"
@@ -301,10 +302,6 @@ verb_ZoomToFit_cb (BonoboUIComponent *uic, gpointer user_data,
eog_scroll_view_zoom_fit (EOG_SCROLL_VIEW (view->priv->widget));
}
-
- /* FIXME: the gtk file dialog crashes here somehow !?!?
- */
-#if 0
static void
verb_SaveAs_cb (BonoboUIComponent *uic, gpointer user_data,
const char *cname)
@@ -339,7 +336,6 @@ verb_SaveAs_cb (BonoboUIComponent *uic, gpointer user_data,
g_free (filename);
}
}
-#endif
static BonoboUIVerb eog_zoom_verbs[] = {
BONOBO_UI_VERB ("ZoomIn", verb_ZoomIn_cb),
@@ -350,7 +346,7 @@ static BonoboUIVerb eog_zoom_verbs[] = {
};
static BonoboUIVerb eog_verbs[] = {
-/* BONOBO_UI_VERB ("SaveAs", verb_SaveAs_cb), */
+ BONOBO_UI_VERB ("SaveAs", verb_SaveAs_cb),
BONOBO_UI_VERB ("FullScreen", verb_FullScreen_cb),
BONOBO_UI_VERB ("FlipHorizontal",verb_FlipHorizontal_cb),
BONOBO_UI_VERB ("FlipVertical", verb_FlipVertical_cb),
@@ -759,9 +755,7 @@ static int n_popup_entries = sizeof (popup_entries) / sizeof (popup_entries[0]);
static gchar *
item_factory_translate_cb (const gchar *path, gpointer data)
{
- /* FIXME */
- /* return _(path); */
- return g_strdup (path);
+ return _(path);
}
/* Sets up a GTK+ item factory for the image view */
@@ -897,33 +891,29 @@ save_uri_cb (BonoboPersistFile *pf, const CORBA_char *text_uri,
view = EOG_IMAGE_VIEW (closure);
if (view->priv->image == NULL) return FALSE;
+ /* FIXME: what kind of escaping do we need here? */
uri = gnome_vfs_uri_new (text_uri);
-
- result = eog_image_save (view->priv->image, uri, &error);
+ result = eog_image_save (view->priv->image, uri, &error);
+
if (result) {
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_CLOSE,
- _("Image successfully saved.\n"));
+ dialog = eog_hig_dialog_new (GTK_STOCK_DIALOG_INFO,
+ _("Image successfully saved"), NULL, FALSE);
}
else {
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- _("Image saving failed.\n"
- "%s"),
- error->message);
+ dialog = eog_hig_dialog_new (GTK_STOCK_DIALOG_ERROR,
+ _("Image saving failed"), error->message, FALSE);
}
-
+ gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show (dialog);
- g_error_free (error);
+ if (error != NULL) {
+ g_error_free (error);
+ }
+
return result;
}