forked from AuroraMiddleware/gtk
bloatpad: port to GActionMap for application
g_application_set_action_group() is now deprecated.
This commit is contained in:
parent
2e64177e3f
commit
59092e1c00
@ -142,9 +142,7 @@ show_about (GSimpleAction *action,
|
|||||||
GVariant *parameter,
|
GVariant *parameter,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkWindow *window = user_data;
|
gtk_show_about_dialog (NULL,
|
||||||
|
|
||||||
gtk_show_about_dialog (window,
|
|
||||||
"program-name", "Bloatpad",
|
"program-name", "Bloatpad",
|
||||||
"title", "About Bloatpad",
|
"title", "About Bloatpad",
|
||||||
"comments", "Not much to say, really.",
|
"comments", "Not much to say, really.",
|
||||||
@ -179,26 +177,12 @@ static GActionEntry app_entries[] = {
|
|||||||
{ "quit", quit_app, NULL, NULL, NULL },
|
{ "quit", quit_app, NULL, NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static GActionGroup *
|
|
||||||
create_app_actions (void)
|
|
||||||
{
|
|
||||||
GSimpleActionGroup *actions = g_simple_action_group_new ();
|
|
||||||
g_simple_action_group_add_entries (actions,
|
|
||||||
app_entries, G_N_ELEMENTS (app_entries),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return G_ACTION_GROUP (actions);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bloat_pad_init (BloatPad *app)
|
bloat_pad_init (BloatPad *app)
|
||||||
{
|
{
|
||||||
GActionGroup *actions;
|
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
|
|
||||||
actions = create_app_actions ();
|
g_action_map_add_action_entries (G_ACTION_MAP (app), app_entries, G_N_ELEMENTS (app_entries), app);
|
||||||
g_application_set_action_group (G_APPLICATION (app), actions);
|
|
||||||
g_object_unref (actions);
|
|
||||||
|
|
||||||
builder = gtk_builder_new ();
|
builder = gtk_builder_new ();
|
||||||
gtk_builder_add_from_string (builder,
|
gtk_builder_add_from_string (builder,
|
||||||
|
Loading…
Reference in New Issue
Block a user