mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
refine all messages
This commit is contained in:
parent
b879b2c208
commit
238983ed0d
@ -18,7 +18,7 @@ void VDirInfoDialog::setupUI()
|
||||
if (!info.isEmpty()) {
|
||||
infoLabel = new QLabel(info);
|
||||
}
|
||||
nameLabel = new QLabel(tr("&Name:"));
|
||||
nameLabel = new QLabel(tr("Directory &name:"));
|
||||
nameEdit = new QLineEdit(defaultName);
|
||||
nameEdit->selectAll();
|
||||
nameLabel->setBuddy(nameEdit);
|
||||
|
@ -18,7 +18,7 @@ void VFileInfoDialog::setupUI()
|
||||
if (!info.isEmpty()) {
|
||||
infoLabel = new QLabel(info);
|
||||
}
|
||||
nameLabel = new QLabel(tr("&Name:"));
|
||||
nameLabel = new QLabel(tr("Note &name:"));
|
||||
nameEdit = new QLineEdit(defaultName);
|
||||
nameEdit->selectAll();
|
||||
nameLabel->setBuddy(nameEdit);
|
||||
|
@ -90,7 +90,7 @@ QString VInsertImageDialog::getPathInput() const
|
||||
void VInsertImageDialog::handleBrowseBtnClicked()
|
||||
{
|
||||
static QString lastPath = QDir::homePath();
|
||||
QString filePath = QFileDialog::getOpenFileName(this, tr("Select the image to be inserted"),
|
||||
QString filePath = QFileDialog::getOpenFileName(this, tr("Select The Image To Be Inserted"),
|
||||
lastPath, tr("Images (*.png *.xpm *.jpg *.bmp *.gif)"));
|
||||
if (filePath.isNull() || filePath.isEmpty()) {
|
||||
return;
|
||||
|
@ -33,7 +33,7 @@ void VNewNotebookDialog::setupUI()
|
||||
|
||||
importCheck = new QCheckBox(tr("Import existing notebook"), this);
|
||||
importCheck->setChecked(true);
|
||||
importCheck->setToolTip(tr("When checked, VNote won't create a new config file if there already exists one."));
|
||||
importCheck->setToolTip(tr("When checked, VNote won't create a new config file if there already exists one"));
|
||||
|
||||
QGridLayout *topLayout = new QGridLayout();
|
||||
topLayout->addWidget(nameLabel, 0, 0);
|
||||
@ -77,7 +77,7 @@ QString VNewNotebookDialog::getPathInput() const
|
||||
|
||||
void VNewNotebookDialog::handleBrowseBtnClicked()
|
||||
{
|
||||
QString dirPath = QFileDialog::getExistingDirectory(this, tr("Select a directory as the path of the notebook"),
|
||||
QString dirPath = QFileDialog::getExistingDirectory(this, tr("Select A Directory For The Notebook"),
|
||||
QDir::homePath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
pathEdit->setText(dirPath);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ void VSettingsDialog::loadConfiguration()
|
||||
return;
|
||||
err:
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to load configuration."), "",
|
||||
QString("Fail to load configuration."), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, NULL);
|
||||
QMetaObject::invokeMethod(this, "reject", Qt::QueuedConnection);
|
||||
}
|
||||
@ -57,7 +57,7 @@ void VSettingsDialog::saveConfiguration()
|
||||
return;
|
||||
err:
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to save configuration. Please try it again."), "",
|
||||
QString("Fail to save configuration. Please try it again."), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, NULL);
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ const QVector<QString> VGeneralTab::c_availableLangs = { "System", "English", "C
|
||||
VGeneralTab::VGeneralTab(QWidget *p_parent)
|
||||
: QWidget(p_parent), m_langChanged(false)
|
||||
{
|
||||
QLabel *langLabel = new QLabel(tr("Language:"));
|
||||
QLabel *langLabel = new QLabel(tr("&Language:"));
|
||||
m_langCombo = new QComboBox(this);
|
||||
m_langCombo->addItem(tr("System"), "System");
|
||||
auto langs = VUtils::getAvailableLanguages();
|
||||
@ -75,6 +75,7 @@ VGeneralTab::VGeneralTab(QWidget *p_parent)
|
||||
}
|
||||
connect(m_langCombo, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(handleIndexChange(int)));
|
||||
langLabel->setBuddy(m_langCombo);
|
||||
|
||||
QFormLayout *optionLayout = new QFormLayout();
|
||||
optionLayout->addRow(langLabel, m_langCombo);
|
||||
@ -120,7 +121,7 @@ bool VGeneralTab::loadLanguage()
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
qWarning() << "invalid language configuration (use default value)";
|
||||
qWarning() << "invalid language configuration (using default value)";
|
||||
m_langCombo->setCurrentIndex(0);
|
||||
}
|
||||
return true;
|
||||
|
@ -241,7 +241,7 @@ void HGMarkdownHighlighter::parse()
|
||||
parseInternal();
|
||||
|
||||
if (highlightingStyles.isEmpty()) {
|
||||
qWarning() << "error: HighlightingStyles is not set";
|
||||
qWarning() << "HighlightingStyles is not set";
|
||||
return;
|
||||
}
|
||||
initBlockHighlightFromResult(nrBlocks);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QDateTime>
|
||||
|
||||
const QVector<QPair<QString, QString>> VUtils::c_availableLanguages = {QPair<QString, QString>("en_US", "Englisth (US)"),
|
||||
const QVector<QPair<QString, QString>> VUtils::c_availableLanguages = {QPair<QString, QString>("en_US", "Englisth(US)"),
|
||||
QPair<QString, QString>("zh_CN", "Chinese")};
|
||||
|
||||
VUtils::VUtils()
|
||||
@ -21,7 +21,7 @@ QString VUtils::readFileFromDisk(const QString &filePath)
|
||||
{
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qWarning() << "error: fail to read file" << filePath;
|
||||
qWarning() << "fail to read file" << filePath;
|
||||
return QString();
|
||||
}
|
||||
QString fileText(file.readAll());
|
||||
@ -34,7 +34,7 @@ bool VUtils::writeFileToDisk(const QString &filePath, const QString &text)
|
||||
{
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qWarning() << "error: fail to open file" << filePath << "to write to";
|
||||
qWarning() << "fail to open file" << filePath << "to write";
|
||||
return false;
|
||||
}
|
||||
QTextStream stream(&file);
|
||||
@ -62,7 +62,7 @@ QRgb VUtils::QRgbFromString(const QString &str)
|
||||
if (ret) {
|
||||
return qRgb(red, green, blue);
|
||||
}
|
||||
qWarning() << "error: fail to construct QRgb from string" << str;
|
||||
qWarning() << "fail to construct QRgb from string" << str;
|
||||
return QRgb();
|
||||
}
|
||||
|
||||
@ -194,12 +194,12 @@ bool VUtils::copyFile(const QString &p_srcFilePath, const QString &p_destFilePat
|
||||
if (p_isCut) {
|
||||
QFile file(srcPath);
|
||||
if (!file.rename(destPath)) {
|
||||
qWarning() << "error: fail to copy file" << srcPath << destPath;
|
||||
qWarning() << "fail to copy file" << srcPath << destPath;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!QFile::copy(srcPath, destPath)) {
|
||||
qWarning() << "error: fail to copy file" << srcPath << destPath;
|
||||
qWarning() << "fail to copy file" << srcPath << destPath;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -219,7 +219,7 @@ bool VUtils::copyDirectory(const QString &p_srcDirPath, const QString &p_destDir
|
||||
QDir parentDir(VUtils::basePathFromPath(p_destDirPath));
|
||||
QString dirName = VUtils::fileNameFromPath(p_destDirPath);
|
||||
if (!parentDir.mkdir(dirName)) {
|
||||
qWarning() << QString("failed to create target directory %1: already exists").arg(p_destDirPath);
|
||||
qWarning() << QString("fail to create target directory %1: already exists").arg(p_destDirPath);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ bool VUtils::copyDirectory(const QString &p_srcDirPath, const QString &p_destDir
|
||||
// Delete the src dir if p_isCut
|
||||
if (p_isCut) {
|
||||
if (!srcDir.removeRecursively()) {
|
||||
qWarning() << "failed to remove directory" << p_srcDirPath;
|
||||
qWarning() << "fail to remove directory" << p_srcDirPath;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ QJsonObject VConfigManager::readDirectoryConfig(const QString &path)
|
||||
qDebug() << "read config file:" << configFile;
|
||||
QFile config(configFile);
|
||||
if (!config.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "error: fail to read directory configuration file:"
|
||||
qWarning() << "fail to read directory configuration file:"
|
||||
<< configFile;
|
||||
return QJsonObject();
|
||||
}
|
||||
@ -188,7 +188,7 @@ bool VConfigManager::writeDirectoryConfig(const QString &path, const QJsonObject
|
||||
qDebug() << "write config file:" << configFile;
|
||||
QFile config(configFile);
|
||||
if (!config.open(QIODevice::WriteOnly)) {
|
||||
qWarning() << "error: fail to open directory configuration file for write:"
|
||||
qWarning() << "fail to open directory configuration file for write:"
|
||||
<< configFile;
|
||||
return false;
|
||||
}
|
||||
@ -204,7 +204,7 @@ bool VConfigManager::deleteDirectoryConfig(const QString &path)
|
||||
|
||||
QFile config(configFile);
|
||||
if (!config.remove()) {
|
||||
qWarning() << "error: fail to delete directory configuration file:"
|
||||
qWarning() << "fail to delete directory configuration file:"
|
||||
<< configFile;
|
||||
return false;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ VDirectory *VDirectory::createSubDirectory(const QString &p_name)
|
||||
QString path = retrivePath();
|
||||
QDir dir(path);
|
||||
if (!dir.mkdir(p_name)) {
|
||||
qWarning() << "failed to create directory" << p_name << "under" << path;
|
||||
qWarning() << "fail to create directory" << p_name << "under" << path;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ VFile *VDirectory::createFile(const QString &p_name)
|
||||
QString filePath = QDir(path).filePath(p_name);
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
qWarning() << "failed to create file" << p_name;
|
||||
qWarning() << "fail to create file" << p_name;
|
||||
return NULL;
|
||||
}
|
||||
file.close();
|
||||
@ -330,7 +330,7 @@ void VDirectory::deleteSubDirectory(VDirectory *p_subDir)
|
||||
p_subDir->close();
|
||||
QDir dir(dirPath);
|
||||
if (!dir.removeRecursively()) {
|
||||
qWarning() << "failed to remove" << dirPath << "recursively";
|
||||
qWarning() << "fail to remove" << dirPath << "recursively";
|
||||
} else {
|
||||
qDebug() << "deleted" << dirPath;
|
||||
}
|
||||
@ -370,7 +370,7 @@ int VDirectory::removeSubDirectory(VDirectory *p_dir)
|
||||
Q_ASSERT(deleted);
|
||||
dirJson["sub_directories"] = subDirArray;
|
||||
if (!VConfigManager::writeDirectoryConfig(path, dirJson)) {
|
||||
qWarning() << "failed to update configuration in" << path;
|
||||
qWarning() << "fail to update configuration in" << path;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
@ -409,7 +409,7 @@ int VDirectory::removeFile(VFile *p_file)
|
||||
Q_ASSERT(deleted);
|
||||
dirJson["files"] = subFileArray;
|
||||
if (!VConfigManager::writeDirectoryConfig(path, dirJson)) {
|
||||
qWarning() << "failed to update configuration in" << path;
|
||||
qWarning() << "fail to update configuration in" << path;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
@ -435,7 +435,7 @@ bool VDirectory::rename(const QString &p_name)
|
||||
QDir dir(parentPath);
|
||||
QString name = m_name;
|
||||
if (!dir.rename(m_name, p_name)) {
|
||||
qWarning() << "failed to rename directory" << m_name << "to" << p_name;
|
||||
qWarning() << "fail to rename directory" << m_name << "to" << p_name;
|
||||
return false;
|
||||
}
|
||||
m_name = p_name;
|
||||
@ -522,8 +522,8 @@ VFile *VDirectory::copyFile(VDirectory *p_destDir, const QString &p_destName,
|
||||
nrPasted++;
|
||||
} else {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to copy image %1.").arg(images[i]),
|
||||
tr("Please check if there already exists a file with the same name and manually copy it."),
|
||||
QString("Fail to copy image %1.").arg(images[i]),
|
||||
tr("Please check if there already exists a file with the same name and then manually copy it."),
|
||||
QMessageBox::Ok, QMessageBox::Ok, NULL);
|
||||
}
|
||||
}
|
||||
@ -591,7 +591,7 @@ void VDirectory::reorderFiles(int p_first, int p_last, int p_destStart)
|
||||
Q_ASSERT(p_destStart >= 0 && p_destStart <= m_files.size());
|
||||
|
||||
if (!reorderFilesInConfig(p_first, p_last, p_destStart)) {
|
||||
qWarning() << "failed to reorder files in config" << p_first << p_last << p_destStart;
|
||||
qWarning() << "fail to reorder files in config" << p_first << p_last << p_destStart;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ void VDirectoryTree::initActions()
|
||||
|
||||
pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"),
|
||||
tr("&Paste"), this);
|
||||
pasteAct->setStatusTip(tr("Paste directories"));
|
||||
pasteAct->setStatusTip(tr("Paste directories under this directory"));
|
||||
connect(pasteAct, &QAction::triggered,
|
||||
this, &VDirectoryTree::pasteDirectoriesInCurDir);
|
||||
}
|
||||
@ -91,7 +91,7 @@ void VDirectoryTree::setNotebook(VNotebook *p_notebook)
|
||||
}
|
||||
if (!m_notebook->open()) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to open notebook %1").arg(m_notebook->getName()), "",
|
||||
QString("Fail to open notebook %1.").arg(m_notebook->getName()), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
clear();
|
||||
return;
|
||||
@ -134,7 +134,7 @@ void VDirectoryTree::updateDirectoryTreeOne(QTreeWidgetItem *p_parent, int depth
|
||||
VDirectory *dir = getVDirectory(p_parent);
|
||||
if (!dir->open()) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to open directory %1").arg(dir->getName()), "",
|
||||
QString("Fail to open directory %1.").arg(dir->getName()), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
return;
|
||||
}
|
||||
@ -296,7 +296,7 @@ void VDirectoryTree::newSubDirectory()
|
||||
VDirectory *curDir = getVDirectory(curItem);
|
||||
|
||||
QString info = QString("Create sub-directory under %1.").arg(curDir->getName());
|
||||
QString text("&Directory name:");
|
||||
QString text("Directory &name:");
|
||||
QString defaultText("new_directory");
|
||||
|
||||
do {
|
||||
@ -311,7 +311,7 @@ void VDirectoryTree::newSubDirectory()
|
||||
VDirectory *subDir = curDir->createSubDirectory(name);
|
||||
if (!subDir) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to create directory %1.").arg(name), "",
|
||||
QString("Fail to create directory %1.").arg(name), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
return;
|
||||
}
|
||||
@ -328,7 +328,7 @@ void VDirectoryTree::newRootDirectory()
|
||||
return;
|
||||
}
|
||||
QString info = QString("Create root directory in notebook %1.").arg(m_notebook->getName());
|
||||
QString text("&Directory name:");
|
||||
QString text("Directory &name:");
|
||||
QString defaultText("new_directory");
|
||||
VDirectory *rootDir = m_notebook->getRootDir();
|
||||
do {
|
||||
@ -343,7 +343,7 @@ void VDirectoryTree::newRootDirectory()
|
||||
VDirectory *subDir = rootDir->createSubDirectory(name);
|
||||
if (!subDir) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to create directory %1.").arg(name), "",
|
||||
QString("Fail to create directory %1.").arg(name), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
return;
|
||||
}
|
||||
@ -410,7 +410,7 @@ void VDirectoryTree::editDirectoryInfo()
|
||||
}
|
||||
if (!curDir->rename(name)) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to rename directory %1.").arg(curName), "",
|
||||
QString("Fail to rename directory %1.").arg(curName), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
return;
|
||||
}
|
||||
@ -552,8 +552,8 @@ bool VDirectoryTree::copyDirectory(VDirectory *p_destDir, const QString &p_destN
|
||||
emit directoryUpdated(destDir);
|
||||
} else {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to copy directory %1.").arg(srcName),
|
||||
QString("Please check if there alread exists a directory with the same name"),
|
||||
QString("Fail to copy directory %1.").arg(srcName),
|
||||
QString("Please check if there alread exists a directory with the same name."),
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ void VEditTab::setupUI()
|
||||
webPreviewer = NULL;
|
||||
break;
|
||||
default:
|
||||
qWarning() << "error: unknown doc type" << int(m_file->getDocType());
|
||||
qWarning() << "unknown doc type" << int(m_file->getDocType());
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
}
|
||||
@ -119,7 +119,7 @@ void VEditTab::showFileReadMode()
|
||||
scrollPreviewToHeader(outlineIndex);
|
||||
break;
|
||||
default:
|
||||
qWarning() << "error: unknown doc type" << int(m_file->getDocType());
|
||||
qWarning() << "unknown doc type" << int(m_file->getDocType());
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
noticeStatusChanged();
|
||||
@ -221,7 +221,7 @@ void VEditTab::readFile()
|
||||
// Nothing to do if user cancel this action
|
||||
return;
|
||||
default:
|
||||
qWarning() << "error: wrong return value from QMessageBox:" << ret;
|
||||
qWarning() << "wrong return value from QMessageBox:" << ret;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -240,7 +240,7 @@ bool VEditTab::saveFile()
|
||||
QString filePath = m_file->retrivePath();
|
||||
if (!QFile(filePath).exists()) {
|
||||
qWarning() << filePath << "being written has been removed";
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to save note"),
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to save note."),
|
||||
QString("%1 being written has been removed.").arg(filePath),
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
return false;
|
||||
@ -248,7 +248,7 @@ bool VEditTab::saveFile()
|
||||
m_textEditor->saveFile();
|
||||
ret = m_file->save();
|
||||
if (!ret) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to save note"),
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to save note."),
|
||||
QString("Fail to write to disk when saving a note. Please try it again."),
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
m_textEditor->setModified(true);
|
||||
@ -312,11 +312,11 @@ void VEditTab::updateTocFromHtml(const QString &tocHtml)
|
||||
if (xml.name() == "ul") {
|
||||
parseTocUl(xml, headers, 1);
|
||||
} else {
|
||||
qWarning() << "error: TOC HTML does not start with <ul>";
|
||||
qWarning() << "TOC HTML does not start with <ul>";
|
||||
}
|
||||
}
|
||||
if (xml.hasError()) {
|
||||
qWarning() << "error: fail to parse TOC in HTML";
|
||||
qWarning() << "fail to parse TOC in HTML";
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -348,7 +348,7 @@ void VEditTab::parseTocUl(QXmlStreamReader &xml, QVector<VHeader> &headers, int
|
||||
if (xml.name() == "li") {
|
||||
parseTocLi(xml, headers, level);
|
||||
} else {
|
||||
qWarning() << "error: TOC HTML <ul> should contain <li>" << xml.name();
|
||||
qWarning() << "TOC HTML <ul> should contain <li>" << xml.name();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -366,7 +366,7 @@ void VEditTab::parseTocLi(QXmlStreamReader &xml, QVector<VHeader> &headers, int
|
||||
if (xml.tokenString() == "Characters") {
|
||||
name = xml.text().toString();
|
||||
} else if (!xml.isEndElement()) {
|
||||
qWarning() << "error: TOC HTML <a> should be ended by </a>" << xml.name();
|
||||
qWarning() << "TOC HTML <a> should be ended by </a>" << xml.name();
|
||||
return;
|
||||
}
|
||||
VHeader header(level, name, anchor, -1);
|
||||
@ -381,7 +381,7 @@ void VEditTab::parseTocLi(QXmlStreamReader &xml, QVector<VHeader> &headers, int
|
||||
headers.append(header);
|
||||
parseTocUl(xml, headers, level + 1);
|
||||
} else {
|
||||
qWarning() << "error: TOC HTML <li> should contain <a> or <ul>" << xml.name();
|
||||
qWarning() << "TOC HTML <li> should contain <a> or <ul>" << xml.name();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ VEditWindow::VEditWindow(VNote *vnote, VEditArea *editArea, QWidget *parent)
|
||||
void VEditWindow::initTabActions()
|
||||
{
|
||||
m_locateAct = new QAction(QIcon(":/resources/icons/locate_note.svg"),
|
||||
tr("Locate"), this);
|
||||
tr("Locate To Directory"), this);
|
||||
m_locateAct->setStatusTip(tr("Locate the directory of current note"));
|
||||
connect(m_locateAct, &QAction::triggered,
|
||||
this, &VEditWindow::handleLocateAct);
|
||||
|
@ -52,7 +52,7 @@ void VFile::deleteDiskFile()
|
||||
if (file.remove()) {
|
||||
qDebug() << "deleted" << filePath;
|
||||
} else {
|
||||
qWarning() << "failed to delete" << filePath;
|
||||
qWarning() << "fail to delete" << filePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void VFileList::initActions()
|
||||
|
||||
pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"),
|
||||
tr("&Paste"), this);
|
||||
pasteAct->setStatusTip(tr("Paste notes"));
|
||||
pasteAct->setStatusTip(tr("Paste notes in current directory"));
|
||||
connect(pasteAct, &QAction::triggered,
|
||||
this, &VFileList::pasteFilesInCurDir);
|
||||
}
|
||||
@ -188,7 +188,7 @@ void VFileList::newFile()
|
||||
VFile *file = m_directory->createFile(name);
|
||||
if (!file) {
|
||||
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
|
||||
QString("Failed to create file %1.").arg(name), "",
|
||||
QString("Fail to create note %1.").arg(name), "",
|
||||
QMessageBox::Ok, QMessageBox::Ok, this);
|
||||
return;
|
||||
}
|
||||
|
@ -141,13 +141,13 @@ void VMainWindow::initViewToolBar()
|
||||
|
||||
QAction *onePanelViewAct = new QAction(QIcon(":/resources/icons/one_panel.svg"),
|
||||
tr("&Single Panel"), this);
|
||||
onePanelViewAct->setStatusTip(tr("Display only the note panel"));
|
||||
onePanelViewAct->setStatusTip(tr("Display only the note list panel"));
|
||||
connect(onePanelViewAct, &QAction::triggered,
|
||||
this, &VMainWindow::onePanelView);
|
||||
|
||||
QAction *twoPanelViewAct = new QAction(QIcon(":/resources/icons/two_panels.svg"),
|
||||
tr("&Two Panels"), this);
|
||||
twoPanelViewAct->setStatusTip(tr("Display both the directory and note panel"));
|
||||
twoPanelViewAct->setStatusTip(tr("Display both the directory and note list panel"));
|
||||
connect(twoPanelViewAct, &QAction::triggered,
|
||||
this, &VMainWindow::twoPanelView);
|
||||
|
||||
@ -188,7 +188,7 @@ void VMainWindow::initFileToolBar()
|
||||
|
||||
noteInfoAct = new QAction(QIcon(":/resources/icons/note_info_tb.svg"),
|
||||
tr("Note &Info"), this);
|
||||
noteInfoAct->setStatusTip(tr("View and edit info of current note"));
|
||||
noteInfoAct->setStatusTip(tr("View and edit the information of current note"));
|
||||
connect(noteInfoAct, &QAction::triggered,
|
||||
this, &VMainWindow::curEditFileInfo);
|
||||
|
||||
@ -225,7 +225,7 @@ void VMainWindow::initFileToolBar()
|
||||
|
||||
saveNoteAct = new QAction(QIcon(":/resources/icons/save_note.svg"),
|
||||
tr("Save"), this);
|
||||
saveNoteAct->setStatusTip(tr("Save changes of current note"));
|
||||
saveNoteAct->setStatusTip(tr("Save changes to current note"));
|
||||
saveNoteAct->setShortcut(QKeySequence::Save);
|
||||
connect(saveNoteAct, &QAction::triggered,
|
||||
editArea, &VEditArea::saveFile);
|
||||
@ -340,7 +340,7 @@ void VMainWindow::initEditMenu()
|
||||
// Insert image.
|
||||
m_insertImageAct = new QAction(QIcon(":/resources/icons/insert_image.svg"),
|
||||
tr("Insert &Image"), this);
|
||||
m_insertImageAct->setStatusTip(tr("Insert an image from file in current note"));
|
||||
m_insertImageAct->setStatusTip(tr("Insert an image from file into current note"));
|
||||
connect(m_insertImageAct, &QAction::triggered,
|
||||
this, &VMainWindow::insertImage);
|
||||
|
||||
@ -418,8 +418,8 @@ void VMainWindow::initEditMenu()
|
||||
this, &VMainWindow::changeHighlightCursorLine);
|
||||
|
||||
// Highlight selected word.
|
||||
QAction *selectedWordAct = new QAction(tr("Highlight Selected Word"), this);
|
||||
selectedWordAct->setStatusTip(tr("Highlight all occurences of selected word"));
|
||||
QAction *selectedWordAct = new QAction(tr("Highlight Selected Words"), this);
|
||||
selectedWordAct->setStatusTip(tr("Highlight all occurences of selected words"));
|
||||
selectedWordAct->setCheckable(true);
|
||||
connect(selectedWordAct, &QAction::triggered,
|
||||
this, &VMainWindow::changeHighlightSelectedWord);
|
||||
@ -544,7 +544,7 @@ void VMainWindow::importNoteFromFile()
|
||||
.arg(files.size() - failedFiles.size()).arg(failedFiles.size()),
|
||||
QMessageBox::Ok, this);
|
||||
if (!failedFiles.isEmpty()) {
|
||||
msgBox.setInformativeText(tr("Failed to import files maybe due to name conflicts."));
|
||||
msgBox.setInformativeText(tr("Fail to import files maybe due to name conflicts."));
|
||||
}
|
||||
msgBox.exec();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "vmarkdownconverter.h"
|
||||
|
||||
VMarkdownConverter::VMarkdownConverter()
|
||||
VMarkdownConverter::VMarkdownConverter()
|
||||
{
|
||||
hoedownHtmlFlags = (hoedown_html_flags)0;
|
||||
nestingLevel = 16;
|
||||
|
@ -57,7 +57,7 @@ void VMdEditOperations::insertImageFromQImage(const QString &title, const QStrin
|
||||
VUtils::makeDirectory(path);
|
||||
bool ret = image.save(filePath);
|
||||
if (!ret) {
|
||||
QMessageBox msgBox(QMessageBox::Warning, tr("Warning"), QString("Fail to save image %1").arg(filePath),
|
||||
QMessageBox msgBox(QMessageBox::Warning, tr("Warning"), QString("Fail to save image %1.").arg(filePath),
|
||||
QMessageBox::Ok, (QWidget *)m_editor);
|
||||
msgBox.exec();
|
||||
return;
|
||||
@ -81,8 +81,8 @@ void VMdEditOperations::insertImageFromPath(const QString &title,
|
||||
VUtils::makeDirectory(path);
|
||||
bool ret = QFile::copy(oriImagePath, filePath);
|
||||
if (!ret) {
|
||||
qWarning() << "error: fail to copy" << oriImagePath << "to" << filePath;
|
||||
QMessageBox msgBox(QMessageBox::Warning, tr("Warning"), QString("Fail to save image %1").arg(filePath),
|
||||
qWarning() << "fail to copy" << oriImagePath << "to" << filePath;
|
||||
QMessageBox msgBox(QMessageBox::Warning, tr("Warning"), QString("Fail to save image %1.").arg(filePath),
|
||||
QMessageBox::Ok, (QWidget *)m_editor);
|
||||
msgBox.exec();
|
||||
return;
|
||||
@ -109,7 +109,7 @@ bool VMdEditOperations::insertImageFromURL(const QUrl &imageUrl)
|
||||
image = QImage(imagePath);
|
||||
|
||||
if (image.isNull()) {
|
||||
qWarning() << "error: image is null";
|
||||
qWarning() << "image is null";
|
||||
return false;
|
||||
}
|
||||
title = "Insert Image From File";
|
||||
|
@ -72,7 +72,7 @@ void VNotebook::deleteNotebook(VNotebook *p_notebook)
|
||||
|
||||
QDir dir(path);
|
||||
if (!dir.removeRecursively()) {
|
||||
qWarning() << "failed to delete" << path;
|
||||
qWarning() << "fail to delete" << path;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ void VNotebookSelector::initActions()
|
||||
|
||||
m_notebookInfoAct = new QAction(QIcon(":/resources/icons/notebook_info.svg"),
|
||||
tr("&Info"));
|
||||
m_notebookInfoAct->setStatusTip(tr("View and edit current notebook's information"));
|
||||
m_notebookInfoAct->setStatusTip(tr("View and edit information of current notebook"));
|
||||
connect(m_notebookInfoAct, SIGNAL(triggered(bool)),
|
||||
this, SLOT(editNotebookInfo()));
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ bool VSingleInstanceGuard::tryRun()
|
||||
{
|
||||
// If we can attach to the sharedmemory, there is another instance running.
|
||||
if (tryAttach()) {
|
||||
qDebug() << "Another instance is running";
|
||||
qDebug() << "another instance is running";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -62,11 +62,11 @@ bool VSingleInstanceGuard::tryRun()
|
||||
} else {
|
||||
// Maybe another thread create it
|
||||
if (tryAttach()) {
|
||||
qDebug() << "Another instance is running";
|
||||
qDebug() << "another instance is running";
|
||||
return false;
|
||||
} else {
|
||||
// Something wrong here
|
||||
qWarning() << "error: failed to create or attach shared memory segment";
|
||||
qWarning() << "fail to create or attach shared memory segment";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ QBrush VStyleParser::QBrushFromPmhAttr(pmh_attr_argb_color *attr) const
|
||||
void markdownStyleErrorCB(char *errMsg, int lineNr, void *context)
|
||||
{
|
||||
(void)context;
|
||||
qDebug() << "parser error:" << errMsg << lineNr;
|
||||
qWarning() << "parser error:" << errMsg << lineNr;
|
||||
}
|
||||
|
||||
QTextCharFormat VStyleParser::QTextCharFormatFromAttrs(pmh_style_attribute *attrs,
|
||||
@ -96,7 +96,7 @@ QTextCharFormat VStyleParser::QTextCharFormatFromAttrs(pmh_style_attribute *attr
|
||||
}
|
||||
|
||||
default:
|
||||
qWarning() << "warning: unimplemented format attr type:" << attrs->type;
|
||||
qWarning() << "unimplemented format attr type:" << attrs->type;
|
||||
break;
|
||||
}
|
||||
attrs = attrs->next;
|
||||
@ -157,7 +157,7 @@ void VStyleParser::fetchMarkdownEditorStyles(QPalette &palette, QFont &font) con
|
||||
}
|
||||
|
||||
default:
|
||||
qWarning() << "warning: unimplemented editor attr type:" << editorStyles->type;
|
||||
qWarning() << "unimplemented editor attr type:" << editorStyles->type;
|
||||
}
|
||||
editorStyles = editorStyles->next;
|
||||
}
|
||||
@ -165,7 +165,7 @@ void VStyleParser::fetchMarkdownEditorStyles(QPalette &palette, QFont &font) con
|
||||
// editor-current-line
|
||||
pmh_style_attribute *curLineStyles = markdownStyles->editor_current_line_styles;
|
||||
if (curLineStyles) {
|
||||
qDebug() << "editor-current-line style is not supported";
|
||||
qWarning() << "editor-current-line style is not supported";
|
||||
}
|
||||
|
||||
// editor-selection
|
||||
@ -183,7 +183,7 @@ void VStyleParser::fetchMarkdownEditorStyles(QPalette &palette, QFont &font) con
|
||||
break;
|
||||
|
||||
default:
|
||||
qWarning() << "warning: unimplemented selection attr type:" << selStyles->type;
|
||||
qWarning() << "unimplemented selection attr type:" << selStyles->type;
|
||||
}
|
||||
selStyles = selStyles->next;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user