mirror of https://github.com/m-labs/artiq.git
browser: toolbar, rm mdiarea tooltip (closes #433)
This commit is contained in:
parent
07b80cc5ab
commit
5e094528c1
|
@ -348,7 +348,6 @@ class ExperimentsArea(QtWidgets.QMdiArea):
|
||||||
self.pixmap = QtGui.QPixmap(os.path.join(
|
self.pixmap = QtGui.QPixmap(os.path.join(
|
||||||
artiq_dir, "gui", "logo20.svg"))
|
artiq_dir, "gui", "logo20.svg"))
|
||||||
self.current_dir = root
|
self.current_dir = root
|
||||||
self.setToolTip("Click to open experiment")
|
|
||||||
|
|
||||||
self.open_experiments = []
|
self.open_experiments = []
|
||||||
|
|
||||||
|
@ -364,7 +363,7 @@ class ExperimentsArea(QtWidgets.QMdiArea):
|
||||||
|
|
||||||
def mousePressEvent(self, ev):
|
def mousePressEvent(self, ev):
|
||||||
if ev.button() == QtCore.Qt.LeftButton:
|
if ev.button() == QtCore.Qt.LeftButton:
|
||||||
asyncio.ensure_future(self._select_experiment_task())
|
self.select_experiment()
|
||||||
|
|
||||||
def paintEvent(self, event):
|
def paintEvent(self, event):
|
||||||
QtWidgets.QMdiArea.paintEvent(self, event)
|
QtWidgets.QMdiArea.paintEvent(self, event)
|
||||||
|
@ -389,7 +388,7 @@ class ExperimentsArea(QtWidgets.QMdiArea):
|
||||||
ex_state["arguments"])
|
ex_state["arguments"])
|
||||||
dock.restore_state(ex_state["dock"])
|
dock.restore_state(ex_state["dock"])
|
||||||
|
|
||||||
def _select_experiment(self):
|
def select_experiment(self):
|
||||||
asyncio.ensure_future(self._select_experiment_task())
|
asyncio.ensure_future(self._select_experiment_task())
|
||||||
|
|
||||||
async def _select_experiment_task(self):
|
async def _select_experiment_task(self):
|
||||||
|
|
|
@ -81,6 +81,7 @@ def main():
|
||||||
# initialize main window
|
# initialize main window
|
||||||
main_window = MainWindow()
|
main_window = MainWindow()
|
||||||
smgr.register(main_window)
|
smgr.register(main_window)
|
||||||
|
main_window.setUnifiedTitleAndToolBarOnMac(True)
|
||||||
status_bar = QtWidgets.QStatusBar()
|
status_bar = QtWidgets.QStatusBar()
|
||||||
main_window.setStatusBar(status_bar)
|
main_window.setStatusBar(status_bar)
|
||||||
|
|
||||||
|
@ -105,6 +106,17 @@ def main():
|
||||||
main_window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, d_applets)
|
main_window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, d_applets)
|
||||||
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_datasets)
|
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_datasets)
|
||||||
|
|
||||||
|
toolbar = main_window.addToolBar("Experiment")
|
||||||
|
toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||||
|
|
||||||
|
open_action = QtWidgets.QAction("Open Experiment", main_window)
|
||||||
|
open_action.setIcon(app.style().standardIcon(
|
||||||
|
QtWidgets.QStyle.SP_DialogOpenButton))
|
||||||
|
open_action.setShortcuts(QtGui.QKeySequence.Open)
|
||||||
|
open_action.setStatusTip("Open existing experiment from file")
|
||||||
|
open_action.triggered.connect(mdi_area.select_experiment)
|
||||||
|
toolbar.addAction(open_action)
|
||||||
|
|
||||||
# load/initialize state
|
# load/initialize state
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
# HACK: show the main window before creating applets.
|
# HACK: show the main window before creating applets.
|
||||||
|
|
Loading…
Reference in New Issue