Skip to content

Commit

Permalink
Quality Check - truncate long titles on progress dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwidude68 committed Aug 6, 2023
1 parent 1dbd802 commit a8cae22
Show file tree
Hide file tree
Showing 8 changed files with 4,151 additions and 7 deletions.
7 changes: 7 additions & 0 deletions quality_check/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Quality Check Change Log

## [1.13.5] - 2023-08-06
### Added
- Latvian translation (ciepina)
- Russian translation (ashed)
### Fixed
- Truncate long book titles in progress dialog to ensure does not get oversized. (ownedbycats)

## [1.13.4] - 2023-04-02
### Fixed
- EPubCheck had typo when trying to log out missing book format (isarl)
Expand Down
2 changes: 1 addition & 1 deletion quality_check/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ActionQualityCheck(InterfaceActionBase):
description = 'Query your library for poor quality covers or invalid metadata'
supported_platforms = ['windows', 'osx', 'linux']
author = 'Grant Drake with updates by others'
version = (1, 13, 4)
version = (1, 13, 5)
minimum_calibre_version = (3, 41, 0)

#: This field defines the GUI plugin class that contains all the code
Expand Down
6 changes: 4 additions & 2 deletions quality_check/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from calibre_plugins.quality_check.common_icons import get_icon
from calibre_plugins.quality_check.common_widgets import ImageTitleLayout, ReadOnlyTableWidgetItem

def truncate_title(title, length = 75):
return (title[:length] + '...') if len(title) > length else title

class QualityProgressDialog(QProgressDialog):

Expand All @@ -56,7 +58,7 @@ def do_book_action(self):
book_id = self.book_ids[self.i]
self.i += 1

dtitle = self.db.title(book_id, index_is_id=True)
dtitle = truncate_title(self.db.title(book_id, index_is_id=True))
self.setWindowTitle(_('%s %d %s (%d matches)...') % (self.action_type, self.total_count, self.status_msg_type, len(self.result_ids)))
self.setLabelText('%s: %s'%(self.action_type, dtitle))
if self.callback_fn(book_id, self.db):
Expand Down Expand Up @@ -606,7 +608,7 @@ def do_book_check(self):
book_id = self.book_ids[self.i]
self.i += 1

title = self.db.title(book_id, index_is_id=True)
title = truncate_title(self.db.title(book_id, index_is_id=True))
self.setLabelText(_('Fixing')+': '+title)

# Call our callback FIX function to perform the work.
Expand Down
2 changes: 1 addition & 1 deletion quality_check/translations/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ msgstr ""
"POT-Creation-Date: 2022-11-06 15:31+0000\n"
"PO-Revision-Date: 2022-09-19 14:57+0000\n"
"Last-Translator: Jellby <jellby@yahoo.com>, 2022\n"
"Language-Team: Spanish (https://www.transifex.com/calibre/teams/19337/es/)\n"
"Language-Team: Spanish (https://app.transifex.com/calibre/teams/19337/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down

0 comments on commit a8cae22

Please sign in to comment.