Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
just the copying to clipboard - #229
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrasca committed Dec 26, 2015
1 parent 30581a8 commit bcda4e2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
30 changes: 7 additions & 23 deletions bauble/plugins/plants/taxonomy_check.glade
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@
<property name="homogeneous">True</property>
<property name="layout_style">edge</property>
<child>
<object class="GtkButton" id="button4">
<object class="GtkButton" id="copy_to_clipboard_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">copy result selection to clipboard</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_copy_to_clipboard_button_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
Expand All @@ -125,12 +126,13 @@
</packing>
</child>
<child>
<object class="GtkButton" id="button8">
<object class="GtkButton" id="tnrs_browse_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">start TNRS lookup</property>
<property name="use_action_appearance">False</property>
<signal name="activate" handler="on_tnrs_browse_button_activate" swapped="no"/>
<child>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
Expand All @@ -152,7 +154,7 @@
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">continue to next screen</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_frame_next" swapped="no"/>
<signal name="clicked" handler="on_frame1_next" swapped="no"/>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
Expand Down Expand Up @@ -259,33 +261,15 @@
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">run the tool</property>
<property name="use_action_appearance">False</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">system-run</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="button10">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_frame_next" swapped="no"/>
<signal name="clicked" handler="on_frame2_next" swapped="no"/>
<child>
<object class="GtkImage" id="image10">
<property name="visible">True</property>
Expand Down
21 changes: 21 additions & 0 deletions bauble/plugins/plants/taxonomy_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def refresh_visible_frame(self):
frame_id = 'frame%d' % i
self.view.widget_set_visible(frame_id, i == self.model['page'])

def on_frame1_next(self, *args):
'parse the results into the liststore1 and move to frame 2'
self.on_frame_next(*args)

def on_frame2_next(self, *args):
'execute all that is selected in liststore1 and move to frame 3'
self.on_frame_next(*args)

def on_frame_next(self, *args):
self.model['page'] += 1
self.refresh_visible_frame()
Expand All @@ -87,6 +95,19 @@ def on_frame_previous(self, *args):
self.model['page'] -= 1
self.refresh_visible_frame()

def on_copy_to_clipboard_button_clicked(self, *args):
from bauble.plugins.plants import Species
binomials = [item.str(item, remove_zws=True)
for item in self.model['selection']
if isinstance(item, Species) and item.sp != '']
text = '\n'.join(binomials)
import gtk
clipboard = gtk.Clipboard()
clipboard.set_text(text)

def on_tnrs_browse_button_clicked(self, *args):
pass

pass


Expand Down

0 comments on commit bcda4e2

Please sign in to comment.