Skip to content

Commit

Permalink
Fix the issue of gui.SettingsPanel. Use github actions instead of app…
Browse files Browse the repository at this point in the history
…veyor.

Prepare for version 3.0.
  • Loading branch information
ibrahim-s committed Oct 19, 2023
1 parent a81827b commit fa0b21a
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 40 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build_addon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: build addon

on:
push:
tags: ["*"]
# To build on main/master branch, uncomment the following line:
branches: [ main , master ]

pull_request:
branches: [ main, master ]

workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- run: echo -e "pre-commit\nscons\nmarkdown">requirements.txt

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y gettext
- name: Code checks
run: export SKIP=no-commit-to-branch; pre-commit run --all

- name: building addon
run: scons

- uses: actions/upload-artifact@v3
with:
name: packaged_addon
path: ./*.nvda-addon

upload_release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: ["build"]
steps:
- uses: actions/checkout@v3
- name: download releases files
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R

- name: Release
uses: softprops/action-gh-release@v1
with:
files: packaged_addon/*.nvda-addon
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, '-') }}
4 changes: 2 additions & 2 deletions addon/doc/ar/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

المطوِّرون: Ibrahim Hamadeh, Cary Rowen, Belala Toufik
التوافقية مع إصدارات NVDA: 2018.3 فما فوق
تحميل [الإصدار 2.9][1]
تحميل [الإصدار 3.0][1]

هذه الإضافة تقوم باستخلاص الروابط إمّا مِن النص المحدد أو النص في الحافِظةأو آخِر نص منطوق.
و إظهارها في قاءمة في محاورة
Expand Down Expand Up @@ -82,4 +82,4 @@ Alt+/ هو الإختصار الإفتراضي, و لكنك دائما تستط

* الإصدار الأول.

[1]: https://github.com/ibrahim-s/openLinkWith/releases/download/v2.9/openLinkWith-2.9.nvda-addon
[1]: https://github.com/ibrahim-s/openLinkWith/releases/download/3.0/openLinkWith-3.0.nvda-addon
6 changes: 3 additions & 3 deletions addon/globalPlugins/openLinkWith/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, *args, **kwargs):
super(GlobalPlugin, self).__init__(*args, **kwargs)
LastSpoken._patch()

if hasattr(gui, 'SettingsPanel'):
if hasattr(gui.settingsDialogs, 'SettingsPanel'):
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.append(OpenLinkWithSettings)
else:
self.prefmenu= gui.mainFrame.sysTrayIcon.preferencesMenu
Expand All @@ -123,7 +123,7 @@ def onOpenSettingDialog(self, evt):

def terminate(self):
LastSpoken.terminate()
if hasattr(gui, 'SettingsPanel'):
if hasattr(gui.settingsDialogs, 'SettingsPanel'):
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.remove(OpenLinkWithSettings)
else:
try:
Expand Down Expand Up @@ -240,8 +240,8 @@ def script_workOnVirtualMenu(self, gesture):
}
config.conf.spec["openLinkWith"]= configspec

parentClass= gui.SettingsPanel if hasattr(gui, 'SettingsPanel') else gui.SettingsDialog
#make either SettingsPanel or SettingsDialog class
parentClass= gui.settingsDialogs.SettingsPanel if hasattr(gui.settingsDialogs, 'SettingsPanel') else gui.settingsDialogs.SettingsDialog
class OpenLinkWithSettings(parentClass):
# Translators: title of the dialog
title= _("Open link with")
Expand Down
32 changes: 0 additions & 32 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _(arg):
Press the command you assotiated with the addon via input gestures, to display OpenLinkWith dialog.
"""),
# version
"addon_version": "2.9",
"addon_version": "3.0",
# Author(s)
"addon_author": "Ibrahim Hamadeh <[email protected]>, Cary Rowen <[email protected]>, Belala Toufik<[email protected]>",
# URL for the add-on documentation support
Expand Down
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Authors: Ibrahim Hamadeh, Cary Rowen, Belala Toufik
NVDA compatibility: 2018.3 and beyond
Download [Version 2.9][1]
Download [Version 3.0][1]

This addon is used to extract links either from selected, clipboard, or last spoken text
display them in a list in a dialog
Expand Down Expand Up @@ -36,6 +36,11 @@ Lot of times, while reading a message encounter a link to github, the browser I

Alt+/ is the default gesture, but you can always change it through NVDA menu/Preferences/Input gestures/Open link with.

## Changes for 3.0 ##

* Fix the issue of gui.SettingsPanel, and get rid of warning messages in the log.
* Use github actions instead of apveyor to build the addon.

## Changes for 2.9 ##

* Add hyper link menu feature, to give you the option to open the link with other browsers.
Expand Down Expand Up @@ -84,4 +89,4 @@ So that we have the obtion to close the dialog after activating a link.

* Initial version.

[1]: https://github.com/ibrahim-s/openLinkWith/releases/download/v2.9/openLinkWith-2.9.nvda-addon
[1]: https://github.com/ibrahim-s/openLinkWith/releases/download/3.0/openLinkWith-3.0.nvda-addon

0 comments on commit fa0b21a

Please sign in to comment.