forked from M-Labs/thermostat
Split the settings and plotting menus
This commit is contained in:
parent
cbffb8d700
commit
5732bc951f
|
@ -280,10 +280,13 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
|
||||
self.thermostat_settings.setMenu(self.menu)
|
||||
|
||||
clear = QtGui.QAction("Clear graphs", self.menu)
|
||||
self.plot_menu = QtWidgets.QMenu()
|
||||
self.plot_menu.setTitle("Plot Settings")
|
||||
|
||||
clear = QtGui.QAction("Clear graphs", self.plot_menu)
|
||||
clear.triggered.connect(self.clear_graphs)
|
||||
self.menu.addAction(clear)
|
||||
self.menu.clear = clear
|
||||
self.plot_menu.addAction(clear)
|
||||
self.plot_menu.clear = clear
|
||||
|
||||
self.samples_spinbox = QtWidgets.QSpinBox()
|
||||
self.samples_spinbox.setRange(2, 100000)
|
||||
|
@ -291,10 +294,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
self.samples_spinbox.setValue(self.max_samples)
|
||||
self.samples_spinbox.valueChanged.connect(self.set_max_samples)
|
||||
|
||||
limit_samples = QtWidgets.QWidgetAction(self.menu)
|
||||
limit_samples = QtWidgets.QWidgetAction(self.plot_menu)
|
||||
limit_samples.setDefaultWidget(self.samples_spinbox)
|
||||
self.menu.addAction(limit_samples)
|
||||
self.menu.limit_samples = limit_samples
|
||||
self.plot_menu.addAction(limit_samples)
|
||||
self.plot_menu.limit_samples = limit_samples
|
||||
|
||||
self.toolButton_2.setMenu(self.plot_menu)
|
||||
|
||||
@pyqtSlot(int)
|
||||
def set_max_samples(self, samples: int):
|
||||
|
|
|
@ -284,6 +284,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -131,6 +131,10 @@ class Ui_MainWindow(object):
|
|||
self.thermostat_settings.setPopupMode(QtWidgets.QToolButton.ToolButtonPopupMode.InstantPopup)
|
||||
self.thermostat_settings.setObjectName("thermostat_settings")
|
||||
self.settings_layout.addWidget(self.thermostat_settings)
|
||||
self.toolButton_2 = QtWidgets.QToolButton(parent=self.bottom_settings_group)
|
||||
self.toolButton_2.setPopupMode(QtWidgets.QToolButton.ToolButtonPopupMode.InstantPopup)
|
||||
self.toolButton_2.setObjectName("toolButton_2")
|
||||
self.settings_layout.addWidget(self.toolButton_2)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.settings_layout.addItem(spacerItem)
|
||||
self.report_group = QtWidgets.QWidget(parent=self.bottom_settings_group)
|
||||
|
@ -216,6 +220,7 @@ class Ui_MainWindow(object):
|
|||
self.ip_set_line.setPlaceholderText(_translate("MainWindow", "IP:port for the Thermostat"))
|
||||
self.connect_btn.setText(_translate("MainWindow", "Connect"))
|
||||
self.status_lbl.setText(_translate("MainWindow", "Disconnected"))
|
||||
self.toolButton_2.setText(_translate("MainWindow", "..."))
|
||||
self.report_lbl.setText(_translate("MainWindow", "Poll every: "))
|
||||
self.report_refresh_spin.setSuffix(_translate("MainWindow", " s"))
|
||||
self.report_box.setText(_translate("MainWindow", "Report"))
|
||||
|
|
Loading…
Reference in New Issue