55 Commits

Author SHA1 Message Date
6e54529c0f Merge pull request 'Fix for allow ipv6' (#31) from 24-02-2025 into main
Reviewed-on: #31
2025-02-24 18:59:04 +01:00
e28235af4b Fix for allow ipv6 2025-02-24 18:51:14 +01:00
862cc91fa1 Merge pull request '1.11.2124' (#30) from 1.11.2124 into main
Reviewed-on: #30
2024-11-17 13:04:26 +01:00
5fe6fd3f29 - Update Translate Files 2024-11-17 12:51:46 +01:00
48a48ffd4c - Update Translate Files 2024-11-17 12:49:41 +01:00
1278b02a95 - Update Translate Files 2024-11-17 12:28:05 +01:00
22abe9f8b9 Merge pull request '- Update Translate Files' (#29) from 1.11.1924 into main
Reviewed-on: #29
2024-11-17 12:13:23 +01:00
52f22beec6 - Update Translate Files 2024-11-17 12:11:55 +01:00
8754e7ecda Merge pull request '- Update Translate Files' (#28) from 1.11.1824 into main
Reviewed-on: #28
2024-11-17 11:48:24 +01:00
a6742a0c0e - Update Translate Files 2024-11-17 11:46:11 +01:00
6b75713121 Merge pull request '1.11.1824' (#27) from 1.11.1824 into main
Reviewed-on: #27
2024-11-17 11:45:10 +01:00
762694aa94 - Update Translate Files 2024-11-17 11:42:58 +01:00
cc54f329fe - Update Translate Files 2024-11-17 11:41:13 +01:00
8c01c1b984 - Update Translate Files 2024-11-17 11:40:33 +01:00
ebafdbdcb3 - - Fix Checkbutton Autostart when first install Wire-Py 2024-11-17 10:48:47 +01:00
ce4f6c84dc - - Fix Checkbutton Autostart when first install Wire-Py 2024-11-15 18:09:21 +01:00
b68908eaef Merge pull request '1.11.1124' (#25) from 1.11.1124 into main
Reviewed-on: #25
2024-11-13 17:51:07 +01:00
c4565ed169 - fix return 'no Updates' 2024-11-10 20:57:52 +01:00
485cfff457 - fix return 'no Updates' 2024-11-10 20:57:19 +01:00
1a0fc74a80 - fix return 'no Updates' 2024-11-10 20:55:33 +01:00
971c86c97f - Translate file de_De complete
- new FrameWidget for rename Entry and rename Button
2024-11-10 20:31:27 +01:00
66dd27cc64 Merge pull request '1.11.1024' (#24) from 1.11.1024 into main
Reviewed-on: #24
2024-11-10 17:57:57 +01:00
cf71eae7d3 - Translate file de_De complete
- new FrameWidget for rename Entry and rename Button
2024-11-10 15:08:00 +01:00
1f80d5342c - Translate file de_De complete
- new FrameWidget for rename Entry and rename Button
2024-11-10 14:51:50 +01:00
e719a1f23f - Preparation for language translation part 5 2024-11-10 13:23:02 +01:00
a0da356cec - Preparation for language translation part 5 2024-11-10 13:17:11 +01:00
ac87e0a4a7 - Preparation for language translation part 4 2024-11-10 11:20:11 +01:00
6a3a982057 - Preparation for language translation part 4 2024-11-10 11:05:32 +01:00
aab90eec70 - Preparation for language translation part 3 2024-11-10 00:23:49 +01:00
511d5f72df - Preparation for language translation part 2 2024-11-09 22:09:23 +01:00
ed93e99026 - Preparation for language translation part 2 2024-11-09 22:08:39 +01:00
10c3b07053 - Preparation for language translation part 1
- separate folder for general icons
- install edit for new dir lx-icons
2024-11-09 19:01:53 +01:00
03a7e48018 Merge pull request '1.11.0824' (#23) from 1.11.0824 into main
Reviewed-on: #23
2024-11-08 21:24:31 +01:00
090842ab28 wg_func.py aktualisiert 2024-11-08 21:23:59 +01:00
9eb99f0859 Changelog aktualisiert
Changelog  updated
2024-11-07 19:30:08 +01:00
feb6217637 wg_func.py aktualisiert
Version number adjusted
2024-11-07 19:27:57 +01:00
5f6aaa6cf1 Merge pull request '1.11.0724' (#22) from 1.11.0724 into main
Reviewed-on: #22
2024-11-07 19:16:22 +01:00
63ed0abc98 testtheme.py gelöscht 2024-10-26 12:31:53 +02:00
3102c685fd Merge pull request '1.10.2124' (#21) from 1.10.2124 into main
Reviewed-on: #21
2024-10-22 12:41:47 +02:00
ec10f912ea Merge pull request '- Fix a ConToDict Class when Endpoint not in Wireguard config file' (#20) from 1.10.2024 into main
Reviewed-on: #20
2024-10-20 12:20:41 +02:00
96164eb132 Merge pull request '- Add Options, Help, Update Label and Update Menubutton' (#19) from 1.10.2024 into main
Reviewed-on: #19
2024-10-20 02:15:23 +02:00
a19f889950 Merge pull request '1.10.1924' (#18) from 1.10.1924 into main
Reviewed-on: #18
2024-10-19 18:06:55 +02:00
de2929896d Merge pull request '- Create file for settings (Autoupdate)' (#17) from 1.10.1224 into main
Reviewed-on: #17
2024-10-12 13:39:04 +02:00
f9d4256679 Merge pull request 'Fix msg_window and remove x , y argument' (#16) from 1.10.0424 into main
Reviewed-on: #16
2024-10-04 21:01:26 +02:00
a0b895438c Merge pull request '28-09-2024' (#15) from 28-09-2024 into main
Reviewed-on: #15
2024-09-28 14:17:38 +02:00
4c89488950 Merge pull request 'wire-py-reformat-14-09-2024' (#14) from wire-py-reformat-14-09-2024 into main
Reviewed-on: #14
2024-09-14 23:31:00 +02:00
c0ae2d2b75 Merge pull request 'wire-py-reformat-14-08-2024' (#13) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #13
2024-09-05 22:22:00 +02:00
e4774abf19 Merge pull request 'fixes on empty Listbox now is disable and now works autoconnect label with read and write, delete works now with read and write' (#12) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #12
2024-09-04 20:55:51 +02:00
7b1e543428 Merge pull request 'add if question and add autoconnect, autoconnect_var to class Filehandle in box_set no finish!' (#11) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #11
2024-09-04 09:20:05 +02:00
6f83fc7162 Merge pull request 'wire-py-reformat-14-08-2024' (#10) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #10
2024-09-04 06:26:30 +02:00
b70400b456 Merge pull request 'wire-py-reformat-14-08-2024' (#9) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #9
2024-08-25 20:32:05 +02:00
e25bc154ea Merge pull request 'wire-py-reformat-14-08-2024' (#8) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #8
2024-08-23 18:00:19 +02:00
7aa3cd75fe Merge pull request 'Set Style to Clam' (#7) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #7
2024-08-21 22:52:27 +02:00
0b9eec8d1d Merge pull request 'add Class StartStopBTN to wg_func.py' (#6) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #6
2024-08-21 12:52:51 +02:00
b9083d4698 Merge pull request 'add file dict_to_address for' (#5) from wire-py-reformat-14-08-2024 into main
Reviewed-on: #5
2024-08-21 12:00:18 +02:00
10 changed files with 267 additions and 226 deletions

210
.idea/workspace.xml generated
View File

@ -4,21 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change&#10;- optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets&#10;- add new Frame for Widgets on Bottom&#10;- optimize from tkinter * to from tkinter import filedialog, ttk, TclError"> <list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Update Translate Files">
<change afterPath="$PROJECT_DIR$/lx-icons/128/error.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/128/info.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/256/error.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/256/info.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/32/error.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/32/info.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/48/error.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/48/info.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/64/error.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/lx-icons/64/info.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" /> <change beforePath="$PROJECT_DIR$/cls_mth_fc.py" beforeDir="false" afterPath="$PROJECT_DIR$/cls_mth_fc.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/cls_mth_fc.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_main.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -56,25 +44,25 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"ASKED_ADD_EXTERNAL_FILES": "true", &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
"Python.INSTALL.executor": "Run", &quot;Python.INSTALL.executor&quot;: &quot;Run&quot;,
"Python.install.executor": "Run", &quot;Python.install.executor&quot;: &quot;Run&quot;,
"Python.main.executor": "Run", &quot;Python.main.executor&quot;: &quot;Run&quot;,
"Python.messagebox.executor": "Run", &quot;Python.messagebox.executor&quot;: &quot;Run&quot;,
"Python.start_wg.executor": "Run", &quot;Python.start_wg.executor&quot;: &quot;Run&quot;,
"Python.testtheme.executor": "Run", &quot;Python.testtheme.executor&quot;: &quot;Run&quot;,
"Python.wg_func.executor": "Run", &quot;Python.wg_func.executor&quot;: &quot;Run&quot;,
"Python.wg_main.executor": "Run", &quot;Python.wg_main.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"Shell Script.install.executor": "Run", &quot;Shell Script.install.executor&quot;: &quot;Run&quot;,
"Shell Script.run_as.executor": "Run", &quot;Shell Script.run_as.executor&quot;: &quot;Run&quot;,
"git-widget-placeholder": "1.11.0824", &quot;git-widget-placeholder&quot;: &quot;1.11.1024&quot;,
"last_opened_file_path": "/home/punix/Pyapps/wire-py/lx-icons", &quot;last_opened_file_path&quot;: &quot;/home/punix/Pyapps/wire-py&quot;,
"settings.editor.selected.configurable": "reference.settingsdialog.IDE.editor.colors" &quot;settings.editor.selected.configurable&quot;: &quot;reference.settingsdialog.IDE.editor.colors&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/lx-icons" /> <recent name="$PROJECT_DIR$/lx-icons" />
@ -154,78 +142,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1723279982210</updated> <updated>1723279982210</updated>
</task> </task>
<task id="LOCAL-00020" summary="columnconfigure on all widgets set">
<option name="closed" value="true" />
<created>1724778892233</created>
<option name="number" value="00020" />
<option name="presentableId" value="LOCAL-00020" />
<option name="project" value="LOCAL" />
<updated>1724778892233</updated>
</task>
<task id="LOCAL-00021" summary="little fixes a &quot; &quot; to ' '">
<option name="closed" value="true" />
<created>1725119445803</created>
<option name="number" value="00021" />
<option name="presentableId" value="LOCAL-00021" />
<option name="project" value="LOCAL" />
<updated>1725119445803</updated>
</task>
<task id="LOCAL-00022" summary="add class FileHandle,&#10;add Label to show autoconnect Tunnel&#10;disable checkbox when Listbox is empty or no select Tunnel">
<option name="closed" value="true" />
<created>1725391658456</created>
<option name="number" value="00022" />
<option name="presentableId" value="LOCAL-00022" />
<option name="project" value="LOCAL" />
<updated>1725391658456</updated>
</task>
<task id="LOCAL-00023" summary="add if question and add autoconnect, autoconnect_var to class Filehandle in box_set no finish!">
<option name="closed" value="true" />
<created>1725434328731</created>
<option name="number" value="00023" />
<option name="presentableId" value="LOCAL-00023" />
<option name="project" value="LOCAL" />
<updated>1725434328731</updated>
</task>
<task id="LOCAL-00024" summary="fixes on empty Listbox now is disable and now works autoconnect label with read and write, delete works now with read and write">
<option name="closed" value="true" />
<created>1725475967338</created>
<option name="number" value="00024" />
<option name="presentableId" value="LOCAL-00024" />
<option name="project" value="LOCAL" />
<updated>1725475967338</updated>
</task>
<task id="LOCAL-00025" summary="add Frame widget 3&#10;for Buttons and Listbox with Scrollbar.&#10;all Widgets new format&#10;delete works now of disable checkbox when Listbox empty (part two)">
<option name="closed" value="true" />
<created>1725567453540</created>
<option name="number" value="00025" />
<option name="presentableId" value="LOCAL-00025" />
<option name="project" value="LOCAL" />
<updated>1725567453540</updated>
</task>
<task id="LOCAL-00026" summary="little fixes">
<option name="closed" value="true" />
<created>1725639633873</created>
<option name="number" value="00026" />
<option name="presentableId" value="LOCAL-00026" />
<option name="project" value="LOCAL" />
<updated>1725639633873</updated>
</task>
<task id="LOCAL-00027" summary="little fixes">
<option name="closed" value="true" />
<created>1725746027132</created>
<option name="number" value="00027" />
<option name="presentableId" value="LOCAL-00027" />
<option name="project" value="LOCAL" />
<updated>1725746027132</updated>
</task>
<task id="LOCAL-00028" summary="little fixes replace os.system with check_call&#10;first steps in install Script add wg_start.service file">
<option name="closed" value="true" />
<created>1725820337669</created>
<option name="number" value="00028" />
<option name="presentableId" value="LOCAL-00028" />
<option name="project" value="LOCAL" />
<updated>1725820337669</updated>
</task>
<task id="LOCAL-00029" summary="little fixes a labels when stop and start, installer first functions works"> <task id="LOCAL-00029" summary="little fixes a labels when stop and start, installer first functions works">
<option name="closed" value="true" /> <option name="closed" value="true" />
<created>1725991610908</created> <created>1725991610908</created>
@ -546,7 +462,79 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1731098372497</updated> <updated>1731098372497</updated>
</task> </task>
<option name="localTasksCounter" value="69" /> <task id="LOCAL-00069" summary=" - - Fix Checkbutton Autostart when first install Wire-Py">
<option name="closed" value="true" />
<created>1731690583059</created>
<option name="number" value="00069" />
<option name="presentableId" value="LOCAL-00069" />
<option name="project" value="LOCAL" />
<updated>1731690583060</updated>
</task>
<task id="LOCAL-00070" summary=" - - Fix Checkbutton Autostart when first install Wire-Py">
<option name="closed" value="true" />
<created>1731836942211</created>
<option name="number" value="00070" />
<option name="presentableId" value="LOCAL-00070" />
<option name="project" value="LOCAL" />
<updated>1731836942212</updated>
</task>
<task id="LOCAL-00071" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731840048762</created>
<option name="number" value="00071" />
<option name="presentableId" value="LOCAL-00071" />
<option name="project" value="LOCAL" />
<updated>1731840048763</updated>
</task>
<task id="LOCAL-00072" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731840089956</created>
<option name="number" value="00072" />
<option name="presentableId" value="LOCAL-00072" />
<option name="project" value="LOCAL" />
<updated>1731840089956</updated>
</task>
<task id="LOCAL-00073" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731840188277</created>
<option name="number" value="00073" />
<option name="presentableId" value="LOCAL-00073" />
<option name="project" value="LOCAL" />
<updated>1731840188278</updated>
</task>
<task id="LOCAL-00074" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731840383592</created>
<option name="number" value="00074" />
<option name="presentableId" value="LOCAL-00074" />
<option name="project" value="LOCAL" />
<updated>1731840383592</updated>
</task>
<task id="LOCAL-00075" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731841930614</created>
<option name="number" value="00075" />
<option name="presentableId" value="LOCAL-00075" />
<option name="project" value="LOCAL" />
<updated>1731841930615</updated>
</task>
<task id="LOCAL-00076" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731844213239</created>
<option name="number" value="00076" />
<option name="presentableId" value="LOCAL-00076" />
<option name="project" value="LOCAL" />
<updated>1731844213239</updated>
</task>
<task id="LOCAL-00077" summary=" - Update Translate Files">
<option name="closed" value="true" />
<created>1731844339039</created>
<option name="number" value="00077" />
<option name="presentableId" value="LOCAL-00077" />
<option name="project" value="LOCAL" />
<updated>1731844339039</updated>
</task>
<option name="localTasksCounter" value="78" />
<servers /> <servers />
</component> </component>
<component name="UnknownFeatures"> <component name="UnknownFeatures">
@ -577,8 +565,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="install rollback bash to py wirepy and wirepy rollback to py" />
<MESSAGE value="fix install and .desktop File Tar works now for user home and filebrowser.askfilebrowser start now in user home" />
<MESSAGE value="replace tar with zip and Check if Zip file is empty" /> <MESSAGE value="replace tar with zip and Check if Zip file is empty" />
<MESSAGE value="Create your own message boxes for export" /> <MESSAGE value="Create your own message boxes for export" />
<MESSAGE value="chown Export File to 1000:1000" /> <MESSAGE value="chown Export File to 1000:1000" />
@ -602,15 +588,17 @@
<MESSAGE value="- Optimize Class. Move to wg_main Import Start/StopBTN and Tooltip" /> <MESSAGE value="- Optimize Class. Move to wg_main Import Start/StopBTN and Tooltip" />
<MESSAGE value="- Optimize Class and Tooltip" /> <MESSAGE value="- Optimize Class and Tooltip" />
<MESSAGE value="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change&#10;- optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets&#10;- add new Frame for Widgets on Bottom&#10;- optimize from tkinter * to from tkinter import filedialog, ttk, TclError" /> <MESSAGE value="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change&#10;- optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets&#10;- add new Frame for Widgets on Bottom&#10;- optimize from tkinter * to from tkinter import filedialog, ttk, TclError" />
<option name="LAST_COMMIT_MESSAGE" value="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change&#10;- optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets&#10;- add new Frame for Widgets on Bottom&#10;- optimize from tkinter * to from tkinter import filedialog, ttk, TclError" /> <MESSAGE value=" - - Fix Checkbutton Autostart when first install Wire-Py" />
<MESSAGE value=" - Update Translate Files" />
<option name="LAST_COMMIT_MESSAGE" value=" - Update Translate Files" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line"> <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/start_wg.py</url> <url>file://$PROJECT_DIR$/wg_main.py</url>
<line>1</line> <line>1128</line>
<option name="timeStamp" value="2" /> <option name="timeStamp" value="3" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>

View File

@ -8,51 +8,81 @@ My standard System: Linux Mint 22 Cinnamon
- for loops with lists replaced by List Comprehensions - for loops with lists replaced by List Comprehensions
- Update search after start of Wire-Py - Update search after start of Wire-Py
### Added
08-11-2024
- Preparation for language translation part 1
- separate folder for general icons
- install edit for new dir lx-icons
### Added
08-11-2024
- methods from class MainWindow move to class FrameWidgets for active color_label when theme change
- optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets
- add new Frame for Widgets on Bottom
- optimize from tkinter * to from tkinter import filedialog, ttk, TclError
### Added ### Added
07-11-2024 07-11-2024
- remove classes and add methods to class FrameWidgets (removed self errors) - remove classes and add methods to class FrameWidgets (removed self errors)
### Added
10-11-2024
- Fix Checkbutton Autostart when first install Wire-Py
- Update Translate Files
### Added
10-11-2024
- Translate file de_De complete
- new FrameWidget for rename Entry and rename Button
### Added
09-11-2024
- Move Tips Method in separate class for Tooltips in another Apps
- Move Version Variable in main script
- Edit Class GiteaUpdate for requests in api_down and download
- Description on Class GiteaUpdate
### Added
08-11-2024
- Preparation for language translation part 1
- separate folder for general icons
- install edit for new dir lx-icons
### Added
08-11-2024
- methods from class MainWindow move to class FrameWidgets for active color_label when theme change
- optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets
- add new Frame for Widgets on Bottom
- optimize from tkinter * to from tkinter import filedialog, ttk, TclError
### Added
07-11-2024
- remove classes and add methods to class FrameWidgets (removed self errors)
### Added ### Added
27-10-2024 27-10-2024
- Add Autoconnect settings to settings.conf - Add Autoconnect settings to settings.conf
### Added ### Added
26-10-2024 26-10-2024
- Add run_as Bash script and open_gitea.py python script - Add run_as Bash script and open_gitea.py python script
- Add Tooltip disable/enable - Add Tooltip disable/enable
- Rename settings to settings.conf for theme, updates and tooltip enable in one file - Rename settings to settings.conf for theme, updates and tooltip enable in one file
### Added ### Added
25-10-2024 25-10-2024
- Optimize Class and Tooltip - Optimize Class and Tooltip
### Added ### Added
21-10-2024 21-10-2024
- Optimize Class. Move to wg_main Import Start/StopBTN and Tooltip - Optimize Class. Move to wg_main Import Start/StopBTN and Tooltip
### Added ### Added

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,62 +1,65 @@
""" Wireguard Classes and Method for Wire-Py """ """ Classes Method and functions for lx apps """
import gettext
import locale
import os import os
import shutil import shutil
import subprocess import subprocess
import time
import tkinter as tk import tkinter as tk
import zipfile import zipfile
import gettext
import locale
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
from subprocess import check_call
from tkinter import ttk from tkinter import ttk
import requests import requests
APP = 'cls_mth_fc' APP = 'wirepy'
LOCALE_DIR = "/usr/share/locale/" LOCALE_DIR = "/usr/share/locale/"
locale.bindtextdomain(APP, LOCALE_DIR) locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR) gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP) gettext.textdomain(APP)
_ = gettext.gettext _ = gettext.gettext
''' 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year '''
version = 'v. 1.11.0824'
path_to_file2 = Path('/etc/wire_py/settings.conf') wg_set = Path('/etc/wire_py/settings.conf')
_u = Path.read_text(Path('/tmp/_u')) _u = Path.read_text(Path('/tmp/_u'))
class GiteaUpdate: class GiteaUpdate:
"""
Calling api_down requests the URL and the version of the running script.
Example: version = 'v. 1.1.1.1' GiteaUpdate.api_down(http://example.de, version)
Calling download requests the download URL of the running script,
the taskbar image for the “Download OK” window, the taskbar image for the
“Download error” window and the variable res
"""
@staticmethod @staticmethod
def api_down(UPDATE_API_URL): def api_down(update_api_url, version):
try: try:
response = requests.get(UPDATE_API_URL) response = requests.get(update_api_url)
response_dict = response.json() response_dict = response.json()
response_dict = response_dict[0] response_dict = response_dict[0]
with open(path_to_file2, 'r') as set_file: with open(wg_set, 'r') as set_file:
set_file = set_file.read() set_file = set_file.read()
if 'on\n' in set_file: if 'on\n' in set_file:
if version[3:] != response_dict['tag_name']: if version[3:] != response_dict['tag_name']:
return response_dict['tag_name'] return response_dict['tag_name']
else: else:
return _('No Updates') return 'No Updates'
else: else:
return _('False') return 'False'
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
return 'No Internet Connection!' return 'No Internet Connection!'
@staticmethod @staticmethod
def download(URLD): def download(urld, down_ok_image, down_not_ok_image, res):
try: try:
to_down = 'wget -qP ' + str(_u) + ' ' + URLD to_down = 'wget -qP ' + str(_u) + ' ' + urld
result = subprocess.call(to_down, shell=True) result = subprocess.call(to_down, shell=True)
if result == 0: if result == 0:
shutil.chown(str(_u) + f'/{res}.zip', 1000, 1000) shutil.chown(str(_u) + f'/{res}.zip', 1000, 1000)
"""img_w, img_i, w_title, w_txt hand over""" """img_w, img_i, w_title, w_txt hand over"""
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_vpn.png' ii = down_ok_image
wt = _('Download Successful') wt = _('Download Successful')
msg_t = _('Your zip file is in home directory') msg_t = _('Your zip file is in home directory')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
@ -64,23 +67,19 @@ class GiteaUpdate:
else: else:
"""img_w, img_i, w_title, w_txt hand over""" """img_w, img_i, w_title, w_txt hand over"""
iw = r'/usr/share/icons/lx-icons/64/error.png' iw = r'/usr/share/icons/lx-icons/64/error.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = down_not_ok_image
wt = _('Download error') wt = _('Download error')
msg_t = _('Download failed! Please try again') msg_t = _('Download failed! Please try again')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
"""img_w, img_i, w_title, w_txt hand over""" """img_w, img_i, w_title, w_txt hand over"""
iw = r'/usr/share/icons/lx-icons/64/error.png' iw = r'/usr/share/icons/lx-icons/64/error.png'
ii = r'/usr/share/icons/wg-icons/48/wg_msg.png' ii = down_not_ok_image
wt = _('Download error') wt = _('Download error')
msg_t = _('Download failed! No internet connection!') msg_t = _('Download failed! No internet connection!')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
res = GiteaUpdate.api_down('https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases')
def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None): def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
""" """
Function for different message windows for the user. with 4 arguments to be passed. Function for different message windows for the user. with 4 arguments to be passed.
@ -90,8 +89,9 @@ def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
img_i = Image for Icon img_i = Image for Icon
w_title = Windows Title w_title = Windows Title
w_txt = Text for Tk Window w_txt = Text for Tk Window
txt2 = Text for Button two
com = function for Button command
""" """
msg = tk.Toplevel() msg = tk.Toplevel()
msg.resizable(width=False, height=False) msg.resizable(width=False, height=False)
msg.title(w_title) msg.title(w_title)
@ -103,7 +103,7 @@ def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
label.grid(column=1, row=0) label.grid(column=1, row=0)
if txt2 != None and com != None: if txt2 is not None and com is not None:
label.config(font=('Ubuntu', 11), padx=15, justify='left') label.config(font=('Ubuntu', 11), padx=15, justify='left')
msg.i_window.grid(column=0, row=0, sticky='nw') msg.i_window.grid(column=0, row=0, sticky='nw')
button2 = ttk.Button(msg, text=f'{txt2}', command=com, padding=4) button2 = ttk.Button(msg, text=f'{txt2}', command=com, padding=4)
@ -125,7 +125,6 @@ def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
class Tunnel: class Tunnel:
""" """
Class of Methods for Wire-Py Class of Methods for Wire-Py
""" """
@ -134,7 +133,6 @@ class Tunnel:
The config file is packed into a dictionary, The config file is packed into a dictionary,
to display the values Address , DNS and Peer in the labels to display the values Address , DNS and Peer in the labels
""" """
@classmethod @classmethod
def con_to_dict(cls, file): def con_to_dict(cls, file):
@ -176,11 +174,9 @@ class Tunnel:
pre_key = final_dict['PreSharedKey'] pre_key = final_dict['PreSharedKey']
return address, dns, endpoint, pre_key return address, dns, endpoint, pre_key
""" """
Shows the Active Tunnel Shows the Active Tunnel
""" """
@staticmethod @staticmethod
def active(): def active():
@ -195,7 +191,6 @@ class Tunnel:
""" """
Shows all existing Wireguard tunnels Shows all existing Wireguard tunnels
""" """
@staticmethod @staticmethod
def list(): def list():
wg_s = os.popen('nmcli con show | grep -iPo "(.*)(wireguard)"').read().split() wg_s = os.popen('nmcli con show | grep -iPo "(.*)(wireguard)"').read().split()
@ -204,13 +199,11 @@ class Tunnel:
tl = wg_s[::3] tl = wg_s[::3]
return tl return tl
""" """
This will export the tunnels. This will export the tunnels.
A zipfile with current date and time is created A zipfile with current date and time is created
in the user's home directory with correct right in the user's home directory with correct right
""" """
@staticmethod @staticmethod
def export(): def export():
_u1 = str(_u[6:]) _u1 = str(_u[6:])
@ -254,19 +247,26 @@ class Tunnel:
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Select tunnel') wt = _('Select tunnel')
msg_t = _('Please first import tunnel.') msg_t = _('Please first import tunnel')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
except TypeError: except TypeError:
pass pass
@staticmethod
def if_tip():
with open(path_to_file2, 'r') as set_file2:
lines2 = set_file2.readlines()
if 'False\n' in lines2:
return False
else:
return True
tips = Tunnel.if_tip() class Tipi:
"""
Class for Tooltip setting write in File
Calling request path to file
"""
@staticmethod
def if_tip(path):
with open(path, 'r') as set_file2:
lines2 = set_file2.readlines()
if 'False\n' in lines2:
return False
else:
return True
wg_tips = Tipi.if_tip(wg_set)

View File

@ -11,6 +11,7 @@ install_file_with(){
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && sudo cp -u settings.conf /etc/wire_py/ && \ sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && sudo cp -u settings.conf /etc/wire_py/ && \
sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \ sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \ sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \ sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \ sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
sudo cp -u Wire-Py.desktop /usr/share/applications/ && \ sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
@ -25,6 +26,7 @@ install_arch_d(){
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && sudo cp -u settings.conf /etc/wire_py/ && \ sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && sudo cp -u settings.conf /etc/wire_py/ && \
sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \ sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \ sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \ sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \ sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
sudo cp -u Wire-Py.desktop /usr/share/applications/ && \ sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
@ -92,6 +94,7 @@ elif grep -i 'fedora' /etc/os-release > /dev/null 2>&1
sudo cp -u wg_main.py start_wg.py cls_mth_fc.py wirepy.py run_as open_gitea.py /usr/bin/ && \ sudo cp -u wg_main.py start_wg.py cls_mth_fc.py wirepy.py run_as open_gitea.py /usr/bin/ && \
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && \ sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && \
sudo cp -u settings.conf /etc/wire_py/ && \ sudo cp -u settings.conf /etc/wire_py/ && \
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \ sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \ sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \ sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
@ -108,6 +111,7 @@ elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
sudo cp -u wg_main.py start_wg.py cls_mth_fc.py wirepy.py run_as open_gitea.py /usr/bin/ && \ sudo cp -u wg_main.py start_wg.py cls_mth_fc.py wirepy.py run_as open_gitea.py /usr/bin/ && \
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && \ sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && \
sudo cp -u settings.conf /etc/wire_py/ && \ sudo cp -u settings.conf /etc/wire_py/ && \
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \ sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \ sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \ sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \

BIN
languages/de/wirepy.mo Normal file

Binary file not shown.

View File

@ -1,4 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
import gettext import gettext
import locale import locale
import os import os
@ -8,12 +9,17 @@ import tkinter as tk
from pathlib import Path from pathlib import Path
from subprocess import check_call from subprocess import check_call
from tkinter import filedialog, ttk, TclError from tkinter import filedialog, ttk, TclError
from cls_mth_fc import (Tunnel, msg_window, GiteaUpdate, _u, wg_tips, wg_set)
from cls_mth_fc import (Tunnel, msg_window, GiteaUpdate, res, _u, version, path_to_file2, tips)
tcl_path = Path('/usr/share/TK-Themes') tcl_path = Path('/usr/share/TK-Themes')
APP = 'wg_main' ''' 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year '''
version = 'v. 2.02.2425'
res = GiteaUpdate.api_down('https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases', version)
''' Translate '''
APP = 'wirepy'
LOCALE_DIR = "/usr/share/locale/" LOCALE_DIR = "/usr/share/locale/"
locale.bindtextdomain(APP, LOCALE_DIR) locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR) gettext.bindtextdomain(APP, LOCALE_DIR)
@ -40,7 +46,7 @@ class MainWindow(tk.Tk):
self.style = ttk.Style(self) self.style = ttk.Style(self)
self.tk.call('source', str(tcl_path) + '/water.tcl') self.tk.call('source', str(tcl_path) + '/water.tcl')
''' self.tk.call('source', 'TK-Themes/water.tcl') ''' ''' self.tk.call('source', 'TK-Themes/water.tcl') '''
with open(path_to_file2, 'r') as read_file: with open(wg_set, 'r') as read_file:
lines = read_file.readlines() lines = read_file.readlines()
if 'light\n' in lines: if 'light\n' in lines:
self.tk.call('set_theme', 'light') self.tk.call('set_theme', 'light')
@ -79,34 +85,34 @@ class FrameWidgets(ttk.Frame):
def update(): def update():
if set_update.get() == 1: if set_update.get() == 1:
with open(path_to_file2, 'r') as set_file2: with open(wg_set, 'r') as set_file2:
lines2 = set_file2.readlines() lines2 = set_file2.readlines()
lines2[1] = 'off\n' lines2[1] = 'off\n'
with open(path_to_file2, 'w') as set_file2: with open(wg_set, 'w') as set_file2:
set_file2.writelines(lines2) set_file2.writelines(lines2)
if set_update.get() == 0: if set_update.get() == 0:
with open(path_to_file2, 'r') as set_file2: with open(wg_set, 'r') as set_file2:
lines2 = set_file2.readlines() lines2 = set_file2.readlines()
lines2[1] = 'on\n' lines2[1] = 'on\n'
with open(path_to_file2, 'w') as set_file2: with open(wg_set, 'w') as set_file2:
set_file2.writelines(lines2) set_file2.writelines(lines2)
''' Set True or False in file ''' ''' Set True or False in file '''
def tooltip(): def tooltip():
if set_tip.get(): if set_tip.get():
with open(path_to_file2, 'r') as set_file2: with open(wg_set, 'r') as set_file2:
lines2 = set_file2.readlines() lines2 = set_file2.readlines()
lines2[5] = 'False\n' lines2[5] = 'False\n'
with open(path_to_file2, 'w') as set_file2: with open(wg_set, 'w') as set_file2:
set_file2.writelines(lines2) set_file2.writelines(lines2)
else: else:
with open(path_to_file2, 'r') as set_file2: with open(wg_set, 'r') as set_file2:
lines2 = set_file2.readlines() lines2 = set_file2.readlines()
lines2[5] = 'True\n' lines2[5] = 'True\n'
with open(path_to_file2, 'w') as set_file2: with open(wg_set, 'w') as set_file2:
set_file2.writelines(lines2) set_file2.writelines(lines2)
''' Set dark or light ''' ''' Set dark or light '''
@ -115,10 +121,10 @@ class FrameWidgets(ttk.Frame):
if self.tk.call("ttk::style", "theme", "use") == "water-dark": if self.tk.call("ttk::style", "theme", "use") == "water-dark":
''' Set light theme ''' ''' Set light theme '''
self.tk.call('set_theme', 'light') self.tk.call('set_theme', 'light')
with open(path_to_file2, 'r') as theme_set2: with open(wg_set, 'r') as theme_set2:
lines3 = theme_set2.readlines() lines3 = theme_set2.readlines()
lines3[3] = 'light\n' lines3[3] = 'light\n'
with open(path_to_file2, 'w') as theme_set2: with open(wg_set, 'w') as theme_set2:
theme_set2.writelines(lines3) theme_set2.writelines(lines3)
self.color_label() self.color_label()
@ -126,10 +132,10 @@ class FrameWidgets(ttk.Frame):
if not self.tk.call("ttk::style", "theme", "use") == "water-dark": if not self.tk.call("ttk::style", "theme", "use") == "water-dark":
''' Set dark theme ''' ''' Set dark theme '''
self.tk.call('set_theme', 'dark') self.tk.call('set_theme', 'dark')
with open(path_to_file2, 'r') as theme_set2: with open(wg_set, 'r') as theme_set2:
lines4 = theme_set2.readlines() lines4 = theme_set2.readlines()
lines4[3] = 'dark\n' lines4[3] = 'dark\n'
with open(path_to_file2, 'w') as theme_set2: with open(wg_set, 'w') as theme_set2:
theme_set2.writelines(lines4) theme_set2.writelines(lines4)
self.color_label() self.color_label()
@ -172,7 +178,7 @@ class FrameWidgets(ttk.Frame):
window.my_tool_tip.destroy() window.my_tool_tip.destroy()
self.options_btn = ttk.Menubutton(self.menu_frame, text=_('Options')) self.options_btn = ttk.Menubutton(self.menu_frame, text=_('Options'))
self.options_btn.grid(column=1, row=0) self.options_btn.grid(column=1, columnspan=1, row=0)
def sets_enter(event): def sets_enter(event):
""" The mouse moves into the entry widget """ """ The mouse moves into the entry widget """
@ -199,14 +205,14 @@ class FrameWidgets(ttk.Frame):
''' About BTN Menu / Label ''' ''' About BTN Menu / Label '''
self.about_btn = ttk.Button(self.menu_frame, text=_('About'), style='Toolbutton', command=info) self.about_btn = ttk.Button(self.menu_frame, text=_('About'), style='Toolbutton', command=info)
self.about_btn.grid(column=2, row=0) self.about_btn.grid(column=2, columnspan=2, row=0)
self.readme = tk.Menu(self) self.readme = tk.Menu(self)
''' Update and Tooltip Label ''' ''' Update and Tooltip Label '''
self.updates_lb = ttk.Label(self.menu_frame) self.updates_lb = ttk.Label(self.menu_frame)
self.updates_lb.grid(column=3, row=0, padx=10) self.updates_lb.grid(column=4, columnspan=3, row=0, padx=10)
'''View Checkbox for enable or disable Tooltip ''' '''View Checkbox for enable or disable Tooltip '''
if tips: if wg_tips:
set_tip.set(value=False) set_tip.set(value=False)
else: else:
set_tip.set(value=True) set_tip.set(value=True)
@ -245,11 +251,11 @@ class FrameWidgets(ttk.Frame):
self.updates_lb.bind('<Leave>', congratulations_leave) self.updates_lb.bind('<Leave>', congratulations_leave)
else: else:
set_update.set(value=0) set_update.set(value=0)
text = _(f'Update {res} available!') text = f'Update {res} ' + _('available!')
''' Update BTN Menu''' ''' Update BTN Menu'''
self.update_btn = ttk.Menubutton(self.menu_frame, text=text) self.update_btn = ttk.Menubutton(self.menu_frame, text=text)
self.update_btn.grid(column=4, row=0, padx=0) self.update_btn.grid(column=4, columnspan=3, row=0, padx=0)
def download_enter(event): def download_enter(event):
""" The mouse moves into the entry widget """ """ The mouse moves into the entry widget """
@ -266,8 +272,15 @@ class FrameWidgets(ttk.Frame):
self.download = tk.Menu(self, relief='flat') self.download = tk.Menu(self, relief='flat')
self.update_btn.configure(menu=self.download, style='Toolbutton') self.update_btn.configure(menu=self.download, style='Toolbutton')
self.download.add_command(label=_('Download'), command=GiteaUpdate.download(f'https://git.ilunix.de/punix' self.download.add_command(label=_('Download'),
f'/Wire-Py/archive/{res}.zip')) command=lambda: GiteaUpdate.download(f'https://git.ilunix.de/punix'
f'/Wire-Py/archive/'
f'{res}.zip', r'/usr/'
r'share/icons/wp-icons'
r'/48/wg_vpn.png',
r'/usr/share/icons/wp-icons'
r'/48/wg_msg.png', res))
''' Show active Tunnel ''' ''' Show active Tunnel '''
self.a = Tunnel.active() self.a = Tunnel.active()
@ -291,6 +304,11 @@ class FrameWidgets(ttk.Frame):
self.lb_frame3.configure(relief='flat') self.lb_frame3.configure(relief='flat')
self.lb_frame3.grid(column=0, row=5, columnspan=4, sticky='snew', padx=2, pady=2) self.lb_frame3.grid(column=0, row=5, columnspan=4, sticky='snew', padx=2, pady=2)
''' Bottom Frame 5 '''
self.lb_frame4 = ttk.Frame(self)
self.lb_frame4.configure(relief='flat')
self.lb_frame4.grid(column=2, row=5, columnspan=3, sticky='e', padx=15)
''' Show active Label ''' ''' Show active Label '''
self.select_tunnel = None self.select_tunnel = None
self.lb = ttk.Label(self, text=_('Active: ')) self.lb = ttk.Label(self, text=_('Active: '))
@ -407,11 +425,11 @@ class FrameWidgets(ttk.Frame):
pre_key = key[3] pre_key = key[3]
check_call(['nmcli', 'connection', 'delete', select_tl]) check_call(['nmcli', 'connection', 'delete', select_tl])
self.l_box.delete(self.select_tunnel[0]) self.l_box.delete(self.select_tunnel[0])
with open(path_to_file2, 'r') as set_file6: with open(wg_set, 'r') as set_file6:
lines6 = set_file6.readlines() lines6 = set_file6.readlines()
if select_tl == lines6[7].strip() and 'off' not in lines6[7].strip(): if select_tl == lines6[7].strip() and 'off\n' not in lines6[7].strip():
lines6[7] = 'off' lines6[7] = 'off\n'
with open(path_to_file2, 'w') as set_file7: with open(wg_set, 'w') as set_file7:
set_file7.writelines(lines6) set_file7.writelines(lines6)
self.selected_option.set(0) self.selected_option.set(0)
self.autoconnect_var.set(_('no Autoconnect')) self.autoconnect_var.set(_('no Autoconnect'))
@ -474,7 +492,7 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Select tunnel') wt = _('Select tunnel')
msg_t = _('Please select a tunnel from the list.') msg_t = _('Please select a tunnel from the list')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
else: else:
@ -483,7 +501,7 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Select tunnel') wt = _('Select tunnel')
msg_t = _('Please first import tunnel.') msg_t = _('Please first import tunnel')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
''' Button Trash ''' ''' Button Trash '''
@ -548,7 +566,7 @@ class FrameWidgets(ttk.Frame):
self.btn_exp.bind('<Leave>', exp_leave) self.btn_exp.bind('<Leave>', exp_leave)
''' Label Entry ''' ''' Label Entry '''
self.lb_rename = ttk.Entry(self.lb_frame3, width=20) self.lb_rename = ttk.Entry(self.lb_frame4, width=20)
self.lb_rename.grid(column=2, row=0, padx=8, pady=10, sticky='ne') self.lb_rename.grid(column=2, row=0, padx=8, pady=10, sticky='ne')
self.lb_rename.insert(0, _('Max. 12 characters!')) self.lb_rename.insert(0, _('Max. 12 characters!'))
self.lb_rename.config(state='disable') self.lb_rename.config(state='disable')
@ -589,7 +607,7 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Renaming not possible') wt = _('Renaming not possible')
msg_t = _('The new name may contain only 12 characters.') msg_t = _('The new name may contain only 12 characters')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
elif len(self.lb_rename.get()) == 0: elif len(self.lb_rename.get()) == 0:
@ -598,7 +616,7 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Renaming not possible') wt = _('Renaming not possible')
msg_t = _('At least one character must be entered.') msg_t = _('At least one character must be entered')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
elif any(ch in special_characters for ch in self.lb_rename.get()): elif any(ch in special_characters for ch in self.lb_rename.get()):
@ -629,11 +647,11 @@ class FrameWidgets(ttk.Frame):
if self.a != '' and self.a == select_tl: if self.a != '' and self.a == select_tl:
self.a = Tunnel.active() self.a = Tunnel.active()
self.StrVar.set(value=self.a) self.StrVar.set(value=self.a)
with open(path_to_file2, 'r') as set_file5: with open(wg_set, 'r') as set_file5:
lines5 = set_file5.readlines() lines5 = set_file5.readlines()
if select_tl == lines5[7].strip() and 'off' not in lines5[7].strip(): if select_tl == lines5[7].strip() and 'off\n' not in lines5[7].strip():
lines5[7] = new_a_connect lines5[7] = new_a_connect
with open(path_to_file2, 'w') as theme_set5: with open(wg_set, 'w') as theme_set5:
theme_set5.writelines(lines5) theme_set5.writelines(lines5)
self.autoconnect_var.set(value=new_a_connect) self.autoconnect_var.set(value=new_a_connect)
@ -645,11 +663,11 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Renaming not possible') wt = _('Renaming not possible')
msg_t = _('Please select a tunnel from the list.') msg_t = _('Please select a tunnel from the list')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
''' Button Rename ''' ''' Button Rename '''
self.btn_rename = ttk.Button(self.lb_frame3, text=_('Rename'), state='disable', command=tl_rename, padding=4, self.btn_rename = ttk.Button(self.lb_frame4, text=_('Rename'), state='disable', command=tl_rename, padding=4,
style='RnButton.TButton') style='RnButton.TButton')
self.btn_rename.grid(column=3, row=0, padx=5, pady=10, sticky='ne') self.btn_rename.grid(column=3, row=0, padx=5, pady=10, sticky='ne')
@ -886,10 +904,10 @@ class FrameWidgets(ttk.Frame):
select_tl = self.l_box.get(select_tunnel[0]) select_tl = self.l_box.get(select_tunnel[0])
if self.selected_option.get() == 0: if self.selected_option.get() == 0:
with open(path_to_file2, 'r') as set_file3: with open(wg_set, 'r') as set_file3:
lines3 = set_file3.readlines() lines3 = set_file3.readlines()
lines3[7] = 'off' lines3[7] = 'off\n'
with open(path_to_file2, 'w') as set_file3: with open(wg_set, 'w') as set_file3:
set_file3.writelines(lines3) set_file3.writelines(lines3)
tl = Tunnel.list() tl = Tunnel.list()
@ -898,10 +916,10 @@ class FrameWidgets(ttk.Frame):
self.wg_autostart.configure(state='disabled') self.wg_autostart.configure(state='disabled')
if self.selected_option.get() >= 1: if self.selected_option.get() >= 1:
with open(path_to_file2, 'r') as set_file3: with open(wg_set, 'r') as set_file3:
lines3 = set_file3.readlines() lines3 = set_file3.readlines()
lines3[7] = select_tl lines3[7] = select_tl
with open(path_to_file2, 'w') as set_file3: with open(wg_set, 'w') as set_file3:
set_file3.writelines(lines3) set_file3.writelines(lines3)
except IndexError: except IndexError:
@ -915,18 +933,19 @@ class FrameWidgets(ttk.Frame):
Set (on), the selected tunnel is displayed in the label. Set (on), the selected tunnel is displayed in the label.
At (off) the label is first emptied then filled with No Autoconnect At (off) the label is first emptied then filled with No Autoconnect
""" """
with open(path_to_file2, 'r') as set_file4: with open(wg_set, 'r') as set_file4:
lines4 = set_file4.readlines() lines4 = set_file4.readlines()
if lines4[7] != 'off': if lines4[7] != 'off\n':
print(lines4[7])
self.selected_option.set(1) self.selected_option.set(1)
self.autoconnect_var.set('') self.autoconnect_var.set('')
self.auto_con = lines4[7] self.auto_con = lines4[7]
else: else:
self.selected_option.set(0)
self.wg_autostart.configure(state='disabled')
self.auto_con = _('no Autoconnect') self.auto_con = _('no Autoconnect')
self.autoconnect_var.set('') self.autoconnect_var.set('')
self.autoconnect_var = tk.StringVar() self.autoconnect_var = tk.StringVar()
self.autoconnect_var.set(self.auto_con) self.autoconnect_var.set(self.auto_con)
@ -1021,7 +1040,7 @@ class FrameWidgets(ttk.Frame):
def color_label(self): def color_label(self):
""" View activ Tunnel in color green or yellow """ """ View activ Tunnel in color green or yellow """
with open(path_to_file2, 'r') as read_file: with open(wg_set, 'r') as read_file:
lines = read_file.readlines() lines = read_file.readlines()
if 'light\n' in lines: if 'light\n' in lines:
self.lb_tunnel = ttk.Label(self, textvariable=self.StrVar, foreground='green') self.lb_tunnel = ttk.Label(self, textvariable=self.StrVar, foreground='green')
@ -1083,7 +1102,7 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Select tunnel') wt = _('Select tunnel')
msg_t = _('Please select a tunnel from the list.') msg_t = _('Please select a tunnel from the list')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
else: else:
@ -1092,14 +1111,14 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/lx-icons/64/info.png' iw = r'/usr/share/icons/lx-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png' ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = _('Select tunnel') wt = _('Select tunnel')
msg_t = _('Please first import tunnel.') msg_t = _('Please first import tunnel')
msg_window(iw, ii, wt, msg_t) msg_window(iw, ii, wt, msg_t)
class MyToolTip(tk.Toplevel): class MyToolTip(tk.Toplevel):
TIP_X_OFFSET = 20 TIP_X_OFFSET = 20
TIP_Y_OFFSET = 20 TIP_Y_OFFSET = 20
if not tips: if not wg_tips:
AUTO_CLEAR_TIME = 0 AUTO_CLEAR_TIME = 0
else: else:
AUTO_CLEAR_TIME = 2000 # Millisecond. (1/200 sec.) AUTO_CLEAR_TIME = 2000 # Millisecond. (1/200 sec.)