From eef9b265b951337d0633d18186dad2b734b30d5a Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 7 Mar 2011 19:18:31 +0200 Subject: STORM-1018 FIXED Improved error messaging for the External Editor feature. Let the user know what's wrong with external editor. Added meaningful messages for the following errors: * Editor not specified. * Error parsing command line. * Specified binary not found. * Editor failed to run. All the messages are translatable. --- indra/newview/llfloateruipreview.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloateruipreview.cpp') diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 11b3379814..0d8601410a 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -1037,18 +1037,29 @@ void LLFloaterUIPreview::onClickEditFloater() cmd_override = bin + " " + args; } } - if (!mExternalEditor.setCommand("LL_XUI_EDITOR", cmd_override)) + + LLExternalEditor::EErrorCode status = mExternalEditor.setCommand("LL_XUI_EDITOR", cmd_override); + if (status != LLExternalEditor::EC_SUCCESS) { - std::string warning = "Select an editor by setting the environment variable LL_XUI_EDITOR " - "or the ExternalEditor setting or specifying its path in the \"Editor Path\" field."; + std::string warning; + + if (status == LLExternalEditor::EC_NOT_SPECIFIED) // Use custom message for this error. + { + warning = getString("ExternalEditorNotSet"); + } + else + { + warning = LLExternalEditor::getErrorMessage(status); + } + popupAndPrintWarning(warning); return; } // Run the editor. - if (!mExternalEditor.run(file_path)) + if (mExternalEditor.run(file_path) != LLExternalEditor::EC_SUCCESS) { - popupAndPrintWarning("Failed to run editor"); + popupAndPrintWarning(LLExternalEditor::getErrorMessage(status)); return; } } -- cgit v1.2.3