Commit 957b5cd8004c20865b0df3a76cfb6c471fc47971
1 parent
22bbe2c0
Exists in
master
and in
1 other branch
Adding notifications on param change.
Showing
5 changed files
with
23 additions
and
9 deletions
Show diff stats
src/include/terminal.h
src/include/v3270.h
| ... | ... | @@ -238,8 +238,10 @@ |
| 238 | 238 | LIB3270_EXPORT const gchar * v3270_get_default_font_name(); |
| 239 | 239 | |
| 240 | 240 | LIB3270_EXPORT void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type, const gchar *title, const gchar *message, const gchar *text); |
| 241 | + | |
| 241 | 242 | LIB3270_EXPORT const gchar * v3270_get_session_name(GtkWidget *widget); |
| 242 | 243 | LIB3270_EXPORT void v3270_set_session_name(GtkWidget *widget, const gchar *name); |
| 244 | + | |
| 243 | 245 | LIB3270_EXPORT int v3270_set_script(GtkWidget *widget, const gchar id); |
| 244 | 246 | LIB3270_EXPORT void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on); |
| 245 | 247 | LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); | ... | ... |
src/terminal/charset.c
| ... | ... | @@ -302,11 +302,9 @@ |
| 302 | 302 | |
| 303 | 303 | if(text && !error) |
| 304 | 304 | { |
| 305 | - | |
| 306 | 305 | GMarkupParseContext * context = g_markup_parse_context_new(&parser,G_MARKUP_TREAT_CDATA_AS_TEXT|G_MARKUP_PREFIX_ERROR_POSITION,&cfg,NULL); |
| 307 | 306 | g_markup_parse_context_parse(context,text,strlen(text),&error); |
| 308 | 307 | g_markup_parse_context_free(context); |
| 309 | - | |
| 310 | 308 | } |
| 311 | 309 | |
| 312 | 310 | debug("error=%p",error); |
| ... | ... | @@ -338,5 +336,7 @@ |
| 338 | 336 | g_free(cfg.host); |
| 339 | 337 | g_free(cfg.display); |
| 340 | 338 | |
| 339 | + g_object_notify_by_pspec(G_OBJECT(widget), GTK_V3270_GET_CLASS(widget)->properties.remap_file); | |
| 340 | + | |
| 341 | 341 | } |
| 342 | 342 | ... | ... |
src/terminal/properties/init.c
| ... | ... | @@ -93,7 +93,7 @@ |
| 93 | 93 | ); |
| 94 | 94 | |
| 95 | 95 | // Session name. |
| 96 | - spec = g_param_spec_string( | |
| 96 | + klass->properties.session_name = g_param_spec_string( | |
| 97 | 97 | "session_name", |
| 98 | 98 | "session_name", |
| 99 | 99 | _("TN3270 Session name"), |
| ... | ... | @@ -104,11 +104,11 @@ |
| 104 | 104 | g_object_class_install_property( |
| 105 | 105 | gobject_class, |
| 106 | 106 | V3270_PROPERTY_SESSION_NAME, |
| 107 | - spec | |
| 107 | + klass->properties.session_name | |
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | 110 | // Auto disconnect |
| 111 | - spec = g_param_spec_string( | |
| 111 | + klass->properties.auto_disconnect = g_param_spec_string( | |
| 112 | 112 | "auto_disconnect", |
| 113 | 113 | "auto_disconnect", |
| 114 | 114 | _("IDLE minutes for automatic disconnection"), |
| ... | ... | @@ -119,7 +119,7 @@ |
| 119 | 119 | g_object_class_install_property( |
| 120 | 120 | gobject_class, |
| 121 | 121 | V3270_PROPERTY_AUTO_DISCONNECT, |
| 122 | - spec | |
| 122 | + klass->properties.auto_disconnect | |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | 125 | // Clipboard |
| ... | ... | @@ -138,7 +138,7 @@ |
| 138 | 138 | ); |
| 139 | 139 | |
| 140 | 140 | // Remap file |
| 141 | - spec = g_param_spec_string( | |
| 141 | + klass->properties.remap_file = g_param_spec_string( | |
| 142 | 142 | "remap", |
| 143 | 143 | "remap", |
| 144 | 144 | _("XML file with remap table"), |
| ... | ... | @@ -149,7 +149,7 @@ |
| 149 | 149 | g_object_class_install_property( |
| 150 | 150 | gobject_class, |
| 151 | 151 | V3270_PROPERTY_REMAP_FILE, |
| 152 | - spec | |
| 152 | + klass->properties.remap_file | |
| 153 | 153 | ); |
| 154 | 154 | |
| 155 | 155 | // | ... | ... |
src/terminal/properties/set.c
| ... | ... | @@ -171,6 +171,7 @@ LIB3270_EXPORT void v3270_set_session_name(GtkWidget *widget, const gchar *name) |
| 171 | 171 | debug("New session name is \"%s\"",GTK_V3270(widget)->session_name); |
| 172 | 172 | |
| 173 | 173 | g_signal_emit(GTK_WIDGET(widget), v3270_widget_signal[V3270_SIGNAL_SESSION_CHANGED], 0); |
| 174 | + g_object_notify_by_pspec(G_OBJECT(widget), GTK_V3270_GET_CLASS(widget)->properties.session_name); | |
| 174 | 175 | |
| 175 | 176 | } |
| 176 | 177 | |
| ... | ... | @@ -203,6 +204,14 @@ void v3270_set_cursor(GtkWidget *widget, LIB3270_POINTER id) |
| 203 | 204 | LIB3270_EXPORT void v3270_set_auto_disconnect(GtkWidget *widget, guint minutes) |
| 204 | 205 | { |
| 205 | 206 | g_return_if_fail(GTK_IS_V3270(widget)); |
| 206 | - GTK_V3270(widget)->activity.disconnect = minutes; | |
| 207 | + | |
| 208 | + v3270 * terminal = GTK_V3270(widget); | |
| 209 | + | |
| 210 | + if(terminal->activity.disconnect != minutes) | |
| 211 | + { | |
| 212 | + terminal->activity.disconnect = minutes; | |
| 213 | + g_object_notify_by_pspec(G_OBJECT(widget), GTK_V3270_GET_CLASS(widget)->properties.auto_disconnect); | |
| 214 | + } | |
| 215 | + | |
| 207 | 216 | } |
| 208 | 217 | ... | ... |