Commit 10dbb6f7bd1da8c06cc0a9e63c336b4d06890afe
1 parent
71f17fd3
Exists in
master
and in
1 other branch
Reworking file transfer dialog.
Showing
1 changed file
with
39 additions
and
3 deletions
Show diff stats
src/v3270ft/dialog.c
... | ... | @@ -79,6 +79,20 @@ static GtkWidget * create_button(V3270FTDialog *widget, FT_BUTTON id, const gcha |
79 | 79 | } |
80 | 80 | */ |
81 | 81 | |
82 | +static void render_local(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) | |
83 | +{ | |
84 | + GObject * activity; | |
85 | + gtk_tree_model_get(tree_model, iter, 0, &activity, -1); | |
86 | + g_object_set(G_OBJECT(cell),"text",v3270_ft_activity_get_local_filename(activity),NULL); | |
87 | +} | |
88 | + | |
89 | +static void render_remote(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) | |
90 | +{ | |
91 | + GObject * activity; | |
92 | + gtk_tree_model_get(tree_model, iter, 0, &activity, -1); | |
93 | + g_object_set(G_OBJECT(cell),"text",v3270_ft_activity_get_remote_filename(activity),NULL); | |
94 | +} | |
95 | + | |
82 | 96 | static void V3270FTDialog_init(V3270FTDialog *widget) |
83 | 97 | { |
84 | 98 | widget->settings = v3270_ft_settings_new(); |
... | ... | @@ -101,7 +115,7 @@ static void V3270FTDialog_init(V3270FTDialog *widget) |
101 | 115 | |
102 | 116 | // Create file list view |
103 | 117 | { |
104 | - GtkTreeModel * model = GTK_TREE_MODEL(gtk_tree_store_new(1,G_TYPE_STRING)); | |
118 | + GtkTreeModel * model = GTK_TREE_MODEL(gtk_list_store_new(1,G_TYPE_OBJECT)); | |
105 | 119 | GtkWidget * files = gtk_tree_view_new_with_model(model); |
106 | 120 | |
107 | 121 | gtk_widget_set_tooltip_markup(files,_("Files to transfer")); |
... | ... | @@ -109,10 +123,21 @@ static void V3270FTDialog_init(V3270FTDialog *widget) |
109 | 123 | gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(files),TRUE); |
110 | 124 | gtk_tree_view_set_reorderable(GTK_TREE_VIEW(files),TRUE); |
111 | 125 | |
112 | - gtk_tree_view_insert_column_with_attributes( | |
126 | + gtk_tree_view_insert_column_with_data_func( | |
127 | + GTK_TREE_VIEW(files), | |
128 | + -1, | |
129 | + _( "Local file" ), | |
130 | + gtk_cell_renderer_text_new(), | |
131 | + render_local, | |
132 | + 0, NULL | |
133 | + ); | |
134 | + | |
135 | + gtk_tree_view_insert_column_with_data_func( | |
113 | 136 | GTK_TREE_VIEW(files), |
114 | 137 | -1, |
115 | - _( "Local file name" ),gtk_cell_renderer_text_new(),"text", | |
138 | + _( "Remote file" ), | |
139 | + gtk_cell_renderer_text_new(), | |
140 | + render_remote, | |
116 | 141 | 0, NULL |
117 | 142 | ); |
118 | 143 | |
... | ... | @@ -127,6 +152,17 @@ static void V3270FTDialog_init(V3270FTDialog *widget) |
127 | 152 | GtkWidget * frame = v3270_dialog_create_frame(scrolled,_("Transfer queue")); |
128 | 153 | |
129 | 154 | gtk_box_pack_start(GTK_BOX(container),frame,TRUE,TRUE,0); |
155 | + | |
156 | + /* | |
157 | + GObject * activity = v3270_ft_activity_new(); | |
158 | + v3270_ft_activity_set_local_filename(activity,"local---"); | |
159 | + v3270_ft_activity_set_remote_filename(activity,"remote---"); | |
160 | + | |
161 | + GtkTreeIter iter; | |
162 | + gtk_list_store_append((GtkListStore *) model,&iter); | |
163 | + gtk_list_store_set((GtkListStore *) model, &iter, 0, activity, -1); | |
164 | + */ | |
165 | + | |
130 | 166 | } |
131 | 167 | |
132 | 168 | ... | ... |