Moved to gtk_application_set_accels_for_action() API
... and with that, to a GTK+ 3.12 requirement.
This commit is contained in:
parent
82c8b193a1
commit
3ad29b3f2d
@ -31,7 +31,7 @@ GLIB_GSETTINGS
|
|||||||
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
|
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
|
||||||
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.38])
|
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.38])
|
||||||
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
|
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
|
||||||
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.8])
|
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.12])
|
||||||
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
|
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
|
||||||
PKG_CHECK_MODULES([LIBXSLT], [libexslt])
|
PKG_CHECK_MODULES([LIBXSLT], [libexslt])
|
||||||
PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-3.0])
|
PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-3.0])
|
||||||
|
59
src/ag-app.c
59
src/ag-app.c
@ -265,52 +265,31 @@ setup_actions(AgApp *app)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gchar *action_accels[] = {
|
||||||
|
"win.close", "<Ctrl>W", NULL,
|
||||||
|
"win.save", "<Ctrl>S", NULL,
|
||||||
|
"win.export", "<Ctrl><Shift>E", NULL,
|
||||||
|
"win.gear-menu", "F10", NULL,
|
||||||
|
"app.help", "F1", NULL,
|
||||||
|
"win.change-tab::chart", "F5", NULL,
|
||||||
|
"win.change-tab::aspects", "F9", NULL,
|
||||||
|
"win.change-tab::edit", "F10", NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_accelerators(AgApp *app)
|
setup_accelerators(AgApp *app)
|
||||||
{
|
{
|
||||||
gtk_application_add_accelerator(
|
const char **it;
|
||||||
|
|
||||||
|
for (it = action_accels; it[0]; it += g_strv_length((gchar **)it) + 1) {
|
||||||
|
gtk_application_set_accels_for_action(
|
||||||
GTK_APPLICATION(app),
|
GTK_APPLICATION(app),
|
||||||
"<Primary>w",
|
it[0],
|
||||||
"win.close",
|
&it[1]
|
||||||
NULL
|
|
||||||
);
|
|
||||||
gtk_application_add_accelerator(
|
|
||||||
GTK_APPLICATION(app),
|
|
||||||
"<Primary>s",
|
|
||||||
"win.save",
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
gtk_application_add_accelerator(
|
|
||||||
GTK_APPLICATION(app),
|
|
||||||
"<Primary><Shift>s",
|
|
||||||
"win.save-as",
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
gtk_application_add_accelerator(
|
|
||||||
GTK_APPLICATION(app),
|
|
||||||
"F10",
|
|
||||||
"win.gear-menu",
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
gtk_application_add_accelerator(
|
|
||||||
GTK_APPLICATION(app),
|
|
||||||
"F1",
|
|
||||||
"app.help",
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
gtk_application_add_accelerator(
|
|
||||||
GTK_APPLICATION(app),
|
|
||||||
"F5",
|
|
||||||
"win.change-tab",
|
|
||||||
g_variant_new_string("chart")
|
|
||||||
);
|
|
||||||
gtk_application_add_accelerator(
|
|
||||||
GTK_APPLICATION(app),
|
|
||||||
"F9",
|
|
||||||
"win.change-tab",
|
|
||||||
g_variant_new_string("aspects")
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_menu(AgApp *app)
|
setup_menu(AgApp *app)
|
||||||
|
Loading…
Reference in New Issue
Block a user