From: Soeren Apel Date: Thu, 25 May 2017 12:30:46 +0000 (+0200) Subject: Disable context menus that could lead to users removing UI parts X-Git-Tag: pulseview-0.4.0~76 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d375140b2e760226ff5f0d8aafc0386c0010644b;p=pulseview.git Disable context menus that could lead to users removing UI parts If a user removes the main toolbar then there's no way to get it back. We don't want that. If a user removes a dock window's contents he can get it back by using the same context menu but it's a useless feature for us and potentially very confusing, so we disable this, too. --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 205c95ca..86a01553 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -188,6 +188,7 @@ shared_ptr MainWindow::add_view(const QString &title, dock_main->setCentralWidget(v.get()); dock->setWidget(dock_main); + dock->setContextMenuPolicy(Qt::PreventContextMenu); dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 0f92f060..4f5cd158 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -114,6 +114,8 @@ MainBar::MainBar(Session &session, QWidget *parent, { setObjectName(QString::fromUtf8("MainBar")); + setContextMenuPolicy(Qt::PreventContextMenu); + // Actions action_new_view_->setText(tr("New &View")); action_new_view_->setIcon(QIcon::fromTheme("window-new",