ui: fix app name casing in UI

* Fix app name casing in UI

* Linter fixes

* Only use NAME variable

* FIx linter errors
This commit is contained in:
Swapnil Devesh 2024-03-05 22:38:56 +05:30 committed by GitHub
parent 51ef2a7fe2
commit 5ee1c6df30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 11 additions and 11 deletions

View File

@ -18,7 +18,7 @@ import pkgutil as _pkgutil
import subprocess as _subprocess
import sys as _sys
NAME = "solaar"
NAME = "Solaar"
try:
__version__ = (

View File

@ -117,7 +117,7 @@ def _receivers(dev_path=None):
yield r
except Exception as e:
logger.exception("opening " + str(dev_info))
_sys.exit("%s: error: %s" % (NAME, str(e)))
_sys.exit("%s: error: %s" % (NAME.lower(), str(e)))
def _receivers_and_devices(dev_path=None):
@ -136,7 +136,7 @@ def _receivers_and_devices(dev_path=None):
yield d
except Exception as e:
logger.exception("opening " + str(dev_info))
_sys.exit("%s: error: %s" % (NAME, str(e)))
_sys.exit("%s: error: %s" % (NAME.lower(), str(e)))
def _find_receiver(receivers, name):

View File

@ -295,7 +295,7 @@ def run(devices, args, find_receiver, find_device):
assert devices
assert args.device
print("%s version %s" % (NAME, __version__))
print("%s version %s" % (NAME.lower(), __version__))
print("")
device_name = args.device.lower()

View File

@ -51,7 +51,7 @@ def _require(module, os_package, gi=None, gi_package=None, gi_version=None):
gi.require_version(gi_package, gi_version)
return importlib.import_module(module)
except (ImportError, ValueError):
sys.exit("%s: missing required system package %s" % (NAME, os_package))
sys.exit("%s: missing required system package %s" % (NAME.lower(), os_package))
battery_icons_style = "regular"

View File

@ -55,7 +55,7 @@ if available:
if logger.isEnabledFor(logging.INFO):
logger.info("starting desktop notifications")
try:
return Notify.init(NAME)
return Notify.init(NAME.lower())
except Exception:
logger.exception("initializing desktop notifications")
available = False
@ -80,15 +80,15 @@ if available:
assert reason
if available and Notify.is_initted():
n = _notifications.get(NAME)
n = _notifications.get(NAME.lower())
if n is None:
n = _notifications[NAME] = Notify.Notification()
n = _notifications[NAME.lower()] = Notify.Notification()
# we need to use the filename here because the notifications daemon
# is an external application that does not know about our icon sets
icon_file = _icons.icon_file(NAME.lower()) if icon is None else _icons.icon_file(icon)
n.update(NAME, reason, icon_file)
n.update(NAME.lower(), reason, icon_file)
n.set_urgency(Notify.Urgency.NORMAL)
n.set_hint("desktop-entry", GLib.Variant("s", NAME.lower()))

View File

@ -182,7 +182,7 @@ try:
ind.set_title(NAME)
ind.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
# ind.set_attention_icon_full(_icon_file(_icons.TRAY_ATTENTION), '') # works poorly for XFCE 16
# ind.set_label(NAME, NAME)
# ind.set_label(NAME.lower(), NAME.lower())
ind.set_menu(menu)
ind.connect("scroll-event", _scroll)
@ -231,7 +231,7 @@ except ImportError:
def _create(menu):
icon = Gtk.StatusIcon.new_from_icon_name(_icons.TRAY_INIT)
icon.set_name(NAME)
icon.set_name(NAME.lower())
icon.set_title(NAME)
icon.set_tooltip_text(NAME)
icon.connect("activate", _window_toggle)