Commit ca20d5926a1752c26726433affbea5bbc5f20079
1 parent
071e1102
Exists in
master
and in
1 other branch
Working in the new FT components.
Showing
4 changed files
with
184 additions
and
1 deletions
Show diff stats
src/include/internals.h
| @@ -61,6 +61,7 @@ | @@ -61,6 +61,7 @@ | ||
| 61 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); | 61 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); |
| 62 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); | 62 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); |
| 63 | G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_grid(GtkAlign align); | 63 | G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_grid(GtkAlign align); |
| 64 | + G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_frame(GtkWidget * child, const gchar *title); | ||
| 64 | 65 | ||
| 65 | G_END_DECLS | 66 | G_END_DECLS |
| 66 | 67 |
src/include/v3270/filetransfer.h
| @@ -94,6 +94,25 @@ | @@ -94,6 +94,25 @@ | ||
| 94 | 94 | ||
| 95 | LIB3270_EXPORT GtkWidget * v3270_ft_settings_new(); | 95 | LIB3270_EXPORT GtkWidget * v3270_ft_settings_new(); |
| 96 | 96 | ||
| 97 | + // FT Activity widget | ||
| 98 | + #define G_TYPE_V3270_FT_ACTIVITY (V3270FTActivity_get_type ()) | ||
| 99 | + #define G_V3270_FT_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_V3270_FT_ACTIVITY, V3270FTActivity)) | ||
| 100 | + #define G_V3270_FT_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_V3270_FT_ACTIVITY, V3270FTActivityClass)) | ||
| 101 | + #define G_IS_V3270_FT_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_V3270_FT_ACTIVITY)) | ||
| 102 | + #define G_IS_V3270_FT_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_V3270_FT_ACTIVITY)) | ||
| 103 | + #define G_V3270_FT_ACTIVITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_V3270_FT_ACTIVITY, V3270FTActivityClass)) | ||
| 104 | + | ||
| 105 | + typedef struct _V3270FTActivity V3270FTActivity; | ||
| 106 | + typedef struct _V3270FTActivityClass V3270FTActivityClass; | ||
| 107 | + | ||
| 108 | + LIB3270_EXPORT GObject * v3270_ft_activity_new(); | ||
| 109 | + | ||
| 110 | + LIB3270_EXPORT const gchar * v3270_ft_activity_get_local_filename(GObject *object); | ||
| 111 | + LIB3270_EXPORT const gchar * v3270_ft_activity_get_remote_filename(GObject *object); | ||
| 112 | + | ||
| 113 | + LIB3270_EXPORT void v3270_ft_activity_set_local_filename(GObject *object, const gchar *filename); | ||
| 114 | + LIB3270_EXPORT void v3270_ft_activity_set_remote_filename(GObject *object, const gchar *filename); | ||
| 115 | + | ||
| 97 | // FT Dialog widget | 116 | // FT Dialog widget |
| 98 | #define GTK_TYPE_V3270_FT_DIALOG (V3270FTDialog_get_type ()) | 117 | #define GTK_TYPE_V3270_FT_DIALOG (V3270FTDialog_get_type ()) |
| 99 | #define GTK_V3270_FT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_V3270_FT_DIALOG, V3270FTDialog)) | 118 | #define GTK_V3270_FT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_V3270_FT_DIALOG, V3270FTDialog)) |
| @@ -0,0 +1,161 @@ | @@ -0,0 +1,161 @@ | ||
| 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 <internals.h> | ||
| 31 | + #include <v3270/filetransfer.h> | ||
| 32 | + | ||
| 33 | +/*--[ Widget definition ]----------------------------------------------------------------------------*/ | ||
| 34 | + | ||
| 35 | + struct _V3270FTActivityClass | ||
| 36 | + { | ||
| 37 | + GObjectClass parent_class; | ||
| 38 | + | ||
| 39 | + }; | ||
| 40 | + | ||
| 41 | + struct _V3270FTActivity | ||
| 42 | + { | ||
| 43 | + GObject parent; | ||
| 44 | + | ||
| 45 | + struct { | ||
| 46 | + gchar * local; | ||
| 47 | + gchar * remote; | ||
| 48 | + } file; | ||
| 49 | + | ||
| 50 | + }; | ||
| 51 | + | ||
| 52 | + enum | ||
| 53 | + { | ||
| 54 | + PROP_0, | ||
| 55 | + PROP_LOCAL, | ||
| 56 | + PROP_REMOTE | ||
| 57 | + }; | ||
| 58 | + | ||
| 59 | + G_DEFINE_TYPE(V3270FTActivity, V3270FTActivity, G_TYPE_OBJECT); | ||
| 60 | + | ||
| 61 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | ||
| 62 | + | ||
| 63 | + static void dispose(GObject *object) | ||
| 64 | + { | ||
| 65 | + debug("%s",__FUNCTION__); | ||
| 66 | + | ||
| 67 | + V3270FTActivity * activity = G_V3270_FT_ACTIVITY(object); | ||
| 68 | + | ||
| 69 | + g_free(activity->file.local); | ||
| 70 | + g_free(activity->file.remote); | ||
| 71 | + | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec G_GNUC_UNUSED(*pspec)) | ||
| 75 | + { | ||
| 76 | + switch(prop_id) | ||
| 77 | + { | ||
| 78 | + case PROP_LOCAL: | ||
| 79 | + v3270_ft_activity_set_local_filename(object,g_value_get_string(value)); | ||
| 80 | + break; | ||
| 81 | + | ||
| 82 | + case PROP_REMOTE: | ||
| 83 | + v3270_ft_activity_set_remote_filename(object,g_value_get_string(value)); | ||
| 84 | + break; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec G_GNUC_UNUSED(*pspec)) | ||
| 90 | + { | ||
| 91 | + switch(prop_id) | ||
| 92 | + { | ||
| 93 | + case PROP_LOCAL: | ||
| 94 | + g_value_set_string(value,v3270_ft_activity_get_local_filename(object)); | ||
| 95 | + break; | ||
| 96 | + | ||
| 97 | + case PROP_REMOTE: | ||
| 98 | + g_value_set_string(value,v3270_ft_activity_get_remote_filename(object)); | ||
| 99 | + break; | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + static void V3270FTActivity_class_init(V3270FTActivityClass *klass) | ||
| 104 | + { | ||
| 105 | + G_OBJECT_CLASS(klass)->dispose = dispose; | ||
| 106 | + | ||
| 107 | + G_OBJECT_CLASS(klass)->set_property = set_property; | ||
| 108 | + G_OBJECT_CLASS(klass)->get_property = get_property; | ||
| 109 | + | ||
| 110 | + g_object_class_install_property( | ||
| 111 | + G_OBJECT_CLASS(klass), | ||
| 112 | + PROP_LOCAL, | ||
| 113 | + g_param_spec_string ("local", "Local", | ||
| 114 | + _( "Full path of local file" ), | ||
| 115 | + FALSE, G_PARAM_READWRITE)); | ||
| 116 | + | ||
| 117 | + g_object_class_install_property( | ||
| 118 | + G_OBJECT_CLASS(klass), | ||
| 119 | + PROP_LOCAL, | ||
| 120 | + g_param_spec_string ("remote", "remote", | ||
| 121 | + _( "Full path of remote file" ), | ||
| 122 | + FALSE, G_PARAM_READWRITE)); | ||
| 123 | + | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + static void V3270FTActivity_init(V3270FTActivity *widget) | ||
| 127 | + { | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + LIB3270_EXPORT GObject * v3270_ft_activity_new() | ||
| 131 | + { | ||
| 132 | + return g_object_new(G_TYPE_V3270_FT_ACTIVITY, NULL); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + LIB3270_EXPORT const gchar * v3270_ft_activity_get_local_filename(GObject *object) | ||
| 136 | + { | ||
| 137 | + gchar **ptr = & G_V3270_FT_ACTIVITY(object)->file.local; | ||
| 138 | + return(*ptr ? *ptr : ""); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + LIB3270_EXPORT const gchar * v3270_ft_activity_get_remote_filename(GObject *object) | ||
| 142 | + { | ||
| 143 | + gchar **ptr = & G_V3270_FT_ACTIVITY(object)->file.remote; | ||
| 144 | + return(*ptr ? *ptr : ""); | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + LIB3270_EXPORT void v3270_ft_activity_set_local_filename(GObject *object, const gchar *filename) | ||
| 148 | + { | ||
| 149 | + gchar **ptr = & G_V3270_FT_ACTIVITY(object)->file.local; | ||
| 150 | + | ||
| 151 | + g_free(*ptr); | ||
| 152 | + *ptr = g_strdup(filename); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + LIB3270_EXPORT void v3270_ft_activity_set_remote_filename(GObject *object, const gchar *filename) | ||
| 156 | + { | ||
| 157 | + gchar **ptr = & G_V3270_FT_ACTIVITY(object)->file.remote; | ||
| 158 | + | ||
| 159 | + g_free(*ptr); | ||
| 160 | + *ptr = g_strdup(filename); | ||
| 161 | + } |
src/v3270ft/dialog.c
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | * | 27 | * |
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | - #include <v3270.h> | 30 | + #include <internals.h> |
| 31 | #include <v3270/filetransfer.h> | 31 | #include <v3270/filetransfer.h> |
| 32 | #include "private.h" | 32 | #include "private.h" |
| 33 | 33 | ||
| @@ -107,6 +107,8 @@ static void V3270FTDialog_init(V3270FTDialog *widget) | @@ -107,6 +107,8 @@ static void V3270FTDialog_init(V3270FTDialog *widget) | ||
| 107 | gtk_widget_set_tooltip_markup(files,_("Files to transfer")); | 107 | gtk_widget_set_tooltip_markup(files,_("Files to transfer")); |
| 108 | 108 | ||
| 109 | gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(files),TRUE); | 109 | gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(files),TRUE); |
| 110 | + gtk_tree_view_set_reorderable(GTK_TREE_VIEW(files),TRUE); | ||
| 111 | + | ||
| 110 | gtk_tree_view_insert_column_with_attributes( | 112 | gtk_tree_view_insert_column_with_attributes( |
| 111 | GTK_TREE_VIEW(files), | 113 | GTK_TREE_VIEW(files), |
| 112 | -1, | 114 | -1, |