1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2025-06-28 20:08:59 +02:00

fix: duplicate options in context menu

This commit is contained in:
aclist 2024-11-03 22:22:46 +09:00
parent abcbb1b427
commit c01f9714f8
3 changed files with 15 additions and 8 deletions
helpers

View file

@ -779,11 +779,12 @@ class TreeView(Gtk.TreeView):
return
for item in items:
if subcontext == "Server browser" or "Recent servers" and item == "Add to my servers":
record = "%s:%s" %(self.get_column_at_index(7), self.get_column_at_index(8))
proc = call_out(widget, "is_in_favs", record)
if proc.returncode == 0:
item = "Remove from my servers"
if subcontext == "Server browser" or "Recent servers":
if item == "Add to my servers":
record = "%s:%s" %(self.get_column_at_index(7), self.get_column_at_index(8))
proc = call_out(widget, "is_in_favs", record)
if proc.returncode == 0:
item = "Remove from my servers"
item = Gtk.MenuItem(label=item)
item.connect("activate", self._on_menu_click)
self.menu.append(item)