From d199770de1f0e1c4a80352b1777472f8d13c430c Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 9 Sep 2024 15:00:14 +0800 Subject: [PATCH] Unprivate conn_menu Used for autoconnect --- pytec/tec_qt.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 6fd9548..46b9df8 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -107,8 +107,8 @@ class MainWindow(QtWidgets.QMainWindow): ) # Bottom bar menus - self._conn_menu = ConnMenu(self._thermostat, self.connect_btn) - self.connect_btn.setMenu(self._conn_menu) + self.conn_menu = ConnMenu(self._thermostat, self.connect_btn) + self.connect_btn.setMenu(self.conn_menu) self._thermostat_ctrl_menu = ThermostatCtrlMenu( self._thermostat, self.info_box, self.style() @@ -189,8 +189,8 @@ class MainWindow(QtWidgets.QMainWindow): case ThermostatConnectionState.DISCONNECTED: self._connecting_task = asyncio.create_task( self._thermostat.start_session( - host=self._conn_menu.host_set_line.text(), - port=self._conn_menu.port_set_spin.value(), + host=self.conn_menu.host_set_line.text(), + port=self.conn_menu.port_set_spin.value(), ) ) self._thermostat.connection_state = ThermostatConnectionState.CONNECTING @@ -234,9 +234,9 @@ async def coro_main(): if args.connect: if args.HOST: - main_window._conn_menu.host_set_line.setText(args.HOST) + main_window.conn_menu.host_set_line.setText(args.HOST) if args.PORT: - main_window._conn_menu.port_set_spin.setValue(int(args.PORT)) + main_window.conn_menu.port_set_spin.setValue(int(args.PORT)) main_window.connect_btn.click() await app_quit_event.wait()