mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 07:51:27 +00:00
network dialog: include protocol in server address field (#6624)
* network-dialog: include protocol in server field In this way it is now possible again to use plain server connections without reverting it automatically to tls connections. * qt network dialog: hide trailing protocol ":s" in TextEdit This hides some complexity from casual users, while still allowing advanced users to set the protocol. Co-authored-by: SomberNight <somber.night@protonmail.com>
This commit is contained in:
parent
83143f421a
commit
292016d283
2 changed files with 7 additions and 1 deletions
|
@ -327,7 +327,7 @@ class NetworkChoiceLayout(object):
|
|||
server = net_params.server
|
||||
auto_connect = net_params.auto_connect
|
||||
if not self.server_e.hasFocus():
|
||||
self.server_e.setText(server.net_addr_str())
|
||||
self.server_e.setText(server.to_friendly_name())
|
||||
self.autoconnect_cb.setChecked(auto_connect)
|
||||
|
||||
height_str = "%d "%(self.network.get_local_height()) + _('blocks')
|
||||
|
|
|
@ -294,6 +294,12 @@ class ServerAddr:
|
|||
protocol = PREFERRED_NETWORK_PROTOCOL
|
||||
return ServerAddr(host=host, port=port, protocol=protocol)
|
||||
|
||||
def to_friendly_name(self) -> str:
|
||||
# note: this method is closely linked to from_str_with_inference
|
||||
if self.protocol == 's': # hide trailing ":s"
|
||||
return self.net_addr_str()
|
||||
return str(self)
|
||||
|
||||
def __str__(self):
|
||||
return '{}:{}'.format(self.net_addr_str(), self.protocol)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue