[goobox] emit a fake EJECT signal to update the window state correclty



commit 00962d890b06a50b780f7406ac31e272185a546b
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Nov 15 22:08:34 2009 +0100

    emit a fake EJECT signal to update the window state correclty
    
    when no disc is present in the drive no eject signal is emitted
    so we need to emit a fake eject signal when a new disc is inserted

 src/goo-player.c |    2 ++
 src/goo-window.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/goo-player.c b/src/goo-player.c
index f8cfcf1..a71800c 100644
--- a/src/goo-player.c
+++ b/src/goo-player.c
@@ -785,6 +785,8 @@ goo_player_update (GooPlayer *self)
 		action_done (self, GOO_PLAYER_ACTION_LIST);
 	}
 	else if ((BRASERO_MEDIUM_IS (brasero_medium_get_status (medium), BRASERO_MEDIUM_CD | BRASERO_MEDIUM_HAS_AUDIO))) {
+		if (self->priv->state == GOO_PLAYER_STATE_NO_DISC)
+			action_done (self, GOO_PLAYER_ACTION_EJECT); /* fake EJECT signal to update the window state correctly */
 		self->priv->audio_cd = TRUE;
 		goo_player_set_state (self, GOO_PLAYER_STATE_STOPPED, TRUE);
 		goo_player_list (self);
diff --git a/src/goo-window.c b/src/goo-window.c
index 49eaad1..5a6fec3 100644
--- a/src/goo-window.c
+++ b/src/goo-window.c
@@ -1636,7 +1636,7 @@ player_done_cb (GooPlayer       *player,
 		goo_window_update_cover (window);
 		window_update_title (window);
 		set_current_track_icon (window, NULL);
-		if (AutoPlay || eel_gconf_get_boolean (PREF_GENERAL_AUTOPLAY, TRUE)) {
+		if (AutoPlay || (window->priv->ejected && eel_gconf_get_boolean (PREF_GENERAL_AUTOPLAY, TRUE))) {
 			AutoPlay = FALSE;
 			g_timeout_add (AUTOPLAY_DELAY, autoplay_cb, window);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]