mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
macOS: duplicate Qt "Preferences" menu item
There is a standardised location along with reserved hotkey for "Preferences" in applications on macOS. Let's put *another* preferences menu item there. The duplicate items ensure that - an electrum user coming from a different OS, - a macOS user used to the standardised preferences location, will both find "Preferences" easily.
This commit is contained in:
parent
54e1520ee4
commit
40dc54e8b8
1 changed files with 12 additions and 4 deletions
|
@ -45,7 +45,8 @@ from PyQt5.QtWidgets import (QMessageBox, QComboBox, QSystemTrayIcon, QTabWidget
|
||||||
QVBoxLayout, QGridLayout, QLineEdit,
|
QVBoxLayout, QGridLayout, QLineEdit,
|
||||||
QHBoxLayout, QPushButton, QScrollArea, QTextEdit,
|
QHBoxLayout, QPushButton, QScrollArea, QTextEdit,
|
||||||
QShortcut, QMainWindow, QCompleter, QInputDialog,
|
QShortcut, QMainWindow, QCompleter, QInputDialog,
|
||||||
QWidget, QSizePolicy, QStatusBar, QToolTip, QDialog)
|
QWidget, QSizePolicy, QStatusBar, QToolTip, QDialog,
|
||||||
|
QMenu, QAction)
|
||||||
|
|
||||||
import electrum
|
import electrum
|
||||||
from electrum import (keystore, ecc, constants, util, bitcoin, commands,
|
from electrum import (keystore, ecc, constants, util, bitcoin, commands,
|
||||||
|
@ -692,10 +693,17 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
add_toggle_action(view_menu, self.contacts_tab)
|
add_toggle_action(view_menu, self.contacts_tab)
|
||||||
add_toggle_action(view_menu, self.console_tab)
|
add_toggle_action(view_menu, self.console_tab)
|
||||||
|
|
||||||
tools_menu = menubar.addMenu(_("&Tools"))
|
tools_menu = menubar.addMenu(_("&Tools")) # type: QMenu
|
||||||
|
preferences_action = tools_menu.addAction(_("Preferences"), self.settings_dialog) # type: QAction
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
# "Settings"/"Preferences" are all reserved keywords in macOS.
|
||||||
|
# preferences_action will get picked up based on name (and put into a standardized location,
|
||||||
|
# and given a standard reserved hotkey)
|
||||||
|
# Hence, this menu item will be at a "uniform location re macOS processes"
|
||||||
|
preferences_action.setMenuRole(QAction.PreferencesRole) # make sure OS recognizes it as preferences
|
||||||
|
# Add another preferences item, to also have a "uniform location for Electrum between different OSes"
|
||||||
|
tools_menu.addAction(_("Electrum preferences"), self.settings_dialog)
|
||||||
|
|
||||||
# Settings / Preferences are all reserved keywords in macOS using this as work around
|
|
||||||
tools_menu.addAction(_("Electrum preferences") if sys.platform == 'darwin' else _("Preferences"), self.settings_dialog)
|
|
||||||
tools_menu.addAction(_("&Network"), self.gui_object.show_network_dialog).setEnabled(bool(self.network))
|
tools_menu.addAction(_("&Network"), self.gui_object.show_network_dialog).setEnabled(bool(self.network))
|
||||||
tools_menu.addAction(_("&Lightning Network"), self.gui_object.show_lightning_dialog).setEnabled(bool(self.wallet.has_lightning() and self.network))
|
tools_menu.addAction(_("&Lightning Network"), self.gui_object.show_lightning_dialog).setEnabled(bool(self.wallet.has_lightning() and self.network))
|
||||||
tools_menu.addAction(_("Local &Watchtower"), self.gui_object.show_watchtower_dialog).setEnabled(bool(self.network and self.network.local_watchtower))
|
tools_menu.addAction(_("Local &Watchtower"), self.gui_object.show_watchtower_dialog).setEnabled(bool(self.network and self.network.local_watchtower))
|
||||||
|
|
Loading…
Add table
Reference in a new issue