Commit eaa4d1b6a4c918e6269fbe0bc1a3276c8e90fb69
1 parent
5ae53d6c
Exists in
master
and in
1 other branch
Adding default title bar on dialogs.
Showing
1 changed file
with
16 additions
and
10 deletions
Show diff stats
src/dialogs/popups.c
@@ -58,7 +58,6 @@ | @@ -58,7 +58,6 @@ | ||
58 | 58 | ||
59 | GtkResponseType response = 0; | 59 | GtkResponseType response = 0; |
60 | 60 | ||
61 | - debug("Emitting %s","V3270_SIGNAL_LOAD_POPUP_RESPONSE"); | ||
62 | v3270_signal_emit( | 61 | v3270_signal_emit( |
63 | widget, | 62 | widget, |
64 | V3270_SIGNAL_LOAD_POPUP_RESPONSE, | 63 | V3270_SIGNAL_LOAD_POPUP_RESPONSE, |
@@ -66,8 +65,6 @@ | @@ -66,8 +65,6 @@ | ||
66 | &response | 65 | &response |
67 | ); | 66 | ); |
68 | 67 | ||
69 | - debug("Got response %d",(int) response); | ||
70 | - | ||
71 | if(response && response != GTK_RESPONSE_NONE) | 68 | if(response && response != GTK_RESPONSE_NONE) |
72 | return response; | 69 | return response; |
73 | 70 | ||
@@ -129,16 +126,25 @@ | @@ -129,16 +126,25 @@ | ||
129 | 126 | ||
130 | #ifdef _WIN32 | 127 | #ifdef _WIN32 |
131 | gtk_container_set_border_width(GTK_CONTAINER(dialog),12); | 128 | gtk_container_set_border_width(GTK_CONTAINER(dialog),12); |
129 | +#endif // _WIN32 | ||
130 | + | ||
132 | if(popup->title) { | 131 | if(popup->title) { |
132 | + | ||
133 | gtk_window_set_title(GTK_WINDOW(dialog),popup->title); | 133 | gtk_window_set_title(GTK_WINDOW(dialog),popup->title); |
134 | - } else { | ||
135 | - gtk_window_set_title(GTK_WINDOW(dialog),G_STRINGIFY(PRODUCT_NAME)); | ||
136 | - } | ||
137 | -#else | ||
138 | - if(popup->title) { | ||
139 | - gtk_window_set_title(GTK_WINDOW(dialog),popup->title); | 134 | + |
135 | + } else if(GTK_IS_V3270(widget)) { | ||
136 | + | ||
137 | + const gchar *url = v3270_get_url(widget); | ||
138 | + g_autofree gchar * title = g_strconcat( | ||
139 | + v3270_get_session_name(widget), | ||
140 | + " - ", | ||
141 | + url ? url : _("No host"), | ||
142 | + NULL | ||
143 | + ); | ||
144 | + | ||
145 | + gtk_window_set_title(GTK_WINDOW(dialog),title); | ||
146 | + | ||
140 | } | 147 | } |
141 | -#endif // _WIN32 | ||
142 | 148 | ||
143 | if(wait) { | 149 | if(wait) { |
144 | 150 |