forked from awendt/pyrelacs
[about] add about dialog window
This commit is contained in:
@@ -11,18 +11,20 @@ from PyQt6.QtWidgets import (
|
||||
QStatusBar
|
||||
)
|
||||
import uldaq
|
||||
import pathlib
|
||||
import numpy as np
|
||||
import nixio as nix
|
||||
import pyqtgraph as pg
|
||||
|
||||
from pathlib import Path as path
|
||||
from importlib.resources import files as rsrc_files
|
||||
from scipy.signal import welch, find_peaks
|
||||
|
||||
from pyrelacs.worker import Worker
|
||||
from ..worker import Worker
|
||||
from ..repros.repros import Repro
|
||||
from ..util.logging import config_logging
|
||||
from .about import AboutDialog
|
||||
log = config_logging()
|
||||
_root = path(__file__).parent.parent
|
||||
|
||||
from IPython import embed
|
||||
|
||||
@@ -61,32 +63,33 @@ class PyRelacs(QMainWindow):
|
||||
widget.setLayout(layout)
|
||||
self.setCentralWidget(widget)
|
||||
|
||||
filename = pathlib.Path.joinpath(pathlib.Path.cwd(), "data.nix")
|
||||
filename = path.joinpath(path.cwd(), "data.nix")
|
||||
self.nix_file = nix.File.open(
|
||||
str(filename), nix.FileMode.Overwrite
|
||||
)
|
||||
|
||||
def create_actions(self):
|
||||
icon_path = str(rsrc_files("pyrelacs.icons").joinpath("exit.png"))
|
||||
self._rlx_exitaction = QAction(QIcon(":icons/exit.png"), "Exit", self)
|
||||
self._rlx_exitaction = QAction(QIcon(str(path.joinpath(_root, "icons/exit.png"))), "Exit", self)
|
||||
self._rlx_exitaction.setStatusTip("Close relacs")
|
||||
self._rlx_exitaction.setShortcut(QKeySequence("Alt+q"))
|
||||
self._rlx_exitaction.triggered.connect(self.on_exit)
|
||||
|
||||
self._rlx_aboutaction = QAction("about")
|
||||
self._rlx_aboutaction.setStatusTip("Show about dialog")
|
||||
self._rlx_aboutaction.setEnabled(True)
|
||||
self._rlx_aboutaction.triggered.connect(self.on_about)
|
||||
|
||||
# icon_path = str(rsrc_files("pyrelacs.icons").joinpath("connect.png"))
|
||||
self._daq_connectaction = QAction(QIcon(":/icons/connect.png"), "Connect DAQ", self)
|
||||
self._daq_connectaction = QAction(QIcon(str(path.joinpath(_root, "icons/connect.png"))), "Connect DAQ", self)
|
||||
self._daq_connectaction.setStatusTip("Connect to daq device")
|
||||
# self._daq_connectaction.setShortcut(QKeySequence("Alt+d"))
|
||||
self._daq_connectaction.triggered.connect(self.connect_dac)
|
||||
|
||||
icon_path = str(rsrc_files("pyrelacs.icons").joinpath("disconnect.png"))
|
||||
self._daq_disconnectaction = QAction(QIcon(icon_path), "Disconnect DAQ", self)
|
||||
self._daq_disconnectaction = QAction(QIcon(str(path.joinpath(_root, "icons/disconnect.png"))), "Disconnect DAQ", self)
|
||||
self._daq_disconnectaction.setStatusTip("Disconnect the DAQ device")
|
||||
# self._daq_connectaction.setShortcut(QKeySequence("Alt+d"))
|
||||
self._daq_disconnectaction.triggered.connect(self.disconnect_dac)
|
||||
|
||||
# icon_path = str(rsrc_files("pyrelacs.icons").joinpath("calibration.png"))
|
||||
self._daq_calibaction = QAction(QIcon(icon_path), "Plot calibration", self)
|
||||
self._daq_calibaction = QAction(QIcon(str(path.joinpath(_root, "icons/calibration.png"))), "Plot calibration", self)
|
||||
self._daq_calibaction.setStatusTip("Calibrate the attenuator device")
|
||||
# self._daq_calibaction.setShortcut(QKeySequence("Alt+d"))
|
||||
self._daq_calibaction.triggered.connect(self.plot_calibration)
|
||||
@@ -96,6 +99,7 @@ class PyRelacs(QMainWindow):
|
||||
menu = self.menuBar()
|
||||
file_menu = menu.addMenu("&File")
|
||||
file_menu.addAction(self._rlx_exitaction)
|
||||
file_menu.addAction(self._rlx_aboutaction)
|
||||
|
||||
device_menu = menu.addMenu("&DAQ")
|
||||
device_menu.addAction(self._daq_connectaction)
|
||||
@@ -254,6 +258,10 @@ class PyRelacs(QMainWindow):
|
||||
print("exit button!")
|
||||
self.close()
|
||||
|
||||
def on_about(self, e):
|
||||
about = AboutDialog(self)
|
||||
about.show()
|
||||
|
||||
def print_output(self, s):
|
||||
print(s)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user