Commit fd2ff06e37894a5740eb02cd7e408e25aa9663c0
1 parent
519143aa
Exists in
master
and in
4 other branches
Adding "close window" action.
Showing
3 changed files
with
17 additions
and
6 deletions
Show diff stats
src/objects/window/actions/close.c
... | ... | @@ -29,9 +29,10 @@ |
29 | 29 | |
30 | 30 | #include "../private.h" |
31 | 31 | |
32 | - void pw3270_window_close_activated(GSimpleAction G_GNUC_UNUSED(* action), GVariant G_GNUC_UNUSED(*parameter), gpointer application) { | |
32 | + void pw3270_window_close_activated(GSimpleAction G_GNUC_UNUSED(* action), GVariant G_GNUC_UNUSED(*parameter), gpointer window) { | |
33 | 33 | |
34 | - debug("%s",__FUNCTION__); | |
34 | + debug("%s(%p)",__FUNCTION__,window); | |
35 | + gtk_window_close(GTK_WINDOW(window)); | |
35 | 36 | |
36 | 37 | } |
37 | 38 | ... | ... |
src/objects/window/private.h
... | ... | @@ -85,7 +85,7 @@ |
85 | 85 | // Terminal actions. |
86 | 86 | GAction * pw3270_model_number_action_new(GtkWidget *terminal); |
87 | 87 | |
88 | - G_GNUC_INTERNAL void pw3270_window_open_activated(GSimpleAction * action, GVariant *parameter, gpointer application); | |
89 | - G_GNUC_INTERNAL void pw3270_window_close_activated(GSimpleAction * action, GVariant *parameter, gpointer application); | |
88 | + G_GNUC_INTERNAL void pw3270_window_open_activated(GSimpleAction * action, GVariant *parameter, gpointer window); | |
89 | + G_GNUC_INTERNAL void pw3270_window_close_activated(GSimpleAction * action, GVariant *parameter, gpointer window); | |
90 | 90 | |
91 | 91 | #endif // PRIVATE_H_INCLUDED | ... | ... |
ui/window.xml
... | ... | @@ -185,6 +185,11 @@ |
185 | 185 | <attribute name="action">win.disconnect</attribute> |
186 | 186 | </item> |
187 | 187 | |
188 | + <item> | |
189 | + <attribute name="label" translatable="yes">Close window</attribute> | |
190 | + <attribute name="action">win.close</attribute> | |
191 | + </item> | |
192 | + | |
188 | 193 | </menu> |
189 | 194 | |
190 | 195 | <menu id="popup-over-unselected-area"> |
... | ... | @@ -296,6 +301,11 @@ |
296 | 301 | <attribute name="action">win.disconnect</attribute> |
297 | 302 | </item> |
298 | 303 | |
304 | + <item> | |
305 | + <attribute name="label" translatable="yes">Close window</attribute> | |
306 | + <attribute name="action">win.close</attribute> | |
307 | + </item> | |
308 | + | |
299 | 309 | </menu> |
300 | 310 | |
301 | 311 | <menu id="popup-when-offline"> |
... | ... | @@ -332,8 +342,8 @@ |
332 | 342 | </submenu> |
333 | 343 | |
334 | 344 | <item> |
335 | - <attribute name="label" translatable="yes">Quit application</attribute> | |
336 | - <attribute name="action">app.quit</attribute> | |
345 | + <attribute name="label" translatable="yes">Close window</attribute> | |
346 | + <attribute name="action">win.close</attribute> | |
337 | 347 | </item> |
338 | 348 | |
339 | 349 | </menu> | ... | ... |