From b66cdda7411132205cd5fcba186d453dd2bf2370 Mon Sep 17 00:00:00 2001 From: nakst <> Date: Mon, 13 Sep 2021 10:07:02 +0100 Subject: [PATCH] various fixes --- apps/file_manager/ui.cpp | 2 ++ desktop/api.cpp | 1 + desktop/desktop.cpp | 1 + desktop/gui.cpp | 5 ++++- desktop/settings.cpp | 12 ++++++------ 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/file_manager/ui.cpp b/apps/file_manager/ui.cpp index e191538..236979f 100644 --- a/apps/file_manager/ui.cpp +++ b/apps/file_manager/ui.cpp @@ -820,6 +820,8 @@ int ListCallback(EsElement *element, EsMessage *message) { EsMenu *menu = EsMenuCreate(element, ES_MENU_AT_CURSOR); EsMenuAddCommand(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(CommonClipboardCut), EsCommandByID(instance, ES_COMMAND_CUT)); EsMenuAddCommand(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(CommonClipboardCopy), EsCommandByID(instance, ES_COMMAND_COPY)); + EsMenuAddSeparator(menu); + EsMenuAddCommand(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(FileManagerRenameAction), &instance->commandRename); EsMenuShow(menu); } else if (message->type == ES_MSG_MOUSE_RIGHT_CLICK) { EsMenu *menu = EsMenuCreate(element, ES_MENU_AT_CURSOR); diff --git a/desktop/api.cpp b/desktop/api.cpp index 34de934..75bc832 100644 --- a/desktop/api.cpp +++ b/desktop/api.cpp @@ -1167,6 +1167,7 @@ void EsInstanceSaveComplete(EsMessage *message, bool success) { apiInstance->startupInformation->filePathBytes, apiInstance->startupInformation->filePath); EsAnnouncementShow(instance->window, ES_FLAGS_DEFAULT, (bounds.l + bounds.r) / 2, bounds.b, message, messageBytes); EsHeapFree(message); + EsCommandSetDisabled(&apiInstance->commandShowInFileManager, false); } else { const char *errorMessage = interfaceString_FileSaveErrorUnknown; diff --git a/desktop/desktop.cpp b/desktop/desktop.cpp index d613baf..2694e82 100644 --- a/desktop/desktop.cpp +++ b/desktop/desktop.cpp @@ -1661,6 +1661,7 @@ void ApplicationInstanceRequestSave(ApplicationInstance *instance, const char *n document.pathBytes = nameBytes; document.readHandle = file.handle; document.id = ++desktop.currentDocumentID; + document.referenceCount++; *desktop.openDocuments.Put(&document.id) = document; instance->documentID = document.id; diff --git a/desktop/gui.cpp b/desktop/gui.cpp index 234b27a..277ce79 100644 --- a/desktop/gui.cpp +++ b/desktop/gui.cpp @@ -6060,7 +6060,10 @@ int UIMessageSendPropagateToAncestors(EsElement *element, EsMessage *message, Es int response = EsMessageSend(element, message); if (response) { - if (handler) *handler = element; + if (handler && (~element->state & UI_STATE_DESTROYING)) { + *handler = element; + } + return response; } diff --git a/desktop/settings.cpp b/desktop/settings.cpp index 7c6f44b..836271c 100644 --- a/desktop/settings.cpp +++ b/desktop/settings.cpp @@ -702,15 +702,15 @@ void SettingsPageTheme(EsElement *element, SettingsPage *page) { } SettingsPage settingsPages[] = { - { INTERFACE_STRING(DesktopSettingsAccessibility), ES_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY, SettingsPageUnimplemented, 'A' }, // TODO. - { INTERFACE_STRING(DesktopSettingsDateAndTime), ES_ICON_PREFERENCES_SYSTEM_TIME, SettingsPageUnimplemented, 'C' }, // TODO. + // { INTERFACE_STRING(DesktopSettingsAccessibility), ES_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY, SettingsPageUnimplemented, 'A' }, // TODO. + // { INTERFACE_STRING(DesktopSettingsDateAndTime), ES_ICON_PREFERENCES_SYSTEM_TIME, SettingsPageUnimplemented, 'C' }, // TODO. { INTERFACE_STRING(DesktopSettingsDisplay), ES_ICON_PREFERENCES_DESKTOP_DISPLAY, SettingsPageDisplay, 'D' }, { INTERFACE_STRING(DesktopSettingsKeyboard), ES_ICON_INPUT_KEYBOARD, SettingsPageKeyboard, 'E' }, - { INTERFACE_STRING(DesktopSettingsLocalisation), ES_ICON_PREFERENCES_DESKTOP_LOCALE, SettingsPageUnimplemented, 'F' }, // TODO. + // { INTERFACE_STRING(DesktopSettingsLocalisation), ES_ICON_PREFERENCES_DESKTOP_LOCALE, SettingsPageUnimplemented, 'F' }, // TODO. { INTERFACE_STRING(DesktopSettingsMouse), ES_ICON_INPUT_MOUSE, SettingsPageMouse, 'G' }, - { INTERFACE_STRING(DesktopSettingsNetwork), ES_ICON_PREFERENCES_SYSTEM_NETWORK, SettingsPageUnimplemented, 'H' }, // TODO. - { INTERFACE_STRING(DesktopSettingsPower), ES_ICON_PREFERENCES_SYSTEM_POWER, SettingsPageUnimplemented, 'J' }, // TODO. - { INTERFACE_STRING(DesktopSettingsSound), ES_ICON_PREFERENCES_DESKTOP_SOUND, SettingsPageUnimplemented, 'K' }, // TODO. + // { INTERFACE_STRING(DesktopSettingsNetwork), ES_ICON_PREFERENCES_SYSTEM_NETWORK, SettingsPageUnimplemented, 'H' }, // TODO. + // { INTERFACE_STRING(DesktopSettingsPower), ES_ICON_PREFERENCES_SYSTEM_POWER, SettingsPageUnimplemented, 'J' }, // TODO. + // { INTERFACE_STRING(DesktopSettingsSound), ES_ICON_PREFERENCES_DESKTOP_SOUND, SettingsPageUnimplemented, 'K' }, // TODO. { INTERFACE_STRING(DesktopSettingsTheme), ES_ICON_APPLICATIONS_INTERFACEDESIGN, SettingsPageTheme, 'M' }, };