Update ui dbus interface and make background activate work again

This commit is contained in:
Bernd Schoolmann 2024-02-09 16:05:49 +01:00
parent 53989ebaa3
commit ed6060eae4
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View file

@ -27,8 +27,8 @@ def main():
import dbus
bus = dbus.SessionBus()
the_object = bus.get_objeect("com.quexten.Goldwarden.dbus", "/com/quexten/Goldwarden")
the_interface = dbus.Interface(the_object, "com.quexten.Goldwarden.Settings")
the_object = bus.get_object("com.quexten.Goldwarden.gui", "/com/quexten/Goldwarden/gui")
the_interface = dbus.Interface(the_object, "com.quexten.Goldwarden.gui.actions")
reply = the_interface.settings()
exit()

View file

@ -11,19 +11,19 @@ daemon_token = None
class GoldwardenDBUSService(dbus.service.Object):
def __init__(self):
bus_name = dbus.service.BusName('com.quexten.Goldwarden.ui', bus=dbus.SessionBus())
dbus.service.Object.__init__(self, bus_name, '/com/quexten/Goldwarden/ui')
bus_name = dbus.service.BusName('com.quexten.Goldwarden.gui', bus=dbus.SessionBus())
dbus.service.Object.__init__(self, bus_name, '/com/quexten/Goldwarden/gui')
@dbus.service.method('com.quexten.Goldwarden.ui.QuickAccess')
@dbus.service.method('com.quexten.Goldwarden.gui.actions')
def quickaccess(self):
p = subprocess.Popen(["python3", "-m", "src.gui.quickaccess"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True)
p.stdin.write(f"{daemon_token}\n".encode())
p.stdin.flush()
return ""
@dbus.service.method('com.quexten.Goldwarden.ui.Settings')
@dbus.service.method('com.quexten.Goldwarden.gui.actions')
def settings(self):
subprocess.Popen(["python3", "-m", "src.gui.settings"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True)
p = subprocess.Popen(["python3", "-m", "src.gui.settings"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True)
p.stdin.write(f"{daemon_token}\n".encode())
p.stdin.flush()
return ""