Commit 68f3236dcf5af03322c5569ec29366ca8a15630f
1 parent
21efd2da
Exists in
master
and in
1 other branch
Working on the new ft dialog.
Showing
2 changed files
with
21 additions
and
1 deletions
Show diff stats
src/v3270ft/activitylist.c
... | ... | @@ -200,6 +200,8 @@ |
200 | 200 | list->filename = filename; |
201 | 201 | } |
202 | 202 | |
203 | + g_signal_emit(widget, v3270_activity_list_signals[V3270_ACTIVITY_LIST_HAS_FILE_SIGNAL], 0, (list->filename == NULL ? FALSE : TRUE)); | |
204 | + | |
203 | 205 | } |
204 | 206 | |
205 | 207 | void v3270_activity_list_save(GtkWidget *widget) |
... | ... | @@ -209,6 +211,8 @@ |
209 | 211 | GError * error = NULL; |
210 | 212 | size_t ix; |
211 | 213 | |
214 | + debug("%s",__FUNCTION__); | |
215 | + | |
212 | 216 | // Serialize activities. |
213 | 217 | GtkTreeIter iter; |
214 | 218 | GtkTreeModel * model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget)); |
... | ... | @@ -234,6 +238,10 @@ |
234 | 238 | g_string_append_printf(str,"\t\t<option name=\'%s\' value=\'%s\' />\n",option_list[ix].name,option_list[ix].value); |
235 | 239 | } |
236 | 240 | |
241 | + for(ix=0;ix<LIB3270_FT_VALUE_COUNT;ix++) { | |
242 | + g_string_append_printf(str,"\t\t<parameter name=\"%s\" value=\"%u\"/>\n",ft_value[ix].name,v3270_ft_activity_get_value(activity,(LIB3270_FT_VALUE) ix)); | |
243 | + } | |
244 | + | |
237 | 245 | g_string_append(str,"\t</entry>\n"); |
238 | 246 | } |
239 | 247 | |
... | ... | @@ -247,6 +255,8 @@ |
247 | 255 | // Save activity list |
248 | 256 | g_autofree gchar * text = g_string_free(str,FALSE); |
249 | 257 | |
258 | + debug("Saving %s",list->filename); | |
259 | + | |
250 | 260 | if(!g_file_set_contents(list->filename,text,-1,&error)) { |
251 | 261 | |
252 | 262 | GtkWidget *popup = gtk_message_dialog_new_with_markup( |
... | ... | @@ -287,5 +297,8 @@ |
287 | 297 | list->filename = filename; |
288 | 298 | v3270_activity_list_save(widget); |
289 | 299 | } |
300 | + | |
301 | + g_signal_emit(widget, v3270_activity_list_signals[V3270_ACTIVITY_LIST_HAS_FILE_SIGNAL], 0, (list->filename == NULL ? FALSE : TRUE)); | |
302 | + | |
290 | 303 | } |
291 | 304 | ... | ... |
src/v3270ft/dialog.c
... | ... | @@ -110,6 +110,7 @@ static void load_queue_clicked(GtkButton G_GNUC_UNUSED(*button), V3270FTDialog * |
110 | 110 | |
111 | 111 | static void save_queue_clicked(GtkButton G_GNUC_UNUSED(*button), V3270FTDialog *widget) |
112 | 112 | { |
113 | + debug("%s",__FUNCTION__); | |
113 | 114 | v3270_activity_list_save(widget->queue.view); |
114 | 115 | } |
115 | 116 | |
... | ... | @@ -164,6 +165,11 @@ static void insert_clicked(GtkWidget *button, V3270FTDialog *widget) |
164 | 165 | |
165 | 166 | } |
166 | 167 | |
168 | +static void enable_queue_save(GtkWidget G_GNUC_UNUSED(*save), gboolean enabled, GtkWidget *button) | |
169 | +{ | |
170 | + gtk_widget_set_sensitive(button,enabled); | |
171 | +} | |
172 | + | |
167 | 173 | static void V3270FTDialog_init(V3270FTDialog *widget) |
168 | 174 | { |
169 | 175 | widget->settings = v3270_ft_settings_new(); |
... | ... | @@ -249,8 +255,9 @@ static void V3270FTDialog_init(V3270FTDialog *widget) |
249 | 255 | |
250 | 256 | widget->queue.save = gtk_button_new_from_icon_name("document-save",GTK_ICON_SIZE_SMALL_TOOLBAR); |
251 | 257 | gtk_widget_set_tooltip_markup(widget->queue.save,_("Save transfer queue")); |
252 | - g_signal_connect(widget->queue.load,"clicked",G_CALLBACK(save_queue_clicked),widget); | |
258 | + g_signal_connect(widget->queue.save,"clicked",G_CALLBACK(save_queue_clicked),widget); | |
253 | 259 | gtk_widget_set_sensitive(widget->queue.save,FALSE); |
260 | + g_signal_connect(widget->queue.view,"has-file",G_CALLBACK(enable_queue_save),widget->queue.save); | |
254 | 261 | |
255 | 262 | widget->queue.saveAs = gtk_button_new_from_icon_name("document-save-as",GTK_ICON_SIZE_SMALL_TOOLBAR); |
256 | 263 | gtk_widget_set_tooltip_markup(widget->queue.saveAs,_("Save transfer queue to file")); | ... | ... |