1 |
// qsamplerDeviceForm.cpp |
// qsamplerDeviceForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2012, 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 |
28 |
#include <QHeaderView> |
#include <QHeaderView> |
29 |
#include <QMessageBox> |
#include <QMessageBox> |
30 |
|
|
31 |
|
#include <QCheckBox> |
32 |
|
|
33 |
|
|
34 |
namespace QSampler { |
namespace QSampler { |
35 |
|
|
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... |