forked from AuroraMiddleware/gtk
print-editor: Stop using appmenu apis
The appmenu-related GtkApplication apis are going away.
This commit is contained in:
parent
a8df81b27c
commit
d5da3b9199
@ -641,24 +641,25 @@ static GActionEntry app_entries[] = {
|
|||||||
|
|
||||||
static const gchar ui_info[] =
|
static const gchar ui_info[] =
|
||||||
"<interface>"
|
"<interface>"
|
||||||
" <menu id='appmenu'>"
|
|
||||||
" <section>"
|
|
||||||
" <item>"
|
|
||||||
" <attribute name='label'>_About</attribute>"
|
|
||||||
" <attribute name='action'>app.about</attribute>"
|
|
||||||
" <attribute name='accel'><Primary>a</attribute>"
|
|
||||||
" </item>"
|
|
||||||
" </section>"
|
|
||||||
" <section>"
|
|
||||||
" <item>"
|
|
||||||
" <attribute name='label'>_Quit</attribute>"
|
|
||||||
" <attribute name='action'>app.quit</attribute>"
|
|
||||||
" <attribute name='accel'><Primary>q</attribute>"
|
|
||||||
" </item>"
|
|
||||||
" </section>"
|
|
||||||
" </menu>"
|
|
||||||
" <menu id='menubar'>"
|
" <menu id='menubar'>"
|
||||||
" <submenu>"
|
" <submenu>"
|
||||||
|
" <attribute name='label'>_Application</attribute>"
|
||||||
|
" <section>"
|
||||||
|
" <item>"
|
||||||
|
" <attribute name='label'>_About</attribute>"
|
||||||
|
" <attribute name='action'>app.about</attribute>"
|
||||||
|
" <attribute name='accel'><Primary>a</attribute>"
|
||||||
|
" </item>"
|
||||||
|
" </section>"
|
||||||
|
" <section>"
|
||||||
|
" <item>"
|
||||||
|
" <attribute name='label'>_Quit</attribute>"
|
||||||
|
" <attribute name='action'>app.quit</attribute>"
|
||||||
|
" <attribute name='accel'><Primary>q</attribute>"
|
||||||
|
" </item>"
|
||||||
|
" </section>"
|
||||||
|
" </submenu>"
|
||||||
|
" <submenu>"
|
||||||
" <attribute name='label'>_File</attribute>"
|
" <attribute name='label'>_File</attribute>"
|
||||||
" <section>"
|
" <section>"
|
||||||
" <item>"
|
" <item>"
|
||||||
@ -738,16 +739,13 @@ static void
|
|||||||
startup (GApplication *app)
|
startup (GApplication *app)
|
||||||
{
|
{
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
GMenuModel *appmenu;
|
|
||||||
GMenuModel *menubar;
|
GMenuModel *menubar;
|
||||||
|
|
||||||
builder = gtk_builder_new ();
|
builder = gtk_builder_new ();
|
||||||
gtk_builder_add_from_string (builder, ui_info, -1, NULL);
|
gtk_builder_add_from_string (builder, ui_info, -1, NULL);
|
||||||
|
|
||||||
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
|
|
||||||
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
|
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
|
||||||
|
|
||||||
gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu);
|
|
||||||
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
|
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
|
||||||
|
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
|
Loading…
Reference in New Issue
Block a user