Merge lp:~xnox/ubiquity/progress-dots into lp:ubiquity

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 5853
Proposed branch: lp:~xnox/ubiquity/progress-dots
Merge into: lp:ubiquity
Diff against target: 266 lines (+126/-57)
3 files modified
debian/changelog (+2/-0)
gui/gtk/ubiquity.ui (+97/-55)
ubiquity/frontend/gtk_ui.py (+27/-2)
To merge this branch: bzr merge lp:~xnox/ubiquity/progress-dots
Reviewer Review Type Date Requested Status
Ubuntu Installer Team Pending
Review via email: mp+151482@code.launchpad.net

Description of the change

This branch implements progress dots:
- for each plugin/page shows a dot
- colour the dot if plugin page is current or past
- revert the dot if one goes back

Due to all the various ways that one may or may not jump pages back and forward, I did a simplistic view of color all the dots from beginning up to current page, and blank the rest. Not sure if it's sufficiently bullet proof approach to history management.

In terms of visuals: the progress section is now a GtkNotebook with blank, dots and progress bar (old one) pages. The dots is simply a GtkGrid of 10x10px big progress bars which are flipped between 0% and 100% full.

Screenshot:
https://lh3.googleusercontent.com/-DU8LtP4EIjo/UTEADqZhCSI/AAAAAAAAAyI/WKWh5NbTC48/s754/049.png

Please review the code and approach taken.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Once the slideshow is reached the normal progress bar is shown (aka the classic one)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-03-04 11:48:35 +0000
3+++ debian/changelog 2013-03-04 13:01:35 +0000
4@@ -10,6 +10,8 @@
5 * Fix colour unit test, the green is no longer what it used to be...
6 * Switch to "NotShowIn=KDE" for ubiquity-gtk desktop files, as most !kde
7 desktop environments use gtk frontend.
8+ * Show progress dots for plugin pages and show progress bar only during
9+ slideshow.
10
11 [ Colin Watson ]
12 * Decode the output of apt_pkg.size_to_str() if necessary when
13
14=== modified file 'gui/gtk/ubiquity.ui'
15--- gui/gtk/ubiquity.ui 2013-02-27 12:09:32 +0000
16+++ gui/gtk/ubiquity.ui 2013-03-04 13:01:35 +0000
17@@ -914,77 +914,119 @@
18 <property name="can_focus">False</property>
19 <property name="border_width">20</property>
20 <child>
21- <object class="GtkBox" id="vbox1">
22+ <object class="GtkNotebook" id="progress_mode">
23 <property name="visible">True</property>
24 <property name="can_focus">False</property>
25- <property name="orientation">vertical</property>
26- <child>
27- <object class="GtkExpander" id="install_details_expander">
28- <property name="visible">True</property>
29- <property name="can_focus">True</property>
30- <property name="label_fill">True</property>
31- <child>
32- <object class="GtkScrolledWindow" id="install_details_sw">
33+ <property name="show_tabs">False</property>
34+ <property name="show_border">False</property>
35+ <child>
36+ <object class="GtkFixed" id="empty_progress">
37+ <property name="visible">True</property>
38+ <property name="can_focus">False</property>
39+ </object>
40+ </child>
41+ <child type="tab">
42+ <placeholder/>
43+ </child>
44+ <child>
45+ <object class="GtkGrid" id="dot_grid">
46+ <property name="visible">True</property>
47+ <property name="can_focus">False</property>
48+ <property name="halign">center</property>
49+ <property name="valign">center</property>
50+ <property name="column_spacing">12</property>
51+ <property name="column_homogeneous">True</property>
52+ <child>
53+ <placeholder/>
54+ </child>
55+ </object>
56+ <packing>
57+ <property name="position">1</property>
58+ </packing>
59+ </child>
60+ <child type="tab">
61+ <placeholder/>
62+ </child>
63+ <child>
64+ <object class="GtkBox" id="installing_expander">
65+ <property name="visible">True</property>
66+ <property name="can_focus">False</property>
67+ <property name="orientation">vertical</property>
68+ <child>
69+ <object class="GtkExpander" id="install_details_expander">
70 <property name="visible">True</property>
71 <property name="can_focus">True</property>
72+ <property name="label_fill">True</property>
73 <child>
74- <placeholder/>
75+ <object class="GtkScrolledWindow" id="install_details_sw">
76+ <property name="visible">True</property>
77+ <property name="can_focus">True</property>
78+ <child>
79+ <placeholder/>
80+ </child>
81+ </object>
82+ </child>
83+ <child type="label">
84+ <object class="GtkBox" id="hbox12">
85+ <property name="visible">True</property>
86+ <property name="can_focus">False</property>
87+ <child>
88+ <object class="GtkLabel" id="install_progress_text">
89+ <property name="visible">True</property>
90+ <property name="can_focus">False</property>
91+ <property name="xalign">0</property>
92+ <property name="label" translatable="yes">Installing...</property>
93+ <property name="wrap">True</property>
94+ <property name="wrap_mode">word-char</property>
95+ <property name="ellipsize">end</property>
96+ </object>
97+ <packing>
98+ <property name="expand">True</property>
99+ <property name="fill">True</property>
100+ <property name="position">0</property>
101+ </packing>
102+ </child>
103+ <child>
104+ <object class="GtkButton" id="progress_cancel_button">
105+ <property name="label" translatable="yes">_Skip</property>
106+ <property name="can_focus">True</property>
107+ <property name="receives_default">True</property>
108+ <property name="use_underline">True</property>
109+ <signal name="clicked" handler="on_progress_cancel_button_clicked" swapped="no"/>
110+ </object>
111+ <packing>
112+ <property name="expand">False</property>
113+ <property name="fill">True</property>
114+ <property name="position">1</property>
115+ </packing>
116+ </child>
117+ </object>
118 </child>
119 </object>
120+ <packing>
121+ <property name="expand">False</property>
122+ <property name="fill">True</property>
123+ <property name="position">0</property>
124+ </packing>
125 </child>
126- <child type="label">
127- <object class="GtkBox" id="hbox12">
128+ <child>
129+ <object class="GtkProgressBar" id="install_progress">
130 <property name="visible">True</property>
131 <property name="can_focus">False</property>
132- <child>
133- <object class="GtkLabel" id="install_progress_text">
134- <property name="visible">True</property>
135- <property name="can_focus">False</property>
136- <property name="xalign">0</property>
137- <property name="label" translatable="yes">Installing...</property>
138- <property name="wrap">True</property>
139- <property name="wrap_mode">word-char</property>
140- <property name="ellipsize">end</property>
141- </object>
142- <packing>
143- <property name="expand">True</property>
144- <property name="fill">True</property>
145- <property name="position">0</property>
146- </packing>
147- </child>
148- <child>
149- <object class="GtkButton" id="progress_cancel_button">
150- <property name="label" translatable="yes">_Skip</property>
151- <property name="can_focus">True</property>
152- <property name="receives_default">True</property>
153- <property name="use_underline">True</property>
154- <signal name="clicked" handler="on_progress_cancel_button_clicked" swapped="no"/>
155- </object>
156- <packing>
157- <property name="expand">False</property>
158- <property name="fill">True</property>
159- <property name="position">1</property>
160- </packing>
161- </child>
162 </object>
163+ <packing>
164+ <property name="expand">False</property>
165+ <property name="fill">True</property>
166+ <property name="position">1</property>
167+ </packing>
168 </child>
169 </object>
170 <packing>
171- <property name="expand">False</property>
172- <property name="fill">True</property>
173- <property name="position">0</property>
174+ <property name="position">2</property>
175 </packing>
176 </child>
177- <child>
178- <object class="GtkProgressBar" id="install_progress">
179- <property name="visible">True</property>
180- <property name="can_focus">False</property>
181- </object>
182- <packing>
183- <property name="expand">False</property>
184- <property name="fill">True</property>
185- <property name="position">1</property>
186- </packing>
187+ <child type="tab">
188+ <placeholder/>
189 </child>
190 </object>
191 </child>
192
193=== modified file 'ubiquity/frontend/gtk_ui.py'
194--- ubiquity/frontend/gtk_ui.py 2013-02-27 12:09:32 +0000
195+++ ubiquity/frontend/gtk_ui.py 2013-03-04 13:01:35 +0000
196@@ -326,9 +326,21 @@
197 self.toplevels.add(widget)
198 self.builder.connect_signals(self)
199
200+ for mod in self.pages:
201+ progress = Gtk.ProgressBar()
202+ progress.set_size_request(10, 10)
203+ progress.set_fraction(0)
204+ self.dot_grid.add(progress)
205+
206 next_style = self.next.get_style_context()
207 next_style.add_class('ubiquity-next')
208
209+ self.progress_pages = {
210+ 'empty': 0,
211+ 'dot_grid': 1,
212+ 'progress_bar': 2,
213+ }
214+
215 self.stop_debconf()
216 self.translate_widgets(reget=True)
217
218@@ -823,6 +835,9 @@
219 return True
220
221 def start_slideshow(self):
222+ self.progress_mode.set_current_page(
223+ self.progress_pages['progress_bar'])
224+
225 if not self.slideshow:
226 self.page_mode.hide()
227 return
228@@ -915,11 +930,18 @@
229 self.quit.hide()
230 self.back.hide()
231
232+ self.progress_section.show()
233+
234 if 'UBIQUITY_AUTOMATIC' in os.environ:
235 # Hide the notebook until the first page is ready.
236 self.page_mode.hide()
237- self.progress_section.show()
238+ self.progress_mode.set_current_page(
239+ self.progress_pages['progress_bar'])
240 self.live_installer.show()
241+ else:
242+ self.progress_mode.set_current_page(
243+ self.progress_pages['dot_grid'])
244+ self.progress_mode.show_all()
245 self.allow_change_step(False)
246
247 # The default instantiation of GtkComboBoxEntry creates a
248@@ -1460,6 +1482,10 @@
249 self.navigation_control.hide()
250 else:
251 self.navigation_control.show()
252+ for i in range(len(self.pages))[:current+1]:
253+ self.dot_grid.get_child_at(i, 0).set_fraction(1)
254+ for i in range(len(self.pages))[current+1:]:
255+ self.dot_grid.get_child_at(i, 0).set_fraction(0)
256
257 syslog.syslog('switched to page %s' % name)
258
259@@ -1553,7 +1579,6 @@
260 def switch_to_install_interface(self):
261 self.installing = True
262 self.lockdown_environment()
263- self.progress_section.show()
264
265 def find_next_step(self, finished_step):
266 # TODO need to handle the case where debconffilters launched from

Subscribers

People subscribed via source and target branches

to status/vote changes: