Merge remote-tracking branch 'origin/master'

This commit is contained in:
ST-TEN-11 2025-02-03 15:16:00 +01:00
commit b3e2eca03e

View File

@ -838,25 +838,24 @@ class Test(Widget):
def update_label_with_args(self, extra_info=None): def update_label_with_args(self, extra_info=None):
""" """
Updates the flag label with current command-line arguments and optional extra info, Updates the flag label with the string representation of current command-line arguments
and sets the tooltip text dynamically. and optional extra info, directly displaying it on the label.
Args: Args:
extra_info (str): Optional. Extra information to append to the label text. extra_info (str): Optional. Extra information to append to the label text.
""" """
# Combine command-line arguments # Combine command-line arguments
args_text = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else None # None if no args args_text = " ".join(sys.argv[1:]) if len(
sys.argv) > 1 else "No system arguments provided." # Default to No args
if args_text: # If there are CLI arguments if args_text: # If there are CLI arguments (or default message)
# Combine CLI args and extra info for label text # Combine CLI args and extra info for label text
if extra_info: if extra_info:
args_text += f" | Additional Info: {extra_info}" args_text += f" | {extra_info}"
# Update label text and set the tooltip # Update the label text directly with args_text
self.flag_label.setText(f"ATTENTION SYSTEM ARGUMENTS PASSED") self.flag_label.setText(args_text)
self.flag_label.setStyleSheet("QLabel { color: red; font-weight: bold; }") self.flag_label.setStyleSheet("QLabel { color: red; font-weight: bold; }") # Customize color if needed
self.flag_label.setToolTip(f"Arguments: {args_text}") self.flag_label.setVisible(True) # Ensure the label is visible
self.flag_label.setVisible(True) # Ensure label is visible
else: # No args provided else: # No args provided
self.flag_label.setVisible(False) # Hide label self.flag_label.setVisible(False) # Hide label
self.flag_label.setToolTip("") # Clear tooltip