I made a simple demo app for this feature.
Is this how you want it?
Is there anything which doesn't work like expected?
Hope you like it.
EDIT Updated the exe fileChangelog for v1.1:
Added support for 'soldat://' links (you can paste links from rr.soldat.pl!)
Added detection for broken links (e.g. oldat:// instead of soldat://)
Modified structure is now compatible with the one from Soldat links: ip:port/pass (not ip:port//pass anymore)
Fixed made it not replace port and/or pass when not given (example 'ip:/' will not clear port and pass)
Fixed doesn't add '/' to port when paste looks like 'ip:port/'
Funny stuff which works now:
':123' set port to 123
':/passw' set password to passw (but read the restrictions!)
Restrictions:
The feature only works when pasting with ctrl+v.
It doesn't work when you use the context menu to paste.
If you are pasting passwords and they contain dots (.) and you don't add an ip or if your password contains 'localhost' without an ip it will misinterpret it as the ip. This is because it tries to find the ip if the link is only pasted partially (e.g. dat://ip:port/pass).
But normal pasting should work.
If you find bugs tell me before it gets added to Soldat
EDIT2 Updated the exe file once againChangelog for v1.2:
Added support for menu->paste
Modified ctrl+v paste code to work with all sorts of pasting
Fixed Window can be maximized and resized
Fixed Wrong version information
Fixed cursor position set to first char but it should be last char
Please report all kind of bugs you find in version 1.2.
If you can't find bugs and I don't notice any the code gets sent to MM to be added to Soldat.
EDIT3 Updated the exe file to filter out none number chars for the portChangelog for v1.3:
Added Port edit only gets assigned numbers
Modified copy Editfield to include non number chars for testing
Modfied size of copy edit so that the whole text can be read
Modified howto text to be more general about pasting text (not limited to ctrl+v)
Modified size of window so that howto text can be read
EDIT4 Updated the exe file to accept ;:/\|<> as splitting chars for the passwordChangelog for v1.4:
Added ;:/\|<> as splitting chars for the password
Modified Copy text to for easy testing