</item>
</section>
<section>
+ <item>
+ <attribute name="label" translatable="yes">_Close</attribute>
+ <attribute name="accel"><Primary>w</attribute>
+ <attribute name="action">win.close</attribute>
+ </item>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="accel"><Primary>q</attribute>
gtk_menu_attach (GTK_MENU (menu), gtk_separator_menu_item_new (), 0, 1, 12, 13);
+
+ {
+ GtkWidget *close = gtk_menu_item_new_with_mnemonic (_("_Close"));
+ gtk_menu_attach (GTK_MENU (menu), close, 0, 1, 13, 14);
+
+ connect_action_to_menuitem (G_ACTION_MAP (dw), "close", close, "<Primary>W");
+ }
+
{
GtkWidget *quit = gtk_menu_item_new_with_mnemonic (_("_Quit"));
- gtk_menu_attach (GTK_MENU (menu), quit, 0, 1, 13, 14);
+ gtk_menu_attach (GTK_MENU (menu), quit, 0, 1, 14, 15);
connect_action_to_menuitem (G_ACTION_MAP (g_application_get_default ()),
"quit", quit, "<Primary>Q");
g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (save_as));
}
+ {
+ GSimpleAction *close_action = g_simple_action_new ("close", NULL);
+ g_signal_connect_swapped (close_action, "activate", G_CALLBACK (gtk_window_close), de);
+ g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (close_action));
+ }
+
{
GSimpleAction *rename_dataset_act = g_simple_action_new ("rename-dataset", NULL);
g_signal_connect_swapped (rename_dataset_act, "activate",
g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (export));
}
+ {
+ GSimpleAction *close = g_simple_action_new ("close", NULL);
+ g_signal_connect_swapped (close, "activate", G_CALLBACK (gtk_window_close), window);
+ g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (close));
+
+ const gchar *accels[2] = { "<Primary>W", NULL};
+ gtk_application_set_accels_for_action (app, "win.close", accels);
+ }
+
{
GSimpleAction *select_all = g_simple_action_new ("select-all", NULL);
g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (select_all));