bugfixing and added history data apply
This commit is contained in:
@@ -83,7 +83,7 @@ def load_config():
|
||||
print("[WARN] FILE: "+HOMEDIR+"/.config/rdpconnect/settings.json doesn't exist")
|
||||
|
||||
class HistoryWindow(Gtk.Window):
|
||||
global hist_info
|
||||
global hist_info, conn_info, app
|
||||
def __init__(self, **kargs):
|
||||
super().__init__(**kargs, title='History')
|
||||
|
||||
@@ -106,19 +106,26 @@ class HistoryWindow(Gtk.Window):
|
||||
self.show()
|
||||
|
||||
def addRow(self, entry, index):
|
||||
runb = Gtk.Button(label=entry)
|
||||
runb.connect("clicked", self.apply_contents)
|
||||
b = Gtk.Button(label=entry)
|
||||
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):
|
||||
conn_info["user"] = button.get_label().split('@')[0]
|
||||
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:
|
||||
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:
|
||||
pass
|
||||
|
||||
self.destroy()
|
||||
|
||||
class PreferencesWindow(Gtk.Window):
|
||||
global settings
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user