From 5d66815765ca5496590beb723040aca63bf2fb85 Mon Sep 17 00:00:00 2001 From: Mizaki Date: Fri, 20 Jan 2023 00:29:02 +0000 Subject: [PATCH] Add attrib string for source. Add logo and URL to issues window. --- comictaggerlib/issueselectionwindow.py | 17 +++++ comictaggerlib/seriesselectionwindow.py | 2 +- comictaggerlib/ui/issueselectionwindow.ui | 88 ++++++++++++++++++----- comictalker/talkerbase.py | 2 + comictalker/talkers/comicvine.py | 1 + 5 files changed, 91 insertions(+), 19 deletions(-) diff --git a/comictaggerlib/issueselectionwindow.py b/comictaggerlib/issueselectionwindow.py index fc48fc2..0f04800 100644 --- a/comictaggerlib/issueselectionwindow.py +++ b/comictaggerlib/issueselectionwindow.py @@ -76,6 +76,23 @@ class IssueSelectionWindow(QtWidgets.QDialog): self.url_fetch_thread = None self.issue_list: list[ComicIssue] = [] + # Display talker logo and set url + self.lblIssuesSourceName.setText( + f'{talker_api.static_options.attribution_string} {talker_api.source_details.name}' + ) + + self.imageIssuesSourceWidget = CoverImageWidget( + self.imageIssuesSourceLogo, + CoverImageWidget.URLMode, + options.runtime_config.user_cache_dir, + talker_api, + False, + ) + gridlayoutIssuesSourceLogo = QtWidgets.QGridLayout(self.imageIssuesSourceLogo) + gridlayoutIssuesSourceLogo.addWidget(self.imageIssuesSourceWidget) + gridlayoutIssuesSourceLogo.setContentsMargins(0, 2, 0, 0) + self.imageIssuesSourceWidget.set_url(talker_api.source_details.logo) + if issue_number is None or issue_number == "": self.issue_number = "1" else: diff --git a/comictaggerlib/seriesselectionwindow.py b/comictaggerlib/seriesselectionwindow.py index 7fc512d..05bcc84 100644 --- a/comictaggerlib/seriesselectionwindow.py +++ b/comictaggerlib/seriesselectionwindow.py @@ -163,7 +163,7 @@ class SeriesSelectionWindow(QtWidgets.QDialog): # Display talker logo and set url self.lblSourceName.setText( - f'Data Source: {talker_api.source_details.name}' + f'{talker_api.static_options.attribution_string} {talker_api.source_details.name}' ) self.imageSourceWidget = CoverImageWidget( diff --git a/comictaggerlib/ui/issueselectionwindow.ui b/comictaggerlib/ui/issueselectionwindow.ui index 8e3845c..2362f9c 100644 --- a/comictaggerlib/ui/issueselectionwindow.ui +++ b/comictaggerlib/ui/issueselectionwindow.ui @@ -7,7 +7,7 @@ 0 0 872 - 550 + 670 @@ -74,9 +74,6 @@ Title - - AlignCenter - @@ -93,20 +90,75 @@ - - - - 300 - 450 - - - - - 300 - 450 - - - + + + + + + 300 + 450 + + + + + 300 + 450 + + + + + + + + + 0 + 0 + + + + 2 + + + 1 + + + Qt::Horizontal + + + + + + + + 300 + 16777215 + + + + Data Source: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 300 + 100 + + + + + 300 + 16777215 + + + + + diff --git a/comictalker/talkerbase.py b/comictalker/talkerbase.py index 7e87304..fcd7be6 100644 --- a/comictalker/talkerbase.py +++ b/comictalker/talkerbase.py @@ -40,6 +40,7 @@ class SourceStaticOptions: def __init__( self, website: str = "", + attribution_string: str = "", # Website link will be added after this text using source_details.name has_issues: bool = False, has_alt_covers: bool = False, requires_apikey: bool = False, @@ -47,6 +48,7 @@ class SourceStaticOptions: has_censored_covers: bool = False, ) -> None: self.website = website + self.attribution_string = attribution_string self.has_issues = has_issues self.has_alt_covers = has_alt_covers self.requires_apikey = requires_apikey diff --git a/comictalker/talkers/comicvine.py b/comictalker/talkers/comicvine.py index 46be864..f10e7c9 100644 --- a/comictalker/talkers/comicvine.py +++ b/comictalker/talkers/comicvine.py @@ -174,6 +174,7 @@ class ComicVineTalker(ComicTalker): ) self.static_options = SourceStaticOptions( website="https://comicvine.gamespot.com/", + attribution_string="Data Source:", has_issues=True, has_alt_covers=True, requires_apikey=True,