Commit 1bc8832009583783c145efde9dfdce91ba4ae9b9
1 parent
6a0e1dd7
Exists in
master
and in
4 other branches
Adding "file transfer" dialog.
Showing
6 changed files
with
91 additions
and
10 deletions
Show diff stats
pw3270.cbp
| ... | ... | @@ -108,6 +108,9 @@ |
| 108 | 108 | <Unit filename="src/objects/window/actions/close.c"> |
| 109 | 109 | <Option compilerVar="CC" /> |
| 110 | 110 | </Unit> |
| 111 | + <Unit filename="src/objects/window/actions/filetransfer.c"> | |
| 112 | + <Option compilerVar="CC" /> | |
| 113 | + </Unit> | |
| 111 | 114 | <Unit filename="src/objects/window/actions/open.c"> |
| 112 | 115 | <Option compilerVar="CC" /> |
| 113 | 116 | </Unit> | ... | ... |
src/objects/toolbar/toolbutton.c
| ... | ... | @@ -63,14 +63,6 @@ |
| 63 | 63 | .tooltip = N_("Quit application") |
| 64 | 64 | }, |
| 65 | 65 | |
| 66 | - { | |
| 67 | - .name = "file.transfer", | |
| 68 | - .icon_name = "drive-harddisk", | |
| 69 | - .label = N_("Send/Receive"), | |
| 70 | - .tooltip = N_("Send/Receive files") | |
| 71 | - } | |
| 72 | - | |
| 73 | - | |
| 74 | 66 | }; |
| 75 | 67 | |
| 76 | 68 | static const struct Button * get_button_info(const gchar *name) { | ... | ... |
| ... | ... | @@ -0,0 +1,84 @@ |
| 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 | + #include "../private.h" | |
| 31 | + #include <pw3270/window.h> | |
| 32 | + #include <pw3270/actions.h> | |
| 33 | + #include <v3270/filetransfer.h> | |
| 34 | + | |
| 35 | + static void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal); | |
| 36 | + | |
| 37 | + GAction * pw3270_file_transfer_action_new(void) { | |
| 38 | + | |
| 39 | + pw3270SimpleAction * action = pw3270_simple_action_new(); | |
| 40 | + | |
| 41 | + action->parent.activate = activate; | |
| 42 | + action->parent.name = "file.transfer"; | |
| 43 | + action->icon_name = "drive-harddisk"; | |
| 44 | + action->label = N_("Send/Receive"); | |
| 45 | + action->tooltip = N_("Send/Receive files"); | |
| 46 | + | |
| 47 | + return G_ACTION(action); | |
| 48 | + | |
| 49 | + } | |
| 50 | + | |
| 51 | + void activate(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { | |
| 52 | + | |
| 53 | + debug("%s","Activating file transfer dialog"); | |
| 54 | + | |
| 55 | + GtkWidget * dialog = v3270ft_new(gtk_widget_get_toplevel(terminal)); | |
| 56 | + | |
| 57 | + do { | |
| 58 | + | |
| 59 | + gtk_widget_show_all(dialog); | |
| 60 | + | |
| 61 | + switch(gtk_dialog_run(GTK_DIALOG(dialog))) { | |
| 62 | + case GTK_RESPONSE_APPLY: | |
| 63 | + case GTK_RESPONSE_OK: | |
| 64 | + case GTK_RESPONSE_YES: | |
| 65 | + gtk_widget_hide(dialog); | |
| 66 | + v3270ft_transfer(dialog,v3270_get_session(terminal)); | |
| 67 | + break; | |
| 68 | + | |
| 69 | + case GTK_RESPONSE_CANCEL: | |
| 70 | + case GTK_RESPONSE_NO: | |
| 71 | + case GTK_RESPONSE_DELETE_EVENT: | |
| 72 | + v3270ft_remove_all(dialog); | |
| 73 | + break; | |
| 74 | + | |
| 75 | + default: | |
| 76 | + g_warning("Unexpected response from v3270ft"); | |
| 77 | + } | |
| 78 | + | |
| 79 | + } while(v3270ft_get_length(dialog) > 0); | |
| 80 | + | |
| 81 | + gtk_widget_destroy(dialog); | |
| 82 | + | |
| 83 | + } | |
| 84 | + | ... | ... |
src/objects/window/private.h
| ... | ... | @@ -68,6 +68,7 @@ |
| 68 | 68 | GAction * pw3270_set_host_action_new(void); |
| 69 | 69 | GAction * pw3270_set_color_action_new(void); |
| 70 | 70 | GAction * pw3270_session_preferences_action_new(void); |
| 71 | + GAction * pw3270_file_transfer_action_new(void); | |
| 71 | 72 | |
| 72 | 73 | G_GNUC_INTERNAL void pw3270_window_open_activated(GSimpleAction * action, GVariant *parameter, gpointer application); |
| 73 | 74 | G_GNUC_INTERNAL void pw3270_window_close_activated(GSimpleAction * action, GVariant *parameter, gpointer application); | ... | ... |
src/objects/window/window.c
| ... | ... | @@ -102,7 +102,8 @@ |
| 102 | 102 | GAction * actions[] = { |
| 103 | 103 | pw3270_set_host_action_new(), |
| 104 | 104 | pw3270_set_color_action_new(), |
| 105 | - pw3270_session_preferences_action_new() | |
| 105 | + pw3270_session_preferences_action_new(), | |
| 106 | + pw3270_file_transfer_action_new() | |
| 106 | 107 | }; |
| 107 | 108 | |
| 108 | 109 | for(ix = 0; ix < G_N_ELEMENTS(actions); ix++) { | ... | ... |
ui/application.xml