Save window geometry, splitter sizes, and preview column widths on exit; restore on launch. Fix episode rewrite duplicating the season letter. Co-authored-by: Cursor <[email protected]>
36 lines
1002 B
Python
36 lines
1002 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
HSRename - Native Linux GUI for mass renaming files.
|
|
Inspired by Bulk Rename Utility (Windows); supports preview and flexible rules.
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Ensure project root is on path when run as script or module
|
|
_root = Path(__file__).resolve().parent
|
|
if str(_root) not in sys.path:
|
|
sys.path.insert(0, str(_root))
|
|
|
|
from PyQt6.QtWidgets import QApplication
|
|
from PyQt6.QtCore import Qt
|
|
from gui.main_window import MainWindow
|
|
|
|
|
|
def main():
|
|
QApplication.setHighDpiScaleFactorRoundingPolicy(
|
|
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
|
|
)
|
|
app = QApplication(sys.argv)
|
|
app.setOrganizationName("HSRename")
|
|
app.setOrganizationDomain("hisora.dev")
|
|
app.setApplicationName("HSRename")
|
|
version_file = _root / "VERSION"
|
|
app.setApplicationVersion(version_file.read_text().strip() if version_file.is_file() else "")
|
|
win = MainWindow()
|
|
win.show()
|
|
sys.exit(app.exec())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|