""" Startup chooser: pick which site to scrape when the app boots. """ from PyQt5.QtWidgets import ( QDialog, QVBoxLayout, QHBoxLayout, QPushButton, QLabel ) from PyQt5.QtCore import Qt class StartupDialog(QDialog): """Small modal shown on boot to choose EBoek or Bookys.""" EBOEK = "eboek" BOOKYS = "bookys" def __init__(self, parent=None): super().__init__(parent) self.choice = None self._init_ui() def _init_ui(self): self.setWindowTitle("Choose Scraper") self.setModal(True) self.setMinimumWidth(420) layout = QVBoxLayout(self) layout.setSpacing(18) layout.setContentsMargins(28, 28, 28, 28) title = QLabel("Which site do you want to scrape?") title.setStyleSheet("font-size: 16px; font-weight: bold;") title.setAlignment(Qt.AlignCenter) layout.addWidget(title) subtitle = QLabel("You can switch anytime from the menu bar.") subtitle.setAlignment(Qt.AlignCenter) subtitle.setStyleSheet("color: #666;") layout.addWidget(subtitle) buttons = QHBoxLayout() buttons.setSpacing(14) eboek_btn = QPushButton("EBoek.info\n\nDownload comic files") eboek_btn.setMinimumHeight(90) eboek_btn.clicked.connect(lambda: self._choose(self.EBOEK)) buttons.addWidget(eboek_btn) bookys_btn = QPushButton("Bookys\n\nHarvest 1fichier links → .txt") bookys_btn.setMinimumHeight(90) bookys_btn.clicked.connect(lambda: self._choose(self.BOOKYS)) buttons.addWidget(bookys_btn) layout.addLayout(buttons) def _choose(self, choice): self.choice = choice self.accept()