diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-11-21 17:41:15 +0200 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-11-21 17:41:15 +0200 |
commit | c99a66a482d8893055be6e130bae22d3d67d123e (patch) | |
tree | 9ada65fed70ab8f756ff794d43162c55ca5aebcd /indra/newview/llfloateruipreview.cpp | |
parent | faf79976c0ad3ea9406f3c13348c6ee27837ef2c (diff) |
SL-10113 FIXED [Win] File pickers are not threaded in XUI preview floater
Diffstat (limited to 'indra/newview/llfloateruipreview.cpp')
-rw-r--r-- | indra/newview/llfloateruipreview.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 76ad2146f1..4e0b27a4f8 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -60,6 +60,7 @@ #include "llfloaterreg.h" #include "llscrollcontainer.h" // scroll container for overlapping elements #include "lllivefile.h" // live file poll/stat/reload +#include "llviewermenufile.h" // LLFilePickerReplyThread // Boost (for linux/unix command-line execv) #include <boost/tokenizer.hpp> @@ -206,7 +207,9 @@ private: void onClickSaveAll(S32 id); void onClickEditFloater(); void onClickBrowseForEditor(); + void getExecutablePath(const std::vector<std::string>& filenames); void onClickBrowseForDiffs(); + void getDiffsFilePath(const std::vector<std::string>& filenames); void onClickToggleDiffHighlighting(); void onClickToggleOverlapping(); void onClickCloseDisplayedFloater(S32 id); @@ -1019,15 +1022,14 @@ void LLFloaterUIPreview::onClickEditFloater() // Respond to button click to browse for an executable with which to edit XML files void LLFloaterUIPreview::onClickBrowseForEditor() { - // Let the user choose an executable through the file picker dialog box - LLFilePicker& picker = LLFilePicker::instance(); - if (!picker.getOpenFile(LLFilePicker::FFLOAD_EXE)) - { - return; // user cancelled -- do nothing - } + // Let the user choose an executable through the file picker dialog box + (new LLFilePickerReplyThread(boost::bind(&LLFloaterUIPreview::getExecutablePath, this, _1), LLFilePicker::FFLOAD_EXE, false))->getFile();
+} +void LLFloaterUIPreview::getExecutablePath(const std::vector<std::string>& filenames) +{ // put the selected path into text field - const std::string chosen_path = picker.getFirstFile(); + const std::string chosen_path = filenames[0]; std::string executable_path = chosen_path; #if LL_DARWIN // on Mac, if it's an application bundle, figure out the actual path from the Info.plist file @@ -1075,15 +1077,13 @@ void LLFloaterUIPreview::onClickBrowseForEditor() void LLFloaterUIPreview::onClickBrowseForDiffs() { // create load dialog box - LLFilePicker::ELoadFilter type = (LLFilePicker::ELoadFilter)((intptr_t)((void*)LLFilePicker::FFLOAD_XML)); // nothing for *.exe so just use all - LLFilePicker& picker = LLFilePicker::instance(); - if (!picker.getOpenFile(type)) // user cancelled -- do nothing - { - return; - } + (new LLFilePickerReplyThread(boost::bind(&LLFloaterUIPreview::getDiffsFilePath, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile();
+} +void LLFloaterUIPreview::getDiffsFilePath(const std::vector<std::string>& filenames) +{ // put the selected path into text field - const std::string chosen_path = picker.getFirstFile(); + const std::string chosen_path = filenames[0]; mDiffPathTextBox->setText(std::string(chosen_path)); // copy the path to the executable to the textfield for display and later fetching if(LLView::sHighlightingDiffs) // if we're already highlighting, toggle off and then on so we get the data from the new file { |