Commit 821655b8206a8d404350a8583e1cf610958266fc

Authored by Perry Werneck
1 parent 4a5875a1

Implementing header buttons for the modern API.

src/objects/window/header.c
... ... @@ -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 60 GtkWidget * pw3270_header_button_new_from_builder(GtkWidget *widget, GtkBuilder * builder, const gchar *action_name) {
45 61  
46 62 GtkWidget * button = NULL;
... ... @@ -66,8 +82,6 @@
66 82 button = pw3270_setup_image_button(gtk_menu_button_new(),icon_name);
67 83 gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name);
68 84 gtk_widget_set_visible(button,g_action_get_enabled(action));
69   -
70   -
71 85 }
72 86  
73 87 }
... ... @@ -75,8 +89,10 @@
75 89 if(button) {
76 90  
77 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 93 gtk_widget_set_focus_on_click(button,FALSE);
79 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 232  
233 233 static const gchar * start_actions[] = {
234 234 "win.disconnect",
235   - "win.reconnect"
  235 + "win.reconnect",
  236 + "win.file.transfer",
  237 + "win.print"
236 238 };
237 239  
238 240 for(ix = 0; ix < G_N_ELEMENTS(start_actions); ix++) {
... ...