-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace checkboxes with CheckListbox.
Add a donation module. It is now possible to suppress suggestion list while typing in the address bar. NVDA 2023.1 compatibility.
- Loading branch information
1 parent
7e67939
commit 2c7b208
Showing
6 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#donatedialog.py | ||
# Copyright (C) 2022-2023 Beqa Gozalishvili <[email protected]> | ||
#This file is covered by the GNU General Public License. | ||
#See the file COPYING for more details. | ||
|
||
import addonHandler | ||
import gui | ||
import webbrowser | ||
import wx | ||
|
||
addonHandler.initTranslation() | ||
|
||
|
||
class DonationDialog(gui.nvdaControls.MessageDialog): | ||
YOOMONEY_URL = "https://yoomoney.ru/to/4100117727255296" | ||
PAYPAL_URL = "https://paypal.me/gozaltech" | ||
|
||
def __init__(self, parent, title, message): | ||
super().__init__(parent, title, message, dialogType=gui.nvdaControls.MessageDialog.DIALOG_TYPE_WARNING) | ||
|
||
def _addButtons(self, buttonHelper): | ||
paypalBtn = buttonHelper.addButton(self, label=_("Donate via Paypal"), name="PAYPAL_URL") | ||
yoomoneyBtn = buttonHelper.addButton(self, label=_("Donate via Yoomoney"), name="YOOMONEY_URL") | ||
paypalBtn.Bind(wx.EVT_BUTTON, self.onDonate) | ||
yoomoneyBtn.Bind(wx.EVT_BUTTON, self.onDonate) | ||
cancelBtn = buttonHelper.addButton(self, id=wx.ID_CANCEL) | ||
cancelBtn.Bind(wx.EVT_BUTTON, lambda evt: self.EndModal(wx.CANCEL)) | ||
|
||
def onDonate(self, evt): | ||
donateBtn = evt.GetEventObject() | ||
donateUrl = getattr(self, donateBtn.Name) | ||
webbrowser.open(donateUrl) | ||
self.EndModal(wx.OK) | ||
|
||
def requestDonations(addonName, parentWindow): | ||
title = _("Request for contributions to {name}").format(name=addonName) | ||
message = _("{name} is a free add-on for NVDA.\n" | ||
"You can make a donation to its author to support further development of this and other free projects.\n" | ||
"Do you want to donate now? Choose one of the available payment methods. You will be redirected to the corresponding website to complete a donation").format(name=addonName) | ||
return DonationDialog(parentWindow, title, message).ShowModal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import addonHandler | ||
import gui | ||
import os.path | ||
import sys | ||
|
||
addon = addonHandler.getCodeAddon() | ||
addonName = addon.name | ||
addonDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "appModules", "msedge")) | ||
sys.path.append(addonDir) | ||
from donate_dialog import requestDonations | ||
sys.path.remove(sys.path[-1]) | ||
import wx | ||
|
||
addonHandler.initTranslation() | ||
|
||
def onInstall(): | ||
gui.mainFrame.prePopup() | ||
wx.CallAfter(requestDonations, addonName, gui.mainFrame) | ||
gui.mainFrame.postPopup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ def _(arg): | |
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager | ||
"addon_description": _("""Discards UIA announcements in Microsoft Edge such as page loading and refreshing, opening and closing tabs and windows."""), | ||
# version | ||
"addon_version": "0.7", | ||
"addon_version": "0.8", | ||
# Author(s) | ||
"addon_author": "Beqa Gozalishvili <[email protected]>", | ||
# URL for the add-on documentation support | ||
|
@@ -35,7 +35,7 @@ def _(arg): | |
# Minimum NVDA version supported (e.g. "2018.3.0", minor version is optional) | ||
"addon_minimumNVDAVersion": "2019.3.0", | ||
# Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version) | ||
"addon_lastTestedNVDAVersion": "2022.2.0", | ||
"addon_lastTestedNVDAVersion": "2023.1.0", | ||
# Add-on update channel (default is None, denoting stable releases, | ||
# and for development releases, use "dev".) | ||
# Do not change unless you know what you are doing! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters