消息框图标优化

致命错误取Error,普通错误取警告。
pull/543/head
YFdyh000 2020-03-16 01:33:07 +08:00
parent e60369c817
commit 794b88e5ab
10 changed files with 25 additions and 17 deletions

View File

@ -63,7 +63,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("OperationFailed"));
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}

View File

@ -96,7 +96,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("OperationFailed"));
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
@ -124,7 +124,7 @@ namespace v2rayN.Forms
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.Show(msg);
UI.ShowWarning(msg);
return;
}

View File

@ -85,7 +85,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("OperationFailed"));
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
@ -113,7 +113,7 @@ namespace v2rayN.Forms
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.Show(msg);
UI.ShowWarning(msg);
return;
}

View File

@ -166,7 +166,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("OperationFailed"));
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
@ -233,7 +233,7 @@ namespace v2rayN.Forms
}
if (vmessItem == null)
{
UI.Show(msg);
UI.ShowWarning(msg);
return;
}
@ -261,7 +261,7 @@ namespace v2rayN.Forms
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.Show(msg);
UI.ShowWarning(msg);
return;
}

View File

@ -804,7 +804,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("FailedImportedCustomServer"));
UI.ShowWarning(UIRes.I18N("FailedImportedCustomServer"));
}
}
@ -1391,7 +1391,7 @@ namespace v2rayN.Forms
string result = Convert.ToString(e.UserState);
if (Utils.IsNullOrEmpty(result))
{
UI.Show(UIRes.I18N("NoValidQRcodeFound"));
UI.ShowWarning(UIRes.I18N("NoValidQRcodeFound"));
}
else
{

View File

@ -181,7 +181,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("OperationFailed"));
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}

View File

@ -79,7 +79,7 @@ namespace v2rayN.Forms
}
else
{
UI.Show(UIRes.I18N("OperationFailed"));
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}

View File

@ -101,7 +101,7 @@ namespace v2rayN.Handler
}
else
{
UI.Show(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName));
UI.ShowWarning(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName));
}
}
@ -141,7 +141,7 @@ namespace v2rayN.Handler
}
else
{
UI.Show(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName));
UI.ShowWarning(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName));
}
}

View File

@ -38,7 +38,7 @@ namespace v2rayN
{
if (!UnzipLibs())
{
UI.Show($"Error preparing the environment(准备运行环境出错)");
UI.ShowError($"Error preparing the environment(准备运行环境出错)");
return;
}
@ -54,7 +54,7 @@ namespace v2rayN
}
else
{
UI.Show($"v2rayN is already running(v2rayN已经运行)");
UI.ShowWarning($"v2rayN is already running(v2rayN已经运行)");
}
}

View File

@ -8,10 +8,18 @@ namespace v2rayN
{
MessageBox.Show(msg, "v2rayN", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public static void ShowWarning(string msg)
{
MessageBox.Show(msg, "v2rayN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
public static void ShowError(string msg)
{
MessageBox.Show(msg, "v2rayN", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
public static DialogResult ShowYesNo(string msg)
{
return MessageBox.Show(msg, "YesNo", MessageBoxButtons.YesNo);
return MessageBox.Show(msg, "v2rayN", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
//public static string GetResourseString(string key)