fix: do not add server if already in config

This commit is contained in:
aclist committed 2026-04-18 20:56:29 +09:00
1 parent af4d79f190
commit 24d054ca16
5 files changed
+22 -4

No files matched your search

+4
View File
@@ -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
+1 -1
View File
@@ -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
+8
View File
@@ -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)