Esempio n. 1
0
    def confirm_install(self, message):
        yield self._switch_to_main_window(
            _('Need to confirm installation of distribution packages'))

        from zeroinstall.injector.download import DownloadAborted
        import dialog
        import gtk
        box = gtk.MessageDialog(self.mainwindow.window,
                                gtk.DIALOG_DESTROY_WITH_PARENT,
                                gtk.MESSAGE_QUESTION, gtk.BUTTONS_CANCEL,
                                str(message))
        box.set_position(gtk.WIN_POS_CENTER)

        install = dialog.MixedButton(_('Install'), gtk.STOCK_OK)
        install.set_can_default(True)
        box.add_action_widget(install, gtk.RESPONSE_OK)
        install.show_all()
        box.set_default_response(gtk.RESPONSE_OK)
        box.show()

        response = dialog.DialogResponse(box)
        yield response
        box.destroy()

        if response.response != gtk.RESPONSE_OK:
            raise DownloadAborted()
Esempio n. 2
0
    def confirm_install(self, message):
        from zeroinstall.injector.download import DownloadAborted
        from zeroinstall.gtkui import gtkutils
        import gtk
        box = gtk.MessageDialog(self.compiler.dialog,
                                gtk.DIALOG_DESTROY_WITH_PARENT,
                                gtk.MESSAGE_QUESTION, gtk.BUTTONS_CANCEL,
                                message)
        box.set_position(gtk.WIN_POS_CENTER)

        install = gtkutils.MixedButton('Install', gtk.STOCK_OK)
        install.set_flags(gtk.CAN_DEFAULT)
        box.add_action_widget(install, gtk.RESPONSE_OK)
        install.show_all()
        box.set_default_response(gtk.RESPONSE_OK)
        box.show()

        response = gtkutils.DialogResponse(box)
        yield response
        box.destroy()

        if response.response != gtk.RESPONSE_OK:
            raise DownloadAborted()