Commit 910bc374330b41336b821ff1c8ddef6496f1585d

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

Refactoring popup engine.

src/dialogs/popups.c
... ... @@ -43,17 +43,16 @@
43 43 // Check if the dialog is enabled
44 44 if(popup->name && GTK_IS_V3270(widget)) {
45 45  
46   - GtkResponseType response = GTK_RESPONSE_NONE;
  46 + GtkResponseType response = GTK_RESPONSE_DELETE_EVENT;
47 47  
48 48 v3270_signal_emit(
49 49 widget,
50 50 V3270_SIGNAL_LOAD_POPUP_RESPONSE,
51 51 popup->name,
52   - response,
53 52 &response
54 53 );
55 54  
56   - if(response != GTK_RESPONSE_NONE)
  55 + if((response != GTK_RESPONSE_NONE) && (response != GTK_RESPONSE_DELETE_EVENT))
57 56 return response;
58 57  
59 58 }
... ... @@ -104,7 +103,8 @@
104 103 GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
105 104 settings[popup->type].type,
106 105 GTK_BUTTONS_NONE,
107   - "<b><big>%s</big></b>",popup->summary
  106 + (popup->body ? "<b><big>%s</big></b>" : "%s"),
  107 + popup->summary
108 108 );
109 109  
110 110 if(popup->body) {
... ... @@ -239,14 +239,15 @@
239 239 GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
240 240 GTK_MESSAGE_INFO,
241 241 GTK_BUTTONS_NONE,
242   - "%s",
243   - summary
  242 + (body ? "<b><big>%s</big></b>" : "%s"),
  243 + summary
244 244 );
245 245  
246 246 if(body)
247   - gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(dialog),"%s",body);
  247 + gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(dialog),"<small>%s</small>",body);
248 248  
249   - gtk_window_set_title(GTK_WINDOW(dialog),title);
  249 + if(title)
  250 + gtk_window_set_title(GTK_WINDOW(dialog),title);
250 251  
251 252 // Set check button
252 253 GtkWidget * dont_ask = gtk_check_button_new_with_label(_("Don't ask again"));
... ...
src/selection/linux/paste.c
... ... @@ -108,6 +108,8 @@ static void formatted_received(GtkClipboard *clipboard, GtkSelectionData *select
108 108 if(!v3270_set_from_data_block(terminal, selection))
109 109 {
110 110 debug("%s: Can't paste data",__FUNCTION__);
  111 +
  112 +
111 113 if(
112 114 v3270_popup_toggleable_dialog(
113 115 widget,
... ...
src/terminal/marshal
... ... @@ -6,7 +6,7 @@ VOID:POINTER
6 6 VOID:VOID,POINTER,POINTER
7 7 VOID:VOID,UINT,POINTER
8 8 BOOLEAN:UINT,ENUM
9   -UINT:POINTER,UINT
  9 +UINT:POINTER
10 10 BOOLEAN:POINTER,UINT
11 11 VOID:VOID,BOOLEAN
12 12 BOOLEAN:VOID,BOOLEAN,BOOLEAN,POINTER
... ...
src/terminal/widget.c
... ... @@ -201,8 +201,8 @@ static void finalize(GObject *object) {
201 201 G_OBJECT_CLASS(v3270_parent_class)->finalize(object);
202 202 }
203 203  
204   - static GtkResponseType load_popup_response(v3270 G_GNUC_UNUSED(*widget), const gchar G_GNUC_UNUSED(*popup_name), GtkResponseType response) {
205   - return response;
  204 + static GtkResponseType load_popup_response(v3270 G_GNUC_UNUSED(*widget), const gchar G_GNUC_UNUSED(*popup_name)) {
  205 + return GTK_RESPONSE_DELETE_EVENT;
206 206 }
207 207  
208 208 static gboolean save_popup_response(v3270 G_GNUC_UNUSED(*widget), const gchar G_GNUC_UNUSED(*popup_name), GtkResponseType G_GNUC_UNUSED(response)) {
... ... @@ -481,8 +481,8 @@ static void v3270_class_init(v3270Class *klass)
481 481 G_SIGNAL_RUN_LAST,
482 482 G_STRUCT_OFFSET (v3270Class, load_popup_response),
483 483 NULL, NULL,
484   - v3270_UINT__POINTER_UINT,
485   - G_TYPE_UINT, 2, G_TYPE_POINTER, G_TYPE_UINT);
  484 + v3270_UINT__POINTER,
  485 + G_TYPE_UINT, 1, G_TYPE_POINTER);
486 486  
487 487 v3270_widget_signal[V3270_SIGNAL_SAVE_POPUP_RESPONSE] =
488 488 g_signal_new( I_("save-popup-response"),
... ...
v3270.cbp
... ... @@ -361,6 +361,7 @@
361 361 <Unit filename="src/terminal/linux/iosource.c">
362 362 <Option compilerVar="CC" />
363 363 </Unit>
  364 + <Unit filename="src/terminal/marshal" />
364 365 <Unit filename="src/terminal/marshal.h" />
365 366 <Unit filename="src/terminal/mouse.c">
366 367 <Option compilerVar="CC" />
... ...