cheese r872 - in trunk: . src
- From: fargiolas svn gnome org
- To: svn-commits-list gnome org
- Subject: cheese r872 - in trunk: . src
- Date: Fri, 8 Aug 2008 14:05:05 +0000 (UTC)
Author: fargiolas
Date: Fri Aug 8 14:05:05 2008
New Revision: 872
URL: http://svn.gnome.org/viewvc/cheese?rev=872&view=rev
Log:
Change action_files sensitiveness on "selection-changed" event. Fixes bug 546918
Modified:
trunk/ChangeLog
trunk/src/cheese-window.c
Modified: trunk/src/cheese-window.c
==============================================================================
--- trunk/src/cheese-window.c (original)
+++ trunk/src/cheese-window.c Fri Aug 8 14:05:05 2008
@@ -812,23 +812,29 @@
g_free (license_trans);
}
+static void
+cheese_window_selection_changed_cb (GtkIconView *iconview,
+ CheeseWindow *cheese_window)
+{
+ if (cheese_thumb_view_get_n_selected (CHEESE_THUMB_VIEW (cheese_window->thumb_view)) > 0) {
+ gtk_action_group_set_sensitive (cheese_window->actions_file, TRUE);
+ } else {
+ gtk_action_group_set_sensitive (cheese_window->actions_file, FALSE);
+ }
+}
+
static gboolean
cheese_window_button_press_event_cb (GtkWidget *iconview, GdkEventButton *event,
CheeseWindow *cheese_window)
{
GtkTreePath *path;
- gtk_action_group_set_sensitive (cheese_window->actions_file, TRUE);
if (event->type == GDK_BUTTON_PRESS || event->type == GDK_2BUTTON_PRESS)
{
path = gtk_icon_view_get_path_at_pos (GTK_ICON_VIEW (iconview),
(int) event->x, (int) event->y);
- if (path == NULL)
- {
- gtk_action_group_set_sensitive (cheese_window->actions_file, FALSE);
- return FALSE;
- }
-
+ if (path == NULL) return FALSE;
+
if (event->type == GDK_BUTTON_PRESS && event->button == 1)
{
if (cheese_thumb_view_get_n_selected (CHEESE_THUMB_VIEW (cheese_window->thumb_view)) > 1) {
@@ -1574,6 +1580,8 @@
g_signal_connect (cheese_window->take_picture, "clicked",
G_CALLBACK (cheese_window_action_button_clicked_cb), cheese_window);
+ g_signal_connect (cheese_window->thumb_view, "selection_changed",
+ G_CALLBACK (cheese_window_selection_changed_cb), cheese_window);
g_signal_connect (cheese_window->thumb_view, "button_press_event",
G_CALLBACK (cheese_window_button_press_event_cb), cheese_window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]