mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix the progress labels close to 100%
This commit is contained in:
parent
152145e1ad
commit
6e86eb53f3
@ -60,10 +60,11 @@ class FTSDialog(Dialog):
|
||||
except Exception:
|
||||
self.indexing_label.setVisible(False)
|
||||
else:
|
||||
if p < 100:
|
||||
t = _('Indexing is only {0:.0%} done').format(p)
|
||||
if p < 1:
|
||||
q = f'{p:.0%}'
|
||||
t = _('Indexing is almost complete') if q == '100%' else _('Indexing is only {} done').format(q)
|
||||
ss = ''
|
||||
if p < 90:
|
||||
if p < 0.9:
|
||||
ss = 'QLabel { color: red }'
|
||||
self.indexing_label.setStyleSheet(ss)
|
||||
self.indexing_label.setText(t)
|
||||
|
@ -103,8 +103,11 @@ class ScanProgress(QWidget):
|
||||
self.switch_anyway.setText(_('Start &searching'))
|
||||
else:
|
||||
done = total - left
|
||||
t = _('{0} of {1} book files, {2:.0%} have been indexed').format(
|
||||
done, total, done / (total or 1))
|
||||
p = done / (total or 1)
|
||||
p = f'{p:.0%}'
|
||||
if p == '100%':
|
||||
p = _('almost 100%')
|
||||
t = _('{0} of {1} book files, {2} have been indexed').format(done, total, p)
|
||||
self.warn_label.setVisible(True)
|
||||
self.switch_anyway.setIcon(QIcon.ic('dialog_warning.png'))
|
||||
self.switch_anyway.setText(_('Start &searching even with incomplete indexing'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user