Add Option to hide Gajim on pressing close
This also adds that Gajim gets present if Gajim is launched a second time
This commit is contained in:
parent
a7e53eb04b
commit
1b9c5066f5
|
@ -237,6 +237,7 @@ class Config:
|
||||||
'notification_position_y': [opt_int, -1],
|
'notification_position_y': [opt_int, -1],
|
||||||
'muc_highlight_words': [opt_str, '', _('A semicolon-separated list of words that will be highlighted in group chats.')],
|
'muc_highlight_words': [opt_str, '', _('A semicolon-separated list of words that will be highlighted in group chats.')],
|
||||||
'quit_on_roster_x_button': [opt_bool, False, _('If True, quits Gajim when X button of Window Manager is clicked. This setting is taken into account only if notification icon is used.')],
|
'quit_on_roster_x_button': [opt_bool, False, _('If True, quits Gajim when X button of Window Manager is clicked. This setting is taken into account only if notification icon is used.')],
|
||||||
|
'hide_on_roster_x_button': [opt_bool, False, _('If True, Gajim hides the Roster window on pressing the X button instead of minimizing into the Dock.')],
|
||||||
'show_unread_tab_icon': [opt_bool, False, _('If True, Gajim will display an icon on each tab containing unread messages. Depending on the theme, this icon may be animated.')],
|
'show_unread_tab_icon': [opt_bool, False, _('If True, Gajim will display an icon on each tab containing unread messages. Depending on the theme, this icon may be animated.')],
|
||||||
'show_status_msgs_in_roster': [opt_bool, True, _('If True, Gajim will display the status message, if not empty, for every contact under the contact name in roster window.'), True],
|
'show_status_msgs_in_roster': [opt_bool, True, _('If True, Gajim will display the status message, if not empty, for every contact under the contact name in roster window.'), True],
|
||||||
'show_avatars_in_roster': [opt_bool, True, '', True],
|
'show_avatars_in_roster': [opt_bool, True, '', True],
|
||||||
|
|
|
@ -224,6 +224,9 @@ class GajimApplication(Gtk.Application):
|
||||||
self.set_menubar(menubar)
|
self.set_menubar(menubar)
|
||||||
|
|
||||||
def _activate(self, application):
|
def _activate(self, application):
|
||||||
|
if self.interface is not None:
|
||||||
|
self.interface.roster.window.present()
|
||||||
|
return
|
||||||
from gajim.gui_interface import Interface
|
from gajim.gui_interface import Interface
|
||||||
from gajim import gtkgui_helpers
|
from gajim import gtkgui_helpers
|
||||||
self.interface = Interface()
|
self.interface = Interface()
|
||||||
|
|
|
@ -2406,7 +2406,10 @@ class RosterWindow:
|
||||||
x, y = self.window.get_position()
|
x, y = self.window.get_position()
|
||||||
app.config.set('roster_x-position', x)
|
app.config.set('roster_x-position', x)
|
||||||
app.config.set('roster_y-position', y)
|
app.config.set('roster_y-position', y)
|
||||||
self.window.iconify()
|
if app.config.get('hide_on_roster_x_button'):
|
||||||
|
self.window.hide()
|
||||||
|
else:
|
||||||
|
self.window.iconify()
|
||||||
elif app.config.get('quit_on_roster_x_button'):
|
elif app.config.get('quit_on_roster_x_button'):
|
||||||
self.on_quit_request()
|
self.on_quit_request()
|
||||||
else:
|
else:
|
||||||
|
@ -3755,7 +3758,10 @@ class RosterWindow:
|
||||||
'quit_on_roster_x_button') and ((app.interface.systray_enabled and\
|
'quit_on_roster_x_button') and ((app.interface.systray_enabled and\
|
||||||
app.config.get('trayicon') == 'always') or app.config.get(
|
app.config.get('trayicon') == 'always') or app.config.get(
|
||||||
'allow_hide_roster')):
|
'allow_hide_roster')):
|
||||||
self.window.iconify()
|
if app.config.get('hide_on_roster_x_button'):
|
||||||
|
self.window.hide()
|
||||||
|
else:
|
||||||
|
self.window.iconify()
|
||||||
elif event.get_state() & Gdk.ModifierType.CONTROL_MASK and event.keyval == \
|
elif event.get_state() & Gdk.ModifierType.CONTROL_MASK and event.keyval == \
|
||||||
Gdk.KEY_i:
|
Gdk.KEY_i:
|
||||||
treeselection = self.tree.get_selection()
|
treeselection = self.tree.get_selection()
|
||||||
|
|
Loading…
Reference in New Issue