Commit 62a7c4accd0500e7c7075bcb96157ea35b5bc863

Authored by perry.werneck@gmail.com
1 parent 10c4fc1b
Exists in master and in 1 other branch develop

Convertendo toggles em propriedades gtk

Showing 1 changed file with 7 additions and 18 deletions   Show diff stats
@@ -75,10 +75,6 @@ @@ -75,10 +75,6 @@
75 /* Construct */ 75 /* Construct */
76 PROP_TYPE, 76 PROP_TYPE,
77 77
78 - /* Normal Props */  
79 - PROP_FULLSCREEN,  
80 -  
81 -  
82 /* Toggle - always the last one, the real values are PROP_TOGGLE+LIB3270_TOGGLE */ 78 /* Toggle - always the last one, the real values are PROP_TOGGLE+LIB3270_TOGGLE */
83 PROP_TOGGLE 79 PROP_TOGGLE
84 }; 80 };
@@ -321,12 +317,6 @@ static void v3270_set_property(GObject *object, guint prop_id, const GValue *val @@ -321,12 +317,6 @@ static void v3270_set_property(GObject *object, guint prop_id, const GValue *val
321 317
322 switch (prop_id) 318 switch (prop_id)
323 { 319 {
324 - case PROP_FULLSCREEN:  
325 - if(g_value_get_boolean (value))  
326 - gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(object))));  
327 - else  
328 - gtk_window_unfullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(object))));  
329 - break;  
330 320
331 default: 321 default:
332 if(prop_id < (PROP_TOGGLE + LIB3270_TOGGLE_COUNT)) 322 if(prop_id < (PROP_TOGGLE + LIB3270_TOGGLE_COUNT))
@@ -345,10 +335,6 @@ static void v3270_get_property(GObject *object,guint prop_id, GValue *value, GPa @@ -345,10 +335,6 @@ static void v3270_get_property(GObject *object,guint prop_id, GValue *value, GPa
345 335
346 switch (prop_id) 336 switch (prop_id)
347 { 337 {
348 - case PROP_FULLSCREEN:  
349 - #warning Get the correct value  
350 - g_value_set_boolean(value,FALSE);  
351 - break;  
352 338
353 default: 339 default:
354 if(prop_id < (PROP_TOGGLE + LIB3270_TOGGLE_COUNT)) 340 if(prop_id < (PROP_TOGGLE + LIB3270_TOGGLE_COUNT))
@@ -630,10 +616,6 @@ static void v3270_class_init(v3270Class *klass) @@ -630,10 +616,6 @@ static void v3270_class_init(v3270Class *klass)
630 gobject_class->set_property = v3270_set_property; 616 gobject_class->set_property = v3270_set_property;
631 gobject_class->get_property = v3270_get_property; 617 gobject_class->get_property = v3270_get_property;
632 618
633 - v3270_properties[PROP_FULLSCREEN] = g_param_spec_boolean("fullscreen","Fullscreen","If TRUE, the toplevel window was set to fullscreen",FALSE,G_PARAM_WRITABLE|G_PARAM_READABLE);  
634 - g_object_class_install_property(gobject_class,PROP_FULLSCREEN,v3270_properties[PROP_FULLSCREEN]);  
635 -  
636 -  
637 // Toggle properties 619 // Toggle properties
638 int f; 620 int f;
639 621
@@ -760,6 +742,13 @@ static void set_timer(H3270 *session, unsigned char on) @@ -760,6 +742,13 @@ static void set_timer(H3270 *session, unsigned char on)
760 742
761 static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value, LIB3270_TOGGLE_TYPE reason, const char *name) 743 static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value, LIB3270_TOGGLE_TYPE reason, const char *name)
762 { 744 {
  745 + if(ix == LIB3270_TOGGLE_FULL_SCREEN)
  746 + {
  747 + if(value)
  748 + gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->widget))));
  749 + else
  750 + gtk_window_unfullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->widget))));
  751 + }
763 g_object_notify_by_pspec(G_OBJECT(session->widget), v3270_properties[PROP_TOGGLE+ix]); 752 g_object_notify_by_pspec(G_OBJECT(session->widget), v3270_properties[PROP_TOGGLE+ix]);
764 g_signal_emit(GTK_WIDGET(session->widget), v3270_widget_signal[SIGNAL_TOGGLE_CHANGED], 0, (guint) ix, (gboolean) (value != 0), (gchar *) name); 753 g_signal_emit(GTK_WIDGET(session->widget), v3270_widget_signal[SIGNAL_TOGGLE_CHANGED], 0, (guint) ix, (gboolean) (value != 0), (gchar *) name);
765 } 754 }