Merge lp:~shtylman/ubiquity/kubuntu into lp:ubiquity

Proposed by Roman Shtylman
Status: Merged
Merged at revision: not available
Proposed branch: lp:~shtylman/ubiquity/kubuntu
Merge into: lp:ubiquity
Diff against target: 636 lines (+198/-168)
7 files modified
debian/ubiquity.templates (+11/-0)
gui/qt/app.ui (+1/-1)
gui/qt/stepLanguage.ui (+76/-29)
ubiquity/components/ubi-intro.py (+0/-61)
ubiquity/components/ubi-language.py (+56/-50)
ubiquity/frontend/kde_components/PartAuto.py (+3/-1)
ubiquity/frontend/kde_ui.py (+51/-26)
To merge this branch: bzr merge lp:~shtylman/ubiquity/kubuntu
Reviewer Review Type Date Requested Status
Ubuntu Installer Team Pending
Review via email: mp+20875@code.launchpad.net

Description of the change

bugfix for the language page
greeter functionality for kubuntu
also unhid the new style progress bar

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/ubiquity.templates'
2--- debian/ubiquity.templates 2010-03-03 17:27:55 +0000
3+++ debian/ubiquity.templates 2010-03-07 22:41:19 +0000
4@@ -1039,3 +1039,14 @@
5 Type: text
6 # Translated acronym for Compact Disc.
7 _Description: CD
8+
9+Template: ubiquity/text/select_language_label
10+Type: text
11+_Description:
12+ Please choose the language to use for the install process. This
13+ Language will be the default language for this computer.
14+
15+Template: ubiquity/text/begin_install_button
16+Type: text
17+_Description:
18+ Continue with installation.
19
20=== modified file 'gui/qt/app.ui'
21--- gui/qt/app.ui 2010-02-21 17:46:17 +0000
22+++ gui/qt/app.ui 2010-03-07 22:41:19 +0000
23@@ -100,7 +100,7 @@
24 </widget>
25 </item>
26 <item>
27- <widget class="QWidget" name="widget" native="true">
28+ <widget class="QWidget" name="navigation" native="true">
29 <layout class="QHBoxLayout" name="horizontalLayout_2">
30 <property name="topMargin">
31 <number>0</number>
32
33=== modified file 'gui/qt/stepLanguage.ui'
34--- gui/qt/stepLanguage.ui 2009-12-30 23:08:51 +0000
35+++ gui/qt/stepLanguage.ui 2010-03-07 22:41:19 +0000
36@@ -1,7 +1,7 @@
37 <?xml version="1.0" encoding="UTF-8"?>
38 <ui version="4.0">
39- <class>page</class>
40- <widget class="QWidget" name="page">
41+ <class>language</class>
42+ <widget class="QWidget" name="language">
43 <property name="geometry">
44 <rect>
45 <x>0</x>
46@@ -28,8 +28,8 @@
47 </property>
48 </widget>
49 </item>
50- <item row="2" column="0" colspan="3">
51- <widget class="QLabel" name="welcome_text_label">
52+ <item row="4" column="0" colspan="3">
53+ <widget class="QLabel" name="ready_text_label">
54 <property name="sizePolicy">
55 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
56 <horstretch>0</horstretch>
57@@ -37,21 +37,14 @@
58 </sizepolicy>
59 </property>
60 <property name="text">
61- <string>Ready to install? Once you answer a few questions, the contents of the live CD can be installed on this computer so you can run the system at full speed and without the CD.
62-
63-Answering the questions should only take a few minutes.
64-
65-This language will be the default language for the final system.</string>
66- </property>
67- <property name="alignment">
68- <set>Qt::AlignVCenter</set>
69+ <string>ready_text_label</string>
70 </property>
71 <property name="wordWrap">
72 <bool>true</bool>
73 </property>
74 </widget>
75 </item>
76- <item row="3" column="0">
77+ <item row="8" column="0">
78 <spacer name="horizontalSpacer_4">
79 <property name="orientation">
80 <enum>Qt::Horizontal</enum>
81@@ -64,7 +57,7 @@
82 </property>
83 </spacer>
84 </item>
85- <item row="3" column="1">
86+ <item row="8" column="1">
87 <widget class="QComboBox" name="language_combobox">
88 <property name="editable">
89 <bool>false</bool>
90@@ -91,7 +84,7 @@
91 </item>
92 </widget>
93 </item>
94- <item row="3" column="2">
95+ <item row="8" column="2">
96 <spacer name="horizontalSpacer_3">
97 <property name="orientation">
98 <enum>Qt::Horizontal</enum>
99@@ -104,7 +97,7 @@
100 </property>
101 </spacer>
102 </item>
103- <item row="4" column="1">
104+ <item row="9" column="1">
105 <spacer name="verticalSpacer_11">
106 <property name="orientation">
107 <enum>Qt::Vertical</enum>
108@@ -117,7 +110,7 @@
109 </property>
110 </spacer>
111 </item>
112- <item row="5" column="0" colspan="3">
113+ <item row="14" column="0" colspan="3">
114 <widget class="QLabel" name="oem_id_label">
115 <property name="text">
116 <string>You are installing in system manufacturer mode. Please enter a unique name for this batch of systems. This name will be saved on the installed system and can be used to help with bug reports.</string>
117@@ -127,10 +120,10 @@
118 </property>
119 </widget>
120 </item>
121- <item row="6" column="0">
122+ <item row="15" column="0">
123 <widget class="QLineEdit" name="oem_id_entry"/>
124 </item>
125- <item row="7" column="0" colspan="3">
126+ <item row="13" column="0" colspan="3">
127 <widget class="QLabel" name="release_notes_label">
128 <property name="text">
129 <string>If you have Internet access, read the release notes for information on problems that may affect you.</string>
130@@ -140,16 +133,70 @@
131 </property>
132 </widget>
133 </item>
134- <item row="8" column="0">
135- <widget class="QWidget" name="release_notes_frame" native="true"/>
136- </item>
137- <item row="8" column="1">
138- <widget class="QPushButton" name="update_this_installer">
139- <property name="text">
140- <string>Update this installer</string>
141- </property>
142- <property name="autoDefault">
143- <bool>true</bool>
144+ <item row="2" column="0" colspan="3">
145+ <widget class="QLabel" name="try_text_label">
146+ <property name="text">
147+ <string>try_text_label</string>
148+ </property>
149+ <property name="wordWrap">
150+ <bool>true</bool>
151+ </property>
152+ </widget>
153+ </item>
154+ <item row="3" column="1">
155+ <widget class="QPushButton" name="try_ubuntu">
156+ <property name="text">
157+ <string>Try Kubuntu</string>
158+ </property>
159+ </widget>
160+ </item>
161+ <item row="5" column="0" colspan="3">
162+ <widget class="QLabel" name="duration_label">
163+ <property name="text">
164+ <string>Answering the questions should only take a few minutes.</string>
165+ </property>
166+ <property name="wordWrap">
167+ <bool>true</bool>
168+ </property>
169+ </widget>
170+ </item>
171+ <item row="7" column="0" colspan="3">
172+ <widget class="QLabel" name="select_language_label">
173+ <property name="text">
174+ <string>Please choose the language to use for the install process. This language will be the default language for this computer.</string>
175+ </property>
176+ <property name="wordWrap">
177+ <bool>true</bool>
178+ </property>
179+ </widget>
180+ </item>
181+ <item row="12" column="0" colspan="3">
182+ <spacer name="verticalSpacer">
183+ <property name="orientation">
184+ <enum>Qt::Vertical</enum>
185+ </property>
186+ <property name="sizeHint" stdset="0">
187+ <size>
188+ <width>20</width>
189+ <height>40</height>
190+ </size>
191+ </property>
192+ </spacer>
193+ </item>
194+ <item row="10" column="0" colspan="3">
195+ <widget class="QLabel" name="alpha_warning_label">
196+ <property name="text">
197+ <string>alpha_warning_label</string>
198+ </property>
199+ <property name="wordWrap">
200+ <bool>true</bool>
201+ </property>
202+ </widget>
203+ </item>
204+ <item row="11" column="1">
205+ <widget class="QPushButton" name="begin_install_button">
206+ <property name="text">
207+ <string>Continue with installation</string>
208 </property>
209 </widget>
210 </item>
211
212=== removed file 'ubiquity/components/ubi-intro.py'
213--- ubiquity/components/ubi-intro.py 2010-03-03 17:27:55 +0000
214+++ ubiquity/components/ubi-intro.py 1970-01-01 00:00:00 +0000
215@@ -1,61 +0,0 @@
216-# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
217-#
218-# Copyright (C) 2009 Canonical Ltd.
219-# Written by Michael Terry <michael.terry@canonical.com>.
220-#
221-# This file is part of Ubiquity.
222-#
223-# Ubiquity is free software; you can redistribute it and/or modify
224-# it under the terms of the GNU General Public License as published by
225-# the Free Software Foundation, either version 2 of the License, or
226-# (at your option) any later version.
227-#
228-# Ubiquity is distributed in the hope that it will be useful,
229-# but WITHOUT ANY WARRANTY; without even the implied warranty of
230-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
231-# GNU General Public License for more details.
232-#
233-# You should have received a copy of the GNU General Public License
234-# along with Ubiquity. If not, see <http://www.gnu.org/licenses/>.
235-
236-import os
237-from ubiquity.plugin import *
238-
239-NAME = 'intro'
240-AFTER = None
241-WEIGHT = 100
242-# Not useful in oem-config.
243-OEM = False
244-
245-def get_intro():
246- """Get some introductory text, if available."""
247- if 'UBIQUITY_OEM_USER_CONFIG' in os.environ or \
248- 'UBIQUITY_AUTOMATIC' in os.environ:
249- return None
250-
251- intro = None
252- introFiles = ['/usr/share/ubiquity/intro.txt', '/usr/share/ubiquity/kubuntu-netbook-intro.txt']
253- for f in introFiles:
254- if os.path.isfile(f):
255- intro = f
256- break
257- if intro is None:
258- return None
259-
260- intro_file = open(intro)
261- text = intro_file.read()
262- intro_file.close()
263- return text
264-
265-class PageKde(PluginUI):
266- plugin_breadcrumb = None
267-
268- def __init__(self, *args, **kwargs):
269- text = get_intro()
270- if text:
271- try:
272- from PyQt4 import uic
273- self.plugin_widgets = uic.loadUi('/usr/share/ubiquity/qt/stepIntro.ui')
274- self.plugin_widgets.introLabel.setText(text.replace('\n', '<br>'))
275- except Exception, e:
276- self.debug('Could not create intro page: %s', e)
277
278=== modified file 'ubiquity/components/ubi-language.py'
279--- ubiquity/components/ubi-language.py 2010-03-04 09:38:59 +0000
280+++ ubiquity/components/ubi-language.py 2010-03-07 22:41:19 +0000
281@@ -264,6 +264,11 @@
282
283 def __init__(self, controller, *args, **kwargs):
284 self.controller = controller
285+ if self.controller.oem_user_config:
286+ self.only = True
287+ else:
288+ self.only = False
289+
290 try:
291 from PyQt4 import uic
292 from PyQt4.QtGui import QLabel, QWidget
293@@ -271,60 +276,57 @@
294 self.combobox = self.page.language_combobox
295 self.combobox.currentIndexChanged[str].connect(self.on_language_selection_changed)
296
297+ self.page.begin_install_button.clicked.connect(self.controller._wizard.on_next_clicked)
298+ self.page.try_ubuntu.clicked.connect(self.controller._wizard.quit_installer)
299+
300 if not self.controller.oem_config:
301 self.page.oem_id_label.hide()
302 self.page.oem_id_entry.hide()
303-
304- if self.page.findChildren(QWidget,'update_this_installer'):
305- if self.controller.oem_config or auto_update.already_updated():
306- self.page.update_this_installer.hide()
307- else:
308- self.page.update_this_installer.clicked.connect(
309- self.on_update_this_installer)
310-
311- class linkLabel(QLabel):
312- def __init__(self, wizard, parent):
313- QLabel.__init__(self, parent)
314- self.wizard = wizard
315-
316- def mouseReleaseEvent(self, event):
317- self.wizard.openReleaseNotes()
318-
319- def setText(self, text):
320- QLabel.setText(self, text)
321- self.resize(self.sizeHint())
322-
323- self.release_notes_url = linkLabel(self, self.page.release_notes_frame)
324- self.release_notes_url.setObjectName("release_notes_url")
325- self.release_notes_url.show()
326-
327- self.release_notes_url_template = None
328+
329+ self.release_notes_url = ''
330 try:
331 release_notes = open(_release_notes_url_path)
332- self.release_notes_url_template = release_notes.read().rstrip('\n')
333+ self.release_notes_url = release_notes.read().rstrip('\n')
334 release_notes.close()
335 except (KeyboardInterrupt, SystemExit):
336- raise
337- except:
338- self.page.release_notes_label.hide()
339- self.page.release_notes_frame.hide()
340+ pass
341+
342+ self.page.release_notes_label.linkActivated.connect(self.on_release_notes_link)
343+
344+ if not 'UBIQUITY_GREETER' in os.environ:
345+ self.page.try_ubuntu.hide()
346+ self.page.try_test_label.hide()
347+ self.begin_install_button.hide()
348
349 except Exception, e:
350 self.debug('Could not create language page: %s', e)
351 self.page = None
352+
353 self.plugin_widgets = self.page
354
355- def openReleaseNotes(self):
356+ def on_release_notes_link(self, link):
357 lang = self.selected_language()
358- if lang:
359- lang = lang.split('.')[0].lower()
360- url = self.release_notes_url_template.replace('${LANG}', lang)
361- self.openURL(url)
362-
363+ if link == "release-notes":
364+ if lang:
365+ lang = lang.split('.')[0].lower()
366+ url = self.release_notes_url.replace('${LANG}', lang)
367+ self.openURL(url)
368+ pass
369+ elif link == "update":
370+ if not auto_update.update(self.controller._wizard):
371+ # no updates, so don't check again
372+ text = i18n.get_string('release_notes_only', lang)
373+ self.page.release_notes_label.setText(text)
374+
375 def openURL(self, url):
376- #need to run this else kdesu can't run Konqueror
377- misc.execute('su', '-c', 'xhost +localhost', 'ubuntu')
378- misc.execute('su', '-c', 'kfmclient openURL '+url, 'ubuntu')
379+ from PyQt4.QtGui import QDesktopServices
380+ from PyQt4.QtCore import QUrl
381+ from ubiquity.misc import drop_privileges_save, regain_privileges_save
382+
383+ # this nonsense is needed because kde doesn't want to be root
384+ drop_privileges_save()
385+ QDesktopServices.openUrl(QUrl(url))
386+ regain_privileges_save()
387
388 def set_language_choices(self, choices, choice_map):
389 from PyQt4.QtCore import QString
390@@ -357,13 +359,22 @@
391 if lang:
392 # strip encoding; we use UTF-8 internally no matter what
393 lang = lang.split('.')[0].lower()
394-
395 self.controller.translate(lang)
396-
397- if self.release_notes_url_template is not None:
398- url = self.release_notes_url_template.replace('${LANG}', lang)
399- text = i18n.get_string('release_notes_url', lang)
400- self.release_notes_url.setText('<a href="%s">%s</a>' % (url, text))
401+ else:
402+ lang = 'C'
403+
404+ if not self.only:
405+ release_name = misc.get_release_name()
406+ install_medium = misc.get_install_medium()
407+ install_medium = i18n.get_string(install_medium, lang)
408+ for widget in (self.page.try_text_label,
409+ self.page.try_ubuntu,
410+ self.page.ready_text_label,
411+ self.page.alpha_warning_label):
412+ text = widget.text()
413+ text = text.replace('${RELEASE}', release_name)
414+ text = text.replace('${MEDIUM}', install_medium)
415+ widget.setText(text)
416
417 def set_oem_id(self, text):
418 return self.page.oem_id_entry.setText(text)
419@@ -371,11 +382,6 @@
420 def get_oem_id(self):
421 return unicode(self.page.oem_id_entry.text())
422
423- def on_update_this_installer(self):
424- if not auto_update.update(self.controller._wizard):
425- # no updates, so don't check again
426- self.page.update_this_installer.setEnabled(False)
427-
428 class PageDebconf(PageBase):
429 plugin_title = 'ubiquity/text/language_heading_label'
430
431
432=== modified file 'ubiquity/frontend/kde_components/PartAuto.py'
433--- ubiquity/frontend/kde_components/PartAuto.py 2010-02-25 11:38:08 +0000
434+++ ubiquity/frontend/kde_components/PartAuto.py 2010-03-07 22:41:19 +0000
435@@ -236,7 +236,9 @@
436 bId = self.autopartition_buttongroup.checkedId()
437 if bId > -1:
438 choice = unicode(self.autopartitionTexts[bId])
439-
440+ else:
441+ raise AssertionError, "no active autopartitioning choice"
442+
443 if choice == self.resizeChoice:
444 # resize choice should have been hidden otherwise
445 assert self.resizeSize is not None
446
447=== modified file 'ubiquity/frontend/kde_ui.py'
448--- ubiquity/frontend/kde_ui.py 2010-03-05 23:25:14 +0000
449+++ ubiquity/frontend/kde_ui.py 2010-03-07 22:41:19 +0000
450@@ -113,10 +113,10 @@
451 event.ignore()
452
453 class Controller(ubiquity.frontend.base.Controller):
454- def translate(self, lang=None, just_me=True, reget=False):
455+ def translate(self, lang=None, just_me=True, not_me=False, reget=False):
456 if lang:
457 self._wizard.locale = lang
458- self._wizard.translate_pages(lang, just_me, reget)
459+ self._wizard.translate_pages(lang, just_me, not_me, reget)
460
461 def allow_go_forward(self, allowed):
462 self._wizard.allow_go_forward(allowed)
463@@ -351,13 +351,14 @@
464
465 # Disable the KDE media notifier to avoid problems during partitioning.
466 def disable_volume_manager(self):
467- print "FIXME, medianotifier unload port to KDE 4"
468+ #FIXME, medianotifier unload port to KDE 4"
469 #execute('dcop', 'kded', 'kded', 'unloadModule', 'medianotifier')
470 atexit.register(self.enable_volume_manager)
471
472 def enable_volume_manager(self):
473- print "FIXME, medianotifier unload port to KDE 4"
474+ #FIXME, medianotifier unload port to KDE 4"
475 #execute('dcop', 'kded', 'kded', 'loadModule', 'medianotifier')
476+ pass
477
478 def run(self):
479 """run the interface."""
480@@ -467,17 +468,27 @@
481 rv = reduce(recurse, parentWidget.children(), [parentWidget])
482 return rv
483
484- def translate_pages(self, lang=None, just_current=True, reget=False):
485+ def translate_pages(self, lang=None, just_current=True, not_current=False, reget=False):
486+ current_page = self.pages[self.pagesindex]
487 if just_current:
488 pages = [self.pages[self.pagesindex]]
489 else:
490 pages = self.pages
491 widgets = []
492 for p in pages:
493+ # There's no sense retranslating the page we're leaving.
494+ if not_current and p == current_page:
495+ continue
496 prefix = p.ui.get('plugin_prefix')
497 for w in p.widgets:
498 for c in self.all_children(w):
499 widgets.append((c, prefix))
500+
501+ #if not just_current:
502+ #for toplevel in self.toplevels:
503+ #if toplevel.name != 'live_installer':
504+ #for c in self.all_children(toplevel):
505+ #widgets.append((c, None))
506 self.translate_widgets(lang=lang, widgets=widgets, reget=reget)
507
508 # translates widget text based on the object names
509@@ -673,9 +684,6 @@
510 self.set_current_page(index)
511 if page.breadcrumb:
512 page.breadcrumb.setStyleSheet(currentSS)
513- self.ui.steps_widget.setVisible(True)
514- else:
515- self.ui.steps_widget.setVisible(False)
516 found = True
517 is_install = page.ui.get('plugin_is_install')
518 elif page.breadcrumb:
519@@ -891,6 +899,15 @@
520
521 self.app.exit()
522
523+ def quit_installer(self):
524+ """quit installer cleanly."""
525+
526+ # exiting from application
527+ self.current_page = None
528+ if self.dbfilter is not None:
529+ self.dbfilter.cancel_handler()
530+ self.quit_main_loop()
531+
532 def on_quit_clicked(self):
533 warning_dialog_label = self.get_string("warning_dialog_label")
534 abortTitle = self.get_string("warning_dialog")
535@@ -974,8 +991,16 @@
536
537 def on_steps_switch_page(self, newPageID):
538 self.current_page = newPageID
539+ name = self.step_name(newPageID)
540 #self.translate_widget(self.ui.step_label)
541- syslog.syslog('switched to page %s' % self.step_name(newPageID))
542+ syslog.syslog('switched to page %s' % name)
543+ if 'UBIQUITY_GREETER' in os.environ:
544+ if name == 'language':
545+ self.ui.steps_widget.hide()
546+ self.ui.navigation.hide()
547+ else:
548+ self.ui.steps_widget.show()
549+ self.ui.navigation.show()
550
551 def watch_debconf_fd (self, from_debconf, process_input):
552 self.debconf_fd_counter = 0
553@@ -1015,17 +1040,17 @@
554
555 self.ui.progressCancel.setText(skipText)
556
557- self.progressDialog.setWindowModality(Qt.WindowModal);
558- self.progressDialog.setCancelText(skipText)
559- self.progressDialog.setCancellable(False)
560- self.progressDialog.setMaximum(total_steps)
561- self.progressDialog.setWindowTitle(progress_title)
562+ #self.progressDialog.setWindowModality(Qt.WindowModal);
563+ #self.progressDialog.setCancelText(skipText)
564+ #self.progressDialog.setCancellable(False)
565+ #self.progressDialog.setMaximum(total_steps)
566+ #self.progressDialog.setWindowTitle(progress_title)
567 #self.progressDialog.show()
568
569 # TODO cancel button
570
571 self.ui.progressBar.setMaximum(total_steps)
572- #self.ui.progressBar.show()
573+ self.ui.progressBar.show()
574
575 self.ui.content_widget.setEnabled(False)
576
577@@ -1042,8 +1067,8 @@
578 self.progress_position.set(progress_val)
579 fraction = self.progress_position.fraction()
580
581- self.progressDialog.setProgressValue(
582- int(fraction * self.progressDialog.maximum()))
583+ #self.progressDialog.setProgressValue(
584+ # int(fraction * self.progressDialog.maximum()))
585
586 self.ui.progressBar.setValue(int(fraction * self.ui.progressBar.maximum()))
587
588@@ -1056,8 +1081,8 @@
589 self.progress_position.step(progress_inc)
590 fraction = self.progress_position.fraction()
591
592- self.progressDialog.setProgressValue(
593- int(fraction * self.progressDialog.maximum()))
594+ #self.progressDialog.setProgressValue(
595+ # int(fraction * self.progressDialog.maximum()))
596
597 self.ui.progressBar.setValue(int(fraction * self.ui.progressBar.maximum()))
598
599@@ -1068,7 +1093,7 @@
600 if self.progress_cancelled:
601 return False
602
603- self.progressDialog.setProgressLabel(progress_info)
604+ #self.progressDialog.setProgressLabel(progress_info)
605 self.ui.progressBar.setFormat(progress_info + " %p%")
606
607 return True
608@@ -1076,10 +1101,10 @@
609 def debconf_progress_stop (self):
610 self.progress_cancelled = False
611 self.progress_position.stop()
612- if self.progress_position.depth() == 0:
613- self.progressDialog.reset() # also hides dialog
614- else:
615- self.progressDialog.setWindowTitle(self.progress_position.title())
616+ #if self.progress_position.depth() == 0:
617+ # self.progressDialog.reset() # also hides dialog
618+ #else:
619+ # self.progressDialog.setWindowTitle(self.progress_position.title())
620
621 self.ui.content_widget.setEnabled(True)
622 self.ui.progressBar.hide()
623@@ -1089,11 +1114,11 @@
624
625 def debconf_progress_cancellable (self, cancellable):
626 if cancellable:
627- self.progressDialog.setCancellable(True)
628+ #self.progressDialog.setCancellable(True)
629 self.ui.progressCancel.show()
630 else:
631 self.ui.progressCancel.hide()
632- self.progressDialog.setCancellable(False)
633+ #self.progressDialog.setCancellable(False)
634 self.progress_cancelled = False
635
636 #def on_progress_cancel_button_clicked (self, button):

Subscribers

People subscribed via source and target branches

to status/vote changes: