diff --git a/src/dialogs/popups.c b/src/dialogs/popups.c index f56d417..bc64ff1 100644 --- a/src/dialogs/popups.c +++ b/src/dialogs/popups.c @@ -61,7 +61,6 @@ static const struct _settings { GtkMessageType type; const gchar *button; - const gchar *title; } settings[LIB3270_NOTIFY_USER] = { // LIB3270_NOTIFY_INFO - Simple information dialog. @@ -163,7 +162,7 @@ gtk_widget_show_all(dialog); GtkResponseType rc = gtk_dialog_run(GTK_DIALOG(dialog)); - if(dont_ask && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dont_ask))) { + if(dont_ask && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dont_ask)) && rc != GTK_RESPONSE_DELETE_EVENT && rc != GTK_RESPONSE_NONE) { gboolean saved = FALSE; @@ -228,6 +227,7 @@ } + /* GtkResponseType v3270_popup_toggleable_dialog(GtkWidget *widget, V3270_TOGGLEABLE_DIALOG id, const gchar *title, const gchar *summary, const gchar *body, const gchar *first_button_text, ...) { GtkResponseType response = GTK_V3270(widget)->responses[id]; @@ -315,3 +315,4 @@ return response; } +*/ diff --git a/src/include/internals.h b/src/include/internals.h index 9f63633..af29612 100644 --- a/src/include/internals.h +++ b/src/include/internals.h @@ -185,6 +185,7 @@ unsigned short keycode; } V3270PFKeyAccelerator; + /* typedef enum v3270_toggleable_dialog { V3270_TOGGLEABLE_DIALOG_PASTE_FAILED, @@ -193,6 +194,7 @@ } V3270_TOGGLEABLE_DIALOG; G_GNUC_INTERNAL GtkResponseType v3270_popup_toggleable_dialog(GtkWidget *widget, V3270_TOGGLEABLE_DIALOG id, const gchar *title, const gchar *summary, const gchar *body, const gchar *first_button_text, ...) G_GNUC_NULL_TERMINATED; + */ #if GTK_CHECK_VERSION(3,12,0) G_GNUC_INTERNAL GtkHeaderBar * v3270_dialog_get_header_bar(GtkWidget * widget); diff --git a/src/include/terminal.h b/src/include/terminal.h index 9249b1a..ba27cbc 100644 --- a/src/include/terminal.h +++ b/src/include/terminal.h @@ -87,13 +87,13 @@ G_BEGIN_DECLS guint integer; guint uint; guint str; - guint responses; +// guint responses; } type; } properties; // Predefined responses. - GParamSpec * responses[V3270_TOGGLEABLE_DIALOG_CUSTOM]; +// GParamSpec * responses[V3270_TOGGLEABLE_DIALOG_CUSTOM]; // Cursors GdkCursor * cursors[LIB3270_POINTER_COUNT]; @@ -163,7 +163,7 @@ G_BEGIN_DECLS int copying : 1; /// @brief Copy with center mouse button /// @brief Action properties. - GtkResponseType responses[V3270_TOGGLEABLE_DIALOG_CUSTOM]; +// GtkResponseType responses[V3270_TOGGLEABLE_DIALOG_CUSTOM]; GSource * timer; GtkIMContext * input_method; diff --git a/src/selection/linux/paste.c b/src/selection/linux/paste.c index 6abf292..f28bf27 100644 --- a/src/selection/linux/paste.c +++ b/src/selection/linux/paste.c @@ -30,6 +30,7 @@ #include #include #include + #include /*--[ Implement ]------------------------------------------------------------------------------------*/ @@ -109,18 +110,15 @@ static void formatted_received(GtkClipboard *clipboard, GtkSelectionData *select { debug("%s: Can't paste data",__FUNCTION__); + LIB3270_POPUP popup = { + .name = "cantpaste", + .title = _("Can't paste"), + .summary = _("Unable to paste formatted data."), + .body = _("None of the screens in the clipboard match with the current one."), + .label = _("_Paste as text") + }; - if( - v3270_popup_toggleable_dialog( - widget, - V3270_TOGGLEABLE_DIALOG_PASTE_FAILED, - _("Can't paste"), - _("Unable to paste formatted data."), - _("None of the screens in the clipboard match with the current one."), - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Paste as text"), GTK_RESPONSE_APPLY, - NULL - ) == GTK_RESPONSE_APPLY) + if(v3270_show_popup(widget,&popup,1) == GTK_RESPONSE_APPLY) { gtk_clipboard_request_text( clipboard, @@ -129,51 +127,8 @@ static void formatted_received(GtkClipboard *clipboard, GtkSelectionData *select ); } - /* - GtkResponseType response = GTK_V3270(terminal)->responses[V3270_TOGGLEABLE_DIALOG_PASTE_FAILED]; - - if(response == GTK_RESPONSE_NONE) - { - // No predefined response, ask. - GtkWidget * dialog = - gtk_message_dialog_new( - GTK_WINDOW(gtk_widget_get_toplevel(widget)), - GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_NONE, - _("Unable to paste formatted data") - ); - - - gtk_window_set_title(GTK_WINDOW(dialog),_("Can't paste")); - - gtk_dialog_add_buttons( - GTK_DIALOG (dialog), - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Paste as text"), GTK_RESPONSE_APPLY, - NULL - ); - - gtk_dialog_set_default_response(GTK_DIALOG (dialog),response); - - gint response = gtk_dialog_run(GTK_DIALOG(dialog)); - - gtk_widget_destroy(dialog); - } - - if(response == GTK_RESPONSE_APPLY) - { - gtk_clipboard_request_text( - clipboard, - (GtkClipboardTextReceivedFunc) text_received, - (gpointer) widget - ); - } - - */ return; - } } diff --git a/src/terminal/actions/toggle.c b/src/terminal/actions/toggle.c index d8c5631..111f4de 100644 --- a/src/terminal/actions/toggle.c +++ b/src/terminal/actions/toggle.c @@ -112,7 +112,7 @@ return G_VARIANT_TYPE_BOOLEAN; } - static gboolean get_enabled(GAction *action, GtkWidget *terminal) { + static gboolean get_enabled(GAction G_GNUC_UNUSED(*action), GtkWidget G_GNUC_UNUSED(*terminal)) { return TRUE; } @@ -126,7 +126,7 @@ } - void Lib3270ToggleAction_init(Lib3270ToggleAction *action) { + void Lib3270ToggleAction_init(Lib3270ToggleAction G_GNUC_UNUSED(*action)) { } GAction * g_action_new_from_toggle(const LIB3270_TOGGLE * definition) { diff --git a/src/terminal/keyfile.c b/src/terminal/keyfile.c index 899de44..ed17bb3 100644 --- a/src/terminal/keyfile.c +++ b/src/terminal/keyfile.c @@ -309,8 +309,10 @@ save_by_pspec(widget,klass->properties.toggle[ix],key_file,group_name); // Save V3270 Responses + /* for(ix = 0; ix < G_N_ELEMENTS(terminal->responses); ix++) save_by_pspec(widget,klass->responses[ix],key_file,group_name); + */ // Save V3270 properties for(ix = 0; ix < V3270_SETTING_COUNT; ix++) @@ -360,9 +362,11 @@ for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) load_by_pspec(widget,klass->properties.toggle[ix],key_file,group_name); + /* // Load V3270 Responses for(ix = 0; ix < G_N_ELEMENTS(terminal->responses); ix++) load_by_pspec(widget,klass->responses[ix],key_file,group_name); + */ // Load V3270 properties for(ix = 0; ix < V3270_SETTING_COUNT; ix++) diff --git a/src/terminal/properties/get.c b/src/terminal/properties/get.c index 8e346f3..13e0a4c 100644 --- a/src/terminal/properties/get.c +++ b/src/terminal/properties/get.c @@ -39,11 +39,13 @@ // debug("%s(%u,%s)",__FUNCTION__,prop_id,g_param_spec_get_name(pspec)); + /* if(prop_id >= klass->properties.type.responses) { g_value_set_int(value,(int) window->responses[prop_id - klass->properties.type.responses]); } - else if(prop_id >= klass->properties.type.str) + else */ + if(prop_id >= klass->properties.type.str) { const LIB3270_STRING_PROPERTY * prop = (lib3270_get_string_properties_list()+(prop_id - klass->properties.type.str)); // debug("%s.%s.%s",__FUNCTION__,"string",prop->name); diff --git a/src/terminal/properties/init.c b/src/terminal/properties/init.c index 7327759..34996ed 100644 --- a/src/terminal/properties/init.c +++ b/src/terminal/properties/init.c @@ -398,6 +398,7 @@ // // Create action properties. // + /* klass->properties.type.responses = klass->properties.count; static const struct @@ -435,7 +436,7 @@ } } - + */ } diff --git a/src/terminal/widget.c b/src/terminal/widget.c index 5358aa2..50f451c 100644 --- a/src/terminal/widget.c +++ b/src/terminal/widget.c @@ -553,8 +553,10 @@ static void v3270_init(v3270 *widget) v3270_font_info_init(&widget->font); v3270_set_color_table(widget->color,v3270_get_default_colors()); + /* for(ix = 0; ix < G_N_ELEMENTS(widget->responses); ix++) widget->responses[ix] = GTK_RESPONSE_NONE; + */ // Init accelerators v3270_init_accelerators(widget); -- libgit2 0.21.2