From c8ec95eb3d62558b48844573edeed36522854937 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 24 May 2017 22:15:35 +0800 Subject: [PATCH] refine English names of notebooks, folders --- src/dialog/vdirinfodialog.cpp | 2 +- src/dialog/vnewdirdialog.cpp | 1 + src/vdirectorytree.cpp | 58 +++++++++++++++++------------------ src/vfilelist.cpp | 8 ++--- src/vmainwindow.cpp | 16 +++++----- 5 files changed, 43 insertions(+), 42 deletions(-) diff --git a/src/dialog/vdirinfodialog.cpp b/src/dialog/vdirinfodialog.cpp index 87d2687f..a93d3d6d 100644 --- a/src/dialog/vdirinfodialog.cpp +++ b/src/dialog/vdirinfodialog.cpp @@ -18,7 +18,7 @@ void VDirInfoDialog::setupUI() if (!info.isEmpty()) { infoLabel = new QLabel(info); } - nameLabel = new QLabel(tr("Directory &name:")); + nameLabel = new QLabel(tr("Folder &name:")); nameEdit = new QLineEdit(defaultName); nameEdit->selectAll(); nameLabel->setBuddy(nameEdit); diff --git a/src/dialog/vnewdirdialog.cpp b/src/dialog/vnewdirdialog.cpp index 39686939..89d57f70 100644 --- a/src/dialog/vnewdirdialog.cpp +++ b/src/dialog/vnewdirdialog.cpp @@ -15,6 +15,7 @@ void VNewDirDialog::setupUI() QLabel *infoLabel = NULL; if (!info.isEmpty()) { infoLabel = new QLabel(info); + infoLabel->setWordWrap(true); } nameLabel = new QLabel(name); diff --git a/src/vdirectorytree.cpp b/src/vdirectorytree.cpp index 765c14f0..a14d0c1e 100644 --- a/src/vdirectorytree.cpp +++ b/src/vdirectorytree.cpp @@ -34,48 +34,48 @@ VDirectoryTree::VDirectoryTree(VNote *vnote, QWidget *parent) void VDirectoryTree::initActions() { newRootDirAct = new QAction(QIcon(":/resources/icons/create_rootdir.svg"), - tr("New &Root Directory"), this); - newRootDirAct->setToolTip(tr("Create a new root directory in current notebook")); + tr("New &Root Folder"), this); + newRootDirAct->setToolTip(tr("Create a new root folder in current notebook")); connect(newRootDirAct, &QAction::triggered, this, &VDirectoryTree::newRootDirectory); - newSubDirAct = new QAction(tr("&New Sub-Directory"), this); - newSubDirAct->setToolTip(tr("Create a new sub-directory")); + newSubDirAct = new QAction(tr("&New Subfolder"), this); + newSubDirAct->setToolTip(tr("Create a new subfolder")); connect(newSubDirAct, &QAction::triggered, this, &VDirectoryTree::newSubDirectory); deleteDirAct = new QAction(QIcon(":/resources/icons/delete_dir.svg"), tr("&Delete"), this); - deleteDirAct->setToolTip(tr("Delete selected directory")); + deleteDirAct->setToolTip(tr("Delete selected folder")); connect(deleteDirAct, &QAction::triggered, this, &VDirectoryTree::deleteDirectory); dirInfoAct = new QAction(QIcon(":/resources/icons/dir_info.svg"), tr("&Info"), this); - dirInfoAct->setToolTip(tr("View and edit current directory's information")); + dirInfoAct->setToolTip(tr("View and edit current folder's information")); connect(dirInfoAct, &QAction::triggered, this, &VDirectoryTree::editDirectoryInfo); copyAct = new QAction(QIcon(":/resources/icons/copy.svg"), tr("&Copy"), this); - copyAct->setToolTip(tr("Copy selected directories")); + copyAct->setToolTip(tr("Copy selected folders")); connect(copyAct, &QAction::triggered, this, &VDirectoryTree::copySelectedDirectories); cutAct = new QAction(QIcon(":/resources/icons/cut.svg"), tr("C&ut"), this); - cutAct->setToolTip(tr("Cut selected directories")); + cutAct->setToolTip(tr("Cut selected folders")); connect(cutAct, &QAction::triggered, this, &VDirectoryTree::cutSelectedDirectories); pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"), tr("&Paste"), this); - pasteAct->setToolTip(tr("Paste directories under this directory")); + pasteAct->setToolTip(tr("Paste folders in this folder")); connect(pasteAct, &QAction::triggered, this, &VDirectoryTree::pasteDirectoriesInCurDir); - m_openLocationAct = new QAction(tr("&Open Directory Location"), this); - m_openLocationAct->setToolTip(tr("Open the folder containing this directory in operating system")); + m_openLocationAct = new QAction(tr("&Open Folder Location"), this); + m_openLocationAct->setToolTip(tr("Open the folder containing this folder in operating system")); connect(m_openLocationAct, &QAction::triggered, this, &VDirectoryTree::openDirectoryLocation); } @@ -164,7 +164,7 @@ void VDirectoryTree::updateDirectoryTreeOne(QTreeWidgetItem *p_parent, int depth VDirectory *dir = getVDirectory(p_parent); if (!dir->open()) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Fail to open directory %2.") + tr("Fail to open folder %2.") .arg(vconfig.c_dataTextStyle).arg(dir->getName()), "", QMessageBox::Ok, QMessageBox::Ok, this); return; @@ -328,17 +328,17 @@ void VDirectoryTree::newSubDirectory() } VDirectory *curDir = getVDirectory(curItem); - QString info = tr("Create sub-directory under %2.") + QString info = tr("Create a subfolder in %2.") .arg(vconfig.c_dataTextStyle).arg(curDir->getName()); - QString text(tr("Directory &name:")); - QString defaultText("new_directory"); + QString text(tr("Folder &name:")); + QString defaultText("new_folder"); do { - VNewDirDialog dialog(tr("Create Directory"), info, text, defaultText, this); + VNewDirDialog dialog(tr("Create Folder"), info, text, defaultText, this); if (dialog.exec() == QDialog::Accepted) { QString name = dialog.getNameInput(); if (curDir->findSubDirectory(name)) { - info = tr("Name already exists under %2. Please choose another name.") + info = tr("Name already exists in %2. Please choose another name.") .arg(vconfig.c_dataTextStyle).arg(curDir->getName()); defaultText = name; continue; @@ -346,7 +346,7 @@ void VDirectoryTree::newSubDirectory() VDirectory *subDir = curDir->createSubDirectory(name); if (!subDir) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Fail to create directory %2.") + tr("Fail to create folder %2.") .arg(vconfig.c_dataTextStyle).arg(name), "", QMessageBox::Ok, QMessageBox::Ok, this); return; @@ -363,13 +363,13 @@ void VDirectoryTree::newRootDirectory() if (!m_notebook) { return; } - QString info = tr("Create root directory in notebook %2.") + QString info = tr("Create a root folder in notebook %2.") .arg(vconfig.c_dataTextStyle).arg(m_notebook->getName()); - QString text(tr("Directory &name:")); - QString defaultText("new_directory"); + QString text(tr("Folder &name:")); + QString defaultText("new_folder"); VDirectory *rootDir = m_notebook->getRootDir(); do { - VNewDirDialog dialog(tr("Create Root Directory"), info, text, defaultText, this); + VNewDirDialog dialog(tr("Create Root Folder"), info, text, defaultText, this); if (dialog.exec() == QDialog::Accepted) { QString name = dialog.getNameInput(); if (rootDir->findSubDirectory(name)) { @@ -381,7 +381,7 @@ void VDirectoryTree::newRootDirectory() VDirectory *subDir = rootDir->createSubDirectory(name); if (!subDir) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Fail to create directory %2.") + tr("Fail to create folder %2.") .arg(vconfig.c_dataTextStyle).arg(name), "", QMessageBox::Ok, QMessageBox::Ok, this); return; @@ -401,7 +401,7 @@ void VDirectoryTree::deleteDirectory() } VDirectory *curDir = getVDirectory(curItem); int ret = VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Are you sure to delete directory %2?") + tr("Are you sure to delete folder %2?") .arg(vconfig.c_dataTextStyle).arg(curDir->getName()), tr("WARNING: " "VNote will delete the whole directory (ANY files) " @@ -445,7 +445,7 @@ void VDirectoryTree::editDirectoryInfo() QString defaultName = curName; do { - VDirInfoDialog dialog(tr("Directory Information"), info, defaultName, this); + VDirInfoDialog dialog(tr("Folder Information"), info, defaultName, this); if (dialog.exec() == QDialog::Accepted) { QString name = dialog.getNameInput(); if (name == curName) { @@ -458,7 +458,7 @@ void VDirectoryTree::editDirectoryInfo() } if (!curDir->rename(name)) { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Fail to rename directory %2.") + tr("Fail to rename folder %2.") .arg(vconfig.c_dataTextStyle).arg(curName), "", QMessageBox::Ok, QMessageBox::Ok, this); return; @@ -645,9 +645,9 @@ bool VDirectoryTree::copyDirectory(VDirectory *p_destDir, const QString &p_destN emit directoryUpdated(destDir); } else { VUtils::showMessage(QMessageBox::Warning, tr("Warning"), - tr("Fail to copy directory %2.") + tr("Fail to copy folder %2.") .arg(vconfig.c_dataTextStyle).arg(srcName), - tr("Please check if there already exists a directory with the same name."), + tr("Please check if there already exists a folder with the same name."), QMessageBox::Ok, QMessageBox::Ok, this); } @@ -693,7 +693,7 @@ QTreeWidgetItem *VDirectoryTree::findVDirectory(const VDirectory *p_dir, bool &p bool VDirectoryTree::locateDirectory(const VDirectory *p_directory) { if (p_directory) { - qDebug() << "locate directory" << p_directory->retrivePath() + qDebug() << "locate folder" << p_directory->retrivePath() << "in" << m_notebook->getName(); if (p_directory->getNotebook() != m_notebook) { return false; diff --git a/src/vfilelist.cpp b/src/vfilelist.cpp index 31238f24..6031f960 100644 --- a/src/vfilelist.cpp +++ b/src/vfilelist.cpp @@ -47,7 +47,7 @@ void VFileList::initActions() { newFileAct = new QAction(QIcon(":/resources/icons/create_note.svg"), tr("&New Note"), this); - newFileAct->setToolTip(tr("Create a note in current directory")); + newFileAct->setToolTip(tr("Create a note in current folder")); connect(newFileAct, SIGNAL(triggered(bool)), this, SLOT(newFile())); @@ -77,7 +77,7 @@ void VFileList::initActions() pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"), tr("&Paste"), this); - pasteAct->setToolTip(tr("Paste notes in current directory")); + pasteAct->setToolTip(tr("Paste notes in current folder")); connect(pasteAct, &QAction::triggered, this, &VFileList::pasteFilesInCurDir); @@ -98,7 +98,7 @@ void VFileList::setDirectory(VDirectory *p_directory) return; } - qDebug() << "filelist set directory" << m_directory->getName(); + qDebug() << "filelist set folder" << m_directory->getName(); updateFileList(); } @@ -445,7 +445,7 @@ void VFileList::pasteFiles(VDirectory *p_destDir) VUtils::showMessage(QMessageBox::Warning, tr("Warning"), tr("Fail to copy note %2.") .arg(vconfig.c_dataTextStyle).arg(srcFile->getName()), - tr("Please check if there already exists a file with the same name in the target directory."), + tr("Please check if there already exists a file with the same name in the target folder."), QMessageBox::Ok, QMessageBox::Ok, this); } } diff --git a/src/vmainwindow.cpp b/src/vmainwindow.cpp index dd809aef..b5a16b0f 100644 --- a/src/vmainwindow.cpp +++ b/src/vmainwindow.cpp @@ -114,10 +114,10 @@ void VMainWindow::setupUI() QWidget *VMainWindow::setupDirectoryPanel() { - notebookLabel = new QLabel(tr("Notebook")); + notebookLabel = new QLabel(tr("Notebooks")); notebookLabel->setProperty("TitleLabel", true); notebookLabel->setProperty("NotebookPanel", true); - directoryLabel = new QLabel(tr("Directory")); + directoryLabel = new QLabel(tr("Folders")); directoryLabel->setProperty("TitleLabel", true); directoryLabel->setProperty("NotebookPanel", true); @@ -165,13 +165,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 list panel")); + onePanelViewAct->setStatusTip(tr("Display only the notes 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 list panel")); + twoPanelViewAct->setStatusTip(tr("Display both the folders and notes list panel")); connect(twoPanelViewAct, &QAction::triggered, this, &VMainWindow::twoPanelView); @@ -198,14 +198,14 @@ void VMainWindow::initFileToolBar() fileToolBar->setMovable(false); newRootDirAct = new QAction(QIcon(":/resources/icons/create_rootdir_tb.svg"), - tr("New &Root Directory"), this); - newRootDirAct->setStatusTip(tr("Create a root directory in current notebook")); + tr("New &Root Folder"), this); + newRootDirAct->setStatusTip(tr("Create a root folder in current notebook")); connect(newRootDirAct, &QAction::triggered, directoryTree, &VDirectoryTree::newRootDirectory); newNoteAct = new QAction(QIcon(":/resources/icons/create_note_tb.svg"), tr("New &Note"), this); - newNoteAct->setStatusTip(tr("Create a note in current directory")); + newNoteAct->setStatusTip(tr("Create a note in current folder")); newNoteAct->setShortcut(QKeySequence::New); connect(newNoteAct, &QAction::triggered, fileList, &VFileList::newFile); @@ -445,7 +445,7 @@ void VMainWindow::initFileMenu() // Import notes from files. m_importNoteAct = new QAction(QIcon(":/resources/icons/import_note.svg"), tr("&Import Notes From Files"), this); - m_importNoteAct->setToolTip(tr("Import notes from files into current directory")); + m_importNoteAct->setToolTip(tr("Import notes from external files into current folder")); connect(m_importNoteAct, &QAction::triggered, this, &VMainWindow::importNoteFromFile); m_importNoteAct->setEnabled(false);