Skip to content

Commit be11700

Browse files
authored
Merge pull request #16 from ArtMin96/jules_wip_4526261753635912301
Fix QUrl ImportError and NameError in ServicesPage; Diagnose Env.
2 parents 3521c07 + 72055a7 commit be11700

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

grazr/ui/services_page.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,24 @@ def on_selection_changed_show_details(self):
206206

207207
# --- Header Action Methods ---
208208
def add_header_actions(self, header_widget):
209-
main_window.add_header_action(self.add_service_button, "services_page")
210-
main_window.add_header_action(self.stop_all_button, "services_page")
211-
if self.add_service_button.parent(): self.add_service_button.parent().layout().removeWidget(self.add_service_button)
212-
if self.stop_all_button.parent(): self.stop_all_button.parent().layout().removeWidget(self.stop_all_button)
209+
logger.debug(f"SERVICES_PAGE.add_header_actions: Called. add_service_button is valid: {self.add_service_button is not None}, stop_all_button is valid: {self.stop_all_button is not None}")
210+
211+
logger.debug(f"SERVICES_PAGE.add_header_actions: Attempting to add add_service_button ({self.add_service_button}) to header.")
212+
if self.add_service_button:
213+
header_widget.add_action_widget(self.add_service_button)
214+
else:
215+
logger.warning("SERVICES_PAGE.add_header_actions: self.add_service_button is None, cannot add to header.")
216+
217+
logger.debug(f"SERVICES_PAGE.add_header_actions: Attempting to add stop_all_button ({self.stop_all_button}) to header.")
218+
if self.stop_all_button:
219+
header_widget.add_action_widget(self.stop_all_button)
220+
else:
221+
logger.warning("SERVICES_PAGE.add_header_actions: self.stop_all_button is None, cannot add to header.")
222+
223+
# The original lines that removed widgets from their parents are commented out.
224+
# HeaderWidget.add_action_widget should handle reparenting.
225+
# if self.add_service_button.parent(): self.add_service_button.parent().layout().removeWidget(self.add_service_button)
226+
# if self.stop_all_button.parent(): self.stop_all_button.parent().layout().removeWidget(self.stop_all_button)
213227

214228
@Slot(str, str) # Receives unique_instance_id_or_process_id, action
215229
def on_service_action(self, service_item_id, action):

grazr/ui/site_config_panel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import logging
22
from pathlib import Path
3+
import re # Added for re.escape
34

45
from PySide6.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QLabel,
56
QPushButton, QComboBox, QCheckBox, QLineEdit,
67
QFormLayout, QSpacerItem, QSizePolicy, QMenu)
7-
from PySide6.QtCore import Signal, Slot, Qt, QRegularExpression, QSize
8-
from PySide6.QtGui import QFont, QRegularExpressionValidator, QIcon, QDesktopServices, QUrl
8+
from PySide6.QtCore import Signal, Slot, Qt, QRegularExpression, QSize, QUrl # QUrl added
9+
from PySide6.QtGui import QFont, QRegularExpressionValidator, QIcon, QDesktopServices # QUrl removed
910

1011
logger = logging.getLogger(__name__)
1112

0 commit comments

Comments
 (0)