Browse Source

qt gui: use QGuiApplication.setApplicationName

I noticed that when running from source on macOS, the OS menubar has an "About Python" menu item,
instead of an "About Electrum" menu item. I tried to fix that by this, but actually it is not working :P

Nevertheless, this looks useful at least on Linux and Windows. E.g. when instantiating a new dialog
without an explicit title, the qt application name is used as default.

The application name, without this change AFAICS was already "Electrum" when running any of the binaries.
However when running from source, it was in some cases "python" or "run_electrum" or even "electrum-4"
(depending on OS and how the main script is started).
Now it is consistent -- except on macOS it still is not, as there it really wants to look for a .plist...
master
SomberNight 1 year ago
parent
commit
2ebf8fd9ef
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/gui/qt/__init__.py

1
electrum/gui/qt/__init__.py

@ -123,6 +123,7 @@ class ElectrumGui(BaseElectrumGui, Logger):
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
if hasattr(QGuiApplication, 'setDesktopFileName'):
QGuiApplication.setDesktopFileName('electrum.desktop')
QGuiApplication.setApplicationName("Electrum")
self.gui_thread = threading.current_thread()
self.windows = [] # type: List[ElectrumWindow]
self.efilter = OpenFileEventFilter(self.windows)

Loading…
Cancel
Save