Skip to content

Commit

Permalink
APA style copy to clipboard function
Browse files Browse the repository at this point in the history
  • Loading branch information
ccbogel authored Oct 13, 2023
1 parent 62be301 commit ba5d57e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qualcoder/manage_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ def table_refs_menu(self, position):
if self.table_refs_rows_hidden:
action_show_all_rows = menu.addAction(_("Show all rows"))
action_copy_to_clipboard = menu.addAction(_("Copy to clipboard"))
action_copy_apa_to_clipboard = menu.addAction(_("Copy to clipboard. APA style"))
action = menu.exec(self.ui.tableWidget_refs.mapToGlobal(position))
if action == action_show_all_rows:
for r in range(0, self.ui.tableWidget_refs.rowCount()):
Expand All @@ -505,6 +506,13 @@ def table_refs_menu(self, position):
reference_text = self.ui.tableWidget_refs.item(row, 1).text()
cb = QtWidgets.QApplication.clipboard()
cb.setText(reference_text)
if action == action_copy_apa_to_clipboard:
#reference_text = self.ui.tableWidget_refs.item(row, 1).text()
ref_id = self.ui.tableWidget_refs.item(row, REF_ID).text()
for ref in self.refs:
if int(ref_id) == ref['risid']:
cb = QtWidgets.QApplication.clipboard()
cb.setText(ref['apa'])

def import_references(self):
""" Import RIS formatted references from .ris or .txt files """
Expand Down

0 comments on commit ba5d57e

Please sign in to comment.