Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
修正问题反馈的逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed Feb 2, 2020
1 parent 410957a commit be495da
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion PixivFSUWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override void OnActivated(IActivatedEventArgs args)
/// 将在启动应用程序以打开特定文件等情况下使用。
/// </summary>
/// <param name="e">有关启动请求和过程的详细信息。</param>
protected override async void OnLaunched(LaunchActivatedEventArgs e)
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;

Expand Down
5 changes: 3 additions & 2 deletions PixivFSUWP/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ private void NavControl_BackRequested(NavigationView sender, NavigationViewBackR
}
}

private void btnReport_Click(object sender, RoutedEventArgs e)
private async void btnReport_Click(object sender, RoutedEventArgs e)
{

//在新窗口中打开发送反馈的窗口
await ShowNewWindow(typeof(ReportIssuePage), null);
}
}
}
7 changes: 3 additions & 4 deletions PixivFSUWP/ReportIssuePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</Grid.RowDefinitions>
<StackPanel Margin="10" Orientation="Vertical">
<TextBlock Margin="15,15,15,0" FontSize="18" FontWeight="Bold">Report an issue/报告问题</TextBlock>
<TextBlock Margin="15,15,15,0">We've detected a crash in your last session. We've collected some details.</TextBlock>
<TextBlock Margin="15,5,15,0">我们在您的上次会话中探测到一次崩溃,我们收集了一些细节。</TextBlock>
<TextBlock Margin="15,15,15,0">You are going to report an issue. We've collected some details.</TextBlock>
<TextBlock Margin="15,5,15,0">您正准备汇报一个问题,我们收集了一些细节。</TextBlock>
</StackPanel>
<ScrollViewer Margin="25,15,25,0" Background="LightGray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalScrollMode="Disabled" VerticalScrollBarVisibility="Visible" Grid.Row="1">
Expand All @@ -29,8 +29,7 @@
<TextBlock Margin="25 10 25 0">Don't worry. The information you just copied does not contain any private data.</TextBlock>
<TextBlock Margin="25 5 25 0">不要担心,您刚刚所复制的信息不会携带您的任何隐私数据。</TextBlock>
<Button x:Name="btnGitHub" Margin="25 15 25 0" Background="#25c6ff" HorizontalAlignment="Stretch" Click="BtnGitHub_Click">Create a new issue on GitHub (RECOMMENDED)/在GitHub上创建新的Issue(推荐)</Button>
<Button x:Name="btnEmail" Margin="25 10 25 0" HorizontalAlignment="Stretch" Click="BtnEmail_Click">Send an Email to 🐟/给🐟发送邮件</Button>
<Button x:Name="btnContinue" Margin="25 10 25 25" HorizontalAlignment="Stretch" Click="BtnContinue_Click">Continue to Pixiv UWP/继续前往Pixiv UWP</Button>
<Button x:Name="btnEmail" Margin="25 10 25 25" HorizontalAlignment="Stretch" Click="BtnEmail_Click">Send an Email to 🐟/给🐟发送邮件</Button>
</StackPanel>
</Grid>
</Page>
28 changes: 13 additions & 15 deletions PixivFSUWP/ReportIssuePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Core;
using Windows.ApplicationModel.DataTransfer;
using Windows.Foundation;
using Windows.Foundation.Collections;
Expand All @@ -31,15 +32,9 @@ public sealed partial class ReportIssuePage : Page
public ReportIssuePage()
{
this.InitializeComponent();
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
if (localSettings.Values["exception"] == null)
{
Frame.Navigate(typeof(LoginPage));
return;
}
var lastExeption = (string)localSettings.Values["exception"];
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
var view = ApplicationView.GetForCurrentView();
view.Title = "Crash Report/崩溃报告";
view.Title = "Report an issue/问题反馈";
txtDetails.Text += "General:\n";
txtDetails.Text += string.Format("OS version: build {0}\n", SystemInformation.OperatingSystemVersion.Build);
txtDetails.Text += string.Format("App version: {0}.{1}.{2} {3}\n",
Expand All @@ -48,13 +43,16 @@ public ReportIssuePage()
Package.Current.Id.Version.Build,
Package.Current.Id.Architecture);
txtDetails.Text += string.Format("Package ID: {0}\n\n", Package.Current.Id.Name);
txtDetails.Text += "Exception:\n";
txtDetails.Text += lastExeption;
}

private void BtnContinue_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(LoginPage));
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
if (localSettings.Values["isCrashed"] != null &&
(bool)localSettings.Values["isCrashed"] == true &&
localSettings.Values["exception"] != null)
{
localSettings.Values.Remove("isCrashed");
var lastExeption = (string)localSettings.Values["exception"];
txtDetails.Text += "Exception:\n";
txtDetails.Text += lastExeption;
}
}

private async void BtnCopy_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit be495da

Please sign in to comment.