Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exitAction = QAction(QIcon(resource_path('img/exit.png')), 'Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(app.quit)
infoAction = QAction(QIcon(resource_path('img/info.png')), 'Info', self)
infoAction.setShortcut('Ctrl+I')
infoAction.setStatusTip('Info & about')
self.aboutWindow = AboutWindow()
infoAction.triggered.connect(self.aboutWindow.show)
settingsAction = QAction(QIcon(resource_path('img/settings.png')), 'Settings', self)
settingsAction.setShortcut('Ctrl+P')
settingsAction.setStatusTip('Settings')
self.settingsWindow = SettingsWindow()
settingsAction.triggered.connect(self.settingsWindow.show)
toolbar = self.addToolBar('')
toolbar.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
toolbar.addAction(exitAction)
toolbar.addAction(infoAction)
toolbar.addAction(settingsAction)
# menubar = self.menuBar()
mainMenu = self.menuBar().addMenu('&Menu')
mainMenu.addAction(exitAction)
mainMenu.addAction(infoAction)
mainMenu.addAction(settingsAction)
if DEMO_MODE:
self.statusBar().addWidget(QLabel("<font color="red">Demo mode</font>"))
def __init__(self, parent=None):
super(SettingsWindow, self).__init__(parent)
self.setWindowTitle("Settings")
self.setWindowIcon(QIcon(resource_path('img/settings.png')))
self.onlyUGraphRadioButton = QRadioButton("Plot only U(t) graph")
self.onlyPIDGraphRadioButton = QRadioButton("Plot only PID-output(t) graph")
self.bothGraphsRadioButton = QRadioButton("Plot both graphs concurrently")
self.onlyUGraphRadioButton.setChecked(True)
chooseNumberOfGraphsVBox = QVBoxLayout()
chooseNumberOfGraphsVBox.addWidget(self.onlyUGraphRadioButton)
chooseNumberOfGraphsVBox.addWidget(self.onlyPIDGraphRadioButton)
chooseNumberOfGraphsVBox.addWidget(self.bothGraphsRadioButton)
chooseNumberOfGraphsGroupBox = QGroupBox("Graphs to plot:")
chooseNumberOfGraphsGroupBox.setLayout(chooseNumberOfGraphsVBox)
restoreLabel = QLabel("Restore all MCU values to values at program start time")