Example #1
0
 def __init__(self):
     GraphicalUserInterface.__init__(self,
                                     None,
                                     None,
                                     product_title,
                                     is_final,
                                     quitDialog=InitialSetupQuitDialog)
     self.mainWindow.set_title("")
Example #2
0
 def __init__(self, storage, payload, instclass):
     GraphicalUserInterface.__init__(self,
                                     storage,
                                     payload,
                                     instclass,
                                     product_title,
                                     is_final,
                                     quitDialog=InitialSetupQuitDialog,
                                     fullscreen=True)
Example #3
0
 def __init__(self, storage, payload, instclass):
     GraphicalUserInterface.__init__(self,
                                     storage,
                                     payload,
                                     instclass,
                                     product_title,
                                     is_final,
                                     quitDialog=InitialSetupQuitDialog)
     self.mainWindow.set_title("")
Example #4
0
    def initInterface(self, addon_paths=None):
        if self._intf:
            raise RuntimeError(
                "Second attempt to initialize the InstallInterface")

        if self.displayMode == 'g':
            from pyanaconda.ui.gui import GraphicalUserInterface
            # Run the GUI in non-fullscreen mode, so live installs can still
            # use the window manager
            self._intf = GraphicalUserInterface(self.storage,
                                                self.payload,
                                                self.instClass,
                                                gui_lock=self.gui_initialized,
                                                fullscreen=False)

            # needs to be refreshed now we know if gui or tui will take place
            addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
                                                     ui_subdir="gui")
        elif self.displayMode in ['t',
                                  'c']:  # text and command line are the same
            from pyanaconda.ui.tui import TextUserInterface
            self._intf = TextUserInterface(self.storage, self.payload,
                                           self.instClass)

            # needs to be refreshed now we know if gui or tui will take place
            addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
                                                     ui_subdir="tui")
        else:
            raise RuntimeError("Unsupported displayMode: %s" %
                               self.displayMode)

        if addon_paths:
            self._intf.update_paths(addon_paths)
Example #5
0
    def initInterface(self):
        if self._intf:
            raise RuntimeError("Second attempt to initialize the InstallInterface")

        if self.gui_mode:
            from pyanaconda.ui.gui import GraphicalUserInterface
            # Run the GUI in non-fullscreen mode, so live installs can still
            # use the window manager
            self._intf = GraphicalUserInterface(None, self.payload,
                                                gui_lock=self.gui_initialized,
                                                fullscreen=False)

            # needs to be refreshed now we know if gui or tui will take place
            addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
                                                     ui_subdir="gui")
        elif self.tui_mode:
            # TUI and noninteractive TUI are the same in this regard
            from pyanaconda.ui.tui import TextUserInterface
            self._intf = TextUserInterface(None, self.payload)

            # needs to be refreshed now we know if gui or tui will take place
            addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
                                                     ui_subdir="tui")
        elif not self.display_mode:
            raise RuntimeError("Display mode not set.")
        else:
            # this should generally never happen, as display_mode now won't let
            # and invalid value to be set, but let's leave it here just in case
            # something ultra crazy happens
            raise RuntimeError("Unsupported display mode: %s" % self.display_mode)

        if addon_paths:
            self._intf.update_paths(addon_paths)
Example #6
0
    def gui_test(self, window_group, window, meh, builder, proxy_getter):
        # Create the interface.
        from pyanaconda.ui.gui import GraphicalUserInterface
        self.interface = GraphicalUserInterface(self.storage, self.payload)

        # Check the hubs.
        from pyanaconda.ui.gui.hubs.summary import SummaryHub
        self.assertEqual(self.hubs, [SummaryHub])

        # Check the actions classes.
        self.assertEqual(self._get_action_class_names(), [
            'WelcomeLanguageSpoke', 'NetworkStandaloneSpoke', 'SummaryHub',
            'ProgressSpoke'
        ])

        # Check the Summary hub.
        self.assertEqual(
            self._get_category_names(SummaryHub), {
                'CustomizationCategory': [],
                'LocalizationCategory':
                ['DatetimeSpoke', 'KeyboardSpoke', 'LangsupportSpoke'],
                'SoftwareCategory': ['SoftwareSelectionSpoke', 'SourceSpoke'],
                'SystemCategory': [
                    'BlivetGuiSpoke', 'CustomPartitioningSpoke', 'FilterSpoke',
                    'NetworkSpoke', 'StorageSpoke'
                ],
                'UserSettingsCategory': ['PasswordSpoke', 'UserSpoke']
            })

        # Force us to always decide order of standalone spokes based on priority not by name.
        # This will ordering errors easier to spot.
        self._check_spokes_priority_uniqueness()
Example #7
0
    def initInterface(self):
        if self._intf:
            raise RuntimeError(
                "Second attempt to initialize the InstallInterface")

        # this boot option is meant to be temporary, so just check it directly
        # from kernel boot command line like this
        if "webui" in kernel_arguments:
            from pyanaconda.ui.webui import CockpitUserInterface
            self._intf = CockpitUserInterface(
                None, self.payload, "webui.remote" in kernel_arguments)

            # needs to be refreshed now we know if gui or tui will take place
            # FIXME - what about Cockpit based addons ?
            addon_paths = []
        elif self.gui_mode:
            from pyanaconda.ui.gui import GraphicalUserInterface
            # Run the GUI in non-fullscreen mode, so live installs can still
            # use the window manager
            self._intf = GraphicalUserInterface(None,
                                                self.payload,
                                                gui_lock=self.gui_initialized,
                                                fullscreen=False)

            # needs to be refreshed now we know if gui or tui will take place
            addon_paths = collect_addon_ui_paths(ADDON_PATHS, "gui")
        elif self.tui_mode:
            # TUI and noninteractive TUI are the same in this regard
            from pyanaconda.ui.tui import TextUserInterface
            self._intf = TextUserInterface(None, self.payload)

            # needs to be refreshed now we know if gui or tui will take place
            addon_paths = collect_addon_ui_paths(ADDON_PATHS, "tui")
        elif not self.display_mode:
            raise RuntimeError("Display mode not set.")
        else:
            # this should generally never happen, as display_mode now won't let
            # and invalid value to be set, but let's leave it here just in case
            # something ultra crazy happens
            raise RuntimeError("Unsupported display mode: %s" %
                               self.display_mode)

        if addon_paths:
            self._intf.update_paths(addon_paths)
Example #8
0
    def gui_test(self, window_group, window, meh, builder):
        # Mock the TimezoneMap hack.
        sys.modules["gi.repository.TimezoneMap"] = Mock()

        # Create the interface.
        from pyanaconda.ui.gui import GraphicalUserInterface
        self.interface = GraphicalUserInterface(self.storage, self.payload)

        # Check the hubs.
        from pyanaconda.ui.gui.hubs.summary import SummaryHub
        self.assertEqual(self.hubs, [SummaryHub])

        # Check the actions classes.
        self.assertEqual(self._get_action_class_names(), [
            'WelcomeLanguageSpoke',
            'NetworkStandaloneSpoke',
            'SummaryHub',
            'ProgressSpoke'
        ])

        # Check the Summary hub.
        self.assertEqual(self._get_category_names(SummaryHub), {
            'CustomizationCategory': [],
            'LocalizationCategory': [
                'DatetimeSpoke',
                'KeyboardSpoke',
                'LangsupportSpoke'
            ],
            'SoftwareCategory': [
                'SoftwareSelectionSpoke',
                'SourceSpoke'
            ],
            'SystemCategory': [
                'BlivetGuiSpoke',
                'CustomPartitioningSpoke',
                'FilterSpoke',
                'NetworkSpoke',
                'StorageSpoke'
            ],
            'UserSettingsCategory': [
                'PasswordSpoke',
                'UserSpoke'
            ]}
        )
Example #9
0
    def test_gui(self, window_group, window, meh, builder, proxy_getter):
        # Create the interface.
        from pyanaconda.ui.gui import GraphicalUserInterface
        self.interface = GraphicalUserInterface(self.storage, self.payload)

        # Check the hubs.
        from pyanaconda.ui.gui.hubs.summary import SummaryHub
        self._check_hubs([SummaryHub])

        # Check the actions classes.
        self._check_actions([
            'language-pre-configuration', 'network-pre-configuration',
            'installation-summary', 'installation-progress'
        ])

        # Check the Summary hub.
        system_category = [
            'blivet-gui-partitioning', 'interactive-partitioning',
            'storage-advanced-configuration', 'network-configuration',
            'storage-configuration'
        ]

        if not HAVE_BLIVET_GUI:
            system_category.remove('blivet-gui-partitioning')

        self._check_categories(
            SummaryHub, {
                'CustomizationCategory': [],
                'LocalizationCategory': [
                    'date-time-configuration', 'keyboard-configuration',
                    'language-configuration'
                ],
                'SoftwareCategory': [
                    'software-selection', 'software-source-configuration',
                    'subscription-configuration'
                ],
                'SystemCategory':
                system_category,
                'UserSettingsCategory':
                ['root-configuration', 'user-configuration']
            })

        # Check the screens.
        screen_ids = [
            # Installation
            'installation-summary',
            'installation-progress',

            # Localization
            'language-pre-configuration',
            'language-configuration',
            'date-time-configuration',
            'keyboard-configuration',

            # Software
            'software-selection',
            'software-source-configuration',
            'subscription-configuration',

            # System
            'network-pre-configuration',
            'network-configuration',

            # Storage
            'storage-configuration',
            'storage-advanced-configuration',
            'interactive-partitioning',
            'blivet-gui-partitioning',

            # User settings
            'root-configuration',
            'user-configuration',
        ]

        if not HAVE_BLIVET_GUI:
            screen_ids.remove('blivet-gui-partitioning')

        self._check_screens(screen_ids)

        # Run general checks on the user interface.
        self._check_interface()
Example #10
0
 def __init__(self, storage, payload, instclass):
     GraphicalUserInterface.__init__(self, storage, payload, instclass,
                                     product_title, is_final,
                                     quitDialog = InitialSetupQuitDialog)