summaryrefslogtreecommitdiff
path: root/indra/newview/llfilepicker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfilepicker.cpp')
-rw-r--r--indra/newview/llfilepicker.cpp250
1 files changed, 125 insertions, 125 deletions
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index b82172c506..6b19fe60d8 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -169,9 +169,9 @@ void LLFilePicker::reset()
#if LL_WINDOWS
-BOOL LLFilePicker::setupFilter(ELoadFilter filter)
+bool LLFilePicker::setupFilter(ELoadFilter filter)
{
- BOOL res = TRUE;
+ bool res = true;
switch (filter)
{
case FFLOAD_ALL:
@@ -242,24 +242,24 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter)
L"\0";
break;
default:
- res = FALSE;
+ res = false;
break;
}
return res;
}
-BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
+bool LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
{
- if( mLocked )
+ if (mLocked)
{
- return FALSE;
+ return false;
}
- BOOL success = FALSE;
+ bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
// don't provide default file selection
@@ -299,27 +299,27 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
return success;
}
-BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
+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;
+ return false;
}
-BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
+bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
{
if( mLocked )
{
- return FALSE;
+ return false;
}
- BOOL success = FALSE;
+ bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
// don't provide default file selection
@@ -385,27 +385,27 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
return success;
}
-BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
+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;
+ return false;
}
-BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
+bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
{
if( mLocked )
{
- return FALSE;
+ return false;
}
- BOOL success = FALSE;
+ bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
mOFN.lpstrFile = mFilesW;
@@ -571,7 +571,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
mOFN.lpstrFilter = L"LSL Files (*.lsl)\0*.lsl\0" L"\0";
break;
default:
- return FALSE;
+ return false;
}
@@ -614,14 +614,14 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
return success;
}
-BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter,
+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;
+ return false;
}
#elif LL_DARWIN
@@ -695,18 +695,18 @@ std::unique_ptr<std::vector<std::string>> LLFilePicker::navOpenFilterProc(ELoadF
return allowedv;
}
-bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
+bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
{
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
-
+
gViewerWindow->getWindow()->beforeDialog();
-
+
std::unique_ptr<std::vector<std::string>> allowed_types = navOpenFilterProc(filter);
-
+
std::unique_ptr<std::vector<std::string>> filev = doLoadDialog(allowed_types.get(),
mPickOptions);
@@ -718,27 +718,27 @@ bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
mFiles.insert(mFiles.end(), filev->begin(), filev->end());
return true;
}
-
+
return false;
}
-bool LLFilePicker::doNavChooseDialogModeless(ELoadFilter filter,
+bool LLFilePicker::doNavChooseDialogModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &,void*),
void *userdata)
{
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
-
+
std::unique_ptr<std::vector<std::string>> allowed_types=navOpenFilterProc(filter);
-
+
doLoadDialogModeless(allowed_types.get(),
mPickOptions,
callback,
userdata);
-
+
return true;
}
@@ -790,7 +790,7 @@ void set_nav_save_data(LLFilePicker::ESaveFilter filter, std::string &extension,
case LLFilePicker::FFSAVE_GLTF:
type = "\?\?\?\?";
creator = "\?\?\?\?";
- extension = "glb";
+ extension = "glb,gltf";
break;
case LLFilePicker::FFSAVE_XML:
@@ -826,16 +826,16 @@ void set_nav_save_data(LLFilePicker::ESaveFilter filter, std::string &extension,
}
}
-bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename)
+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";
-
+
gViewerWindow->getWindow()->beforeDialog();
// Run the dialog
@@ -852,20 +852,20 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena
mFiles.push_back(*filev);
return true;
}
-
+
return false;
}
-bool LLFilePicker::doNavSaveDialogModeless(ESaveFilter filter,
+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";
@@ -880,27 +880,26 @@ bool LLFilePicker::doNavSaveDialogModeless(ESaveFilter filter,
return true;
}
-BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
+bool LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
{
if( mLocked )
- return FALSE;
+ return false;
- BOOL success = FALSE;
+ bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return 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;
}
@@ -936,17 +935,17 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
}
-BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
+bool LLFilePicker::getOpenFileModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &, void*),
void *userdata)
{
- if( mLocked )
- return FALSE;
+ if (mLocked)
+ return false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
reset();
@@ -969,21 +968,21 @@ BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
return doNavChooseDialogModeless(filter, callback, userdata);
}
-BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
+bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
{
- if( mLocked )
- return FALSE;
+ if (mLocked)
+ return false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
-
- BOOL success = FALSE;
+
+ bool success = false;
reset();
-
+
mPickOptions |= F_FILE;
mPickOptions |= F_MULTIPLE;
@@ -1015,21 +1014,21 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
}
-BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
+bool LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &, void*),
void *userdata )
{
- if( mLocked )
- return FALSE;
+ if (mLocked)
+ return false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
reset();
-
+
mPickOptions |= F_FILE;
mPickOptions |= F_MULTIPLE;
@@ -1037,21 +1036,22 @@ BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
return doNavChooseDialogModeless(filter, callback, userdata);
}
-BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
+bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
{
- if( mLocked )
+ if (mLocked)
return false;
- BOOL success = false;
+
+ bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
mPickOptions &= ~F_MULTIPLE;
if (blocking)
@@ -1078,22 +1078,22 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
return success;
}
-BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter,
+bool LLFilePicker::getSaveFileModeless(ESaveFilter filter,
const std::string& filename,
void (*callback)(bool, std::string&, void*),
void *userdata)
{
- if( mLocked )
+ if (mLocked)
return false;
-
+
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
mPickOptions &= ~F_MULTIPLE;
return doNavSaveDialogModeless(filter, filename, callback, userdata);
@@ -1367,20 +1367,20 @@ static std::string add_save_texture_filter_to_gtkchooser(GtkWindow *picker)
return caption;
}
-BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking )
+bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking )
{
- BOOL rtn = FALSE;
+ bool rtn = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
gViewerWindow->getWindow()->beforeDialog();
reset();
-
+
GtkWindow* picker = buildFilePicker(true, false, "savefile");
if (picker)
@@ -1448,7 +1448,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename,
default:;
break;
}
-
+
gtk_window_set_title(GTK_WINDOW(picker), caption.c_str());
if (filename.empty())
@@ -1484,20 +1484,20 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename,
return rtn;
}
-BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
+bool LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
{
- BOOL rtn = FALSE;
+ bool rtn = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
gViewerWindow->getWindow()->beforeDialog();
reset();
-
+
GtkWindow* picker = buildFilePicker(false, false, "openfile");
if (picker)
@@ -1549,14 +1549,14 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
return rtn;
}
-BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
+bool LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
{
- BOOL rtn = FALSE;
+ bool rtn = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
gViewerWindow->getWindow()->beforeDialog();
@@ -1587,47 +1587,47 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
// Hacky stubs designed to facilitate fake getSaveFile and getOpenFile with
// static results, when we don't have a real filepicker.
-BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking )
+bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking )
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
reset();
-
+
LL_INFOS() << "getSaveFile suggested filename is [" << filename
<< "]" << LL_ENDL;
if (!filename.empty())
{
mFiles.push_back(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + filename);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter,
+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;
+ return false;
}
-BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
+bool LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
reset();
-
+
// HACK: Static filenames for 'open' until we implement filepicker
std::string filename = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + "upload";
switch (filter)
@@ -1639,58 +1639,58 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
}
mFiles.push_back(filename);
LL_INFOS() << "getOpenFile: Will try to open file: " << filename << LL_ENDL;
- return TRUE;
+ return true;
}
-BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter,
+bool LLFilePicker::getOpenFileModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &, void*),
void *userdata)
{
LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
- return FALSE;
+ return false;
}
-BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
+bool LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
- return FALSE;
+ return false;
}
reset();
- return FALSE;
+ return false;
}
-BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
+bool LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &, void*),
void *userdata )
{
LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL;
- return FALSE;
+ return false;
}
#endif // LL_GTK
#else // not implemented
-BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename )
+bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename )
{
reset();
- return FALSE;
+ return false;
}
-BOOL LLFilePicker::getOpenFile( ELoadFilter filter )
+bool LLFilePicker::getOpenFile( ELoadFilter filter )
{
reset();
- return FALSE;
+ return false;
}
-BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
+bool LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
{
reset();
- return FALSE;
+ return false;
}
#endif // LL_LINUX