Commit 910bc374330b41336b821ff1c8ddef6496f1585d
1 parent
60c9f2d5
Exists in
master
and in
1 other branch
Refactoring popup engine.
Showing
5 changed files
with
17 additions
and
13 deletions
Show diff stats
src/dialogs/popups.c
@@ -43,17 +43,16 @@ | @@ -43,17 +43,16 @@ | ||
43 | // Check if the dialog is enabled | 43 | // Check if the dialog is enabled |
44 | if(popup->name && GTK_IS_V3270(widget)) { | 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 | v3270_signal_emit( | 48 | v3270_signal_emit( |
49 | widget, | 49 | widget, |
50 | V3270_SIGNAL_LOAD_POPUP_RESPONSE, | 50 | V3270_SIGNAL_LOAD_POPUP_RESPONSE, |
51 | popup->name, | 51 | popup->name, |
52 | - response, | ||
53 | &response | 52 | &response |
54 | ); | 53 | ); |
55 | 54 | ||
56 | - if(response != GTK_RESPONSE_NONE) | 55 | + if((response != GTK_RESPONSE_NONE) && (response != GTK_RESPONSE_DELETE_EVENT)) |
57 | return response; | 56 | return response; |
58 | 57 | ||
59 | } | 58 | } |
@@ -104,7 +103,8 @@ | @@ -104,7 +103,8 @@ | ||
104 | GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, | 103 | GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, |
105 | settings[popup->type].type, | 104 | settings[popup->type].type, |
106 | GTK_BUTTONS_NONE, | 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 | if(popup->body) { | 110 | if(popup->body) { |
@@ -239,14 +239,15 @@ | @@ -239,14 +239,15 @@ | ||
239 | GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, | 239 | GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, |
240 | GTK_MESSAGE_INFO, | 240 | GTK_MESSAGE_INFO, |
241 | GTK_BUTTONS_NONE, | 241 | GTK_BUTTONS_NONE, |
242 | - "%s", | ||
243 | - summary | 242 | + (body ? "<b><big>%s</big></b>" : "%s"), |
243 | + summary | ||
244 | ); | 244 | ); |
245 | 245 | ||
246 | if(body) | 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 | // Set check button | 252 | // Set check button |
252 | GtkWidget * dont_ask = gtk_check_button_new_with_label(_("Don't ask again")); | 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,6 +108,8 @@ static void formatted_received(GtkClipboard *clipboard, GtkSelectionData *select | ||
108 | if(!v3270_set_from_data_block(terminal, selection)) | 108 | if(!v3270_set_from_data_block(terminal, selection)) |
109 | { | 109 | { |
110 | debug("%s: Can't paste data",__FUNCTION__); | 110 | debug("%s: Can't paste data",__FUNCTION__); |
111 | + | ||
112 | + | ||
111 | if( | 113 | if( |
112 | v3270_popup_toggleable_dialog( | 114 | v3270_popup_toggleable_dialog( |
113 | widget, | 115 | widget, |
src/terminal/marshal
@@ -6,7 +6,7 @@ VOID:POINTER | @@ -6,7 +6,7 @@ VOID:POINTER | ||
6 | VOID:VOID,POINTER,POINTER | 6 | VOID:VOID,POINTER,POINTER |
7 | VOID:VOID,UINT,POINTER | 7 | VOID:VOID,UINT,POINTER |
8 | BOOLEAN:UINT,ENUM | 8 | BOOLEAN:UINT,ENUM |
9 | -UINT:POINTER,UINT | 9 | +UINT:POINTER |
10 | BOOLEAN:POINTER,UINT | 10 | BOOLEAN:POINTER,UINT |
11 | VOID:VOID,BOOLEAN | 11 | VOID:VOID,BOOLEAN |
12 | BOOLEAN:VOID,BOOLEAN,BOOLEAN,POINTER | 12 | BOOLEAN:VOID,BOOLEAN,BOOLEAN,POINTER |
src/terminal/widget.c
@@ -201,8 +201,8 @@ static void finalize(GObject *object) { | @@ -201,8 +201,8 @@ static void finalize(GObject *object) { | ||
201 | G_OBJECT_CLASS(v3270_parent_class)->finalize(object); | 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 | static gboolean save_popup_response(v3270 G_GNUC_UNUSED(*widget), const gchar G_GNUC_UNUSED(*popup_name), GtkResponseType G_GNUC_UNUSED(response)) { | 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,8 +481,8 @@ static void v3270_class_init(v3270Class *klass) | ||
481 | G_SIGNAL_RUN_LAST, | 481 | G_SIGNAL_RUN_LAST, |
482 | G_STRUCT_OFFSET (v3270Class, load_popup_response), | 482 | G_STRUCT_OFFSET (v3270Class, load_popup_response), |
483 | NULL, NULL, | 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 | v3270_widget_signal[V3270_SIGNAL_SAVE_POPUP_RESPONSE] = | 487 | v3270_widget_signal[V3270_SIGNAL_SAVE_POPUP_RESPONSE] = |
488 | g_signal_new( I_("save-popup-response"), | 488 | g_signal_new( I_("save-popup-response"), |
v3270.cbp
@@ -361,6 +361,7 @@ | @@ -361,6 +361,7 @@ | ||
361 | <Unit filename="src/terminal/linux/iosource.c"> | 361 | <Unit filename="src/terminal/linux/iosource.c"> |
362 | <Option compilerVar="CC" /> | 362 | <Option compilerVar="CC" /> |
363 | </Unit> | 363 | </Unit> |
364 | + <Unit filename="src/terminal/marshal" /> | ||
364 | <Unit filename="src/terminal/marshal.h" /> | 365 | <Unit filename="src/terminal/marshal.h" /> |
365 | <Unit filename="src/terminal/mouse.c"> | 366 | <Unit filename="src/terminal/mouse.c"> |
366 | <Option compilerVar="CC" /> | 367 | <Option compilerVar="CC" /> |