Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 579e789ad707
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cd732718adf6
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 14, 2016

  1. Copy the full SHA
    d81ce15 View commit details
  2. Copy the full SHA
    cd73271 View commit details
Showing with 14 additions and 15 deletions.
  1. +11 −7 artiq/frontend/artiq_gui.py
  2. +3 −8 artiq/gui/explorer.py
18 changes: 11 additions & 7 deletions artiq/frontend/artiq_gui.py
Original file line number Diff line number Diff line change
@@ -47,10 +47,14 @@ def closeEvent(self, *args):
self.exit_request.set()

def save_state(self):
return bytes(self.saveState())
return {
"state": bytes(self.saveState()),
"geometry": bytes(self.saveGeometry())
}

def restore_state(self, state):
self.restoreState(QtCore.QByteArray(state))
self.restoreGeometry(QtCore.QByteArray(state["geometry"]))
self.restoreState(QtCore.QByteArray(state["state"]))


def main():
@@ -100,10 +104,10 @@ def main():
smgr.register(expmgr)
d_shortcuts = shortcuts.ShortcutsDock(main_window, expmgr)
smgr.register(d_shortcuts)
d_explorer = explorer.ExplorerDock(status_bar, expmgr, d_shortcuts,
sub_clients["explist"],
rpc_clients["schedule"],
rpc_clients["experiment_db"])
d_explorer = explorer.Explorer(status_bar, expmgr, d_shortcuts,
sub_clients["explist"],
rpc_clients["schedule"],
rpc_clients["experiment_db"])

d_datasets = datasets.DatasetsDock(sub_clients["datasets"],
rpc_clients["dataset_db"])
@@ -124,6 +128,7 @@ def main():
smgr.register(logmgr)

# lay out docks
main_window.setCentralWidget(d_explorer)
if os.name != "nt":
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_ttl_dds.dds_dock)
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_ttl_dds.ttl_dock)
@@ -133,7 +138,6 @@ def main():
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_applets)
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_datasets)
main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d_shortcuts)
main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d_explorer)
main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d_schedule)

# load/initialize state
11 changes: 3 additions & 8 deletions artiq/gui/explorer.py
Original file line number Diff line number Diff line change
@@ -115,18 +115,13 @@ def __init__(self, init):
DictSyncTreeSepModel.__init__(self, "/", ["Experiment"], init)


class ExplorerDock(QtWidgets.QDockWidget):
class Explorer(QtWidgets.QWidget):
def __init__(self, status_bar, exp_manager, d_shortcuts,
explist_sub, schedule_ctl, experiment_db_ctl):
QtWidgets.QDockWidget.__init__(self, "Explorer")
self.setObjectName("Explorer")
self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
QtWidgets.QDockWidget.DockWidgetFloatable)
QtWidgets.QWidget.__init__(self)

layout = QtWidgets.QGridLayout()
top_widget = QtWidgets.QWidget()
top_widget.setLayout(layout)
self.setWidget(top_widget)
self.setLayout(layout)
layout.setSpacing(5)
layout.setContentsMargins(5, 5, 5, 5)