diff --git a/gajim/chat_control.py b/gajim/chat_control.py index b492d0998..3e60fbf2d 100644 --- a/gajim/chat_control.py +++ b/gajim/chat_control.py @@ -107,6 +107,8 @@ class ChatControl(ChatControlBase): # Menu for the HeaderBar self.control_menu = gui_menu_builder.get_singlechat_menu( self.control_id) + settings_menu = self.xml.get_object('settings_menu') + settings_menu.set_menu_model(self.control_menu) self._audio_banner_image = self.xml.get_object('audio_banner_image') self._video_banner_image = self.xml.get_object('video_banner_image') diff --git a/gajim/data/gui/chat_control.ui b/gajim/data/gui/chat_control.ui index 74f560bae..613eba6e6 100644 --- a/gajim/data/gui/chat_control.ui +++ b/gajim/data/gui/chat_control.ui @@ -1,5 +1,5 @@ - + @@ -626,58 +626,6 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - True - Show a list of emoticons (Alt+M) - none - - - True - False - face-smile-symbolic - - - - - - False - True - 0 - - - - - True - True - False - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - none - formattings_menu - - - True - False - format-text-bold-symbolic - 1 - - - - - - False - True - 1 - - True @@ -687,7 +635,7 @@ True True end - 2 + 0 @@ -791,7 +739,31 @@ audio-mic-volume-low False True end - 3 + 1 + + + + + True + True + True + none + + + True + False + open-menu-symbolic + + + + + + False + True + end + 2 @@ -818,7 +790,7 @@ audio-mic-volume-low False False end - 4 + 3 @@ -843,7 +815,7 @@ audio-mic-volume-low False True end - 5 + 4 @@ -870,9 +842,61 @@ audio-mic-volume-low False False end + 5 + + + + + True + True + True + Show a list of emoticons (Alt+M) + none + + + True + False + face-smile-symbolic + + + + + + False + True 6 + + + True + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + none + formattings_menu + + + True + False + format-text-bold-symbolic + 1 + + + + + + False + True + 7 + + diff --git a/gajim/data/gui/groupchat_control.ui b/gajim/data/gui/groupchat_control.ui index 8e0169d09..eb58e2c20 100644 --- a/gajim/data/gui/groupchat_control.ui +++ b/gajim/data/gui/groupchat_control.ui @@ -1,5 +1,5 @@ - + @@ -221,6 +221,107 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + True + True + none + + + True + False + open-menu-symbolic + + + + + + False + True + end + 0 + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + none + + + True + False + gtk-dialog-authentication + 1 + + + + + + False + False + end + 1 + + + + + True + True + True + Choose an encryption + none + + + True + False + channel-secure-symbolic + + + + + + False + True + end + 2 + + + + + True + True + False + True + none + + + True + False + mail-attachment-symbolic + + + + + + False + False + end + 3 + + True @@ -242,7 +343,7 @@ False True - 0 + 4 @@ -270,34 +371,7 @@ False True - 1 - - - - - True - False - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - none - - - True - False - gtk-dialog-authentication - 1 - - - - - - False - False - end - 2 + 5 @@ -312,57 +386,7 @@ True True - 4 - - - - - True - True - True - Choose an encryption - none - - - True - False - channel-secure-symbolic - - - - - - False - True - end - 5 - - - - - True - True - False - True - none - - - True - False - mail-attachment-symbolic - - - - - - False - False - end - 6 + 7 diff --git a/gajim/data/gui/message_window.ui b/gajim/data/gui/message_window.ui index 854cd7db3..79efdaac4 100644 --- a/gajim/data/gui/message_window.ui +++ b/gajim/data/gui/message_window.ui @@ -1,5 +1,5 @@ - + @@ -64,25 +64,6 @@ - - True - False - True - - - True - True - True - - - True - False - open-menu-symbolic - - - - - MessageWindow False @@ -96,5 +77,8 @@ True + + + diff --git a/gajim/data/gui/roster_window.ui b/gajim/data/gui/roster_window.ui index 4601484bc..cac95c47e 100644 --- a/gajim/data/gui/roster_window.ui +++ b/gajim/data/gui/roster_window.ui @@ -1,5 +1,5 @@ - + @@ -115,29 +115,8 @@ - - - True - False - Gajim - True - - - True - True - True - True - - - True - False - open-menu-symbolic - - - - - end - + + diff --git a/gajim/groupchat_control.py b/gajim/groupchat_control.py index a5b6a82ce..c1aeb87d8 100644 --- a/gajim/groupchat_control.py +++ b/gajim/groupchat_control.py @@ -482,6 +482,8 @@ class GroupchatControl(ChatControlBase): self.gc_tooltip = tooltips.GCTooltip() self.control_menu = gui_menu_builder.get_groupchat_menu(self.control_id) + settings_menu = self.xml.get_object('settings_menu') + settings_menu.set_menu_model(self.control_menu) app.ged.register_event_handler('gc-presence-received', ged.GUI1, self._nec_gc_presence_received) diff --git a/gajim/message_window.py b/gajim/message_window.py index 80941f216..53db62741 100644 --- a/gajim/message_window.py +++ b/gajim/message_window.py @@ -101,18 +101,6 @@ class MessageWindow(object): orig_window.destroy() del orig_window - # Set headermenu - # single-window mode: show the header menu on the roster window - # all other modes: add the headerbar to the new window - # A headerbar has to be set before the window calls show() - if parent_window: - self.header_menu = app.interface.roster.header_menu - self.header_menu.show() - else: - self.header_menu = self.xml.get_object('header_menu') - headerbar = self.xml.get_object('headerbar') - self.window.set_titlebar(headerbar) - # NOTE: we use 'connect_after' here because in # MessageWindowMgr._new_window we register handler that saves window # state when closing it, and it should be called before @@ -170,9 +158,6 @@ class MessageWindow(object): self.notebook.set_show_border(app.config.get('tabs_border')) self.show_icon() - def set_header_menu(self, menu): - self.header_menu.set_menu_model(menu) - def change_account_name(self, old_name, new_name): if old_name in self._controls: self._controls[new_name] = self._controls[old_name] @@ -589,7 +574,6 @@ class MessageWindow(object): ask any confirmation """ def close(ctrl): - self.remove_headermenu(self.notebook, ctrl) if reason is not None: # We are leaving gc with a status message ctrl.shutdown(reason) else: # We are leaving gc without status message or it's a chat @@ -627,7 +611,6 @@ class MessageWindow(object): def on_minimize(ctrl): if method != self.CLOSE_COMMAND: - self.remove_headermenu(self.notebook, ctrl) ctrl.minimize() self.check_tabs() return @@ -639,13 +622,6 @@ class MessageWindow(object): else: ctrl.allow_shutdown(method, on_yes, on_no, on_minimize) - def remove_headermenu(self, notebook, ctrl): - page_num = notebook.page_num(ctrl.widget) - if page_num == notebook.get_current_page(): - self.set_header_menu(None) - elif notebook.get_n_pages() == 1: - self.set_header_menu(None) - def check_tabs(self): if self.parent_paned: # Do nothing in single window mode @@ -866,7 +842,6 @@ class MessageWindow(object): new_ctrl = self._widget_to_control(notebook.get_nth_page(page_num)) new_ctrl.set_control_active(True) self.show_title(control = new_ctrl) - self.set_header_menu(new_ctrl.control_menu) control = self.get_active_control() if isinstance(control, ChatControlBase): @@ -1321,7 +1296,6 @@ class MessageWindowMgr(GObject.GObject): gtkgui_helpers.resize_window(w.window, app.config.get('roster_width'), app.config.get('roster_height')) - self.hide_header_bar(self.parent_win) self._windows = {} @@ -1335,12 +1309,6 @@ class MessageWindowMgr(GObject.GObject): ctrl.update_actions() mw.new_tab(ctrl) - @staticmethod - def hide_header_bar(parent_win): - header_bar = parent_win.get_titlebar() - for child in header_bar.get_children(): - child.hide() - def save_opened_controls(self): if not app.config.get('remember_opened_chat_controls'): return diff --git a/gajim/roster_window.py b/gajim/roster_window.py index e0cdfd6c8..20ec90497 100644 --- a/gajim/roster_window.py +++ b/gajim/roster_window.py @@ -5675,13 +5675,6 @@ class RosterWindow: app.interface.msg_win_mgr.connect('window-delete', self.on_message_window_delete) - # Set headermenu but hide it. - # MessageWindow will show it if we are in single-window mode - headerbar = self.xml.get_object('headerbar') - self.window.set_titlebar(headerbar) - self.header_menu = self.xml.get_object('header_menu') - self.header_menu.hide() - self.advanced_menus = [] # We keep them to destroy them if app.config.get('roster_window_skip_taskbar'): self.window.set_property('skip-taskbar-hint', True)