From 067bea25e06477edf964a37ef246643cab12f3fa Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Fri, 30 May 2025 20:30:04 +0200 Subject: [PATCH] Use LLFilePickerReplyThread instead of LLFilePicker in access/ban lists exporting --- indra/newview/llfloaterland.cpp | 15 ++++++++++----- indra/newview/llfloaterland.h | 1 + indra/newview/llfloaterregioninfo.cpp | 13 +++++++++---- indra/newview/llfloaterregioninfo.h | 1 + 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index a3a13fca96..8c940f69e6 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -43,7 +43,6 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcombobox.h" -#include "llfilepicker.h" // Ban and access lists export #include "llfloaterreg.h" #include "llfloateravatarpicker.h" #include "llfloaterauction.h" @@ -69,6 +68,7 @@ #include "lluiconstants.h" #include "lluictrlfactory.h" #include "llviewertexturelist.h" // LLUIImageList +#include "llviewermenufile.h" // Ban and access lists export #include "llviewermessage.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -3312,15 +3312,20 @@ void LLPanelLandAccess::onClickExportBanned() void LLPanelLandAccess::exportList(LLNameListCtrl* list, const std::string& default_filename) { - if (!list) return; + if (list) + { + LLFilePickerReplyThread::startPicker(boost::bind(&LLPanelLandAccess::exportListCallback, this, list, _1), LLFilePicker::FFSAVE_CSV, default_filename); + } +} - LLFilePicker& picker = LLFilePicker::instance(); - if (!picker.getSaveFile(LLFilePicker::FFSAVE_CSV, default_filename)) +void LLPanelLandAccess::exportListCallback(LLNameListCtrl* list, const std::vector& filenames) +{ + if (filenames.empty()) { return; } - std::string filename = picker.getFirstFile(); + std::string filename = filenames[0]; std::ofstream file(filename.c_str()); if (!file.is_open()) { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 71e01996e0..92eeaa1e49 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -410,6 +410,7 @@ public: void onClickExportBanned(); void onClickExportList(LLNameListCtrl* list, const std::string& filename); void exportList(LLNameListCtrl* list, const std::string& default_filename); + void exportListCallback(LLNameListCtrl* list, const std::vector& filenames); // Ban and access lists export protected: diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 75eb8bc12d..538988b513 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -4656,15 +4656,20 @@ void LLPanelEstateAccess::onClickExportBannedList() void LLPanelEstateAccess::exportList(LLNameListCtrl* list, const std::string& default_filename) { - if (!list) return; + if (list) + { + LLFilePickerReplyThread::startPicker(boost::bind(&LLPanelEstateAccess::exportListCallback, this, list, _1), LLFilePicker::FFSAVE_CSV, default_filename); + } +} - LLFilePicker& picker = LLFilePicker::instance(); - if (!picker.getSaveFile(LLFilePicker::FFSAVE_CSV, default_filename)) +void LLPanelEstateAccess::exportListCallback(LLNameListCtrl* list, const std::vector& filenames) +{ + if (filenames.empty()) { return; } - std::string filename = picker.getFirstFile(); + std::string filename = filenames[0]; std::ofstream file(filename.c_str()); if (!file.is_open()) { diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 5d7a832463..676e56b9d7 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -515,6 +515,7 @@ public: void onClickExportBannedList(); void onClickExportList(LLNameListCtrl* list, const std::string& filename); void exportList(LLNameListCtrl* list, const std::string& default_filename); + void exportListCallback(LLNameListCtrl* list, const std::vector& filenames); // Ban and access lists export private: