Skip to content

Commit

Permalink
Add window caption to logviewer.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Mar 27, 2017
1 parent 4d81f86 commit 4cb3a55
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LogViewer/LogViewer/LogViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<SuiteName>PX4 Log Viewer</SuiteName>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>31</ApplicationRevision>
<ApplicationRevision>32</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down
20 changes: 20 additions & 0 deletions LogViewer/LogViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,31 @@ private async void OnOpenFile(object sender, RoutedEventArgs e)
"Unsupported file extension", MessageBoxButton.OK, MessageBoxImage.Exclamation);
break;
}
UpdateTitle(System.IO.Path.GetFileName(file));
}
ShowTotalFlightTime();
}
OpenButton.IsEnabled = true;
}

string originalTitle;

private void UpdateTitle(string caption)
{
if (originalTitle == null)
{
originalTitle = this.Title;
}
if (string.IsNullOrEmpty(caption))
{
this.Title = originalTitle;
}
else
{
this.Title = originalTitle + " - " + caption;
}
}

private async Task LoadJSonFile(string file)
{
try
Expand Down Expand Up @@ -1083,6 +1102,7 @@ private void OnClear(object sender, RoutedEventArgs e)
myMap.Children.Clear();
ImageViewer.Source = null;
ShowSchema();
UpdateTitle("");
}

private void OnFlightSelected(object sender, SelectionChangedEventArgs e)
Expand Down

0 comments on commit 4cb3a55

Please sign in to comment.