From 6a0e1dd77867f140bb71ff6bf855a3a10219101f Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 30 Oct 2019 16:03:40 -0300 Subject: [PATCH] Implementing the classic UI. --- src/objects/actions/abstract.c | 4 +--- src/objects/toolbar/toolbutton.c | 17 ++++++++++++++++- src/objects/window/actions/preferences.c | 13 +++++++------ src/objects/window/window.c | 8 +++----- ui/application.xml | 2 +- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/objects/actions/abstract.c b/src/objects/actions/abstract.c index f6b92b2..800b3b2 100644 --- a/src/objects/actions/abstract.c +++ b/src/objects/actions/abstract.c @@ -388,7 +388,7 @@ if(action && action->terminal) { enabled = PW3270_ACTION_GET_CLASS(object)->get_enabled(object,action->terminal); - debug("Action %s is %s",g_action_get_name(object),enabled ? "enabled" : "disabled"); +// debug("Action %s is %s",g_action_get_name(object),enabled ? "enabled" : "disabled"); } return enabled; @@ -420,8 +420,6 @@ } const gchar * pw3270_action_get_icon_name(GAction *action) { - debug("***********%s(%p)=%p",__FUNCTION__,action,PW3270_ACTION_GET_CLASS(action)->get_icon_name); - debug("*************** %s",g_action_get_name(action)); return PW3270_ACTION_GET_CLASS(action)->get_icon_name(action); } diff --git a/src/objects/toolbar/toolbutton.c b/src/objects/toolbar/toolbutton.c index 32aa951..14eaafc 100644 --- a/src/objects/toolbar/toolbutton.c +++ b/src/objects/toolbar/toolbutton.c @@ -54,8 +54,23 @@ .name = "preferences", .icon_name = "preferences-other", .label = N_("Preferences"), + }, + + { + .name = "quit", + .icon_name = "gtk-quit", + .label = N_("Quit"), + .tooltip = N_("Quit application") + }, + + { + .name = "file.transfer", + .icon_name = "drive-harddisk", + .label = N_("Send/Receive"), + .tooltip = N_("Send/Receive files") } + }; static const struct Button * get_button_info(const gchar *name) { @@ -133,7 +148,7 @@ const gchar * icon_name = pw3270_action_get_icon_name(action); if(!icon_name) { - g_message("Action doesn't have an icon"); + g_message("Action \"%s\" doesn't have an icon",g_action_get_name(action)); return NULL; } diff --git a/src/objects/window/actions/preferences.c b/src/objects/window/actions/preferences.c index a289f5a..25f2c03 100644 --- a/src/objects/window/actions/preferences.c +++ b/src/objects/window/actions/preferences.c @@ -36,20 +36,21 @@ GAction * pw3270_session_preferences_action_new(void) { - pw3270Action * action = PW3270_ACTION(pw3270_action_new()); + pw3270SimpleAction * action = pw3270_simple_action_new(); - action->activate = activate; - action->name = "preferences"; - - debug("action=%p",__FUNCTION__); - debug("\n\n%s\n\n",pw3270_action_get_icon_name(G_ACTION(action))); + action->parent.activate = activate; + action->parent.name = "preferences"; + action->icon_name = "preferences-other"; + action->label = N_("Session properties"); return G_ACTION(action); + } void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + debug("%s","Activating session properties dialog"); } diff --git a/src/objects/window/window.c b/src/objects/window/window.c index 995e240..4855050 100644 --- a/src/objects/window/window.c +++ b/src/objects/window/window.c @@ -105,10 +105,6 @@ pw3270_session_preferences_action_new() }; - debug("****************************** %s",__FUNCTION__); - debug("color is %s",g_action_get_enabled(actions[1]) ? "enabled" : "disabled"); - debug("****************************** %s",__FUNCTION__); - for(ix = 0; ix < G_N_ELEMENTS(actions); ix++) { debug("Inserting %s",g_action_get_name(actions[ix])); g_action_map_add_action(G_ACTION_MAP(widget),actions[ix]); @@ -155,7 +151,9 @@ "separator", "win.set.colors", "win.preferences", - "win.print" + "win.file.transfer", + "win.print", + "app.quit" }; diff --git a/ui/application.xml b/ui/application.xml index 103f985..42f79f4 100644 --- a/ui/application.xml +++ b/ui/application.xml @@ -162,7 +162,7 @@ - Remove selection + Unselect win.unselect -- libgit2 0.21.2