Added Open/Save functionality to the menus
This commit is contained in:
parent
6c7bd24ff6
commit
72df6b944d
@ -103,6 +103,11 @@ quit_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
open_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
raise_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
|
||||
{
|
||||
@ -119,6 +124,7 @@ static GActionEntry app_entries[] = {
|
||||
{ "about", about_cb, NULL, NULL, NULL },
|
||||
{ "quit", quit_cb, NULL, NULL, NULL },
|
||||
{ "raise", raise_cb, NULL, NULL, NULL },
|
||||
{ "open", open_cb, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
static void
|
||||
@ -131,6 +137,7 @@ static void
|
||||
setup_accelerators(AgApp *app)
|
||||
{
|
||||
gtk_application_add_accelerator(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), "F10", "win.gear-menu", NULL);
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,11 @@ close_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
|
||||
gtk_widget_destroy(GTK_WIDGET(window));
|
||||
}
|
||||
|
||||
static void
|
||||
save_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
chart_changed(AgChart *chart, gpointer user_data)
|
||||
{
|
||||
@ -128,6 +133,7 @@ tab_changed_cb(GdStack *stack, GParamSpec *pspec, AgWindow *window)
|
||||
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "close", close_cb, NULL, NULL, NULL },
|
||||
{ "save", save_cb, NULL, NULL, NULL },
|
||||
{ "gear-menu", gear_menu_cb, NULL, "false", NULL },
|
||||
};
|
||||
|
||||
|
@ -8,6 +8,11 @@
|
||||
<attribute name="action">app.new-window</attribute>
|
||||
<attribute name="accel"><Primary>n</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open</attribute>
|
||||
<attribute name="action">app.open</attribute>
|
||||
<attribute name="accel"><Primary>o</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
@ -29,5 +34,10 @@
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="window-menu">
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Save</attribute>
|
||||
<attribute name="action">win.save</attribute>
|
||||
<attribute name="accel"><Primary>s</attribute>
|
||||
</item>
|
||||
</menu>
|
||||
</interface>
|
||||
|
Loading…
Reference in New Issue
Block a user