@@ -110,17 +110,15 @@ def _displayStringLabels(self) -> Dict["AvailableAddonStatus", str]:
110110 self .PENDING_DISABLE : pgettext ("addonStore" , "Disabled, pending restart" ),
111111 # Translators: Status for addons shown in the add-on store dialog
112112 self .DISABLED : pgettext ("addonStore" , "Disabled" ),
113+ # Translators: Status for addons shown in the add-on store dialog
113114 self .PENDING_INCOMPATIBLE_DISABLED : pgettext (
114- "addonStore" ,
115- # Translators: Status for addons shown in the add-on store dialog
116- "Disabled (incompatible), pending restart" ,
115+ "addonStore" , "Disabled (incompatible), pending restart"
117116 ),
118117 # Translators: Status for addons shown in the add-on store dialog
119118 self .INCOMPATIBLE_DISABLED : pgettext ("addonStore" , "Disabled (incompatible)" ),
119+ # Translators: Status for addons shown in the add-on store dialog
120120 self .PENDING_INCOMPATIBLE_ENABLED : pgettext (
121- "addonStore" ,
122- # Translators: Status for addons shown in the add-on store dialog
123- "Enabled (incompatible), pending restart" ,
121+ "addonStore" , "Enabled (incompatible), pending restart"
124122 ),
125123 # Translators: Status for addons shown in the add-on store dialog
126124 self .INCOMPATIBLE_ENABLED : pgettext ("addonStore" , "Enabled (incompatible)" ),
@@ -166,9 +164,11 @@ class _StatusFilterKey(DisplayStringEnum):
166164 UPDATE = enum .auto ()
167165 AVAILABLE = enum .auto ()
168166 INCOMPATIBLE = enum .auto ()
167+ NEW = enum .auto ()
169168
170169 @property
171170 def _displayStringLabels (self ) -> Dict ["_StatusFilterKey" , str ]:
171+ resetNewAddonsDate = getResetNewAddonsDate ()
172172 return {
173173 # Translators: The label of a tab to display installed add-ons in the add-on store.
174174 # Ensure the translation matches the label for the add-on list which includes an accelerator key.
@@ -182,6 +182,9 @@ def _displayStringLabels(self) -> Dict["_StatusFilterKey", str]:
182182 # Translators: The label of a tab to display incompatible add-ons in the add-on store.
183183 # Ensure the translation matches the label for the add-on list which includes an accelerator key.
184184 self .INCOMPATIBLE : pgettext ("addonStore" , "Installed incompatible add-ons" ),
185+ # Translators: The label of a tab to display new add-ons in the add-on store.
186+ # Ensure the translation matches the label for the add-on list which includes an accelerator key.
187+ self .NEW : pgettext ("addonStore" , "Available new add-ons (%s)" % resetNewAddonsDate ),
185188 }
186189
187190 @property
@@ -203,6 +206,10 @@ def _displayStringLabelsWithAccelerators(self) -> Dict["_StatusFilterKey", str]:
203206 # Preferably use the same accelerator key for the four labels.
204207 # Ensure the translation matches the label for the add-on tab which has the accelerator key removed.
205208 self .INCOMPATIBLE : pgettext ("addonStore" , "Installed incompatible &add-ons" ),
209+ # Translators: The label of the add-ons list in the corresponding panel.
210+ # Preferably use the same accelerator key for the four labels.
211+ # Ensure the translation matches the label for the add-on tab which has the accelerator key removed.
212+ self .NEW : pgettext ("addonStore" , "Available new &add-ons" ),
206213 }
207214
208215 @property
@@ -268,7 +275,7 @@ def _getUpdateStatus(model: "_AddonGUIModel") -> Optional[AvailableAddonStatus]:
268275 # Parsing from a side-loaded add-on
269276 try :
270277 manifestAddonVersion = MajorMinorPatch ._parseVersionFromVersionStr (
271- model ._addonHandlerModel .version ,
278+ model ._addonHandlerModel .version
272279 )
273280 except ValueError :
274281 # Parsing failed to get a numeric version.
@@ -324,7 +331,7 @@ def getStatus(model: "_AddonGUIModel", context: _StatusFilterKey) -> AvailableAd
324331 :return: Status of add-on for the context of the current tab.
325332 """
326333
327- if context in (_StatusFilterKey .AVAILABLE , _StatusFilterKey .UPDATE ):
334+ if context in (_StatusFilterKey .AVAILABLE , _StatusFilterKey .UPDATE , _StatusFilterKey . NEW ):
328335 downloadableStatus = _getDownloadableStatus (model )
329336 if downloadableStatus :
330337 # Is this available in the add-on store and not installed?
@@ -344,10 +351,7 @@ def getStatus(model: "_AddonGUIModel", context: _StatusFilterKey) -> AvailableAd
344351 return AvailableAddonStatus .UNKNOWN
345352
346353
347- _addonStoreStateToAddonHandlerState : OrderedDict [
348- AvailableAddonStatus ,
349- Set [AddonStateCategory ],
350- ] = OrderedDict (
354+ _addonStoreStateToAddonHandlerState : OrderedDict [AvailableAddonStatus , Set [AddonStateCategory ]] = OrderedDict (
351355 {
352356 # Pending states must be first as the pending state may be altering another state.
353357 AvailableAddonStatus .PENDING_INCOMPATIBLE_DISABLED : {
@@ -371,7 +375,7 @@ def getStatus(model: "_AddonGUIModel", context: _StatusFilterKey) -> AvailableAd
371375 AvailableAddonStatus .INCOMPATIBLE_ENABLED : {AddonStateCategory .OVERRIDE_COMPATIBILITY },
372376 AvailableAddonStatus .DISABLED : {AddonStateCategory .DISABLED },
373377 AvailableAddonStatus .INSTALLED : {AddonStateCategory .PENDING_INSTALL },
374- },
378+ }
375379)
376380
377381
@@ -423,7 +427,7 @@ def getStatus(model: "_AddonGUIModel", context: _StatusFilterKey) -> AvailableAd
423427 {
424428 AvailableAddonStatus .INCOMPATIBLE ,
425429 AvailableAddonStatus .AVAILABLE ,
426- },
430+ }
427431 ),
428432 _StatusFilterKey .INCOMPATIBLE : {
429433 AvailableAddonStatus .PENDING_INCOMPATIBLE_DISABLED ,
@@ -432,13 +436,20 @@ def getStatus(model: "_AddonGUIModel", context: _StatusFilterKey) -> AvailableAd
432436 AvailableAddonStatus .INCOMPATIBLE_ENABLED ,
433437 AvailableAddonStatus .UNKNOWN ,
434438 },
435- },
439+ _StatusFilterKey .NEW : _installingStatuses .union ({AvailableAddonStatus .AVAILABLE }),
440+ }
436441)
437442"""A dictionary where the keys are a status to filter by,
438443and the values are which statuses should be shown for a given filter.
439444"""
440445
441446
447+ def getResetNewAddonsDate () -> str :
448+ from ..dataManager import addonDataManager
449+
450+ return addonDataManager ._getResetNewAddonsDate ()
451+
452+
442453class SupportsAddonState (SupportsVersionCheck , Protocol ):
443454 @property
444455 def _stateHandler (self ) -> "AddonsState" :
@@ -458,17 +469,11 @@ def isRunning(self) -> bool:
458469 def pendingInstallPath (self ) -> str :
459470 from addonHandler import ADDON_PENDINGINSTALL_SUFFIX
460471
461- return os .path .join (
462- WritePaths .addonsDir ,
463- self .name + ADDON_PENDINGINSTALL_SUFFIX ,
464- )
472+ return os .path .join (WritePaths .addonsDir , self .name + ADDON_PENDINGINSTALL_SUFFIX )
465473
466474 @property
467475 def installPath (self ) -> str :
468- return os .path .join (
469- WritePaths .addonsDir ,
470- self .name ,
471- )
476+ return os .path .join (WritePaths .addonsDir , self .name )
472477
473478 @property
474479 def isPendingInstall (self ) -> bool :
0 commit comments