refs #2060 launch QT6 browser, use dbus to change URLs
parent
ac9ab7e8f5
commit
1fa2a4f0bb
|
@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [5.6.0] - 2025-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Launch QT6 browser
|
||||
- Change URLs using dbus
|
||||
|
||||
## [5.5.0] - 2025-05-19
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
ogagent (5.6.0-1) stable; urgency=medium
|
||||
|
||||
* Execute 'launch_browser' rather than 'browser'
|
||||
* Change URLs using dbus
|
||||
|
||||
-- OpenGnsys developers <info@opengnsys.es> Wed, 21 May 2025 15:06:52 +0200
|
||||
|
||||
ogagent (5.5.0-1) stable; urgency=medium
|
||||
|
||||
* Return to the QT4 browser again
|
||||
|
|
|
@ -1 +1 @@
|
|||
5.5.0
|
||||
5.6.0
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
import os
|
||||
import re
|
||||
import time
|
||||
import dbus
|
||||
import random
|
||||
import subprocess
|
||||
import threading
|
||||
|
@ -369,15 +370,25 @@ class ogLiveWorker(ServerWorker):
|
|||
|
||||
def cargaPaginaWeb (self, url=None):
|
||||
if (not url): url = self.urlMenu
|
||||
os.system ('pkill -9 browser')
|
||||
|
||||
p = subprocess.Popen (['/usr/bin/browser', '-qws', url])
|
||||
dbus_address = os.environ.get ('DBUS_SESSION_BUS_ADDRESS')
|
||||
if not dbus_address: logger.warning ('env var DBUS_SESSION_BUS_ADDRESS not set, cargaPaginaWeb() will likely not work')
|
||||
|
||||
b = dbus.SystemBus()
|
||||
dest = 'es.opengnsys.OGBrowser.browser'
|
||||
path = '/'
|
||||
interface = None
|
||||
method = 'setURL'
|
||||
signature = 's'
|
||||
try:
|
||||
p.wait (2) ## if the process dies before 2 seconds...
|
||||
logger.error ('Error al ejecutar browser, return code "{}"'.format (p.returncode))
|
||||
return False
|
||||
except subprocess.TimeoutExpired:
|
||||
pass
|
||||
b.call_blocking (dest, path, interface, method, 's', [url])
|
||||
except Exception as e:
|
||||
if 'ServiceUnknown' in str(e):
|
||||
## browser not running
|
||||
subprocess.Popen (['/usr/bin/launch_browser', url])
|
||||
else:
|
||||
logger.error (f'Error al cambiar URL: ({e})')
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue