Skip to content

Commit

Permalink
Fix app name casing in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
sidevesh authored Mar 4, 2024
1 parent 51ef2a7 commit c1a8c5e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions lib/solaar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import sys as _sys

NAME = "solaar"
DISPLAY_NAME = "Solaar"

try:
__version__ = (
Expand Down
6 changes: 3 additions & 3 deletions lib/solaar/ui/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from gi.repository import Gtk

from solaar import NAME, __version__
from solaar import NAME, DISPLAY_NAME, __version__
from solaar.i18n import _

#
Expand All @@ -32,7 +32,7 @@
def _create():
about = Gtk.AboutDialog()

about.set_program_name(NAME)
about.set_program_name(DISPLAY_NAME)
about.set_version(__version__)
about.set_comments(_("Manages Logitech receivers,\nkeyboards, mice, and tablets."))
about.set_icon_name(NAME.lower())
Expand Down Expand Up @@ -83,7 +83,7 @@ def _create():
)

about.set_website("https://pwr-solaar.github.io/Solaar")
about.set_website_label(NAME)
about.set_website_label(DISPLAY_NAME)

about.connect("response", lambda x, y: x.hide())

Expand Down
14 changes: 7 additions & 7 deletions lib/solaar/ui/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import solaar.gtk as gtk

from solaar import NAME
from solaar import NAME, DISPLAY_NAME
from solaar.i18n import _

from . import icons as _icons
Expand Down Expand Up @@ -60,8 +60,8 @@ def _create_menu(quit_handler):
menu.append(no_receiver)
menu.append(Gtk.SeparatorMenuItem.new())

menu.append(_make("help-about", _("About %s") % NAME, _show_about_window, stock_id="help-about").create_menu_item())
menu.append(_make("application-exit", _("Quit %s") % NAME, quit_handler, stock_id="application-exit").create_menu_item())
menu.append(_make("help-about", _("About %s") % DISPLAY_NAME, _show_about_window, stock_id="help-about").create_menu_item())
menu.append(_make("application-exit", _("Quit %s") % DISPLAY_NAME, quit_handler, stock_id="application-exit").create_menu_item())

menu.show_all()

Expand Down Expand Up @@ -179,7 +179,7 @@ def _create(menu):
ind = AppIndicator3.Indicator.new(
"indicator-solaar", _icon_file(_icons.TRAY_INIT), AppIndicator3.IndicatorCategory.HARDWARE
)
ind.set_title(NAME)
ind.set_title(DISPLAY_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)
Expand Down Expand Up @@ -232,8 +232,8 @@ def attention(reason=None):
def _create(menu):
icon = Gtk.StatusIcon.new_from_icon_name(_icons.TRAY_INIT)
icon.set_name(NAME)
icon.set_title(NAME)
icon.set_tooltip_text(NAME)
icon.set_title(DISPLAY_NAME)
icon.set_tooltip_text(DISPLAY_NAME)
icon.connect("activate", _window_toggle)
icon.connect("scroll-event", _scroll)
icon.connect("popup-menu", lambda icon, button, time: menu.popup(None, None, icon.position_menu, icon, button, time))
Expand Down Expand Up @@ -292,7 +292,7 @@ def attention(reason=None):

def _generate_tooltip_lines():
if not _devices_info:
yield "<b>%s</b>: " % NAME + _("no receiver")
yield "<b>%s</b>: " % DISPLAY_NAME + _("no receiver")
return

yield from _generate_description_lines()
Expand Down
10 changes: 5 additions & 5 deletions lib/solaar/ui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from logitech_receiver.common import NamedInts as _NamedInts
from logitech_receiver.status import KEYS as _K

from solaar import NAME
from solaar import NAME, DISPLAY_NAME
from solaar.i18n import _, ngettext

from . import action as _action
Expand Down Expand Up @@ -315,9 +315,9 @@ def _create_window_layout():
bottom_buttons_box = Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL)
bottom_buttons_box.set_layout(Gtk.ButtonBoxStyle.START)
bottom_buttons_box.set_spacing(20)
quit_button = _new_button(_("Quit %s") % NAME, "application-exit", _SMALL_BUTTON_ICON_SIZE, clicked=destroy)
quit_button = _new_button(_("Quit %s") % DISPLAY_NAME, "application-exit", _SMALL_BUTTON_ICON_SIZE, clicked=destroy)
bottom_buttons_box.add(quit_button)
about_button = _new_button(_("About %s") % NAME, "help-about", _SMALL_BUTTON_ICON_SIZE, clicked=_show_about_window)
about_button = _new_button(_("About %s") % DISPLAY_NAME, "help-about", _SMALL_BUTTON_ICON_SIZE, clicked=_show_about_window)
bottom_buttons_box.add(about_button)
diversion_button = _new_button(
_("Rule Editor"), "", _SMALL_BUTTON_ICON_SIZE, clicked=lambda *_trigger: _show_diversion_window(_model)
Expand All @@ -326,7 +326,7 @@ def _create_window_layout():
bottom_buttons_box.set_child_secondary(diversion_button, True)

# solaar_version = Gtk.Label()
# solaar_version.set_markup('<small>' + NAME + ' v' + VERSION + '</small>')
# solaar_version.set_markup('<small>' + DISPLAY_NAME + ' v' + VERSION + '</small>')
# bottom_buttons_box.add(solaar_version)
# bottom_buttons_box.set_child_secondary(solaar_version, True)

Expand All @@ -343,7 +343,7 @@ def _create_window_layout():

def _create(delete_action):
window = Gtk.Window()
window.set_title(NAME)
window.set_title(DISPLAY_NAME)
window.set_role("status-window")

# window.set_type_hint(Gdk.WindowTypeHint.UTILITY)
Expand Down

0 comments on commit c1a8c5e

Please sign in to comment.