diff --git a/src/objects/window/application.c b/src/objects/window/application.c index 18ee3bb..d6002f5 100644 --- a/src/objects/window/application.c +++ b/src/objects/window/application.c @@ -85,6 +85,7 @@ .name = "about", .activate = pw3270_application_generic_activated, }, + { .name = "preferences", .activate = pw3270_application_generic_activated, @@ -96,15 +97,29 @@ }, { - .name = "new_tab", + .name = "new.tab", .activate = pw3270_application_new_tab_activated, }, { - .name = "new_window", + .name = "new.window", .activate = pw3270_application_new_window_activated, - } + }, + + { + .name = "open", + .activate = pw3270_application_generic_activated, + }, + + { + .name = "open.tab", + .activate = pw3270_application_generic_activated, + }, + { + .name = "open.window", + .activate = pw3270_application_generic_activated, + }, }; g_action_map_add_action_entries( @@ -164,6 +179,3 @@ } - PW3270_UI_TYPE pw3270_application_get_ui_type(GApplication *app) { - return PW3270_UI_STYLE_GNOME; - } diff --git a/src/objects/window/private.h b/src/objects/window/private.h index 360bc55..47aa848 100644 --- a/src/objects/window/private.h +++ b/src/objects/window/private.h @@ -61,6 +61,9 @@ }; + // Internal methods + G_GNUC_INTERNAL GtkWidget * pw3270_setup_image_button(GtkWidget *button, const gchar *image_name); + // Actions G_GNUC_INTERNAL void pw3270_application_generic_activated(GSimpleAction * action, GVariant *parameter, gpointer application); G_GNUC_INTERNAL void pw3270_application_quit_activated(GSimpleAction * action, GVariant *parameter, gpointer application); diff --git a/src/objects/window/testprogram/testprogram.c b/src/objects/window/testprogram/testprogram.c index b080c36..dfed455 100644 --- a/src/objects/window/testprogram/testprogram.c +++ b/src/objects/window/testprogram/testprogram.c @@ -88,4 +88,8 @@ int main (int argc, char **argv) { } +PW3270_UI_TYPE pw3270_application_get_ui_type(GApplication *app) { + return PW3270_UI_STYLE_GNOME; +} + diff --git a/src/objects/window/ui/application.xml b/src/objects/window/ui/application.xml index 3e96cff..d875c0f 100644 --- a/src/objects/window/ui/application.xml +++ b/src/objects/window/ui/application.xml @@ -9,11 +9,7 @@ New Window - app.new_window - - - Preferences - app.help + app.new.window Quit @@ -24,21 +20,46 @@ + _Session + + + Open + win.open + + + + Close + win.close + + + + Open in new window + app.open.window + + + + Open in new tab + app.open.tab + + + + + _Edit
_Copy - app.quit + app.default _Paste - app.quit + app.default
Plugins - app.quit + app.default
diff --git a/src/objects/window/ui/window.xml b/src/objects/window/ui/window.xml index 105eb5d..b8959df 100644 --- a/src/objects/window/ui/window.xml +++ b/src/objects/window/ui/window.xml @@ -8,11 +8,11 @@ New Tab - app.new_tab + app.new.tab Application Window - app.new_window + app.new.window @@ -24,11 +24,11 @@ New tab - app.new_tab + app.new.tab New window - app.new_window + app.new.window diff --git a/src/objects/window/window.c b/src/objects/window/window.c index 8b8f0ae..51c88c3 100644 --- a/src/objects/window/window.c +++ b/src/objects/window/window.c @@ -74,6 +74,16 @@ static GActionEntry actions[] = { { + .name = "open", + .activate = pw3270_application_generic_activated, + }, + + { + .name = "close", + .activate = pw3270_application_generic_activated, + }, + + { .name = "preferences", .activate = pw3270_application_generic_activated, }, @@ -125,17 +135,13 @@ // Create gear button // https://wiki.gnome.org/Initiatives/GnomeGoals/GearIcons - GtkWidget * gear_menu = gtk_menu_button_new(); - gtk_button_set_image(GTK_BUTTON(gear_menu),gtk_image_new_from_icon_name("open-menu-symbolic",GTK_ICON_SIZE_MENU)); - + GtkWidget * gear_menu = pw3270_setup_image_button(gtk_menu_button_new(),"open-menu-symbolic"); gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(gear_menu), G_MENU_MODEL(gtk_builder_get_object (builder, "gear-menu"))); - gtk_header_bar_pack_end(header, gear_menu); // Create "new tab" bar - GtkWidget * new_tab_button = gtk_button_new_from_icon_name("tab-new-symbolic",GTK_ICON_SIZE_MENU); + GtkWidget * new_tab_button = pw3270_setup_image_button(gtk_button_new(),"tab-new-symbolic"); gtk_actionable_set_action_name(GTK_ACTIONABLE(new_tab_button),"app.new_tab"); - gtk_header_bar_pack_start(header, new_tab_button); // Show the new header diff --git a/src/objects/window/window.cbp b/src/objects/window/window.cbp index 591e29a..aed36fb 100644 --- a/src/objects/window/window.cbp +++ b/src/objects/window/window.cbp @@ -55,6 +55,9 @@ + + -- libgit2 0.21.2