Dark theme, scan auto-ingest, packaging prep, and README refresh
This commit is contained in:
+25
-18
@@ -21,7 +21,7 @@ from PySide6.QtWidgets import (
|
||||
QTabWidget, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget,
|
||||
)
|
||||
|
||||
from . import config, covers, info, iso_reader, launcher, matcher, namer, pipeline, ps1, psp, queue, saves, scanner, sources, store, theme, transfers
|
||||
from . import config, covers, info, ingest, iso_reader, launcher, matcher, namer, pipeline, ps1, psp, queue, saves, scanner, sources, store, style, theme, transfers
|
||||
from .db import get_connection, init_db
|
||||
|
||||
log = logging.getLogger("gui")
|
||||
@@ -622,7 +622,7 @@ class GameDetailsPanel(QWidget):
|
||||
|
||||
content = QWidget()
|
||||
self.layout = QVBoxLayout(content)
|
||||
self.layout.setContentsMargins(6, 6, 6, 6)
|
||||
self.layout.setContentsMargins(6, 6, 16, 6)
|
||||
self.layout.setSpacing(6)
|
||||
scroll.setWidget(content)
|
||||
|
||||
@@ -681,32 +681,28 @@ class GameDetailsPanel(QWidget):
|
||||
self.convert_btn.setToolTip("Convert this PS1 disc to an EBOOT.PBP")
|
||||
self.layout.addWidget(self.convert_btn)
|
||||
|
||||
btn_grid = QGridLayout()
|
||||
btn_grid.setHorizontalSpacing(6)
|
||||
btn_grid.setVerticalSpacing(6)
|
||||
self.link_btn = QPushButton("Scrape…")
|
||||
self.link_btn.clicked.connect(self.link_requested.emit)
|
||||
btn_grid.addWidget(self.link_btn, 0, 0)
|
||||
self.layout.addWidget(self.link_btn)
|
||||
self.edit_btn = QPushButton("Edit details…")
|
||||
self.edit_btn.clicked.connect(self.edit_requested.emit)
|
||||
btn_grid.addWidget(self.edit_btn, 0, 1)
|
||||
self.layout.addWidget(self.edit_btn)
|
||||
self.copy_btn = QPushButton("Copy to PSP")
|
||||
self.copy_btn.clicked.connect(self.copy_requested.emit)
|
||||
self.copy_btn.setEnabled(False)
|
||||
self.copy_btn.setToolTip("Copy this disc to the connected PSP")
|
||||
btn_grid.addWidget(self.copy_btn, 1, 0)
|
||||
self.layout.addWidget(self.copy_btn)
|
||||
self.delete_btn = QPushButton("Delete")
|
||||
self.delete_btn.clicked.connect(self.delete_requested.emit)
|
||||
self.delete_btn.setStyleSheet("color: #e06c6c;")
|
||||
self.delete_btn.setToolTip("Permanently delete this disc from disk")
|
||||
btn_grid.addWidget(self.delete_btn, 1, 1)
|
||||
self.layout.addWidget(self.delete_btn)
|
||||
self.del_psp_btn = QPushButton("Delete from PSP")
|
||||
self.del_psp_btn.clicked.connect(self.delete_psp_requested.emit)
|
||||
self.del_psp_btn.setEnabled(False)
|
||||
self.del_psp_btn.setStyleSheet("color: #e06c6c;")
|
||||
self.del_psp_btn.setToolTip("Delete this disc from the connected PSP")
|
||||
btn_grid.addWidget(self.del_psp_btn, 2, 0)
|
||||
self.layout.addLayout(btn_grid)
|
||||
self.layout.addWidget(self.del_psp_btn)
|
||||
|
||||
self.layout.addStretch(1)
|
||||
|
||||
@@ -1207,7 +1203,7 @@ class SettingsPage(QWidget):
|
||||
|
||||
hint = QLabel(
|
||||
"Manual UMD covers: drop images into "
|
||||
f"<tt>{config.DATA_DIR / 'manual_covers'}</tt> "
|
||||
f"<tt>{config.USER_DATA_DIR / 'manual_covers'}</tt> "
|
||||
"(subfolders <tt>games/</tt> and <tt>videos/</tt>)."
|
||||
)
|
||||
hint.setWordWrap(True)
|
||||
@@ -1450,7 +1446,7 @@ class StoreDetailsPanel(QWidget):
|
||||
outer.addWidget(scroll)
|
||||
content = QWidget()
|
||||
self.layout = QVBoxLayout(content)
|
||||
self.layout.setContentsMargins(6, 6, 6, 6)
|
||||
self.layout.setContentsMargins(6, 6, 16, 6)
|
||||
self.layout.setSpacing(6)
|
||||
scroll.setWidget(content)
|
||||
|
||||
@@ -2503,8 +2499,10 @@ class QueuePage(QWidget):
|
||||
self.table = QTableWidget(0, 7)
|
||||
self.table.setHorizontalHeaderLabels(["Item", "Type", "Status", "Progress", "Destination", "", ""])
|
||||
self.table.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch)
|
||||
self.table.horizontalHeader().setSectionResizeMode(5, QHeaderView.ResizeToContents)
|
||||
self.table.horizontalHeader().setSectionResizeMode(6, QHeaderView.ResizeToContents)
|
||||
self.table.horizontalHeader().setSectionResizeMode(5, QHeaderView.Fixed)
|
||||
self.table.horizontalHeader().setSectionResizeMode(6, QHeaderView.Fixed)
|
||||
self.table.setColumnWidth(5, 80)
|
||||
self.table.setColumnWidth(6, 34)
|
||||
self.table.verticalHeader().setVisible(False)
|
||||
layout.addWidget(self.table)
|
||||
|
||||
@@ -2531,11 +2529,14 @@ class QueuePage(QWidget):
|
||||
self.table.setCellWidget(row, 3, bar)
|
||||
self.table.setItem(row, 4, QTableWidgetItem(job["dest"]))
|
||||
cancel = QPushButton("Cancel")
|
||||
cancel.setFixedHeight(22)
|
||||
cancel.setStyleSheet("padding: 0px 8px;")
|
||||
cancel.clicked.connect(lambda _=False, jid=job["id"]: self.queue.cancel(jid))
|
||||
self.table.setCellWidget(row, 5, cancel)
|
||||
delete = QPushButton("✕")
|
||||
delete.setToolTip("Remove this entry from the queue history")
|
||||
delete.setFixedWidth(28)
|
||||
delete.setFixedSize(22, 22)
|
||||
delete.setStyleSheet("padding: 0px;")
|
||||
delete.clicked.connect(lambda _=False, jid=job["id"]: self.queue.remove(jid))
|
||||
self.table.setCellWidget(row, 6, delete)
|
||||
self._rows[job["id"]] = row
|
||||
@@ -4092,7 +4093,7 @@ class MainWindow(QMainWindow):
|
||||
layout.setContentsMargins(8, 8, 0, 8)
|
||||
|
||||
self.tabs = QTabWidget()
|
||||
self.tabs.setStyleSheet("QTabWidget::pane { border: 0px; padding: 0px; }")
|
||||
self.tabs.setStyleSheet("QTabWidget::pane { border: 0px; padding: 10px 0 0 0; }")
|
||||
layout.addWidget(self.tabs)
|
||||
self.queue = queue.TransferQueue(self)
|
||||
self.queue.job_finished.connect(self._on_queue_job_done)
|
||||
@@ -4175,7 +4176,7 @@ class MainWindow(QMainWindow):
|
||||
splitter = QSplitter(Qt.Horizontal)
|
||||
|
||||
self.library_subtabs = QTabWidget()
|
||||
self.library_subtabs.setStyleSheet("QTabWidget::pane { border: 0px; padding: 0px; }")
|
||||
self.library_subtabs.setStyleSheet("QTabWidget::pane { border: 0px; padding: 10px 0 0 0; }")
|
||||
self.library_subtabs.addTab(self._build_library_view(), "Library")
|
||||
self.library_subtabs.addTab(self._build_scan_view(), "Scan")
|
||||
splitter.addWidget(self.library_subtabs)
|
||||
@@ -5310,8 +5311,14 @@ def _start_bundle_check(window):
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)-7s %(name)-14s %(message)s")
|
||||
init_db() # migrate legacy on-share DB/covers to local storage, then schema
|
||||
# Auto-ingest any missing DATs so scanning matches against the catalog
|
||||
# even on a fresh/reset database (no manual `python -m app.ingest` step).
|
||||
n = ingest.ensure_catalog()
|
||||
if n:
|
||||
log.info("ingested %d DAT(s) into the catalog", n)
|
||||
log.info("starting psp-preserve (db: %s)", config.DB_PATH)
|
||||
app = QApplication(sys.argv)
|
||||
style.apply_theme(app)
|
||||
icon_path = config.PROJECT_ROOT / "img" / "app-icon.png"
|
||||
if icon_path.is_file():
|
||||
app.setWindowIcon(QIcon(str(icon_path)))
|
||||
|
||||
Reference in New Issue
Block a user