[vlmc-devel] commit: Adding a preference to disable the clip deletion confirmation dialog. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Tue Apr 20 02:26:49 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Apr 20 02:04:35 2010 +0200| [97ab2b5eaa2e3ce334ebe4fc47229e3ed52ebc05] | committer: Hugo Beauzée-Luyssen 

Adding a preference to disable the clip deletion confirmation dialog.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=97ab2b5eaa2e3ce334ebe4fc47229e3ed52ebc05
---

 src/Gui/MainWindow.cpp           |    3 ++
 src/Gui/timeline/TracksScene.cpp |   40 +++++++++++++++++++++----------------
 2 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 6b8debb..1806a09 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -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;
diff --git a/src/Gui/timeline/TracksScene.cpp b/src/Gui/timeline/TracksScene.cpp
index fa7ff35..183434a 100644
--- a/src/Gui/timeline/TracksScene.cpp
+++ b/src/Gui/timeline/TracksScene.cpp
@@ -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)" );
 



More information about the Vlmc-devel mailing list