Compare commits

..

6 Commits

Author SHA1 Message Date
b96e08436f Merge pull request 'Remove deprecated canMinimizeToTray option' (#13) from remove-deprecated-option into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #13
2024-09-27 17:33:07 +00:00
46fc044b5c Remove deprecated canMinimizeToTray option
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
2024-09-27 12:24:13 -05:00
e9a599dfd8 Merge pull request 'Fix other issues arising from the migration' (#12) from fix-other-migration-issues into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/release/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
Reviewed-on: #12
2024-09-27 16:59:46 +00:00
a4fa4bf6ba Fix other issues arising from the migration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
2024-09-27 11:52:05 -05:00
dda00bace0 Merge pull request 'Update the README' (#11) from update-readme into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #11
2024-09-27 16:32:32 +00:00
49fd14d7c2 Update the README
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
2024-09-27 11:30:23 -05:00
2 changed files with 13 additions and 16 deletions

View File

@ -3,8 +3,8 @@ WebAppify
|pypi| |license| |build|
WebAppify is a simple module to easily create your own desktop apps of websites. WebAppify uses PyQt5 and QtWebEngine
for displaying the web page, and works on Python 3.8 and up.
WebAppify is a simple module to easily create your own desktop apps of websites. WebAppify uses PySide6 and QtWebEngine
for displaying the web page, and works on Python 3.10 and up.
To create your own desktop web app, import and set up the WebApp class.
@ -19,8 +19,7 @@ This will create a window with the website, using the icon provided.
.. note::
If your site needs Flash Player, you'll need the appropriate Flash Player plugin installed system-wide. For QtWebKit
you will need the NPAPI plugin, and for QtWebEngine you will need the PPAPI plugin.
If your site needs Flash Player, you'll need the appropriate Flash Player plugin installed system-wide.
Additional Options
------------------
@ -28,11 +27,6 @@ Additional Options
``can_minimize_to_tray``
''''''''''''''''''''''''
.. important::
This option was changed in version 0.4.0 from ``canMinimizeToTray`` to ``can_minimize_to_tray``. The old option
is still available, but is deprecated. It will be removed in 0.5.0.
To install a system tray icon, and minimize your application to the system tray, simply pass
``can_minimize_to_tray=True`` to the class and a tray icon will be installed with the necessary menu options.
@ -42,6 +36,10 @@ To install a system tray icon, and minimize your application to the system tray,
Clicking on the tray icon will show the window, while right-clicking will show the menu.
.. note::
The `canMinimizeToTray` version of this option was removed in 0.6.0
.. |pypi| image:: https://img.shields.io/pypi/v/WebAppify
:target: https://pypi.org/project/webappify/
.. |license| image:: https://img.shields.io/pypi/l/WebAppify

View File

@ -118,13 +118,13 @@ class WebWindow(QtWidgets.QWidget):
Create and return the menu for the tray icon
"""
# Create the actions for the menu
self.restore_action = QtWidgets.QAction('&Restore', self)
self.restore_action = QtGui.QAction('&Restore', self)
self.restore_action.triggered.connect(self._restore_window)
self.minimize_action = QtWidgets.QAction('Mi&nimize', self)
self.minimize_action = QtGui.QAction('Mi&nimize', self)
self.minimize_action.triggered.connect(self.close)
self.maximize_action = QtWidgets.QAction('Ma&ximize', self)
self.maximize_action = QtGui.QAction('Ma&ximize', self)
self.maximize_action.triggered.connect(self._maximize_window)
self.quit_action = QtWidgets.QAction('&Quit', self)
self.quit_action = QtGui.QAction('&Quit', self)
self.quit_action.triggered.connect(self.app.quit)
# Create the menu and add the actions
tray_icon_menu = QtWidgets.QMenu(self)
@ -209,7 +209,7 @@ class WebApp(QtWidgets.QApplication):
"""
A generic application to open a web page in a desktop app
"""
def __init__(self, title, url, icon, can_minimize_to_tray=False, canMinimizeToTray=False):
def __init__(self, title, url, icon, can_minimize_to_tray=False):
"""
Create an application which loads a URL into a window
"""
@ -219,8 +219,7 @@ class WebApp(QtWidgets.QApplication):
self.title = title
self.url = url
self.icon = icon
self.can_minimize_to_tray = QtWidgets.QSystemTrayIcon.isSystemTrayAvailable() and \
(can_minimize_to_tray or canMinimizeToTray)
self.can_minimize_to_tray = QtWidgets.QSystemTrayIcon.isSystemTrayAvailable() and can_minimize_to_tray
if self.can_minimize_to_tray:
self.setQuitOnLastWindowClosed(False)
self.setWindowIcon(QtGui.QIcon(self.icon))