Bug 230569 - No visual cue for "Stop playing after current track" by shortcut
Summary: No visual cue for "Stop playing after current track" by shortcut
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.3-GIT
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-13 14:20 UTC by Bram Schoenmakers
Modified: 2010-03-15 08:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bram Schoenmakers 2010-03-13 14:20:48 UTC
Version:           2.2.2 (using KDE 4.4.1)
OS:                Linux
Installed from:    Archlinux Packages

Minor bug: when I trigger the Stop playing after current track with the keyboard shortcut (either 'local' or global shortcut), the stop icon does not appear at the current track. When I hover the track with the mouse, it is properly repainted.
Comment 1 Myriam Schweingruber 2010-03-14 09:26:20 UTC
Still present in current 2.3-git: the Global Shortcut Meta+Shift+V stops after current track, but there is no visual indicator in the track. Either hovering the mouse on that track or any other nearby track makes the stop button appear.
Comment 2 Nikolaj Hald Nielsen 2010-03-15 08:46:46 UTC
commit d55d35a8e705c1bb256c84d7cc9b4ecc7e2b8d75
Author: Nikolaj Hald Nielsen <nhn@kde.org>
Date:   Mon Mar 15 08:40:49 2010 +0100

    Trigger a repaint of The Playlist when using a shortcut to set/unset "stop after this track"
    
    BUG: 230569

diff --git a/src/ActionClasses.cpp b/src/ActionClasses.cpp
index 1b0b23c..c528e50 100644
--- a/src/ActionClasses.cpp
+++ b/src/ActionClasses.cpp
@@ -537,11 +537,13 @@ StopPlayingAfterCurrentTrackAction::stopPlayingAfterCurrentTrack()
     {
         The::playlistActions()->setStopAfterMode( Playlist::StopAfterCurrent );
         The::playlistActions()->setTrackToBeLast( Playlist::ModelStack::instance()->source()->activeId() );
+        The::playlistActions()->repaintPlaylist();
         Amarok::OSD::instance()->setImage( QImage( KIconLoader::global()->iconPath( "amarok", -KIconLoader::SizeHuge ) ) );
         Amarok::OSD::instance()->OSDWidget::show( i18n( "Stop after current track: On" ) );
     } else {
         The::playlistActions()->setStopAfterMode( Playlist::StopNever );
         The::playlistActions()->setTrackToBeLast( 0 );
+        The::playlistActions()->repaintPlaylist();
         Amarok::OSD::instance()->setImage( QImage( KIconLoader::global()->iconPath( "amarok", -KIconLoader::SizeHuge ) ) );
         Amarok::OSD::instance()->OSDWidget::show( i18n( "Stop after current track: Off" ) );
     }
diff --git a/src/playlist/PlaylistActions.cpp b/src/playlist/PlaylistActions.cpp
index 18d50d0..dc58e0f 100644
--- a/src/playlist/PlaylistActions.cpp
+++ b/src/playlist/PlaylistActions.cpp
@@ -439,6 +439,12 @@ Playlist::Actions::normalizeDynamicPlaylist()
     }
 }
 
+void
+Playlist::Actions::repaintPlaylist()
+{
+    The::mainWindow()->playlistWidget()->currentView()->repaint();
+}
+
 
 namespace The
 {
diff --git a/src/playlist/PlaylistActions.h b/src/playlist/PlaylistActions.h
index 196eac0..6e97a0d 100644
--- a/src/playlist/PlaylistActions.h
+++ b/src/playlist/PlaylistActions.h
@@ -111,6 +111,12 @@ public slots:
     void queue( QList<int> rows );
     void dequeue( QList<int> rows );
 
+    /**
+    * Repaint the playlist.
+    * Useful when triggering a change that will modify the visual appearance of one or more items in the playlist
+    */
+    void repaintPlaylist();
+
 signals:
     void navigatorChanged();