Commit b4e98e07e30d2c21d7a9c4237658aa73d713727c

Authored by Perry Werneck
1 parent f0fc99bd
Exists in master and in 1 other branch develop

Working on the new FT dialog.

Makefile.in
... ... @@ -252,7 +252,7 @@ $(BINRLS)/$(LIBNAME)@DLLEXT@: \
252 252 @echo $< ...
253 253 @rm -f $@
254 254 @$(LN_S) \
255   - $(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ \
  255 + $^ \
256 256 $@
257 257  
258 258 $(BINRLS)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@: \
... ... @@ -260,7 +260,7 @@ $(BINRLS)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@: \
260 260  
261 261 @rm -f $@
262 262 @$(LN_S) \
263   - $(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ \
  263 + $^ \
264 264 $@
265 265  
266 266 $(BINRLS)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@: \
... ... @@ -437,7 +437,7 @@ $(BINDBG)/$(LIBNAME)@DLLEXT@: \
437 437 @echo $< ...
438 438 @rm -f $@
439 439 @$(LN_S) \
440   - $(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@ \
  440 + $^ \
441 441 $@
442 442  
443 443 $(BINDBG)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@: \
... ... @@ -445,7 +445,7 @@ $(BINDBG)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@: \
445 445  
446 446 @rm -f $@
447 447 @$(LN_S) \
448   - $(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@ \
  448 + $^ \
449 449 $@
450 450  
451 451 $(BINDBG)/$(LIBNAME)@DLLEXT@.@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@: \
... ...
src/include/v3270/filetransfer.h
... ... @@ -93,7 +93,9 @@
93 93 typedef struct _V3270FTSettingsClass V3270FTSettingsClass;
94 94  
95 95 LIB3270_EXPORT GtkWidget * v3270_ft_settings_new();
  96 +
96 97 LIB3270_EXPORT void v3270_ft_settings_set_activity(GtkWidget *widget, GObject *activity);
  98 + LIB3270_EXPORT GObject * v3270_ft_settings_create_activity(GtkWidget *widget);
97 99  
98 100 LIB3270_EXPORT void v3270_ft_settings_reset(GtkWidget *widget);
99 101 LIB3270_EXPORT void v3270_ft_settings_update(GtkWidget *widget);
... ...
src/v3270ft/dialog.c
... ... @@ -122,10 +122,10 @@ static void update_clicked(GtkButton G_GNUC_UNUSED(*button), V3270FTDialog *widg
122 122 //gtk_widget_queue_draw(widget->queue);
123 123 }
124 124  
125   -static void insert_clicked(GtkButton G_GNUC_UNUSED(*button), V3270FTDialog *widget)
  125 +static void insert_clicked(GtkWidget *button, V3270FTDialog *widget)
126 126 {
127 127 GtkTreeIter iter;
128   - GtkTreeModel * model = gtk_tree_view_get_model(widget->queue);
  128 + GtkTreeModel * model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget->queue));
129 129  
130 130 if(gtk_tree_model_get_iter_first(model,&iter))
131 131 {
... ... @@ -136,7 +136,26 @@ static void insert_clicked(GtkButton G_GNUC_UNUSED(*button), V3270FTDialog *widg
136 136  
137 137 if(activity && v3270_ft_settings_equals(widget->settings,activity))
138 138 {
139   - debug("%s: Activity already inserted",__FUNCTION__);
  139 + // Activity already exist
  140 + GtkWidget * dialog =
  141 + gtk_message_dialog_new(
  142 + GTK_WINDOW(gtk_widget_get_toplevel(button)),
  143 + GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
  144 + GTK_MESSAGE_ERROR,
  145 + GTK_BUTTONS_CLOSE,
  146 + _("Activity already on the queue")
  147 + );
  148 +
  149 + gtk_message_dialog_format_secondary_text(
  150 + GTK_MESSAGE_DIALOG(dialog),
  151 + _( "You can't add more than one acitivity with the same files.")
  152 + );
  153 +
  154 + gtk_window_set_title(GTK_WINDOW(dialog),_("Can't add activity"));
  155 +
  156 + gtk_dialog_run(GTK_DIALOG(dialog));
  157 + gtk_widget_destroy(dialog);
  158 +
140 159 return;
141 160 }
142 161  
... ... @@ -145,6 +164,7 @@ static void insert_clicked(GtkButton G_GNUC_UNUSED(*button), V3270FTDialog *widg
145 164 }
146 165  
147 166 // Not found, insert it.
  167 + v3270_activity_list_append(widget->queue,v3270_ft_settings_create_activity(widget->settings));
148 168  
149 169 }
150 170  
... ... @@ -175,13 +195,13 @@ static void V3270FTDialog_init(V3270FTDialog *widget)
175 195 g_object_set(G_OBJECT(widget->button.valid),"margin-top",6,NULL);
176 196  
177 197 widget->button.reset = v3270_box_pack_end(widget->button.valid,gtk_button_new_with_mnemonic("_Reset"),FALSE,FALSE,0);
178   - g_signal_connect(widget->button.reset,"clicked",reset_clicked,widget);
  198 + g_signal_connect(widget->button.reset,"clicked",G_CALLBACK(reset_clicked),widget);
179 199  
180 200 widget->button.update = v3270_box_pack_end(widget->button.valid,gtk_button_new_with_mnemonic("_Update"),FALSE,FALSE,0);
181   - g_signal_connect(widget->button.update,"clicked",update_clicked,widget);
  201 + g_signal_connect(widget->button.update,"clicked",G_CALLBACK(update_clicked),widget);
182 202  
183 203 widget->button.insert = v3270_box_pack_end(widget->button.valid,gtk_button_new_with_mnemonic("_Insert"),FALSE,FALSE,0);
184   - g_signal_connect(widget->button.insert,"clicked",insert_clicked,widget);
  204 + g_signal_connect(widget->button.insert,"clicked",G_CALLBACK(insert_clicked),widget);
185 205  
186 206 gtk_widget_set_sensitive(widget->button.update,FALSE);
187 207 gtk_widget_set_sensitive(widget->button.reset,FALSE);
... ...
src/v3270ft/settings.c
... ... @@ -591,6 +591,14 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP
591 591 }
592 592 }
593 593  
  594 + LIB3270_EXPORT GObject * v3270_ft_settings_create_activity(GtkWidget *widget)
  595 + {
  596 + V3270FTSettings * settings = GTK_V3270_FT_SETTINGS(widget);
  597 + settings->activity = v3270_ft_activity_new();
  598 + v3270_ft_settings_update(widget);
  599 + return settings->activity;
  600 + }
  601 +
594 602 LIB3270_EXPORT void v3270_ft_settings_set_options(GtkWidget *widget, LIB3270_FT_OPTION options)
595 603 {
596 604 int ix;
... ...