ui: make about and quit buttons more translatable
This commit is contained in:
parent
0fbeebf121
commit
453be19356
|
@ -20,12 +20,10 @@
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
from gi.repository import Gdk, Gtk
|
from gi.repository import Gdk, Gtk
|
||||||
from solaar import NAME
|
|
||||||
from solaar.i18n import _
|
from solaar.i18n import _
|
||||||
|
|
||||||
from ..ui import error_dialog
|
from ..ui import error_dialog
|
||||||
from . import pair_window
|
from . import pair_window
|
||||||
from .about import show_window as _show_about_window
|
|
||||||
|
|
||||||
# from logging import getLogger
|
# from logging import getLogger
|
||||||
# _log = getLogger(__name__)
|
# _log = getLogger(__name__)
|
||||||
|
@ -67,12 +65,6 @@ def make_toggle(name, label, function, stock_id=None, *args):
|
||||||
# action.set_sensitive(notify.available)
|
# action.set_sensitive(notify.available)
|
||||||
# toggle_notifications = make_toggle('notifications', 'Notifications', _toggle_notifications)
|
# toggle_notifications = make_toggle('notifications', 'Notifications', _toggle_notifications)
|
||||||
|
|
||||||
about = make('help-about', _('About') + ' ' + NAME, _show_about_window, stock_id='help-about')
|
|
||||||
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
def pair(window, receiver):
|
def pair(window, receiver):
|
||||||
assert receiver
|
assert receiver
|
||||||
|
|
|
@ -34,6 +34,7 @@ from solaar import NAME
|
||||||
from solaar.i18n import _
|
from solaar.i18n import _
|
||||||
|
|
||||||
from . import icons as _icons
|
from . import icons as _icons
|
||||||
|
from .about import show_window as _show_about_window
|
||||||
from .window import popup as _window_popup
|
from .window import popup as _window_popup
|
||||||
from .window import toggle as _window_toggle
|
from .window import toggle as _window_toggle
|
||||||
|
|
||||||
|
@ -63,10 +64,10 @@ def _create_menu(quit_handler):
|
||||||
menu.append(no_receiver)
|
menu.append(no_receiver)
|
||||||
menu.append(Gtk.SeparatorMenuItem.new())
|
menu.append(Gtk.SeparatorMenuItem.new())
|
||||||
|
|
||||||
from .action import about, make
|
from .action import make
|
||||||
menu.append(about.create_menu_item())
|
menu.append(make('help-about', _('About %s') % NAME, _show_about_window, stock_id='help-about').create_menu_item())
|
||||||
menu.append(make('application-exit', _('Quit') + ' ' + NAME, quit_handler, stock_id='application-exit').create_menu_item())
|
menu.append(make('application-exit', _('Quit %s') % NAME, quit_handler, stock_id='application-exit').create_menu_item())
|
||||||
del about, make
|
del make
|
||||||
|
|
||||||
menu.show_all()
|
menu.show_all()
|
||||||
|
|
||||||
|
|
|
@ -322,13 +322,11 @@ def _create_window_layout():
|
||||||
bottom_buttons_box = Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL)
|
bottom_buttons_box = Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL)
|
||||||
bottom_buttons_box.set_layout(Gtk.ButtonBoxStyle.START)
|
bottom_buttons_box.set_layout(Gtk.ButtonBoxStyle.START)
|
||||||
bottom_buttons_box.set_spacing(20)
|
bottom_buttons_box.set_spacing(20)
|
||||||
quit_button = _new_button(_('Quit') + ' ' + NAME, 'application-exit', icon_size=_SMALL_BUTTON_ICON_SIZE, clicked=destroy)
|
quit_button = _new_button(_('Quit %s') % NAME, 'application-exit', _SMALL_BUTTON_ICON_SIZE, clicked=destroy)
|
||||||
bottom_buttons_box.add(quit_button)
|
bottom_buttons_box.add(quit_button)
|
||||||
about_button = _new_button(
|
about_button = _new_button(_('About %s') % NAME, 'help-about', _SMALL_BUTTON_ICON_SIZE, clicked=_show_about_window)
|
||||||
_('About') + ' ' + NAME, 'help-about', icon_size=_SMALL_BUTTON_ICON_SIZE, clicked=_show_about_window
|
|
||||||
)
|
|
||||||
bottom_buttons_box.add(about_button)
|
bottom_buttons_box.add(about_button)
|
||||||
diversion_button = _new_button(_('Rule Editor'), '', icon_size=_SMALL_BUTTON_ICON_SIZE, clicked=_show_diversion_window)
|
diversion_button = _new_button(_('Rule Editor'), '', _SMALL_BUTTON_ICON_SIZE, clicked=_show_diversion_window)
|
||||||
bottom_buttons_box.add(diversion_button)
|
bottom_buttons_box.add(diversion_button)
|
||||||
bottom_buttons_box.set_child_secondary(diversion_button, True)
|
bottom_buttons_box.set_child_secondary(diversion_button, True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue