Commit 919ef290 authored by Michael J. Chudobiak's avatar Michael J. Chudobiak Committed by Michael J. Chudobiak
Browse files

Added libgthumb/gth-utils.c, and placed gthumb_display_help in it, to

2006-11-05  Michael J. Chudobiak  <mjc@cvs.gnome.org>

        * libgthumb/Makefile.am:
        * libgthumb/gth-utils.c: (gthumb_display_help):
        * libgthumb/gth-utils.h:
        * src/dlg-categories.c: (help_cb):
        * src/dlg-change-date.c: (help_cb):
        * src/dlg-comment.c: (help_cb):
        * src/dlg-convert.c: (help_cb):
        * src/dlg-jpegtran.c: (help_cb):
        * src/dlg-photo-importer.c: (help_cb):
        * src/dlg-preferences.c: (help_cb):
        * src/dlg-redeye-removal.c: (help_cb):
        * src/dlg-rename-series.c: (help_cb):
        * src/dlg-reset-exif.c: (help_cb):
        * src/dlg-search.c: (help_cb):
        * src/dlg-web-exporter.c: (help_cb):
        * src/gth-window-actions-callbacks.c:
        (gth_window_activate_action_help_help),
        (gth_window_activate_action_help_shortcuts):
        Added libgthumb/gth-utils.c, and placed gthumb_display_help in it,
        to reduce code duplication. Bug 369449. Patch by Manuel Braga.

        * src/gth-browser.c: (save_jpeg_data):
        * src/gth-viewer.c: (save_jpeg_data):
        * src/catalog-web-exporter.c: (copy_exif_from_orig):
        Added some comments, to clarify the changes in the previous commit.
parent 8ad7f7db
2006-11-05 Michael J. Chudobiak <mjc@cvs.gnome.org>
* libgthumb/Makefile.am:
* libgthumb/gth-utils.c: (gthumb_display_help):
* libgthumb/gth-utils.h:
* src/dlg-categories.c: (help_cb):
* src/dlg-change-date.c: (help_cb):
* src/dlg-comment.c: (help_cb):
* src/dlg-convert.c: (help_cb):
* src/dlg-jpegtran.c: (help_cb):
* src/dlg-photo-importer.c: (help_cb):
* src/dlg-preferences.c: (help_cb):
* src/dlg-redeye-removal.c: (help_cb):
* src/dlg-rename-series.c: (help_cb):
* src/dlg-reset-exif.c: (help_cb):
* src/dlg-search.c: (help_cb):
* src/dlg-web-exporter.c: (help_cb):
* src/gth-window-actions-callbacks.c:
(gth_window_activate_action_help_help),
(gth_window_activate_action_help_shortcuts):
Added libgthumb/gth-utils.c, and placed gthumb_display_help in it,
to reduce code duplication. Bug 369449. Patch by Manuel Braga.
* src/gth-browser.c: (save_jpeg_data):
* src/gth-viewer.c: (save_jpeg_data):
* src/catalog-web-exporter.c: (copy_exif_from_orig):
Added some comments, to clarify the changes in the previous commit.
2006-11-04 Michael J. Chudobiak <mjc@cvs.gnome.org>
* src/catalog-web-exporter.c: (copy_exif_from_orig):
......
......@@ -54,6 +54,7 @@ HEADER_FILES = \
gth-file-view-thumbs.h \
gth-nav-window.h \
gth-pixbuf-op.h \
gth-utils.h \
gthumb-error.h \
gthumb-histogram.h \
gthumb-init.h \
......@@ -111,6 +112,7 @@ libgthumb_la_SOURCES = \
gth-file-view-list.c \
gth-file-view-thumbs.c \
gth-nav-window.c \
gth-utils.c \
gthumb-error.c \
gthumb-histogram.c \
gthumb-init.c \
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
*
* This program 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.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <string.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <libgnome/libgnome.h>
void
gthumb_display_help (GtkWindow *window,
const char *section)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", section, &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (window,
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help"));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* GThumb
*
* Copyright (C) 2001 The Free Software Foundation, Inc.
*
* This program 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.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*/
#ifndef _GTH_UTILS_H
#define _GTH_UTILS_H
#include <gtk/gtk.h>
void gthumb_display_help (GtkWindow *window, const char *section);
#endif /* _GTH_UTILS_H */
......@@ -1639,6 +1639,7 @@ copy_exif_from_orig (const char *src_filename,
jpeg_data_unref (jdata_src);
jpeg_data_unref (jdata_dest);
/* The exif orientation tag, if present, must be reset to "top-left" */
write_orientation_field (dest_filename, GTH_TRANSFORM_NONE);
}
......
......@@ -354,31 +354,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "comments", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-categories");
}
......
......@@ -193,31 +193,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-change-date", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-change-date");
}
......
......@@ -275,31 +275,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-comments", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-comments");
}
......
......@@ -440,31 +440,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-convert-format", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-convert-format");
}
......
......@@ -474,31 +474,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-rotate-jpeg", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-rotate-jpeg");
}
......
......@@ -1793,30 +1793,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-import-photos", &err);
if (err != NULL) {
GtkWidget *d;
d = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (d), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (d), FALSE);
gtk_widget_show (d);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-import-photos");
}
......
......@@ -164,31 +164,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "preferences", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "preferences");
}
......
......@@ -423,31 +423,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-redeye", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-redeye");
}
......
......@@ -331,31 +331,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-rename-series", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-rename-series");
}
......
......@@ -206,31 +206,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-reset-exif", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-reset-exif");
}
......
......@@ -452,30 +452,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-find", &err);
if (err != NULL) {
GtkWidget *d;
d = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (d), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (d), FALSE);
gtk_widget_show (d);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-find");
}
......
......@@ -116,31 +116,7 @@ static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "gthumb-web-album", &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
gthumb_display_help (GTK_WINDOW (data->dialog), "gthumb-web-album");
}
......
......@@ -1827,6 +1827,7 @@ save_jpeg_data (GthBrowser *browser,
jpeg_data_save_file (jdata, filename);
jpeg_data_unref (jdata);
/* The exif orientation tag, if present, must be reset to "top-left" */
write_orientation_field (filename, GTH_TRANSFORM_NONE);
}
......
......@@ -883,6 +883,7 @@ save_jpeg_data (GthViewer *viewer,
jpeg_data_save_file (jdata, filename);
jpeg_data_unref (jdata);
/* The exif orientation tag, if present, must be reset to "top-left" */
write_orientation_field (filename, GTH_TRANSFORM_NONE);
}
......
......@@ -59,6 +59,7 @@
#include "gconf-utils.h"
#include "gth-pixbuf-op.h"
#include "gth-viewer.h"
#include "gth-utils.h"
#include "gthumb-error.h"
#include "gthumb-module.h"
#include "gtk-utils.h"
......@@ -810,43 +811,11 @@ gth_window_activate_action_help_about (GtkAction *action,
}
static void
display_help (GthWindow *window,
const char *section)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", section, &err);
if (err != NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Could not display help: %s"),
err->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_widget_show (dialog);
g_error_free (err);
}
}
void
gth_window_activate_action_help_help (GtkAction *action,
gpointer data)
{
display_help (GTH_WINDOW (data), NULL);