bugfixing and added history data apply

This commit is contained in:
2025-09-17 12:48:53 +02:00
parent efa23f6b50
commit cd2545934e

View File

@@ -83,7 +83,7 @@ def load_config():
print("[WARN] FILE: "+HOMEDIR+"/.config/rdpconnect/settings.json doesn't exist") print("[WARN] FILE: "+HOMEDIR+"/.config/rdpconnect/settings.json doesn't exist")
class HistoryWindow(Gtk.Window): class HistoryWindow(Gtk.Window):
global hist_info global hist_info, conn_info, app
def __init__(self, **kargs): def __init__(self, **kargs):
super().__init__(**kargs, title='History') super().__init__(**kargs, title='History')
@@ -106,19 +106,26 @@ class HistoryWindow(Gtk.Window):
self.show() self.show()
def addRow(self, entry, index): def addRow(self, entry, index):
runb = Gtk.Button(label=entry) b = Gtk.Button(label=entry)
runb.connect("clicked", self.apply_contents) b.connect("clicked", self.apply_contents)
self.grid.attach(runb, 0, index, 1, 1) self.grid.attach(b, 0, index, 1, 1)
def apply_contents(self, button): def apply_contents(self, button):
conn_info["user"] = button.get_label().split('@')[0] conn_info["user"] = button.get_label().split('@')[0]
conn_info["ip"] = button.get_label().split('@')[1] conn_info["ip"] = button.get_label().split('@')[1]
app.ip.get_buffer().set_text(str(conn_info["ip"]), len(conn_info["ip"]))
app.user.get_buffer().set_text(str(conn_info["user"]), len(conn_info["user"]))
try: try:
conn_info["passwd"] = keyring.get_password("com.angoosh.RDPConnect", button.get_label()) conn_info["passwd"] = keyring.get_password("com.angoosh.RDPConnect", button.get_label())
app.passwd.get_buffer().set_text(str(conn_info["passwd"]), len(conn_info["passwd"]))
except: except:
pass pass
self.destroy()
class PreferencesWindow(Gtk.Window): class PreferencesWindow(Gtk.Window):
global settings global settings
def __init__(self, **kwargs): def __init__(self, **kwargs):