Skip to content
Snippets Groups Projects
Commit fc627fc1 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Use appmenu only if system supports it

parent 276daa99
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@
##
import os
import sys
import logging
import locale
import uuid
......@@ -500,3 +501,10 @@ def get_priority(account, show):
def log(domain):
root = 'gajim.'
return logging.getLogger(root + domain)
def prefers_app_menu():
if sys.platform == 'darwin':
return True
if sys.platform == 'win32':
return False
return app.prefers_app_menu()
......@@ -215,10 +215,9 @@ class GajimApplication(Gtk.Application):
builder.add_from_file(path)
menubar = builder.get_object("menubar")
appmenu = builder.get_object("appmenu")
if os.name != 'nt':
if app.prefers_app_menu():
self.set_app_menu(appmenu)
else:
# Dont set Application Menu for Windows
# Add it to the menubar instead
menubar.prepend_submenu('Gajim', appmenu)
self.set_menubar(menubar)
......
......@@ -767,9 +767,9 @@ def get_account_menu(account):
def build_accounts_menu():
menubar = app.app.get_menubar()
# Accounts Submenu
menu_position = 0
if os.name == 'nt':
menu_position = 1
menu_position = 1
if app.prefers_app_menu():
menu_position = 0
acc_menu = menubar.get_item_link(menu_position, 'submenu')
acc_menu.remove_all()
......@@ -796,9 +796,9 @@ def build_bookmark_menu(account):
if not bookmark_menu:
return
menu_position = 0
if os.name == 'nt':
menu_position = 1
menu_position = 1
if app.prefers_app_menu():
menu_position = 0
# Accounts Submenu
acc_menu = menubar.get_item_link(menu_position, 'submenu')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment