コード例 #1
0
    def __init__(self, distro):
        BaseFrontend.__init__(self, distro)

        with misc.raised_privileges():
            self.console = open('/dev/console', 'w')
        if not self.console:
            self.console = sys.stdout # better than crashing
        self.installing = False
        self.progress_position = ubiquity.progressposition.ProgressPosition()
        self.progress_val = 0
        self.progress_info = ''
        self.mainloop = GObject.MainLoop()

        self.pages = []
        for mod in self.modules:
            if hasattr(mod.module, 'PageNoninteractive'):
                mod.controller = ubiquity.frontend.base.Controller(self)
                mod.ui_class = mod.module.PageNoninteractive
                mod.ui = mod.ui_class(mod.controller)
                self.pages.append(mod)

        i18n.reset_locale(self)

        if self.oem_config:
            misc.execute_root('apt-install', 'oem-config-gtk')
コード例 #2
0
    def __init__(self, distro):
        BaseFrontend.__init__(self, distro)

        with misc.raised_privileges():
            self.console = open('/dev/console', 'w')
        if not self.console:
            self.console = sys.stdout  # better than crashing
        self.installing = False
        self.progress_position = ubiquity.progressposition.ProgressPosition()
        self.progress_val = 0
        self.progress_info = ''
        self.mainloop = GObject.MainLoop()

        self.pages = []
        for mod in self.modules:
            if hasattr(mod.module, 'PageNoninteractive'):
                mod.controller = ubiquity.frontend.base.Controller(self)
                mod.ui_class = mod.module.PageNoninteractive
                mod.ui = mod.ui_class(mod.controller)
                self.pages.append(mod)

        i18n.reset_locale(self)

        if self.oem_config:
            misc.execute_root('apt-install', 'oem-config-gtk')
コード例 #3
0
    def cleanup(self):
        # edit by kobe
        # model = 'pc105'
        # layout = 'cn'
        # variant = ''
        # options = ''
        model = self.db.get('keyboard-configuration/modelcode')
        layout = self.db.get('keyboard-configuration/layoutcode')
        variant = self.db.get('keyboard-configuration/variantcode')
        options = self.db.get('keyboard-configuration/optionscode')
        if options:
            options_list = options.split(',')
        else:
            options_list = []
        self.apply_real_keyboard(model, layout, variant, options_list)

        plugin.Plugin.cleanup(self)
        i18n.reset_locale(self.frontend)
        self.frontend.stop_debconf()
        self.ui.controller.translate(just_me=False, not_me=True, reget=True)

        # edit by kobe
        if layout == '':
            return
        self.rewrite_xorg_conf(model, layout, variant, options)
コード例 #4
0
ファイル: debconf_ui.py プロジェクト: pkt/ubiquity.squibby
    def __init__(self, distro):
        BaseFrontend.__init__(self, distro)

        if self.oem_user_config:
            self.db.info('ubiquity/text/oem_user_config_title')
        else:
            self.db.info('ubiquity/text/live_installer')

        self.previous_excepthook = sys.excepthook
        sys.excepthook = self.excepthook

        # Set default language.
        i18n.reset_locale(self)

        self.stop_debconf()
コード例 #5
0
    def __init__(self, distro):
        BaseFrontend.__init__(self, distro)

        if self.oem_user_config:
            self.db.info('ubiquity/text/oem_user_config_title')
        else:
            self.db.info('ubiquity/text/live_installer')

        self.previous_excepthook = sys.excepthook
        sys.excepthook = self.excepthook

        # Set default language.
        i18n.reset_locale(self)

        self.stop_debconf()
コード例 #6
0
ファイル: ubi-language.py プロジェクト: DirkHaar/ubiquity
 def cleanup(self):
     plugin.Plugin.cleanup(self)
     i18n.reset_locale(self.frontend)
     self.frontend.stop_debconf()
     self.ui.controller.translate(just_me=False, not_me=True, reget=True)
コード例 #7
0
ファイル: kde_ui.py プロジェクト: Jolicloud/ubiquity
    def __init__(self, distro):
        BaseFrontend.__init__(self, distro)

        self.previous_excepthook = sys.excepthook
        sys.excepthook = self.excepthook

        appName     = "kubuntu-ubiquity"
        catalog     = ""
        programName = ki18n ("Installer")
        ver         = "1.0"
        description = ki18n ("Live CD Installer for Kubuntu")
        rights      = KAboutData.License_GPL
        copy        = ki18n ("(c) 2006 Canonical Ltd")
        text        = ki18n ("none")
        homePage    = "http://wiki.kubuntu.org/KubuntuUbiquity"
        bugEmail    = "*****@*****.**"

        about = KAboutData (appName, catalog, programName, ver, description,
                            rights, copy, text, homePage, bugEmail)
        about.addAuthor(ki18n("Jonathan Riddell"), KLocalizedString() ,"*****@*****.**")
        about.addAuthor(ki18n("Roman Shtylman"), KLocalizedString() ,"*****@*****.**")
        KCmdLineArgs.init([""],about)

        # KApplication won't initialise if real UID != effective UID.  On
        # the other hand, we can't talk to D-Bus unless the effective user
        # is the live CD user.  Oh dear.  The solution is to use saved IDs:
        # if we hide our rootliness in the saved IDs, then neither
        # KApplication nor D-Bus will spot it.
        drop_privileges_save()
        try:
            self.app = KApplication()
            self.app.setStyleSheet(file(os.path.join(UIDIR, "style.qss")).read())
        finally:
            regain_privileges_save()

        self.ui = UbiquityUI()

        # handle smaller screens (old school eee pc
        if (QApplication.desktop().screenGeometry().height() < 560):
            self.ui.main_frame.setFixedHeight(470)
            self.ui.main_frame.setStyleSheet(file(os.path.join(UIDIR, "style_small.qss")).read())

        # initially the steps widget is not visible
        # it becomes visible once the first step becomes active
        self.ui.steps_widget.setVisible(False)
        self.ui.content_widget.setVisible(False)

        if 'UBIQUITY_GREETER' in os.environ:
            self.ui.minimize_button.hide()

        self.ui.setWindowState(self.ui.windowState() ^ Qt.WindowFullScreen)

        self.ui.setWizard(self)
        #self.ui.setWindowFlags(Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowMinMaxButtonsHint)

        #hide the minimize button if in "install only" mode
        if 'UBIQUITY_ONLY' in os.environ or 'UBIQUITY_GREETER' in os.environ:
            self.ui.minimize_button.setVisible(False)

        self.stackLayout = QStackedLayout(self.ui.widgetStack)

        self.pages = []
        self.pagesindex = 0
        self.pageslen = 0
        for mod in self.modules:
            if hasattr(mod.module, 'PageKde'):
                mod.ui_class = mod.module.PageKde
                mod.controller = Controller(self)
                mod.ui = mod.ui_class(mod.controller)
                widgets = mod.ui.get('plugin_widgets')
                optional_widgets = mod.ui.get('plugin_optional_widgets')
                breadcrumb = mod.ui.get('plugin_breadcrumb')
                if widgets or optional_widgets:
                    def fill_out(widget_list):
                        rv = []
                        if not isinstance(widget_list, list):
                            widget_list = [widget_list]
                        for w in widget_list:
                            if not w: continue
                            if not isinstance(w, str):
                                # Until we ship with no pre-built pages, insert
                                # at 'beginning'
                                self.stackLayout.insertWidget(self.pageslen, w)
                            elif hasattr(self.ui, w):
                                w = getattr(self.ui, w)
                            rv.append(w)
                        return rv
                    mod.widgets = fill_out(widgets)
                    mod.optional_widgets = fill_out(optional_widgets)
                    if not hasattr(mod.ui, 'plugin_breadcrumb'):
                        breadcrumb = '------' # just a placeholder
                    if breadcrumb:
                        mod.breadcrumb_question = breadcrumb
                        mod.breadcrumb = SqueezeLabel()
                        mod.breadcrumb.setObjectName(mod.breadcrumb_question)
                        label_index = self.ui.steps_widget.layout().count() - 2 # Room for install crumb
                        self.ui.steps_widget.layout().insertWidget(label_index, mod.breadcrumb)
                    else:
                        mod.breadcrumb_question = None
                        mod.breadcrumb = None # page intentionally didn't want a label (intro)
                    self.pageslen += 1
                    self.pages.append(mod)
        self.user_pageslen = self.pageslen

        # declare attributes
        self.language_questions = (
            'live_installer',
            'step_label',
            'quit',
            'back',
            'next',
            'warning_dialog',
            'warning_dialog_label',
            'cancelbutton',
            'exitbutton',
            'install_process_label'
        )

        self.current_page = None
        self.first_seen_page = None
        self.allowed_change_step = True
        self.allowed_go_backward = True
        self.allowed_go_forward = True
        self.stay_on_page = False
        self.mainLoopRunning = False
        self.progress_position = ubiquity.progressposition.ProgressPosition()
        self.progress_cancelled = False
        self.previous_partitioning_page = self.step_index("stepPartAuto")
        self.installing = False
        self.installing_no_return = False
        self.returncode = 0
        self.backup = False
        self.history = []
        self.progressDialog = ProgressDialog(0, 0, self.ui)

        self.laptop = execute("laptop-detect")

        # set default language
        self.locale = i18n.reset_locale(self)

        self.debconf_callbacks = {}    # array to keep callback functions needed by debconf file descriptors

        self.ui.setWindowIcon(KIcon("ubiquity"))
        self.allow_go_backward(False)

        if not 'UBIQUITY_AUTOMATIC' in os.environ:
            self.ui.show()

        self.stop_debconf()
        self.translate_widgets(reget=True)

        if self.oem_config:
            self.ui.setWindowTitle(self.get_string('oem_config_title'))
        elif self.oem_user_config:
            self.ui.setWindowTitle(self.get_string('oem_user_config_title'))
            self.ui.setWindowIcon(KIcon("preferences-system"))
            flags = self.ui.windowFlags() ^ Qt.WindowMinMaxButtonsHint
            if hasattr(Qt, 'WindowCloseButtonHint'):
                flags = flags ^ Qt.WindowCloseButtonHint
            self.ui.setWindowFlags(flags)
            self.ui.quit.hide()
            # TODO cjwatson 2010-04-07: provide alternative strings instead
            self.ui.install_process_label.hide()
            self.ui.breadcrumb_install.hide()

        iconLoader = KIconLoader()
        warningIcon = iconLoader.loadIcon("dialog-warning", KIconLoader.Desktop)

        # TODO move to plugin
        #self.ui.part_advanced_warning_image.setPixmap(warningIcon)

        self.forwardIcon = KIcon("go-next")
        self.ui.next.setIcon(self.forwardIcon)

        #Used for the last step
        self.applyIcon = KIcon("dialog-ok-apply")

        backIcon = KIcon("go-previous")
        self.ui.back.setIcon(backIcon)

        quitIcon = KIcon("dialog-close")
        self.ui.quit.setIcon(quitIcon)

        self.ui.progressBar.hide()
        self.ui.progressCancel.hide()
コード例 #8
0
ファイル: ubi-language.py プロジェクト: IbpTeam/ubiquity
 def cleanup(self):
     plugin.Plugin.cleanup(self)
     i18n.reset_locale(self.frontend)
     self.frontend.stop_debconf()
     self.ui.controller.translate(just_me=False, not_me=True, reget=True)
コード例 #9
0
 def cleanup(self):
     plugin.Plugin.cleanup(self)
     self.ui.controller.set_locale(i18n.reset_locale(self.frontend))
コード例 #10
0
ファイル: ubi-timezone.py プロジェクト: Jolicloud/ubiquity
 def cleanup(self):
     Plugin.cleanup(self)
     i18n.reset_locale(self.frontend, just_country=True)
コード例 #11
0
 def cleanup(self):
     plugin.Plugin.cleanup(self)
     self.ui.controller.set_locale(i18n.reset_locale(self.frontend, just_country=True))
コード例 #12
0
ファイル: ubi-timezone.py プロジェクト: cjenkin2/ubiquity
 def cleanup(self):
     Plugin.cleanup(self)
     i18n.reset_locale(self.frontend, just_country=True)
コード例 #13
0
 def cleanup(self):
     plugin.Plugin.cleanup(self)
     self.ui.controller.set_locale(
             i18n.reset_locale(self.frontend, just_country=True))