Commit 4cdb9db324a48383738dda7dd3455c702d4934e0
1 parent
5ac373b9
Exists in
master
and in
1 other branch
"has-copy" is now a widget property.
Showing
5 changed files
with
22 additions
and
1 deletions
Show diff stats
src/include/terminal.h
src/selection/selection.c
| @@ -70,6 +70,7 @@ gboolean v3270_has_copy(GtkWidget *widget) | @@ -70,6 +70,7 @@ gboolean v3270_has_copy(GtkWidget *widget) | ||
| 70 | void v3270_emit_copy_state(GtkWidget *widget) | 70 | void v3270_emit_copy_state(GtkWidget *widget) |
| 71 | { | 71 | { |
| 72 | g_signal_emit(widget,v3270_widget_signal[V3270_SIGNAL_CLIPBOARD], 0, GTK_V3270(widget)->selection.blocks != NULL); | 72 | g_signal_emit(widget,v3270_widget_signal[V3270_SIGNAL_CLIPBOARD], 0, GTK_V3270(widget)->selection.blocks != NULL); |
| 73 | + g_object_notify_by_pspec(G_OBJECT(widget), GTK_V3270_GET_CLASS(widget)->properties.has_copy); | ||
| 73 | lib3270_action_group_notify(GTK_V3270(widget)->host,LIB3270_ACTION_GROUP_COPY); | 74 | lib3270_action_group_notify(GTK_V3270(widget)->host,LIB3270_ACTION_GROUP_COPY); |
| 74 | } | 75 | } |
| 75 | 76 |
src/terminal/properties/get.c
| @@ -143,6 +143,9 @@ | @@ -143,6 +143,9 @@ | ||
| 143 | g_value_set_uint(value,(guint) window->selection.options); | 143 | g_value_set_uint(value,(guint) window->selection.options); |
| 144 | break; | 144 | break; |
| 145 | 145 | ||
| 146 | + case V3270_PROPERTY_HAS_COPY: | ||
| 147 | + g_value_set_boolean(value,window->selection.blocks != NULL); | ||
| 148 | + break; | ||
| 146 | default: | 149 | default: |
| 147 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); | 150 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
| 148 | 151 |
src/terminal/properties/init.c
| @@ -243,6 +243,21 @@ | @@ -243,6 +243,21 @@ | ||
| 243 | ); | 243 | ); |
| 244 | 244 | ||
| 245 | 245 | ||
| 246 | + klass->properties.has_copy = | ||
| 247 | + g_param_spec_boolean( | ||
| 248 | + "has_copy", | ||
| 249 | + "has_copy", | ||
| 250 | + _( "True if the terminal has copy blocks" ), | ||
| 251 | + FALSE, | ||
| 252 | + G_PARAM_READABLE | ||
| 253 | + ); | ||
| 254 | + | ||
| 255 | + g_object_class_install_property( | ||
| 256 | + gobject_class, | ||
| 257 | + V3270_PROPERTY_HAS_COPY, | ||
| 258 | + klass->properties.has_copy | ||
| 259 | + ); | ||
| 260 | + | ||
| 246 | 261 | ||
| 247 | // | 262 | // |
| 248 | // Create dynamic properties | 263 | // Create dynamic properties |
src/terminal/properties/private.h
| @@ -58,8 +58,9 @@ | @@ -58,8 +58,9 @@ | ||
| 58 | V3270_PROPERTY_TRACE = 9, ///< @brief Is the trace widget active? | 58 | V3270_PROPERTY_TRACE = 9, ///< @brief Is the trace widget active? |
| 59 | V3270_PROPERTY_TERMINAL_COLORS = 10, ///< @brief Terminal colors. | 59 | V3270_PROPERTY_TERMINAL_COLORS = 10, ///< @brief Terminal colors. |
| 60 | V3270_PROPERTY_SELECTION_OPTIONS = 11, | 60 | V3270_PROPERTY_SELECTION_OPTIONS = 11, |
| 61 | + V3270_PROPERTY_HAS_COPY = 12, ///< @brief Terminal has copy. | ||
| 61 | 62 | ||
| 62 | - V3270_PROPERTY_DYNAMIC = 12 ///< @brief Id of the first LIB3270 internal property. | 63 | + V3270_PROPERTY_DYNAMIC = 13 ///< @brief Id of the first LIB3270 internal property. |
| 63 | }; | 64 | }; |
| 64 | 65 | ||
| 65 | G_GNUC_INTERNAL void v3270_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | 66 | G_GNUC_INTERNAL void v3270_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); |