Commit 654f7e73 authored by Paolo Bacchilega's avatar Paolo Bacchilega Committed by Paolo Bacchilega

make rotation buttons not sensitive while loading the image.

2003-01-12  Paolo Bacchilega  <paolo.bacch@tin.it>

        * src/dlg-jpegtran.c (load_current_image): make rotation buttons
        not sensitive while loading the image.

        * src/commands-impl.c (edit_duplicate_file_command_impl):
        duplicate all images not only the first one.

        * libgthumb/gthumb-init.c (ensure_directories_exist): remove the
        old config file if present.
parent 3fba6908
2003-01-12 Paolo Bacchilega <paolo.bacch@tin.it>
* src/dlg-jpegtran.c (load_current_image): make rotation buttons
not sensitive while loading the image.
* src/commands-impl.c (edit_duplicate_file_command_impl):
duplicate all images not only the first one.
* libgthumb/gthumb-init.c (ensure_directories_exist): remove the
old config file if present.
2003-01-09 Paolo Bacchilega <paolo.bacch@tin.it>
* src/dlg-file-utils.h:
......
......@@ -15,7 +15,7 @@ Notes:
What is gThumb
==============
* gThumb is a browser
* gThumb is an image browser
+ Browse your hard disk showing you thumbnails of image files.
+ Thumbnails are saved in the same database used by Nautilus so you
......@@ -24,7 +24,7 @@ What is gThumb
+ Copy, move, delete images and folders.
+ Bookmarks of folders and catalogs.
* gThumb is a viewer
* gThumb is an image viewer
+ View single images (including GIF animations). Supported image
types are: BMP, JPEG, GIF, PNG, TIFF, TGA, ICO, XPM.
......@@ -32,7 +32,7 @@ What is gThumb
+ View in fullscreen mode.
+ View images rotated, flipped, mirrored.
* gThumb is an organizer
* gThumb is an image organizer
+ Add comments to images.
+ Organize images in catalogs, catalogs in libraries.
......
......@@ -1303,22 +1303,6 @@
</para>
</sect2>
<!-- Create Index Image -->
<sect2 id="create-index-image">
<title>Index Image</title>
<para>
An index image is an image that contains small previews of a series of
images. If you want to create an index image select the images you
want
to insert in the index and then use the <menuchoice><guimenu>Tools</guimenu><guimenuitem>Create Index Image</guimenuitem></menuchoice> command.
</para>
<para>
[...]
</para>
</sect2>
<sect2 id="rotate-jpeg">
<title>Rotate JPEG</title>
<para>
......@@ -1328,27 +1312,67 @@
quality for JPEG images.
</para>
<para>
If you want to rotate JPEG images without losing quality you
can select the images you want to rotate and use the
If you want to rotate JPEG images without losing image quality,
select the images you want to rotate and use the
<menuchoice><guimenu>Tools</guimenu><guimenuitem>Rotate
JPEG</guimenuitem></menuchoice> command.
</para>
<para>
If you select the <guilabel>Apply to all images</guilabel>
If you check the <guilabel>Apply to all images</guilabel>
option the rotation is applied to the
currently displayed image as well as to all the remaining images,
currently displayed image as well as to all the remaining
images you have selected,
otherwise, once the rotation has been performed on the current
image, the next image in the selection is displayed, and you can
choose another type of rotation.
</para>
<para>
If the selection contains some non-JPEG images, they are simply ignored.
If the selection contains some non-JPEG images, they are
simply ignored.
</para>
</sect2>
<sect2 id="convert-format">
<title>Convert Format</title>
<para>
With this tool you can change the format of images. To use it
select the images you want to convert, and use the
<menuchoice><guimenu>Tools</guimenu><guimenuitem>Convert
Format</guimenuitem></menuchoice> command.
</para>
<para>
The <guilabel>Convert Format</guilabel> dialog offers you the
following options:
<itemizedlist>
<listitem>
<para>
<guilabel>Image type</guilabel>: this is the format you want to
convert images into.
</para>
</listitem>
<listitem>
<para>
<guilabel>Overwrite mode</guilabel>: a converted image has the
same name of the original image except for the extension which is
determined by the new format, an image with the new name
can already exist in the destination folder, this option lets you
decide what to do when such a case occurs. If use choose
<guilabel>skip</guilabel> the new image won't be created;
<guilabel>rename</guilabel> will ask you to specify a new name;
<guilabel>ask</guilabel> will ask you whether to overwrite the
old image or not and <guilabel>overwrite</guilabel> will
overwrite the old image without asking.
</para>
</listitem>
<listitem>
<para>
<guilabel>Remove original</guilabel>: lets you remove the
original image. If an image is not converted because of an
error it will not be removed.
</para>
</listitem>
</itemizedlist>
</para>
</sect2>
......@@ -1364,9 +1388,63 @@
</para>
</sect2>
<sect2 id="create-index-image">
<title>Index Image</title>
<para>
An index image is an image that contains small previews of a series of
images. If you want to create an index image select the images you
want
to insert in the index and then use the <menuchoice><guimenu>Tools</guimenu><guimenuitem>Create Index Image</guimenuitem></menuchoice> command.
</para>
<para>
[..]
</para>
</sect2>
<sect2 id="maintenance">
<title>Maintenance</title>
<para>
To get access to maintenance operations select the
<menuchoice><guimenu>Tools</guimenu><guimenuitem>Maintenance
</guimenuitem></menuchoice> menu item.
</para>
<para>
<guilabel>Backup Comments</guilabel>. With this command you
can create an archive of all the comments you have writed.
After pressing the button you have to enter the archive name,
for example: <filename>comments.tgz</filename>, or
<filename>comments.zip</filename>. The archive is created
using the application <application>File Roller</application>.
</para>
<para>
<guilabel>Restore Comments From a Backup File</guilabel>. Use
this command if
you want to restore comments previously saved in an archive.
After pressing the button you have to
specify the archive where the comments are stored. The
archive is extracted using the application <application>File
Roller</application>.
</para>
<para>
<guilabel>Delete Old Comments</guilabel>. If you use
<application>gThumb</application> to delete or move images,
comments are deleted and moved accordingly. Other
applications do not handle image comments so it can happen that
a comment exists but the relative image does not exist
anymore. This command lets you delete such comments.
</para>
<para>
<guilabel>Delete ALL Comments</guilabel>. This command will
delete all the comments you have written.
</para>
<para>
Thumbnails are small versions of the images you have on your
disk, they are used to speed up browsing. Thumbnails can use
a lot of space, so in order to save disk space you may wish to
delete all the thumbnails or only the thumbnails of no more
existing images. The commands in the
<guilabel>Thumbnails</guilabel> section let you do this.
</para>
</sect2>
......
......@@ -1295,8 +1295,8 @@ gth_file_list_enable_thumbs (GthFileList *file_list,
void
gth_file_list_set_progress_func (GthFileList *file_list,
ProgressFunc func,
gpointer data)
ProgressFunc func,
gpointer data)
{
g_return_if_fail (file_list != NULL);
......
......@@ -48,11 +48,10 @@ ensure_directories_exist (void)
{
char *path;
/* FIXME
path = get_home_relative_dir (RC_THUMBS_DIR);
ensure_dir_exists (path, 0700);
g_free (path);
*/
/* before the gconf port this was a file, now it's folder. */
path = get_home_relative_dir (RC_DIR);
if (path_is_file (path))
unlink (path);
path = get_home_relative_dir (RC_CATALOG_DIR);
ensure_dir_exists (path, 0700);
......
......@@ -368,17 +368,16 @@ image_rename_command_impl (BonoboUIComponent *uic,
static void
duplicate_file (GThumbWindow *window,
const GList *list)
const char *old_path)
{
const char *old_name, *old_path, *ext;
char *old_name_no_ext;
char *new_name, *new_path;
char *dir;
int try;
const char *old_name, *ext;
char *old_name_no_ext;
char *new_name, *new_path;
char *dir;
int try;
g_return_if_fail (list != NULL);
g_return_if_fail (old_path != NULL);
old_path = list->data;
old_name = file_name_from_path (old_path);
old_name_no_ext = remove_extension_from_path (old_name);
ext = strrchr (old_name, '.');
......@@ -404,6 +403,7 @@ duplicate_file (GThumbWindow *window,
if (file_copy (old_path, new_path)) {
cache_copy (old_path, new_path);
comment_copy (old_path, new_path);
} else {
char *utf8_path;
......@@ -420,6 +420,19 @@ duplicate_file (GThumbWindow *window,
}
static void
duplicate_file_list (GThumbWindow *window,
const GList *list)
{
const GList *scan;
for (scan = list; scan; scan = scan->next) {
char *filename = scan->data;
duplicate_file (window, filename);
}
}
void
edit_duplicate_file_command_impl (BonoboUIComponent *uic,
gpointer user_data,
......@@ -431,7 +444,7 @@ edit_duplicate_file_command_impl (BonoboUIComponent *uic,
list = ilist_utils_get_file_list_selection (IMAGE_LIST (window->file_list->ilist));
g_return_if_fail (list != NULL);
duplicate_file (window, list);
duplicate_file_list (window, list);
path_list_free (list);
}
......@@ -448,7 +461,7 @@ image_duplicate_command_impl (BonoboUIComponent *uic,
return;
list = g_list_prepend (NULL, g_strdup (window->image_path));
duplicate_file (window, list);
duplicate_file_list (window, list);
path_list_free (list);
}
......
......@@ -314,8 +314,8 @@ dir_list_refresh_continue (PathListData *pld,
if (dir_list->old_dir) {
GList *scan;
gint row;
gint found = FALSE;
int row;
int found = FALSE;
row = -1;
scan = dir_list->list;
......@@ -329,7 +329,7 @@ dir_list_refresh_continue (PathListData *pld,
if (found) {
GtkTreePath *path;
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, row);
gtk_tree_path_prepend_index (path, row);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dir_list->list_view),
path,
NULL,
......
......@@ -299,22 +299,24 @@ static ExifTag usefull_tags[] = {
EXIF_TAG_EXPOSURE_PROGRAM,
EXIF_TAG_EXPOSURE_MODE,
EXIF_TAG_EXPOSURE_BIAS_VALUE,
EXIF_TAG_FLASH,
EXIF_TAG_FLASH_ENERGY,
EXIF_TAG_SPECTRAL_SENSITIVITY,
EXIF_TAG_SHUTTER_SPEED_VALUE,
EXIF_TAG_APERTURE_VALUE,
EXIF_TAG_BRIGHTNESS_VALUE,
EXIF_TAG_LIGHT_SOURCE,
EXIF_TAG_FLASH,
EXIF_TAG_FLASH_ENERGY,
EXIF_TAG_FOCAL_LENGTH,
EXIF_TAG_WHITE_BALANCE,
EXIF_TAG_WHITE_POINT,
EXIF_TAG_DIGITAL_ZOOM_RATIO,
EXIF_TAG_SUBJECT_DISTANCE,
EXIF_TAG_SUBJECT_DISTANCE_RANGE,
EXIF_TAG_METERING_MODE,
EXIF_TAG_CONTRAST,
EXIF_TAG_SATURATION,
EXIF_TAG_SHARPNESS,
EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM,
EXIF_TAG_SUBJECT_DISTANCE_RANGE,
EXIF_TAG_BATTERY_LEVEL,
EXIF_TAG_DATE_TIME,
......
......@@ -67,6 +67,7 @@ typedef struct {
GladeXML *gui;
GtkWidget *dialog;
GtkWidget *j_button_box;
GtkWidget *j_apply_to_all_checkbutton;
int rot_type; /* 0, 90 ,180, 270 */
......@@ -103,6 +104,14 @@ add_image_to_button (GtkWidget *button,
}
static void
image_loaded_cb (ImageViewer *viewer,
DialogData *data)
{
gtk_widget_set_sensitive (data->j_button_box, TRUE);
}
static void
load_current_image (DialogData *data)
{
......@@ -113,6 +122,8 @@ load_current_image (DialogData *data)
return;
}
gtk_widget_set_sensitive (data->j_button_box, FALSE);
fd = data->current_image->data;
image_viewer_load_image (IMAGE_VIEWER (data->viewer), fd->path);
......@@ -497,9 +508,15 @@ rot90_clicked (GtkWidget *button,
}
src_pixbuf = image_viewer_get_current_pixbuf (viewer);
if (src_pixbuf == NULL)
return;
dest_pixbuf = _gdk_pixbuf_copy_rotate_90 (src_pixbuf, FALSE);
image_viewer_set_pixbuf (viewer, dest_pixbuf);
g_object_unref (dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
}
......@@ -519,9 +536,15 @@ rot270_clicked (GtkWidget *button,
data->rot_type = get_next_rot (data->rot_type);
src_pixbuf = image_viewer_get_current_pixbuf (viewer);
if (src_pixbuf == NULL)
return;
dest_pixbuf = _gdk_pixbuf_copy_rotate_90 (src_pixbuf, TRUE);
image_viewer_set_pixbuf (viewer, dest_pixbuf);
g_object_unref (dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
}
......@@ -529,23 +552,31 @@ static void
mirror_clicked (GtkWidget *button,
DialogData *data)
{
ImageViewer *viewer = IMAGE_VIEWER (data->viewer);
GdkPixbuf *src_pixbuf;
GdkPixbuf *dest_pixbuf;
ImageViewer *viewer = IMAGE_VIEWER (data->viewer);
GdkPixbuf *src_pixbuf;
GdkPixbuf *dest_pixbuf;
src_pixbuf = image_viewer_get_current_pixbuf (viewer);
if (src_pixbuf == NULL)
return;
if (data->tran_type == TRAN_FLIP) {
data->tran_type = TRAN_NONE;
data->rot_type = get_next_rot (data->rot_type);
data->rot_type = get_next_rot (data->rot_type);
} else if (data->tran_type == TRAN_MIRROR)
data->tran_type = TRAN_NONE;
else
data->tran_type = TRAN_MIRROR;
src_pixbuf = image_viewer_get_current_pixbuf (viewer);
dest_pixbuf = _gdk_pixbuf_copy_mirror (src_pixbuf, TRUE, FALSE);
image_viewer_set_pixbuf (viewer, dest_pixbuf);
g_object_unref (dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
}
......@@ -561,15 +592,23 @@ flip_clicked (GtkWidget *button,
data->tran_type = TRAN_NONE;
data->rot_type = get_next_rot (data->rot_type);
data->rot_type = get_next_rot (data->rot_type);
} else if (data->tran_type == TRAN_FLIP)
data->tran_type = TRAN_NONE;
else
data->tran_type = TRAN_FLIP;
src_pixbuf = image_viewer_get_current_pixbuf (viewer);
if (src_pixbuf == NULL)
return;
dest_pixbuf = _gdk_pixbuf_copy_mirror (src_pixbuf, FALSE, TRUE);
image_viewer_set_pixbuf (viewer, dest_pixbuf);
g_object_unref (dest_pixbuf);
if (dest_pixbuf != NULL)
g_object_unref (dest_pixbuf);
}
......@@ -667,6 +706,7 @@ dlg_jpegtran (GThumbWindow *window)
data->dialog = glade_xml_get_widget (data->gui, "jpeg_rotate_dialog");
data->j_apply_to_all_checkbutton = glade_xml_get_widget (data->gui, "j_apply_to_all_checkbutton");
data->j_button_box = glade_xml_get_widget (data->gui, "j_button_box");
j_image_vbox = glade_xml_get_widget (data->gui, "j_image_vbox");
j_revert_button = glade_xml_get_widget (data->gui, "j_revert_button");
......@@ -674,6 +714,7 @@ dlg_jpegtran (GThumbWindow *window)
j_rot_270_button = glade_xml_get_widget (data->gui, "j_rot_270_button");
j_v_flip_button = glade_xml_get_widget (data->gui, "j_v_flip_button");
j_h_flip_button = glade_xml_get_widget (data->gui, "j_h_flip_button");
j_help_button = glade_xml_get_widget (data->gui, "j_help_button");
j_cancel_button = glade_xml_get_widget (data->gui, "j_cancel_button");
j_ok_button = glade_xml_get_widget (data->gui, "j_ok_button");
......@@ -743,6 +784,11 @@ dlg_jpegtran (GThumbWindow *window)
G_CALLBACK (flip_clicked),
data);
g_signal_connect (G_OBJECT (data->viewer),
"image_loaded",
G_CALLBACK (image_loaded_cb),
data);
/* Run dialog. */
gtk_window_set_transient_for (GTK_WINDOW (data->dialog), GTK_WINDOW (window->app));
......
......@@ -22,6 +22,7 @@
#include <config.h>
#include <gtk/gtk.h>
#include <libgnome/libgnome.h>
#include <glade/glade.h>
#include "comments.h"
#include "gthumb-window.h"
......@@ -252,6 +253,39 @@ restore_comments_cb (GtkWidget *widget,
}
/* called when the "help" button is clicked. */
static void
help_cb (GtkWidget *widget,
DialogData *data)
{
GError *err;
err = NULL;
gnome_help_display ("gthumb", "maintenance", &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);
}
}
/* create the main dialog. */
void
dlg_maintenance (GThumbWindow *window)
......@@ -300,7 +334,10 @@ dlg_maintenance (GThumbWindow *window)
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (data->dialog));
g_signal_connect (G_OBJECT (btn_help),
"clicked",
G_CALLBACK (help_cb),
data);
g_signal_connect (G_OBJECT (btn_comment_remove_old),
"clicked",
G_CALLBACK (remove_old_comments_cb),
......
......@@ -620,7 +620,7 @@ window_update_sensitivity (GThumbWindow *window)
set_command_sensitive (window, "Edit_RenameFile", only_one_is_selected && not_fullscreen);
set_command_sensitive (window, "Edit_RenameFilePopup", only_one_is_selected && not_fullscreen);
set_command_sensitive (window, "Edit_DuplicateFile", only_one_is_selected && not_fullscreen);
set_command_sensitive (window, "Edit_DuplicateFile", sel_not_null && not_fullscreen);
set_command_sensitive (window, "Edit_DeleteFiles", sel_not_null && not_fullscreen);
set_command_sensitive (window, "Edit_CopyFiles", sel_not_null && not_fullscreen);
set_command_sensitive (window, "Edit_MoveFiles", sel_not_null && not_fullscreen);
......
......@@ -1302,7 +1302,7 @@
</child>
<child>
<widget class="GtkHBox" id="hbox28">
<widget class="GtkHBox" id="j_button_box">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment