[Xfce4-commits] <parole:master> Don't set the play button insensitive when stop is clicked and media list isn't empty
Ali Abdallah
noreply at xfce.org
Tue Sep 29 11:38:03 CEST 2009
Updating branch refs/heads/master
to 9ed4c72d9422cb432271af63e6f749ad77095fc4 (commit)
from 2133d31be66a99bafc7b27cf8b4f50997ea2bc19 (commit)
commit 9ed4c72d9422cb432271af63e6f749ad77095fc4
Author: Ali Abdallah <ali at ali-xfce.org>
Date: Tue Sep 29 11:36:06 2009 +0000
Don't set the play button insensitive when stop is clicked and media list isn't empty
parole/parole-medialist.c | 5 +++++
parole/parole-medialist.h | 2 ++
parole/parole-player.c | 6 ++++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/parole/parole-medialist.c b/parole/parole-medialist.c
index 4a97d6f..19cf63c 100644
--- a/parole/parole-medialist.c
+++ b/parole/parole-medialist.c
@@ -1198,6 +1198,11 @@ GtkTreeRowReference *parole_media_list_get_row_random (ParoleMediaList *list)
return row;
}
+gboolean parole_media_list_is_selected_row (ParoleMediaList *list)
+{
+ return gtk_tree_selection_count_selected_rows (list->priv->sel) > 0;
+}
+
GtkTreeRowReference *parole_media_list_get_selected_row (ParoleMediaList *list)
{
return parole_media_list_get_first_selected_row (list);
diff --git a/parole/parole-medialist.h b/parole/parole-medialist.h
index 46259b6..4d0a922 100644
--- a/parole/parole-medialist.h
+++ b/parole/parole-medialist.h
@@ -69,6 +69,8 @@ GtkWidget *parole_media_list_new (void);
void parole_media_list_load (ParoleMediaList *list);
+gboolean parole_media_list_is_selected_row (ParoleMediaList *list);
+
GtkTreeRowReference *parole_media_list_get_selected_row (ParoleMediaList *list);
GtkTreeRowReference *parole_media_list_get_next_row (ParoleMediaList *list,
diff --git a/parole/parole-player.c b/parole/parole-player.c
index 70d450b..391d211 100644
--- a/parole/parole-player.c
+++ b/parole/parole-player.c
@@ -563,9 +563,11 @@ parole_player_stopped (ParolePlayer *player)
player->priv->state = PAROLE_MEDIA_STATE_STOPPED;
- gtk_widget_set_sensitive (player->priv->play_pause, FALSE);
+ gtk_widget_set_sensitive (player->priv->play_pause,
+ parole_media_list_is_selected_row (player->priv->list));
- /* Set the stop widget insensitive only if we are not going to got to playing
+ /*
+ * Set the stop widget insensitive only if we are not going to got to playing
* state, this give the possibility to press on it if the media get stuck
* for some reason.
*/
More information about the Xfce4-commits
mailing list