33 lines
839 B
Python
33 lines
839 B
Python
import sys
|
|
import os
|
|
from PySide6.QtWidgets import QApplication
|
|
from gui.main_window import MainWindow
|
|
from gui.style_manager import StyleManager
|
|
|
|
def get_app_dir():
|
|
if getattr(sys, 'frozen', False):
|
|
return os.path.dirname(sys.executable)
|
|
return os.path.dirname(os.path.abspath(__file__))
|
|
|
|
def main():
|
|
app = QApplication(sys.argv)
|
|
|
|
# Portable mode: Determine app directory for DB and config
|
|
app_dir = get_app_dir()
|
|
db_path = os.path.join(app_dir, "citorrent.db")
|
|
save_path = os.path.join(app_dir, "downloads")
|
|
os.makedirs(save_path, exist_ok=True)
|
|
|
|
# Apply the dark theme stylesheet
|
|
StyleManager.apply_stylesheet(app, "style.qss")
|
|
|
|
window = MainWindow(db_path=db_path, save_path=save_path)
|
|
window.show()
|
|
|
|
sys.exit(app.exec())
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|
|
|