frontengine 0.0.68__py3-none-any.whl → 0.0.70__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
  from PySide6.QtCore import Qt, QUrl
5
5
  from PySide6.QtGui import QIcon, QAction
6
6
  from PySide6.QtWebEngineWidgets import QWebEngineView
7
- from PySide6.QtWidgets import QMessageBox
7
+ from PySide6.QtWidgets import QMessageBox, QMenu
8
8
 
9
9
  from frontengine.utils.multi_language.language_wrapper import language_wrapper
10
10
 
@@ -13,6 +13,8 @@ class WebWidget(QWebEngineView):
13
13
 
14
14
  def __init__(self, url: str, is_file: bool = False):
15
15
  super().__init__()
16
+ self.menu = None
17
+ self.close_action = None
16
18
  self.opacity: float = 0.2
17
19
  self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
18
20
  if not is_file:
@@ -36,10 +38,12 @@ class WebWidget(QWebEngineView):
36
38
  self.setWindowIcon(QIcon(str(self.icon_path)))
37
39
 
38
40
  def contextMenuEvent(self, event):
39
- self.menu = self.createStandardContextMenu()
40
- self.close_action = QAction("Close")
41
- self.close_action.triggered.connect(self.close)
42
- self.menu.addAction(self.close_action)
41
+ if self.close_action is None:
42
+ self.close_action = QAction("Close")
43
+ self.close_action.triggered.connect(self.close)
44
+ if self.menu is None:
45
+ self.menu = QMenu(self)
46
+ self.menu.addAction(self.close_action)
43
47
  self.menu.popup(event.globalPos())
44
48
 
45
49
  def set_ui_variable(self, opacity: float = 0.2) -> None:
frontengine/ui/main_ui.py CHANGED
@@ -31,10 +31,11 @@ FrontEngine_EXTEND_TAB: Dict[str, Type[QWidget]] = {}
31
31
 
32
32
  class FrontEngineMainUI(QMainWindow):
33
33
 
34
- def __init__(self, debug: bool = False, show_system_tray_ray: bool = True):
34
+ def __init__(self, main_app: QApplication = None, debug: bool = False, show_system_tray_ray: bool = True):
35
35
  super().__init__()
36
36
  # User setting
37
37
  self.id = "FrontEngine"
38
+ self.main_app = main_app
38
39
  QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling)
39
40
  if sys.platform in ["win32", "cygwin", "msys"]:
40
41
  from ctypes import windll
@@ -150,7 +151,8 @@ class FrontEngineMainUI(QMainWindow):
150
151
  self.sound_player_setting_ui.sound_widget_list.clear()
151
152
  self.text_setting_ui.text_widget_list.clear()
152
153
  super().close()
153
- QCoreApplication.exit(0)
154
+ if self.main_app:
155
+ self.main_app.exit(0)
154
156
 
155
157
  @classmethod
156
158
  def debug_close(cls):
@@ -159,7 +161,7 @@ class FrontEngineMainUI(QMainWindow):
159
161
 
160
162
  def start_front_engine(debug: bool = False) -> None:
161
163
  main_app = QApplication(sys.argv)
162
- window = FrontEngineMainUI(debug=debug)
164
+ window = FrontEngineMainUI(main_app=main_app, debug=debug)
163
165
  try:
164
166
  window.startup_setting()
165
167
  except Exception as error:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frontengine
3
- Version: 0.0.68
3
+ Version: 0.0.70
4
4
  Summary: FrontEngine is BingGPT that can use-define front end or only use like screen saver
5
5
  Author-email: JE-Chen <jechenmailman@gmail.com>
6
6
  License: MIT
@@ -26,11 +26,11 @@ frontengine/show/text/draw_text.py,sha256=7uXWXDVU6TE5sfQ52bXCNkl0uBIR3dku7xyZPK
26
26
  frontengine/show/video/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  frontengine/show/video/video_player.py,sha256=ndiMp4nNvxJ3cpuBw_qvtbdm8dnwdm7Jnxl3ke0i0ZU,3360
28
28
  frontengine/show/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- frontengine/show/web/webview.py,sha256=2-7HW395Fp0SZnjUcrTGW-AWk_5OAAyzgjoXnnPpQoE,2842
29
+ frontengine/show/web/webview.py,sha256=KBu68YCjXDMhd4Y_dN5rILD7YQOo5H-t6v6KafB0Z4I,2974
30
30
  frontengine/system_tray/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  frontengine/system_tray/extend_system_tray.py,sha256=k4u2lEox-fCwmQKy1qnek9SGoqUkMFv8Av_DcNanwcE,1595
32
32
  frontengine/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- frontengine/ui/main_ui.py,sha256=47vTOtnNbiPV3J1LtKRRSnXlTmaedJSX7Cf4neIwhyA,7304
33
+ frontengine/ui/main_ui.py,sha256=I_ZouKjVRNZnO4rBsY08juHbsZiMoVJc5_Vt3o-FLUc,7416
34
34
  frontengine/ui/color/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  frontengine/ui/color/global_color.py,sha256=Rh-R-X2BHVjcK5MTBZ1nEMVHgLj1rP4nk-wTQKbiwFA,125
36
36
  frontengine/ui/dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -105,8 +105,8 @@ frontengine/utils/redirect_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
105
105
  frontengine/utils/redirect_manager/redirect_manager_class.py,sha256=zGJeVpjRU12MCnhVAdksAIhK_IhddI4cNKVb7DMgOZA,1888
106
106
  frontengine/worker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  frontengine/worker/qthread_worker.py,sha256=TcmRv4PUlWxYLzMoB_6fUefEZpVhNy5D6_hhShAdKzU,875
108
- frontengine-0.0.68.dist-info/LICENSE,sha256=b3VlPBXnrDylKGffOEOLWMgOX-yfd65XC7PA1_sox2o,1085
109
- frontengine-0.0.68.dist-info/METADATA,sha256=ErxGmFPRxDrdtQm0Wlch5X_lNSr751oV9tz09H-vfEY,2166
110
- frontengine-0.0.68.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
111
- frontengine-0.0.68.dist-info/top_level.txt,sha256=btCybScN_ubeQ8phsSDBB0T-HyHjqt7b-WPy61uTox0,12
112
- frontengine-0.0.68.dist-info/RECORD,,
108
+ frontengine-0.0.70.dist-info/LICENSE,sha256=b3VlPBXnrDylKGffOEOLWMgOX-yfd65XC7PA1_sox2o,1085
109
+ frontengine-0.0.70.dist-info/METADATA,sha256=1SDZD5wLuDujITZFhALmxozmwOFa_LLusBJTkDydN3g,2166
110
+ frontengine-0.0.70.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
111
+ frontengine-0.0.70.dist-info/top_level.txt,sha256=btCybScN_ubeQ8phsSDBB0T-HyHjqt7b-WPy61uTox0,12
112
+ frontengine-0.0.70.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5