Pull in Dullahan 1.1.929 (multiple file picking support) and update plugin code accordingly

Thu, 14 Dec 2017 14:27:49 -0800

author
callum_linden <callum@lindenlab.com>
date
Thu, 14 Dec 2017 14:27:49 -0800
changeset 55045
0d923cae762e
parent 55044
3516b95e9d6c
child 55046
ab438756835d

Pull in Dullahan 1.1.929 (multiple file picking support) and update plugin code accordingly

autobuild.xml file | annotate | diff | revisions
indra/llplugin/llpluginclassmedia.cpp file | annotate | diff | revisions
indra/llplugin/llpluginclassmedia.h file | annotate | diff | revisions
indra/media_plugins/cef/media_plugin_cef.cpp file | annotate | diff | revisions
indra/newview/llviewermedia.cpp file | annotate | diff | revisions
     1.1 --- a/autobuild.xml	Wed Dec 13 13:55:33 2017 -0800
     1.2 +++ b/autobuild.xml	Thu Dec 14 14:27:49 2017 -0800
     1.3 @@ -556,9 +556,9 @@
     1.4              <key>archive</key>
     1.5              <map>
     1.6                <key>hash</key>
     1.7 -              <string>1937f9f84f0f33563b9d33cf1c8e695a</string>
     1.8 +              <string>4332ef6c8e8d7462ee42c99045b0cd87</string>
     1.9                <key>url</key>
    1.10 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11646/67094/dullahan-1.1.925_3.3202.1686.gd665578-darwin64-511376.tar.bz2</string>
    1.11 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11702/67585/dullahan-1.1.929_3.3202.1686.gd665578-darwin64-511421.tar.bz2</string>
    1.12              </map>
    1.13              <key>name</key>
    1.14              <string>darwin64</string>
    1.15 @@ -568,9 +568,9 @@
    1.16              <key>archive</key>
    1.17              <map>
    1.18                <key>hash</key>
    1.19 -              <string>08edc9fa2dc586e7a1c7c4b7a6b6c548</string>
    1.20 +              <string>001b4ae5c536ee625cf2f85e3bdf2d89</string>
    1.21                <key>url</key>
    1.22 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11648/67101/dullahan-1.1.925_3.3202.1686.gd665578-windows-511376.tar.bz2</string>
    1.23 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11703/67592/dullahan-1.1.929_3.3202.1686.gd665578-windows-511421.tar.bz2</string>
    1.24              </map>
    1.25              <key>name</key>
    1.26              <string>windows</string>
    1.27 @@ -580,16 +580,16 @@
    1.28              <key>archive</key>
    1.29              <map>
    1.30                <key>hash</key>
    1.31 -              <string>b220e427ade837e45a92fffab02c068f</string>
    1.32 +              <string>90f1926a1e3cd3ae56acd662ad9c0bdc</string>
    1.33                <key>url</key>
    1.34 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11649/67106/dullahan-1.1.925_3.3202.1686.gd665578-windows64-511376.tar.bz2</string>
    1.35 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11704/67597/dullahan-1.1.929_3.3202.1686.gd665578-windows64-511421.tar.bz2</string>
    1.36              </map>
    1.37              <key>name</key>
    1.38              <string>windows64</string>
    1.39            </map>
    1.40          </map>
    1.41          <key>version</key>
    1.42 -        <string>1.1.925_3.3202.1686.gd665578</string>
    1.43 +        <string>1.1.929_3.3202.1686.gd665578</string>
    1.44        </map>
    1.45        <key>elfio</key>
    1.46        <map>
     2.1 --- a/indra/llplugin/llpluginclassmedia.cpp	Wed Dec 13 13:55:33 2017 -0800
     2.2 +++ b/indra/llplugin/llpluginclassmedia.cpp	Thu Dec 14 14:27:49 2017 -0800
     2.3 @@ -792,15 +792,22 @@
     2.4  	return result;
     2.5  }
     2.6  
     2.7 -void LLPluginClassMedia::sendPickFileResponse(const std::string &file)
     2.8 +void LLPluginClassMedia::sendPickFileResponse(const std::vector<std::string> files)
     2.9  {
    2.10  	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response");
    2.11 -	message.setValue("file", file);
    2.12  	if(mPlugin && mPlugin->isBlocked())
    2.13  	{
    2.14  		// If the plugin sent a blocking pick-file request, the response should unblock it.
    2.15  		message.setValueBoolean("blocking_response", true);
    2.16  	}
    2.17 +
    2.18 +	LLSD file_list = LLSD::emptyArray();
    2.19 +	for (std::vector<std::string>::const_iterator in_iter = files.begin(); in_iter != files.end(); ++in_iter)
    2.20 +	{
    2.21 +		file_list.append(LLSD::String(*in_iter));
    2.22 +	}
    2.23 +	message.setValueLLSD("file_list", file_list);
    2.24 +
    2.25  	sendMessage(message);
    2.26  }
    2.27  
    2.28 @@ -1090,6 +1097,7 @@
    2.29  		}
    2.30  		else if(message_name == "pick_file")
    2.31  		{
    2.32 +			mIsMultipleFilePick = message.getValueBoolean("multiple_files");
    2.33  			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PICK_FILE_REQUEST);
    2.34  		}
    2.35  		else if(message_name == "auth_request")
     3.1 --- a/indra/llplugin/llpluginclassmedia.h	Wed Dec 13 13:55:33 2017 -0800
     3.2 +++ b/indra/llplugin/llpluginclassmedia.h	Thu Dec 14 14:27:49 2017 -0800
     3.3 @@ -176,7 +176,7 @@
     3.4  	
     3.5  	F64 getCPUUsage();
     3.6  	
     3.7 -	void sendPickFileResponse(const std::string &file);
     3.8 +	void sendPickFileResponse(const std::vector<std::string> files);
     3.9  
    3.10  	void sendAuthResponse(bool ok, const std::string &username, const std::string &password);
    3.11  
    3.12 @@ -277,6 +277,9 @@
    3.13  	std::string	getAuthURL() const { return mAuthURL; };
    3.14  	std::string	getAuthRealm() const { return mAuthRealm; };
    3.15  
    3.16 +	// These are valid during MEDIA_EVENT_PICK_FILE_REQUEST
    3.17 +	bool getIsMultipleFilePick() const { return mIsMultipleFilePick; }
    3.18 +
    3.19  	// These are valid during MEDIA_EVENT_LINK_HOVERED
    3.20  	std::string	getHoverText() const { return mHoverText; };
    3.21  	std::string	getHoverLink() const { return mHoverLink; };
    3.22 @@ -435,6 +438,7 @@
    3.23  	std::string		mHoverText;
    3.24  	std::string		mHoverLink;
    3.25  	std::string     mFileDownloadFilename;
    3.26 +	bool			mIsMultipleFilePick;
    3.27  	
    3.28  	/////////////////////////////////////////
    3.29  	// media_time class
     4.1 --- a/indra/media_plugins/cef/media_plugin_cef.cpp	Wed Dec 13 13:55:33 2017 -0800
     4.2 +++ b/indra/media_plugins/cef/media_plugin_cef.cpp	Thu Dec 14 14:27:49 2017 -0800
     4.3 @@ -68,7 +68,7 @@
     4.4  	void onNavigateURLCallback(std::string url, std::string target);
     4.5  	bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
     4.6  	void onCursorChangedCallback(dullahan::ECursorType type);
     4.7 -	const std::string onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, const std::string dialog_accept_filter, bool& use_default);
     4.8 +	const std::vector<std::string> onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, const std::string dialog_accept_filter, bool& use_default);
     4.9  
    4.10  	void postDebugMessage(const std::string& msg);
    4.11  	void authResponse(LLPluginMessage &message);
    4.12 @@ -94,7 +94,7 @@
    4.13  	bool mCanPaste;
    4.14  	std::string mCachePath;
    4.15  	std::string mCookiePath;
    4.16 -	std::string mPickedFile;
    4.17 +	std::vector<std::string> mPickedFiles;
    4.18  	VolumeCatcher mVolumeCatcher;
    4.19  	F32 mCurVolume;
    4.20  	dullahan* mCEFLib;
    4.21 @@ -124,7 +124,7 @@
    4.22  	mCanPaste = false;
    4.23  	mCachePath = "";
    4.24  	mCookiePath = "";
    4.25 -	mPickedFile = "";
    4.26 +	mPickedFiles.clear();
    4.27  	mCurVolume = 0.0;
    4.28  
    4.29  	mCEFLib = new dullahan();
    4.30 @@ -284,21 +284,34 @@
    4.31  
    4.32  ////////////////////////////////////////////////////////////////////////////////
    4.33  //
    4.34 -const std::string MediaPluginCEF::onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, std::string dialog_accept_filter, bool& use_default)
    4.35 +const std::vector<std::string> MediaPluginCEF::onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, std::string dialog_accept_filter, bool& use_default)
    4.36  {
    4.37  	// do not use the default CEF file picker
    4.38  	use_default = false;
    4.39  
    4.40  	if (dialog_type == dullahan::FD_OPEN_FILE)
    4.41  	{
    4.42 -		mPickedFile.clear();
    4.43 +		mPickedFiles.clear();
    4.44  
    4.45  		LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file");
    4.46  		message.setValueBoolean("blocking_request", true);
    4.47 +		message.setValueBoolean("multiple_files", false);
    4.48  
    4.49  		sendMessage(message);
    4.50  
    4.51 -		return mPickedFile;
    4.52 +		return mPickedFiles;
    4.53 +	}
    4.54 +	else if (dialog_type == dullahan::FD_OPEN_MULTIPLE_FILES)
    4.55 +	{
    4.56 +		mPickedFiles.clear();
    4.57 +
    4.58 +		LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file");
    4.59 +		message.setValueBoolean("blocking_request", true);
    4.60 +		message.setValueBoolean("multiple_files", true);
    4.61 +
    4.62 +		sendMessage(message);
    4.63 +
    4.64 +		return mPickedFiles;
    4.65  	}
    4.66  	else if (dialog_type == dullahan::FD_SAVE_FILE)
    4.67  	{
    4.68 @@ -309,10 +322,10 @@
    4.69  
    4.70  		sendMessage(message);
    4.71  
    4.72 -		return std::string();
    4.73 +		return std::vector<std::string>();
    4.74  	}
    4.75  
    4.76 -	return std::string();
    4.77 +	return std::vector<std::string>();
    4.78  }
    4.79  
    4.80  ////////////////////////////////////////////////////////////////////////////////
    4.81 @@ -659,7 +672,14 @@
    4.82  			}
    4.83  			if (message_name == "pick_file_response")
    4.84  			{
    4.85 -				mPickedFile = message_in.getValue("file");
    4.86 +				LLSD file_list_llsd = message_in.getValueLLSD("file_list");
    4.87 +
    4.88 +				LLSD::array_const_iterator iter = file_list_llsd.beginArray();
    4.89 +				LLSD::array_const_iterator end = file_list_llsd.endArray();
    4.90 +				for (; iter != end; ++iter)
    4.91 +				{
    4.92 +					mPickedFiles.push_back(((*iter).asString()));
    4.93 +				}
    4.94  			}
    4.95  			if (message_name == "auth_response")
    4.96  			{
     5.1 --- a/indra/newview/llviewermedia.cpp	Wed Dec 13 13:55:33 2017 -0800
     5.2 +++ b/indra/newview/llviewermedia.cpp	Thu Dec 14 14:27:49 2017 -0800
     5.3 @@ -3480,22 +3480,40 @@
     5.4  
     5.5  		case LLViewerMediaObserver::MEDIA_EVENT_PICK_FILE_REQUEST:
     5.6  		{
     5.7 -			// Display a file picker
     5.8 -			std::string response;
     5.9 -
    5.10  			LLFilePicker& picker = LLFilePicker::instance();
    5.11 -			if (!picker.getOpenFile(LLFilePicker::FFLOAD_ALL))
    5.12 +			std::vector<std::string> responses;
    5.13 +
    5.14 +			bool pick_multiple_files = plugin->getIsMultipleFilePick();
    5.15 +			if (pick_multiple_files == false)
    5.16  			{
    5.17 -				// The user didn't pick a file -- the empty response string will indicate this.
    5.18 +				picker.getOpenFile(LLFilePicker::FFLOAD_ALL);
    5.19 +
    5.20 +				std::string filename = picker.getFirstFile();
    5.21 +				responses.push_back(filename);
    5.22  			}
    5.23 -
    5.24 -			response = picker.getFirstFile();
    5.25 -
    5.26 -			plugin->sendPickFileResponse(response);
    5.27 +			else
    5.28 +			{
    5.29 +				if (picker.getMultipleOpenFiles())
    5.30 +				{
    5.31 +					std::string filename = picker.getFirstFile();
    5.32 +
    5.33 +					responses.push_back(filename);
    5.34 +
    5.35 +					while (!filename.empty())
    5.36 +					{
    5.37 +						filename = picker.getNextFile();
    5.38 +
    5.39 +						if (!filename.empty())
    5.40 +						{
    5.41 +							responses.push_back(filename);
    5.42 +						}
    5.43 +					}
    5.44 +				}
    5.45 +			}
    5.46 +			plugin->sendPickFileResponse(responses);
    5.47  		}
    5.48  		break;
    5.49  
    5.50 -
    5.51  		case LLViewerMediaObserver::MEDIA_EVENT_AUTH_REQUEST:
    5.52  		{
    5.53  			LLNotification::Params auth_request_params;

mercurial