Commit 821655b8206a8d404350a8583e1cf610958266fc
1 parent
4a5875a1
Exists in
master
and in
4 other branches
Implementing header buttons for the modern API.
Showing
2 changed files
with
21 additions
and
3 deletions
Show diff stats
src/objects/window/header.c
@@ -41,6 +41,22 @@ | @@ -41,6 +41,22 @@ | ||
41 | 41 | ||
42 | } | 42 | } |
43 | 43 | ||
44 | + /* | ||
45 | + static gboolean bg_deactivate_button(GtkWidget *button) { | ||
46 | + debug("******************** %s %p",__FUNCTION__,button) | ||
47 | + return FALSE; | ||
48 | + } | ||
49 | + | ||
50 | + static void on_state_flags_changed(GtkWidget *button, GtkStateFlags flags, gpointer user_data) { | ||
51 | + | ||
52 | + debug("%s(%p,%d)",__FUNCTION__,button,flags & GTK_STATE_FLAG_ACTIVE); | ||
53 | + | ||
54 | + if(flags & GTK_STATE_FLAG_ACTIVE) | ||
55 | + g_idle_add((GSourceFunc) bg_deactivate_button, button); | ||
56 | + | ||
57 | + } | ||
58 | + */ | ||
59 | + | ||
44 | GtkWidget * pw3270_header_button_new_from_builder(GtkWidget *widget, GtkBuilder * builder, const gchar *action_name) { | 60 | GtkWidget * pw3270_header_button_new_from_builder(GtkWidget *widget, GtkBuilder * builder, const gchar *action_name) { |
45 | 61 | ||
46 | GtkWidget * button = NULL; | 62 | GtkWidget * button = NULL; |
@@ -66,8 +82,6 @@ | @@ -66,8 +82,6 @@ | ||
66 | button = pw3270_setup_image_button(gtk_menu_button_new(),icon_name); | 82 | button = pw3270_setup_image_button(gtk_menu_button_new(),icon_name); |
67 | gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name); | 83 | gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name); |
68 | gtk_widget_set_visible(button,g_action_get_enabled(action)); | 84 | gtk_widget_set_visible(button,g_action_get_enabled(action)); |
69 | - | ||
70 | - | ||
71 | } | 85 | } |
72 | 86 | ||
73 | } | 87 | } |
@@ -75,8 +89,10 @@ | @@ -75,8 +89,10 @@ | ||
75 | if(button) { | 89 | if(button) { |
76 | 90 | ||
77 | g_signal_connect(button, "notify::sensitive", G_CALLBACK(on_sensitive), widget); | 91 | g_signal_connect(button, "notify::sensitive", G_CALLBACK(on_sensitive), widget); |
92 | + // g_signal_connect(button,"state-flags-changed",G_CALLBACK(on_state_flags_changed), widget); | ||
78 | gtk_widget_set_focus_on_click(button,FALSE); | 93 | gtk_widget_set_focus_on_click(button,FALSE); |
79 | gtk_widget_set_can_focus(button,FALSE); | 94 | gtk_widget_set_can_focus(button,FALSE); |
95 | + gtk_widget_set_can_default(button,FALSE); | ||
80 | 96 | ||
81 | } | 97 | } |
82 | 98 |
src/objects/window/window.c
@@ -232,7 +232,9 @@ | @@ -232,7 +232,9 @@ | ||
232 | 232 | ||
233 | static const gchar * start_actions[] = { | 233 | static const gchar * start_actions[] = { |
234 | "win.disconnect", | 234 | "win.disconnect", |
235 | - "win.reconnect" | 235 | + "win.reconnect", |
236 | + "win.file.transfer", | ||
237 | + "win.print" | ||
236 | }; | 238 | }; |
237 | 239 | ||
238 | for(ix = 0; ix < G_N_ELEMENTS(start_actions); ix++) { | 240 | for(ix = 0; ix < G_N_ELEMENTS(start_actions); ix++) { |