Merge lp:~azzar1/unity/fix-731578 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Merged at revision: 960
Proposed branch: lp:~azzar1/unity/fix-731578
Merge into: lp:unity
Diff against target: 51 lines (+12/-4)
2 files modified
com.canonical.Unity.gschema.xml (+2/-2)
tools/unity.cmake (+10/-2)
To merge this branch: bzr merge lp:~azzar1/unity/fix-731578
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+53658@code.launchpad.net

Description of the change

Add unity --reset-icons option to restore default launcher icons.

I don't know if this is the better way to do this.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Approved! thanks a lot for your work there ;)

And no, there is no gsettings binding in python (yet), so this is the less ugly way to deal with it :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'com.canonical.Unity.gschema.xml'
--- com.canonical.Unity.gschema.xml 2011-03-16 16:29:02 +0000
+++ com.canonical.Unity.gschema.xml 2011-03-16 17:11:26 +0000
@@ -40,8 +40,8 @@
40 <schema path="/desktop/unity/devices/" id="com.canonical.Unity.Devices" gettext-domain="unity">40 <schema path="/desktop/unity/devices/" id="com.canonical.Unity.Devices" gettext-domain="unity">
41 <key enum="devices-option-enum" name="devices-option">41 <key enum="devices-option-enum" name="devices-option">
42 <default>"OnlyMounted"</default>42 <default>"OnlyMounted"</default>
43 <summary>Summary</summary>43 <summary>The devices that will be shown on launcher</summary>
44 <description>Description</description>44 <description>Key for setting the devices that will be shown on launcher. </description>
45 </key>45 </key>
46 </schema>46 </schema>
47</schemalist>47</schemalist>
4848
=== modified file 'tools/unity.cmake'
--- tools/unity.cmake 2011-03-07 15:47:14 +0000
+++ tools/unity.cmake 2011-03-16 17:11:26 +0000
@@ -87,7 +87,10 @@
87 # the python binding doesn't recursive-unset right87 # the python binding doesn't recursive-unset right
88 subprocess.Popen(["gconftool-2", "--recursive-unset", "/apps/compiz-1"]).communicate()88 subprocess.Popen(["gconftool-2", "--recursive-unset", "/apps/compiz-1"]).communicate()
89 subprocess.Popen(["gconftool-2", "--recursive-unset", "/apps/compizconfig-1/profiles/unity"]).communicate()89 subprocess.Popen(["gconftool-2", "--recursive-unset", "/apps/compizconfig-1/profiles/unity"]).communicate()
90 90
91def reset_launcher_icons ():
92 '''Reset the default launcher icon and restart it.'''
93 subprocess.Popen(["gsettings", "reset" ,"com.canonical.Unity.Launcher" , "favorites"])
9194
92def process_and_start_unity (verbose, debug, compiz_args, log_file):95def process_and_start_unity (verbose, debug, compiz_args, log_file):
93 '''launch unity under compiz (replace the current shell in any case)'''96 '''launch unity under compiz (replace the current shell in any case)'''
@@ -175,7 +178,9 @@
175 parser.add_option("--replace", action="store_true",178 parser.add_option("--replace", action="store_true",
176 help="Run unity /!\ This is for compatibility with other desktop interfaces and acts the same as running unity without --replace")179 help="Run unity /!\ This is for compatibility with other desktop interfaces and acts the same as running unity without --replace")
177 parser.add_option("--reset", action="store_true",180 parser.add_option("--reset", action="store_true",
178 help="Reset the unity profile in compiz and restart it.") 181 help="Reset the unity profile in compiz and restart it.")
182 parser.add_option("--reset-icons", action="store_true",
183 help="Reset the default launcher icon.")
179 parser.add_option("-v", "--verbose", action="store_true",184 parser.add_option("-v", "--verbose", action="store_true",
180 help="Get additional debug output from unity.")185 help="Get additional debug output from unity.")
181 (options, args) = parser.parse_args()186 (options, args) = parser.parse_args()
@@ -187,6 +192,9 @@
187 192
188 if options.reset:193 if options.reset:
189 reset_unity_compiz_profile ()194 reset_unity_compiz_profile ()
195
196 if options.reset_icons:
197 reset_launcher_icons ()
190 198
191 if options.replace:199 if options.replace:
192 print ("WARNING: This is for compatibility with other desktop interfaces please use unity without --replace")200 print ("WARNING: This is for compatibility with other desktop interfaces please use unity without --replace")