--- qsampler/trunk/src/qsamplerDeviceForm.cpp 2010/03/29 17:00:30 2074 +++ qsampler/trunk/src/qsamplerDeviceForm.cpp 2015/03/03 17:41:04 2722 @@ -1,7 +1,7 @@ // qsamplerDeviceForm.cpp // /**************************************************************************** - Copyright (C) 2004-2010, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2004-2015, rncbc aka Rui Nuno Capela. All rights reserved. Copyright (C) 2007, 2008 Christian Schoenebeck This program is free software; you can redistribute it and/or @@ -28,6 +28,8 @@ #include #include +#include + namespace QSampler { @@ -60,12 +62,20 @@ m_ui.DeviceParamTable->setModel(&m_deviceParamModel); m_ui.DeviceParamTable->setItemDelegate(&m_deviceParamDelegate); +#if QT_VERSION >= 0x050000 + m_ui.DeviceParamTable->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); +#else m_ui.DeviceParamTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch); +#endif m_ui.DeviceParamTable->verticalHeader()->hide(); m_ui.DevicePortParamTable->setModel(&m_devicePortParamModel); m_ui.DevicePortParamTable->setItemDelegate(&m_devicePortParamDelegate); +#if QT_VERSION >= 0x050000 + m_ui.DevicePortParamTable->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); +#else m_ui.DevicePortParamTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch); +#endif m_ui.DevicePortParamTable->verticalHeader()->hide(); // Initial contents. @@ -273,15 +283,31 @@ // Prompt user if this is for real... Options *pOptions = pMainForm->options(); if (pOptions && pOptions->bConfirmRemove) { - if (QMessageBox::warning(this, - QSAMPLER_TITLE ": " + tr("Warning"), - tr("About to delete device:\n\n" + const QString& sTitle = QSAMPLER_TITLE ": " + tr("Warning"); + const QString& sText = tr( + "About to delete device:\n\n" "%1\n\n" "Are you sure?") - .arg(device.deviceName()), - QMessageBox::Ok | QMessageBox::Cancel) - == QMessageBox::Cancel) + .arg(device.deviceName()); + #if 0 + if (QMessageBox::warning(this, sTitle, sText, + QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) + return; + #else + QMessageBox mbox(this); + mbox.setIcon(QMessageBox::Warning); + mbox.setWindowTitle(sTitle); + mbox.setText(sText); + mbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); + QCheckBox cbox(tr("Don't ask this again")); + cbox.setChecked(false); + cbox.blockSignals(true); + mbox.addButton(&cbox, QMessageBox::ActionRole); + if (mbox.exec() == QMessageBox::Cancel) return; + if (cbox.isChecked()) + pOptions->bConfirmRemove = false; + #endif } // Go and destroy...