refactor messages

Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
Le Tan 2017-01-01 17:00:38 +08:00
parent 9b6afa013d
commit d416cf6eda
3 changed files with 14 additions and 14 deletions

View File

@ -29,12 +29,12 @@ VDirectoryTree::VDirectoryTree(VNote *vnote, QWidget *parent)
void VDirectoryTree::initActions() void VDirectoryTree::initActions()
{ {
newRootDirAct = new QAction(QIcon(":/resources/icons/create_rootdir.svg"), newRootDirAct = new QAction(QIcon(":/resources/icons/create_rootdir.svg"),
tr("New &root directory"), this); tr("New &Root Directory"), this);
newRootDirAct->setStatusTip(tr("Create a new root directory in current notebook")); newRootDirAct->setStatusTip(tr("Create a new root directory in current notebook"));
connect(newRootDirAct, &QAction::triggered, connect(newRootDirAct, &QAction::triggered,
this, &VDirectoryTree::newRootDirectory); this, &VDirectoryTree::newRootDirectory);
newSubDirAct = new QAction(tr("&New sub-directory"), this); newSubDirAct = new QAction(tr("&New Sub-Directory"), this);
newSubDirAct->setStatusTip(tr("Create a new sub-directory")); newSubDirAct->setStatusTip(tr("Create a new sub-directory"));
connect(newSubDirAct, &QAction::triggered, connect(newSubDirAct, &QAction::triggered,
this, &VDirectoryTree::newSubDirectory); this, &VDirectoryTree::newSubDirectory);
@ -298,11 +298,11 @@ void VDirectoryTree::newSubDirectory()
QString defaultText("new_directory"); QString defaultText("new_directory");
do { do {
VNewDirDialog dialog(tr("Create directory"), info, text, defaultText, this); VNewDirDialog dialog(tr("Create Directory"), info, text, defaultText, this);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
QString name = dialog.getNameInput(); QString name = dialog.getNameInput();
if (curDir->findSubDirectory(name)) { if (curDir->findSubDirectory(name)) {
info = QString("Name already exists under %1.\nPlease choose another name.").arg(curDir->getName()); info = QString("Name already exists under %1. Please choose another name.").arg(curDir->getName());
defaultText = name; defaultText = name;
continue; continue;
} }
@ -329,11 +329,11 @@ void VDirectoryTree::newRootDirectory()
QString defaultText("new_directory"); QString defaultText("new_directory");
VDirectory *rootDir = m_notebook->getRootDir(); VDirectory *rootDir = m_notebook->getRootDir();
do { do {
VNewDirDialog dialog(tr("Create root directory"), info, text, defaultText, this); VNewDirDialog dialog(tr("Create Root Directory"), info, text, defaultText, this);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
QString name = dialog.getNameInput(); QString name = dialog.getNameInput();
if (rootDir->findSubDirectory(name)) { if (rootDir->findSubDirectory(name)) {
info = QString("Name already exists in notebook %1.\nPlease choose another name.").arg(m_notebook->getName()); info = QString("Name already exists in notebook %1. Please choose another name.").arg(m_notebook->getName());
defaultText = name; defaultText = name;
continue; continue;
} }
@ -400,7 +400,7 @@ void VDirectoryTree::editDirectoryInfo()
return; return;
} }
if (parentDir->findSubDirectory(name)) { if (parentDir->findSubDirectory(name)) {
info = "Name already exists.\nPlease choose another name."; info = "Name already exists. Please choose another name.";
defaultName = name; defaultName = name;
continue; continue;
} }

View File

@ -41,8 +41,8 @@ void VFileList::setupUI()
void VFileList::initActions() void VFileList::initActions()
{ {
newFileAct = new QAction(QIcon(":/resources/icons/create_note.svg"), newFileAct = new QAction(QIcon(":/resources/icons/create_note.svg"),
tr("&New note"), this); tr("&New Note"), this);
newFileAct->setStatusTip(tr("Create a new note in current directory")); newFileAct->setStatusTip(tr("Create a note in current directory"));
connect(newFileAct, SIGNAL(triggered(bool)), connect(newFileAct, SIGNAL(triggered(bool)),
this, SLOT(newFile())); this, SLOT(newFile()));
@ -129,7 +129,7 @@ void VFileList::fileInfo(VFile *p_file)
return; return;
} }
if (dir->findFile(name)) { if (dir->findFile(name)) {
info = "Name already exists.\nPlease choose another name."; info = "Name already exists. Please choose another name.";
defaultName = name; defaultName = name;
continue; continue;
} }
@ -171,15 +171,15 @@ void VFileList::newFile()
if (!m_directory) { if (!m_directory) {
return; return;
} }
QString info = QString("Create a new note under %1.").arg(m_directory->getName()); QString info = QString("Create a note under %1.").arg(m_directory->getName());
QString text("&Note name:"); QString text("&Note name:");
QString defaultText("new_note"); QString defaultText("new_note");
do { do {
VNewFileDialog dialog(QString("Create new note"), info, text, defaultText, this); VNewFileDialog dialog(QString("Create Note"), info, text, defaultText, this);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
QString name = dialog.getNameInput(); QString name = dialog.getNameInput();
if (m_directory->findFile(name)) { if (m_directory->findFile(name)) {
info = "Name already exists.\nPlease choose another name."; info = "Name already exists. Please choose another name.";
defaultText = name; defaultText = name;
continue; continue;
} }

View File

@ -261,7 +261,7 @@ void VNotebookSelector::editNotebookInfo()
QString defaultPath = notebook->getPath(); QString defaultPath = notebook->getPath();
QString defaultName(curName); QString defaultName(curName);
do { do {
VNotebookInfoDialog dialog(tr("Notebook information"), info, defaultName, VNotebookInfoDialog dialog(tr("Notebook Information"), info, defaultName,
defaultPath, this); defaultPath, this);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
QString name = dialog.getNameInput(); QString name = dialog.getNameInput();