Commit 97ab2b5e authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Adding a preference to disable the clip deletion confirmation dialog.

parent 636e307a
......@@ -239,6 +239,9 @@ MainWindow::initVlmcPreferences()
LanguageHelper::getInstance(),
SLOT( languageChanged( const QVariant& ) ),
SettingsManager::Vlmc );
VLMC_CREATE_PREFERENCE_BOOL( "general/ConfirmDeletion", true,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Confirm deletion"),
QT_TRANSLATE_NOOP( "PreferenceWidget", "Ask for confirmation before deleting a clip from the timeline" ) );
//Load saved preferences :
QSettings s;
......
......@@ -20,16 +20,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QMessageBox>
#include <QKeyEvent>
#include <QGraphicsSceneContextMenuEvent>
#include "TracksScene.h"
#include "Commands.h"
#include "GraphicsMovieItem.h"
#include "GraphicsAudioItem.h"
#include "SettingsManager.h"
#include "Timeline.h"
#include "UndoStack.h"
#include <QMessageBox>
#include <QKeyEvent>
#include <QGraphicsSceneContextMenuEvent>
TracksScene::TracksScene( QObject* parent ) : QGraphicsScene( parent )
{
}
......@@ -67,20 +70,23 @@ TracksScene::askRemoveSelectedItems()
if ( !tv ) return;
QString message;
if ( selectedItems().size() == 1 )
message = tr("Confirm the deletion of the region?");
else
message = tr("Confirm the deletion of those regions?");
QMessageBox::StandardButton b =
QMessageBox::warning( tv, "Object deletion",
message,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No );
// Skip the deletion process
if ( b == QMessageBox::No ) return;
if ( VLMC_GET_BOOL( "general/ConfirmDeletion" ) == true )
{
QString message;
if ( selectedItems().size() == 1 )
message = tr("Confirm the deletion of the region?");
else
message = tr("Confirm the deletion of those regions?");
QMessageBox::StandardButton b =
QMessageBox::warning( tv, "Object deletion",
message,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No );
// Skip the deletion process
if ( b == QMessageBox::No ) return;
}
UndoStack::getInstance()->beginMacro( "Remove clip(s)" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment