From 55ed173c39f97264095c34ed1b0c7e25aca75999 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Mon, 5 Apr 2021 12:30:00 -0400 Subject: [PATCH] ui: replace deprecated GTK stock values --- lib/solaar/ui/action.py | 4 ++-- lib/solaar/ui/diversion_rules.py | 6 +++--- lib/solaar/ui/tray.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/solaar/ui/action.py b/lib/solaar/ui/action.py index 492b1207..8d2ae84f 100644 --- a/lib/solaar/ui/action.py +++ b/lib/solaar/ui/action.py @@ -67,7 +67,7 @@ def make_toggle(name, label, function, stock_id=None, *args): # action.set_sensitive(notify.available) # toggle_notifications = make_toggle('notifications', 'Notifications', _toggle_notifications) -about = make('help-about', _('About') + ' ' + NAME, _show_about_window, stock_id=Gtk.STOCK_ABOUT) +about = make('help-about', _('About') + ' ' + NAME, _show_about_window, stock_id='help-about') # # @@ -96,7 +96,7 @@ def unpair(window, device): _('Unpair') + ' ' + device.name + ' ?' ) qdialog.set_icon_name('remove') - qdialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) + qdialog.add_button(_('Cancel'), Gtk.ResponseType.CANCEL) qdialog.add_button(_('Unpair'), Gtk.ResponseType.ACCEPT) choice = qdialog.run() qdialog.destroy() diff --git a/lib/solaar/ui/diversion_rules.py b/lib/solaar/ui/diversion_rules.py index 4091e673..01ec5d26 100644 --- a/lib/solaar/ui/diversion_rules.py +++ b/lib/solaar/ui/diversion_rules.py @@ -136,11 +136,11 @@ class DiversionDialog: ) dialog.set_default_size(400, 100) dialog.add_buttons( - Gtk.STOCK_YES, + _('Yes'), Gtk.ResponseType.YES, - Gtk.STOCK_NO, + _('No'), Gtk.ResponseType.NO, - Gtk.STOCK_CANCEL, + _('Cancel'), Gtk.ResponseType.CANCEL, ) dialog.set_markup(_('If you choose No, changes will be lost when Solaar is closed.')) diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index d37f7188..beccbb21 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -65,7 +65,7 @@ def _create_menu(quit_handler): from .action import about, make menu.append(about.create_menu_item()) - menu.append(make('application-exit', _('Quit'), quit_handler, stock_id=Gtk.STOCK_QUIT).create_menu_item()) + menu.append(make('application-exit', _('Quit'), quit_handler, stock_id='application-exit').create_menu_item()) del about, make menu.show_all()