...
 
Commits (8)
  • Abel Cheung's avatar
    Added "hr" to ALL_LINGUAS. · f738d95b
    Abel Cheung authored
    2003-12-15  Abel Cheung  <maddog@linux.org.hk>
    
    	* configure.in: Added "hr" to ALL_LINGUAS.
    f738d95b
  • Paolo Bacchilega's avatar
    do not free a string twice. · 1959a640
    Paolo Bacchilega authored
    2003-12-16  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            * src/commands-impl.c (folder_copy__response_cb): do not free a string
            twice.
    
    2003-12-15  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            * src/dlg-duplicates.c: remove unused variable.
    
            * src/commands-impl.c (wallpaper_restore_command_impl): restore
            wallpaper correctly when the picture_options value is 'none'.
    1959a640
  • Paolo Bacchilega's avatar
    [ gthumb 2.2.0 released ] · d2d4be52
    Paolo Bacchilega authored
    2003-12-19  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            [ gthumb 2.2.0 released ]
    d2d4be52
  • Paolo Bacchilega's avatar
    updated from gedit. · f13fd370
    Paolo Bacchilega authored
    2003-12-22  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            * libgthumb/gnome-print-font-picker.c:
            * libgthumb/gnome-print-font-dialog.c: updated from gedit.
    f13fd370
  • Paolo Bacchilega's avatar
    fix bug #129858 (libgthumb-jpegutils.a isn't libtool library, does not · 7ebfb5e2
    Paolo Bacchilega authored
    2003-12-23  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            * src/jpegutils/Makefile.am (noinst_LTLIBRARIES):
            * src/Makefile.am (libjpegtran_la_LIBADD): fix bug #129858
            (libgthumb-jpegutils.a isn't libtool library, does not link on
            non-x86).
    
            Patch by Matthew Wilson.
    7ebfb5e2
  • Paolo Bacchilega's avatar
    Fix bug #126292 (Date shows badly if locale charset is not utf8). Patch by · e8f533be
    Paolo Bacchilega authored
    2004-01-09  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            * libgthumb/comments.c (comments_get_comment_as_string):
            * src/gthumb-window.c (window_update_statusbar_image_info):
            * src/gth-exif-data-viewer.c (update_file_info):
            * src/fullscreen.c (get_file_info):
            * src/dlg-duplicates.c (images_selection_changed_cb):
            * components/image-viewer/viewer-stream.c (get_status):
    
            Fix bug  #126292 (Date shows badly if locale charset is not utf8).
            Patch by Egmont Koblinger.
    e8f533be
  • Paolo Bacchilega's avatar
    Remove the auto load timeout after leaving. · f6b4eeb4
    Paolo Bacchilega authored
    2004-01-21  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            * src/gthumb-window.c (dir_list_drag_leave):
            (dir_list_drag_leave, create_new_file_list):
    
            Remove the auto load timeout after leaving.
    
            * src/dlg-jpegtran.c (apply_tran):
    
            Fix bug #130823 (gthumb does not maintain permissions on files).
            Fix bug #130824 (gthumb does not complain about lack of permissions).
    
            * libgthumb/preferences.c (preferences_init):
    
            Fix bug #130829 (gthumb ignores current directory when starting).
    
            * src/gthumb-window.c (window_set_preview_content):
    
            Fix bug #131853 (Changing folders produces flicker in image viewer).
    f6b4eeb4
  • Paolo Bacchilega's avatar
    [ gthumb 2.2.1 released ] · af6a559f
    Paolo Bacchilega authored
    2004-01-24  Paolo Bacchilega  <paolo.bacch@tin.it>
    
            [ gthumb 2.2.1 released ]
    
            * src/gthumb-window.c: fix dnd.
            (key_press_cb):
    
            Fix bug #130382 (gthumb keyboard usability issue).
    
            * src/dlg-file-utils.c (folder_copy): remove old comment cache before
            copying.
    af6a559f
2004-01-24 Paolo Bacchilega <paolo.bacch@tin.it>
[ gthumb 2.2.1 released ]
* src/gthumb-window.c: fix dnd.
(key_press_cb):
Fix bug #130382 (gthumb keyboard usability issue).
* src/dlg-file-utils.c (folder_copy): remove old comment cache before
copying.
2004-01-21 Paolo Bacchilega <paolo.bacch@tin.it>
* src/gthumb-window.c (dir_list_drag_leave):
(dir_list_drag_leave, create_new_file_list):
Remove the auto load timeout after leaving.
* src/dlg-jpegtran.c (apply_tran):
Fix bug #130823 (gthumb does not maintain permissions on files).
Fix bug #130824 (gthumb does not complain about lack of permissions).
* libgthumb/preferences.c (preferences_init):
Fix bug #130829 (gthumb ignores current directory when starting).
* src/gthumb-window.c (window_set_preview_content):
Fix bug #131853 (Changing folders produces flicker in image viewer).
2004-01-09 Paolo Bacchilega <paolo.bacch@tin.it>
* libgthumb/comments.c (comments_get_comment_as_string):
* src/gthumb-window.c (window_update_statusbar_image_info):
* src/gth-exif-data-viewer.c (update_file_info):
* src/fullscreen.c (get_file_info):
* src/dlg-duplicates.c (images_selection_changed_cb):
* components/image-viewer/viewer-stream.c (get_status):
Fix bug #126292 (Date shows badly if locale charset is not utf8).
Patch by Egmont Koblinger.
2003-12-25 Paolo Bacchilega <paolo.bacch@tin.it>
* libgthumb/image-loader.c (image_loader_sync_pixbuf): assign pixbuf
inside the lock.
2003-12-23 Paolo Bacchilega <paolo.bacch@tin.it>
* src/jpegutils/Makefile.am (noinst_LTLIBRARIES):
* src/Makefile.am (libjpegtran_la_LIBADD): fix bug #129858
(libgthumb-jpegutils.a isn't libtool library, does not link on
non-x86).
Patch by Matthew Wilson.
2003-12-22 Paolo Bacchilega <paolo.bacch@tin.it>
* libgthumb/gnome-print-font-picker.c:
* libgthumb/gnome-print-font-dialog.c: updated from gedit.
2003-12-19 Paolo Bacchilega <paolo.bacch@tin.it>
[ gthumb 2.2.0 released ]
2003-12-16 Paolo Bacchilega <paolo.bacch@tin.it>
* src/commands-impl.c (folder_copy__response_cb): do not free a string
twice.
2003-12-15 Paolo Bacchilega <paolo.bacch@tin.it>
* src/dlg-duplicates.c: remove unused variable.
* src/commands-impl.c (wallpaper_restore_command_impl): restore
wallpaper correctly when the picture_options value is 'none'.
2003-12-15 Abel Cheung <maddog@linux.org.hk>
* configure.in: Added "hr" to ALL_LINGUAS.
2003-12-14 Paolo Bacchilega <paolo.bacch@tin.it>
* libgthumb/print-callbacks.c (get_next_line_to_print_delimiter):
......
version 2.2.1
-------------
* Fix Drag and Drop.
* Fix bug #130823 (gthumb does not maintain permissions on files).
* Fix bug #130824 (gthumb does not complain about lack of permissions).
* Fix bug #130829 (gthumb ignores current directory when starting).
* Fix bug #131853 (Changing folders produces flicker in image viewer).
* Fix bug #126292 (Date shows badly if locale charset is not utf8).
Patch by Egmont Koblinger.
* Fix bug #129858 (libgthumb-jpegutils.a isn't libtool library,
does not link on non-x86).
* Fix bug #130382 (gthumb keyboard usability issue).
* Update the gnome-print-font-picker code from gedit.
version 2.2.0
-------------
* Bugfixes.
......
......@@ -76,7 +76,7 @@ get_status (ImageViewer *viewer,
const char *location)
{
char *text;
char time_txt[50];
char time_txt[50], *utf8_time_txt;
char *size_txt;
char *file_size_txt;
char *escaped_name;
......@@ -88,6 +88,7 @@ get_status (ImageViewer *viewer,
timer = get_uri_mtime (location);
tm = localtime (&timer);
strftime (time_txt, 50, _("%d %b %Y, %H:%M"), tm);
utf8_time_txt = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
utf8_name = g_locale_to_utf8 (file_name_from_path (location), -1,
0, 0, 0);
......@@ -104,8 +105,9 @@ get_status (ImageViewer *viewer,
text = g_strdup_printf ("%s - %s - %s",
size_txt,
file_size_txt,
time_txt);
utf8_time_txt);
g_free (utf8_time_txt);
g_free (utf8_name);
g_free (escaped_name);
g_free (size_txt);
......
......@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
AC_INIT(gthumb, 2.2.0, http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb)
AC_INIT(gthumb, 2.2.1, http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb)
AC_CONFIG_SRCDIR(src/main.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
......@@ -212,7 +212,7 @@ dnl ###############################################
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
ALL_LINGUAS="am az be ca cs da de en_GB es fr ga hu it ja ko lv mk ml ms nl no pl pt pt_BR ru sr sr@Latn sv uk zh_CN zh_TW"
ALL_LINGUAS="am az be ca cs da de en_GB es fr ga hr hu it ja ko lv mk ml ms nl no pl pt pt_BR ru sr sr@Latn sv uk zh_CN zh_TW"
GETTEXT_PACKAGE=gthumb
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [GetText Package])
......
......@@ -753,9 +753,11 @@ comments_get_comment_as_string (CommentData *data,
{
char *as_string = NULL;
char time_txt[50];
char *utf8_time_txt = NULL;
struct tm *tm;
if (data == NULL) return NULL;
if (data == NULL)
return NULL;
if (data->time != 0) {
tm = localtime (& data->time);
......@@ -763,8 +765,8 @@ comments_get_comment_as_string (CommentData *data,
strftime (time_txt, 50, _("%d %B %Y"), tm);
else
strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);
} else
time_txt[0] = 0;
utf8_time_txt = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
}
if ((data->comment == NULL)
&& (data->place == NULL)
......@@ -791,13 +793,15 @@ comments_get_comment_as_string (CommentData *data,
if ((data->place != NULL) && (*time_txt != 0))
g_string_append (comment, sep2);
if (*time_txt != 0)
g_string_append (comment, time_txt);
if (utf8_time_txt != NULL)
g_string_append (comment, utf8_time_txt);
as_string = comment->str;
g_string_free (comment, FALSE);
}
g_free (utf8_time_txt);
return as_string;
}
......
......@@ -27,11 +27,6 @@
* See the ChangeLog files for a list of changes.
*/
/*
* Modified by Paolo Bacchilega for gThumb.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
......@@ -212,8 +207,6 @@ gnome_print_font_dialog_init (GnomePrintFontDialog *fontseldiag)
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag), 4);
gtk_window_set_resizable (GTK_WINDOW (fontseldiag), FALSE);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
......@@ -221,7 +214,7 @@ gnome_print_font_dialog_init (GnomePrintFontDialog *fontseldiag)
preview_frame = gnome_print_font_dialog_create_preview_frame (fontseldiag);
gtk_box_pack_start (GTK_BOX (vbox), fontseldiag->fontsel, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), preview_frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), preview_frame, FALSE, FALSE, 0);
font = gnome_font_selection_get_font (GNOME_FONT_SELECTION (fontseldiag->fontsel));
gnome_font_preview_set_font (GNOME_FONT_PREVIEW (fontseldiag->preview), font);
......
......@@ -728,7 +728,7 @@ const gchar* gnome_print_font_picker_get_font_name (GnomePrintFontPicker *
font_sel = gnome_print_font_dialog_get_fontsel (GNOME_PRINT_FONT_DIALOG (gfp->_priv->font_dialog));
font = gnome_font_selection_get_font (GNOME_FONT_SELECTION (font_sel));
gfp->_priv->font_name = g_strdup (gnome_font_get_full_name (font));
gfp->_priv->font_name = gnome_font_get_full_name (font);
gfp->_priv->font = font;
}
......
......@@ -389,16 +389,18 @@ image_loader_sync_pixbuf (ImageLoader *il)
pixbuf = gdk_pixbuf_animation_get_static_image (priv->animation);
g_mutex_unlock (priv->yes_or_no);
if (priv->pixbuf == pixbuf)
if (priv->pixbuf == pixbuf) {
g_mutex_unlock (priv->yes_or_no);
return;
}
if (pixbuf != NULL)
g_object_ref (pixbuf);
if (priv->pixbuf != NULL)
g_object_unref (priv->pixbuf);
priv->pixbuf = pixbuf;
g_mutex_unlock (priv->yes_or_no);
}
......@@ -429,18 +431,20 @@ image_loader_sync_pixbuf_from_loader (ImageLoader *il,
priv->animation = NULL;
}
g_mutex_unlock (priv->yes_or_no);
pixbuf = gdk_pixbuf_loader_get_pixbuf (pb_loader);
if (priv->pixbuf == pixbuf)
if (priv->pixbuf == pixbuf) {
g_mutex_unlock (priv->yes_or_no);
return;
}
if (pixbuf != NULL)
g_object_ref (pixbuf);
if (priv->pixbuf != NULL)
g_object_unref (priv->pixbuf);
priv->pixbuf = pixbuf;
g_mutex_unlock (priv->yes_or_no);
}
......
......@@ -227,7 +227,15 @@ preferences_init (void)
g_object_unref (client);
preferences.startup_location = NULL;
preferences_set_startup_location (eel_gconf_get_path (PREF_STARTUP_LOCATION, NULL));
if (eel_gconf_get_boolean (PREF_USE_STARTUP_LOCATION, FALSE) ||
eel_gconf_get_boolean (PREF_GO_TO_LAST_LOCATION, FALSE))
preferences_set_startup_location (eel_gconf_get_path (PREF_STARTUP_LOCATION, NULL));
else {
char *current = g_get_current_dir ();
preferences_set_startup_location (current);
g_free (current);
}
}
......
......@@ -129,7 +129,7 @@ libduplicates_la_LDFLAGS = $(MODULE_LIBTOOL_FLAGS)
libjpegtran_la_SOURCES = dlg-jpegtran.c dlg-jpegtran.h
libjpegtran_la_LDFLAGS = $(MODULE_LIBTOOL_FLAGS)
libjpegtran_la_LIBADD = $(top_builddir)/src/jpegutils/libgthumb-jpegutils.a
libjpegtran_la_LIBADD = $(top_builddir)/src/jpegutils/libgthumb-jpegutils.la
libpngexporter_la_SOURCES = \
catalog-png-exporter.c \
......
......@@ -75,7 +75,8 @@ typedef enum {
WALLPAPER_ALIGN_TILED = 0,
WALLPAPER_ALIGN_CENTERED = 1,
WALLPAPER_ALIGN_STRETCHED = 2,
WALLPAPER_ALIGN_SCALED = 3
WALLPAPER_ALIGN_SCALED = 3,
WALLPAPER_NONE = 4
} WallpaperAlign;
......@@ -1405,7 +1406,6 @@ folder_copy__response_cb (GObject *object,
rename (old_cache_path, new_cache_path);
}
g_free (old_cache_path);
g_free (new_cache_path);
all_windows_notify_directory_rename (old_path, new_path);
......@@ -2487,7 +2487,11 @@ set_as_wallpaper (GThumbWindow *window,
case WALLPAPER_ALIGN_SCALED:
options = "scaled";
break;
case WALLPAPER_NONE:
options = "none";
break;
}
gconf_client_set_string (client,
"/desktop/gnome/background/picture_options",
options,
......@@ -2552,6 +2556,8 @@ wallpaper_restore_command_impl (BonoboUIComponent *uic,
align_type = WALLPAPER_ALIGN_STRETCHED;
else if (strcmp (preferences.wallpaperAlign, "scaled") == 0)
align_type = WALLPAPER_ALIGN_SCALED;
else if (strcmp (preferences.wallpaperAlign, "none") == 0)
align_type = WALLPAPER_NONE;
set_as_wallpaper (window,
preferences.wallpaper,
......
......@@ -82,7 +82,6 @@ typedef struct {
GtkWidget *dialog;
GtkWidget *results_dialog;
GtkWidget *duplicates_dialog;
GtkWidget *fd_start_from_entry;
GtkWidget *fd_start_from_fileentry;
......@@ -534,7 +533,7 @@ images_selection_changed_cb (GtkTreeSelection *selection,
char *location, *location_utf8;
const char *name;
char *name_utf8;
char time_txt[50];
char time_txt[50], *time_txt_utf8;
struct tm *tm;
if (idata->common != idata2->common)
......@@ -549,6 +548,7 @@ images_selection_changed_cb (GtkTreeSelection *selection,
tm = localtime (&idata2->last_modified);
strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);
time_txt_utf8 = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
gtk_list_store_append (GTK_LIST_STORE (data->duplicates_model), &iter2);
gtk_list_store_set (GTK_LIST_STORE (data->duplicates_model),
......@@ -556,9 +556,10 @@ images_selection_changed_cb (GtkTreeSelection *selection,
DCOLUMN_IMAGE_DATA, idata2,
DCOLUMN_NAME, name_utf8,
DCOLUMN_LOCATION, location_utf8,
DCOLUMN_LAST_MODIFIED, time_txt,
DCOLUMN_LAST_MODIFIED, time_txt_utf8,
-1);
g_free (time_txt_utf8);
g_free (name_utf8);
g_free (location_utf8);
}
......@@ -781,7 +782,6 @@ dlg_duplicates (GThumbWindow *window)
data->dialog = glade_xml_get_widget (data->gui, "duplicates_dialog");
data->results_dialog = glade_xml_get_widget (data->gui, "duplicates_results_dialog");
data->duplicates_dialog = glade_xml_get_widget (data->gui, "duplicates_list_dialog");
data->fd_start_from_entry = glade_xml_get_widget (data->gui, "fd_start_from_entry");
data->fd_start_from_fileentry = glade_xml_get_widget (data->gui, "fd_start_from_fileentry");
......@@ -871,7 +871,7 @@ dlg_duplicates (GThumbWindow *window)
G_CALLBACK (find_cb),
data);
g_signal_connect (G_OBJECT (data->dialog),
g_signal_connect (G_OBJECT (data->results_dialog),
"destroy",
G_CALLBACK (destroy_results_dialog_cb),
data);
......
......@@ -2215,9 +2215,12 @@ folder_copy (GThumbWindow *window,
src_list = g_list_append (src_list,
new_uri_from_path (src_cache));
if (fcdata->file_op != FILE_OP_DELETE)
if (fcdata->file_op != FILE_OP_DELETE) {
if (path_is_dir (dest_cache) && !overwrite_all)
rmdir_recursive (dest_cache);
dest_list = g_list_append (dest_list,
new_uri_from_path (dest_cache));
}
}
g_free (src_cache);
......
......@@ -245,25 +245,45 @@ static void
apply_tran (DialogData *data,
GList *current_image)
{
FileData *fd = current_image->data;
int rot_type = data->rot_type;
int tran_type = data->tran_type;
char *line;
char *tmp1, *tmp2;
static int count = 0;
GError *err = NULL;
GtkWindow *parent = GTK_WINDOW (data->dialog);
FileData *fd = current_image->data;
char *dir;
struct stat buf;
int rot_type = data->rot_type;
int tran_type = data->tran_type;
char *line;
char *tmp1, *tmp2;
static int count = 0;
GError *err = NULL;
GtkWindow *parent = GTK_WINDOW (data->dialog);
#ifdef HAVE_LIBJPEG
JXFORM_CODE transf;
JXFORM_CODE transf;
#else
char *command;
char *command;
#endif
char *e1, *e2;
char *e1, *e2;
if ((rot_type == TRAN_ROTATE_0) && (tran_type == TRAN_NONE))
return;
/* Check directory permissions. */
dir = remove_level_from_path (fd->path);
if (access (dir, R_OK | W_OK | X_OK) != 0) {
char *utf8_path;
utf8_path = g_filename_to_utf8 (dir, -1, NULL, NULL, NULL);
_gtk_error_dialog_run (GTK_WINDOW (data->dialog),
_("You don't have the right permissions to create images in the folder \"%s\""),
utf8_path);
g_free (utf8_path);
g_free (dir);
return;
}
g_free (dir);
/**/
stat (fd->path, &buf);
if (rot_type == TRAN_ROTATE_0)
tmp1 = g_strdup (fd->path);
......@@ -409,6 +429,8 @@ apply_tran (DialogData *data,
g_strdup (fd->path));
}
chmod (fd->path, buf.st_mode);
g_free (e1);
g_free (e2);
g_free (line);
......
......@@ -204,7 +204,7 @@ get_file_info (GThumbWindow *window)
char *file_size_txt;
int zoom;
char *file_info;
char time_txt[50];
char time_txt[50], *utf8_time_txt;
time_t timer;
struct tm *tm;
......@@ -221,6 +221,7 @@ get_file_info (GThumbWindow *window)
timer = get_file_mtime (window->image_path);
tm = localtime (&timer);
strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);
utf8_time_txt = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
file_info = g_strdup_printf ("%d/%d - <tt>%s</tt>\n<i>%s (%d%%) - %s - %s </i>",
gth_file_list_pos_from_path (window->file_list, window->image_path) + 1,
......@@ -229,7 +230,8 @@ get_file_info (GThumbWindow *window)
size_txt,
zoom,
file_size_txt,
time_txt);
utf8_time_txt);
g_free (utf8_time_txt);
g_free (e_filename);
g_free (size_txt);
g_free (file_size_txt);
......
......@@ -428,7 +428,7 @@ update_file_info (GthExifDataViewer *edv)
char *size_txt;
time_t mtime;
struct tm *tm;
char time_txt[50];
char time_txt[50], *utf8_time_txt;
double sec;
GnomeVFSFileSize file_size;
char *file_size_txt;
......@@ -452,6 +452,7 @@ update_file_info (GthExifDataViewer *edv)
mtime = get_file_mtime (edv->priv->path);
tm = localtime (&mtime);
strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);
utf8_time_txt = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
sec = g_timer_elapsed (image_loader_get_timer (edv->priv->viewer->loader), NULL);
file_size = get_file_size (edv->priv->path);
......@@ -483,12 +484,13 @@ update_file_info (GthExifDataViewer *edv)
gtk_list_store_append (edv->priv->image_exif_model, &iter);
gtk_list_store_set (edv->priv->image_exif_model, &iter,
NAME_COLUMN, _("Modified"),
VALUE_COLUMN, time_txt,
VALUE_COLUMN, utf8_time_txt,
POS_COLUMN, -1,
-1);
/**/
g_free (utf8_time_txt);
g_free (utf8_name);
g_free (size_txt);
g_free (file_size_txt);
......
......@@ -354,8 +354,8 @@ window_update_statusbar_zoom_info (GThumbWindow *window)
static void
window_update_statusbar_image_info (GThumbWindow *window)
{
char *text, *utf8_text;
char time_txt[50];
char *text;
char time_txt[50], *utf8_time_txt;
char *size_txt;
char *file_size_txt;
const char *path;
......@@ -390,6 +390,7 @@ window_update_statusbar_image_info (GThumbWindow *window)
timer = get_file_mtime (path);
tm = localtime (&timer);
strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);
utf8_time_txt = g_locale_to_utf8 (time_txt, -1, 0, 0, 0);
sec = g_timer_elapsed (image_loader_get_timer (IMAGE_VIEWER (window->viewer)->loader), NULL);
size_txt = g_strdup_printf (_("%d x %d pixels"), width, height);
......@@ -400,16 +401,15 @@ window_update_statusbar_image_info (GThumbWindow *window)
text = g_strdup_printf (" %s - %s - %s ",
size_txt,
file_size_txt,
time_txt);
utf8_text = g_locale_to_utf8 (text, -1, 0, 0, 0);
gtk_label_set_markup (GTK_LABEL (window->image_info), utf8_text);
utf8_time_txt);
gtk_label_set_markup (GTK_LABEL (window->image_info), text);
/**/
g_free (size_txt);
g_free (file_size_txt);
g_free (text);
g_free (utf8_text);
g_free (utf8_time_txt);
}
......@@ -2851,6 +2851,11 @@ key_press_cb (GtkWidget *widget,
edit_edit_categories_command_impl (NULL, window, NULL);
return TRUE;
case GDK_Escape:
if (window->image_pane_visible)
window_hide_image_pane (window);
return TRUE;
default:
break;
}
......@@ -3321,6 +3326,17 @@ gth_file_list_drag_begin (GtkWidget *widget,
}
static void
gth_file_list_drag_end (GtkWidget *widget,
GdkDragContext *context,
gpointer extra_data)
{
if (gth_file_list_drag_data != NULL)
path_list_free (gth_file_list_drag_data);
gth_file_list_drag_data = NULL;
}
static void
gth_file_list_drag_data_get (GtkWidget *widget,
GdkDragContext *context,
......@@ -3341,8 +3357,6 @@ gth_file_list_drag_data_get (GtkWidget *widget,
g_free (target);
url_list = make_url_list (gth_file_list_drag_data, target_id);
path_list_free (gth_file_list_drag_data);
gth_file_list_drag_data = NULL;
if (url_list == NULL)
return;
......@@ -3385,7 +3399,9 @@ image_list_drag_data_received (GtkWidget *widget,
char *dest_dir = NULL;
if (! ((data->length >= 0) && (data->format == 8))
|| (window->sidebar_content != GTH_SIDEBAR_DIR_LIST)) {
|| (window->sidebar_content != GTH_SIDEBAR_DIR_LIST)
|| (context->action & GDK_ACTION_COPY != GDK_ACTION_COPY)
|| (context->action & GDK_ACTION_MOVE != GDK_ACTION_MOVE)) {
gtk_drag_finish (context, FALSE, FALSE, time);
return;
}
......@@ -3400,7 +3416,7 @@ image_list_drag_data_received (GtkWidget *widget,
dlg_copy_items (window,
list,
dest_dir,
TRUE,
(context->action & GDK_ACTION_MOVE == GDK_ACTION_MOVE),
TRUE,
move_items__continue,
window);
......@@ -3426,7 +3442,10 @@ dir_list_drag_data_received (GtkWidget *widget,
char *dest_dir = NULL;
const char *current_dir;
if (! ((data->length >= 0) && (data->format == 8))) {
if ((data->length < 0)
|| (data->format != 8)
|| ((context->actions & GDK_ACTION_COPY) != GDK_ACTION_COPY)
|| ((context->actions & GDK_ACTION_MOVE) != GDK_ACTION_MOVE)) {
gtk_drag_finish (context, FALSE, FALSE, time);
return;
}
......@@ -3463,7 +3482,7 @@ dir_list_drag_data_received (GtkWidget *widget,
dlg_copy_items (window,
list,
dest_dir,
TRUE,
(context->actions & GDK_ACTION_MOVE) == GDK_ACTION_MOVE,
TRUE,
move_items__continue,
window);
......@@ -3564,7 +3583,7 @@ dir_list_drag_begin (GtkWidget *widget,
dir_list_tree_path = NULL;
}
if (dir_list_drag_data) {
if (dir_list_drag_data != NULL) {
g_free (dir_list_drag_data);
dir_list_drag_data = NULL;
}
......@@ -3577,6 +3596,18 @@ dir_list_drag_begin (GtkWidget *widget,
}
static void
dir_list_drag_end (GtkWidget *widget,
GdkDragContext *context,
gpointer extra_data)
{
if (dir_list_drag_data != NULL) {
g_free (dir_list_drag_data);
dir_list_drag_data = NULL;
}
}
static void
dir_list_drag_leave (GtkWidget *widget,
GdkDragContext *context,
......@@ -3586,6 +3617,11 @@ dir_list_drag_leave (GtkWidget *widget,
GThumbWindow *window = extra_data;
GtkTreeView *list_view;
if (window->auto_load_timeout != 0) {
g_source_remove (window->auto_load_timeout);
window->auto_load_timeout = 0;
}
list_view = GTK_TREE_VIEW (window->dir_list->list_view);
gtk_tree_view_set_drag_dest_row (list_view, NULL, 0);
}
......@@ -3612,14 +3648,15 @@ dir_list_drag_data_get (GtkWidget *widget,
}
g_free (target);
context->actions = GDK_ACTION_COPY | GDK_ACTION_MOVE;
context->suggested_action = GDK_ACTION_MOVE;
uri = g_strconcat ("file://", dir_list_drag_data, "\n", NULL);
gtk_selection_data_set (selection_data,
selection_data->target,
8,
dir_list_drag_data,
strlen (uri));
g_free (dir_list_drag_data);
dir_list_drag_data = NULL;
g_free (uri);
}
......@@ -3810,6 +3847,11 @@ catalog_list_drag_leave (GtkWidget *widget,
GThumbWindow *window = extra_data;
GtkTreeView *list_view;
if (window->auto_load_timeout != 0) {
g_source_remove (window->auto_load_timeout);
window->auto_load_timeout = 0;
}
list_view = GTK_TREE_VIEW (window->catalog_list->list_view);
gtk_tree_view_set_drag_dest_row (list_view, NULL, 0);
}
......@@ -4559,19 +4601,21 @@ create_new_file_list (GThumbWindow *window)
gtk_drag_dest_set (file_list->root_widget,
GTK_DEST_DEFAULT_ALL,
target_table,
G_N_ELEMENTS(target_table),
GDK_ACTION_COPY);
G_N_ELEMENTS (target_table),
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gtk_drag_source_set (file_list->root_widget,
GDK_BUTTON1_MASK,
target_table,
G_N_ELEMENTS(target_table),
GDK_ACTION_COPY);
G_N_ELEMENTS (target_table),
GDK_ACTION_COPY | GDK_ACTION_MOVE);
/*
gtk_drag_dest_set (file_list->root_widget,
GTK_DEST_DEFAULT_ALL,
same_app_target_table,
G_N_ELEMENTS(same_app_target_table),
GDK_ACTION_MOVE);
*/
gtk_drag_source_set (file_list->root_widget,
GDK_BUTTON1_MASK,
same_app_target_table,
......@@ -4611,6 +4655,10 @@ create_new_file_list (GThumbWindow *window)
"drag_begin",
G_CALLBACK (gth_file_list_drag_begin),
window);
g_signal_connect (G_OBJECT (view_widget),
"drag_end",
G_CALLBACK (gth_file_list_drag_end),
window);
g_signal_connect (G_OBJECT (view_widget),
"drag_data_get",
G_CALLBACK (gth_file_list_drag_data_get),
......@@ -4683,25 +4731,27 @@ window_set_preview_content (GThumbWindow *window,
window->preview_content = content;
gtk_widget_hide (window->preview_widget_image);
gtk_widget_hide (window->preview_widget_data);
gtk_widget_hide (window->preview_widget_comment);
gtk_widget_hide (window->preview_widget_data_comment);
set_button_active_no_notify (window, window->preview_button_image, FALSE);
set_button_active_no_notify (window, window->preview_button_data, FALSE);
set_button_active_no_notify (window, window->preview_button_comment, FALSE);
if (window->preview_content == GTH_PREVIEW_CONTENT_IMAGE) {
gtk_widget_hide (window->preview_widget_data);
gtk_widget_hide (window->preview_widget_comment);
gtk_widget_hide (window->preview_widget_data_comment);
gtk_widget_show (window->preview_widget_image);
set_button_active_no_notify (window, window->preview_button_image, TRUE);
} else if (window->preview_content == GTH_PREVIEW_CONTENT_DATA) {
gtk_widget_hide (window->preview_widget_image);
gtk_widget_hide (window->preview_widget_comment);
gtk_widget_show (window->preview_widget_data);
gtk_widget_show (window->preview_widget_data_comment);
set_button_active_no_notify (window, window->preview_button_data, TRUE);
} else if (window->preview_content == GTH_PREVIEW_CONTENT_COMMENT) {
gtk_widget_hide (window->preview_widget_image);
gtk_widget_hide (window->preview_widget_data);
gtk_widget_show (window->preview_widget_comment);
gtk_widget_show (window->preview_widget_data_comment);
set_button_active_no_notify (window, window->preview_button_comment, TRUE);
......@@ -4878,11 +4928,11 @@ window_new (void)
window->dir_list = dir_list_new ();
gtk_drag_dest_set (window->dir_list->root_widget,
GTK_DEST_DEFAULT_ALL,
target_table, G_N_ELEMENTS(target_table),
target_table, G_N_ELEMENTS (target_table),
GDK_ACTION_MOVE);
gtk_drag_source_set (window->dir_list->list_view,
GDK_BUTTON1_MASK,
target_table, G_N_ELEMENTS(target_table),
target_table, G_N_ELEMENTS (target_table),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
g_signal_connect (G_OBJECT (window->dir_list->root_widget),
"drag_data_received",
......@@ -4892,6 +4942,10 @@ window_new (void)
"drag_begin",
G_CALLBACK (dir_list_drag_begin),
window);
g_signal_connect (G_OBJECT (window->dir_list->list_view),
"drag_end",
G_CALLBACK (dir_list_drag_end),
window);
g_signal_connect (G_OBJECT (window->dir_list->root_widget),
"drag_motion",
G_CALLBACK (dir_list_drag_motion),
......@@ -5736,6 +5790,16 @@ close__step5 (GThumbWindow *window)
window->popup_menu = NULL;
}
if (gth_file_list_drag_data != NULL) {
path_list_free (gth_file_list_drag_data);
gth_file_list_drag_data = NULL;
}
if (dir_list_drag_data != NULL) {
g_free (dir_list_drag_data);
dir_list_drag_data = NULL;
}
gtk_object_destroy (GTK_OBJECT (window->tooltips));
gtk_widget_destroy (window->app);
......
......@@ -11,9 +11,9 @@ INCLUDES = \
-I$(top_srcdir)/libgthumb
noinst_LIBRARIES = libgthumb-jpegutils.a
noinst_LTLIBRARIES = libgthumb-jpegutils.la
libgthumb_jpegutils_a_SOURCES = \
libgthumb_jpegutils_la_SOURCES = \
jpeg-data.c \
jpeg-data.h \
jpeg-marker.c \
......