Skip to content

Commit

Permalink
一、新增功能
Browse files Browse the repository at this point in the history
新增下弹提示

二、优化修复
美化右下提示
  • Loading branch information
SuperStudio committed Jan 8, 2023
1 parent 28d4abe commit 632993b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
5 changes: 2 additions & 3 deletions SuperCom/Config/UrlManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ public static string GetPluginUrl()
static UrlManager()
{
Type t = typeof(UrlManager);
FieldInfo[] fields = t.GetFields(BindingFlags.Static | BindingFlags.Public);
JArray array = FileHelper.TryReadConfigFromJson("UpgradeSources") as JArray;
//List<Dictionary<string, string>> dicts = FileHelper.TryReadConfigFromJson("UpgradeSources") as List<Dictionary<string, string>>;
if (array?.Count == 0) return;
if (array == null || array.Count == 0) return;
foreach (JObject obj in array)
{
if (obj == null) continue;
Dictionary<string, string> dict = obj.ToObject<Dictionary<string, string>>();
if (dict == null) continue;
if (dict.ContainsKey("Name") && !string.IsNullOrEmpty(dict["Name"]))
Expand Down
2 changes: 1 addition & 1 deletion SuperCom/CustomWindows/About.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void OpenUrl(object sender, RoutedEventArgs e)
Hyperlink hyperlink = sender as Hyperlink;
FileHelper.TryOpenUrl(hyperlink.NavigateUri?.ToString(), (err) =>
{
MessageCard.Error(err);
MessageNotify.Error(err);
});
}
}
Expand Down
18 changes: 10 additions & 8 deletions SuperCom/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ private async void SaveToNewFile(object sender, RoutedEventArgs e)
{
portTabItem.ConnectTime = DateTime.Now;
await Task.Delay(500);
MessageCard.Success("成功存到新文件!");
MessageNotify.Success("成功存到新文件!");
}
}
(sender as FrameworkElement).IsEnabled = true;
Expand Down Expand Up @@ -1006,7 +1006,7 @@ private void SplitPanel(object sender, RoutedEventArgs e)
}
}
panelSplitPopup.IsOpen = false;
MessageCard.Info("开发中");
MessageNotify.Info("开发中");
}

private void SplitPanel(SplitPanelType type)
Expand Down Expand Up @@ -1116,7 +1116,7 @@ private void OpenHex(string text)
if (string.IsNullOrEmpty(text)) return;
if (text.Length > MAX_TRANSFORM_SIZE)
{
MessageCard.Warning($"超过了 {MAX_TRANSFORM_SIZE}");
MessageNotify.Warning($"超过了 {MAX_TRANSFORM_SIZE}");
return;
}
hexTransPopup.IsOpen = true;
Expand Down Expand Up @@ -1158,7 +1158,7 @@ private void OpenTime(string text)
{
if (text.Length > MAX_TIMESTAMP_LENGTH)
{
MessageCard.Warning($"超过了 {MAX_TIMESTAMP_LENGTH}");
MessageNotify.Warning($"超过了 {MAX_TIMESTAMP_LENGTH}");
return;
}
if (string.IsNullOrEmpty(text)) return;
Expand Down Expand Up @@ -1795,7 +1795,7 @@ private async void SendToFindResultTask(PortTabItem item, string recvResult, int
}
else
{
MessageCard.Info($"查找超时!");
MessageNotify.Info($"查找超时!");
}
portTabItem.ResultChecks.Dequeue();
}
Expand Down Expand Up @@ -2014,14 +2014,14 @@ private void Remark(object sender, RoutedEventArgs e)
}
else if (sideComPort.PortTabItem == null)
{
MessageCard.Info("打开串口后才能备注");
MessageNotify.Info("打开串口后才能备注");
}
}
}

private void OpenLog(object sender, RoutedEventArgs e)
{
MessageCard.Info("开发中");
MessageNotify.Info("开发中");
}

private void BuadRate_SelectionChanged(object sender, SelectionChangedEventArgs e)
Expand Down Expand Up @@ -2140,13 +2140,15 @@ private async void CheckUpgrade()
await Task.Delay(UpgradeHelper.AUTO_CHECK_UPGRADE_DELAY);
(string LatestVersion, string ReleaseDate, string ReleaseNote) result = await UpgradeHelper.GetUpgardeInfo();
string remote = result.LatestVersion;
string ReleaseDate = result.ReleaseDate;
if (!string.IsNullOrEmpty(remote))
{
string local = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
local = local.Substring(0, local.Length - ".0.0".Length);
if (local.CompareTo(remote) < 0)
{
bool opened = (bool)new MsgBox(this, "存在新版本!").ShowDialog();
bool opened = (bool)new MsgBox(this,
$"存在新版本\n版本:{remote}\n日期:{ReleaseDate}").ShowDialog();
if (opened)
UpgradeHelper.OpenWindow();
}
Expand Down
Binary file modified SuperCom/References/SuperControls.Style.dll
Binary file not shown.
Binary file modified SuperCom/References/SuperUtils.dll
Binary file not shown.
8 changes: 2 additions & 6 deletions SuperCom/SuperCom.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,8 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="AvalonEdit\Higlighting\JSON\JsonLight.xshd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="AvalonEdit\Higlighting\JSON\JsonDeep.xshd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="AvalonEdit\Higlighting\JSON\JsonLight.xshd" />
<None Include="AvalonEdit\Higlighting\JSON\JsonDeep.xshd" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
12 changes: 6 additions & 6 deletions SuperCom/Windows/Window_Setting.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ private void DeleteBaudRate(object sender, RoutedEventArgs e)
{
if (IsPortRunning())
{
MessageCard.Error("请关闭所有串口后再试");
MessageNotify.Error("请关闭所有串口后再试");
return;
}
if (vieModel.BaudRates?.Count <= 1)
{
MessageCard.Error("至少保留一个");
MessageNotify.Error("至少保留一个");
return;
}
Button button = sender as Button;
Expand Down Expand Up @@ -224,7 +224,7 @@ private void SaveSettings(object sender, RoutedEventArgs e)
ConfigManager.Settings.Save();

vieModel.SaveAllRule();
MessageCard.Success("保存成功");
MessageNotify.Success("保存成功");
ApplyRule();
Main?.ReadXshdList();
Main?.RefreshSetting();
Expand Down Expand Up @@ -253,7 +253,7 @@ private void RestoreSettings(object sender, RoutedEventArgs e)
{
if (IsPortRunning())
{
MessageCard.Error("请关闭所有串口后再试");
MessageNotify.Error("请关闭所有串口后再试");
return;
}

Expand All @@ -276,7 +276,7 @@ private void RestoreSettings(object sender, RoutedEventArgs e)
vieModel.CloseToBar = false;
vieModel.FixedOnSendCommand = false;
vieModel.ScrollOnSearchClosed = true;
MessageCard.Success("已恢复默认值");
MessageNotify.Success("已恢复默认值");
}


Expand Down Expand Up @@ -356,7 +356,7 @@ private void DeleteRule(object sender, RoutedEventArgs e)
{
long.TryParse(button.Tag.ToString(), out long id);
if (!vieModel.DeleteRule(id))
MessageCard.Error("删除失败");
MessageNotify.Error("删除失败");
else
{
Main?.ReadXshdList();
Expand Down

0 comments on commit 632993b

Please sign in to comment.