-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add profile delete button in GUI #326
Comments
The profile should disappear from the GUI if deleted from the disk. But note that if any connections are active deleted profiles may still show up in the menu list until the last active connection is disconnected. |
I too would like the added delete feature instead of going into the drive to manually remove entries. Will be very useful when testing multiple connections. |
Hi! I want to try to implement this function. I already figured out how to add new pop-up menu item for config/connection removal, but I'm not really experienced in WinAPI so I could use your suggestion/guidance for best way to implement function to remove the config file directory from the disk. It also would really help if you could give info about what such function has to do in order to inform other parts of the program about executed removal. |
Currently there is no way for the program to notice that a config file is deleted. The item will stay in the menu listing (until the GUI is restarted) but when attempted to connect, it will fail with "file not found error". Its not too hard to change that, and we may do "one day". If that is acceptable, you can just delete the file. The reason why I haven't implemented a delete menu is because an ovpn file may have dependency files --- like certificates, scripts etc. Just deleting the .ovpn alone can leave unused files behind. We have a config parser and one can parse and find the dependencies and delete them too, but that's trickier than it looks. We can't be sure no other configs depend on those files. Two or more .ovpn files sharing a certificate or key is not uncommon. The root of the problem is that config files and their dependencies end up in the folder in two different ways -- via import and via user copying them manually. To provide a clean add/delete/edit interface to the user, OpenVPN-GUI has to take full control of the "configuration store", track dependencies and their re-use, should not allow the user to directly access the store etc.. That would be a major overhaul. I would suggest to just navigate to the folder and delete the files manually. We can add a menu to open the config folder to make this easier. We keep config files in their original form, unedited, and do not hide them away in some program-specific folder. They are all in %USERPROFILE%\OpenVPN for the user to see --- or in the global-config folder, but those cannot be deleted without admin privileges. A "delete" feature applied only to configs imported via the import menu could be easier to implement. For now, each of those end up in a new subfolder containing a single .ovpn file with no dependencies. So deletion is less likely to affect other configs. |
Thanks for your answer! |
That looks useful if coupled with code to also update the menu listing to match the changes. As for the current behaviour of not removing deleted files from the menu, as I wrote earlier, "Its not too hard to change... " that. When changes do not reflect in the menu it could be very confusing to the user. Or force a restart of the GUI to recognize the changes. From the same view, the user could also re-organize the config folder and thus the nested config menu listing, not just prune files and folders. So, this could be a global menu item like "Manage Configs"? If the normal file-explorer dialog is used, we can put the onus on the user to know which files/folders can be safely deleted or moved around. |
@pitfisher I have implemented the part of updating the menu when files are deleted. Also, when new configs are added now they appear within the correct parent menu (instead of in the root menu) in the nested menu view. You will have to either set the config menu view ( This has to be thoroughly tested before going upstream. Could you try to give it a test run and try to break it by adding or removing configs manually, deleting all configs, starting with none, one or many etc. ? You could also use it as starting point for the enhancement you have in mind. |
@pitfisher did you get a chance to test the above? |
I imported a lot of profiles.ovpn Then I deleted them from the folder, but they all remained in the GUI. And it has grown. Openvpn gui does not have a delete profile button.
How to get rid of unnecessary profiles in gui at the moment?
The text was updated successfully, but these errors were encountered: