warn users when copying files failed

This commit is contained in:
Le Tan 2017-03-04 14:39:52 +08:00
parent f46b023d1b
commit e7381bdd04
4 changed files with 22 additions and 6 deletions

Binary file not shown.

View File

@ -189,8 +189,8 @@
</message> </message>
<message> <message>
<location filename="../vdirectorytree.cpp" line="556"/> <location filename="../vdirectorytree.cpp" line="556"/>
<source>Please check if there alread exists a directory with the same name.</source> <source>Please check if there already exists a directory with the same name.</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context> <context>
@ -384,7 +384,8 @@
<message> <message>
<location filename="../vfilelist.cpp" line="190"/> <location filename="../vfilelist.cpp" line="190"/>
<location filename="../vfilelist.cpp" line="247"/> <location filename="../vfilelist.cpp" line="247"/>
<location filename="../vfilelist.cpp" line="433"/> <location filename="../vfilelist.cpp" line="414"/>
<location filename="../vfilelist.cpp" line="438"/>
<source>Warning</source> <source>Warning</source>
<translation></translation> <translation></translation>
</message> </message>
@ -404,12 +405,22 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../vfilelist.cpp" line="434"/> <location filename="../vfilelist.cpp" line="415"/>
<source>Fail to copy note %1.</source>
<translation>: %1</translation>
</message>
<message>
<location filename="../vfilelist.cpp" line="416"/>
<source>Please check if there already exists a file with the same name in the target directory.</source>
<translation></translation>
</message>
<message>
<location filename="../vfilelist.cpp" line="439"/>
<source>The renaming will change the note type.</source> <source>The renaming will change the note type.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../vfilelist.cpp" line="435"/> <location filename="../vfilelist.cpp" line="440"/>
<source>You should close the note %1 before continue.</source> <source>You should close the note %1 before continue.</source>
<translation>: %1</translation> <translation>: %1</translation>
</message> </message>

View File

@ -553,7 +553,7 @@ bool VDirectoryTree::copyDirectory(VDirectory *p_destDir, const QString &p_destN
} else { } else {
VUtils::showMessage(QMessageBox::Warning, tr("Warning"), VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
tr("Fail to copy directory %1.").arg(srcName), tr("Fail to copy directory %1.").arg(srcName),
tr("Please check if there alread exists a directory with the same name."), tr("Please check if there already exists a directory with the same name."),
QMessageBox::Ok, QMessageBox::Ok, this); QMessageBox::Ok, QMessageBox::Ok, this);
} }

View File

@ -410,6 +410,11 @@ void VFileList::pasteFiles(VDirectory *p_destDir)
} }
if (copyFile(p_destDir, fileName, srcFile, isCut)) { if (copyFile(p_destDir, fileName, srcFile, isCut)) {
nrPasted++; nrPasted++;
} else {
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
tr("Fail to copy note %1.").arg(srcFile->getName()),
tr("Please check if there already exists a file with the same name in the target directory."),
QMessageBox::Ok, QMessageBox::Ok, this);
} }
} }