/[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 2718 by capela, Thu Jan 22 19:01:32 2015 UTC revision 2722 by capela, Tue Mar 3 17:41:04 2015 UTC
# Line 1405  void MainForm::fileReset (void) Line 1405  void MainForm::fileReset (void)
1405                  return;                  return;
1406    
1407          // Ask user whether he/she want's an internal sampler reset...          // Ask user whether he/she want's an internal sampler reset...
1408          if (QMessageBox::warning(this,          if (m_pOptions && m_pOptions->bConfirmReset) {
1409                  QSAMPLER_TITLE ": " + tr("Warning"),                  const QString& sTitle = QSAMPLER_TITLE ": " + tr("Warning");
1410                  tr("Resetting the sampler instance will close\n"                  const QString& sText = tr(
1411                  "all device and channel configurations.\n\n"                          "Resetting the sampler instance will close\n"
1412                  "Please note that this operation may cause\n"                          "all device and channel configurations.\n\n"
1413                  "temporary MIDI and Audio disruption.\n\n"                          "Please note that this operation may cause\n"
1414                  "Do you want to reset the sampler engine now?"),                          "temporary MIDI and Audio disruption.\n\n"
1415                  QMessageBox::Ok | QMessageBox::Cancel)                          "Do you want to reset the sampler engine now?");
1416                  == QMessageBox::Cancel)          #if 0
1417                  return;                  if (QMessageBox::warning(this, sTitle, sText,
1418                            QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
1419                            return;
1420            #else
1421                    QMessageBox mbox(this);
1422                    mbox.setIcon(QMessageBox::Warning);
1423                    mbox.setWindowTitle(sTitle);
1424                    mbox.setText(sText);
1425                    mbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
1426                    QCheckBox cbox(tr("Don't ask this again"));
1427                    cbox.setChecked(false);
1428                    cbox.blockSignals(true);
1429                    mbox.addButton(&cbox, QMessageBox::ActionRole);
1430                    if (mbox.exec() == QMessageBox::Cancel)
1431                            return;
1432                    if (cbox.isChecked())
1433                            m_pOptions->bConfirmReset = false;
1434            #endif
1435            }
1436    
1437          // Trye closing the current session, first...          // Trye closing the current session, first...
1438          if (!closeSession(true))          if (!closeSession(true))
# Line 1446  void MainForm::fileRestart (void) Line 1464  void MainForm::fileRestart (void)
1464    
1465          // Ask user whether he/she want's a complete restart...          // Ask user whether he/she want's a complete restart...
1466          // (if we're currently up and running)          // (if we're currently up and running)
1467          if (bRestart && m_pClient) {          if (m_pOptions && m_pOptions->bConfirmRestart) {
1468                  bRestart = (QMessageBox::warning(this,                  const QString& sTitle = QSAMPLER_TITLE ": " + tr("Warning");
1469                          QSAMPLER_TITLE ": " + tr("Warning"),                  const QString& sText = tr(
1470                          tr("New settings will be effective after\n"                          "New settings will be effective after\n"
1471                          "restarting the client/server connection.\n\n"                          "restarting the client/server connection.\n\n"
1472                          "Please note that this operation may cause\n"                          "Please note that this operation may cause\n"
1473                          "temporary MIDI and Audio disruption.\n\n"                          "temporary MIDI and Audio disruption.\n\n"
1474                          "Do you want to restart the connection now?"),                          "Do you want to restart the connection now?");
1475                          QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok);          #if 0
1476                    if (QMessageBox::warning(this, sTitle, sText,
1477                            QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
1478                            bRestart = false;
1479            #else
1480                    QMessageBox mbox(this);
1481                    mbox.setIcon(QMessageBox::Warning);
1482                    mbox.setWindowTitle(sTitle);
1483                    mbox.setText(sText);
1484                    mbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
1485                    QCheckBox cbox(tr("Don't ask this again"));
1486                    cbox.setChecked(false);
1487                    cbox.blockSignals(true);
1488                    mbox.addButton(&cbox, QMessageBox::ActionRole);
1489                    if (mbox.exec() == QMessageBox::Cancel)
1490                            bRestart = false;
1491                    else
1492                    if (cbox.isChecked())
1493                            m_pOptions->bConfirmRestart = false;
1494            #endif
1495          }          }
1496    
1497          // Are we still for it?          // Are we still for it?
# Line 1529  void MainForm::editRemoveChannel (void) Line 1566  void MainForm::editRemoveChannel (void)
1566    
1567          // Prompt user if he/she's sure about this...          // Prompt user if he/she's sure about this...
1568          if (m_pOptions && m_pOptions->bConfirmRemove) {          if (m_pOptions && m_pOptions->bConfirmRemove) {
1569                  if (QMessageBox::warning(this,                  const QString& sTitle = QSAMPLER_TITLE ": " + tr("Warning");
1570                          QSAMPLER_TITLE ": " + tr("Warning"),                  const QString& sText = tr(
1571                          tr("About to remove channel:\n\n"                          "About to remove channel:\n\n"
1572                          "%1\n\n"                          "%1\n\n"
1573                          "Are you sure?")                          "Are you sure?")
1574                          .arg(pChannelStrip->windowTitle()),                          .arg(pChannelStrip->windowTitle());
1575                          QMessageBox::Ok | QMessageBox::Cancel)          #if 0
1576                          == QMessageBox::Cancel)                  if (QMessageBox::warning(this, sTitle, sText,
1577                            QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
1578                          return;                          return;
1579            #else
1580                    QMessageBox mbox(this);
1581                    mbox.setIcon(QMessageBox::Warning);
1582                    mbox.setWindowTitle(sTitle);
1583                    mbox.setText(sText);
1584                    mbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
1585                    QCheckBox cbox(tr("Don't ask this again"));
1586                    cbox.setChecked(false);
1587                    cbox.blockSignals(true);
1588                    mbox.addButton(&cbox, QMessageBox::ActionRole);
1589                    if (mbox.exec() == QMessageBox::Cancel)
1590                            return;
1591                    if (cbox.isChecked())
1592                            m_pOptions->bConfirmRemove = false;
1593            #endif
1594          }          }
1595    
1596          // Remove the existing sampler channel.          // Remove the existing sampler channel.
# Line 2348  void MainForm::appendMessagesText( const Line 2401  void MainForm::appendMessagesText( const
2401                  m_pMessages->appendMessagesText(s);                  m_pMessages->appendMessagesText(s);
2402  }  }
2403    
2404  void MainForm::appendMessagesError( const QString& s )  void MainForm::appendMessagesError( const QString& sText )
2405  {  {
2406          if (m_pMessages)          if (m_pMessages)
2407                  m_pMessages->show();                  m_pMessages->show();
2408    
2409          appendMessagesColor(s.simplified(), "#ff0000");          appendMessagesColor(sText.simplified(), "#ff0000");
2410    
2411          // Make it look responsive...:)          // Make it look responsive...:)
2412          QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);          QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
2413    
2414          QMessageBox::critical(this,          if (m_pOptions && m_pOptions->bConfirmError) {
2415                  QSAMPLER_TITLE ": " + tr("Error"), s, QMessageBox::Cancel);                  const QString& sTitle = QSAMPLER_TITLE ": " + tr("Error");
2416            #if 0
2417                    QMessageBox::critical(this, sTitle, sText, QMessageBox::Cancel);
2418            #else
2419                    QMessageBox mbox(this);
2420                    mbox.setIcon(QMessageBox::Critical);
2421                    mbox.setWindowTitle(sTitle);
2422                    mbox.setText(sText);
2423                    mbox.setStandardButtons(QMessageBox::Cancel);
2424                    QCheckBox cbox(tr("Don't show this again"));
2425                    cbox.setChecked(false);
2426                    cbox.blockSignals(true);
2427                    mbox.addButton(&cbox, QMessageBox::ActionRole);
2428                    if (mbox.exec() && cbox.isChecked())
2429                            m_pOptions->bConfirmError = false;
2430            #endif
2431            }
2432  }  }
2433    
2434    

Legend:
Removed from v.2718  
changed lines
  Added in v.2722

  ViewVC Help
Powered by ViewVC