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>
<location filename="../vdirectorytree.cpp" line="556"/>
<source>Please check if there alread exists a directory with the same name.</source>
<translation></translation>
<source>Please check if there already exists a directory with the same name.</source>
<translation></translation>
</message>
</context>
<context>
@ -384,7 +384,8 @@
<message>
<location filename="../vfilelist.cpp" line="190"/>
<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>
<translation></translation>
</message>
@ -404,12 +405,22 @@
<translation></translation>
</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>
<translation></translation>
</message>
<message>
<location filename="../vfilelist.cpp" line="435"/>
<location filename="../vfilelist.cpp" line="440"/>
<source>You should close the note %1 before continue.</source>
<translation>: %1</translation>
</message>

View File

@ -553,7 +553,7 @@ bool VDirectoryTree::copyDirectory(VDirectory *p_destDir, const QString &p_destN
} else {
VUtils::showMessage(QMessageBox::Warning, tr("Warning"),
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);
}

View File

@ -410,6 +410,11 @@ void VFileList::pasteFiles(VDirectory *p_destDir)
}
if (copyFile(p_destDir, fileName, srcFile, isCut)) {
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);
}
}