Moved to gtk_application_set_accels_for_action() API

... and with that, to a GTK+ 3.12 requirement.
This commit is contained in:
Gergely Polonkai 2014-08-03 23:32:17 +02:00
parent 82c8b193a1
commit 3ad29b3f2d
2 changed files with 22 additions and 43 deletions

View File

@ -31,7 +31,7 @@ GLIB_GSETTINGS
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.38])
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([LIBXSLT], [libexslt])
PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-3.0])

View File

@ -265,51 +265,30 @@ 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
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),
"<Primary>w",
"win.close",
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")
it[0],
&it[1]
);
}
}
static void