diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index fe5b03a..2a746f9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,8 @@
-
+
-
@@ -134,14 +133,6 @@
1723279982210
-
-
- 1724013210356
-
-
-
- 1724013210356
-
1724013251954
@@ -526,7 +517,15 @@
1727347126769
-
+
+
+ 1727378355274
+
+
+
+ 1727378355275
+
+
@@ -567,7 +566,6 @@
-
@@ -592,19 +590,20 @@
-
+
+
file://$PROJECT_DIR$/wg_func.py
- 184
+ 182
file://$PROJECT_DIR$/wg_func.py
- 294
+ 292
diff --git a/wg_func.py b/wg_func.py
index 1c9dc3d..9ef5e7e 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -426,6 +426,17 @@ class ExportTunnels:
x = 340 # width
y = 140 # height
msg_window(iw, ii, wt, msg_t, x, y)
+ else:
+ """img_w, img_i, w_title, w_txt x, y hand over"""
+ iw = r'/usr/share/icons/wp-icons/64/info.png'
+ ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
+ wt = 'Select tunnel'
+ msg_t = 'Please first import tunnel. '
+ x = 340 # width
+ y = 140 # height
+ msg_window(iw, ii, wt, msg_t, x, y)
except TypeError:
pass
+
+
diff --git a/wg_main.py b/wg_main.py
index c5636ec..540c5c4 100755
--- a/wg_main.py
+++ b/wg_main.py
@@ -192,14 +192,25 @@ class FrameWidgets(ttk.Frame):
self.enp.set('')
return select_tl
except IndexError:
- """img_w, img_i, w_title, w_txt x, y hand over"""
- iw = r'/usr/share/icons/wp-icons/64/info.png'
- ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
- wt = 'Renaming not possible'
- msg_t = 'Please select a tunnel from the list.'
- x = 340 # width
- y = 140 # height
- msg_window(iw, ii, wt, msg_t, x, y)
+ tl = ListTunnels.tl_list()
+ if len(tl) != 0:
+ """img_w, img_i, w_title, w_txt x, y hand over"""
+ iw = r'/usr/share/icons/wp-icons/64/info.png'
+ ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
+ wt = 'Select tunnel'
+ msg_t = 'Please select a tunnel from the list.'
+ x = 340 # width
+ y = 140 # height
+ msg_window(iw, ii, wt, msg_t, x, y)
+ else:
+ """img_w, img_i, w_title, w_txt x, y hand over"""
+ iw = r'/usr/share/icons/wp-icons/64/info.png'
+ ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
+ wt = 'Select tunnel'
+ msg_t = 'Please first import tunnel. '
+ x = 340 # width
+ y = 140 # height
+ msg_window(iw, ii, wt, msg_t, x, y)
# Button Trash
self.btn_tr = tk.Button(self.lb_frame_btn_lbox, image=self.tr_pic, bd=0, command=delete)
@@ -339,14 +350,25 @@ class FrameWidgets(ttk.Frame):
self.enp.set('')
ShowAddress.show_data(self)
except IndexError:
- """img_w, img_i, w_title, w_txt x, y hand over"""
- iw = r'/usr/share/icons/wp-icons/64/info.png'
- ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
- wt = 'Renaming not possible'
- msg_t = 'Please select a tunnel from the list.'
- x = 340 # width
- y = 140 # height
- msg_window(iw, ii, wt, msg_t, x, y)
+ tl = ListTunnels.tl_list()
+ if len(tl) != 0:
+ """img_w, img_i, w_title, w_txt x, y hand over"""
+ iw = r'/usr/share/icons/wp-icons/64/info.png'
+ ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
+ wt = 'Select tunnel'
+ msg_t = 'Please select a tunnel from the list.'
+ x = 340 # width
+ y = 140 # height
+ msg_window(iw, ii, wt, msg_t, x, y)
+ else:
+ """img_w, img_i, w_title, w_txt x, y hand over"""
+ iw = r'/usr/share/icons/wp-icons/64/info.png'
+ ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
+ wt = 'Select tunnel'
+ msg_t = 'Please first import tunnel. '
+ x = 340 # width
+ y = 140 # height
+ msg_window(iw, ii, wt, msg_t, x, y)
if __name__ == '__main__':