diff --git a/apps/file_manager/ui.cpp b/apps/file_manager/ui.cpp index 4532a6d..0ee3042 100644 --- a/apps/file_manager/ui.cpp +++ b/apps/file_manager/ui.cpp @@ -831,22 +831,6 @@ int ListCallback(EsElement *element, EsMessage *message) { } else if (message->type == ES_MSG_MOUSE_RIGHT_CLICK) { EsMenu *menu = EsMenuCreate(element, ES_MENU_AT_CURSOR); -#define ADD_SORT_COLUMN_MENU_ITEM(_column, _string) \ - EsMenuAddItem(menu, instance->viewSettings.sortColumn == (_column) ? ES_MENU_ITEM_CHECKED : ES_FLAGS_DEFAULT, \ - INTERFACE_STRING(_string), InstanceChangeSortColumn, _column) - EsMenuAddItem(menu, ES_MENU_ITEM_HEADER, INTERFACE_STRING(CommonSortAscending)); - ADD_SORT_COLUMN_MENU_ITEM(COLUMN_NAME, FileManagerColumnName); - ADD_SORT_COLUMN_MENU_ITEM(COLUMN_TYPE, FileManagerColumnType); - ADD_SORT_COLUMN_MENU_ITEM(COLUMN_SIZE, FileManagerColumnSize); - EsMenuAddSeparator(menu); - EsMenuAddItem(menu, ES_MENU_ITEM_HEADER, INTERFACE_STRING(CommonSortDescending)); - ADD_SORT_COLUMN_MENU_ITEM(COLUMN_NAME | (1 << 8), FileManagerColumnName); - ADD_SORT_COLUMN_MENU_ITEM(COLUMN_TYPE | (1 << 8), FileManagerColumnType); - ADD_SORT_COLUMN_MENU_ITEM(COLUMN_SIZE | (1 << 8), FileManagerColumnSize); -#undef ADD_SORT_COLUMN_MENU_ITEM - - EsMenuNextColumn(menu); - EsMenuAddItem(menu, ES_MENU_ITEM_HEADER, INTERFACE_STRING(FileManagerListContextActions)); EsMenuAddCommand(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(CommonClipboardPaste), EsCommandByID(instance, ES_COMMAND_PASTE)); EsMenuAddCommand(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(CommonSelectionSelectAll), EsCommandByID(instance, ES_COMMAND_SELECT_ALL)); @@ -863,6 +847,22 @@ int ListCallback(EsElement *element, EsMessage *message) { ADD_VIEW_TYPE_MENU_ITEM(&instance->commandViewDetails, CommonListViewTypeDetails); #undef ADD_VIEW_TYPE_MENU_ITEM + EsMenuNextColumn(menu); + +#define ADD_SORT_COLUMN_MENU_ITEM(_column, _string) \ + EsMenuAddItem(menu, instance->viewSettings.sortColumn == (_column) ? ES_MENU_ITEM_CHECKED : ES_FLAGS_DEFAULT, \ + INTERFACE_STRING(_string), InstanceChangeSortColumn, _column) + EsMenuAddItem(menu, ES_MENU_ITEM_HEADER, INTERFACE_STRING(CommonSortAscending)); + ADD_SORT_COLUMN_MENU_ITEM(COLUMN_NAME, FileManagerColumnName); + ADD_SORT_COLUMN_MENU_ITEM(COLUMN_TYPE, FileManagerColumnType); + ADD_SORT_COLUMN_MENU_ITEM(COLUMN_SIZE, FileManagerColumnSize); + EsMenuAddSeparator(menu); + EsMenuAddItem(menu, ES_MENU_ITEM_HEADER, INTERFACE_STRING(CommonSortDescending)); + ADD_SORT_COLUMN_MENU_ITEM(COLUMN_NAME | (1 << 8), FileManagerColumnName); + ADD_SORT_COLUMN_MENU_ITEM(COLUMN_TYPE | (1 << 8), FileManagerColumnType); + ADD_SORT_COLUMN_MENU_ITEM(COLUMN_SIZE | (1 << 8), FileManagerColumnSize); +#undef ADD_SORT_COLUMN_MENU_ITEM + EsMenuShow(menu); } else { return 0; diff --git a/util/build_core.c b/util/build_core.c index 9036de8..56d9b16 100644 --- a/util/build_core.c +++ b/util/build_core.c @@ -578,38 +578,39 @@ void BuildDesktop(Application *application) { } void BuildApplication(Application *application) { + char symbolFile[256]; + char objectFiles[4096]; + char strippedFile[256]; + char executable[256]; + char linkerScript[256]; + char crti[256]; + char crtbegin[256]; + char crtend[256]; + char crtn[256]; + size_t objectFilesPosition = 0; + + snprintf(symbolFile, sizeof(symbolFile), "bin/%s", application->name); + snprintf(strippedFile, sizeof(strippedFile), "bin/%s.no_symbols", application->name); + snprintf(linkerScript, sizeof(linkerScript), "%s/linker/userland64.ld", toolchainLinkerScripts); + snprintf(crti, sizeof(crti), "%s/crti.o", toolchainCRTObjects); + snprintf(crtbegin, sizeof(crtbegin), "%s/crtbegin.o", toolchainCRTObjects); + snprintf(crtend, sizeof(crtend), "%s/crtend.o", toolchainCRTObjects); + snprintf(crtn, sizeof(crtn), "%s/crtn.o", toolchainCRTObjects); + + if (systemBuild) { + snprintf(executable, sizeof(executable), "root/Applications/%s.esx", application->name); + } else { + snprintf(executable, sizeof(executable), "bin/%s.esx", application->name); + } + if (application->customCompileCommand) { #ifdef OS_ESSENCE // TODO. #else application->error = system(application->customCompileCommand); + ExecuteForApp(application, toolchainStrip, "--strip-all", executable); #endif } else { - char symbolFile[256]; - char objectFiles[4096]; - char strippedFile[256]; - char executable[256]; - char linkerScript[256]; - char crti[256]; - char crtbegin[256]; - char crtend[256]; - char crtn[256]; - size_t objectFilesPosition = 0; - - snprintf(symbolFile, sizeof(symbolFile), "bin/%s", application->name); - snprintf(strippedFile, sizeof(strippedFile), "bin/%s.no_symbols", application->name); - snprintf(linkerScript, sizeof(linkerScript), "%s/linker/userland64.ld", toolchainLinkerScripts); - snprintf(crti, sizeof(crti), "%s/crti.o", toolchainCRTObjects); - snprintf(crtbegin, sizeof(crtbegin), "%s/crtbegin.o", toolchainCRTObjects); - snprintf(crtend, sizeof(crtend), "%s/crtend.o", toolchainCRTObjects); - snprintf(crtn, sizeof(crtn), "%s/crtn.o", toolchainCRTObjects); - - if (systemBuild) { - snprintf(executable, sizeof(executable), "root/Applications/%s.esx", application->name); - } else { - snprintf(executable, sizeof(executable), "bin/%s.esx", application->name); - } - for (uintptr_t i = 0; i < arrlenu(application->sources); i++) { const char *source = application->sources[i]; size_t sourceBytes = strlen(source);