fix msg_boxes when tunnel list = 0 a Start, Delete and Export

This commit is contained in:
Désiré Werner Menrath 2024-09-26 21:42:22 +02:00
parent e1623ab184
commit d39a16cab8
3 changed files with 63 additions and 31 deletions

View File

@ -4,9 +4,8 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="info icon shadow fix end msg Export fix to">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="little fixes">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_main.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -134,14 +133,6 @@
<option name="presentableId" value="Default" />
<updated>1723279982210</updated>
</task>
<task id="LOCAL-00004" summary="add class Frame and class Massage, delete funktion go 100%, add resize window">
<option name="closed" value="true" />
<created>1724013210356</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1724013210356</updated>
</task>
<task id="LOCAL-00005" summary="add class Frame and class Massage, delete funktion go 100%, add resize window, add warning pic">
<option name="closed" value="true" />
<created>1724013251954</created>
@ -526,7 +517,15 @@
<option name="project" value="LOCAL" />
<updated>1727347126769</updated>
</task>
<option name="localTasksCounter" value="53" />
<task id="LOCAL-00053" summary="little fixes">
<option name="closed" value="true" />
<created>1727378355274</created>
<option name="number" value="00053" />
<option name="presentableId" value="LOCAL-00053" />
<option name="project" value="LOCAL" />
<updated>1727378355275</updated>
</task>
<option name="localTasksCounter" value="54" />
<servers />
</component>
<component name="UnknownFeatures">
@ -567,7 +566,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="little fixes replace os.system with check_call&#10;first steps in install Script add wg_start.service file" />
<MESSAGE value="little fixes a labels when stop and start, installer first functions works" />
<MESSAGE value="little fixes, add msg_window() &#10;function for Messagebox to show a tk.Toplevel()&#10;replace var = open() with: &#10;with open() as var:&#10;and remove by classes (tk.tk) and super()" />
<MESSAGE value="in delete replace open with Path&#10;install fixes" />
@ -592,19 +590,20 @@
<MESSAGE value="in msg_window two further parameters to be added to the pass, so height and wide can also be specified.&#10;In rename, messages come now if new names do not fit&#10;Fix Index Error on msg_window()" />
<MESSAGE value="ad max 12-character message, no character message and special_characters message for entry label" />
<MESSAGE value="info icon shadow fix end msg Export fix to" />
<option name="LAST_COMMIT_MESSAGE" value="info icon shadow fix end msg Export fix to" />
<MESSAGE value="little fixes" />
<option name="LAST_COMMIT_MESSAGE" value="little fixes" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/wg_func.py</url>
<line>184</line>
<line>182</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/wg_func.py</url>
<line>294</line>
<line>292</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
</breakpoints>

View File

@ -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

View File

@ -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__':