Skip to content

Commit

Permalink
Autoplot replace QtTest calls in msui mainwindow (#2551)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimarBauer authored Oct 5, 2024
1 parent 342d317 commit 9082188
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions mslib/msui/msui_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@
from mslib.msui.icons import icons, python_powered
from mslib.utils.qt import get_open_filenames, get_save_filename, show_popup
from mslib.utils.config import read_config_file, config_loader
from PyQt5 import QtGui, QtCore, QtWidgets
from mslib.utils import release_info
from PyQt5 import QtGui, QtCore, QtWidgets, QtTest

from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas

# Add config path to PYTHONPATH so plugins located there may be found
Expand Down Expand Up @@ -601,20 +602,16 @@ def update_treewidget_op_fl(self, op_fl, flight):
if op_fl == "operation":
for index in range(self.listOperationsMSC.count()):
item = self.listOperationsMSC.item(index)
if item.text().startswith(flight):
if flight == item.operation_path:
item = self.listOperationsMSC.item(index)
point = self.listOperationsMSC.visualItemRect(item).center()
QtTest.QTest.mouseClick(self.listOperationsMSC.viewport(), QtCore.Qt.LeftButton, pos=point)
QtTest.QTest.mouseDClick(self.listOperationsMSC.viewport(), QtCore.Qt.LeftButton, pos=point)
self.mscolab.set_active_op_id(item)
break
else:
for index in range(self.listFlightTracks.count()):
item = self.listFlightTracks.item(index)
if flight == item.text():
item = self.listFlightTracks.item(index)
point = self.listFlightTracks.visualItemRect(item).center()
QtTest.QTest.mouseClick(self.listFlightTracks.viewport(), QtCore.Qt.LeftButton, pos=point)
QtTest.QTest.mouseDClick(self.listFlightTracks.viewport(), QtCore.Qt.LeftButton, pos=point)
self.activate_flight_track(item)
break

def add_import_plugins(self, picker_default):
Expand Down Expand Up @@ -1123,8 +1120,6 @@ def closeEvent(self, event):
if self.config_editor is not None:
self.config_editor.restart_on_save = False
self.config_editor.close()
from PyQt5 import QtTest
QtTest.QTest.qWait(5)
if self.config_editor is not None:
self.statusBar.showMessage("Save your config changes and try closing again")
event.ignore()
Expand Down

0 comments on commit 9082188

Please sign in to comment.