|
28 | 28 |
|
29 | 29 |
|
30 | 30 | from abc import abstractmethod |
31 | | -from buildVersion import version_detailed as NVDA_VERSION |
32 | 31 | from collections import OrderedDict |
33 | 32 | from dataclasses import dataclass |
34 | 33 | from enum import Enum, auto |
35 | 34 | import re |
36 | | -import sys |
37 | 35 | from typing import Any, Callable |
38 | 36 | import wx |
39 | 37 | import wx.lib.mixins.listctrl as listmix |
|
61 | 59 | # Fall back to wx.lib.scrolledpanel.ScrolledPanel which now has the fix built-in. |
62 | 60 | _TabbableScrolledPanel = getattr(nvdaControls, "TabbableScrolledPanel", ScrolledPanel) |
63 | 61 |
|
64 | | - |
65 | | -if sys.version_info[1] < 9: |
66 | | - from typing import Iterable, Mapping, Sequence, Set |
67 | | -else: |
68 | | - from collections.abc import Iterable, Mapping, Sequence, Set |
| 62 | +from collections.abc import Iterable, Mapping, Sequence, Set |
69 | 63 |
|
70 | 64 |
|
71 | 65 | addonHandler.initTranslation() |
@@ -256,7 +250,7 @@ def _buildGui(self): |
256 | 250 | self.SetSizer(self.mainSizer) |
257 | 251 |
|
258 | 252 |
|
259 | | -# TODO: Consider migrating to NVDA's SettingsDialog once we hit 2023.2 as minimum version |
| 253 | +# TODO: Consider migrating to NVDA's SettingsDialog |
260 | 254 | class ContextualDialog(ScalingMixin, wx.Dialog): |
261 | 255 |
|
262 | 256 | def initData(self, context): |
@@ -372,12 +366,9 @@ def configuredSettingsDialogType(hasApplyButton: bool) -> type(SettingsDialog): |
372 | 366 | class Type(SettingsDialog): |
373 | 367 |
|
374 | 368 | def __init__(self, *args, **kwargs): |
375 | | - if NVDA_VERSION < "2023.2": |
376 | | - kwargs["hasApplyButton"] = hasApplyButton |
377 | | - else: |
378 | | - buttons: Set[int] = kwargs.get("buttons", {wx.OK, wx.CANCEL}) |
379 | | - if not hasApplyButton: |
380 | | - buttons -= {wx.APPLY} |
| 369 | + buttons: Set[int] = kwargs.get("buttons", {wx.OK, wx.CANCEL}) |
| 370 | + if not hasApplyButton: |
| 371 | + buttons -= {wx.APPLY} |
381 | 372 | super().__init__(*args, **kwargs) |
382 | 373 |
|
383 | 374 | return Type |
|
0 commit comments