mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
fix
This commit is contained in:
parent
2c0589cf3c
commit
88c2e76a75
@ -2378,7 +2378,6 @@ class mdict(cishubase):
|
|||||||
return parsed_strings
|
return parsed_strings
|
||||||
|
|
||||||
def parseashtml(self, item):
|
def parseashtml(self, item):
|
||||||
item = item.replace("\r\n", "<br>")
|
|
||||||
items = self.parse_strings(item)
|
items = self.parse_strings(item)
|
||||||
html = ""
|
html = ""
|
||||||
for type_, string in items:
|
for type_, string in items:
|
||||||
@ -2402,6 +2401,8 @@ class mdict(cishubase):
|
|||||||
|
|
||||||
if (not ishtml) and not string.endswith("<br>"):
|
if (not ishtml) and not string.endswith("<br>"):
|
||||||
html += "<br>"
|
html += "<br>"
|
||||||
|
if not ishtml:
|
||||||
|
item = item.replace("\r\n", "<br>")
|
||||||
return html
|
return html
|
||||||
|
|
||||||
def dfstyle(self):
|
def dfstyle(self):
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtWidgets import QTabWidget, QTextBrowser, QAction, QMenu, QFileDialog
|
from PyQt5.QtWidgets import QTabWidget, QTextBrowser, QAction, QMenu, QFileDialog
|
||||||
from PyQt5.QtCore import Qt, pyqtSignal
|
from PyQt5.QtCore import Qt, pyqtSignal
|
||||||
import qtawesome, functools
|
import qtawesome, functools, winsharedutils
|
||||||
|
|
||||||
from gui.usefulwidget import closeashidewindow
|
from gui.usefulwidget import closeashidewindow
|
||||||
from myutils.config import globalconfig, _TR
|
from myutils.config import globalconfig, _TR
|
||||||
|
|
||||||
@ -46,10 +45,13 @@ class transhist(closeashidewindow):
|
|||||||
menu = QMenu(self)
|
menu = QMenu(self)
|
||||||
qingkong = QAction(_TR("清空"))
|
qingkong = QAction(_TR("清空"))
|
||||||
baocun = QAction(_TR("保存"))
|
baocun = QAction(_TR("保存"))
|
||||||
|
copy = QAction(_TR("复制到剪贴板"))
|
||||||
hideshowraw = QAction(_TR("显示原文" if self.hiderawflag else "不显示原文"))
|
hideshowraw = QAction(_TR("显示原文" if self.hiderawflag else "不显示原文"))
|
||||||
hideshowapi = QAction(_TR("显示api" if self.hideapiflag else "不显示api"))
|
hideshowapi = QAction(_TR("显示api" if self.hideapiflag else "不显示api"))
|
||||||
menu.addAction(qingkong)
|
menu.addAction(qingkong)
|
||||||
menu.addAction(baocun)
|
menu.addAction(baocun)
|
||||||
|
if len(self.textOutput.textCursor().selectedText()):
|
||||||
|
menu.addAction(copy)
|
||||||
if flag == 1:
|
if flag == 1:
|
||||||
menu.addAction(hideshowraw)
|
menu.addAction(hideshowraw)
|
||||||
menu.addAction(hideshowapi)
|
menu.addAction(hideshowapi)
|
||||||
@ -57,6 +59,8 @@ class transhist(closeashidewindow):
|
|||||||
action = menu.exec(self.mapToGlobal(p))
|
action = menu.exec(self.mapToGlobal(p))
|
||||||
if action == qingkong:
|
if action == qingkong:
|
||||||
tb.clear()
|
tb.clear()
|
||||||
|
elif action == copy:
|
||||||
|
winsharedutils.clipboard_set(self.textOutput.textCursor().selectedText())
|
||||||
elif action == baocun:
|
elif action == baocun:
|
||||||
ff = QFileDialog.getSaveFileName(self, directory="save.txt")
|
ff = QFileDialog.getSaveFileName(self, directory="save.txt")
|
||||||
if ff[0] == "":
|
if ff[0] == "":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user