Merge lp:~mandel/ubuntuone-windows-installer/implement_notify_presenter into lp:ubuntuone-windows-installer/beta
- implement_notify_presenter
- Merge into beta
Proposed by
Manuel de la Peña
Status: | Merged |
---|---|
Approved by: | Vincenzo Di Somma |
Approved revision: | 76 |
Merged at revision: | 51 |
Proposed branch: | lp:~mandel/ubuntuone-windows-installer/implement_notify_presenter |
Merge into: | lp:ubuntuone-windows-installer/beta |
Prerequisite: | lp:~mandel/ubuntuone-windows-installer/split_objects_definition |
Diff against target: |
2182 lines (+1372/-203) 44 files modified
build.number (+1/-1) src/Canonical.UbuntuOne.Client.Test/Canonical.UbuntuOne.Client.Test.csproj (+13/-0) src/Canonical.UbuntuOne.Client.Test/Notification/NotificationPresenterFixture.cs (+294/-0) src/Canonical.UbuntuOne.Client.Test/Notification/OperationCompletenessEventArgsFixture.cs (+6/-5) src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs (+31/-2) src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj (+19/-1) src/Canonical.UbuntuOne.Client/Notification/INotificationIconPresenter.cs (+0/-22) src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs (+9/-0) src/Canonical.UbuntuOne.Client/Notification/IStateMapper.cs (+41/-0) src/Canonical.UbuntuOne.Client/Notification/ISyncDaemonClientNotifier.cs (+50/-0) src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs (+171/-23) src/Canonical.UbuntuOne.Client/Notification/NotificationResources.Designer.cs (+117/-0) src/Canonical.UbuntuOne.Client/Notification/NotificationResources.resx (+138/-0) src/Canonical.UbuntuOne.Client/Notification/OperationCompletenessEventArgs.cs (+12/-5) src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialog.cs (+0/-30) src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs (+30/-0) src/Canonical.UbuntuOne.Client/Properties/AssemblyInfo.cs (+1/-0) src/Canonical.UbuntuOne.Client/SyncDaemonClient.cs (+30/-8) src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj (+10/-0) src/Canonical.UbuntuOne.Common/OperationContracts/ISyncConfiguration.cs (+7/-0) src/Canonical.UbuntuOne.Common/OperationContracts/ISyncDaemon.cs (+7/-0) src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFileManager.cs (+11/-0) src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFolders.cs (+7/-0) src/Canonical.UbuntuOne.Common/OperationContracts/ISyncShares.cs (+7/-0) src/Canonical.UbuntuOne.Common/Utils/ApplicationWrapper.cs (+63/-0) src/Canonical.UbuntuOne.Common/Utils/Explorer.cs (+46/-0) src/Canonical.UbuntuOne.Common/Utils/ExplorerException.cs (+43/-0) src/Canonical.UbuntuOne.Common/Utils/IApplication.cs (+45/-0) src/Canonical.UbuntuOne.Common/Utils/IExplorer.cs (+29/-0) src/Canonical.UbuntuOne.Common/Utils/IWebbrowser.cs (+29/-0) src/Canonical.UbuntuOne.Common/Utils/Webbrowser.cs (+32/-0) src/Canonical.UbuntuOne.Common/objects.xml (+13/-2) src/Canonical.UbuntuOne.ProcessDispatcher/SyncConfigurationService.cs (+9/-0) src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs (+10/-0) src/Canonical.UbuntuOne.ProcessDispatcher/SyncFileManagerService.cs (+9/-0) src/Canonical.UbuntuOne.ProcessDispatcher/SyncFoldersService.cs (+9/-0) src/Canonical.UbuntuOne.ProcessDispatcher/SyncSharesService.cs (+9/-0) src/UbuntuOneClient.Tests/ProgramFixture.cs (+7/-3) src/UbuntuOneClient.Tests/UbuntuOneClient.Tests.csproj (+3/-0) src/UbuntuOneClient/ApplicationWrapper.cs (+0/-55) src/UbuntuOneClient/IApplication.cs (+0/-41) src/UbuntuOneClient/Program.cs (+2/-1) src/UbuntuOneClient/UbuntuOneClient.csproj (+0/-2) src/Version.cs (+2/-2) |
To merge this branch: | bzr merge lp:~mandel/ubuntuone-windows-installer/implement_notify_presenter |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John Lenton (community) | Approve | ||
Review via email: mp+31624@code.launchpad.net |
Commit message
Description of the change
Provides the implementation of the notification icon presenter.
To post a comment you must log in.
- 74. By Manuel de la Peña
-
Merge with parent
Revision history for this message
John Lenton (chipaca) : | # |
review:
Approve
- 75. By Manuel de la Peña
-
Merge with parent.
- 76. By Manuel de la Peña
-
Fixed errors related to merge issues.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'build.number' | |||
2 | --- build.number 2010-08-04 14:20:36 +0000 | |||
3 | +++ build.number 2010-08-09 16:14:47 +0000 | |||
4 | @@ -1,1 +1,1 @@ | |||
5 | 1 | 1.0.404.5869 | ||
6 | 2 | \ No newline at end of file | 1 | \ No newline at end of file |
7 | 2 | 1.0.409.6549 | ||
8 | 3 | \ No newline at end of file | 3 | \ No newline at end of file |
9 | 4 | 4 | ||
10 | === modified file 'src/Canonical.UbuntuOne.Client.Test/Canonical.UbuntuOne.Client.Test.csproj' | |||
11 | --- src/Canonical.UbuntuOne.Client.Test/Canonical.UbuntuOne.Client.Test.csproj 2010-07-30 09:33:20 +0000 | |||
12 | +++ src/Canonical.UbuntuOne.Client.Test/Canonical.UbuntuOne.Client.Test.csproj 2010-08-09 16:14:47 +0000 | |||
13 | @@ -31,10 +31,18 @@ | |||
14 | 31 | <WarningLevel>4</WarningLevel> | 31 | <WarningLevel>4</WarningLevel> |
15 | 32 | </PropertyGroup> | 32 | </PropertyGroup> |
16 | 33 | <ItemGroup> | 33 | <ItemGroup> |
17 | 34 | <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> | ||
18 | 35 | <SpecificVersion>False</SpecificVersion> | ||
19 | 36 | <HintPath>..\..\lib\log4net\log4net.dll</HintPath> | ||
20 | 37 | </Reference> | ||
21 | 34 | <Reference Include="nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> | 38 | <Reference Include="nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> |
22 | 35 | <SpecificVersion>False</SpecificVersion> | 39 | <SpecificVersion>False</SpecificVersion> |
23 | 36 | <HintPath>..\..\lib\Nunit\nunit.framework.dll</HintPath> | 40 | <HintPath>..\..\lib\Nunit\nunit.framework.dll</HintPath> |
24 | 37 | </Reference> | 41 | </Reference> |
25 | 42 | <Reference Include="Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL"> | ||
26 | 43 | <SpecificVersion>False</SpecificVersion> | ||
27 | 44 | <HintPath>..\..\lib\RhinoMocks\Rhino.Mocks.dll</HintPath> | ||
28 | 45 | </Reference> | ||
29 | 38 | <Reference Include="System" /> | 46 | <Reference Include="System" /> |
30 | 39 | <Reference Include="System.Core"> | 47 | <Reference Include="System.Core"> |
31 | 40 | <RequiredTargetFramework>3.5</RequiredTargetFramework> | 48 | <RequiredTargetFramework>3.5</RequiredTargetFramework> |
32 | @@ -53,6 +61,7 @@ | |||
33 | 53 | <Link>Properties\Version.cs</Link> | 61 | <Link>Properties\Version.cs</Link> |
34 | 54 | </Compile> | 62 | </Compile> |
35 | 55 | <Compile Include="Notification\NotificationEventArgsFixture.cs" /> | 63 | <Compile Include="Notification\NotificationEventArgsFixture.cs" /> |
36 | 64 | <Compile Include="Notification\NotificationPresenterFixture.cs" /> | ||
37 | 56 | <Compile Include="Notification\OperationCompletenessEventArgsFixture.cs" /> | 65 | <Compile Include="Notification\OperationCompletenessEventArgsFixture.cs" /> |
38 | 57 | <Compile Include="Notification\RecentlyModifiedEventArgsFixture.cs" /> | 66 | <Compile Include="Notification\RecentlyModifiedEventArgsFixture.cs" /> |
39 | 58 | <Compile Include="Notification\StateEventArgsFixture.cs" /> | 67 | <Compile Include="Notification\StateEventArgsFixture.cs" /> |
40 | @@ -63,6 +72,10 @@ | |||
41 | 63 | <Project>{7467483A-D6D5-4362-8DF4-57A7254EB569}</Project> | 72 | <Project>{7467483A-D6D5-4362-8DF4-57A7254EB569}</Project> |
42 | 64 | <Name>Canonical.UbuntuOne.Client</Name> | 73 | <Name>Canonical.UbuntuOne.Client</Name> |
43 | 65 | </ProjectReference> | 74 | </ProjectReference> |
44 | 75 | <ProjectReference Include="..\Canonical.UbuntuOne.Common\Canonical.UbuntuOne.Common.csproj"> | ||
45 | 76 | <Project>{11353FF8-8E5A-488E-9CB1-873DADD232B9}</Project> | ||
46 | 77 | <Name>Canonical.UbuntuOne.Common</Name> | ||
47 | 78 | </ProjectReference> | ||
48 | 66 | </ItemGroup> | 79 | </ItemGroup> |
49 | 67 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | 80 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
50 | 68 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | 81 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
51 | 69 | 82 | ||
52 | === added file 'src/Canonical.UbuntuOne.Client.Test/Notification/NotificationPresenterFixture.cs' | |||
53 | --- src/Canonical.UbuntuOne.Client.Test/Notification/NotificationPresenterFixture.cs 1970-01-01 00:00:00 +0000 | |||
54 | +++ src/Canonical.UbuntuOne.Client.Test/Notification/NotificationPresenterFixture.cs 2010-08-09 16:14:47 +0000 | |||
55 | @@ -0,0 +1,294 @@ | |||
56 | 1 | /** | ||
57 | 2 | * Copyright 2010 Canonical Ltd. | ||
58 | 3 | * | ||
59 | 4 | * This file is part of UbuntuOne on Windows. | ||
60 | 5 | * | ||
61 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
62 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
63 | 8 | * as published by the Free Software Foundation. | ||
64 | 9 | * | ||
65 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
66 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
67 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
68 | 13 | * GNU Lesser General Public License for more details. | ||
69 | 14 | * | ||
70 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
71 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
72 | 17 | * | ||
73 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
74 | 19 | */ | ||
75 | 20 | using System; | ||
76 | 21 | using System.Collections.Generic; | ||
77 | 22 | using Canonical.UbuntuOne.Client.Notification; | ||
78 | 23 | using Canonical.UbuntuOne.Client.Preferences; | ||
79 | 24 | using Canonical.UbuntuOne.Common.Utils; | ||
80 | 25 | using log4net; | ||
81 | 26 | using NUnit.Framework; | ||
82 | 27 | using Rhino.Mocks; | ||
83 | 28 | using Rhino.Mocks.Interfaces; | ||
84 | 29 | |||
85 | 30 | namespace Canonical.UbuntuOne.Client.Test.Notification | ||
86 | 31 | { | ||
87 | 32 | [TestFixture] | ||
88 | 33 | public class NotificationPresenterFixture | ||
89 | 34 | { | ||
90 | 35 | |||
91 | 36 | #region Variables | ||
92 | 37 | |||
93 | 38 | private MockRepository _mocks; | ||
94 | 39 | private IApplication _app; | ||
95 | 40 | private IExplorer _explorer; | ||
96 | 41 | private IWebbrowser _browser; | ||
97 | 42 | private IStateMapper _mapper; | ||
98 | 43 | private IPreferencesDialogPresenter _preferences; | ||
99 | 44 | private INotificationIconView _view; | ||
100 | 45 | private ISyncDaemonClientNotifier _notifier; | ||
101 | 46 | private NotificationIconPresenter _presenter; | ||
102 | 47 | private ILog _logger; | ||
103 | 48 | |||
104 | 49 | #endregion | ||
105 | 50 | |||
106 | 51 | #region Setup | ||
107 | 52 | |||
108 | 53 | [SetUp] | ||
109 | 54 | public void Setup() | ||
110 | 55 | { | ||
111 | 56 | _mocks = new MockRepository(); | ||
112 | 57 | _app = _mocks.StrictMock<IApplication>(); | ||
113 | 58 | _explorer = _mocks.StrictMock<IExplorer>(); | ||
114 | 59 | _browser = _mocks.StrictMock<IWebbrowser>(); | ||
115 | 60 | _mapper = _mocks.StrictMock<IStateMapper>(); | ||
116 | 61 | _preferences = _mocks.StrictMock<IPreferencesDialogPresenter>(); | ||
117 | 62 | _view = _mocks.StrictMock<INotificationIconView>(); | ||
118 | 63 | _notifier = _mocks.DynamicMock<ISyncDaemonClientNotifier>(); | ||
119 | 64 | _logger = _mocks.StrictMock<ILog>(); | ||
120 | 65 | _presenter = new NotificationIconPresenter | ||
121 | 66 | { | ||
122 | 67 | Application = _app, | ||
123 | 68 | Explorer = _explorer, | ||
124 | 69 | Webbrowser = _browser, | ||
125 | 70 | StateMapper = _mapper, | ||
126 | 71 | PreferencesDialogPresenter = _preferences, | ||
127 | 72 | NotificationIconView = _view, | ||
128 | 73 | Logger = _logger | ||
129 | 74 | }; | ||
130 | 75 | _mocks.BackToRecordAll(); | ||
131 | 76 | } | ||
132 | 77 | |||
133 | 78 | #endregion | ||
134 | 79 | |||
135 | 80 | #region Tests | ||
136 | 81 | |||
137 | 82 | [Test] | ||
138 | 83 | public void OnStateChange() | ||
139 | 84 | { | ||
140 | 85 | IEventRaiser onStateRaiser; | ||
141 | 86 | var args = new StateEventArgs(StateEventArgs.StateEnum.OUT_OF_SYNC); | ||
142 | 87 | using (_mocks.Record()) | ||
143 | 88 | { | ||
144 | 89 | _notifier.OnStateChanged += null; | ||
145 | 90 | onStateRaiser = LastCall.IgnoreArguments().GetEventRaiser(); | ||
146 | 91 | |||
147 | 92 | Expect.Call(_mapper.ToString(args.State)) | ||
148 | 93 | .Return("") | ||
149 | 94 | .Repeat.Once(); | ||
150 | 95 | _view.State = "new state"; | ||
151 | 96 | |||
152 | 97 | LastCall.IgnoreArguments(); | ||
153 | 98 | } | ||
154 | 99 | using(_mocks.Playback()) | ||
155 | 100 | { | ||
156 | 101 | _presenter.SyncDaemonClientNotifier = _notifier; | ||
157 | 102 | onStateRaiser.Raise(this, args); | ||
158 | 103 | } | ||
159 | 104 | } | ||
160 | 105 | |||
161 | 106 | [Test] | ||
162 | 107 | public void OnRecentlyModifiedTest() | ||
163 | 108 | { | ||
164 | 109 | IEventRaiser onRecentlyModifiedRaiser; | ||
165 | 110 | var args = new RecentlyModifiedEventArgs(new List<string>()); | ||
166 | 111 | using(_mocks.Record()) | ||
167 | 112 | { | ||
168 | 113 | _notifier.OnRecentlyModifiedChanged += null; | ||
169 | 114 | onRecentlyModifiedRaiser = LastCall.IgnoreArguments().GetEventRaiser(); | ||
170 | 115 | _view.RecentlyModifiedFiles = new List<string>(); | ||
171 | 116 | LastCall.IgnoreArguments(); | ||
172 | 117 | } | ||
173 | 118 | using(_mocks.Playback()) | ||
174 | 119 | { | ||
175 | 120 | _presenter.SyncDaemonClientNotifier = _notifier; | ||
176 | 121 | onRecentlyModifiedRaiser.Raise(this, args); | ||
177 | 122 | } | ||
178 | 123 | } | ||
179 | 124 | |||
180 | 125 | [Test] | ||
181 | 126 | public void OnOperationCompletnessTest() | ||
182 | 127 | { | ||
183 | 128 | IEventRaiser onOperationCompletnessRaiser; | ||
184 | 129 | var args = new OperationCompletenessEventArgs("dowload", 45, 23.4, | ||
185 | 130 | OperationCompletenessEventArgs.SpeedUnitsEnum.KB); | ||
186 | 131 | using(_mocks.Record()) | ||
187 | 132 | { | ||
188 | 133 | _notifier.OnOperationCompletness += null; | ||
189 | 134 | onOperationCompletnessRaiser = LastCall.IgnoreArguments().GetEventRaiser(); | ||
190 | 135 | _view.CurrentOperation = ""; | ||
191 | 136 | LastCall.IgnoreArguments(); | ||
192 | 137 | } | ||
193 | 138 | using(_mocks.Playback()) | ||
194 | 139 | { | ||
195 | 140 | _presenter.SyncDaemonClientNotifier = _notifier; | ||
196 | 141 | onOperationCompletnessRaiser.Raise(this, args); | ||
197 | 142 | } | ||
198 | 143 | } | ||
199 | 144 | |||
200 | 145 | [Test] | ||
201 | 146 | public void OnNotificationTest() | ||
202 | 147 | { | ||
203 | 148 | IEventRaiser onNotificationRaiser; | ||
204 | 149 | var notification = "mensagge"; | ||
205 | 150 | var args = new NotificationEventArgs(notification); | ||
206 | 151 | using (_mocks.Record()) | ||
207 | 152 | { | ||
208 | 153 | _notifier.OnNotification += null; | ||
209 | 154 | onNotificationRaiser = LastCall.IgnoreArguments().GetEventRaiser(); | ||
210 | 155 | _view.Notification = notification; | ||
211 | 156 | } | ||
212 | 157 | using(_mocks.Playback()) | ||
213 | 158 | { | ||
214 | 159 | _presenter.SyncDaemonClientNotifier = _notifier; | ||
215 | 160 | onNotificationRaiser.Raise(this, args); | ||
216 | 161 | } | ||
217 | 162 | } | ||
218 | 163 | |||
219 | 164 | [Test] | ||
220 | 165 | public void OpenPreferencesTest() | ||
221 | 166 | { | ||
222 | 167 | using(_mocks.Record()) | ||
223 | 168 | { | ||
224 | 169 | Expect.Call(() => _preferences.Show()) | ||
225 | 170 | .Repeat.Once(); | ||
226 | 171 | } | ||
227 | 172 | using(_mocks.Playback()) | ||
228 | 173 | { | ||
229 | 174 | _presenter.OpenUbuntuOnePreferences(); | ||
230 | 175 | } | ||
231 | 176 | } | ||
232 | 177 | |||
233 | 178 | [Test] | ||
234 | 179 | public void OpenShareLocationTest() | ||
235 | 180 | { | ||
236 | 181 | using(_mocks.Record()) | ||
237 | 182 | { | ||
238 | 183 | Expect.Call(() => _explorer.OpenFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))) | ||
239 | 184 | .Repeat.Once(); | ||
240 | 185 | } | ||
241 | 186 | using(_mocks.Playback()) | ||
242 | 187 | { | ||
243 | 188 | _presenter.OpenSharesLocation(); | ||
244 | 189 | } | ||
245 | 190 | |||
246 | 191 | } | ||
247 | 192 | |||
248 | 193 | [Test] | ||
249 | 194 | [ExpectedException(typeof(ExplorerException))] | ||
250 | 195 | public void OpenShareLocationExceptionTest() | ||
251 | 196 | { | ||
252 | 197 | using (_mocks.Record()) | ||
253 | 198 | { | ||
254 | 199 | Expect.Call(() => _explorer.OpenFolder("")) | ||
255 | 200 | .IgnoreArguments() | ||
256 | 201 | .Throw(new ExplorerException()); | ||
257 | 202 | Expect.Call(() => _logger.WarnFormat("(0)", new ExplorerException())) | ||
258 | 203 | .IgnoreArguments() | ||
259 | 204 | .Repeat.Once(); | ||
260 | 205 | _view.Notification = "error msg"; | ||
261 | 206 | LastCall.IgnoreArguments(); | ||
262 | 207 | } | ||
263 | 208 | using (_mocks.Playback()) | ||
264 | 209 | { | ||
265 | 210 | _presenter.OpenSharesLocation(); | ||
266 | 211 | } | ||
267 | 212 | } | ||
268 | 213 | |||
269 | 214 | [Test] | ||
270 | 215 | public void OpenSyncsLocationTest() | ||
271 | 216 | { | ||
272 | 217 | using (_mocks.Record()) | ||
273 | 218 | { | ||
274 | 219 | Expect.Call(() => _explorer.OpenFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))) | ||
275 | 220 | .Repeat.Once(); | ||
276 | 221 | } | ||
277 | 222 | using (_mocks.Playback()) | ||
278 | 223 | { | ||
279 | 224 | _presenter.OpenSyncsLocation(); | ||
280 | 225 | } | ||
281 | 226 | } | ||
282 | 227 | |||
283 | 228 | [Test] | ||
284 | 229 | [ExpectedException(typeof(ExplorerException))] | ||
285 | 230 | public void OpenSyncsLocationExceptionTest() | ||
286 | 231 | { | ||
287 | 232 | using (_mocks.Record()) | ||
288 | 233 | { | ||
289 | 234 | Expect.Call(() => _explorer.OpenFolder("")) | ||
290 | 235 | .IgnoreArguments() | ||
291 | 236 | .Throw(new ExplorerException()); | ||
292 | 237 | Expect.Call(() => _logger.WarnFormat("(0)", new ExplorerException())) | ||
293 | 238 | .IgnoreArguments() | ||
294 | 239 | .Repeat.Once(); | ||
295 | 240 | _view.Notification = "error msg"; | ||
296 | 241 | LastCall.IgnoreArguments(); | ||
297 | 242 | } | ||
298 | 243 | using (_mocks.Playback()) | ||
299 | 244 | { | ||
300 | 245 | _presenter.OpenSyncsLocation(); | ||
301 | 246 | } | ||
302 | 247 | } | ||
303 | 248 | |||
304 | 249 | [Test] | ||
305 | 250 | public void OpenHelpTest() | ||
306 | 251 | { | ||
307 | 252 | using (_mocks.Record()) | ||
308 | 253 | { | ||
309 | 254 | Expect.Call(() => _browser.LauncWebpage(NotificationIconPresenter.HelpUrl)) | ||
310 | 255 | .Repeat.Once(); | ||
311 | 256 | } | ||
312 | 257 | using (_mocks.Playback()) | ||
313 | 258 | { | ||
314 | 259 | _presenter.OpenHelp(); | ||
315 | 260 | } | ||
316 | 261 | } | ||
317 | 262 | |||
318 | 263 | [Test] | ||
319 | 264 | public void OpenUpgradeOptionTest() | ||
320 | 265 | { | ||
321 | 266 | using (_mocks.Record()) | ||
322 | 267 | { | ||
323 | 268 | Expect.Call(() => _browser.LauncWebpage(NotificationIconPresenter.UpgradeUrl)) | ||
324 | 269 | .Repeat.Once(); | ||
325 | 270 | } | ||
326 | 271 | using (_mocks.Playback()) | ||
327 | 272 | { | ||
328 | 273 | _presenter.OpenUpgradeOption(); | ||
329 | 274 | } | ||
330 | 275 | } | ||
331 | 276 | |||
332 | 277 | [Test] | ||
333 | 278 | public void ExitApplicationTest() | ||
334 | 279 | { | ||
335 | 280 | using (_mocks.Record()) | ||
336 | 281 | { | ||
337 | 282 | Expect.Call(() => _app.Exit()) | ||
338 | 283 | .Repeat.Once(); | ||
339 | 284 | } | ||
340 | 285 | using (_mocks.Playback()) | ||
341 | 286 | { | ||
342 | 287 | _presenter.Exit(); | ||
343 | 288 | } | ||
344 | 289 | } | ||
345 | 290 | |||
346 | 291 | #endregion | ||
347 | 292 | |||
348 | 293 | } | ||
349 | 294 | } | ||
350 | 0 | 295 | ||
351 | === modified file 'src/Canonical.UbuntuOne.Client.Test/Notification/OperationCompletenessEventArgsFixture.cs' | |||
352 | --- src/Canonical.UbuntuOne.Client.Test/Notification/OperationCompletenessEventArgsFixture.cs 2010-07-27 11:57:29 +0000 | |||
353 | +++ src/Canonical.UbuntuOne.Client.Test/Notification/OperationCompletenessEventArgsFixture.cs 2010-08-09 16:14:47 +0000 | |||
354 | @@ -37,12 +37,13 @@ | |||
355 | 37 | Assert.AreEqual(OperationCompletenessEventArgs.SpeedUnitsEnum.MB, args.SpeedUnits); | 37 | Assert.AreEqual(OperationCompletenessEventArgs.SpeedUnitsEnum.MB, args.SpeedUnits); |
356 | 38 | } | 38 | } |
357 | 39 | 39 | ||
362 | 40 | [TestCase(1, 3.4, OperationCompletenessEventArgs.SpeedUnitsEnum.MB)] | 40 | [TestCase("work", 1, 3.4, OperationCompletenessEventArgs.SpeedUnitsEnum.MB)] |
363 | 41 | [TestCase(2323, 0.0, OperationCompletenessEventArgs.SpeedUnitsEnum.MB)] | 41 | [TestCase("dance", 2323, 0.0, OperationCompletenessEventArgs.SpeedUnitsEnum.MB)] |
364 | 42 | [TestCase(45, 23.4, OperationCompletenessEventArgs.SpeedUnitsEnum.KB)] | 42 | [TestCase("dowload", 45, 23.4, OperationCompletenessEventArgs.SpeedUnitsEnum.KB)] |
365 | 43 | public void ParametersConstructorTest(int percentage, double speed, OperationCompletenessEventArgs.SpeedUnitsEnum unitsEnum) | 43 | public void ParametersConstructorTest(string operation, int percentage, double speed, OperationCompletenessEventArgs.SpeedUnitsEnum unitsEnum) |
366 | 44 | { | 44 | { |
368 | 45 | var args = new OperationCompletenessEventArgs(percentage, speed, unitsEnum); | 45 | var args = new OperationCompletenessEventArgs(operation, percentage, speed, unitsEnum); |
369 | 46 | Assert.AreEqual(operation, args.Operation); | ||
370 | 46 | Assert.AreEqual(percentage, args.Percentage); | 47 | Assert.AreEqual(percentage, args.Percentage); |
371 | 47 | Assert.AreEqual(speed, args.Speed); | 48 | Assert.AreEqual(speed, args.Speed); |
372 | 48 | Assert.AreEqual(unitsEnum, args.SpeedUnits); | 49 | Assert.AreEqual(unitsEnum, args.SpeedUnits); |
373 | 49 | 50 | ||
374 | === modified file 'src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs' | |||
375 | --- src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs 2010-07-28 11:06:07 +0000 | |||
376 | +++ src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs 2010-08-09 16:14:47 +0000 | |||
377 | @@ -17,7 +17,8 @@ | |||
378 | 17 | * | 17 | * |
379 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
380 | 19 | */ | 19 | */ |
382 | 20 | using System.Windows; | 20 | using System; |
383 | 21 | using System.Collections.Generic; | ||
384 | 21 | using Canonical.UbuntuOne.Client.Notification; | 22 | using Canonical.UbuntuOne.Client.Notification; |
385 | 22 | 23 | ||
386 | 23 | namespace Canonical.UbuntuOne.Client.Views | 24 | namespace Canonical.UbuntuOne.Client.Views |
387 | @@ -25,11 +26,39 @@ | |||
388 | 25 | /// <summary> | 26 | /// <summary> |
389 | 26 | /// Interaction logic for UbuntuOneNotifyIcon.xaml | 27 | /// Interaction logic for UbuntuOneNotifyIcon.xaml |
390 | 27 | /// </summary> | 28 | /// </summary> |
392 | 28 | public partial class UbuntuOneNotifyIcon : Window, INotificationIconView | 29 | public partial class UbuntuOneNotifyIcon : INotificationIconView |
393 | 29 | { | 30 | { |
394 | 30 | public UbuntuOneNotifyIcon() | 31 | public UbuntuOneNotifyIcon() |
395 | 31 | { | 32 | { |
396 | 32 | InitializeComponent(); | 33 | InitializeComponent(); |
397 | 33 | } | 34 | } |
398 | 35 | |||
399 | 36 | #region Implementation of INotificationIconView | ||
400 | 37 | |||
401 | 38 | public string Notification | ||
402 | 39 | { | ||
403 | 40 | get { throw new NotImplementedException(); } | ||
404 | 41 | set { throw new NotImplementedException(); } | ||
405 | 42 | } | ||
406 | 43 | |||
407 | 44 | public IList<string> RecentlyModifiedFiles | ||
408 | 45 | { | ||
409 | 46 | get { throw new NotImplementedException(); } | ||
410 | 47 | set { throw new NotImplementedException(); } | ||
411 | 48 | } | ||
412 | 49 | |||
413 | 50 | public string State | ||
414 | 51 | { | ||
415 | 52 | get { throw new NotImplementedException(); } | ||
416 | 53 | set { throw new NotImplementedException(); } | ||
417 | 54 | } | ||
418 | 55 | |||
419 | 56 | public string CurrentOperation | ||
420 | 57 | { | ||
421 | 58 | get { throw new NotImplementedException(); } | ||
422 | 59 | set { throw new NotImplementedException(); } | ||
423 | 60 | } | ||
424 | 61 | |||
425 | 62 | #endregion | ||
426 | 34 | } | 63 | } |
427 | 35 | } | 64 | } |
428 | 36 | 65 | ||
429 | === modified file 'src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj' | |||
430 | --- src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj 2010-08-02 17:57:48 +0000 | |||
431 | +++ src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj 2010-08-09 16:14:47 +0000 | |||
432 | @@ -36,13 +36,20 @@ | |||
433 | 36 | <Link>Properties\Version.cs</Link> | 36 | <Link>Properties\Version.cs</Link> |
434 | 37 | </Compile> | 37 | </Compile> |
435 | 38 | <Compile Include="Notification\INotificationIconView.cs" /> | 38 | <Compile Include="Notification\INotificationIconView.cs" /> |
436 | 39 | <Compile Include="Notification\IStateMapper.cs" /> | ||
437 | 40 | <Compile Include="Notification\ISyncDaemonClientNotifier.cs" /> | ||
438 | 39 | <Compile Include="Notification\NotificationIconPresenter.cs" /> | 41 | <Compile Include="Notification\NotificationIconPresenter.cs" /> |
439 | 42 | <Compile Include="Notification\NotificationResources.Designer.cs"> | ||
440 | 43 | <AutoGen>True</AutoGen> | ||
441 | 44 | <DesignTime>True</DesignTime> | ||
442 | 45 | <DependentUpon>NotificationResources.resx</DependentUpon> | ||
443 | 46 | </Compile> | ||
444 | 40 | <Compile Include="Notification\OperationCompletenessEventArgs.cs" /> | 47 | <Compile Include="Notification\OperationCompletenessEventArgs.cs" /> |
445 | 41 | <Compile Include="Notification\RecentlyModifiedEventArgs.cs" /> | 48 | <Compile Include="Notification\RecentlyModifiedEventArgs.cs" /> |
446 | 42 | <Compile Include="Notification\StateEventArgs.cs" /> | 49 | <Compile Include="Notification\StateEventArgs.cs" /> |
447 | 43 | <Compile Include="Notification\INotificationIconPresenter.cs" /> | 50 | <Compile Include="Notification\INotificationIconPresenter.cs" /> |
448 | 44 | <Compile Include="Notification\NotificationEventArgs.cs" /> | 51 | <Compile Include="Notification\NotificationEventArgs.cs" /> |
450 | 45 | <Compile Include="Preferences\IPreferencesDialog.cs" /> | 52 | <Compile Include="Preferences\IPreferencesDialogPresenter.cs" /> |
451 | 46 | <Compile Include="Properties\AssemblyInfo.cs" /> | 53 | <Compile Include="Properties\AssemblyInfo.cs" /> |
452 | 47 | <Compile Include="SyncDaemonClient.cs" /> | 54 | <Compile Include="SyncDaemonClient.cs" /> |
453 | 48 | </ItemGroup> | 55 | </ItemGroup> |
454 | @@ -53,6 +60,10 @@ | |||
455 | 53 | </ProjectReference> | 60 | </ProjectReference> |
456 | 54 | </ItemGroup> | 61 | </ItemGroup> |
457 | 55 | <ItemGroup> | 62 | <ItemGroup> |
458 | 63 | <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> | ||
459 | 64 | <SpecificVersion>False</SpecificVersion> | ||
460 | 65 | <HintPath>..\..\lib\log4net\log4net.dll</HintPath> | ||
461 | 66 | </Reference> | ||
462 | 56 | <Reference Include="PresentationFramework"> | 67 | <Reference Include="PresentationFramework"> |
463 | 57 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 68 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
464 | 58 | </Reference> | 69 | </Reference> |
465 | @@ -63,5 +74,12 @@ | |||
466 | 63 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 74 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
467 | 64 | </Reference> | 75 | </Reference> |
468 | 65 | </ItemGroup> | 76 | </ItemGroup> |
469 | 77 | <ItemGroup> | ||
470 | 78 | <EmbeddedResource Include="Notification\NotificationResources.resx"> | ||
471 | 79 | <Generator>ResXFileCodeGenerator</Generator> | ||
472 | 80 | <LastGenOutput>NotificationResources.Designer.cs</LastGenOutput> | ||
473 | 81 | <SubType>Designer</SubType> | ||
474 | 82 | </EmbeddedResource> | ||
475 | 83 | </ItemGroup> | ||
476 | 66 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | 84 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
477 | 67 | </Project> | 85 | </Project> |
478 | 68 | \ No newline at end of file | 86 | \ No newline at end of file |
479 | 69 | 87 | ||
480 | === modified file 'src/Canonical.UbuntuOne.Client/Notification/INotificationIconPresenter.cs' | |||
481 | --- src/Canonical.UbuntuOne.Client/Notification/INotificationIconPresenter.cs 2010-07-27 11:58:32 +0000 | |||
482 | +++ src/Canonical.UbuntuOne.Client/Notification/INotificationIconPresenter.cs 2010-08-09 16:14:47 +0000 | |||
483 | @@ -17,8 +17,6 @@ | |||
484 | 17 | * | 17 | * |
485 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
486 | 19 | */ | 19 | */ |
487 | 20 | using System; | ||
488 | 21 | |||
489 | 22 | namespace Canonical.UbuntuOne.Client.Notification | 20 | namespace Canonical.UbuntuOne.Client.Notification |
490 | 23 | { | 21 | { |
491 | 24 | /// <summary> | 22 | /// <summary> |
492 | @@ -28,26 +26,6 @@ | |||
493 | 28 | public interface INotificationIconPresenter | 26 | public interface INotificationIconPresenter |
494 | 29 | { | 27 | { |
495 | 30 | /// <summary> | 28 | /// <summary> |
496 | 31 | /// Event to be raised when there is a notification to display to the user. | ||
497 | 32 | /// </summary> | ||
498 | 33 | event EventHandler<NotificationEventArgs> OnNotificationChanged; | ||
499 | 34 | |||
500 | 35 | /// <summary> | ||
501 | 36 | /// Event to be raised when there status of the daemon has changed. | ||
502 | 37 | /// </summary> | ||
503 | 38 | event EventHandler<StateEventArgs> OnStateChanged; | ||
504 | 39 | |||
505 | 40 | /// <summary> | ||
506 | 41 | /// Event to be raised when the completness of the current operation has changed. | ||
507 | 42 | /// </summary> | ||
508 | 43 | event EventHandler<OperationCompletenessEventArgs> OnCompletenessChanged; | ||
509 | 44 | |||
510 | 45 | /// <summary> | ||
511 | 46 | /// Event to be raised when the recently modified files have been changed. | ||
512 | 47 | /// </summary> | ||
513 | 48 | event EventHandler<RecentlyModifiedEventArgs> OnRecentlyModifiedChanged; | ||
514 | 49 | |||
515 | 50 | /// <summary> | ||
516 | 51 | /// When implemented this method should open the Preferences window of Ubuntu One. | 29 | /// When implemented this method should open the Preferences window of Ubuntu One. |
517 | 52 | /// </summary> | 30 | /// </summary> |
518 | 53 | void OpenUbuntuOnePreferences(); | 31 | void OpenUbuntuOnePreferences(); |
519 | 54 | 32 | ||
520 | === modified file 'src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs' | |||
521 | --- src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs 2010-07-28 11:05:41 +0000 | |||
522 | +++ src/Canonical.UbuntuOne.Client/Notification/INotificationIconView.cs 2010-08-09 16:14:47 +0000 | |||
523 | @@ -17,9 +17,18 @@ | |||
524 | 17 | * | 17 | * |
525 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
526 | 19 | */ | 19 | */ |
527 | 20 | using System.Collections.Generic; | ||
528 | 21 | |||
529 | 20 | namespace Canonical.UbuntuOne.Client.Notification | 22 | namespace Canonical.UbuntuOne.Client.Notification |
530 | 21 | { | 23 | { |
531 | 22 | public interface INotificationIconView | 24 | public interface INotificationIconView |
532 | 23 | { | 25 | { |
533 | 26 | string Notification { get; set; } | ||
534 | 27 | |||
535 | 28 | IList<string> RecentlyModifiedFiles { get; set; } | ||
536 | 29 | |||
537 | 30 | string State { get; set; } | ||
538 | 31 | |||
539 | 32 | string CurrentOperation { get; set; } | ||
540 | 24 | } | 33 | } |
541 | 25 | } | 34 | } |
542 | 26 | 35 | ||
543 | === added file 'src/Canonical.UbuntuOne.Client/Notification/IStateMapper.cs' | |||
544 | --- src/Canonical.UbuntuOne.Client/Notification/IStateMapper.cs 1970-01-01 00:00:00 +0000 | |||
545 | +++ src/Canonical.UbuntuOne.Client/Notification/IStateMapper.cs 2010-08-09 16:14:47 +0000 | |||
546 | @@ -0,0 +1,41 @@ | |||
547 | 1 | /** | ||
548 | 2 | * Copyright 2010 Canonical Ltd. | ||
549 | 3 | * | ||
550 | 4 | * This file is part of UbuntuOne on Windows. | ||
551 | 5 | * | ||
552 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
553 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
554 | 8 | * as published by the Free Software Foundation. | ||
555 | 9 | * | ||
556 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
557 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
558 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
559 | 13 | * GNU Lesser General Public License for more details. | ||
560 | 14 | * | ||
561 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
562 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
563 | 17 | * | ||
564 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
565 | 19 | */ | ||
566 | 20 | namespace Canonical.UbuntuOne.Client.Notification | ||
567 | 21 | { | ||
568 | 22 | /// <summary> | ||
569 | 23 | /// Interface to be implemented by the | ||
570 | 24 | /// </summary> | ||
571 | 25 | public interface IStateMapper | ||
572 | 26 | { | ||
573 | 27 | /// <summary> | ||
574 | 28 | /// Converts a state enum to a string that can be displayed to the user. | ||
575 | 29 | /// </summary> | ||
576 | 30 | /// <param name="state">The state to be converted.</param> | ||
577 | 31 | /// <returns>A string that represents the sate.</returns> | ||
578 | 32 | string ToString(StateEventArgs.StateEnum state); | ||
579 | 33 | |||
580 | 34 | /// <summary> | ||
581 | 35 | /// Converst a string to the state enum | ||
582 | 36 | /// </summary> | ||
583 | 37 | /// <param name="state">The string to be parsed and converted to the enum.</param> | ||
584 | 38 | /// <returns>An enum with the state.</returns> | ||
585 | 39 | StateEventArgs.StateEnum FromString(string state); | ||
586 | 40 | } | ||
587 | 41 | } | ||
588 | 0 | 42 | ||
589 | === added file 'src/Canonical.UbuntuOne.Client/Notification/ISyncDaemonClientNotifier.cs' | |||
590 | --- src/Canonical.UbuntuOne.Client/Notification/ISyncDaemonClientNotifier.cs 1970-01-01 00:00:00 +0000 | |||
591 | +++ src/Canonical.UbuntuOne.Client/Notification/ISyncDaemonClientNotifier.cs 2010-08-09 16:14:47 +0000 | |||
592 | @@ -0,0 +1,50 @@ | |||
593 | 1 | /** | ||
594 | 2 | * Copyright 2010 Canonical Ltd. | ||
595 | 3 | * | ||
596 | 4 | * This file is part of UbuntuOne on Windows. | ||
597 | 5 | * | ||
598 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
599 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
600 | 8 | * as published by the Free Software Foundation. | ||
601 | 9 | * | ||
602 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
603 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
604 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
605 | 13 | * GNU Lesser General Public License for more details. | ||
606 | 14 | * | ||
607 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
608 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
609 | 17 | * | ||
610 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
611 | 19 | */ | ||
612 | 20 | using System; | ||
613 | 21 | |||
614 | 22 | namespace Canonical.UbuntuOne.Client.Notification | ||
615 | 23 | { | ||
616 | 24 | /// <summary> | ||
617 | 25 | /// Interface to be implemented by a sync daemon client that will contain the required events that will be used to notify the | ||
618 | 26 | /// NotificationIconPresenter about the different operations that have occurred in the sync daemon client. | ||
619 | 27 | /// </summary> | ||
620 | 28 | public interface ISyncDaemonClientNotifier | ||
621 | 29 | { | ||
622 | 30 | /// <summary> | ||
623 | 31 | /// Event raised when there are notifications to be provided to the notification icon. | ||
624 | 32 | /// </summary> | ||
625 | 33 | event EventHandler<NotificationEventArgs> OnNotification; | ||
626 | 34 | |||
627 | 35 | /// <summary> | ||
628 | 36 | /// Event raised when there are changes in the completness of the current opertaion. | ||
629 | 37 | /// </summary> | ||
630 | 38 | event EventHandler<OperationCompletenessEventArgs> OnOperationCompletness; | ||
631 | 39 | |||
632 | 40 | /// <summary> | ||
633 | 41 | /// Event raised when there are changed in teh recetly modififed items. | ||
634 | 42 | /// </summary> | ||
635 | 43 | event EventHandler<RecentlyModifiedEventArgs> OnRecentlyModifiedChanged; | ||
636 | 44 | |||
637 | 45 | /// <summary> | ||
638 | 46 | /// Event raised when there are changes in the state. | ||
639 | 47 | /// </summary> | ||
640 | 48 | event EventHandler<StateEventArgs> OnStateChanged; | ||
641 | 49 | } | ||
642 | 50 | } | ||
643 | 0 | 51 | ||
644 | === modified file 'src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs' | |||
645 | --- src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs 2010-07-27 15:02:26 +0000 | |||
646 | +++ src/Canonical.UbuntuOne.Client/Notification/NotificationIconPresenter.cs 2010-08-09 16:14:47 +0000 | |||
647 | @@ -18,9 +18,10 @@ | |||
648 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
649 | 19 | */ | 19 | */ |
650 | 20 | using System; | 20 | using System; |
651 | 21 | using System.Windows; | ||
652 | 22 | using System.Diagnostics; | ||
653 | 23 | using Canonical.UbuntuOne.Client.Preferences; | 21 | using Canonical.UbuntuOne.Client.Preferences; |
654 | 22 | using Canonical.UbuntuOne.Common.Aop; | ||
655 | 23 | using Canonical.UbuntuOne.Common.Utils; | ||
656 | 24 | using log4net; | ||
657 | 24 | 25 | ||
658 | 25 | namespace Canonical.UbuntuOne.Client.Notification | 26 | namespace Canonical.UbuntuOne.Client.Notification |
659 | 26 | { | 27 | { |
660 | @@ -28,9 +29,13 @@ | |||
661 | 28 | { | 29 | { |
662 | 29 | #region Variables | 30 | #region Variables |
663 | 30 | 31 | ||
667 | 31 | private const string UpgradeUrl = "https://one.ubuntu.com/upgrade"; | 32 | public const string UpgradeUrl = "https://one.ubuntu.com/upgrade"; |
668 | 32 | 33 | public const string HelpUrl = "https://one.ubuntu.com/support/"; | |
669 | 33 | private const string HelpUrl = "https://one.ubuntu.com/support/"; | 34 | private static readonly string SharesLocation = ""; |
670 | 35 | private static readonly string SyncsLocation = ""; | ||
671 | 36 | private ISyncDaemonClientNotifier _clientNotifier; | ||
672 | 37 | private ILog _logger; | ||
673 | 38 | private readonly object _loggerLock = new object(); | ||
674 | 34 | 39 | ||
675 | 35 | #endregion | 40 | #endregion |
676 | 36 | 41 | ||
677 | @@ -39,49 +44,192 @@ | |||
678 | 39 | /// <summary> | 44 | /// <summary> |
679 | 40 | /// Gets and sets the dialog used to show the preferences. | 45 | /// Gets and sets the dialog used to show the preferences. |
680 | 41 | /// </summary> | 46 | /// </summary> |
684 | 42 | public IPreferencesDialog PreferencesDialog { get; set; } | 47 | public IPreferencesDialogPresenter PreferencesDialogPresenter { get; set; } |
685 | 43 | 48 | ||
686 | 44 | #endregion | 49 | /// <summary> |
687 | 50 | /// Gets and sets the views that will be used to show the user the information. | ||
688 | 51 | /// </summary> | ||
689 | 52 | public INotificationIconView NotificationIconView { get; set; } | ||
690 | 53 | |||
691 | 54 | /// <summary> | ||
692 | 55 | /// Gets and sets the mapper used to convert from the state enum to a string. | ||
693 | 56 | /// </summary> | ||
694 | 57 | public IStateMapper StateMapper { get; set; } | ||
695 | 58 | |||
696 | 59 | /// <summary> | ||
697 | 60 | /// Gets and sets the webbrowser to be used to show pages to the user. | ||
698 | 61 | /// </summary> | ||
699 | 62 | public IWebbrowser Webbrowser { get; set; } | ||
700 | 63 | |||
701 | 64 | /// <summary> | ||
702 | 65 | /// Get and sets the eplorer that will be used to open folder in the client | ||
703 | 66 | /// machine. | ||
704 | 67 | /// </summary> | ||
705 | 68 | public IExplorer Explorer { get; set; } | ||
706 | 69 | |||
707 | 70 | /// <summary> | ||
708 | 71 | /// Gets and sets the application that is running the notify presenter. | ||
709 | 72 | /// </summary> | ||
710 | 73 | public IApplication Application { get; set; } | ||
711 | 74 | |||
712 | 75 | /// <summary> | ||
713 | 76 | /// Gets and sets the notifier that will ensure that the presenter know about changes in the | ||
714 | 77 | /// sync daemon. | ||
715 | 78 | /// </summary> | ||
716 | 79 | public ISyncDaemonClientNotifier SyncDaemonClientNotifier | ||
717 | 80 | { | ||
718 | 81 | get { return _clientNotifier; } | ||
719 | 82 | set | ||
720 | 83 | { | ||
721 | 84 | if (value == null) return; | ||
722 | 85 | _clientNotifier = value; | ||
723 | 86 | // register to the different events raised by the client | ||
724 | 87 | _clientNotifier.OnNotification += OnNotificationHandler; | ||
725 | 88 | _clientNotifier.OnOperationCompletness += OnOperationCompletnessHandler; | ||
726 | 89 | _clientNotifier.OnRecentlyModifiedChanged += OnRecentlyModifiedChangedHandler; | ||
727 | 90 | _clientNotifier.OnStateChanged += OnStateChangedHandler; | ||
728 | 91 | } | ||
729 | 92 | } | ||
730 | 93 | |||
731 | 94 | #endregion | ||
732 | 95 | |||
733 | 96 | #region Properties | ||
734 | 97 | |||
735 | 98 | /// <summary> | ||
736 | 99 | /// Gets and sets the logger used by the class. | ||
737 | 100 | /// </summary> | ||
738 | 101 | internal ILog Logger | ||
739 | 102 | { | ||
740 | 103 | get | ||
741 | 104 | { | ||
742 | 105 | if(_logger == null) | ||
743 | 106 | { | ||
744 | 107 | lock (_loggerLock) | ||
745 | 108 | { | ||
746 | 109 | _logger = LogManager.GetLogger(typeof (NotificationIconPresenter)); | ||
747 | 110 | } | ||
748 | 111 | } | ||
749 | 112 | return _logger; | ||
750 | 113 | } | ||
751 | 114 | set { _logger = value; } | ||
752 | 115 | } | ||
753 | 116 | |||
754 | 117 | #endregion | ||
755 | 118 | |||
756 | 119 | #region Constructors | ||
757 | 120 | |||
758 | 121 | static NotificationIconPresenter() | ||
759 | 122 | { | ||
760 | 123 | SharesLocation = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | ||
761 | 124 | SyncsLocation = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | ||
762 | 125 | } | ||
763 | 126 | |||
764 | 127 | #endregion | ||
765 | 128 | |||
766 | 129 | #region Helper methods | ||
767 | 130 | |||
768 | 131 | /// <summary> | ||
769 | 132 | /// Helper method that will ensure that when the state of the sync daemon changes this change | ||
770 | 133 | /// is correctly reflected in the View. | ||
771 | 134 | /// </summary> | ||
772 | 135 | /// <param name="sender">The object that sent the event.</param> | ||
773 | 136 | /// <param name="e">The arguments that describe the state change.</param> | ||
774 | 137 | [DebugLogged] | ||
775 | 138 | private void OnStateChangedHandler(object sender, StateEventArgs e) | ||
776 | 139 | { | ||
777 | 140 | NotificationIconView.State = StateMapper.ToString(e.State); | ||
778 | 141 | } | ||
779 | 142 | |||
780 | 143 | /// <summary> | ||
781 | 144 | /// Helper method that will ensure that when the recently changed files are updated by the daemon that | ||
782 | 145 | /// such a change is correcty displayed in the view. | ||
783 | 146 | /// </summary> | ||
784 | 147 | /// <param name="sender">The object that sent the event.</param> | ||
785 | 148 | /// <param name="e">The arguments that describe the changes in the recently changed list.</param> | ||
786 | 149 | [DebugLogged] | ||
787 | 150 | private void OnRecentlyModifiedChangedHandler(object sender, RecentlyModifiedEventArgs e) | ||
788 | 151 | { | ||
789 | 152 | NotificationIconView.RecentlyModifiedFiles = e.RecentlyModifiedFiles; | ||
790 | 153 | } | ||
791 | 154 | |||
792 | 155 | /// <summary> | ||
793 | 156 | /// Helper method that will ensure that when the status of an operation that is being performed by the daemon | ||
794 | 157 | /// changes that such a changed ins correctly reflected in the UI. | ||
795 | 158 | /// </summary> | ||
796 | 159 | /// <param name="sender">The object that sent the event.</param> | ||
797 | 160 | /// <param name="e">The argumets that describe the new updated operation state.</param> | ||
798 | 161 | [DebugLogged] | ||
799 | 162 | private void OnOperationCompletnessHandler(object sender, OperationCompletenessEventArgs e) | ||
800 | 163 | { | ||
801 | 164 | NotificationIconView.CurrentOperation = String.Format(NotificationResources.OperationStateNotification, | ||
802 | 165 | e.Operation, e.Percentage, e.Speed, e.SpeedUnits); | ||
803 | 166 | } | ||
804 | 167 | |||
805 | 168 | /// <summary> | ||
806 | 169 | /// Helper method that will ensure that when a notification is sent by the daemon that it is correctly displayed in the UI. | ||
807 | 170 | /// </summary> | ||
808 | 171 | /// <param name="sender">The object that sent the event.</param> | ||
809 | 172 | /// <param name="e">The arguments that contains the notification to display.</param> | ||
810 | 173 | [DebugLogged] | ||
811 | 174 | private void OnNotificationHandler(object sender, NotificationEventArgs e) | ||
812 | 175 | { | ||
813 | 176 | NotificationIconView.Notification = e.Message; | ||
814 | 177 | } | ||
815 | 178 | |||
816 | 179 | #endregion | ||
817 | 45 | 180 | ||
818 | 46 | #region Implementation of INotificationIconPresenter | 181 | #region Implementation of INotificationIconPresenter |
819 | 47 | 182 | ||
820 | 48 | #region events | ||
821 | 49 | |||
822 | 50 | public event EventHandler<NotificationEventArgs> OnNotificationChanged; | ||
823 | 51 | public event EventHandler<StateEventArgs> OnStateChanged; | ||
824 | 52 | public event EventHandler<OperationCompletenessEventArgs> OnCompletenessChanged; | ||
825 | 53 | public event EventHandler<RecentlyModifiedEventArgs> OnRecentlyModifiedChanged; | ||
826 | 54 | |||
827 | 55 | #endregion | ||
828 | 56 | |||
829 | 57 | public void OpenUbuntuOnePreferences() | 183 | public void OpenUbuntuOnePreferences() |
830 | 58 | { | 184 | { |
832 | 59 | PreferencesDialog.Show(); | 185 | PreferencesDialogPresenter.Show(); |
833 | 60 | } | 186 | } |
834 | 61 | 187 | ||
835 | 62 | public void OpenSharesLocation() | 188 | public void OpenSharesLocation() |
836 | 63 | { | 189 | { |
838 | 64 | throw new NotImplementedException(); | 190 | try |
839 | 191 | { | ||
840 | 192 | Explorer.OpenFolder(SharesLocation); | ||
841 | 193 | } | ||
842 | 194 | catch(ExplorerException exception) | ||
843 | 195 | { | ||
844 | 196 | Logger.WarnFormat("There was an error operning the SharesLocation, {0}", exception); | ||
845 | 197 | // use the view to notify the error | ||
846 | 198 | NotificationIconView.Notification = String.Format(NotificationResources.ErrorOpeningFolder, | ||
847 | 199 | Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); | ||
848 | 200 | throw; | ||
849 | 201 | } | ||
850 | 65 | } | 202 | } |
851 | 66 | 203 | ||
852 | 67 | public void OpenSyncsLocation() | 204 | public void OpenSyncsLocation() |
853 | 68 | { | 205 | { |
855 | 69 | throw new NotImplementedException(); | 206 | try |
856 | 207 | { | ||
857 | 208 | Explorer.OpenFolder(SyncsLocation); | ||
858 | 209 | } | ||
859 | 210 | catch (ExplorerException exception) | ||
860 | 211 | { | ||
861 | 212 | Logger.WarnFormat("There was an error operning the SharesLocation, {0}", exception); | ||
862 | 213 | // use the view to notify the error | ||
863 | 214 | NotificationIconView.Notification = String.Format(NotificationResources.ErrorOpeningFolder, | ||
864 | 215 | Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); | ||
865 | 216 | throw; | ||
866 | 217 | } | ||
867 | 70 | } | 218 | } |
868 | 71 | 219 | ||
869 | 72 | public void OpenHelp() | 220 | public void OpenHelp() |
870 | 73 | { | 221 | { |
872 | 74 | Process.Start(HelpUrl); | 222 | Webbrowser.LauncWebpage(HelpUrl); |
873 | 75 | } | 223 | } |
874 | 76 | 224 | ||
875 | 77 | public void OpenUpgradeOption() | 225 | public void OpenUpgradeOption() |
876 | 78 | { | 226 | { |
878 | 79 | Process.Start(UpgradeUrl); | 227 | Webbrowser.LauncWebpage(UpgradeUrl); |
879 | 80 | } | 228 | } |
880 | 81 | 229 | ||
881 | 82 | public void Exit() | 230 | public void Exit() |
882 | 83 | { | 231 | { |
884 | 84 | Application.Current.Shutdown(); | 232 | Application.Exit(); |
885 | 85 | } | 233 | } |
886 | 86 | 234 | ||
887 | 87 | #endregion | 235 | #endregion |
888 | 88 | 236 | ||
889 | === added file 'src/Canonical.UbuntuOne.Client/Notification/NotificationResources.Designer.cs' | |||
890 | --- src/Canonical.UbuntuOne.Client/Notification/NotificationResources.Designer.cs 1970-01-01 00:00:00 +0000 | |||
891 | +++ src/Canonical.UbuntuOne.Client/Notification/NotificationResources.Designer.cs 2010-08-09 16:14:47 +0000 | |||
892 | @@ -0,0 +1,117 @@ | |||
893 | 1 | //------------------------------------------------------------------------------ | ||
894 | 2 | // <auto-generated> | ||
895 | 3 | // This code was generated by a tool. | ||
896 | 4 | // Runtime Version:2.0.50727.4927 | ||
897 | 5 | // | ||
898 | 6 | // Changes to this file may cause incorrect behavior and will be lost if | ||
899 | 7 | // the code is regenerated. | ||
900 | 8 | // </auto-generated> | ||
901 | 9 | //------------------------------------------------------------------------------ | ||
902 | 10 | |||
903 | 11 | namespace Canonical.UbuntuOne.Client.Notification { | ||
904 | 12 | using System; | ||
905 | 13 | |||
906 | 14 | |||
907 | 15 | /// <summary> | ||
908 | 16 | /// A strongly-typed resource class, for looking up localized strings, etc. | ||
909 | 17 | /// </summary> | ||
910 | 18 | // This class was auto-generated by the StronglyTypedResourceBuilder | ||
911 | 19 | // class via a tool like ResGen or Visual Studio. | ||
912 | 20 | // To add or remove a member, edit your .ResX file then rerun ResGen | ||
913 | 21 | // with the /str option, or rebuild your VS project. | ||
914 | 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] | ||
915 | 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
916 | 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | ||
917 | 25 | internal class NotificationResources { | ||
918 | 26 | |||
919 | 27 | private static global::System.Resources.ResourceManager resourceMan; | ||
920 | 28 | |||
921 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; | ||
922 | 30 | |||
923 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] | ||
924 | 32 | internal NotificationResources() { | ||
925 | 33 | } | ||
926 | 34 | |||
927 | 35 | /// <summary> | ||
928 | 36 | /// Returns the cached ResourceManager instance used by this class. | ||
929 | 37 | /// </summary> | ||
930 | 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | ||
931 | 39 | internal static global::System.Resources.ResourceManager ResourceManager { | ||
932 | 40 | get { | ||
933 | 41 | if (object.ReferenceEquals(resourceMan, null)) { | ||
934 | 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Canonical.UbuntuOne.Client.Notification.NotificationResources", typeof(NotificationResources).Assembly); | ||
935 | 43 | resourceMan = temp; | ||
936 | 44 | } | ||
937 | 45 | return resourceMan; | ||
938 | 46 | } | ||
939 | 47 | } | ||
940 | 48 | |||
941 | 49 | /// <summary> | ||
942 | 50 | /// Overrides the current thread's CurrentUICulture property for all | ||
943 | 51 | /// resource lookups using this strongly typed resource class. | ||
944 | 52 | /// </summary> | ||
945 | 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | ||
946 | 54 | internal static global::System.Globalization.CultureInfo Culture { | ||
947 | 55 | get { | ||
948 | 56 | return resourceCulture; | ||
949 | 57 | } | ||
950 | 58 | set { | ||
951 | 59 | resourceCulture = value; | ||
952 | 60 | } | ||
953 | 61 | } | ||
954 | 62 | |||
955 | 63 | /// <summary> | ||
956 | 64 | /// Looks up a localized string similar to Download finished for {0}. | ||
957 | 65 | /// </summary> | ||
958 | 66 | internal static string DownloadFinishedNotification { | ||
959 | 67 | get { | ||
960 | 68 | return ResourceManager.GetString("DownloadFinishedNotification", resourceCulture); | ||
961 | 69 | } | ||
962 | 70 | } | ||
963 | 71 | |||
964 | 72 | /// <summary> | ||
965 | 73 | /// Looks up a localized string similar to Download started for {0}. | ||
966 | 74 | /// </summary> | ||
967 | 75 | internal static string DownloadStartedNotitication { | ||
968 | 76 | get { | ||
969 | 77 | return ResourceManager.GetString("DownloadStartedNotitication", resourceCulture); | ||
970 | 78 | } | ||
971 | 79 | } | ||
972 | 80 | |||
973 | 81 | /// <summary> | ||
974 | 82 | /// Looks up a localized string similar to There was an error opening {0}. | ||
975 | 83 | /// </summary> | ||
976 | 84 | internal static string ErrorOpeningFolder { | ||
977 | 85 | get { | ||
978 | 86 | return ResourceManager.GetString("ErrorOpeningFolder", resourceCulture); | ||
979 | 87 | } | ||
980 | 88 | } | ||
981 | 89 | |||
982 | 90 | /// <summary> | ||
983 | 91 | /// Looks up a localized string similar to {0} , Completed {1}% at {2} {3}. | ||
984 | 92 | /// </summary> | ||
985 | 93 | internal static string OperationStateNotification { | ||
986 | 94 | get { | ||
987 | 95 | return ResourceManager.GetString("OperationStateNotification", resourceCulture); | ||
988 | 96 | } | ||
989 | 97 | } | ||
990 | 98 | |||
991 | 99 | /// <summary> | ||
992 | 100 | /// Looks up a localized string similar to Upload finished for {0}. | ||
993 | 101 | /// </summary> | ||
994 | 102 | internal static string UploadFinishedNotification { | ||
995 | 103 | get { | ||
996 | 104 | return ResourceManager.GetString("UploadFinishedNotification", resourceCulture); | ||
997 | 105 | } | ||
998 | 106 | } | ||
999 | 107 | |||
1000 | 108 | /// <summary> | ||
1001 | 109 | /// Looks up a localized string similar to Upload started for {0}. | ||
1002 | 110 | /// </summary> | ||
1003 | 111 | internal static string UploadStartedNotification { | ||
1004 | 112 | get { | ||
1005 | 113 | return ResourceManager.GetString("UploadStartedNotification", resourceCulture); | ||
1006 | 114 | } | ||
1007 | 115 | } | ||
1008 | 116 | } | ||
1009 | 117 | } | ||
1010 | 0 | 118 | ||
1011 | === added file 'src/Canonical.UbuntuOne.Client/Notification/NotificationResources.resx' | |||
1012 | --- src/Canonical.UbuntuOne.Client/Notification/NotificationResources.resx 1970-01-01 00:00:00 +0000 | |||
1013 | +++ src/Canonical.UbuntuOne.Client/Notification/NotificationResources.resx 2010-08-09 16:14:47 +0000 | |||
1014 | @@ -0,0 +1,138 @@ | |||
1015 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
1016 | 2 | <root> | ||
1017 | 3 | <!-- | ||
1018 | 4 | Microsoft ResX Schema | ||
1019 | 5 | |||
1020 | 6 | Version 2.0 | ||
1021 | 7 | |||
1022 | 8 | The primary goals of this format is to allow a simple XML format | ||
1023 | 9 | that is mostly human readable. The generation and parsing of the | ||
1024 | 10 | various data types are done through the TypeConverter classes | ||
1025 | 11 | associated with the data types. | ||
1026 | 12 | |||
1027 | 13 | Example: | ||
1028 | 14 | |||
1029 | 15 | ... ado.net/XML headers & schema ... | ||
1030 | 16 | <resheader name="resmimetype">text/microsoft-resx</resheader> | ||
1031 | 17 | <resheader name="version">2.0</resheader> | ||
1032 | 18 | <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | ||
1033 | 19 | <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | ||
1034 | 20 | <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | ||
1035 | 21 | <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | ||
1036 | 22 | <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | ||
1037 | 23 | <value>[base64 mime encoded serialized .NET Framework object]</value> | ||
1038 | 24 | </data> | ||
1039 | 25 | <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | ||
1040 | 26 | <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | ||
1041 | 27 | <comment>This is a comment</comment> | ||
1042 | 28 | </data> | ||
1043 | 29 | |||
1044 | 30 | There are any number of "resheader" rows that contain simple | ||
1045 | 31 | name/value pairs. | ||
1046 | 32 | |||
1047 | 33 | Each data row contains a name, and value. The row also contains a | ||
1048 | 34 | type or mimetype. Type corresponds to a .NET class that support | ||
1049 | 35 | text/value conversion through the TypeConverter architecture. | ||
1050 | 36 | Classes that don't support this are serialized and stored with the | ||
1051 | 37 | mimetype set. | ||
1052 | 38 | |||
1053 | 39 | The mimetype is used for serialized objects, and tells the | ||
1054 | 40 | ResXResourceReader how to depersist the object. This is currently not | ||
1055 | 41 | extensible. For a given mimetype the value must be set accordingly: | ||
1056 | 42 | |||
1057 | 43 | Note - application/x-microsoft.net.object.binary.base64 is the format | ||
1058 | 44 | that the ResXResourceWriter will generate, however the reader can | ||
1059 | 45 | read any of the formats listed below. | ||
1060 | 46 | |||
1061 | 47 | mimetype: application/x-microsoft.net.object.binary.base64 | ||
1062 | 48 | value : The object must be serialized with | ||
1063 | 49 | : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | ||
1064 | 50 | : and then encoded with base64 encoding. | ||
1065 | 51 | |||
1066 | 52 | mimetype: application/x-microsoft.net.object.soap.base64 | ||
1067 | 53 | value : The object must be serialized with | ||
1068 | 54 | : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | ||
1069 | 55 | : and then encoded with base64 encoding. | ||
1070 | 56 | |||
1071 | 57 | mimetype: application/x-microsoft.net.object.bytearray.base64 | ||
1072 | 58 | value : The object must be serialized into a byte array | ||
1073 | 59 | : using a System.ComponentModel.TypeConverter | ||
1074 | 60 | : and then encoded with base64 encoding. | ||
1075 | 61 | --> | ||
1076 | 62 | <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
1077 | 63 | <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
1078 | 64 | <xsd:element name="root" msdata:IsDataSet="true"> | ||
1079 | 65 | <xsd:complexType> | ||
1080 | 66 | <xsd:choice maxOccurs="unbounded"> | ||
1081 | 67 | <xsd:element name="metadata"> | ||
1082 | 68 | <xsd:complexType> | ||
1083 | 69 | <xsd:sequence> | ||
1084 | 70 | <xsd:element name="value" type="xsd:string" minOccurs="0" /> | ||
1085 | 71 | </xsd:sequence> | ||
1086 | 72 | <xsd:attribute name="name" use="required" type="xsd:string" /> | ||
1087 | 73 | <xsd:attribute name="type" type="xsd:string" /> | ||
1088 | 74 | <xsd:attribute name="mimetype" type="xsd:string" /> | ||
1089 | 75 | <xsd:attribute ref="xml:space" /> | ||
1090 | 76 | </xsd:complexType> | ||
1091 | 77 | </xsd:element> | ||
1092 | 78 | <xsd:element name="assembly"> | ||
1093 | 79 | <xsd:complexType> | ||
1094 | 80 | <xsd:attribute name="alias" type="xsd:string" /> | ||
1095 | 81 | <xsd:attribute name="name" type="xsd:string" /> | ||
1096 | 82 | </xsd:complexType> | ||
1097 | 83 | </xsd:element> | ||
1098 | 84 | <xsd:element name="data"> | ||
1099 | 85 | <xsd:complexType> | ||
1100 | 86 | <xsd:sequence> | ||
1101 | 87 | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
1102 | 88 | <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||
1103 | 89 | </xsd:sequence> | ||
1104 | 90 | <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | ||
1105 | 91 | <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||
1106 | 92 | <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||
1107 | 93 | <xsd:attribute ref="xml:space" /> | ||
1108 | 94 | </xsd:complexType> | ||
1109 | 95 | </xsd:element> | ||
1110 | 96 | <xsd:element name="resheader"> | ||
1111 | 97 | <xsd:complexType> | ||
1112 | 98 | <xsd:sequence> | ||
1113 | 99 | <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
1114 | 100 | </xsd:sequence> | ||
1115 | 101 | <xsd:attribute name="name" type="xsd:string" use="required" /> | ||
1116 | 102 | </xsd:complexType> | ||
1117 | 103 | </xsd:element> | ||
1118 | 104 | </xsd:choice> | ||
1119 | 105 | </xsd:complexType> | ||
1120 | 106 | </xsd:element> | ||
1121 | 107 | </xsd:schema> | ||
1122 | 108 | <resheader name="resmimetype"> | ||
1123 | 109 | <value>text/microsoft-resx</value> | ||
1124 | 110 | </resheader> | ||
1125 | 111 | <resheader name="version"> | ||
1126 | 112 | <value>2.0</value> | ||
1127 | 113 | </resheader> | ||
1128 | 114 | <resheader name="reader"> | ||
1129 | 115 | <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
1130 | 116 | </resheader> | ||
1131 | 117 | <resheader name="writer"> | ||
1132 | 118 | <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
1133 | 119 | </resheader> | ||
1134 | 120 | <data name="DownloadFinishedNotification" xml:space="preserve"> | ||
1135 | 121 | <value>Download finished for {0}</value> | ||
1136 | 122 | </data> | ||
1137 | 123 | <data name="DownloadStartedNotitication" xml:space="preserve"> | ||
1138 | 124 | <value>Download started for {0}</value> | ||
1139 | 125 | </data> | ||
1140 | 126 | <data name="ErrorOpeningFolder" xml:space="preserve"> | ||
1141 | 127 | <value>There was an error opening {0}</value> | ||
1142 | 128 | </data> | ||
1143 | 129 | <data name="OperationStateNotification" xml:space="preserve"> | ||
1144 | 130 | <value>{0} , Completed {1}% at {2} {3}</value> | ||
1145 | 131 | </data> | ||
1146 | 132 | <data name="UploadFinishedNotification" xml:space="preserve"> | ||
1147 | 133 | <value>Upload finished for {0}</value> | ||
1148 | 134 | </data> | ||
1149 | 135 | <data name="UploadStartedNotification" xml:space="preserve"> | ||
1150 | 136 | <value>Upload started for {0}</value> | ||
1151 | 137 | </data> | ||
1152 | 138 | </root> | ||
1153 | 0 | \ No newline at end of file | 139 | \ No newline at end of file |
1154 | 1 | 140 | ||
1155 | === modified file 'src/Canonical.UbuntuOne.Client/Notification/OperationCompletenessEventArgs.cs' | |||
1156 | --- src/Canonical.UbuntuOne.Client/Notification/OperationCompletenessEventArgs.cs 2010-07-27 11:58:32 +0000 | |||
1157 | +++ src/Canonical.UbuntuOne.Client/Notification/OperationCompletenessEventArgs.cs 2010-08-09 16:14:47 +0000 | |||
1158 | @@ -34,25 +34,30 @@ | |||
1159 | 34 | } | 34 | } |
1160 | 35 | 35 | ||
1161 | 36 | /// <summary> | 36 | /// <summary> |
1163 | 37 | /// | 37 | /// The percentage of the operation that has been done. |
1164 | 38 | /// </summary> | 38 | /// </summary> |
1165 | 39 | public int Percentage { get; set; } | 39 | public int Percentage { get; set; } |
1166 | 40 | 40 | ||
1167 | 41 | /// <summary> | 41 | /// <summary> |
1169 | 42 | /// | 42 | /// The speed in which the operation is being done. |
1170 | 43 | /// </summary> | 43 | /// </summary> |
1171 | 44 | public double Speed { get; set; } | 44 | public double Speed { get; set; } |
1172 | 45 | 45 | ||
1173 | 46 | /// <summary> | 46 | /// <summary> |
1175 | 47 | /// | 47 | /// The unit used in the speed. |
1176 | 48 | /// </summary> | 48 | /// </summary> |
1177 | 49 | public SpeedUnitsEnum SpeedUnits { get; set; } | 49 | public SpeedUnitsEnum SpeedUnits { get; set; } |
1178 | 50 | 50 | ||
1179 | 51 | /// <summary> | 51 | /// <summary> |
1180 | 52 | /// A string with the operation that is being performed. | ||
1181 | 53 | /// </summary> | ||
1182 | 54 | public string Operation { get; set; } | ||
1183 | 55 | |||
1184 | 56 | /// <summary> | ||
1185 | 52 | /// Creates a new event arge with all its data init to the default values. | 57 | /// Creates a new event arge with all its data init to the default values. |
1186 | 53 | /// </summary> | 58 | /// </summary> |
1187 | 54 | public OperationCompletenessEventArgs() | 59 | public OperationCompletenessEventArgs() |
1189 | 55 | : this(0, 0, SpeedUnitsEnum.MB) | 60 | : this("", 0, 0, SpeedUnitsEnum.MB) |
1190 | 56 | { | 61 | { |
1191 | 57 | 62 | ||
1192 | 58 | } | 63 | } |
1193 | @@ -60,11 +65,13 @@ | |||
1194 | 60 | /// <summary> | 65 | /// <summary> |
1195 | 61 | /// Creates a new event arg that can be used to state the current completness of an operation. | 66 | /// Creates a new event arg that can be used to state the current completness of an operation. |
1196 | 62 | /// </summary> | 67 | /// </summary> |
1197 | 68 | /// <param name="operation">A string with the operation that is being performed.</param> | ||
1198 | 63 | /// <param name="percentage">The percentage of the operation that has been done.</param> | 69 | /// <param name="percentage">The percentage of the operation that has been done.</param> |
1199 | 64 | /// <param name="speed">The speed in which the operation is done.</param> | 70 | /// <param name="speed">The speed in which the operation is done.</param> |
1200 | 65 | /// <param name="units">The units used in the speed.</param> | 71 | /// <param name="units">The units used in the speed.</param> |
1202 | 66 | public OperationCompletenessEventArgs(int percentage, double speed, SpeedUnitsEnum units) | 72 | public OperationCompletenessEventArgs(string operation, int percentage, double speed, SpeedUnitsEnum units) |
1203 | 67 | { | 73 | { |
1204 | 74 | Operation = operation; | ||
1205 | 68 | Percentage = percentage; | 75 | Percentage = percentage; |
1206 | 69 | Speed = speed; | 76 | Speed = speed; |
1207 | 70 | SpeedUnits = units; | 77 | SpeedUnits = units; |
1208 | 71 | 78 | ||
1209 | === removed file 'src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialog.cs' | |||
1210 | --- src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialog.cs 2010-07-27 15:36:33 +0000 | |||
1211 | +++ src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialog.cs 1970-01-01 00:00:00 +0000 | |||
1212 | @@ -1,30 +0,0 @@ | |||
1213 | 1 | /** | ||
1214 | 2 | * Copyright 2010 Canonical Ltd. | ||
1215 | 3 | * | ||
1216 | 4 | * This file is part of UbuntuOne on Windows. | ||
1217 | 5 | * | ||
1218 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1219 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1220 | 8 | * as published by the Free Software Foundation. | ||
1221 | 9 | * | ||
1222 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1223 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1224 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1225 | 13 | * GNU Lesser General Public License for more details. | ||
1226 | 14 | * | ||
1227 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1228 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1229 | 17 | * | ||
1230 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1231 | 19 | */ | ||
1232 | 20 | |||
1233 | 21 | namespace Canonical.UbuntuOne.Client.Preferences | ||
1234 | 22 | { | ||
1235 | 23 | /// <summary> | ||
1236 | 24 | /// Interface to be implemented by those dialogs used tod isaply preferences. | ||
1237 | 25 | /// </summary> | ||
1238 | 26 | public interface IPreferencesDialog | ||
1239 | 27 | { | ||
1240 | 28 | void Show(); | ||
1241 | 29 | } | ||
1242 | 30 | } | ||
1243 | 31 | 0 | ||
1244 | === added file 'src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs' | |||
1245 | --- src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs 1970-01-01 00:00:00 +0000 | |||
1246 | +++ src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs 2010-08-09 16:14:47 +0000 | |||
1247 | @@ -0,0 +1,30 @@ | |||
1248 | 1 | /** | ||
1249 | 2 | * Copyright 2010 Canonical Ltd. | ||
1250 | 3 | * | ||
1251 | 4 | * This file is part of UbuntuOne on Windows. | ||
1252 | 5 | * | ||
1253 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1254 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1255 | 8 | * as published by the Free Software Foundation. | ||
1256 | 9 | * | ||
1257 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1258 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1259 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1260 | 13 | * GNU Lesser General Public License for more details. | ||
1261 | 14 | * | ||
1262 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1263 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1264 | 17 | * | ||
1265 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1266 | 19 | */ | ||
1267 | 20 | |||
1268 | 21 | namespace Canonical.UbuntuOne.Client.Preferences | ||
1269 | 22 | { | ||
1270 | 23 | /// <summary> | ||
1271 | 24 | /// Interface to be implemented by those dialogs used tod isaply preferences. | ||
1272 | 25 | /// </summary> | ||
1273 | 26 | public interface IPreferencesDialogPresenter | ||
1274 | 27 | { | ||
1275 | 28 | void Show(); | ||
1276 | 29 | } | ||
1277 | 30 | } | ||
1278 | 0 | 31 | ||
1279 | === modified file 'src/Canonical.UbuntuOne.Client/Properties/AssemblyInfo.cs' | |||
1280 | --- src/Canonical.UbuntuOne.Client/Properties/AssemblyInfo.cs 2010-07-30 09:33:20 +0000 | |||
1281 | +++ src/Canonical.UbuntuOne.Client/Properties/AssemblyInfo.cs 2010-08-09 16:14:47 +0000 | |||
1282 | @@ -21,4 +21,5 @@ | |||
1283 | 21 | 21 | ||
1284 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
1285 | 23 | [assembly: Guid("3c7586a6-40ca-463b-b12c-b0aed0f4cb92")] | 23 | [assembly: Guid("3c7586a6-40ca-463b-b12c-b0aed0f4cb92")] |
1286 | 24 | [assembly: InternalsVisibleTo("Canonical.UbuntuOne.Client.Test")] | ||
1287 | 24 | 25 | ||
1288 | 25 | 26 | ||
1289 | === modified file 'src/Canonical.UbuntuOne.Client/SyncDaemonClient.cs' | |||
1290 | --- src/Canonical.UbuntuOne.Client/SyncDaemonClient.cs 2010-07-27 15:02:26 +0000 | |||
1291 | +++ src/Canonical.UbuntuOne.Client/SyncDaemonClient.cs 2010-08-09 16:14:47 +0000 | |||
1292 | @@ -18,13 +18,35 @@ | |||
1293 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> |
1294 | 19 | */ | 19 | */ |
1295 | 20 | using System; | 20 | using System; |
1296 | 21 | using Canonical.UbuntuOne.Client.Notification; | ||
1297 | 21 | using Canonical.UbuntuOne.Common; | 22 | using Canonical.UbuntuOne.Common; |
1298 | 22 | using Canonical.UbuntuOne.Common.Validation; | 23 | using Canonical.UbuntuOne.Common.Validation; |
1299 | 23 | 24 | ||
1300 | 24 | namespace Canonical.UbuntuOne.Client | 25 | namespace Canonical.UbuntuOne.Client |
1301 | 25 | { | 26 | { |
1303 | 26 | class SyncDaemonClient : ISyncDaemonClient | 27 | class SyncDaemonClient : ISyncDaemonClient, ISyncDaemonClientNotifier |
1304 | 27 | { | 28 | { |
1305 | 29 | #region ISyncDaemonClientNotifier implementation | ||
1306 | 30 | |||
1307 | 31 | public event EventHandler<NotificationEventArgs> OnNotification; | ||
1308 | 32 | public event EventHandler<OperationCompletenessEventArgs> OnOperationCompletness; | ||
1309 | 33 | public event EventHandler<RecentlyModifiedEventArgs> OnRecentlyModifiedChanged; | ||
1310 | 34 | public event EventHandler<StateEventArgs> OnStateChanged; | ||
1311 | 35 | |||
1312 | 36 | #endregion | ||
1313 | 37 | |||
1314 | 38 | #region Helper methods | ||
1315 | 39 | |||
1316 | 40 | private void NotifyAction(string message) | ||
1317 | 41 | { | ||
1318 | 42 | if (OnNotification == null) return; | ||
1319 | 43 | var args = new NotificationEventArgs(message); | ||
1320 | 44 | OnNotification(this, args); | ||
1321 | 45 | } | ||
1322 | 46 | #endregion | ||
1323 | 47 | |||
1324 | 48 | #region ISyncDaemonClient implementation | ||
1325 | 49 | |||
1326 | 28 | /// <summary> | 50 | /// <summary> |
1327 | 29 | /// Callback performed when a download starts. | 51 | /// Callback performed when a download starts. |
1328 | 30 | /// </summary> | 52 | /// </summary> |
1329 | @@ -34,8 +56,7 @@ | |||
1330 | 34 | ValidateArgs.Begin() | 56 | ValidateArgs.Begin() |
1331 | 35 | .IsNotNull(data, "data") | 57 | .IsNotNull(data, "data") |
1332 | 36 | .Check(); | 58 | .Check(); |
1335 | 37 | 59 | NotifyAction(String.Format(NotificationResources.DownloadStartedNotitication, data.Path)); | |
1334 | 38 | throw new NotImplementedException(); | ||
1336 | 39 | } | 60 | } |
1337 | 40 | 61 | ||
1338 | 41 | /// <summary> | 62 | /// <summary> |
1339 | @@ -47,8 +68,7 @@ | |||
1340 | 47 | ValidateArgs.Begin() | 68 | ValidateArgs.Begin() |
1341 | 48 | .IsNotNull(data) | 69 | .IsNotNull(data) |
1342 | 49 | .Check(); | 70 | .Check(); |
1345 | 50 | 71 | NotifyAction(String.Format(NotificationResources.DownloadFinishedNotification, data.Path)); | |
1344 | 51 | throw new NotImplementedException(); | ||
1346 | 52 | } | 72 | } |
1347 | 53 | 73 | ||
1348 | 54 | /// <summary> | 74 | /// <summary> |
1349 | @@ -61,7 +81,7 @@ | |||
1350 | 61 | .IsNotNull(data) | 81 | .IsNotNull(data) |
1351 | 62 | .Check(); | 82 | .Check(); |
1352 | 63 | 83 | ||
1354 | 64 | throw new NotImplementedException(); | 84 | NotifyAction(String.Format(NotificationResources.UploadStartedNotification, data.Path)); |
1355 | 65 | } | 85 | } |
1356 | 66 | 86 | ||
1357 | 67 | /// <summary> | 87 | /// <summary> |
1358 | @@ -73,7 +93,7 @@ | |||
1359 | 73 | ValidateArgs.Begin() | 93 | ValidateArgs.Begin() |
1360 | 74 | .IsNotNull(data, "data") | 94 | .IsNotNull(data, "data") |
1361 | 75 | .Check(); | 95 | .Check(); |
1363 | 76 | throw new NotImplementedException(); | 96 | NotifyAction(String.Format(NotificationResources.UploadFinishedNotification, data.Path)); |
1364 | 77 | } | 97 | } |
1365 | 78 | 98 | ||
1366 | 79 | /// <summary> | 99 | /// <summary> |
1367 | @@ -85,7 +105,7 @@ | |||
1368 | 85 | ValidateArgs.Begin() | 105 | ValidateArgs.Begin() |
1369 | 86 | .IsNotNull(data, "data") | 106 | .IsNotNull(data, "data") |
1370 | 87 | .Check(); | 107 | .Check(); |
1372 | 88 | throw new NotImplementedException(); | 108 | |
1373 | 89 | } | 109 | } |
1374 | 90 | 110 | ||
1375 | 91 | /// <summary> | 111 | /// <summary> |
1376 | @@ -233,5 +253,7 @@ | |||
1377 | 233 | .Check(); | 253 | .Check(); |
1378 | 234 | throw new NotImplementedException(); | 254 | throw new NotImplementedException(); |
1379 | 235 | } | 255 | } |
1380 | 256 | |||
1381 | 257 | #endregion | ||
1382 | 236 | } | 258 | } |
1383 | 237 | } | 259 | } |
1384 | 238 | 260 | ||
1385 | === modified file 'src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj' | |||
1386 | --- src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj 2010-08-04 14:23:27 +0000 | |||
1387 | +++ src/Canonical.UbuntuOne.Common/Canonical.UbuntuOne.Common.csproj 2010-08-09 16:14:47 +0000 | |||
1388 | @@ -57,9 +57,15 @@ | |||
1389 | 57 | <Compile Include="Container\SpringContainer.cs" /> | 57 | <Compile Include="Container\SpringContainer.cs" /> |
1390 | 58 | <Compile Include="Container\UnsatisfiedDependencyException.cs" /> | 58 | <Compile Include="Container\UnsatisfiedDependencyException.cs" /> |
1391 | 59 | <Compile Include="IAuthentication.cs" /> | 59 | <Compile Include="IAuthentication.cs" /> |
1392 | 60 | <Compile Include="Utils\ApplicationWrapper.cs" /> | ||
1393 | 61 | <Compile Include="Utils\Explorer.cs" /> | ||
1394 | 62 | <Compile Include="Utils\ExplorerException.cs" /> | ||
1395 | 63 | <Compile Include="Utils\IApplication.cs" /> | ||
1396 | 64 | <Compile Include="Utils\IExplorer.cs" /> | ||
1397 | 60 | <Compile Include="IMessageBox.cs" /> | 65 | <Compile Include="IMessageBox.cs" /> |
1398 | 61 | <Compile Include="IProcessManager.cs" /> | 66 | <Compile Include="IProcessManager.cs" /> |
1399 | 62 | <Compile Include="IProcessManagerFactory.cs" /> | 67 | <Compile Include="IProcessManagerFactory.cs" /> |
1400 | 68 | <Compile Include="Utils\IWebbrowser.cs" /> | ||
1401 | 63 | <Compile Include="ProcessManagementException.cs" /> | 69 | <Compile Include="ProcessManagementException.cs" /> |
1402 | 64 | <Compile Include="ProcessManager.cs" /> | 70 | <Compile Include="ProcessManager.cs" /> |
1403 | 65 | <Compile Include="SyncDaemonAuthentication.cs" /> | 71 | <Compile Include="SyncDaemonAuthentication.cs" /> |
1404 | @@ -106,6 +112,7 @@ | |||
1405 | 106 | <Compile Include="Validation\ValidateArgs.cs" /> | 112 | <Compile Include="Validation\ValidateArgs.cs" /> |
1406 | 107 | <Compile Include="Validation\ValidationException.cs" /> | 113 | <Compile Include="Validation\ValidationException.cs" /> |
1407 | 108 | <Compile Include="Validation\ValidationExtensions.cs" /> | 114 | <Compile Include="Validation\ValidationExtensions.cs" /> |
1408 | 115 | <Compile Include="Utils\Webbrowser.cs" /> | ||
1409 | 109 | </ItemGroup> | 116 | </ItemGroup> |
1410 | 110 | <ItemGroup> | 117 | <ItemGroup> |
1411 | 111 | <Reference Include="DotUpdater, Version=0.2.0.4, Culture=neutral, processorArchitecture=MSIL"> | 118 | <Reference Include="DotUpdater, Version=0.2.0.4, Culture=neutral, processorArchitecture=MSIL"> |
1412 | @@ -120,6 +127,9 @@ | |||
1413 | 120 | <SpecificVersion>False</SpecificVersion> | 127 | <SpecificVersion>False</SpecificVersion> |
1414 | 121 | <HintPath>..\..\lib\log4net\log4net.dll</HintPath> | 128 | <HintPath>..\..\lib\log4net\log4net.dll</HintPath> |
1415 | 122 | </Reference> | 129 | </Reference> |
1416 | 130 | <Reference Include="PresentationCore"> | ||
1417 | 131 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | ||
1418 | 132 | </Reference> | ||
1419 | 123 | <Reference Include="PresentationFramework"> | 133 | <Reference Include="PresentationFramework"> |
1420 | 124 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 134 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
1421 | 125 | </Reference> | 135 | </Reference> |
1422 | 126 | 136 | ||
1423 | === modified file 'src/Canonical.UbuntuOne.Common/OperationContracts/ISyncConfiguration.cs' | |||
1424 | --- src/Canonical.UbuntuOne.Common/OperationContracts/ISyncConfiguration.cs 2010-07-07 10:41:49 +0000 | |||
1425 | +++ src/Canonical.UbuntuOne.Common/OperationContracts/ISyncConfiguration.cs 2010-08-09 16:14:47 +0000 | |||
1426 | @@ -29,6 +29,13 @@ | |||
1427 | 29 | public interface ISyncConfiguration | 29 | public interface ISyncConfiguration |
1428 | 30 | { | 30 | { |
1429 | 31 | /// <summary> | 31 | /// <summary> |
1430 | 32 | /// Provides a way that the client can use to register itself to be notified about events | ||
1431 | 33 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1432 | 34 | /// </summary> | ||
1433 | 35 | [OperationContract(IsOneWay = true)] | ||
1434 | 36 | void RegisterClient(); | ||
1435 | 37 | |||
1436 | 38 | /// <summary> | ||
1437 | 32 | /// Returns the throttling limits that have been set up for the daemon. | 39 | /// Returns the throttling limits that have been set up for the daemon. |
1438 | 33 | /// </summary> | 40 | /// </summary> |
1439 | 34 | /// <returns>The upload and downloads limits that the daemon has.</returns> | 41 | /// <returns>The upload and downloads limits that the daemon has.</returns> |
1440 | 35 | 42 | ||
1441 | === modified file 'src/Canonical.UbuntuOne.Common/OperationContracts/ISyncDaemon.cs' | |||
1442 | --- src/Canonical.UbuntuOne.Common/OperationContracts/ISyncDaemon.cs 2010-07-07 10:41:49 +0000 | |||
1443 | +++ src/Canonical.UbuntuOne.Common/OperationContracts/ISyncDaemon.cs 2010-08-09 16:14:47 +0000 | |||
1444 | @@ -33,6 +33,13 @@ | |||
1445 | 33 | SessionMode = SessionMode.Required)] | 33 | SessionMode = SessionMode.Required)] |
1446 | 34 | public interface ISyncDaemon | 34 | public interface ISyncDaemon |
1447 | 35 | { | 35 | { |
1448 | 36 | /// <summary> | ||
1449 | 37 | /// Provides a way that the client can use to register itself to be notified about events | ||
1450 | 38 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1451 | 39 | /// </summary> | ||
1452 | 40 | [OperationContract(IsOneWay = true)] | ||
1453 | 41 | void RegisterClient(); | ||
1454 | 42 | |||
1455 | 36 | /// <summary> | 43 | /// <summary> |
1456 | 37 | /// Allows to start the daemon by a client. | 44 | /// Allows to start the daemon by a client. |
1457 | 38 | /// </summary> | 45 | /// </summary> |
1458 | 39 | 46 | ||
1459 | === modified file 'src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFileManager.cs' | |||
1460 | --- src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFileManager.cs 2010-07-07 10:41:49 +0000 | |||
1461 | +++ src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFileManager.cs 2010-08-09 16:14:47 +0000 | |||
1462 | @@ -32,7 +32,18 @@ | |||
1463 | 32 | SessionMode = SessionMode.Required)] | 32 | SessionMode = SessionMode.Required)] |
1464 | 33 | public interface ISyncFileManager | 33 | public interface ISyncFileManager |
1465 | 34 | { | 34 | { |
1466 | 35 | /// <summary> | ||
1467 | 36 | /// Provides a way that the client can use to register itself to be notified about events | ||
1468 | 37 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1469 | 38 | /// </summary> | ||
1470 | 39 | [OperationContract(IsOneWay = true)] | ||
1471 | 40 | void RegisterClient(); | ||
1472 | 35 | 41 | ||
1473 | 42 | /// <summary> | ||
1474 | 43 | /// Returns the metadata | ||
1475 | 44 | /// </summary> | ||
1476 | 45 | /// <param name="path"></param> | ||
1477 | 46 | /// <returns></returns> | ||
1478 | 36 | [OperationContract] | 47 | [OperationContract] |
1479 | 37 | IDictionary<string, string> GetMetadata(string path); | 48 | IDictionary<string, string> GetMetadata(string path); |
1480 | 38 | } | 49 | } |
1481 | 39 | 50 | ||
1482 | === modified file 'src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFolders.cs' | |||
1483 | --- src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFolders.cs 2010-07-07 10:41:49 +0000 | |||
1484 | +++ src/Canonical.UbuntuOne.Common/OperationContracts/ISyncFolders.cs 2010-08-09 16:14:47 +0000 | |||
1485 | @@ -30,6 +30,13 @@ | |||
1486 | 30 | public interface ISyncFolders | 30 | public interface ISyncFolders |
1487 | 31 | { | 31 | { |
1488 | 32 | /// <summary> | 32 | /// <summary> |
1489 | 33 | /// Provides a way that the client can use to register itself to be notified about events | ||
1490 | 34 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1491 | 35 | /// </summary> | ||
1492 | 36 | [OperationContract(IsOneWay = true)] | ||
1493 | 37 | void RegisterClient(); | ||
1494 | 38 | |||
1495 | 39 | /// <summary> | ||
1496 | 33 | /// Creates a new udf for the given path. | 40 | /// Creates a new udf for the given path. |
1497 | 34 | /// </summary> | 41 | /// </summary> |
1498 | 35 | /// <param name="path">The path to which the Udf will be created.</param> | 42 | /// <param name="path">The path to which the Udf will be created.</param> |
1499 | 36 | 43 | ||
1500 | === modified file 'src/Canonical.UbuntuOne.Common/OperationContracts/ISyncShares.cs' | |||
1501 | --- src/Canonical.UbuntuOne.Common/OperationContracts/ISyncShares.cs 2010-07-07 10:41:49 +0000 | |||
1502 | +++ src/Canonical.UbuntuOne.Common/OperationContracts/ISyncShares.cs 2010-08-09 16:14:47 +0000 | |||
1503 | @@ -30,6 +30,13 @@ | |||
1504 | 30 | public interface ISyncShares | 30 | public interface ISyncShares |
1505 | 31 | { | 31 | { |
1506 | 32 | /// <summary> | 32 | /// <summary> |
1507 | 33 | /// Provides a way that the client can use to register itself to be notified about events | ||
1508 | 34 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1509 | 35 | /// </summary> | ||
1510 | 36 | [OperationContract(IsOneWay = true)] | ||
1511 | 37 | void RegisterClient(); | ||
1512 | 38 | |||
1513 | 39 | /// <summary> | ||
1514 | 33 | /// Allows the client to query and get all the different shares that the user has. | 40 | /// Allows the client to query and get all the different shares that the user has. |
1515 | 34 | /// </summary> | 41 | /// </summary> |
1516 | 35 | /// <returns>Returns a list with all the shares that the user has.</returns> | 42 | /// <returns>Returns a list with all the shares that the user has.</returns> |
1517 | 36 | 43 | ||
1518 | === added directory 'src/Canonical.UbuntuOne.Common/Utils' | |||
1519 | === added file 'src/Canonical.UbuntuOne.Common/Utils/ApplicationWrapper.cs' | |||
1520 | --- src/Canonical.UbuntuOne.Common/Utils/ApplicationWrapper.cs 1970-01-01 00:00:00 +0000 | |||
1521 | +++ src/Canonical.UbuntuOne.Common/Utils/ApplicationWrapper.cs 2010-08-09 16:14:47 +0000 | |||
1522 | @@ -0,0 +1,63 @@ | |||
1523 | 1 | /** | ||
1524 | 2 | * Copyright 2010 Canonical Ltd. | ||
1525 | 3 | * | ||
1526 | 4 | * This file is part of UbuntuOne on Windows. | ||
1527 | 5 | * | ||
1528 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1529 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1530 | 8 | * as published by the Free Software Foundation. | ||
1531 | 9 | * | ||
1532 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1533 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1534 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1535 | 13 | * GNU Lesser General Public License for more details. | ||
1536 | 14 | * | ||
1537 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1538 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1539 | 17 | * | ||
1540 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1541 | 19 | */ | ||
1542 | 20 | using System.Windows; | ||
1543 | 21 | |||
1544 | 22 | namespace Canonical.UbuntuOne.Common.Utils | ||
1545 | 23 | { | ||
1546 | 24 | public class ApplicationWrapper : IApplication | ||
1547 | 25 | { | ||
1548 | 26 | private readonly Application _app; | ||
1549 | 27 | |||
1550 | 28 | public ApplicationWrapper() | ||
1551 | 29 | { | ||
1552 | 30 | _app = new Application(); | ||
1553 | 31 | } | ||
1554 | 32 | |||
1555 | 33 | #region Implementation of IApplication | ||
1556 | 34 | |||
1557 | 35 | /// <summary> | ||
1558 | 36 | /// Allows to start the application using the passed window. | ||
1559 | 37 | /// </summary> | ||
1560 | 38 | /// <param name="startWindow">The main window of the application.</param> | ||
1561 | 39 | public void Run(Window startWindow) | ||
1562 | 40 | { | ||
1563 | 41 | _app.Run(startWindow); | ||
1564 | 42 | } | ||
1565 | 43 | |||
1566 | 44 | /// <summary> | ||
1567 | 45 | /// Gets and sets the shutdown mode to be used in the application. | ||
1568 | 46 | /// </summary> | ||
1569 | 47 | public ShutdownMode ShutdownMode | ||
1570 | 48 | { | ||
1571 | 49 | get { return _app.ShutdownMode; } | ||
1572 | 50 | set { _app.ShutdownMode = value; } | ||
1573 | 51 | } | ||
1574 | 52 | |||
1575 | 53 | /// <summary> | ||
1576 | 54 | /// Allows to close the application. | ||
1577 | 55 | /// </summary> | ||
1578 | 56 | public void Exit() | ||
1579 | 57 | { | ||
1580 | 58 | _app.Shutdown(); | ||
1581 | 59 | } | ||
1582 | 60 | |||
1583 | 61 | #endregion | ||
1584 | 62 | } | ||
1585 | 63 | } | ||
1586 | 0 | 64 | ||
1587 | === added file 'src/Canonical.UbuntuOne.Common/Utils/Explorer.cs' | |||
1588 | --- src/Canonical.UbuntuOne.Common/Utils/Explorer.cs 1970-01-01 00:00:00 +0000 | |||
1589 | +++ src/Canonical.UbuntuOne.Common/Utils/Explorer.cs 2010-08-09 16:14:47 +0000 | |||
1590 | @@ -0,0 +1,46 @@ | |||
1591 | 1 | /** | ||
1592 | 2 | * Copyright 2010 Canonical Ltd. | ||
1593 | 3 | * | ||
1594 | 4 | * This file is part of UbuntuOne on Windows. | ||
1595 | 5 | * | ||
1596 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1597 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1598 | 8 | * as published by the Free Software Foundation. | ||
1599 | 9 | * | ||
1600 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1601 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1602 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1603 | 13 | * GNU Lesser General Public License for more details. | ||
1604 | 14 | * | ||
1605 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1606 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1607 | 17 | * | ||
1608 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1609 | 19 | */ | ||
1610 | 20 | using System.Diagnostics; | ||
1611 | 21 | using System.IO; | ||
1612 | 22 | |||
1613 | 23 | namespace Canonical.UbuntuOne.Common.Utils | ||
1614 | 24 | { | ||
1615 | 25 | |||
1616 | 26 | public class Explorer : IExplorer | ||
1617 | 27 | { | ||
1618 | 28 | private const string ExplorerProcess = "explorer.exe"; | ||
1619 | 29 | |||
1620 | 30 | #region Implementation of IExplorer | ||
1621 | 31 | |||
1622 | 32 | /// <summary> | ||
1623 | 33 | /// When implemented the method should open a location of a folder with the given path. | ||
1624 | 34 | /// </summary> | ||
1625 | 35 | public void OpenFolder(string folderFullPath) | ||
1626 | 36 | { | ||
1627 | 37 | if(!File.Exists(folderFullPath)) | ||
1628 | 38 | { | ||
1629 | 39 | throw new ExplorerException("File not found."); | ||
1630 | 40 | } | ||
1631 | 41 | Process.Start(ExplorerProcess, folderFullPath); | ||
1632 | 42 | } | ||
1633 | 43 | |||
1634 | 44 | #endregion | ||
1635 | 45 | } | ||
1636 | 46 | } | ||
1637 | 0 | 47 | ||
1638 | === added file 'src/Canonical.UbuntuOne.Common/Utils/ExplorerException.cs' | |||
1639 | --- src/Canonical.UbuntuOne.Common/Utils/ExplorerException.cs 1970-01-01 00:00:00 +0000 | |||
1640 | +++ src/Canonical.UbuntuOne.Common/Utils/ExplorerException.cs 2010-08-09 16:14:47 +0000 | |||
1641 | @@ -0,0 +1,43 @@ | |||
1642 | 1 | /** | ||
1643 | 2 | * Copyright 2010 Canonical Ltd. | ||
1644 | 3 | * | ||
1645 | 4 | * This file is part of UbuntuOne on Windows. | ||
1646 | 5 | * | ||
1647 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1648 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1649 | 8 | * as published by the Free Software Foundation. | ||
1650 | 9 | * | ||
1651 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1652 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1653 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1654 | 13 | * GNU Lesser General Public License for more details. | ||
1655 | 14 | * | ||
1656 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1657 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1658 | 17 | * | ||
1659 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1660 | 19 | */ | ||
1661 | 20 | using System; | ||
1662 | 21 | |||
1663 | 22 | namespace Canonical.UbuntuOne.Common.Utils | ||
1664 | 23 | { | ||
1665 | 24 | public class ExplorerException : Exception | ||
1666 | 25 | { | ||
1667 | 26 | public ExplorerException() | ||
1668 | 27 | { | ||
1669 | 28 | |||
1670 | 29 | } | ||
1671 | 30 | |||
1672 | 31 | public ExplorerException(string message) | ||
1673 | 32 | : base(message) | ||
1674 | 33 | { | ||
1675 | 34 | |||
1676 | 35 | } | ||
1677 | 36 | |||
1678 | 37 | public ExplorerException(string message, Exception inner) | ||
1679 | 38 | : base(message, inner) | ||
1680 | 39 | { | ||
1681 | 40 | |||
1682 | 41 | } | ||
1683 | 42 | } | ||
1684 | 43 | } | ||
1685 | 0 | 44 | ||
1686 | === added file 'src/Canonical.UbuntuOne.Common/Utils/IApplication.cs' | |||
1687 | --- src/Canonical.UbuntuOne.Common/Utils/IApplication.cs 1970-01-01 00:00:00 +0000 | |||
1688 | +++ src/Canonical.UbuntuOne.Common/Utils/IApplication.cs 2010-08-09 16:14:47 +0000 | |||
1689 | @@ -0,0 +1,45 @@ | |||
1690 | 1 | /** | ||
1691 | 2 | * Copyright 2010 Canonical Ltd. | ||
1692 | 3 | * | ||
1693 | 4 | * This file is part of UbuntuOne on Windows. | ||
1694 | 5 | * | ||
1695 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1696 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1697 | 8 | * as published by the Free Software Foundation. | ||
1698 | 9 | * | ||
1699 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1700 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1701 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1702 | 13 | * GNU Lesser General Public License for more details. | ||
1703 | 14 | * | ||
1704 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1705 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1706 | 17 | * | ||
1707 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1708 | 19 | */ | ||
1709 | 20 | using System.Windows; | ||
1710 | 21 | |||
1711 | 22 | namespace Canonical.UbuntuOne.Common.Utils | ||
1712 | 23 | { | ||
1713 | 24 | /// <summary> | ||
1714 | 25 | /// Interface that allows to abstract an application in C# allowing to make the code more testable. | ||
1715 | 26 | /// </summary> | ||
1716 | 27 | public interface IApplication | ||
1717 | 28 | { | ||
1718 | 29 | /// <summary> | ||
1719 | 30 | /// Allows to start the application using the passed window. | ||
1720 | 31 | /// </summary> | ||
1721 | 32 | /// <param name="startWindow">The main window of the application.</param> | ||
1722 | 33 | void Run(Window startWindow); | ||
1723 | 34 | |||
1724 | 35 | /// <summary> | ||
1725 | 36 | /// Gets and sets the shutdown mode to be used in the application. | ||
1726 | 37 | /// </summary> | ||
1727 | 38 | ShutdownMode ShutdownMode { get; set; } | ||
1728 | 39 | |||
1729 | 40 | /// <summary> | ||
1730 | 41 | /// Allows to close the application. | ||
1731 | 42 | /// </summary> | ||
1732 | 43 | void Exit(); | ||
1733 | 44 | } | ||
1734 | 45 | } | ||
1735 | 0 | 46 | ||
1736 | === added file 'src/Canonical.UbuntuOne.Common/Utils/IExplorer.cs' | |||
1737 | --- src/Canonical.UbuntuOne.Common/Utils/IExplorer.cs 1970-01-01 00:00:00 +0000 | |||
1738 | +++ src/Canonical.UbuntuOne.Common/Utils/IExplorer.cs 2010-08-09 16:14:47 +0000 | |||
1739 | @@ -0,0 +1,29 @@ | |||
1740 | 1 | /** | ||
1741 | 2 | * Copyright 2010 Canonical Ltd. | ||
1742 | 3 | * | ||
1743 | 4 | * This file is part of UbuntuOne on Windows. | ||
1744 | 5 | * | ||
1745 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1746 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1747 | 8 | * as published by the Free Software Foundation. | ||
1748 | 9 | * | ||
1749 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1750 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1751 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1752 | 13 | * GNU Lesser General Public License for more details. | ||
1753 | 14 | * | ||
1754 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1755 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1756 | 17 | * | ||
1757 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1758 | 19 | */ | ||
1759 | 20 | namespace Canonical.UbuntuOne.Common.Utils | ||
1760 | 21 | { | ||
1761 | 22 | public interface IExplorer | ||
1762 | 23 | { | ||
1763 | 24 | /// <summary> | ||
1764 | 25 | /// When implemented the method should open a location of a folder with the given path. | ||
1765 | 26 | /// </summary> | ||
1766 | 27 | void OpenFolder(string folderFullPath); | ||
1767 | 28 | } | ||
1768 | 29 | } | ||
1769 | 0 | 30 | ||
1770 | === added file 'src/Canonical.UbuntuOne.Common/Utils/IWebbrowser.cs' | |||
1771 | --- src/Canonical.UbuntuOne.Common/Utils/IWebbrowser.cs 1970-01-01 00:00:00 +0000 | |||
1772 | +++ src/Canonical.UbuntuOne.Common/Utils/IWebbrowser.cs 2010-08-09 16:14:47 +0000 | |||
1773 | @@ -0,0 +1,29 @@ | |||
1774 | 1 | /** | ||
1775 | 2 | * Copyright 2010 Canonical Ltd. | ||
1776 | 3 | * | ||
1777 | 4 | * This file is part of UbuntuOne on Windows. | ||
1778 | 5 | * | ||
1779 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1780 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1781 | 8 | * as published by the Free Software Foundation. | ||
1782 | 9 | * | ||
1783 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1784 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1785 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1786 | 13 | * GNU Lesser General Public License for more details. | ||
1787 | 14 | * | ||
1788 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1789 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1790 | 17 | * | ||
1791 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1792 | 19 | */ | ||
1793 | 20 | namespace Canonical.UbuntuOne.Common.Utils | ||
1794 | 21 | { | ||
1795 | 22 | public interface IWebbrowser | ||
1796 | 23 | { | ||
1797 | 24 | /// <summary> | ||
1798 | 25 | /// The implementation should open the default browser in the system and dispaly the passed url. | ||
1799 | 26 | /// </summary> | ||
1800 | 27 | void LauncWebpage(string url); | ||
1801 | 28 | } | ||
1802 | 29 | } | ||
1803 | 0 | 30 | ||
1804 | === added file 'src/Canonical.UbuntuOne.Common/Utils/Webbrowser.cs' | |||
1805 | --- src/Canonical.UbuntuOne.Common/Utils/Webbrowser.cs 1970-01-01 00:00:00 +0000 | |||
1806 | +++ src/Canonical.UbuntuOne.Common/Utils/Webbrowser.cs 2010-08-09 16:14:47 +0000 | |||
1807 | @@ -0,0 +1,32 @@ | |||
1808 | 1 | /** | ||
1809 | 2 | * Copyright 2010 Canonical Ltd. | ||
1810 | 3 | * | ||
1811 | 4 | * This file is part of UbuntuOne on Windows. | ||
1812 | 5 | * | ||
1813 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
1814 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
1815 | 8 | * as published by the Free Software Foundation. | ||
1816 | 9 | * | ||
1817 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
1818 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1819 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1820 | 13 | * GNU Lesser General Public License for more details. | ||
1821 | 14 | * | ||
1822 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
1823 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
1824 | 17 | * | ||
1825 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
1826 | 19 | */ | ||
1827 | 20 | using System.Diagnostics; | ||
1828 | 21 | |||
1829 | 22 | namespace Canonical.UbuntuOne.Common.Utils | ||
1830 | 23 | { | ||
1831 | 24 | public class Webbrowser : IWebbrowser | ||
1832 | 25 | { | ||
1833 | 26 | public void LauncWebpage(string url) | ||
1834 | 27 | { | ||
1835 | 28 | // trust the console to open the correct app | ||
1836 | 29 | Process.Start(url); | ||
1837 | 30 | } | ||
1838 | 31 | } | ||
1839 | 32 | } | ||
1840 | 0 | 33 | ||
1841 | === modified file 'src/Canonical.UbuntuOne.Common/objects.xml' | |||
1842 | --- src/Canonical.UbuntuOne.Common/objects.xml 2010-07-30 16:32:54 +0000 | |||
1843 | +++ src/Canonical.UbuntuOne.Common/objects.xml 2010-08-09 16:14:47 +0000 | |||
1844 | @@ -31,8 +31,19 @@ | |||
1845 | 31 | <property name="RSSFeed" | 31 | <property name="RSSFeed" |
1846 | 32 | value="http://path/to/rss.feed"/> <!-- Provide a way to set this through config ????--> | 32 | value="http://path/to/rss.feed"/> <!-- Provide a way to set this through config ????--> |
1847 | 33 | </object> | 33 | </object> |
1850 | 34 | 34 | ||
1851 | 35 | 35 | <!-- ######################################################################################## --> | |
1852 | 36 | <!-- Util Objects --> | ||
1853 | 37 | <!-- ######################################################################################## --> | ||
1854 | 38 | |||
1855 | 39 | <object id="Webbrowser" | ||
1856 | 40 | type="Canonical.UbuntuOne.Common.Utils.Webbrowser, Canonical.UbuntuOne.Common" /> | ||
1857 | 41 | |||
1858 | 42 | <object id="Explorer" | ||
1859 | 43 | type="Canonical.UbuntuOne.Common.Utils.Explorer, Canonical.UbuntuOne.Common" /> | ||
1860 | 44 | |||
1861 | 45 | <object id="Application" | ||
1862 | 46 | type="Canonical.UbuntuOne.Common.Utils.ApplicationWrapper, Canonical.UbuntuOne.Common" /> | ||
1863 | 36 | 47 | ||
1864 | 37 | </objects> | 48 | </objects> |
1865 | 38 | 49 | ||
1866 | 39 | \ No newline at end of file | 50 | \ No newline at end of file |
1867 | 40 | 51 | ||
1868 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncConfigurationService.cs' | |||
1869 | --- src/Canonical.UbuntuOne.ProcessDispatcher/SyncConfigurationService.cs 2010-07-26 11:10:16 +0000 | |||
1870 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncConfigurationService.cs 2010-08-09 16:14:47 +0000 | |||
1871 | @@ -26,6 +26,15 @@ | |||
1872 | 26 | class SyncConfigurationService : ISyncConfiguration | 26 | class SyncConfigurationService : ISyncConfiguration |
1873 | 27 | { | 27 | { |
1874 | 28 | /// <summary> | 28 | /// <summary> |
1875 | 29 | /// Provides a way that the client can use to register itself to be notified about events | ||
1876 | 30 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1877 | 31 | /// </summary> | ||
1878 | 32 | public void RegisterClient() | ||
1879 | 33 | { | ||
1880 | 34 | throw new NotImplementedException(); | ||
1881 | 35 | } | ||
1882 | 36 | |||
1883 | 37 | /// <summary> | ||
1884 | 29 | /// Returns the throttling limits that have been set up for the daemon. | 38 | /// Returns the throttling limits that have been set up for the daemon. |
1885 | 30 | /// </summary> | 39 | /// </summary> |
1886 | 31 | /// <returns>The upload and downloads limits that the daemon has.</returns> | 40 | /// <returns>The upload and downloads limits that the daemon has.</returns> |
1887 | 32 | 41 | ||
1888 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs' | |||
1889 | --- src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs 2010-07-26 11:10:16 +0000 | |||
1890 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs 2010-08-09 16:14:47 +0000 | |||
1891 | @@ -82,6 +82,7 @@ | |||
1892 | 82 | _processesMap = new Dictionary<string, IProcessManager>(); | 82 | _processesMap = new Dictionary<string, IProcessManager>(); |
1893 | 83 | } | 83 | } |
1894 | 84 | 84 | ||
1895 | 85 | |||
1896 | 85 | /// <summary> | 86 | /// <summary> |
1897 | 86 | /// Allows to start the daemon by a client. | 87 | /// Allows to start the daemon by a client. |
1898 | 87 | /// </summary> | 88 | /// </summary> |
1899 | @@ -194,6 +195,15 @@ | |||
1900 | 194 | } | 195 | } |
1901 | 195 | 196 | ||
1902 | 196 | /// <summary> | 197 | /// <summary> |
1903 | 198 | /// Provides a way that the client can use to register itself to be notified about events | ||
1904 | 199 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1905 | 200 | /// </summary> | ||
1906 | 201 | public void RegisterClient() | ||
1907 | 202 | { | ||
1908 | 203 | throw new NotImplementedException(); | ||
1909 | 204 | } | ||
1910 | 205 | |||
1911 | 206 | /// <summary> | ||
1912 | 197 | /// Allows to query the service about the current status of the daemon. | 207 | /// Allows to query the service about the current status of the daemon. |
1913 | 198 | /// </summary> | 208 | /// </summary> |
1914 | 199 | /// <returns>A data contract that contains the current status of the daemon.</returns> | 209 | /// <returns>A data contract that contains the current status of the daemon.</returns> |
1915 | 200 | 210 | ||
1916 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncFileManagerService.cs' | |||
1917 | --- src/Canonical.UbuntuOne.ProcessDispatcher/SyncFileManagerService.cs 2010-07-26 11:10:16 +0000 | |||
1918 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncFileManagerService.cs 2010-08-09 16:14:47 +0000 | |||
1919 | @@ -26,6 +26,15 @@ | |||
1920 | 26 | { | 26 | { |
1921 | 27 | class SyncFileManagerService : ISyncFileManager | 27 | class SyncFileManagerService : ISyncFileManager |
1922 | 28 | { | 28 | { |
1923 | 29 | /// <summary> | ||
1924 | 30 | /// Provides a way that the client can use to register itself to be notified about events | ||
1925 | 31 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1926 | 32 | /// </summary> | ||
1927 | 33 | public void RegisterClient() | ||
1928 | 34 | { | ||
1929 | 35 | throw new NotImplementedException(); | ||
1930 | 36 | } | ||
1931 | 37 | |||
1932 | 29 | [DebugLogged] | 38 | [DebugLogged] |
1933 | 30 | public IDictionary<string, string> GetMetadata(string path) | 39 | public IDictionary<string, string> GetMetadata(string path) |
1934 | 31 | { | 40 | { |
1935 | 32 | 41 | ||
1936 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncFoldersService.cs' | |||
1937 | --- src/Canonical.UbuntuOne.ProcessDispatcher/SyncFoldersService.cs 2010-07-07 10:41:49 +0000 | |||
1938 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncFoldersService.cs 2010-08-09 16:14:47 +0000 | |||
1939 | @@ -26,6 +26,15 @@ | |||
1940 | 26 | class SyncFoldersService : ISyncFolders | 26 | class SyncFoldersService : ISyncFolders |
1941 | 27 | { | 27 | { |
1942 | 28 | /// <summary> | 28 | /// <summary> |
1943 | 29 | /// Provides a way that the client can use to register itself to be notified about events | ||
1944 | 30 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1945 | 31 | /// </summary> | ||
1946 | 32 | public void RegisterClient() | ||
1947 | 33 | { | ||
1948 | 34 | throw new NotImplementedException(); | ||
1949 | 35 | } | ||
1950 | 36 | |||
1951 | 37 | /// <summary> | ||
1952 | 29 | /// Creates a new udf for the given path. | 38 | /// Creates a new udf for the given path. |
1953 | 30 | /// </summary> | 39 | /// </summary> |
1954 | 31 | /// <param name="path">The path to which the Udf will be created.</param> | 40 | /// <param name="path">The path to which the Udf will be created.</param> |
1955 | 32 | 41 | ||
1956 | === modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncSharesService.cs' | |||
1957 | --- src/Canonical.UbuntuOne.ProcessDispatcher/SyncSharesService.cs 2010-07-26 11:10:16 +0000 | |||
1958 | +++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncSharesService.cs 2010-08-09 16:14:47 +0000 | |||
1959 | @@ -27,6 +27,15 @@ | |||
1960 | 27 | class SyncSharesService : ISyncShares | 27 | class SyncSharesService : ISyncShares |
1961 | 28 | { | 28 | { |
1962 | 29 | /// <summary> | 29 | /// <summary> |
1963 | 30 | /// Provides a way that the client can use to register itself to be notified about events | ||
1964 | 31 | /// through callbacks. The client should implemented the ISyncDaemonClient interface. | ||
1965 | 32 | /// </summary> | ||
1966 | 33 | public void RegisterClient() | ||
1967 | 34 | { | ||
1968 | 35 | throw new NotImplementedException(); | ||
1969 | 36 | } | ||
1970 | 37 | |||
1971 | 38 | /// <summary> | ||
1972 | 30 | /// Allows the client to query and get all the different shares that the user has. | 39 | /// Allows the client to query and get all the different shares that the user has. |
1973 | 31 | /// </summary> | 40 | /// </summary> |
1974 | 32 | /// <returns>Returns a list with all the shares that the user has.</returns> | 41 | /// <returns>Returns a list with all the shares that the user has.</returns> |
1975 | 33 | 42 | ||
1976 | === modified file 'src/UbuntuOneClient.Tests/ProgramFixture.cs' | |||
1977 | --- src/UbuntuOneClient.Tests/ProgramFixture.cs 2010-08-05 19:26:54 +0000 | |||
1978 | +++ src/UbuntuOneClient.Tests/ProgramFixture.cs 2010-08-09 16:14:47 +0000 | |||
1979 | @@ -21,6 +21,7 @@ | |||
1980 | 21 | using System.Windows; | 21 | using System.Windows; |
1981 | 22 | using Canonical.UbuntuOne.Client.Notification; | 22 | using Canonical.UbuntuOne.Client.Notification; |
1982 | 23 | using Canonical.UbuntuOne.Common.Update; | 23 | using Canonical.UbuntuOne.Common.Update; |
1983 | 24 | using Canonical.UbuntuOne.Common.Utils; | ||
1984 | 24 | using NUnit.Framework; | 25 | using NUnit.Framework; |
1985 | 25 | using Rhino.Mocks; | 26 | using Rhino.Mocks; |
1986 | 26 | 27 | ||
1987 | @@ -79,7 +80,8 @@ | |||
1988 | 79 | _app.ShutdownMode = ShutdownMode.OnExplicitShutdown; | 80 | _app.ShutdownMode = ShutdownMode.OnExplicitShutdown; |
1989 | 80 | 81 | ||
1990 | 81 | // expect that we are calling the run with the correct window | 82 | // expect that we are calling the run with the correct window |
1992 | 82 | Expect.Call(() => _app.Run(_notifyIcon)) | 83 | Expect.Call(() => _app.Run(_notifyIcon as Window)) |
1993 | 84 | .IgnoreArguments() | ||
1994 | 83 | .Repeat.Once(); | 85 | .Repeat.Once(); |
1995 | 84 | 86 | ||
1996 | 85 | // return that the are no update, since we have a strict mock the test will | 87 | // return that the are no update, since we have a strict mock the test will |
1997 | @@ -102,7 +104,8 @@ | |||
1998 | 102 | _app.ShutdownMode = ShutdownMode.OnExplicitShutdown; | 104 | _app.ShutdownMode = ShutdownMode.OnExplicitShutdown; |
1999 | 103 | 105 | ||
2000 | 104 | // expect that we are calling the run with the correct window | 106 | // expect that we are calling the run with the correct window |
2002 | 105 | Expect.Call(() => _app.Run(_notifyIcon)) | 107 | Expect.Call(() => _app.Run(_notifyIcon as Window)) |
2003 | 108 | .IgnoreArguments() | ||
2004 | 106 | .Repeat.Once(); | 109 | .Repeat.Once(); |
2005 | 107 | 110 | ||
2006 | 108 | // return that the are no update, since we have a strict mock the test will | 111 | // return that the are no update, since we have a strict mock the test will |
2007 | @@ -127,7 +130,8 @@ | |||
2008 | 127 | _app.ShutdownMode = ShutdownMode.OnExplicitShutdown; | 130 | _app.ShutdownMode = ShutdownMode.OnExplicitShutdown; |
2009 | 128 | 131 | ||
2010 | 129 | // expect that we are calling the run with the correct window | 132 | // expect that we are calling the run with the correct window |
2012 | 130 | Expect.Call(() => _app.Run(_notifyIcon)) | 133 | Expect.Call(() => _app.Run(_notifyIcon as Window)) |
2013 | 134 | .IgnoreArguments() | ||
2014 | 131 | .Repeat.Once(); | 135 | .Repeat.Once(); |
2015 | 132 | 136 | ||
2016 | 133 | // throw an exception and expect it to be caught and continue. | 137 | // throw an exception and expect it to be caught and continue. |
2017 | 134 | 138 | ||
2018 | === modified file 'src/UbuntuOneClient.Tests/UbuntuOneClient.Tests.csproj' | |||
2019 | --- src/UbuntuOneClient.Tests/UbuntuOneClient.Tests.csproj 2010-07-30 16:32:54 +0000 | |||
2020 | +++ src/UbuntuOneClient.Tests/UbuntuOneClient.Tests.csproj 2010-08-09 16:14:47 +0000 | |||
2021 | @@ -43,6 +43,9 @@ | |||
2022 | 43 | <SpecificVersion>False</SpecificVersion> | 43 | <SpecificVersion>False</SpecificVersion> |
2023 | 44 | <HintPath>..\..\lib\Nunit\nunit.framework.dll</HintPath> | 44 | <HintPath>..\..\lib\Nunit\nunit.framework.dll</HintPath> |
2024 | 45 | </Reference> | 45 | </Reference> |
2025 | 46 | <Reference Include="PresentationCore"> | ||
2026 | 47 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | ||
2027 | 48 | </Reference> | ||
2028 | 46 | <Reference Include="PresentationFramework"> | 49 | <Reference Include="PresentationFramework"> |
2029 | 47 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 50 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
2030 | 48 | </Reference> | 51 | </Reference> |
2031 | 49 | 52 | ||
2032 | === removed file 'src/UbuntuOneClient/ApplicationWrapper.cs' | |||
2033 | --- src/UbuntuOneClient/ApplicationWrapper.cs 2010-07-28 11:03:35 +0000 | |||
2034 | +++ src/UbuntuOneClient/ApplicationWrapper.cs 1970-01-01 00:00:00 +0000 | |||
2035 | @@ -1,55 +0,0 @@ | |||
2036 | 1 | using System; | ||
2037 | 2 | /** | ||
2038 | 3 | * Copyright 2010 Canonical Ltd. | ||
2039 | 4 | * | ||
2040 | 5 | * This file is part of UbuntuOne on Windows. | ||
2041 | 6 | * | ||
2042 | 7 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
2043 | 8 | * it under the terms of the GNU Lesser General Public License version | ||
2044 | 9 | * as published by the Free Software Foundation. | ||
2045 | 10 | * | ||
2046 | 11 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
2047 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2048 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2049 | 14 | * GNU Lesser General Public License for more details. | ||
2050 | 15 | * | ||
2051 | 16 | * You should have received a copy of the GNU Lesser General Public License | ||
2052 | 17 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
2053 | 18 | * | ||
2054 | 19 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
2055 | 20 | */ | ||
2056 | 21 | using System.Threading; | ||
2057 | 22 | using System.Windows; | ||
2058 | 23 | using Canonical.UbuntuOne.Client.Notification; | ||
2059 | 24 | using Canonical.UbuntuOne.Common.Validation; | ||
2060 | 25 | |||
2061 | 26 | namespace UbuntuOneClient | ||
2062 | 27 | { | ||
2063 | 28 | /// <summary> | ||
2064 | 29 | /// Helper class that has been created to allow an easy way to test the Program class that starts the application. | ||
2065 | 30 | /// </summary> | ||
2066 | 31 | internal class ApplicationWrapper : IApplication | ||
2067 | 32 | { | ||
2068 | 33 | private readonly Application _app; | ||
2069 | 34 | |||
2070 | 35 | public ApplicationWrapper() | ||
2071 | 36 | { | ||
2072 | 37 | _app = new Application(); | ||
2073 | 38 | } | ||
2074 | 39 | |||
2075 | 40 | public void Run(INotificationIconView notificationIcon) | ||
2076 | 41 | { | ||
2077 | 42 | ValidateArgs.Begin() | ||
2078 | 43 | .IsOfType(notificationIcon, typeof (Window), "notificationIcon") | ||
2079 | 44 | .Check(); | ||
2080 | 45 | var window = (Window)notificationIcon; | ||
2081 | 46 | _app.Run(window); | ||
2082 | 47 | } | ||
2083 | 48 | |||
2084 | 49 | public ShutdownMode ShutdownMode | ||
2085 | 50 | { | ||
2086 | 51 | get { return _app.ShutdownMode; } | ||
2087 | 52 | set { _app.ShutdownMode = value; } | ||
2088 | 53 | } | ||
2089 | 54 | } | ||
2090 | 55 | } | ||
2091 | 56 | 0 | ||
2092 | === removed file 'src/UbuntuOneClient/IApplication.cs' | |||
2093 | --- src/UbuntuOneClient/IApplication.cs 2010-07-28 11:03:35 +0000 | |||
2094 | +++ src/UbuntuOneClient/IApplication.cs 1970-01-01 00:00:00 +0000 | |||
2095 | @@ -1,41 +0,0 @@ | |||
2096 | 1 | /** | ||
2097 | 2 | * Copyright 2010 Canonical Ltd. | ||
2098 | 3 | * | ||
2099 | 4 | * This file is part of UbuntuOne on Windows. | ||
2100 | 5 | * | ||
2101 | 6 | * UbuntuOne on Windows is free software: you can redistribute it and/or modify | ||
2102 | 7 | * it under the terms of the GNU Lesser General Public License version | ||
2103 | 8 | * as published by the Free Software Foundation. | ||
2104 | 9 | * | ||
2105 | 10 | * Ubuntu One on Windows is distributed in the hope that it will be useful, | ||
2106 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2107 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2108 | 13 | * GNU Lesser General Public License for more details. | ||
2109 | 14 | * | ||
2110 | 15 | * You should have received a copy of the GNU Lesser General Public License | ||
2111 | 16 | * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>. | ||
2112 | 17 | * | ||
2113 | 18 | * Authors: Manuel de la Peña <manuel.delapena@canonical.com> | ||
2114 | 19 | */ | ||
2115 | 20 | using System.Windows; | ||
2116 | 21 | using Canonical.UbuntuOne.Client.Notification; | ||
2117 | 22 | |||
2118 | 23 | namespace UbuntuOneClient | ||
2119 | 24 | { | ||
2120 | 25 | /// <summary> | ||
2121 | 26 | /// Helper interface that has been added to make the code more testable in the program class. | ||
2122 | 27 | /// </summary> | ||
2123 | 28 | public interface IApplication | ||
2124 | 29 | { | ||
2125 | 30 | /// <summary> | ||
2126 | 31 | /// Runs an application using the passed window as its main window in the thread. | ||
2127 | 32 | /// </summary> | ||
2128 | 33 | /// <param name="notificationIcon">The notification icon used by the user to interact with the daemon.</param> | ||
2129 | 34 | void Run(INotificationIconView notificationIcon); | ||
2130 | 35 | |||
2131 | 36 | /// <summary> | ||
2132 | 37 | /// Gets and sets the shutdown mode to be used in the application. | ||
2133 | 38 | /// </summary> | ||
2134 | 39 | ShutdownMode ShutdownMode { get; set; } | ||
2135 | 40 | } | ||
2136 | 41 | } | ||
2137 | 42 | 0 | ||
2138 | === modified file 'src/UbuntuOneClient/Program.cs' | |||
2139 | --- src/UbuntuOneClient/Program.cs 2010-07-30 16:32:54 +0000 | |||
2140 | +++ src/UbuntuOneClient/Program.cs 2010-08-09 16:14:47 +0000 | |||
2141 | @@ -23,6 +23,7 @@ | |||
2142 | 23 | using Canonical.UbuntuOne.Client.Notification; | 23 | using Canonical.UbuntuOne.Client.Notification; |
2143 | 24 | using Canonical.UbuntuOne.Common.Container; | 24 | using Canonical.UbuntuOne.Common.Container; |
2144 | 25 | using Canonical.UbuntuOne.Common.Update; | 25 | using Canonical.UbuntuOne.Common.Update; |
2145 | 26 | using Canonical.UbuntuOne.Common.Utils; | ||
2146 | 26 | using log4net; | 27 | using log4net; |
2147 | 27 | 28 | ||
2148 | 28 | namespace UbuntuOneClient | 29 | namespace UbuntuOneClient |
2149 | @@ -125,7 +126,7 @@ | |||
2150 | 125 | _updatesThread = new Thread(CheckForUpdates); | 126 | _updatesThread = new Thread(CheckForUpdates); |
2151 | 126 | _updatesThread.Start(); | 127 | _updatesThread.Start(); |
2152 | 127 | // we do not worry about looping to allow the other thread to finish, we no that app should take longer | 128 | // we do not worry about looping to allow the other thread to finish, we no that app should take longer |
2154 | 128 | Application.Run(NotifyIcon); | 129 | Application.Run(NotifyIcon as Window); |
2155 | 129 | } | 130 | } |
2156 | 130 | 131 | ||
2157 | 131 | /// <summary> | 132 | /// <summary> |
2158 | 132 | 133 | ||
2159 | === modified file 'src/UbuntuOneClient/UbuntuOneClient.csproj' | |||
2160 | --- src/UbuntuOneClient/UbuntuOneClient.csproj 2010-08-02 17:57:48 +0000 | |||
2161 | +++ src/UbuntuOneClient/UbuntuOneClient.csproj 2010-08-09 16:14:47 +0000 | |||
2162 | @@ -65,8 +65,6 @@ | |||
2163 | 65 | <Compile Include="..\Version.cs"> | 65 | <Compile Include="..\Version.cs"> |
2164 | 66 | <Link>Version.cs</Link> | 66 | <Link>Version.cs</Link> |
2165 | 67 | </Compile> | 67 | </Compile> |
2166 | 68 | <Compile Include="ApplicationWrapper.cs" /> | ||
2167 | 69 | <Compile Include="IApplication.cs" /> | ||
2168 | 70 | <Compile Include="Program.cs" /> | 68 | <Compile Include="Program.cs" /> |
2169 | 71 | <Compile Include="Properties\AssemblyInfo.cs"> | 69 | <Compile Include="Properties\AssemblyInfo.cs"> |
2170 | 72 | <SubType>Code</SubType> | 70 | <SubType>Code</SubType> |
2171 | 73 | 71 | ||
2172 | === modified file 'src/Version.cs' | |||
2173 | --- src/Version.cs 2010-08-04 14:20:36 +0000 | |||
2174 | +++ src/Version.cs 2010-08-09 16:14:47 +0000 | |||
2175 | @@ -10,6 +10,6 @@ | |||
2176 | 10 | // </auto-generated> | 10 | // </auto-generated> |
2177 | 11 | //------------------------------------------------------------------------------ | 11 | //------------------------------------------------------------------------------ |
2178 | 12 | 12 | ||
2181 | 13 | [assembly: AssemblyVersionAttribute("1.0.404.5869")] | 13 | [assembly: AssemblyVersionAttribute("1.0.409.6549")] |
2182 | 14 | [assembly: AssemblyFileVersionAttribute("1.0.404.5869")] | 14 | [assembly: AssemblyFileVersionAttribute("1.0.409.6549")] |
2183 | 15 | 15 |