summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-02-02 21:22:50 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-02-02 21:22:50 +0200
commite9370893f7f6b3473059c63c42089b42593d6a4d (patch)
treeb5c9b3d6a7c1c966825257a892c37afa787210d8 /indra/newview
parent11b9b6f5f826c26673b79360c79daae7061c9569 (diff)
parenta6615b3264011f186678e7d0380291dd3bedc9aa (diff)
Merge branch 'contribute' into DRTVWR-577-maint-S
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfilepicker.cpp355
-rw-r--r--indra/newview/llfilepicker.h15
-rw-r--r--indra/newview/llfilepicker_mac.h14
-rw-r--r--indra/newview/llfilepicker_mac.mm114
-rw-r--r--indra/newview/llviewermenufile.cpp78
-rw-r--r--indra/newview/llviewermenufile.h3
-rw-r--r--indra/newview/skins/default/xui/da/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/de/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/en/mime_types.xml22
-rw-r--r--indra/newview/skins/default/xui/en/mime_types_mac.xml22
-rw-r--r--indra/newview/skins/default/xui/es/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/fr/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/it/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/ja/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/pt/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/ru/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/tr/floater_about.xml1
-rw-r--r--indra/newview/skins/default/xui/zh/floater_about.xml1
19 files changed, 528 insertions, 106 deletions
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 3669fb1eeb..e6b6c22cc3 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -285,6 +285,15 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
return success;
}
+BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata)
+{
+ // not supposed to be used yet, use LLFilePickerThread
+ LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
+ return FALSE;
+}
+
BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
{
if( mLocked )
@@ -362,6 +371,15 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
return success;
}
+BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata )
+{
+ // not supposed to be used yet, use LLFilePickerThread
+ LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
+ return FALSE;
+}
+
BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
{
if( mLocked )
@@ -584,6 +602,16 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
return success;
}
+BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter,
+ const std::string& filename,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata)
+{
+ // not supposed to be used yet, use LLFilePickerThread
+ LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
+ return FALSE;
+}
+
#elif LL_DARWIN
std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode)
@@ -678,105 +706,123 @@ bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
return false;
}
-bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename)
+bool LLFilePicker::doNavChooseDialogModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &,void*),
+ void *userdata)
{
-
- // Setup the type, creator, and extension
- std::string extension, type, creator;
+ // if local file browsing is turned off, return without opening dialog
+ if ( check_local_file_access_enabled() == false )
+ {
+ return false;
+ }
- switch (filter)
- {
- case FFSAVE_WAV:
- type = "WAVE";
- creator = "TVOD";
- extension = "wav";
- break;
- case FFSAVE_TGA:
- type = "TPIC";
- creator = "prvw";
- extension = "tga";
- break;
- case FFSAVE_TGAPNG:
- type = "PNG";
- creator = "prvw";
- extension = "png,tga";
- break;
- case FFSAVE_BMP:
- type = "BMPf";
- creator = "prvw";
- extension = "bmp";
- break;
- case FFSAVE_JPEG:
- type = "JPEG";
- creator = "prvw";
- extension = "jpeg";
- break;
- case FFSAVE_PNG:
- type = "PNG ";
- creator = "prvw";
- extension = "png";
- break;
- case FFSAVE_AVI:
- type = "\?\?\?\?";
- creator = "\?\?\?\?";
- extension = "mov";
- break;
+ std::vector<std::string> *allowed_types=navOpenFilterProc(filter);
+
+ doLoadDialogModeless(allowed_types,
+ mPickOptions,
+ callback,
+ userdata);
+
+ return true;
+}
- case FFSAVE_ANIM:
- type = "\?\?\?\?";
- creator = "\?\?\?\?";
- extension = "xaf";
- break;
+void set_nav_save_data(LLFilePicker::ESaveFilter filter, std::string &extension, std::string &type, std::string &creator)
+{
+ switch (filter)
+ {
+ case LLFilePicker::FFSAVE_WAV:
+ type = "WAVE";
+ creator = "TVOD";
+ extension = "wav";
+ break;
+ case LLFilePicker::FFSAVE_TGA:
+ type = "TPIC";
+ creator = "prvw";
+ extension = "tga";
+ break;
+ case LLFilePicker::FFSAVE_TGAPNG:
+ type = "PNG";
+ creator = "prvw";
+ extension = "png,tga";
+ break;
+ case LLFilePicker::FFSAVE_BMP:
+ type = "BMPf";
+ creator = "prvw";
+ extension = "bmp";
+ break;
+ case LLFilePicker::FFSAVE_JPEG:
+ type = "JPEG";
+ creator = "prvw";
+ extension = "jpeg";
+ break;
+ case LLFilePicker::FFSAVE_PNG:
+ type = "PNG ";
+ creator = "prvw";
+ extension = "png";
+ break;
+ case LLFilePicker::FFSAVE_AVI:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "mov";
+ break;
+
+ case LLFilePicker::FFSAVE_ANIM:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "xaf";
+ break;
#ifdef _CORY_TESTING
- case FFSAVE_GEOMETRY:
- type = "\?\?\?\?";
- creator = "\?\?\?\?";
- extension = "slg";
- break;
-#endif
-
- case FFSAVE_XML:
- type = "\?\?\?\?";
- creator = "\?\?\?\?";
- extension = "xml";
- break;
-
- case FFSAVE_RAW:
- type = "\?\?\?\?";
- creator = "\?\?\?\?";
- extension = "raw";
- break;
+ case LLFilePicker::FFSAVE_GEOMETRY:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "slg";
+ break;
+#endif
+
+ case LLFilePicker::FFSAVE_XML:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "xml";
+ break;
+
+ case LLFilePicker::FFSAVE_RAW:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "raw";
+ break;
- case FFSAVE_J2C:
- type = "\?\?\?\?";
- creator = "prvw";
- extension = "j2c";
- break;
-
- case FFSAVE_SCRIPT:
- type = "LSL ";
- creator = "\?\?\?\?";
- extension = "lsl";
- break;
-
- case FFSAVE_ALL:
- default:
- type = "\?\?\?\?";
- creator = "\?\?\?\?";
- extension = "";
- break;
- }
+ case LLFilePicker::FFSAVE_J2C:
+ type = "\?\?\?\?";
+ creator = "prvw";
+ extension = "j2c";
+ break;
+
+ case LLFilePicker::FFSAVE_SCRIPT:
+ type = "LSL ";
+ creator = "\?\?\?\?";
+ extension = "lsl";
+ break;
+
+ case LLFilePicker::FFSAVE_ALL:
+ default:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "";
+ break;
+ }
+}
+
+bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename)
+{
+ // Setup the type, creator, and extension
+ std::string extension, type, creator;
+
+ set_nav_save_data(filter, extension, type, creator);
std::string namestring = filename;
if (namestring.empty()) namestring="Untitled";
-// if (! boost::algorithm::ends_with(namestring, extension) )
-// {
-// namestring = namestring + "." + extension;
-//
-// }
-
gViewerWindow->getWindow()->beforeDialog();
// Run the dialog
@@ -797,6 +843,30 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena
return false;
}
+bool LLFilePicker::doNavSaveDialogModeless(ESaveFilter filter,
+ const std::string& filename,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata)
+{
+ // Setup the type, creator, and extension
+ std::string extension, type, creator;
+
+ set_nav_save_data(filter, extension, type, creator);
+
+ std::string namestring = filename;
+ if (namestring.empty()) namestring="Untitled";
+
+ // Run the dialog
+ doSaveDialogModeless(&namestring,
+ &type,
+ &creator,
+ &extension,
+ mPickOptions,
+ callback,
+ userdata);
+ return true;
+}
+
BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
{
if( mLocked )
@@ -852,18 +922,52 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
return success;
}
+
+BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata)
+{
+ if( mLocked )
+ return FALSE;
+
+ // if local file browsing is turned off, return without opening dialog
+ if ( check_local_file_access_enabled() == false )
+ {
+ return FALSE;
+ }
+
+ reset();
+
+ mPickOptions &= ~F_MULTIPLE;
+ mPickOptions |= F_FILE;
+
+ if (filter == FFLOAD_DIRECTORY) //This should only be called from lldirpicker.
+ {
+
+ mPickOptions |= ( F_NAV_SUPPORT | F_DIRECTORY );
+ mPickOptions &= ~F_FILE;
+ }
+
+ if (filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful
+ {
+ mPickOptions |= F_NAV_SUPPORT;
+ }
+
+ return doNavChooseDialogModeless(filter, callback, userdata);
+}
+
BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
{
if( mLocked )
return FALSE;
- BOOL success = FALSE;
-
// if local file browsing is turned off, return without opening dialog
if ( check_local_file_access_enabled() == false )
{
return FALSE;
}
+
+ BOOL success = FALSE;
reset();
@@ -897,6 +1001,29 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
return success;
}
+
+BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata )
+{
+ if( mLocked )
+ return FALSE;
+
+ // if local file browsing is turned off, return without opening dialog
+ if ( check_local_file_access_enabled() == false )
+ {
+ return FALSE;
+ }
+
+ reset();
+
+ mPickOptions |= F_FILE;
+
+ mPickOptions |= F_MULTIPLE;
+
+ return doNavChooseDialogModeless(filter, callback, userdata);
+}
+
BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
{
@@ -937,6 +1064,27 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
LLFrameTimer::updateFrameTime();
return success;
}
+
+BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter,
+ const std::string& filename,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata)
+{
+ if( mLocked )
+ return false;
+
+ // if local file browsing is turned off, return without opening dialog
+ if ( check_local_file_access_enabled() == false )
+ {
+ return false;
+ }
+
+ reset();
+
+ mPickOptions &= ~F_MULTIPLE;
+
+ return doNavSaveDialogModeless(filter, filename, callback, userdata);
+}
//END LL_DARWIN
#elif LL_LINUX
@@ -1444,6 +1592,15 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
return FALSE;
}
+BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter,
+ const std::string& filename,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata)
+{
+ LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
+ return FALSE;
+}
+
BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
{
// if local file browsing is turned off, return without opening dialog
@@ -1469,6 +1626,14 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
return TRUE;
}
+BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata)
+{
+ LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
+ return FALSE;
+}
+
BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
{
// if local file browsing is turned off, return without opening dialog
@@ -1482,6 +1647,14 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
return FALSE;
}
+BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata )
+{
+ LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
+ return FALSE;
+}
+
#endif // LL_GTK
#else // not implemented
diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h
index 04ba4416d7..5e2b7f51f2 100644
--- a/indra/newview/llfilepicker.h
+++ b/indra/newview/llfilepicker.h
@@ -114,8 +114,16 @@ public:
// open the dialog. This is a modal operation
BOOL getSaveFile( ESaveFilter filter = FFSAVE_ALL, const std::string& filename = LLStringUtil::null, bool blocking = true);
+ BOOL getSaveFileModeless(ESaveFilter filter,
+ const std::string& filename,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata);
BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL, bool blocking = true );
+ // Todo: implement getOpenFileModeless and getMultipleOpenFilesModeless
+ // for windows and use directly instead of ugly LLFilePickerThread
+ BOOL getOpenFileModeless( ELoadFilter filter, void (*callback)(bool, std::vector<std::string> &, void*), void *userdata); // MAC only.
BOOL getMultipleOpenFiles( ELoadFilter filter = FFLOAD_ALL, bool blocking = true );
+ BOOL getMultipleOpenFilesModeless( ELoadFilter filter, void (*callback)(bool, std::vector<std::string> &, void*), void *userdata ); // MAC only
// Get the filename(s) found. getFirstFile() sets the pointer to
// the start of the structure and allows the start of iteration.
@@ -166,8 +174,15 @@ private:
std::vector<std::string> mFileVector;
bool doNavChooseDialog(ELoadFilter filter);
+ bool doNavChooseDialogModeless(ELoadFilter filter,
+ void (*callback)(bool, std::vector<std::string>&, void*),
+ void *userdata);
bool doNavSaveDialog(ESaveFilter filter, const std::string& filename);
std::vector<std::string>* navOpenFilterProc(ELoadFilter filter);
+ bool doNavSaveDialogModeless(ESaveFilter filter,
+ const std::string& filename,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata);
#endif
#if LL_GTK
diff --git a/indra/newview/llfilepicker_mac.h b/indra/newview/llfilepicker_mac.h
index e0b7e2e8ce..2ec9d0c4e6 100644
--- a/indra/newview/llfilepicker_mac.h
+++ b/indra/newview/llfilepicker_mac.h
@@ -41,11 +41,25 @@
//void modelessPicker();
std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_types,
unsigned int flags);
+
+void doLoadDialogModeless(const std::vector<std::string>* allowed_types,
+ unsigned int flags,
+ void (*callback)(bool, std::vector<std::string>&, void*),
+ void *userdata);
+
std::string* doSaveDialog(const std::string* file,
const std::string* type,
const std::string* creator,
const std::string* extension,
unsigned int flags);
+
+void doSaveDialogModeless(const std::string* file,
+ const std::string* type,
+ const std::string* creator,
+ const std::string* extension,
+ unsigned int flags,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata);
enum {
F_FILE = 0x00000001,
F_DIRECTORY = 0x00000002,
diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm
index 1438e4dc0a..8f5b3030db 100644
--- a/indra/newview/llfilepicker_mac.mm
+++ b/indra/newview/llfilepicker_mac.mm
@@ -29,27 +29,22 @@
#include <iostream>
#include "llfilepicker_mac.h"
-std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_types,
- unsigned int flags)
+NSOpenPanel *init_panel(const std::vector<std::string>* allowed_types, unsigned int flags)
{
- int i, result;
-
- //Aura TODO: We could init a small window and release it at the end of this routine
- //for a modeless interface.
+ int i;
NSOpenPanel *panel = [NSOpenPanel openPanel];
- //NSString *fileName = nil;
NSMutableArray *fileTypes = nil;
- if ( allowed_types && !allowed_types->empty())
+ if ( allowed_types && !allowed_types->empty())
{
fileTypes = [[NSMutableArray alloc] init];
for (i=0;i<allowed_types->size();++i)
{
- [fileTypes addObject:
- [NSString stringWithCString:(*allowed_types)[i].c_str()
+ [fileTypes addObject:
+ [NSString stringWithCString:(*allowed_types)[i].c_str()
encoding:[NSString defaultCStringEncoding]]];
}
}
@@ -62,21 +57,30 @@ std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_t
[panel setCanChooseFiles: ( (flags & F_FILE)?true:false )];
[panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ];
- std::vector<std::string>* outfiles = NULL;
-
if (fileTypes)
{
[panel setAllowedFileTypes:fileTypes];
- result = [panel runModal];
}
- else
+ else
{
// I suggest it's better to open the last path and let this default to home dir as necessary
// for consistency with other OS X apps
//
//[panel setDirectoryURL: fileURLWithPath(NSHomeDirectory()) ];
- result = [panel runModal];
}
+ return panel;
+}
+
+std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_types,
+ unsigned int flags)
+{
+ int result;
+
+ NSOpenPanel *panel = init_panel(allowed_types,flags);
+
+ result = [panel runModal];
+
+ std::vector<std::string>* outfiles = NULL;
if (result == NSOKButton)
{
@@ -97,6 +101,44 @@ std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_t
return outfiles;
}
+void doLoadDialogModeless(const std::vector<std::string>* allowed_types,
+ unsigned int flags,
+ void (*callback)(bool, std::vector<std::string> &, void*),
+ void *userdata)
+{
+ // Note: might need to return and save this panel
+ // so that it does not close immediately
+ NSOpenPanel *panel = init_panel(allowed_types,flags);
+
+ [panel beginWithCompletionHandler:^(NSModalResponse result)
+ {
+ std::vector<std::string> outfiles;
+ if (result == NSOKButton)
+ {
+ NSArray *filesToOpen = [panel URLs];
+ int i, count = [filesToOpen count];
+
+ if (count > 0)
+ {
+
+ for (i=0; i<count; i++) {
+ NSString *aFile = [[filesToOpen objectAtIndex:i] path];
+ std::string *afilestr = new std::string([aFile UTF8String]);
+ outfiles.push_back(*afilestr);
+ }
+ callback(true, outfiles, userdata);
+ }
+ else // no valid result
+ {
+ callback(false, outfiles, userdata);
+ }
+ }
+ else // cancel
+ {
+ callback(false, outfiles, userdata);
+ }
+ }];
+}
std::string* doSaveDialog(const std::string* file,
const std::string* type,
@@ -130,4 +172,46 @@ std::string* doSaveDialog(const std::string* file,
return outfile;
}
+void doSaveDialogModeless(const std::string* file,
+ const std::string* type,
+ const std::string* creator,
+ const std::string* extension,
+ unsigned int flags,
+ void (*callback)(bool, std::string&, void*),
+ void *userdata)
+{
+ NSSavePanel *panel = [NSSavePanel savePanel];
+
+ NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]];
+ NSArray *fileType = [extensionns componentsSeparatedByString:@","];
+
+ //[panel setMessage:@"Save Image File"];
+ [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ];
+ [panel setCanSelectHiddenExtension:true];
+ [panel setAllowedFileTypes:fileType];
+ NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]];
+
+ NSURL* url = [NSURL fileURLWithPath:fileName];
+ [panel setNameFieldStringValue: fileName];
+ [panel setDirectoryURL: url];
+
+
+ [panel beginWithCompletionHandler:^(NSModalResponse result)
+ {
+ if (result == NSOKButton)
+ {
+ NSURL* url = [panel URL];
+ NSString* p = [url path];
+ std::string outfile([p UTF8String]);
+
+ callback(true, outfile, userdata);
+ }
+ else // cancel
+ {
+ std::string outfile;
+ callback(false, outfile, userdata);
+ }
+ }];
+}
+
#endif
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index fdf1d04c09..27fe7a7018 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -123,7 +123,10 @@ std::queue<LLFilePickerThread*> LLFilePickerThread::sDeadQ;
void LLFilePickerThread::getFile()
{
#if LL_WINDOWS
+ // Todo: get rid of LLFilePickerThread and make this modeless
start();
+#elif LL_DARWIN
+ runModeless();
#else
run();
#endif
@@ -166,7 +169,82 @@ void LLFilePickerThread::run()
LLMutexLock lock(sMutex);
sDeadQ.push(this);
}
+}
+
+void LLFilePickerThread::runModeless()
+{
+ BOOL result = FALSE;
+ LLFilePicker picker;
+
+ if (mIsSaveDialog)
+ {
+ result = picker.getSaveFileModeless(mSaveFilter,
+ mProposedName,
+ modelessStringCallback,
+ this);
+ }
+ else if (mIsGetMultiple)
+ {
+ result = picker.getMultipleOpenFilesModeless(mLoadFilter, modelessVectorCallback, this);
+ }
+ else
+ {
+ result = picker.getOpenFileModeless(mLoadFilter, modelessVectorCallback, this);
+ }
+
+ if (!result)
+ {
+ LLMutexLock lock(sMutex);
+ sDeadQ.push(this);
+ }
+}
+void LLFilePickerThread::modelessStringCallback(bool success,
+ std::string &response,
+ void *user_data)
+{
+ LLFilePickerThread *picker = (LLFilePickerThread*)user_data;
+ if (success)
+ {
+ picker->mResponses.push_back(response);
+ }
+
+ {
+ LLMutexLock lock(sMutex);
+ sDeadQ.push(picker);
+ }
+}
+
+void LLFilePickerThread::modelessVectorCallback(bool success,
+ std::vector<std::string> &responses,
+ void *user_data)
+{
+ LLFilePickerThread *picker = (LLFilePickerThread*)user_data;
+ if (success)
+ {
+ if (picker->mIsGetMultiple)
+ {
+ picker->mResponses = responses;
+ }
+ else
+ {
+ std::vector<std::string>::iterator iter = responses.begin();
+ while (iter != responses.end())
+ {
+ if (!iter->empty())
+ {
+ picker->mResponses.push_back(*iter);
+ break;
+ }
+ iter++;
+ }
+ }
+ }
+
+ {
+ LLMutexLock lock(sMutex);
+ sDeadQ.push(picker);
+ }
}
//static
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index beeac418d9..61572b9996 100644
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -105,6 +105,9 @@ public:
void getFile();
virtual void run();
+ void runModeless();
+ static void modelessStringCallback(bool success, std::string &response, void *user_data);
+ static void modelessVectorCallback(bool success, std::vector<std::string> &responses, void *user_data);
virtual void notify(const std::vector<std::string>& filenames) = 0;
};
diff --git a/indra/newview/skins/default/xui/da/floater_about.xml b/indra/newview/skins/default/xui/da/floater_about.xml
index b322e67bb7..7bcae69779 100644
--- a/indra/newview/skins/default/xui/da/floater_about.xml
+++ b/indra/newview/skins/default/xui/da/floater_about.xml
@@ -70,6 +70,7 @@ PCRE Copyright (c) 1997-2008 University of Cambridge
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler.
google-perftools Copyright (c) 2005, Google Inc.
diff --git a/indra/newview/skins/default/xui/de/floater_about.xml b/indra/newview/skins/default/xui/de/floater_about.xml
index b2708f7141..10ccf0d5da 100644
--- a/indra/newview/skins/default/xui/de/floater_about.xml
+++ b/indra/newview/skins/default/xui/de/floater_about.xml
@@ -29,6 +29,7 @@ mit Open-Source-Beiträgen von:</text>
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga.
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com).
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly und Mark Adler.
Second Life Viewer verwendet Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (und Lizenzgeber). Alle Rechte vorbehalten. Details siehe www.havok.com.
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index eb07425dfe..1ad7811d85 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -112,6 +112,7 @@ Dummy Name replaced at run time
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler.
Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml
index de9ac4247f..a9d99dad27 100644
--- a/indra/newview/skins/default/xui/en/mime_types.xml
+++ b/indra/newview/skins/default/xui/en/mime_types.xml
@@ -309,6 +309,17 @@
media_plugin_cef
</impl>
</mimetype>
+ <mimetype name="application/octet-stream">
+ <label name="application/octet-stream_label">
+ Stream
+ </label>
+ <widgettype>
+ movie
+ </widgettype>
+ <impl>
+ media_plugin_libvlc
+ </impl>
+ </mimetype>
<mimetype name="audio/mid">
<label name="audio/mid_label">
Audio (MIDI)
@@ -474,6 +485,17 @@
media_plugin_libvlc
</impl>
</mimetype>
+ <mimetype name="video/x-flv">
+ <label name="video/x-flv_label">
+ Movie (flv)
+ </label>
+ <widgettype>
+ movie
+ </widgettype>
+ <impl>
+ media_plugin_libvlc
+ </impl>
+ </mimetype>
<mimetype name="application/octet-stream">
<label name="video/octet-stream">
Movie
diff --git a/indra/newview/skins/default/xui/en/mime_types_mac.xml b/indra/newview/skins/default/xui/en/mime_types_mac.xml
index 2d96708b86..7fa0a676dd 100644
--- a/indra/newview/skins/default/xui/en/mime_types_mac.xml
+++ b/indra/newview/skins/default/xui/en/mime_types_mac.xml
@@ -287,6 +287,17 @@
media_plugin_cef
</impl>
</mimetype>
+ <mimetype name="application/octet-stream">
+ <label name="application/octet-stream_label">
+ Stream
+ </label>
+ <widgettype>
+ movie
+ </widgettype>
+ <impl>
+ media_plugin_libvlc
+ </impl>
+ </mimetype>
<mimetype name="audio/mid">
<label name="audio/mid_label">
Audio (MIDI)
@@ -452,6 +463,17 @@
media_plugin_libvlc
</impl>
</mimetype>
+ <mimetype name="video/x-flv">
+ <label name="video/x-flv_label">
+ Movie (flv)
+ </label>
+ <widgettype>
+ movie
+ </widgettype>
+ <impl>
+ media_plugin_libvlc
+ </impl>
+ </mimetype>
<mimetype menu="1" name="video/quicktime">
<label name="video/quicktime_label">
Movie (QuickTime)
diff --git a/indra/newview/skins/default/xui/es/floater_about.xml b/indra/newview/skins/default/xui/es/floater_about.xml
index f59f534908..e14ba32f69 100644
--- a/indra/newview/skins/default/xui/es/floater_about.xml
+++ b/indra/newview/skins/default/xui/es/floater_about.xml
@@ -29,6 +29,7 @@ con contribuciones de código abierto de:</text>
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly y Mark Adler.
El visor de Second Life usa Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (y sus licenciadores). Reservados todos los derechos. Vea los detalles en www.havok.com.
diff --git a/indra/newview/skins/default/xui/fr/floater_about.xml b/indra/newview/skins/default/xui/fr/floater_about.xml
index df6b61e293..09da1fb5fd 100644
--- a/indra/newview/skins/default/xui/fr/floater_about.xml
+++ b/indra/newview/skins/default/xui/fr/floater_about.xml
@@ -29,6 +29,7 @@ avec les contributions Open Source de :</text>
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-Loup Gailly et Mark Adler.
Le client Second Life utilise Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (et ses concédants de licence). Tous droits réservés. Pour plus de détails, consultez le site Web www.havok.com.
diff --git a/indra/newview/skins/default/xui/it/floater_about.xml b/indra/newview/skins/default/xui/it/floater_about.xml
index edb334e13e..7e195d3ca9 100644
--- a/indra/newview/skins/default/xui/it/floater_about.xml
+++ b/indra/newview/skins/default/xui/it/floater_about.xml
@@ -29,6 +29,7 @@ con contributi open source da:</text>
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly e Mark Adler.
Il Viewer Second Life utilizza Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (e licenziatari). Tutti i diritti riservati. Per informazioni dettagliate, vedere www.havok.com.
diff --git a/indra/newview/skins/default/xui/ja/floater_about.xml b/indra/newview/skins/default/xui/ja/floater_about.xml
index 6a39d057e2..22a65003d3 100644
--- a/indra/newview/skins/default/xui/ja/floater_about.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about.xml
@@ -29,6 +29,7 @@ PCRE Copyright (c) 1997-2012 University of Cambridge
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler.
Second Life ビューワでは Havok (TM) Physics が使用されています。(c)Copyright 1999-2010 Havok.com Inc. (and its Licensors).無断複写・複製・転載を禁じます。詳細については www.havok.com をご参照ください。
diff --git a/indra/newview/skins/default/xui/pt/floater_about.xml b/indra/newview/skins/default/xui/pt/floater_about.xml
index 3c0ca332ac..aaed728f84 100644
--- a/indra/newview/skins/default/xui/pt/floater_about.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about.xml
@@ -29,6 +29,7 @@ com contribuições de código aberto de:</text>
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler.
O Visualizador do Second Life usa Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (e seus Licenciantes). Todos os direitos reservados. Consulte www.havok.com para obter detalhes.
diff --git a/indra/newview/skins/default/xui/ru/floater_about.xml b/indra/newview/skins/default/xui/ru/floater_about.xml
index 44216e0430..a65a979ccd 100644
--- a/indra/newview/skins/default/xui/ru/floater_about.xml
+++ b/indra/newview/skins/default/xui/ru/floater_about.xml
@@ -29,6 +29,7 @@
SDL (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib (C) 1995-2012 Jean-loup Gailly и Mark Adler.
В клиенте Second Life используется технология Havok (TM) Physics. (C) 1999-2010 Havok.com Inc. (и лицензиары компании). Все права защищены. Подробнее см. веб-сайт www.havok.com.
diff --git a/indra/newview/skins/default/xui/tr/floater_about.xml b/indra/newview/skins/default/xui/tr/floater_about.xml
index faa504a996..40ca3707c3 100644
--- a/indra/newview/skins/default/xui/tr/floater_about.xml
+++ b/indra/newview/skins/default/xui/tr/floater_about.xml
@@ -29,6 +29,7 @@ açık kaynak kod katkısında bulunanlar şunlardır:</text>
SDL Telif Hakkı (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Telif Hakkı (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Telif Hakkı (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Telif Hakkı (C) 1995-2012 Jean-loup Gailly ve Mark Adler.
Second Life Görüntüleyicisi Havok (TM) Fizik motorunu kullanmaktadır. (c)Telif Hakkı 1999-2010 Havok.com Inc. (ve Lisans Verenleri). Tüm Hakları Saklıdır. Ayrıntılı bilgi için bkz. www.havok.com
diff --git a/indra/newview/skins/default/xui/zh/floater_about.xml b/indra/newview/skins/default/xui/zh/floater_about.xml
index d7d2a52750..a56ae753d1 100644
--- a/indra/newview/skins/default/xui/zh/floater_about.xml
+++ b/indra/newview/skins/default/xui/zh/floater_about.xml
@@ -29,6 +29,7 @@
SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
xmlrpc-epi Copyright (C) 2000 Epinions, Inc.
+ xxHash Copyright (C) 2012-2020 Yann Collet.
zlib Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler.
第二人生 Viewer 採用 Havok (TM) 物理引擎。 (c)Copyright 1999-2010 Havok.com Inc.(及其放照人)。 保留一切權利。 詳情見 www.havok.com。