fixing #1434
This commit is contained in:
parent
23ea0af3a6
commit
c4ff6b2a2d
|
@ -115,6 +115,21 @@ SchedulerWindow :: SchedulerWindow (
|
|||
showContents();
|
||||
|
||||
show_all_children();
|
||||
|
||||
// set up the dialog window
|
||||
Ptr<Glib::ustring>::Ref confirmationMessage;
|
||||
try {
|
||||
confirmationMessage.reset(new Glib::ustring(
|
||||
*getResourceUstring("stopCurrentlyPlayingDialogMsg") ));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
dialogWindow.reset(new DialogWindow(confirmationMessage,
|
||||
DialogWindow::noButton |
|
||||
DialogWindow::yesButton,
|
||||
gLiveSupport->getBundle() ));
|
||||
}
|
||||
|
||||
|
||||
|
@ -382,6 +397,18 @@ SchedulerWindow :: onDeleteItem(void) throw ()
|
|||
void
|
||||
SchedulerWindow :: onStopCurrentlyPlayingButtonClicked(void) throw ()
|
||||
{
|
||||
DialogWindow::ButtonType result = dialogWindow->run();
|
||||
switch (result) {
|
||||
case DialogWindow::yesButton: break;
|
||||
|
||||
case DialogWindow::noButton: return;
|
||||
break;
|
||||
|
||||
// can happen if the window is closed with Alt-F4 -- treated as No
|
||||
default : return;
|
||||
break;
|
||||
}
|
||||
|
||||
Ptr<SessionId>::Ref sessionId = gLiveSupport->getSessionId();
|
||||
Ptr<SchedulerClientInterface>::Ref
|
||||
scheduler = gLiveSupport->getScheduler();
|
||||
|
@ -390,7 +417,8 @@ SchedulerWindow :: onStopCurrentlyPlayingButtonClicked(void) throw ()
|
|||
scheduler->stopCurrentlyPlaying(sessionId);
|
||||
|
||||
} catch (XmlRpcException &e) {
|
||||
// TODO: signal error here
|
||||
Ptr<Glib::ustring>::Ref errorMessage(new Glib::ustring(e.what()));
|
||||
gLiveSupport->displayMessageWindow(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
#include "LiveSupport/Core/Ptr.h"
|
||||
#include "LiveSupport/Core/LocalizedObject.h"
|
||||
#include "LiveSupport/Widgets/DialogWindow.h"
|
||||
#include "GuiWindow.h"
|
||||
#include "GLiveSupport.h"
|
||||
|
||||
|
@ -207,6 +208,12 @@ class SchedulerWindow : public GuiWindow
|
|||
*/
|
||||
Gtk::Button * closeButton;
|
||||
|
||||
/**
|
||||
* The "are you sure you want to stop the currently playing item?"
|
||||
* dialog window.
|
||||
*/
|
||||
Ptr<DialogWindow>::Ref dialogWindow;
|
||||
|
||||
/**
|
||||
* Signal handler for when a date is selected in the calendar.
|
||||
*/
|
||||
|
|
|
@ -170,8 +170,8 @@ root:table
|
|||
|
||||
stopCurrentlyPlayingText:string
|
||||
{ "Currently playing in scheduler:" }
|
||||
stopCurrentlyPlayingButtonLabel:string
|
||||
{ "Stop" }
|
||||
stopCurrentlyPlayingButtonLabel:string { "Stop" }
|
||||
stopCurrentlyPlayingDialogMsg:string { "Are you sure?" }
|
||||
|
||||
closeButtonLabel:string { "Close" }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue