commit e7a6e22658b6a8e66ce71b5c07ae1529a841da0c Author: phantomjinx <p.g.richard...@phantomjinx.co.uk> Date: Tue Jun 29 22:21:46 2010 +0100
Fixes for coverart display syncing * cover_display/plugin.c * respond to tracks displayed signal * anjuta_app.c * Seems that if a plugin UI window was closed then the app exited, the next time it is opened, the former has trouble displaying. * display_sorttabs.c * stop broadcasting the displayed tracks quite as often. .gitignore | 1 + libgtkpod/gtkpod_app_iface.c | 6 ++++++ plugins/cover_display/plugin.c | 1 + src/anjuta-app.c | 2 +- src/display_sorttabs.c | 23 ++++++++--------------- 5 files changed, 17 insertions(+), 16 deletions(-) --- diff --git a/.gitignore b/.gitignore index 950815e..2b999d8 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ cscope.out /stamp-h1 /ylwrap /.cproject +/libgtkpod-1.0.pc /libtool /ltmain.sh diff --git a/libgtkpod/gtkpod_app_iface.c b/libgtkpod/gtkpod_app_iface.c index b5a2384..42505f8 100644 --- a/libgtkpod/gtkpod_app_iface.c +++ b/libgtkpod/gtkpod_app_iface.c @@ -323,6 +323,9 @@ GList *gtkpod_get_displayed_tracks() { void gtkpod_set_displayed_tracks(GList *tracks) { g_return_if_fail (GTKPOD_IS_APP(gtkpod_app)); + if (tracks == GTKPOD_APP_GET_INTERFACE (gtkpod_app)->displayed_tracks) + return; // Nothing to do + if (tracks) GTKPOD_APP_GET_INTERFACE (gtkpod_app)->displayed_tracks = g_list_copy(tracks); else { @@ -345,6 +348,9 @@ GList *gtkpod_get_selected_tracks() { void gtkpod_set_selected_tracks(GList *tracks) { g_return_if_fail (GTKPOD_IS_APP(gtkpod_app)); + if (tracks == GTKPOD_APP_GET_INTERFACE (gtkpod_app)->selected_tracks) + return; // Nothing to do + if (tracks) GTKPOD_APP_GET_INTERFACE (gtkpod_app)->selected_tracks = g_list_copy(tracks); else diff --git a/plugins/cover_display/plugin.c b/plugins/cover_display/plugin.c index 33643fa..387db52 100644 --- a/plugins/cover_display/plugin.c +++ b/plugins/cover_display/plugin.c @@ -83,6 +83,7 @@ static gboolean activate_plugin(AnjutaPlugin *plugin) { g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (coverart_display_update_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACK_REMOVED, G_CALLBACK (coverart_display_track_removed_cb), NULL); + g_signal_connect (gtkpod_app, SIGNAL_TRACKS_DISPLAYED, G_CALLBACK (coverart_display_set_tracks_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACKS_SELECTED, G_CALLBACK (coverart_display_set_tracks_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACK_UPDATED, G_CALLBACK (coverart_display_track_updated_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACK_ADDED, G_CALLBACK (coverart_display_track_added_cb), NULL); diff --git a/src/anjuta-app.c b/src/anjuta-app.c index fbf5490..d2f5f31 100644 --- a/src/anjuta-app.c +++ b/src/anjuta-app.c @@ -169,7 +169,7 @@ static void anjuta_gtkpod_app_display_widget(GtkWidget *widget) { w = g_object_get_data(G_OBJECT (widget), "dockitem"); } - if (w && !gtk_widget_get_visible(w)) { + if (w) { // Only show docked widget if really sure it is no longer // in the dock layout, ie. widget is not visible gdl_dock_item_show_item(GDL_DOCK_ITEM (w)); diff --git a/src/display_sorttabs.c b/src/display_sorttabs.c index bf77854..4bddf5d 100644 --- a/src/display_sorttabs.c +++ b/src/display_sorttabs.c @@ -1603,7 +1603,6 @@ void st_remove_track(Track *track, guint32 inst) { select "All" in accordance to the prefs settings. */ void st_init(ST_CAT_item new_category, guint32 inst) { if (inst == prefs_get_int("sort_tab_num")) { - gtkpod_set_displayed_tracks(NULL); gtkpod_tracks_statusbar_update(); return; } @@ -1612,6 +1611,7 @@ void st_init(ST_CAT_item new_category, guint32 inst) { if (st == NULL) return; /* could happen during initialisation */ + sp_store_sp_entries(inst); /* store sp entries (if applicable) */ st->unselected = FALSE; /* nothing was unselected so far */ st->final = TRUE; /* all tracks are added */ @@ -1888,7 +1888,7 @@ static gboolean st_selection_changed_cb(gpointer data) { inst, time.tv_sec % 3600, time.tv_usec); #endif - /* printf("st_s_c_cb %d: entered\n", inst); */ + /* printf("st_s_c_cb %d: entered\n", inst); */ st = sorttab[inst]; if (st == NULL) return FALSE; @@ -1906,8 +1906,8 @@ static gboolean st_selection_changed_cb(gpointer data) { } else { /* handle new selection */ gtk_tree_model_get(model, &iter, ST_COLUMN_ENTRY, &new_entry, -1); - /*printf("selected instance %d, entry %x (was: %x)\n", inst, - *new_entry, st->current_entry);*/ + /* printf("selected instance %d, entry %x (was: %x)\n", inst, + *new_entry, st->current_entry); */ /* initialize next instance */ st_init(-1, inst + 1); @@ -1927,21 +1927,14 @@ static gboolean st_selection_changed_cb(gpointer data) { Track *track = gl->data; st_add_track(track, FALSE, TRUE, inst + 1); } - /* Advertise that a new set of tracks has been selected */ - gtkpod_set_displayed_tracks(new_entry->members); - st_enable_disable_view_sort(inst + 1, TRUE); st_add_track(NULL, TRUE, st->final, inst + 1); + /* Advertise that a new set of tracks has been selected */ + if ((inst + 1) == prefs_get_int("sort_tab_num")) { + gtkpod_set_displayed_tracks(new_entry->members); + } } gtkpod_tracks_statusbar_update(); - - /* Select the cover in the coverart_display */ - // GList *gl = g_list_first(new_entry->members); - // if (gl != NULL) { - // Track *track = gl->data; - // if (track != NULL) - // coverart_select_cover(track); - // } } #if DEBUG_TIMING ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2