Merge lp:~3v1n0/unity/text-scale-factor-migration-fix into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3746
Proposed branch: lp:~3v1n0/unity/text-scale-factor-migration-fix
Merge into: lp:unity
Diff against target: 30 lines (+8/-6)
1 file modified
tools/migration-scripts/02_unity_setup_text_scale_factor (+8/-6)
To merge this branch: bzr merge lp:~3v1n0/unity/text-scale-factor-migration-fix
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+212522@code.launchpad.net

Commit message

02_unity_setup_text_scale_factor: actually make it working, copy the gnome value to unity

Description of the change

Fix the unity migration script for text-scale, to make it to be really useful... :/

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/migration-scripts/02_unity_setup_text_scale_factor'
2--- tools/migration-scripts/02_unity_setup_text_scale_factor 2014-03-21 15:42:49 +0000
3+++ tools/migration-scripts/02_unity_setup_text_scale_factor 2014-03-24 22:58:01 +0000
4@@ -22,18 +22,20 @@
5 import os,sys
6
7 GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
8-GNOME_UI_SETTINGS_PATH = "/org/gnome/desktop/interface/"
9 GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";
10
11+UNITY_UI_SETTINGS = "com.canonical.Unity.Interface";
12+UNITY_UI_SETTINGS_PATH = "/com/canonical/unity/interface/"
13+UNITY_TEXT_SCALE_FACTOR = "text-scale-factor";
14+
15 if GNOME_UI_SETTINGS not in Gio.Settings.list_schemas():
16 print("No gnome desktop interface schemas found, no migration needed")
17 sys.exit(0)
18
19-ui_settings = Gio.Settings(schema=GNOME_UI_SETTINGS, path=GNOME_UI_SETTINGS_PATH)
20-text_scale_factor = ui_settings.get_double(GNOME_TEXT_SCALE_FACTOR)
21+text_scale_factor = Gio.Settings(schema=GNOME_UI_SETTINGS).get_double(GNOME_TEXT_SCALE_FACTOR)
22
23 # gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
24-# ui_settings.set_int(GNOME_TEXT_SCALE_FACTOR, text_scale_factor)
25+# Gio.Settings(schema=UNITY_UI_SETTINGS).set_int(UNITY_TEXT_SCALE_FACTOR, text_scale_factor)
26 from subprocess import Popen, PIPE, STDOUT
27-p = Popen(("dconf load "+GNOME_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
28-p.communicate(input="[/]\n"+GNOME_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor).encode('utf-8'))
29+p = Popen(("dconf load "+UNITY_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
30+p.communicate(input="[/]\n"+UNITY_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor).encode('utf-8'))