When the media server is not running, display an alert and offer to start it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31035 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -124,14 +124,6 @@ MainApp::PlayerCount() const
|
|||||||
void
|
void
|
||||||
MainApp::ReadyToRun()
|
MainApp::ReadyToRun()
|
||||||
{
|
{
|
||||||
// make sure we have at least one window open
|
|
||||||
FirstWindow();
|
|
||||||
|
|
||||||
// setup the settings window now, we need to have it
|
|
||||||
fSettingsWindow = new SettingsWindow(BRect(150, 150, 450, 520));
|
|
||||||
fSettingsWindow->Hide();
|
|
||||||
fSettingsWindow->Show();
|
|
||||||
|
|
||||||
// Now tell the application roster, that we're interested
|
// Now tell the application roster, that we're interested
|
||||||
// in getting notifications of apps being launched or quit.
|
// in getting notifications of apps being launched or quit.
|
||||||
// In this way we are going to detect a media_server restart.
|
// In this way we are going to detect a media_server restart.
|
||||||
@@ -139,8 +131,32 @@ MainApp::ReadyToRun()
|
|||||||
B_REQUEST_LAUNCHED | B_REQUEST_QUIT);
|
B_REQUEST_LAUNCHED | B_REQUEST_QUIT);
|
||||||
// we will keep track of the status of media_server
|
// we will keep track of the status of media_server
|
||||||
// and media_addon_server
|
// and media_addon_server
|
||||||
fMediaServerRunning = be_roster->IsRunning(kMediaServerSig);
|
fMediaServerRunning = be_roster->IsRunning(kMediaServerSig);
|
||||||
fMediaAddOnServerRunning = be_roster->IsRunning(kMediaServerAddOnSig);
|
fMediaAddOnServerRunning = be_roster->IsRunning(kMediaServerAddOnSig);
|
||||||
|
|
||||||
|
if (!fMediaServerRunning || !fMediaAddOnServerRunning) {
|
||||||
|
BAlert* alert = new BAlert("start_media_server",
|
||||||
|
"It appears the Media Server is not running.\n"
|
||||||
|
"Would you like to start it ?", "Quit", "Start Media Server", NULL,
|
||||||
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
|
if (alert->Go() == 0) {
|
||||||
|
PostMessage(B_QUIT_REQUESTED);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
launch_media_server();
|
||||||
|
|
||||||
|
fMediaServerRunning = be_roster->IsRunning(kMediaServerSig);
|
||||||
|
fMediaAddOnServerRunning = be_roster->IsRunning(kMediaServerAddOnSig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure we have at least one window open
|
||||||
|
FirstWindow();
|
||||||
|
|
||||||
|
// setup the settings window now, we need to have it
|
||||||
|
fSettingsWindow = new SettingsWindow(BRect(150, 150, 450, 520));
|
||||||
|
fSettingsWindow->Hide();
|
||||||
|
fSettingsWindow->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user