Commit 155e957cc532db480c6cce661d30a9253f329ddc

Authored by Perry Werneck
1 parent 043e8af0

Implementing new actions.

pw3270.cbp
... ... @@ -81,10 +81,19 @@
81 81 <Unit filename="src/objects/actions/lib3270/toggle.c">
82 82 <Option compilerVar="CC" />
83 83 </Unit>
  84 + <Unit filename="src/objects/actions/print.c">
  85 + <Option compilerVar="CC" />
  86 + </Unit>
84 87 <Unit filename="src/objects/actions/private.h" />
  88 + <Unit filename="src/objects/actions/save.c">
  89 + <Option compilerVar="CC" />
  90 + </Unit>
85 91 <Unit filename="src/objects/actions/simple.c">
86 92 <Option compilerVar="CC" />
87 93 </Unit>
  94 + <Unit filename="src/objects/actions/v3270/copy.c">
  95 + <Option compilerVar="CC" />
  96 + </Unit>
88 97 <Unit filename="src/objects/actions/v3270/property.c">
89 98 <Option compilerVar="CC" />
90 99 </Unit>
... ... @@ -142,6 +151,8 @@
142 151 <Unit filename="src/objects/window/window.c">
143 152 <Option compilerVar="CC" />
144 153 </Unit>
  154 + <Unit filename="ui/application.xml" />
  155 + <Unit filename="ui/window.xml" />
145 156 <Extensions>
146 157 <code_completion />
147 158 <debugger />
... ...
src/objects/actions/clipboard.c
... ... @@ -100,7 +100,7 @@
100 100  
101 101 }
102 102  
103   - GAction * pw3270_copy_action_new(void) {
  103 + GAction * pw3270_action_copy_new(void) {
104 104  
105 105 pw3270SimpleAction * action = pw3270_simple_action_new();
106 106  
... ... @@ -117,7 +117,7 @@
117 117  
118 118 }
119 119  
120   - GAction * pw3270_cut_action_new(void) {
  120 + GAction * pw3270_action_cut_new(void) {
121 121  
122 122 pw3270SimpleAction * action = pw3270_simple_action_new();
123 123  
... ... @@ -134,7 +134,7 @@
134 134  
135 135 }
136 136  
137   - GAction * pw3270_paste_action_new(void) {
  137 + GAction * pw3270_action_paste_new(void) {
138 138  
139 139  
140 140 pw3270SimpleAction * action = pw3270_simple_action_new();
... ...
src/objects/actions/connect.c
... ... @@ -41,7 +41,7 @@
41 41  
42 42 }
43 43  
44   - GAction * pw3270_connect_action_new(void) {
  44 + GAction * pw3270_action_connect_new(void) {
45 45  
46 46 pw3270Action * action = PW3270_ACTION(pw3270_action_new_from_lib3270(lib3270_action_get_by_name("reconnect")));
47 47  
... ...
src/objects/actions/print.c 0 → 100644
... ... @@ -0,0 +1,105 @@
  1 +/*
  2 + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  19 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  20 + *
  21 + * Este programa está nomeado como - e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  27 + *
  28 + */
  29 +
  30 + /**
  31 + * @brief Implement PW3270 print actions.
  32 + *
  33 + */
  34 +
  35 + #include "private.h"
  36 + #include <v3270.h>
  37 +
  38 + static void activate_print_screen(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  39 +
  40 + debug("%s",__FUNCTION__);
  41 +
  42 + }
  43 +
  44 + static void activate_print_selected(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  45 +
  46 + debug("%s",__FUNCTION__);
  47 +
  48 + }
  49 +
  50 + static void activate_print_copy(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  51 +
  52 + debug("%s",__FUNCTION__);
  53 +
  54 + }
  55 +
  56 + static void activate_print(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  57 +
  58 + debug("%s",__FUNCTION__);
  59 +
  60 + }
  61 +
  62 + GAction * pw3270_action_print_new(void) {
  63 +
  64 + pw3270SimpleAction * action = pw3270_simple_action_new();
  65 +
  66 + action->parent.activate = activate_print;
  67 + action->parent.types.parameter = G_VARIANT_TYPE_STRING;
  68 +
  69 + action->group.id = LIB3270_ACTION_GROUP_ONLINE;
  70 + action->parent.name = "print";
  71 + action->label = N_( "Print" );
  72 + action->tooltip = N_( "Print terminal contents." );
  73 +
  74 + return G_ACTION(action);
  75 +
  76 + }
  77 +
  78 + GAction * pw3270_action_print_screen_new(void) {
  79 +
  80 + pw3270SimpleAction * action = pw3270_simple_action_new();
  81 +
  82 + action->parent.activate = activate_print_screen;
  83 +
  84 + action->group.id = LIB3270_ACTION_GROUP_ONLINE;
  85 + action->parent.name = "print_screen";
  86 + action->label = N_( "Print screen" );
  87 +
  88 + return G_ACTION(action);
  89 +
  90 + }
  91 +
  92 + GAction * pw3270_action_print_selected_new(void) {
  93 +
  94 + pw3270SimpleAction * action = pw3270_simple_action_new();
  95 +
  96 + action->parent.activate = activate_print_selected;
  97 +
  98 + action->group.id = LIB3270_ACTION_GROUP_SELECTION;
  99 + action->parent.name = "print_selected";
  100 + action->label = N_( "Print selected" );
  101 +
  102 + return G_ACTION(action);
  103 +
  104 + }
  105 +
... ...
src/objects/actions/private.h
... ... @@ -61,9 +61,19 @@
61 61 G_GNUC_INTERNAL void pw3270_action_notify_state(GAction *object);
62 62  
63 63 // Internal actions
64   - G_GNUC_INTERNAL GAction * pw3270_connect_action_new(void);
65   - G_GNUC_INTERNAL GAction * pw3270_copy_action_new(void);
66   - G_GNUC_INTERNAL GAction * pw3270_cut_action_new(void);
67   - G_GNUC_INTERNAL GAction * pw3270_paste_action_new(void);
  64 + G_GNUC_INTERNAL GAction * pw3270_action_connect_new(void);
  65 + G_GNUC_INTERNAL GAction * pw3270_action_copy_new(void);
  66 + G_GNUC_INTERNAL GAction * pw3270_action_cut_new(void);
  67 + G_GNUC_INTERNAL GAction * pw3270_action_paste_new(void);
  68 +
  69 + G_GNUC_INTERNAL GAction * pw3270_action_save_new(void);
  70 + G_GNUC_INTERNAL GAction * pw3270_action_save_screen_new(void);
  71 + G_GNUC_INTERNAL GAction * pw3270_action_save_selected_new(void);
  72 + G_GNUC_INTERNAL GAction * pw3270_action_save_copy_new(void);
  73 +
  74 + G_GNUC_INTERNAL GAction * pw3270_action_print_new(void);
  75 + G_GNUC_INTERNAL GAction * pw3270_action_print_screen_new(void);
  76 + G_GNUC_INTERNAL GAction * pw3270_action_print_selected_new(void);
  77 + G_GNUC_INTERNAL GAction * pw3270_action_print_copy_new(void);
68 78  
69 79 #endif // PRIVATE_H_INCLUDED
... ...
src/objects/actions/save.c 0 → 100644
... ... @@ -0,0 +1,105 @@
  1 +/*
  2 + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  19 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  20 + *
  21 + * Este programa está nomeado como - e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  27 + *
  28 + */
  29 +
  30 + /**
  31 + * @brief Implement PW3270 save actions.
  32 + *
  33 + */
  34 +
  35 + #include "private.h"
  36 + #include <v3270.h>
  37 +
  38 + static void activate_save_screen(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  39 +
  40 + debug("%s",__FUNCTION__);
  41 +
  42 + }
  43 +
  44 + static void activate_save_selected(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  45 +
  46 + debug("%s",__FUNCTION__);
  47 +
  48 + }
  49 +
  50 + static void activate_save_copy(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  51 +
  52 + debug("%s",__FUNCTION__);
  53 +
  54 + }
  55 +
  56 + static void activate_save(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  57 +
  58 + debug("%s",__FUNCTION__);
  59 +
  60 + }
  61 +
  62 + GAction * pw3270_action_save_new(void) {
  63 +
  64 + pw3270SimpleAction * action = pw3270_simple_action_new();
  65 +
  66 + action->parent.activate = activate_save;
  67 + action->parent.types.parameter = G_VARIANT_TYPE_STRING;
  68 +
  69 + action->group.id = LIB3270_ACTION_GROUP_ONLINE;
  70 + action->parent.name = "save";
  71 + action->label = N_( "_Save" );
  72 + action->tooltip = N_( "Save terminal contents." );
  73 +
  74 + return G_ACTION(action);
  75 +
  76 + }
  77 +
  78 + GAction * pw3270_action_save_screen_new(void) {
  79 +
  80 + pw3270SimpleAction * action = pw3270_simple_action_new();
  81 +
  82 + action->parent.activate = activate_save_screen;
  83 +
  84 + action->group.id = LIB3270_ACTION_GROUP_ONLINE;
  85 + action->parent.name = "save_screen";
  86 + action->label = N_( "Save screen" );
  87 +
  88 + return G_ACTION(action);
  89 +
  90 + }
  91 +
  92 + GAction * pw3270_action_save_selected_new(void) {
  93 +
  94 + pw3270SimpleAction * action = pw3270_simple_action_new();
  95 +
  96 + action->parent.activate = activate_save_selected;
  97 +
  98 + action->group.id = LIB3270_ACTION_GROUP_SELECTION;
  99 + action->parent.name = "save_selected";
  100 + action->label = N_( "Save selected" );
  101 +
  102 + return G_ACTION(action);
  103 +
  104 + }
  105 +
... ...
src/objects/actions/v3270/copy.c 0 → 100644
... ... @@ -0,0 +1,61 @@
  1 +/*
  2 + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  19 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  20 + *
  21 + * Este programa está nomeado como - e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  27 + *
  28 + */
  29 +
  30 + /**
  31 + * @brief Implement PW3270 save actions.
  32 + *
  33 + */
  34 +
  35 + #include "../private.h"
  36 + #include <v3270.h>
  37 +
  38 +
  39 + GAction * pw3270_action_print_copy_new(void) {
  40 +
  41 + pw3270SimpleAction * action = pw3270_simple_action_new();
  42 +
  43 + action->group.id = LIB3270_ACTION_GROUP_ONLINE;
  44 + action->parent.name = "print_copy";
  45 + action->label = N_( "Print copy" );
  46 +
  47 + return G_ACTION(action);
  48 +
  49 + }
  50 +
  51 + GAction * pw3270_action_save_copy_new(void) {
  52 +
  53 + pw3270SimpleAction * action = pw3270_simple_action_new();
  54 +
  55 + action->group.id = LIB3270_ACTION_GROUP_ONLINE;
  56 + action->parent.name = "save_copy";
  57 + action->label = N_( "Save copy" );
  58 +
  59 + return G_ACTION(action);
  60 +
  61 + }
... ...
src/objects/actions/window.c
... ... @@ -68,10 +68,20 @@
68 68 GAction * actions[] = {
69 69 pw3270_action_new_pfkey(),
70 70 pw3270_action_new_pakey(),
71   - pw3270_connect_action_new(),
72   - pw3270_copy_action_new(),
73   - pw3270_cut_action_new(),
74   - pw3270_paste_action_new()
  71 + pw3270_action_connect_new(),
  72 + pw3270_action_copy_new(),
  73 + pw3270_action_cut_new(),
  74 + pw3270_action_paste_new(),
  75 + pw3270_action_save_new(),
  76 +
  77 + pw3270_action_save_screen_new(),
  78 + pw3270_action_save_selected_new(),
  79 + pw3270_action_save_copy_new(),
  80 +
  81 + pw3270_action_print_screen_new(),
  82 + pw3270_action_print_selected_new(),
  83 + pw3270_action_print_copy_new()
  84 +
75 85 };
76 86  
77 87 for(ix = 0; ix < G_N_ELEMENTS(actions); ix++) {
... ...
src/objects/toolbar/toolbar.c
... ... @@ -34,6 +34,7 @@
34 34  
35 35 static gboolean popup_context_menu(GtkToolbar *toolbar, gint x, gint y, gint button_number);
36 36 static void finalize(GObject *object);
  37 + static void pw3270_toolbar_toolbar_set_style(GtkToolbar *toolbar, GtkToolbarStyle style);
37 38  
38 39 static const struct icon_size {
39 40 const gchar * label;
... ...
ui/application.xml
... ... @@ -324,7 +324,7 @@
324 324 </submenu>
325 325  
326 326 <submenu id='font-select-placeholder'>
327   - <attribute name="label" translatable="yes">Select font</attribute>
  327 + <attribute name="label" translatable="yes">Terminal font</attribute>
328 328 </submenu>
329 329  
330 330 <submenu>
... ...