From 72df6b944df44a53ffd1581f6c6a68f3ae793151 Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 17 Sep 2013 13:58:49 +0200 Subject: [PATCH] Added Open/Save functionality to the menus --- src/ag-app.c | 7 +++++++ src/ag-window.c | 6 ++++++ src/astrognome.ui | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/ag-app.c b/src/ag-app.c index c52ca04..5846284 100644 --- a/src/ag-app.c +++ b/src/ag-app.c @@ -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), "w", "win.close", NULL); + gtk_application_add_accelerator(GTK_APPLICATION(app), "s", "win.save", NULL); gtk_application_add_accelerator(GTK_APPLICATION(app), "F10", "win.gear-menu", NULL); } diff --git a/src/ag-window.c b/src/ag-window.c index dce7d2f..0d13545 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -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 }, }; diff --git a/src/astrognome.ui b/src/astrognome.ui index c8fdfac..5546d5c 100644 --- a/src/astrognome.ui +++ b/src/astrognome.ui @@ -8,6 +8,11 @@ app.new-window <Primary>n + + Open + app.open + <Primary>o +
@@ -29,5 +34,10 @@
+ + Save + win.save + <Primary>s +