~gilir/+junk/ubiquity-lxdm-autologin

« back to all changes in this revision

Viewing changes to ubiquity/frontend/gtk_ui.py

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello, Mario Limonciello, Evan Dandrea
  • Date: 2010-01-31 23:44:44 UTC
  • Revision ID: james.westby@ubuntu.com-20100131234444-tr2u4n0evnu2pv02
Tags: 2.1.15
[ Mario Limonciello ]
* Add a new template, ubiquity/only-show-installable-languages for modifying
  the behavior of what languages to offer on an invokation based upon
  what's installed or "available" to install according to an apt cache.
* Expose extra functions get and substitute to plugins via it's
  second argument (currently called Progress).
* Drop extraneous handlers from Mythbuntu pages.
* Move all handlers from mythbuntu_ui directly into plugins themselves.
* Move some functions from the install.py script into a new file,
  install_misc.  The intention here is that they can then be used more
  directly by ubiquity plugins.
* Add a new method for package removals to install_misc to allow
  plugins to mark packages to be removed later in remove_extras.
* Modify the Mythbuntu services plugin to not even offer VNC if a short
  pw. (LP: #469312)
* Convert most of the functions from mythbuntu_install.py into plugin
  type Install methods.
* Support using pkgsel/install-language-support preseeded to false to
  ignore installation of language packs (just like alternates).
* Drop mythbuntu_ui and all references to it.  The (former) Mythbuntu 
  frontend is now fully pluggable into ubiquity's gtk_ui on it's own.
* Fix unmount command in chroot_cleanup to actually release /target/dev.
* In the KDE frontend for ubi-language, use findChildren to find widgets
  because QWidget itself is not iterable.
* In the KDE frontend, don't try to set the text on the breadcrumbs early
  as translations don't appear ready yet.  The widgets will still load,
  and translate when the langauge is changed. (LP: #511947)
* Automatic update of included source packages: console-setup
  1.34ubuntu8, debian-installer-utils 1.72ubuntu2, tzsetup
  1:0.26ubuntu4.

[ Evan Dandrea ]
* Support getting the timezone from a geoip server (LP: #229884).
* Move oem-config runtime debconf questions into the oem-config
  package.
* Add oem-config/early_command (run a command just before oem-config
  starts).
* Support installing additional packages at runtime in oem-config, as
  specified by oem-config/extra_packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
    def go_to_page(self, widget):
124
124
        self._wizard.set_current_page(self._wizard.steps.page_num(widget))
125
125
 
 
126
    def toggle_top_level(self):
 
127
        if self._wizard.live_installer.get_property('visible'):
 
128
            self._wizard.live_installer.hide()
 
129
        else:
 
130
            self._wizard.live_installer.show()
 
131
        self._wizard.refresh()
 
132
 
126
133
class Wizard(BaseFrontend):
127
134
 
128
135
    def __init__(self, distro):
455
462
 
456
463
        self.set_current_page(0)
457
464
 
458
 
        while(self.pagesindex < self.pageslen):
459
 
            if self.current_page == None:
460
 
                break
 
465
        while(self.pagesindex < len(self.pages)):
 
466
            if self.current_page is None:
 
467
                return self.returncode
461
468
 
462
469
            if not self.pages[self.pagesindex].filter_class:
463
470
                # This page is just a UI page
485
492
                self.pages[self.pagesindex].controller.dbfilter = None
486
493
 
487
494
            if self.backup or self.dbfilter_handle_status():
488
 
                if self.installing:
489
 
                    self.progress_loop()
490
 
                elif self.current_page is not None and not self.backup:
 
495
                #TODO: superm1, Jan 2010 is there some kind of way that we are entering this normally?
 
496
                #if self.installing:
 
497
                #    self.progress_loop()
 
498
                #elif
 
499
                if self.current_page is not None and not self.backup:
491
500
                    self.process_step()
492
501
                    if not self.stay_on_page:
493
502
                        self.pagesindex = self.pagesindex + 1
498
507
                if self.backup:
499
508
                    self.pagesindex = self.pop_history()
500
509
 
 
510
 
501
511
            while gtk.events_pending():
502
512
                gtk.main_iteration()
503
513
 
504
 
            # needed to be here for --automatic as there might not be any
505
 
            # current page in the event all of the questions have been
506
 
            # preseeded.
507
 
            if self.pagesindex == self.pageslen:
508
 
                # Ready to install
509
 
                self.live_installer.hide()
510
 
                self.current_page = None
511
 
                self.installing = True
512
 
                self.progress_loop()
 
514
        if self.oem_user_config:
 
515
            self.quit_installer()
 
516
        elif not self.get_reboot_seen():
 
517
            self.live_installer.hide()
 
518
            if 'UBIQUITY_ONLY' in os.environ:
 
519
                txt = self.get_string('ubiquity/finished_restart_only')
 
520
                self.finished_label.set_label(txt)
 
521
                self.quit_button.hide()
 
522
            self.finished_dialog.set_keep_above(True)
 
523
            self.finished_dialog.run()
 
524
        elif self.get_reboot():
 
525
            self.reboot()
 
526
 
513
527
        return self.returncode
514
528
 
515
529
 
943
957
 
944
958
    def progress_loop(self):
945
959
        """prepare, copy and config the system in the core install process."""
 
960
        self.installing = True
946
961
 
947
962
        syslog.syslog('progress_loop()')
948
963
 
949
 
        self.current_page = None
 
964
        self.live_installer.hide()
950
965
 
951
966
        slideshow_dir = '/usr/share/ubiquity-slideshow'
952
967
        slideshow_locale = self.slideshow_get_available_locale(slideshow_dir, self.locale)
1030
1045
        # just to make sure
1031
1046
        self.debconf_progress_window.hide()
1032
1047
 
1033
 
        self.installing = False
1034
 
 
1035
1048
        self.run_success_cmd()
1036
 
        if self.oem_user_config:
1037
 
            self.quit_installer()
1038
 
        elif not self.get_reboot_seen():
1039
 
            if 'UBIQUITY_ONLY' in os.environ:
1040
 
                txt = self.get_string('ubiquity/finished_restart_only')
1041
 
                self.finished_label.set_label(txt)
1042
 
                self.quit_button.hide()
1043
 
            self.finished_dialog.set_keep_above(True)
1044
 
            self.finished_dialog.run()
1045
 
        elif self.get_reboot():
1046
 
            self.reboot()
1047
 
 
 
1049
 
 
1050
        #in case there are extra pages
 
1051
        self.back.hide()
 
1052
        self.quit.hide()
 
1053
        self.next.set_label("gtk-go-forward")
 
1054
        self.translate_widget(self.next)
 
1055
 
 
1056
        self.installing = False
1048
1057
 
1049
1058
    def reboot(self, *args):
1050
1059
        """reboot the system after installing process."""
1087
1096
        response = self.warning_dialog.run()
1088
1097
        self.warning_dialog.hide()
1089
1098
        if response == gtk.RESPONSE_CLOSE:
1090
 
            self.current_page = None
1091
1099
            self.quit_installer()
1092
1100
            return False
1093
1101
        else:
1191
1199
        elif step == "stepUserInfo":
1192
1200
            self.process_identification()
1193
1201
 
 
1202
        # Ready to install
 
1203
        elif self.pages[self.pagesindex].ui.get('plugin_is_install'):
 
1204
            self.progress_loop()
 
1205
 
1194
1206
    def process_identification (self):
1195
1207
        """Processing identification step tasks."""
1196
1208