Browse files

Upgraded DropBox to use OAuth.

Always log user out first for SkyDrive and DropBox to clear cookies.
  • Loading branch information...
1 parent 90782a9 commit 3875ea5f7dee46aba0d1283240f35faeb78d76f4 @7Pass committed Jan 11, 2012
Showing with 223 additions and 35,432 deletions.
  1. +12 −14 KeePass/KeePass.csproj
  2. +1 −1 KeePass/Sources/Download.xaml.cs
  3. +0 −61 KeePass/Sources/DropBox/DropBox.xaml
  4. +0 −101 KeePass/Sources/DropBox/DropBox.xaml.cs
  5. +25 −0 KeePass/Sources/DropBox/DropBoxAuth.xaml
  6. +55 −0 KeePass/Sources/DropBox/DropBoxAuth.xaml.cs
  7. +1 −1 KeePass/Sources/DropBox/DropBoxInfo.cs
  8. +3 −3 KeePass/Sources/DropBox/List.xaml
  9. +35 −21 KeePass/Sources/DropBox/List.xaml.cs
  10. +23 −4 KeePass/Sources/DropBox/MetaListItemInfo.cs
  11. +12 −14 KeePass/Sources/SkyDrive/List.xaml
  12. +29 −26 KeePass/Sources/SkyDrive/List.xaml.cs
  13. +1 −3 KeePass/Sources/SkyDrive/LiveAuth.xaml
  14. +4 −19 KeePass/Sources/SkyDrive/LiveAuth.xaml.cs
  15. +1 −4 KeePass/packages.config
  16. BIN Libs/DropNet.WindowsPhone.dll
  17. BIN {packages/Newtonsoft.Json.4.0.5/lib/sl3-wp → Libs}/Newtonsoft.Json.dll
  18. 0 {packages/Newtonsoft.Json.4.0.5/lib/sl4-windowsphone71 → Libs}/Newtonsoft.Json.xml
  19. BIN Libs/RestSharp.WindowsPhone.dll
  20. +21 −0 README.de
  21. BIN packages/Coding4Fun.Phone.Controls.1.4.8/Coding4Fun.Phone.Controls.1.4.8.nupkg
  22. BIN packages/Coding4Fun.Phone.Controls.1.4.8/lib/Coding4Fun.Phone.Controls.dll
  23. BIN packages/Coding4Fun.Phone.Controls.1.5.1/Coding4Fun.Phone.Controls.1.5.1.nupkg
  24. BIN packages/Coding4Fun.Phone.Controls.1.5.1/lib/Coding4Fun.Phone.Controls.dll
  25. BIN packages/DropNet.1.6/DropNet.1.6.nupkg
  26. BIN packages/DropNet.1.6/lib/net35/DropNet.dll
  27. BIN packages/DropNet.1.6/lib/sl3-wp/DropNet.WindowsPhone.dll
  28. BIN packages/DropNet.1.6/lib/sl4-WindowsPhone71/DropNet.WindowsPhone.dll
  29. BIN packages/Newtonsoft.Json.4.0.5/Newtonsoft.Json.4.0.5.nupkg
  30. BIN packages/Newtonsoft.Json.4.0.5/lib/net20/Newtonsoft.Json.dll
  31. BIN packages/Newtonsoft.Json.4.0.5/lib/net20/Newtonsoft.Json.pdb
  32. +0 −7,859 packages/Newtonsoft.Json.4.0.5/lib/net20/Newtonsoft.Json.xml
  33. BIN packages/Newtonsoft.Json.4.0.5/lib/net35/Newtonsoft.Json.dll
  34. BIN packages/Newtonsoft.Json.4.0.5/lib/net35/Newtonsoft.Json.pdb
  35. +0 −6,982 packages/Newtonsoft.Json.4.0.5/lib/net35/Newtonsoft.Json.xml
  36. BIN packages/Newtonsoft.Json.4.0.5/lib/net40/Newtonsoft.Json.dll
  37. BIN packages/Newtonsoft.Json.4.0.5/lib/net40/Newtonsoft.Json.pdb
  38. +0 −7,141 packages/Newtonsoft.Json.4.0.5/lib/net40/Newtonsoft.Json.xml
  39. BIN packages/Newtonsoft.Json.4.0.5/lib/sl3-wp/Newtonsoft.Json.pdb
  40. +0 −6,574 packages/Newtonsoft.Json.4.0.5/lib/sl3-wp/Newtonsoft.Json.xml
  41. BIN packages/Newtonsoft.Json.4.0.5/lib/sl4-windowsphone71/Newtonsoft.Json.dll
  42. BIN packages/Newtonsoft.Json.4.0.5/lib/sl4-windowsphone71/Newtonsoft.Json.pdb
  43. BIN packages/Newtonsoft.Json.4.0.5/lib/sl4/Newtonsoft.Json.dll
  44. BIN packages/Newtonsoft.Json.4.0.5/lib/sl4/Newtonsoft.Json.pdb
  45. +0 −6,604 packages/Newtonsoft.Json.4.0.5/lib/sl4/Newtonsoft.Json.xml
  46. BIN packages/RestSharp.102.5/RestSharp.102.5.nupkg
  47. BIN packages/RestSharp.102.5/lib/net35-client/RestSharp.dll
  48. BIN packages/RestSharp.102.5/lib/net35/RestSharp.dll
  49. BIN packages/RestSharp.102.5/lib/sl3-wp/RestSharp.WindowsPhone.dll
  50. BIN packages/RestSharp.102.5/lib/sl4-wp71/RestSharp.WindowsPhone.dll
  51. BIN packages/RestSharp.102.5/lib/sl4/RestSharp.Silverlight.dll
View
26 KeePass/KeePass.csproj
@@ -106,12 +106,11 @@
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Coding4Fun.Phone.Controls, Version=1.4.8.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\Coding4Fun.Phone.Controls.1.4.8\lib\Coding4Fun.Phone.Controls.dll</HintPath>
- </Reference>
- <Reference Include="DropNet.WindowsPhone, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\DropNet.1.6\lib\sl4-WindowsPhone71\DropNet.WindowsPhone.dll</HintPath>
+ <Reference Include="Coding4Fun.Phone.Controls, Version=1.5.1.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Coding4Fun.Phone.Controls.1.5.1\lib\Coding4Fun.Phone.Controls.dll</HintPath>
</Reference>
+ <Reference Include="DropNet.WindowsPhone, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Phone" />
<Reference Include="Microsoft.Phone.Controls, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Phone.Controls.Toolkit, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b772ad94eb9ca604, processorArchitecture=MSIL">
@@ -121,12 +120,11 @@
<Reference Include="NavigationListControl">
<HintPath>..\Libs\NavigationListControl.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.4.0.5\lib\sl4-windowsphone71\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="RestSharp.WindowsPhone, Version=102.5.0.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\RestSharp.102.5\lib\sl4-wp71\RestSharp.WindowsPhone.dll</HintPath>
+ <Reference Include="Newtonsoft.Json, Version=4.0.4.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\Libs\Newtonsoft.Json.dll</HintPath>
</Reference>
+ <Reference Include="RestSharp.WindowsPhone, Version=102.5.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="SharpZipLib.Silverlight4">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\SL4\SharpZipLib.Silverlight4.dll</HintPath>
</Reference>
@@ -249,6 +247,9 @@
</Compile>
<Compile Include="Sources\DatabaseUpdater.cs" />
<Compile Include="Sources\DropBox\DropBoxAdapter.cs" />
+ <Compile Include="Sources\DropBox\DropBoxAuth.xaml.cs">
+ <DependentUpon>DropBoxAuth.xaml</DependentUpon>
+ </Compile>
<Compile Include="Sources\IServiceAdapter.cs" />
<Compile Include="Sources\ListItem.cs" />
<Compile Include="Sources\ServiceAdapterBase.cs" />
@@ -285,9 +286,6 @@
</Compile>
<Compile Include="Sources\SyncCompleteInfo.cs" />
<Compile Include="Sources\SyncInfo.cs" />
- <Compile Include="Sources\DropBox\DropBox.xaml.cs">
- <DependentUpon>DropBox.xaml</DependentUpon>
- </Compile>
<Compile Include="Sources\DropBox\List.xaml.cs">
<DependentUpon>List.xaml</DependentUpon>
</Compile>
@@ -449,7 +447,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Sources\DropBox\DropBox.xaml">
+ <Page Include="Sources\DropBox\DropBoxAuth.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
View
2 KeePass/Sources/Download.xaml.cs
@@ -66,7 +66,7 @@ private void lnkDemo_Click(object sender, EventArgs e)
private void lnkDropBox_Click(object sender, RoutedEventArgs e)
{
AnalyticsTracker.Track("new_db", "dropbox");
- Navigate<DropBox.DropBox>();
+ Navigate<DropBox.DropBoxAuth>();
}
private void lnkSkyDrive_Click(object sender, RoutedEventArgs e)
View
61 KeePass/Sources/DropBox/DropBox.xaml
@@ -1,61 +0,0 @@
-<keepass:KeePassPage
- x:Class="KeePass.Sources.DropBox.DropBox"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
- xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
- xmlns:keepass="clr-namespace:KeePass.Utils"
- xmlns:uc="clr-namespace:KeePass.Controls"
- Style="{StaticResource KeePassPage}">
-
- <Grid x:Name="LayoutRoot" Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
-
- <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
- <TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}"
- Style="{StaticResource PhoneTextNormalStyle}"/>
- <TextBlock x:Name="PageTitle" Text="DropBox" Margin="9,-7,0,0"
- Style="{StaticResource PhoneTextTitle1Style}"/>
- </StackPanel>
-
- <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <TextBlock Text="{Binding Path=Strings.DropBox_Email, Source={StaticResource UiStrings}}"
- Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
- Style="{StaticResource PhoneTextNormalStyle}" />
- <TextBox Name="txtEmail" InputScope="EmailSmtpAddress" Grid.Row="0" Grid.Column="1"
- TextChanged="txt_Changed" Loaded="txtEmail_Loaded" KeyDown="txtEmail_KeyDown" />
-
- <TextBlock Text="{Binding Path=Strings.DropBox_Password, Source={StaticResource UiStrings}}"
- Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
- Style="{StaticResource PhoneTextNormalStyle}" />
- <PasswordBox Name="txtPassword" Grid.Row="1" Grid.Column="1"
- PasswordChanged="txt_Changed" KeyDown="txtPassword_KeyDown" />
- </Grid>
-
- <uc:ProgressOverlay x:Name="progBusy" />
- </Grid>
- </Grid>
-
- <phone:PhoneApplicationPage.ApplicationBar>
- <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
- <shell:ApplicationBarIconButton
- IconUri="/Images/check.png" Text="[Login]"
- Click="cmdLogin_Click" IsEnabled="False" />
- </shell:ApplicationBar>
- </phone:PhoneApplicationPage.ApplicationBar>
-
-</keepass:KeePassPage>
View
101 KeePass/Sources/DropBox/DropBox.xaml.cs
@@ -1,101 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Input;
-using DropNet;
-using DropNet.Exceptions;
-using DropNet.Models;
-using KeePass.I18n;
-using KeePass.Utils;
-using Microsoft.Phone.Shell;
-
-namespace KeePass.Sources.DropBox
-{
- public partial class DropBox
- {
- private readonly ApplicationBarIconButton _cmdOpen;
-
- public DropBox()
- {
- InitializeComponent();
-
- _cmdOpen = AppButton(0);
- _cmdOpen.Text = Strings.DropBox_Login;
- }
-
- private void LoginCompleted(UserLogin info)
- {
- Dispatcher.BeginInvoke(() =>
- {
- progBusy.IsBusy = false;
-
- txtPassword.Password = string.Empty;
-
- var folder = NavigationContext
- .QueryString["folder"];
-
- this.NavigateTo<List>(
- "token={0}&secret={1}&path=/&folder={2}",
- info.Token, info.Secret, folder);
- });
- }
-
- private void LoginFailed(DropboxException ex)
- {
- Dispatcher.BeginInvoke(() =>
- {
- progBusy.IsBusy = false;
-
- MessageBox.Show(DropBoxResources.LoginFailure,
- DropBoxResources.LoginTitle,
- MessageBoxButton.OK);
-
- txtEmail.Focus();
- txtEmail.SelectAll();
- });
- }
-
- private void PerformLogin()
- {
- if (!Network.CheckNetwork())
- return;
-
- progBusy.IsBusy = true;
-
- var client = new DropNetClient(
- DropBoxInfo.KEY, DropBoxInfo.SECRET);
-
- client.LoginAsync(txtEmail.Text, txtPassword.Password,
- LoginCompleted, LoginFailed);
- }
-
- private void cmdLogin_Click(object sender, EventArgs e)
- {
- PerformLogin();
- }
-
- private void txtEmail_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.IsEnter())
- txtPassword.Focus();
- }
-
- private void txtEmail_Loaded(object sender, RoutedEventArgs e)
- {
- txtEmail.Focus();
- }
-
- private void txtPassword_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.IsEnter())
- PerformLogin();
- }
-
- private void txt_Changed(object sender, EventArgs e)
- {
- var hasData = txtEmail.Text.Length > 0 &&
- txtPassword.Password.Length > 0;
-
- _cmdOpen.IsEnabled = hasData;
- }
- }
-}
View
25 KeePass/Sources/DropBox/DropBoxAuth.xaml
@@ -0,0 +1,25 @@
+<keepass:KeePassPage
+ x:Class="KeePass.Sources.DropBox.DropBoxAuth"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:keepass="clr-namespace:KeePass.Utils"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ Style="{StaticResource KeePassPage}">
+
+ <Grid x:Name="LayoutRoot" Background="Transparent">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
+ <TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}"
+ Style="{StaticResource PhoneTextNormalStyle}"/>
+ </StackPanel>
+
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
+ <phone:WebBrowser Name="browser" IsScriptEnabled="True"
+ Loaded="browser_Loaded" Navigating="browser_Navigating" />
+ </Grid>
+ </Grid>
+</keepass:KeePassPage>
View
55 KeePass/Sources/DropBox/DropBoxAuth.xaml.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Net;
+using System.Windows;
+using DropNet;
+using KeePass.Utils;
+using Microsoft.Phone.Controls;
+
+namespace KeePass.Sources.DropBox
+{
+ public partial class DropBoxAuth
+ {
+ private const string CALL_BACK = "http://7pass.wordpress.com";
+ private readonly DropNetClient _client;
+
+ public DropBoxAuth()
+ {
+ InitializeComponent();
+
+ _client = DropBoxInfo.Create();
+ }
+
+ private void CheckToken()
+ {
+ _client.GetAccessTokenAsync(x =>
+ {
+ var folder = NavigationContext
+ .QueryString["folder"];
+
+ this.NavigateTo<List>(
+ "token={0}&secret={1}&folder={2}",
+ x.Token, x.Secret, folder);
+ }, ex => { throw ex; });
+ }
+
+ private void browser_Loaded(object sender, RoutedEventArgs e)
+ {
+ _client.GetTokenAsync(x =>
+ {
+ var url = _client.BuildAuthorizeUrl(x, CALL_BACK);
+
+ url = "https://www.dropbox.com/logout?cont=" +
+ HttpUtility.UrlEncode(url);
+
+ Dispatcher.BeginInvoke(() =>
+ browser.Navigate(new Uri(url)));
+ }, ex => { throw ex; });
+ }
+
+ private void browser_Navigating(object sender, NavigatingEventArgs e)
+ {
+ if (e.Uri.ToString().StartsWith(CALL_BACK))
+ CheckToken();
+ }
+ }
+}
View
2 KeePass/Sources/DropBox/DropBoxInfo.cs
@@ -5,7 +5,7 @@ namespace KeePass.Sources.DropBox
{
internal static class DropBoxInfo
{
- // Your DropBox info is needed
+#warning Your DropBox info is needed
public const string KEY = "YOUR_KEY";
public const string SECRET = "YOUR_SECRET";
View
6 KeePass/Sources/DropBox/List.xaml
@@ -21,9 +21,9 @@
Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
- <Grid Grid.Row="1" Margin="12,0,12,0">
- <uc:KeePassList x:Name="lstBrowse"
- SelectionChanged="lstBrowse_SelectionChanged" />
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
+ <uc:KeePassList x:Name="lstItems"
+ SelectionChanged="lstItems_SelectionChanged" />
<uc:ProgressOverlay x:Name="progBusy" />
</Grid>
</Grid>
View
56 KeePass/Sources/DropBox/List.xaml.cs
@@ -53,28 +53,29 @@ private void InitPars()
{
var pars = NavigationContext.QueryString;
- _path = pars["path"];
+ _path = "/";
_token = pars["token"];
_folder = pars["folder"];
_secret = pars["secret"];
}
private void NavigateTo(string path)
{
- this.NavigateTo<List>(
- "token={0}&secret={1}&path={2}&folder={3}",
- _token, _secret, path, _folder);
+ _path = path;
+ RefreshList();
}
private void OnFileDownloadFailed(DropboxException obj)
{
- progBusy.IsBusy = false;
-
Dispatcher.BeginInvoke(() =>
+ {
+ progBusy.IsBusy = false;
+
MessageBox.Show(
DropBoxResources.DownloadError,
DropBoxResources.ListTitle,
- MessageBoxButton.OK));
+ MessageBoxButton.OK);
+ });
}
private void OnFileDownloaded(byte[] file,
@@ -141,7 +142,19 @@ private void OnListComplete(MetaData data)
.Select(x => new MetaListItemInfo(x))
.ToList();
- lstBrowse.SetItems(items);
+ if (data.Path != "/")
+ {
+ var sepIndex = data.Path.LastIndexOf(
+ "/", StringComparison.Ordinal);
+
+ if (sepIndex == 0)
+ sepIndex = 1;
+
+ var grandParent = data.Path.Remove(sepIndex);
+ items.Insert(0, new MetaListItemInfo(grandParent));
+ }
+
+ lstItems.SetItems(items);
}
finally
{
@@ -180,7 +193,7 @@ private void cmdRefresh_Click(object sender, EventArgs e)
RefreshList();
}
- private void lstBrowse_SelectionChanged(object sender,
+ private void lstItems_SelectionChanged(object sender,
NavigationListControl.NavigationEventArgs e)
{
var meta = e.Item as MetaListItemInfo;
@@ -192,20 +205,21 @@ private void cmdRefresh_Click(object sender, EventArgs e)
return;
if (meta.IsDir)
- NavigateTo(meta.Path);
- else
{
- progBusy.IsBusy = true;
+ NavigateTo(meta.Path);
+ return;
+ }
+
+ progBusy.IsBusy = true;
- var client = DropBoxInfo
- .Create(_token, _secret);
+ var client = DropBoxInfo
+ .Create(_token, _secret);
- var url = client.GetUrl(meta.Path);
- client.GetFileAsync(meta.Path,
- x => OnFileDownloaded(x.RawBytes, url,
- meta.Title, meta.Modified),
- OnFileDownloadFailed);
- }
+ var url = client.GetUrl(meta.Path);
+ client.GetFileAsync(meta.Path,
+ x => OnFileDownloaded(x.RawBytes, url,
+ meta.Title, meta.Modified),
+ OnFileDownloadFailed);
}
}
-}
+}
View
27 KeePass/Sources/DropBox/MetaListItemInfo.cs
@@ -6,15 +6,21 @@
namespace KeePass.Sources.DropBox
{
- internal class MetaListItemInfo : ListItemInfo
+ internal interface IListItem
{
- private readonly bool _idDir;
+ bool IsDir { get; }
+ string Path { get; }
+ }
+
+ internal class MetaListItemInfo : ListItemInfo, IListItem
+ {
+ private readonly bool _isDir;
private readonly string _modified;
private readonly string _path;
public bool IsDir
{
- get { return _idDir; }
+ get { return _isDir; }
}
public string Modified
@@ -33,7 +39,7 @@ public MetaListItemInfo(MetaData data)
throw new ArgumentNullException("data");
_path = data.Path;
- _idDir = data.Is_Dir;
+ _isDir = data.Is_Dir;
_modified = data.Modified;
Title = data.Name;
@@ -42,6 +48,19 @@ public MetaListItemInfo(MetaData data)
data.Is_Dir ? "folder" : "entry");
}
+ public MetaListItemInfo(string path)
+ {
+ if (path == null)
+ throw new ArgumentNullException("path");
+
+ _path = path;
+ _isDir = true;
+ _modified = string.Empty;
+
+ Title = "Parent Folder";
+ Icon = ThemeData.GetImage("parent");
+ }
+
private static string GetRelativeTime(MetaData data)
{
DateTime date;
View
26 KeePass/Sources/SkyDrive/List.xaml
@@ -3,6 +3,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:keepass="clr-namespace:KeePass.Utils" xmlns:uc="clr-namespace:KeePass.Controls"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
Style="{StaticResource KeePassPage}">
<Grid x:Name="LayoutRoot" Background="Transparent">
@@ -19,22 +21,18 @@
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <uc:KeePassList x:Name="lstItems" Grid.ColumnSpan="2"
+ <uc:KeePassList x:Name="lstItems"
SelectionChanged="lstItems_SelectionChanged" />
- <TextBlock Name="lblEmail" Grid.Row="1" />
- <HyperlinkButton Content="{Binding Path=Strings.SkyDriveList_Refresh, Source={StaticResource UiStrings}}"
- Grid.Row="1" Grid.Column="1" Click="lnkRefresh_Click" />
+ <uc:ProgressOverlay x:Name="progBusy" />
</Grid>
</Grid>
+
+ <phone:PhoneApplicationPage.ApplicationBar>
+ <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
+ <shell:ApplicationBarIconButton
+ IconUri="/Images/refresh.png" Text="[Refresh]"
+ Click="cmdRefresh_Click" />
+ </shell:ApplicationBar>
+ </phone:PhoneApplicationPage.ApplicationBar>
</keepass:KeePassPage>
View
55 KeePass/Sources/SkyDrive/List.xaml.cs
@@ -4,6 +4,7 @@
using System.Windows;
using System.Windows.Navigation;
using KeePass.Data;
+using KeePass.I18n;
using KeePass.IO.Data;
using KeePass.Storage;
using KeePass.Utils;
@@ -19,6 +20,7 @@ public partial class List
public List()
{
InitializeComponent();
+ AppButton(0).Text = Strings.Refresh;
}
protected override void OnNavigatedTo(
@@ -35,19 +37,6 @@ public List()
_folder = pars["folder"];
RefreshList(null);
- DisplayEmail();
- }
-
- private void DisplayEmail()
- {
- _client.GetEmail(email =>
- {
- if (!string.IsNullOrEmpty(email))
- {
- Dispatcher.BeginInvoke(() =>
- lblEmail.Text = email);
- }
- });
}
private void OnFileDownloaded(MetaListItemInfo item,
@@ -97,40 +86,53 @@ private void DisplayEmail()
}
finally
{
- /*dispatcher.BeginInvoke(() =>
- progBusy.IsBusy = false);*/
+ dispatcher.BeginInvoke(() =>
+ progBusy.IsBusy = false);
}
}
private void RefreshList(string path)
{
+ progBusy.IsBusy = true;
+
_client.List(path, (parent, items) =>
{
- _current = path;
+ try
+ {
+ _current = path;
- var grandParent = parent != null
- ? parent.Parent : null;
+ var grandParent = parent != null
+ ? parent.Parent : null;
- if (!string.IsNullOrEmpty(grandParent))
- {
- var list = new List<ListItemInfo>(items);
- list.Insert(0, new ParentItem(grandParent));
+ if (!string.IsNullOrEmpty(grandParent))
+ {
+ var list = new List<ListItemInfo>(items);
+ list.Insert(0, new ParentItem(grandParent));
- lstItems.SetItems(list);
+ lstItems.SetItems(list);
+ }
+ else
+ lstItems.SetItems(items);
+ }
+ finally
+ {
+ Dispatcher.BeginInvoke(() =>
+ progBusy.IsBusy = false);
}
- else
- lstItems.SetItems(items);
});
}
- private void lnkRefresh_Click(object sender, RoutedEventArgs e)
+ private void cmdRefresh_Click(object sender, EventArgs e)
{
RefreshList(_current);
}
private void lstItems_SelectionChanged(object sender,
NavigationListControl.NavigationEventArgs e)
{
+ if (!Network.CheckNetwork())
+ return;
+
var item = e.Item as MetaListItemInfo;
if (item != null)
@@ -141,6 +143,7 @@ private void lnkRefresh_Click(object sender, RoutedEventArgs e)
return;
}
+ progBusy.IsBusy = true;
_client.Download(item.Path,
OnFileDownloaded);
View
4 KeePass/Sources/SkyDrive/LiveAuth.xaml
@@ -15,12 +15,10 @@
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}"
Style="{StaticResource PhoneTextNormalStyle}"/>
- <TextBlock x:Name="PageTitle" Text="SkyDrive" Margin="9,-7,0,0"
- Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
- <phone:WebBrowser Name="browser" IsScriptEnabled="True" Background="Transparent"
+ <phone:WebBrowser Name="browser" IsScriptEnabled="True"
Loaded="browser_Loaded" Navigating="browser_Navigating" />
</Grid>
</Grid>
View
23 KeePass/Sources/SkyDrive/LiveAuth.xaml.cs
@@ -1,27 +1,17 @@
using System;
using System.Linq;
-using System.Windows.Navigation;
using KeePass.Utils;
using Microsoft.Phone.Controls;
namespace KeePass.Sources.SkyDrive
{
public partial class LiveAuth
{
- private bool _attemptLogout;
-
public LiveAuth()
{
InitializeComponent();
}
- protected override void OnNavigatedTo(
- bool cancelled, NavigationEventArgs e)
- {
- _attemptLogout = e.NavigationMode ==
- NavigationMode.Back;
- }
-
private void CheckToken(Uri uri)
{
var parts = uri.Fragment
@@ -46,7 +36,7 @@ private void ShowLogin()
{
var theme = ThemeData.IsDarkTheme
? "Dark" : "Light";
-
+
var url = string.Format(
SkyDrive.Resources.AuthUrl,
SkyDriveInfo.CLIENT_ID,
@@ -58,13 +48,8 @@ private void ShowLogin()
private void browser_Loaded(object sender,
System.Windows.RoutedEventArgs e)
{
- if (!_attemptLogout)
- ShowLogin();
- else
- {
- browser.Navigate(new Uri(
- "http://login.live.com/logout.srf"));
- }
+ browser.Navigate(new Uri(
+ "http://login.live.com/logout.srf"));
}
private void browser_Navigating(
@@ -79,7 +64,7 @@ private void ShowLogin()
return;
}
- if (!_attemptLogout || uri.Host.Contains("live.com"))
+ if (uri.Host.Contains("live.com"))
return;
e.Cancel = true;
View
5 KeePass/packages.config
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Coding4Fun.Phone.Controls" version="1.4.8" />
- <package id="DropNet" version="1.6" />
- <package id="Newtonsoft.Json" version="4.0.5" />
- <package id="RestSharp" version="102.5" />
+ <package id="Coding4Fun.Phone.Controls" version="1.5.1" />
<package id="SharpZipLib" version="0.86.0" />
<package id="SilverlightToolkitWP" version="4.2011.12.13" />
</packages>
View
BIN Libs/DropNet.WindowsPhone.dll
Binary file not shown.
View
BIN ...Json.4.0.5/lib/sl3-wp/Newtonsoft.Json.dll → Libs/Newtonsoft.Json.dll
Binary file not shown.
View
0 ...ib/sl4-windowsphone71/Newtonsoft.Json.xml → Libs/Newtonsoft.Json.xml
File renamed without changes.
View
BIN Libs/RestSharp.WindowsPhone.dll
Binary file not shown.
View
21 README.de
@@ -0,0 +1,21 @@
+Der inoffizielle KeePass Passwort Manager, kompatibel mit KeePass 2.x f�r Windows (Desktop).
+
+Support Informationen:
+- Blog: http://7pass.wordpress.com
+- Quelltext: https://github.com/7pass/7pass
+
+Version 3.4:
+ - Added SkyDrive support.
+ - Removed usage of device ID.
+
+Version 3.3:
+- Behoben: WebDAV Fehler.
+- Behoben: Globales Passwort wird bei Umschalten der App nicht angezeigt.
+- Behoben: Darstellung der gesch�tzten Felder mit hellen Themes.
+- Hinzugef�gt: Editieren von Zusatzfeldern und Asterisk Support
+
+Version 3.2:
+- Hinzugef�gt: Animierte �berg�nge bei Navigation.
+- Hinzugef�gt: Anpinnen der Datenbank an Startmen�.
+- Hinzugef�gt: Verstecken von Passwort, Titel und Benutzername.
+- Fehlerbereinigungen und Verbesserung der Oberfl�che.
View
BIN packages/Coding4Fun.Phone.Controls.1.4.8/Coding4Fun.Phone.Controls.1.4.8.nupkg
Binary file not shown.
View
BIN packages/Coding4Fun.Phone.Controls.1.4.8/lib/Coding4Fun.Phone.Controls.dll
Binary file not shown.
View
BIN packages/Coding4Fun.Phone.Controls.1.5.1/Coding4Fun.Phone.Controls.1.5.1.nupkg
Binary file not shown.
View
BIN packages/Coding4Fun.Phone.Controls.1.5.1/lib/Coding4Fun.Phone.Controls.dll
Binary file not shown.
View
BIN packages/DropNet.1.6/DropNet.1.6.nupkg
Binary file not shown.
View
BIN packages/DropNet.1.6/lib/net35/DropNet.dll
Binary file not shown.
View
BIN packages/DropNet.1.6/lib/sl3-wp/DropNet.WindowsPhone.dll
Binary file not shown.
View
BIN packages/DropNet.1.6/lib/sl4-WindowsPhone71/DropNet.WindowsPhone.dll
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/Newtonsoft.Json.4.0.5.nupkg
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/net20/Newtonsoft.Json.dll
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/net20/Newtonsoft.Json.pdb
Binary file not shown.
View
7,859 packages/Newtonsoft.Json.4.0.5/lib/net20/Newtonsoft.Json.xml
0 additions, 7,859 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/net35/Newtonsoft.Json.dll
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/net35/Newtonsoft.Json.pdb
Binary file not shown.
View
6,982 packages/Newtonsoft.Json.4.0.5/lib/net35/Newtonsoft.Json.xml
0 additions, 6,982 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/net40/Newtonsoft.Json.dll
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/net40/Newtonsoft.Json.pdb
Binary file not shown.
View
7,141 packages/Newtonsoft.Json.4.0.5/lib/net40/Newtonsoft.Json.xml
0 additions, 7,141 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/sl3-wp/Newtonsoft.Json.pdb
Binary file not shown.
View
6,574 packages/Newtonsoft.Json.4.0.5/lib/sl3-wp/Newtonsoft.Json.xml
0 additions, 6,574 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/sl4-windowsphone71/Newtonsoft.Json.dll
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/sl4-windowsphone71/Newtonsoft.Json.pdb
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/sl4/Newtonsoft.Json.dll
Binary file not shown.
View
BIN packages/Newtonsoft.Json.4.0.5/lib/sl4/Newtonsoft.Json.pdb
Binary file not shown.
View
6,604 packages/Newtonsoft.Json.4.0.5/lib/sl4/Newtonsoft.Json.xml
0 additions, 6,604 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN packages/RestSharp.102.5/RestSharp.102.5.nupkg
Binary file not shown.
View
BIN packages/RestSharp.102.5/lib/net35-client/RestSharp.dll
Binary file not shown.
View
BIN packages/RestSharp.102.5/lib/net35/RestSharp.dll
Binary file not shown.
View
BIN packages/RestSharp.102.5/lib/sl3-wp/RestSharp.WindowsPhone.dll
Binary file not shown.
View
BIN packages/RestSharp.102.5/lib/sl4-wp71/RestSharp.WindowsPhone.dll
Binary file not shown.
View
BIN packages/RestSharp.102.5/lib/sl4/RestSharp.Silverlight.dll
Binary file not shown.

0 comments on commit 3875ea5

Please sign in to comment.