made the start/stop button to enable/disable the Scheduler button on the Master Panel

This commit is contained in:
fgerlits 2006-08-07 17:14:46 +00:00
parent 9900d724f0
commit f24055e72c
3 changed files with 37 additions and 9 deletions

View File

@ -1571,8 +1571,14 @@ GLiveSupport :: checkSchedulerClient(void) throw ()
try {
scheduler->getVersion();
schedulerAvailable = true;
if (masterPanel) {
masterPanel->setSchedulerAvailable(true);
}
} catch (XmlRpcException &e) {
schedulerAvailable = false;
if (masterPanel) {
masterPanel->setSchedulerAvailable(false);
}
}
}

View File

@ -333,12 +333,12 @@ MasterPanelWindow :: changeLanguage(Ptr<ResourceBundle>::Ref bundle)
&MasterPanelWindow::onSearchButtonClicked));
} else {
// gray out all the buttons except Options
liveModeButton->set_sensitive(false);
uploadFileButton->set_sensitive(false);
scratchpadButton->set_sensitive(false);
simplePlaylistMgmtButton->set_sensitive(false);
schedulerButton->set_sensitive(false);
searchButton->set_sensitive(false);
liveModeButton->setDisabled(true);
uploadFileButton->setDisabled(true);
scratchpadButton->setDisabled(true);
simplePlaylistMgmtButton->setDisabled(true);
schedulerButton->setDisabled(true);
searchButton->setDisabled(true);
}
optionsButton->signal_clicked().connect(sigc::mem_fun(*this,
@ -754,9 +754,7 @@ MasterPanelWindow :: showLoggedInUI(void) throw ()
searchButton->setDisabled(true);
}
if (!gLiveSupport->isSchedulerAvailable()) {
schedulerButton->setDisabled(true);
}
setSchedulerAvailable(gLiveSupport->isSchedulerAvailable());
}
@ -879,3 +877,20 @@ MasterPanelWindow :: uploadToHub(Ptr<Playable>::Ref playable)
}
/*------------------------------------------------------------------------------
* Show or hide the Scheduler button.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: setSchedulerAvailable(bool status) throw ()
{
if (status == false) {
if (schedulerWindow && schedulerWindow->is_visible()) {
schedulerWindow->hide();
}
}
if (schedulerButton) {
schedulerButton->setDisabled(!status);
}
}

View File

@ -536,6 +536,13 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
void
uploadToHub(Ptr<Playable>::Ref playable) throw ();
/**
* Show or hide the Scheduler button.
*
* @param status true means show the button, false means hide.
*/
void
setSchedulerAvailable(bool status) throw ();
};
/* ================================================= external data structures */