src/mess/tools/imgtool/windows/wimgtool.c
| r7921 | r7922 | |
| 336 | 336 | { |
| 337 | 337 | t_extension = tstring_from_utf8(extension); |
| 338 | 338 | _tcscat(file_path, t_extension); |
| 339 | | free(t_extension); |
| 339 | global_free(t_extension); |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | file = CreateFile(file_path, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL); |
| r7921 | r7922 | |
| 457 | 457 | |
| 458 | 458 | new_index = ListView_InsertItem(info->listview, &lvi); |
| 459 | 459 | |
| 460 | | free(t_entry_filename); |
| 460 | global_free(t_entry_filename); |
| 461 | 461 | |
| 462 | 462 | if (entry->directory) |
| 463 | 463 | { |
| r7921 | r7922 | |
| 501 | 501 | // set attributes and corruption notice |
| 502 | 502 | if (entry->attr) |
| 503 | 503 | { |
| 504 | | TCHAR *tempstr = tstring_from_utf8(entry->attr); |
| 505 | | ListView_SetItemText(info->listview, new_index, column_index++, tempstr); |
| 506 | | free(tempstr); |
| 504 | TCHAR *t_tempstr = tstring_from_utf8(entry->attr); |
| 505 | ListView_SetItemText(info->listview, new_index, column_index++, t_tempstr); |
| 506 | global_free(t_tempstr); |
| 507 | 507 | } |
| 508 | 508 | if (entry->corrupt) |
| 509 | 509 | { |
| r7921 | r7922 | |
| 597 | 597 | |
| 598 | 598 | tempstr = tstring_from_utf8(size_buf); |
| 599 | 599 | SendMessage(info->statusbar, SB_SETTEXT, 2, (LPARAM) tempstr); |
| 600 | | free(tempstr); |
| 600 | global_free(tempstr); |
| 601 | 601 | |
| 602 | 602 | done: |
| 603 | 603 | if (imageenum) |
| r7921 | r7922 | |
| 617 | 617 | char imageinfo_buf[256]; |
| 618 | 618 | const char *imageinfo = NULL; |
| 619 | 619 | TCHAR file_title_buf[MAX_PATH]; |
| 620 | | char *file_title; |
| 620 | char *utf8_file_title; |
| 621 | 621 | const char *statusbar_text[2]; |
| 622 | 622 | TCHAR *t_filename; |
| 623 | 623 | imgtool_partition_features features; |
| r7921 | r7922 | |
| 635 | 635 | // get file title from Windows |
| 636 | 636 | t_filename = tstring_from_utf8(info->filename); |
| 637 | 637 | GetFileTitle(t_filename, file_title_buf, ARRAY_LENGTH(file_title_buf)); |
| 638 | | free(t_filename); |
| 639 | | file_title = utf8_from_tstring(file_title_buf); |
| 638 | global_free(t_filename); |
| 639 | utf8_file_title = utf8_from_tstring(file_title_buf); |
| 640 | 640 | |
| 641 | 641 | // get info from image |
| 642 | 642 | if (info->image && (imgtool_image_info(info->image, imageinfo_buf, sizeof(imageinfo_buf) |
| r7921 | r7922 | |
| 653 | 653 | if (imageinfo) |
| 654 | 654 | { |
| 655 | 655 | snprintf(buf, ARRAY_LENGTH(buf), |
| 656 | | "%s (\"%s\") - %s", file_title, imageinfo, info->current_directory); |
| 656 | "%s (\"%s\") - %s", utf8_file_title, imageinfo, info->current_directory); |
| 657 | 657 | } |
| 658 | 658 | else |
| 659 | 659 | { |
| 660 | 660 | snprintf(buf, ARRAY_LENGTH(buf), |
| 661 | | "%s - %s", file_title, info->current_directory); |
| 661 | "%s - %s", utf8_file_title, info->current_directory); |
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | 664 | else |
| r7921 | r7922 | |
| 666 | 666 | // no current directory |
| 667 | 667 | snprintf(buf, ARRAY_LENGTH(buf), |
| 668 | 668 | imageinfo ? "%s (\"%s\")" : "%s", |
| 669 | | file_title, imageinfo); |
| 669 | utf8_file_title, imageinfo); |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | statusbar_text[0] = imgtool_basename((char *) info->filename); |
| 673 | 673 | statusbar_text[1] = imgtool_image_module(info->image)->description; |
| 674 | 674 | |
| 675 | | free(file_title); |
| 675 | global_free(utf8_file_title); |
| 676 | 676 | } |
| 677 | 677 | else |
| 678 | 678 | { |
| r7921 | r7922 | |
| 686 | 686 | |
| 687 | 687 | for (i = 0; i < ARRAY_LENGTH(statusbar_text); i++) |
| 688 | 688 | { |
| 689 | | TCHAR *tempstr = statusbar_text[i] ? tstring_from_utf8(statusbar_text[i]) : NULL; |
| 690 | | SendMessage(info->statusbar, SB_SETTEXT, i, (LPARAM) tempstr); |
| 691 | | if (tempstr) |
| 692 | | free(tempstr); |
| 689 | TCHAR *t_tempstr = statusbar_text[i] ? tstring_from_utf8(statusbar_text[i]) : NULL; |
| 690 | SendMessage(info->statusbar, SB_SETTEXT, i, (LPARAM) t_tempstr); |
| 691 | if (t_tempstr) |
| 692 | global_free(t_tempstr); |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | // set the icon |