fixed error when active tunnel is deleted,
now also the Address Label is emptied
This commit is contained in:
parent
357cae2d2a
commit
b6555974ea
17
.idea/workspace.xml
generated
17
.idea/workspace.xml
generated
@ -4,9 +4,9 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="Set Style to Clam Improved layout of widgets">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="Remove open file function, add Show Address Labels with tk.StrVar when remove a not active Tunnel Labels of Active Tunnel removed!">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dict_to_address" beforeDir="false" afterPath="$PROJECT_DIR$/dict_to_address" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dict_to_address" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
|
||||
</list>
|
||||
@ -172,7 +172,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724272761629</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="11" />
|
||||
<task id="LOCAL-00011" summary="Remove open file function, add Show Address Labels with tk.StrVar when remove a not active Tunnel Labels of Active Tunnel removed!">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724371229008</created>
|
||||
<option name="number" value="00011" />
|
||||
<option name="presentableId" value="LOCAL-00011" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724371229008</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="12" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
@ -209,6 +217,7 @@
|
||||
<MESSAGE value="add file dict_to_address for address a active Tunnel. Label green pack in Class. add Class to convert fileoutput as String to Dictionary" />
|
||||
<MESSAGE value="add Class StartStopBTN to wg_func.py" />
|
||||
<MESSAGE value="Set Style to Clam Improved layout of widgets" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Set Style to Clam Improved layout of widgets" />
|
||||
<MESSAGE value="Remove open file function, add Show Address Labels with tk.StrVar when remove a not active Tunnel Labels of Active Tunnel removed!" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Remove open file function, add Show Address Labels with tk.StrVar when remove a not active Tunnel Labels of Active Tunnel removed!" />
|
||||
</component>
|
||||
</project>
|
@ -1,3 +0,0 @@
|
||||
192.168.178.158/24
|
||||
192.168.178.1,
|
||||
rj2cexasg9b9oydd.myfritz.net:54775
|
12
main.py
12
main.py
@ -131,15 +131,15 @@ class FrameWidgets(ttk.Frame):
|
||||
os.system('nmcli connection delete ' + str(select_tl))
|
||||
self.l_box.delete(self.select_tunnel[0])
|
||||
os.remove(os.environ['HOME'] + '/tester/' + str(select_tl) + '.conf')
|
||||
if self.a != '':
|
||||
if self.a != '' and self.a == select_tl:
|
||||
self.StrVar.set(value='')
|
||||
StartStopBTN.button_start(self)
|
||||
self.l_box.update()
|
||||
# Address Label
|
||||
self.add.set('')
|
||||
self.DNS.set('')
|
||||
self.enp.set('')
|
||||
ShowAddress.show_data(self)
|
||||
# Address Label
|
||||
self.add.set('')
|
||||
self.DNS.set('')
|
||||
self.enp.set('')
|
||||
ShowAddress.show_data(self)
|
||||
|
||||
# Button Trash
|
||||
self.btn_tr = tk.Button(self, image=self.tr_pic, bd=0, command=delete)
|
||||
|
@ -187,11 +187,8 @@ class ImportTunnel:
|
||||
wg_read = os.environ['HOME'] + '/tester/' + str(self.a) + '.conf'
|
||||
file = open(wg_read, 'r')
|
||||
data = ConToDict.covert_to_dict(file)
|
||||
self.add = tk.StringVar()
|
||||
self.add.set('Address: ' + data[0])
|
||||
self.DNS = tk.StringVar()
|
||||
self.DNS.set(' DNS: ' + data[1])
|
||||
self.enp = tk.StringVar()
|
||||
self.enp.set('Endpoint: ' + data[2])
|
||||
ShowAddress.show_data(self)
|
||||
file.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user