diff --git a/changes.md b/changes.md index 8b5cf9b6..7f16c8b3 100644 --- a/changes.md +++ b/changes.md @@ -1,4 +1,13 @@ # Changes History +## v1.22 +- Editor + - Support parsting HTML as converted Markdown text; + - Improve performance of in-place preview; + - Be aware of links, images, and in-place preview in edit mode (visit or copy); + - Support exporting and copying PlantUML and Graphviz diagram in edit mode; +- Support middle click to close a tab; +- Support searching files via multiple tags, such as "vnote && markdown"; + ## v1.21 - Improve performance of editor (now could process 10K lines); - Support `vnote` highlight in edit mode; diff --git a/src/resources/markdown_template.js b/src/resources/markdown_template.js index 128df2c1..61125877 100644 --- a/src/resources/markdown_template.js +++ b/src/resources/markdown_template.js @@ -1405,8 +1405,8 @@ var handleGraphvizResult = function(id, timeStamp, format, result) { var setPreviewEnabled = function(enabled) { var hint = '
' + - '

Live Preview for Diagrams

' + - '

Place the cursor on the definition of a diagram to preview.

' + + '

Live Preview for Graphs

' + + '

Place the cursor on the definition of a graph to preview.

' + '
'; if (enabled) { diff --git a/src/translations/vnote_zh_CN.qm b/src/translations/vnote_zh_CN.qm index 8b0517e8..c945f440 100644 Binary files a/src/translations/vnote_zh_CN.qm and b/src/translations/vnote_zh_CN.qm differ diff --git a/src/translations/vnote_zh_CN.ts b/src/translations/vnote_zh_CN.ts index d71fb180..de20638a 100644 --- a/src/translations/vnote_zh_CN.ts +++ b/src/translations/vnote_zh_CN.ts @@ -9,42 +9,42 @@ 所有幻词: - + Insert Link 插入链接 - + Found no match 没有找到匹配项 - + Found %1 %2 找到 %1 %2 - + matches 处匹配 - + match 处匹配 - + Replace %1 %2 替换了 %1 %2 - + occurences 处匹配 - + occurence 处匹配 @@ -69,29 +69,29 @@ 这里插入图片 - + Information 信息 - + Please re-open current opened tabs to make it work. 请重新打开当前打开页面以生效。 - - + + Illegal name. Please try again: 非法名字。请重试: - - + + Name already exists. Please try again: 名字已存在。请重试: - + Set base font point size %1 当前字体大小为 %1 @@ -1217,192 +1217,192 @@ VEditWindow - + Locate To Folder 定位所在文件夹 - + Locate the folder of current note 定位到当前笔记所在的文件夹 - + Move One Split Left 左移一个分割窗口 - + Move current tab to the split on the left 将当前标签页往左移动一个分割窗口 - + Move One Split Right 右移一个分割窗口 - + Move current tab to the split on the right 将当前标签页往右移动一个分割窗口 - + Close Tab 关闭标签页 - + Close current note tab 关闭当前标签页 - + Close Other Tabs 关闭其他标签页 - + Close all other note tabs 关闭其他所有标签页 - + Close All Tabs 关闭所有标签页 - + Close all the note tabs 关闭所有标签页 - + Maximize Split 最大化分割 - + Maximize current split window 最大化当前分割窗口 - + Distribute Splits 分布分割 - + Distribute all the split windows evenly 均等分布所有分割窗口 - + Close Tabs To The Right 关闭右侧标签页 - + Close all the note tabs to the right of current tab 关闭当前标签页右侧所有标签页 - + Note Info 笔记信息 - + View and edit information of the note 查看并编辑笔记的信息 - + Add To Cart 添加到小推车 - + Explore the folder containing this note in operating system 在操作系统中浏览包含该笔记的文件夹 - + Add this note to Cart for further processing 将该笔记添加到小推车以进一步处理 - + 1 note added to Cart 1个笔记添加到小推车 - + Open Note Location 打开笔记所在位置 - + Reload From Disk 从磁盘中重新加载 - + Reload the content of this note from disk 从磁盘中重新加载该笔记的内容 - + &Recycle Bin 回收站 (&R) - + Open the recycle bin of this note 打开该笔记的回收站 - + Opened Notes List 已打开笔记列表 - + Remove Split 移除分割 - + Pin To History 钉到历史中 - + Pin this note to History 将该笔记钉到历史中 - + 1 note pinned to History 1个笔记被钉到历史中 - + Split 分割 - + Split current window vertically 垂直分割当前窗口 - + Remove current split window 移除当前分割窗口 - + Menu 菜单 @@ -3306,17 +3306,17 @@ Modified Time: %3 VListUE - + List and search history 列出和搜索历史 - + Invalid ID %1 无效的ID %1 - + History 历史 @@ -5012,122 +5012,235 @@ Modified Time: %3 VMdEditor - + &Save Changes And Read 保存更改并阅读 (&S) - + Save changes and exit edit mode 保存对当前笔记的更改并退出编辑模式 - + &Discard Changes And Read 放弃更改并阅读 (&D) - + Discard changes and exit edit mode 放弃对当前笔记的更改并退出编辑模式 - Live Preview for Diagrams - 图表实时预览 + 图表实时预览 - Toggle live preview panel for diagrams - 打开或关闭图表实时预览面板 + 打开或关闭图表实时预览面板 - + Following images seems not to be used in this note anymore. Please confirm the deletion of these images. 下列图片似乎已经不再在该笔记中被使用。请确认是否删除这些图片。 - + Deleted files could be found in the recycle bin of this note.<br>Click "Cancel" to leave them untouched. 被删除的文件可以在该笔记的回收站中找回。<br>点击“取消”以终止操作。 - + Confirm Cleaning Up Unused Images 确认清理未被使用的图片 - - + + + Insert From Clipboard 粘贴选项 - + Insert From URL 从URL中插入 - + Insert From Image Data 从图片数据中插入 - - + + Insert As Image Link 作为图片链接插入 - + + Insert As Image 作为图片插入 - + + Insert As Text 作为文本插入 - + + Live Preview For Graphs + 图表实时预览 + + + + Toggle live preview panel for graphs + 打开或关闭图表实时预览面板 + + + + Parse And Insert Markdown Text + 解析并插入Markdown文本 + + + + + Warning 警告 - + Fail to move unsaved inserted image %1 to %2. 移动未保存的插入图片 %1 到 %2 失败。 - + Please check it manually to avoid image loss. 请手动检查以免丢失图片。 - + + Parsed Markdown text inserted + 解析的Markdown文本已插入 + + + Copy HTML As 复制HTML为 - + Copy selected content as HTML using rules specified by target %1 使用目标 %1 指定的规则将所选内容复制为HTML - + Paste As Block &Quote 粘贴为块引用 (&Q) - + Paste text from clipboard as block quote 将剪切版中的文本作为块引用粘贴 - + Insert Image Link 插入图片链接 + + + View Image + 查看图片 + + + + Copy Image URL + 复制图片URL + + + + Copy Image Path + 复制图片路径 + + + + Copy Image + 复制图片 + + + + View Link + 访问链接 + + + + Copy Link URL + 复制链接URL + + + + Copy Link Path + 复制链接路径 + + + + Copy In-Place Preview + 复制原地预览 + + + + Copy Graph + 复制图表 + + + + PNG + PNG格式 + + + + Export graph as PNG to a temporary file and copy + 将图表以PNG格式导出到一个临时文件并复制 + + + + SVG + SVG格式 + + + + Export graph as SVG to a temporary file and copy + 将图表以SVG格式导出到一个临时文件并复制 + + + + Fail to open a temporary file for export. + 无法打开一个临时文件并导出。 + + + + Exporting graph + 正在导出图表 + + + + Fail to export graph. + 导出图表失败。 + + + + Graph exported and copied + 图表已导出并复制 + + + + Fail to read exported image: %1 + 无法读取导出的图片: %1 + VMdTab @@ -5180,97 +5293,97 @@ Modified Time: %3 保存笔记时,写入文件失败。请稍后再试。 - + Snippet applied 片段已应用 - + Snippet %1 is not applicable 片段 %1 不适用 - + Snippets are not applicable 无法应用片段 - + No available snippets defined with shortcuts 当前没有定义带有快捷键的片段可用 - + Backup File Found 发现备份文件 - + Found backup file <span style="%1">%2</span> when opening note <span style="%1">%3</span>. 打开笔记 <span style="%1">%3</span> 时发现备份文件 <span style="%1">%2</span>。 - + VNote may crash while editing this note before.<br/>Please choose to recover from the backup file or delete it.<br/><br/>Note file last modified: <span style="%1">%2</span><br/>Backup file last modified: <span style="%1">%3</span> VNote此前编辑该笔记时可能意外退出。<br/>请选择从该备份文件恢复或者删除该备份文件。<br/><br/>笔记文件上次修改时间: <span style="%1">%2</span><br/>备份文件上次修改时间: <span style="%1">%3</span> - + Recover From Backup File 从备份文件恢复 - + Discard Backup File 放弃备份文件 - + Cancel 取消 - + Quit 退出 - + Not an editor command: %1 不是一个编辑器命令:%1 - + Page saved to %1 页面保存为 %1 - + Fail to save page to %1 保存页面为 %1 失败 - + Single HTML (*.html) 仅HTML (*.html) - + Complete HTML (*.html) 完整HTML (*.html) - + MIME HTML (*.mht) MIME HTML (*.mht) - + Save Page 保存页面 - + Saving page to %1 正在保存页面为 %1 @@ -6123,64 +6236,64 @@ If absolute path is used, VNote will not manage those images.(empty to use globa VSearchResultTree - + &Open 打开 (&O) - + Open selected notes 打开选定笔记 - + &Locate To Folder 定位所在文件夹 (&L) - + Locate the folder of current note 定位到当前笔记所在的文件夹 - + Add To Cart 添加到小推车 - + Add selected notes to Cart for further processing 将所选笔记添加到小推车以进一步处理 - + Pin To History 钉到历史中 - + Pin selected notes to History 将选定笔记钉到历史中 - + %1 %2 added to Cart %1个%2添加到小推车 - - + + notes 笔记 - - + + note 笔记 - + %1 %2 pinned to History %1个%2被钉到历史中 @@ -6188,87 +6301,87 @@ If absolute path is used, VNote will not manage those images.(empty to use globa VSearchUE - + List and search all the notebooks 列出和搜索全部笔记本 - + Search the name of folders/notes in all the notebooks 在全部笔记本中搜索文件夹或笔记的名字 - + Search the content of notes in all the notebooks 在全部笔记本中搜索笔记的内容 - + Search the tags of notes in all the notebooks 在全部笔记本中搜索笔记的标签 - + Search the name of folders/notes in current notebook 在当前笔记本中搜索文件夹或笔记的名字 - + Search the content of notes in current notebook 在当前笔记本中搜索笔记的内容 - + Search the tags of notes in current notebook 在当前笔记本中搜索笔记的标签 - + Search the name of folders/notes in current folder 在当前文件夹中搜索文件夹或笔记的名字 - + Search the content of notes in current folder 在当前文件夹中搜索笔记的内容 - + Search the tags of notes in current folder 在当前文件夹中搜索笔记的标签 - + List and search the name of opened notes in buffer 列出和搜索缓冲区中已打开笔记的名字 - + Search the content of opened notes in buffer 搜索缓冲区中已打开笔记的内容 - + Search the outline of opened notes in buffer 搜索缓冲区中已打开笔记的大纲 - + Search the path of folders/notes in all the notebooks 在全部笔记本中搜索文件夹或笔记的路径 - + Search the path of folders/notes in current notebook 在当前笔记本中搜索文件夹或笔记的路径 - + Search the content of notes in Explorer root directory 在浏览器根目录中搜索笔记的内容 - + Invalid ID %1 无效的ID %1 @@ -7115,7 +7228,7 @@ If absolute path is used, VNote will not manage those images.(empty to use globa VUniversalEntry - + Universal Entry, reach anything by typing 通用入口,触手可达 diff --git a/src/vmdeditor.cpp b/src/vmdeditor.cpp index 22bcf446..41200042 100644 --- a/src/vmdeditor.cpp +++ b/src/vmdeditor.cpp @@ -327,8 +327,8 @@ void VMdEditor::contextMenuEvent(QContextMenuEvent *p_event) emit m_object->discardAndRead(); }); - QAction *toggleLivePreviewAct = new QAction(tr("Live Preview for Diagrams"), menu.data()); - toggleLivePreviewAct->setToolTip(tr("Toggle live preview panel for diagrams")); + QAction *toggleLivePreviewAct = new QAction(tr("Live Preview For Graphs"), menu.data()); + toggleLivePreviewAct->setToolTip(tr("Toggle live preview panel for graphs")); connect(toggleLivePreviewAct, &QAction::triggered, this, [this]() { m_editTab->toggleLivePreview(); @@ -825,7 +825,7 @@ void VMdEditor::insertFromMimeData(const QMimeData *p_source) // Handle HTML. VSelectDialog dialog(tr("Insert From Clipboard"), this); - dialog.addSelection(tr("Insert Converted Markdown Text"), 0); + dialog.addSelection(tr("Parse And Insert Markdown Text"), 0); dialog.addSelection(tr("Insert As Text"), 1); if (p_source->hasImage()) { dialog.addSelection(tr("Insert As Image"), 2); @@ -1240,7 +1240,7 @@ void VMdEditor::htmlToTextFinished(int p_id, int p_timeStamp, const QString &p_t QTextCursor cursor = textCursor(); cursor.insertText(p_text); setTextCursor(cursor); - emit m_object->statusMessage(tr("Converted Markdown text inverted")); + emit m_object->statusMessage(tr("Parsed Markdown text inserted")); } } @@ -1710,22 +1710,22 @@ bool VMdEditor::initExportAndCopyMenu(QAction *p_before, return false; } - QMenu *subMenu = new QMenu(tr("Copy Diagram"), p_menu); + QMenu *subMenu = new QMenu(tr("Copy Graph"), p_menu); subMenu->setToolTipsVisible(true); QAction *pngAct = new QAction(tr("PNG"), subMenu); - pngAct->setToolTip(tr("Export diagram as PNG to a temporary file and copy")); + pngAct->setToolTip(tr("Export graph as PNG to a temporary file and copy")); connect(pngAct, &QAction::triggered, this, [this, lang = cb.m_lang, text = cb.m_text]() { - exportDiagramAndCopy(lang, text, "png"); + exportGraphAndCopy(lang, text, "png"); }); subMenu->addAction(pngAct); QAction *svgAct = new QAction(tr("SVG"), subMenu); - svgAct->setToolTip(tr("Export diagram as SVG to a temporary file and copy")); + svgAct->setToolTip(tr("Export graph as SVG to a temporary file and copy")); connect(svgAct, &QAction::triggered, this, [this, lang = cb.m_lang, text = cb.m_text]() { - exportDiagramAndCopy(lang, text, "svg"); + exportGraphAndCopy(lang, text, "svg"); }); subMenu->addAction(svgAct); @@ -1733,9 +1733,9 @@ bool VMdEditor::initExportAndCopyMenu(QAction *p_before, return true; } -void VMdEditor::exportDiagramAndCopy(const QString &p_lang, - const QString &p_text, - const QString &p_format) +void VMdEditor::exportGraphAndCopy(const QString &p_lang, + const QString &p_text, + const QString &p_format) { m_exportTempFile.reset(new QTemporaryFile(QDir::tempPath() + QDir::separator() @@ -1752,7 +1752,7 @@ void VMdEditor::exportDiagramAndCopy(const QString &p_lang, return; } - emit m_object->statusMessage(tr("Exporting diagram")); + emit m_object->statusMessage(tr("Exporting graph")); QString filePath(m_exportTempFile->fileName()); QByteArray out; @@ -1767,7 +1767,7 @@ void VMdEditor::exportDiagramAndCopy(const QString &p_lang, if (out.isEmpty() || m_exportTempFile->write(out) == -1) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Fail to export diagram."), + tr("Fail to export graph."), "", QMessageBox::Ok, QMessageBox::Ok, @@ -1782,7 +1782,7 @@ void VMdEditor::exportDiagramAndCopy(const QString &p_lang, img, filePath, QClipboard::Clipboard); - emit m_object->statusMessage(tr("Diagram exported and copied")); + emit m_object->statusMessage(tr("Graph exported and copied")); } else { emit m_object->statusMessage(tr("Fail to read exported image: %1").arg(filePath)); } diff --git a/src/vmdeditor.h b/src/vmdeditor.h index 9235d19f..96299da5 100644 --- a/src/vmdeditor.h +++ b/src/vmdeditor.h @@ -297,9 +297,9 @@ private: void setFontAndPaletteByStyleSheet(const QFont &p_font, const QPalette &p_palette); - void exportDiagramAndCopy(const QString &p_lang, - const QString &p_text, - const QString &p_format); + void exportGraphAndCopy(const QString &p_lang, + const QString &p_text, + const QString &p_format); PegMarkdownHighlighter *m_pegHighlighter;