Merge lp:~mandel/ubuntuone-windows-installer/add_preferences_dialog into lp:ubuntuone-windows-installer/beta

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 127
Merged at revision: 110
Proposed branch: lp:~mandel/ubuntuone-windows-installer/add_preferences_dialog
Merge into: lp:ubuntuone-windows-installer/beta
Prerequisite: lp:~mandel/ubuntuone-windows-installer/add_timer_execution
Diff against target: 2017 lines (+1462/-99)
30 files modified
lib/PhoenixControlLib/license.txt (+19/-0)
src/Canonical.UbuntuOne.Client.Views/AccountView.xaml (+74/-0)
src/Canonical.UbuntuOne.Client.Views/AccountView.xaml.cs (+64/-0)
src/Canonical.UbuntuOne.Client.Views/Canonical.UbuntuOne.Client.Views.csproj (+31/-0)
src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml (+40/-0)
src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml.cs (+39/-0)
src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml (+9/-8)
src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs (+23/-17)
src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml (+60/-5)
src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml.cs (+98/-29)
src/Canonical.UbuntuOne.Client.Views/Resources/Resources.resx (+96/-10)
src/Canonical.UbuntuOne.Client.Views/Resources/Resources1.Designer.cs (+224/-17)
src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml (+59/-0)
src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml.cs (+83/-0)
src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml (+41/-0)
src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml.cs (+66/-0)
src/Canonical.UbuntuOne.Client.Views/objects.xml (+6/-0)
src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj (+3/-0)
src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs (+5/-0)
src/Canonical.UbuntuOne.Client/Preferences/IPreferencesManager.cs (+42/-0)
src/Canonical.UbuntuOne.Client/Preferences/IPreferencesView.cs (+83/-0)
src/Canonical.UbuntuOne.Client/Preferences/PreferencesDialogPresenter.cs (+182/-0)
src/Canonical.UbuntuOne.Client/objects.xml (+5/-0)
src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs (+6/-7)
src/UbuntuOneClient/App.config (+14/-1)
src/UbuntuOneClient/PreferencesManager.cs (+45/-0)
src/UbuntuOneClient/Properties/Settings.Designer.cs (+24/-0)
src/UbuntuOneClient/Properties/Settings.settings (+10/-5)
src/UbuntuOneClient/UbuntuOneClient.csproj (+1/-0)
src/UbuntuOneClient/objects.xml (+10/-0)
To merge this branch: bzr merge lp:~mandel/ubuntuone-windows-installer/add_preferences_dialog
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+38315@code.launchpad.net

Description of the change

Adds a preferences dialog that allows to store the execution setting of the app.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'lib/PhoenixControlLib'
2=== added file 'lib/PhoenixControlLib/PhoenixControlLib.dll'
3Binary files lib/PhoenixControlLib/PhoenixControlLib.dll 1970-01-01 00:00:00 +0000 and lib/PhoenixControlLib/PhoenixControlLib.dll 2010-10-13 11:56:07 +0000 differ
4=== added file 'lib/PhoenixControlLib/license.txt'
5--- lib/PhoenixControlLib/license.txt 1970-01-01 00:00:00 +0000
6+++ lib/PhoenixControlLib/license.txt 2010-10-13 11:56:07 +0000
7@@ -0,0 +1,19 @@
8+Copyright (c) 2010, Daniel De Sousa (daniel@dandesousa.com)
9+
10+Permission is hereby granted, free of charge, to any person obtaining a copy
11+of this software and associated documentation files (the "Software"), to deal
12+in the Software without restriction, including without limitation the rights
13+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+copies of the Software, and to permit persons to whom the Software is
15+furnished to do so, subject to the following conditions:
16+
17+The above copyright notice and this permission notice shall be included in
18+all copies or substantial portions of the Software.
19+
20+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26+THE SOFTWARE.
27\ No newline at end of file
28
29=== added file 'src/Canonical.UbuntuOne.Client.Views/AccountView.xaml'
30--- src/Canonical.UbuntuOne.Client.Views/AccountView.xaml 1970-01-01 00:00:00 +0000
31+++ src/Canonical.UbuntuOne.Client.Views/AccountView.xaml 2010-10-13 11:56:07 +0000
32@@ -0,0 +1,74 @@
33+<!--
34+ * Copyright 2010 Canonical Ltd.
35+ *
36+ * This file is part of UbuntuOne on Windows.
37+ *
38+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
39+ * it under the terms of the GNU Lesser General Public License version
40+ * as published by the Free Software Foundation.
41+ *
42+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
43+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
44+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+ * GNU Lesser General Public License for more details.
46+ *
47+ * You should have received a copy of the GNU Lesser General Public License
48+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
49+ *
50+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
51+-->
52+<UserControl x:Class="Canonical.UbuntuOne.Client.Views.AccountView"
53+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
54+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
56+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
57+ xmlns:resx="clr-namespace:Canonical.UbuntuOne.Client.Views.Resources"
58+ mc:Ignorable="d"
59+ d:DesignHeight="300" d:DesignWidth="300">
60+ <Grid>
61+ <Grid.RowDefinitions>
62+ <RowDefinition Height="120" />
63+ <RowDefinition Height="*" />
64+ </Grid.RowDefinitions>
65+ <Grid Grid.Row="0">
66+ <Grid.RowDefinitions>
67+ <RowDefinition Height="38" />
68+ <RowDefinition Height="38" />
69+ <RowDefinition Height="38" />
70+ </Grid.RowDefinitions>
71+ <Grid Grid.Row="0">
72+ <Grid.ColumnDefinitions>
73+ <ColumnDefinition Width="*" />
74+ <ColumnDefinition Width="*" />
75+ </Grid.ColumnDefinitions>
76+ <Label Name="NameLabel" Grid.Column="0" Margin="3" Content="{x:Static resx:Resources.AccountViewNameLabel}" />
77+ <Label Name="NameContent" Grid.Column="1" Margin="3">Unknown</Label>
78+ </Grid>
79+ <Grid Grid.Row="1">
80+ <Grid.ColumnDefinitions>
81+ <ColumnDefinition Width="*" />
82+ <ColumnDefinition Width="*" />
83+ </Grid.ColumnDefinitions>
84+ <Label Name="EmailLabel" Grid.Column="0" Margin="3" Content="{x:Static resx:Resources.AccountViewEmailLabel}" />
85+ <Label Name="EmailContent" Grid.Column="1" Margin="3">Unknown</Label>
86+ </Grid>
87+ <Grid Grid.Row="2">
88+ <Grid.ColumnDefinitions>
89+ <ColumnDefinition Width="*" />
90+ <ColumnDefinition Width="*" />
91+ </Grid.ColumnDefinitions>
92+ <Label Name="CurrentPlanLabel" Grid.Column="0" Margin="3" Content="{x:Static resx:Resources.AccountViewCurrentPlanLabel}" />
93+ <Label Name="CurrentPlanContent" Grid.Column="1" Margin="3">Unknown</Label>
94+ </Grid>
95+ </Grid>
96+ <Grid Grid.Row="1">
97+ <Grid.RowDefinitions>
98+ <RowDefinition Height="38" />
99+ <RowDefinition Height="38" />
100+ <RowDefinition Height="*" />
101+ </Grid.RowDefinitions>
102+ <Label Name="ManageAccount" Grid.Row="0" Margin="3" Content="{x:Static resx:Resources.AccountViewManageAccountLabel}" />
103+ <Label Name="SupportOptions" Grid.Row="1" Margin="3" Content="{x:Static resx:Resources.AccountViewSupportOptionsLabel}" />
104+ </Grid>
105+ </Grid>
106+</UserControl>
107
108=== added file 'src/Canonical.UbuntuOne.Client.Views/AccountView.xaml.cs'
109--- src/Canonical.UbuntuOne.Client.Views/AccountView.xaml.cs 1970-01-01 00:00:00 +0000
110+++ src/Canonical.UbuntuOne.Client.Views/AccountView.xaml.cs 2010-10-13 11:56:07 +0000
111@@ -0,0 +1,64 @@
112+/*
113+ * Copyright 2010 Canonical Ltd.
114+ *
115+ * This file is part of UbuntuOne on Windows.
116+ *
117+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
118+ * it under the terms of the GNU Lesser General Public License version
119+ * as published by the Free Software Foundation.
120+ *
121+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
122+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
123+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
124+ * GNU Lesser General Public License for more details.
125+ *
126+ * You should have received a copy of the GNU Lesser General Public License
127+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
128+ *
129+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
130+ */
131+using System.Windows.Controls;
132+
133+namespace Canonical.UbuntuOne.Client.Views
134+{
135+ /// <summary>
136+ /// Interaction logic for AccountView.xaml
137+ /// </summary>
138+ public partial class AccountView : UserControl
139+ {
140+ #region Properties
141+
142+ /// <summary>
143+ /// Allows to set the name that will be displayed in the UI.
144+ /// </summary>
145+ public string UserName
146+ {
147+ set { NameContent.Content = value; }
148+ }
149+
150+ /// <summary>
151+ /// Allows to set the users email in the UI.
152+ /// </summary>
153+ public string Email
154+ {
155+ set { EmailContent.Content = value; }
156+ }
157+
158+ /// <summary>
159+ /// Allows to set the current plan of the user.
160+ /// </summary>
161+ public string CurrentPlan
162+ {
163+ set { CurrentPlanContent.Content = value; }
164+ }
165+
166+ #endregion
167+
168+ public AccountView()
169+ {
170+ InitializeComponent();
171+ }
172+
173+
174+ }
175+}
176
177=== modified file 'src/Canonical.UbuntuOne.Client.Views/Canonical.UbuntuOne.Client.Views.csproj'
178--- src/Canonical.UbuntuOne.Client.Views/Canonical.UbuntuOne.Client.Views.csproj 2010-10-13 11:56:06 +0000
179+++ src/Canonical.UbuntuOne.Client.Views/Canonical.UbuntuOne.Client.Views.csproj 2010-10-13 11:56:07 +0000
180@@ -62,6 +62,9 @@
181 <SpecificVersion>False</SpecificVersion>
182 <HintPath>..\..\lib\DotUpdater\DotUpdater.dll</HintPath>
183 </Reference>
184+ <Reference Include="PhoenixControlLib">
185+ <HintPath>..\..\lib\PhoenixControlLib\PhoenixControlLib.dll</HintPath>
186+ </Reference>
187 <Reference Include="System" />
188 <Reference Include="System.Core">
189 <RequiredTargetFramework>3.5</RequiredTargetFramework>
190@@ -80,6 +83,17 @@
191 <Reference Include="PresentationFramework" />
192 </ItemGroup>
193 <ItemGroup>
194+ <Compile Include="WindowsSettingsView.xaml.cs">
195+ <DependentUpon>WindowsSettingsView.xaml</DependentUpon>
196+ </Compile>
197+ <Page Include="AccountView.xaml">
198+ <SubType>Designer</SubType>
199+ <Generator>MSBuild:Compile</Generator>
200+ </Page>
201+ <Page Include="DevicesView.xaml">
202+ <SubType>Designer</SubType>
203+ <Generator>MSBuild:Compile</Generator>
204+ </Page>
205 <Page Include="NotifyIcon.xaml">
206 <Generator>MSBuild:Compile</Generator>
207 <SubType>Designer</SubType>
208@@ -92,6 +106,10 @@
209 <Generator>MSBuild:Compile</Generator>
210 <SubType>Designer</SubType>
211 </Page>
212+ <Page Include="ServicesView.xaml">
213+ <SubType>Designer</SubType>
214+ <Generator>MSBuild:Compile</Generator>
215+ </Page>
216 <Page Include="Update\DownloadingView.xaml">
217 <SubType>Designer</SubType>
218 <Generator>MSBuild:Compile</Generator>
219@@ -104,9 +122,19 @@
220 <Generator>MSBuild:Compile</Generator>
221 <SubType>Designer</SubType>
222 </Page>
223+ <Compile Include="AccountView.xaml.cs">
224+ <DependentUpon>AccountView.xaml</DependentUpon>
225+ </Compile>
226+ <Compile Include="DevicesView.xaml.cs">
227+ <DependentUpon>DevicesView.xaml</DependentUpon>
228+ </Compile>
229 <Compile Include="NotifyIcon.xaml.cs">
230 <DependentUpon>NotifyIcon.xaml</DependentUpon>
231 </Compile>
232+ <Page Include="WindowsSettingsView.xaml">
233+ <Generator>MSBuild:Compile</Generator>
234+ <SubType>Designer</SubType>
235+ </Page>
236 </ItemGroup>
237 <ItemGroup>
238 <Compile Include="Resources\Resources1.Designer.cs">
239@@ -114,6 +142,9 @@
240 <DesignTime>True</DesignTime>
241 <DependentUpon>Resources.resx</DependentUpon>
242 </Compile>
243+ <Compile Include="ServicesView.xaml.cs">
244+ <DependentUpon>ServicesView.xaml</DependentUpon>
245+ </Compile>
246 <Compile Include="UbuntuOneMessageBox.cs" />
247 <Compile Include="..\Version.cs">
248 <Link>Properties\Version.cs</Link>
249
250=== added file 'src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml'
251--- src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml 1970-01-01 00:00:00 +0000
252+++ src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml 2010-10-13 11:56:07 +0000
253@@ -0,0 +1,40 @@
254+<!--
255+ * Copyright 2010 Canonical Ltd.
256+ *
257+ * This file is part of UbuntuOne on Windows.
258+ *
259+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
260+ * it under the terms of the GNU Lesser General Public License version
261+ * as published by the Free Software Foundation.
262+ *
263+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
264+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
265+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
266+ * GNU Lesser General Public License for more details.
267+ *
268+ * You should have received a copy of the GNU Lesser General Public License
269+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
270+ *
271+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
272+-->
273+<UserControl x:Class="Canonical.UbuntuOne.Client.Views.DevicesView"
274+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
275+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
276+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
277+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
278+ xmlns:resx="clr-namespace:Canonical.UbuntuOne.Client.Views.Resources"
279+ mc:Ignorable="d"
280+ d:DesignHeight="300" d:DesignWidth="300">
281+ <Grid>
282+ <Grid.RowDefinitions>
283+ <RowDefinition Height="75" />
284+ <RowDefinition Height="*" />
285+ </Grid.RowDefinitions>
286+ <TextBlock Name="MessageText" Grid.Row="0" Margin="3" TextWrapping="Wrap" Text="{x:Static resx:Resources.DevicesViewMessageTextBlock}"/>
287+ <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
288+ <StackPanel Name="MachinesContent">
289+
290+ </StackPanel>
291+ </ScrollViewer>
292+ </Grid>
293+</UserControl>
294
295=== added file 'src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml.cs'
296--- src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml.cs 1970-01-01 00:00:00 +0000
297+++ src/Canonical.UbuntuOne.Client.Views/DevicesView.xaml.cs 2010-10-13 11:56:07 +0000
298@@ -0,0 +1,39 @@
299+/*
300+ * Copyright 2010 Canonical Ltd.
301+ *
302+ * This file is part of UbuntuOne on Windows.
303+ *
304+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
305+ * it under the terms of the GNU Lesser General Public License version
306+ * as published by the Free Software Foundation.
307+ *
308+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
309+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
310+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
311+ * GNU Lesser General Public License for more details.
312+ *
313+ * You should have received a copy of the GNU Lesser General Public License
314+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
315+ *
316+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
317+ */
318+using System.Windows.Controls;
319+
320+namespace Canonical.UbuntuOne.Client.Views
321+{
322+ /// <summary>
323+ /// Interaction logic for DevicesView.xaml
324+ /// </summary>
325+ public partial class DevicesView : UserControl
326+ {
327+ #region Properties
328+
329+
330+ #endregion
331+
332+ public DevicesView()
333+ {
334+ InitializeComponent();
335+ }
336+ }
337+}
338
339=== modified file 'src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml'
340--- src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml 2010-10-13 11:56:06 +0000
341+++ src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml 2010-10-13 11:56:07 +0000
342@@ -37,18 +37,19 @@
343 <ContextMenu>
344 <MenuItem x:Uid="UbuntuOneManualSync"
345 Name="UbuntuOneManualSync"
346- Header="{x:Static resx:Resources.UbuntuOneManualSync}"
347+ Header="{x:Static resx:Resources.NotificationIconUbuntuOneManualSyncLabel}"
348 Click="OnUbuntuOneManualSyncClick"/>
349 <MenuItem x:Uid="UbuntuOnePreferencesMenuItem"
350 Name="UbuntuOnePreferencesMenuItem"
351- Header="{x:Static resx:Resources.UbuntuOnePreferences}" />
352+ Header="{x:Static resx:Resources.NotificationIconUbuntuOnePreferencesLabel}"
353+ Click="OnUbuntuOnePreferencesMenuItemClick"/>
354 <MenuItem x:Uid="OpenShareManueItem"
355 Name="OpenShareManueItem"
356- Header="{x:Static resx:Resources.OpenShares}"
357+ Header="{x:Static resx:Resources.NotificationIconOpenSharesLabel}"
358 IsEnabled="False"/> <!-- TODO: open the shares when ever syncdaemon ha been ported-->
359 <MenuItem x:Uid="OpenSyncMenuItem"
360 Name="OpenSyncMenuItem"
361- Header="{x:Static resx:Resources.OpenSync}"
362+ Header="{x:Static resx:Resources.NotificationIconOpenSyncLabel}"
363 Click="OnOpenShareManueItemClick"/>
364 <Separator />
365 <MenuItem Name="StateMenuItem"
366@@ -60,19 +61,19 @@
367 <Separator />
368 <MenuItem x:Uid="RecentlyModifyFilesMenuItem"
369 Name="RecentlyModifyFilesMenuItem"
370- Header="{x:Static resx:Resources.RecentlyModifyFiles}" />
371+ Header="{x:Static resx:Resources.NotificationIconRecentlyModifyFilesLabel}" />
372 <Separator />
373 <MenuItem x:Uid="HelpMenuItem"
374 Name="HelpMenuItem"
375- Header="{x:Static resx:Resources.Help}"
376+ Header="{x:Static resx:Resources.NotificationIconHelpLabel}"
377 Click="OnHelpMenuItemClick"/>
378 <MenuItem x:Uid="MoreSpaceMenuItem"
379 Name="MoreSpaceMenuItem"
380- Header="{x:Static resx:Resources.MoreSpace}"
381+ Header="{x:Static resx:Resources.NotificationIconMoreSpaceLabel}"
382 Click="OnMoreSpaceMenuItemClick"/>
383 <MenuItem x:Uid="ExitMenuItem"
384 Name="ExitMenuItem"
385- Header="{x:Static resx:Resources.Exit}"
386+ Header="{x:Static resx:Resources.NotificationIconExitLabel}"
387 Click="OnExitMenuItemClick"/>
388 </ContextMenu>
389 </FrameworkElement.ContextMenu>
390
391=== modified file 'src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs'
392--- src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs 2010-10-13 11:56:06 +0000
393+++ src/Canonical.UbuntuOne.Client.Views/NotifyIcon.xaml.cs 2010-10-13 11:56:07 +0000
394@@ -1,20 +1,21 @@
395-// Copyright 2010 Canonical Ltd.
396-//
397-// This file is part of UbuntuOne on Windows.
398-//
399-// UbuntuOne on Windows is free software: you can redistribute it and/or modify
400-// it under the terms of the GNU Lesser General Public License version
401-// as published by the Free Software Foundation.
402-//
403-// Ubuntu One on Windows is distributed in the hope that it will be useful,
404-// but WITHOUT ANY WARRANTY; without even the implied warranty of
405-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
406-// GNU Lesser General Public License for more details.
407-//
408-// You should have received a copy of the GNU Lesser General Public License
409-// along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
410-//
411-// Authors: Manuel de la Peña <manuel.delapena@canonical.com>
412+/* Copyright 2010 Canonical Ltd.
413+ *
414+ * This file is part of UbuntuOne on Windows.
415+ *
416+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
417+ * it under the terms of the GNU Lesser General Public License version
418+ * as published by the Free Software Foundation.
419+ *
420+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
421+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
422+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
423+ * GNU Lesser General Public License for more details.
424+ *
425+ * You should have received a copy of the GNU Lesser General Public License
426+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
427+ *
428+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
429+ */
430 using System;
431 using System.Collections.Generic;
432 using Canonical.UbuntuOne.Client.Notification;
433@@ -109,5 +110,10 @@
434 NotificationIconPresenter.OpenSyncsLocation();
435 }
436
437+ private void OnUbuntuOnePreferencesMenuItemClick(object sender, System.Windows.RoutedEventArgs e)
438+ {
439+ NotificationIconPresenter.OpenUbuntuOnePreferences();
440+ }
441+
442 }
443 }
444
445=== modified file 'src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml'
446--- src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml 2010-07-27 15:36:33 +0000
447+++ src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml 2010-10-13 11:56:07 +0000
448@@ -1,8 +1,63 @@
449-<Window x:Class="Canonical.UbuntuOne.Client.Views.PreferencesDialog"
450+<!--
451+ * Copyright 2010 Canonical Ltd.
452+ *
453+ * This file is part of UbuntuOne on Windows.
454+ *
455+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
456+ * it under the terms of the GNU Lesser General Public License version
457+ * as published by the Free Software Foundation.
458+ *
459+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
460+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
461+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
462+ * GNU Lesser General Public License for more details.
463+ *
464+ * You should have received a copy of the GNU Lesser General Public License
465+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
466+ *
467+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
468+-->
469+<Window x:Class="Canonical.UbuntuOne.Client.Views.PreferencesDialog"
470 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
471- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
472- Title="PreferencesDialog" Height="300" Width="300">
473- <Grid>
474-
475+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
476+ xmlns:Views="clr-namespace:Canonical.UbuntuOne.Client.Views"
477+ xmlns:resx="clr-namespace:Canonical.UbuntuOne.Client.Views.Resources"
478+ Title="{x:Static resx:Resources.PreferencesDialogTitle}" Height="450" Width="300">
479+ <Grid Margin="3">
480+ <Grid.RowDefinitions>
481+ <RowDefinition Height="50" />
482+ <RowDefinition Height="*" />
483+ <RowDefinition Height="28" />
484+ </Grid.RowDefinitions>
485+ <Grid Grid.Row="0">
486+ <Grid.RowDefinitions>
487+ <RowDefinition Height="*" />
488+ <RowDefinition Height="*" />
489+ </Grid.RowDefinitions>
490+ <Grid>
491+ <Grid.ColumnDefinitions>
492+ <ColumnDefinition Width="*" />
493+ <ColumnDefinition Width="*" />
494+ </Grid.ColumnDefinitions>
495+ <ProgressBar Name="Progressbar" Grid.Column="0" HorizontalAlignment="Stretch" Margin="3" />
496+ <Label Name="ConsumptionLabel" Grid.Column="1">Unknown</Label>
497+ </Grid>
498+ <Label Name="StatusLabel" Grid.Row="1">Disconnected</Label>
499+ </Grid>
500+ <TabControl Margin="3" Grid.Row="1">
501+ <TabItem Header="{x:Static resx:Resources.PreferencesDialogWindowsTabHeader}">
502+ <Views:WindowsSettingsView x:Name="WindowsTab" Height="300" />
503+ </TabItem>
504+ <TabItem Header="{x:Static resx:Resources.PreferencesDialogAccountTabHeader}">
505+ <Views:AccountView x:Name="AccountsTab" Height="300" IsEnabled="False"/>
506+ </TabItem>
507+ <TabItem Header="{x:Static resx:Resources.PreferencesDialogDevicesTabHeader}" >
508+ <Views:DevicesView x:Name="DevicesTab" Height="300" IsEnabled="False"/>
509+ </TabItem>
510+ <TabItem Header="{x:Static resx:Resources.PreferencesDialogServicesTabHeader}" >
511+ <Views:ServicesView x:Name="ServicesTab" Height="300" IsEnabled="False"/>
512+ </TabItem>
513+ </TabControl>
514+ <Button Name="CloseButton" Grid.Row="2" HorizontalAlignment="Right" Width="75" Content="{x:Static resx:Resources.CloseButtonLabel}" Click="OnCloseButtonClick"/>
515 </Grid>
516 </Window>
517
518=== modified file 'src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml.cs'
519--- src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml.cs 2010-08-05 08:15:00 +0000
520+++ src/Canonical.UbuntuOne.Client.Views/PreferencesDialog.xaml.cs 2010-10-13 11:56:07 +0000
521@@ -1,40 +1,40 @@
522-// Copyright 2010 Canonical Ltd.
523-//
524-// This file is part of UbuntuOne on Windows.
525-//
526-// UbuntuOne on Windows is free software: you can redistribute it and/or modify
527-// it under the terms of the GNU Lesser General Public License version
528-// as published by the Free Software Foundation.
529-//
530-// Ubuntu One on Windows is distributed in the hope that it will be useful,
531-// but WITHOUT ANY WARRANTY; without even the implied warranty of
532-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
533-// GNU Lesser General Public License for more details.
534-//
535-// You should have received a copy of the GNU Lesser General Public License
536-// along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
537-//
538-// Authors: Manuel de la Peña <manuel.delapena@canonical.com>
539-using System;
540-using System.Collections.Generic;
541-using System.Linq;
542-using System.Text;
543+/* Copyright 2010 Canonical Ltd.
544+ *
545+ * This file is part of UbuntuOne on Windows.
546+ *
547+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
548+ * it under the terms of the GNU Lesser General Public License version
549+ * as published by the Free Software Foundation.
550+ *
551+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
552+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
553+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
554+ * GNU Lesser General Public License for more details.
555+ *
556+ * You should have received a copy of the GNU Lesser General Public License
557+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
558+ *
559+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
560+ */
561 using System.Windows;
562-using System.Windows.Controls;
563-using System.Windows.Data;
564-using System.Windows.Documents;
565-using System.Windows.Input;
566-using System.Windows.Media;
567-using System.Windows.Media.Imaging;
568-using System.Windows.Shapes;
569+using Canonical.UbuntuOne.Client.Preferences;
570
571 namespace Canonical.UbuntuOne.Client.Views
572 {
573 /// <summary>
574 /// Interaction logic for PreferencesDialog.xaml
575 /// </summary>
576- public partial class PreferencesDialog : Window
577+ public partial class PreferencesDialog : Window, IPreferencesView
578 {
579+ #region DI properties
580+
581+ /// <summary>
582+ /// Gets and sets the presenter that will be used by the view.
583+ /// </summary>
584+ public IPreferencesDialogPresenter PreferencesDialogPresenter { get; set; }
585+
586+ #endregion
587+
588 /// <summary>
589 /// Initializes a new instance of the PreferencesDialog class.
590 /// </summary>
591@@ -42,5 +42,74 @@
592 {
593 InitializeComponent();
594 }
595+
596+ public string UserName
597+ {
598+ set { AccountsTab.UserName = value; }
599+ }
600+
601+ public string Email
602+ {
603+ set { AccountsTab.Email = value; }
604+ }
605+
606+ public string CurrentPlan
607+ {
608+ set { AccountsTab.CurrentPlan = value; }
609+ }
610+
611+ public bool IsBookmarksSynced
612+ {
613+ get { return ServicesTab.IsBookmarksSynced; }
614+ set { ServicesTab.IsBookmarksSynced = value; }
615+ }
616+
617+ public bool IsBroadcastSynced
618+ {
619+ get { return ServicesTab.IsBroadcastSynced; }
620+ set { ServicesTab.IsBroadcastSynced = value; }
621+ }
622+
623+ public bool IsContactsSynced
624+ {
625+ get { return ServicesTab.IsContactsSynced; }
626+ set { ServicesTab.IsContactsSynced = value; }
627+ }
628+
629+ public bool IsFilesSynced
630+ {
631+ get { return ServicesTab.IsFilesSynced; }
632+ set { ServicesTab.IsFilesSynced = value; }
633+ }
634+
635+ public bool IsMusicSynced
636+ {
637+ get { return ServicesTab.IsMusicSynced; }
638+ set { ServicesTab.IsMusicSynced = value; }
639+ }
640+
641+ public bool IsAutoSyncEnable
642+ {
643+ get { return WindowsTab.IsAutoSyncEnable; }
644+ set { WindowsTab.IsAutoSyncEnable = value; }
645+ }
646+
647+ public double AutoSyncFrequency
648+ {
649+ get { return WindowsTab.AutoSyncFrequency; }
650+ set { WindowsTab.AutoSyncFrequency = value; }
651+ }
652+
653+ void IPreferencesView.ShowDialog()
654+ {
655+ ShowDialog();
656+ }
657+
658+ private void OnCloseButtonClick(object sender, RoutedEventArgs e)
659+ {
660+ Hide();
661+ // tell the presenter we are closing and that he needs to update the preferences
662+ PreferencesDialogPresenter.UpdatePreferences();
663+ }
664 }
665 }
666
667=== modified file 'src/Canonical.UbuntuOne.Client.Views/Resources/Resources.resx'
668--- src/Canonical.UbuntuOne.Client.Views/Resources/Resources.resx 2010-10-13 11:56:06 +0000
669+++ src/Canonical.UbuntuOne.Client.Views/Resources/Resources.resx 2010-10-13 11:56:07 +0000
670@@ -112,42 +112,128 @@
671 <value>2.0</value>
672 </resheader>
673 <resheader name="reader">
674- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
675+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
676 </resheader>
677 <resheader name="writer">
678- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
679+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
680 </resheader>
681+ <data name="AccountViewCurrentPlanLabel" xml:space="preserve">
682+ <value>Current plan:</value>
683+ <comment>The text ot be used in the label using to show the current plan in the accccont view.</comment>
684+ </data>
685+ <data name="AccountViewEmailLabel" xml:space="preserve">
686+ <value>E-mail:</value>
687+ <comment>The text to be used in the label that points to the email in the account view.</comment>
688+ </data>
689+ <data name="AccountViewManageAccountLabel" xml:space="preserve">
690+ <value>Manage account</value>
691+ <comment>The text to be used in the label that allows to manage the account in the account view.</comment>
692+ </data>
693+ <data name="AccountViewNameLabel" xml:space="preserve">
694+ <value>Name:</value>
695+ <comment>The text to be used in the label that shows the name of the user in the account view.</comment>
696+ </data>
697+ <data name="AccountViewSupportOptionsLabel" xml:space="preserve">
698+ <value>Support options</value>
699+ <comment>The text to be used in the label that allows to view the support options in the account view.</comment>
700+ </data>
701 <data name="ApplicationName" xml:space="preserve">
702 <value>Ubuntu One</value>
703+ <comment>The name of the application</comment>
704+ </data>
705+ <data name="AutoSyncMinutesLabel" xml:space="preserve">
706+ <value>minutes</value>
707+ </data>
708+ <data name="CloseButtonLabel" xml:space="preserve">
709+ <value>Close</value>
710+ </data>
711+ <data name="DevicesViewMessageTextBlock" xml:space="preserve">
712+ <value>The devices connected to with your personal cloud network are listed below.</value>
713+ <comment>The text block used to tell the user what he is seeing in the devices view.</comment>
714 </data>
715 <data name="DownloadingDialogTitle" xml:space="preserve">
716 <value>Downloading updates...</value>
717+ <comment>The title of the downloading dialog.</comment>
718 </data>
719- <data name="Exit" xml:space="preserve">
720+ <data name="NotificationIconExitLabel" xml:space="preserve">
721 <value>Exit</value>
722+ <comment>The title of the exit menu item.</comment>
723 </data>
724- <data name="Help" xml:space="preserve">
725+ <data name="NotificationIconHelpLabel" xml:space="preserve">
726 <value>Get Help and Support...</value>
727+ <comment>The title of the help menu item.</comment>
728 </data>
729- <data name="MoreSpace" xml:space="preserve">
730+ <data name="NotificationIconMoreSpaceLabel" xml:space="preserve">
731 <value>Add More Storage Space</value>
732+ <comment>The title of the menu item that allows to get more space.</comment>
733 </data>
734- <data name="OpenShares" xml:space="preserve">
735+ <data name="NotificationIconOpenSharesLabel" xml:space="preserve">
736 <value>Open Shared Folders</value>
737+ <comment>The title of the menu item that opens the shared folders.</comment>
738 </data>
739- <data name="OpenSync" xml:space="preserve">
740+ <data name="NotificationIconOpenSyncLabel" xml:space="preserve">
741 <value>Open Synced Folders</value>
742+ <comment>The title of the menu item that opens the sunced folders.</comment>
743 </data>
744- <data name="RecentlyModifyFiles" xml:space="preserve">
745+ <data name="NotificationIconRecentlyModifyFilesLabel" xml:space="preserve">
746 <value>Recently Modified Files</value>
747+ <comment>The title used to state the recety modified files.</comment>
748 </data>
749- <data name="UbuntuOneManualSync" xml:space="preserve">
750+ <data name="NotificationIconUbuntuOneManualSyncLabel" xml:space="preserve">
751 <value>Synchronize Now</value>
752+ <comment>The title of the menu item that allows to manually sync the machine.</comment>
753 </data>
754- <data name="UbuntuOnePreferences" xml:space="preserve">
755+ <data name="NotificationIconUbuntuOnePreferencesLabel" xml:space="preserve">
756 <value>Ubuntu One Preferences</value>
757+ <comment>The title of the menu item that allows to launch the ubuntu one preference.</comment>
758+ </data>
759+ <data name="PreferencesDialogAccountTabHeader" xml:space="preserve">
760+ <value>Account</value>
761+ </data>
762+ <data name="PreferencesDialogDevicesTabHeader" xml:space="preserve">
763+ <value>Devices</value>
764+ </data>
765+ <data name="PreferencesDialogServicesTabHeader" xml:space="preserve">
766+ <value>Services</value>
767+ </data>
768+ <data name="PreferencesDialogTitle" xml:space="preserve">
769+ <value>Preferences</value>
770+ </data>
771+ <data name="PreferencesDialogWindowsTabHeader" xml:space="preserve">
772+ <value>Windows</value>
773+ </data>
774+ <data name="ServicesViewBookmarksCheckbox" xml:space="preserve">
775+ <value>Bookmarks</value>
776+ </data>
777+ <data name="ServicesViewBroadcastCheckbox" xml:space="preserve">
778+ <value>Broadcast Messages Archive</value>
779+ </data>
780+ <data name="ServicesViewContactsCheckbox" xml:space="preserve">
781+ <value>Contacts</value>
782+ </data>
783+ <data name="ServicesViewFilesCheckbox" xml:space="preserve">
784+ <value>File Synchronization</value>
785+ </data>
786+ <data name="ServicesViewMusicCheckbox" xml:space="preserve">
787+ <value>Music Download</value>
788+ </data>
789+ <data name="ServicesViewSyncOptionsIntro" xml:space="preserve">
790+ <value>Choose services to synchronize with this computer.</value>
791+ </data>
792+ <data name="ServicesViewSyncOptionsLabel" xml:space="preserve">
793+ <value>Ubuntu One Sync options</value>
794 </data>
795 <data name="UpdatingDialogTitle" xml:space="preserve">
796 <value>Updating Ubuntu One...</value>
797+ <comment>The title of the dialog that updates ubuntu one.</comment>
798+ </data>
799+ <data name="WindowsSettingsAutoSyncOption" xml:space="preserve">
800+ <value>Auto sync.</value>
801+ </data>
802+ <data name="WindowsSettingsIntro" xml:space="preserve">
803+ <value>Set your specific windows options.</value>
804+ </data>
805+ <data name="WindowsSettingsTitleLabel" xml:space="preserve">
806+ <value>Windows options</value>
807 </data>
808 </root>
809\ No newline at end of file
810
811=== modified file 'src/Canonical.UbuntuOne.Client.Views/Resources/Resources1.Designer.cs'
812--- src/Canonical.UbuntuOne.Client.Views/Resources/Resources1.Designer.cs 2010-10-13 11:56:06 +0000
813+++ src/Canonical.UbuntuOne.Client.Views/Resources/Resources1.Designer.cs 2010-10-13 11:56:07 +0000
814@@ -61,6 +61,51 @@
815 }
816
817 /// <summary>
818+ /// Looks up a localized string similar to Current plan:.
819+ /// </summary>
820+ public static string AccountViewCurrentPlanLabel {
821+ get {
822+ return ResourceManager.GetString("AccountViewCurrentPlanLabel", resourceCulture);
823+ }
824+ }
825+
826+ /// <summary>
827+ /// Looks up a localized string similar to E-mail:.
828+ /// </summary>
829+ public static string AccountViewEmailLabel {
830+ get {
831+ return ResourceManager.GetString("AccountViewEmailLabel", resourceCulture);
832+ }
833+ }
834+
835+ /// <summary>
836+ /// Looks up a localized string similar to Manage account.
837+ /// </summary>
838+ public static string AccountViewManageAccountLabel {
839+ get {
840+ return ResourceManager.GetString("AccountViewManageAccountLabel", resourceCulture);
841+ }
842+ }
843+
844+ /// <summary>
845+ /// Looks up a localized string similar to Name:.
846+ /// </summary>
847+ public static string AccountViewNameLabel {
848+ get {
849+ return ResourceManager.GetString("AccountViewNameLabel", resourceCulture);
850+ }
851+ }
852+
853+ /// <summary>
854+ /// Looks up a localized string similar to Support options.
855+ /// </summary>
856+ public static string AccountViewSupportOptionsLabel {
857+ get {
858+ return ResourceManager.GetString("AccountViewSupportOptionsLabel", resourceCulture);
859+ }
860+ }
861+
862+ /// <summary>
863 /// Looks up a localized string similar to Ubuntu One.
864 /// </summary>
865 public static string ApplicationName {
866@@ -70,6 +115,33 @@
867 }
868
869 /// <summary>
870+ /// Looks up a localized string similar to minutes.
871+ /// </summary>
872+ public static string AutoSyncMinutesLabel {
873+ get {
874+ return ResourceManager.GetString("AutoSyncMinutesLabel", resourceCulture);
875+ }
876+ }
877+
878+ /// <summary>
879+ /// Looks up a localized string similar to Close.
880+ /// </summary>
881+ public static string CloseButtonLabel {
882+ get {
883+ return ResourceManager.GetString("CloseButtonLabel", resourceCulture);
884+ }
885+ }
886+
887+ /// <summary>
888+ /// Looks up a localized string similar to The devices connected to with your personal cloud network are listed below..
889+ /// </summary>
890+ public static string DevicesViewMessageTextBlock {
891+ get {
892+ return ResourceManager.GetString("DevicesViewMessageTextBlock", resourceCulture);
893+ }
894+ }
895+
896+ /// <summary>
897 /// Looks up a localized string similar to Downloading updates....
898 /// </summary>
899 public static string DownloadingDialogTitle {
900@@ -81,72 +153,180 @@
901 /// <summary>
902 /// Looks up a localized string similar to Exit.
903 /// </summary>
904- public static string Exit {
905+ public static string NotificationIconExitLabel {
906 get {
907- return ResourceManager.GetString("Exit", resourceCulture);
908+ return ResourceManager.GetString("NotificationIconExitLabel", resourceCulture);
909 }
910 }
911
912 /// <summary>
913 /// Looks up a localized string similar to Get Help and Support....
914 /// </summary>
915- public static string Help {
916+ public static string NotificationIconHelpLabel {
917 get {
918- return ResourceManager.GetString("Help", resourceCulture);
919+ return ResourceManager.GetString("NotificationIconHelpLabel", resourceCulture);
920 }
921 }
922
923 /// <summary>
924 /// Looks up a localized string similar to Add More Storage Space.
925 /// </summary>
926- public static string MoreSpace {
927+ public static string NotificationIconMoreSpaceLabel {
928 get {
929- return ResourceManager.GetString("MoreSpace", resourceCulture);
930+ return ResourceManager.GetString("NotificationIconMoreSpaceLabel", resourceCulture);
931 }
932 }
933
934 /// <summary>
935 /// Looks up a localized string similar to Open Shared Folders.
936 /// </summary>
937- public static string OpenShares {
938+ public static string NotificationIconOpenSharesLabel {
939 get {
940- return ResourceManager.GetString("OpenShares", resourceCulture);
941+ return ResourceManager.GetString("NotificationIconOpenSharesLabel", resourceCulture);
942 }
943 }
944
945 /// <summary>
946 /// Looks up a localized string similar to Open Synced Folders.
947 /// </summary>
948- public static string OpenSync {
949+ public static string NotificationIconOpenSyncLabel {
950 get {
951- return ResourceManager.GetString("OpenSync", resourceCulture);
952+ return ResourceManager.GetString("NotificationIconOpenSyncLabel", resourceCulture);
953 }
954 }
955
956 /// <summary>
957 /// Looks up a localized string similar to Recently Modified Files.
958 /// </summary>
959- public static string RecentlyModifyFiles {
960+ public static string NotificationIconRecentlyModifyFilesLabel {
961 get {
962- return ResourceManager.GetString("RecentlyModifyFiles", resourceCulture);
963+ return ResourceManager.GetString("NotificationIconRecentlyModifyFilesLabel", resourceCulture);
964 }
965 }
966
967 /// <summary>
968 /// Looks up a localized string similar to Synchronize Now.
969 /// </summary>
970- public static string UbuntuOneManualSync {
971+ public static string NotificationIconUbuntuOneManualSyncLabel {
972 get {
973- return ResourceManager.GetString("UbuntuOneManualSync", resourceCulture);
974+ return ResourceManager.GetString("NotificationIconUbuntuOneManualSyncLabel", resourceCulture);
975 }
976 }
977
978 /// <summary>
979 /// Looks up a localized string similar to Ubuntu One Preferences.
980 /// </summary>
981- public static string UbuntuOnePreferences {
982- get {
983- return ResourceManager.GetString("UbuntuOnePreferences", resourceCulture);
984+ public static string NotificationIconUbuntuOnePreferencesLabel {
985+ get {
986+ return ResourceManager.GetString("NotificationIconUbuntuOnePreferencesLabel", resourceCulture);
987+ }
988+ }
989+
990+ /// <summary>
991+ /// Looks up a localized string similar to Account.
992+ /// </summary>
993+ public static string PreferencesDialogAccountTabHeader {
994+ get {
995+ return ResourceManager.GetString("PreferencesDialogAccountTabHeader", resourceCulture);
996+ }
997+ }
998+
999+ /// <summary>
1000+ /// Looks up a localized string similar to Devices.
1001+ /// </summary>
1002+ public static string PreferencesDialogDevicesTabHeader {
1003+ get {
1004+ return ResourceManager.GetString("PreferencesDialogDevicesTabHeader", resourceCulture);
1005+ }
1006+ }
1007+
1008+ /// <summary>
1009+ /// Looks up a localized string similar to Services.
1010+ /// </summary>
1011+ public static string PreferencesDialogServicesTabHeader {
1012+ get {
1013+ return ResourceManager.GetString("PreferencesDialogServicesTabHeader", resourceCulture);
1014+ }
1015+ }
1016+
1017+ /// <summary>
1018+ /// Looks up a localized string similar to Preferences.
1019+ /// </summary>
1020+ public static string PreferencesDialogTitle {
1021+ get {
1022+ return ResourceManager.GetString("PreferencesDialogTitle", resourceCulture);
1023+ }
1024+ }
1025+
1026+ /// <summary>
1027+ /// Looks up a localized string similar to Windows.
1028+ /// </summary>
1029+ public static string PreferencesDialogWindowsTabHeader {
1030+ get {
1031+ return ResourceManager.GetString("PreferencesDialogWindowsTabHeader", resourceCulture);
1032+ }
1033+ }
1034+
1035+ /// <summary>
1036+ /// Looks up a localized string similar to Bookmarks.
1037+ /// </summary>
1038+ public static string ServicesViewBookmarksCheckbox {
1039+ get {
1040+ return ResourceManager.GetString("ServicesViewBookmarksCheckbox", resourceCulture);
1041+ }
1042+ }
1043+
1044+ /// <summary>
1045+ /// Looks up a localized string similar to Broadcast Messages Archive.
1046+ /// </summary>
1047+ public static string ServicesViewBroadcastCheckbox {
1048+ get {
1049+ return ResourceManager.GetString("ServicesViewBroadcastCheckbox", resourceCulture);
1050+ }
1051+ }
1052+
1053+ /// <summary>
1054+ /// Looks up a localized string similar to Contacts.
1055+ /// </summary>
1056+ public static string ServicesViewContactsCheckbox {
1057+ get {
1058+ return ResourceManager.GetString("ServicesViewContactsCheckbox", resourceCulture);
1059+ }
1060+ }
1061+
1062+ /// <summary>
1063+ /// Looks up a localized string similar to File Synchronization.
1064+ /// </summary>
1065+ public static string ServicesViewFilesCheckbox {
1066+ get {
1067+ return ResourceManager.GetString("ServicesViewFilesCheckbox", resourceCulture);
1068+ }
1069+ }
1070+
1071+ /// <summary>
1072+ /// Looks up a localized string similar to Music Download.
1073+ /// </summary>
1074+ public static string ServicesViewMusicCheckbox {
1075+ get {
1076+ return ResourceManager.GetString("ServicesViewMusicCheckbox", resourceCulture);
1077+ }
1078+ }
1079+
1080+ /// <summary>
1081+ /// Looks up a localized string similar to Choose services to synchronize with this computer..
1082+ /// </summary>
1083+ public static string ServicesViewSyncOptionsIntro {
1084+ get {
1085+ return ResourceManager.GetString("ServicesViewSyncOptionsIntro", resourceCulture);
1086+ }
1087+ }
1088+
1089+ /// <summary>
1090+ /// Looks up a localized string similar to Ubuntu One Sync options.
1091+ /// </summary>
1092+ public static string ServicesViewSyncOptionsLabel {
1093+ get {
1094+ return ResourceManager.GetString("ServicesViewSyncOptionsLabel", resourceCulture);
1095 }
1096 }
1097
1098@@ -158,5 +338,32 @@
1099 return ResourceManager.GetString("UpdatingDialogTitle", resourceCulture);
1100 }
1101 }
1102+
1103+ /// <summary>
1104+ /// Looks up a localized string similar to Auto sync..
1105+ /// </summary>
1106+ public static string WindowsSettingsAutoSyncOption {
1107+ get {
1108+ return ResourceManager.GetString("WindowsSettingsAutoSyncOption", resourceCulture);
1109+ }
1110+ }
1111+
1112+ /// <summary>
1113+ /// Looks up a localized string similar to Set your specific windows options..
1114+ /// </summary>
1115+ public static string WindowsSettingsIntro {
1116+ get {
1117+ return ResourceManager.GetString("WindowsSettingsIntro", resourceCulture);
1118+ }
1119+ }
1120+
1121+ /// <summary>
1122+ /// Looks up a localized string similar to Windows options.
1123+ /// </summary>
1124+ public static string WindowsSettingsTitleLabel {
1125+ get {
1126+ return ResourceManager.GetString("WindowsSettingsTitleLabel", resourceCulture);
1127+ }
1128+ }
1129 }
1130 }
1131
1132=== added file 'src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml'
1133--- src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml 1970-01-01 00:00:00 +0000
1134+++ src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml 2010-10-13 11:56:07 +0000
1135@@ -0,0 +1,59 @@
1136+<!--
1137+ * Copyright 2010 Canonical Ltd.
1138+ *
1139+ * This file is part of UbuntuOne on Windows.
1140+ *
1141+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1142+ * it under the terms of the GNU Lesser General Public License version
1143+ * as published by the Free Software Foundation.
1144+ *
1145+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1146+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1147+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1148+ * GNU Lesser General Public License for more details.
1149+ *
1150+ * You should have received a copy of the GNU Lesser General Public License
1151+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1152+ *
1153+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1154+-->
1155+<UserControl x:Class="Canonical.UbuntuOne.Client.Views.ServicesView"
1156+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1157+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
1158+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1159+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
1160+ xmlns:resx="clr-namespace:Canonical.UbuntuOne.Client.Views.Resources"
1161+ mc:Ignorable="d"
1162+ d:DesignHeight="300" d:DesignWidth="300">
1163+ <Grid>
1164+ <Grid.RowDefinitions>
1165+ <RowDefinition Height="75" />
1166+ <RowDefinition Height="*" />
1167+ </Grid.RowDefinitions>
1168+ <Grid Grid.Row="0">
1169+ <Grid.RowDefinitions>
1170+ <RowDefinition Height="38" />
1171+ <RowDefinition Height="*" />
1172+ </Grid.RowDefinitions>
1173+ <Label Name="SyncOptionsLabel" Grid.Row="0" Margin="3" Content="{x:Static resx:Resources.ServicesViewSyncOptionsLabel}"/>
1174+ <TextBlock Name="SyncOptionsIntro" Grid.Row="1" Margin="3" TextWrapping="Wrap" Text="{x:Static resx:Resources.ServicesViewSyncOptionsIntro}"/>
1175+ </Grid>
1176+ <Grid Grid.Row="1">
1177+ <Grid.RowDefinitions>
1178+ <RowDefinition Height="38" />
1179+ <RowDefinition Height="38" />
1180+ <RowDefinition Height="38" />
1181+ <RowDefinition Height="38" />
1182+ <RowDefinition Height="38" />
1183+ <RowDefinition Height="38" />
1184+ <RowDefinition Height="38" />
1185+ <RowDefinition Height="*" />
1186+ </Grid.RowDefinitions>
1187+ <CheckBox Name="BookmarksCheckbox" Grid.Row="0" Margin="3" VerticalAlignment="Center" Content="{x:Static resx:Resources.ServicesViewBookmarksCheckbox}"/>
1188+ <CheckBox Name="BroadcastCheckbox" Grid.Row="1" Margin="3" VerticalAlignment="Center" Content="{x:Static resx:Resources.ServicesViewBroadcastCheckbox}"/>
1189+ <CheckBox Name="ContactsCheckbox" Grid.Row="2" Margin="3" VerticalAlignment="Center" Content="{x:Static resx:Resources.ServicesViewContactsCheckbox}"/>
1190+ <CheckBox Name="FilesCheckbox" Grid.Row="3" Margin="3" VerticalAlignment="Center" Content="{x:Static resx:Resources.ServicesViewFilesCheckbox}"/>
1191+ <CheckBox Name="MusicCheckbox" Grid.Row="4" Margin="18 3 3 3" VerticalAlignment="Center" Content="{x:Static resx:Resources.ServicesViewMusicCheckbox}"/>
1192+ </Grid>
1193+ </Grid>
1194+</UserControl>
1195
1196=== added file 'src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml.cs'
1197--- src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml.cs 1970-01-01 00:00:00 +0000
1198+++ src/Canonical.UbuntuOne.Client.Views/ServicesView.xaml.cs 2010-10-13 11:56:07 +0000
1199@@ -0,0 +1,83 @@
1200+/*
1201+ * Copyright 2010 Canonical Ltd.
1202+ *
1203+ * This file is part of UbuntuOne on Windows.
1204+ *
1205+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1206+ * it under the terms of the GNU Lesser General Public License version
1207+ * as published by the Free Software Foundation.
1208+ *
1209+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1210+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1211+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212+ * GNU Lesser General Public License for more details.
1213+ *
1214+ * You should have received a copy of the GNU Lesser General Public License
1215+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1216+ *
1217+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1218+ */
1219+using System.Windows.Controls;
1220+
1221+namespace Canonical.UbuntuOne.Client.Views
1222+{
1223+ /// <summary>
1224+ /// Interaction logic for ServicesView.xaml
1225+ /// </summary>
1226+ public partial class ServicesView : UserControl
1227+ {
1228+ #region Properties
1229+
1230+ /// <summary>
1231+ /// Allows to get and set if the bookmarks are synced.
1232+ /// </summary>
1233+ public bool IsBookmarksSynced
1234+ {
1235+ get { return BookmarksCheckbox.IsChecked.Value; }
1236+ set { BookmarksCheckbox.IsChecked = true; }
1237+ }
1238+
1239+ /// <summary>
1240+ /// Allows to get or set if the broadcast is synced.
1241+ /// </summary>
1242+ public bool IsBroadcastSynced
1243+ {
1244+ get { return BroadcastCheckbox.IsChecked.Value; }
1245+ set { BroadcastCheckbox.IsChecked = value; }
1246+ }
1247+
1248+ /// <summary>
1249+ /// Allows to get and set if the contacts are synced.
1250+ /// </summary>
1251+ public bool IsContactsSynced
1252+ {
1253+ get { return ContactsCheckbox.IsChecked.Value; }
1254+ set { ContactsCheckbox.IsChecked = value; }
1255+ }
1256+
1257+ /// <summary>
1258+ /// Allows to get and set if the files re synced.
1259+ /// </summary>
1260+ public bool IsFilesSynced
1261+ {
1262+ get { return FilesCheckbox.IsChecked.Value; }
1263+ set { FilesCheckbox.IsChecked = value; }
1264+ }
1265+
1266+ /// <summary>
1267+ /// Allows to get and set if the music is synced.
1268+ /// </summary>
1269+ public bool IsMusicSynced
1270+ {
1271+ get { return MusicCheckbox.IsChecked.Value; }
1272+ set { MusicCheckbox.IsChecked = value; }
1273+ }
1274+
1275+ #endregion
1276+
1277+ public ServicesView()
1278+ {
1279+ InitializeComponent();
1280+ }
1281+ }
1282+}
1283
1284=== added file 'src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml'
1285--- src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml 1970-01-01 00:00:00 +0000
1286+++ src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml 2010-10-13 11:56:07 +0000
1287@@ -0,0 +1,41 @@
1288+<UserControl x:Class="Canonical.UbuntuOne.Client.Views.WindowsSettingsView"
1289+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1290+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
1291+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1292+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
1293+ xmlns:pcl="clr-namespace:PhoenixControlLib;assembly=PhoenixControlLib"
1294+ xmlns:resx="clr-namespace:Canonical.UbuntuOne.Client.Views.Resources"
1295+ mc:Ignorable="d"
1296+ d:DesignHeight="300" d:DesignWidth="300">
1297+ <Grid>
1298+ <Grid.RowDefinitions>
1299+ <RowDefinition Height="75" />
1300+ <RowDefinition Height="*" />
1301+ </Grid.RowDefinitions>
1302+ <Grid Grid.Row="0">
1303+ <Grid.RowDefinitions>
1304+ <RowDefinition Height="38" />
1305+ <RowDefinition Height="*" />
1306+ </Grid.RowDefinitions>
1307+ <Label Name="WindowsSettingsTitleLabel" Grid.Row="0" Margin="3" Content="{x:Static resx:Resources.WindowsSettingsTitleLabel}"/>
1308+ <TextBlock Name="WindowsSettingsIntro" Grid.Row="1" Margin="3" TextWrapping="Wrap" Text="{x:Static resx:Resources.WindowsSettingsIntro}"/>
1309+ </Grid>
1310+ <Grid Grid.Row="1">
1311+ <Grid.RowDefinitions>
1312+ <RowDefinition Height="38" />
1313+ <RowDefinition Height="*" />
1314+ </Grid.RowDefinitions>
1315+ <Grid Grid.Row="0">
1316+ <Grid.ColumnDefinitions>
1317+ <ColumnDefinition Width="*"/>
1318+ <ColumnDefinition Width="100"/>
1319+ <ColumnDefinition Width="*"/>
1320+ </Grid.ColumnDefinitions>
1321+ <CheckBox Name="AutoSyncOption" Grid.Column="0" Margin="3" VerticalAlignment="Center" Content="{x:Static resx:Resources.WindowsSettingsAutoSyncOption}" Checked="OnAutoSyncOptionChecked" Unchecked="OnAutoSyncOptionUnchecked"/>
1322+ <pcl:NumericSpinnerControl x:Name="AutoSyncFrequencySpinner" Grid.Column="1" Width="100" Minimum="0" Value="1" IncrementValue="1" IsEnabled="False"/>
1323+ <Label Name="AutoSyncMinutesLabel" Grid.Column="2" Margin="3" Content="{x:Static resx:Resources.AutoSyncMinutesLabel}"/>
1324+ </Grid>
1325+
1326+ </Grid>
1327+ </Grid>
1328+</UserControl>
1329
1330=== added file 'src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml.cs'
1331--- src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml.cs 1970-01-01 00:00:00 +0000
1332+++ src/Canonical.UbuntuOne.Client.Views/WindowsSettingsView.xaml.cs 2010-10-13 11:56:07 +0000
1333@@ -0,0 +1,66 @@
1334+/*
1335+ * Copyright 2010 Canonical Ltd.
1336+ *
1337+ * This file is part of UbuntuOne on Windows.
1338+ *
1339+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1340+ * it under the terms of the GNU Lesser General Public License version
1341+ * as published by the Free Software Foundation.
1342+ *
1343+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1344+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1345+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1346+ * GNU Lesser General Public License for more details.
1347+ *
1348+ * You should have received a copy of the GNU Lesser General Public License
1349+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1350+ *
1351+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1352+ */
1353+using System.Windows.Controls;
1354+
1355+namespace Canonical.UbuntuOne.Client.Views
1356+{
1357+ /// <summary>
1358+ /// Interaction logic for WindowsSettingsView.xaml
1359+ /// </summary>
1360+ public partial class WindowsSettingsView : UserControl
1361+ {
1362+ #region Properties
1363+
1364+ /// <summary>
1365+ /// Allows to get and set if the autosync does occur.
1366+ /// </summary>
1367+ public bool IsAutoSyncEnable
1368+ {
1369+ get { return AutoSyncOption.IsChecked.Value; }
1370+ set { AutoSyncOption.IsChecked = value; }
1371+ }
1372+
1373+ /// <summary>
1374+ /// Allows to get and set the frequency used in the atosync.
1375+ /// </summary>
1376+ public double AutoSyncFrequency
1377+ {
1378+ get { return AutoSyncFrequencySpinner.Value*60; }
1379+ set { AutoSyncFrequencySpinner.Value = value/60; }
1380+ }
1381+
1382+ #endregion
1383+
1384+ public WindowsSettingsView()
1385+ {
1386+ InitializeComponent();
1387+ }
1388+
1389+ private void OnAutoSyncOptionChecked(object sender, System.Windows.RoutedEventArgs e)
1390+ {
1391+ AutoSyncFrequencySpinner.IsEnabled = true;
1392+ }
1393+
1394+ private void OnAutoSyncOptionUnchecked(object sender, System.Windows.RoutedEventArgs e)
1395+ {
1396+ AutoSyncFrequencySpinner.IsEnabled = false;
1397+ }
1398+ }
1399+}
1400
1401=== modified file 'src/Canonical.UbuntuOne.Client.Views/objects.xml'
1402--- src/Canonical.UbuntuOne.Client.Views/objects.xml 2010-08-30 17:30:31 +0000
1403+++ src/Canonical.UbuntuOne.Client.Views/objects.xml 2010-10-13 11:56:07 +0000
1404@@ -13,6 +13,12 @@
1405 ref="NotificationIconPresenter" />
1406 </object>
1407
1408+ <object id="PreferencesView"
1409+ type="Canonical.UbuntuOne.Client.Views.PreferencesDialog, Canonical.UbuntuOne.Client.Views" >
1410+ <property name="PreferencesDialogPresenter"
1411+ ref="PreferencesDialogPresenter" />
1412+ </object>
1413+
1414 <object id="MessageBox"
1415 type="Canonical.UbuntuOne.Client.Views.UbuntuOneMessageBox, Canonical.UbuntuOne.Client.Views" />
1416 </objects>
1417\ No newline at end of file
1418
1419=== modified file 'src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj'
1420--- src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj 2010-10-13 11:56:06 +0000
1421+++ src/Canonical.UbuntuOne.Client/Canonical.UbuntuOne.Client.csproj 2010-10-13 11:56:07 +0000
1422@@ -89,6 +89,9 @@
1423 <Compile Include="Notification\INotificationIconPresenter.cs" />
1424 <Compile Include="Notification\NotificationEventArgs.cs" />
1425 <Compile Include="Preferences\IPreferencesDialogPresenter.cs" />
1426+ <Compile Include="Preferences\IPreferencesManager.cs" />
1427+ <Compile Include="Preferences\IPreferencesView.cs" />
1428+ <Compile Include="Preferences\PreferencesDialogPresenter.cs" />
1429 <Compile Include="Properties\AssemblyInfo.cs" />
1430 <Compile Include="SyncDaemonClient.cs" />
1431 </ItemGroup>
1432
1433=== modified file 'src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs'
1434--- src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs 2010-08-05 08:01:59 +0000
1435+++ src/Canonical.UbuntuOne.Client/Preferences/IPreferencesDialogPresenter.cs 2010-10-13 11:56:07 +0000
1436@@ -26,5 +26,10 @@
1437 /// Shows the dialog to the user.
1438 /// </summary>
1439 void Show();
1440+
1441+ /// <summary>
1442+ /// Updates the preferences that the user will use in the application.
1443+ /// </summary>
1444+ void UpdatePreferences();
1445 }
1446 }
1447
1448=== added file 'src/Canonical.UbuntuOne.Client/Preferences/IPreferencesManager.cs'
1449--- src/Canonical.UbuntuOne.Client/Preferences/IPreferencesManager.cs 1970-01-01 00:00:00 +0000
1450+++ src/Canonical.UbuntuOne.Client/Preferences/IPreferencesManager.cs 2010-10-13 11:56:07 +0000
1451@@ -0,0 +1,42 @@
1452+/* Copyright 2010 Canonical Ltd.
1453+ *
1454+ * This file is part of UbuntuOne on Windows.
1455+ *
1456+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1457+ * it under the terms of the GNU Lesser General Public License version
1458+ * as published by the Free Software Foundation.
1459+ *
1460+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1461+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1462+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1463+ * GNU Lesser General Public License for more details.
1464+ *
1465+ * You should have received a copy of the GNU Lesser General Public License
1466+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1467+ *
1468+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1469+ */
1470+namespace Canonical.UbuntuOne.Client.Preferences
1471+{
1472+ /// <summary>
1473+ /// Interface to be implemented by an object that know how to serialize and deserialize the preferences
1474+ /// of a user.
1475+ /// </summary>
1476+ public interface IPreferencesManager
1477+ {
1478+ /// <summary>
1479+ /// Allows to get or set if the autosync is enabled.
1480+ /// </summary>
1481+ bool IsAutoSyncEnable { get; set; }
1482+
1483+ /// <summary>
1484+ /// Allows to get and sets the autosync frequency used.
1485+ /// </summary>
1486+ double AutoSyncFrequency { get; set; }
1487+
1488+ /// <summary>
1489+ /// Allows to save the preferences in the system.
1490+ /// </summary>
1491+ void Save();
1492+ }
1493+}
1494
1495=== added file 'src/Canonical.UbuntuOne.Client/Preferences/IPreferencesView.cs'
1496--- src/Canonical.UbuntuOne.Client/Preferences/IPreferencesView.cs 1970-01-01 00:00:00 +0000
1497+++ src/Canonical.UbuntuOne.Client/Preferences/IPreferencesView.cs 2010-10-13 11:56:07 +0000
1498@@ -0,0 +1,83 @@
1499+/*
1500+ * Copyright 2010 Canonical Ltd.
1501+ *
1502+ * This file is part of UbuntuOne on Windows.
1503+ *
1504+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1505+ * it under the terms of the GNU Lesser General Public License version
1506+ * as published by the Free Software Foundation.
1507+ *
1508+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1509+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1510+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1511+ * GNU Lesser General Public License for more details.
1512+ *
1513+ * You should have received a copy of the GNU Lesser General Public License
1514+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1515+ *
1516+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1517+ */
1518+namespace Canonical.UbuntuOne.Client.Preferences
1519+{
1520+ /// <summary>
1521+ /// Interface to be implemented by those UI components that are used to display the Ubuntu One
1522+ /// preferences.
1523+ /// </summary>
1524+ public interface IPreferencesView
1525+ {
1526+ /// <summary>
1527+ /// Allows to set the name that will be displayed in the UI.
1528+ /// </summary>
1529+ string UserName { set; }
1530+
1531+ /// <summary>
1532+ /// Allows to set the users email in the UI.
1533+ /// </summary>
1534+ string Email { set; }
1535+
1536+ /// <summary>
1537+ /// Allows to set the current plan of the user.
1538+ /// </summary>
1539+ string CurrentPlan { set; }
1540+
1541+ /// <summary>
1542+ /// Allows to get and set if the bookmarks are synced.
1543+ /// </summary>
1544+ bool IsBookmarksSynced { get; set; }
1545+
1546+ /// <summary>
1547+ /// Allows to get or set if the broadcast is synced.
1548+ /// </summary>
1549+ bool IsBroadcastSynced { get; set; }
1550+
1551+ /// <summary>
1552+ /// Allows to get and set if the contacts are synced.
1553+ /// </summary>
1554+ bool IsContactsSynced { get; set; }
1555+
1556+ /// <summary>
1557+ /// Allows to get and set if the files re synced.
1558+ /// </summary>
1559+ bool IsFilesSynced { get; set; }
1560+
1561+ /// <summary>
1562+ /// Allows to get and set if the music is synced.
1563+ /// </summary>
1564+ bool IsMusicSynced { get; set; }
1565+
1566+ /// <summary>
1567+ /// Allows to get and set if the autosync does occur.
1568+ /// </summary>
1569+ bool IsAutoSyncEnable { get; set; }
1570+
1571+ /// <summary>
1572+ /// Allows to get and set the frequency used in the atosync.
1573+ /// </summary>
1574+ double AutoSyncFrequency { get; set; }
1575+
1576+ /// <summary>
1577+ /// Tell the view to show itself as a dialog.
1578+ /// </summary>
1579+ void ShowDialog();
1580+ }
1581+}
1582
1583=== added file 'src/Canonical.UbuntuOne.Client/Preferences/PreferencesDialogPresenter.cs'
1584--- src/Canonical.UbuntuOne.Client/Preferences/PreferencesDialogPresenter.cs 1970-01-01 00:00:00 +0000
1585+++ src/Canonical.UbuntuOne.Client/Preferences/PreferencesDialogPresenter.cs 2010-10-13 11:56:07 +0000
1586@@ -0,0 +1,182 @@
1587+/* Copyright 2010 Canonical Ltd.
1588+ *
1589+ * This file is part of UbuntuOne on Windows.
1590+ *
1591+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1592+ * it under the terms of the GNU Lesser General Public License version
1593+ * as published by the Free Software Foundation.
1594+ *
1595+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1596+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1597+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1598+ * GNU Lesser General Public License for more details.
1599+ *
1600+ * You should have received a copy of the GNU Lesser General Public License
1601+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1602+ *
1603+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1604+ */
1605+using System;
1606+using System.IO;
1607+using System.ServiceModel;
1608+using Canonical.Ubuntu.SSO;
1609+using Canonical.UbuntuOne.Common;
1610+using Canonical.UbuntuOne.Common.Net;
1611+using log4net;
1612+
1613+namespace Canonical.UbuntuOne.Client.Preferences
1614+{
1615+ /// <summary>
1616+ /// Presneter that manages the Preferences UI.
1617+ /// </summary>
1618+ internal class PreferencesDialogPresenter : IPreferencesDialogPresenter
1619+ {
1620+ #region Variables
1621+
1622+ private ISSOCredentialsProvider _ssoProvider;
1623+ private ILog _logger;
1624+ private readonly object _loggerLock = new object();
1625+
1626+ #endregion
1627+
1628+ #region Properties
1629+
1630+ /// <summary>
1631+ /// Gets and sets the logger used by the class.
1632+ /// </summary>
1633+ internal ILog Logger
1634+ {
1635+ get
1636+ {
1637+ if (_logger == null)
1638+ {
1639+ lock (_loggerLock)
1640+ {
1641+ _logger = LogManager.GetLogger(typeof(PreferencesDialogPresenter));
1642+ }
1643+ }
1644+ return _logger;
1645+ }
1646+ set { _logger = value; }
1647+ }
1648+ #endregion
1649+
1650+ #region DI Properties
1651+
1652+ /// <summary>
1653+ /// Gets and sets the view used by this presenter.
1654+ /// </summary>
1655+ public IPreferencesView PreferencesView { get; set; }
1656+
1657+ /// <summary>
1658+ /// Gets and sets the preferences manager used to ensure that the user has its preferences
1659+ /// stored.
1660+ /// </summary>
1661+ public IPreferencesManager PreferencesManager { get; set; }
1662+
1663+ /// <summary>
1664+ /// Gets and sets the channel factory that can be used to create communication objects that are used to
1665+ /// interact with the sync daemon.
1666+ /// </summary>
1667+ public ChannelFactory<ISyncDaemon> SyncDaemonChannelFactory { get; set; }
1668+
1669+ /// <summary>
1670+ /// Gets and sets the service caller that is used to do the house keeping when calling a service.
1671+ /// </summary>
1672+ public IServiceCaller ServiceCaller { get; set; }
1673+
1674+ /// <summary>
1675+ /// Gets and sets the provider that will return the credentials used in ubuntu one.
1676+ /// </summary>
1677+ public ISSOCredentialsProvider SSOCredentialsProvider
1678+ {
1679+ get { return _ssoProvider; }
1680+ set
1681+ {
1682+ if (value == null) return;
1683+ _ssoProvider = value;
1684+ _ssoProvider.OnCredentialsFound += OnCredentialsFound;
1685+ _ssoProvider.OnCredentialsError += OnCredentialsError;
1686+ _ssoProvider.OnCredetialsDenied += OnCredentialsDenied;
1687+ }
1688+ }
1689+
1690+ /// <summary>
1691+ /// Gets and sets the message box used to send messages to the user.
1692+ /// </summary>
1693+ public IMessageBox MessageBox { get; set; }
1694+
1695+ #endregion
1696+
1697+ #region Helpers
1698+
1699+
1700+ /// <summary>
1701+ /// Helper method executed when the provider did return new credentials.
1702+ /// </summary>
1703+ /// <param name="sender"></param>
1704+ /// <param name="args"></param>
1705+ private void OnCredentialsFound(object sender, CredentialsFoundEventArgs args)
1706+ {
1707+ // check if the credentials are for us
1708+ if (args.ApplicationName != "UbuntuOne") return;
1709+ Logger.Info("Got the UbuntuOne credentials!");
1710+ var oneDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
1711+ "UbuntuOne");
1712+ // ensure that the path can be handled by the python code
1713+ oneDir = oneDir.Replace("\\", "\\\\");
1714+ // call the ISyncService to perform the manual sync
1715+
1716+ var syncServiceChannel = SyncDaemonChannelFactory.CreateChannel();
1717+ ServiceCaller.SaveProxyCall(
1718+ () => syncServiceChannel.EnableManualSyncAutoExecution(
1719+ oneDir,
1720+ args.Credentials["Token"],
1721+ args.Credentials["TokenSecret"],
1722+ args.Credentials["ConsumerKey"],
1723+ args.Credentials["ConsumerSecret"],
1724+ (int)PreferencesManager.AutoSyncFrequency),
1725+ (ICommunicationObject)syncServiceChannel);
1726+ }
1727+
1728+ private void OnCredentialsDenied(object sender, CredentialsDeniedEventArgs args)
1729+ {
1730+
1731+ MessageBox.ShowWarning("You need to login to be able to sync your files.");
1732+ }
1733+
1734+ private void OnCredentialsError(object sender, CredentialsErrorEventArgs args)
1735+ {
1736+ MessageBox.ShowError("An error courred when trying to retrieve your credentials.");
1737+ }
1738+ #endregion
1739+
1740+ public void Show()
1741+ {
1742+ // set the preferences to be shown in the UI.
1743+ PreferencesView.IsAutoSyncEnable = PreferencesManager.IsAutoSyncEnable;
1744+ if (PreferencesManager.IsAutoSyncEnable)
1745+ PreferencesView.AutoSyncFrequency = PreferencesManager.AutoSyncFrequency;
1746+ PreferencesView.ShowDialog();
1747+ }
1748+
1749+ public void UpdatePreferences()
1750+ {
1751+ PreferencesManager.IsAutoSyncEnable = PreferencesView.IsAutoSyncEnable;
1752+ if (PreferencesView.IsAutoSyncEnable)
1753+ {
1754+ PreferencesManager.AutoSyncFrequency = PreferencesView.AutoSyncFrequency;
1755+ // we get the credentials, because we have register an action to the credetials aquired, we do nothing besides this
1756+ SSOCredentialsProvider.LoginToGetCredentials();
1757+ }
1758+ else
1759+ {
1760+ // we call to disable the autosync, the service knows what to do
1761+ var syncServiceChannel = SyncDaemonChannelFactory.CreateChannel();
1762+ ServiceCaller.SaveProxyCall(syncServiceChannel.DisableManualSyncAutoExecution,
1763+ (ICommunicationObject)syncServiceChannel);
1764+ }
1765+ PreferencesManager.Save();
1766+ }
1767+ }
1768+}
1769
1770=== modified file 'src/Canonical.UbuntuOne.Client/objects.xml'
1771--- src/Canonical.UbuntuOne.Client/objects.xml 2010-10-05 15:20:36 +0000
1772+++ src/Canonical.UbuntuOne.Client/objects.xml 2010-10-13 11:56:07 +0000
1773@@ -4,4 +4,9 @@
1774 <object id="NotificationIconPresenter"
1775 type="Canonical.UbuntuOne.Client.Notification.NotificationIconPresenter, Canonical.UbuntuOne.Client"
1776 autowire="autodetect"/>
1777+
1778+ <object id="PreferencesDialogPresenter"
1779+ type="Canonical.UbuntuOne.Client.Preferences.PreferencesDialogPresenter, Canonical.UbuntuOne.Client"
1780+ autowire="autodetect"/>
1781+
1782 </objects>
1783\ No newline at end of file
1784
1785=== modified file 'src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs'
1786--- src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs 2010-10-13 11:56:06 +0000
1787+++ src/Canonical.UbuntuOne.ProcessDispatcher/SyncDaemonService.cs 2010-10-13 11:56:07 +0000
1788@@ -121,7 +121,7 @@
1789 private readonly object _autoManualSyncThreadLock = new object();
1790 private Thread _autoManualSyncThread;
1791 private bool _isAutoManualSync;
1792- private readonly object _isAutoManualSyncLock;
1793+ private readonly object _isAutoManualSyncLock = new object();
1794
1795 #endregion
1796
1797@@ -224,6 +224,7 @@
1798
1799 // we got the number of seconds, therefor multiple by 1000 the value
1800 manualSyncTimer.Interval = state.Seconds*1000;
1801+ manualSyncTimer.Enabled = true;
1802 //stay here forever until we are killed
1803 while (IsAutoManualSync)
1804 {
1805@@ -377,8 +378,7 @@
1806 var initCommand = String.Format("{0} --init \"{1}\" --oauth {2}",
1807 Path.Combine(u1SyncPath, "main.exe"),
1808 path, tokens);
1809- Logger.DebugFormat("Executing {0} as user {1}", initCommand,
1810- ServiceSecurityContext.Current.WindowsIdentity.Name);
1811+ Logger.DebugFormat("Executing {0} as user.", initCommand);
1812
1813 //init the directory
1814 var init = new Process
1815@@ -405,8 +405,6 @@
1816
1817 }
1818 var syncCommand = String.Format("{0} --oauth {1}", Path.Combine(u1SyncPath, "main.exe"), tokens);
1819- Logger.DebugFormat("Executing {0} as user {1}", syncCommand,
1820- ServiceSecurityContext.Current.WindowsIdentity.Name);
1821 var proc = new Process
1822 {
1823 StartInfo =
1824@@ -417,13 +415,14 @@
1825 UseShellExecute = false,
1826 RedirectStandardOutput = true,
1827 RedirectStandardError = true,
1828- CreateNoWindow = false,
1829+ CreateNoWindow = true,
1830 WindowStyle = ProcessWindowStyle.Hidden
1831 }
1832 };
1833 proc.Start();
1834 // we wait, we are in a diff thread in a diff process this will not block the user UI
1835 proc.WaitForExit();
1836+ var error = proc.StandardError.ReadToEnd();
1837 Logger.InfoFormat("StandarOutput from u1sync is: {0}", proc.StandardOutput.ReadToEnd());
1838 Logger.ErrorFormat("StandardError from u1sync is: {0}", proc.StandardError.ReadToEnd());
1839 proc.Close();
1840@@ -448,7 +447,7 @@
1841 // we set var to tell that we are going to perform the auto execution
1842 IsAutoManualSync = true;
1843 // we create the tread
1844- AutoManualSyncThread = new Thread(AutoManualSync);
1845+ AutoManualSyncThread = new Thread(AutoManualSync) {Name = "AutoManualSyncThread"};
1846 AutoManualSyncThread.Start(state);
1847 }
1848
1849
1850=== modified file 'src/UbuntuOneClient/App.config'
1851--- src/UbuntuOneClient/App.config 2010-10-13 11:56:06 +0000
1852+++ src/UbuntuOneClient/App.config 2010-10-13 11:56:07 +0000
1853@@ -9,6 +9,9 @@
1854 <sectionGroup name="common">
1855 <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging"/>
1856 </sectionGroup>
1857+ <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
1858+ <section name="UbuntuOneClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
1859+ </sectionGroup>
1860 </configSections>
1861
1862 <!-- logging configuration -->
1863@@ -40,4 +43,14 @@
1864 </context>
1865
1866 </spring>
1867-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
1868+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><userSettings>
1869+ <UbuntuOneClient.Properties.Settings>
1870+ <setting name="IsAutoSyncEnabled" serializeAs="String">
1871+ <value>False</value>
1872+ </setting>
1873+ <setting name="AutoSyncFrequency" serializeAs="String">
1874+ <value>10</value>
1875+ </setting>
1876+ </UbuntuOneClient.Properties.Settings>
1877+ </userSettings>
1878+</configuration>
1879
1880=== added file 'src/UbuntuOneClient/PreferencesManager.cs'
1881--- src/UbuntuOneClient/PreferencesManager.cs 1970-01-01 00:00:00 +0000
1882+++ src/UbuntuOneClient/PreferencesManager.cs 2010-10-13 11:56:07 +0000
1883@@ -0,0 +1,45 @@
1884+/* Copyright 2010 Canonical Ltd.
1885+ *
1886+ * This file is part of UbuntuOne on Windows.
1887+ *
1888+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
1889+ * it under the terms of the GNU Lesser General Public License version
1890+ * as published by the Free Software Foundation.
1891+ *
1892+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
1893+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1894+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1895+ * GNU Lesser General Public License for more details.
1896+ *
1897+ * You should have received a copy of the GNU Lesser General Public License
1898+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
1899+ *
1900+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
1901+ */
1902+using Canonical.UbuntuOne.Client.Preferences;
1903+
1904+namespace UbuntuOneClient
1905+{
1906+ /// <summary>
1907+ /// Process manager that allows to manage the prefenrences for the current user.
1908+ /// </summary>
1909+ public class PreferencesManager : IPreferencesManager
1910+ {
1911+ public bool IsAutoSyncEnable
1912+ {
1913+ get { return Properties.Settings.Default.IsAutoSyncEnabled; }
1914+ set { Properties.Settings.Default.IsAutoSyncEnabled = value; }
1915+ }
1916+
1917+ public double AutoSyncFrequency
1918+ {
1919+ get { return Properties.Settings.Default.AutoSyncFrequency; }
1920+ set { Properties.Settings.Default.AutoSyncFrequency = value; }
1921+ }
1922+
1923+ public void Save()
1924+ {
1925+ Properties.Settings.Default.Save();
1926+ }
1927+ }
1928+}
1929
1930=== modified file 'src/UbuntuOneClient/Properties/Settings.Designer.cs'
1931--- src/UbuntuOneClient/Properties/Settings.Designer.cs 2010-10-13 11:56:06 +0000
1932+++ src/UbuntuOneClient/Properties/Settings.Designer.cs 2010-10-13 11:56:07 +0000
1933@@ -22,5 +22,29 @@
1934 return defaultInstance;
1935 }
1936 }
1937+
1938+ [global::System.Configuration.UserScopedSettingAttribute()]
1939+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1940+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
1941+ public bool IsAutoSyncEnabled {
1942+ get {
1943+ return ((bool)(this["IsAutoSyncEnabled"]));
1944+ }
1945+ set {
1946+ this["IsAutoSyncEnabled"] = value;
1947+ }
1948+ }
1949+
1950+ [global::System.Configuration.UserScopedSettingAttribute()]
1951+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1952+ [global::System.Configuration.DefaultSettingValueAttribute("10")]
1953+ public double AutoSyncFrequency {
1954+ get {
1955+ return ((double)(this["AutoSyncFrequency"]));
1956+ }
1957+ set {
1958+ this["AutoSyncFrequency"] = value;
1959+ }
1960+ }
1961 }
1962 }
1963
1964=== modified file 'src/UbuntuOneClient/Properties/Settings.settings'
1965--- src/UbuntuOneClient/Properties/Settings.settings 2010-07-27 14:19:43 +0000
1966+++ src/UbuntuOneClient/Properties/Settings.settings 2010-10-13 11:56:07 +0000
1967@@ -1,7 +1,12 @@
1968 <?xml version='1.0' encoding='utf-8'?>
1969-<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
1970- <Profiles>
1971- <Profile Name="(Default)" />
1972- </Profiles>
1973- <Settings />
1974+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UbuntuOneClient.Properties" GeneratedClassName="Settings">
1975+ <Profiles />
1976+ <Settings>
1977+ <Setting Name="IsAutoSyncEnabled" Type="System.Boolean" Scope="User">
1978+ <Value Profile="(Default)">False</Value>
1979+ </Setting>
1980+ <Setting Name="AutoSyncFrequency" Type="System.Double" Scope="User">
1981+ <Value Profile="(Default)">10</Value>
1982+ </Setting>
1983+ </Settings>
1984 </SettingsFile>
1985\ No newline at end of file
1986
1987=== modified file 'src/UbuntuOneClient/UbuntuOneClient.csproj'
1988--- src/UbuntuOneClient/UbuntuOneClient.csproj 2010-10-13 11:56:06 +0000
1989+++ src/UbuntuOneClient/UbuntuOneClient.csproj 2010-10-13 11:56:07 +0000
1990@@ -91,6 +91,7 @@
1991 <Compile Include="..\Version.cs">
1992 <Link>Properties\Version.cs</Link>
1993 </Compile>
1994+ <Compile Include="PreferencesManager.cs" />
1995 <Compile Include="Program.cs" />
1996 <Compile Include="Properties\AssemblyInfo.cs">
1997 <SubType>Code</SubType>
1998
1999=== modified file 'src/UbuntuOneClient/objects.xml'
2000--- src/UbuntuOneClient/objects.xml 2010-10-13 11:56:06 +0000
2001+++ src/UbuntuOneClient/objects.xml 2010-10-13 11:56:07 +0000
2002@@ -58,6 +58,16 @@
2003 </object>
2004
2005 <!-- ############################################################### -->
2006+ <!-- Define settings manager. -->
2007+ <!-- ############################################################### -->
2008+
2009+ <object id="PreferencesManager"
2010+ type="UbuntuOneClient.PreferencesManager, UbuntuOneClient"
2011+ autowire="autodetect" >
2012+ </object>
2013+
2014+
2015+ <!-- ############################################################### -->
2016 <!-- WCF services configuration -->
2017 <!-- ############################################################### -->
2018

Subscribers

People subscribed via source and target branches

to all changes: