Commit 54e33560912a18ec83a4675971044c3c0de33924
1 parent
9dff8391
Exists in
master
and in
1 other branch
"APPEND" is now a copy mode instead of a separated method.
Showing
3 changed files
with
10 additions
and
17 deletions
Show diff stats
src/include/v3270.h
... | ... | @@ -197,17 +197,16 @@ |
197 | 197 | LIB3270_EXPORT gchar * v3270_get_lunames(GtkWidget *widget); |
198 | 198 | |
199 | 199 | // Clipboard |
200 | - typedef enum _v3270_copy_mode | |
200 | + typedef enum _v3270_copy_mode | |
201 | 201 | { |
202 | 202 | V3270_COPY_FORMATTED, ///< @brief Copy formatted data; keep attributes. |
203 | 203 | V3270_COPY_TEXT, ///< @brief Single text format, ignore attributes. |
204 | 204 | V3270_COPY_TABLE, ///< @brief Copy as table. |
205 | + V3270_COPY_APPEND ///< @brief Append to current contents keeping the stored format. | |
205 | 206 | |
206 | 207 | } V3270_COPY_MODE; |
207 | 208 | |
208 | 209 | LIB3270_EXPORT void v3270_clipboard_set(GtkWidget *widget, V3270_COPY_MODE mode, gboolean cut); |
209 | - LIB3270_EXPORT void v3270_clipboard_append(GtkWidget *widget, gboolean cut); | |
210 | - | |
211 | 210 | LIB3270_EXPORT void v3270_clipboard_get_from_url(GtkWidget *widget, const gchar *url); |
212 | 211 | |
213 | 212 | LIB3270_EXPORT void v3270_paste(GtkWidget *widget) G_GNUC_DEPRECATED; | ... | ... |
src/selection/copy.c
... | ... | @@ -47,27 +47,21 @@ |
47 | 47 | |
48 | 48 | v3270 * terminal = GTK_V3270(widget); |
49 | 49 | |
50 | - // Have data? Clear it? | |
51 | - v3270_clear_selection(terminal); | |
50 | + if(mode != V3270_COPY_APPEND) { | |
52 | 51 | |
53 | - terminal->selection.format = mode; | |
54 | - do_copy(terminal,cut); | |
52 | + // It's not append, clear current contents ... | |
53 | + v3270_clear_selection(terminal); | |
55 | 54 | |
56 | - v3270_update_system_clipboard(widget); | |
57 | - } | |
55 | + // ... and set the new mode. | |
56 | + terminal->selection.format = mode; | |
58 | 57 | |
59 | - LIB3270_EXPORT void v3270_clipboard_append(GtkWidget *widget, gboolean cut) | |
60 | - { | |
61 | - g_return_if_fail(GTK_IS_V3270(widget)); | |
62 | - | |
63 | - v3270 * terminal = GTK_V3270(widget); | |
58 | + } | |
64 | 59 | |
65 | 60 | do_copy(terminal,cut); |
66 | 61 | |
67 | 62 | v3270_update_system_clipboard(widget); |
68 | 63 | } |
69 | 64 | |
70 | - | |
71 | 65 | LIB3270_EXPORT void v3270_copy_selection(GtkWidget *widget, V3270_COPY_MODE format, gboolean cut) |
72 | 66 | { |
73 | 67 | v3270_clipboard_set(widget,format,cut); |
... | ... | @@ -75,6 +69,6 @@ |
75 | 69 | |
76 | 70 | LIB3270_EXPORT void v3270_append_selection(GtkWidget *widget, gboolean cut) |
77 | 71 | { |
78 | - v3270_clipboard_append(widget,cut); | |
72 | + v3270_clipboard_set(widget,V3270_COPY_APPEND,cut); | |
79 | 73 | } |
80 | 74 | ... | ... |
src/trace/exec.c