disable button start/stop not 100% work
This commit is contained in:
parent
9667bf0690
commit
bc8dd7fe6d
16
.idea/workspace.xml
generated
16
.idea/workspace.xml
generated
@ -4,8 +4,9 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="add method init_and_report and label_empty to Class ShowAddress">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="little fixes in Class Import">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="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>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@ -202,7 +203,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724410630021</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="15" />
|
||||
<task id="LOCAL-00015" summary="little fixes in Class Import">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724416642213</created>
|
||||
<option name="number" value="00015" />
|
||||
<option name="presentableId" value="LOCAL-00015" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724416642213</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="16" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
@ -243,6 +252,7 @@
|
||||
<MESSAGE value="fixed error when active tunnel is deleted, now also the Address Label is emptied" />
|
||||
<MESSAGE value="In FrameWidged Class else Block StrVar, this resorts reference and variable assignment together" />
|
||||
<MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="add method init_and_report and label_empty to Class ShowAddress" />
|
||||
<MESSAGE value="little fixes in Class Import" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="little fixes in Class Import" />
|
||||
</component>
|
||||
</project>
|
15
wg_func.py
15
wg_func.py
@ -46,6 +46,7 @@ class GreenLabel(tk.Tk):
|
||||
class StartStopBTN(tk.Tk):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.tl = None
|
||||
self.wg_switch = None
|
||||
self.btn_stst = None
|
||||
self.wg_vpn_start = tk.PhotoImage(file=r'icons/wg-vpn-start-48.png')
|
||||
@ -57,9 +58,17 @@ class StartStopBTN(tk.Tk):
|
||||
self.rowconfigure(0, weight=1)
|
||||
|
||||
def button_start(self):
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_start, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=10, sticky="s")
|
||||
self.rowconfigure(0, weight=1)
|
||||
self.tl = ListTunnels.tl_list()
|
||||
print(len(self.tl))
|
||||
if len(self.tl) == 0:
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_start, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.config(state=tk.DISABLED)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=10, sticky="s")
|
||||
self.rowconfigure(0, weight=1)
|
||||
else:
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_start, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=10, sticky="s")
|
||||
self.rowconfigure(0, weight=1)
|
||||
|
||||
|
||||
class ConToDict:
|
||||
|
Loading…
x
Reference in New Issue
Block a user