When the connection is refused, create the failed action before showing the

pop-up, otherwise the UX is slightly strange if the failure appears on the
status bar only after the user has closed the pop-up.
Also, improved failure message shown on the History page.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-10-03 09:12:11 +01:00 committed by Mihaela Stoica
parent 7e6f0bb10c
commit be0176afe0
3 changed files with 22 additions and 48 deletions

View File

@ -712,7 +712,7 @@ namespace XenAdmin
}
break;
case ArgType.Passwords:
System.Diagnostics.Trace.Assert(false);
Trace.Assert(false);
break;
}
Launched = true;
@ -867,21 +867,13 @@ namespace XenAdmin
{
connection.EndConnect();
Program.Invoke(Program.MainWindow, delegate()
Program.Invoke(Program.MainWindow, delegate
{
string msg = string.Format(Messages.INCOMPATIBLE_PRODUCTS, Helpers.GetName(master));
string url = "";
var title = string.Format(Messages.CONNECTION_REFUSED_TITLE, Helpers.GetName(master).Ellipsise(80));
new ActionBase(title, "", false, true, Messages.INCOMPATIBLE_PRODUCTS);
using (var dlog = new ConnectionRefusedDialog())
{
dlog.ErrorMessage = msg;
dlog.Url = "";
using (var dlog = new ConnectionRefusedDialog {ErrorMessage = Messages.INCOMPATIBLE_PRODUCTS, Url = ""})
dlog.ShowDialog(this);
}
new ActionBase(Messages.CONNECTION_REFUSED_TITLE,
string.Format("{0}\n{1}", msg, url), false,
true, Messages.CONNECTION_REFUSED);
});
return;
}
@ -907,29 +899,23 @@ namespace XenAdmin
{
connection.EndConnect();
Program.Invoke(Program.MainWindow, delegate()
Program.Invoke(Program.MainWindow, delegate
{
string msg = string.Format(Messages.GUI_OUT_OF_DATE, Helpers.GetName(master));
msg = msg + Messages.GUI_OUT_OF_DATE_MORE;
string url = "https://" + connection.Hostname;
var msg = string.Format(Messages.GUI_OUT_OF_DATE, Helpers.GetName(master));
var url = "https://" + connection.Hostname;
var title = string.Format(Messages.CONNECTION_REFUSED_TITLE, Helpers.GetName(master).Ellipsise(80));
var error = string.Format("{0}\n{1}", msg, url);
using (var dlog = new ConnectionRefusedDialog())
{
dlog.ErrorMessage = msg;
dlog.Url = url;
new ActionBase(title, "", false, true, error);
using (var dlog = new ConnectionRefusedDialog {ErrorMessage = msg, Url = url})
dlog.ShowDialog(this);
}
new ActionBase(Messages.CONNECTION_REFUSED_TITLE,
string.Format("{0}\n{1}", msg, url), false,
true, Messages.CONNECTION_REFUSED);
});
return;
}
else if (server_max > current_version)
{
if (server_max > current_version)
Alert.AddAlert(new GuiOldAlert());
}
LoadTasksAsMeddlingActions(connection);
}
@ -975,7 +961,7 @@ namespace XenAdmin
newHealthCheckSSettings.GetSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_CREDENTIAL_PASSWORD_SECRET), true).RunAsync();
}
public static bool SameProductBrand(Host host)
private static bool SameProductBrand(Host host)
{
var brand = host.ProductBrand();
return brand == Branding.PRODUCT_BRAND || brand == Branding.LEGACY_PRODUCT_BRAND || Branding.PRODUCT_BRAND == "[XenServer product]";

View File

@ -8526,7 +8526,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Connection Refused.
/// Looks up a localized string similar to Refused connection to {0}.
/// </summary>
public static string CONNECTION_REFUSED_TITLE {
get {
@ -16670,7 +16670,9 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to This version of [XenCenter] is out of date and cannot connect to {0}..
/// Looks up a localized string similar to This version of [XenCenter] is out of date and cannot connect to {0}.
///
///You can get a compatible version of [XenCenter] from the following location:.
/// </summary>
public static string GUI_OUT_OF_DATE {
get {
@ -16678,17 +16680,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to
///
///You can get a compatible version of [XenCenter] from the following location:.
/// </summary>
public static string GUI_OUT_OF_DATE_MORE {
get {
return ResourceManager.GetString("GUI_OUT_OF_DATE_MORE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to HA.
/// </summary>

View File

@ -3084,7 +3084,7 @@ Would you like to carry out the operation at this time?</value>
<value>The connection was refused.</value>
</data>
<data name="CONNECTION_REFUSED_TITLE" xml:space="preserve">
<value>Connection Refused</value>
<value>Refused connection to {0}</value>
</data>
<data name="CONNECTION_RESTRICTED_MESSAGE" xml:space="preserve">
<value>Connection to Server {0} restricted because a connection already exists to another XE Express Server ({1})</value>
@ -5833,10 +5833,7 @@ Note: Any custom color selections will remain unchanged</value>
<value>Group Roles</value>
</data>
<data name="GUI_OUT_OF_DATE" xml:space="preserve">
<value>This version of [XenCenter] is out of date and cannot connect to {0}.</value>
</data>
<data name="GUI_OUT_OF_DATE_MORE" xml:space="preserve">
<value>
<value>This version of [XenCenter] is out of date and cannot connect to {0}.
You can get a compatible version of [XenCenter] from the following location:</value>
</data>