Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix app name casing in UI #2365

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/solaar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import subprocess as _subprocess
import sys as _sys

NAME = "solaar"
NAME = "Solaar"

try:
__version__ = (
Expand Down
4 changes: 2 additions & 2 deletions lib/solaar/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion lib/solaar/cli/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lib/solaar/gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions lib/solaar/ui/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def init():
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
Expand All @@ -80,15 +80,15 @@ def alert(reason, icon=None):
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()))

Expand Down
4 changes: 2 additions & 2 deletions lib/solaar/ui/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def _create(menu):
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)
Expand Down Expand Up @@ -231,7 +231,7 @@ def attention(reason=None):

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)
Expand Down
Loading