[Xfce4-commits] <ristretto:master> Update button sensitivity when an image is opened or closed.
Stephan Arts
noreply at xfce.org
Sat Aug 27 14:40:06 CEST 2011
Updating branch refs/heads/master
to 6d37d2c5f58d5f28d5282b3a93bbf95245865175 (commit)
from f6c5507d34e9c17ca229849c426056d216105355 (commit)
commit 6d37d2c5f58d5f28d5282b3a93bbf95245865175
Author: Stephan Arts <stephan at xfce.org>
Date: Sat Aug 27 13:17:39 2011 +0200
Update button sensitivity when an image is opened or closed.
When the first image is opened, the 'iter-changed' signal is
emitted, this causes the main-window to toggle the sensitivity of
the next, previous and play buttons. Since 'next', 'previous' and
'play slideshow' do not make sense when you've opened a single
image, these 3 buttons are marked insensitive then. Opening the
rest of the folder doesn't move the iterator, and thus doesn't
trigger additional 'iter-changed' signals. Keeping the buttons
disabled even though several other images have been opened aswell.
Calling the 'update_buttons' function immediately after opening
new images or a folder of images solves this discrepancy.
For consistency, 'update_buttons' is called from the function
closing the images aswell. This makes sure the zoom- and rotate-
buttons are disabled when no image is opened.
src/main_window.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/main_window.c b/src/main_window.c
index 5218e4c..3b6c17d 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -2086,6 +2086,8 @@ cb_rstto_main_window_open_image (GtkWidget *widget, RsttoMainWindow *window)
gtk_widget_destroy(dialog);
+ rstto_main_window_update_buttons (window);
+
if (files)
{
g_slist_foreach (files, (GFunc)g_object_unref, NULL);
@@ -2163,6 +2165,8 @@ cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window)
gtk_widget_destroy(dialog);
+ rstto_main_window_update_buttons (window);
+
if (file)
{
g_object_unref (file);
@@ -2238,6 +2242,8 @@ cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow *win
gtk_widget_destroy (err_dialog);
}
+ rstto_main_window_update_buttons (window);
+
g_object_unref (file);
g_free (uri);
}
@@ -2291,6 +2297,8 @@ cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window)
{
GFile *file = rstto_image_list_iter_get_file (window->priv->iter);
rstto_image_list_remove_file (window->priv->props.image_list, file);
+
+ rstto_main_window_update_buttons (window);
}
/**
@@ -2305,6 +2313,8 @@ cb_rstto_main_window_close_all (GtkWidget *widget, RsttoMainWindow *window)
{
rstto_image_list_remove_all (window->priv->props.image_list);
rstto_main_window_image_list_iter_changed (window);
+
+ rstto_main_window_update_buttons (window);
}
More information about the Xfce4-commits
mailing list