Exemplo n.º 1
0
 def __init__(self, controller, *args, **kwargs):
     if self.is_automatic:
         self.page = None
         return
     self.controller = controller
     from gi.repository import Gtk
     builder = Gtk.Builder()
     self.controller.add_builder(builder)
     builder.add_from_file(os.path.join(
         os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui'))
     builder.connect_signals(self)
     self.page = builder.get_object('stepPrepare')
     self.prepare_download_updates = builder.get_object(
         'prepare_download_updates')
     self.prepare_nonfree_software = builder.get_object(
         'prepare_nonfree_software')
     self.prepare_sufficient_space = builder.get_object(
         'prepare_sufficient_space')
     self.prepare_foss_disclaimer = builder.get_object(
         'prepare_foss_disclaimer')
     self.prepare_foss_disclaimer_extra = builder.get_object(
         'prepare_foss_disclaimer_extra_label')
     self.prepare_power_source = builder.get_object('prepare_power_source')
     if upower.has_battery():
         upower.setup_power_watch(self.prepare_power_source)
     else:
         self.prepare_power_source.hide()
     self.prepare_network_connection = builder.get_object(
         'prepare_network_connection')
     self.plugin_widgets = self.page
Exemplo n.º 2
0
 def __init__(self, controller, *args, **kwargs):
     if self.is_automatic:
         self.page = None
         return
     self.controller = controller
     from gi.repository import Gtk
     builder = Gtk.Builder()
     self.controller.add_builder(builder)
     builder.add_from_file(os.path.join(
         os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui'))
     builder.connect_signals(self)
     self.page = builder.get_object('stepPrepare')
     self.prepare_download_updates = builder.get_object(
         'prepare_download_updates')
     self.prepare_nonfree_software = builder.get_object(
         'prepare_nonfree_software')
     self.prepare_sufficient_space = builder.get_object(
         'prepare_sufficient_space')
     self.prepare_foss_disclaimer = builder.get_object(
         'prepare_foss_disclaimer')
     self.prepare_foss_disclaimer_extra = builder.get_object(
         'prepare_foss_disclaimer_extra_label')
     self.prepare_power_source = builder.get_object('prepare_power_source')
     if upower.has_battery():
         upower.setup_power_watch(self.prepare_power_source)
     else:
         self.prepare_power_source.hide()
     self.prepare_network_connection = builder.get_object(
         'prepare_network_connection')
     self.plugin_widgets = self.page
Exemplo n.º 3
0
 def __init__(self, controller, *args, **kwargs):
     from ubiquity.qtwidgets import StateBox
     if 'UBIQUITY_AUTOMATIC' in os.environ:
         self.page = None
         return
     self.controller = controller
     try:
         from PyQt4 import uic
         self.page = uic.loadUi('/usr/share/ubiquity/qt/stepPrepare.ui')
         self.prepare_download_updates = self.page.prepare_download_updates
         self.prepare_nonfree_software = self.page.prepare_nonfree_software
         self.prepare_foss_disclaimer = self.page.prepare_foss_disclaimer
         self.prepare_sufficient_space = StateBox(self.page)
         self.page.vbox1.addWidget(self.prepare_sufficient_space)
         # TODO we should set these up and tear them down while on this page.
         try:
             self.prepare_power_source = StateBox(self.page)
             if upower.has_battery():
                 upower.setup_power_watch(self.prepare_power_source)
                 self.page.vbox1.addWidget(self.prepare_power_source)
             else:
                 self.prepare_power_source.hide()
         except Exception, e:
             # TODO use an inconsistent state?
             print 'unable to set up power source watch:', e
         try:
             self.prepare_network_connection = StateBox(self.page)
             self.page.vbox1.addWidget(self.prepare_network_connection)
         except Exception, e:
             print 'unable to set up network connection watch:', e
 def __init__(self, controller, *args, **kwargs):
     from ubiquity.qtwidgets import StateBox
     if 'UBIQUITY_AUTOMATIC' in os.environ:
         self.page = None
         return
     self.controller = controller
     try:
         from PyQt4 import uic
         self.page = uic.loadUi('/usr/share/ubiquity/qt/stepPrepare.ui')
         self.prepare_download_updates = self.page.prepare_download_updates
         self.prepare_nonfree_software = self.page.prepare_nonfree_software
         self.prepare_foss_disclaimer = self.page.prepare_foss_disclaimer
         self.prepare_sufficient_space = StateBox(self.page)
         self.page.vbox1.addWidget(self.prepare_sufficient_space)
         # TODO we should set these up and tear them down while on this page.
         try:
             self.prepare_power_source = StateBox(self.page)
             if upower.has_battery():
                 upower.setup_power_watch(self.prepare_power_source)
                 self.page.vbox1.addWidget(self.prepare_power_source)
             else:
                 self.prepare_power_source.hide()
         except Exception, e:
             # TODO use an inconsistent state?
             print 'unable to set up power source watch:', e
         try:
             self.prepare_network_connection = StateBox(self.page)
             self.page.vbox1.addWidget(self.prepare_network_connection)
         except Exception, e:
             print 'unable to set up network connection watch:', e
Exemplo n.º 5
0
 def __init__(self, controller, *args, **kwargs):
     from ubiquity.qtwidgets import StateBox
     if self.is_automatic:
         self.page = None
         return
     self.controller = controller
     try:
         from PyQt4 import uic
         from PyQt4 import QtGui
         self.page = uic.loadUi('/usr/share/ubiquity/qt/stepPrepare.ui')
         self.prepare_download_updates = self.page.prepare_download_updates
         self.prepare_nonfree_software = self.page.prepare_nonfree_software
         self.prepare_foss_disclaimer = self.page.prepare_foss_disclaimer
         self.prepare_sufficient_space = StateBox(self.page)
         self.page.vbox1.addWidget(self.prepare_sufficient_space)
         self.secureboot_label = self.page.secureboot_label
         self.disable_secureboot = self.page.disable_secureboot
         self.password = self.page.password
         self.verified_password = self.page.verified_password
         self.password_extra_label = self.page.password_extra_label
         self.badPassword = self.page.badPassword
         self.badPassword.setPixmap(QtGui.QPixmap(
             "/usr/share/icons/oxygen/16x16/status/dialog-warning.png"))
         # TODO we should set these up and tear them down while on this
         # page.
         try:
             self.prepare_power_source = StateBox(self.page)
             if upower.has_battery():
                 upower.setup_power_watch(self.prepare_power_source)
                 self.page.vbox1.addWidget(self.prepare_power_source)
             else:
                 self.prepare_power_source.hide()
         except Exception as e:
             # TODO use an inconsistent state?
             print('unable to set up power source watch:', e)
         try:
             self.prepare_network_connection = StateBox(self.page)
             self.page.vbox1.addWidget(self.prepare_network_connection)
         except Exception as e:
             print('unable to set up network connection watch:', e)
     except Exception as e:
         print("Could not create prepare page:", str(e), file=sys.stderr)
         self.debug('Could not create prepare page: %s', e)
         self.page = None
     self.set_using_secureboot(False)
     self.plugin_widgets = self.page
     # quick fix for Neon, hide these, work out if the code
     # should disappear or what should happen
     self.prepare_sufficient_space.hide()
     #self.prepare_power_source.hide()
     #self.prepare_network_connection.hide()
     self.page.prepare_best_results.hide()
     # Maui does not need this
     self.prepare_download_updates.hide()
     self.prepare_nonfree_software.hide()
     self.prepare_foss_disclaimer.hide()
Exemplo n.º 6
0
 def __init__(self, controller, *args, **kwargs):
     from ubiquity.qtwidgets import StateBox
     self.controller = controller
     try:
         from PyQt5 import uic
         from PyQt5 import QtGui, QtWidgets
         # No worries, this has nothing to do with NM, we just want the
         # generic progress indicator from there
         from ubiquity.frontend.kde_components.nmwidgets import ProgressIndicator
         self.page = uic.loadUi('/usr/share/ubiquity/qt/stepPrepare.ui')
         self.prepare_minimal_install = self.page.prepare_minimal_install
         self.qt_label_minimal_install = self.page.qt_label_minimal_install
         self.prepare_download_updates = self.page.prepare_download_updates
         self.prepare_nonfree_software = self.page.prepare_nonfree_software
         self.prepare_foss_disclaimer = self.page.prepare_foss_disclaimer
         self.prepare_sufficient_space = StateBox(self.page)
         self.secureboot_label = self.page.secureboot_label
         self.disable_secureboot = self.page.disable_secureboot
         self.password = self.page.password
         self.verified_password = self.page.verified_password
         self.password_extra_label = self.page.password_extra_label
         self.badPassword = self.page.badPassword
         self.badPassword.setPixmap(
             QtGui.QPixmap(
                 "/usr/share/icons/oxygen/16x16/status/dialog-warning.png"))
         self.progress_indicator = ProgressIndicator()
         self.progress_indicator.hide()
         layout = QtWidgets.QHBoxLayout(self.page.progress_container)
         layout.addWidget(self.progress_indicator)
         # TODO we should set these up and tear them down while on this
         # page.
         try:
             self.prepare_power_source = StateBox(self.page)
             if upower.has_battery():
                 upower.setup_power_watch(self.prepare_power_source)
             else:
                 self.prepare_power_source.hide()
         except Exception as e:
             # TODO use an inconsistent state?
             print('unable to set up power source watch:', e)
         if not os.path.exists(minimal_install_rlist_path):
             self.qt_label_minimal_install.hide()
             self.prepare_minimal_install.hide()
         try:
             self.prepare_network_connection = StateBox(self.page)
         except Exception as e:
             print('unable to set up network connection watch:', e)
     except Exception as e:
         print("Could not create prepare page:", str(e), file=sys.stderr)
         self.debug('Could not create prepare page: %s', e)
         self.page = None
     self.set_using_secureboot(False)
     self.plugin_widgets = self.page
Exemplo n.º 7
0
    def __init__(self, controller, *args, **kwargs):
        if self.is_automatic:
            self.page = None
            return
        self.controller = controller
        from ubiquity.gtkwidgets import Builder
        builder = Builder()
        self.controller.add_builder(builder)
        builder.add_from_file(os.path.join(
            os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui'))
        builder.connect_signals(self)

        # Get all objects + add internal child(s)
        all_widgets = builder.get_object_ids()
        for wdg in all_widgets:
            setattr(self, wdg, builder.get_object(wdg))

        self.password_strength_pages = {
            'empty': 0,
            'too_short': 1,
            'good': 2,
        }
        self.password_match_pages = {
            'empty': 0,
            'mismatch': 1,
            'ok': 2,
        }

        if upower.has_battery():
            upower.setup_power_watch(self.prepare_power_source)
        else:
            self.prepare_power_source.hide()
        self.prepare_network_connection = builder.get_object(
            'prepare_network_connection')

        self.using_secureboot = False

        self.secureboot_box.set_sensitive(False)
        self.password_grid.set_sensitive(False)

        self.minimal_install_vbox.set_visible(
            os.path.exists(minimal_install_rlist_path))

        self.prepare_page = builder.get_object('stepPrepare')
        self.insufficient_space_page = builder.get_object('stepNoSpace')
        self.rst_page = builder.get_object('stepRST')
        self.rst_label = builder.get_object('label_using_rst')
        self.rst_label.connect('activate-link', self.on_link_clicked)
        self.current_page = self.prepare_page
        self.plugin_widgets = self.prepare_page
        self.plugin_optional_widgets = [self.insufficient_space_page,
                                        self.rst_page]
Exemplo n.º 8
0
    def __init__(self, controller, *args, **kwargs):
        if self.is_automatic:
            self.page = None
            return
        self.controller = controller
        from ubiquity.gtkwidgets import Builder
        builder = Builder()
        self.controller.add_builder(builder)
        builder.add_from_file(os.path.join(
            os.environ['UBIQUITY_GLADE'], 'stepPrepare.ui'))
        builder.connect_signals(self)

        # Get all objects + add internal child(s)
        all_widgets = builder.get_object_ids()
        for wdg in all_widgets:
            setattr(self, wdg, builder.get_object(wdg))

        self.password_strength_pages = {
            'empty': 0,
            'too_short': 1,
            'good': 2,
        }
        self.password_match_pages = {
            'empty': 0,
            'mismatch': 1,
            'ok': 2,
        }

        if upower.has_battery():
            upower.setup_power_watch(self.prepare_power_source)
        else:
            self.prepare_power_source.hide()
        self.prepare_network_connection = builder.get_object(
            'prepare_network_connection')

        self.using_secureboot = False

        self.secureboot_box.set_sensitive(False)
        self.password_grid.set_sensitive(False)

        self.minimal_install_vbox.set_visible(
            os.path.exists(minimal_install_rlist_path))

        self.prepare_page = builder.get_object('stepPrepare')
        self.insufficient_space_page = builder.get_object('stepNoSpace')
        self.current_page = self.prepare_page
        self.plugin_widgets = self.prepare_page
        self.plugin_optional_widgets = [self.insufficient_space_page]
Exemplo n.º 9
0
 def __init__(self, controller, *args, **kwargs):
     from ubiquity.qtwidgets import StateBox
     if self.is_automatic:
         self.page = None
         return
     self.controller = controller
     try:
         from PyQt4 import uic
         self.page = uic.loadUi('/usr/share/ubiquity/qt/stepPrepare.ui')
         self.prepare_download_updates = self.page.prepare_download_updates
         self.prepare_nonfree_software = self.page.prepare_nonfree_software
         self.prepare_foss_disclaimer = self.page.prepare_foss_disclaimer
         self.prepare_sufficient_space = StateBox(self.page)
         self.page.vbox1.addWidget(self.prepare_sufficient_space)
         self.prepare_download_updates.setVisible(False)
         self.prepare_nonfree_software.setVisible(False)
         self.prepare_foss_disclaimer.setVisible(False)
         try:
             self.prepare_power_source = StateBox(self.page)
             if upower.has_battery():
                 upower.setup_power_watch(self.prepare_power_source)
                 self.page.vbox1.addWidget(self.prepare_power_source)
             else:
                 self.prepare_power_source.hide()
         except Exception as e:
             # TODO use an inconsistent state?
             print('unable to set up power source watch:', e)
         try:
             self.prepare_network_connection = StateBox(self.page)
             self.page.vbox1.addWidget(self.prepare_network_connection)
         except Exception as e:
             print('unable to set up network connection watch:', e)
     except Exception as e:
         print("Could not create prepare page:", str(e), file=sys.stderr)
         self.debug('Could not create prepare page: %s', e)
         self.page = None
     self.plugin_widgets = self.page
Exemplo n.º 10
0
 def __init__(self, controller, *args, **kwargs):
     from ubiquity.qtwidgets import StateBox
     if self.is_automatic:
         self.page = None
         return
     self.controller = controller
     try:
         from PyQt4 import uic
         self.page = uic.loadUi('/usr/share/ubiquity/qt/stepPrepare.ui')
         self.prepare_download_updates = self.page.prepare_download_updates
         self.prepare_nonfree_software = self.page.prepare_nonfree_software
         self.prepare_foss_disclaimer = self.page.prepare_foss_disclaimer
         self.prepare_sufficient_space = StateBox(self.page)
         self.page.vbox1.addWidget(self.prepare_sufficient_space)
         self.prepare_download_updates.setVisible(False)
         self.prepare_nonfree_software.setVisible(False)
         self.prepare_foss_disclaimer.setVisible(False)
         try:
             self.prepare_power_source = StateBox(self.page)
             if upower.has_battery():
                 upower.setup_power_watch(self.prepare_power_source)
                 self.page.vbox1.addWidget(self.prepare_power_source)
             else:
                 self.prepare_power_source.hide()
         except Exception as e:
             # TODO use an inconsistent state?
             print('unable to set up power source watch:', e)
         try:
             self.prepare_network_connection = StateBox(self.page)
             self.page.vbox1.addWidget(self.prepare_network_connection)
         except Exception as e:
             print('unable to set up network connection watch:', e)
     except Exception as e:
         print("Could not create prepare page:", str(e), file=sys.stderr)
         self.debug('Could not create prepare page: %s', e)
         self.page = None
     self.plugin_widgets = self.page