~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to ubiquity/plugins/ubi-language.py

  • Committer: Colin Watson
  • Date: 2012-04-30 23:38:41 UTC
  • mfrom: (5402 trunk)
  • mto: This revision was merged to the branch mainline in revision 5403.
  • Revision ID: cjwatson@canonical.com-20120430233841-xb0qsk46lnhski7m
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from __future__ import print_function
21
21
 
22
22
import os
 
23
 
23
24
import debconf
24
25
 
25
26
from ubiquity import plugin
36
37
    import lsb_release
37
38
    _ver = lsb_release.get_distro_information()['RELEASE']
38
39
except:
39
 
    _ver = '11.10'
 
40
    _ver = '12.04'
40
41
_wget_url = 'http://changelogs.ubuntu.com/ubiquity/%s-update-available' % _ver
41
42
 
42
43
_release_notes_url_path = '/cdrom/.disk/release_notes_url'
130
131
 
131
132
    @plugin.only_this_page
132
133
    def on_try_ubuntu_clicked(self, *args):
 
134
        if not self.controller.allowed_change_step():
 
135
            # The button's already been clicked once, so stop reacting to it.
 
136
            # LP: #911907.
 
137
            return
133
138
        # Spinning cursor.
134
139
        self.controller.allow_change_step(False)
135
140
        # Queue quit.
223
228
        self.controller.allow_go_forward(bool(lang))
224
229
        if not lang:
225
230
            return
226
 
        misc.set_indicator_keymaps(lang)
 
231
        if 'UBIQUITY_GREETER' in os.environ:
 
232
            misc.set_indicator_keymaps(lang)
227
233
        # strip encoding; we use UTF-8 internally no matter what
228
234
        lang = lang.split('.')[0]
229
235
        self.controller.translate(lang)
346
352
    def on_link_clicked(self, widget, uri):
347
353
        # Connected in glade.
348
354
        lang = self.get_language()
 
355
        if not lang:
 
356
            lang = 'C'
349
357
        lang = lang.split('.')[0] # strip encoding
350
358
        if uri == 'update':
351
359
            if not auto_update.update(self.controller._wizard):
444
452
 
445
453
    @plugin.only_this_page
446
454
    def on_try_ubuntu_clicked(self, *args):
 
455
        if not self.controller.allowed_change_step():
 
456
            # The button's already been clicked once, so stop reacting to it.
 
457
            # LP: #911907.
 
458
            return
447
459
        # Spinning cursor.
448
460
        self.controller.allow_change_step(False)
449
461
        # Queue quit.