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
=== modified file 'tools/migration-scripts/02_unity_setup_text_scale_factor'
--- tools/migration-scripts/02_unity_setup_text_scale_factor 2014-03-21 15:42:49 +0000
+++ tools/migration-scripts/02_unity_setup_text_scale_factor 2014-03-24 22:58:01 +0000
@@ -22,18 +22,20 @@
22import os,sys22import os,sys
2323
24GNOME_UI_SETTINGS = "org.gnome.desktop.interface";24GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
25GNOME_UI_SETTINGS_PATH = "/org/gnome/desktop/interface/"
26GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";25GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";
2726
27UNITY_UI_SETTINGS = "com.canonical.Unity.Interface";
28UNITY_UI_SETTINGS_PATH = "/com/canonical/unity/interface/"
29UNITY_TEXT_SCALE_FACTOR = "text-scale-factor";
30
28if GNOME_UI_SETTINGS not in Gio.Settings.list_schemas():31if GNOME_UI_SETTINGS not in Gio.Settings.list_schemas():
29 print("No gnome desktop interface schemas found, no migration needed")32 print("No gnome desktop interface schemas found, no migration needed")
30 sys.exit(0)33 sys.exit(0)
3134
32ui_settings = Gio.Settings(schema=GNOME_UI_SETTINGS, path=GNOME_UI_SETTINGS_PATH)35text_scale_factor = Gio.Settings(schema=GNOME_UI_SETTINGS).get_double(GNOME_TEXT_SCALE_FACTOR)
33text_scale_factor = ui_settings.get_double(GNOME_TEXT_SCALE_FACTOR)
3436
35# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!37# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
36# ui_settings.set_int(GNOME_TEXT_SCALE_FACTOR, text_scale_factor)38# Gio.Settings(schema=UNITY_UI_SETTINGS).set_int(UNITY_TEXT_SCALE_FACTOR, text_scale_factor)
37from subprocess import Popen, PIPE, STDOUT39from subprocess import Popen, PIPE, STDOUT
38p = Popen(("dconf load "+GNOME_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)40p = Popen(("dconf load "+UNITY_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
39p.communicate(input="[/]\n"+GNOME_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor).encode('utf-8'))41p.communicate(input="[/]\n"+UNITY_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor).encode('utf-8'))