|
@@ -1274,6 +1274,10 @@ VMarkdownTab::VMarkdownTab(QWidget *p_parent)
|
|
|
QLabel *colorColumnLabel = new QLabel(tr("Color column:"));
|
|
|
colorColumnLabel->setToolTip(m_colorColumnEdit->toolTip());
|
|
|
|
|
|
+ // Code block copy button.
|
|
|
+ m_codeBlockCopyButtonCB = new QCheckBox(tr("Code block copy button"));
|
|
|
+ m_codeBlockCopyButtonCB->setToolTip(tr("Display a copy button at the top right corner of each code block to copy the content in read mode"));
|
|
|
+
|
|
|
// MathJax.
|
|
|
m_mathjaxConfigEdit = new VLineEdit();
|
|
|
m_mathjaxConfigEdit->setToolTip(tr("Location of MathJax JavaScript and its configuration "
|
|
@@ -1371,6 +1375,7 @@ VMarkdownTab::VMarkdownTab(QWidget *p_parent)
|
|
|
mainLayout->addRow(tr("Open mode:"), m_openModeCombo);
|
|
|
mainLayout->addRow(tr("Heading sequence:"), headingSequenceLayout);
|
|
|
mainLayout->addRow(colorColumnLabel, m_colorColumnEdit);
|
|
|
+ mainLayout->addRow(m_codeBlockCopyButtonCB);
|
|
|
mainLayout->addRow(tr("MathJax configuration:"), m_mathjaxConfigEdit);
|
|
|
mainLayout->addRow(tr("PlantUML:"), m_plantUMLModeCombo);
|
|
|
mainLayout->addRow(tr("PlantUML server:"), m_plantUMLServerEdit);
|
|
@@ -1395,6 +1400,10 @@ bool VMarkdownTab::loadConfiguration()
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ if (!loadCodeBlockCopyButton()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
if (!loadMathJax()) {
|
|
|
return false;
|
|
|
}
|
|
@@ -1424,6 +1433,10 @@ bool VMarkdownTab::saveConfiguration()
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ if (!saveCodeBlockCopyButton()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
if (!saveMathJax()) {
|
|
|
return false;
|
|
|
}
|
|
@@ -1507,6 +1520,18 @@ bool VMarkdownTab::saveColorColumn()
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+bool VMarkdownTab::loadCodeBlockCopyButton()
|
|
|
+{
|
|
|
+ m_codeBlockCopyButtonCB->setChecked(g_config->getEnableCodeBlockCopyButton());
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool VMarkdownTab::saveCodeBlockCopyButton()
|
|
|
+{
|
|
|
+ g_config->setEnableCodeBlockCopyButton(m_codeBlockCopyButtonCB->isChecked());
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
bool VMarkdownTab::loadMathJax()
|
|
|
{
|
|
|
m_mathjaxConfigEdit->setText(g_config->getMathjaxJavascript());
|