mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 02:07:18 +02:00
fix: do not add server if already in config
This commit is contained in:
parent
af4d79f190
commit
24d054ca16
@ -32,7 +32,8 @@ class ConnectionManager:
|
||||
StoredFunc(self._server_timeout), destroy_first=True
|
||||
)
|
||||
|
||||
print("DEBUG")
|
||||
# TODO: resolve real ip
|
||||
print("UNIMPLEMENTED: get rules")
|
||||
print(res)
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@ -43,7 +44,8 @@ class ConnectionManager:
|
||||
StoredFunc(self._server_timeout), destroy_first=True
|
||||
)
|
||||
|
||||
print("DEBUG")
|
||||
# TODO: resolve real ip
|
||||
print("UNIMPLEMENTED: get rules")
|
||||
print(res)
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
@ -55,7 +57,7 @@ class ConnectionManager:
|
||||
)
|
||||
|
||||
# TODO: add to history if successful
|
||||
print("DEBUG")
|
||||
print("UNIMPLEMENTED: get rules")
|
||||
print(res)
|
||||
|
||||
@call_on_thread(dialog.querying)
|
||||
|
||||
@ -260,6 +260,7 @@ class ServerModelManager:
|
||||
fqip = Servers.response_to_fq_ip(response)
|
||||
config_man = self.controller.get_config_man()
|
||||
|
||||
# TODO: less convoluted
|
||||
if delete:
|
||||
# NOTE: abort early if Saved Servers tab was not loaded yet
|
||||
config_man.remove_saved_server(fqip)
|
||||
@ -268,6 +269,9 @@ class ServerModelManager:
|
||||
return
|
||||
proxy_man.remove_row_from_control(record)
|
||||
else:
|
||||
if config_man.is_in_favs(fqip):
|
||||
self.thread_man.set_cleanup_func(StoredFunc(self._cleanup_when_no_model))
|
||||
return
|
||||
config_man.add_saved_server(fqip)
|
||||
if proxy_man.has_control_model() is False:
|
||||
self.thread_man.set_cleanup_func(StoredFunc(self._cleanup_when_no_model))
|
||||
|
||||
@ -151,6 +151,7 @@ class FavPanel(Gtk.Frame):
|
||||
scrollable_label.add(self.fav_label)
|
||||
|
||||
self.fav_button = SteamConnectButton()
|
||||
self.fav_button.connect("clicked", self._on_connect_clicked)
|
||||
if server_name is None:
|
||||
self.fav_button.set_sensitive(False)
|
||||
copy = ClipboardButton(self.controller, self.get_fav_ip)
|
||||
@ -162,6 +163,9 @@ class FavPanel(Gtk.Frame):
|
||||
|
||||
self.add(grid)
|
||||
|
||||
def _on_connect_clicked(self, button: Gtk.Button) -> None:
|
||||
self.controller.connect_by_str(self.server_ip)
|
||||
|
||||
def get_fav_ip(self) -> str:
|
||||
return self.server_ip
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ from dzgui.views.components.buttonbox import ButtonBox
|
||||
from dzgui.views.components.filter_panel import FilterPanel
|
||||
from dzgui.views.components.mod_panel import ModSelectionPanel
|
||||
from dzgui.views.components.buttons import RefreshButton, KeysButton
|
||||
from dzgui.const.constants import NO_EXPAND, NO_FILL, FILL, NO_PADDING
|
||||
from dzgui.const.constants import EXPAND, NO_EXPAND, NO_FILL, FILL, NO_PADDING
|
||||
|
||||
import gi
|
||||
|
||||
|
||||
@ -32,6 +32,14 @@ class Statusbar(Gtk.Grid):
|
||||
self.attach(self.statusbar, 0, 0, 3, 1)
|
||||
self.attach_next_to(self.spinner, self.statusbar, Gtk.PositionType.RIGHT, 3, 1)
|
||||
|
||||
# TODO: pack version event box in right panel into hbox with update button
|
||||
# TODO: spawns a modal or just jumps right to install page
|
||||
#from dzgui.views.components.buttons import IconTextButton
|
||||
#b = IconTextButton("dialog-information-symbolic", label="Updates available")
|
||||
#b.set_halign(Gtk.Align.END)
|
||||
#b.set_hexpand(True)
|
||||
#self.attach_next_to(b, self.spinner, Gtk.PositionType.RIGHT, 3, 1)
|
||||
|
||||
self.players = ""
|
||||
|
||||
controller.get_menu().connect("generic_treesel_changed", self._help_row_changed)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user