Ticket #3971: 0001-AP-password-dialog-theme-the-ok-button-correctly-SL-.patch

File 0001-AP-password-dialog-theme-the-ok-button-correctly-SL-.patch, 1.6 KB (added by erikos, 10 years ago)

AP password dialog: theme the ok button correctly

  • src/jarabe/desktop/keydialog.py

    From 09b6a9187bd4ba2030bece50fe391ad2fe6045b5 Mon Sep 17 00:00:00 2001
    From: Simon Schampijer <simon@laptop.org>
    Date: Mon, 8 Oct 2012 07:00:13 +0200
    Subject: [PATCH shell] AP password dialog: theme the ok button correctly, SL
     #3971
    
    Use gtk-dialog-add-action-widget to add buttons to the
    GtkDialog that use the Sugar Icons.
    
    Signed-off-by: Simon Schampijer <simon@laptop.org>
    ---
     src/jarabe/desktop/keydialog.py | 13 +++++++++++--
     1 file changed, 11 insertions(+), 2 deletions(-)
    
    diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
    index 5215d05..0230f95 100644
    a b from gettext import gettext as _ 
    2121from gi.repository import Gtk
    2222import dbus
    2323
     24from sugar3.graphics.icon import Icon
     25
    2426from jarabe.model import network
    2527
    2628
    class KeyDialog(Gtk.Dialog): 
    9092                            " the wireless network '%s'.") % (display_name, ))
    9193        self.vbox.pack_start(label, True, True, 0)
    9294
    93         self.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
    94                          Gtk.STOCK_OK, Gtk.ResponseType.OK)
     95        button = Gtk.Button()
     96        button.set_image(Icon(icon_name='dialog-cancel'))
     97        button.set_label(_('Cancel'))
     98        self.add_action_widget(button, Gtk.ResponseType.CANCEL)
     99        button = Gtk.Button()
     100        button.set_image(Icon(icon_name='dialog-ok'))
     101        button.set_label(_('Ok'))
     102        self.add_action_widget(button, Gtk.ResponseType.OK)
     103
    95104        self.set_default_response(Gtk.ResponseType.OK)
    96105
    97106    def add_key_entry(self):