Added line number saving
This commit is contained in:
parent
3999de77d7
commit
fff3699efe
@ -1 +0,0 @@
|
|||||||
{"file": "", "inline": "# Dies ist ein Test\n\n# 192.168.30.10\n# \u2191 so ein Kommentar wird auch gespeichert!\n\n192.168.30.68\n192.168.30.69\n192.168.30.70\n192.168.30.71 # Leselampe Benni\n192.168.30.72\n", "action": "toggle"}
|
|
@ -47,6 +47,10 @@ def load_config(file="tasmotonov-gui-config.json"): # load config from configpa
|
|||||||
a_new = to_load['action']
|
a_new = to_load['action']
|
||||||
if a_new != "":
|
if a_new != "":
|
||||||
action = a_new
|
action = a_new
|
||||||
|
if "tab_index" in to_load:
|
||||||
|
tab_index = to_load["tab_index"]
|
||||||
|
if type(tab_index) == int and (0 <= tab_index < window.tabWidget.count()):
|
||||||
|
window.tabWidget.setCurrentIndex(to_load["tab_index"])
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass # no config there yet
|
pass # no config there yet
|
||||||
|
|
||||||
@ -57,6 +61,7 @@ def save_config(file="tasmotonov-gui-config.json"):
|
|||||||
to_save['file'] = str(filename)
|
to_save['file'] = str(filename)
|
||||||
to_save['inline'] = str(window.tab2_plainTextEdit.toPlainText())
|
to_save['inline'] = str(window.tab2_plainTextEdit.toPlainText())
|
||||||
to_save['action'] = str(action)
|
to_save['action'] = str(action)
|
||||||
|
to_save['tab_index'] = window.tabWidget.currentIndex()
|
||||||
with open(file, 'w') as f:
|
with open(file, 'w') as f:
|
||||||
f.write(json.dumps(to_save))
|
f.write(json.dumps(to_save))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user