Commit d5e1cf2d authored by Stephan Arts's avatar Stephan Arts

Remove obsolete files and improve status messages

parent fa40ab20
2009-09-19 Stephan Arts <stephan@xfce.org>
* src/navigator.c,
src/navigator.h: Remove obsolete source files
* src/main_window.c,
src/image_list.c: Improve status-messages
2009-09-06 Stephan Arts <stephan@xfce.org>
* src/main_window.c,
......
......@@ -62,6 +62,7 @@ enum
enum
{
RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED = 0,
RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE,
RSTTO_IMAGE_LIST_ITER_SIGNAL_COUNT
};
......@@ -315,6 +316,17 @@ rstto_image_list_iter_class_init(RsttoImageListIterClass *iter_class)
object_class->dispose = rstto_image_list_iter_dispose;
rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE] = g_signal_new("prepare-change",
G_TYPE_FROM_CLASS(iter_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0,
NULL,
NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0,
NULL);
rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED] = g_signal_new("changed",
G_TYPE_FROM_CLASS(iter_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
......@@ -363,6 +375,8 @@ rstto_image_list_iter_find_image (RsttoImageListIter *iter, RsttoImage *image)
gint pos = g_list_index (iter->priv->image_list->priv->images, image);
if (pos > -1)
{
g_signal_emit (G_OBJECT (iter), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE], 0, NULL);
if (iter->priv->image)
{
iter->priv->image = NULL;
......@@ -396,6 +410,8 @@ rstto_image_list_iter_get_image (RsttoImageListIter *iter)
void
rstto_image_list_iter_set_position (RsttoImageListIter *iter, gint pos)
{
g_signal_emit (G_OBJECT (iter), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE], 0, NULL);
if (iter->priv->image)
{
iter->priv->image = NULL;
......@@ -410,6 +426,9 @@ void
rstto_image_list_iter_next (RsttoImageListIter *iter)
{
GList *position = NULL;
g_signal_emit (G_OBJECT (iter), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE], 0, NULL);
if (iter->priv->image)
{
position = g_list_find (iter->priv->image_list->priv->images, iter->priv->image);
......@@ -435,6 +454,9 @@ void
rstto_image_list_iter_previous (RsttoImageListIter *iter)
{
GList *position = NULL;
g_signal_emit (G_OBJECT (iter), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_PREPARE_CHANGE], 0, NULL);
if (iter->priv->image)
{
position = g_list_find (iter->priv->image_list->priv->images, iter->priv->image);
......
......@@ -134,6 +134,9 @@ rstto_main_window_get_property (GObject *object,
static gboolean
rstto_window_save_geometry_timer (gpointer user_data);
static void
rstto_main_window_image_list_iter_changed (RsttoMainWindow *window);
static gboolean
cb_rstto_main_window_configure_event (GtkWidget *widget, GdkEventConfigure *event);
static void
......@@ -143,7 +146,9 @@ cb_rstto_main_window_show_fs_toolbar_timeout (RsttoMainWindow *window);
static void
cb_rstto_main_window_image_list_iter_changed (RsttoImageListIter *iter, RsttoMainWindow *window);
static void
rstto_main_window_image_list_iter_changed (RsttoMainWindow *window);
cb_rstto_main_window_image_list_iter_prepare_change (RsttoImageListIter *iter, RsttoMainWindow *window);
static void
cb_rstto_main_window_image_prepared(RsttoImage *image, RsttoMainWindow *window);
static void
cb_rstto_main_window_image_list_new_image (RsttoImageList *image_list, RsttoImage *image, RsttoMainWindow *window);
......@@ -707,6 +712,8 @@ rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
cur_image = rstto_image_list_iter_get_image (window->priv->iter);
if (cur_image)
{
g_signal_connect (G_OBJECT (cur_image), "prepared", G_CALLBACK (cb_rstto_main_window_image_prepared), window);
width = rstto_image_get_width(cur_image);
height = rstto_image_get_height(cur_image);
......@@ -716,7 +723,14 @@ rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
basename = g_path_get_basename (path);
title = g_strdup_printf ("%s - %s [%d/%d]", RISTRETTO_APP_TITLE, basename, position+1, count);
status = g_strdup_printf ("%d x %d", width, height);
if (width > 0)
{
status = g_strdup_printf ("%d x %d", width, height);
}
else
{
status = g_strdup_printf ("Loading '%s'", basename);
}
g_free (basename);
g_free (path);
......@@ -738,6 +752,15 @@ rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
}
static void
cb_rstto_main_window_image_list_iter_prepare_change (RsttoImageListIter *iter, RsttoMainWindow *window)
{
RsttoImage *image = rstto_image_list_iter_get_image (iter);
if (image)
{
g_signal_handlers_disconnect_by_func (image, cb_rstto_main_window_image_prepared, window);
}
}
/**
* rstto_main_window_update_buttons:
......@@ -2273,3 +2296,16 @@ cb_rstto_main_window_toggle_show_thumbnailbar (GtkWidget *widget, RsttoMainWindo
rstto_settings_set_boolean_property (RSTTO_SETTINGS (window->priv->settings_manager), "show-thumbnailbar", FALSE);
}
}
static void
cb_rstto_main_window_image_prepared (RsttoImage *image, RsttoMainWindow *window)
{
gint width = rstto_image_get_width (image);
gint height = rstto_image_get_height (image);
gchar *status = g_strdup_printf ("%d x %d", width, height);
gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar), window->priv->statusbar_context_id);
gtk_statusbar_push (GTK_STATUSBAR (window->priv->statusbar), window->priv->statusbar_context_id, status);
g_free (status);
}
This diff is collapsed.
/*
* 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 Library 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 Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __RISTRETTO_NAVIGATOR_H__
#define __RISTRETTO_NAVIGATOR_H__
G_BEGIN_DECLS
#define RSTTO_TYPE_NAVIGATOR rstto_navigator_get_type()
#define RSTTO_NAVIGATOR(obj)( \
G_TYPE_CHECK_INSTANCE_CAST ((obj), \
RSTTO_TYPE_NAVIGATOR, \
RsttoNavigator))
#define RSTTO_IS_NAVIGATOR(obj)( \
G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
RSTTO_TYPE_NAVIGATOR))
#define RSTTO_NAVIGATOR_CLASS(klass)( \
G_TYPE_CHECK_CLASS_CAST ((klass), \
RSTTO_TYPE_NAVIGATOR, \
RsttoNavigatorClass))
#define RSTTO_IS_NAVIGATOR_CLASS(klass)( \
G_TYPE_CHECK_CLASS_TYPE ((klass), \
RSTTO_TYPE_NAVIGATOR()))
typedef struct _RsttoNavigatorEntry RsttoNavigatorEntry;
typedef struct _RsttoNavigator RsttoNavigator;
struct _RsttoNavigator
{
GObject parent;
GtkRecentManager *manager;
ThunarVfsMonitor *monitor;
ThunarVfsMonitorHandle *monitor_handle;
ThunarVfsThumbFactory *factory;
ThunarVfsPath *path;
GCompareFunc compare_func;
GList *file_list;
GList *file_iter;
GList *history;
guint64 max_history;
gboolean preload;
gint old_position;
gboolean running;
gint timeout;
gint id;
gboolean busy;
};
typedef struct _RsttoNavigatorClass RsttoNavigatorClass;
struct _RsttoNavigatorClass
{
GObjectClass parent_class;
};
GType rstto_navigator_get_type ();
RsttoNavigator *
rstto_navigator_new (GtkRecentManager *recent_manager);
void rstto_navigator_jump_first (RsttoNavigator *navigator);
void rstto_navigator_jump_forward (RsttoNavigator *navigator);
void rstto_navigator_jump_back (RsttoNavigator *navigator);
void rstto_navigator_jump_last (RsttoNavigator *navigator);
void rstto_navigator_set_running (RsttoNavigator *navigator,
gboolean running);
gboolean rstto_navigator_is_running (RsttoNavigator *navigator);
void
rstto_navigator_set_timeout (RsttoNavigator *nav, gint);
RsttoNavigatorEntry *
rstto_navigator_get_file (RsttoNavigator *navigator);
gint
rstto_navigator_get_position(RsttoNavigator *navigator);
gint
rstto_navigator_get_old_position(RsttoNavigator *navigator);
gint
rstto_navigator_add (RsttoNavigator *navigator, RsttoNavigatorEntry *entry, gboolean with_monitor);
void
rstto_navigator_remove (RsttoNavigator *navigator, RsttoNavigatorEntry *entry);
gint
rstto_navigator_get_n_files (RsttoNavigator *navigator);
RsttoNavigatorEntry *
rstto_navigator_get_nth_file (RsttoNavigator *navigator, gint n);
void
rstto_navigator_set_file_nr (RsttoNavigator *navigator, gint n);
void
rstto_navigator_clear (RsttoNavigator *navigator);
RsttoNavigatorEntry *
rstto_navigator_entry_new (RsttoNavigator *, ThunarVfsInfo *info);
void
rstto_navigator_entry_free(RsttoNavigatorEntry *nav_entry);
ThunarVfsInfo *
rstto_navigator_entry_get_info (RsttoNavigatorEntry *entry);
gboolean
rstto_navigator_entry_get_fit_to_screen (RsttoNavigatorEntry *entry);
gdouble
rstto_navigator_entry_get_scale (RsttoNavigatorEntry *entry);
void
rstto_navigator_entry_set_fit_to_screen (RsttoNavigatorEntry *entry, gboolean);
void
rstto_navigator_entry_set_scale (RsttoNavigatorEntry *entry, gdouble);
void
rstto_navigator_entry_set_rotation (RsttoNavigatorEntry *entry, GdkPixbufRotation rotation);
gint
rstto_navigator_entry_get_position(RsttoNavigatorEntry *entry);
GdkPixbufRotation
rstto_navigator_entry_get_rotation (RsttoNavigatorEntry *entry);
gboolean
rstto_navigator_entry_get_flip (RsttoNavigatorEntry *entry, gboolean horizontal);
void
rstto_navigator_flip_entry(RsttoNavigator *navigator, RsttoNavigatorEntry *entry, gboolean horizontal);
GdkPixbuf *
rstto_navigator_entry_get_thumb(RsttoNavigatorEntry *entry, gint size);
ExifData *
rstto_navigator_entry_get_exif_data (RsttoNavigatorEntry *entry);
GdkPixbufLoader *
rstto_navigator_entry_get_pixbuf_loader (RsttoNavigatorEntry *entry);
GdkPixbuf *
rstto_navigator_entry_get_pixbuf (RsttoNavigatorEntry *entry);
gboolean
rstto_navigator_entry_load_image (RsttoNavigatorEntry *entry, gboolean empty_cache);
void
rstto_navigator_entry_select (RsttoNavigatorEntry *entry);
guint64
rstto_navigator_entry_get_size (RsttoNavigatorEntry *entry);
guint64
rstto_navigator_get_max_history_size(RsttoNavigator *navigator);
void
rstto_navigator_set_max_history_size(RsttoNavigator *nav, guint64 size);
void
rstto_navigator_set_monitor_handle_for_dir(RsttoNavigator *nav, ThunarVfsPath *dir_path);
gboolean
rstto_navigator_entry_is_selected(RsttoNavigatorEntry *entry);
gboolean
rstto_navigator_open_file(RsttoNavigator *navigator, const gchar *path, gboolean open_folder, GError **error);
gboolean
rstto_navigator_open_folder(RsttoNavigator *navigator, const gchar *path, gboolean clear, GError **error);
gboolean
rstto_navigator_entry_get_orientation_changed (RsttoNavigatorEntry *entry);
G_END_DECLS
#endif /* __RISTRETTO_NAVIGATOR_H__ */
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