This commit is contained in:
恍兮惚兮 2024-05-20 14:39:08 +08:00
parent 2c0589cf3c
commit 88c2e76a75
2 changed files with 8 additions and 3 deletions

View File

@ -2378,7 +2378,6 @@ class mdict(cishubase):
return parsed_strings
def parseashtml(self, item):
item = item.replace("\r\n", "<br>")
items = self.parse_strings(item)
html = ""
for type_, string in items:
@ -2402,6 +2401,8 @@ class mdict(cishubase):
if (not ishtml) and not string.endswith("<br>"):
html += "<br>"
if not ishtml:
item = item.replace("\r\n", "<br>")
return html
def dfstyle(self):

View File

@ -1,8 +1,7 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QTabWidget, QTextBrowser, QAction, QMenu, QFileDialog
from PyQt5.QtCore import Qt, pyqtSignal
import qtawesome, functools
import qtawesome, functools, winsharedutils
from gui.usefulwidget import closeashidewindow
from myutils.config import globalconfig, _TR
@ -46,10 +45,13 @@ class transhist(closeashidewindow):
menu = QMenu(self)
qingkong = QAction(_TR("清空"))
baocun = QAction(_TR("保存"))
copy = QAction(_TR("复制到剪贴板"))
hideshowraw = QAction(_TR("显示原文" if self.hiderawflag else "不显示原文"))
hideshowapi = QAction(_TR("显示api" if self.hideapiflag else "不显示api"))
menu.addAction(qingkong)
menu.addAction(baocun)
if len(self.textOutput.textCursor().selectedText()):
menu.addAction(copy)
if flag == 1:
menu.addAction(hideshowraw)
menu.addAction(hideshowapi)
@ -57,6 +59,8 @@ class transhist(closeashidewindow):
action = menu.exec(self.mapToGlobal(p))
if action == qingkong:
tb.clear()
elif action == copy:
winsharedutils.clipboard_set(self.textOutput.textCursor().selectedText())
elif action == baocun:
ff = QFileDialog.getSaveFileName(self, directory="save.txt")
if ff[0] == "":