summaryrefslogtreecommitdiff
path: root/indra/newview/llfilepicker.cpp
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2012-06-04 16:10:32 +0200
committerKitty Barnett <develop@catznip.com>2012-06-04 16:10:32 +0200
commit20210455f5a350b3e8e24515ba7af71db0eece0b (patch)
tree50e0150f86a43dc0488dc7f8615cbbcda9b222bc /indra/newview/llfilepicker.cpp
parent17605cc894ad458915d958919554345334892eb0 (diff)
STORM-276 Dictionary import functionality and floater
Diffstat (limited to 'indra/newview/llfilepicker.cpp')
-rw-r--r--indra/newview/llfilepicker.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 8986a694f9..cbb5a40cfa 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -59,6 +59,7 @@ LLFilePicker LLFilePicker::sInstance;
#define RAW_FILTER L"RAW files (*.raw)\0*.raw\0"
#define MODEL_FILTER L"Model files (*.dae)\0*.dae\0"
#define SCRIPT_FILTER L"Script files (*.lsl)\0*.lsl\0"
+#define DICTIONARY_FILTER L"Dictionary files (*.dic)\0*.dic\0"
#endif
//
@@ -218,6 +219,10 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter)
mOFN.lpstrFilter = SCRIPT_FILTER \
L"\0";
break;
+ case FFLOAD_DICTIONARY:
+ mOFN.lpstrFilter = DICTIONARY_FILTER \
+ L"\0";
+ break;
default:
res = FALSE;
break;
@@ -643,6 +648,14 @@ Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callB
result = false;
}
}
+ else if (filter == FFLOAD_DICTIONARY)
+ {
+ if (fileInfo.filetype != 'DIC ' &&
+ (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dic"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) )
+ {
+ result = false;
+ }
+ }
if (fileInfo.extension)
{
@@ -1235,6 +1248,12 @@ static std::string add_script_filter_to_gtkchooser(GtkWindow *picker)
LLTrans::getString("script_files") + " (*.lsl)");
}
+static std::string add_dictionary_filter_to_gtkchooser(GtkWindow *picker)
+{
+ return add_simple_mime_filter_to_gtkchooser(picker, "text/plain",
+ LLTrans::getString("dictionary_files") + " (*.dic)");
+}
+
BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename )
{
BOOL rtn = FALSE;
@@ -1371,6 +1390,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
case FFLOAD_SCRIPT:
filtername = add_script_filter_to_gtkchooser(picker);
break;
+ case FFLOAD_DICTIONARY:
+ filtername = add_dictionary_filter_to_gtkchooser(picker);
+ break;
default:;
break;
}