Browse Source

warn users when copying files failed

Le Tan 8 years ago
parent
commit
e7381bdd04
4 changed files with 22 additions and 6 deletions
  1. BIN
      src/translations/vnote_zh_CN.qm
  2. 16 5
      src/translations/vnote_zh_CN.ts
  3. 1 1
      src/vdirectorytree.cpp
  4. 5 0
      src/vfilelist.cpp

BIN
src/translations/vnote_zh_CN.qm


+ 16 - 5
src/translations/vnote_zh_CN.ts

@@ -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>

+ 1 - 1
src/vdirectorytree.cpp

@@ -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);
     }
 

+ 5 - 0
src/vfilelist.cpp

@@ -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);
         }
     }