Merge lp://qastaging/~mikemc/ubuntuone-control-panel/add-to-favorites-mac into lp://qastaging/ubuntuone-control-panel

Proposed by Mike McCracken
Status: Merged
Approved by: Mike McCracken
Approved revision: 393
Merged at revision: 389
Proposed branch: lp://qastaging/~mikemc/ubuntuone-control-panel/add-to-favorites-mac
Merge into: lp://qastaging/ubuntuone-control-panel
Prerequisite: lp://qastaging/~mikemc/ubuntuone-control-panel/updater-common
Diff against target: 190 lines (+107/-1)
4 files modified
ubuntuone/controlpanel/gui/qt/main/__init__.py (+3/-1)
ubuntuone/controlpanel/utils/__init__.py (+3/-0)
ubuntuone/controlpanel/utils/darwin.py (+39/-0)
ubuntuone/controlpanel/utils/tests/test_darwin.py (+62/-0)
To merge this branch: bzr merge lp://qastaging/~mikemc/ubuntuone-control-panel/add-to-favorites-mac
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
dobey (community) Approve
Review via email: mp+139530@code.qastaging.launchpad.net

Commit message

- Add u1 folder to OS X Finder favorites sidebar on first launch.

Description of the change

- Add u1 folder to OS X Finder favorites sidebar on first launch.

Writes a flag file to the prefs dir to avoid re-adding the sidebar shortcut if a user has removed it.

Mac specific, call is no-op on linux/windows.

Tests pass on darwin, linux.

To test IRL, run control-panel and see your finder sidebar.
"Ubuntu One" should be the first item in the list.
If it was there already, it'll just be moved to the top if this is the first time you've run this code. You could then move it and re-run the code and nothing will happen.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

I am not terribly convinced by the flag file, but it does work.

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve
393. By Mike McCracken

Switch to using NSUserDefaults instead of a flag file.

Revision history for this message
Mike McCracken (mikemc) wrote :

As per discussion on irc, rev 393 uses NSUserDefaults instead of the ad hoc flag file.
This is good for two reasons:
1. the code is a little nicer (although due to a required wrapper for testing calls to NSUserDefaults, not as nice as I'd like)

2. this is the right approach if we later want to set more mac-specific prefs, while the ad hoc file would not support multiple prefs, but we'd have to keep code to handle it around even if we switched later, so that's ugly.

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches