mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add 'Clear Log' Button in about
This commit is contained in:
parent
792b383505
commit
5140690e07
3 changed files with 23 additions and 0 deletions
|
|
@ -162,6 +162,8 @@
|
|||
<system:String x:Key="devtool">DevTools</system:String>
|
||||
<system:String x:Key="settingfolder">Setting Folder</system:String>
|
||||
<system:String x:Key="logfolder">Log Folder</system:String>
|
||||
<system:String x:Key="clearlogfolder">Clear Logs</system:String>
|
||||
<system:String x:Key="clearlogfolderMessage">Are you sure you want to delete the entire log?</system:String>
|
||||
<system:String x:Key="welcomewindow">Wizard</system:String>
|
||||
|
||||
<!-- FileManager Setting Dialog -->
|
||||
|
|
|
|||
|
|
@ -2523,6 +2523,10 @@
|
|||
Margin="0,0,12,0"
|
||||
Click="OpenSettingFolder"
|
||||
Content="{DynamicResource settingfolder}" />
|
||||
<Button
|
||||
Margin="0,0,12,0"
|
||||
Click="ClearLogFolder"
|
||||
Content="{DynamicResource clearlogfolder}" />
|
||||
<Button Click="OpenLogFolder" Content="{DynamicResource logfolder}" />
|
||||
</StackPanel>
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||
|
|
|
|||
|
|
@ -269,6 +269,23 @@ namespace Flow.Launcher
|
|||
{
|
||||
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
|
||||
}
|
||||
private void ClearLogFolder(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var confirmResult = MessageBox.Show(InternationalizationManager.Instance.GetTranslation("clearlogfolderMessage"),InternationalizationManager.Instance.GetTranslation("clearlogfolder"), MessageBoxButton.YesNo);
|
||||
if (confirmResult == MessageBoxResult.Yes)
|
||||
{
|
||||
DirectoryInfo Di = new DirectoryInfo(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
|
||||
FileInfo[] files = Di.GetFiles();
|
||||
foreach (FileInfo file in files)
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue