Seregon/PkgToolBox

Toolbox for analyzing and editing pkg application files for psp,ps3, ps4 and ps5, includes the most useful functions you might need.

Python/57.3 KB/No license
GraphicUserInterface/widgets/base_tab.py
1"""
2Base tab widget for modular UI architecture
3"""
4from PyQt5.QtWidgets import QWidget, QVBoxLayout
5 
6 
7class BaseTab(QWidget):
8 """Base class for all tab widgets"""
9
10 def __init__(self, parent=None):
11 super().__init__(parent)
12 self.parent_window = parent
13 self.layout = QVBoxLayout(self)
14 self.setup_ui()
15
16 def setup_ui(self):
17 """Setup the UI components for this tab"""
18 raise NotImplementedError("setup_ui() must be implemented by subclasses")
19
20 def get_package(self):
21 """Get the currently loaded package from parent window"""
22 if hasattr(self.parent_window, 'package'):
23 return self.parent_window.package
24 return None
25
26 def show_message(self, title, message, message_type="info"):
27 """Show message dialog through parent window"""
28 if hasattr(self.parent_window, 'show_message'):
29 self.parent_window.show_message(title, message, message_type)
30