Merge lp:~mandel/ubuntuone-windows-installer/add_icon_overlay into lp:ubuntuone-windows-installer/beta
- add_icon_overlay
- Merge into beta
Proposed by
Manuel de la Peña
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 113 | ||||||||
Proposed branch: | lp:~mandel/ubuntuone-windows-installer/add_icon_overlay | ||||||||
Merge into: | lp:ubuntuone-windows-installer/beta | ||||||||
Diff against target: |
636 lines (+242/-84) 11 files modified
install/UbuntuOne7.wxs (+32/-59) install/UbuntuOneXP.wxs (+32/-2) src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml (+1/-1) src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs (+8/-2) src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs (+5/-0) src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs (+32/-0) src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs (+1/-1) src/UbuntuOne.sln (+10/-10) src/u1sync/client.py (+0/-1) src/u1sync/icons.py (+121/-0) src/u1sync/main.py (+0/-8) |
||||||||
To merge this branch: | bzr merge lp:~mandel/ubuntuone-windows-installer/add_icon_overlay | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu One hackers | Pending | ||
Review via email: mp+39902@code.launchpad.net |
Commit message
Description of the change
Provide icon overlays.
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
1 | === added file 'data/added.ico' |
2 | Binary files data/added.ico 1970-01-01 00:00:00 +0000 and data/added.ico 2010-11-02 21:59:42 +0000 differ |
3 | === added file 'data/conflict.ico' |
4 | Binary files data/conflict.ico 1970-01-01 00:00:00 +0000 and data/conflict.ico 2010-11-02 21:59:42 +0000 differ |
5 | === modified file 'install/UbuntuOne7.wxs' |
6 | --- install/UbuntuOne7.wxs 2010-10-12 10:31:21 +0000 |
7 | +++ install/UbuntuOne7.wxs 2010-11-02 21:59:42 +0000 |
8 | @@ -42,7 +42,7 @@ |
9 | |
10 | <Directory Id="TARGETDIR" |
11 | Name="SourceDir"> |
12 | - <Component Id="RegistryEntries" Guid="76925500-d14e-11df-bd3b-0800200c9a66"> |
13 | + <Component Id="RegistryInstallationPath" Guid="76925500-d14e-11df-bd3b-0800200c9a66"> |
14 | <RegistryKey Root="HKLM" |
15 | Key="Software\Canonical\UbuntuOne" |
16 | Action="createAndRemoveOnUninstall"> |
17 | @@ -91,6 +91,25 @@ |
18 | Name="ProgramFilesFolder"> |
19 | <Directory Id="U1Installdir" |
20 | Name="Ubuntu One"> |
21 | + <Directory Id="IconsDir" |
22 | + Name="Icons"> |
23 | + <Component Id="AddedIconComponent" |
24 | + Guid="5fc1c5f0-d77e-11df-937b-0800200c9a66"> |
25 | + <File Id="Added.ico" |
26 | + Name="Added.ico" |
27 | + DiskId="1" |
28 | + Source="build_results\data\added.ico" |
29 | + KeyPath="yes"/> |
30 | + </Component> |
31 | + <Component Id="ConflictIconComponent" |
32 | + Guid="69cd7d50-d77e-11df-937b-0800200c9a66"> |
33 | + <File Id="Conflict.ico" |
34 | + Name="Conflict.ico" |
35 | + DiskId="1" |
36 | + Source="build_results\data\conflict.ico" |
37 | + KeyPath="yes"/> |
38 | + </Component> |
39 | + </Directory> |
40 | <Directory Id="DaemonDir" |
41 | Name="Daemon"> |
42 | <Component Id="DaemonAutostart" |
43 | @@ -288,6 +307,14 @@ |
44 | Type="string"/> |
45 | <Condition>UBUNTUONECLIENT_START_VIA_REGISTRY</Condition> |
46 | </Component> |
47 | + <Component Id="PhoenixLib" |
48 | + Guid="02c46240-d77e-11df-937b-0800200c9a66"> |
49 | + <File Id="PhoenixControlLib.dll" |
50 | + Name="PhoenixControlLib.dll" |
51 | + DiskId="1" |
52 | + Source="build_results\Client\PhoenixControlLib.dll" |
53 | + KeyPath="yes"/> |
54 | + </Component> |
55 | <Component Id="AvalonLib" |
56 | Guid="99106520-9f9b-11df-981c-0800200c9a66"> |
57 | <File Id="AvalonLibrary.dll" |
58 | @@ -549,14 +576,6 @@ |
59 | Source="build_results\u1sync\API-MS-Win-Core-Handle-L1-1-0.dll" |
60 | KeyPath="yes"/> |
61 | </Component> |
62 | - <Component Id="WinCoreInterlockedComponent" |
63 | - Guid="252ce1d1-b1f0-11df-94e2-0800200c9a66"> |
64 | - <File Id="API_MS_Win_Core_Interlocked_L1_1_0.dll" |
65 | - Name="API-MS-Win-Core-Interlocked-L1-1-0.dll" |
66 | - DiskId="1" |
67 | - Source="build_results\u1sync\API-MS-Win-Core-Interlocked-L1-1-0.dll" |
68 | - KeyPath="yes"/> |
69 | - </Component> |
70 | <Component Id="WinCoreIOComponent" |
71 | Guid="252ce1d2-b1f0-11df-94e2-0800200c9a66"> |
72 | <File Id="API_MS_Win_Core_IO_L1_1_0.dll" |
73 | @@ -813,14 +832,6 @@ |
74 | Source="build_results\u1sync\unicodedata.pyd" |
75 | KeyPath="yes"/> |
76 | </Component> |
77 | - <Component Id="W9xpopenComponent" |
78 | - Guid="bb15dbc7-b1f5-11df-94e2-0800200c9a66"> |
79 | - <File Id="w9xpopen.exe" |
80 | - Name="w9xpopen.exe" |
81 | - DiskId="1" |
82 | - Source="build_results\u1sync\w9xpopen.exe" |
83 | - KeyPath="yes"/> |
84 | - </Component> |
85 | <Component Id="Win32ApiComponent" |
86 | Guid="bb15dbc8-b1f5-11df-94e2-0800200c9a66"> |
87 | <File Id="win32api.pyd" |
88 | @@ -901,41 +912,6 @@ |
89 | Source="build_results\u1sync\zope.interface._zope_interface_coptimizations.pyd" |
90 | KeyPath="yes"/> |
91 | </Component> |
92 | - <Directory Id="Vc90Dir" |
93 | - Name="Microsoft.VC90.CRT"> |
94 | - <Component Id="MicrosoftVC90CRTManifestComponent" |
95 | - Guid="46354fd0-b3ac-11df-8d81-0800200c9a66"> |
96 | - <File Id="Microsoft.VC90.CRT.manifest" |
97 | - Name="Microsoft.VC90.CRT.manifest" |
98 | - DiskId="1" |
99 | - Source="build_results\u1sync\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" |
100 | - KeyPath="yes"/> |
101 | - </Component> |
102 | - <Component Id="Msvcm90Component" |
103 | - Guid="ae81e760-b3ac-11df-8d81-0800200c9a66"> |
104 | - <File Id="msvcm90.dll" |
105 | - Name="msvcm90.dll" |
106 | - DiskId="1" |
107 | - Source="build_results\u1sync\Microsoft.VC90.CRT\msvcm90.dll" |
108 | - KeyPath="yes"/> |
109 | - </Component> |
110 | - <Component Id="Msvcp90Component" |
111 | - Guid="f7dbacc0-b3ac-11df-8d81-0800200c9a66"> |
112 | - <File Id="msvcp90.dll" |
113 | - Name="msvcp90.dll" |
114 | - DiskId="1" |
115 | - Source="build_results\u1sync\Microsoft.VC90.CRT\msvcp90.dll" |
116 | - KeyPath="yes"/> |
117 | - </Component> |
118 | - <Component Id="Msvcr90Component" |
119 | - Guid="e5e63e30-b3ad-11df-8d81-0800200c9a66"> |
120 | - <File Id="msvcr90.dll" |
121 | - Name="msvcr90.dll" |
122 | - DiskId="1" |
123 | - Source="build_results\u1sync\Microsoft.VC90.CRT\msvcr90.dll" |
124 | - KeyPath="yes"/> |
125 | - </Component> |
126 | - </Directory> |
127 | </Directory> |
128 | </Directory> |
129 | </Directory> |
130 | @@ -948,10 +924,12 @@ |
131 | Title="Ubuntu One" |
132 | Description="Ubuntu One is the personal cloud service that simplifies your digital life."> |
133 | <!-- common data --> |
134 | - <ComponentRef Id="RegistryEntries" /> |
135 | + <ComponentRef Id="RegistryInstallationPath" /> |
136 | <ComponentRef Id="ApplicationShortcut" /> |
137 | <ComponentRef Id="UbuntuOneGoDaddyCAComponent" /> |
138 | <ComponentRef Id="UbuntuOneGoDaddyClass2CAComponent" /> |
139 | + <ComponentRef Id="AddedIconComponent" /> |
140 | + <ComponentRef Id="ConflictIconComponent" /> |
141 | <!-- Daemon components --> |
142 | <ComponentRef Id="DaemonCommonLibComponent" /> |
143 | <ComponentRef Id="DaemonCommonPdbComponent" /> |
144 | @@ -975,6 +953,7 @@ |
145 | <ComponentRef Id="SpringDataComponent" /> |
146 | <ComponentRef Id="SymstemDataSQLiteComponent" /> |
147 | <!-- Client components --> |
148 | + <ComponentRef Id="PhoenixLib" /> |
149 | <ComponentRef Id="AvalonLib" /> |
150 | <ComponentRef Id="UbuntuOneClientLib" /> |
151 | <ComponentRef Id="UbuntuOneClientLibPdb" /> |
152 | @@ -1008,7 +987,6 @@ |
153 | <ComponentRef Id="WinCoreDelayComponent" /> |
154 | <ComponentRef Id="WinCoreErrorHandlingComponent" /> |
155 | <ComponentRef Id="WinCoreHandleComponent" /> |
156 | - <ComponentRef Id="WinCoreInterlockedComponent" /> |
157 | <ComponentRef Id="WinCoreIOComponent" /> |
158 | <ComponentRef Id="WinCoreLoaderComponent" /> |
159 | <ComponentRef Id="WinCoreLocalizationComponent" /> |
160 | @@ -1041,7 +1019,6 @@ |
161 | <ComponentRef Id="Ssleay32Component" /> |
162 | <ComponentRef Id="TwistedComponent" /> |
163 | <ComponentRef Id="UnicodeDataComponent" /> |
164 | - <ComponentRef Id="W9xpopenComponent" /> |
165 | <ComponentRef Id="Win32ApiComponent" /> |
166 | <ComponentRef Id="Win32EventComponent" /> |
167 | <ComponentRef Id="Win32EventLogComponent" /> |
168 | @@ -1052,10 +1029,6 @@ |
169 | <ComponentRef Id="Win32UIComponent" /> |
170 | <ComponentRef Id="Win32WnetComponent" /> |
171 | <ComponentRef Id="ZopeInterfaceComponent" /> |
172 | - <ComponentRef Id="MicrosoftVC90CRTManifestComponent" /> |
173 | - <ComponentRef Id="Msvcm90Component" /> |
174 | - <ComponentRef Id="Msvcp90Component" /> |
175 | - <ComponentRef Id="Msvcr90Component" /> |
176 | <ComponentRef Id="UbuntuSSO" /> |
177 | <ComponentRef Id="UbuntuSSOViews" /> |
178 | <ComponentRef Id="Newtonsoft.Json" /> |
179 | |
180 | === modified file 'install/UbuntuOneXP.wxs' |
181 | --- install/UbuntuOneXP.wxs 2010-10-12 10:31:21 +0000 |
182 | +++ install/UbuntuOneXP.wxs 2010-11-02 21:59:42 +0000 |
183 | @@ -42,7 +42,7 @@ |
184 | |
185 | <Directory Id="TARGETDIR" |
186 | Name="SourceDir"> |
187 | - <Component Id="RegistryEntries" Guid="76925500-d14e-11df-bd3b-0800200c9a66"> |
188 | + <Component Id="RegistryInstallationPath" Guid="76925500-d14e-11df-bd3b-0800200c9a66"> |
189 | <RegistryKey Root="HKLM" |
190 | Key="Software\Canonical\UbuntuOne" |
191 | Action="createAndRemoveOnUninstall"> |
192 | @@ -91,6 +91,25 @@ |
193 | Name="ProgramFilesFolder"> |
194 | <Directory Id="U1Installdir" |
195 | Name="UbuntuOne"> |
196 | + <Directory Id="IconsDir" |
197 | + Name="Icons"> |
198 | + <Component Id="AddedIconComponent" |
199 | + Guid="5fc1c5f0-d77e-11df-937b-0800200c9a66"> |
200 | + <File Id="Added.ico" |
201 | + Name="Added.ico" |
202 | + DiskId="1" |
203 | + Source="build_results\data\added.ico" |
204 | + KeyPath="yes"/> |
205 | + </Component> |
206 | + <Component Id="ConflictIconComponent" |
207 | + Guid="69cd7d50-d77e-11df-937b-0800200c9a66"> |
208 | + <File Id="Conflict.ico" |
209 | + Name="Conflict.ico" |
210 | + DiskId="1" |
211 | + Source="build_results\data\conflict.ico" |
212 | + KeyPath="yes"/> |
213 | + </Component> |
214 | + </Directory> |
215 | <Directory Id="DaemonDir" |
216 | Name="Daemon"> |
217 | <Component Id="DaemonAutostart" |
218 | @@ -288,6 +307,14 @@ |
219 | Type="string"/> |
220 | <Condition>UBUNTUONECLIENT_START_VIA_REGISTRY</Condition> |
221 | </Component> |
222 | + <Component Id="PhoenixLib" |
223 | + Guid="02c46240-d77e-11df-937b-0800200c9a66"> |
224 | + <File Id="PhoenixControlLib.dll" |
225 | + Name="PhoenixControlLib.dll" |
226 | + DiskId="1" |
227 | + Source="build_results\Client\PhoenixControlLib.dll" |
228 | + KeyPath="yes"/> |
229 | + </Component> |
230 | <Component Id="AvalonLib" |
231 | Guid="99106520-9f9b-11df-981c-0800200c9a66"> |
232 | <File Id="AvalonLibrary.dll" |
233 | @@ -745,10 +772,12 @@ |
234 | Title="Ubuntu One" |
235 | Description="Ubuntu One is the personal cloud service that simplifies your digital life."> |
236 | <!-- common data --> |
237 | - <ComponentRef Id="RegistryEntries" /> |
238 | + <ComponentRef Id="RegistryInstallationPath" /> |
239 | <ComponentRef Id="ApplicationShortcut" /> |
240 | <ComponentRef Id="UbuntuOneGoDaddyCAComponent" /> |
241 | <ComponentRef Id="UbuntuOneGoDaddyClass2CAComponent" /> |
242 | + <ComponentRef Id="AddedIconComponent" /> |
243 | + <ComponentRef Id="ConflictIconComponent" /> |
244 | <!-- Daemon components --> |
245 | <ComponentRef Id="DaemonCommonLibComponent" /> |
246 | <ComponentRef Id="DaemonCommonPdbComponent" /> |
247 | @@ -772,6 +801,7 @@ |
248 | <ComponentRef Id="SpringDataComponent" /> |
249 | <ComponentRef Id="SymstemDataSQLiteComponent" /> |
250 | <!-- Client components --> |
251 | + <ComponentRef Id="PhoenixLib" /> |
252 | <ComponentRef Id="AvalonLib" /> |
253 | <ComponentRef Id="UbuntuOneClientLib" /> |
254 | <ComponentRef Id="UbuntuOneClientLibPdb" /> |
255 | |
256 | === modified file 'src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml' |
257 | --- src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml 2010-10-13 10:38:57 +0000 |
258 | +++ src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml 2010-11-02 21:59:42 +0000 |
259 | @@ -33,7 +33,7 @@ |
260 | <StackPanel Margin="20"> |
261 | <av:NotifyIcon Name="notifyIcon" Icon="/Canonical.UbuntuOne.Client.Views;component/Resources/ubuntu-logo-22x22.png" |
262 | Text="Ubuntu One"> <!-- TODO: Add icon Icon="/AvalonLibraryTestPages;component/Properties/App.ico" Open preferences when click --> |
263 | - <FrameworkElement.ContextMenu> |
264 | + <FrameworkElement.ContextMenu > |
265 | <ContextMenu> |
266 | <MenuItem x:Uid="UbuntuOneManualSync" |
267 | Name="UbuntuOneManualSync" |
268 | |
269 | === modified file 'src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs' |
270 | --- src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs 2010-10-13 10:38:57 +0000 |
271 | +++ src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs 2010-11-02 21:59:42 +0000 |
272 | @@ -46,6 +46,12 @@ |
273 | |
274 | #region Implementation of INotificationIconView |
275 | |
276 | + public bool IsManualSyncEnabled |
277 | + { |
278 | + get { return UbuntuOneManualSync.IsEnabled; } |
279 | + set { UbuntuOneManualSync.IsEnabled = value; } |
280 | + } |
281 | + |
282 | /// <summary> |
283 | /// Gets and sets a notification to be shown to the user. |
284 | /// </summary> |
285 | @@ -69,8 +75,8 @@ |
286 | /// </summary> |
287 | public string State |
288 | { |
289 | - get { throw new NotImplementedException(); } |
290 | - set { throw new NotImplementedException(); } |
291 | + get { return (string)StateMenuItem.Header; } |
292 | + set { StateMenuItem.Header = value; } |
293 | } |
294 | |
295 | /// <summary> |
296 | |
297 | === modified file 'src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs' |
298 | --- src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs 2010-08-05 08:01:59 +0000 |
299 | +++ src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs 2010-11-02 21:59:42 +0000 |
300 | @@ -25,6 +25,11 @@ |
301 | public interface INotificationIconView |
302 | { |
303 | /// <summary> |
304 | + /// Gets and sets if the manual sync is enabled. |
305 | + /// </summary> |
306 | + bool IsManualSyncEnabled { get; set; } |
307 | + |
308 | + /// <summary> |
309 | /// Gets and sets a notification to be shown to the user. |
310 | /// </summary> |
311 | string Notification { get; set; } |
312 | |
313 | === modified file 'src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs' |
314 | --- src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs 2010-10-12 12:13:30 +0000 |
315 | +++ src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs 2010-11-02 21:59:42 +0000 |
316 | @@ -171,12 +171,37 @@ |
317 | { |
318 | SharesLocation = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); |
319 | SyncsLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "UbuntuOne"); |
320 | + |
321 | } |
322 | |
323 | #endregion |
324 | |
325 | #region Helper methods |
326 | |
327 | + private void OnChanged(object source, FileSystemEventArgs e) |
328 | + { |
329 | + try |
330 | + { |
331 | + var metaRootDir = Path.Combine(SyncsLocation, ".ubuntuone-sync"); |
332 | + using ( |
333 | + var writer = |
334 | + new StreamWriter(File.Open(Path.Combine(metaRootDir, "modified.data"), FileMode.OpenOrCreate))) |
335 | + { |
336 | + writer.WriteLine(e.FullPath); |
337 | + } |
338 | + } |
339 | + catch(Exception) |
340 | + { |
341 | + // do nothing |
342 | + } |
343 | + } |
344 | + |
345 | + private static void CleanMetadata() |
346 | + { |
347 | + var metaRootDir = Path.Combine(SyncsLocation, ".ubuntuone-sync"); |
348 | + File.Open(Path.Combine(metaRootDir, "modified.data"), FileMode.Create); |
349 | + } |
350 | + |
351 | /// <summary> |
352 | /// Helper method that will ensure that when the state of the sync daemon changes this change |
353 | /// is correctly reflected in the View. |
354 | @@ -233,6 +258,8 @@ |
355 | [DebugLogged] |
356 | private void OnCredentialsFound(object sender, CredentialsFoundEventArgs args) |
357 | { |
358 | + NotificationIconView.IsManualSyncEnabled = false; |
359 | + NotificationIconView.State = "Syncing"; |
360 | // check if the credentials are for us |
361 | if (args.ApplicationName != "UbuntuOne") return; |
362 | Logger.Info("Got the UbuntuOne credentials!"); |
363 | @@ -243,9 +270,13 @@ |
364 | // call the ISyncService to perform the manual sync |
365 | |
366 | var syncServiceChannel = SyncDaemonChannelFactory.CreateChannel(); |
367 | + |
368 | ServiceCaller.SaveProxyCall( |
369 | () => syncServiceChannel.ManualSync(oneDir, args.Credentials["Token"], args.Credentials["TokenSecret"],args.Credentials["ConsumerKey"], args.Credentials["ConsumerSecret"]), |
370 | (ICommunicationObject) syncServiceChannel); |
371 | + |
372 | + NotificationIconView.IsManualSyncEnabled = true; |
373 | + NotificationIconView.State = "Synced"; |
374 | } |
375 | |
376 | [DebugLogged] |
377 | @@ -270,6 +301,7 @@ |
378 | /// </summary> |
379 | public void ManualSync() |
380 | { |
381 | + |
382 | // we get the credentials, because we have register an action to the credetials aquired, we do nothing besides this |
383 | SSOCredentialsProvider.LoginToGetCredentials(); |
384 | } |
385 | |
386 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs' |
387 | --- src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs 2010-10-13 12:48:57 +0000 |
388 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs 2010-11-02 21:59:42 +0000 |
389 | @@ -124,6 +124,7 @@ |
390 | private readonly object _isAutoManualSyncLock = new object(); |
391 | private Process _u1syncProcess; |
392 | private readonly object _u1syncProcessLock = new object(); |
393 | + private FileSystemWatcher _changesWatcher; |
394 | |
395 | #endregion |
396 | |
397 | @@ -203,7 +204,6 @@ |
398 | public SyncDaemonService() |
399 | { |
400 | _processesMap = new Dictionary<string, IProcessManager>(); |
401 | - |
402 | } |
403 | |
404 | |
405 | |
406 | === modified file 'src/UbuntuOne.sln' |
407 | --- src/UbuntuOne.sln 2010-10-12 12:42:38 +0000 |
408 | +++ src/UbuntuOne.sln 2010-11-02 21:59:42 +0000 |
409 | @@ -39,8 +39,8 @@ |
410 | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
411 | {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
412 | {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|Any CPU.Build.0 = Debug|Any CPU |
413 | - {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 |
414 | - {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|Mixed Platforms.Build.0 = Debug|x86 |
415 | + {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU |
416 | + {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU |
417 | {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|x86.ActiveCfg = Debug|x86 |
418 | {7467483A-D6D5-4362-8DF4-57A7254EB569}.Debug|x86.Build.0 = Debug|x86 |
419 | {7467483A-D6D5-4362-8DF4-57A7254EB569}.Release|Any CPU.ActiveCfg = Release|x86 |
420 | @@ -50,8 +50,8 @@ |
421 | {7467483A-D6D5-4362-8DF4-57A7254EB569}.Release|x86.Build.0 = Release|x86 |
422 | {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
423 | {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|Any CPU.Build.0 = Debug|Any CPU |
424 | - {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 |
425 | - {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|Mixed Platforms.Build.0 = Debug|x86 |
426 | + {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU |
427 | + {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU |
428 | {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|x86.ActiveCfg = Debug|x86 |
429 | {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Debug|x86.Build.0 = Debug|x86 |
430 | {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Release|Any CPU.ActiveCfg = Release|x86 |
431 | @@ -61,8 +61,8 @@ |
432 | {11353FF8-8E5A-488E-9CB1-873DADD232B9}.Release|x86.Build.0 = Release|x86 |
433 | {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
434 | {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|Any CPU.Build.0 = Debug|Any CPU |
435 | - {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 |
436 | - {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|Mixed Platforms.Build.0 = Debug|x86 |
437 | + {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU |
438 | + {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU |
439 | {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|x86.ActiveCfg = Debug|x86 |
440 | {9F0C15EE-6132-4431-8924-D65530F52CCE}.Debug|x86.Build.0 = Debug|x86 |
441 | {9F0C15EE-6132-4431-8924-D65530F52CCE}.Release|Any CPU.ActiveCfg = Release|x86 |
442 | @@ -72,8 +72,8 @@ |
443 | {9F0C15EE-6132-4431-8924-D65530F52CCE}.Release|x86.Build.0 = Release|x86 |
444 | {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
445 | {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
446 | - {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 |
447 | - {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|Mixed Platforms.Build.0 = Debug|x86 |
448 | + {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU |
449 | + {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU |
450 | {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|x86.ActiveCfg = Debug|x86 |
451 | {8D353509-C095-4E72-A693-3CEE97704C7D}.Debug|x86.Build.0 = Debug|x86 |
452 | {8D353509-C095-4E72-A693-3CEE97704C7D}.Release|Any CPU.ActiveCfg = Release|x86 |
453 | @@ -83,8 +83,8 @@ |
454 | {8D353509-C095-4E72-A693-3CEE97704C7D}.Release|x86.Build.0 = Release|x86 |
455 | {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
456 | {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
457 | - {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 |
458 | - {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|Mixed Platforms.Build.0 = Debug|x86 |
459 | + {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU |
460 | + {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU |
461 | {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|x86.ActiveCfg = Debug|x86 |
462 | {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Debug|x86.Build.0 = Debug|x86 |
463 | {6C139C0B-FDBB-4DA3-9308-0E57531A085F}.Release|Any CPU.ActiveCfg = Release|x86 |
464 | |
465 | === modified file 'src/u1sync/client.py' |
466 | --- src/u1sync/client.py 2010-10-14 11:35:12 +0000 |
467 | +++ src/u1sync/client.py 2010-11-02 21:59:42 +0000 |
468 | @@ -688,7 +688,6 @@ |
469 | self.compressed_size += len(compressed_bytes) |
470 | self.stream.write(compressed_bytes) |
471 | |
472 | - |
473 | with open("\\\\?\\" + unique_filename, "wb+") as compressed: |
474 | with open("\\\\?\\" + filename, "rb") as original: |
475 | staging = StagingFile(compressed) |
476 | |
477 | === added file 'src/u1sync/icons.py' |
478 | --- src/u1sync/icons.py 1970-01-01 00:00:00 +0000 |
479 | +++ src/u1sync/icons.py 2010-11-02 21:59:42 +0000 |
480 | @@ -0,0 +1,121 @@ |
481 | +# Ubuntu One windows Ion overlays |
482 | +# |
483 | +# Author: Tim Cole <tim.cole@canonical.com> |
484 | +# |
485 | +# Copyright 2009 Canonical Ltd. |
486 | +# |
487 | +# This program is free software: you can redistribute it and/or modify it |
488 | +# under the terms of the GNU General Public License version 3, as published |
489 | +# by the Free Software Foundation. |
490 | +# |
491 | +# This program is distributed in the hope that it will be useful, but |
492 | +# WITHOUT ANY WARRANTY; without even the implied warranties of |
493 | +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
494 | +# PURPOSE. See the GNU General Public License for more details. |
495 | +# |
496 | +# You should have received a copy of the GNU General Public License along |
497 | +# with this program. If not, see <http://www.gnu.org/licenses/>. |
498 | +import os |
499 | +from win32com.shell import shell, shellcon |
500 | +import winerror |
501 | +import _winreg |
502 | +import win32api |
503 | +import win32con |
504 | +import win32com.server.register |
505 | +from u1sync import metadata |
506 | +from u1sync.constants import METADATA_DIR_NAME |
507 | + |
508 | +def get_icon_root_location(): |
509 | + # First open the registry hive |
510 | + hive = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) |
511 | + key = _winreg.OpenKey(hive, "Software\Canonical\UbuntuOne") |
512 | + for i in range(0, _winreg.QueryInfoKey(key)[1]): |
513 | + name, value, val_type = _winreg.EnumValue(key, i) |
514 | + # Common AppData will always be present unless the user played with regedit |
515 | + if name == "InstallationPath": |
516 | + return os.path.join(value, "icons") |
517 | + |
518 | +def file_is_in_ubuntuone_root(path): |
519 | + absolute_path = os.path.abspath(path) |
520 | + while True: |
521 | + metadir = os.path.join(absolute_path, '.ubuntuone-sync') |
522 | + if os.path.exists(metadir): |
523 | + return True |
524 | + if absolute_path == "C:\\": |
525 | + return False |
526 | + absolute_path = os.path.split(absolute_path)[0] |
527 | + return True |
528 | + |
529 | +def get_metadata_dir(path): |
530 | + # we need to find the metadata |
531 | + absolute_path = os.path.abspath(path) |
532 | + while True: |
533 | + metadir = os.path.join(absolute_path, '.ubuntuone-sync') |
534 | + if os.path.exists(metadir): |
535 | + return metadir |
536 | + if absolute_path == "C:\\": |
537 | + None |
538 | + absolute_path = os.path.split(absolute_path)[0] |
539 | + return None |
540 | + |
541 | +def file_was_modified(path): |
542 | + absolute_path = os.path.abspath(path) |
543 | + metadir = get_metadata_dir(path) |
544 | + modified_files = open(os.path.join(metadir, "modified.data"), "rb") |
545 | + modified_data = modified_files.read() |
546 | + index = modified_data.find(absolute_path) |
547 | + return index >= 0 |
548 | + |
549 | +class ModifiedIconOverlay: |
550 | + _reg_clsid_ = '{9c2b3e80-d766-11df-937b-0800200c9a66}' |
551 | + _reg_progid_ = 'TJG.PythonPackagesOverlayHandler' |
552 | + _reg_desc_ = 'Icon Overlay Handler to indicate Python packages' |
553 | + _public_methods_ = ['GetOverlayInfo', 'GetPriority', 'IsMemberOf'] |
554 | + _com_interfaces_ = [shell.IID_IShellIconOverlayIdentifier] |
555 | + |
556 | + def GetOverlayInfo(self): |
557 | + icon_path = os.path.join(get_icon_root_location(), "conflict.ico") |
558 | + return (icon_path, 0, shellcon.ISIOI_ICONFILE) |
559 | + |
560 | + def GetPriority(self): |
561 | + return 50 |
562 | + |
563 | + def IsMemberOf(self, fname, attributes): |
564 | + if file_is_in_ubuntuone_root(fname) and file_was_modified(fname): |
565 | + return winerror.S_OK |
566 | + return winerror.E_FAIL |
567 | + |
568 | +class AddedIconOverlay: |
569 | + _reg_clsid_ = '{a9a25b70-d766-11df-937b-0800200c9a66}' |
570 | + _reg_progid_ = 'TJG.PythonPackagesOverlayHandler' |
571 | + _reg_desc_ = 'Icon Overlay Handler to indicate Python packages' |
572 | + _public_methods_ = ['GetOverlayInfo', 'GetPriority', 'IsMemberOf'] |
573 | + _com_interfaces_ = [shell.IID_IShellIconOverlayIdentifier] |
574 | + |
575 | + def GetOverlayInfo(self): |
576 | + icon_path = os.path.join(get_icon_root_location(), "added.ico") |
577 | + return (icon_path, 0, shellcon.ISIOI_ICONFILE) |
578 | + |
579 | + def GetPriority(self): |
580 | + return 50 |
581 | + |
582 | + def IsMemberOf(self, fname, attributes): |
583 | + if file_is_in_ubuntuone_root(fname): |
584 | + return winerror.S_OK |
585 | + return winerror.E_FAIL |
586 | + |
587 | +def icon_overlays_are_registered(): |
588 | + # First open the registry hive |
589 | + hive = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) |
590 | + # Then open the registry key where we stored the overlays |
591 | + try: |
592 | + key = _winreg.OpenKey(hive, "Software\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\UbuntuOneModifiedIconOverlay") |
593 | + key = _winreg.OpenKey(hive, "Software\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\UbuntuOneAddedIconOverlay") |
594 | + return True |
595 | + except: |
596 | + return False |
597 | + |
598 | +def register_icon_overlays(): |
599 | + win32com.server.register.UseCommandLine (ModifiedIconOverlay) |
600 | + win32com.server.register.UseCommandLine (AddedIconOverlay) |
601 | + |
602 | \ No newline at end of file |
603 | |
604 | === modified file 'src/u1sync/main.py' |
605 | --- src/u1sync/main.py 2010-10-11 18:59:47 +0000 |
606 | +++ src/u1sync/main.py 2010-11-02 21:59:42 +0000 |
607 | @@ -332,29 +332,21 @@ |
608 | try: |
609 | do_main(argv, UbuntuOneOptionsParser()) |
610 | except AuthenticationError, e: |
611 | - sed_bus_error("Authentication failed: %s" % e, e) |
612 | print "Authentication failed: %s" % e |
613 | except ConnectionError, e: |
614 | - sed_bus_error("Connection failed: %s" % e, e) |
615 | print "Connection failed: %s" % e |
616 | except DirectoryNotInitializedError, e: |
617 | - sed_bus_error("Directory not initialized", e) |
618 | print "Directory not initialized; " \ |
619 | "use --init [DIRECTORY] to initialize it." |
620 | except DirectoryAlreadyInitializedError, e: |
621 | - sed_bus_error("Directory not initialized", e) |
622 | print "Directory already initialized." |
623 | except NoSuchShareError, e: |
624 | - sed_bus_error("No matching share found.", e) |
625 | print "No matching share found." |
626 | except ReadOnlyShareError, e: |
627 | - sed_bus_error("The selected action isn't possible on a read-only share.", e) |
628 | print "The selected action isn't possible on a read-only share." |
629 | except (ForcedShutdown, KeyboardInterrupt), e: |
630 | - sed_bus_error("Interrupted!", e) |
631 | print "Interrupted!" |
632 | except TreesDiffer, e: |
633 | - sed_bus_error("Trees differ.", e) |
634 | if not e.quiet: |
635 | print "Trees differ." |
636 | else: |