fixed "crash on stop clicked while paused" bug
This commit is contained in:
parent
a40d2e523c
commit
6d66851484
2 changed files with 20 additions and 5 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/NowPlaying.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -81,6 +81,7 @@ NowPlaying :: NowPlaying(Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
&NowPlaying::onStopButtonClicked ));
|
||||
|
||||
isActive = false;
|
||||
isPaused = false;
|
||||
|
||||
label = Gtk::manage(new Gtk::Label);
|
||||
label->set_ellipsize(Pango::ELLIPSIZE_END);
|
||||
|
@ -101,6 +102,7 @@ NowPlaying :: setPlayable(Ptr<Playable>::Ref playable) throw ()
|
|||
stopButton->show();
|
||||
pauseButton->show();
|
||||
isActive = true;
|
||||
isPaused = false;
|
||||
}
|
||||
|
||||
Ptr<Glib::ustring>::Ref infoString(new Glib::ustring);
|
||||
|
@ -124,7 +126,11 @@ NowPlaying :: setPlayable(Ptr<Playable>::Ref playable) throw ()
|
|||
label->set_text("");
|
||||
if (isActive) {
|
||||
remove(*stopButton);
|
||||
remove(*pauseButton);
|
||||
if (isPaused) {
|
||||
remove(*playButton);
|
||||
} else {
|
||||
remove(*pauseButton);
|
||||
}
|
||||
isActive = false;
|
||||
}
|
||||
this->playable.reset();
|
||||
|
@ -142,7 +148,9 @@ NowPlaying :: onPlayButtonClicked(void) throw ()
|
|||
|
||||
remove(*playButton);
|
||||
pack_end(*pauseButton, Gtk::PACK_SHRINK, 2);
|
||||
pauseButton->show();
|
||||
pauseButton->show();
|
||||
|
||||
isPaused = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,6 +165,8 @@ NowPlaying :: onPauseButtonClicked(void) throw ()
|
|||
remove(*pauseButton);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK, 2);
|
||||
playButton->show();
|
||||
|
||||
isPaused = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/NowPlaying.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -66,7 +66,7 @@ using namespace LiveSupport::Widgets;
|
|||
* The box displaying "now playing" in the master panel.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
class NowPlaying : public Gtk::HBox,
|
||||
public LocalizedObject
|
||||
|
@ -78,6 +78,11 @@ class NowPlaying : public Gtk::HBox,
|
|||
*/
|
||||
bool isActive;
|
||||
|
||||
/**
|
||||
* Whether the pause button has been clicked.
|
||||
*/
|
||||
bool isPaused;
|
||||
|
||||
/**
|
||||
* The playable which is shown in the widget.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue