diff --git a/pw3270.cbp b/pw3270.cbp index fe8d403..957fc65 100644 --- a/pw3270.cbp +++ b/pw3270.cbp @@ -111,6 +111,9 @@ + + diff --git a/src/include/pw3270/actions.h b/src/include/pw3270/actions.h index 6f622d6..28ac983 100644 --- a/src/include/pw3270/actions.h +++ b/src/include/pw3270/actions.h @@ -83,6 +83,9 @@ GType pw3270Action_get_type(void) G_GNUC_CONST; + /// @brief New generica acion. + GAction * pw3270_action_new(); + /// @brief New action from LIB3270's control data. GAction * pw3270_action_new_from_lib3270(const LIB3270_ACTION * definition); diff --git a/src/objects/actions/abstract.c b/src/objects/actions/abstract.c index 60be025..9818947 100644 --- a/src/objects/actions/abstract.c +++ b/src/objects/actions/abstract.c @@ -401,9 +401,9 @@ } - gboolean get_enabled(GAction G_GNUC_UNUSED(*object), GtkWidget G_GNUC_UNUSED(*terminal)) { -// debug("%s(%s)",__FUNCTION__,pw3270_action_get_name(object)); - return TRUE; + gboolean get_enabled(GAction G_GNUC_UNUSED(*object), GtkWidget *terminal) { + debug("Action %s is %s",pw3270_action_get_name(object),terminal == NULL ? "disabled" : "enabled"); + return terminal != NULL; } void activate(GAction *action, GVariant G_GNUC_UNUSED(*parameter), GtkWidget G_GNUC_UNUSED(*terminal)) { @@ -439,3 +439,7 @@ H3270 * pw3270_action_get_session(GAction *action) { return v3270_get_session(PW3270_ACTION(action)->terminal); } + + GAction * pw3270_action_new() { + return G_ACTION(g_object_new(PW3270_TYPE_ACTION, NULL)); + } diff --git a/src/objects/window/actions/preferences.c b/src/objects/window/actions/preferences.c index 5fb5f8e..d6f5ab5 100644 --- a/src/objects/window/actions/preferences.c +++ b/src/objects/window/actions/preferences.c @@ -28,10 +28,25 @@ */ #include "../private.h" + #include + #include + #include - void pw3270_window_preferences_activated(GSimpleAction G_GNUC_UNUSED(* action), GVariant G_GNUC_UNUSED(*parameter), gpointer application) { + static void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal); + + GAction * pw3270_session_preferences_action_new(void) { + + pw3270Action * action = PW3270_ACTION(pw3270_action_new()); + + action->activate = activate; + action->name = "preferences"; + + return G_ACTION(action); + + } + + void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { - debug("%s",__FUNCTION__); } diff --git a/src/objects/window/actions/setcolors.c b/src/objects/window/actions/setcolors.c new file mode 100644 index 0000000..a7428cc --- /dev/null +++ b/src/objects/window/actions/setcolors.c @@ -0,0 +1,62 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + #include "../private.h" + #include + #include + #include + #include + #include + + static void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal); + + GAction * pw3270_set_color_action_new(void) { + + pw3270Action * action = PW3270_ACTION(pw3270_action_new()); + + action->activate = activate; + action->name = "setcolors"; + + return G_ACTION(action); + + } + + void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + g_return_if_fail(GTK_IS_V3270(terminal)); + + GtkWidget * dialog = v3270_settings_dialog_new(terminal, v3270_color_selection_new()); + + v3270_dialog_setup(dialog,_("Color setup"),_("_Save")); + + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); + g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL); + + } + diff --git a/src/objects/window/private.h b/src/objects/window/private.h index 5804cdb..6b3bfc6 100644 --- a/src/objects/window/private.h +++ b/src/objects/window/private.h @@ -66,10 +66,11 @@ // Actions GAction * pw3270_set_host_action_new(void); + GAction * pw3270_set_color_action_new(void); + GAction * pw3270_session_preferences_action_new(void); G_GNUC_INTERNAL void pw3270_window_open_activated(GSimpleAction * action, GVariant *parameter, gpointer application); G_GNUC_INTERNAL void pw3270_window_close_activated(GSimpleAction * action, GVariant *parameter, gpointer application); - G_GNUC_INTERNAL void pw3270_window_preferences_activated(GSimpleAction * action, GVariant *parameter, gpointer application); #endif // PRIVATE_H_INCLUDED diff --git a/src/objects/window/window.c b/src/objects/window/window.c index 0ebfb4d..08dfe67 100644 --- a/src/objects/window/window.c +++ b/src/objects/window/window.c @@ -100,10 +100,17 @@ size_t ix; GAction * actions[] = { - pw3270_set_host_action_new() + pw3270_set_host_action_new(), + pw3270_set_color_action_new(), + 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]); } @@ -124,11 +131,6 @@ .activate = pw3270_window_close_activated, }, - { - .name = "preferences", - .activate = pw3270_window_preferences_activated, - }, - }; g_action_map_add_action_entries( diff --git a/ui/application.xml b/ui/application.xml index 41c2047..103f985 100644 --- a/ui/application.xml +++ b/ui/application.xml @@ -231,7 +231,7 @@ Colors - win.edit.colors + win.set.colors @@ -244,42 +244,103 @@ win.screen.sizes - + + + Options + + + Connect on startup + win.autoconnect + + + + Blinking Cursor + win.cursorblink + + + + Monocase + win.monocase + + + + Track Cursor + win.cursorpos + + + + Full Screen + win.fullscreen + + + + Resize on alternate screen + win.altscreen + + + + Paste with left margin + win.marginedpaste + + + + Cross hair cursor + win.crosshair + + + + Blank Fill + win.blankfill + + + + Select by rectangles + win.rectselect + + + + Auto-Reconnect + win.autoreconnect + + + + Bold + win.bold + + + + Show Underline + win.underline + + + + Keep selected + win.keepselected + + + + Smart paste + win.smartpaste + + + + Alert sound + win.beep + + + + Use +/- for field navigation + win.kpalternative + + + + Network keep alive + win.keepalive + + + - + -- libgit2 0.21.2