diff --git a/XenAdmin/Branding.cs b/XenAdmin/Branding.cs index abcd3a20a..df855f699 100644 --- a/XenAdmin/Branding.cs +++ b/XenAdmin/Branding.cs @@ -49,6 +49,14 @@ namespace XenAdmin public const string UPDATE = "@BRANDING_UPDATE@"; public const string CHECK_FOR_UPDATES_URL = "@BRANDING_XENSERVER_UPDATE_URL@"; + public static string Search + { + get + { + return SEARCH != "@BRANDING_SEARCH@" ? SEARCH : InvisibleMessages.XEN_SEARCH; + } + } + public static string Update { get diff --git a/XenAdmin/Commands/ImportSearchCommand.cs b/XenAdmin/Commands/ImportSearchCommand.cs index 69212a0c2..8b96cba63 100644 --- a/XenAdmin/Commands/ImportSearchCommand.cs +++ b/XenAdmin/Commands/ImportSearchCommand.cs @@ -88,10 +88,10 @@ namespace XenAdmin.Commands oldDir = Directory.GetCurrentDirectory(); OpenFileDialog dialog = new OpenFileDialog(); dialog.AddExtension = true; - dialog.Filter = string.Format("{0} (*." + Branding.SEARCH + ")|*." + Branding.SEARCH, Messages.XENSEARCH_SAVED_SEARCH); + dialog.Filter = string.Format(Messages.XENSEARCH_SAVED_SEARCH, Branding.Search); dialog.FilterIndex = 0; dialog.RestoreDirectory = true; - dialog.DefaultExt = Branding.SEARCH; + dialog.DefaultExt = Branding.Search; dialog.CheckPathExists = false; if (dialog.ShowDialog(Parent) == DialogResult.OK) @@ -108,7 +108,7 @@ namespace XenAdmin.Commands { log.InfoFormat("Importing search from '{0}'", filename); - if (filename.EndsWith("." + Branding.SEARCH) && MainWindowCommandInterface.DoSearch(filename)) + if (filename.EndsWith("." + Branding.Search) && MainWindowCommandInterface.DoSearch(filename)) { log.InfoFormat("Imported search from '{0}' successfully.", filename); } @@ -119,7 +119,7 @@ namespace XenAdmin.Commands new ThreeButtonDialog( new ThreeButtonDialog.Details( SystemIcons.Error, - String.Format(Messages.UNABLE_TO_IMPORT_SEARCH, filename), + String.Format(Messages.UNABLE_TO_IMPORT_SEARCH, filename, Branding.Search), Messages.XENCENTER)).ShowDialog(Parent); } } diff --git a/XenAdmin/Program.cs b/XenAdmin/Program.cs index 8a09276d3..da4df932d 100644 --- a/XenAdmin/Program.cs +++ b/XenAdmin/Program.cs @@ -227,7 +227,7 @@ namespace XenAdmin ConnectionsManager.XenConnections.Clear(); ConnectionsManager.History.Clear(); - Search.InitSearch(); + Search.InitSearch(Branding.Search); TreeSearch.InitSearch(); ArgType argType = ArgType.None; diff --git a/XenAdmin/TabPages/SearchPage.cs b/XenAdmin/TabPages/SearchPage.cs index c22a48f23..f6080d55a 100644 --- a/XenAdmin/TabPages/SearchPage.cs +++ b/XenAdmin/TabPages/SearchPage.cs @@ -290,8 +290,7 @@ namespace XenAdmin.TabPages using (SaveFileDialog dialog = new SaveFileDialog()) { dialog.AddExtension = true; - dialog.Filter = string.Format("{0} (*." + Branding.SEARCH + ")|*." + Branding.SEARCH, - Messages.XENSEARCH_SAVED_SEARCH); + dialog.Filter = string.Format(Messages.XENSEARCH_SAVED_SEARCH, Branding.Search); dialog.FilterIndex = 0; dialog.RestoreDirectory = true; dialog.DefaultExt = Branding.SEARCH; diff --git a/XenModel/InvisibleMessages.Designer.cs b/XenModel/InvisibleMessages.Designer.cs index 2f499d08a..633b5cb38 100644 --- a/XenModel/InvisibleMessages.Designer.cs +++ b/XenModel/InvisibleMessages.Designer.cs @@ -403,7 +403,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to @BRANDING_SEARCH@. + /// Looks up a localized string similar to xensearch. /// public static string XEN_SEARCH { get { diff --git a/XenModel/InvisibleMessages.ja.resx b/XenModel/InvisibleMessages.ja.resx index 3c10d4a08..fb623a8a2 100644 --- a/XenModel/InvisibleMessages.ja.resx +++ b/XenModel/InvisibleMessages.ja.resx @@ -175,7 +175,7 @@ http://citrix.com/English/aboutCitrix/legal/privacyStatement.asp?ntref=hp_nav_US - @BRANDING_SEARCH@ + xensearch http://support.citrix.com/ diff --git a/XenModel/InvisibleMessages.resx b/XenModel/InvisibleMessages.resx index 8ccffe092..5643d935c 100644 --- a/XenModel/InvisibleMessages.resx +++ b/XenModel/InvisibleMessages.resx @@ -178,7 +178,7 @@ http://citrix.com/English/aboutCitrix/legal/privacyStatement.asp?ntref=hp_nav_US - @BRANDING_SEARCH@ + xensearch http://support.citrix.com/ diff --git a/XenModel/InvisibleMessages.zh-CN.resx b/XenModel/InvisibleMessages.zh-CN.resx index 15014f5fe..787ea9180 100644 --- a/XenModel/InvisibleMessages.zh-CN.resx +++ b/XenModel/InvisibleMessages.zh-CN.resx @@ -175,7 +175,7 @@ http://citrix.com/English/aboutCitrix/legal/privacyStatement.asp?ntref=hp_nav_US - @BRANDING_SEARCH@ + xensearch http://support.citrix.com/ diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 154e9c481..3ea065851 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -31609,7 +31609,7 @@ namespace XenAdmin { /// /// Looks up a localized string similar to @BRANDING_BRAND_CONSOLE@ was unable to import a saved search from file '{0}'. /// - ///Verify that the file is a valid @BRANDING_SEARCH@ export.. + ///Verify that the file is a valid {1} export.. /// public static string UNABLE_TO_IMPORT_SEARCH { get { @@ -37026,7 +37026,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to Saved Searches. + /// Looks up a localized string similar to Saved Searches (*.{0})|*.{0}. /// public static string XENSEARCH_SAVED_SEARCH { get { diff --git a/XenModel/Messages.ja.resx b/XenModel/Messages.ja.resx index d9981f040..b72d4289a 100644 --- a/XenModel/Messages.ja.resx +++ b/XenModel/Messages.ja.resx @@ -10409,7 +10409,7 @@ VM が再起動したら、[@BRANDING_PRODUCT_BRAND@ Tools のインストール ファイル '{0}' に保存されている検索をインポートできません。 -このファイルが有効な @BRANDING_SEARCH@ ファイルであることを確認してください。 +このファイルが有効な {1} ファイルであることを確認してください。 ファイルが '{0}' に圧縮解除されます。元のファイル '{1}' は削除されます。続行しますか? @@ -12106,7 +12106,7 @@ VM が再起動したら、[@BRANDING_PRODUCT_BRAND@ Tools のインストール 新しい @BRANDING_BRAND_CONSOLE@ が使用可能 - 保存済みの検索 + 保存済みの検索 (*.{0})|*.{0} @BRANDING_SERVER@ diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 8bca5a3e2..007e4e96a 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -10967,7 +10967,7 @@ Refer to the "@BRANDING_PRODUCT_BRAND@ Administrator's Guide" for instructions o @BRANDING_BRAND_CONSOLE@ was unable to import a saved search from file '{0}'. -Verify that the file is a valid @BRANDING_SEARCH@ export. +Verify that the file is a valid {1} export. @BRANDING_BRAND_CONSOLE@ will uncompress the file to '{0}'. After uncompression the original file '{1}' will be deleted. Continue? @@ -12796,7 +12796,7 @@ Are you sure you want to enable automated power management for this Host?Newer @BRANDING_BRAND_CONSOLE@ Available - Saved Searches + Saved Searches (*.{0})|*.{0} @BRANDING_SERVER@ diff --git a/XenModel/Messages.zh-CN.resx b/XenModel/Messages.zh-CN.resx index 06ee29c6e..cd33d7ffd 100644 --- a/XenModel/Messages.zh-CN.resx +++ b/XenModel/Messages.zh-CN.resx @@ -10412,7 +10412,7 @@ VM 克隆使用文件管理器的快照和克隆功能来实现高性能,并 @BRANDING_BRAND_CONSOLE@ 无法从文件 {0} 中导入保存的搜索。 -请确认该文件属于有效的 @BRANDING_SEARCH@ 导出。 +请确认该文件属于有效的 {1} 导出。 @BRANDING_BRAND_CONSOLE@ 将文件解压到“{0}”。 解压后,将删除原始文件“{1}”。是否继续? @@ -12109,7 +12109,7 @@ VM 克隆使用文件管理器的快照和克隆功能来实现高性能,并 更新的 @BRANDING_BRAND_CONSOLE@ 可用 - 保存的搜索 + 保存的搜索 (*.{0})|*.{0}> @BRANDING_SERVER@ diff --git a/XenModel/XenSearch/Search.cs b/XenModel/XenSearch/Search.cs index 66dbbd18c..be548f335 100644 --- a/XenModel/XenSearch/Search.cs +++ b/XenModel/XenSearch/Search.cs @@ -295,7 +295,7 @@ namespace XenAdmin.XenSearch if (uuid == null) uuid = System.Guid.NewGuid().ToString(); - String key = InvisibleMessages.XEN_SEARCH + ".Search-" + uuid; + String key = SearchPrefix + uuid; String value = GetXML(); if (connection == null) @@ -339,7 +339,7 @@ namespace XenAdmin.XenSearch public void Delete() { - String key = InvisibleMessages.XEN_SEARCH + ".Search-" + uuid; + String key = SearchPrefix + uuid; foreach (IXenConnection connection in ConnectionsManager.XenConnectionsCopy) { @@ -672,6 +672,7 @@ namespace XenAdmin.XenSearch } private static Dictionary searches =new Dictionary(); + public static string BrandedSearchKey { get; private set; } public static event Action SearchesChanged; private static void OnSearchesChanged() @@ -693,9 +694,10 @@ namespace XenAdmin.XenSearch } } - public static void InitSearch() + public static void InitSearch(string brandedSearchKey) { searches = new Dictionary(); + BrandedSearchKey = brandedSearchKey; InitDefaultSearches(); @@ -714,10 +716,14 @@ namespace XenAdmin.XenSearch SynchroniseSearches(); } + private static string SearchPrefix + { + get { return BrandedSearchKey + ".Search-"; } + } + private static void SynchroniseSearches() { Dictionary localSearches = new Dictionary(); - string SearchPrefix = InvisibleMessages.XEN_SEARCH + ".Search-"; foreach (IXenConnection connection in ConnectionsManager.XenConnectionsCopy) { connection.Cache.RegisterBatchCollectionChanged(Pool_BatchCollectionChanged); diff --git a/XenModel/XenSearch/SearchMarshalling.cs b/XenModel/XenSearch/SearchMarshalling.cs index 19599f80a..6af170ccb 100644 --- a/XenModel/XenSearch/SearchMarshalling.cs +++ b/XenModel/XenSearch/SearchMarshalling.cs @@ -307,7 +307,7 @@ namespace XenAdmin.XenSearch document.XmlResolver = new BasicXMLResolver(); document.AppendChild(document.CreateXmlDeclaration("1.0", Encoding.UTF8.WebName, null)); - document.AppendChild(document.CreateDocumentType(InvisibleMessages.XEN_SEARCH, "-//" + InvisibleMessages.XEN_SEARCH.ToUpper() + "//DTD " + InvisibleMessages.XEN_SEARCH.ToUpper() + " 1//EN", InvisibleMessages.XEN_SEARCH + "-1.dtd", null)); + document.AppendChild(document.CreateDocumentType(Search.BrandedSearchKey, "-//" + Search.BrandedSearchKey.ToUpper() + "//DTD " + Search.BrandedSearchKey.ToUpper() + " 1//EN", Search.BrandedSearchKey + "-1.dtd", null)); XmlNode node = document.CreateElement("Searches"); AddAttribute(document, node, "xmlns", xmlns);