Merge ubiquity:no-going-back-from-timezone into ubiquity:master

Proposed by Iain Lane on 2018-10-22
Status: Merged
Merged at revision: c1cb3268170c57eb88ebb48de14634491ebd8b58
Proposed branch: ubiquity:no-going-back-from-timezone
Merge into: ubiquity:master
Diff against target: 79 lines (+30/-2)
3 files modified
ubiquity/frontend/gtk_ui.py (+26/-1)
ubiquity/frontend/kde_ui.py (+2/-1)
ubiquity/gsettings.py (+2/-0)
Reviewer Review Type Date Requested Status
Ubuntu Installer Team 2018-10-22 Pending
Review via email: mp+357618@code.launchpad.net

Description of the change

Turn off the back button forever once we are past the partman step

See the commit message for the full rationale.

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1799097

Only merge one of this and https://code.launchpad.net/~ubuntu-installer/ubiquity/+git/ubiquity/+merge/357619

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
1diff --git a/ubiquity/frontend/gtk_ui.py b/ubiquity/frontend/gtk_ui.py
2index e63046c..ee8b462 100644
3--- a/ubiquity/frontend/gtk_ui.py
4+++ b/ubiquity/frontend/gtk_ui.py
5@@ -587,6 +587,29 @@ class Wizard(BaseFrontend):
6
7 gsettings.set(gs_schema, gs_key, gs_value)
8
9+ def disable_screen_blanking(self):
10+ gs_schema = 'org.gnome.desktop.session'
11+ gs_key = 'idle-delay'
12+ gs_previous = '%s/%s' % (gs_schema, gs_key)
13+ if gs_previous in self.gsettings_previous:
14+ return
15+
16+ gs_value = gsettings.get(gs_schema, gs_key)
17+ self.gsettings_previous[gs_previous] = gs_value
18+
19+ if gs_value:
20+ gsettings.set(gs_schema, gs_key, 0)
21+
22+ atexit.register(self.enable_screen_blanking)
23+
24+ def enable_screen_blanking(self):
25+ gs_schema = 'org.gnome.desktop.session'
26+ gs_key = 'idle-delay'
27+ gs_previous = '%s/%s' % (gs_schema, gs_key)
28+ gs_value = self.gsettings_previous[gs_previous]
29+
30+ gsettings.set(gs_schema, gs_key, gs_value)
31+
32 def disable_powermgr(self):
33 gs_schema = 'org.gnome.settings-daemon.plugins.power'
34 gs_key = 'active'
35@@ -738,6 +761,7 @@ class Wizard(BaseFrontend):
36
37 self.disable_volume_manager()
38 self.disable_screensaver()
39+ self.disable_screen_blanking()
40 self.disable_powermgr()
41
42 if 'UBIQUITY_ONLY' in os.environ:
43@@ -1351,7 +1375,8 @@ class Wizard(BaseFrontend):
44
45 if self.pagesindex == 0:
46 self.allow_go_backward(False)
47- elif self.pages[self.pagesindex - 1].module.NAME == 'partman':
48+ elif 'partman' in [page.module.NAME for page in
49+ self.pages[:self.pagesindex - 1]]:
50 # We're past partitioning. Unless the install fails, there is no
51 # going back.
52 self.allow_go_backward(False)
53diff --git a/ubiquity/frontend/kde_ui.py b/ubiquity/frontend/kde_ui.py
54index 9a285a5..d1a363d 100644
55--- a/ubiquity/frontend/kde_ui.py
56+++ b/ubiquity/frontend/kde_ui.py
57@@ -950,7 +950,8 @@ class Wizard(BaseFrontend):
58
59 if self.pagesindex == 0:
60 self.allow_go_backward(False)
61- elif self.pages[self.pagesindex - 1].module.NAME == 'partman':
62+ elif 'partman' in [page.module.NAME for page in
63+ self.pages[:self.pagesindex - 1]]:
64 # We're past partitioning. Unless the install fails, there is no
65 # going back.
66 self.allow_go_backward(False)
67diff --git a/ubiquity/gsettings.py b/ubiquity/gsettings.py
68index 7f06f6e..7b1cced 100644
69--- a/ubiquity/gsettings.py
70+++ b/ubiquity/gsettings.py
71@@ -68,6 +68,8 @@ def get(schema, key, user=None):
72 # Parse ints
73 if value.isdigit():
74 return int(value)
75+ if value.startswith('uint32'): # uint32 100
76+ return int(value.split()[1])
77
78 # Parse booleans
79 if value == 'false':

Subscribers

People subscribed via source and target branches