diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 468d1c1..4079918 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,4 +1,4 @@
-exclude: ^scripts
+exclude: ^(scripts|comictaggerlib/graphics/resources.py)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
diff --git a/comictaggerlib/coverimagewidget.py b/comictaggerlib/coverimagewidget.py
index 22a43a3..3c604a3 100644
--- a/comictaggerlib/coverimagewidget.py
+++ b/comictaggerlib/coverimagewidget.py
@@ -26,7 +26,6 @@ import pathlib
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from comicapi.comicarchive import ComicArchive
-from comictaggerlib.graphics import graphics_path
from comictaggerlib.imagefetcher import ImageFetcher
from comictaggerlib.imagepopup import ImagePopup
from comictaggerlib.pageloader import PageLoader
@@ -102,8 +101,8 @@ class CoverImageWidget(QtWidgets.QWidget):
self.imageCount = 1
self.imageData = b""
- self.btnLeft.setIcon(QtGui.QIcon(str(graphics_path / "left.png")))
- self.btnRight.setIcon(QtGui.QIcon(str(graphics_path / "right.png")))
+ self.btnLeft.setIcon(QtGui.QIcon(":/graphics/left.png"))
+ self.btnRight.setIcon(QtGui.QIcon(":/graphics/right.png"))
self.btnLeft.clicked.connect(self.decrement_image)
self.btnRight.clicked.connect(self.increment_image)
@@ -263,7 +262,7 @@ class CoverImageWidget(QtWidgets.QWidget):
self.page_loader = None
def load_default(self) -> None:
- self.current_pixmap = QtGui.QPixmap(str(graphics_path / "nocover.png"))
+ self.current_pixmap = QtGui.QPixmap(":/graphics/nocover.png")
self.set_display_pixmap()
def resizeEvent(self, resize_event: QtGui.QResizeEvent) -> None:
diff --git a/comictaggerlib/gui.py b/comictaggerlib/gui.py
index e1dd39e..74ee72b 100644
--- a/comictaggerlib/gui.py
+++ b/comictaggerlib/gui.py
@@ -111,10 +111,8 @@ def open_tagger_window(
# needed to catch initial open file events (macOS)
app.openFileRequest.connect(lambda x: config[0].Runtime_Options__files.append(x.toLocalFile()))
-
- if platform.system() == "Darwin":
- # Set the MacOS dock icon
- app.setWindowIcon(QtGui.QIcon(str(graphics_path / "app.png")))
+ # The window Icon needs to be set here. It's also set in taggerwindow.ui but it doesn't seem to matter
+ app.setWindowIcon(QtGui.QIcon(":/graphics/app.png"))
if platform.system() == "Windows":
# For pure python, tell windows that we're not python,
@@ -139,7 +137,6 @@ def open_tagger_window(
try:
tagger_window = TaggerWindow(config[0].Runtime_Options__files, config, talkers)
- tagger_window.setWindowIcon(QtGui.QIcon(str(graphics_path / "app.png")))
tagger_window.show()
# Catch open file events (macOS)
diff --git a/comictaggerlib/imagepopup.py b/comictaggerlib/imagepopup.py
index 40ebc41..0e1678f 100644
--- a/comictaggerlib/imagepopup.py
+++ b/comictaggerlib/imagepopup.py
@@ -20,7 +20,6 @@ import logging
from PyQt5 import QtCore, QtGui, QtWidgets, sip, uic
-from comictaggerlib.graphics import graphics_path
from comictaggerlib.ui import ui_path
logger = logging.getLogger(__name__)
@@ -50,7 +49,7 @@ class ImagePopup(QtWidgets.QDialog):
# TODO: macOS denies this
screen = QtWidgets.QApplication.primaryScreen()
self.desktopBg = screen.grabWindow(sip.voidptr(0), 0, 0, screen_size.width(), screen_size.height())
- bg = QtGui.QPixmap(str(graphics_path / "popup_bg.png"))
+ bg = QtGui.QPixmap(":/graphics/popup_bg.png")
self.clientBgPixmap = bg.scaled(
screen_size.width(),
screen_size.height(),
diff --git a/comictaggerlib/pagebrowser.py b/comictaggerlib/pagebrowser.py
index e4c11a2..a6cec10 100644
--- a/comictaggerlib/pagebrowser.py
+++ b/comictaggerlib/pagebrowser.py
@@ -17,14 +17,12 @@
from __future__ import annotations
import logging
-import platform
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from comicapi.comicarchive import ComicArchive
from comicapi.genericmetadata import GenericMetadata
from comictaggerlib.coverimagewidget import CoverImageWidget
-from comictaggerlib.graphics import graphics_path
from comictaggerlib.ui import ui_path
logger = logging.getLogger(__name__)
@@ -57,12 +55,8 @@ class PageBrowserWindow(QtWidgets.QDialog):
self.metadata = metadata
self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Close).setDefault(True)
- if platform.system() == "Darwin":
- self.btnPrev.setText("<<")
- self.btnNext.setText(">>")
- else:
- self.btnPrev.setIcon(QtGui.QIcon(str(graphics_path / "left.png")))
- self.btnNext.setIcon(QtGui.QIcon(str(graphics_path / "right.png")))
+ self.btnPrev.setIcon(QtGui.QIcon(":/graphics/left.png"))
+ self.btnNext.setIcon(QtGui.QIcon(":/graphics/right.png"))
self.btnNext.clicked.connect(self.next_page)
self.btnPrev.clicked.connect(self.prev_page)
diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py
index 61d2ae9..ea5d7bc 100644
--- a/comictaggerlib/taggerwindow.py
+++ b/comictaggerlib/taggerwindow.py
@@ -32,6 +32,7 @@ import settngs
from PyQt5 import QtCore, QtGui, QtNetwork, QtWidgets, uic
import comicapi.merge
+import comictaggerlib.graphics.resources
import comictaggerlib.ui
from comicapi import utils
from comicapi.comicarchive import ComicArchive, metadata_styles
@@ -412,134 +413,42 @@ class TaggerWindow(QtWidgets.QMainWindow):
def config_menus(self) -> None:
# File Menu
- self.actionExit.setShortcut("Ctrl+Q")
- self.actionExit.setStatusTip("Exit application")
- self.actionExit.triggered.connect(self.close)
-
- self.actionLoad.setShortcut("Ctrl+O")
- self.actionLoad.setStatusTip("Load comic archive")
- self.actionLoad.triggered.connect(self.select_file)
-
- self.actionLoadFolder.setShortcut("Ctrl+Shift+O")
- self.actionLoadFolder.setStatusTip("Load folder with comic archives")
- self.actionLoadFolder.triggered.connect(self.select_folder)
-
- self.actionOpenFolderAsComic.setShortcut("Ctrl+Shift+Alt+O")
- self.actionOpenFolderAsComic.setStatusTip("Load folder as a comic archives")
- self.actionOpenFolderAsComic.triggered.connect(self.select_folder_archive)
-
- self.actionWrite_Tags.setShortcut("Ctrl+S")
- self.actionWrite_Tags.setStatusTip("Save tags to comic archive")
- self.actionWrite_Tags.triggered.connect(self.commit_metadata)
-
- self.actionAutoTag.setShortcut("Ctrl+T")
- self.actionAutoTag.setStatusTip("Auto-tag multiple archives")
self.actionAutoTag.triggered.connect(self.auto_tag)
-
- self.actionCopyTags.setShortcut("Ctrl+C")
- self.actionCopyTags.setStatusTip("Copy one tag style tags to enabled modify style(s)")
self.actionCopyTags.triggered.connect(self.copy_tags)
-
- self.actionRemoveAuto.setShortcut("Ctrl+D")
- self.actionRemoveAuto.setStatusTip("Remove currently selected modify tag style(s) from the archive")
+ self.actionExit.triggered.connect(self.close)
+ self.actionLoad.triggered.connect(self.select_file)
+ self.actionLoadFolder.triggered.connect(self.select_folder)
+ self.actionOpenFolderAsComic.triggered.connect(self.select_folder_archive)
self.actionRemoveAuto.triggered.connect(self.remove_auto)
-
- self.actionRepackage.setShortcut("Ctrl+E")
- self.actionRepackage.setStatusTip("Re-create archive as CBZ")
- self.actionRepackage.triggered.connect(self.repackage_archive)
-
- self.actionRename.setShortcut("Ctrl+N")
- self.actionRename.setStatusTip("Rename archive based on tags")
self.actionRename.triggered.connect(self.rename_archive)
-
- self.actionSettings.setShortcut("Ctrl+Shift+S")
- self.actionSettings.setStatusTip("Configure ComicTagger")
+ self.actionRepackage.triggered.connect(self.repackage_archive)
self.actionSettings.triggered.connect(self.show_settings)
-
+ self.actionWrite_Tags.triggered.connect(self.commit_metadata)
# Tag Menu
- self.actionParse_Filename.setShortcut("Ctrl+F")
- self.actionParse_Filename.setStatusTip("Try to extract tags from filename")
- self.actionParse_Filename.triggered.connect(self.use_filename)
-
- self.actionParse_Filename_split_words.setShortcut("Ctrl+Shift+F")
- self.actionParse_Filename_split_words.setStatusTip("Try to extract tags from filename and split words")
- self.actionParse_Filename_split_words.triggered.connect(self.use_filename_split)
-
- self.actionSearchOnline.setShortcut("Ctrl+W")
- self.actionSearchOnline.setStatusTip("Search online for tags")
- self.actionSearchOnline.triggered.connect(self.query_online)
-
- self.actionAutoImprint.triggered.connect(self.auto_imprint)
-
- self.actionAutoIdentify.setShortcut("Ctrl+I")
- self.actionAutoIdentify.triggered.connect(self.auto_identify_search)
-
- self.actionLiteralSearch.triggered.connect(self.literal_search)
-
- self.actionApplyCBLTransform.setShortcut("Ctrl+L")
- self.actionApplyCBLTransform.setStatusTip("Modify tags specifically for CBL format")
self.actionApplyCBLTransform.triggered.connect(self.apply_cbl_transform)
-
- self.actionReCalcPageDims.setShortcut("Ctrl+R")
- self.actionReCalcPageDims.setStatusTip(
- "Trigger re-calculating image size, height and width for all pages on the next save"
- )
- self.actionReCalcPageDims.triggered.connect(self.recalc_page_dimensions)
-
- self.actionClearEntryForm.setShortcut("Ctrl+Shift+C")
- self.actionClearEntryForm.setStatusTip("Clear all the data on the screen")
+ self.actionAutoIdentify.triggered.connect(self.auto_identify_search)
+ self.actionAutoImprint.triggered.connect(self.auto_imprint)
self.actionClearEntryForm.triggered.connect(self.clear_form)
-
+ self.actionLiteralSearch.triggered.connect(self.literal_search)
+ self.actionParse_Filename.triggered.connect(self.use_filename)
+ self.actionParse_Filename_split_words.triggered.connect(self.use_filename_split)
+ self.actionReCalcPageDims.triggered.connect(self.recalc_page_dimensions)
+ self.actionSearchOnline.triggered.connect(self.query_online)
# Window Menu
- self.actionPageBrowser.setShortcut("Ctrl+P")
- self.actionPageBrowser.setStatusTip("Show the page browser")
- self.actionPageBrowser.triggered.connect(self.show_page_browser)
- self.actionLogWindow.setShortcut("Ctrl+Shift+L")
- self.actionLogWindow.setStatusTip("Show the log window")
self.actionLogWindow.triggered.connect(self.log_window.show)
-
+ self.actionPageBrowser.triggered.connect(self.show_page_browser)
# Help Menu
- self.actionAbout.setStatusTip("Show the " + self.appName + " info")
self.actionAbout.triggered.connect(self.about_app)
- self.actionWiki.triggered.connect(self.show_wiki)
- self.actionReportBug.triggered.connect(self.report_bug)
self.actionComicTaggerForum.triggered.connect(self.show_forum)
-
- # Notes Menu
- self.btnOpenWebLink.setIcon(QtGui.QIcon(str(graphics_path / "open.png")))
-
- # ToolBar
- self.actionLoad.setIcon(QtGui.QIcon(str(graphics_path / "open.png")))
- self.actionLoadFolder.setIcon(QtGui.QIcon(str(graphics_path / "longbox.png")))
- self.actionOpenFolderAsComic.setIcon(QtGui.QIcon(str(graphics_path / "open.png")))
- self.actionWrite_Tags.setIcon(QtGui.QIcon(str(graphics_path / "save.png")))
- self.actionParse_Filename.setIcon(QtGui.QIcon(str(graphics_path / "parse.png")))
- self.actionParse_Filename_split_words.setIcon(QtGui.QIcon(str(graphics_path / "parse.png")))
- self.actionSearchOnline.setIcon(QtGui.QIcon(str(graphics_path / "search.png")))
- self.actionLiteralSearch.setIcon(QtGui.QIcon(str(graphics_path / "search.png")))
- self.actionAutoIdentify.setIcon(QtGui.QIcon(str(graphics_path / "auto.png")))
- self.actionAutoTag.setIcon(QtGui.QIcon(str(graphics_path / "autotag.png")))
- self.actionAutoImprint.setIcon(QtGui.QIcon(str(graphics_path / "autotag.png")))
- self.actionClearEntryForm.setIcon(QtGui.QIcon(str(graphics_path / "clear.png")))
- self.actionPageBrowser.setIcon(QtGui.QIcon(str(graphics_path / "browse.png")))
-
- self.toolBar.addAction(self.actionLoad)
- self.toolBar.addAction(self.actionLoadFolder)
- self.toolBar.addAction(self.actionWrite_Tags)
- self.toolBar.addAction(self.actionSearchOnline)
- self.toolBar.addAction(self.actionLiteralSearch)
- self.toolBar.addAction(self.actionAutoIdentify)
- self.toolBar.addAction(self.actionAutoTag)
- self.toolBar.addAction(self.actionClearEntryForm)
- self.toolBar.addAction(self.actionPageBrowser)
- self.toolBar.addAction(self.actionAutoImprint)
-
- self.leWebLink.addAction(self.actionAddWebLink)
- self.leWebLink.addAction(self.actionRemoveWebLink)
+ self.actionReportBug.triggered.connect(self.report_bug)
+ self.actionWiki.triggered.connect(self.show_wiki)
self.actionAddWebLink.triggered.connect(self.add_weblink_item)
self.actionRemoveWebLink.triggered.connect(self.remove_weblink_item)
+ self.leWebLink.addAction(self.actionAddWebLink)
+ self.leWebLink.addAction(self.actionRemoveWebLink)
+
def add_weblink_item(self, url: str = "") -> None:
item = ""
if isinstance(url, str):
@@ -678,7 +587,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
msg_box = QtWidgets.QMessageBox()
msg_box.setWindowTitle("About " + self.appName)
msg_box.setTextFormat(QtCore.Qt.TextFormat.RichText)
- msg_box.setIconPixmap(QtGui.QPixmap(str(graphics_path / "about.png")))
+ msg_box.setIconPixmap(QtGui.QPixmap(":/graphics/about.png"))
msg_box.setText(
"
"
+ self.appName
diff --git a/comictaggerlib/ui/customwidgets.py b/comictaggerlib/ui/customwidgets.py
index 2401ccf..e38cfe7 100644
--- a/comictaggerlib/ui/customwidgets.py
+++ b/comictaggerlib/ui/customwidgets.py
@@ -10,7 +10,6 @@ from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import QEvent, QModelIndex, QPoint, QRect, QSize, Qt, pyqtSignal
from comicapi.utils import StrEnum
-from comictaggerlib.graphics import graphics_path
class ClickedButtonEnum(StrEnum):
@@ -133,8 +132,8 @@ class ReadStyleItemDelegate(QtWidgets.QStyledItemDelegate):
super().__init__()
self.combobox = parent
- self.down_icon = QtGui.QImage(str(graphics_path / "down.png"))
- self.up_icon = QtGui.QImage(str(graphics_path / "up.png"))
+ self.down_icon = QtGui.QImage(":/graphics/down.png")
+ self.up_icon = QtGui.QImage(":/graphics/up.png")
self.button_width = self.down_icon.width()
self.button_padding = 5
diff --git a/comictaggerlib/ui/qtutils.py b/comictaggerlib/ui/qtutils.py
index 23d4e54..d1b6472 100644
--- a/comictaggerlib/ui/qtutils.py
+++ b/comictaggerlib/ui/qtutils.py
@@ -11,8 +11,6 @@ from collections.abc import Sequence
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QWidget
-from comictaggerlib.graphics import graphics_path
-
logger = logging.getLogger(__name__)
try:
@@ -143,7 +141,7 @@ if qt_available:
pass
# if still nothing, go with default image
if not success:
- img.load(str(graphics_path / "nocover.png"))
+ img.load(":/graphics/nocover.png")
return img
def qt_error(msg: str, e: Exception | None = None) -> None:
diff --git a/comictaggerlib/ui/taggerwindow.ui b/comictaggerlib/ui/taggerwindow.ui
index f99e7d5..1bb4493 100644
--- a/comictaggerlib/ui/taggerwindow.ui
+++ b/comictaggerlib/ui/taggerwindow.ui
@@ -22,6 +22,10 @@
ComicTagger
+
+
+ :/graphics/app.png:/graphics/app.png
+
true
@@ -1015,6 +1019,10 @@ border-radius: 4px;
16777215
+
+
+ :/graphics/open.png:/graphics/open.png
+
-
@@ -1340,203 +1348,22 @@ border-radius: 4px;
false
+
+
+
+
+
+
+
+
+
-
-
- Open
-
-
-
-
- Save Tags
-
-
-
-
- Export as Zip Archive
-
-
-
-
- Exit
-
-
About ComicTagger
-
-
-
- Parse Filename
-
-
-
-
- Search Online
-
-
-
-
- Clear Form
-
-
-
-
- Remove ComicRack Tags
-
-
-
-
- Remove ComicBookLover Tags
-
-
-
-
- Reload ComicBookLover Tags
-
-
-
-
- Reload ComicRack Tags
-
-
-
-
- Reload Selected Tag Style
-
-
-
-
- Settings...
-
-
-
-
- Auto-Identify
-
-
- Auto-Identify
-
-
- Search online for tags and auto-identify best match for single archive
-
-
- Search online for tags and auto-identify best match for single archive
-
-
-
-
- Show Page Browser
-
-
- Page Browser
-
-
- Show the Page Browser to inspect the comic
-
-
- Show the Page Browser to inspect the comic
-
-
-
-
- View Raw ComicRack Tags
-
-
-
-
- View Raw ComicBookLover Tags
-
-
-
-
- Report Bug...
-
-
-
-
- ComicTagger Discussions...
-
-
-
-
- Online Docs...
-
-
-
-
- Remove Current 'Modify' Tag Style(s)
-
-
-
-
- Rename
-
-
-
-
- Apply CBL Transform
-
-
-
-
- Re-Calculate Page Dimensions
-
-
-
-
- Open Folder
-
-
-
-
- Copy Tags
-
-
-
-
- Auto-Tag
-
-
- Search online for tags,auto-identify best match, and save to archive
-
-
- Search online for tags,auto-identify best match, and save to archive
-
-
-
-
- Auto Imprint
-
-
- Normalize the publisher and map imprints to their parent publisher (e.g. Vertigo is an imprint of DC Comics)
-
-
-
-
- Parse Filename and split words
-
-
- Parse Filename and split words
-
-
-
-
- Show Log Window
-
-
-
-
- Literal Search
-
-
- perform a literal search on the series and return the first 50 results
-
-
-
-
- Open Folder as Comic
+
+ QAction::AboutRole
@@ -1544,10 +1371,330 @@ border-radius: 4px;
Add Item
+
+
+ Apply CBL Transform
+
+
+ Modify metadata specifically for the CBL tags
+
+
+ Ctrl+Shift+T
+
+
+
+
+
+ :/graphics/auto.png:/graphics/auto.png
+
+
+ Auto-Identify
+
+
+ Auto-Identify
+
+
+ Search online for metadata and auto-identify best match for single archive
+
+
+ Ctrl+I
+
+
+
+
+
+ :/graphics/auto.png:/graphics/auto.png
+
+
+ Auto Imprint
+
+
+ Normalize the publisher and map imprints to their parent publisher (e.g. Vertigo is an imprint of DC Comics)
+
+
+ Ctrl+Shift+I
+
+
+
+
+
+ :/graphics/autotag.png:/graphics/autotag.png
+
+
+ Auto-Tag
+
+
+ Auto-Tag multiple archives
+
+
+ Search online for metadata, auto-identify best match, and save to archive
+
+
+ Ctrl+T
+
+
+
+
+
+ :/graphics/clear.png:/graphics/clear.png
+
+
+ Clear Form
+
+
+ Clear all metadata for the current comic
+
+
+ Clear all the data on the screen
+
+
+ Ctrl+Shift+C
+
+
+
+
+ ComicTagger Discussions...
+
+
+
+
+ Copy Tags
+
+
+ Copy metadata from the selected 'read' tags to the selected 'modify' tags
+
+
+ Copy metadata from one type of tag to another
+
+
+ Ctrl+C
+
+
+
+
+ Exit
+
+
+ Ctrl+Q
+
+
+ QAction::QuitRole
+
+
+
+
+
+ :/graphics/search.png:/graphics/search.png
+
+
+ Literal Search
+
+
+ perform a literal search on the series and return the first 50 results
+
+
+ Ctrl+Shift+L
+
+
+
+
+
+ :/graphics/open.png:/graphics/open.png
+
+
+ Open
+
+
+ Load comic archive
+
+
+ Ctrl+O
+
+
+
+
+
+ :/graphics/longbox.png:/graphics/longbox.png
+
+
+ Open Folder
+
+
+ Load folder containing comic archives
+
+
+ Ctrl+Shift+O
+
+
+
+
+ Show Log Window
+
+
+
+
+ Open Folder as a Comic
+
+
+ Load images from a folder as a single comic archive
+
+
+ Open Folder as a Comic
+
+
+ Ctrl+Alt+Shift+O
+
+
+
+
+
+ :/graphics/browse.png:/graphics/browse.png
+
+
+ Show Page Browser
+
+
+ Page Browser
+
+
+ Show the Page Browser
+
+
+ Show the Page Browser to inspect the comic
+
+
+ Ctrl+P
+
+
+
+
+
+ :/graphics/parse.png:/graphics/parse.png
+
+
+ Parse Filename
+
+
+ Parse metadata from filename
+
+
+ Ctrl+F
+
+
+
+
+
+ :/graphics/parse.png:/graphics/parse.png
+
+
+ Parse Filename and split words
+
+
+ Attempt to split words before parsing the filename (eg 'MonsterFunHalloweenSpooktacularSpecial.cbz' becomes 'Monster Fun Halloween Spook t acul ar Special.cbz')
+
+
+ Parse Filename and split words
+
+
+ Ctrl+Shift+F
+
+
+
+
+ Re-Calculate Page Dimensions
+
+
+ Ctrl+Shift+R
+
+
+
+
+ Remove Current 'Modify' tag(s)
+
+
+ Remove currently selected modify tag(s) from the archive
+
+
+ Ctrl+D
+
+
Remove Web Link
+
+ Remove Web Link
+
+
+
+
+ Rename
+
+
+ Ctrl+R
+
+
+
+
+ Export as Zip Archive
+
+
+ Ctrl+E
+
+
+
+
+ Report Bug...
+
+
+
+
+
+ :/graphics/search.png:/graphics/search.png
+
+
+ Search Online
+
+
+ Search Online
+
+
+ Alt+S
+
+
+
+
+ Settings...
+
+
+ Ctrl+Shift+S
+
+
+ QAction::PreferencesRole
+
+
+
+
+ Online Docs...
+
+
+ F1
+
+
+
+
+
+ :/graphics/save.png:/graphics/save.png
+
+
+ Save tag(s)
+
+
+ Write tag(s) to file
+
+
+ Ctrl+S
+
@@ -1563,7 +1710,9 @@ border-radius: 4px;
comictaggerlib.ui.customwidgets
-
+
+
+
btnAddWebLink
diff --git a/comictaggerlib/ui/talkeruigenerator.py b/comictaggerlib/ui/talkeruigenerator.py
index 7d3a88f..11a1daa 100644
--- a/comictaggerlib/ui/talkeruigenerator.py
+++ b/comictaggerlib/ui/talkeruigenerator.py
@@ -10,7 +10,6 @@ from PyQt5 import QtCore, QtGui, QtWidgets
from comictaggerlib.coverimagewidget import CoverImageWidget
from comictaggerlib.ctsettings import ct_ns, group_for_plugin
-from comictaggerlib.graphics import graphics_path
from comictalker.comictalker import ComicTalker
logger = logging.getLogger(__name__)
@@ -37,8 +36,8 @@ class PasswordEdit(QtWidgets.QLineEdit):
def __init__(self, show_visibility: bool = True, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
- self.visibleIcon = QtGui.QIcon(str(graphics_path / "eye.svg"))
- self.hiddenIcon = QtGui.QIcon(str(graphics_path / "hidden.svg"))
+ self.visibleIcon = QtGui.QIcon(":/graphics/eye.svg")
+ self.hiddenIcon = QtGui.QIcon(":/graphics/hidden.svg")
self.setEchoMode(QtWidgets.QLineEdit.Password)
diff --git a/pyproject.toml b/pyproject.toml
index a1cee20..fa5b7ac 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,10 +1,11 @@
[tool.black]
line-length = 120
force-exclude = "scripts"
+extend-exclude = "comictaggerlib/graphics/resources.py"
[tool.isort]
line_length = 120
-extend_skip = ["scripts"]
+extend_skip = ["scripts", "comictaggerlib/graphics/resources.py"]
profile = "black"
[build-system]
diff --git a/setup.cfg b/setup.cfg
index 35d2ca7..5e7489e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -242,6 +242,7 @@ deps =
extras =
all
commands =
+ pyrcc5 comictaggerlib/graphics/graphics.qrc -o comictaggerlib/graphics/resources.py
pyinstaller -y build-tools/comictagger.spec
python -c 'import importlib,platform; importlib.import_module("icu") if platform.system() != "Windows" else ...' # Sanity check for icu
@@ -312,6 +313,7 @@ per-file-ignores =
tests/*: L
[mypy]
+exclude = comictaggerlib/graphics/resources.py
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
@@ -329,3 +331,6 @@ check_untyped_defs = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
+
+[mypy-comictaggerlib.graphics.resources]
+ignore_errors = True