/[svn]/qsampler/trunk/src/qsamplerMainForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1559 by capela, Thu Dec 6 14:23:39 2007 UTC revision 1626 by schoenebeck, Sat Jan 5 13:29:11 2008 UTC
# Line 471  bool MainForm::queryClose (void) Line 471  bool MainForm::queryClose (void)
471                          if (m_pDeviceForm)                          if (m_pDeviceForm)
472                                  m_pDeviceForm->close();                                  m_pDeviceForm->close();
473                          // Stop client and/or server, gracefully.                          // Stop client and/or server, gracefully.
474                          stopServer();                          stopServer(true /*interactive*/);
475                  }                  }
476          }          }
477    
# Line 2390  void MainForm::startServer (void) Line 2390  void MainForm::startServer (void)
2390                  switch (QMessageBox::warning(this,                  switch (QMessageBox::warning(this,
2391                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
2392                          tr("Could not start the LinuxSampler server.\n\n"                          tr("Could not start the LinuxSampler server.\n\n"
2393                          "Maybe it ss already started."),                          "Maybe it is already started."),
2394                          tr("Stop"), tr("Kill"), tr("Cancel"))) {                          tr("Stop"), tr("Kill"), tr("Cancel"))) {
2395                  case 0:                  case 0:
2396                          m_pServer->terminate();                          m_pServer->terminate();
# Line 2410  void MainForm::startServer (void) Line 2410  void MainForm::startServer (void)
2410                  return;                  return;
2411    
2412          // OK. Let's build the startup process...          // OK. Let's build the startup process...
2413          m_pServer = new QProcess(this);          m_pServer = new QProcess();
2414            bForceServerStop = true;
2415    
2416          // Setup stdout/stderr capture...          // Setup stdout/stderr capture...
2417  //      if (m_pOptions->bStdoutCapture) {  //      if (m_pOptions->bStdoutCapture) {
# Line 2458  void MainForm::startServer (void) Line 2459  void MainForm::startServer (void)
2459    
2460    
2461  // Stop linuxsampler server...  // Stop linuxsampler server...
2462  void MainForm::stopServer (void)  void MainForm::stopServer (bool bInteractive)
2463  {  {
2464          // Stop client code.          // Stop client code.
2465          stopClient();          stopClient();
2466    
2467            if (m_pServer && bInteractive) {
2468                    if (QMessageBox::question(this,
2469                            QSAMPLER_TITLE ": " + tr("The backend's fate ..."),
2470                            tr("You have the option to keep the sampler backend (LinuxSampler)\n"
2471                            "running in the background. The sampler would continue to work\n"
2472                            "according to your current sampler session and you could alter the\n"
2473                            "sampler session at any time by relaunching QSampler.\n\n"
2474                            "Do you want LinuxSampler to stop or to keep running in\n"
2475                            "the background?"),
2476                            tr("Stop"), tr("Keep Running")) == 1)
2477                    {
2478                            bForceServerStop = false;
2479                    }
2480            }
2481    
2482          // And try to stop server.          // And try to stop server.
2483          if (m_pServer) {          if (m_pServer && bForceServerStop) {
2484                  appendMessages(tr("Server is stopping..."));                  appendMessages(tr("Server is stopping..."));
2485                  if (m_pServer->state() == QProcess::Running) {                  if (m_pServer->state() == QProcess::Running) {
2486  #if defined(WIN32)  #if defined(WIN32)
# Line 2504  void MainForm::processServerExit (void) Line 2520  void MainForm::processServerExit (void)
2520          if (m_pMessages)          if (m_pMessages)
2521                  m_pMessages->flushStdoutBuffer();                  m_pMessages->flushStdoutBuffer();
2522    
2523          if (m_pServer) {          if (m_pServer && bForceServerStop) {
2524                  if (m_pServer->state() != QProcess::NotRunning) {                  if (m_pServer->state() != QProcess::NotRunning) {
2525                          appendMessages(tr("Server is being forced..."));                          appendMessages(tr("Server is being forced..."));
2526                          // Force final server shutdown...                          // Force final server shutdown...

Legend:
Removed from v.1559  
changed lines
  Added in v.1626

  ViewVC Help
Powered by ViewVC