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

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

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

revision 2074 by capela, Mon Mar 29 17:00:30 2010 UTC revision 2722 by capela, Tue Mar 3 17:41:04 2015 UTC
# Line 1  Line 1 
1  // qsamplerDeviceForm.cpp  // qsamplerDeviceForm.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2010, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2015, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, 2008 Christian Schoenebeck     Copyright (C) 2007, 2008 Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
# Line 28  Line 28 
28  #include <QHeaderView>  #include <QHeaderView>
29  #include <QMessageBox>  #include <QMessageBox>
30    
31    #include <QCheckBox>
32    
33    
34  namespace QSampler {  namespace QSampler {
35    
# Line 60  DeviceForm::DeviceForm ( QWidget *pParen Line 62  DeviceForm::DeviceForm ( QWidget *pParen
62    
63          m_ui.DeviceParamTable->setModel(&m_deviceParamModel);          m_ui.DeviceParamTable->setModel(&m_deviceParamModel);
64          m_ui.DeviceParamTable->setItemDelegate(&m_deviceParamDelegate);          m_ui.DeviceParamTable->setItemDelegate(&m_deviceParamDelegate);
65    #if QT_VERSION >= 0x050000
66            m_ui.DeviceParamTable->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
67    #else
68          m_ui.DeviceParamTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);          m_ui.DeviceParamTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);
69    #endif
70          m_ui.DeviceParamTable->verticalHeader()->hide();          m_ui.DeviceParamTable->verticalHeader()->hide();
71    
72          m_ui.DevicePortParamTable->setModel(&m_devicePortParamModel);          m_ui.DevicePortParamTable->setModel(&m_devicePortParamModel);
73          m_ui.DevicePortParamTable->setItemDelegate(&m_devicePortParamDelegate);          m_ui.DevicePortParamTable->setItemDelegate(&m_devicePortParamDelegate);
74    #if QT_VERSION >= 0x050000
75            m_ui.DevicePortParamTable->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
76    #else
77          m_ui.DevicePortParamTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);          m_ui.DevicePortParamTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);
78    #endif
79          m_ui.DevicePortParamTable->verticalHeader()->hide();          m_ui.DevicePortParamTable->verticalHeader()->hide();
80    
81          // Initial contents.          // Initial contents.
# Line 273  void DeviceForm::deleteDevice (void) Line 283  void DeviceForm::deleteDevice (void)
283          // Prompt user if this is for real...          // Prompt user if this is for real...
284          Options *pOptions = pMainForm->options();          Options *pOptions = pMainForm->options();
285          if (pOptions && pOptions->bConfirmRemove) {          if (pOptions && pOptions->bConfirmRemove) {
286                  if (QMessageBox::warning(this,                  const QString& sTitle = QSAMPLER_TITLE ": " + tr("Warning");
287                          QSAMPLER_TITLE ": " + tr("Warning"),                  const QString& sText = tr(
288                          tr("About to delete device:\n\n"                          "About to delete device:\n\n"
289                          "%1\n\n"                          "%1\n\n"
290                          "Are you sure?")                          "Are you sure?")
291                          .arg(device.deviceName()),                          .arg(device.deviceName());
292                          QMessageBox::Ok | QMessageBox::Cancel)          #if 0
293                          == QMessageBox::Cancel)                  if (QMessageBox::warning(this, sTitle, sText,
294                            QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
295                            return;
296            #else
297                    QMessageBox mbox(this);
298                    mbox.setIcon(QMessageBox::Warning);
299                    mbox.setWindowTitle(sTitle);
300                    mbox.setText(sText);
301                    mbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
302                    QCheckBox cbox(tr("Don't ask this again"));
303                    cbox.setChecked(false);
304                    cbox.blockSignals(true);
305                    mbox.addButton(&cbox, QMessageBox::ActionRole);
306                    if (mbox.exec() == QMessageBox::Cancel)
307                          return;                          return;
308                    if (cbox.isChecked())
309                            pOptions->bConfirmRemove = false;
310            #endif
311          }          }
312    
313          // Go and destroy...          // Go and destroy...

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

  ViewVC Help
Powered by ViewVC