Commit be8f5790f8652987d015025c666f044547a82e0f

Authored by Perry Werneck
1 parent 154e0036

Implementing paste actions.

src/objects/actions/clipboard.c
... ... @@ -49,10 +49,15 @@
49 49  
50 50 }
51 51  
52   - static void activate_paste(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) {
  52 + static void activate_paste(GAction G_GNUC_UNUSED(*action), GVariant *parameter, GtkWidget *terminal) {
53 53  
54   - debug("%s",__FUNCTION__);
55   - v3270_paste(terminal);
  54 + debug("%s %p",__FUNCTION__,parameter);
  55 +
  56 + if(!parameter) {
  57 + v3270_paste(terminal);
  58 + } else {
  59 + v3270_paste_from_url(terminal,g_variant_get_string(parameter,NULL));
  60 + }
56 61  
57 62 }
58 63  
... ... @@ -123,10 +128,11 @@
123 128  
124 129 };
125 130  
126   - GAction * action = pw3270_action_new_from_lib3270(&action_descriptor);
  131 + pw3270Action * action = PW3270_ACTION(pw3270_action_new_from_lib3270(&action_descriptor));
127 132  
128   - PW3270_ACTION(action)->activate = activate_paste;
  133 + action->types.parameter = G_VARIANT_TYPE_STRING;
  134 + action->activate = activate_paste;
129 135  
130   - return action;
  136 + return G_ACTION(action);
131 137  
132 138 }
... ...
ui/application.xml
... ... @@ -135,20 +135,22 @@
135 135 <item>
136 136 <attribute name="label" translatable="yes">Paste from clipboard</attribute>
137 137 <attribute name="action">win.paste</attribute>
  138 + <attribute name="target">clipboard://</attribute>
138 139 </item>
139 140  
140 141 <item>
141 142 <attribute name="label" translatable="yes">Paste next</attribute>
142   - <attribute name="action">win.paste_next</attribute>
  143 + <attribute name="action">win.paste</attribute>
  144 + <attribute name="target">next://</attribute>
143 145 </item>
144 146  
145 147 <item>
146   - <attribute name="label" translatable="yes">Paste text file</attribute>
147   - <attribute name="action">win.paste_file</attribute>
  148 + <attribute name="label" translatable="yes">Paste from text file</attribute>
  149 + <attribute name="action">win.paste</attribute>
  150 + <attribute name="target">file://</attribute>
148 151 </item>
149 152  
150 153 </section>
151   -
152 154  
153 155 <section>
154 156  
... ...