diff --git a/appModules/msedge/__init__.py b/appModules/msedge/__init__.py index d2aea25..5c38cd2 100644 --- a/appModules/msedge/__init__.py +++ b/appModules/msedge/__init__.py @@ -3,39 +3,24 @@ # Released under GPL 2 import appModuleHandler -from collections import namedtuple import config import gui import wx - -Settings = namedtuple("Settings", "configKey, label, defaultValue") -settingItems = [ - Settings("PageLoading", _("Announce loading of pages"), "boolean(default=false)"), - Settings("RefreshingPage", _("Announce page refresh"), "boolean(default=false)"), - Settings("ClosingTab", _("Announce closing of tab"), "boolean(default=false)"), - Settings("OpeningNewTab", _("Announce Opening of new tab"), "boolean(default=false)"), - Settings("OpeningWindow", _("Announce window opening"), "boolean(default=false)"), - Settings("HubDownloadsNewDownload", _("Announce starting file download"), "boolean(default=true)"), - Settings("HubDownloadsCompleteState", _("Announce download completion"), "boolean(default=true)"), - Settings("GoingBack", _("Announce navigating back"), "boolean(default=false)"), - Settings("ToolbarButtonRemoved", _("Announce removing toolbar buttons"), "boolean(default=false)"), - Settings("SearchMode", _("Announce of search mode"), "boolean(default=false)"), - Settings("SearchModeAvailable", _("Announce availability of search mode"), "boolean(default=false)"), - ] - +from .settings import settingItems + config.conf.spec["MSEdgeDiscardAnnouncements"] = {setting.configKey: setting.defaultValue for setting in settingItems} class AppModule(appModuleHandler.AppModule): activityIDs = [] def __init__(self, processID, appName): - super(AppModule, self).__init__(processID, appName) + super().__init__(processID, appName) categoryClasses = gui.settingsDialogs.NVDASettingsDialog.categoryClasses if not (MSEdgeDiscardAnnouncementsPanel in categoryClasses): categoryClasses.append(MSEdgeDiscardAnnouncementsPanel) def terminate(self): - super(AppModule, self).terminate() + super().terminate() gui.settingsDialogs.NVDASettingsDialog.categoryClasses.remove(MSEdgeDiscardAnnouncementsPanel) def getActivityIDsFromConfig(self): diff --git a/appModules/msedge/settings.py b/appModules/msedge/settings.py new file mode 100644 index 0000000..6b7d579 --- /dev/null +++ b/appModules/msedge/settings.py @@ -0,0 +1,16 @@ +from collections import namedtuple + +Settings = namedtuple("Settings", "configKey, label, defaultValue") +settingItems = [ + Settings("PageLoading", _("Announce loading of pages"), "boolean(default=false)"), + Settings("RefreshingPage", _("Announce page refresh"), "boolean(default=false)"), + Settings("ClosingTab", _("Announce closing of tab"), "boolean(default=false)"), + Settings("OpeningNewTab", _("Announce Opening of new tab"), "boolean(default=false)"), + Settings("OpeningWindow", _("Announce window opening"), "boolean(default=false)"), + Settings("HubDownloadsNewDownload", _("Announce starting file download"), "boolean(default=true)"), + Settings("HubDownloadsCompleteState", _("Announce download completion"), "boolean(default=true)"), + Settings("GoingBack", _("Announce navigating back"), "boolean(default=false)"), + Settings("ToolbarButtonRemoved", _("Announce removing toolbar buttons"), "boolean(default=false)"), + Settings("SearchMode", _("Announce of search mode"), "boolean(default=false)"), + Settings("SearchModeAvailable", _("Announce availability of search mode"), "boolean(default=false)") +] diff --git a/manifest.ini b/manifest.ini index 444e8fd..ae069a7 100644 --- a/manifest.ini +++ b/manifest.ini @@ -1,6 +1,6 @@ name = MSEdgeDiscardAnnouncements summary = Microsoft Edge discard announcements -version = 0.3 +version = 0.4 author = """Beqa Gozalishvili """ description = """Discards UIA announcements in Microsoft Edge such as page loading and refreshing, opening and closing tabs and windows.""" url = https://gozaltech.org