diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index cdeab28..2e7a420 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,11 @@
-
+
+
+
+
+
diff --git a/main.py b/main.py
index 618518c..4f9e64f 100755
--- a/main.py
+++ b/main.py
@@ -47,6 +47,7 @@ class FrameWidgets(ttk.Frame):
def __init__(self, container, **kwargs):
super().__init__(container, **kwargs)
+ self.auto_con = None
self.enp = None
self.DNS = None
self.add = None
@@ -64,23 +65,24 @@ class FrameWidgets(ttk.Frame):
# Show active Tunnel
self.a = TunnelActiv.active()
# Label Frame 1
+ self.lb_frame_btn_lbox = ttk.Frame(self)
+ self.lb_frame_btn_lbox.configure(relief='flat')
+ self.lb_frame_btn_lbox.grid(column=0, rowspan=4, row=0)
+ self.columnconfigure(0, weight=1)
+ self.rowconfigure(0, weight=1)
+ # Label Frame 2
self.lb_frame = ttk.Frame(self)
self.lb_frame.configure(relief='solid')
self.lb_frame.grid(column=2, row=1, sticky='snew', padx=20, pady=5)
self.columnconfigure(2, weight=1)
self.rowconfigure(1, weight=1)
- # Label Frame 2
+ # Label Frame 3
self.lb_frame2 = ttk.Frame(self)
self.lb_frame2.configure(relief='solid')
self.lb_frame2.grid(column=2, row=2, sticky='snew', padx=20, pady=5)
self.columnconfigure(2, weight=1)
self.rowconfigure(2, weight=1)
- # Label Frame 3
- self.lb_frame_buttons = ttk.Frame(self)
- self.lb_frame_buttons.configure(relief='flat')
- self.lb_frame_buttons.grid(column=0, rowspan=4, row=0)
- self.columnconfigure(0, weight=1)
- self.rowconfigure(0, weight=1)
+
# Show active Label
self.select_tunnel = None
self.lb = tk.Label(self, text='Active: ')
@@ -108,13 +110,13 @@ class FrameWidgets(ttk.Frame):
if len(tl) != 0:
self.wg_autostart.configure(state='normal')
- self.l_box = tk.Listbox(self.lb_frame_buttons, fg='#606060', selectmode='single')
+ self.l_box = tk.Listbox(self.lb_frame_btn_lbox, fg='#606060', selectmode='single')
self.l_box.config(highlightthickness=0, relief='ridge')
self.l_box.config(font=('Ubuntu', 12, 'bold'))
self.l_box.grid(column=1, rowspan=4, row=0, sticky='ns')
self.l_box.event_add('<>', '')
self.l_box.bind('<>', enable_check_box)
- self.scrollbar = ttk.Scrollbar(self.lb_frame_buttons, orient='vertical', command=self.l_box.yview)
+ self.scrollbar = ttk.Scrollbar(self.lb_frame_btn_lbox, orient='vertical', command=self.l_box.yview)
self.scrollbar.grid(column=1, rowspan=4, row=0, sticky='nse')
self.l_box.configure(yscrollcommand=self.scrollbar.set)
self.rowconfigure(0, weight=1)
@@ -143,7 +145,7 @@ class FrameWidgets(ttk.Frame):
ShowAddress.label_empty(self)
ShowAddress.show_data(self)
# Button Import
- self.btn_i = tk.Button(self.lb_frame_buttons,
+ self.btn_i = tk.Button(self.lb_frame_btn_lbox,
image=self.imp_pic, bd=0,
command=lambda: ImportTunnel.wg_import_select(self))
self.btn_i.grid(column=0, row=1, padx=15, pady=8)
@@ -190,11 +192,11 @@ class FrameWidgets(ttk.Frame):
pass
# Button Trash
- self.btn_tr = tk.Button(self.lb_frame_buttons, image=self.tr_pic, bd=0, command=delete)
+ self.btn_tr = tk.Button(self.lb_frame_btn_lbox, image=self.tr_pic, bd=0, command=delete)
self.btn_tr.grid(column=0, row=2, padx=15, pady=8)
# Button Export
- self.btn_exp = tk.Button(self.lb_frame_buttons, image=self.exp_pic, bd=0, command=ExportTunnels.wg_export)
+ self.btn_exp = tk.Button(self.lb_frame_btn_lbox, image=self.exp_pic, bd=0, command=ExportTunnels.wg_export)
self.btn_exp.grid(column=0, row=3, padx=15, pady=8)
# Button Rename
@@ -203,7 +205,11 @@ class FrameWidgets(ttk.Frame):
# Check Buttons
self.selected_option = tk.IntVar()
-
+ self.autoconnect_var = tk.StringVar()
+ self.autoconnect_var.set(self.auto_con)
+ self.autoconnect = tk.Label(self, textvariable=self.autoconnect_var, fg='blue', padx=5)
+ self.autoconnect.config(font=('Ubuntu', 11))
+ self.autoconnect.grid(column=0, row=4, sticky='ne', pady=20)
self.wg_autostart = tk.Checkbutton(self,
text='Autoconnect on:',
variable=self.selected_option,
diff --git a/wg_func.py b/wg_func.py
index 2a0fe3b..2473572 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -49,23 +49,19 @@ class GreenLabel(tk.Tk):
class StartStopBTN(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- self.lb_frame_buttons = None
+ self.lb_frame_btn_lbox = None
self.wg_switch = None
self.btn_stst = None
self.wg_vpn_start = tk.PhotoImage(file=r'icons/wg-vpn-start-48.png')
self.wg_vpn_stop = tk.PhotoImage(file=r'icons/wg-vpn-stop-48.png')
def button_stop(self):
- self.btn_stst = tk.Button(self.lb_frame_buttons, image=self.wg_vpn_stop, bd=0, command=self.wg_switch)
+ self.btn_stst = tk.Button(self.lb_frame_btn_lbox, image=self.wg_vpn_stop, bd=0, command=self.wg_switch)
self.btn_stst.grid(column=0, row=0, padx=15, pady=8)
- #self.columnconfigure(0, weight=1)
- #self.rowconfigure(0, weight=1)
def button_start(self):
- self.btn_stst = tk.Button(self.lb_frame_buttons, image=self.wg_vpn_start, bd=0, command=self.wg_switch)
+ self.btn_stst = tk.Button(self.lb_frame_btn_lbox, image=self.wg_vpn_start, bd=0, command=self.wg_switch)
self.btn_stst.grid(column=0, row=0, padx=15, pady=8)
- #self.columnconfigure(0, weight=1)
- #self.rowconfigure(0, weight=1)
class ConToDict: