diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewermenufile.cpp | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp index ab77b53..b8a4f65 100644 --- a/linden/indra/newview/llviewermenufile.cpp +++ b/linden/indra/newview/llviewermenufile.cpp | |||
@@ -414,18 +414,6 @@ class LLFileTakeSnapshotToDisk : public view_listener_t | |||
414 | } | 414 | } |
415 | }; | 415 | }; |
416 | 416 | ||
417 | class LLFileSetWindowSize : public view_listener_t | ||
418 | { | ||
419 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
420 | { | ||
421 | LLString size = userdata.asString(); | ||
422 | S32 width, height; | ||
423 | sscanf(size.c_str(), "%d,%d", &width, &height); | ||
424 | LLViewerWindow::movieSize(width, height); | ||
425 | return true; | ||
426 | } | ||
427 | }; | ||
428 | |||
429 | class LLFileQuit : public view_listener_t | 417 | class LLFileQuit : public view_listener_t |
430 | { | 418 | { |
431 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 419 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -448,25 +436,31 @@ void handle_upload(void* data) | |||
448 | void handle_compress_image(void*) | 436 | void handle_compress_image(void*) |
449 | { | 437 | { |
450 | LLFilePicker& picker = LLFilePicker::instance(); | 438 | LLFilePicker& picker = LLFilePicker::instance(); |
451 | if (picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE)) | 439 | if (picker.getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE)) |
452 | { | 440 | { |
453 | std::string infile(picker.getFirstFile()); | 441 | const char* input_file = picker.getFirstFile(); |
454 | std::string outfile = infile + ".j2c"; | 442 | while (input_file) |
443 | { | ||
444 | std::string infile(input_file); | ||
445 | std::string outfile = infile + ".j2c"; | ||
455 | 446 | ||
456 | llinfos << "Input: " << infile << llendl; | 447 | llinfos << "Input: " << infile << llendl; |
457 | llinfos << "Output: " << outfile << llendl; | 448 | llinfos << "Output: " << outfile << llendl; |
458 | 449 | ||
459 | BOOL success; | 450 | BOOL success; |
460 | 451 | ||
461 | success = LLViewerImageList::createUploadFile(infile, outfile, IMG_CODEC_TGA); | 452 | success = LLViewerImageList::createUploadFile(infile, outfile, IMG_CODEC_TGA); |
462 | 453 | ||
463 | if (success) | 454 | if (success) |
464 | { | 455 | { |
465 | llinfos << "Compression complete" << llendl; | 456 | llinfos << "Compression complete" << llendl; |
466 | } | 457 | } |
467 | else | 458 | else |
468 | { | 459 | { |
469 | llinfos << "Compression failed: " << LLImageBase::getLastError() << llendl; | 460 | llinfos << "Compression failed: " << LLImageBase::getLastError() << llendl; |
461 | } | ||
462 | |||
463 | input_file = picker.getNextFile(); | ||
470 | } | 464 | } |
471 | } | 465 | } |
472 | } | 466 | } |
@@ -603,7 +597,7 @@ void upload_new_resource(const LLString& src_filename, std::string name, | |||
603 | { | 597 | { |
604 | // This is a generic .lin resource file | 598 | // This is a generic .lin resource file |
605 | asset_type = LLAssetType::AT_OBJECT; | 599 | asset_type = LLAssetType::AT_OBJECT; |
606 | FILE* in = LLFile::fopen(src_filename.c_str(), "rb"); /* Flawfinder: ignore */ | 600 | LLFILE* in = LLFile::fopen(src_filename.c_str(), "rb"); /* Flawfinder: ignore */ |
607 | if (in) | 601 | if (in) |
608 | { | 602 | { |
609 | // read in the file header | 603 | // read in the file header |
@@ -688,7 +682,7 @@ void upload_new_resource(const LLString& src_filename, std::string name, | |||
688 | } | 682 | } |
689 | 683 | ||
690 | // copy the file's data segment into another file for uploading | 684 | // copy the file's data segment into another file for uploading |
691 | FILE* out = LLFile::fopen(filename.c_str(), "wb"); /* Flawfinder: ignore */ | 685 | LLFILE* out = LLFile::fopen(filename.c_str(), "wb"); /* Flawfinder: ignore */ |
692 | if (out) | 686 | if (out) |
693 | { | 687 | { |
694 | while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ | 688 | while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ |
@@ -1024,7 +1018,6 @@ void init_menu_file() | |||
1024 | (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); | 1018 | (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); |
1025 | (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); | 1019 | (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); |
1026 | (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); | 1020 | (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); |
1027 | (new LLFileSetWindowSize())->registerListener(gMenuHolder, "File.SetWindowSize"); | ||
1028 | (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); | 1021 | (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); |
1029 | 1022 | ||
1030 | (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); | 1023 | (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); |