diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5c45740..7aa4bb7 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,8 +4,9 @@
-
+
+
@@ -202,7 +203,15 @@
1724410630021
-
+
+
+ 1724416642213
+
+
+
+ 1724416642213
+
+
@@ -243,6 +252,7 @@
-
+
+
\ No newline at end of file
diff --git a/wg_func.py b/wg_func.py
index ae6ab57..4a8289d 100644
--- a/wg_func.py
+++ b/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: