created installable flatpak file, moved connect button a bit
This commit is contained in:
@@ -17,8 +17,6 @@ from gi.repository import Gtk, Adw, Gdk, Gio
|
||||
APPID = "com.angoosh.RDPConnect"
|
||||
HOMEDIR = os.path.expanduser('~')
|
||||
|
||||
print(HOMEDIR)
|
||||
|
||||
conn_info = {}
|
||||
settings = {}
|
||||
|
||||
@@ -52,10 +50,13 @@ class MyApp(Adw.Application):
|
||||
|
||||
def on_activate(self, app):
|
||||
builder = Gtk.Builder()
|
||||
builder.add_from_file(APPID+".ui")
|
||||
builder.add_from_file("/app/"+APPID+".ui")
|
||||
|
||||
css_provider = Gtk.CssProvider()
|
||||
css_provider.load_from_file(Gio.File.new_for_path("style.css"))
|
||||
if Adw.StyleManager().get_default().get_dark():
|
||||
css_provider.load_from_file(Gio.File.new_for_path("/app/style-dark.css"))
|
||||
else:
|
||||
css_provider.load_from_file(Gio.File.new_for_path("/app/style-light.css"))
|
||||
Gtk.StyleContext.add_provider_for_display(Gdk.Display.get_default(), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
|
||||
|
||||
connect = builder.get_object("connect")
|
||||
@@ -80,7 +81,7 @@ class MyApp(Adw.Application):
|
||||
self.win = builder.get_object("main_window")
|
||||
self.win.set_application(self)
|
||||
self.win.present()
|
||||
|
||||
|
||||
def saveConnConf(self):
|
||||
if settings["save_conn"]:
|
||||
print("Saving connection config to "+HOMEDIR+"/.config/rdpconnect/connection.json")
|
||||
@@ -109,7 +110,7 @@ class MyApp(Adw.Application):
|
||||
settings["extra_params"] = []
|
||||
|
||||
self.saveConnConf()
|
||||
subprocess.Popen(["flatpak", "run", "com.freerdp.FreeRDP", "/v:"+str(conn_info["ip"]), "/u:"+str(conn_info["user"]), "/p:"+str(conn_info["passwd"])]+settings["extra_params"])
|
||||
subprocess.Popen(["flatpak-spawn", "--host", "com.freerdp.FreeRDP", "/v:"+str(conn_info["ip"]), "/u:"+str(conn_info["user"]), "/p:"+str(conn_info["passwd"])]+settings["extra_params"])
|
||||
#subprocess.run(["xfreerdp", "/v:"+str(ip), "/u:"+str(user), "/p:"+str(passwd)])
|
||||
|
||||
if not os.path.isdir(HOMEDIR+"/.config/rdpconnect"):
|
||||
|
||||
Reference in New Issue
Block a user