mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix tertiary updates being notified if the current primary.secondary version is less than the released primary.secondary
This commit is contained in:
parent
66be8fe65d
commit
d91585c7dc
@ -101,6 +101,12 @@ class CheckForUpdates(Thread):
|
|||||||
self.shutdown_event.set()
|
self.shutdown_event.set()
|
||||||
|
|
||||||
|
|
||||||
|
def version_key(calibre_version):
|
||||||
|
if calibre_version.count('.') > 1:
|
||||||
|
calibre_version = calibre_version.rpartition('.')[0]
|
||||||
|
return 'update to version %s' % calibre_version
|
||||||
|
|
||||||
|
|
||||||
class UpdateNotification(QDialog):
|
class UpdateNotification(QDialog):
|
||||||
|
|
||||||
def __init__(self, calibre_version, plugin_updates, parent=None):
|
def __init__(self, calibre_version, plugin_updates, parent=None):
|
||||||
@ -143,7 +149,7 @@ class UpdateNotification(QDialog):
|
|||||||
self.l.addWidget(self.bb, 2, 0, 1, -1)
|
self.l.addWidget(self.bb, 2, 0, 1, -1)
|
||||||
self.bb.accepted.connect(self.accept)
|
self.bb.accepted.connect(self.accept)
|
||||||
self.bb.rejected.connect(self.reject)
|
self.bb.rejected.connect(self.reject)
|
||||||
dynamic.set('update to version %s'%calibre_version, False)
|
dynamic.set(version_key(calibre_version), False)
|
||||||
|
|
||||||
def get_plugins(self):
|
def get_plugins(self):
|
||||||
from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
|
from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
|
||||||
@ -208,8 +214,7 @@ class UpdateMixin(object):
|
|||||||
self.status_bar.update_label.setVisible(True)
|
self.status_bar.update_label.setVisible(True)
|
||||||
|
|
||||||
if has_calibre_update:
|
if has_calibre_update:
|
||||||
if (force or (config.get('new_version_notification') and dynamic.get(
|
if (force or (config.get('new_version_notification') and dynamic.get(version_key(calibre_version), True))):
|
||||||
'update to version %s'%calibre_version, True))):
|
|
||||||
if not no_show_popup:
|
if not no_show_popup:
|
||||||
self._update_notification__ = UpdateNotification(calibre_version,
|
self._update_notification__ = UpdateNotification(calibre_version,
|
||||||
number_of_plugin_updates, parent=self)
|
number_of_plugin_updates, parent=self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user