消息框图标优化

致命错误取Error,普通错误取警告。
This commit is contained in:
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 else
{ {
UI.Show(UIRes.I18N("OperationFailed")); UI.ShowWarning(UIRes.I18N("OperationFailed"));
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -101,7 +101,7 @@ namespace v2rayN.Handler
} }
else 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 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()) if (!UnzipLibs())
{ {
UI.Show($"Error preparing the environment(准备运行环境出错)"); UI.ShowError($"Error preparing the environment(准备运行环境出错)");
return; return;
} }
@ -54,7 +54,7 @@ namespace v2rayN
} }
else 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); 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) 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) //public static string GetResourseString(string key)