Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<data>
<version>v2.7.17</version>
<version>v2.7.18</version>
<description>Configuration file for the application</description>
</data>
45 changes: 20 additions & 25 deletions ui/help/help_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,25 @@ def init_ui(self):

layout.addLayout(buttons_layout)

footer = QLabel("ROBOT RUNNER v2.7.16")
config_paths = [
'config.xml', # Development path
os.path.join(os.path.dirname(sys.executable), 'config.xml'), # EXE location
]

config_loaded = False
for path in config_paths:
if os.path.exists(path):
tree = ET.parse(path)
root = tree.getroot()
self.version_label = f"{root[0].text}"
config_loaded = True
break

if not config_loaded:
self.version_label = "(Unknown version)"

footer = QLabel(f"© ROBOT RUNNER {self.version_label} | "
"Developed by Achraf KHABAR | ")
footer.setAlignment(Qt.AlignmentFlag.AlignCenter)
footer.setStyleSheet("""
QLabel {
Expand All @@ -218,30 +236,7 @@ def init_ui(self):
layout.addWidget(footer)

self.setLayout(layout)

def _load_config(self):
try:
# Try multiple paths to locate the config file
config_paths = [
'config.xml', # Development path
os.path.join(os.path.dirname(sys.executable), 'config.xml'), # EXE location
os.path.join(sys._MEIPASS, 'config.xml') # PyInstaller temp directory
]

config_loaded = False
for path in config_paths:
if os.path.exists(path):
tree = ET.parse(path)
root = tree.getroot()
self.version_label = f"© Robot Runner {root[0].text}"
config_loaded = True
break

if not config_loaded:
raise FileNotFoundError("Config file not found in any standard location")

except Exception as e:
self.version_label = "© Robot Runner v2.7.16"


def setup_animations(self):
self.opacity_effect = QGraphicsOpacityEffect(self)
Expand Down
16 changes: 8 additions & 8 deletions ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QLabel,
QListWidget, QCheckBox, QSpinBox, QScrollArea,
QStackedWidget, QMessageBox, QLineEdit, QGroupBox,
QFormLayout
QFormLayout, QSizePolicy
)
from PyQt6.QtCore import Qt, QPoint, pyqtSignal, QTimer, QSettings
from PyQt6.QtCore import Qt, QPoint, pyqtSignal, QTimer, QSettings
from PyQt6.QtGui import QFont

from ui.logo_splash import LogoSplash
Expand All @@ -27,6 +28,7 @@
from ui.help.help_controller import HelpController



matplotlib.use('Qt5Agg')

class RobotTestRunner(QWidget):
Expand Down Expand Up @@ -90,11 +92,12 @@ def init_ui(self):
self.right_container.setLayout(self.right_layout)

# Title bar
self.title_bar = TitleBar("", self)
self.title_bar = TitleBar("Robot Test Runner", self)
self.right_layout.addWidget(self.title_bar)

# Stacked widget for pages
self.stacked_widget = QStackedWidget()
self.stacked_widget.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
self.right_layout.addWidget(self.stacked_widget)

# Main content area
Expand All @@ -104,7 +107,7 @@ def init_ui(self):
self.content_layout = QVBoxLayout()
self.content_widget.setLayout(self.content_layout)
self.content_scroll.setWidget(self.content_widget)
self.right_layout.addWidget(self.content_scroll)
self.stacked_widget.addWidget(self.content_scroll)

self.main_h_layout.addWidget(self.right_container)

Expand Down Expand Up @@ -314,7 +317,7 @@ def _init_help_page(self):

def _handle_help_link(self, url):
"""Handle help link clicks"""
print(f"Help link clicked: {url}") # You can add analytics here if needed
print(f"Help link clicked: {url}")

def _save_settings(self):
"""Save settings to persistent storage"""
Expand Down Expand Up @@ -430,13 +433,10 @@ def show_analytics(self):

def show_main_content(self):
"""Show the main test selection content"""
self.content_scroll.show()
self.stacked_widget.hide()
self.stacked_widget.setCurrentWidget(self.content_scroll)

def show_page(self, page):
"""Show a specific page"""
self.content_scroll.hide()
self.stacked_widget.show()
self.stacked_widget.setCurrentWidget(page)

def toggle_select_all_tests(self, state):
Expand Down
5 changes: 1 addition & 4 deletions widgets/title_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, title, parent_window=None):
self.setFixedHeight(40)
self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
self.drag_start_position = None
self.is_maximized = False # Track maximized state
self.is_maximized = False

layout = QHBoxLayout()
layout.setContentsMargins(10, 0, 10, 0)
Expand Down Expand Up @@ -69,9 +69,7 @@ def mouseMoveEvent(self, event):
return

if self.is_maximized:
# If window is maximized and we start dragging
self.parent_window.showNormal()
# Adjust position for natural dragging
new_pos = event.globalPosition().toPoint() - QPoint(
self.parent_window.width() // 2,
self.height() // 2
Expand All @@ -80,7 +78,6 @@ def mouseMoveEvent(self, event):
self.drag_start_position = event.globalPosition().toPoint()
self.is_maximized = False
else:
# Normal window movement
delta = event.globalPosition().toPoint() - self.drag_start_position
self.parent_window.move(self.parent_window.pos() + delta)
self.drag_start_position = event.globalPosition().toPoint()
Expand Down