Skip to content

Commit

Permalink
#1701: the session-name may come from the server, so reset the menu i…
Browse files Browse the repository at this point in the history
…tem label after the handshake

git-svn-id: https://xpra.org/svn/Xpra/trunk@17505 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 26, 2017
1 parent 7772cd8 commit 61b18a8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/xpra/client/gtk_base/gtk_tray_menu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,19 @@ def make_aboutmenuitem(self):
return self.menuitem("About Xpra", "xpra.png", None, about)

def make_sessioninfomenuitem(self):
title = "Session Info"
if self.client.session_name and self.client.session_name!="Xpra session":
title = "Info: %s" % self.client.session_name
def get_title():
if self.client.session_name and self.client.session_name!="Xpra session":
return "Info: %s" % self.client.session_name
return "Session Info"
def show_session_info_cb(*_args):
#we define a generic callback to remove the arguments
#(which contain the menu widget and are of no interest to the 'show_session_info' function)
self.show_session_info()
return self.handshake_menuitem(title, "statistics.png", None, show_session_info_cb)
sessioninfomenuitem = self.handshake_menuitem(get_title(), "statistics.png", None, show_session_info_cb)
def set_menuitem_title(*_args):
sessioninfomenuitem.set_label(get_title())
self.client.after_handshake(set_menuitem_title)
return sessioninfomenuitem

def make_bugreportmenuitem(self):
def show_bug_report_cb(*_args):
Expand Down

0 comments on commit 61b18a8

Please sign in to comment.