Compare commits

..

8 Commits

3 changed files with 19 additions and 20 deletions

View File

@ -1,4 +1,4 @@
pipeline:
steps:
# tests:
# image: python:3
# commands:
@ -21,8 +21,10 @@ pipeline:
- pip install -U pip wheel hatch hatch-vcs
- hatch build
- hatch publish
secrets:
- hatch_pypi_user
- hatch_pypi_auth
environment:
HATCH_INDEX_USER:
from_secret: hatch_pypi_user
HATCH_INDEX_AUTH:
from_secret: hatch_pypi_auth
when:
event: tag

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))