[gnome-builder/wip/gtk4-port] plugins/editorui: be even more explicit in LF naming
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] plugins/editorui: be even more explicit in LF naming
- Date: Wed, 1 Jun 2022 21:17:34 +0000 (UTC)
commit 3fa0e06e239ce7b109bad4847b590a4544af3236
Author: Christian Hergert <chergert redhat com>
Date: Wed Jun 1 14:17:25 2022 -0700
plugins/editorui: be even more explicit in LF naming
I guess for macOS, we really want "macOS" since people there are going to
be less Unix-knowledgy and we wouldn't want them to select Mac Classic.
.../editorui/gbp-editorui-application-addin.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-application-addin.c
b/src/plugins/editorui/gbp-editorui-application-addin.c
index 567490d0b..27986a49e 100644
--- a/src/plugins/editorui/gbp-editorui-application-addin.c
+++ b/src/plugins/editorui/gbp-editorui-application-addin.c
@@ -345,16 +345,28 @@ static void
update_menus (IdeApplication *app)
{
g_autoptr(GMenuItem) lf = NULL;
+ const char *lf_name = NULL;
GMenu *menu;
g_assert (IDE_IS_APPLICATION (app));
- menu = ide_application_get_menu_by_id (app, "editorui-line-ends-section");
-#if !defined(G_OS_UNIX) || defined(__linux__)
- lf = g_menu_item_new ("Linux (LF)", NULL);
+#if defined(G_OS_UNIX)
+# if defined(__APPLE__)
+ lf_name = "macOS (LF)";
+# elif defined(__linux__)
+ lf_name = "Linux (LF)";
+# else
+ lf_name = "Unix (LF)";
+# endif
#else
- lf = g_menu_item_new ("Unix (LF)", NULL);
+ /* G_OS_WIN32 */
+ lf_name = "Linux (LF)";
#endif
+
+ g_assert (lf_name != NULL);
+
+ menu = ide_application_get_menu_by_id (app, "editorui-line-ends-section");
+ lf = g_menu_item_new (lf_name, NULL);
g_menu_item_set_action_and_target (lf, "editor.newline", "s", "lf");
g_menu_prepend_item (menu, lf);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]