예제 #1
0
    def notify_alert(self, title, msg):
        """Raise standard notify alert"""
        alert = NotifyAlert(title=title, msg=msg)

        def response(alert, response_id, self):
            self.remove_alert(alert)

        alert.connect('response', response, self)
        alert.show_all()
        self.add_alert(alert)
예제 #2
0
    def _confirm_save(self):
        color1 = self.colors[0].upper()
        color2 = self.colors[1].upper()

        settings = Gio.Settings("org.sugarlabs.user")
        settings.set_string("color", "%s,%s" % (color1, color2))

        alert = NotifyAlert()
        alert.props.title = _('Saving colors')
        alert.props.msg = _(
            'A restart is required before your new colors will appear.')
        alert.connect("response", self._notify_response_cb)
        self.add_alert(alert)
        alert.show_all()