1 |
// qsamplerInstrumentListForm.cpp |
// qsamplerInstrumentListForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2003-2010, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2003-2015, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, Christian Schoenebeck |
Copyright (C) 2007, 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 |
35 |
#include <QMessageBox> |
#include <QMessageBox> |
36 |
#include <QContextMenuEvent> |
#include <QContextMenuEvent> |
37 |
|
|
38 |
|
#include <QCheckBox> |
39 |
|
|
40 |
|
|
41 |
namespace QSampler { |
namespace QSampler { |
42 |
|
|
281 |
// Prompt user if this is for real... |
// Prompt user if this is for real... |
282 |
Options *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
283 |
if (pOptions && pOptions->bConfirmRemove) { |
if (pOptions && pOptions->bConfirmRemove) { |
284 |
if (QMessageBox::warning(this, |
const QString& sTitle = QSAMPLER_TITLE ": " + tr("Warning"); |
285 |
QSAMPLER_TITLE ": " + tr("Warning"), |
const QString& sText = tr( |
286 |
tr("About to delete instrument map entry:\n\n" |
"About to delete instrument map entry:\n\n" |
287 |
"%1\n\n" |
"%1\n\n" |
288 |
"Are you sure?") |
"Are you sure?") |
289 |
.arg(pInstrument->name()), |
.arg(pInstrument->name()); |
290 |
QMessageBox::Ok | QMessageBox::Cancel) |
#if 0 |
291 |
== QMessageBox::Cancel) |
if (QMessageBox::warning(this, sTitle, sText, |
292 |
return; |
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) |
293 |
|
return; |
294 |
|
#else |
295 |
|
QMessageBox mbox(this); |
296 |
|
mbox.setIcon(QMessageBox::Warning); |
297 |
|
mbox.setWindowTitle(sTitle); |
298 |
|
mbox.setText(sText); |
299 |
|
mbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); |
300 |
|
QCheckBox cbox(tr("Don't ask this again")); |
301 |
|
cbox.setChecked(false); |
302 |
|
cbox.blockSignals(true); |
303 |
|
mbox.addButton(&cbox, QMessageBox::ActionRole); |
304 |
|
if (mbox.exec() == QMessageBox::Cancel) |
305 |
|
return; |
306 |
|
if (cbox.isChecked()) |
307 |
|
pOptions->bConfirmRemove = false; |
308 |
|
#endif |
309 |
} |
} |
310 |
|
|
311 |
pInstrument->unmapInstrument(); |
pInstrument->unmapInstrument(); |