Revision: 1827
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1827&view=rev
Author: phantom_sf
Date: 2007-12-13 14:55:50 -0800 (Thu, 13 Dec 2007)
Log Message:
-----------
2007-12-13 P.G. Richardson <phantom_sf at users.sourceforge.net>
* src/context_menus.c
src/display_photo.h
src/display_photo.c
Bug fixes made to photo window. Remove photo action disabled
on thumbnail view context menu when no thumbs selected. The
Remove album action was not removing an album unless the
album contained photos. Thanks to Alex Eftimie for raising
the bugs.
Modified Paths:
--------------
gtkpod/trunk/ChangeLog_detailed
gtkpod/trunk/src/context_menus.c
gtkpod/trunk/src/display_photo.c
gtkpod/trunk/src/display_photo.h
Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed 2007-12-13 14:06:42 UTC (rev 1826)
+++ gtkpod/trunk/ChangeLog_detailed 2007-12-13 22:55:50 UTC (rev 1827)
@@ -1,3 +1,15 @@
+2007-12-13 P.G. Richardson <phantom_sf at users.sourceforge.net>
+
+ * src/context_menus.c
+ src/display_photo.h
+ src/display_photo.c
+
+ Bug fixes made to photo window. Remove photo action disabled
+ on thumbnail view context menu when no thumbs selected. The
+ Remove album action was not removing an album unless the
+ album contained photos. Thanks to Alex Eftimie for raising
+ the bugs.
+
2007-12-13 Daniele Forsi <dforsi at users.sourceforge.net>
* src/file.c: add variable for existing %s directive
Modified: gtkpod/trunk/src/context_menus.c
===================================================================
--- gtkpod/trunk/src/context_menus.c 2007-12-13 14:06:42 UTC (rev 1826)
+++ gtkpod/trunk/src/context_menus.c 2007-12-13 22:55:50 UTC (rev 1827)
@@ -900,12 +900,19 @@
GtkWidget *gphoto_menuitem_remove_photo_from_album_item(GtkWidget *menu)
{
- return hookup_mi (
+ GtkWidget *mitem = hookup_mi (
menu,
_("Remove Photo"),
GTK_STOCK_DELETE,
G_CALLBACK (gphoto_remove_selected_photos_from_album),
NULL);
+
+ if (gphoto_get_selected_photo_count() == 0)
+ gtk_widget_set_sensitive (mitem, FALSE);
+ else
+ gtk_widget_set_sensitive (mitem, TRUE);
+
+ return mitem;
}
GtkWidget *gphoto_menuitem_rename_photoalbum_item(GtkWidget *menu)
Modified: gtkpod/trunk/src/display_photo.c
===================================================================
--- gtkpod/trunk/src/display_photo.c 2007-12-13 14:06:42 UTC (rev 1826)
+++ gtkpod/trunk/src/display_photo.c 2007-12-13 22:55:50 UTC (rev 1827)
@@ -770,6 +770,25 @@
}
/**
+ * gphoto_get_selected_photo_count
+ *
+ * Function to return the number of photos
+ * currently selected in the iconview.
+ *
+ */
+gint gphoto_get_selected_photo_count ()
+{
+ GList *selected_items= NULL;
+
+ selected_items = gtk_icon_view_get_selected_items (thumbnail_view);
+
+ if (selected_items == NULL)
+ return 0;
+
+ return g_list_length (selected_items);
+}
+
+/**
* gphoto_add_image_to_database
*
* Add a photo from file name to the photo database and
@@ -922,12 +941,12 @@
}
gboolean remove_pics = FALSE;
- if (g_list_length (selected_album->members) <= 0)
- return;
-
- if (prefs_get_int("photo_library_confirm_delete") == FALSE)
+ if (prefs_get_int("photo_library_confirm_delete") == FALSE ||
+ g_list_length (selected_album->members) <= 0)
{
- /* User has chosen to assume yes and not display a confirm
dialog */
+ /* User has chosen to assume yes and not display a confirm
dialog
+ * or the album is empty
+ */
remove_pics = TRUE;
}
else
Modified: gtkpod/trunk/src/display_photo.h
===================================================================
--- gtkpod/trunk/src/display_photo.h 2007-12-13 14:06:42 UTC (rev 1826)
+++ gtkpod/trunk/src/display_photo.h 2007-12-13 22:55:50 UTC (rev 1827)
@@ -58,7 +58,7 @@
gboolean gphoto_is_photo_playlist (Playlist *pl);
void gphoto_display_photo_window (iTunesDB *itdb);
void gphoto_change_to_photo_window (gboolean showflag);
-
+gint gphoto_get_selected_photo_count ();
void gphoto_remove_selected_photos_from_album (gboolean show_dialogs);
void gphoto_remove_album_from_database ();
void gphoto_rename_selected_album ();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2