From ba5d57e87c7abd7e143b3a4fb57f78fbfaad904c Mon Sep 17 00:00:00 2001 From: QualCoder Developer Date: Fri, 13 Oct 2023 13:09:34 +1100 Subject: [PATCH] APA style copy to clipboard function --- qualcoder/manage_references.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qualcoder/manage_references.py b/qualcoder/manage_references.py index 7b57b86f3..c60dd9cc9 100644 --- a/qualcoder/manage_references.py +++ b/qualcoder/manage_references.py @@ -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()): @@ -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 """