From 4423e7efc0a4b105bdeb93d0ab54ca16d2855c13 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 14 Nov 2013 08:36:26 -0800 Subject: [PATCH] Correctly copy Kanji defintions to clipboard Former-commit-id: 505fff8db8eabb0abfe1f8ff8e6b411ee520563d --- ui/reader.ui | 6 +++++- yomi_base/gen/about_ui.py | 2 +- yomi_base/gen/preferences_ui.py | 2 +- yomi_base/gen/reader_ui.py | 3 ++- yomi_base/gen/resources_rc.py | 2 +- yomi_base/reader_util.py | 4 ++++ 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ui/reader.ui b/ui/reader.ui index 13ef455..68f6fd5 100644 --- a/ui/reader.ui +++ b/ui/reader.ui @@ -221,7 +221,11 @@ - + + + false + + diff --git a/yomi_base/gen/about_ui.py b/yomi_base/gen/about_ui.py index 04c44ba..bcdf546 100644 --- a/yomi_base/gen/about_ui.py +++ b/yomi_base/gen/about_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ui/about.ui' # -# Created: Mon Nov 11 15:13:30 2013 +# Created: Thu Nov 14 08:32:50 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! diff --git a/yomi_base/gen/preferences_ui.py b/yomi_base/gen/preferences_ui.py index 3fb6f25..23c8a2e 100644 --- a/yomi_base/gen/preferences_ui.py +++ b/yomi_base/gen/preferences_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ui/preferences.ui' # -# Created: Mon Nov 11 15:13:30 2013 +# Created: Thu Nov 14 08:32:50 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! diff --git a/yomi_base/gen/reader_ui.py b/yomi_base/gen/reader_ui.py index d08033b..ef61cf9 100644 --- a/yomi_base/gen/reader_ui.py +++ b/yomi_base/gen/reader_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ui/reader.ui' # -# Created: Mon Nov 11 15:13:30 2013 +# Created: Thu Nov 14 08:32:50 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! @@ -122,6 +122,7 @@ class Ui_MainWindowReader(object): self.verticalLayout_3 = QtGui.QVBoxLayout(self.dockWidgetContents_3) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.textKanjiDefs = QtGui.QTextBrowser(self.dockWidgetContents_3) + self.textKanjiDefs.setOpenLinks(False) self.textKanjiDefs.setObjectName(_fromUtf8("textKanjiDefs")) self.verticalLayout_3.addWidget(self.textKanjiDefs) self.horizontalLayout_4 = QtGui.QHBoxLayout() diff --git a/yomi_base/gen/resources_rc.py b/yomi_base/gen/resources_rc.py index 333e5bc..7376eb6 100644 --- a/yomi_base/gen/resources_rc.py +++ b/yomi_base/gen/resources_rc.py @@ -2,7 +2,7 @@ # Resource object code # -# Created: Mon Nov 11 15:13:30 2013 +# Created: Thu Nov 14 08:32:50 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! diff --git a/yomi_base/reader_util.py b/yomi_base/reader_util.py index 1e89fe1..bc15a37 100644 --- a/yomi_base/reader_util.py +++ b/yomi_base/reader_util.py @@ -131,6 +131,10 @@ def markupKanji(definition): } +def copyKanjiDef(definition): + return QtGui.QApplication.clipboard().setText(u'{character}\t{kunyomi}\t{onyomi}\t{glossary}'.format(**definition)) + + def buildDefHeader(): palette = QtGui.QApplication.palette() toolTipBg = palette.color(QtGui.QPalette.Window).name()