changeset 1458:009f22e03bf6 single-point

Make it possible to disable cancel buttons
author Chris Cannam
date Thu, 16 May 2019 15:50:11 +0100
parents 160e6d010141
children 42c87368287c
files view/View.cpp
diffstat 1 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/view/View.cpp	Thu May 16 15:50:02 2019 +0100
+++ b/view/View.cpp	Thu May 16 15:50:11 2019 +0100
@@ -1745,6 +1745,11 @@
         return;
     }
 
+    QSettings settings;
+    settings.beginGroup("View");
+    bool showCancelButton = settings.value("showcancelbuttons", true).toBool();
+    settings.endGroup();
+    
     int ph = height();
     bool found = false;
 
@@ -1833,13 +1838,23 @@
                     timer->start();
                 }
 
-                int scaled20 = scalePixelSize(20);
-
-                cancel->move(0, ph - pb->height()/2 - scaled20/2);
-                cancel->show();
-
-                pb->setValue(completion);
-                pb->move(scaled20, ph - pb->height());
+                if (showCancelButton) {
+                
+                    int scaled20 = scalePixelSize(20);
+
+                    cancel->move(0, ph - pb->height()/2 - scaled20/2);
+                    cancel->show();
+
+                    pb->setValue(completion);
+                    pb->move(scaled20, ph - pb->height());
+
+                } else {
+
+                    cancel->hide();
+
+                    pb->setValue(completion);
+                    pb->move(0, ph - pb->height());
+                }
 
                 pb->show();
                 pb->update();