NULL);
}
-static void
-quit_app (GtkApplication *app)
-{
- GList *list, *next;
- GtkWindow *win;
-
- g_print ("Going down...\n");
-
- list = gtk_application_get_windows (app);
- while (list)
- {
- win = list->data;
- next = list->next;
-
- gtk_widget_destroy (GTK_WIDGET (win));
-
- list = next;
- }
-}
-
static void
quit_activated (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- GtkApplication *app = user_data;
+ GApplication *app = user_data;
- quit_app (app);
+ g_application_quit (app);
}
static GActionEntry app_entries[] = {
"<interface>"
" <menu id='app-menu'>"
" <section>"
- " <item label='_New Window' action='app.new' accel='<Primary>n'/>"
+ " <item>"
+ " <attribute name='label' translatable='yes'>_New Window</attribute>"
+ " <attribute name='action'>app.new</attribute>"
+ " <attribute name='accel'><Primary>n</attribute>"
+ " </item>"
" </section>"
" <section>"
- " <item label='_About Bloatpad' action='app.about'/>"
+ " <item>"
+ " <attribute name='label' translatable='yes'>_About Bloatpad</attribute>"
+ " <attribute name='action'>app.about</attribute>"
+ " </item>"
" </section>"
" <section>"
- " <item label='_Quit' action='app.quit' accel='<Primary>q'/>"
+ " <item>"
+ " <attribute name='label' translatable='yes'>_Quit</attribute>"
+ " <attribute name='action'>app.quit</attribute>"
+ " <attribute name='accel'><Primary>q</attribute>"
+ " </item>"
" </section>"
" </menu>"
" <menu id='menubar'>"
- " <submenu label='_Edit'>"
+ " <submenu>"
+ " <attribute name='label' translatable='yes'>_Edit</attribute>"
" <section>"
- " <item label='_Copy' action='win.copy' accel='<Primary>c'/>"
- " <item label='_Paste' action='win.paste' accel='<Primary>v'/>"
+ " <item>"
+ " <attribute name='label' translatable='yes'>_Copy</attribute>"
+ " <attribute name='action'>win.copy</attribute>"
+ " <attribute name='accel'><Primary>c</attribute>"
+ " </item>"
+ " <item>"
+ " <attribute name='label' translatable='yes'>_Parse</attribute>"
+ " <attribute name='action'>win.parse</attribute>"
+ " <attribute name='accel'><Primary>v</attribute>"
+ " </item>"
" </section>"
" </submenu>"
- " <submenu label='_View'>"
+ " <submenu>"
+ " <attribute name='label' translatable='yes'>_View</attribute>"
" <section>"
- " <item label='_Fullscreen' action='win.fullscreen'/>"
+ " <item>"
+ " <attribute name='label' translatable='yes'>_Fullscreen</attribute>"
+ " <attribute name='action'>win.fullscreen</attribute>"
+ " <attribute name='accel'>F11</attribute>"
+ " </item>"
" </section>"
" </submenu>"
" </menu>"
}
-static void
-quit_cb (GtkApplication *app)
-{
- g_print ("Session manager to us to quit\n");
-
- quit_app (app);
-}
-
BloatPad *
bloat_pad_new (void)
{
"register-session", TRUE,
NULL);
- g_signal_connect (bloat_pad, "quit", G_CALLBACK (quit_cb), NULL);
-
return bloat_pad;
}