From 61bc18413699f5a1210be84122eeb399e4f8e285 Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Fri, 23 Aug 2013 20:33:37 +0300 Subject: [PATCH] Move proxy settings to its own naviframe page. --- TODO | 14 ++++++----- epour/gui/Preferences.py | 51 +++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/TODO b/TODO index fa60dd1..780f111 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,9 @@ -High priority: - ☐ I18N - This should wait until most of the features are in and the strings are stable. - ☐ Add Torrent-dialog +I18N: + This should wait until most of the features are in and the strings are stable. + ☐ Make strings localizable + ☐ Create pot file + ☐ Generate po files +Add Torrent-dialog: ☐ Create a new class to hold a torrent and store its instances between sessions. Migrate the old dict(ihash->torrent_file) to the new list of torrents ☐ Dialog window @@ -9,7 +11,7 @@ High priority: ☐ File selector ☐ Storage path ☐ Add preferences for initial/automatic values for the above -Low priority: +Misc: ☐ Torrent tooltips handle.status() ☐ More tooltips in general @@ -17,4 +19,4 @@ Low priority: ✔ Auto-paste magnet links from clipboard #epour/gui/Main.py@select_torrent @done (13-08-11 21:45) Note: The pasted text is not filtered. ☐ Construct and populate #epour/gui/Preferences.py@SessionSettings with an Idler - ☐ Move proxy settings to its own naviframe page and don't autocollapse the frames + ✔ Move proxy settings to its own naviframe page and don't autocollapse the frames @done (13-08-18 18:02) diff --git a/epour/gui/Preferences.py b/epour/gui/Preferences.py index 3c9c229..c64a7c8 100644 --- a/epour/gui/Preferences.py +++ b/epour/gui/Preferences.py @@ -76,12 +76,12 @@ class Preferences(InnerWindow): mbox.size_hint_weight = 1.0, 1.0 mbox.size_hint_align = -1.0, -1.0 - lbl = Label(self) - lbl.text = "Click on a title to open/close configuration entry." + #lbl = Label(self) + #lbl.text = "Click on a title to open/close configuration entry." limits = Limits(self, session) ports = ListenPorts(self, session) - pf = ProxyConfig(self) + #pf = ProxyConfig(self) pe = EncryptionSettings(self, session) dlsel = DataStorageSelector(self, conf) @@ -109,16 +109,20 @@ class Preferences(InnerWindow): sep2 = Separator(self) sep2.horizontal = True + prox_btn = Button(self) + prox_btn.text = "Proxy settings ->" + prox_btn.callback_clicked_add(self.show_prox_set, nf, session) + ses_btn = Button(self) - ses_btn.text = "Session settings" + ses_btn.text = "Session settings ->" ses_btn.callback_clicked_add(self.show_ses_set, nf, session) xbtn = Button(self) xbtn.text_set("Close") xbtn.callback_clicked_add(lambda x: self.delete()) - for w in lbl, ports, limits, pf, dlsel, pe, pad, \ - sep1, chk1, chk2, sep2, ses_btn, xbtn: + for w in ports, limits, dlsel, pe, pad, \ + sep1, chk1, chk2, sep2, prox_btn, ses_btn, xbtn: w.show() mbox.pack_end(w) @@ -136,6 +140,10 @@ class Preferences(InnerWindow): ses_set = SessionSettings(self, session, nf) nf.item_simple_push(ses_set) + def show_prox_set(self, btn, nf, session): + prox_set = ProxyConfig(self, session, nf) + nf.item_simple_push(prox_set) + class DataStorageSelector(Frame): def __init__(self, parent, conf): Frame.__init__(self, parent) @@ -143,8 +151,6 @@ class DataStorageSelector(Frame): self.size_hint_align = -1.0, 0.0 self.size_hint_weight = 1.0, 0.0 self.text = "Data storage" - self.collapse = True - self.autocollapse = True self.conf = conf @@ -188,8 +194,6 @@ class ListenPorts(Frame): self.session = session self.size_hint_align = -1.0, -1.0 - self.collapse = True - self.autocollapse = True self.text = "Listen port (range)" port = session.listen_port() @@ -221,19 +225,17 @@ class ListenPorts(Frame): self.session.conf.set("Settings", "listen_low", str(low)) self.session.conf.set("Settings", "listen_high", str(high)) -class ProxyConfig(Frame): - def __init__(self, parent): - Frame.__init__(self, parent) +class ProxyConfig(Scroller): + def __init__(self, parent, session, nf): + Scroller.__init__(self, parent) - session = self.session = parent.session + self.session = session - self.collapse = True - self.autocollapse = True self.size_hint_weight = (1.0, 0.0) self.size_hint_align = (-1.0, 0.0) - self.text = "Proxy configuration" b = Box(parent) + b.size_hint_weight = 1.0, 1.0 proxies = [ ["Proxy for torrent peer connections", @@ -246,11 +248,18 @@ class ProxyConfig(Frame): session.dht_proxy, session.set_dht_proxy], ] + xbtn = Button(self) + xbtn.text = "<- Back" + xbtn.callback_clicked_add(lambda x: nf.item_pop()) + for title, rfunc, wfunc in proxies: pg = ProxyGroup(parent, title, rfunc, wfunc) pg.show() b.pack_end(pg) + b.pack_end(xbtn) + xbtn.show() + b.show() self.content = b @@ -268,8 +277,6 @@ class ProxyGroup(Frame): def __init__(self, parent, title, rfunc, wfunc): Frame.__init__(self, parent) - self.collapse = True - self.autocollapse = True self.size_hint_weight = 1.0, 0.0 self.size_hint_align = -1.0, 0.0 self.text = title @@ -359,8 +366,6 @@ class EncryptionSettings(Frame): self.session = session Frame.__init__(self, parent) - self.collapse = True - self.autocollapse = True self.size_hint_align = -1.0, 0.0 self.text = "Encryption settings" @@ -542,7 +547,7 @@ class SessionSettings(Scroller): i += 1 xbtn = Button(parent) - xbtn.text = "Close" + xbtn.text = "<- Back" xbtn.callback_clicked_add(lambda x: nf.item_pop()) xbtn.show() t.pack(xbtn, 0, i, 2, 1) @@ -631,8 +636,6 @@ class Limits(Frame): def __init__(self, parent, session): Frame.__init__(self, parent) self.text = "Limits" - self.collapse = True - self.autocollapse = True self.size_hint_align = -1.0, 0.0