From 00b3dffbbd7f297ee49f12a0b0da67c0f8c23c5c Mon Sep 17 00:00:00 2001
From: Yaronzz <392309221@qq.com>
Date: Wed, 9 Oct 2019 15:04:51 +0800
Subject: [PATCH] fixd bug of settings
---
TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml | 20 ++++++++---
TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml.cs | 1 +
TIDALDL-UI/TIDALDL-UI/Pages/MainViewModel.cs | 33 +++++++++++++++++++
TIDALDL-UI/TIDALDL-UI/Pages/SettingView.xaml | 3 +-
.../TIDALDL-UI/Pages/SettingViewModel.cs | 5 +++
.../TIDALDL-UI/Properties/AssemblyInfo.cs | 4 +--
TIDALDL-UI/TIDALDL-UI/updateLog.md | 5 +--
7 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml b/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml
index 44885042..d9466122 100644
--- a/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml
+++ b/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml
@@ -25,7 +25,7 @@
-
+
-
+
-
+
+
+
+
+
+
+
diff --git a/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml.cs b/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml.cs
index 97cf493d..89a977da 100644
--- a/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml.cs
+++ b/TIDALDL-UI/TIDALDL-UI/Pages/MainView.xaml.cs
@@ -34,5 +34,6 @@ private void TextBox_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs
TextBox ctrl = (TextBox)sender;
ctrl.SelectAll();
}
+
}
}
diff --git a/TIDALDL-UI/TIDALDL-UI/Pages/MainViewModel.cs b/TIDALDL-UI/TIDALDL-UI/Pages/MainViewModel.cs
index 0533d3e3..c5110a92 100644
--- a/TIDALDL-UI/TIDALDL-UI/Pages/MainViewModel.cs
+++ b/TIDALDL-UI/TIDALDL-UI/Pages/MainViewModel.cs
@@ -14,6 +14,7 @@
using System.Collections.ObjectModel;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
+using System.Windows.Controls;
namespace TIDALDL_UI.Pages
{
@@ -35,6 +36,14 @@ public class MainViewModel : Screen
public BindableCollection ItemList { get; } = new BindableCollection();
public Thread UpdateThread;
+ ///
+ /// Combox
+ ///
+ public List QualityList { get; set; }
+ public int SelectQualityIndex { get; set; }
+ public List ResolutionList { get; set; }
+ public int SelectResolutionIndex { get; set; }
+
private IWindowManager Manager;
private LoginViewModel VMLogin;
private SettingViewModel VMSetting;
@@ -62,6 +71,16 @@ public MainViewModel(IWindowManager manager,
UpdateThread.IsBackground = true;
UpdateThread.Start();
+ QualityList = TidalTool.getQualityList();
+ SelectQualityIndex = QualityList.IndexOf(Config.Quality().ToUpper());
+ if (SelectQualityIndex < 0)
+ SelectQualityIndex = 0;
+
+ ResolutionList = TidalTool.getResolutionList();
+ SelectResolutionIndex = ResolutionList.IndexOf(Config.Resolution().ToUpper());
+ if (SelectResolutionIndex < 0)
+ SelectResolutionIndex = 0;
+
TidalTool.SetSearchMaxNum(int.Parse(Config.SearchNum()));
//test
@@ -94,6 +113,16 @@ public void WindowClose()
// }
//}
+ public void QualityChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Config.Quality(QualityList[SelectQualityIndex].ToLower());
+ }
+
+ public void ResolutionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Config.Resolution(ResolutionList[SelectResolutionIndex]);
+ }
+
#region Button
public async void Search()
{
@@ -157,9 +186,13 @@ public void Logout()
}
public void Setting()
{
+ VMSetting.RefreshSetting();
Manager.ShowDialog(VMSetting);
string sValue = Config.ThreadNum();
ThreadTool.SetThreadNum(int.Parse(sValue));
+
+ SelectQualityIndex = QualityList.IndexOf(Config.Quality().ToUpper());
+ SelectResolutionIndex = ResolutionList.IndexOf(Config.Resolution().ToUpper());
}
public void About()
{
diff --git a/TIDALDL-UI/TIDALDL-UI/Pages/SettingView.xaml b/TIDALDL-UI/TIDALDL-UI/Pages/SettingView.xaml
index f0b4d3a7..dee9c86b 100644
--- a/TIDALDL-UI/TIDALDL-UI/Pages/SettingView.xaml
+++ b/TIDALDL-UI/TIDALDL-UI/Pages/SettingView.xaml
@@ -38,8 +38,7 @@
-
-
+
ResolutionList { get; set; }
public SettingViewModel()
+ {
+ RefreshSetting();
+ }
+
+ public void RefreshSetting()
{
OutputDir = Config.OutputDir();
OnlyM4a = Config.OnlyM4a();
diff --git a/TIDALDL-UI/TIDALDL-UI/Properties/AssemblyInfo.cs b/TIDALDL-UI/TIDALDL-UI/Properties/AssemblyInfo.cs
index 72f74c43..ce22b053 100644
--- a/TIDALDL-UI/TIDALDL-UI/Properties/AssemblyInfo.cs
+++ b/TIDALDL-UI/TIDALDL-UI/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.7")]
-[assembly: AssemblyFileVersion("1.1.0.7")]
+[assembly: AssemblyVersion("1.1.0.8")]
+[assembly: AssemblyFileVersion("1.1.0.8")]
diff --git a/TIDALDL-UI/TIDALDL-UI/updateLog.md b/TIDALDL-UI/TIDALDL-UI/updateLog.md
index ee797d02..35cf47da 100644
--- a/TIDALDL-UI/TIDALDL-UI/updateLog.md
+++ b/TIDALDL-UI/TIDALDL-UI/updateLog.md
@@ -1,5 +1,6 @@
-- Search box: select all when double click
-- Settings: search max num
+#### v1.1.0.8
+- Search box: select all when double click
+- Settings: fixd bug, add search max num, add to chinese
- Settings: to chinese
- Fix bug of playlist video savepath