|
21 | 21 | from bravepatcher.static_data import default_pattern_data
|
22 | 22 | from bravepatcher.utils import open_folder_in_explorer
|
23 | 23 | from bravepatcher.utils.brave import (
|
24 |
| - find_chrome_dll, get_brave_for_chrome_dll, get_brave_path, kill_all_brave) |
| 24 | + UpdateDisabler, find_chrome_dll, get_brave_for_chrome_dll, get_brave_path, |
| 25 | + get_brave_updater_for_chrome_dll, kill_all_brave) |
25 | 26 |
|
26 | 27 | try:
|
27 | 28 | chrome_dll = find_chrome_dll(get_brave_path()) or ""
|
@@ -313,6 +314,26 @@ def on_stop_brave(window):
|
313 | 314 | sg.popup_error(f"{e}", keep_on_top=True, modal=True)
|
314 | 315 |
|
315 | 316 |
|
| 317 | +@event_handler("Enable Updates") |
| 318 | +def on_enable_updates(window): |
| 319 | + chrome_dll_path = Path(window['chrome_dll'].get()) |
| 320 | + try: |
| 321 | + updater_exe = get_brave_updater_for_chrome_dll(chrome_dll_path) |
| 322 | + UpdateDisabler(updater_exe).enable_update() |
| 323 | + except Exception as e: |
| 324 | + sg.popup_error(f"{e}", keep_on_top=True, modal=True) |
| 325 | + |
| 326 | + |
| 327 | +@event_handler("Disable Updates") |
| 328 | +def on_disable_updates(window): |
| 329 | + chrome_dll_path = Path(window['chrome_dll'].get()) |
| 330 | + try: |
| 331 | + updater_exe = get_brave_updater_for_chrome_dll(chrome_dll_path) |
| 332 | + UpdateDisabler(updater_exe).disable_update() |
| 333 | + except Exception as e: |
| 334 | + sg.popup_error(f"{e}", keep_on_top=True, modal=True) |
| 335 | + |
| 336 | + |
316 | 337 | def _is_nuitka():
|
317 | 338 | return "__compiled__" in globals()
|
318 | 339 |
|
|
0 commit comments