Skip to content

Commit

Permalink
upload new version
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronzz committed Feb 22, 2021
1 parent f7b0d4a commit f70f62f
Show file tree
Hide file tree
Showing 26 changed files with 523 additions and 268 deletions.
Binary file modified TIDALDL-UI-PRO/.vs/TIDALDL-UI/v16/.suo
Binary file not shown.
4 changes: 3 additions & 1 deletion TIDALDL-UI-PRO/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<ResourceDictionary Source="Properties/ControlResources.xaml" />

<!--Language-->
<ResourceDictionary Source="Properties/Lang/StringResource.zh-CN.xaml" />
<ResourceDictionary Source="Properties/Lang/StringResource.Chinese.xaml" />
<ResourceDictionary Source="Properties/Lang/StringResource.Russian.xaml" />
<ResourceDictionary Source="Properties/Lang/StringResource.Turkish.xaml" />
<ResourceDictionary Source="Properties/Lang/StringResource.xaml" />
</ResourceDictionary.MergedDictionaries>
</s:ApplicationLoader>
Expand Down
1 change: 1 addition & 0 deletions TIDALDL-UI-PRO/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Stylet;
using StyletIoC;
using TIDALDL_UI.Pages;
using TIDALDL_UI.Else;

namespace TIDALDL_UI
{
Expand Down
15 changes: 9 additions & 6 deletions TIDALDL-UI-PRO/Else/Language.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public enum Type
{
Default,
English,
简体中文,
Chinese,
Russian,
Turkish,
}

private static ResourceDictionary GetResourceDictionaryByType(Type type = Type.Default)
Expand All @@ -36,12 +38,13 @@ private static ResourceDictionary GetResourceDictionaryByType(Type type = Type.D
pList.Add(item);

//find resource file
if (type == Type.Default)
findstr = string.Format(@"StringResource.{0}.xaml", CultureInfo.CurrentCulture.Name);
else if(type == Type.简体中文)
findstr = string.Format(@"StringResource.{0}.xaml", "zh-CN");
else
if (type == Type.Default || type == Type.English)
findstr = @"StringResource.xaml";
else
{
string sub = AIGS.Common.Convert.ConverEnumToString((int)type, typeof(Type), 0);
findstr = string.Format(@"StringResource.{0}.xaml", sub);
}

ret = pList.FirstOrDefault(x => x.Source != null && x.Source.OriginalString.Contains(findstr));
if(ret == null)
Expand Down
4 changes: 2 additions & 2 deletions TIDALDL-UI-PRO/Else/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ public static void Change(Settings newItem, Settings oldItem = null)
{
if(oldItem == null || oldItem.ThemeType != newItem.ThemeType)
Theme.Change(newItem.ThemeType);
//if (oldItem == null || oldItem.LanguageType != newItem.LanguageType)
// Language.Change(newItem.LanguageType);
if (oldItem == null || oldItem.LanguageType != newItem.LanguageType)
Language.Change(newItem.LanguageType);
if (oldItem == null || oldItem.ThreadNum != newItem.ThreadNum)
ThreadTool.SetThreadNum(newItem.ThreadNum);
}
Expand Down
2 changes: 2 additions & 0 deletions TIDALDL-UI-PRO/Else/TrackTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ public void Download()

CALL_RETURN:
TellParentOver();

DownloadSpeedString = "";
}

public void ErrDownloadNotify(long lTotalSize, long lAlreadyDownloadSize, string sErrMsg, object data)
Expand Down
2 changes: 2 additions & 0 deletions TIDALDL-UI-PRO/Else/VideoTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public void Download()

CALL_RETURN:
TellParentOver();

DownloadSpeedString = "";
}

public bool UpdateDownloadNotify(long lTotalSize, long lAlreadyDownloadSize, long lIncreSize, object data)
Expand Down
1 change: 1 addition & 0 deletions TIDALDL-UI-PRO/Pages/AboutView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>

<!-- logo -->
<Image Source="/Resource/favicon2.ico" Height="180" Width="180"></Image>
<DockPanel Grid.Column="1" Margin="15,0,0,0" VerticalAlignment="Center">
<TextBlock Text="TIDAL-GUI" DockPanel.Dock="Top" FontSize="40" VerticalAlignment="Top" FontWeight="ExtraBlack" Margin="0,15,0,15" />
Expand Down
8 changes: 4 additions & 4 deletions TIDALDL-UI-PRO/Pages/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ public void StartUpdate()
Progress.ValueInt = 0;
CountIncreSize = 0;
ShowProgress = Visibility.Visible;
DownloadStatusInfo = "Get new version file-url...";
DownloadStatusInfo = Language.Get("strmsgGetNewVersionUrl");

string url = GithubHelper.getFileUrl(Global.NAME_GITHUB_AUTHOR, Global.NAME_GITHUB_PROJECT, LastVersion, Global.NAME_GITHUB_FILE);
if (PathHelper.Mkdirs(Global.PATH_UPDATE) == false)
{
DownloadStatusInfo = "Creat update folder falied!";
DownloadStatusInfo = Language.Get("strmsgCreatUpdateFolderFailed");
EndUpdate();
return;
}

DownloadStatusInfo = "Start update...";
DownloadStatusInfo = Language.Get("strmsgStartUpdate");
Progress.SetStatus(ProgressHelper.STATUS.RUNNING);
StartTime = TimeHelper.GetCurrentTime();
LoginKey key = Tools.GetKey();
Expand Down Expand Up @@ -99,7 +99,7 @@ public void CompleteDownloadNotify(long lTotalSize, object data)
{
Progress.ValueInt = 100;
Progress.SetStatus(ProgressHelper.STATUS.COMPLETE);
DownloadStatusInfo = "Download complete, start update...";
DownloadStatusInfo = Language.Get("strmsgDownloadCompleteStartUpdate");

string sBat = "ping -n 5 127.0.0.1\n";
sBat += string.Format("move {0} {1}\\tidal-gui.exe\n", Global.PATH_UPDATE + Global.NAME_GITHUB_FILE, Path.GetFullPath(".\\"));
Expand Down
8 changes: 4 additions & 4 deletions TIDALDL-UI-PRO/Pages/DownloadView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
</Grid.RowDefinitions>

<Border Grid.RowSpan="2" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource BorderBrush}" ></Border>
<TextBlock Text="TASK LIST" FontWeight="Bold" FontSize="15" VerticalAlignment="Bottom" Margin="15"></TextBlock>
<TextBlock Text="{DynamicResource strTASKLIST}" FontWeight="Bold" FontSize="15" VerticalAlignment="Bottom" Margin="15"></TextBlock>
<ListBox Grid.Row="1" Margin="15" BorderThickness="0" Background="{x:Null}">
<ListBoxItem Margin="0,0,0,5" IsSelected="{Binding VisibilityDownload}" Style="{StaticResource MyListBoxItemTransparent}">
<StackPanel Orientation="Horizontal">
<Path Fill="{DynamicResource InfoBrush}" Width="18" Data="{StaticResource StartGeometry}"></Path>
<TextBlock Margin="6,0,0,0" Text="Download"/>
<TextBlock Margin="6,0,0,0" Text="{DynamicResource strDownload}"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Margin="0,0,0,5" IsSelected="{Binding VisibilityComplete}" Style="{StaticResource MyListBoxItemTransparent}">
<StackPanel Orientation="Horizontal">
<Path Fill="{DynamicResource SuccessBrush}" Width="18" Data="{StaticResource SuccessGeometry}"></Path>
<TextBlock Margin="6,0,0,0" Text="Complete"/>
<TextBlock Margin="6,0,0,0" Text="{DynamicResource strComplete}"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Margin="0,0,0,5" IsSelected="{Binding VisibilityError}" Style="{StaticResource MyListBoxItemTransparent}">
<StackPanel Orientation="Horizontal">
<Path Fill="{DynamicResource DangerBrush}" Width="18" Data="{StaticResource ErrorGeometry}"></Path>
<TextBlock Margin="6,0,0,0" Text="Error"/>
<TextBlock Margin="6,0,0,0" Text="{DynamicResource strError}"/>
</StackPanel>
</ListBoxItem>
</ListBox>
Expand Down
6 changes: 3 additions & 3 deletions TIDALDL-UI-PRO/Pages/DownloadViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class DownloadViewModel : ModelBase
public bool VisibilityError{ get; set; }

public string PageHeader { set { } get {
if (VisibilityDownload) return "Download";
if (VisibilityComplete) return "Complete";
return "Error";
if (VisibilityDownload) return Language.Get("strDownload");
if (VisibilityComplete) return Language.Get("strComplete");
return Language.Get("strError");
} }

public DownloadViewModel()
Expand Down
14 changes: 7 additions & 7 deletions TIDALDL-UI-PRO/Pages/LoginView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</Grid>-->

<TabControl Margin="30,62,29.6,65" Grid.Column="1" VerticalAlignment="Center" Height="250">
<TabItem Header="LOGIN" FontWeight="ExtraBold">
<TabItem Header="{DynamicResource strLOGIN}" FontWeight="ExtraBold">
<Grid Margin="0 16 0 0" >
<StackPanel VerticalAlignment="Center">
<DockPanel>
Expand All @@ -57,7 +57,7 @@
</StackPanel>
</Grid>
</TabItem>
<!--<TabItem Header="LOGIN" FontWeight="ExtraBold">
<!--<TabItem Header="{DynamicResource strLOGIN}" FontWeight="ExtraBold">
<Grid Margin="0 16 0 0" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
Expand Down Expand Up @@ -100,7 +100,7 @@
Content="Login" Grid.RowSpan="2" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" Margin="0,15,0,0"/>
</Grid>
</TabItem>-->
<TabItem Header="PROXY" FontWeight="Bold">
<TabItem Header="{DynamicResource strPROXY}" FontWeight="Bold">
<Grid Margin="0 16 0 0" >
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -116,18 +116,18 @@
</Grid.ColumnDefinitions>

<TextBlock Text="HttpProxy" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>
<TextBlock Grid.Row="1" Text="Host" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>
<TextBlock Grid.Row="1" Text="{DynamicResource strHost}" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>
<TextBlock Grid.Row="1" Text=":" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal" Grid.Column="2" Margin="0,10,79,3" Width="8" Height="23" TextAlignment="Center"/>
<TextBlock Grid.Row="2" Text="Username" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>
<TextBlock Grid.Row="3" Text="Password" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>
<TextBlock Grid.Row="2" Text="{DynamicResource strUsername}" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>
<TextBlock Grid.Row="3" Text="{DynamicResource strPassword}" VerticalAlignment="Center" HorizontalAlignment="Right" FontWeight="Normal"/>

<ToggleButton Grid.Column="2" IsChecked="{Binding Settings.ProxyEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ToggleButtonSwitch}" HorizontalAlignment="Left"/>
<hc:TextBox Grid.Row="1" Grid.Column="2" Text="{Binding Settings.ProxyHost}" Height="30" FontWeight="Normal" Margin="0,3,87,3"/>
<hc:TextBox Grid.Row="1" Grid.Column="2" Text="{Binding Settings.ProxyPort}" Height="30" FontWeight="Normal" Margin="141,3,0,3"/>
<hc:TextBox Grid.Row="2" Grid.Column="2" Text="{Binding Settings.ProxyUser}" Height="30" FontWeight="Normal"/>
<hc:TextBox Grid.Row="3" Grid.Column="2" Text="{Binding Settings.ProxyPwd}" Height="30" FontWeight="Normal"/>

<Button Grid.Row="4" Grid.ColumnSpan="3" Command="{s:Action SaveProxy}" Content="Save" Style="{StaticResource ButtonPrimary}" Margin="5,5,5,2" HorizontalAlignment="Stretch" />
<Button Grid.Row="4" Grid.ColumnSpan="3" Command="{s:Action SaveProxy}" Content="{DynamicResource strSave}" Style="{StaticResource ButtonPrimary}" Margin="5,5,5,2" HorizontalAlignment="Stretch" />

</Grid>
</TabItem>
Expand Down
8 changes: 4 additions & 4 deletions TIDALDL-UI-PRO/Pages/LoginViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected override async void OnViewLoaded()
//get device code
(string msg1, TidalDeviceCode code) = await Client.GetDeviceCode(PROXY);
if (msg1.IsNotBlank())
Growl.Error("Get device code failed!", Global.TOKEN_LOGIN);
Growl.Error(Language.Get("strmsgGetDeviceCodeFailed"), Global.TOKEN_LOGIN);
else
DeviceCode = code;
goto RETURN_POINT;
Expand Down Expand Up @@ -96,7 +96,7 @@ public async void Login()
(string msg1, TidalDeviceCode code) = await Client.GetDeviceCode(PROXY);
if (msg1.IsNotBlank())
{
Growl.Error("Get device code failed!", Global.TOKEN_LOGIN);
Growl.Error(Language.Get("strmsgGetDeviceCodeFailed"), Global.TOKEN_LOGIN);
BtnLoginEnable = true;
return;
}
Expand All @@ -121,7 +121,7 @@ public async void Login2()

if (Settings.Username.IsBlank() || Settings.Password.IsBlank())
{
Growl.Error("Username or password is err!", Global.TOKEN_LOGIN);
Growl.Error(Language.Get("strmsgUsenamePasswordErr"), Global.TOKEN_LOGIN);
goto RETURN_POINT;
}

Expand All @@ -136,7 +136,7 @@ public async void Login2()
(string msg3, LoginKey key3) = await Client.Login(Settings.Username, Settings.Password, token2, PROXY);
if (msg.IsNotBlank() || key == null)
{
Growl.Error("Login Err! " + msg, Global.TOKEN_LOGIN);
Growl.Error(Language.Get("strmsgLoginErr") + msg, Global.TOKEN_LOGIN);
goto RETURN_POINT;
}

Expand Down
Loading

0 comments on commit f70f62f

Please sign in to comment.