61 |
61 |
62 PluginStatusUpToDate = 0 |
62 PluginStatusUpToDate = 0 |
63 PluginStatusNew = 1 |
63 PluginStatusNew = 1 |
64 PluginStatusLocalUpdate = 2 |
64 PluginStatusLocalUpdate = 2 |
65 PluginStatusRemoteUpdate = 3 |
65 PluginStatusRemoteUpdate = 3 |
|
66 PluginStatusError = 4 |
66 |
67 |
67 def __init__(self, pluginManager, parent=None): |
68 def __init__(self, pluginManager, parent=None): |
68 """ |
69 """ |
69 Constructor |
70 Constructor |
70 |
71 |
634 self.__updateLocalItems += 1 |
635 self.__updateLocalItems += 1 |
635 elif updateStatus == PluginRepositoryWidget.PluginStatusRemoteUpdate: |
636 elif updateStatus == PluginRepositoryWidget.PluginStatusRemoteUpdate: |
636 itm.setIcon(1, UI.PixmapCache.getIcon("updateRemote.png")) |
637 itm.setIcon(1, UI.PixmapCache.getIcon("updateRemote.png")) |
637 itm.setToolTip(1, self.tr("updated download available")) |
638 itm.setToolTip(1, self.tr("updated download available")) |
638 self.__updateRemoteItems += 1 |
639 self.__updateRemoteItems += 1 |
|
640 elif updateStatus == PluginRepositoryWidget.PluginStatusError: |
|
641 itm.setIcon(1, UI.PixmapCache.getIcon("warning.png")) |
|
642 itm.setToolTip(1, self.tr("error determining status")) |
639 |
643 |
640 def __updateStatus(self, filename, version): |
644 def __updateStatus(self, filename, version): |
641 """ |
645 """ |
642 Private method to check the given archive update status. |
646 Private method to check the given archive update status. |
643 |
647 |
658 pluginName = filename.rsplit('-', 1)[0] |
662 pluginName = filename.rsplit('-', 1)[0] |
659 pluginDetails = self.__pluginManager.getPluginDetails(pluginName) |
663 pluginDetails = self.__pluginManager.getPluginDetails(pluginName) |
660 if pluginDetails is None or \ |
664 if pluginDetails is None or \ |
661 pluginDetails["moduleName"] != pluginName: |
665 pluginDetails["moduleName"] != pluginName: |
662 return PluginRepositoryWidget.PluginStatusNew |
666 return PluginRepositoryWidget.PluginStatusNew |
|
667 if pluginDetails["error"]: |
|
668 return PluginRepositoryWidget.PluginStatusError |
663 pluginVersionTuple = Globals.versionToTuple( |
669 pluginVersionTuple = Globals.versionToTuple( |
664 pluginDetails["version"])[:3] |
670 pluginDetails["version"])[:3] |
665 versionTuple = Globals.versionToTuple(version)[:3] |
671 versionTuple = Globals.versionToTuple(version)[:3] |
666 if pluginVersionTuple < versionTuple: |
672 if pluginVersionTuple < versionTuple: |
667 return PluginRepositoryWidget.PluginStatusRemoteUpdate |
673 return PluginRepositoryWidget.PluginStatusRemoteUpdate |