From b601a51b980bbf1c180d994aaea2999446d46121 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 29 Jan 2026 00:17:06 +0100 Subject: [PATCH] update: disabeld button on multiple windows --- .../process_the_proxy.cpython-312.pyc | Bin 1537 -> 1868 bytes gui/__main__.py | 25 +++++++++++++++--- requirements.txt | 19 +++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) mode change 100755 => 100644 SMS-Exchange-Linux-GUI/interact_with_rest_of_app/__pycache__/process_the_proxy.cpython-312.pyc create mode 100644 requirements.txt diff --git a/SMS-Exchange-Linux-GUI/interact_with_rest_of_app/__pycache__/process_the_proxy.cpython-312.pyc b/SMS-Exchange-Linux-GUI/interact_with_rest_of_app/__pycache__/process_the_proxy.cpython-312.pyc old mode 100755 new mode 100644 index 0abe99e4089a8353ea21cacd934341ee9753f323..ce7e46331de890bcfb3d9b5b27ccc2b1d04ad70a GIT binary patch delta 987 zcmZ`%O-vI(6rSnsw!5$_(D2(o)M7|6rASgxene70NQ4?N&n7BcH*-{mgE|C80|fraKB80+t?CFLpL}N6qq(au!L$ukg4gOMy=cQ zh^Ro{oks1m$p;%X20IgMNk@f9lugRgiXifAT;ft9U$XzJ3JSZ-3yD=WrSP1rcevCx zv&dds2u{yloniyQ`RUm!>`ZWOO7mg;kkW2oFZi}dN|yPAdR#k^iZAnWsXmfYR4L9T z!)mld#S|&Q>Q^fiDtpSXis*|Q^KT1(KCVMAs}H8EckDGNBLs3Uf(kiW{rO9BKMM6RRoW07VGzQ7K<$J2L(qK) Nu9wYD*dzN;>Nm1x?b-kU delta 586 zcmX@Z*T}p-Kb`9HVph+N* z!nuZPH4}u*$WS5(VKFe&u%&Rr#7!A$*-L~cuVs|ss9~*PPvKd^JK2=Uk+FVqIg=tI z-{hH06SS(#^)vEwQ}s)WQ;YQVlJoP@GSl@lDpQIQb<0vSbMy;}^3yVNQj7HsC+jim zGjdOkV^*4c0m$N*#IkJiJ{AcjkS7$N;8zsHw93+wbbXinSi20DUpff-7 zVLnC>Da7h5&92E@Bnnhh1d8t>kUv&3d+ ZU}j`wyv@LQn}Pc?ixgupW05*g6aeMth`#^; diff --git a/gui/__main__.py b/gui/__main__.py index f5706cb..ac3bc01 100755 --- a/gui/__main__.py +++ b/gui/__main__.py @@ -1459,11 +1459,13 @@ class MenuPage(Page): self.button_states = {} self.is_system_connected = False self.profile_button_map = {} + self.p2p_processes = {} self.font_style = f"font-family: '{main_window.open_sans_family}';" if main_window.open_sans_family else "" - # self.label.setStyleSheet("background-color: rgba(0, 255, 0, 51);") - # Establecer el color de fondo y el color del texto utilizando hojas de estilo self.create_interface_elements() + self.p2p_timer = QTimer(self) + self.p2p_timer.timeout.connect(self.update_p2p_button_status) + self.p2p_timer.start(1000) def showEvent(self, event): super().showEvent(event) @@ -1564,11 +1566,24 @@ class MenuPage(Page): def request_func(self): if hasattr(self, 'reverse_id'): profile_id = self.reverse_id + if profile_id in self.p2p_processes and self.p2p_processes[profile_id].poll() is None: + return project_root = os.path.dirname( os.path.dirname(os.path.abspath(__file__))) script_path = os.path.join( project_root, 'SMS-Exchange-Linux-GUI', 'GUI.py') - subprocess.Popen([sys.executable, script_path, str(profile_id)]) + process = subprocess.Popen( + [sys.executable, script_path, str(profile_id)]) + self.p2p_processes[profile_id] = process + if hasattr(self, 'request_button'): + self.request_button.setEnabled(False) + + def update_p2p_button_status(self): + if hasattr(self, 'reverse_id') and hasattr(self, 'request_button'): + is_running = self.reverse_id in self.p2p_processes and self.p2p_processes[self.reverse_id].poll( + ) is None + if self.request_button.isEnabled() == is_running: + self.request_button.setEnabled(not is_running) def delete_status_update(self, text): self.update_status.update_status(text) @@ -2014,7 +2029,9 @@ class MenuPage(Page): profile = self.profile_info.get(profile_name) self.boton_launch.setEnabled(True) if hasattr(self, 'request_button'): - self.request_button.setEnabled(True) + is_running = self.reverse_id in self.p2p_processes and self.p2p_processes[self.reverse_id].poll( + ) is None + self.request_button.setEnabled(not is_running) self.boton_just.setEnabled(True) self.boton_just_session.setEnabled(True) self.boton_create.setEnabled(True) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..282130f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,19 @@ +aiohappyeyeballs==2.6.1 +aiohttp==3.13.3 +aiosignal==1.4.0 +asyncio==4.0.0 +attrs==25.4.0 +certifi==2026.1.4 +charset-normalizer==3.4.4 +frozenlist==1.8.0 +idna==3.11 +multidict==6.7.0 +propcache==0.4.1 +PyQt6==6.10.2 +PyQt6-Qt6==6.10.1 +PyQt6_sip==13.11.0 +qasync==0.28.0 +requests==2.32.5 +typing_extensions==4.15.0 +urllib3==2.6.3 +yarl==1.22.0