From 5dbb7ff6457c40e23b853c49c5fec1295af746ef Mon Sep 17 00:00:00 2001 From: mgrojo Date: Tue, 30 Jan 2018 20:33:15 +0100 Subject: [PATCH] Ensure the Escape key doesn't make Plot and Remote docks go away Override reject() as done in other dock dialogs. Fixes #1310 --- src/PlotDock.cpp | 7 +++++++ src/PlotDock.h | 1 + src/RemoteDock.cpp | 7 +++++++ src/RemoteDock.h | 3 +++ 4 files changed, 18 insertions(+) diff --git a/src/PlotDock.cpp b/src/PlotDock.cpp index 3f382fa7..0be88aa2 100644 --- a/src/PlotDock.cpp +++ b/src/PlotDock.cpp @@ -861,3 +861,10 @@ void PlotDock::toggleStackedBars(bool stacked) adjustBars(); ui->plotWidget->replot(); } + +void PlotDock::reject() +{ + // We override this, to ensure the Escape key doesn't make this dialog + // dock go away + return; +} diff --git a/src/PlotDock.h b/src/PlotDock.h index 11631582..fb609f9a 100644 --- a/src/PlotDock.h +++ b/src/PlotDock.h @@ -67,6 +67,7 @@ public slots: void updatePlot(SqliteTableModel* model, BrowseDataTableSettings* settings = nullptr, bool update = true, bool keepOrResetSelection = true); void fetchAllData(); void resetPlot(); + virtual void reject(); signals: void pointsSelected(int firstIndex, int count); diff --git a/src/RemoteDock.cpp b/src/RemoteDock.cpp index f53c9be8..b64f2125 100644 --- a/src/RemoteDock.cpp +++ b/src/RemoteDock.cpp @@ -132,3 +132,10 @@ void RemoteDock::newDirectoryNode(const QModelIndex& parent) } } } + +void RemoteDock::reject() +{ + // We override this, to ensure the Escape key doesn't make this dialog + // dock go away + return; +} diff --git a/src/RemoteDock.h b/src/RemoteDock.h index ac8649d7..070237de 100644 --- a/src/RemoteDock.h +++ b/src/RemoteDock.h @@ -22,6 +22,9 @@ public: void reloadSettings(); void enableButtons(); +public slots: + virtual void reject(); + private slots: void setNewIdentity(); void fetchDatabase(const QModelIndex& idx);