diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-05-08 21:42:32 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-05-08 21:42:32 +0300 |
commit | 28ddde936d1a43f6d702504f868ec3cc7ec4f60e (patch) | |
tree | ccc06eb3ae7922442c7b9a970ff6689eb6bef9dc /indra/newview/llfloateruipreview.cpp | |
parent | 07f1c4c9c59c3b825a605dd9c695aae492bbf09c (diff) | |
parent | 34322f8f37380df868703051230f2a4109602b3f (diff) |
Merged in lindenlab/viewer-release
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..db5a192287 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 { |