Commit 66ae11a5e06d9903a789f2287be487138ed0faa9
Exists in
master
and in
1 other branch
Merge branch 'master' into develop
Showing
11 changed files
with
253 additions
and
206 deletions
Show diff stats
.lgtm.yml
@@ -5,10 +5,14 @@ extraction: | @@ -5,10 +5,14 @@ extraction: | ||
5 | # Define settings for C/C++ analysis | 5 | # Define settings for C/C++ analysis |
6 | ##################################### | 6 | ##################################### |
7 | cpp: | 7 | cpp: |
8 | + configure: | ||
9 | + command: | ||
10 | + - NOCONFIGURE=1 ./autogen.sh | ||
11 | + - ./configure --prefix=/usr --with-product-name="pw3270" | ||
8 | prepare: | 12 | prepare: |
9 | packages: | 13 | packages: |
10 | - gettext | 14 | - gettext |
11 | - - git | 15 | + - git |
12 | - make | 16 | - make |
13 | - autotools-dev | 17 | - autotools-dev |
14 | - autoconf | 18 | - autoconf |
src/dialogs/settings/accelerator.c
@@ -112,7 +112,7 @@ | @@ -112,7 +112,7 @@ | ||
112 | 112 | ||
113 | static void V3270AcceleratorSettings_init(V3270AcceleratorSettings *widget) | 113 | static void V3270AcceleratorSettings_init(V3270AcceleratorSettings *widget) |
114 | { | 114 | { |
115 | - size_t ix; | 115 | + //size_t ix; |
116 | 116 | ||
117 | // Create description list | 117 | // Create description list |
118 | GtkCellRenderer * text_renderer = gtk_cell_renderer_text_new(); | 118 | GtkCellRenderer * text_renderer = gtk_cell_renderer_text_new(); |
@@ -144,7 +144,6 @@ | @@ -144,7 +144,6 @@ | ||
144 | gtk_tree_view_set_enable_search(GTK_TREE_VIEW(view),TRUE); | 144 | gtk_tree_view_set_enable_search(GTK_TREE_VIEW(view),TRUE); |
145 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(view),1); | 145 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(view),1); |
146 | 146 | ||
147 | - | ||
148 | g_signal_connect(G_OBJECT(widget),"realize",G_CALLBACK(realize),view); | 147 | g_signal_connect(G_OBJECT(widget),"realize",G_CALLBACK(realize),view); |
149 | 148 | ||
150 | gtk_widget_set_tooltip_markup(view,_("Keyboard accelerators")); | 149 | gtk_widget_set_tooltip_markup(view,_("Keyboard accelerators")); |
@@ -180,7 +179,7 @@ | @@ -180,7 +179,7 @@ | ||
180 | NULL | 179 | NULL |
181 | ); | 180 | ); |
182 | 181 | ||
183 | - gtk_tree_view_column_set_min_width(column, 500); | 182 | + gtk_tree_view_column_set_min_width(column, 100); |
184 | gtk_tree_view_column_set_resizable(column, TRUE); | 183 | gtk_tree_view_column_set_resizable(column, TRUE); |
185 | 184 | ||
186 | gtk_tree_view_insert_column( | 185 | gtk_tree_view_insert_column( |
@@ -210,12 +209,13 @@ | @@ -210,12 +209,13 @@ | ||
210 | NULL | 209 | NULL |
211 | ); | 210 | ); |
212 | 211 | ||
212 | + /* | ||
213 | for(ix = 1; ix < 3; ix++) | 213 | for(ix = 1; ix < 3; ix++) |
214 | { | 214 | { |
215 | column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), ix); | 215 | column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), ix); |
216 | - gtk_tree_view_column_set_min_width(column, 200); | ||
217 | gtk_tree_view_column_set_resizable(column, TRUE); | 216 | gtk_tree_view_column_set_resizable(column, TRUE); |
218 | } | 217 | } |
218 | + */ | ||
219 | 219 | ||
220 | // Create scroller view | 220 | // Create scroller view |
221 | { | 221 | { |
@@ -223,14 +223,13 @@ | @@ -223,14 +223,13 @@ | ||
223 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(box),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); | 223 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(box),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); |
224 | gtk_container_add(GTK_CONTAINER(box),view); | 224 | gtk_container_add(GTK_CONTAINER(box),view); |
225 | 225 | ||
226 | - /* | ||
227 | - gtk_widget_set_vexpand(view,TRUE); | ||
228 | - gtk_widget_set_hexpand(view,TRUE); | ||
229 | - */ | ||
230 | - | 226 | + gtk_scrolled_window_set_propagate_natural_width(GTK_SCROLLED_WINDOW(box),TRUE); |
227 | + //gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(box),TRUE); | ||
231 | gtk_widget_set_vexpand(box,TRUE); | 228 | gtk_widget_set_vexpand(box,TRUE); |
232 | gtk_widget_set_hexpand(box,TRUE); | 229 | gtk_widget_set_hexpand(box,TRUE); |
233 | 230 | ||
231 | + gtk_scrolled_window_set_min_content_width(GTK_SCROLLED_WINDOW(box),800); | ||
232 | + //gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(box),600); | ||
234 | gtk_grid_attach(GTK_GRID(widget),box,0,0,10,10); | 233 | gtk_grid_attach(GTK_GRID(widget),box,0,0,10,10); |
235 | } | 234 | } |
236 | 235 |
src/dialogs/settings/dialog.c
1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
2 | + | ||
1 | /* | 3 | /* |
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. | 4 | + * Copyright (C) 2008 Banco do Brasil S.A. |
22 | * | 5 | * |
23 | - * Contatos: | 6 | + * This program is free software: you can redistribute it and/or modify |
7 | + * it under the terms of the GNU Lesser General Public License as published | ||
8 | + * by the Free Software Foundation, either version 3 of the License, or | ||
9 | + * (at your option) any later version. | ||
24 | * | 10 | * |
25 | - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
26 | - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | 11 | + * This program is distributed in the hope that it will be useful, |
12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + * GNU General Public License for more details. | ||
27 | * | 15 | * |
16 | + * You should have received a copy of the GNU Lesser General Public License | ||
17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
28 | */ | 18 | */ |
29 | 19 | ||
30 | #include "../private.h" | 20 | #include "../private.h" |
@@ -301,6 +291,11 @@ void v3270_settings_dialog_set_terminal_widget(GtkWidget *widget, GtkWidget *ter | @@ -301,6 +291,11 @@ void v3270_settings_dialog_set_terminal_widget(GtkWidget *widget, GtkWidget *ter | ||
301 | g_message("No active page on settings dialog"); | 291 | g_message("No active page on settings dialog"); |
302 | } | 292 | } |
303 | 293 | ||
294 | + gtk_window_set_transient_for( | ||
295 | + GTK_WINDOW(widget), | ||
296 | + GTK_WINDOW(gtk_widget_get_toplevel(terminal)) | ||
297 | + ); | ||
298 | + | ||
304 | } | 299 | } |
305 | 300 | ||
306 | void v3270_settings_dialog_set_has_subtitle(GtkWidget *widget, gboolean has_subtitle) | 301 | void v3270_settings_dialog_set_has_subtitle(GtkWidget *widget, gboolean has_subtitle) |
@@ -332,32 +327,6 @@ void v3270_setttings_dialog_response(GtkDialog *dialog, gint response_id, GtkWid | @@ -332,32 +327,6 @@ void v3270_setttings_dialog_response(GtkDialog *dialog, gint response_id, GtkWid | ||
332 | 327 | ||
333 | } | 328 | } |
334 | 329 | ||
335 | -void v3270_settings_popup_dialog(GtkWidget *widget, GtkWidget *terminal, gboolean modal) | ||
336 | -{ | ||
337 | - g_return_if_fail(GTK_IS_V3270(terminal) && GTK_IS_V3270_SETTINGS(widget)); | ||
338 | - | ||
339 | - GtkWidget * dialog = v3270_settings_dialog_new(); | ||
340 | - V3270Settings * settings = GTK_V3270_SETTINGS(widget); | ||
341 | - | ||
342 | - v3270_settings_dialog_set_has_subtitle(dialog,FALSE); | ||
343 | - | ||
344 | - if(settings->title) | ||
345 | - gtk_window_set_title(GTK_WINDOW(dialog),settings->title); | ||
346 | - | ||
347 | - gtk_container_add(GTK_CONTAINER(dialog), widget); | ||
348 | - gtk_dialog_set_toplevel(dialog,terminal); | ||
349 | - | ||
350 | - gtk_window_set_modal(GTK_WINDOW(dialog),modal); | ||
351 | - | ||
352 | - v3270_settings_dialog_set_terminal_widget(dialog, terminal); | ||
353 | - | ||
354 | - g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | ||
355 | - g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),NULL); | ||
356 | - | ||
357 | - gtk_widget_show_all(dialog); | ||
358 | - | ||
359 | -} | ||
360 | - | ||
361 | GtkWidget * v3270_settings_get_edit_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal) { | 330 | GtkWidget * v3270_settings_get_edit_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal) { |
362 | 331 | ||
363 | const gchar * title = GTK_V3270_SETTINGS(settings)->title; | 332 | const gchar * title = GTK_V3270_SETTINGS(settings)->title; |
src/dialogs/settings/host.c
@@ -588,6 +588,7 @@ LIB3270_EXPORT GtkWidget * v3270_host_select_new() | @@ -588,6 +588,7 @@ LIB3270_EXPORT GtkWidget * v3270_host_select_new() | ||
588 | return v3270_host_settings_new(); | 588 | return v3270_host_settings_new(); |
589 | } | 589 | } |
590 | 590 | ||
591 | +/* | ||
591 | LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) | 592 | LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) |
592 | { | 593 | { |
593 | g_return_if_fail(GTK_IS_V3270(widget)); | 594 | g_return_if_fail(GTK_IS_V3270(widget)); |
@@ -633,6 +634,7 @@ LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) | @@ -633,6 +634,7 @@ LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) | ||
633 | gtk_widget_destroy(dialog); | 634 | gtk_widget_destroy(dialog); |
634 | 635 | ||
635 | } | 636 | } |
637 | +*/ | ||
636 | 638 | ||
637 | static void apply(GtkWidget *w, GtkWidget *terminal) | 639 | static void apply(GtkWidget *w, GtkWidget *terminal) |
638 | { | 640 | { |
@@ -0,0 +1,54 @@ | @@ -0,0 +1,54 @@ | ||
1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
2 | + | ||
3 | +/* | ||
4 | + * Copyright (C) 2008 Banco do Brasil S.A. | ||
5 | + * | ||
6 | + * This program is free software: you can redistribute it and/or modify | ||
7 | + * it under the terms of the GNU Lesser General Public License as published | ||
8 | + * by the Free Software Foundation, either version 3 of the License, or | ||
9 | + * (at your option) any later version. | ||
10 | + * | ||
11 | + * This program is distributed in the hope that it will be useful, | ||
12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + * GNU General Public License for more details. | ||
15 | + * | ||
16 | + * You should have received a copy of the GNU Lesser General Public License | ||
17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
18 | + */ | ||
19 | + | ||
20 | + #include "private.h" | ||
21 | + #include <v3270/settings.h> | ||
22 | + #include <v3270/tools.h> | ||
23 | + | ||
24 | + GtkWidget * v3270_settings_popup_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal) | ||
25 | + { | ||
26 | +#ifdef DEBUG | ||
27 | + g_message("terminal=%d settings=%d",(int) GTK_IS_V3270(terminal), (int) GTK_IS_V3270_SETTINGS(settings)); | ||
28 | +#endif // DEBUG | ||
29 | + if( !(GTK_IS_V3270(terminal) && GTK_IS_V3270_SETTINGS(settings))) { | ||
30 | + g_message("%s was called with invalid arguments",__FUNCTION__); | ||
31 | + if(g_object_is_floating(settings)) { | ||
32 | + g_object_ref_sink(settings); | ||
33 | + } | ||
34 | + g_object_unref(settings); | ||
35 | + return; | ||
36 | + } | ||
37 | + | ||
38 | + GtkWidget * dialog = v3270_settings_dialog_new(); | ||
39 | + v3270_settings_dialog_set_has_subtitle(dialog,FALSE); | ||
40 | + | ||
41 | + gtk_window_set_title(GTK_WINDOW(dialog), v3270_settings_get_title(settings)); | ||
42 | + gtk_container_add(GTK_CONTAINER(dialog), settings); | ||
43 | + | ||
44 | + gtk_dialog_set_toplevel(dialog,terminal); | ||
45 | + gtk_window_set_modal(GTK_WINDOW(dialog),modal); | ||
46 | + | ||
47 | + v3270_settings_dialog_set_terminal_widget(dialog, terminal); | ||
48 | + | ||
49 | + g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),NULL); | ||
50 | + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | ||
51 | + | ||
52 | + return dialog; | ||
53 | + | ||
54 | + } |
src/include/v3270.h
@@ -239,7 +239,7 @@ | @@ -239,7 +239,7 @@ | ||
239 | LIB3270_EXPORT const gchar * v3270_get_remap_filename(GtkWidget *widget); | 239 | LIB3270_EXPORT const gchar * v3270_get_remap_filename(GtkWidget *widget); |
240 | 240 | ||
241 | // Auxiliary widgets | 241 | // Auxiliary widgets |
242 | - LIB3270_EXPORT void v3270_select_host(GtkWidget *widget); | 242 | + // LIB3270_EXPORT void v3270_select_host(GtkWidget *widget); |
243 | 243 | ||
244 | 244 | ||
245 | LIB3270_EXPORT int v3270_print(GtkWidget *widget, GError **error); | 245 | LIB3270_EXPORT int v3270_print(GtkWidget *widget, GError **error); |
src/include/v3270/settings.h
@@ -102,7 +102,7 @@ | @@ -102,7 +102,7 @@ | ||
102 | LIB3270_EXPORT const gchar * v3270_settings_get_tooltip(GtkWidget *widget); | 102 | LIB3270_EXPORT const gchar * v3270_settings_get_tooltip(GtkWidget *widget); |
103 | 103 | ||
104 | /// @brief Popup a settings dialog for the terminal. | 104 | /// @brief Popup a settings dialog for the terminal. |
105 | - LIB3270_EXPORT void v3270_settings_popup_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal); | 105 | + LIB3270_EXPORT GtkWidget * v3270_settings_popup_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal); |
106 | 106 | ||
107 | /// @brief Get an edit dialog for the settings widget. | 107 | /// @brief Get an edit dialog for the settings widget. |
108 | LIB3270_EXPORT GtkWidget * v3270_settings_get_edit_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal); | 108 | LIB3270_EXPORT GtkWidget * v3270_settings_get_edit_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal); |
src/terminal/actions/table.c
1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
2 | + | ||
1 | /* | 3 | /* |
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. | 4 | + * Copyright (C) 2008 Banco do Brasil S.A. |
16 | * | 5 | * |
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 | 6 | + * This program is free software: you can redistribute it and/or modify |
7 | + * it under the terms of the GNU Lesser General Public License as published | ||
8 | + * by the Free Software Foundation, either version 3 of the License, or | ||
9 | + * (at your option) any later version. | ||
20 | * | 10 | * |
21 | - * Este programa está nomeado como properties.c 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) | 11 | + * This program is distributed in the hope that it will be useful, |
12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + * GNU General Public License for more details. | ||
27 | * | 15 | * |
16 | + * You should have received a copy of the GNU Lesser General Public License | ||
17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
28 | */ | 18 | */ |
29 | 19 | ||
30 | #include "private.h" | 20 | #include "private.h" |
31 | #include <lib3270/actions.h> | 21 | #include <lib3270/actions.h> |
32 | #include <v3270/actions.h> | 22 | #include <v3270/actions.h> |
33 | #include <v3270/selection.h> | 23 | #include <v3270/selection.h> |
24 | + #include <v3270/settings.h> | ||
34 | #include <terminal.h> | 25 | #include <terminal.h> |
35 | 26 | ||
36 | -// static int fire_kp_add_action(GtkWidget *widget, const struct _v3270_action * action); | ||
37 | -// static int fire_kp_sub_action(GtkWidget *widget, const struct _v3270_action * action); | ||
38 | - | ||
39 | static int fire_copy_as_html(GtkWidget *widget, const struct _v3270_action * action); | 27 | static int fire_copy_as_html(GtkWidget *widget, const struct _v3270_action * action); |
40 | static int fire_copy_as_pixbuff(GtkWidget *widget, const struct _v3270_action * action); | 28 | static int fire_copy_as_pixbuff(GtkWidget *widget, const struct _v3270_action * action); |
29 | + static int fire_accelerators_dialog(GtkWidget *widget, const struct _v3270_action * action); | ||
30 | + static int fire_host_dialog(GtkWidget *widget, const struct _v3270_action * action); | ||
41 | 31 | ||
42 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 32 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
43 | 33 | ||
@@ -45,22 +35,9 @@ | @@ -45,22 +35,9 @@ | ||
45 | 35 | ||
46 | static const V3270_ACTION actions[] = { | 36 | static const V3270_ACTION actions[] = { |
47 | 37 | ||
48 | - /* | ||
49 | - { | ||
50 | - .name = "keypad-add", | ||
51 | - .keys = "<Mod2>KP_Add", | ||
52 | - .group = LIB3270_ACTION_GROUP_ONLINE, | ||
53 | - .activate = fire_kp_add_action | ||
54 | - }, | ||
55 | - { | ||
56 | - .name = "keypad-subtract", | ||
57 | - .keys = "<Mod2>KP_Subtract", | ||
58 | - .group = LIB3270_ACTION_GROUP_ONLINE, | ||
59 | - .activate = fire_kp_sub_action | ||
60 | - }, | ||
61 | - */ | ||
62 | - | 38 | + // |
63 | // Standard Clipboard actions | 39 | // Standard Clipboard actions |
40 | + // | ||
64 | { | 41 | { |
65 | .flags = (V3270_ACTION_FLAGS) V3270_COPY_SMART, | 42 | .flags = (V3270_ACTION_FLAGS) V3270_COPY_SMART, |
66 | .name = "copy", | 43 | .name = "copy", |
@@ -74,6 +51,17 @@ | @@ -74,6 +51,17 @@ | ||
74 | }, | 51 | }, |
75 | 52 | ||
76 | { | 53 | { |
54 | + .name = "copy-append", | ||
55 | + .keys = "<Primary><Shift>c", | ||
56 | + .flags = (V3270_ACTION_FLAGS) V3270_COPY_APPEND, | ||
57 | + .group = LIB3270_ACTION_GROUP_SELECTION, | ||
58 | + .label = N_( "Add to copy" ), | ||
59 | + .summary = N_("Append selection to clipboard"), | ||
60 | + .description = N_("Append selected area to current clipboard contents"), | ||
61 | + .activate = fire_copy_accelerator | ||
62 | + }, | ||
63 | + | ||
64 | + { | ||
77 | .name = "copy-html", | 65 | .name = "copy-html", |
78 | .group = LIB3270_ACTION_GROUP_SELECTION, | 66 | .group = LIB3270_ACTION_GROUP_SELECTION, |
79 | .label = N_( "Copy as HTML" ), | 67 | .label = N_( "Copy as HTML" ), |
@@ -92,19 +80,7 @@ | @@ -92,19 +80,7 @@ | ||
92 | }, | 80 | }, |
93 | 81 | ||
94 | { | 82 | { |
95 | - .name = "copy-append", | ||
96 | - .keys = "<Alt>c", | ||
97 | - .flags = (V3270_ACTION_FLAGS) V3270_COPY_APPEND, | ||
98 | - .group = LIB3270_ACTION_GROUP_SELECTION, | ||
99 | - .label = N_( "Add to copy" ), | ||
100 | - .summary = N_("Append selection to clipboard"), | ||
101 | - .description = N_("Append selected area to current clipboard contents"), | ||
102 | - .activate = fire_copy_accelerator | ||
103 | - }, | ||
104 | - | ||
105 | - { | ||
106 | .name = "copy-text", | 83 | .name = "copy-text", |
107 | - .keys = "<Primary><Shift>c", | ||
108 | .flags = (V3270_ACTION_FLAGS) V3270_COPY_TEXT, | 84 | .flags = (V3270_ACTION_FLAGS) V3270_COPY_TEXT, |
109 | .group = LIB3270_ACTION_GROUP_SELECTION, | 85 | .group = LIB3270_ACTION_GROUP_SELECTION, |
110 | .icon = "edit-copy", | 86 | .icon = "edit-copy", |
@@ -336,6 +312,30 @@ | @@ -336,6 +312,30 @@ | ||
336 | 312 | ||
337 | }, | 313 | }, |
338 | 314 | ||
315 | + // | ||
316 | + // Dialog actions | ||
317 | + // | ||
318 | + { | ||
319 | + .group = LIB3270_ACTION_GROUP_NONE, | ||
320 | + .name = "dialog-keyboard", | ||
321 | + .icon = "preferences-desktop-keyboard-shortcuts", | ||
322 | + .label = N_("Keyboard accelerators"), | ||
323 | + .summary = N_("Edit keyboard accelerators"), | ||
324 | + .activate = fire_accelerators_dialog | ||
325 | + }, | ||
326 | + | ||
327 | + { | ||
328 | + .group = LIB3270_ACTION_GROUP_OFFLINE, | ||
329 | + .name = "dialog-host", | ||
330 | + .icon = "network-server", | ||
331 | + .label = N_("Host settings"), | ||
332 | + .summary = N_("Edit host settings"), | ||
333 | + .activate = fire_host_dialog | ||
334 | + }, | ||
335 | + | ||
336 | + // | ||
337 | + // Terminator | ||
338 | + // | ||
339 | { | 339 | { |
340 | .name = NULL | 340 | .name = NULL |
341 | } | 341 | } |
@@ -355,26 +355,73 @@ | @@ -355,26 +355,73 @@ | ||
355 | return 0; | 355 | return 0; |
356 | } | 356 | } |
357 | 357 | ||
358 | - /* | ||
359 | - int fire_kp_add_action(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { | 358 | + static int fire_accelerators_dialog(GtkWidget *widget, const struct _v3270_action * action) { |
360 | 359 | ||
361 | - if(v3270_get_toggle(widget,LIB3270_TOGGLE_KP_ALTERNATIVE)) | ||
362 | - return lib3270_nextfield(GTK_V3270(widget)->host); | 360 | + GtkWidget * dialog = |
361 | + v3270_settings_popup_dialog( | ||
362 | + v3270_accelerator_settings_new(), | ||
363 | + widget, | ||
364 | + TRUE | ||
365 | + ); | ||
363 | 366 | ||
364 | - v3270_set_string(widget, "+"); | 367 | + gtk_window_set_default_size(GTK_WINDOW(dialog),950,400); |
368 | + gtk_widget_show_all(dialog); | ||
365 | 369 | ||
366 | return 0; | 370 | return 0; |
367 | - | ||
368 | } | 371 | } |
369 | 372 | ||
370 | - int fire_kp_sub_action(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { | 373 | + static int fire_host_dialog(GtkWidget *widget, const struct _v3270_action * action) { |
371 | 374 | ||
372 | - if(v3270_get_toggle(widget,LIB3270_TOGGLE_KP_ALTERNATIVE)) | ||
373 | - return lib3270_previousfield(GTK_V3270(widget)->host); | ||
374 | - | ||
375 | - v3270_set_string(widget, "-"); | 375 | + gtk_widget_show_all( |
376 | + v3270_settings_popup_dialog( | ||
377 | + v3270_host_settings_new(), | ||
378 | + widget, | ||
379 | + TRUE | ||
380 | + ) | ||
381 | + ); | ||
376 | 382 | ||
377 | return 0; | 383 | return 0; |
378 | 384 | ||
385 | + /* | ||
386 | + GtkWidget * dialog = v3270_settings_dialog_new(); | ||
387 | + GtkWidget * settings = v3270_host_settings_new(); | ||
388 | + | ||
389 | + v3270_settings_dialog_set_has_subtitle(dialog,FALSE); | ||
390 | + | ||
391 | + gtk_window_set_title(GTK_WINDOW(dialog), v3270_settings_get_title(settings)); | ||
392 | + gtk_container_add(GTK_CONTAINER(dialog), settings); | ||
393 | + | ||
394 | + gtk_dialog_set_toplevel(dialog,widget); | ||
395 | + gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); | ||
396 | + | ||
397 | + v3270_settings_dialog_set_terminal_widget(dialog, widget); | ||
398 | + | ||
399 | + gtk_window_set_default_size(GTK_WINDOW(dialog), 700, 150); | ||
400 | + gtk_widget_show_all(dialog); | ||
401 | + | ||
402 | + gboolean again = TRUE; | ||
403 | + while(again) | ||
404 | + { | ||
405 | + gtk_widget_set_sensitive(dialog,TRUE); | ||
406 | + gtk_widget_set_visible(dialog,TRUE); | ||
407 | + | ||
408 | + switch(gtk_dialog_run(GTK_DIALOG(dialog))) | ||
409 | + { | ||
410 | + case GTK_RESPONSE_APPLY: | ||
411 | + debug("V3270HostSelectWidget::%s=%s",__FUNCTION__,"GTK_RESPONSE_APPLY"); | ||
412 | + v3270_settings_dialog_apply(dialog); | ||
413 | + again = lib3270_reconnect(v3270_get_session(widget),0); | ||
414 | + break; | ||
415 | + | ||
416 | + case GTK_RESPONSE_CANCEL: | ||
417 | + again = FALSE; | ||
418 | + debug("V3270HostSelectWidget::%s=%s",__FUNCTION__,"GTK_RESPONSE_CANCEL"); | ||
419 | + v3270_settings_dialog_revert(dialog); | ||
420 | + break; | ||
421 | + } | ||
422 | + } | ||
423 | + | ||
424 | + gtk_widget_destroy(dialog); | ||
425 | + */ | ||
426 | + | ||
379 | } | 427 | } |
380 | -*/ |
src/terminal/keyboard/init.c
@@ -130,8 +130,6 @@ | @@ -130,8 +130,6 @@ | ||
130 | accelerator->arg = (gconstpointer) &actions[ix]; | 130 | accelerator->arg = (gconstpointer) &actions[ix]; |
131 | accelerator->activate = G_CALLBACK(fire_lib3270_action); | 131 | accelerator->activate = G_CALLBACK(fire_lib3270_action); |
132 | 132 | ||
133 | -// debug("%s=%s",actions[ix].name,keys[key]); | ||
134 | - | ||
135 | v3270_accelerator_parse(accelerator,keys[key]); | 133 | v3270_accelerator_parse(accelerator,keys[key]); |
136 | 134 | ||
137 | accelerators = g_slist_prepend(accelerators,accelerator); | 135 | accelerators = g_slist_prepend(accelerators,accelerator); |
@@ -228,61 +226,27 @@ | @@ -228,61 +226,27 @@ | ||
228 | 226 | ||
229 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,NULL)); | 227 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,NULL)); |
230 | 228 | ||
231 | - if(key == 7) { | 229 | + switch(key) { |
230 | + case 7: | ||
232 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"Page_Up")); | 231 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"Page_Up")); |
233 | - } else if(key == 8) { | 232 | + break; |
233 | + | ||
234 | + case 8: | ||
234 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"Page_Down")); | 235 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"Page_Down")); |
235 | - } | 236 | + break; |
236 | 237 | ||
237 | - } | 238 | + case 19: |
239 | + accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"<Shift>Page_Up")); | ||
240 | + break; | ||
238 | 241 | ||
239 | - } | ||
240 | - /* | ||
241 | - { | ||
242 | - static const struct | ||
243 | - { | ||
244 | - guint key; | ||
245 | - GdkModifierType mods; | ||
246 | - const gchar * name; | ||
247 | - const gchar * description; | ||
248 | - unsigned short pfkey; | ||
249 | - } accels[] = | ||
250 | - { | ||
251 | - { | ||
252 | - .key = GDK_Page_Up, | ||
253 | - .name = "page-up", | ||
254 | - .description = N_( "Previous page" ), | ||
255 | - .pfkey = 7 | ||
256 | - }, | ||
257 | - { | ||
258 | - .key = GDK_Page_Down, | ||
259 | - .name = "page-down", | ||
260 | - .description = N_( "Next page" ), | ||
261 | - .pfkey = 8 | 242 | + case 20: |
243 | + accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"<Shift>Page_Down")); | ||
244 | + break; | ||
262 | } | 245 | } |
263 | - }; | ||
264 | - | ||
265 | - for(ix = 0 ; ix < G_N_ELEMENTS(accels); ix++) | ||
266 | - { | ||
267 | - V3270PFKeyAccelerator * accelerator = g_new0(V3270PFKeyAccelerator,1); | ||
268 | - | ||
269 | - accelerator->keycode = accels[ix].pfkey; | ||
270 | - accelerator->name = accels[ix].name; | ||
271 | - accelerator->description = accels[ix].description; | ||
272 | - accelerator->parent.type = V3270_ACCELERATOR_TYPE_PFKEY; | ||
273 | - accelerator->parent.key = accels[ix].key; | ||
274 | - accelerator->parent.mods = accels[ix].mods; | ||
275 | - accelerator->parent.arg = (gconstpointer) accelerator; | ||
276 | - accelerator->parent.activate = G_CALLBACK(fire_pfkey_action); | ||
277 | - | ||
278 | - debug("%s Accelerator(%s)=%p pfkey=%d",__FUNCTION__,accelerator->name,accelerator,accelerator->keycode); | ||
279 | - | ||
280 | - widget->accelerators = g_slist_prepend(widget->accelerators,accelerator); | ||
281 | 246 | ||
282 | } | 247 | } |
283 | 248 | ||
284 | } | 249 | } |
285 | - */ | ||
286 | 250 | ||
287 | return v3270_accelerator_map_sort(accelerators); | 251 | return v3270_accelerator_map_sort(accelerators); |
288 | 252 |
src/trace/exec.c
1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
2 | + | ||
1 | /* | 3 | /* |
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. | 4 | + * Copyright (C) 2008 Banco do Brasil S.A. |
16 | * | 5 | * |
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 | 6 | + * This program is free software: you can redistribute it and/or modify |
7 | + * it under the terms of the GNU Lesser General Public License as published | ||
8 | + * by the Free Software Foundation, either version 3 of the License, or | ||
9 | + * (at your option) any later version. | ||
20 | * | 10 | * |
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) | 11 | + * This program is distributed in the hope that it will be useful, |
12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | + * GNU General Public License for more details. | ||
27 | * | 15 | * |
16 | + * You should have received a copy of the GNU Lesser General Public License | ||
17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
28 | */ | 18 | */ |
29 | 19 | ||
30 | #include "private.h" | 20 | #include "private.h" |
@@ -34,6 +24,7 @@ | @@ -34,6 +24,7 @@ | ||
34 | #include <lib3270/actions.h> | 24 | #include <lib3270/actions.h> |
35 | #include <internals.h> | 25 | #include <internals.h> |
36 | #include <v3270/selection.h> | 26 | #include <v3270/selection.h> |
27 | + #include <v3270/actions.h> | ||
37 | 28 | ||
38 | static const gchar * get_word(gchar **ptr) | 29 | static const gchar * get_word(gchar **ptr) |
39 | { | 30 | { |
@@ -308,19 +299,33 @@ | @@ -308,19 +299,33 @@ | ||
308 | } | 299 | } |
309 | 300 | ||
310 | // Check for external interpreters | 301 | // Check for external interpreters |
311 | - gboolean handled = FALSE; | ||
312 | - gchar * args = cmdline; | 302 | + { |
303 | + gboolean handled = FALSE; | ||
304 | + gchar * args = cmdline; | ||
313 | 305 | ||
314 | - while(*args && !g_ascii_isspace(*args)) | ||
315 | - args++; | 306 | + while(*args && !g_ascii_isspace(*args)) |
307 | + args++; | ||
316 | 308 | ||
317 | - if(*args) | ||
318 | - *(args++) = 0; | 309 | + if(*args) |
310 | + *(args++) = 0; | ||
319 | 311 | ||
320 | - v3270_trace_signal_emit(GTK_WIDGET(t), V3270_TRACE_SIGNAL_COMMAND, cmdline, args, &handled); | 312 | + v3270_trace_signal_emit(GTK_WIDGET(t), V3270_TRACE_SIGNAL_COMMAND, cmdline, args, &handled); |
321 | 313 | ||
322 | - if(handled) | ||
323 | - return 0; | 314 | + if(handled) |
315 | + return 0; | ||
316 | + } | ||
317 | + | ||
318 | + // Check for v3270 actions | ||
319 | + { | ||
320 | + const V3270_ACTION * action = v3270_get_actions(); | ||
321 | + | ||
322 | + while(action->name) { | ||
323 | + if(!g_ascii_strcasecmp(action->name,cmdline)) { | ||
324 | + return action->activate(terminal,action); | ||
325 | + } | ||
326 | + action++; | ||
327 | + } | ||
328 | + } | ||
324 | 329 | ||
325 | return errno = ENOENT; | 330 | return errno = ENOENT; |
326 | } | 331 | } |
v3270.cbp
@@ -117,6 +117,9 @@ | @@ -117,6 +117,9 @@ | ||
117 | <Unit filename="src/dialogs/settings/host.c"> | 117 | <Unit filename="src/dialogs/settings/host.c"> |
118 | <Option compilerVar="CC" /> | 118 | <Option compilerVar="CC" /> |
119 | </Unit> | 119 | </Unit> |
120 | + <Unit filename="src/dialogs/settings/popup.c"> | ||
121 | + <Option compilerVar="CC" /> | ||
122 | + </Unit> | ||
120 | <Unit filename="src/dialogs/settings/private.h" /> | 123 | <Unit filename="src/dialogs/settings/private.h" /> |
121 | <Unit filename="src/dialogs/settings/tools.c"> | 124 | <Unit filename="src/dialogs/settings/tools.c"> |
122 | <Option compilerVar="CC" /> | 125 | <Option compilerVar="CC" /> |