From b3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 24 Nov 2017 23:24:09 +0000 Subject: New upstream version 1.2.3.6 --- AuthPlugin.cpp | 123 - AuthPlugin.h | 46 - CliParser.cpp | 295 +-- CliParser.h | 46 +- CompilerInfo.h | 2 - CopyEngineManager.cpp | 620 ++--- CopyEngineManager.h | 144 +- CopyListener.cpp | 657 +++--- CopyListener.h | 196 +- Core.cpp | 1790 ++++++++------- Core.h | 320 +-- DebugEngine.cpp | 627 +++--- DebugEngine.h | 177 +- DebugEngineMacro.h | 20 +- DebugModel.cpp | 158 ++ Environment.h | 10 +- EventDispatcher.cpp | 665 ++++-- EventDispatcher.h | 116 +- ExtraSocket.cpp | 66 +- ExtraSocket.h | 16 +- FacilityEngine.cpp | 339 +-- FacilityEngine.h | 88 +- GlobalClass.cpp | 40 - GlobalClass.h | 44 - HelpDialog.cpp | 233 +- HelpDialog.h | 50 +- HelpDialog.ui | 38 +- InternetUpdater.cpp | 112 + InternetUpdater.h | 33 + LanguagesManager.cpp | 468 ++-- LanguagesManager.h | 101 +- LocalListener.cpp | 455 ++-- LocalListener.h | 69 +- LocalPluginOptions.cpp | 54 +- LocalPluginOptions.h | 33 +- LogThread.cpp | 397 ++-- LogThread.h | 104 +- OSSpecific.cpp | 62 + OSSpecific.h | 29 + OSSpecific.ui | 108 + OptionDialog.cpp | 2332 +++++++++++++------ OptionDialog.h | 194 +- OptionDialog.ui | 193 +- OptionEngine.cpp | 361 +-- OptionEngine.h | 104 +- PlatformMacro.h | 2 - PluginInformation.cpp | 174 +- PluginInformation.h | 40 +- PluginLoader.cpp | 440 ++-- PluginLoader.h | 83 +- PluginsManager.cpp | 1562 ++++++------- PluginsManager.h | 215 +- README | 7 + ResourcesManager.cpp | 318 +-- ResourcesManager.h | 71 +- SessionLoader.cpp | 242 +- SessionLoader.h | 64 +- Singleton.h | 52 - StructEnumDefinition.h | 140 +- StructEnumDefinition_UltracopierSpecific.h | 2 - SystrayIcon.cpp | 826 ++++--- SystrayIcon.h | 211 +- ThemesManager.cpp | 437 ++-- ThemesManager.h | 118 +- Variable.h | 30 +- interface/FacilityInterface.h | 46 +- interface/OptionInterface.h | 29 +- interface/PluginInterface_CopyEngine.h | 353 ++- interface/PluginInterface_Listener.h | 62 +- interface/PluginInterface_PluginLoader.h | 35 +- interface/PluginInterface_SessionLoader.h | 33 +- interface/PluginInterface_Themes.h | 172 +- lib/qt-tar-xz/QTarDecode.cpp | 233 +- lib/qt-tar-xz/QTarDecode.h | 45 +- lib/qt-tar-xz/QXzDecode.cpp | 2 - lib/qt-tar-xz/QXzDecode.h | 2 - lib/qt-tar-xz/QXzDecodeThread.cpp | 2 - lib/qt-tar-xz/QXzDecodeThread.h | 2 - main.cpp | 156 +- patch/comercial/rsync-copy-engine.patch | 902 -------- patch/opensource/KDE-Ultracopier.patch | 290 --- patch/opensource/options-with-pass.patch | 336 --- .../CopyEngine/Rsync/AvancedQFile.cpp | 94 - .../CopyEngine/Rsync/AvancedQFile.h | 32 - .../CopyEngine/Rsync/CompilerInfo.h | 1 - .../CopyEngine/Rsync/DebugEngineMacro.h | 25 - plugins-alternative/CopyEngine/Rsync/Environment.h | 12 - .../CopyEngine/Rsync/FilterRules.cpp | 193 -- plugins-alternative/CopyEngine/Rsync/FilterRules.h | 46 - .../CopyEngine/Rsync/FilterRules.ui | 162 -- plugins-alternative/CopyEngine/Rsync/Filters.cpp | 456 ---- plugins-alternative/CopyEngine/Rsync/Filters.h | 44 - plugins-alternative/CopyEngine/Rsync/Filters.ui | 194 -- .../CopyEngine/Rsync/Languages/ar/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/de/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/el/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/es/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/fr/translation.ts | 810 ------- .../CopyEngine/Rsync/Languages/hi/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/id/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/it/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/ja/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/ko/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/nl/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/no/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/pl/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/pt/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/ru/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/th/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/tr/translation.ts | 806 ------- .../CopyEngine/Rsync/Languages/zh/translation.ts | 806 ------- .../CopyEngine/Rsync/ListThread.cpp | 1720 -------------- plugins-alternative/CopyEngine/Rsync/ListThread.h | 376 ---- .../CopyEngine/Rsync/ListThread_InodeAction.cpp | 66 - plugins-alternative/CopyEngine/Rsync/MkPath.cpp | 100 - plugins-alternative/CopyEngine/Rsync/MkPath.h | 56 - .../CopyEngine/Rsync/ReadThread.cpp | 597 ----- plugins-alternative/CopyEngine/Rsync/ReadThread.h | 144 -- .../CopyEngine/Rsync/RenamingRules.cpp | 85 - .../CopyEngine/Rsync/RenamingRules.h | 34 - .../CopyEngine/Rsync/RenamingRules.ui | 129 -- plugins-alternative/CopyEngine/Rsync/RmPath.cpp | 179 -- plugins-alternative/CopyEngine/Rsync/RmPath.h | 58 - .../CopyEngine/Rsync/StructEnumDefinition.h | 1 - .../Rsync/StructEnumDefinition_CopyEngine.h | 90 - .../CopyEngine/Rsync/TransferThread.cpp | 1252 ---------- .../CopyEngine/Rsync/TransferThread.h | 221 -- plugins-alternative/CopyEngine/Rsync/Variable.h | 35 - .../CopyEngine/Rsync/WriteThread.cpp | 508 ----- plugins-alternative/CopyEngine/Rsync/WriteThread.h | 138 -- .../Rsync/copyEngine-collision-and-error.cpp | 565 ----- .../CopyEngine/Rsync/copyEngine.cpp | 819 ------- plugins-alternative/CopyEngine/Rsync/copyEngine.h | 362 --- .../CopyEngine/Rsync/copyEngine.pro | 82 - .../CopyEngine/Rsync/debugDialog.cpp | 70 - plugins-alternative/CopyEngine/Rsync/debugDialog.h | 40 - .../CopyEngine/Rsync/debugDialog.ui | 100 - .../CopyEngine/Rsync/documentation.dox | 42 - plugins-alternative/CopyEngine/Rsync/factory.cpp | 420 ---- plugins-alternative/CopyEngine/Rsync/factory.h | 96 - .../CopyEngine/Rsync/fileErrorDialog.cpp | 95 - .../CopyEngine/Rsync/fileErrorDialog.h | 45 - .../CopyEngine/Rsync/fileErrorDialog.ui | 220 -- .../CopyEngine/Rsync/fileExistsDialog.cpp | 189 -- .../CopyEngine/Rsync/fileExistsDialog.h | 58 - .../CopyEngine/Rsync/fileExistsDialog.ui | 367 --- .../CopyEngine/Rsync/fileIsSameDialog.cpp | 156 -- .../CopyEngine/Rsync/fileIsSameDialog.h | 56 - .../CopyEngine/Rsync/fileIsSameDialog.ui | 192 -- .../CopyEngine/Rsync/folderExistsDialog.cpp | 143 -- .../CopyEngine/Rsync/folderExistsDialog.h | 54 - .../CopyEngine/Rsync/folderExistsDialog.ui | 282 --- .../CopyEngine/Rsync/informations.xml | 27 - plugins-alternative/CopyEngine/Rsync/options.ui | 328 --- plugins-alternative/CopyEngine/Rsync/resources.qrc | 8 - .../CopyEngine/Rsync/resources/add.png | Bin 564 -> 0 bytes .../CopyEngine/Rsync/resources/edit.png | Bin 563 -> 0 bytes .../CopyEngine/Rsync/resources/filter.png | Bin 429 -> 0 bytes .../CopyEngine/Rsync/resources/remove.png | Bin 722 -> 0 bytes .../CopyEngine/Rsync/scanFileOrFolder.cpp | 511 ----- .../CopyEngine/Rsync/scanFileOrFolder.h | 91 - .../PluginLoader/keybinding/DebugEngineMacro.h | 28 + .../PluginLoader/keybinding/Environment.h | 10 + .../PluginLoader/keybinding/KeyBind.cpp | 11 + .../PluginLoader/keybinding/KeyBind.h | 18 + .../keybinding/Languages/ar/translation.ts | 4 + .../keybinding/Languages/de/translation.ts | 4 + .../keybinding/Languages/el/translation.ts | 4 + .../keybinding/Languages/en/translation.ts | 4 + .../keybinding/Languages/es/translation.ts | 4 + .../keybinding/Languages/fr/translation.ts | 4 + .../keybinding/Languages/hi/translation.ts | 4 + .../keybinding/Languages/hu/translation.ts | 4 + .../keybinding/Languages/id/translation.ts | 4 + .../keybinding/Languages/it/translation.ts | 4 + .../keybinding/Languages/ja/translation.ts | 4 + .../keybinding/Languages/ko/translation.ts | 4 + .../keybinding/Languages/nl/translation.ts | 4 + .../keybinding/Languages/no/translation.ts | 4 + .../keybinding/Languages/pl/translation.ts | 4 + .../keybinding/Languages/pt/translation.ts | 4 + .../keybinding/Languages/ru/translation.ts | 4 + .../keybinding/Languages/th/translation.ts | 4 + .../keybinding/Languages/tr/translation.ts | 4 + .../keybinding/Languages/zh/translation.ts | 4 + .../PluginLoader/keybinding/OptionsWidget.cpp | 55 + .../PluginLoader/keybinding/OptionsWidget.h | 31 + .../PluginLoader/keybinding/OptionsWidget.ui | 31 + .../PluginLoader/keybinding/PlatformMacro.h | 1 + .../PluginLoader/keybinding/StructEnumDefinition.h | 1 + .../PluginLoader/keybinding/Variable.h | 16 + .../PluginLoader/keybinding/documentation.dox | 34 + .../PluginLoader/keybinding/informations.xml | 27 + .../PluginLoader/keybinding/plugin.json | 1 + .../PluginLoader/keybinding/pluginLoader.cpp | 61 + .../PluginLoader/keybinding/pluginLoader.h | 47 + .../PluginLoader/keybinding/pluginLoader.pro | 50 + .../keybinding/pluginLoader.pro.user.3.3-pre1 | 266 +++ .../Themes/Clean/Languages/ar/translation.ts | 4 +- .../Themes/Clean/Languages/de/translation.ts | 16 +- .../Themes/Clean/Languages/el/translation.ts | 4 +- .../Themes/Clean/Languages/en/translation.ts | 55 + .../Themes/Clean/Languages/es/translation.ts | 10 +- .../Themes/Clean/Languages/fr/translation.ts | 10 +- .../Themes/Clean/Languages/hi/translation.ts | 4 +- .../Themes/Clean/Languages/hu/translation.ts | 55 + .../Themes/Clean/Languages/id/translation.ts | 4 +- .../Themes/Clean/Languages/it/translation.ts | 20 +- .../Themes/Clean/Languages/ja/translation.ts | 4 +- .../Themes/Clean/Languages/ko/translation.ts | 10 +- .../Themes/Clean/Languages/nl/translation.ts | 4 +- .../Themes/Clean/Languages/no/translation.ts | 4 +- .../Themes/Clean/Languages/pl/translation.ts | 4 +- .../Themes/Clean/Languages/ru/translation.ts | 10 +- .../Themes/Clean/Languages/th/translation.ts | 4 +- .../Themes/Clean/Languages/tr/translation.ts | 4 +- .../Themes/Clean/Languages/zh/translation.ts | 4 +- plugins-alternative/Themes/Clean/documentation.dox | 6 +- plugins-alternative/Themes/Clean/factory.cpp | 89 +- plugins-alternative/Themes/Clean/factory.h | 42 +- plugins-alternative/Themes/Clean/informations.xml | 3 +- plugins-alternative/Themes/Clean/interface.cpp | 557 ++--- plugins-alternative/Themes/Clean/interface.h | 242 +- plugins-alternative/Themes/Clean/interface.pro | 31 +- plugins-alternative/Themes/Clean/interface.ui | 14 +- plugins-alternative/Themes/Clean/plugin.json | 1 + plugins-alternative/Themes/Clean/resources.qrc | 2 +- .../resources/SystemTrayIcon/informations.png | Bin 734 -> 841 bytes .../SystemTrayIcon/systray_Caught_Unix.png | Bin 798 -> 1093 bytes .../SystemTrayIcon/systray_Caught_Windows.png | Bin 563 -> 623 bytes .../SystemTrayIcon/systray_Semiuncaught_Unix.png | Bin 1007 -> 1296 bytes .../systray_Semiuncaught_Windows.png | Bin 664 -> 841 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 789 -> 754 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 551 -> 485 bytes .../Themes/Clean/resources_unix.qrc | 4 +- .../Themes/Clean/resources_windows.qrc | 2 +- .../Themes/Supercopier/DebugEngineMacro.h | 28 + .../Themes/Supercopier/Environment.h | 10 + .../Themes/Supercopier/Languages/ar/translation.ts | 324 +++ .../Themes/Supercopier/Languages/de/translation.ts | 324 +++ .../Themes/Supercopier/Languages/el/translation.ts | 324 +++ .../Themes/Supercopier/Languages/en/translation.ts | 324 +++ .../Themes/Supercopier/Languages/es/translation.ts | 340 +++ .../Themes/Supercopier/Languages/fr/translation.ts | 344 +++ .../Themes/Supercopier/Languages/hi/translation.ts | 324 +++ .../Themes/Supercopier/Languages/hu/translation.ts | 328 +++ .../Themes/Supercopier/Languages/id/translation.ts | 324 +++ .../Themes/Supercopier/Languages/it/translation.ts | 336 +++ .../Themes/Supercopier/Languages/ja/translation.ts | 324 +++ .../Themes/Supercopier/Languages/ko/translation.ts | 336 +++ .../Themes/Supercopier/Languages/nl/translation.ts | 324 +++ .../Themes/Supercopier/Languages/no/translation.ts | 324 +++ .../Themes/Supercopier/Languages/pl/translation.ts | 324 +++ .../Themes/Supercopier/Languages/pt/translation.ts | 324 +++ .../Themes/Supercopier/Languages/ru/translation.ts | 336 +++ .../Themes/Supercopier/Languages/th/translation.ts | 324 +++ .../Themes/Supercopier/Languages/tr/translation.ts | 324 +++ .../Themes/Supercopier/Languages/zh/translation.ts | 324 +++ .../Themes/Supercopier/StructEnumDefinition.h | 1 + .../Themes/Supercopier/TransferModel.cpp | 569 +++++ .../Themes/Supercopier/TransferModel.h | 96 + plugins-alternative/Themes/Supercopier/Variable.h | 15 + .../Themes/Supercopier/documentation.dox | 33 + plugins-alternative/Themes/Supercopier/factory.cpp | 441 ++++ plugins-alternative/Themes/Supercopier/factory.h | 83 + .../Themes/Supercopier/informations.xml | 26 + .../Themes/Supercopier/interface.cpp | 1332 +++++++++++ plugins-alternative/Themes/Supercopier/interface.h | 221 ++ .../Themes/Supercopier/interface.pro | 59 + .../Themes/Supercopier/interface.ui | 845 +++++++ .../Themes/Supercopier/interfaceResources.qrc | 24 + .../Themes/Supercopier/interfaceResources_unix.qrc | 9 + .../Supercopier/interfaceResources_windows.qrc | 9 + plugins-alternative/Themes/Supercopier/plugin.json | 1 + .../Supercopier/resources/SystemTrayIcon/add.png | Bin 0 -> 246 bytes .../Supercopier/resources/SystemTrayIcon/exit.png | Bin 0 -> 545 bytes .../resources/SystemTrayIcon/informations.png | Bin 0 -> 281 bytes .../resources/SystemTrayIcon/options.png | Bin 0 -> 275 bytes .../systray_Bottom_Progress_Unix.png | Bin 0 -> 95 bytes .../systray_Bottom_Progress_Windows.png | Bin 0 -> 93 bytes .../SystemTrayIcon/systray_Caught_Unix.png | Bin 0 -> 147 bytes .../SystemTrayIcon/systray_Caught_Windows.png | Bin 0 -> 148 bytes .../SystemTrayIcon/systray_Semiuncaught_Unix.png | Bin 0 -> 147 bytes .../systray_Semiuncaught_Windows.png | Bin 0 -> 148 bytes .../SystemTrayIcon/systray_Top_Progress_Unix.png | Bin 0 -> 95 bytes .../systray_Top_Progress_Windows.png | Bin 0 -> 93 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 0 -> 141 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 0 -> 139 bytes .../Themes/Supercopier/resources/add.png | Bin 0 -> 240 bytes .../Themes/Supercopier/resources/cancel.png | Bin 0 -> 284 bytes .../Supercopier/resources/export-transfer-list.png | Bin 0 -> 264 bytes .../Supercopier/resources/import-transfer-list.png | Bin 0 -> 316 bytes .../Themes/Supercopier/resources/main.png | Bin 0 -> 148 bytes .../Themes/Supercopier/resources/moveDown.png | Bin 0 -> 191 bytes .../Themes/Supercopier/resources/moveUp.png | Bin 0 -> 190 bytes .../Themes/Supercopier/resources/player_end.png | Bin 0 -> 226 bytes .../Themes/Supercopier/resources/player_pause.png | Bin 0 -> 207 bytes .../Themes/Supercopier/resources/player_play.png | Bin 0 -> 208 bytes .../Supercopier/resources/progressbarleft.png | Bin 0 -> 133 bytes .../Supercopier/resources/progressbarright.png | Bin 0 -> 132 bytes .../Themes/Supercopier/resources/putOnBottom.png | Bin 0 -> 206 bytes .../Themes/Supercopier/resources/putOnTop.png | Bin 0 -> 208 bytes .../Themes/Supercopier/resources/remove.png | Bin 0 -> 254 bytes .../Themes/Supercopier/resources/search.png | Bin 0 -> 237 bytes .../Themes/Supercopier/themesOptions.ui | 384 ++++ .../Themes/Teracopy/DebugEngineMacro.h | 7 +- plugins-alternative/Themes/Teracopy/Environment.h | 3 +- .../Themes/Teracopy/Languages/ar/translation.ts | 8 +- .../Themes/Teracopy/Languages/de/translation.ts | 26 +- .../Themes/Teracopy/Languages/el/translation.ts | 8 +- .../Themes/Teracopy/Languages/en/translation.ts | 89 + .../Themes/Teracopy/Languages/es/translation.ts | 14 +- .../Themes/Teracopy/Languages/fr/translation.ts | 9 +- .../Themes/Teracopy/Languages/hi/translation.ts | 8 +- .../Themes/Teracopy/Languages/hu/translation.ts | 93 + .../Themes/Teracopy/Languages/id/translation.ts | 8 +- .../Themes/Teracopy/Languages/it/translation.ts | 26 +- .../Themes/Teracopy/Languages/ja/translation.ts | 8 +- .../Themes/Teracopy/Languages/ko/translation.ts | 6 +- .../Themes/Teracopy/Languages/nl/translation.ts | 8 +- .../Themes/Teracopy/Languages/no/translation.ts | 8 +- .../Themes/Teracopy/Languages/pl/translation.ts | 8 +- .../Themes/Teracopy/Languages/ru/translation.ts | 14 +- .../Themes/Teracopy/Languages/th/translation.ts | 8 +- .../Themes/Teracopy/Languages/tr/translation.ts | 8 +- .../Themes/Teracopy/Languages/zh/translation.ts | 8 +- .../Themes/Teracopy/TransferModel.cpp | 841 +++---- .../Themes/Teracopy/TransferModel.h | 120 +- plugins-alternative/Themes/Teracopy/Variable.h | 3 +- .../Themes/Teracopy/documentation.dox | 6 +- plugins-alternative/Themes/Teracopy/factory.cpp | 107 +- plugins-alternative/Themes/Teracopy/factory.h | 38 +- .../Themes/Teracopy/informations.xml | 3 +- plugins-alternative/Themes/Teracopy/interface.cpp | 695 +++--- plugins-alternative/Themes/Teracopy/interface.h | 289 +-- plugins-alternative/Themes/Teracopy/interface.pro | 31 +- plugins-alternative/Themes/Teracopy/interface.ui | 14 +- plugins-alternative/Themes/Teracopy/plugin.json | 1 + plugins-alternative/Themes/Teracopy/resources.qrc | 2 +- .../Teracopy/resources/SystemTrayIcon/add.png | Bin 564 -> 552 bytes .../Teracopy/resources/SystemTrayIcon/exit.png | Bin 775 -> 874 bytes .../resources/SystemTrayIcon/informations.png | Bin 734 -> 841 bytes .../Teracopy/resources/SystemTrayIcon/options.png | Bin 660 -> 624 bytes .../SystemTrayIcon/systray_Caught_Unix.png | Bin 798 -> 1093 bytes .../SystemTrayIcon/systray_Caught_Windows.png | Bin 563 -> 623 bytes .../SystemTrayIcon/systray_Semiuncaught_Unix.png | Bin 1007 -> 1296 bytes .../systray_Semiuncaught_Windows.png | Bin 664 -> 841 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 789 -> 754 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 551 -> 485 bytes .../Themes/Teracopy/resources/checkbox.png | Bin 654 -> 619 bytes .../Themes/Teracopy/resources/main.png | Bin 563 -> 623 bytes .../Themes/Teracopy/resources/player_pause.png | Bin 484 -> 640 bytes .../Themes/Teracopy/resources/player_play.png | Bin 501 -> 673 bytes .../Themes/Teracopy/resources_unix.qrc | 4 +- .../Themes/Teracopy/resources_windows.qrc | 2 +- .../Themes/Windows/DebugEngineMacro.h | 28 + plugins-alternative/Themes/Windows/Environment.h | 10 + .../Themes/Windows/Languages/ar/translation.ts | 121 + .../Themes/Windows/Languages/de/translation.ts | 124 + .../Themes/Windows/Languages/el/translation.ts | 121 + .../Themes/Windows/Languages/en/translation.ts | 124 + .../Themes/Windows/Languages/es/translation.ts | 124 + .../Themes/Windows/Languages/fr/translation.ts | 124 + .../Themes/Windows/Languages/hi/translation.ts | 121 + .../Themes/Windows/Languages/hu/translation.ts | 121 + .../Themes/Windows/Languages/id/translation.ts | 121 + .../Themes/Windows/Languages/it/translation.ts | 125 + .../Themes/Windows/Languages/ja/translation.ts | 121 + .../Themes/Windows/Languages/ko/translation.ts | 121 + .../Themes/Windows/Languages/nl/translation.ts | 121 + .../Themes/Windows/Languages/no/translation.ts | 121 + .../Themes/Windows/Languages/pl/translation.ts | 121 + .../Themes/Windows/Languages/ru/translation.ts | 127 ++ .../Themes/Windows/Languages/th/translation.ts | 121 + .../Themes/Windows/Languages/tr/translation.ts | 121 + .../Themes/Windows/Languages/zh/translation.ts | 121 + .../Themes/Windows/StructEnumDefinition.h | 1 + .../Themes/Windows/TransferModel.cpp | 286 +++ plugins-alternative/Themes/Windows/TransferModel.h | 90 + plugins-alternative/Themes/Windows/Variable.h | 15 + .../Themes/Windows/documentation.dox | 29 + plugins-alternative/Themes/Windows/factory.cpp | 74 + plugins-alternative/Themes/Windows/factory.h | 45 + .../Themes/Windows/informations.xml | 26 + plugins-alternative/Themes/Windows/interface.cpp | 414 ++++ plugins-alternative/Themes/Windows/interface.h | 165 ++ plugins-alternative/Themes/Windows/interface.pro | 48 + plugins-alternative/Themes/Windows/interface.ui | 415 ++++ plugins-alternative/Themes/Windows/plugin.json | 1 + plugins-alternative/Themes/Windows/resources.qrc | 10 + .../resources/SystemTrayIcon/informations.png | Bin 0 -> 841 bytes .../SystemTrayIcon/systray_Caught_Unix.png | Bin 0 -> 1093 bytes .../SystemTrayIcon/systray_Caught_Windows.png | Bin 0 -> 623 bytes .../SystemTrayIcon/systray_Semiuncaught_Unix.png | Bin 0 -> 1296 bytes .../systray_Semiuncaught_Windows.png | Bin 0 -> 841 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 0 -> 754 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 0 -> 485 bytes .../Themes/Windows/resources/arrow-down.png | Bin 0 -> 598 bytes .../Themes/Windows/resources/arrow-up.png | Bin 0 -> 602 bytes .../Themes/Windows/resources/empty.png | Bin 0 -> 95 bytes .../Themes/Windows/resources/icon-top.png | Bin 0 -> 2437 bytes .../Themes/Windows/resources/icon-top.xcf | Bin 0 -> 4398 bytes .../Themes/Windows/resources/icon.png | Bin 0 -> 379 bytes .../Themes/Windows/resources_unix.qrc | 7 + .../Themes/Windows/resources_windows.qrc | 7 + plugins-alternative/static-plugins-supercopier.qrc | 6 + plugins/CopyEngine/Rsync/Rsync.pro | 2 + .../CopyEngine/Ultracopier-0.3/AvancedQFile.cpp | 94 - plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.h | 32 - plugins/CopyEngine/Ultracopier-0.3/CompilerInfo.h | 1 - .../CopyEngine/Ultracopier-0.3/DebugEngineMacro.h | 25 - plugins/CopyEngine/Ultracopier-0.3/Environment.h | 12 - plugins/CopyEngine/Ultracopier-0.3/FilterRules.cpp | 193 -- plugins/CopyEngine/Ultracopier-0.3/FilterRules.h | 46 - plugins/CopyEngine/Ultracopier-0.3/FilterRules.ui | 162 -- plugins/CopyEngine/Ultracopier-0.3/Filters.cpp | 456 ---- plugins/CopyEngine/Ultracopier-0.3/Filters.h | 44 - plugins/CopyEngine/Ultracopier-0.3/Filters.ui | 194 -- .../Ultracopier-0.3/Languages/ar/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/de/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/el/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/es/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/fr/translation.ts | 799 ------- .../Ultracopier-0.3/Languages/hi/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/id/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/it/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/ja/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/ko/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/nl/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/no/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/pl/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/pt/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/ru/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/th/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/tr/translation.ts | 795 ------- .../Ultracopier-0.3/Languages/zh/translation.ts | 795 ------- plugins/CopyEngine/Ultracopier-0.3/ListThread.cpp | 1689 -------------- plugins/CopyEngine/Ultracopier-0.3/ListThread.h | 370 --- .../Ultracopier-0.3/ListThread_InodeAction.cpp | 58 - plugins/CopyEngine/Ultracopier-0.3/MkPath.cpp | 100 - plugins/CopyEngine/Ultracopier-0.3/MkPath.h | 56 - plugins/CopyEngine/Ultracopier-0.3/ReadThread.cpp | 597 ----- plugins/CopyEngine/Ultracopier-0.3/ReadThread.h | 144 -- .../CopyEngine/Ultracopier-0.3/RenamingRules.cpp | 85 - plugins/CopyEngine/Ultracopier-0.3/RenamingRules.h | 34 - .../CopyEngine/Ultracopier-0.3/RenamingRules.ui | 129 -- plugins/CopyEngine/Ultracopier-0.3/RmPath.cpp | 127 -- plugins/CopyEngine/Ultracopier-0.3/RmPath.h | 56 - .../Ultracopier-0.3/StructEnumDefinition.h | 1 - .../StructEnumDefinition_CopyEngine.h | 90 - .../CopyEngine/Ultracopier-0.3/TransferThread.cpp | 1245 ---------- .../CopyEngine/Ultracopier-0.3/TransferThread.h | 218 -- plugins/CopyEngine/Ultracopier-0.3/Variable.h | 35 - plugins/CopyEngine/Ultracopier-0.3/WriteThread.cpp | 508 ----- plugins/CopyEngine/Ultracopier-0.3/WriteThread.h | 138 -- .../copyEngine-collision-and-error.cpp | 565 ----- plugins/CopyEngine/Ultracopier-0.3/copyEngine.cpp | 796 ------- plugins/CopyEngine/Ultracopier-0.3/copyEngine.h | 359 --- plugins/CopyEngine/Ultracopier-0.3/copyEngine.pro | 82 - plugins/CopyEngine/Ultracopier-0.3/debugDialog.cpp | 70 - plugins/CopyEngine/Ultracopier-0.3/debugDialog.h | 40 - plugins/CopyEngine/Ultracopier-0.3/debugDialog.ui | 100 - .../CopyEngine/Ultracopier-0.3/documentation.dox | 41 - plugins/CopyEngine/Ultracopier-0.3/factory.cpp | 407 ---- plugins/CopyEngine/Ultracopier-0.3/factory.h | 95 - .../CopyEngine/Ultracopier-0.3/fileErrorDialog.cpp | 95 - .../CopyEngine/Ultracopier-0.3/fileErrorDialog.h | 45 - .../CopyEngine/Ultracopier-0.3/fileErrorDialog.ui | 220 -- .../Ultracopier-0.3/fileExistsDialog.cpp | 189 -- .../CopyEngine/Ultracopier-0.3/fileExistsDialog.h | 58 - .../CopyEngine/Ultracopier-0.3/fileExistsDialog.ui | 367 --- .../Ultracopier-0.3/fileIsSameDialog.cpp | 156 -- .../CopyEngine/Ultracopier-0.3/fileIsSameDialog.h | 56 - .../CopyEngine/Ultracopier-0.3/fileIsSameDialog.ui | 192 -- .../Ultracopier-0.3/folderExistsDialog.cpp | 143 -- .../Ultracopier-0.3/folderExistsDialog.h | 54 - .../Ultracopier-0.3/folderExistsDialog.ui | 282 --- .../CopyEngine/Ultracopier-0.3/informations.xml | 27 - plugins/CopyEngine/Ultracopier-0.3/options.ui | 314 --- plugins/CopyEngine/Ultracopier-0.3/resources.qrc | 8 - .../CopyEngine/Ultracopier-0.3/resources/add.png | Bin 564 -> 0 bytes .../CopyEngine/Ultracopier-0.3/resources/edit.png | Bin 563 -> 0 bytes .../Ultracopier-0.3/resources/filter.png | Bin 429 -> 0 bytes .../Ultracopier-0.3/resources/remove.png | Bin 722 -> 0 bytes .../Ultracopier-0.3/scanFileOrFolder.cpp | 460 ---- .../CopyEngine/Ultracopier-0.3/scanFileOrFolder.h | 87 - plugins/CopyEngine/Ultracopier/AvancedQFile.cpp | 208 ++ plugins/CopyEngine/Ultracopier/AvancedQFile.h | 45 + plugins/CopyEngine/Ultracopier/CompilerInfo.h | 1 + .../Ultracopier/CopyEngine-collision-and-error.cpp | 567 +++++ plugins/CopyEngine/Ultracopier/CopyEngine.cpp | 1238 ++++++++++ plugins/CopyEngine/Ultracopier/CopyEngine.h | 381 ++++ plugins/CopyEngine/Ultracopier/CopyEngine.pro | 101 + .../CopyEngine/Ultracopier/CopyEngineFactory.cpp | 692 ++++++ plugins/CopyEngine/Ultracopier/CopyEngineFactory.h | 132 ++ plugins/CopyEngine/Ultracopier/DebugDialog.cpp | 44 + plugins/CopyEngine/Ultracopier/DebugDialog.h | 39 + plugins/CopyEngine/Ultracopier/DebugEngineMacro.h | 28 + plugins/CopyEngine/Ultracopier/DiskSpace.cpp | 53 + plugins/CopyEngine/Ultracopier/DiskSpace.h | 28 + plugins/CopyEngine/Ultracopier/DiskSpace.ui | 68 + plugins/CopyEngine/Ultracopier/DriveManagement.cpp | 102 + plugins/CopyEngine/Ultracopier/DriveManagement.h | 34 + plugins/CopyEngine/Ultracopier/Environment.h | 11 + plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp | 163 ++ plugins/CopyEngine/Ultracopier/FileErrorDialog.h | 51 + .../CopyEngine/Ultracopier/FileExistsDialog.cpp | 238 ++ plugins/CopyEngine/Ultracopier/FileExistsDialog.h | 60 + .../CopyEngine/Ultracopier/FileIsSameDialog.cpp | 188 ++ plugins/CopyEngine/Ultracopier/FileIsSameDialog.h | 57 + plugins/CopyEngine/Ultracopier/FilterRules.cpp | 193 ++ plugins/CopyEngine/Ultracopier/FilterRules.h | 46 + plugins/CopyEngine/Ultracopier/FilterRules.ui | 162 ++ plugins/CopyEngine/Ultracopier/Filters.cpp | 457 ++++ plugins/CopyEngine/Ultracopier/Filters.h | 45 + plugins/CopyEngine/Ultracopier/Filters.ui | 194 ++ .../CopyEngine/Ultracopier/FolderExistsDialog.cpp | 199 ++ .../CopyEngine/Ultracopier/FolderExistsDialog.h | 57 + .../Ultracopier/Languages/ar/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/de/translation.ts | 1294 +++++++++++ .../Ultracopier/Languages/el/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/en/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/es/translation.ts | 1305 +++++++++++ .../Ultracopier/Languages/fr/translation.ts | 1338 +++++++++++ .../Ultracopier/Languages/hi/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/hu/translation.ts | 1297 +++++++++++ .../Ultracopier/Languages/id/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/it/translation.ts | 1319 +++++++++++ .../Ultracopier/Languages/ja/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/ko/translation.ts | 1293 +++++++++++ .../Ultracopier/Languages/nl/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/no/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/pl/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/pt/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/ru/translation.ts | 1293 +++++++++++ .../Ultracopier/Languages/th/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/tr/translation.ts | 1289 +++++++++++ .../Ultracopier/Languages/zh/translation.ts | 1289 +++++++++++ plugins/CopyEngine/Ultracopier/ListThread.cpp | 2379 ++++++++++++++++++++ plugins/CopyEngine/Ultracopier/ListThread.h | 431 ++++ .../Ultracopier/ListThread_InodeAction.cpp | 64 + plugins/CopyEngine/Ultracopier/MkPath.cpp | 516 +++++ plugins/CopyEngine/Ultracopier/MkPath.h | 106 + plugins/CopyEngine/Ultracopier/ReadThread.cpp | 687 ++++++ plugins/CopyEngine/Ultracopier/ReadThread.h | 147 ++ plugins/CopyEngine/Ultracopier/RenamingRules.cpp | 85 + plugins/CopyEngine/Ultracopier/RenamingRules.h | 34 + plugins/CopyEngine/Ultracopier/RenamingRules.ui | 129 ++ .../CopyEngine/Ultracopier/ScanFileOrFolder.cpp | 677 ++++++ plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h | 108 + .../CopyEngine/Ultracopier/StructEnumDefinition.h | 1 + .../Ultracopier/StructEnumDefinition_CopyEngine.h | 124 + plugins/CopyEngine/Ultracopier/TransferThread.cpp | 2081 +++++++++++++++++ plugins/CopyEngine/Ultracopier/TransferThread.h | 288 +++ plugins/CopyEngine/Ultracopier/Variable.h | 43 + plugins/CopyEngine/Ultracopier/WriteThread.cpp | 967 ++++++++ plugins/CopyEngine/Ultracopier/WriteThread.h | 160 ++ .../CopyEngine/Ultracopier/copyEngineOptions.ui | 762 +++++++ .../CopyEngine/Ultracopier/copyEngineResources.qrc | 8 + plugins/CopyEngine/Ultracopier/debugDialog.ui | 98 + plugins/CopyEngine/Ultracopier/documentation.dox | 39 + plugins/CopyEngine/Ultracopier/fileErrorDialog.ui | 264 +++ plugins/CopyEngine/Ultracopier/fileExistsDialog.ui | 412 ++++ plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui | 214 ++ .../CopyEngine/Ultracopier/folderExistsDialog.ui | 309 +++ .../CopyEngine/Ultracopier/informations-rsync.xml | 26 + plugins/CopyEngine/Ultracopier/informations.xml | 26 + plugins/CopyEngine/Ultracopier/plugin.json | 1 + plugins/CopyEngine/Ultracopier/resources/add.png | Bin 0 -> 552 bytes plugins/CopyEngine/Ultracopier/resources/edit.png | Bin 0 -> 623 bytes .../CopyEngine/Ultracopier/resources/filter.png | Bin 0 -> 685 bytes .../CopyEngine/Ultracopier/resources/remove.png | Bin 0 -> 683 bytes plugins/Languages/ar/flag.png | Bin 992 -> 585 bytes plugins/Languages/ar/informations.xml | 5 +- plugins/Languages/ar/translation.ts | 876 ++++--- plugins/Languages/de/flag.png | Bin 753 -> 712 bytes plugins/Languages/de/informations.xml | 5 +- plugins/Languages/de/translation.ts | 1169 ++++++---- plugins/Languages/el/flag.png | Bin 779 -> 726 bytes plugins/Languages/el/informations.xml | 5 +- plugins/Languages/el/translation.ts | 876 ++++--- plugins/Languages/es/flag.png | Bin 782 -> 726 bytes plugins/Languages/es/informations.xml | 5 +- plugins/Languages/es/translation.ts | 1061 ++++++--- plugins/Languages/fr/flag.png | Bin 738 -> 699 bytes plugins/Languages/fr/informations.xml | 9 +- plugins/Languages/fr/translation.ts | 1123 ++++++--- plugins/Languages/hi/flag.png | Bin 696 -> 728 bytes plugins/Languages/hi/informations.xml | 5 +- plugins/Languages/hi/translation.ts | 876 ++++--- plugins/Languages/hu/flag.png | Bin 0 -> 810 bytes plugins/Languages/hu/informations.xml | 29 + plugins/Languages/hu/translation.ts | 1412 ++++++++++++ plugins/Languages/id/flag.png | Bin 659 -> 691 bytes plugins/Languages/id/informations.xml | 5 +- plugins/Languages/id/translation.ts | 876 ++++--- plugins/Languages/it/flag.png | Bin 710 -> 675 bytes plugins/Languages/it/informations.xml | 5 +- plugins/Languages/it/translation.ts | 1215 ++++++---- plugins/Languages/ja/flag.png | Bin 630 -> 595 bytes plugins/Languages/ja/informations.xml | 5 +- plugins/Languages/ja/translation.ts | 886 +++++--- plugins/Languages/ko/flag.png | Bin 744 -> 650 bytes plugins/Languages/ko/informations.xml | 3 +- plugins/Languages/ko/translation.ts | 964 +++++--- plugins/Languages/nl/flag.png | Bin 679 -> 709 bytes plugins/Languages/nl/informations.xml | 5 +- plugins/Languages/nl/translation.ts | 876 ++++--- plugins/Languages/no/flag.png | Bin 739 -> 715 bytes plugins/Languages/no/informations.xml | 5 +- plugins/Languages/no/translation.ts | 876 ++++--- plugins/Languages/pl/flag.png | Bin 703 -> 586 bytes plugins/Languages/pl/informations.xml | 5 +- plugins/Languages/pl/translation.ts | 876 ++++--- plugins/Languages/pt/flag.png | Bin 703 -> 686 bytes plugins/Languages/pt/informations.xml | 5 +- plugins/Languages/pt/translation.ts | 876 ++++--- plugins/Languages/ru/flag.png | Bin 676 -> 721 bytes plugins/Languages/ru/informations.xml | 5 +- plugins/Languages/ru/translation.ts | 1003 ++++++--- plugins/Languages/th/flag.png | Bin 694 -> 731 bytes plugins/Languages/th/informations.xml | 5 +- plugins/Languages/th/translation.ts | 876 ++++--- plugins/Languages/tr/flag.png | Bin 672 -> 634 bytes plugins/Languages/tr/informations.xml | 5 +- plugins/Languages/tr/translation.ts | 876 ++++--- plugins/Languages/zh/flag.png | Bin 576 -> 538 bytes plugins/Languages/zh/informations.xml | 5 +- plugins/Languages/zh/translation.ts | 886 +++++--- .../Listener/catchcopy-v0002/DebugEngineMacro.h | 7 +- plugins/Listener/catchcopy-v0002/Environment.h | 3 +- plugins/Listener/catchcopy-v0002/Variable.h | 3 +- .../catchcopy-api-0002/ClientCatchcopy.cpp | 12 +- .../catchcopy-api-0002/ClientCatchcopy.h | 3 +- .../catchcopy-api-0002/ExtraSocketCatchcopy.cpp | 47 +- .../catchcopy-api-0002/ExtraSocketCatchcopy.h | 17 +- .../catchcopy-api-0002/ServerCatchcopy.cpp | 1269 +++++------ .../catchcopy-api-0002/ServerCatchcopy.h | 264 +-- .../catchcopy-api-0002/VariablesCatchcopy.h | 3 +- plugins/Listener/catchcopy-v0002/documentation.dox | 6 +- plugins/Listener/catchcopy-v0002/informations.xml | 3 +- plugins/Listener/catchcopy-v0002/listener.cpp | 127 +- plugins/Listener/catchcopy-v0002/listener.h | 79 +- plugins/Listener/catchcopy-v0002/listener.pro | 6 +- plugins/Listener/catchcopy-v0002/plugin.json | 1 + plugins/Listener/dbus/Catchcopy.cpp | 6 +- plugins/Listener/dbus/Catchcopy.h | 8 +- plugins/Listener/dbus/DebugEngineMacro.h | 7 +- plugins/Listener/dbus/Environment.h | 3 +- plugins/Listener/dbus/Variable.h | 3 +- plugins/Listener/dbus/documentation.dox | 18 +- plugins/Listener/dbus/informations.xml | 3 +- plugins/Listener/dbus/listener.cpp | 99 +- plugins/Listener/dbus/listener.h | 65 +- plugins/Listener/dbus/listener.pro | 5 +- plugins/Listener/dbus/plugin.json | 1 + .../catchcopy-v0002/DebugEngineMacro.h | 7 +- plugins/PluginLoader/catchcopy-v0002/Environment.h | 3 +- .../catchcopy-v0002/Languages/ar/translation.ts | 5 + .../catchcopy-v0002/Languages/de/translation.ts | 8 +- .../catchcopy-v0002/Languages/el/translation.ts | 5 + .../catchcopy-v0002/Languages/en/translation.ts | 17 + .../catchcopy-v0002/Languages/es/translation.ts | 5 + .../catchcopy-v0002/Languages/fr/translation.ts | 5 + .../catchcopy-v0002/Languages/hi/translation.ts | 5 + .../catchcopy-v0002/Languages/hu/translation.ts | 17 + .../catchcopy-v0002/Languages/id/translation.ts | 5 + .../catchcopy-v0002/Languages/it/translation.ts | 9 +- .../catchcopy-v0002/Languages/ja/translation.ts | 5 + .../catchcopy-v0002/Languages/ko/translation.ts | 5 + .../catchcopy-v0002/Languages/nl/translation.ts | 5 + .../catchcopy-v0002/Languages/no/translation.ts | 5 + .../catchcopy-v0002/Languages/pl/translation.ts | 5 + .../catchcopy-v0002/Languages/pt/translation.ts | 5 + .../catchcopy-v0002/Languages/ru/translation.ts | 5 + .../catchcopy-v0002/Languages/th/translation.ts | 5 + .../catchcopy-v0002/Languages/tr/translation.ts | 5 + .../catchcopy-v0002/Languages/zh/translation.ts | 5 + .../PluginLoader/catchcopy-v0002/OptionsWidget.cpp | 16 +- .../PluginLoader/catchcopy-v0002/OptionsWidget.h | 0 .../PluginLoader/catchcopy-v0002/OptionsWidget.ui | 3 + plugins/PluginLoader/catchcopy-v0002/Variable.h | 4 +- .../PluginLoader/catchcopy-v0002/documentation.dox | 10 +- .../PluginLoader/catchcopy-v0002/informations.xml | 3 +- plugins/PluginLoader/catchcopy-v0002/plugin.json | 1 + .../PluginLoader/catchcopy-v0002/pluginLoader.cpp | 877 ++++---- .../PluginLoader/catchcopy-v0002/pluginLoader.h | 74 +- .../PluginLoader/catchcopy-v0002/pluginLoader.pro | 35 +- plugins/SessionLoader/KDE4/DebugEngineMacro.h | 7 +- plugins/SessionLoader/KDE4/Environment.h | 3 +- plugins/SessionLoader/KDE4/Variable.h | 3 +- plugins/SessionLoader/KDE4/documentation.dox | 6 +- plugins/SessionLoader/KDE4/informations.xml | 3 +- plugins/SessionLoader/KDE4/plugin.json | 1 + plugins/SessionLoader/KDE4/sessionLoader.cpp | 72 +- plugins/SessionLoader/KDE4/sessionLoader.h | 35 +- plugins/SessionLoader/KDE4/sessionLoader.pro | 4 + .../KDE4/sessionLoader.pro.user.2.7pre1 | 208 ++ plugins/SessionLoader/Windows/DebugEngineMacro.h | 7 +- plugins/SessionLoader/Windows/Environment.h | 3 +- plugins/SessionLoader/Windows/Variable.h | 3 +- plugins/SessionLoader/Windows/documentation.dox | 8 +- plugins/SessionLoader/Windows/informations.xml | 3 +- plugins/SessionLoader/Windows/plugin.json | 1 + plugins/SessionLoader/Windows/sessionLoader.cpp | 99 +- plugins/SessionLoader/Windows/sessionLoader.h | 18 +- plugins/SessionLoader/Windows/sessionLoader.pro | 5 + plugins/Themes/Oxygen/DebugEngineMacro.h | 7 +- plugins/Themes/Oxygen/Environment.h | 3 +- plugins/Themes/Oxygen/Languages/ar/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/de/translation.ts | 329 ++- plugins/Themes/Oxygen/Languages/el/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/en/translation.ts | 329 +++ plugins/Themes/Oxygen/Languages/es/translation.ts | 315 ++- plugins/Themes/Oxygen/Languages/fr/translation.ts | 305 ++- plugins/Themes/Oxygen/Languages/hi/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/hu/translation.ts | 329 +++ plugins/Themes/Oxygen/Languages/id/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/it/translation.ts | 333 ++- plugins/Themes/Oxygen/Languages/ja/translation.ts | 257 ++- plugins/Themes/Oxygen/Languages/ko/translation.ts | 285 ++- plugins/Themes/Oxygen/Languages/nl/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/no/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/pl/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/pt/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/ru/translation.ts | 317 ++- plugins/Themes/Oxygen/Languages/th/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/tr/translation.ts | 263 ++- plugins/Themes/Oxygen/Languages/zh/translation.ts | 257 ++- plugins/Themes/Oxygen/ThemesFactory.cpp | 476 ++++ plugins/Themes/Oxygen/ThemesFactory.h | 86 + plugins/Themes/Oxygen/TransferModel.cpp | 887 ++++---- plugins/Themes/Oxygen/TransferModel.h | 119 +- plugins/Themes/Oxygen/Variable.h | 6 +- plugins/Themes/Oxygen/documentation.dox | 6 +- plugins/Themes/Oxygen/factory.cpp | 146 -- plugins/Themes/Oxygen/factory.h | 61 - plugins/Themes/Oxygen/informations.xml | 3 +- plugins/Themes/Oxygen/interface.cpp | 1817 +++++++++------ plugins/Themes/Oxygen/interface.h | 355 +-- plugins/Themes/Oxygen/interface.pro | 56 +- plugins/Themes/Oxygen/interface.ui | 646 ++---- plugins/Themes/Oxygen/interfaceResources.qrc | 22 + plugins/Themes/Oxygen/interfaceResources_unix.qrc | 7 + .../Themes/Oxygen/interfaceResources_windows.qrc | 7 + plugins/Themes/Oxygen/options.ui | 281 ++- plugins/Themes/Oxygen/plugin.json | 1 + plugins/Themes/Oxygen/resources.qrc | 22 - .../Themes/Oxygen/resources/SystemTrayIcon/add.png | Bin 564 -> 552 bytes .../Oxygen/resources/SystemTrayIcon/exit.png | Bin 775 -> 874 bytes .../resources/SystemTrayIcon/informations.png | Bin 734 -> 841 bytes .../Oxygen/resources/SystemTrayIcon/options.png | Bin 660 -> 624 bytes .../SystemTrayIcon/systray_Caught_Unix.png | Bin 798 -> 1093 bytes .../SystemTrayIcon/systray_Caught_Windows.png | Bin 563 -> 623 bytes .../SystemTrayIcon/systray_Semiuncaught_Unix.png | Bin 1007 -> 1174 bytes .../systray_Semiuncaught_Windows.png | Bin 664 -> 677 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 789 -> 665 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 551 -> 439 bytes plugins/Themes/Oxygen/resources/add.png | Bin 564 -> 552 bytes plugins/Themes/Oxygen/resources/cancel.png | Bin 775 -> 874 bytes .../Oxygen/resources/export-transfer-list.png | Bin 504 -> 455 bytes .../Oxygen/resources/import-transfer-list.png | Bin 481 -> 454 bytes plugins/Themes/Oxygen/resources/main.png | Bin 563 -> 623 bytes plugins/Themes/Oxygen/resources/moveDown.png | Bin 525 -> 466 bytes plugins/Themes/Oxygen/resources/moveUp.png | Bin 484 -> 466 bytes plugins/Themes/Oxygen/resources/player_end.png | Bin 506 -> 696 bytes plugins/Themes/Oxygen/resources/player_pause.png | Bin 484 -> 640 bytes plugins/Themes/Oxygen/resources/player_play.png | Bin 501 -> 673 bytes plugins/Themes/Oxygen/resources/putOnBottom.png | Bin 691 -> 676 bytes plugins/Themes/Oxygen/resources/putOnTop.png | Bin 650 -> 681 bytes plugins/Themes/Oxygen/resources/remove.png | Bin 722 -> 683 bytes plugins/Themes/Oxygen/resources/search.png | Bin 808 -> 781 bytes plugins/Themes/Oxygen/resources_unix.qrc | 7 - plugins/Themes/Oxygen/resources_windows.qrc | 7 - plugins/Themes/Oxygen/themesOptions.ui | 426 ++++ plugins/static-plugins-oxygen.qrc | 6 + plugins/static-plugins-windows.qrc | 6 + plugins/static-plugins.qrc | 12 + resources/Languages/en/flag.png | Bin 779 -> 741 bytes resources/Languages/en/informations.xml | 8 +- resources/Languages/en/translation.ts | 1383 ++++++++++++ resources/bug-128x128.png | Bin 12933 -> 6042 bytes resources/document-encrypt.png | Bin 561 -> 0 bytes resources/moveDown.png | Bin 525 -> 466 bytes resources/moveUp.png | Bin 484 -> 466 bytes resources/none-128x128.png | Bin 11200 -> 4942 bytes resources/options.png | Bin 660 -> 624 bytes resources/qt.conf | 2 + resources/resources-windows-qt-plugin.qrc | 5 + resources/resources-windows.rc | 19 +- resources/resources.qrc | 14 - resources/resources_unix.qrc | 7 - resources/resources_windows.qrc | 7 - resources/supercopier-128x128.png | Bin 0 -> 5041 bytes resources/supercopier-16x16.png | Bin 0 -> 148 bytes resources/supercopier-all-in-one.ico | Bin 0 -> 786 bytes resources/supercopier.icns | Bin 0 -> 32304 bytes resources/supercopier.ico | Bin 0 -> 1078 bytes resources/systray_Caught_Unix.png | Bin 798 -> 1093 bytes resources/systray_Caught_Windows.png | Bin 563 -> 623 bytes resources/systray_Semiuncaught_Unix.png | Bin 1007 -> 1296 bytes resources/systray_Semiuncaught_Windows.png | Bin 664 -> 841 bytes resources/systray_Uncaught_Unix.png | Bin 789 -> 754 bytes resources/systray_Uncaught_Windows.png | Bin 551 -> 485 bytes resources/ultracopier-128x128.png | Bin 7440 -> 4928 bytes resources/ultracopier-16x16.png | Bin 672 -> 685 bytes resources/ultracopier-all-in-one.ico | Bin 0 -> 2594 bytes resources/ultracopier-resources.qrc | 15 + resources/ultracopier-resources_unix.qrc | 7 + resources/ultracopier-resources_windows.qrc | 7 + resources/ultracopier.exe.amd64.manifest | 14 - resources/ultracopier.exe.x86.manifest | 14 - resources/warning.png | Bin 0 -> 511 bytes static.pro | 33 + supercopier-static.pro | 6 + tools/unit-tester/copyEngine.cpp | 1386 ++++++++++++ tools/unit-tester/copyEngine.h | 263 +++ tools/unit-tester/copyEngineUnitTester.cpp | 104 + tools/unit-tester/copyEngineUnitTester.h | 46 + tools/unit-tester/main.cpp | 8 + tools/unit-tester/unit-tester.pro | 42 + ultracopier-all-in-one-direct.pro | 119 + ultracopier-core.pro | 125 + ultracopier-static.pro | 6 + ultracopier.dox | 6 +- ultracopier.pro | 119 - 826 files changed, 96909 insertions(+), 75977 deletions(-) delete mode 100644 AuthPlugin.cpp delete mode 100644 AuthPlugin.h mode change 100755 => 100644 CopyListener.cpp mode change 100755 => 100644 CopyListener.h mode change 100755 => 100644 Core.cpp create mode 100644 DebugModel.cpp delete mode 100644 GlobalClass.cpp delete mode 100644 GlobalClass.h create mode 100644 InternetUpdater.cpp create mode 100644 InternetUpdater.h mode change 100755 => 100644 LanguagesManager.cpp create mode 100644 OSSpecific.cpp create mode 100644 OSSpecific.h create mode 100644 OSSpecific.ui mode change 100755 => 100644 OptionDialog.cpp mode change 100755 => 100644 OptionDialog.h mode change 100755 => 100644 PluginLoader.cpp mode change 100755 => 100644 PluginLoader.h delete mode 100644 Singleton.h delete mode 100644 patch/comercial/rsync-copy-engine.patch delete mode 100644 patch/opensource/KDE-Ultracopier.patch delete mode 100644 patch/opensource/options-with-pass.patch delete mode 100644 plugins-alternative/CopyEngine/Rsync/AvancedQFile.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/AvancedQFile.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/CompilerInfo.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/DebugEngineMacro.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/Environment.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/FilterRules.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/FilterRules.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/FilterRules.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/Filters.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/Filters.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/Filters.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/ar/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/de/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/el/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/es/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/fr/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/hi/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/id/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/it/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/ja/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/ko/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/nl/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/no/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/pl/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/pt/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/ru/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/th/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/tr/translation.ts delete mode 100644 plugins-alternative/CopyEngine/Rsync/Languages/zh/translation.ts delete mode 100755 plugins-alternative/CopyEngine/Rsync/ListThread.cpp delete mode 100755 plugins-alternative/CopyEngine/Rsync/ListThread.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/ListThread_InodeAction.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/MkPath.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/MkPath.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/ReadThread.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/ReadThread.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/RenamingRules.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/RenamingRules.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/RenamingRules.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/RmPath.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/RmPath.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/StructEnumDefinition.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/StructEnumDefinition_CopyEngine.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/TransferThread.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/TransferThread.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/Variable.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/WriteThread.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/WriteThread.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/copyEngine-collision-and-error.cpp delete mode 100755 plugins-alternative/CopyEngine/Rsync/copyEngine.cpp delete mode 100755 plugins-alternative/CopyEngine/Rsync/copyEngine.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/copyEngine.pro delete mode 100644 plugins-alternative/CopyEngine/Rsync/debugDialog.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/debugDialog.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/debugDialog.ui delete mode 100755 plugins-alternative/CopyEngine/Rsync/documentation.dox delete mode 100644 plugins-alternative/CopyEngine/Rsync/factory.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/factory.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileErrorDialog.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileErrorDialog.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileErrorDialog.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileExistsDialog.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileExistsDialog.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileExistsDialog.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/folderExistsDialog.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/folderExistsDialog.h delete mode 100644 plugins-alternative/CopyEngine/Rsync/folderExistsDialog.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/informations.xml delete mode 100644 plugins-alternative/CopyEngine/Rsync/options.ui delete mode 100644 plugins-alternative/CopyEngine/Rsync/resources.qrc delete mode 100644 plugins-alternative/CopyEngine/Rsync/resources/add.png delete mode 100644 plugins-alternative/CopyEngine/Rsync/resources/edit.png delete mode 100644 plugins-alternative/CopyEngine/Rsync/resources/filter.png delete mode 100644 plugins-alternative/CopyEngine/Rsync/resources/remove.png delete mode 100644 plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.cpp delete mode 100644 plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.h create mode 100644 plugins-alternative/PluginLoader/keybinding/DebugEngineMacro.h create mode 100644 plugins-alternative/PluginLoader/keybinding/Environment.h create mode 100644 plugins-alternative/PluginLoader/keybinding/KeyBind.cpp create mode 100644 plugins-alternative/PluginLoader/keybinding/KeyBind.h create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/ar/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/de/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/el/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/en/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/es/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/fr/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/hi/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/hu/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/id/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/it/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/ja/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/ko/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/nl/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/no/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/pl/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/pt/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/ru/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/th/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/tr/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/Languages/zh/translation.ts create mode 100644 plugins-alternative/PluginLoader/keybinding/OptionsWidget.cpp create mode 100644 plugins-alternative/PluginLoader/keybinding/OptionsWidget.h create mode 100644 plugins-alternative/PluginLoader/keybinding/OptionsWidget.ui create mode 100644 plugins-alternative/PluginLoader/keybinding/PlatformMacro.h create mode 100644 plugins-alternative/PluginLoader/keybinding/StructEnumDefinition.h create mode 100644 plugins-alternative/PluginLoader/keybinding/Variable.h create mode 100644 plugins-alternative/PluginLoader/keybinding/documentation.dox create mode 100644 plugins-alternative/PluginLoader/keybinding/informations.xml create mode 100644 plugins-alternative/PluginLoader/keybinding/plugin.json create mode 100644 plugins-alternative/PluginLoader/keybinding/pluginLoader.cpp create mode 100644 plugins-alternative/PluginLoader/keybinding/pluginLoader.h create mode 100644 plugins-alternative/PluginLoader/keybinding/pluginLoader.pro create mode 100644 plugins-alternative/PluginLoader/keybinding/pluginLoader.pro.user.3.3-pre1 create mode 100644 plugins-alternative/Themes/Clean/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/hu/translation.ts mode change 100755 => 100644 plugins-alternative/Themes/Clean/documentation.dox create mode 100644 plugins-alternative/Themes/Clean/plugin.json create mode 100644 plugins-alternative/Themes/Supercopier/DebugEngineMacro.h create mode 100644 plugins-alternative/Themes/Supercopier/Environment.h create mode 100644 plugins-alternative/Themes/Supercopier/Languages/ar/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/de/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/el/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/es/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/fr/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/hi/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/hu/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/id/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/it/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/ja/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/ko/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/nl/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/no/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/pl/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/pt/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/ru/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/th/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/tr/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/Languages/zh/translation.ts create mode 100644 plugins-alternative/Themes/Supercopier/StructEnumDefinition.h create mode 100644 plugins-alternative/Themes/Supercopier/TransferModel.cpp create mode 100644 plugins-alternative/Themes/Supercopier/TransferModel.h create mode 100644 plugins-alternative/Themes/Supercopier/Variable.h create mode 100644 plugins-alternative/Themes/Supercopier/documentation.dox create mode 100644 plugins-alternative/Themes/Supercopier/factory.cpp create mode 100644 plugins-alternative/Themes/Supercopier/factory.h create mode 100644 plugins-alternative/Themes/Supercopier/informations.xml create mode 100644 plugins-alternative/Themes/Supercopier/interface.cpp create mode 100644 plugins-alternative/Themes/Supercopier/interface.h create mode 100644 plugins-alternative/Themes/Supercopier/interface.pro create mode 100644 plugins-alternative/Themes/Supercopier/interface.ui create mode 100644 plugins-alternative/Themes/Supercopier/interfaceResources.qrc create mode 100644 plugins-alternative/Themes/Supercopier/interfaceResources_unix.qrc create mode 100644 plugins-alternative/Themes/Supercopier/interfaceResources_windows.qrc create mode 100644 plugins-alternative/Themes/Supercopier/plugin.json create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/add.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/exit.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/informations.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/options.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Unix.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Windows.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Unix.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Windows.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/add.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/cancel.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/export-transfer-list.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/import-transfer-list.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/main.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/moveDown.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/moveUp.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/player_end.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/player_pause.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/player_play.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/progressbarleft.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/progressbarright.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/putOnBottom.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/putOnTop.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/remove.png create mode 100644 plugins-alternative/Themes/Supercopier/resources/search.png create mode 100644 plugins-alternative/Themes/Supercopier/themesOptions.ui create mode 100644 plugins-alternative/Themes/Teracopy/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts mode change 100755 => 100644 plugins-alternative/Themes/Teracopy/documentation.dox create mode 100644 plugins-alternative/Themes/Teracopy/plugin.json create mode 100644 plugins-alternative/Themes/Windows/DebugEngineMacro.h create mode 100644 plugins-alternative/Themes/Windows/Environment.h create mode 100644 plugins-alternative/Themes/Windows/Languages/ar/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/de/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/el/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/es/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/fr/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/hi/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/hu/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/id/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/it/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/ja/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/ko/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/nl/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/no/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/pl/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/ru/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/th/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/tr/translation.ts create mode 100644 plugins-alternative/Themes/Windows/Languages/zh/translation.ts create mode 100644 plugins-alternative/Themes/Windows/StructEnumDefinition.h create mode 100644 plugins-alternative/Themes/Windows/TransferModel.cpp create mode 100644 plugins-alternative/Themes/Windows/TransferModel.h create mode 100644 plugins-alternative/Themes/Windows/Variable.h create mode 100644 plugins-alternative/Themes/Windows/documentation.dox create mode 100644 plugins-alternative/Themes/Windows/factory.cpp create mode 100644 plugins-alternative/Themes/Windows/factory.h create mode 100644 plugins-alternative/Themes/Windows/informations.xml create mode 100644 plugins-alternative/Themes/Windows/interface.cpp create mode 100644 plugins-alternative/Themes/Windows/interface.h create mode 100644 plugins-alternative/Themes/Windows/interface.pro create mode 100644 plugins-alternative/Themes/Windows/interface.ui create mode 100644 plugins-alternative/Themes/Windows/plugin.json create mode 100644 plugins-alternative/Themes/Windows/resources.qrc create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/informations.png create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Unix.png create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Windows.png create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Unix.png create mode 100644 plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Windows.png create mode 100644 plugins-alternative/Themes/Windows/resources/arrow-down.png create mode 100644 plugins-alternative/Themes/Windows/resources/arrow-up.png create mode 100644 plugins-alternative/Themes/Windows/resources/empty.png create mode 100644 plugins-alternative/Themes/Windows/resources/icon-top.png create mode 100644 plugins-alternative/Themes/Windows/resources/icon-top.xcf create mode 100644 plugins-alternative/Themes/Windows/resources/icon.png create mode 100644 plugins-alternative/Themes/Windows/resources_unix.qrc create mode 100644 plugins-alternative/Themes/Windows/resources_windows.qrc create mode 100644 plugins-alternative/static-plugins-supercopier.qrc create mode 100644 plugins/CopyEngine/Rsync/Rsync.pro delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/CompilerInfo.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/DebugEngineMacro.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Environment.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/FilterRules.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/FilterRules.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/FilterRules.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Filters.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Filters.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Filters.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/ar/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/de/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/el/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/es/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/fr/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/hi/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/id/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/it/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/ja/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/ko/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/nl/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/no/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/pl/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/pt/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/ru/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/th/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/tr/translation.ts delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Languages/zh/translation.ts delete mode 100755 plugins/CopyEngine/Ultracopier-0.3/ListThread.cpp delete mode 100755 plugins/CopyEngine/Ultracopier-0.3/ListThread.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/ListThread_InodeAction.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/MkPath.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/MkPath.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/ReadThread.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/ReadThread.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/RenamingRules.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/RenamingRules.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/RenamingRules.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/RmPath.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/RmPath.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition_CopyEngine.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/TransferThread.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/TransferThread.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/Variable.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/WriteThread.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/WriteThread.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/copyEngine-collision-and-error.cpp delete mode 100755 plugins/CopyEngine/Ultracopier-0.3/copyEngine.cpp delete mode 100755 plugins/CopyEngine/Ultracopier-0.3/copyEngine.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/copyEngine.pro delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/debugDialog.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/debugDialog.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/debugDialog.ui delete mode 100755 plugins/CopyEngine/Ultracopier-0.3/documentation.dox delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/factory.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/factory.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.h delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/informations.xml delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/options.ui delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/resources.qrc delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/resources/add.png delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/resources/edit.png delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/resources/filter.png delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/resources/remove.png delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.cpp delete mode 100644 plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.h create mode 100644 plugins/CopyEngine/Ultracopier/AvancedQFile.cpp create mode 100644 plugins/CopyEngine/Ultracopier/AvancedQFile.h create mode 100644 plugins/CopyEngine/Ultracopier/CompilerInfo.h create mode 100644 plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp create mode 100644 plugins/CopyEngine/Ultracopier/CopyEngine.cpp create mode 100644 plugins/CopyEngine/Ultracopier/CopyEngine.h create mode 100644 plugins/CopyEngine/Ultracopier/CopyEngine.pro create mode 100644 plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp create mode 100644 plugins/CopyEngine/Ultracopier/CopyEngineFactory.h create mode 100644 plugins/CopyEngine/Ultracopier/DebugDialog.cpp create mode 100644 plugins/CopyEngine/Ultracopier/DebugDialog.h create mode 100644 plugins/CopyEngine/Ultracopier/DebugEngineMacro.h create mode 100644 plugins/CopyEngine/Ultracopier/DiskSpace.cpp create mode 100644 plugins/CopyEngine/Ultracopier/DiskSpace.h create mode 100644 plugins/CopyEngine/Ultracopier/DiskSpace.ui create mode 100644 plugins/CopyEngine/Ultracopier/DriveManagement.cpp create mode 100644 plugins/CopyEngine/Ultracopier/DriveManagement.h create mode 100644 plugins/CopyEngine/Ultracopier/Environment.h create mode 100644 plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp create mode 100644 plugins/CopyEngine/Ultracopier/FileErrorDialog.h create mode 100644 plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp create mode 100644 plugins/CopyEngine/Ultracopier/FileExistsDialog.h create mode 100644 plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp create mode 100644 plugins/CopyEngine/Ultracopier/FileIsSameDialog.h create mode 100644 plugins/CopyEngine/Ultracopier/FilterRules.cpp create mode 100644 plugins/CopyEngine/Ultracopier/FilterRules.h create mode 100644 plugins/CopyEngine/Ultracopier/FilterRules.ui create mode 100644 plugins/CopyEngine/Ultracopier/Filters.cpp create mode 100644 plugins/CopyEngine/Ultracopier/Filters.h create mode 100644 plugins/CopyEngine/Ultracopier/Filters.ui create mode 100644 plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp create mode 100644 plugins/CopyEngine/Ultracopier/FolderExistsDialog.h create mode 100644 plugins/CopyEngine/Ultracopier/Languages/ar/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/de/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/el/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/en/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/es/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/fr/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/hi/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/hu/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/id/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/it/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/ja/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/ko/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/nl/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/no/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/pl/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/pt/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/ru/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/th/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/tr/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/Languages/zh/translation.ts create mode 100644 plugins/CopyEngine/Ultracopier/ListThread.cpp create mode 100644 plugins/CopyEngine/Ultracopier/ListThread.h create mode 100644 plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp create mode 100644 plugins/CopyEngine/Ultracopier/MkPath.cpp create mode 100644 plugins/CopyEngine/Ultracopier/MkPath.h create mode 100644 plugins/CopyEngine/Ultracopier/ReadThread.cpp create mode 100644 plugins/CopyEngine/Ultracopier/ReadThread.h create mode 100644 plugins/CopyEngine/Ultracopier/RenamingRules.cpp create mode 100644 plugins/CopyEngine/Ultracopier/RenamingRules.h create mode 100644 plugins/CopyEngine/Ultracopier/RenamingRules.ui create mode 100644 plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp create mode 100644 plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h create mode 100644 plugins/CopyEngine/Ultracopier/StructEnumDefinition.h create mode 100644 plugins/CopyEngine/Ultracopier/StructEnumDefinition_CopyEngine.h create mode 100644 plugins/CopyEngine/Ultracopier/TransferThread.cpp create mode 100644 plugins/CopyEngine/Ultracopier/TransferThread.h create mode 100644 plugins/CopyEngine/Ultracopier/Variable.h create mode 100644 plugins/CopyEngine/Ultracopier/WriteThread.cpp create mode 100644 plugins/CopyEngine/Ultracopier/WriteThread.h create mode 100644 plugins/CopyEngine/Ultracopier/copyEngineOptions.ui create mode 100644 plugins/CopyEngine/Ultracopier/copyEngineResources.qrc create mode 100644 plugins/CopyEngine/Ultracopier/debugDialog.ui create mode 100644 plugins/CopyEngine/Ultracopier/documentation.dox create mode 100644 plugins/CopyEngine/Ultracopier/fileErrorDialog.ui create mode 100644 plugins/CopyEngine/Ultracopier/fileExistsDialog.ui create mode 100644 plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui create mode 100644 plugins/CopyEngine/Ultracopier/folderExistsDialog.ui create mode 100644 plugins/CopyEngine/Ultracopier/informations-rsync.xml create mode 100644 plugins/CopyEngine/Ultracopier/informations.xml create mode 100644 plugins/CopyEngine/Ultracopier/plugin.json create mode 100644 plugins/CopyEngine/Ultracopier/resources/add.png create mode 100644 plugins/CopyEngine/Ultracopier/resources/edit.png create mode 100644 plugins/CopyEngine/Ultracopier/resources/filter.png create mode 100644 plugins/CopyEngine/Ultracopier/resources/remove.png create mode 100644 plugins/Languages/hu/flag.png create mode 100644 plugins/Languages/hu/informations.xml create mode 100644 plugins/Languages/hu/translation.ts mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/documentation.dox mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/listener.cpp mode change 100755 => 100644 plugins/Listener/catchcopy-v0002/listener.h create mode 100644 plugins/Listener/catchcopy-v0002/plugin.json mode change 100755 => 100644 plugins/Listener/dbus/documentation.dox mode change 100755 => 100644 plugins/Listener/dbus/listener.cpp mode change 100755 => 100644 plugins/Listener/dbus/listener.h create mode 100644 plugins/Listener/dbus/plugin.json mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/Environment.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/Variable.h mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/documentation.dox mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/informations.xml create mode 100644 plugins/PluginLoader/catchcopy-v0002/plugin.json mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/pluginLoader.h mode change 100755 => 100644 plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro mode change 100755 => 100644 plugins/SessionLoader/KDE4/documentation.dox create mode 100644 plugins/SessionLoader/KDE4/plugin.json create mode 100644 plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 mode change 100755 => 100644 plugins/SessionLoader/Windows/documentation.dox create mode 100644 plugins/SessionLoader/Windows/plugin.json mode change 100755 => 100644 plugins/SessionLoader/Windows/sessionLoader.cpp mode change 100755 => 100644 plugins/SessionLoader/Windows/sessionLoader.h create mode 100644 plugins/Themes/Oxygen/Languages/en/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/hu/translation.ts create mode 100644 plugins/Themes/Oxygen/ThemesFactory.cpp create mode 100644 plugins/Themes/Oxygen/ThemesFactory.h mode change 100755 => 100644 plugins/Themes/Oxygen/documentation.dox delete mode 100644 plugins/Themes/Oxygen/factory.cpp delete mode 100644 plugins/Themes/Oxygen/factory.h mode change 100755 => 100644 plugins/Themes/Oxygen/interface.cpp mode change 100755 => 100644 plugins/Themes/Oxygen/interface.h create mode 100644 plugins/Themes/Oxygen/interfaceResources.qrc create mode 100644 plugins/Themes/Oxygen/interfaceResources_unix.qrc create mode 100644 plugins/Themes/Oxygen/interfaceResources_windows.qrc create mode 100644 plugins/Themes/Oxygen/plugin.json delete mode 100644 plugins/Themes/Oxygen/resources.qrc delete mode 100644 plugins/Themes/Oxygen/resources_unix.qrc delete mode 100644 plugins/Themes/Oxygen/resources_windows.qrc create mode 100644 plugins/Themes/Oxygen/themesOptions.ui create mode 100644 plugins/static-plugins-oxygen.qrc create mode 100644 plugins/static-plugins-windows.qrc create mode 100644 plugins/static-plugins.qrc create mode 100644 resources/Languages/en/translation.ts delete mode 100644 resources/document-encrypt.png create mode 100644 resources/qt.conf create mode 100644 resources/resources-windows-qt-plugin.qrc delete mode 100644 resources/resources.qrc delete mode 100644 resources/resources_unix.qrc delete mode 100644 resources/resources_windows.qrc create mode 100644 resources/supercopier-128x128.png create mode 100644 resources/supercopier-16x16.png create mode 100644 resources/supercopier-all-in-one.ico create mode 100644 resources/supercopier.icns create mode 100644 resources/supercopier.ico create mode 100644 resources/ultracopier-all-in-one.ico create mode 100644 resources/ultracopier-resources.qrc create mode 100644 resources/ultracopier-resources_unix.qrc create mode 100644 resources/ultracopier-resources_windows.qrc delete mode 100644 resources/ultracopier.exe.amd64.manifest delete mode 100644 resources/ultracopier.exe.x86.manifest create mode 100644 resources/warning.png create mode 100644 static.pro create mode 100644 supercopier-static.pro create mode 100644 tools/unit-tester/copyEngine.cpp create mode 100644 tools/unit-tester/copyEngine.h create mode 100644 tools/unit-tester/copyEngineUnitTester.cpp create mode 100644 tools/unit-tester/copyEngineUnitTester.h create mode 100644 tools/unit-tester/main.cpp create mode 100644 tools/unit-tester/unit-tester.pro create mode 100644 ultracopier-all-in-one-direct.pro create mode 100644 ultracopier-core.pro create mode 100644 ultracopier-static.pro mode change 100755 => 100644 ultracopier.dox delete mode 100644 ultracopier.pro diff --git a/AuthPlugin.cpp b/AuthPlugin.cpp deleted file mode 100644 index fcea81c..0000000 --- a/AuthPlugin.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/** \file AuthPlugin.cpp -\brief Define the authentication plugin -\author alpha_one_x86 -\version 0.3 -\date 2010 -\copyright GNU Public License 3 (GPL3), see the file COPYING */ - -#include - -#include "AuthPlugin.h" - -AuthPlugin::AuthPlugin() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //load the overall instance - stopIt=false; - //set sem to 1 - sem.release(); - moveToThread(this); -} - -AuthPlugin::~AuthPlugin() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - stop(); -} - -QStringList AuthPlugin::getFileList(const QString &path) -{ - QStringList list; - QDir dir(path); - if(dir.exists()) - { - foreach(QString dirName, dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot)) - list<readPath=readPath; - this->searchPathPlugin=searchPathPlugin; -} - -void AuthPlugin::stop() -{ - stopIt=true; - sem.acquire(); - sem.release(); -} diff --git a/AuthPlugin.h b/AuthPlugin.h deleted file mode 100644 index dda14ac..0000000 --- a/AuthPlugin.h +++ /dev/null @@ -1,46 +0,0 @@ -/** \file AuthPlugin.h -\brief Define the authentication plugin -\author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ - -#ifndef AUTHPLUGIN_H -#define AUTHPLUGIN_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -/** \brief allow authentify the plugin */ -class AuthPlugin : public QThread -{ - Q_OBJECT -public: - AuthPlugin(); - ~AuthPlugin(); - /** \brief stop all action to close ultracopier */ - void stop(); - /** \brief add path to check - \param readPath list of read place - \param searchPathPlugin list of plugin place - */ - void loadSearchPath(const QStringList &readPath,const QStringList &searchPathPlugin); -protected: - void run(); -private: - bool stopIt; - QSemaphore sem; - QStringList readPath; - QStringList searchPathPlugin; - static QStringList getFileList(const QString &path); -signals: - void authentifiedPath(QString); -}; - -#endif // AUTHPLUGIN_H diff --git a/CliParser.cpp b/CliParser.cpp index 13aeac1..e2a9780 100644 --- a/CliParser.cpp +++ b/CliParser.cpp @@ -1,8 +1,6 @@ /** \file CliParser.cpp \brief To group into one class, the CLI parsing \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "CliParser.h" @@ -20,150 +18,165 @@ CliParser::CliParser(QObject *parent) : */ void CliParser::cli(const QStringList &ultracopierArguments,const bool &external,const bool &onlyCheck) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";")); - if(ultracopierArguments.size()==1) - { - if(external) - QMessageBox::warning(NULL,tr("Warning"),tr("Ultracopier is already running, right click on its system tray icon (near the clock) to use it")); - // else do nothing, is normal starting without arguements - return; - } - if(ultracopierArguments.size()==2) - { - if(ultracopierArguments.last()=="quit" && external) - { - if(onlyCheck) - return; - QCoreApplication::exit(); - return; - } - if(ultracopierArguments.last()=="--help") - { - showHelp(false); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Command line not understand"); - showHelp(); - return; - } - if(ultracopierArguments.size()==3) - { - if(ultracopierArguments[1]=="Transfer-list") - { - if(onlyCheck) - return; - QFile transferFile(ultracopierArguments.last()); - if(transferFile.open(QIODevice::ReadOnly)) - { - QString content; - QByteArray data=transferFile.readLine(64); - if(data.size()<=0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Problem at the reading, or file size is null")); - QMessageBox::warning(NULL,tr("Warning"),tr("Problem at the reading, or file size is null")); - transferFile.close(); - return; - } - content=QString::fromUtf8(data); - content.remove('\n'); - QStringList transferListArguments=content.split(';'); - if(transferListArguments.size()!=4 || transferListArguments[0]!="Ultracopier-0.3" || transferListArguments[1]!="Transfer-list") - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("This file is not supported transfer list")); - QMessageBox::warning(NULL,tr("Warning"),tr("This file is not supported transfer list")); - transferFile.close(); - return; - } - transferFile.close(); - emit newTransferList(transferListArguments[3],transferListArguments[2],ultracopierArguments.last()); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to open the transfer list file: %1").arg(transferFile.errorString())); - QMessageBox::warning(NULL,tr("Warning"),tr("Unable to open the transfer list file")); - return; - } - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Command line not understand"); - showHelp(); - return; - } - if(ultracopierArguments.size()>3) - { - if(ultracopierArguments[1]=="Copy" || ultracopierArguments[1]=="cp") - { - if(onlyCheck) - return; - QStringList transferList=ultracopierArguments; - transferList.removeFirst(); - transferList.removeFirst(); - if(transferList.last()=="?") - { - transferList.removeLast(); - emit newCopy(transferList); - } - else - { - QString destination=transferList.last(); - transferList.removeLast(); - emit newCopy(transferList,destination); - } - return; - } - if(ultracopierArguments[1]=="Move" || ultracopierArguments[1]=="mv") - { - if(onlyCheck) - return; - QStringList transferList=ultracopierArguments; - transferList.removeFirst(); - transferList.removeFirst(); - if(transferList.last()=="?") - { - transferList.removeLast(); - emit newMove(transferList); - } - else - { - QString destination=transferList.last(); - transferList.removeLast(); - emit newMove(transferList,destination); - } - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Command line not understand"); - showHelp(); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Command line not understand"); - showHelp(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("ultracopierArguments: ")+ultracopierArguments.join(QStringLiteral(";"))); + if(ultracopierArguments.size()==1) + { + if(external) + QMessageBox::warning(NULL,tr("Warning"),tr("Ultracopier is already running, right click on its system tray icon (near the clock) to use it")); + // else do nothing, is normal starting without arguements + return; + } + else if(ultracopierArguments.size()==2) + { + if(ultracopierArguments.last()==QStringLiteral("quit")) + { + if(onlyCheck) + return; + QCoreApplication::exit(); + return; + } + else if(ultracopierArguments.last()==QStringLiteral("--help")) + { + showHelp(false); + return; + } + else if(ultracopierArguments.last()==QStringLiteral("--options")) + { + emit showOptions(); + return; + } + else if(ultracopierArguments.last().endsWith(QStringLiteral(".urc"))) + { + tryLoadPlugin(ultracopierArguments.last()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Command line not understand"); + showHelp(); + return; + } + else if(ultracopierArguments.size()==3) + { + if(ultracopierArguments.at(1)==QStringLiteral("Transfer-list")) + { + if(onlyCheck) + return; + QFile transferFile(ultracopierArguments.last()); + if(transferFile.open(QIODevice::ReadOnly)) + { + QString content; + QByteArray data=transferFile.readLine(64); + if(data.size()<=0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Problem reading file, or file size is 0")); + QMessageBox::warning(NULL,tr("Warning"),tr("Problem reading file, or file size is 0")); + transferFile.close(); + return; + } + content=QString::fromUtf8(data); + QStringList transferListArguments=content.split(';'); + transferListArguments[3].remove('\n'); + if(transferListArguments.at(0)!="Ultracopier" || + transferListArguments.at(1)!="Transfer-list" || + (transferListArguments.at(2)!="Transfer" && transferListArguments.at(2)!="Copy" && transferListArguments.at(2)!="Move") + ) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("This file is not supported transfer list")); + QMessageBox::warning(NULL,tr("Warning"),tr("This file is not supported transfer list")); + transferFile.close(); + return; + } + transferFile.close(); + emit newTransferList(transferListArguments.at(3),transferListArguments.at(2),ultracopierArguments.last()); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("Unable to open the transfer list file: %1").arg(transferFile.errorString())); + QMessageBox::warning(NULL,tr("Warning"),tr("Unable to open the transfer list file")); + return; + } + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Command line not understand"); + showHelp(); + return; + } + else if(ultracopierArguments.size()>3) + { + if(ultracopierArguments.at(1)==QStringLiteral("Copy") || ultracopierArguments.at(1)==QStringLiteral("cp")) + { + if(onlyCheck) + return; + QStringList transferList=ultracopierArguments; + transferList.removeFirst(); + transferList.removeFirst(); + if(transferList.last()=="?") + { + transferList.removeLast(); + emit newCopyWithoutDestination(transferList); + } + else + { + QString destination=transferList.last(); + transferList.removeLast(); + emit newCopy(transferList,destination); + } + return; + } + else if(ultracopierArguments.at(1)==QStringLiteral("Move") || ultracopierArguments.at(1)==QStringLiteral("mv")) + { + if(onlyCheck) + return; + QStringList transferList=ultracopierArguments; + transferList.removeFirst(); + transferList.removeFirst(); + if(transferList.last()=="?") + { + transferList.removeLast(); + emit newMoveWithoutDestination(transferList); + } + else + { + QString destination=transferList.last(); + transferList.removeLast(); + emit newMove(transferList,destination); + } + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Command line not understand")); + showHelp(); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Command line not understand")); + showHelp(); } /** \brief show the help *\param incorrectArguments if the help is call because the arguments are wrong */ void CliParser::showHelp(const bool &incorrectArguments) { - if(incorrectArguments) - qDebug() << "Incorrect arguments detected"; - qDebug() << tr("The arguments possibles are:"); - qDebug() << "--help : "+tr("To have this help"); - qDebug() << "quit : "+tr("To quit the other instance running (if have)"); - qDebug() << "Transfer-list [transfer list file] : "+tr("To pass transfer list to do"); - qDebug() << "cp [source [source2]] [destination] : "+tr("To copy sources separated by space to destination. If destination is \"?\", ultracopier will ask it to the user"); - qDebug() << "mv [source [source2]] [destination] : "+tr("Same as above, but with move"); + if(incorrectArguments) + qDebug() << "Incorrect arguments detected"; + qDebug() << tr("The arguments possible are:"); + qDebug() << "--help : "+tr("To display this help"); + qDebug() << "--options : "+tr("To display the options"); + qDebug() << "quit : "+tr("To quit the other instances (if running)"); + qDebug() << "Transfer-list [transfer list file] : "+tr("Open transfer list"); + qDebug() << "cp [source [source2]] [destination] : "+tr("To copy sources to destination, separated by space. If destination is \"?\", ultracopier will ask the user"); + qDebug() << "mv [source [source2]] [destination] : "+tr("To move sources to destination, separated by space. If destination is \"?\", ultracopier will ask the user"); - QString message; - if(incorrectArguments) - message+=""+tr("Command line not understand")+"
\n"; - message+=+""+tr("The arguments possibles are:")+"\n
    "; - message+="
  • --help : "+tr("To have this help")+"
  • \n"; - message+="
  • quit : "+tr("To quit the other instance running (if have)")+"
  • \n"; - message+="
  • Transfer-list [transfer list file] : "+tr("To pass transfer list to do")+"
  • \n"; - message+="
  • cp [source [source2]] [destination] : "+tr("To copy sources separated by space to destination. If destination is \"?\", ultracopier will ask it to the user")+"
  • \n"; - message+="
  • mv [source [source2]] [destination] : "+tr("Same as above, but with move")+"
  • \n"; - message+=+"
"; - if(incorrectArguments) - QMessageBox::warning(NULL,tr("Warning"),message); - else - QMessageBox::information(NULL,tr("Help"),message); + QString message; + if(incorrectArguments) + message+=""+tr("Command not valid")+"
\n"; + message+=+""+tr("The arguments possible are:")+"\n
    "; + message+="
  • --help : "+tr("To display this help")+"
  • \n"; + message+="
  • --options : "+tr("To display the options")+"
  • \n"; + message+="
  • quit : "+tr("To quit the other instances (if running)")+"
  • \n"; + message+="
  • Transfer-list [transfer list file] : "+tr("Open transfer list")+"
  • \n"; + message+="
  • cp [source [source2]] [destination] : "+tr("To copy sources to destination, separated by space. If destination is \"?\", ultracopier will ask the user")+"
  • \n"; + message+="
  • mv [source [source2]] [destination] : "+tr("To move sources to destination, separated by space. If destination is \"?\", ultracopier will ask the user")+"
  • \n"; + message+=+"
"; + if(incorrectArguments) + QMessageBox::warning(NULL,tr("Warning"),message); + else + QMessageBox::information(NULL,tr("Help"),message); } diff --git a/CliParser.h b/CliParser.h index 360f30e..a2f3617 100644 --- a/CliParser.h +++ b/CliParser.h @@ -1,8 +1,6 @@ /** \file CliParser.h \brief To group into one class, the CLI parsing \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef CLIPARSER_H @@ -18,30 +16,34 @@ /** \brief class to parse all command line options */ class CliParser : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit CliParser(QObject *parent = 0); + explicit CliParser(QObject *parent = 0); public slots: - /** \brief method to parse the ultracopier arguments - \param ultracopierArguments the argument list - \param external true if the arguments come from other instance of ultracopier - */ - void cli(const QStringList &ultracopierArguments,const bool &external,const bool &onlyCheck); + /** \brief method to parse the ultracopier arguments + \param ultracopierArguments the argument list + \param external true if the arguments come from other instance of ultracopier + */ + void cli(const QStringList &ultracopierArguments,const bool &external,const bool &onlyCheck); signals: - /** new copy without destination have been pased by the CLI */ - void newCopy(QStringList sources); - /** new copy with destination have been pased by the CLI */ - void newCopy(QStringList sources,QString destination); - /** new move without destination have been pased by the CLI */ - void newMove(QStringList sources); - /** new move with destination have been pased by the CLI */ - void newMove(QStringList sources,QString destination); - /** new transfer list pased by the CLI */ - void newTransferList(QString engine,QString mode,QString file); + /** new copy without destination have been pased by the CLI */ + void newCopyWithoutDestination(QStringList sources) const; + /** new copy with destination have been pased by the CLI */ + void newCopy(QStringList sources,QString destination) const; + /** new move without destination have been pased by the CLI */ + void newMoveWithoutDestination(QStringList sources) const; + /** new move with destination have been pased by the CLI */ + void newMove(QStringList sources,QString destination) const; + /** new transfer list pased by the CLI */ + void newTransferList(QString engine,QString mode,QString file) const; + + void tryLoadPlugin(const QString &file) const; + /// \brief Show the help option + void showOptions() const; private: - /** \brief show the help - *\param incorrectArguments if the help is call because the arguments are wrong */ - void showHelp(const bool &incorrectArguments=true); + /** \brief show the help + *\param incorrectArguments if the help is call because the arguments are wrong */ + void showHelp(const bool &incorrectArguments=true); }; #endif // CLIPARSER_H diff --git a/CompilerInfo.h b/CompilerInfo.h index 6cc079b..c4b4464 100644 --- a/CompilerInfo.h +++ b/CompilerInfo.h @@ -1,8 +1,6 @@ /** \file CompilerInfo.h \brief Define the compiler info \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ /// \def COMPILERINFO the string to identify the compiler diff --git a/CopyEngineManager.cpp b/CopyEngineManager.cpp index 4808fc7..2355743 100644 --- a/CopyEngineManager.cpp +++ b/CopyEngineManager.cpp @@ -1,343 +1,381 @@ /** \file CopyEngineManager.cpp \brief Define the copy engine manager \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ -#include #include #include "CopyEngineManager.h" +#include "LanguagesManager.h" + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include "plugins/CopyEngine/Ultracopier/CopyEngineFactory.h" +#endif CopyEngineManager::CopyEngineManager(OptionDialog *optionDialog) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - connect(languages, SIGNAL(newLanguageLoaded(QString)), &facilityEngine,SLOT(retranslate()),Qt::DirectConnection); - this->optionDialog=optionDialog; - //setup the ui layout - plugins->lockPluginListEdition(); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - connect(plugins,SIGNAL(pluginListingIsfinish()), this,SLOT(allPluginIsloaded()),Qt::QueuedConnection); - QList list=plugins->getPluginsByCategory(PluginType_CopyEngine); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - //load the options - isConnected=false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->optionDialog=optionDialog; + //setup the ui layout + PluginsManager::pluginsManager->lockPluginListEdition(); + connect(this,&CopyEngineManager::previouslyPluginAdded, this,&CopyEngineManager::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginAdded, this,&CopyEngineManager::onePluginAdded,Qt::QueuedConnection); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved, this,&CopyEngineManager::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish, this,&CopyEngineManager::allPluginIsloaded,Qt::QueuedConnection); + QList list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_CopyEngine); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + //load the options + isConnected=false; } void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_CopyEngine) - return; - //setFileName - QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName("copyEngine"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+pluginPath); - //search into loaded session - int index=0; - while(indexinstance(); - if(pluginObject==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to load the plugin: %1").arg(newItem.pointer->errorString())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to load the plugin for %1").arg(newItem.pluginPath)); - newItem.pointer->unload(); - return; - } - newItem.factory = qobject_cast(pluginObject); - //check if found - index=0; - while(indexunload(); - return; - } - index++; - } - if(newItem.factory==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to cast the plugin: %1").arg(newItem.pointer->errorString())); - newItem.pointer->unload(); - return; - } - #ifdef ULTRACOPIER_DEBUG - qRegisterMetaType("DebugLevel"); - connect(newItem.factory,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SLOT(debugInformation(DebugLevel,QString,QString,QString,int)),Qt::QueuedConnection); - #endif // ULTRACOPIER_DEBUG - newItem.options=new LocalPluginOptions("CopyEngine-"+newItem.name); - newItem.factory->setResources(newItem.options,plugin.writablePath,plugin.path,&facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL); - newItem.optionsWidget=newItem.factory->options(); - newItem.supportedProtocolsForTheSource=newItem.factory->supportedProtocolsForTheSource(); - newItem.supportedProtocolsForTheDestination=newItem.factory->supportedProtocolsForTheDestination(); - newItem.canDoOnlyCopy=newItem.factory->canDoOnlyCopy(); - newItem.type=newItem.factory->getCopyType(); - newItem.transferListOperation=newItem.factory->getTransferListOperation(); - optionDialog->addPluginOptionWidget(PluginType_CopyEngine,newItem.name,newItem.optionsWidget); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"plugin: "+newItem.name+" loaded, send options"); - //emit newCopyEngineOptions(plugin.path,newItem.name,newItem.optionsWidget); - pluginList << newItem; - connect(languages,SIGNAL(newLanguageLoaded(QString)),newItem.factory,SLOT(newLanguageLoaded())); - if(plugins->allPluginHaveBeenLoaded()) - allPluginIsloaded(); - if(isConnected) - emit addCopyEngine(newItem.name,newItem.canDoOnlyCopy); + if(plugin.category!=PluginType_CopyEngine) + return; + //setFileName + QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName(QStringLiteral("copyEngine")); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + /*more IO + if(!QFile(pluginPath).exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("The plugin binary is missing: ")+pluginPath); + return; + }*/ + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+pluginPath); + //search into loaded session + int index=0; + while(index(pluginObject); + if(newItem.factory!=NULL) + break; + index++; + } + if(index==objectList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("static copy engine not found")); + return; + } + #else + QObject *pluginObject = newItem.pointer->instance(); + if(pluginObject==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin: %1").arg(newItem.pointer->errorString())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin for %1").arg(newItem.pluginPath)); + newItem.pointer->unload(); + return; + } + newItem.factory = qobject_cast(pluginObject); + //check if found + index=0; + while(indexunload(); + return; + } + index++; + } + if(newItem.factory==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to cast the plugin: %1").arg(newItem.pointer->errorString())); + newItem.pointer->unload(); + return; + } + #endif + #else + newItem.factory=new CopyEngineFactory(); + #endif + + #ifdef ULTRACOPIER_DEBUG + connect(newItem.factory,&PluginInterface_CopyEngineFactory::debugInformation,this,&CopyEngineManager::debugInformation,Qt::QueuedConnection); + #endif // ULTRACOPIER_DEBUG + newItem.options=new LocalPluginOptions(QStringLiteral("CopyEngine-")+newItem.name); + newItem.factory->setResources(newItem.options,plugin.writablePath,plugin.path,&FacilityEngine::facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL); + newItem.optionsWidget=newItem.factory->options(); + newItem.supportedProtocolsForTheSource=newItem.factory->supportedProtocolsForTheSource(); + newItem.supportedProtocolsForTheDestination=newItem.factory->supportedProtocolsForTheDestination(); + newItem.canDoOnlyCopy=newItem.factory->canDoOnlyCopy(); + newItem.type=newItem.factory->getCopyType(); + newItem.transferListOperation=newItem.factory->getTransferListOperation(); + optionDialog->addPluginOptionWidget(PluginType_CopyEngine,newItem.name,newItem.optionsWidget); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("plugin: ")+newItem.name+QStringLiteral(" loaded, send options")); + //emit newCopyEngineOptions(plugin.path,newItem.name,newItem.optionsWidget); + pluginList << newItem; + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newItem.factory,&PluginInterface_CopyEngineFactory::newLanguageLoaded); + if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + allPluginIsloaded(); + if(isConnected) + emit addCopyEngine(newItem.name,newItem.canDoOnlyCopy); } +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void CopyEngineManager::onePluginWillBeRemoved(const PluginsAvailable &plugin) { - int index=0; - while(indexunload(); - return; - } - index++; - } + if(plugin.category!=PluginType_CopyEngine) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + while(indexunload(); + return; + } + index++; + } } +#endif -CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination) +CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, pluginList.size(): %1, mode: %2, and particular protocol").arg(pluginList.size()).arg((int)mode)); - returnCopyEngine temp; - int index=0; - bool isTheGoodEngine=false; - while(indexgetInstance(); - temp.engine=pluginList[index].intances.last(); - temp.canDoOnlyCopy=pluginList.at(index).canDoOnlyCopy; - temp.type=pluginList.at(index).type; - temp.transferListOperation=pluginList.at(index).transferListOperation; - return temp; - } - index++; - } - if(mode==Move) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Cannot find any copy engine with motions support"); - QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any copy engine with motions support")); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Cannot find any compatible engine!"); - QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any compatible engine!")); - } - temp.engine=NULL; - temp.type=File; - temp.canDoOnlyCopy=true; - return temp; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, pluginList.size(): %1, mode: %2, and particular protocol").arg(pluginList.size()).arg((int)mode)); + returnCopyEngine temp; + int index=0; + bool isTheGoodEngine=false; + while(indexgetInstance(); + temp.engine=pluginList.at(index).intances.last(); + temp.canDoOnlyCopy=pluginList.at(index).canDoOnlyCopy; + temp.type=pluginList.at(index).type; + temp.transferListOperation=pluginList.at(index).transferListOperation; + return temp; + } + index++; + } + if(mode==Ultracopier::Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Cannot find any copy engine with move support"); + QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any copy engine with move support")); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Cannot find any compatible engine!"); + QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any compatible engine!")); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("protocolsUsedForTheSources: %1, protocolsUsedForTheDestination: %2").arg(protocolsUsedForTheSources.join(";")).arg(protocolsUsedForTheDestination)); + + temp.engine=NULL; + temp.type=Ultracopier::File; + temp.canDoOnlyCopy=true; + return temp; } -CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const CopyMode &mode,const QString &name) +CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,const QString &name) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, pluginList.size(): %1, with mode: %2, and name: %3").arg(pluginList.size()).arg((int)mode).arg(name)); - returnCopyEngine temp; - int index=0; - while(indexgetInstance(); - temp.engine=pluginList[index].intances.last(); - temp.canDoOnlyCopy=pluginList.at(index).canDoOnlyCopy; - temp.type=pluginList.at(index).type; - temp.transferListOperation=pluginList.at(index).transferListOperation; - return temp; - } - index++; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Cannot find any engine with this name: %1").arg(name)); - QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name: %1").arg(name)); - temp.engine=NULL; - temp.type=File; - temp.canDoOnlyCopy=true; - return temp; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, pluginList.size(): %1, with mode: %2, and name: %3").arg(pluginList.size()).arg((int)mode).arg(name)); + returnCopyEngine temp; + int index=0; + while(indexgetInstance(); + temp.engine=pluginList.at(index).intances.last(); + temp.canDoOnlyCopy=pluginList.at(index).canDoOnlyCopy; + temp.type=pluginList.at(index).type; + temp.transferListOperation=pluginList.at(index).transferListOperation; + return temp; + } + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Cannot find any engine with this name: %1").arg(name)); + QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name: %1").arg(name)); + temp.engine=NULL; + temp.type=Ultracopier::File; + temp.canDoOnlyCopy=true; + return temp; } #ifdef ULTRACOPIER_DEBUG -void CopyEngineManager::debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne) +void CopyEngineManager::debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne) { - DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Copy Engine plugin"); + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,QStringLiteral("Copy Engine plugin")); } #endif // ULTRACOPIER_DEBUG /// \brief To notify when new value into a group have changed void CopyEngineManager::newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value) { - if(groupName=="CopyEngine" && variableName=="List") - { - Q_UNUSED(value) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"start(\""+groupName+"\",\""+variableName+"\",\""+value.toString()+"\")"); - allPluginIsloaded(); - } + if(groupName==QStringLiteral("CopyEngine") && variableName==QStringLiteral("List")) + { + Q_UNUSED(value) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start(\""+groupName+"\",\""+variableName+"\",\""+value.toString()+"\")"); + allPluginIsloaded(); + } } void CopyEngineManager::setIsConnected() { - /* ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - prevent bug, I don't know why, in one case it bug here - */ - isConnected=true; - int index=0; - while(indexgetOptionValue("CopyEngine","List").toStringList(); - preferedList.removeDuplicates(); - actualList.removeDuplicates(); - index=0; - while(indexsetOptionValue("CopyEngine","List",preferedList); - QList newPluginList; - index=0; - while(indexgetOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List")).toStringList(); + preferedList.removeDuplicates(); + actualList.removeDuplicates(); + index=0; + while(indexsetOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List"),preferedList); + QList newPluginList; + index=0; + while(index +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT #include +#endif #include #include #include #include "Environment.h" -#include "GlobalClass.h" #include "LocalPluginOptions.h" #include "OptionDialog.h" #include "interface/PluginInterface_CopyEngine.h" #include "FacilityEngine.h" namespace Ui { - class CopyEngineOptions; + class CopyEngineOptions; } /** \brief Manage copy engine plugins and their instance */ -class CopyEngineManager : public QObject, public GlobalClass +class CopyEngineManager : public QObject { - Q_OBJECT + Q_OBJECT public: - /** \brief internal structure to return one copy engine instance */ - struct returnCopyEngine - { - PluginInterface_CopyEngine * engine; ///< The copy engine instance - bool canDoOnlyCopy; ///< true if can do only the copy (not move) - CopyType type; ///< Kind of copy what it can do - TransferListOperation transferListOperation; - }; - explicit CopyEngineManager(OptionDialog *optionDialog); - /** \brief return copy engine instance when know the sources and destinations - \param mode the mode (copy/move) - \param protocolsUsedForTheSources list of sources used - \param protocolsUsedForTheDestination list of destination used - \see getCopyEngine() - */ - returnCopyEngine getCopyEngine(const CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination); - /** \brief return copy engine instance with specific engine - \param mode the mode (copy/move) - \param name name of the engine needed - \see getCopyEngine() - */ - returnCopyEngine getCopyEngine(const CopyMode &mode,const QString &name); - //bool currentEngineCanDoOnlyCopy(QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination=""); - //CopyType currentEngineGetCopyType(QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination=""); - /** \brief to send all signal because all object is connected on it */ - void setIsConnected(); - /** \brief check if the protocols given is supported by the copy engine - \see Core::newCopy() - \see Core::newMove() - */ - bool protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination); + /** \brief internal structure to return one copy engine instance */ + struct returnCopyEngine + { + PluginInterface_CopyEngine * engine; ///< The copy engine instance + bool canDoOnlyCopy; ///< true if can do only the copy (not move) + Ultracopier::CopyType type; ///< Kind of copy what it can do + Ultracopier::TransferListOperation transferListOperation; + }; + explicit CopyEngineManager(OptionDialog *optionDialog); + /** \brief return copy engine instance when know the sources and destinations + \param mode the mode (copy/move) + \param protocolsUsedForTheSources list of sources used + \param protocolsUsedForTheDestination list of destination used + \see getCopyEngine() + */ + returnCopyEngine getCopyEngine(const Ultracopier::CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination); + /** \brief return copy engine instance with specific engine + \param mode the mode (copy/move) + \param name name of the engine needed + \see getCopyEngine() + */ + returnCopyEngine getCopyEngine(const Ultracopier::CopyMode &mode,const QString &name); + //bool currentEngineCanDoOnlyCopy(QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination=""); + //CopyType currentEngineGetCopyType(QStringList protocolsUsedForTheSources,QString protocolsUsedForTheDestination=""); + /** \brief to send all signal because all object is connected on it */ + void setIsConnected(); + /** \brief check if the protocols given is supported by the copy engine + \see Core::newCopy() + \see Core::newMove() + */ + bool protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination); private slots: - void onePluginAdded(const PluginsAvailable &plugin); - void onePluginWillBeRemoved(const PluginsAvailable &plugin); - void onePluginWillBeUnloaded(const PluginsAvailable &plugin); - #ifdef ULTRACOPIER_DEBUG - void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne); - #endif // ULTRACOPIER_DEBUG - /// \brief To notify when new value into a group have changed - void newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value); - void allPluginIsloaded(); + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + void onePluginWillBeUnloaded(const PluginsAvailable &plugin); + #endif + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level, const QString& fonction, const QString& text, const QString& file, const int& ligne); + #endif // ULTRACOPIER_DEBUG + /// \brief To notify when new value into a group have changed + void newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value); + void allPluginIsloaded(); private: - /// \brief the option interface - struct CopyEnginePlugin - { - QString path; - QString name; - QString pluginPath; - QStringList supportedProtocolsForTheSource; - QStringList supportedProtocolsForTheDestination; - QPluginLoader * pointer; - PluginInterface_CopyEngineFactory * factory; - QList intances; - bool canDoOnlyCopy; - CopyType type; - TransferListOperation transferListOperation; - LocalPluginOptions *options; - QWidget *optionsWidget; - }; - QList pluginList; - OptionDialog *optionDialog; - bool isConnected; - FacilityEngine facilityEngine; + /// \brief the option interface + struct CopyEnginePlugin + { + QString path; + QString name; + QString pluginPath; + QStringList supportedProtocolsForTheSource; + QStringList supportedProtocolsForTheDestination; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader * pointer; + #endif + PluginInterface_CopyEngineFactory * factory; + QList intances; + bool canDoOnlyCopy; + Ultracopier::CopyType type; + Ultracopier::TransferListOperation transferListOperation; + LocalPluginOptions *options; + QWidget *optionsWidget; + }; + QList pluginList; + OptionDialog *optionDialog; + bool isConnected; signals: - //void newCopyEngineOptions(QString,QString,QWidget *); - void addCopyEngine(QString name,bool canDoOnlyCopy); - void removeCopyEngine(QString name); - void previouslyPluginAdded(PluginsAvailable); + //void newCopyEngineOptions(QString,QString,QWidget *); + void addCopyEngine(QString name,bool canDoOnlyCopy) const; + void removeCopyEngine(QString name) const; + void previouslyPluginAdded(PluginsAvailable) const; }; #endif // COPYENGINEMANAGER_H diff --git a/CopyListener.cpp b/CopyListener.cpp old mode 100755 new mode 100644 index c648b97..897a4c4 --- a/CopyListener.cpp +++ b/CopyListener.cpp @@ -1,392 +1,465 @@ /** \file CopyListener.h \brief Define the copy listener \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "CopyListener.h" +#include "LanguagesManager.h" + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include "plugins/Listener/catchcopy-v0002/listener.h" +#endif + +#include +#include CopyListener::CopyListener(OptionDialog *optionDialog) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->optionDialog=optionDialog; - pluginLoader=new PluginLoader(optionDialog); - //load the options - tryListen=false; - QList > KeysList; - KeysList.append(qMakePair(QString("CatchCopyAsDefault"),QVariant(true))); - options->addOptionGroup("CopyListener",KeysList); - plugins->lockPluginListEdition(); - QList list=plugins->getPluginsByCategory(PluginType_Listener); - qRegisterMetaType("PluginsAvailable"); - qRegisterMetaType("ListeningState"); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - connect(plugins,SIGNAL(pluginListingIsfinish()), this,SLOT(allPluginIsloaded()),Qt::QueuedConnection); - connect(pluginLoader,SIGNAL(pluginLoaderReady(CatchState,bool,bool)), this,SIGNAL(pluginLoaderReady(CatchState,bool,bool))); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - last_state=NotListening; - last_have_plugin=false; - last_inWaitOfReply=false; + stopIt=false; + this->optionDialog=optionDialog; + pluginLoader=new PluginLoader(optionDialog); + //load the options + tryListen=false; + PluginsManager::pluginsManager->lockPluginListEdition(); + QList list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_Listener); + connect(this,&CopyListener::previouslyPluginAdded, this,&CopyListener::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginAdded, this,&CopyListener::onePluginAdded,Qt::QueuedConnection); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved, this,&CopyListener::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish, this,&CopyListener::allPluginIsloaded,Qt::QueuedConnection); + connect(pluginLoader,&PluginLoader::pluginLoaderReady, this,&CopyListener::pluginLoaderReady); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + last_state=Ultracopier::NotListening; + last_have_plugin=false; + last_inWaitOfReply=false; + stripSeparatorRegex=QRegularExpression(QStringLiteral("[\\\\/]+$")); } CopyListener::~CopyListener() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QList list=plugins->getPluginsByCategory(PluginType_Listener); - foreach(PluginsAvailable currentPlugin,list) - onePluginWillBeRemoved(currentPlugin); - delete pluginLoader; + stopIt=true; + if(pluginLoader!=NULL) + { + delete pluginLoader; + pluginLoader=NULL; + } } void CopyListener::resendState() { - if(plugins->allPluginHaveBeenLoaded()) - { - sendState(true); - pluginLoader->resendState(); - } + if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + { + sendState(true); + if(pluginLoader!=NULL) + pluginLoader->resendState(); + } } void CopyListener::onePluginAdded(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_Listener) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"try load: "+plugin.path+PluginsManager::getResolvedPluginName("listener")); - //setFileName - QPluginLoader *pluginOfPluginLoader=new QPluginLoader(plugin.path+PluginsManager::getResolvedPluginName("listener")); - QObject *pluginInstance = pluginOfPluginLoader->instance(); - if(pluginInstance) - { - PluginInterface_Listener *listen = qobject_cast(pluginInstance); - //check if found - int index=0; - while(indexunload(); - return; - } - index++; - } - if(listen) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Plugin correctly loaded"); - #ifdef ULTRACOPIER_DEBUG - connect(listen,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SLOT(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif // ULTRACOPIER_DEBUG - connect(listen,SIGNAL(newCopy(quint32,QStringList)), this,SLOT(newPluginCopy(quint32,QStringList))); - connect(listen,SIGNAL(newCopy(quint32,QStringList,QString)), this,SLOT(newPluginCopy(quint32,QStringList,QString))); - connect(listen,SIGNAL(newMove(quint32,QStringList)), this,SLOT(newPluginMove(quint32,QStringList))); - connect(listen,SIGNAL(newMove(quint32,QStringList,QString)), this,SLOT(newPluginMove(quint32,QStringList,QString))); - PluginListener newPluginListener; - newPluginListener.listenInterface = listen; - newPluginListener.pluginLoader = pluginOfPluginLoader; - newPluginListener.path = plugin.path+PluginsManager::getResolvedPluginName("listener"); - newPluginListener.state = NotListening; - newPluginListener.inWaitOfReply = false; - newPluginListener.options=new LocalPluginOptions("Listener-"+plugin.name); - newPluginListener.listenInterface->setResources(newPluginListener.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); - optionDialog->addPluginOptionWidget(PluginType_Listener,plugin.name,newPluginListener.listenInterface->options()); - connect(languages,SIGNAL(newLanguageLoaded(QString)),newPluginListener.listenInterface,SLOT(newLanguageLoaded())); - pluginList << newPluginListener; - connect(pluginList.last().listenInterface,SIGNAL(newState(ListeningState)),this,SLOT(newState(ListeningState))); - if(tryListen) - { - pluginList.last().inWaitOfReply=true; - listen->listen(); - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to cast the plugin: "+pluginOfPluginLoader->errorString()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to load the plugin: "+pluginOfPluginLoader->errorString()); + if(plugin.category!=PluginType_Listener) + return; + PluginListener newPluginListener; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("try load: ")+plugin.path+PluginsManager::getResolvedPluginName("listener")); + //setFileName + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + PluginInterface_Listener *listen; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QObjectList objectList=QPluginLoader::staticInstances(); + int index=0; + QObject *pluginObject; + while(index(pluginObject); + if(listen!=NULL) + break; + index++; + } + if(index==objectList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("static listener not found")); + return; + } + #else + listen=new Listener(); + #endif + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + newPluginListener.pluginLoader=NULL; + #endif + #else + QPluginLoader *pluginOfPluginLoader=new QPluginLoader(plugin.path+PluginsManager::getResolvedPluginName(QStringLiteral("listener"))); + QObject *pluginInstance = pluginOfPluginLoader->instance(); + if(!pluginInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin: ")+pluginOfPluginLoader->errorString()); + return; + } + PluginInterface_Listener *listen = qobject_cast(pluginInstance); + if(!listen) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin: ")+pluginOfPluginLoader->errorString()); + return; + } + //check if found + int index=0; + while(indexunload(); + return; + } + index++; + } + newPluginListener.pluginLoader = pluginOfPluginLoader; + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Plugin correctly loaded")); + #ifdef ULTRACOPIER_DEBUG + connect(listen,&PluginInterface_Listener::debugInformation,this,&CopyListener::debugInformation,Qt::DirectConnection); + #endif // ULTRACOPIER_DEBUG + connect(listen,&PluginInterface_Listener::error, this,&CopyListener::error,Qt::DirectConnection); + connect(listen,&PluginInterface_Listener::newCopyWithoutDestination, this,&CopyListener::newPluginCopyWithoutDestination,Qt::DirectConnection); + connect(listen,&PluginInterface_Listener::newCopy, this,&CopyListener::newPluginCopy,Qt::DirectConnection); + connect(listen,&PluginInterface_Listener::newMoveWithoutDestination, this,&CopyListener::newPluginMoveWithoutDestination,Qt::DirectConnection); + connect(listen,&PluginInterface_Listener::newMove, this,&CopyListener::newPluginMove,Qt::DirectConnection); + connect(listen,&PluginInterface_Listener::newClientList, this,&CopyListener::reloadClientList,Qt::DirectConnection); + newPluginListener.listenInterface = listen; + + newPluginListener.path = plugin.path+PluginsManager::getResolvedPluginName(QStringLiteral("listener")); + newPluginListener.state = Ultracopier::NotListening; + newPluginListener.inWaitOfReply = false; + newPluginListener.options=new LocalPluginOptions(QStringLiteral("Listener-")+plugin.name); + newPluginListener.listenInterface->setResources(newPluginListener.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); + optionDialog->addPluginOptionWidget(PluginType_Listener,plugin.name,newPluginListener.listenInterface->options()); + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newPluginListener.listenInterface,&PluginInterface_Listener::newLanguageLoaded,Qt::DirectConnection); + pluginList << newPluginListener; + connect(pluginList.last().listenInterface,&PluginInterface_Listener::newState,this,&CopyListener::newState,Qt::DirectConnection); + if(tryListen) + { + pluginList.last().inWaitOfReply=true; + listen->listen(); + } } #ifdef ULTRACOPIER_DEBUG -void CopyListener::debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne) +void CopyListener::debugInformation(const Ultracopier::DebugLevel &level, const QString& fonction, const QString& text, const QString& file, const int& ligne) { - DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Listener plugin"); + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,QStringLiteral("Listener plugin")); } #endif // ULTRACOPIER_DEBUG +void CopyListener::error(const QString &error) +{ + QMessageBox::critical(NULL,tr("Error"),tr("Error during the reception of the copy/move list\n%1").arg(error)); +} + bool CopyListener::oneListenerIsLoaded() { - return (pluginList.size()>0); + return (pluginList.size()>0); } +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void CopyListener::onePluginWillBeRemoved(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_Listener) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"unload the current plugin"); - int indexPlugin=0; - while(indexPluginclose(); - disconnect(pluginList.at(indexPlugin).listenInterface); - pluginList.at(indexPlugin).pluginLoader->unload(); - delete pluginList.at(indexPlugin).options; - pluginList.removeAt(indexPlugin); - sendState(); - return; - } - indexPlugin++; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"not found"); + if(plugin.category!=PluginType_Listener) + return; + int indexPlugin=0; + while(indexPluginclose(); + delete pluginList.at(indexPlugin).listenInterface; + } + if(pluginList.at(indexPlugin).pluginLoader!=NULL) + { + pluginList.at(indexPlugin).pluginLoader->unload(); + delete pluginList.at(indexPlugin).options; + } + pluginList.removeAt(indexPlugin); + sendState(); + return; + } + indexPlugin++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"not found"); } +#endif -void CopyListener::newState(const ListeningState &state) +void CopyListener::newState(const Ultracopier::ListeningState &state) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - PluginInterface_Listener *temp=qobject_cast(QObject::sender()); - if(temp==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("listener not located!")); - return; - } - int index=0; - while(index(QObject::sender()); + if(temp==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("listener not located!")); + return; + } + int index=0; + while(indexlisten(); - index++; - } - pluginLoader->load(); + tryListen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + while(indexlisten(); + index++; + } + if(pluginLoader!=NULL) + pluginLoader->load(); } void CopyListener::close() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - tryListen=false; - pluginLoader->unload(); - int index=0; - while(indexclose(); - index++; - } - copyRunningList.clear(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + tryListen=false; + if(pluginLoader!=NULL) + pluginLoader->unload(); + int index=0; + while(indexclose(); + index++; + } + copyRunningList.clear(); } QStringList CopyListener::stripSeparator(QStringList sources) { - int index=0; - while(indextransferFinished(copyRunningList.at(index).pluginOrderId,withError); - copyRunningList.removeAt(index); - return; - } - index++; - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + while(indextransferFinished(copyRunningList.at(index).pluginOrderId,withError); + copyRunningList.removeAt(index); + return; + } + index++; + } } void CopyListener::copyCanceled(const quint32 & orderId) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(indextransferCanceled(copyRunningList.at(index).pluginOrderId); - copyRunningList.removeAt(index); - return; - } - index++; - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + while(indextransferCanceled(copyRunningList.at(index).pluginOrderId); + copyRunningList.removeAt(index); + return; + } + index++; + } } -void CopyListener::newPluginCopy(const quint32 &orderId,const QStringList &sources) +void CopyListener::newPluginCopyWithoutDestination(const quint32 &orderId,const QStringList &sources) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";")); - PluginInterface_Listener *plugin = qobject_cast(sender()); - CopyRunning newCopyInformation; - newCopyInformation.listenInterface = plugin; - newCopyInformation.pluginOrderId = orderId; - newCopyInformation.orderId = incrementOrderId(); - copyRunningList << newCopyInformation; - emit newCopy(orderId,QStringList() << "file",stripSeparator(sources)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("sources: ")+sources.join(QStringLiteral(";"))); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList << newCopyInformation; + emit newCopyWithoutDestination(orderId,QStringList() << QStringLiteral("file"),stripSeparator(sources)); } void CopyListener::newPluginCopy(const quint32 &orderId,const QStringList &sources,const QString &destination) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";")+", destination: "+destination); - PluginInterface_Listener *plugin = qobject_cast(sender()); - CopyRunning newCopyInformation; - newCopyInformation.listenInterface = plugin; - newCopyInformation.pluginOrderId = orderId; - newCopyInformation.orderId = incrementOrderId(); - copyRunningList << newCopyInformation; - emit newCopy(orderId,QStringList() << "file",stripSeparator(sources),"file",destination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("sources: ")+sources.join(QStringLiteral(";"))+QStringLiteral(", destination: ")+destination); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList << newCopyInformation; + emit newCopy(orderId,QStringList() << QStringLiteral("file"),stripSeparator(sources),QStringLiteral("file"),destination); } -void CopyListener::newPluginMove(const quint32 &orderId,const QStringList &sources) +void CopyListener::newPluginMoveWithoutDestination(const quint32 &orderId,const QStringList &sources) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";")); - PluginInterface_Listener *plugin = qobject_cast(sender()); - CopyRunning newCopyInformation; - newCopyInformation.listenInterface = plugin; - newCopyInformation.pluginOrderId = orderId; - newCopyInformation.orderId = incrementOrderId(); - copyRunningList << newCopyInformation; - emit newMove(orderId,QStringList() << "file",stripSeparator(sources)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("sources: ")+sources.join(QStringLiteral(";"))); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList << newCopyInformation; + emit newMoveWithoutDestination(orderId,QStringList() << QStringLiteral("file"),stripSeparator(sources)); } void CopyListener::newPluginMove(const quint32 &orderId,const QStringList &sources,const QString &destination) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"sources: "+sources.join(";")+", destination: "+destination); - PluginInterface_Listener *plugin = qobject_cast(sender()); - CopyRunning newCopyInformation; - newCopyInformation.listenInterface = plugin; - newCopyInformation.pluginOrderId = orderId; - newCopyInformation.orderId = incrementOrderId(); - copyRunningList << newCopyInformation; - emit newMove(orderId,QStringList() << "file",stripSeparator(sources),"file",destination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("sources: ")+sources.join(";")+QStringLiteral(", destination: ")+destination); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList << newCopyInformation; + emit newMove(orderId,QStringList() << QStringLiteral("file"),stripSeparator(sources),QStringLiteral("file"),destination); } quint32 CopyListener::incrementOrderId() { - do - { - nextOrderId++; - if(nextOrderId>2000000) - nextOrderId=0; - } while(orderList.contains(nextOrderId)); - return nextOrderId; + do + { + nextOrderId++; + if(nextOrderId>2000000) + nextOrderId=0; + } while(orderList.contains(nextOrderId)); + return nextOrderId; } void CopyListener::allPluginIsloaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"with value: "+QString::number(pluginList.size()>0)); - sendState(true); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("with value: ")+QString::number(pluginList.size()>0)); + sendState(true); + reloadClientList(); +} + +void CopyListener::reloadClientList() +{ + if(!PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + return; + QStringList clients; + int indexPlugin=0; + while(indexPluginclientsList(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("ask client to: ")+pluginList.at(indexPlugin).path); + } + indexPlugin++; + } + emit newClientList(clients); } void CopyListener::sendState(bool force) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, pluginList.size(): %1, force: %2").arg(pluginList.size()).arg(force)); - ListeningState current_state=NotListening; - bool found_not_listen=false,found_listen=false,found_inWaitOfReply=false; - int index=0; - while(index0; - if(force || current_state!=last_state || have_plugin!=last_have_plugin || found_inWaitOfReply!=last_inWaitOfReply) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("send listenerReady(%1,%2,%3)").arg(current_state).arg(have_plugin).arg(found_inWaitOfReply)); - emit listenerReady(current_state,have_plugin,found_inWaitOfReply); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Skip the signal sending")); - last_state=current_state; - last_have_plugin=have_plugin; - last_inWaitOfReply=found_inWaitOfReply; + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, pluginList.size(): %1, force: %2").arg(pluginList.size()).arg(force)); + Ultracopier::ListeningState current_state=Ultracopier::NotListening; + bool found_not_listen=false,found_listen=false,found_inWaitOfReply=false; + int index=0; + while(index0; + if(force || current_state!=last_state || have_plugin!=last_have_plugin || found_inWaitOfReply!=last_inWaitOfReply) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("send listenerReady(%1,%2,%3)").arg(current_state).arg(have_plugin).arg(found_inWaitOfReply)); + emit listenerReady(current_state,have_plugin,found_inWaitOfReply); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Skip the signal sending")); + last_state=current_state; + last_have_plugin=have_plugin; + last_inWaitOfReply=found_inWaitOfReply; } diff --git a/CopyListener.h b/CopyListener.h old mode 100755 new mode 100644 index 198ce9f..447ecb8 --- a/CopyListener.h +++ b/CopyListener.h @@ -1,115 +1,123 @@ /** \file CopyListener.h \brief Define the class to load the plugin and lunch it \author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ +\licence GPL3, see the file COPYING */ #ifndef COPYLISTENER_H #define COPYLISTENER_H #include #include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT #include +#endif #include "interface/PluginInterface_Listener.h" #include "Environment.h" -#include "GlobalClass.h" #include "PluginLoader.h" #include "OptionDialog.h" /** \brief to load all the listener and parse all event */ -class CopyListener : public QObject, public GlobalClass +class CopyListener : public QObject { - Q_OBJECT - public: - explicit CopyListener(OptionDialog *optionDialog); - ~CopyListener(); - /** \brief send of one listener is loaded */ - bool oneListenerIsLoaded(); - /** \brief to resend the state */ - void resendState(); - private slots: - //void newPlugin(); - void newPluginCopy(const quint32 &orderId,const QStringList &sources); - void newPluginCopy(const quint32 &orderId,const QStringList &sources,const QString &destination); - void newPluginMove(const quint32 &orderId,const QStringList &sources); - void newPluginMove(const quint32 &orderId,const QStringList &sources,const QString &destination); - void onePluginAdded(const PluginsAvailable &plugin); - void onePluginWillBeRemoved(const PluginsAvailable &plugin); - void newState(const ListeningState &state); - #ifdef ULTRACOPIER_DEBUG - void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne); - #endif // ULTRACOPIER_DEBUG - void allPluginIsloaded(); - public slots: - /** \brief the copy is finished - \param orderId id used when it have send the copy - \param withError true if it have found error - \see newCopy() - \see newMove() - */ - void copyFinished(const quint32 & orderId,const bool &withError); - /** \brief the copy is canceled by the user - \param orderId id used when it have send the copy - \see newCopy() - \see newMove() - */ - void copyCanceled(const quint32 & orderId); - /** \brief try listen, to get copy/move from external source (mainly the file manager) - \see close() - */ - void listen(); - /** \brief stop listen, to get copy/move from external source (mainly the file manager) - \see listen() - */ - void close(); - /** new copy without destination have been pased by the CLI */ - void newCopy(QStringList sources); - /** new copy with destination have been pased by the CLI */ - void newCopy(QStringList sources,QString destination); - /** new move without destination have been pased by the CLI */ - void newMove(QStringList sources); - /** new move with destination have been pased by the CLI */ - void newMove(QStringList sources,QString destination); - signals: - void newCopy(quint32 orderId,QStringList protocolsUsedForTheSources,QStringList sources); - void newCopy(quint32 orderId,QStringList protocolsUsedForTheSources,QStringList sources,QString protocolsUsedForTheDestination,QString destination); - void newMove(quint32 orderId,QStringList protocolsUsedForTheSources,QStringList sources); - void newMove(quint32 orderId,QStringList protocolsUsedForTheSources,QStringList sources,QString protocolsUsedForTheDestination,QString destination); - void listenerReady(ListeningState state,bool havePlugin,bool someAreInWaitOfReply); - void pluginLoaderReady(CatchState state,bool havePlugin,bool someAreInWaitOfReply); - void previouslyPluginAdded(PluginsAvailable); - private: - struct PluginListener - { - PluginInterface_Listener *listenInterface; - QPluginLoader *pluginLoader; - QString path; - ListeningState state; - bool inWaitOfReply; - LocalPluginOptions *options; - }; - QList pluginList; - //for the options - quint32 nextOrderId; - QList orderList; - //for the copy as suspend - struct CopyRunning - { - PluginInterface_Listener *listenInterface; - quint32 pluginOrderId; - quint32 orderId; - }; - QList copyRunningList; - quint32 incrementOrderId(); - bool tryListen; - PluginLoader *pluginLoader; - ListeningState last_state; - bool last_have_plugin,last_inWaitOfReply; - void sendState(bool force=false); - QStringList stripSeparator(QStringList sources); - OptionDialog *optionDialog; + Q_OBJECT + public: + explicit CopyListener(OptionDialog *optionDialog); + ~CopyListener(); + /** \brief send of one listener is loaded */ + bool oneListenerIsLoaded(); + /** \brief to resend the state */ + void resendState(); + private slots: + //void newPlugin(); + void newPluginCopyWithoutDestination(const quint32 &orderId,const QStringList &sources); + void newPluginCopy(const quint32 &orderId,const QStringList &sources,const QString &destination); + void newPluginMoveWithoutDestination(const quint32 &orderId,const QStringList &sources); + void newPluginMove(const quint32 &orderId,const QStringList &sources,const QString &destination); + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + #endif + void newState(const Ultracopier::ListeningState &state); + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne); + #endif // ULTRACOPIER_DEBUG + void error(const QString &error); + void allPluginIsloaded(); + void reloadClientList(); + public slots: + /** \brief the copy is finished + \param orderId id used when it have send the copy + \param withError true if it have found error + \see newCopy() + \see newMove() + */ + void copyFinished(const quint32 & orderId,const bool &withError); + /** \brief the copy is canceled by the user + \param orderId id used when it have send the copy + \see newCopy() + \see newMove() + */ + void copyCanceled(const quint32 & orderId); + /** \brief try listen, to get copy/move from external source (mainly the file manager) + \see close() + */ + void listen(); + /** \brief stop listen, to get copy/move from external source (mainly the file manager) + \see listen() + */ + void close(); + /** new copy without destination have been pased by the CLI */ + void copyWithoutDestination(QStringList sources); + /** new copy with destination have been pased by the CLI */ + void copy(QStringList sources,QString destination); + /** new move without destination have been pased by the CLI */ + void moveWithoutDestination(QStringList sources); + /** new move with destination have been pased by the CLI */ + void move(QStringList sources,QString destination); + signals: + void newCopyWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) const; + void newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) const; + void newMoveWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) const; + void newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) const; + void listenerReady(const Ultracopier::ListeningState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) const; + void pluginLoaderReady(const Ultracopier::CatchState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) const; + void previouslyPluginAdded(const PluginsAvailable &) const; + void newClientList(const QStringList &clientsList) const; + private: + struct PluginListener + { + PluginInterface_Listener *listenInterface; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader *pluginLoader; + #endif + QString path; + Ultracopier::ListeningState state; + bool inWaitOfReply; + LocalPluginOptions *options; + }; + QList pluginList; + //for the options + quint32 nextOrderId; + QList orderList; + //for the copy as suspend + struct CopyRunning + { + PluginInterface_Listener *listenInterface; + quint32 pluginOrderId; + quint32 orderId; + }; + QList copyRunningList; + quint32 incrementOrderId(); + bool tryListen; + PluginLoader *pluginLoader; + Ultracopier::ListeningState last_state; + bool last_have_plugin,last_inWaitOfReply; + void sendState(bool force=false); + QStringList stripSeparator(QStringList sources); + OptionDialog *optionDialog; + bool stopIt; + QRegularExpression stripSeparatorRegex; }; #endif // COPYLISTENER_H diff --git a/Core.cpp b/Core.cpp old mode 100755 new mode 100644 index a12ba32..52d693c --- a/Core.cpp +++ b/Core.cpp @@ -1,304 +1,284 @@ /** \file Core.cpp \brief Define the class for the core \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include #include +#include #include "Core.h" +#include "ThemesManager.h" Core::Core(CopyEngineManager *copyEngineList) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->copyEngineList=copyEngineList; - nextId=0; - forUpateInformation.setInterval(ULTRACOPIER_TIME_INTERFACE_UPDATE); - loadInterface(); - //connect(©EngineList, SIGNAL(newCanDoOnlyCopy(bool)), this, SIGNAL(newCanDoOnlyCopy(bool))); - connect(themes, SIGNAL(theThemeNeedBeUnloaded()), this, SLOT(unloadInterface())); - connect(themes, SIGNAL(theThemeIsReloaded()), this, SLOT(loadInterface())); - connect(&forUpateInformation, SIGNAL(timeout()), this, SLOT(periodicSynchronization())); - - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - qRegisterMetaType("EngineActionInProgress"); - qRegisterMetaType("CopyMode"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); -} - -void Core::newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(openNewCopyEngineInstance(Copy,false,protocolsUsedForTheSources)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - copyList.last().orderId<newCopy(sources); - copyList.last().interface->haveExternalOrder(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->copyEngineList=copyEngineList; + nextId=0; + forUpateInformation.setInterval(ULTRACOPIER_TIME_INTERFACE_UPDATE); + loadInterface(); + //connect(©EngineList, &CopyEngineManager::newCanDoOnlyCopy, this, &Core::newCanDoOnlyCopy); + connect(ThemesManager::themesManager, &ThemesManager::theThemeNeedBeUnloaded, this, &Core::unloadInterface); + connect(ThemesManager::themesManager, &ThemesManager::theThemeIsReloaded, this, &Core::loadInterface, Qt::QueuedConnection); + connect(&forUpateInformation, &QTimer::timeout, this, &Core::periodicSynchronization); +} + +Core::~Core() +{ + int index=0; + while(indexcancel(); + delete copyList.at(index).nextConditionalSync; + delete copyList.at(index).interface; + delete copyList.at(index).engine; + index++; + } +} + +void Core::newCopyWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(openNewCopyEngineInstance(Ultracopier::Copy,false,protocolsUsedForTheSources)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } + copyList.last().orderId<newCopy(sources); + copyList.last().interface->haveExternalOrder(); +} + +void Core::newTransfer(const Ultracopier::CopyMode &mode,const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+sources.join(QStringLiteral(";"))+QStringLiteral(", dest: ")+destination+QStringLiteral(", mode: ")+QString::number(mode)); + //search to group the window + int GroupWindowWhen=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("GroupWindowWhen")).toInt(); + bool haveSameSource=false,haveSameDestination=false; + if(GroupWindowWhen!=0) + { + bool needConfirmation=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("confirmToGroupWindows")).toInt(); + int index=0; + while(indexhaveSameSource(sources); + if(GroupWindowWhen!=1) + haveSameDestination=copyList.at(index).engine->haveSameDestination(destination); + } + if( + GroupWindowWhen==5 || + (GroupWindowWhen==1 && haveSameSource) || + (GroupWindowWhen==2 && haveSameDestination) || + (GroupWindowWhen==3 && (haveSameSource && haveSameDestination)) || + (GroupWindowWhen==4 && (haveSameSource || haveSameDestination)) + ) + { + /*protocols are same*/ + if(copyEngineList->protocolsSupportedByTheCopyEngine(copyList.at(index).engine,protocolsUsedForTheSources,protocolsUsedForTheDestination)) + { + bool confirmed=true; + if(needConfirmation) + { + QMessageBox::StandardButton reply = QMessageBox::question(copyList.at(index).interface,tr("Group window"),tr("Do you want group the transfer with another actual running transfer?"),QMessageBox::Yes|QMessageBox::No,QMessageBox::No); + confirmed=(reply==QMessageBox::Yes); + } + if(confirmed) + { + copyList[index].orderId<newCopy(sources,destination); + else + copyList.at(index).engine->newMove(sources,destination); + copyList.at(index).interface->haveExternalOrder(); + return; + } + } + } + } + index++; + } + } + //else open new windows + if(openNewCopyEngineInstance(mode,false,protocolsUsedForTheSources,protocolsUsedForTheDestination)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to get a engine instance")); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a engine instance")); + return; + } + copyList.last().orderId<newCopy(sources,destination); + else + copyList.last().engine->newMove(sources,destination); + copyList.last().interface->haveExternalOrder(); } void Core::newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+sources.join(";")+", dest: "+destination); - //search to group the window - int GroupWindowWhen=options->getOptionValue("Ultracopier","GroupWindowWhen").toInt(); - bool haveSameSource=false,haveSameDestination=false; - if(GroupWindowWhen!=0) - { - int index=0; - while(indexhaveSameSource(sources); - if(GroupWindowWhen!=1) - haveSameDestination=copyList.at(index).engine->haveSameDestination(destination); - } - if( - GroupWindowWhen==5 || - (GroupWindowWhen==1 && haveSameSource) || - (GroupWindowWhen==2 && haveSameDestination) || - (GroupWindowWhen==3 && (haveSameSource && haveSameDestination)) || - (GroupWindowWhen==4 && (haveSameSource || haveSameDestination)) - ) - { - /*protocols are same*/ - if(copyEngineList->protocolsSupportedByTheCopyEngine(copyList.at(index).engine,protocolsUsedForTheSources,protocolsUsedForTheDestination)) - { - copyList[index].orderId<newCopy(sources,destination); - copyList.at(index).interface->haveExternalOrder(); - return; - } - } - } - index++; - } - } - //else open new windows - if(openNewCopyEngineInstance(Copy,false,protocolsUsedForTheSources,protocolsUsedForTheDestination)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - copyList.last().orderId<newCopy(sources,destination); - copyList.last().interface->haveExternalOrder(); -} - -void Core::newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) -{ - if(openNewCopyEngineInstance(Move,false,protocolsUsedForTheSources)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - copyList.last().orderId<newMove(sources); - copyList.last().interface->haveExternalOrder(); + newTransfer(Ultracopier::Copy,orderId,protocolsUsedForTheSources,sources,protocolsUsedForTheDestination,destination); } void Core::newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+sources.join(";")+", dest: "+destination); - //search to group the window - int GroupWindowWhen=options->getOptionValue("Ultracopier","GroupWindowWhen").toInt(); - bool haveSameSource=false,haveSameDestination=false; - if(GroupWindowWhen!=0) - { - int index=0; - while(indexhaveSameSource(sources); - if(GroupWindowWhen!=1) - haveSameDestination=copyList.at(index).engine->haveSameDestination(destination); - } - if( - GroupWindowWhen==5 || - (GroupWindowWhen==1 && haveSameSource) || - (GroupWindowWhen==2 && haveSameDestination) || - (GroupWindowWhen==3 && (haveSameSource && haveSameDestination)) || - (GroupWindowWhen==4 && (haveSameSource || haveSameDestination)) - ) - { - /*protocols are same*/ - if(copyEngineList->protocolsSupportedByTheCopyEngine(copyList.at(index).engine,protocolsUsedForTheSources,protocolsUsedForTheDestination)) - { - copyList[index].orderId<newCopy(sources,destination); - copyList.at(index).interface->haveExternalOrder(); - return; - } - } - } - index++; - } - } - //else open new windows - if(openNewCopyEngineInstance(Move,false,protocolsUsedForTheSources,protocolsUsedForTheDestination)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - copyList.last().orderId<newMove(sources,destination); - copyList.last().interface->haveExternalOrder(); + newTransfer(Ultracopier::Move,orderId,protocolsUsedForTheSources,sources,protocolsUsedForTheDestination,destination); +} + +void Core::newMoveWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) +{ + if(openNewCopyEngineInstance(Ultracopier::Move,false,protocolsUsedForTheSources)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } + copyList.last().orderId<newMove(sources); + copyList.last().interface->haveExternalOrder(); } /// \brief name to open the right copy engine -void Core::addWindowCopyMove(const CopyMode &mode,const QString &name) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+name); - if(openNewCopyEngineInstance(mode,false,name)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - ActionOnManualOpen ActionOnManualOpen_value=(ActionOnManualOpen)options->getOptionValue("Ultracopier","ActionOnManualOpen").toInt(); - if(ActionOnManualOpen_value!=ActionOnManualOpen_Nothing) - { - if(ActionOnManualOpen_value==ActionOnManualOpen_Folder) - copyList.last().engine->userAddFolder(mode); - else - copyList.last().engine->userAddFile(mode); - } +void Core::addWindowCopyMove(const Ultracopier::CopyMode &mode,const QString &name) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+name); + if(openNewCopyEngineInstance(mode,false,name)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } + ActionOnManualOpen ActionOnManualOpen_value=(ActionOnManualOpen)OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("ActionOnManualOpen")).toInt(); + if(ActionOnManualOpen_value!=ActionOnManualOpen_Nothing) + { + if(ActionOnManualOpen_value==ActionOnManualOpen_Folder) + copyList.last().engine->userAddFolder(mode); + else + copyList.last().engine->userAddFile(mode); + } } /// \brief name to open the right copy engine void Core::addWindowTransfer(const QString &name) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"+name); - if(openNewCopyEngineInstance(Copy,true,name)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")+name); + if(openNewCopyEngineInstance(Ultracopier::Copy,true,name)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } } /** new transfer list pased by the CLI */ void Core::newTransferList(QString engine,QString mode,QString file) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("engine: %1, mode: %2, file: %3").arg(engine).arg(mode).arg(file)); - if(mode=="Transfer") - { - if(openNewCopyEngineInstance(Copy,true,engine)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - } - else if(mode=="Copy") - { - if(openNewCopyEngineInstance(Copy,false,engine)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - } - else if(mode=="Move") - { - if(openNewCopyEngineInstance(Move,false,engine)==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to get a copy engine instance"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); - return; - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The argument for the mode is not understand"); - QMessageBox::critical(NULL,tr("Error"),tr("The argument for the mode is not understand")); - return; - } - copyList.last().engine->newTransferList(file); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("engine: %1, mode: %2, file: %3").arg(engine).arg(mode).arg(file)); + if(mode==QStringLiteral("Transfer")) + { + if(openNewCopyEngineInstance(Ultracopier::Copy,true,engine)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } + } + else if(mode==QStringLiteral("Copy")) + { + if(openNewCopyEngineInstance(Ultracopier::Copy,false,engine)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } + } + else if(mode==QStringLiteral("Move")) + { + if(openNewCopyEngineInstance(Ultracopier::Move,false,engine)==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return; + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The argument for the mode is not valid"); + QMessageBox::critical(NULL,tr("Error"),tr("The argument for the mode is not valid")); + return; + } + copyList.last().engine->newTransferList(file); } void Core::loadInterface() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //load the extra files to check the themes availability - if(copyList.size()>0) - { - bool error=false; - index=0; - loop_size=copyList.size(); - while(indexgetThemesInstance(); - if(copyList[index].interface==NULL) - { - copyInstanceCanceledByIndex(index); - index--; - error=true; - } - else - { - if(!copyList.at(index).ignoreMode) - copyList.at(index).interface->forceCopyMode(copyList.at(index).mode); - connectInterfaceAndSync(copyList.count()-1); - copyList.at(index).engine->syncTransferList(); - } - index++; - } - if(error) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to load the interface, copy aborted"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the interface, copy aborted")); - } - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //load the extra files to check the themes availability + if(copyList.size()>0) + { + bool error=false; + int index=0; + while(indexgetThemesInstance(); + if(copyList.at(index).interface==NULL) + { + copyInstanceCanceledByIndex(index); + error=true; + } + else + { + if(!copyList.at(index).ignoreMode) + copyList.at(index).interface->forceCopyMode(copyList.at(index).mode); + connectInterfaceAndSync(copyList.count()-1); + copyList.at(index).engine->syncTransferList(); + index++; + } + } + if(error) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, copy aborted"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the interface, copy aborted")); + } + } } void Core::unloadInterface() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - index=0; - loop_size=copyList.size(); - while(index2000000) - nextId=0; - } while(idList.contains(nextId)); - return nextId; + do + { + nextId++; + if(nextId>2000000) + nextId=0; + } while(idList.contains(nextId)); + return nextId; } /** open with specific source/destination @@ -307,13 +287,13 @@ int Core::incrementId() \param protocolsUsedForTheSources protocols used for sources \param protocolsUsedForTheDestination protocols used for destination */ -int Core::openNewCopyEngineInstance(const CopyMode &mode,const bool &ignoreMode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination) +int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - CopyEngineManager::returnCopyEngine returnInformations=copyEngineList->getCopyEngine(mode,protocolsUsedForTheSources,protocolsUsedForTheDestination); - if(returnInformations.engine==NULL) - return -1; - return connectCopyEngine(mode,ignoreMode,returnInformations); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + CopyEngineManager::returnCopyEngine returnInformations=copyEngineList->getCopyEngine(mode,protocolsUsedForTheSources,protocolsUsedForTheDestination); + if(returnInformations.engine==NULL) + return -1; + return connectCopyEngine(mode,ignoreMode,returnInformations); } /** open with specific copy engine @@ -322,649 +302,849 @@ int Core::openNewCopyEngineInstance(const CopyMode &mode,const bool &ignoreMode, \param protocolsUsedForTheSources protocols used for sources \param protocolsUsedForTheDestination protocols used for destination */ -int Core::openNewCopyEngineInstance(const CopyMode &mode,const bool &ignoreMode,const QString &name) +int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const QString &name) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, mode: "+QString::number(mode)+", name: "+name); - CopyEngineManager::returnCopyEngine returnInformations=copyEngineList->getCopyEngine(mode,name); - if(returnInformations.engine==NULL) - return -1; - return connectCopyEngine(mode,ignoreMode,returnInformations); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, mode: "+QString::number(mode)+", name: "+name); + CopyEngineManager::returnCopyEngine returnInformations=copyEngineList->getCopyEngine(mode,name); + if(returnInformations.engine==NULL) + return -1; + return connectCopyEngine(mode,ignoreMode,returnInformations); } /** Connect the copy engine instance provided previously to the management */ -int Core::connectCopyEngine(const CopyMode &mode,bool ignoreMode,const CopyEngineManager::returnCopyEngine &returnInformations) -{ - if(returnInformations.canDoOnlyCopy) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Mode force for unknow reason"); - ignoreMode=false;//force mode if need, normaly not used - } - CopyInstance newItem; - newItem.engine=returnInformations.engine; - if(newItem.engine!=NULL) - { - PluginInterface_Themes *theme=themes->getThemesInstance(); - if(theme!=NULL) - { - newItem.id=incrementId(); - newItem.lastProgression=0; - newItem.interface=theme; - newItem.ignoreMode=ignoreMode; - newItem.mode=mode; - newItem.type=returnInformations.type; - newItem.transferListOperation=returnInformations.transferListOperation; - newItem.baseTime=0; - newItem.numberOfFile=0; - newItem.numberOfTransferedFile=0; - newItem.currentProgression=0; - newItem.totalProgression=0; - newItem.action=Idle; - newItem.lastProgression=0;//store the real byte transfered, used in time remaining calculation - newItem.isPaused=false; - newItem.baseTime=0;//stored in ms - newItem.isRunning=false; - newItem.haveError=false; - newItem.lastConditionalSync.start(); - newItem.nextConditionalSync=new QTimer(); - newItem.nextConditionalSync->setSingleShot(true); - newItem.copyEngineIsSync=true; - - if(!ignoreMode) - { - newItem.interface->forceCopyMode(mode); - newItem.engine->forceMode(mode); - } - if(copyList.size()==0) - forUpateInformation.start(); - copyList << newItem; - connectEngine(copyList.count()-1); - connectInterfaceAndSync(copyList.count()-1); - return newItem.id; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to load the interface, copy aborted"); - delete newItem.engine; - QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the interface, copy aborted")); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to load the copy engine, copy aborted"); - QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the copy engine, copy aborted")); - } - return -1; +int Core::connectCopyEngine(const Ultracopier::CopyMode &mode,bool ignoreMode,const CopyEngineManager::returnCopyEngine &returnInformations) +{ + if(returnInformations.canDoOnlyCopy) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Mode force for unknow reason"); + ignoreMode=false;//force mode if need, normaly not used + } + CopyInstance newItem; + newItem.engine=returnInformations.engine; + if(newItem.engine!=NULL) + { + PluginInterface_Themes *theme=ThemesManager::themesManager->getThemesInstance(); + if(theme!=NULL) + { + newItem.id=incrementId(); + newItem.lastProgression=0; + newItem.interface=theme; + newItem.ignoreMode=ignoreMode; + newItem.mode=mode; + newItem.type=returnInformations.type; + newItem.transferListOperation=returnInformations.transferListOperation; + newItem.numberOfFile=0; + newItem.numberOfTransferedFile=0; + newItem.currentProgression=0; + newItem.totalProgression=0; + newItem.action=Ultracopier::Idle; + newItem.lastProgression=0;//store the real byte transfered, used in time remaining calculation + newItem.isPaused=false; + newItem.isRunning=false; + newItem.haveError=false; + newItem.lastConditionalSync.start(); + newItem.nextConditionalSync=new QTimer(); + newItem.nextConditionalSync->setSingleShot(true); + newItem.copyEngineIsSync=true; + newItem.canceled=false; + + switch(OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("remainingTimeAlgorithm")).toUInt()) + { + default: + case 0: + newItem.remainingTimeAlgo=Ultracopier::RemainingTimeAlgo_Traditional; + break; + case 1: + newItem.remainingTimeAlgo=Ultracopier::RemainingTimeAlgo_Logarithmic; + { + int index=0; + while(indexforceCopyMode(mode); + newItem.engine->forceMode(mode); + } + if(copyList.size()==0) + forUpateInformation.start(); + copyList << newItem; + connectEngine(copyList.count()-1); + connectInterfaceAndSync(copyList.count()-1); + return newItem.id; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, copy aborted"); + delete newItem.engine; + QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the interface, copy aborted")); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the copy engine, copy aborted"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the copy engine, copy aborted")); + } + return -1; } void Core::resetSpeedDetectedEngine() { - int index=indexCopySenderCopyEngine(); - if(index!=-1) - resetSpeedDetected(index); + int index=indexCopySenderCopyEngine(); + if(index!=-1) + resetSpeedDetected(index); } void Core::resetSpeedDetectedInterface() { - int index=indexCopySenderInterface(); - if(index!=-1) - resetSpeedDetected(index); + int index=indexCopySenderInterface(); + if(index!=-1) + resetSpeedDetected(index); } void Core::resetSpeedDetected(const int &index) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start on %1").arg(index)); - copyList[index].runningTime.restart(); - copyList[index].lastSpeedDetected.clear(); - copyList[index].lastSpeedTime.clear(); -} - -void Core::actionInProgess(const EngineActionInProgress &action) -{ - index=indexCopySenderCopyEngine(); - if(index!=-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("action: %1, from %2").arg(action).arg(index)); - //drop here the duplicate action - if(copyList[index].action==action) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("The copy engine have send 2x the same EngineActionInProgress")); - return; - } - //update time runing for time remaning caculation - if(action==Copying || action==CopyingAndListing) - { - if(!copyList.at(index).isRunning) - { - copyList[index].isRunning=true; - copyList[index].runningTime.restart(); - } - } - else - { - if(copyList.at(index).isRunning) - { - copyList[index].isRunning=false; - copyList[index].baseTime+=copyList[index].runningTime.elapsed(); - } - } - //do sync - periodicSynchronization(index); - copyList[index].action=action; - if(copyList.at(index).interface!=NULL) - copyList.at(index).interface->actionInProgess(action); - if(action==Idle) - { - index_sub_loop=0; - loop_size=copyList.at(index).orderId.size(); - while(index_sub_loop > &timeList) { - int index=indexCopySenderCopyEngine(); - if(index!=-1) - { - copyList[index].folderListing=path; - copyList.at(index).interface->newFolderListing(path); - } + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + switch(copyList.at(index).remainingTimeAlgo) + { + case Ultracopier::RemainingTimeAlgo_Logarithmic: + if(copyList.at(index).remainingTimeLogarithmicValue.size() &timeUnit=timeList.at(sub_index); + const quint8 &col=fileCatNumber(timeUnit.first); + if(copyList.at(index).remainingTimeLogarithmicValue.size()<=col) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("bug, copyList.at(index).remainingTimeLogarithmicValue.size() %1 < col %2").arg(copyList.at(index).remainingTimeLogarithmicValue.size()).arg(col)); + break; + } + else + { + if(timeUnit.second>0) + { + copyList[index].remainingTimeLogarithmicValue[col].lastProgressionSpeed << timeUnit.first/timeUnit.second; + if(copyList[index].remainingTimeLogarithmicValue[col].lastProgressionSpeed.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + copyList[index].remainingTimeLogarithmicValue[col].lastProgressionSpeed.removeFirst(); + } + } + sub_index++; + } + } + default: + case Ultracopier::RemainingTimeAlgo_Traditional: + break; + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the interface sender"); } -void Core::newCollisionAction(const QString &action) +void Core::actionInProgess(const Ultracopier::EngineActionInProgress &action) { - int index=indexCopySenderCopyEngine(); - if(index!=-1) - { - copyList[index].collisionAction=action; - copyList.at(index).interface->newCollisionAction(action); - } + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action: %1, from %2").arg(action).arg(index)); + //drop here the duplicate action + if(copyList.at(index).action==action) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("The copy engine have send 2x the same EngineActionInProgress")); + return; + } + //update time runing for time remaning caculation + if(action==Ultracopier::Copying || action==Ultracopier::CopyingAndListing) + { + if(!copyList.at(index).isRunning) + copyList[index].isRunning=true; + } + else + { + if(copyList.at(index).isRunning) + copyList[index].isRunning=false; + } + //do sync + periodicSynchronizationWithIndex(index); + copyList[index].action=action; + if(copyList.at(index).interface!=NULL) + copyList.at(index).interface->actionInProgess(action); + if(action==Ultracopier::Idle) + { + int index_sub_loop=0; + const int &loop_size=copyList.at(index).orderId.size(); + while(index_sub_loopnewErrorAction(action); - } + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + copyList[index].folderListing=path; + copyList.at(index).interface->newFolderListing(path); + } } void Core::isInPause(const bool &isPaused) { - int index=indexCopySenderCopyEngine(); - if(index!=-1) - { - if(!isPaused) - resetSpeedDetected(index); - copyList[index].isPaused=isPaused; - copyList.at(index).interface->isInPause(isPaused); - } + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + if(!isPaused) + resetSpeedDetected(index); + copyList[index].isPaused=isPaused; + copyList.at(index).interface->isInPause(isPaused); + } } /// \brief get the right copy instance (copy engine + interface), by signal emited from copy engine int Core::indexCopySenderCopyEngine() { - QObject * senderObject=sender(); - if(senderObject==NULL) - { - //QMessageBox::critical(NULL,tr("Internal error"),tr("A communication error occured between the interface and the copy plugin. Please report this bug.")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Qt sender() NULL"); - return -1; - } - index=0; - loop_size=copyList.size(); - while(index(senderObject); - if(interface==NULL) - { - //QMessageBox::critical(NULL,tr("Internal error"),tr("A communication error occured between the interface and the copy plugin. Please report this bug.")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Qt sender themes NULL"); - return -1; - } - index=0; - while(index(senderObject); + if(interface==NULL) + { + //QMessageBox::critical(NULL,tr("Internal error"),tr("A communication error occured between the interface and the copy plugin. Please report this bug.")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Qt sender themes NULL"); + return -1; + } + index=0; + while(index)), currentCopyInstance.engine,SLOT(removeItems(QList)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for removeItems()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(moveItemsOnTop(QList)), currentCopyInstance.engine,SLOT(moveItemsOnTop(QList)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for moveItemsOnTop()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(moveItemsUp(QList)), currentCopyInstance.engine,SLOT(moveItemsUp(QList)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for moveItemsUp()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(moveItemsDown(QList)), currentCopyInstance.engine,SLOT(moveItemsDown(QList)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for moveItemsDown()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(moveItemsOnBottom(QList)), currentCopyInstance.engine,SLOT(moveItemsOnBottom(QList)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for moveItemsOnBottom()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(exportTransferList()), currentCopyInstance.engine,SLOT(exportTransferList()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for exportTransferList()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(importTransferList()), currentCopyInstance.engine,SLOT(importTransferList()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for importTransferList()").arg(index).arg((quint64)sender())); - - if(!connect(currentCopyInstance.interface,SIGNAL(newSpeedLimitation(qint64)), this,SLOT(resetSpeedDetectedInterface()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for newSpeedLimitation()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(resume()), this,SLOT(resetSpeedDetectedInterface()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for resume()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(cancel()), this,SLOT(copyInstanceCanceledByInterface()),Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for cancel()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.interface,SIGNAL(urlDropped(QList)), this,SLOT(urlDropped(QList)),Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for urlDropped()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.engine,SIGNAL(newActionOnList(QList)),this,SLOT(getActionOnList(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for newActionOnList()").arg(index).arg((quint64)sender())); - - if(!connect(currentCopyInstance.engine,SIGNAL(pushFileProgression(QList)), currentCopyInstance.interface,SLOT(setFileProgression(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for pushFileProgression()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.engine,SIGNAL(pushGeneralProgression(quint64,quint64)), currentCopyInstance.interface,SLOT(setGeneralProgression(quint64,quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for pushGeneralProgression()").arg(index).arg((quint64)sender())); - if(!connect(currentCopyInstance.engine,SIGNAL(pushGeneralProgression(quint64,quint64)), this,SLOT(pushGeneralProgression(quint64,quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("error at connect, the interface can not work correctly: %1: %2 for pushGeneralProgression() for this").arg(index).arg((quint64)sender())); - - currentCopyInstance.interface->setSpeedLimitation(currentCopyInstance.engine->getSpeedLimitation()); - currentCopyInstance.interface->setErrorAction(currentCopyInstance.engine->getErrorAction()); - currentCopyInstance.interface->setCollisionAction(currentCopyInstance.engine->getCollisionAction()); - currentCopyInstance.interface->setCopyType(currentCopyInstance.type); - currentCopyInstance.interface->setTransferListOperation(currentCopyInstance.transferListOperation); - currentCopyInstance.interface->actionInProgess(currentCopyInstance.action); - currentCopyInstance.interface->isInPause(currentCopyInstance.isPaused); - if(currentCopyInstance.haveError) - currentCopyInstance.interface->errorDetected(); - QWidget *tempWidget=currentCopyInstance.interface->getOptionsEngineWidget(); - if(tempWidget!=NULL) - currentCopyInstance.interface->getOptionsEngineEnabled(currentCopyInstance.engine->getOptionsEngine(tempWidget)); - //important, to have the modal dialog - currentCopyInstance.engine->setInterfacePointer(currentCopyInstance.interface); - - //put entry into the interface - currentCopyInstance.engine->syncTransferList(); - - //force the updating, without wait the timer - periodicSynchronization(index); -} - -void Core::disconnectEngine(const int &index) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start with index: %1").arg(index)); -// CopyInstance& currentCopyInstance=copyList[index]; -/* disconnect(currentCopyInstance.engine,SIGNAL(newFolderListing(QString)), this,SLOT(newFolderListing(QString)));//to check to change - disconnect(currentCopyInstance.engine,SIGNAL(newCollisionAction(QString)), this,SLOT(newCollisionAction(QString))); - disconnect(currentCopyInstance.engine,SIGNAL(newErrorAction(QString)), this,SLOT(newErrorAction(QString))); - disconnect(currentCopyInstance.engine,SIGNAL(actionInProgess(EngineActionInProgress)), this,SLOT(actionInProgess(EngineActionInProgress))); - disconnect(currentCopyInstance.engine,SIGNAL(isInPause(bool)), this,SLOT(isInPause(bool)));//to check to change - disconnect(currentCopyInstance.engine,SIGNAL(cancelAll()), this,SLOT(copyInstanceCanceledByEngine())); - disconnect(currentCopyInstance.engine,SIGNAL(error(QString,quint64,QDateTime,QString)), this,SLOT(error(QString,quint64,QDateTime,QString))); - disconnect(currentCopyInstance.engine,SIGNAL(rmPath(QString)), this,SLOT(rmPath(QString))); - disconnect(currentCopyInstance.engine,SIGNAL(mkPath(QString)), this,SLOT(mkPath(QString)));*/ - -} - -void Core::disconnectInterface(const int &index) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start with index: %1").arg(index)); - Q_UNUSED(index); -/* CopyInstance& currentCopyInstance=copyList[index]; - disconnect(currentCopyInstance.interface,SIGNAL(pause()), currentCopyInstance.engine,SLOT(pause())); - disconnect(currentCopyInstance.interface,SIGNAL(resume()), currentCopyInstance.engine,SLOT(resume())); - disconnect(currentCopyInstance.interface,SIGNAL(skip(quint64)), currentCopyInstance.engine,SLOT(skip(quint64))); - disconnect(currentCopyInstance.interface,SIGNAL(sendErrorAction(QString)), currentCopyInstance.engine,SLOT(setErrorAction(QString))); - disconnect(currentCopyInstance.interface,SIGNAL(newSpeedLimitation(qint64)), currentCopyInstance.engine,SLOT(setSpeedLimitation(qint64))); - disconnect(currentCopyInstance.interface,SIGNAL(sendCollisionAction(QString)), currentCopyInstance.engine,SLOT(setCollisionAction(QString))); - disconnect(currentCopyInstance.interface,SIGNAL(userAddFolder(CopyMode)), currentCopyInstance.engine,SLOT(userAddFolder(CopyMode))); - disconnect(currentCopyInstance.interface,SIGNAL(userAddFile(CopyMode)), currentCopyInstance.engine,SLOT(userAddFile(CopyMode))); - - disconnect(currentCopyInstance.interface,SIGNAL(removeItems(QList)), currentCopyInstance.engine,SLOT(removeItems(QList))); - disconnect(currentCopyInstance.interface,SIGNAL(moveItemsOnTop(QList)), currentCopyInstance.engine,SLOT(moveItemsOnTop(QList))); - disconnect(currentCopyInstance.interface,SIGNAL(moveItemsUp(QList)), currentCopyInstance.engine,SLOT(moveItemsUp(QList))); - disconnect(currentCopyInstance.interface,SIGNAL(moveItemsDown(QList)), currentCopyInstance.engine,SLOT(moveItemsDown(QList))); - disconnect(currentCopyInstance.interface,SIGNAL(moveItemsOnBottom(QList)), currentCopyInstance.engine,SLOT(moveItemsOnBottom(QList))); - - disconnect(currentCopyInstance.interface,SIGNAL(newSpeedLimitation(qint64)), this,SLOT(resetSpeedDetectedInterface())); - disconnect(currentCopyInstance.interface,SIGNAL(resume()), this,SLOT(resetSpeedDetectedInterface())); - disconnect(currentCopyInstance.interface,SIGNAL(cancel()), this,SLOT(copyInstanceCanceledByInterface())); - disconnect(currentCopyInstance.interface,SIGNAL(urlDropped(QList)), this,SLOT(urlDropped(QList))); - - disconnect(currentCopyInstance.engine,SIGNAL(newActionOnList(QList)), currentCopyInstance.interface,SLOT(getActionOnList(QList))); - disconnect(currentCopyInstance.engine,SIGNAL(pushFileProgression(QList)), currentCopyInstance.interface,SLOT(setFileProgression(QList))); - disconnect(currentCopyInstance.engine,SIGNAL(pushGeneralProgression(quint64,quint64)), currentCopyInstance.interface,SLOT(setGeneralProgression(quint64,quint64)));*/ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start with index: %1: %2").arg(index).arg((quint64)sender())); + //disconnectInterface(index); + + CopyInstance& currentCopyInstance=copyList[index]; + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::pause, currentCopyInstance.engine,&PluginInterface_CopyEngine::pause)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for pause()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::resume, currentCopyInstance.engine,&PluginInterface_CopyEngine::resume)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for resume()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::skip, currentCopyInstance.engine,&PluginInterface_CopyEngine::skip)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for skip()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::newSpeedLimitation, currentCopyInstance.engine,&PluginInterface_CopyEngine::setSpeedLimitation)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for newSpeedLimitation()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::userAddFolder, currentCopyInstance.engine,&PluginInterface_CopyEngine::userAddFolder)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for userAddFolder()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::userAddFile, currentCopyInstance.engine,&PluginInterface_CopyEngine::userAddFile)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for userAddFile()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::removeItems, currentCopyInstance.engine,&PluginInterface_CopyEngine::removeItems)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for removeItems()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::moveItemsOnTop, currentCopyInstance.engine,&PluginInterface_CopyEngine::moveItemsOnTop)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for moveItemsOnTop()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::moveItemsUp, currentCopyInstance.engine,&PluginInterface_CopyEngine::moveItemsUp)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for moveItemsUp()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::moveItemsDown, currentCopyInstance.engine,&PluginInterface_CopyEngine::moveItemsDown)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for moveItemsDown()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::moveItemsOnBottom, currentCopyInstance.engine,&PluginInterface_CopyEngine::moveItemsOnBottom)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for moveItemsOnBottom()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::exportTransferList, currentCopyInstance.engine,&PluginInterface_CopyEngine::exportTransferList)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for exportTransferList()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::exportErrorIntoTransferList, currentCopyInstance.engine,&PluginInterface_CopyEngine::exportErrorIntoTransferList)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for exportErrorIntoTransferList()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::importTransferList, currentCopyInstance.engine,&PluginInterface_CopyEngine::importTransferList)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for importTransferList()").arg(index).arg((quint64)sender())); + + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::newSpeedLimitation, this,&Core::resetSpeedDetectedInterface)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for newSpeedLimitation()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::resume, this,&Core::resetSpeedDetectedInterface)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for resume()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::cancel, this,&Core::copyInstanceCanceledByInterface,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for cancel()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.interface,&PluginInterface_Themes::urlDropped, this,&Core::urlDropped,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for urlDropped()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.engine,&PluginInterface_CopyEngine::newActionOnList,this,&Core::getActionOnList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for newActionOnList()").arg(index).arg((quint64)sender())); + + if(!connect(currentCopyInstance.engine,&PluginInterface_CopyEngine::pushFileProgression, currentCopyInstance.interface,&PluginInterface_Themes::setFileProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for pushFileProgression()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.engine,&PluginInterface_CopyEngine::pushGeneralProgression, currentCopyInstance.interface,&PluginInterface_Themes::setGeneralProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for pushGeneralProgression()").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.engine,&PluginInterface_CopyEngine::pushGeneralProgression, this,&Core::pushGeneralProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for pushGeneralProgression() for this").arg(index).arg((quint64)sender())); + if(!connect(currentCopyInstance.engine,&PluginInterface_CopyEngine::errorToRetry, currentCopyInstance.interface,&PluginInterface_Themes::errorToRetry, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("error at connect, the interface can not work correctly: %1: %2 for errorToRetry() for this").arg(index).arg((quint64)sender())); + + currentCopyInstance.interface->setSupportSpeedLimitation(currentCopyInstance.engine->supportSpeedLimitation()); + currentCopyInstance.interface->setCopyType(currentCopyInstance.type); + currentCopyInstance.interface->setTransferListOperation(currentCopyInstance.transferListOperation); + currentCopyInstance.interface->actionInProgess(currentCopyInstance.action); + currentCopyInstance.interface->isInPause(currentCopyInstance.isPaused); + if(currentCopyInstance.haveError) + currentCopyInstance.interface->errorDetected(); + QWidget *tempWidget=currentCopyInstance.interface->getOptionsEngineWidget(); + if(tempWidget!=NULL) + currentCopyInstance.interface->getOptionsEngineEnabled(currentCopyInstance.engine->getOptionsEngine(tempWidget)); + //important, to have the modal dialog + currentCopyInstance.engine->setInterfacePointer(currentCopyInstance.interface); + + //put entry into the interface + currentCopyInstance.engine->syncTransferList(); + + //force the updating, without wait the timer + periodicSynchronizationWithIndex(index); } void Core::periodicSynchronization() { - index_sub_loop=0; - loop_size=copyList.size(); - while(index_sub_looprealByteTransfered(); - diffCopiedSize=0; - if(realByteTransfered>=currentCopyInstance.lastProgression) - diffCopiedSize=realByteTransfered-currentCopyInstance.lastProgression; - currentCopyInstance.lastProgression=realByteTransfered; - - // algo 1: - // ((double)currentProgression)/totalProgression -> example: done 80% -> 0.8 - // baseTime+runningTime -> example: done into 80s, remaining time: 80/0.8-80=80*(1/0.8-1)=20s - // algo 2 (not used): - // remaining byte/current speed - - transferAddedTime=currentCopyInstance.baseTime+currentCopyInstance.runningTime.elapsed(); - - //remaining time: (total byte - lastProgression)/byte per ms since the start - if(currentCopyInstance.totalProgression==0 || currentCopyInstance.currentProgression==0) - currentCopyInstance.interface->remainingTime(-1); - else - currentCopyInstance.interface->remainingTime(transferAddedTime*((double)currentCopyInstance.totalProgression/(double)currentCopyInstance.currentProgression-1)/1000); - - //do the speed calculation - if(lastProgressionTime.isNull()) - lastProgressionTime.start(); - else - { - if((currentCopyInstance.action==Copying || currentCopyInstance.action==CopyingAndListing)) - { - currentCopyInstance.lastSpeedTime << lastProgressionTime.elapsed(); - currentCopyInstance.lastSpeedDetected << diffCopiedSize; - while(currentCopyInstance.lastSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) - { - currentCopyInstance.lastSpeedTime.removeFirst(); - currentCopyInstance.lastSpeedDetected.removeFirst(); - } - totTime=0; - totSpeed=0; - index_sub_loop=0; - loop_size=currentCopyInstance.lastSpeedDetected.size(); - while(index_sub_loopdetectedSpeed(totSpeed/totTime); - } - lastProgressionTime.restart(); - } - } + int index_sub_loop=0; + const int &loop_size=copyList.size(); + while(index_sub_looprealByteTransfered(); + quint64 diffCopiedSize=0; + if(realByteTransfered>=currentCopyInstance.lastProgression) + diffCopiedSize=realByteTransfered-currentCopyInstance.lastProgression; + currentCopyInstance.lastProgression=realByteTransfered; + + // algo 1: + // ((double)currentProgression)/totalProgression -> example: done 80% -> 0.8 + // baseTime+runningTime -> example: done into 80s, remaining time: 80/0.8-80=80*(1/0.8-1)=20s + // algo 2 (not used): + // remaining byte/current speed + + //remaining time: (total byte - lastProgression)/byte per ms since the start + /*if(currentCopyInstance.totalProgression==0 || currentCopyInstance.currentProgression==0) + currentCopyInstance.interface->remainingTime(-1); + else if((currentCopyInstance.totalProgression-currentCopyInstance.currentProgression)>1024) + currentCopyInstance.interface->remainingTime(transferAddedTime*((double)currentCopyInstance.totalProgression/(double)currentCopyInstance.currentProgression-1)/1000);*/ + + //do the speed calculation + if(lastProgressionTime.isNull()) + lastProgressionTime.start(); + else + { + if((currentCopyInstance.action==Ultracopier::Copying || currentCopyInstance.action==Ultracopier::CopyingAndListing)) + { + currentCopyInstance.lastSpeedTime << lastProgressionTime.elapsed(); + currentCopyInstance.lastSpeedDetected << diffCopiedSize; + currentCopyInstance.lastAverageSpeedTime << lastProgressionTime.elapsed(); + currentCopyInstance.lastAverageSpeedDetected << diffCopiedSize; + while(currentCopyInstance.lastSpeedTime.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + currentCopyInstance.lastSpeedTime.removeFirst(); + while(currentCopyInstance.lastSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + currentCopyInstance.lastSpeedDetected.removeFirst(); + while(currentCopyInstance.lastAverageSpeedTime.size()>ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME) + currentCopyInstance.lastAverageSpeedTime.removeFirst(); + while(currentCopyInstance.lastAverageSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME) + currentCopyInstance.lastAverageSpeedDetected.removeFirst(); + double totTime=0,totAverageTime=0; + double totSpeed=0,totAverageSpeed=0; + + //current speed + int index_sub_loop=0; + int loop_size=currentCopyInstance.lastSpeedDetected.size(); + while(index_sub_loop0) + if(loop_size>=ULTRACOPIER_MINVALUESPEED) + currentCopyInstance.interface->detectedSpeed(totSpeed/totTime); + + if(totAverageTime>0) + if(loop_size>=ULTRACOPIER_MINVALUESPEEDTOREMAININGTIME) + { + if(currentCopyInstance.remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Traditional) + { + if(totSpeed>0) + { + //remaining time: (total byte - lastProgression)/byte per ms since the start + if(currentCopyInstance.totalProgression==0 || currentCopyInstance.currentProgression==0) + currentCopyInstance.interface->remainingTime(-1); + else if((currentCopyInstance.totalProgression-currentCopyInstance.currentProgression)>1024) + currentCopyInstance.interface->remainingTime((currentCopyInstance.totalProgression-currentCopyInstance.currentProgression)/(totAverageSpeed/totAverageTime)); + } + else + currentCopyInstance.interface->remainingTime(-1); + } + else if(currentCopyInstance.remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Logarithmic) + { + int remainingTimeValue=0; + //calculate for each file class + index_sub_loop=0; + loop_size=currentCopyInstance.remainingTimeLogarithmicValue.size(); + while(index_sub_loop=ULTRACOPIER_MINVALUESPEED) + { + int average_speed=0; + int temp_loop_index=0; + while(temp_loop_index0) + { + //remaining time: (total byte - lastProgression)/byte per ms since the start + if(currentCopyInstance.totalProgression==0 || currentCopyInstance.currentProgression==0) + remainingTimeValue+=1; + else if((currentCopyInstance.totalProgression-currentCopyInstance.currentProgression)>1024) + remainingTimeValue+=remainingSize/totAverageSpeed; + } + else + remainingTimeValue+=1; + } + index_sub_loop++; + } + currentCopyInstance.interface->remainingTime(remainingTimeValue); + } + else + {}//error case + } + } + lastProgressionTime.restart(); + } + } +} + +quint8 Core::fileCatNumber(quint64 size) +{ + //all is in base 10 to understand more easily + //drop the big value + if(size>ULTRACOPIER_REMAININGTIME_BIGFILEMEGABYTEBASE10*1000*1000) + size=ULTRACOPIER_REMAININGTIME_BIGFILEMEGABYTEBASE10*1000*1000; + size=size/100;//to group all the too small file into the value 0 + return log10(size); } /// \brief the copy engine have canceled the transfer void Core::copyInstanceCanceledByEngine() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=indexCopySenderCopyEngine(); - if(index!=-1) - copyInstanceCanceledByIndex(index); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to locate the copy engine sender"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=indexCopySenderCopyEngine(); + if(index!=-1) + copyInstanceCanceledByIndex(index); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); } /// \brief the interface have canceled the transfer void Core::copyInstanceCanceledByInterface() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=indexCopySenderInterface(); - if(index!=-1) - copyInstanceCanceledByIndex(index); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to locate the copy engine sender"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=indexCopySenderInterface(); + if(index!=-1) + copyInstanceCanceledByIndex(index); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); } /// \brief the transfer have been canceled void Core::copyInstanceCanceledByIndex(const int &index) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, remove with the index: "+QString::number(index)); - disconnectEngine(index); - disconnectInterface(index); - CopyInstance& currentCopyInstance=copyList[index]; - currentCopyInstance.engine->cancel(); - delete currentCopyInstance.nextConditionalSync; - currentCopyInstance.engine->cancel(); - delete currentCopyInstance.interface; - index_sub_loop=0; - loop_size=currentCopyInstance.orderId.size(); - while(index_sub_loopcancel(); + delete currentCopyInstance.nextConditionalSync; + delete currentCopyInstance.interface; + int index_sub_loop=0; + const int &loop_size=currentCopyInstance.orderId.size(); + while(index_sub_loop(senderObject); - if(copyEngine==NULL) - { - //QMessageBox::critical(NULL,tr("Internal error"),tr("A communication error occured between the interface and the copy plugin. Please report this bug.")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Qt sender() NULL"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, delete the copy engine"); - delete copyEngine; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop, delete the copy engine"); + QObject * senderObject=sender(); + if(senderObject==NULL) + { + //QMessageBox::critical(NULL,tr("Internal error"),tr("A communication error occured between the interface and the copy plugin. Please report this bug.")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Qt sender() NULL"); + return; + } + PluginInterface_CopyEngine * copyEngine = static_cast(senderObject); + if(copyEngine==NULL) + { + //QMessageBox::critical(NULL,tr("Internal error"),tr("A communication error occured between the interface and the copy plugin. Please report this bug.")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Qt sender() NULL"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, delete the copy engine"); + delete copyEngine; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop, delete the copy engine"); } //error occurred void Core::error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error) { - log.error(path,size,mtime,error); - int index=indexCopySenderCopyEngine(); - if(index!=-1) - { - copyList[index].haveError=true; - copyList.at(index).interface->errorDetected(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to locate the copy engine sender"); + log.error(path,size,mtime,error); + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + copyList[index].haveError=true; + copyList.at(index).interface->errorDetected(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); } //for the extra logging void Core::rmPath(const QString &path) { - log.rmPath(path); + log.rmPath(path); } void Core::mkPath(const QString &path) { - log.mkPath(path); + log.mkPath(path); } /// \brief to rsync after a new interface connection void Core::syncReady() { - int index=indexCopySenderCopyEngine(); - if(index!=-1) - copyList[index].copyEngineIsSync=true; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to locate the copy engine sender"); + int index=indexCopySenderCopyEngine(); + if(index!=-1) + copyList[index].copyEngineIsSync=true; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); } -void Core::getActionOnList(const QList & actionList) +void Core::getActionOnList(const QList &actionList) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=indexCopySenderCopyEngine(); - if(index!=-1) - { - if(copyList[index].copyEngineIsSync) - copyList[index].interface->getActionOnList(actionList); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to locate the copy engine sender"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //send the the interface + const int &index=indexCopySenderCopyEngine(); + if(index!=-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start2")); + if(copyList.at(index).copyEngineIsSync) + copyList.at(index).interface->getActionOnList(actionList); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start3")); + //log to the file and compute the remaining time + if(log.logTransfer() || copyList.at(index).remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Logarithmic) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start4")); + int sub_index=0; + const int &size=actionList.size(); + if(log.logTransfer() && copyList.at(index).remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Logarithmic) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start5")); + while(sub_index &urls) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=indexCopySenderInterface(); - if(index!=-1) - { - QStringList sources; - int index_loop=0; - while(index_loopnewCopy(sources); - if(reply==QMessageBox::No) - copyList.at(index).engine->newMove(sources); - } - else - { - if(copyList.at(index).mode==Copy) - copyList.at(index).engine->newCopy(sources); - else - copyList.at(index).engine->newMove(sources); - } - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to locate the copy engine sender"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=indexCopySenderInterface(); + if(index!=-1) + { + QStringList sources; + int index_loop=0; + while(index_loopnewCopy(sources); + if(reply==QMessageBox::No) + copyList.at(index).engine->newMove(sources); + } + else + { + if(copyList.at(index).mode==Ultracopier::Copy) + copyList.at(index).engine->newCopy(sources); + else + copyList.at(index).engine->newMove(sources); + } + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); } diff --git a/Core.h b/Core.h index a3a9c2a..3b2928c 100644 --- a/Core.h +++ b/Core.h @@ -1,8 +1,6 @@ /** \file Core.h \brief Define the class definition for core, the Copy of each copy/move window \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef CORE_H @@ -20,7 +18,6 @@ #include "Environment.h" #include "StructEnumDefinition.h" #include "CopyEngineManager.h" -#include "GlobalClass.h" #include "LogThread.h" #include "interface/PluginInterface_CopyEngine.h" #include "interface/PluginInterface_Themes.h" @@ -28,159 +25,172 @@ /** \brief Define the class definition for core, the Copy of each copy/move window This class provide a core for dispatch the event of signal/slot, it checks too if not other instance is running */ -class Core : public QObject, public GlobalClass +class Core : public QObject { - Q_OBJECT - public: - /// \brief Initate the core of one copy or move window, dispatch the event specific at this window - Core(CopyEngineManager *copyEngineList); - private: - CopyEngineManager *copyEngineList; - struct RunningTransfer - { - ItemOfCopyList item; - bool progression; - }; - struct CopyInstance - { - int id; - PluginInterface_CopyEngine * engine; - PluginInterface_Themes * interface; - bool ignoreMode; - CopyMode mode; - quint64 numberOfFile; - quint64 numberOfTransferedFile; - quint64 currentProgression,totalProgression;//store the file byte transfered, used into the remaining time - EngineActionInProgress action; - quint64 lastProgression;//store the real byte transfered, used in speed calculation - QList lastSpeedDetected;//stored in bytes - QList lastSpeedTime;//stored in ms - QList transferItemList;//full info of started item, to have wich progression to poll - QList orderId;//external order send via listener plugin - QString folderListing; - QString collisionAction; - QString errorAction; - bool isPaused; - quint64 baseTime;//stored in ms - QTime runningTime; - bool isRunning; - CopyType type; - TransferListOperation transferListOperation; - bool haveError; - QTime lastConditionalSync; - QTimer *nextConditionalSync; - bool copyEngineIsSync; - }; - QList copyList; - /** open with specific source/destination - \param move Copy or move - \param ignoreMode if need ignore the mode - \param protocolsUsedForTheSources protocols used for sources - \param protocolsUsedForTheDestination protocols used for destination - */ - int openNewCopyEngineInstance(const CopyMode &mode,const bool &ignoreMode,const QStringList &protocolsUsedForTheSources=QStringList(),const QString &protocolsUsedForTheDestination=""); - /** open with specific copy engine - \param move Copy or move - \param ignoreMode if need ignore the mode - \param protocolsUsedForTheSources protocols used for sources - \param protocolsUsedForTheDestination protocols used for destination - */ - int openNewCopyEngineInstance(const CopyMode &mode,const bool &ignoreMode,const QString &name); - - /// \brief get the right copy instance (copy engine + interface), by signal emited from copy engine - int indexCopySenderCopyEngine(); - /// \brief get the right copy instance (copy engine + interface), by signal emited from interface - int indexCopySenderInterface(); - - void connectEngine(const int &index); - void connectInterfaceAndSync(const int &index); - void disconnectEngine(const int &index); - void disconnectInterface(const int &index); - - /** \brief update at periodic interval, the synchronization between copy engine and interface, but for specific entry - \see forUpateInformation */ - void periodicSynchronization(const int &index); - - //for the internal management - int incrementId(); - int nextId; - QList idList; - QTime lastProgressionTime; - QTimer forUpateInformation;///< used to call \see periodicSynchronization() - void resetSpeedDetected(const int &index); - - /** Connect the copy engine instance provided previously to the management */ - int connectCopyEngine(const CopyMode &mode,bool ignoreMode,const CopyEngineManager::returnCopyEngine &returnInformations); - - LogThread log;///< To save the log like mkpath, rmpath, error, copy, ... - //temp variable - int index,index_sub_loop,loop_size,loop_sub_size; - double totTime; - double totSpeed; - quint64 realByteTransfered; - quint64 transferSpeed; - quint64 transferAddedTime; - quint64 diffCopiedSize; - signals: - void copyFinished(const quint32 & orderId,bool withError); - void copyCanceled(const quint32 & orderId); - public slots: - /** \brief do copy with sources, but ask the destination */ - void newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources); - /** \brief do copy with sources and destination */ - void newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination); - /** \brief do move with sources, but ask the destination */ - void newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources); - /** \brief do move with sources and destination */ - void newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination); - /** \brief open copy/move windows with specific engine */ - void addWindowCopyMove(const CopyMode &mode,const QString &name); - /** \brief open transfer (copy+move) windows with specific engine */ - void addWindowTransfer(const QString &name); - /** new transfer list pased by the CLI */ - void newTransferList(QString engine,QString mode,QString file); - private slots: - /// \brief the copy engine have canceled the transfer - void copyInstanceCanceledByEngine(); - /// \brief the interface have canceled the transfer - void copyInstanceCanceledByInterface(); - /// \brief the transfer have been canceled - void copyInstanceCanceledByIndex(const int &index); - /// \brief only when the copy engine say it's ready to delete them self, it call this - void deleteCopyEngine(); - - // some stat update - void actionInProgess(const EngineActionInProgress &action); - void newFolderListing(const QString &path); - void newCollisionAction(const QString &action); - void newErrorAction(const QString &action); - void isInPause(const bool&); - - /** \brief update at periodic interval, the synchronization between copy engine and interface - \see forUpateInformation */ - void periodicSynchronization(); - - //reset some information - void resetSpeedDetectedEngine(); - void resetSpeedDetectedInterface(); - - //load the interface - void loadInterface(); - void unloadInterface(); - - //error occurred - void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error); - //for the extra logging - void rmPath(const QString &path); - void mkPath(const QString &path); - - /// \brief used to drag and drop files - void urlDropped(const QList &urls); - /// \brief to rsync after a new interface connection - void syncReady(); - - void getActionOnList(const QList & actionList); - void pushGeneralProgression(const quint64 ¤t,const quint64 &total); + Q_OBJECT + public: + /// \brief Initate the core of one copy or move window, dispatch the event specific at this window + Core(CopyEngineManager *copyEngineList); + ~Core(); + private: + CopyEngineManager *copyEngineList; + struct RunningTransfer + { + Ultracopier::ItemOfCopyList item; + bool progression; + }; + struct RemainingTimeLogarithmicColumn + { + QList lastProgressionSpeed; + quint64 totalSize; + quint64 transferedSize; + }; + + struct CopyInstance + { + int id; + PluginInterface_CopyEngine * engine; + PluginInterface_Themes * interface; + bool ignoreMode; + Ultracopier::CopyMode mode; + quint64 numberOfFile; + quint64 numberOfTransferedFile; + quint64 currentProgression,totalProgression;//store the file byte transfered, used into the remaining time + Ultracopier::EngineActionInProgress action; + quint64 lastProgression;//store the real byte transfered, used in speed calculation + QList transferItemList;//full info of started item, to have wich progression to poll + QList orderId;//external order send via listener plugin + QString folderListing; + QString collisionAction; + QString errorAction; + bool isPaused; + bool isRunning; + Ultracopier::CopyType type; + Ultracopier::TransferListOperation transferListOperation; + bool haveError; + QTime lastConditionalSync; + QTimer *nextConditionalSync; + bool copyEngineIsSync; + bool canceled;//to not try groun when is in canceling + + Ultracopier::RemainingTimeAlgo remainingTimeAlgo; + + /** for RemainingTimeAlgo_Traditional **/ + //this speed is for instant speed + QList lastSpeedDetected;//stored in bytes + QList lastSpeedTime;//stored in ms + //this speed is average speed on more time to calculate the remaining time + QList lastAverageSpeedDetected;//stored in bytes + QList lastAverageSpeedTime;//stored in ms + + /** for RemainingTimeAlgo_Logarithmic **/ + QList remainingTimeLogarithmicValue; + }; + QList copyList; + /** open with specific source/destination + \param move Copy or move + \param ignoreMode if need ignore the mode + \param protocolsUsedForTheSources protocols used for sources + \param protocolsUsedForTheDestination protocols used for destination + */ + int openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const QStringList &protocolsUsedForTheSources=QStringList(),const QString &protocolsUsedForTheDestination=""); + /** open with specific copy engine + \param move Copy or move + \param ignoreMode if need ignore the mode + \param protocolsUsedForTheSources protocols used for sources + \param protocolsUsedForTheDestination protocols used for destination + */ + int openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const QString &name); + + /// \brief get the right copy instance (copy engine + interface), by signal emited from copy engine + int indexCopySenderCopyEngine(); + /// \brief get the right copy instance (copy engine + interface), by signal emited from interface + int indexCopySenderInterface(); + + void connectEngine(const int &index); + void connectInterfaceAndSync(const int &index); + //void disconnectEngine(const int &index); + //void disconnectInterface(const int &index); + + /** \brief update at periodic interval, the synchronization between copy engine and interface, but for specific entry + \see forUpateInformation */ + void periodicSynchronizationWithIndex(const int &index); + + //for the internal management + int incrementId(); + int nextId; + QList idList; + QTime lastProgressionTime; + QTimer forUpateInformation;///< used to call \see periodicSynchronization() + void resetSpeedDetected(const int &index); + + /** Connect the copy engine instance provided previously to the management */ + int connectCopyEngine(const Ultracopier::CopyMode &mode,bool ignoreMode,const CopyEngineManager::returnCopyEngine &returnInformations); + + LogThread log;///< To save the log like mkpath, rmpath, error, copy, ... + quint64 realByteTransfered; + + static quint8 fileCatNumber(quint64 size); + signals: + void copyFinished(const quint32 & orderId,bool withError) const; + void copyCanceled(const quint32 & orderId) const; + public slots: + /** \brief do copy with sources, but ask the destination */ + void newCopyWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources); + void newTransfer(const Ultracopier::CopyMode &mode,const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination); + /** \brief do copy with sources and destination */ + void newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination); + /** \brief do move with sources, but ask the destination */ + void newMoveWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources); + /** \brief do move with sources and destination */ + void newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination); + /** \brief open copy/move windows with specific engine */ + void addWindowCopyMove(const Ultracopier::CopyMode &mode,const QString &name); + /** \brief open transfer (copy+move) windows with specific engine */ + void addWindowTransfer(const QString &name); + /** new transfer list pased by the CLI */ + void newTransferList(QString engine,QString mode,QString file); + private slots: + /// \brief the copy engine have canceled the transfer + void copyInstanceCanceledByEngine(); + /// \brief the interface have canceled the transfer + void copyInstanceCanceledByInterface(); + /// \brief the transfer have been canceled + void copyInstanceCanceledByIndex(const int &index); + /// \brief only when the copy engine say it's ready to delete them self, it call this + void deleteCopyEngine(); + + // some stat update + void actionInProgess(const Ultracopier::EngineActionInProgress &action); + void newFolderListing(const QString &path); + void isInPause(const bool&); + + /** \brief update at periodic interval, the synchronization between copy engine and interface + \see forUpateInformation */ + void periodicSynchronization(); + + //reset some information + void resetSpeedDetectedEngine(); + void resetSpeedDetectedInterface(); + + //load the interface + void loadInterface(); + void unloadInterface(); + + //error occurred + void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error); + //for the extra logging + void rmPath(const QString &path); + void mkPath(const QString &path); + + /// \brief used to drag and drop files + void urlDropped(const QList &urls); + /// \brief to rsync after a new interface connection + void syncReady(); + void doneTime(const QList > &timeList); + + void getActionOnList(const QList & actionList); + void pushGeneralProgression(const quint64 ¤t,const quint64 &total); }; #endif // CORE_H diff --git a/DebugEngine.cpp b/DebugEngine.cpp index 4fe6314..2cdfaab 100644 --- a/DebugEngine.cpp +++ b/DebugEngine.cpp @@ -1,25 +1,27 @@ /** \file DebugEngine.cpp \brief Define the class for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include -#include #include #include #include +#include #include "Variable.h" #include "DebugEngine.h" #include "ExtraSocket.h" +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief The local macro: ULTRACOPIER_DEBUGCONSOLE #if defined (__FILE__) && defined (__LINE__) - #define ULTRACOPIER_DEBUGCONSOLE(a,b) addDebugInformation(a,__func__,b,__FILE__,__LINE__) +# define ULTRACOPIER_DEBUGCONSOLE(a,b) addDebugInformation(a,__func__,b,__FILE__,__LINE__) #else - #define ULTRACOPIER_DEBUGCONSOLE(a,b) addDebugInformation(a,__func__,b) +# define ULTRACOPIER_DEBUGCONSOLE(a,b) addDebugInformation(a,__func__,b) #endif #ifdef ULTRACOPIER_DEBUG @@ -27,360 +29,365 @@ /// \brief initiate the ultracopier event dispatcher and check if no other session is running DebugEngine::DebugEngine() { - addDebugInformationCallNumber=0; - //Load the first content - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+="Ultracopier "+QString(ULTRACOPIER_VERSION)+" "+QString(ULTRACOPIER_PLATFORM_NAME)+", debug report"; - debugHtmlContent+=""; - debugHtmlContent+=""; - debugHtmlContent+=""; - //Load the start time at now - startTime.start(); - //Load the log file end - endOfLogFile="
"; - //check if other instance is running, then switch to memory backend - if(tryConnect()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Notice,"currentBackend: File because other session is runing"); - currentBackend=Memory; - return; - } - //The lock and log file path is not defined - bool fileNameIsLoaded=false; - #ifdef ULTRACOPIER_VERSION_PORTABLE - #ifdef ULTRACOPIER_VERSION_PORTABLEAPPS - //Load the data folder path - QDir dir(QCoreApplication::applicationDirPath()); - dir.cdUp(); - dir.cdUp(); - dir.cd("Data"); - logFile.setFileName(dir.absolutePath()+QDir::separator()+"log.html"); - lockFile.setFileName(dir.absolutePath()+QDir::separator()+"ultracopier.lock"); - fileNameIsLoaded=true; - #else - //Load the ultracopier path - QDir dir(QCoreApplication::applicationDirPath()); - logFile.setFileName(dir.absolutePath()+QDir::separator()+"log.html"); - lockFile.setFileName(dir.absolutePath()+QDir::separator()+"ultracopier.lock"); - fileNameIsLoaded=true; - #endif - #else - #ifdef Q_OS_WIN32 - #define EXTRA_HOME_PATH "\\ultracopier\\" - #else - #define EXTRA_HOME_PATH "/.config/Ultracopier/" - #endif - //Load the user path only if exists and writable - QDir dir(QFSFileEngine::homePath()+EXTRA_HOME_PATH); - bool errorFound=false; - //If user's directory not exists create it - if(!dir.exists()) - { - //If failed not load the file - if(!dir.mkpath(dir.absolutePath())) - { - errorFound=true; - puts(qPrintable("Unable to make path: "+dir.absolutePath()+", disable file log")); - } - } - //If no error found set the file name - if(errorFound==false) - { - fileNameIsLoaded=true; - logFile.setFileName(dir.absolutePath()+QDir::separator()+"log.html"); - lockFile.setFileName(dir.absolutePath()+QDir::separator()+"ultracopier.lock"); - } - errorFound=false; - #endif - //If the file name is loaded - if(fileNameIsLoaded) - { - //If the previous file is here, then crash previous, ask if the user want to save - if(lockFile.exists() && logFile.exists()) - { - //Try open the file as read only to propose save it as the user - //Don't ask it if unable to write, because unable to remove, then alert at all start - if(removeTheLockFile()) - { - //Ask to the user - QMessageBox::StandardButton reply = QMessageBox::question(NULL,"Save the previous report","Ultracopier seam have crashed, do you want save the previous report for report it to the forum?",QMessageBox::Yes|QMessageBox::No,QMessageBox::No); - if(reply==QMessageBox::Yes) - saveBugReport(); - } - else - puts(qPrintable(logFile.fileName()+" unable to open it as read")); - } - //Now try to create and open the log file and lock file - if(!lockFile.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Unbuffered)) - { - currentBackend=Memory; - puts(qPrintable(lockFile.fileName()+" unable to open it as write, log into file disabled")); - } - else - { - if(!logFile.open(QIODevice::ReadWrite|QIODevice::Truncate|QIODevice::Unbuffered)) - { - currentBackend=Memory; - puts(qPrintable(logFile.fileName()+" unable to open it as write, log into file disabled")); - removeTheLockFile(); - } - else - { - currentBackend=File; - logFile.write(debugHtmlContent.toUtf8()); - } - } - } - if(currentBackend==File) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Notice,"currentBackend: File"); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Notice,"currentBackend: Memory"); + fileNameCleaner=QRegularExpression(QStringLiteral("\\.\\.?[/\\\\]([^/]+[/\\\\])?")); + quit=false; + QStringList ultracopierArguments=QCoreApplication::arguments(); + if(ultracopierArguments.size()==2) + if(ultracopierArguments.last()=="quit") + quit=true; + addDebugInformationCallNumber=0; + //Load the first content + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + debugHtmlContent+="Supercopier"; + #else + debugHtmlContent+="Ultracopier"; + #endif + debugHtmlContent+=" "+QString(ULTRACOPIER_VERSION)+" "+QString(ULTRACOPIER_PLATFORM_NAME)+", debug report"; + debugHtmlContent+=""; + debugHtmlContent+=""; + debugHtmlContent+=""; + //Load the start time at now + startTime.start(); + //Load the log file end + endOfLogFile="
"; + //check if other instance is running, then switch to memory backend + if(tryConnect()) + { + ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Notice,"currentBackend: File because other session is runing"); + currentBackend=Memory; + return; + } + //The lock and log file path is not defined + bool fileNameIsLoaded=false; + #ifdef ULTRACOPIER_VERSION_PORTABLE + #ifdef ULTRACOPIER_VERSION_PORTABLEAPPS + //Load the data folder path + QDir dir(QCoreApplication::applicationDirPath()); + dir.cdUp(); + dir.cdUp(); + dir.cd("Data"); + logFile.setFileName(dir.absolutePath()+QDir::separator()+"log.html"); + lockFile.setFileName(dir.absolutePath()+QDir::separator()+"ultracopier.lock"); + fileNameIsLoaded=true; + #else + //Load the ultracopier path + QDir dir(QCoreApplication::applicationDirPath()); + logFile.setFileName(dir.absolutePath()+QDir::separator()+"log.html"); + lockFile.setFileName(dir.absolutePath()+QDir::separator()+"ultracopier.lock"); + fileNameIsLoaded=true; + #endif + #else + #ifdef Q_OS_WIN32 + #define EXTRA_HOME_PATH "\\ultracopier\\" + #else + #define EXTRA_HOME_PATH "/.config/Ultracopier/" + #endif + //Load the user path only if exists and writable + QDir dir(QDir::homePath()+EXTRA_HOME_PATH); + bool errorFound=false; + //If user's directory not exists create it + if(!dir.exists()) + { + //If failed not load the file + if(!dir.mkpath(dir.absolutePath())) + { + errorFound=true; + puts(qPrintable("Unable to make path: "+dir.absolutePath()+", disable file log")); + } + } + //If no error found set the file name + if(errorFound==false) + { + fileNameIsLoaded=true; + logFile.setFileName(dir.absolutePath()+QDir::separator()+"log.html"); + lockFile.setFileName(dir.absolutePath()+QDir::separator()+"ultracopier.lock"); + } + //errorFound=false; + #endif + //If the file name is loaded + if(fileNameIsLoaded) + { + //If the previous file is here, then crash previous, ask if the user want to save + if(lockFile.exists() && logFile.exists() && !quit) + { + //Try open the file as read only to propose save it as the user + //Don't ask it if unable to write, because unable to remove, then alert at all start + if(removeTheLockFile()) + { + //Ask to the user + QMessageBox::StandardButton reply = QMessageBox::question(NULL,"Save the previous report", + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + QString("Supercopier")+ + #else + QString("Ultracopier")+ + #endif + " seam have crashed, do you want save the previous report for report it to the forum?",QMessageBox::Yes|QMessageBox::No,QMessageBox::No); + if(reply==QMessageBox::Yes) + saveBugReport(); + } + else + puts(qPrintable(logFile.fileName()+" unable to open it as read")); + } + //Now try to create and open the log file and lock file + if(!lockFile.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Unbuffered)) + { + currentBackend=Memory; + puts(qPrintable(lockFile.fileName()+" unable to open it as write, log into file disabled")); + } + else + { + if(!logFile.open(QIODevice::ReadWrite|QIODevice::Truncate|QIODevice::Unbuffered)) + { + currentBackend=Memory; + puts(qPrintable(logFile.fileName()+" unable to open it as write, log into file disabled")); + removeTheLockFile(); + } + else + { + logFile.resize(0); + currentBackend=File; + logFile.write(debugHtmlContent.toUtf8()); + } + } + } } /// \brief Destroy the ultracopier event dispatcher DebugEngine::~DebugEngine() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Notice,"start"); - if(currentBackend==File) - { - removeTheLockFile(); - //Finalize the log file - logFile.write(endOfLogFile.toUtf8()); - logFile.close(); - } + if(currentBackend==File) + { + removeTheLockFile(); + //Finalize the log file + logFile.write(endOfLogFile.toUtf8()); + logFile.close(); + } } -/// \brief ask to the user where save the bug report +/// \brief ask to the user where save the bug report void DebugEngine::saveBugReport() { - bool errorFound; - do - { - errorFound=false; - //Ask where it which save it - QString fileName = QFileDialog::getSaveFileName(NULL,"Save file","ultracopier-bug-report.log.html","Log file (*.log.html)"); - if(fileName!="") - { - if(QFile::exists(fileName)) - { - if(!QFile::remove(fileName)) - { - errorFound=true; - puts(qPrintable(fileName+" unable remove it")); - QMessageBox::critical(NULL,"Error","Unable to save the bug report"); - } - } - if(!errorFound) - { - //Open the destination as write - if(!logFile.copy(fileName)) - { - errorFound=true; - puts(qPrintable(fileName+" unable to open it as write: "+logFile.errorString())); - QMessageBox::critical(NULL,"Error","Unable to save the bug report"+logFile.errorString()); - } - } - } - } while(errorFound!=false); + bool errorFound; + do + { + errorFound=false; + //Ask where it which save it + QString fileName = QFileDialog::getSaveFileName(NULL,"Save file","ultracopier-bug-report.log.html","Log file (*.log.html)"); + if(fileName!="") + { + if(QFile::exists(fileName)) + { + if(!QFile::remove(fileName)) + { + errorFound=true; + puts(qPrintable(fileName+" unable remove it")); + QMessageBox::critical(NULL,"Error","Unable to save the bug report"); + } + } + if(!errorFound) + { + //Open the destination as write + if(!logFile.copy(fileName)) + { + errorFound=true; + puts(qPrintable(fileName+" unable to open it as write: "+logFile.errorString())); + QMessageBox::critical(NULL,"Error","Unable to save the bug report"+logFile.errorString()); + } + } + } + } while(errorFound!=false); } /// \brief Internal function to remove the lock file bool DebugEngine::removeTheLockFile() { - //close the file and remove it - lockFile.close(); - if(!lockFile.remove()) - { - puts(qPrintable(lockFile.fileName()+" unable to remove it, crash report at the next start")); - return false; - } - else - return true; + //close the file and remove it + lockFile.close(); + if(!lockFile.remove()) + { + puts(qPrintable(lockFile.fileName()+" unable to remove it, crash report at the next start")); + return false; + } + else + return true; } -void DebugEngine::addDebugInformationStatic(const DebugLevel &level,const QString& function,const QString& text,const QString& file,const int& ligne,const QString& location) +void DebugEngine::addDebugInformationStatic(const Ultracopier::DebugLevel &level,const QString& function,const QString& text,const QString& file,const int& ligne,const QString& location) { - DebugEngine *debug_engine_instance=DebugEngine::getInstance(); - DebugLevel_custom tempLevel=DebugLevel_custom_Information; - switch(level) - { - case DebugLevel_Information: - tempLevel=DebugLevel_custom_Information; - break; - case DebugLevel_Critical: - tempLevel=DebugLevel_custom_Critical; - break; - case DebugLevel_Warning: - tempLevel=DebugLevel_custom_Warning; - break; - case DebugLevel_Notice: - tempLevel=DebugLevel_custom_Notice; - break; - default: - tempLevel=DebugLevel_custom_Notice; - } - debug_engine_instance->addDebugInformation(tempLevel,function,text,file,ligne,location); - DebugEngine::destroyInstanceAtTheLastCall(); + if(DebugEngine::debugEngine==NULL) + { + qWarning() << QStringLiteral("After close: ") << function << file << ligne; + return; + } + DebugLevel_custom tempLevel=DebugLevel_custom_Information; + switch(level) + { + case Ultracopier::DebugLevel_Information: + tempLevel=DebugLevel_custom_Information; + break; + case Ultracopier::DebugLevel_Critical: + tempLevel=DebugLevel_custom_Critical; + break; + case Ultracopier::DebugLevel_Warning: + tempLevel=DebugLevel_custom_Warning; + break; + case Ultracopier::DebugLevel_Notice: + tempLevel=DebugLevel_custom_Notice; + break; + default: + tempLevel=DebugLevel_custom_Notice; + } + DebugEngine::debugEngine->addDebugInformation(tempLevel,function,text,file,ligne,location); } void DebugEngine::addDebugNote(const QString& text) { - DebugEngine *debug_engine_instance=DebugEngine::getInstance(); - debug_engine_instance->addDebugInformation(DebugLevel_custom_UserNote,"",text,"",-1,"Core"); - DebugEngine::destroyInstanceAtTheLastCall(); + if(DebugEngine::debugEngine==NULL) + return; + DebugEngine::debugEngine->addDebugInformation(DebugLevel_custom_UserNote,QStringLiteral(""),text,QStringLiteral(""),-1,QStringLiteral("Core")); } /// \brief For add message info, this function is thread safe void DebugEngine::addDebugInformation(const DebugLevel_custom &level,const QString& function,const QString& text,QString file,const int& ligne,const QString& location) { - //Remove the compiler extra patch generated - file=file.remove(QRegExp("\\.\\.?[/\\\\]([^/]+[/\\\\])?")); - QString addDebugInformation_lignestring=QString::number(ligne); - QString addDebugInformation_fileString=file; - if(ligne!=-1) - addDebugInformation_fileString+=":"+addDebugInformation_lignestring; - //Load the time from start - QString addDebugInformation_time = QString::number(startTime.elapsed()); - QString addDebugInformation_htmlFormat; - switch(level) - { - case DebugLevel_custom_Information: - addDebugInformation_htmlFormat=""+addDebugInformation_time+""+addDebugInformation_fileString+""+function+"()"+location+""+htmlEntities(text)+"\n"; - break; - case DebugLevel_custom_Critical: - addDebugInformation_htmlFormat=""+addDebugInformation_time+""+addDebugInformation_fileString+""+function+"()"+location+""+htmlEntities(text)+"\n"; - break; - case DebugLevel_custom_Warning: - addDebugInformation_htmlFormat=""+addDebugInformation_time+""+addDebugInformation_fileString+""+function+"()"+location+""+htmlEntities(text)+"\n"; - break; - case DebugLevel_custom_Notice: - addDebugInformation_htmlFormat=""+addDebugInformation_time+""+addDebugInformation_fileString+""+function+"()"+location+""+htmlEntities(text)+"\n"; - break; - case DebugLevel_custom_UserNote: - addDebugInformation_htmlFormat=""+addDebugInformation_time+""+addDebugInformation_fileString+""+function+"()"+location+""+htmlEntities(text)+"\n"; - break; - } - //To prevent access of string in multi-thread - { - //Show the text in console - QString addDebugInformation_textFormat; - addDebugInformation_textFormat = "("+addDebugInformation_time.rightJustified(8,' ')+") "; - if(file!="" && ligne!=-1) - addDebugInformation_textFormat += file+":"+addDebugInformation_lignestring+":"; - addDebugInformation_textFormat += function+"(), (location: "+location+"): "+text; - puts(qPrintable(addDebugInformation_textFormat)); - QMutexLocker lock_mutex(&mutex); - if(currentBackend==File) - { - if(logFile.size()>64*1024*1024) // greater than 64MB - puts("File log greater than 64MB, stop to record it!"); - else - logFile.write(addDebugInformation_htmlFormat.toUtf8()); - } - else - { - if(debugHtmlContent.size()<64*1024*1024) - debugHtmlContent+=addDebugInformation_htmlFormat; - else - puts("String greater than 64MB, stop to record it!"); - } - ItemOfDebug newItem; - newItem.time=addDebugInformation_time; - newItem.level=level; - newItem.function=function; - if(addDebugInformation_lignestring!="-1") - newItem.file=file+":"+addDebugInformation_lignestring; - else - newItem.file=file; - newItem.location=location; - newItem.text=text; - listItemOfDebug << newItem; - } - //Send the new line - if(addDebugInformationCallNumber DebugEngine::getItemList() -{ - QList returnedList; - { - QMutexLocker lock_mutex(&mutexList); - returnedList=listItemOfDebug; - listItemOfDebug.clear(); - } - return returnedList; + if(DebugEngine::debugEngine==NULL) + { + qWarning() << QStringLiteral("After close: ") << function << file << ligne; + return; + } + //Remove the compiler extra patch generated + file=file.remove(fileNameCleaner); + QString addDebugInformation_lignestring=QString::number(ligne); + QString addDebugInformation_fileString=file; + if(ligne!=-1) + addDebugInformation_fileString+=QStringLiteral(":")+addDebugInformation_lignestring; + //Load the time from start + QString addDebugInformation_time = QString::number(startTime.elapsed()); + QString addDebugInformation_htmlFormat; + bool important=true; + switch(level) + { + case DebugLevel_custom_Information: + addDebugInformation_htmlFormat=QStringLiteral("")+addDebugInformation_time+QStringLiteral("")+addDebugInformation_fileString+QStringLiteral("")+function+QStringLiteral("()")+location+QStringLiteral("")+htmlEntities(text)+QStringLiteral("\n"); + break; + case DebugLevel_custom_Critical: + addDebugInformation_htmlFormat=QStringLiteral("")+addDebugInformation_time+QStringLiteral("")+addDebugInformation_fileString+QStringLiteral("")+function+QStringLiteral("()")+location+QStringLiteral("")+htmlEntities(text)+QStringLiteral("\n"); + break; + case DebugLevel_custom_Warning: + addDebugInformation_htmlFormat=QStringLiteral("")+addDebugInformation_time+QStringLiteral("")+addDebugInformation_fileString+QStringLiteral("")+function+QStringLiteral("()")+location+QStringLiteral("")+htmlEntities(text)+QStringLiteral("\n"); + break; + case DebugLevel_custom_Notice: + { + addDebugInformation_htmlFormat=QStringLiteral("")+addDebugInformation_time+QStringLiteral("")+addDebugInformation_fileString+QStringLiteral("")+function+QStringLiteral("()")+location+QStringLiteral("")+htmlEntities(text)+QStringLiteral("\n"); + important=false; + } + break; + case DebugLevel_custom_UserNote: + addDebugInformation_htmlFormat=QStringLiteral("")+addDebugInformation_time+QStringLiteral("")+addDebugInformation_fileString+QStringLiteral("")+function+QStringLiteral("()")+location+QStringLiteral("")+htmlEntities(text)+QStringLiteral("\n"); + break; + } + //To prevent access of string in multi-thread + { + //Show the text in console + QString addDebugInformation_textFormat; + addDebugInformation_textFormat = QStringLiteral("(")+addDebugInformation_time.rightJustified(8,' ')+QStringLiteral(") "); + if(file!="" && ligne!=-1) + addDebugInformation_textFormat += file+QStringLiteral(":")+addDebugInformation_lignestring+QStringLiteral(":"); + addDebugInformation_textFormat += function+QStringLiteral("(), (location: ")+location+QStringLiteral("): ")+text; + QMutexLocker lock_mutex(&mutex); + if(currentBackend==File) + { + if(logFile.size()addDebugInformation(startTime.elapsed(),level,function,text,file,ligne,location); + } + } } /// \brief Get the html text info for re-show it QString DebugEngine::getTheDebugHtml() { - if(currentBackend==File) - { - logFile.seek(0); - if(!logFile.isOpen()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Warning,"The log file is not open"); - return QString().fromUtf8(logFile.readAll().data())+endOfLogFile; - } - else - return debugHtmlContent+endOfLogFile; + if(currentBackend==File) + { + logFile.seek(0); + if(!logFile.isOpen()) + ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Warning,"The log file is not open"); + return QString().fromUtf8(logFile.readAll().data())+endOfLogFile; + } + else + return debugHtmlContent+endOfLogFile; } /// \brief Get the html end QString DebugEngine::getTheDebugEnd() { - return endOfLogFile; + return endOfLogFile; } /// \brief Drop the html entities -QString DebugEngine::htmlEntities(QString text) +QString DebugEngine::htmlEntities(const QString &text) { - text.replace('&',"&"); - text.replace('"',"""); - text.replace('\'',"'"); - text.replace('<',"<"); - text.replace('>',">"); - return text; + QString newText(text); + newText.replace('&',"&"); + newText.replace('"',"""); + newText.replace('\'',"'"); + newText.replace('<',"<"); + newText.replace('>',">"); + return newText; } /// \brief return the current backend DebugEngine::Backend DebugEngine::getCurrentBackend() { - return currentBackend; + return currentBackend; } bool DebugEngine::tryConnect() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Notice,"start"); - QLocalSocket localSocket; - localSocket.connectToServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME),QIODevice::WriteOnly|QIODevice::Unbuffered); - if(localSocket.waitForConnected(1000)) - { - localSocket.disconnectFromServer(); - return true; - } - else - return false; + QLocalSocket localSocket; + localSocket.connectToServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME),QIODevice::WriteOnly|QIODevice::Unbuffered); + if(localSocket.waitForConnected(1000)) + { + localSocket.disconnectFromServer(); + return true; + } + else + return false; } #endif diff --git a/DebugEngine.h b/DebugEngine.h index fb1eda9..e39470e 100644 --- a/DebugEngine.h +++ b/DebugEngine.h @@ -1,8 +1,6 @@ /** \file DebugEngine.h \brief Define the class for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 \note This class don't need be thread safe because ultracopier is done with one thread, but I have implement some basic thread protection \licence GPL3, see the file COPYING */ @@ -14,99 +12,116 @@ #include #include #include +#include #include #include +#include +#include #include "Variable.h" #include "PlatformMacro.h" #include "StructEnumDefinition.h" #include "StructEnumDefinition_UltracopierSpecific.h" -#include "Singleton.h" #ifdef ULTRACOPIER_DEBUG +class DebugModel : public QAbstractTableModel +{ + Q_OBJECT +public: + /// \brief the transfer item displayed + struct DebugItem + { + int time; + DebugLevel_custom level; + QString function; + QString text; + QString file; + QString location; + }; + + static DebugModel *debugModel; + DebugModel(); + ~DebugModel(); + + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex&, const QVariant&, int = Qt::EditRole); + + void addDebugInformation(const int &time, const DebugLevel_custom &level, const QString& function, const QString& text, const QString &file="", const int& ligne=-1, const QString& location="Core"); + void setupTheTimer(); + QTimer *updateDisplayTimer; + bool displayed; + bool inWaitOfDisplay; +private: + QList list; +private slots: + void updateDisplay(); +}; + /** \brief Define the class for the debug This class provide all needed for the debug mode of ultracopier */ -class DebugEngine : public QObject, public Singleton +class DebugEngine : public QObject { - Q_OBJECT - friend class Singleton; - public: - /** \brief Get the html text info for re-show it - \note This function is thread safe */ - QString getTheDebugHtml(); - /// \brief Enumeration of backend - enum Backend - { - Memory, //Do intensive usage of memory, used only if the file backend is not available - File //Store all directly into file, at crash the backtrace is into the file - }; - /// \brief return the current backend - Backend getCurrentBackend(); - /// \brief Get the html end - QString getTheDebugEnd(); - /** \brief For add message info, this function - \note This function is reentrant */ - static void addDebugInformationStatic(const DebugLevel &level,const QString& function,const QString& text,const QString& file="",const int& ligne=-1,const QString& location="Core"); - static void addDebugNote(const QString& text); - /** \brief structure for one debug item */ - struct ItemOfDebug - { - DebugLevel_custom level; - QString time; - QString file; - QString function; - QString location; - QString text; - }; - QList listItemOfDebug; - QList getItemList(); - public slots: - /** \brief ask to the user where save the bug report - \warning This function can be only call by the graphical thread */ - void saveBugReport(); - - void addDebugInformation(const DebugLevel_custom &level,const QString& fonction,const QString& text,QString file="",const int& ligne=-1,const QString& location="Core"); - private: - /// \brief Initiate the ultracopier event dispatcher and check if no other session is running - DebugEngine(); - /** \brief Destroy the ultracopier event dispatcher - \note This function is thread safe */ - ~DebugEngine(); - /// \brief Path for log file - QFile logFile; - /// \brief Path for lock file - QFile lockFile; - /// \brief Internal function to remove the lock file - bool removeTheLockFile(); - /** \brief Do thread safe part for the addDebugInformation() - \see addDebugInformation() */ - QMutex mutex; - QMutex mutexList; - /// \brief For record the start time - QTime startTime; - /// \brief String for the end of log file - QString endOfLogFile; - /// \brief Drop the html entities - QString htmlEntities(QString text); - /// \brief To store the debug informations - QString debugHtmlContent; - /// \brief The current backend - Backend currentBackend; - /// try connect to send to the current running instance the arguements - bool tryConnect(); - //temp variable - /* can't because multiple thread can access at this variable - QString addDebugInformation_lignestring; - QString addDebugInformation_fileString; - QString addDebugInformation_time; - QString addDebugInformation_htmlFormat; - QString addDebugInformation_textFormat;*/ - quint32 addDebugInformationCallNumber; - signals: - /// \brief Send that's when new debug info is added - void newDebugInformation(); + Q_OBJECT + public: + /// \brief Initiate the ultracopier event dispatcher and check if no other session is running + DebugEngine(); + /** \brief Destroy the ultracopier event dispatcher + \note This function is thread safe */ + ~DebugEngine(); + /** \brief Get the html text info for re-show it + \note This function is thread safe */ + QString getTheDebugHtml(); + /// \brief Enumeration of backend + enum Backend + { + Memory, //Do intensive usage of memory, used only if the file backend is not available + File //Store all directly into file, at crash the backtrace is into the file + }; + /// \brief return the current backend + Backend getCurrentBackend(); + /// \brief Get the html end + QString getTheDebugEnd(); + /** \brief For add message info, this function + \note This function is reentrant */ + static void addDebugInformationStatic(const Ultracopier::DebugLevel &level,const QString& function,const QString& text,const QString& file="",const int& ligne=-1,const QString& location="Core"); + static void addDebugNote(const QString& text); + static DebugEngine *debugEngine; + public slots: + /** \brief ask to the user where save the bug report + \warning This function can be only call by the graphical thread */ + void saveBugReport(); + void addDebugInformation(const DebugLevel_custom &level,const QString& fonction,const QString& text,QString file="",const int& ligne=-1,const QString& location="Core"); + private: + /// \brief Path for log file + QFile logFile; + /// \brief Path for lock file + QFile lockFile; + /// \brief Internal function to remove the lock file + bool removeTheLockFile(); + /** \brief Do thread safe part for the addDebugInformation() + \see addDebugInformation() */ + QMutex mutex; + QMutex mutexList; + /// \brief For record the start time + QTime startTime; + /// \brief String for the end of log file + QString endOfLogFile; + /// \brief Drop the html entities + QString htmlEntities(const QString &text); + /// \brief To store the debug informations + QString debugHtmlContent; + /// \brief The current backend + Backend currentBackend; + /// try connect to send to the current running instance the arguements + bool tryConnect(); + int addDebugInformationCallNumber; + bool quit; + QRegularExpression fileNameCleaner; }; #endif // ULTRACOPIER_DEBUG diff --git a/DebugEngineMacro.h b/DebugEngineMacro.h index 9a96957..c3822cd 100644 --- a/DebugEngineMacro.h +++ b/DebugEngineMacro.h @@ -1,23 +1,25 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_DEBUG - #include "DebugEngine.h" - #if defined (__FILE__) && defined (__LINE__) - #define ULTRACOPIER_DEBUGCONSOLE(a,b) DebugEngine::addDebugInformationStatic(a,__func__,b,__FILE__,__LINE__) - #else - #define ULTRACOPIER_DEBUGCONSOLE(a,b) DebugEngine::addDebugInformationStatic(a,__func__,b) - #endif +# include "DebugEngine.h" +# if defined (__FILE__) && defined (__LINE__) +# define ULTRACOPIER_DEBUGCONSOLE(a,b) DebugEngine::addDebugInformationStatic(a,__func__,b,__FILE__,__LINE__) +# else +# define ULTRACOPIER_DEBUGCONSOLE(a,b) DebugEngine::addDebugInformationStatic(a,__func__,b) +# endif #else // ULTRACOPIER_DEBUG - #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() +# define ULTRACOPIER_DEBUGCONSOLE(a,b) void() #endif // ULTRACOPIER_DEBUG #endif // DEBUGENGINEMACRO_H diff --git a/DebugModel.cpp b/DebugModel.cpp new file mode 100644 index 0000000..2a7b173 --- /dev/null +++ b/DebugModel.cpp @@ -0,0 +1,158 @@ +#include "DebugEngine.h" + +#include + +#ifdef ULTRACOPIER_DEBUG + +#define COLUMN_COUNT 5 + +// Model + +DebugModel::DebugModel() +{ + displayed = false; + inWaitOfDisplay = false; + updateDisplayTimer = NULL; +} + +DebugModel::~DebugModel() +{ + if(updateDisplayTimer!=NULL) + delete updateDisplayTimer; +} + +int DebugModel::columnCount( const QModelIndex& parent ) const +{ + return parent == QModelIndex() ? COLUMN_COUNT : 0; +} + +QVariant DebugModel::data( const QModelIndex& index, int role ) const +{ + int row,column; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= list.count() || column < 0 || column >= COLUMN_COUNT) + return QVariant(); + + const DebugItem& item = list.at(row); + if(role==Qt::UserRole) + return row; + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + return item.time; + break; + case 1: + return item.file; + break; + case 2: + return item.function; + break; + case 3: + return item.location; + break; + case 4: + return item.text; + break; + default: + return QVariant(); + } + } + else if(role==Qt::DecorationRole) + return QVariant(); + else if(role==Qt::ForegroundRole) + { + switch(item.level) + { + case DebugLevel_custom_Information: + return QColor(94,165,255); + break; + case DebugLevel_custom_Critical: + return QColor(255,0,0); + break; + case DebugLevel_custom_Warning: + return QColor(255,178,0); + break; + case DebugLevel_custom_Notice: + return QColor(128,128,128); + break; + case DebugLevel_custom_UserNote: + return QColor(0,0,0); + break; + } + return QVariant(); + } + return QVariant(); +} + +int DebugModel::rowCount( const QModelIndex& parent ) const +{ + return parent == QModelIndex() ? list.count() : 0; +} + +QVariant DebugModel::headerData( int section, Qt::Orientation orientation, int role ) const +{ + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return QStringLiteral("Time"); + case 1: + return QStringLiteral("File"); + case 2: + return QStringLiteral("Function"); + case 3: + return QStringLiteral("Location"); + case 4: + return QStringLiteral("Text"); + } + } + + return QAbstractTableModel::headerData( section, orientation, role ); +} + +bool DebugModel::setData( const QModelIndex&, const QVariant&, int) +{ + return false; +} + +void DebugModel::addDebugInformation(const int &time,const DebugLevel_custom &level,const QString& function,const QString& text,const QString &file,const int& ligne,const QString& location) +{ + DebugItem item; + item.time=time; + item.level=level; + item.function=function; + item.text=text; + item.file=QStringLiteral("%1:%2").arg(file).arg(ligne); + item.location=location; + list << item; + if(!displayed) + { + displayed=true; + emit layoutChanged(); + } + else + inWaitOfDisplay=true; +} + +void DebugModel::setupTheTimer() +{ + if(updateDisplayTimer!=NULL) + return; + updateDisplayTimer=new QTimer(); + connect(updateDisplayTimer,&QTimer::timeout,this,&DebugModel::updateDisplay); + updateDisplayTimer->start(100); +} + +void DebugModel::updateDisplay() +{ + displayed=false; + if(!inWaitOfDisplay) + { + inWaitOfDisplay=false; + displayed=true; + emit layoutChanged(); + } +} +#endif diff --git a/Environment.h b/Environment.h index dcbea70..d653c5f 100644 --- a/Environment.h +++ b/Environment.h @@ -1,8 +1,6 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "Variable.h" @@ -13,7 +11,11 @@ #include "DebugEngineMacro.h" #ifdef ULTRACOPIER_VERSION_PORTABLE - #define ULTRACOPIER_VERSION_PORTABLE_BOOL true + #define ULTRACOPIER_VERSION_PORTABLE_BOOL true #else - #define ULTRACOPIER_VERSION_PORTABLE_BOOL false + #define ULTRACOPIER_VERSION_PORTABLE_BOOL false +#endif + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#undef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT #endif diff --git a/EventDispatcher.cpp b/EventDispatcher.cpp index a19cfd4..744bc6a 100644 --- a/EventDispatcher.cpp +++ b/EventDispatcher.cpp @@ -1,167 +1,578 @@ /** \file EventDispatcher.cpp \brief Define the class of the event dispatcher \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ -#include #include #include +#include +#include #include "EventDispatcher.h" #include "ExtraSocket.h" #include "CompilerInfo.h" +#include "ThemesManager.h" #ifdef Q_OS_UNIX - #include - #include -#else - #include + #include + #include +#endif +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include + #include + #include + #include + typedef void (WINAPI *PGNSI) (LPSYSTEM_INFO); + typedef BOOL (WINAPI *PGPI) (DWORD, DWORD, DWORD, DWORD, PDWORD); +#endif +#ifdef Q_OS_MAC +#include +#include +#include +#include +#endif + +#ifdef ULTRACOPIER_VERSION_ULTIMATE +#include #endif /// \brief Initiate the ultracopier event dispatcher and check if no other session is running EventDispatcher::EventDispatcher() { - copyServer=new CopyListener(&optionDialog); - connect(&localListener,SIGNAL(cli(QStringList,bool,bool)),&cliParser,SLOT(cli(QStringList,bool,bool)),Qt::QueuedConnection); - connect(themes, SIGNAL(newThemeOptions(QString,QWidget*,bool,bool)), &optionDialog, SLOT(newThemeOptions(QString,QWidget*,bool,bool))); - connect(&cliParser, SIGNAL(newCopy(QStringList)), copyServer, SLOT(newCopy(QStringList))); - connect(&cliParser, SIGNAL(newCopy(QStringList,QString)), copyServer, SLOT(newCopy(QStringList,QString))); - connect(&cliParser, SIGNAL(newMove(QStringList)), copyServer, SLOT(newMove(QStringList))); - connect(&cliParser, SIGNAL(newMove(QStringList,QString)), copyServer, SLOT(newMove(QStringList,QString))); - copyMoveEventIdIndex=0; - backgroundIcon=NULL; - stopIt=false; - sessionloader=new SessionLoader(&optionDialog); - copyEngineList=new CopyEngineManager(&optionDialog); - core=new Core(copyEngineList); - qRegisterMetaType("CatchState"); - qRegisterMetaType("ListeningState"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //show the ultracopier information - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("ULTRACOPIER_VERSION: ")+ULTRACOPIER_VERSION); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("Qt version: %1 (%2)").arg(qVersion()).arg(QT_VERSION)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("ULTRACOPIER_PLATFORM_NAME: ")+ULTRACOPIER_PLATFORM_NAME); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("Application path: %1 (%2)").arg(QCoreApplication::applicationFilePath()).arg(QCoreApplication::applicationPid())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,COMPILERINFO); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("Local socket: ")+ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME)); - //To lunch some initialization after QApplication::exec() to quit eventually - lunchInitFunction.setInterval(0); - lunchInitFunction.setSingleShot(true); - connect(&lunchInitFunction,SIGNAL(timeout()),this,SLOT(initFunction()),Qt::QueuedConnection); - lunchInitFunction.start(); - //add the options to use - QList > KeysList; - //add the options hidden, will not show in options pannel - KeysList.clear(); - KeysList.append(qMakePair(QString("Last_version_used"),QVariant("na"))); - KeysList.append(qMakePair(QString("ActionOnManualOpen"),QVariant(1))); - KeysList.append(qMakePair(QString("GroupWindowWhen"),QVariant(0))); - options->addOptionGroup("Ultracopier",KeysList); - if(options->getOptionValue("Ultracopier","Last_version_used")!=QVariant("na") && options->getOptionValue("Ultracopier","Last_version_used")!=QVariant(ULTRACOPIER_VERSION)) - { - //then ultracopier have been updated - } - options->setOptionValue("Ultracopier","Last_version_used",QVariant(ULTRACOPIER_VERSION)); - int a=options->getOptionValue("Ultracopier","ActionOnManualOpen").toInt(); - if(a<0 || a>2) - options->setOptionValue("Ultracopier","ActionOnManualOpen",QVariant(1)); - a=options->getOptionValue("Ultracopier","GroupWindowWhen").toInt(); - if(a<0 || a>5) - options->setOptionValue("Ultracopier","GroupWindowWhen",QVariant(0)); - - KeysList.clear(); - KeysList.append(qMakePair(QString("List"),QVariant(QStringList() << "Ultracopier-0.3"))); - options->addOptionGroup("CopyEngine",KeysList); - - connect(&cliParser, SIGNAL(newTransferList(QString,QString,QString)),core, SLOT(newTransferList(QString,QString,QString))); + qRegisterMetaType >("QList"); + qRegisterMetaType >("QList"); + qRegisterMetaType("Ultracopier::EngineActionInProgress"); + qRegisterMetaType >("QList"); + qRegisterMetaType("Ultracopier::ItemOfCopyList"); + #ifdef ULTRACOPIER_CGMINER + qRegisterMetaType("QProcess::ExitStatus"); + qRegisterMetaType("QProcess::ProcessError"); + #endif + + copyServer=new CopyListener(&optionDialog); + connect(&localListener, &LocalListener::cli, &cliParser, &CliParser::cli,Qt::QueuedConnection); + connect(ThemesManager::themesManager, &ThemesManager::newThemeOptions, &optionDialog, &OptionDialog::newThemeOptions); + connect(&cliParser, &CliParser::newCopyWithoutDestination, copyServer, &CopyListener::copyWithoutDestination); + connect(&cliParser, &CliParser::newCopy, copyServer, &CopyListener::copy); + connect(&cliParser, &CliParser::newMoveWithoutDestination, copyServer, &CopyListener::moveWithoutDestination); + connect(&cliParser, &CliParser::newMove, copyServer, &CopyListener::move); + connect(copyServer, &CopyListener::newClientList, &optionDialog, &OptionDialog::newClientList); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + connect(&cliParser, &CliParser::tryLoadPlugin, PluginsManager::pluginsManager, &PluginsManager::tryLoadPlugin); + #endif + copyMoveEventIdIndex=0; + backgroundIcon=NULL; + stopIt=false; + + + #ifndef ULTRACOPIER_VERSION_PORTABLE + sessionloader=new SessionLoader(&optionDialog); + #endif + copyEngineList=new CopyEngineManager(&optionDialog); + core=new Core(copyEngineList); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //show the ultracopier information + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Windows version: %1").arg(GetOSDisplayString())); + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("ULTRACOPIER_VERSION: ")+ULTRACOPIER_VERSION); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Qt version: %1 (%2)").arg(qVersion()).arg(QT_VERSION)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("ULTRACOPIER_PLATFORM_NAME: ")+ULTRACOPIER_PLATFORM_NAME); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Application path: %1 (%2)").arg(QCoreApplication::applicationFilePath()).arg(QCoreApplication::applicationPid())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,COMPILERINFO); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Local socket: ")+ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME)); + #ifdef ULTRACOPIER_CGMINER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("With cgminer")); + #endif + #if defined(ULTRACOPIER_DEBUG) && defined(ULTRACOPIER_PLUGIN_ALL_IN_ONE) + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Version as all in one")); + QObjectList objectList=QPluginLoader::staticInstances(); + int index=0; + while(indexmetaObject()->className())); + index++; + } + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Version as all in one, direct")); + #endif + #endif + + { + const QList mountedVolumesList=QStorageInfo::mountedVolumes(); + int index=0; + while(indexgetOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("Last_version_used"))!=QVariant(QStringLiteral("na")) && OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("Last_version_used"))!=QVariant(ULTRACOPIER_VERSION)) + { + //then ultracopier have been updated + } + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("Last_version_used"),QVariant(ULTRACOPIER_VERSION)); + int a=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("ActionOnManualOpen")).toInt(); + if(a<0 || a>2) + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("ActionOnManualOpen"),QVariant(1)); + a=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("GroupWindowWhen")).toInt(); + if(a<0 || a>5) + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("GroupWindowWhen"),QVariant(0)); + + #ifdef ULTRACOPIER_VERSION_ULTIMATE + #ifdef ULTRACOPIER_ILLEGAL + static bool crackedVersion=true; + #else + static bool crackedVersion=false; + #endif + if(!crackedVersion) + { + while(1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("ultimate key")); + QString key=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("key")).toString(); + if(!key.isEmpty()) + { + QCryptographicHash hash(QCryptographicHash::Sha224); + hash.addData(QStringLiteral("U2NgvbKVrVwlaXnx").toUtf8()); + hash.addData(key.toUtf8()); + const QByteArray &result=hash.result(); + if(!result.isEmpty() && result.at(0)==0x00 && result.at(1)==0x00) + break; + } + key=QInputDialog::getText(NULL,tr("Key"),tr("Give the key of this software, more information on ultracopier.first-world.info")); + if(key.isEmpty()) + { + QCoreApplication::quit(); + stopIt=true; + return; + } + { + QCryptographicHash hash(QCryptographicHash::Sha224); + hash.addData(QStringLiteral("U2NgvbKVrVwlaXnx").toUtf8()); + hash.addData(key.toUtf8()); + const QByteArray &result=hash.result(); + if(!result.isEmpty() && result.at(0)==0x00 && result.at(1)==0x00) + { + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("key"),key); + break; + } + } + } + } + #endif + + connect(&cliParser, &CliParser::newTransferList,core, &Core::newTransferList); } /// \brief Destroy the ultracopier event dispatcher EventDispatcher::~EventDispatcher() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(core!=NULL) - delete core; - if(copyEngineList!=NULL) - delete copyEngineList; - if(sessionloader!=NULL) - delete sessionloader; - if(backgroundIcon!=NULL) - delete backgroundIcon; - delete copyServer; + if(core!=NULL) + { + delete core; + core=NULL; + } + if(copyEngineList!=NULL) + { + delete copyEngineList; + copyEngineList=NULL; + } + #ifndef ULTRACOPIER_VERSION_PORTABLE + if(sessionloader!=NULL) + { + delete sessionloader; + sessionloader=NULL; + } + #endif + if(backgroundIcon!=NULL) + { + delete backgroundIcon; + backgroundIcon=NULL; + } + if(copyServer!=NULL) + { + delete copyServer; + copyServer=NULL; + } } /// \brief return if need be close bool EventDispatcher::shouldBeClosed() { - return stopIt; + return stopIt; } /// \brief Quit ultracopier void EventDispatcher::quit() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Will quit ultracopier"); - //disconnect(QCoreApplication::instance(),SIGNAL(aboutToQuit()),this,SLOT(quit())); - QCoreApplication::exit(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Will quit ultracopier")); + //disconnect(QCoreApplication::instance(),SIGNAL(aboutToQuit()),this,SLOT(quit())); + QCoreApplication::exit(); } /// \brief Called when event loop is setup void EventDispatcher::initFunction() { - if(core==NULL || copyEngineList==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Unable to initialize correctly the software"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Initialize the variable of event loop"); - connect(copyServer, SIGNAL(newCopy(quint32,QStringList,QStringList)), core, SLOT(newCopy(quint32,QStringList,QStringList))); - connect(copyServer, SIGNAL(newCopy(quint32,QStringList,QStringList,QString,QString)), core, SLOT(newCopy(quint32,QStringList,QStringList,QString,QString))); - connect(copyServer, SIGNAL(newMove(quint32,QStringList,QStringList)), core, SLOT(newMove(quint32,QStringList,QStringList))); - connect(copyServer, SIGNAL(newMove(quint32,QStringList,QStringList,QString,QString)), core, SLOT(newMove(quint32,QStringList,QStringList,QString,QString))); - connect(core, SIGNAL(copyFinished(quint32,bool)), copyServer, SLOT(copyFinished(quint32,bool))); - connect(core, SIGNAL(copyCanceled(quint32)), copyServer, SLOT(copyCanceled(quint32))); - if(localListener.tryConnect()) - { - stopIt=true; - //why before removed??? - QCoreApplication::quit(); - return; - } - localListener.listenServer(); - //load the systray icon - if(backgroundIcon==NULL) - { - backgroundIcon=new SystrayIcon(); - //connect the slot - //quit is for this object -// connect(core, SIGNAL(newCanDoOnlyCopy(bool)), backgroundIcon, SLOT(newCanDoOnlyCopy(bool))); - connect(backgroundIcon, SIGNAL(quit()),this,SLOT(quit())); - //show option is for OptionEngine object - connect(backgroundIcon, SIGNAL(showOptions()), &optionDialog, SLOT(show())); - connect(copyServer, SIGNAL(listenerReady(ListeningState,bool,bool)), backgroundIcon, SLOT(listenerReady(ListeningState,bool,bool))); - connect(copyServer, SIGNAL(pluginLoaderReady(CatchState,bool,bool)), backgroundIcon, SLOT(pluginLoaderReady(CatchState,bool,bool))); - connect(backgroundIcon, SIGNAL(tryCatchCopy()), copyServer, SLOT(listen())); - connect(backgroundIcon, SIGNAL(tryUncatchCopy()), copyServer, SLOT(close())); - if(options->getOptionValue("CopyListener","CatchCopyAsDefault").toBool()) - copyServer->listen(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"copyServer.oneListenerIsLoaded(): "+QString::number(copyServer->oneListenerIsLoaded())); - //backgroundIcon->readyToListen(copyServer.oneListenerIsLoaded()); - - connect(backgroundIcon, SIGNAL(addWindowCopyMove(CopyMode,QString)), core, SLOT(addWindowCopyMove(CopyMode,QString))); - connect(backgroundIcon, SIGNAL(addWindowTransfer(QString)), core, SLOT(addWindowTransfer(QString))); - connect(copyEngineList, SIGNAL(addCopyEngine(QString,bool)), backgroundIcon, SLOT(addCopyEngine(QString,bool))); - connect(copyEngineList, SIGNAL(removeCopyEngine(QString)), backgroundIcon, SLOT(removeCopyEngine(QString))); - copyEngineList->setIsConnected(); - copyServer->resendState(); - } - //conntect the last chance signal before quit - connect(QCoreApplication::instance(),SIGNAL(aboutToQuit()),this,SLOT(quit())); - //connect the slot for the help dialog - connect(backgroundIcon,SIGNAL(showHelp()),&theHelp,SLOT(show())); + if(core==NULL || copyEngineList==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Unable to initialize correctly the software"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Initialize the variable of event loop"); + connect(copyServer, &CopyListener::newCopyWithoutDestination, core, &Core::newCopyWithoutDestination,Qt::DirectConnection); + connect(copyServer, &CopyListener::newCopy, core, &Core::newCopy,Qt::DirectConnection); + connect(copyServer, &CopyListener::newMoveWithoutDestination, core, &Core::newMoveWithoutDestination,Qt::DirectConnection); + connect(copyServer, &CopyListener::newMove, core, &Core::newMove,Qt::DirectConnection); + connect(core, &Core::copyFinished, copyServer, &CopyListener::copyFinished,Qt::DirectConnection); + connect(core, &Core::copyCanceled, copyServer, &CopyListener::copyCanceled,Qt::DirectConnection); + if(localListener.tryConnect()) + { + stopIt=true; + QCoreApplication::exit(1);//by 1, return process is in progress + return; + } + localListener.listenServer(); + //load the systray icon + if(backgroundIcon==NULL) + { + backgroundIcon=new SystrayIcon(); + //connect the slot + //quit is for this object +// connect(core, &Core::newCanDoOnlyCopy, backgroundIcon, &SystrayIcon::newCanDoOnlyCopy,Qt::DirectConnection); + connect(backgroundIcon, &SystrayIcon::quit,this,&EventDispatcher::quit); + //show option is for OptionEngine object + connect(backgroundIcon, &SystrayIcon::showOptions, &optionDialog, &OptionDialog::show,Qt::DirectConnection); + connect(&cliParser, &CliParser::showOptions, &optionDialog, &OptionDialog::show,Qt::DirectConnection); + connect(copyServer, &CopyListener::listenerReady, backgroundIcon, &SystrayIcon::listenerReady,Qt::DirectConnection); + connect(copyServer, &CopyListener::pluginLoaderReady, backgroundIcon, &SystrayIcon::pluginLoaderReady,Qt::DirectConnection); + connect(backgroundIcon, &SystrayIcon::tryCatchCopy, copyServer, &CopyListener::listen,Qt::DirectConnection); + connect(backgroundIcon, &SystrayIcon::tryUncatchCopy, copyServer, &CopyListener::close,Qt::DirectConnection); + if(OptionEngine::optionEngine->getOptionValue("CopyListener","CatchCopyAsDefault").toBool()) + copyServer->listen(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"copyServer.oneListenerIsLoaded(): "+QString::number(copyServer->oneListenerIsLoaded())); + //backgroundIcon->readyToListen(copyServer.oneListenerIsLoaded()); + + #ifdef ULTRACOPIER_DEBUG + connect(backgroundIcon, &SystrayIcon::saveBugReport, DebugEngine::debugEngine, &DebugEngine::saveBugReport,Qt::QueuedConnection); + #endif + connect(backgroundIcon, &SystrayIcon::addWindowCopyMove, core, &Core::addWindowCopyMove,Qt::DirectConnection); + connect(backgroundIcon, &SystrayIcon::addWindowTransfer, core, &Core::addWindowTransfer,Qt::DirectConnection); + connect(copyEngineList, &CopyEngineManager::addCopyEngine, backgroundIcon, &SystrayIcon::addCopyEngine,Qt::DirectConnection); + connect(copyEngineList, &CopyEngineManager::removeCopyEngine, backgroundIcon, &SystrayIcon::removeCopyEngine,Qt::DirectConnection); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + connect(&internetUpdater,&InternetUpdater::newUpdate, backgroundIcon, &SystrayIcon::newUpdate); + #endif + copyEngineList->setIsConnected(); + copyServer->resendState(); + } + //conntect the last chance signal before quit + connect(QCoreApplication::instance(),&QCoreApplication::aboutToQuit,this,&EventDispatcher::quit,Qt::DirectConnection); + //connect the slot for the help dialog + connect(backgroundIcon,&SystrayIcon::showHelp,&theHelp,&HelpDialog::show); + #ifdef ULTRACOPIER_DEBUG + DebugModel::debugModel->setupTheTimer(); + #endif } +#ifdef Q_OS_WIN32 +QString EventDispatcher::GetOSDisplayString() +{ + QString Os; + OSVERSIONINFOEX osvi; + SYSTEM_INFO si; + PGNSI pGNSI; + PGPI pGPI; + BOOL bOsVersionInfoEx; + DWORD dwType; + + ZeroMemory(&si, sizeof(SYSTEM_INFO)); + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*) &osvi); + + if(bOsVersionInfoEx == NULL) + return QStringLiteral("Os detection blocked"); + + // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. + + pGNSI = (PGNSI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), + "GetNativeSystemInfo"); + if(NULL != pGNSI) + pGNSI(&si); + else GetSystemInfo(&si); + + if(VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion>4) + { + if(osvi.dwMajorVersion==6) + { + switch(osvi.dwMinorVersion) + { + case 0: + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Windows Vista "); + else Os+=QStringLiteral("Windows Server 2008 "); + break; + case 1: + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Windows 7 "); + else Os+=QStringLiteral("Windows Server 2008 R2 "); + break; + case 2: + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Windows 8 "); + else Os+=QStringLiteral("Windows Server 2012 "); + break; + default: + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Windows (dwMajorVersion: %1, dwMinorVersion: %2)").arg(osvi.dwMinorVersion).arg(osvi.dwMinorVersion); + else Os+=QStringLiteral("Windows Server (dwMajorVersion: %1, dwMinorVersion: %2)").arg(osvi.dwMinorVersion).arg(osvi.dwMinorVersion); + break; + } + + pGPI = (PGPI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), + "GetProductInfo"); + + pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType); + + switch(dwType) + { + case PRODUCT_ULTIMATE: + Os+=QStringLiteral("Ultimate Edition"); + break; + case PRODUCT_PROFESSIONAL: + Os+=QStringLiteral("Professional"); + break; + case PRODUCT_HOME_PREMIUM: + Os+=QStringLiteral("Home Premium Edition"); + break; + case PRODUCT_HOME_BASIC: + Os+=QStringLiteral("Home Basic Edition"); + break; + case PRODUCT_ENTERPRISE: + Os+=QStringLiteral("Enterprise Edition"); + break; + case PRODUCT_BUSINESS: + Os+=QStringLiteral("Business Edition"); + break; + case PRODUCT_STARTER: + Os+=QStringLiteral("Starter Edition"); + break; + case PRODUCT_CLUSTER_SERVER: + Os+=QStringLiteral("Cluster Server Edition"); + break; + case PRODUCT_DATACENTER_SERVER: + Os+=QStringLiteral("Datacenter Edition"); + break; + case PRODUCT_DATACENTER_SERVER_CORE: + Os+=QStringLiteral("Datacenter Edition (core installation)"); + break; + case PRODUCT_ENTERPRISE_SERVER: + Os+=QStringLiteral("Enterprise Edition"); + break; + case PRODUCT_ENTERPRISE_SERVER_CORE: + Os+=QStringLiteral("Enterprise Edition (core installation)"); + break; + case PRODUCT_ENTERPRISE_SERVER_IA64: + Os+=QStringLiteral("Enterprise Edition for Itanium-based Systems"); + break; + case PRODUCT_SMALLBUSINESS_SERVER: + Os+=QStringLiteral("Small Business Server"); + break; + case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: + Os+=QStringLiteral("Small Business Server Premium Edition"); + break; + case PRODUCT_STANDARD_SERVER: + Os+=QStringLiteral("Standard Edition"); + break; + case PRODUCT_STANDARD_SERVER_CORE: + Os+=QStringLiteral("Standard Edition (core installation)"); + break; + case PRODUCT_WEB_SERVER: + Os+=QStringLiteral("Web Server Edition"); + break; + } + } + else if(osvi.dwMajorVersion==5) + { + switch(osvi.dwMinorVersion) + { + case 0: + Os+=QStringLiteral("Windows 2000 "); + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Professional"); + else + { + if(osvi.wSuiteMask & VER_SUITE_DATACENTER) + Os+=QStringLiteral("Datacenter Server"); + else if(osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + Os+=QStringLiteral("Advanced Server"); + else Os+=QStringLiteral("Server"); + } + break; + case 1: + Os+=QStringLiteral("Windows XP "); + if(osvi.wSuiteMask & VER_SUITE_PERSONAL) + Os+=QStringLiteral("Home Edition"); + else Os+=QStringLiteral("Professional"); + break; + case 2: + if(GetSystemMetrics(SM_SERVERR2)) + Os+=QStringLiteral("Windows Server 2003 R2, "); + else if(osvi.wSuiteMask & VER_SUITE_STORAGE_SERVER ) + Os+=QStringLiteral("Windows Storage Server 2003"); + else if(osvi.wSuiteMask & VER_SUITE_WH_SERVER ) + Os+=QStringLiteral("Windows Home Server"); + else if(osvi.wProductType==VER_NT_WORKSTATION && si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) + Os+=QStringLiteral("Windows XP Professional x64 Edition"); + else Os+=QStringLiteral("Windows Server 2003, "); + // Test for the server type. + if(osvi.wProductType!=VER_NT_WORKSTATION ) + { + if(si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64) + { + if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) + Os+=QStringLiteral("Datacenter Edition for Itanium-based Systems"); + else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) + Os+=QStringLiteral("Enterprise Edition for Itanium-based Systems"); + } + else if(si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) + { + if(osvi.wSuiteMask & VER_SUITE_DATACENTER) + Os+=QStringLiteral("Datacenter x64 Edition"); + else if(osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + Os+=QStringLiteral("Enterprise x64 Edition"); + else Os+=QStringLiteral("Standard x64 Edition"); + } + else + { + if(osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER) + Os+=QStringLiteral("Compute Cluster Edition"); + else if( osvi.wSuiteMask & VER_SUITE_DATACENTER) + Os+=QStringLiteral("Datacenter Edition"); + else if(osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + Os+=QStringLiteral("Enterprise Edition"); + else if(osvi.wSuiteMask & VER_SUITE_BLADE) + Os+=QStringLiteral("Web Edition"); + else Os+=QStringLiteral("Standard Edition"); + } + } + break; + } + } + else + { + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Windows (dwMajorVersion: %1, dwMinorVersion: %2)").arg(osvi.dwMinorVersion).arg(osvi.dwMinorVersion); + else Os+=QStringLiteral("Windows Server (dwMajorVersion: %1, dwMinorVersion: %2)").arg(osvi.dwMinorVersion).arg(osvi.dwMinorVersion); + } + + // Include service pack (if any) and build number. + QString QszCSDVersion=QString::fromUtf16((ushort*)osvi.szCSDVersion); + if(!QszCSDVersion.isEmpty()) + Os+=QStringLiteral(" %1").arg(QszCSDVersion); + Os+=QStringLiteral(" (build %1)").arg(osvi.dwBuildNumber); + if(osvi.dwMajorVersion >= 6) + { + if(si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) + Os+=QStringLiteral(", 64-bit"); + else if(si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL) + Os+=QStringLiteral(", 32-bit"); + } + } + else + { + if(osvi.wProductType==VER_NT_WORKSTATION) + Os+=QStringLiteral("Windows (dwMajorVersion: %1, dwMinorVersion: %2)").arg(osvi.dwMinorVersion).arg(osvi.dwMinorVersion); + else Os+=QStringLiteral("Windows Server (dwMajorVersion: %1, dwMinorVersion: %2)").arg(osvi.dwMinorVersion).arg(osvi.dwMinorVersion); + } + return Os; +} +#endif + +#ifdef Q_OS_MAC +QString EventDispatcher::GetOSDisplayString() +{ + QStringList key; + QStringList string; + QFile xmlFile(QStringLiteral("/System/Library/CoreServices/SystemVersion.plist")); + if(xmlFile.open(QIODevice::ReadOnly)) + { + QString content=xmlFile.readAll(); + xmlFile.close(); + QString errorStr; + int errorLine; + int errorColumn; + QDomDocument domDocument; + if (!domDocument.setContent(content, false, &errorStr,&errorLine,&errorColumn)) + return QStringLiteral("Mac OS X"); + else + { + QDomElement root = domDocument.documentElement(); + if(root.tagName()!=QStringLiteral("plist")) + return QStringLiteral("Mac OS X"); + else + { + if(root.isElement()) + { + QDomElement SubChild=root.firstChildElement(QStringLiteral("dict")); + while(!SubChild.isNull()) + { + if(SubChild.isElement()) + { + QDomElement SubChild2=SubChild.firstChildElement(QStringLiteral("key")); + while(!SubChild2.isNull()) + { + if(SubChild2.isElement()) + key << SubChild2.text(); + else + return QStringLiteral("Mac OS X"); + SubChild2 = SubChild2.nextSiblingElement(QStringLiteral("key")); + } + SubChild2=SubChild.firstChildElement(QStringLiteral("string")); + while(!SubChild2.isNull()) + { + if(SubChild2.isElement()) + string << SubChild2.text(); + else + return QStringLiteral("Mac OS X"); + SubChild2 = SubChild2.nextSiblingElement(QStringLiteral("string")); + } + } + else + return QStringLiteral("Mac OS X"); + SubChild = SubChild.nextSiblingElement(QStringLiteral("property")); + } + } + else + return QStringLiteral("Mac OS X"); + } + } + } + if(key.size()!=string.size()) + return QStringLiteral("Mac OS X"); + int index=0; + while(index copyMoveEventIdManaged; - }; - /// \brief the systray icon - SystrayIcon *backgroundIcon; - /// \brief To lunch event only when the event loop is setup - QTimer lunchInitFunction; - /// \brief the help dialog - HelpDialog theHelp; - /// \brief the session loader - SessionLoader *sessionloader; - bool stopIt; - CopyListener *copyServer; - Core *core; - OptionDialog optionDialog; - CopyEngineManager *copyEngineList; - LocalListener localListener; - CliParser cliParser; - private slots: - /// \brief Called when event loop is setup - void initFunction(); + Q_OBJECT + public: + /// \brief Initiate the ultracopier event dispatcher and check if no other session is running + EventDispatcher(); + /// \brief Destroy the ultracopier event dispatcher + ~EventDispatcher(); + /// \brief return if need be close + bool shouldBeClosed(); + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + static QString GetOSDisplayString(); + #endif + public slots: + /// \brief Quit ultracopier + void quit(); + signals: + /** \brief Send that's caught state have changed for CatchedState::Uncatched or CatchedState::Semicatched or CatchedState::Catched + \see CatchState + \see tryCatchCopy() + \see tryUncatchCopy() + \param State is the new state */ + void catchCopyStateChanged(Ultracopier::CatchState state) const; + /** \brief Send that's copy/move task is finished in returning the copyMoveEventId + \see routeCopyMoveEvent() + \param copyMoveEventId The task id generated by routeCopyMoveEvent() */ + void copyMoveEventIsFinish(int copyMoveEventId) const; + private: + /// \brief To have counter for increment the copyMoveEventId at each request + int copyMoveEventIdIndex; + /// \brief To store windows windows session + struct CoreSession + { + Core * CoreWindow; + QList copyMoveEventIdManaged; + }; + /// \brief the systray icon + SystrayIcon *backgroundIcon; + /// \brief To lunch event only when the event loop is setup + QTimer lunchInitFunction; + /// \brief the help dialog + HelpDialog theHelp; + #ifndef ULTRACOPIER_VERSION_PORTABLE + /// \brief the session loader + SessionLoader *sessionloader; + #endif + bool stopIt; + CopyListener *copyServer; + Core *core; + OptionDialog optionDialog; + #ifdef ULTRACOPIER_INTERNET_SUPPORT + InternetUpdater internetUpdater; + #endif + CopyEngineManager *copyEngineList; + LocalListener localListener; + CliParser cliParser; + private slots: + /// \brief Called when event loop is setup + void initFunction(); }; #endif // EVENT_DISPATCHER_H diff --git a/ExtraSocket.cpp b/ExtraSocket.cpp index 08b0979..8175c5f 100644 --- a/ExtraSocket.cpp +++ b/ExtraSocket.cpp @@ -1,32 +1,60 @@ /** \file ExtraSocket.h \brief Define the socket of ultracopier \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "ExtraSocket.h" +#include +#include QString ExtraSocket::pathSocket(const QString &name) { #ifdef Q_OS_UNIX - return name+"-"+QString::number(getuid()); + return name+QStringLiteral("-")+QString::number(getuid()); #else - QString userName; - DWORD size=0; - if(GetUserNameW(NULL,&size) || (GetLastError()!=ERROR_INSUFFICIENT_BUFFER)) - { - } - else - { - WCHAR * userNameW=new WCHAR[size]; - if(GetUserNameW(userNameW,&size)) - { - userName.fromWCharArray(userNameW,size*2); - userName=QString(QByteArray((char*)userNameW,size*2-2).toHex()); - } - delete userNameW; - } - return name+"-"+userName; + QString userName; + + /* bad way for catchcopy compatibility + char uname[1024]; + DWORD len=1023; + if(GetUserNameA(uname, &len)!=FALSE) + userName=QString::fromLatin1(toHex(uname));*/ + + QChar charTemp; + DWORD size=255; + WCHAR * userNameW=new WCHAR[size]; + if(GetUserNameW(userNameW,&size)) + { + QByteArray tempArray; + userName=QString::fromWCharArray(userNameW,size-1); + int index=0; + while(index #ifdef Q_OS_UNIX - #include - #include + #include + #include #else - #include + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include #endif /** \brief class to have general socket options */ class ExtraSocket { public: - /** \brief class to return always the same socket resolution */ - static QString pathSocket(const QString &name); + /** \brief class to return always the same socket resolution */ + static QString pathSocket(const QString &name); + static char * toHex(const char *str); }; #endif // EXTRASOCKET_H diff --git a/FacilityEngine.cpp b/FacilityEngine.cpp index 30c5168..ca6d467 100644 --- a/FacilityEngine.cpp +++ b/FacilityEngine.cpp @@ -2,207 +2,240 @@ \brief To implement the facility engine, the interface is defined into FacilityInterface() \see FacilityInterface() \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "FacilityEngine.h" #if defined (Q_OS_WIN32) -#include + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include #endif +FacilityEngine FacilityEngine::facilityEngine; + FacilityEngine::FacilityEngine() { - retranslate(); + retranslate(); } /// \brief To force the text re-translation void FacilityEngine::retranslate() { - //undirect translated string - Translation_perSecond="/"+tr("s"); - Translation_tooBig=tr("Too big"); - Translation_B=tr("B"); - Translation_KB=tr("KB"); - Translation_MB=tr("MB"); - Translation_GB=tr("GB"); - Translation_TB=tr("TB"); - Translation_PB=tr("PB"); - Translation_EB=tr("EB"); - Translation_ZB=tr("ZB"); - Translation_YB=tr("YB"); - Translation_SimplifiedRemaningTime_LessThan10s=tr("Less than %10 seconds"); - Translation_SimplifiedRemaningTime_AboutSeconds=tr("About %10 seconds remaining"); - Translation_SimplifiedRemaningTime_AboutMinutes=tr("About %1 minutes remaining"); - Translation_SimplifiedRemaningTime_AboutHours=tr("About %1 hours remaining"); - //load the translations tab - translations["Copy engine"]=tr("Copy engine"); - translations["Copy"]=tr("Copy"); - translations["Move"]=tr("Move"); - translations["Pause"]=tr("Pause"); - translations["Resume"]=tr("Resume"); - translations["Skip"]=tr("Skip"); - translations["Unlimited"]=tr("Unlimited"); - translations["Source"]=tr("Source"); - translations["Size"]=tr("Size"); - translations["Destination"]=tr("Destination"); - translations["Quit"]=tr("Quit"); - translations["Target"]=tr("Target"); - translations["Time remaining:"]=tr("Time remaining:"); - translations["Listing"]=tr("Listing"); - translations["Copying"]=tr("Copying"); - translations["Listing and copying"]=tr("Listing and copying"); - translations["Time remaining:"]=tr("Time remaining:"); - //for copy engine - translations["Ask"]=tr("Ask"); - translations["Skip"]=tr("Skip"); - translations["Overwrite"]=tr("Overwrite"); - translations["Overwrite if newer"]=tr("Overwrite if newer"); - translations["Overwrite if the last modification dates are different"]=tr("Overwrite if the last modification dates are different"); - translations["Rename"]=tr("Rename"); - translations["Put to end of the list"]=tr("Put to end of the list"); - translations["Select source directory"]=tr("Select source directory"); - translations["Select destination directory"]=tr("Select destination directory"); - translations["Internal error"]=tr("Internal error"); - translations["Select one or more files to open"]=tr("Select one or more files to open"); - translations["All files"]=tr("All files"); - translations["Save transfer list"]=tr("Save transfer list"); - translations["Open transfer list"]=tr("Open transfer list"); - translations["Transfer list"]=tr("Transfer list"); - translations["Error"]=tr("Error"); - translations["Not supported on this platform"]=tr("Not supported on this platform"); + //undirect translated string + Translation_perSecond=QStringLiteral("/")+tr("s"); + Translation_tooBig=tr("Too big"); + Translation_B=tr("B"); + Translation_KB=tr("KB"); + Translation_MB=tr("MB"); + Translation_GB=tr("GB"); + Translation_TB=tr("TB"); + Translation_PB=tr("PB"); + Translation_EB=tr("EB"); + Translation_ZB=tr("ZB"); + Translation_YB=tr("YB"); + Translation_SimplifiedRemaningTime_LessThan10s=tr("Less than %10 seconds"); + Translation_SimplifiedRemaningTime_AboutSeconds=tr("About %10 seconds remaining"); + Translation_SimplifiedRemaningTime_AboutMinutes=tr("About %1 minutes remaining"); + Translation_SimplifiedRemaningTime_AboutHours=tr("About %1 hours remaining"); + //load the translations tab + translations["Copy engine"]=tr("Copy engine"); + //: a copy + translations["Copy"]=tr("Copy"); + //: a transfer + translations["Transfer"]=tr("Transfer"); + //: a move + translations["Move"]=tr("Move"); + translations["Start"]=tr("Start"); + translations["Pause"]=tr("Pause"); + translations["Resume"]=tr("Resume"); + translations["Skip"]=tr("Skip"); + translations["Unlimited"]=tr("Unlimited"); + translations["Source"]=tr("Source"); + translations["Size"]=tr("Size"); + translations["Destination"]=tr("Destination"); + translations["Quit"]=tr("Quit"); + translations["Target"]=tr("Target"); + translations["Time remaining:"]=tr("Time remaining:"); + translations["Listing"]=tr("Listing"); + translations["Copying"]=tr("Copying"); + translations["Listing and copying"]=tr("Listing and copying"); + translations["Time remaining:"]=tr("Time remaining:"); + //for copy engine + translations["Ask"]=tr("Ask"); + translations["Skip"]=tr("Skip"); + translations["Overwrite"]=tr("Overwrite"); + translations["Overwrite if newer"]=tr("Overwrite if newer"); + translations["Overwrite if the last modification dates are different"]=tr("Overwrite if the last modification dates are different"); + translations["Rename"]=tr("Rename"); + translations["Put to the end of the list"]=tr("Put to the end of the list"); + translations["Select source directory"]=tr("Select source directory"); + translations["Select destination directory"]=tr("Select destination directory"); + translations["Internal error"]=tr("Internal error"); + translations["Select one or more files to open"]=tr("Select one or more files to open"); + translations["All files"]=tr("All files"); + translations["Save transfer list"]=tr("Save transfer list"); + translations["Open transfer list"]=tr("Open transfer list"); + translations["Transfer list"]=tr("Transfer list"); + translations["Error"]=tr("Error"); + translations["Not supported on this platform"]=tr("Not supported on this platform"); + translations["Completed in %1"]=tr("Completed in %1"); } /// \brief convert size in Byte to String -QString FacilityEngine::sizeToString(const double &size) +QString FacilityEngine::sizeToString(const double &size) const { - double size_temp=size; - if(size_temp<1024) - return QString::number(size_temp)+sizeUnitToString(SizeUnit_byte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_KiloByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_MegaByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_GigaByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_TeraByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_PetaByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_ExaByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_ZettaByte); - if((size_temp=size_temp/1024)<1024) - return adaptString(size_temp)+sizeUnitToString(SizeUnit_YottaByte); - return Translation_tooBig; + double size_temp=size; + if(size_temp<1024) + return QString::number(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_byte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_KiloByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_MegaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_GigaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_TeraByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_PetaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_ExaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_ZettaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(size_temp)+sizeUnitToString(Ultracopier::SizeUnit_YottaByte); + return Translation_tooBig; } -QString FacilityEngine::adaptString(const float &size) +QString FacilityEngine::adaptString(const float &size) const { - if(size>=100) - return QString::number(size,'f',0); - else - return QString::number(size,'g',3); + if(size>=100) + return QString::number(size,'f',0); + else + return QString::number(size,'g',3); } /// \brief convert size unit to String -QString FacilityEngine::sizeUnitToString(const SizeUnit &sizeUnit) +QString FacilityEngine::sizeUnitToString(const Ultracopier::SizeUnit &sizeUnit) const { - switch(sizeUnit) - { - case SizeUnit_byte: - return Translation_B; - case SizeUnit_KiloByte: - return Translation_KB; - case SizeUnit_MegaByte: - return Translation_MB; - case SizeUnit_GigaByte: - return Translation_GB; - case SizeUnit_TeraByte: - return Translation_TB; - case SizeUnit_PetaByte: - return Translation_PB; - case SizeUnit_ExaByte: - return Translation_EB; - case SizeUnit_ZettaByte: - return Translation_ZB; - case SizeUnit_YottaByte: - return Translation_YB; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"sizeUnit: "+QString::number(sizeUnit)); - return "???"; - } + switch(sizeUnit) + { + case Ultracopier::SizeUnit_byte: + return Translation_B; + case Ultracopier::SizeUnit_KiloByte: + return Translation_KB; + case Ultracopier::SizeUnit_MegaByte: + return Translation_MB; + case Ultracopier::SizeUnit_GigaByte: + return Translation_GB; + case Ultracopier::SizeUnit_TeraByte: + return Translation_TB; + case Ultracopier::SizeUnit_PetaByte: + return Translation_PB; + case Ultracopier::SizeUnit_ExaByte: + return Translation_EB; + case Ultracopier::SizeUnit_ZettaByte: + return Translation_ZB; + case Ultracopier::SizeUnit_YottaByte: + return Translation_YB; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"sizeUnit: "+QString::number(sizeUnit)); + return "???"; + } } /// \brief translate the text -QString FacilityEngine::translateText(const QString &text) +QString FacilityEngine::translateText(const QString &text) const { - if(translations.contains(text)) - return translations[text]; - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"text: "+text); - return text; - } + if(translations.contains(text)) + return translations.value(text); + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"translation not found: "+text); + return text; + } } /// \brief speed to string in byte per seconds -QString FacilityEngine::speedToString(const double &speed) +QString FacilityEngine::speedToString(const double &speed) const { - return sizeToString(speed)+Translation_perSecond; + return sizeToString(speed)+Translation_perSecond; } /// \brief Decompose the time in second -TimeDecomposition FacilityEngine::secondsToTimeDecomposition(const quint32 &seconds) +Ultracopier::TimeDecomposition FacilityEngine::secondsToTimeDecomposition(const quint32 &seconds) const { - quint32 seconds_temp=seconds; - TimeDecomposition returnValue; - returnValue.second=seconds_temp%60; - seconds_temp-=returnValue.second; - seconds_temp/=60; - returnValue.minute=seconds_temp%60; - seconds_temp-=returnValue.minute; - seconds_temp/=60; - returnValue.hour=seconds_temp; - return returnValue; + quint32 seconds_temp=seconds; + Ultracopier::TimeDecomposition returnValue; + returnValue.second=seconds_temp%60; + seconds_temp-=returnValue.second; + seconds_temp/=60; + returnValue.minute=seconds_temp%60; + seconds_temp-=returnValue.minute; + seconds_temp/=60; + returnValue.hour=seconds_temp; + return returnValue; } /// \brief have the functionality -bool FacilityEngine::haveFunctionality(const QString &fonctionnality) +bool FacilityEngine::haveFunctionality(const QString &fonctionnality) const { - #if defined (Q_OS_WIN32) - if(fonctionnality=="shutdown") - return true; - #endif - Q_UNUSED(fonctionnality); - return false; + #if defined (Q_OS_WIN32) + if(fonctionnality=="shutdown") + return true; + #endif + Q_UNUSED(fonctionnality); + return false; } /// \brief call the fonctionnality QVariant FacilityEngine::callFunctionality(const QString &fonctionnality,const QStringList &args) { - #if defined (Q_OS_WIN32) - ExitWindowsEx(EWX_POWEROFF | EWX_FORCE,0); - system("shutdown /s /f /t 0"); - #endif - Q_UNUSED(fonctionnality); - Q_UNUSED(args); - return QVariant(); + #if defined (Q_OS_WIN32) + ExitWindowsEx(EWX_POWEROFF | EWX_FORCE,0); + system("shutdown /s /f /t 0"); + #endif + Q_UNUSED(fonctionnality); + Q_UNUSED(args); + return QVariant(); } /// \brief Do the simplified time -QString FacilityEngine::simplifiedRemainingTime(const quint32 &seconds) +QString FacilityEngine::simplifiedRemainingTime(const quint32 &seconds) const +{ + if(seconds<50) + { + if(seconds<10) + return Translation_SimplifiedRemaningTime_LessThan10s.arg(seconds/10+1); + else + return Translation_SimplifiedRemaningTime_AboutSeconds.arg(seconds/10+1); + } + if(seconds<3600) + return Translation_SimplifiedRemaningTime_AboutMinutes.arg(seconds/60); + return Translation_SimplifiedRemaningTime_AboutHours.arg(seconds/3600); +} + +/// \brief Return ultimate url, empty is not found or already ultimate +QString FacilityEngine::ultimateUrl() const +{ + #ifdef ULTRACOPIER_VERSION_ULTIMATE + return QString(); + #else + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + return QStringLiteral("http://ultracopier.first-world.info/shop.html"); + #else + return QString(); + #endif + #endif +} + +/// \brief Return the software name +QString FacilityEngine::softwareName() const { - if(seconds<50) - { - if(seconds<10) - return Translation_SimplifiedRemaningTime_LessThan10s.arg(seconds/10+1); - else - return Translation_SimplifiedRemaningTime_AboutSeconds.arg(seconds/10+1); - } - if(seconds<3600) - return Translation_SimplifiedRemaningTime_AboutMinutes.arg(seconds/60); - return Translation_SimplifiedRemaningTime_AboutHours.arg(seconds/3600); + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + return QStringLiteral("Supercopier"); + #else + return QStringLiteral("Ultracopier"); + #endif } diff --git a/FacilityEngine.h b/FacilityEngine.h index d5a6145..1ab658f 100644 --- a/FacilityEngine.h +++ b/FacilityEngine.h @@ -2,8 +2,6 @@ \brief To implement the facility engine, the interface is defined into FacilityInterface() \see FacilityInterface() \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef FACILITYENGINE_H @@ -23,49 +21,55 @@ This class is used into some plugin like copy engine plugin, to all into one pla */ class FacilityEngine : public FacilityInterface { - Q_OBJECT + Q_OBJECT public: - explicit FacilityEngine(); - /// \brief convert size in Byte to String - QString sizeToString(const double &size); - /// \brief convert size unit to String - QString sizeUnitToString(const SizeUnit &sizeUnit); - /// \brief translate the text - QString translateText(const QString &text); - /// \brief speed to string in byte per seconds - QString speedToString(const double &speed); - /// \brief Decompose the time in second - TimeDecomposition secondsToTimeDecomposition(const quint32 &seconds); - /// \brief have the fonctionnality - bool haveFunctionality(const QString &fonctionnality); - /// \brief call the fonctionnality - QVariant callFunctionality(const QString &fonctionnality,const QStringList &args=QStringList()); - /// \brief Do the simplified time - QString simplifiedRemainingTime(const quint32 &seconds); + explicit FacilityEngine(); + /// \brief convert size in Byte to String + QString sizeToString(const double &size) const; + /// \brief convert size unit to String + QString sizeUnitToString(const Ultracopier::SizeUnit &sizeUnit) const; + /// \brief translate the text + QString translateText(const QString &text) const; + /// \brief speed to string in byte per seconds + QString speedToString(const double &speed) const; + /// \brief Decompose the time in second + Ultracopier::TimeDecomposition secondsToTimeDecomposition(const quint32 &seconds) const; + /// \brief have the fonctionnality + bool haveFunctionality(const QString &fonctionnality) const; + /// \brief call the fonctionnality + QVariant callFunctionality(const QString &fonctionnality,const QStringList &args=QStringList()); + /// \brief Do the simplified time + QString simplifiedRemainingTime(const quint32 &seconds) const; + /// \brief Return ultimate url, empty is not found or already ultimate + QString ultimateUrl() const; + /// \brief Return the software name + QString softwareName() const; + + static FacilityEngine facilityEngine; private: - //undirect translated string - QString Translation_perSecond; - QString Translation_tooBig; - QString Translation_B; - QString Translation_KB; - QString Translation_MB; - QString Translation_GB; - QString Translation_TB; - QString Translation_PB; - QString Translation_EB; - QString Translation_ZB; - QString Translation_YB; - //simplified remaining time - QString Translation_SimplifiedRemaningTime_LessThan10s; - QString Translation_SimplifiedRemaningTime_AboutSeconds; - QString Translation_SimplifiedRemaningTime_AboutMinutes; - QString Translation_SimplifiedRemaningTime_AboutHours; - //internal fonction - QString adaptString(const float &nb); - QHash translations; + //undirect translated string + QString Translation_perSecond; + QString Translation_tooBig; + QString Translation_B; + QString Translation_KB; + QString Translation_MB; + QString Translation_GB; + QString Translation_TB; + QString Translation_PB; + QString Translation_EB; + QString Translation_ZB; + QString Translation_YB; + //simplified remaining time + QString Translation_SimplifiedRemaningTime_LessThan10s; + QString Translation_SimplifiedRemaningTime_AboutSeconds; + QString Translation_SimplifiedRemaningTime_AboutMinutes; + QString Translation_SimplifiedRemaningTime_AboutHours; + //internal fonction + inline QString adaptString(const float &nb) const; + QHash translations; public slots: - /// \brief To force the text re-translation - void retranslate(); + /// \brief To force the text re-translation + void retranslate(); }; #endif // FACILITYENGINE_H diff --git a/GlobalClass.cpp b/GlobalClass.cpp deleted file mode 100644 index 0f1c52a..0000000 --- a/GlobalClass.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** \file GlobalClass.cpp -\brief Define the class for all the class different of ResourcesManager, DebugEngine, ThemesManager, OptionEngine can have object of this class at the global scope -\author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ - -#include "GlobalClass.h" - -/// \brief The constructor where set the global variable to the good pointer -GlobalClass::GlobalClass() -{ - //load the debug engine, themes and resources, after reused in all the program and all class derive from GlobalClass - #ifdef ULTRACOPIER_DEBUG - debug_engine_instance=DebugEngine::getInstance(); - #endif // ULTRACOPIER_DEBUG - resources=ResourcesManager::getInstance(); - plugins=PluginsManager::getInstance(); - options=OptionEngine::getInstance(); - themes=ThemesManager::getInstance(); - languages=LanguagesManager::getInstance(); -} - -/// \brief The destructor where destroy the variable if the object no more longer used -GlobalClass::~GlobalClass() -{ - //destroy the resources variable if not more used - LanguagesManager::destroyInstanceAtTheLastCall(); - ThemesManager::destroyInstanceAtTheLastCall(); - OptionEngine::destroyInstanceAtTheLastCall(); - PluginsManager::destroyInstanceAtTheLastCall(); - ResourcesManager::destroyInstanceAtTheLastCall(); - #ifdef ULTRACOPIER_DEBUG - DebugEngine::destroyInstanceAtTheLastCall(); - #endif // ULTRACOPIER_DEBUG -} - - - - diff --git a/GlobalClass.h b/GlobalClass.h deleted file mode 100644 index 21dd12e..0000000 --- a/GlobalClass.h +++ /dev/null @@ -1,44 +0,0 @@ -/** \file GlobalClass.h -\brief Define the class for all the class different of ResourcesManager, DebugEngine, ThemesManager, OptionEngine have object of this class at the global scope -\author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ - -#ifndef GLOBAL_CLASS_H -#define GLOBAL_CLASS_H - -#include "Environment.h" -#include "ThemesManager.h" -#include "ResourcesManager.h" -#include "OptionEngine.h" -#include "LanguagesManager.h" -#include "PluginsManager.h" - -#include "interface/OptionInterface.h" - -/// \brief Define the class for the debug and global variables heritage -class GlobalClass -{ - public: - /// \brief The constructor where set the global variable to the good pointer - GlobalClass(); - /// \brief The destructor where destroy the variable if the unique instance is no more longer used - ~GlobalClass(); - protected: - //for the themes - ThemesManager *themes; - //for the resources linked with the themes - ResourcesManager *resources; - //for the options - OptionEngine *options; - //for the languages - LanguagesManager *languages; - //for the plugins - PluginsManager *plugins; - #ifdef ULTRACOPIER_DEBUG - DebugEngine *debug_engine_instance; - #endif // ULTRACOPIER_DEBUG -}; - -#endif // GLOBAL_CLASS_H diff --git a/HelpDialog.cpp b/HelpDialog.cpp index 2d06d54..f821eac 100644 --- a/HelpDialog.cpp +++ b/HelpDialog.cpp @@ -1,8 +1,6 @@ /** \file HelpDialog.cpp \brief Define the help dialog \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "HelpDialog.h" @@ -12,169 +10,140 @@ /// \brief Construct the object HelpDialog::HelpDialog() : - ui(new Ui::HelpDialog) + ui(new Ui::HelpDialog) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - ui->setupUi(this); - reloadTextValue(); - #ifdef ULTRACOPIER_DEBUG - connect(debug_engine_instance,SIGNAL(newDebugInformation()),this,SLOT(addDebugText())); - connect(ui->pushButtonSaveBugReport,SIGNAL(clicked()),debug_engine_instance,SLOT(saveBugReport())); - #else // ULTRACOPIER_DEBUG - ui->lineEditInsertDebug->hide(); - ui->debugView->hide(); - ui->pushButtonSaveBugReport->hide(); - ui->pushButtonCrash->hide(); - this->setMaximumSize(QSize(500,128)); - /*timeToSetText.setInterval(250); - timeToSetText.setSingleShot(true); - connect(&timeToSetText,SIGNAL(timeout()),this,SLOT(showDebugText()));*/ - ui->pushButtonClose->hide(); - #endif // ULTRACOPIER_DEBUG - //connect the about Qt - connect(ui->pushButtonAboutQt,SIGNAL(toggled(bool)),qApp,SLOT(aboutQt())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ui->setupUi(this); + reloadTextValue(); + #ifdef ULTRACOPIER_DEBUG + ui->debugView->setModel(DebugModel::debugModel); + connect(ui->pushButtonSaveBugReport,&QPushButton::clicked,DebugEngine::debugEngine,&DebugEngine::saveBugReport); + #else // ULTRACOPIER_DEBUG + ui->lineEditInsertDebug->hide(); + ui->debugView->hide(); + ui->pushButtonSaveBugReport->hide(); + ui->pushButtonCrash->hide(); + this->setMaximumSize(QSize(500,128)); + /*timeToSetText.setInterval(250); + timeToSetText.setSingleShot(true); + connect(&timeToSetText,QTimer::timeout,this,&DebugEngine::showDebugText);*/ + ui->pushButtonClose->hide(); + #endif // ULTRACOPIER_DEBUG + //connect the about Qt + connect(ui->pushButtonAboutQt,&QPushButton::toggled,&QApplication::aboutQt); + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + setWindowTitle(tr("About Supercopier")); + #else + setWindowTitle(tr("About Ultracopier")); + #endif } /// \brief Destruct the object HelpDialog::~HelpDialog() { - delete ui; + delete ui; } /// \brief To re-translate the ui void HelpDialog::changeEvent(QEvent *e) { - QDialog::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - ui->retranslateUi(this); - reloadTextValue(); - break; - default: - break; - } + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ui->retranslateUi(this); + reloadTextValue(); + break; + default: + break; + } } /// \brief To reload the text value void HelpDialog::reloadTextValue() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString text=ui->label_ultracopier->text(); - #ifdef ULTRACOPIER_VERSION_ULTIMATE - text=text.replace("%1",QString("Ultimate %1").arg(ULTRACOPIER_VERSION)); - #else - text=text.replace("%1",ULTRACOPIER_VERSION); - #endif - ui->label_ultracopier->setText(text); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + QString text=ui->label_ultracopier->text(); + #ifdef ULTRACOPIER_VERSION_ULTIMATE + text=text.replace(QStringLiteral("%1"),QStringLiteral("Ultimate %1").arg(ULTRACOPIER_VERSION)); + #else + text=text.replace(QStringLiteral("%1"),ULTRACOPIER_VERSION); + #endif + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + text=text.replace(QStringLiteral("Ultracopier"),QStringLiteral("Supercopier"),Qt::CaseInsensitive); + #endif + ui->label_ultracopier->setText(text); - text=ui->label_description->text(); - #ifdef ULTRACOPIER_VERSION_PORTABLE - #ifdef ULTRACOPIER_VERSION_PORTABLEAPPS - text=text.replace("%1",tr("For http://portableapps.com/")); - #else - text=text.replace("%1",tr("Portable version")); - #endif - #else - text=text.replace("%1",tr("Normal version")); - #endif - ui->label_description->setText(text); + text=ui->label_description->text(); + #ifdef ULTRACOPIER_VERSION_PORTABLE + #ifdef ULTRACOPIER_VERSION_PORTABLEAPPS + text=text.replace(QStringLiteral("%1"),tr("For http://portableapps.com/")); + #else + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + text=text.replace(QStringLiteral("%1"),tr("Portable and all in one version")); + #else + text=text.replace(QStringLiteral("%1"),tr("Portable version")); + #endif + #endif + #else + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + text=text.replace(QStringLiteral("%1"),tr("All in one version")); + #else + text=text.replace(QStringLiteral("%1"),tr("Normal version")); + #endif + #endif + ui->label_description->setText(text); - text=ui->label_site->text(); - //: This site need be the official site of ultracopier, into the right languages, english if not exists - text=text.replace("%1",tr("http://ultracopier.first-world.info/")); - ui->label_site->setText(text); + text=ui->label_site->text(); + //: This site need be the official site of ultracopier, into the right languages, english if not exists + text=text.replace(QStringLiteral("%1"),getWebSite()); + ui->label_site->setText(text); - text=ui->label_platform->text(); - text=text.replace("%1",ULTRACOPIER_PLATFORM_NAME); - ui->label_platform->setText(text); + text=ui->label_platform->text(); + text=text.replace(QStringLiteral("%1"),ULTRACOPIER_PLATFORM_NAME); + ui->label_platform->setText(text); } -#ifdef ULTRACOPIER_DEBUG -/// \brief Add debug text -void HelpDialog::addDebugText() +QString HelpDialog::getWebSite() { - QList returnedList=debug_engine_instance->getItemList(); - QTreeWidgetItem * item; - QBrush brush; - QFont functionFont; - functionFont.setItalic(true); - functionFont.setUnderline(true); - QFont timeFont; - timeFont.setBold(true); - QFont noteFont; - noteFont.setBold(true); - noteFont.setPointSize(15); - int index=0; - int loop_size=returnedList.size(); - while(indexdebugView,QStringList() - << returnedList.at(index).time - << returnedList.at(index).file - << returnedList.at(index).function - << returnedList.at(index).location - << returnedList.at(index).text); - switch(returnedList.at(index).level) - { - case DebugLevel_custom_Information: - brush=QBrush(QColor(94,165,255)); - break; - case DebugLevel_custom_Critical: - brush=QBrush(QColor(255,0,0)); - break; - case DebugLevel_custom_Warning: - brush=QBrush(QColor(255,178,0)); - break; - case DebugLevel_custom_Notice: - brush=QBrush(QColor(128,128,128)); - break; - case DebugLevel_custom_UserNote: - brush=QBrush(QColor(0,0,0)); - break; - } - item->setForeground(0,brush); - item->setFont(0,timeFont); - item->setForeground(1,brush); - item->setForeground(2,brush); - item->setFont(2,functionFont); - item->setForeground(3,brush); - item->setForeground(4,brush); - if(returnedList.at(index).level==DebugLevel_custom_UserNote) - { - item->setFont(0,noteFont); - item->setFont(1,noteFont); - item->setFont(2,noteFont); - item->setFont(3,noteFont); - item->setFont(4,noteFont); - } - ui->debugView->insertTopLevelItem(ui->debugView->columnCount(),item); - index++; - } - if(loop_size==ULTRACOPIER_DEBUG_MAX_GUI_LINE) - { - item=new QTreeWidgetItem(ui->debugView,QStringList() << "..."); - ui->debugView->insertTopLevelItem(ui->debugView->columnCount(),item); - } + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + return tr("http://ultracopier.first-world.info/")+QStringLiteral("supercopier.html"); + #else + return tr("http://ultracopier.first-world.info/"); + #endif } -void HelpDialog::on_lineEditInsertDebug_returnPressed() + +QString HelpDialog::getUpdateUrl() { - DebugEngine::addDebugNote(ui->lineEditInsertDebug->text()); - ui->lineEditInsertDebug->clear(); - ui->debugView->scrollToBottom(); + #if defined(ULTRACOPIER_VERSION_ULTIMATE) + return tr("http://ultracopier.first-world.info/shop.html"); + #else + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + return tr("http://ultracopier.first-world.info/")+QStringLiteral("supercopier.html"); + #else + return tr("http://ultracopier.first-world.info/download.html"); + #endif + #endif } +#ifdef ULTRACOPIER_DEBUG +void HelpDialog::on_lineEditInsertDebug_returnPressed() +{ + DebugEngine::addDebugNote(ui->lineEditInsertDebug->text()); + ui->lineEditInsertDebug->clear(); + ui->debugView->scrollToBottom(); +} #endif // ULTRACOPIER_DEBUG void HelpDialog::on_pushButtonAboutQt_clicked() { - QApplication::aboutQt(); + QApplication::aboutQt(); } void HelpDialog::on_pushButtonCrash_clicked() { - int a=0; - int *b=NULL; - *b=3/a; + int a=0; + int *b=NULL; + *b=3/a; } diff --git a/HelpDialog.h b/HelpDialog.h index 43cbc7f..2a2fd32 100644 --- a/HelpDialog.h +++ b/HelpDialog.h @@ -1,8 +1,6 @@ /** \file HelpDialog.h \brief Define the help dialog \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef DIALOG_H @@ -16,35 +14,35 @@ #include "ui_HelpDialog.h" #include "Environment.h" -#include "GlobalClass.h" namespace Ui { - class HelpDialog; + class HelpDialog; } /** \brief Help dialog, and some user oriented repport/debug function */ -class HelpDialog : public QDialog, public GlobalClass { - Q_OBJECT - public: - /// \brief Construct the object - HelpDialog(); - /// \brief Destruct the object - ~HelpDialog(); - protected: - /// \brief To re-translate the ui - void changeEvent(QEvent *e); - private: - Ui::HelpDialog *ui; - /// \brief To reload the text value - void reloadTextValue(); - private slots: - #ifdef ULTRACOPIER_DEBUG - /// \brief Add debug text - void addDebugText(); - void on_lineEditInsertDebug_returnPressed(); - #endif // ULTRACOPIER_DEBUG - void on_pushButtonAboutQt_clicked(); - void on_pushButtonCrash_clicked(); +class HelpDialog : public QDialog { + Q_OBJECT + public: + /// \brief Construct the object + HelpDialog(); + /// \brief Destruct the object + ~HelpDialog(); + static QString getWebSite(); + static QString getUpdateUrl(); + protected: + /// \brief To re-translate the ui + void changeEvent(QEvent *e); + private: + Ui::HelpDialog *ui; + /// \brief To reload the text value + void reloadTextValue(); + private slots: + #ifdef ULTRACOPIER_DEBUG + /// \brief Add debug text + void on_lineEditInsertDebug_returnPressed(); + #endif // ULTRACOPIER_DEBUG + void on_pushButtonAboutQt_clicked(); + void on_pushButtonCrash_clicked(); }; #endif // DIALOG_H diff --git a/HelpDialog.ui b/HelpDialog.ui index 1826120..5d42f18 100644 --- a/HelpDialog.ui +++ b/HelpDialog.ui @@ -16,11 +16,8 @@ 16777214 - - About ultracopier - - + :/ultracopier-16x16.png:/ultracopier-16x16.png @@ -44,7 +41,7 @@ - :/ultracopier-128x128.png + :/ultracopier-128x128.png @@ -67,7 +64,7 @@ - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. @@ -107,38 +104,13 @@ This version is compiled as version: %1. - + false true - - - Time - - - - - File - - - - - Function - - - - - Location - - - - - Text - - @@ -196,7 +168,7 @@ This version is compiled as version: %1. pushButtonClose - + diff --git a/InternetUpdater.cpp b/InternetUpdater.cpp new file mode 100644 index 0000000..de23424 --- /dev/null +++ b/InternetUpdater.cpp @@ -0,0 +1,112 @@ +#include "InternetUpdater.h" +#include "EventDispatcher.h" +#include "OptionEngine.h" + +#ifdef ULTRACOPIER_INTERNET_SUPPORT + +#include +#include + +#include "PluginsManager.h" + +InternetUpdater::InternetUpdater(QObject *parent) : + QObject(parent) +{ + connect(&newUpdateTimer,&QTimer::timeout,this,&InternetUpdater::downloadFile); + connect(&firstUpdateTimer,&QTimer::timeout,this,&InternetUpdater::downloadFile); + newUpdateTimer.start(1000*3600); + firstUpdateTimer.setSingleShot(true); + firstUpdateTimer.start(1000*60); +} + +void InternetUpdater::downloadFile() +{ + if(!OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("checkTheUpdate")).toBool()) + return; + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + QString name=QStringLiteral("Supercopier"); + #else + QString name=QStringLiteral("Ultracopier"); + #endif + QString ultracopierVersion; + #ifdef ULTRACOPIER_VERSION_ULTIMATE + ultracopierVersion=QStringLiteral("%1 Ultimate/%2").arg(name).arg(ULTRACOPIER_VERSION); + #else + ultracopierVersion=QStringLiteral("%1/%2").arg(name).arg(ULTRACOPIER_VERSION); + #endif + #ifdef ULTRACOPIER_VERSION_PORTABLE + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + ultracopierVersion+=QStringLiteral(" portable/all-in-one"); + #else + ultracopierVersion+=QStringLiteral(" portable"); + #endif + #else + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + ultracopierVersion+=QStringLiteral(" all-in-one"); + #endif + #endif + #ifdef ULTRACOPIER_CGMINER + ultracopierVersion+=QStringLiteral(" miner"); + #endif + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + ultracopierVersion+=QStringLiteral(" (OS: %1)").arg(EventDispatcher::GetOSDisplayString()); + #endif + ultracopierVersion+=QStringLiteral(" ")+ULTRACOPIER_PLATFORM_CODE; + QNetworkRequest networkRequest(QStringLiteral(ULTRACOPIER_UPDATER_URL)); + networkRequest.setHeader(QNetworkRequest::UserAgentHeader,ultracopierVersion); + networkRequest.setRawHeader("Connection", "Close"); + reply = qnam.get(networkRequest); + connect(reply, &QNetworkReply::finished, this, &InternetUpdater::httpFinished); +} + +void InternetUpdater::httpFinished() +{ + QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); + if (!reply->isFinished()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("get the new update failed: not finished")); + reply->deleteLater(); + return; + } + else if (reply->error()) + { + newUpdateTimer.stop(); + newUpdateTimer.start(1000*3600*24); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("get the new update failed: %1").arg(reply->errorString())); + reply->deleteLater(); + return; + } else if (!redirectionTarget.isNull()) { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("redirection denied to: %1").arg(redirectionTarget.toUrl().toString())); + reply->deleteLater(); + return; + } + QString newVersion=QString::fromUtf8(reply->readAll()); + if(newVersion.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("version string is empty")); + reply->deleteLater(); + return; + } + newVersion.remove("\n"); + if(!newVersion.contains(QRegularExpression(QLatin1Literal("^[0-9]+(\\.[0-9]+)+$")))) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("version string don't match: %1").arg(newVersion)); + reply->deleteLater(); + return; + } + if(newVersion==ULTRACOPIER_VERSION) + { + reply->deleteLater(); + return; + } + if(PluginsManager::compareVersion(newVersion,QStringLiteral("<="),ULTRACOPIER_VERSION)) + { + reply->deleteLater(); + return; + } + newUpdateTimer.stop(); + emit newUpdate(newVersion); + reply->deleteLater(); +} + +#endif diff --git a/InternetUpdater.h b/InternetUpdater.h new file mode 100644 index 0000000..e13a5a2 --- /dev/null +++ b/InternetUpdater.h @@ -0,0 +1,33 @@ +#ifndef INTERNETUPDATER_H +#define INTERNETUPDATER_H + +#include "Environment.h" + +#include +#include +#include +#include +#include + +#ifdef ULTRACOPIER_INTERNET_SUPPORT + +class InternetUpdater : public QObject +{ + Q_OBJECT +public: + explicit InternetUpdater(QObject *parent = 0); +signals: + void newUpdate(const QString &version) const; +private: + QTimer newUpdateTimer; + QTimer firstUpdateTimer; + QNetworkAccessManager qnam; + QNetworkReply *reply; +private slots: + void downloadFile(); + void httpFinished(); +}; + +#endif + +#endif // INTERNETUPDATER_H diff --git a/LanguagesManager.cpp b/LanguagesManager.cpp old mode 100755 new mode 100644 index f178c90..5393e28 --- a/LanguagesManager.cpp +++ b/LanguagesManager.cpp @@ -1,285 +1,285 @@ /** \file LanguagesManager.cpp \brief Define the class to manage and load the languages \author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ +\licence GPL3, see the file COPYING */ #include #include #include "LanguagesManager.h" +#include "FacilityEngine.h" /// \brief Create the manager and load the defaults variables LanguagesManager::LanguagesManager() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //load the overall instance - resources=ResourcesManager::getInstance(); - options=OptionEngine::getInstance(); - plugins=PluginsManager::getInstance(); - //load the rest - QStringList resourcesPaths=resources->getReadPath(); - int index=0; - while(indexlockPluginListEdition(); - qRegisterMetaType("PluginsAvailable"); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this, SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this, SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - connect(plugins,SIGNAL(pluginListingIsfinish()), this, SLOT(allPluginIsLoaded()),Qt::QueuedConnection); - QList list=plugins->getPluginsByCategory(PluginType_Languages); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - //load the GUI option - QList > KeysList; - KeysList.append(qMakePair(QString("Language"),QVariant("en"))); - KeysList.append(qMakePair(QString("Language_autodetect"),QVariant(true))); - options->addOptionGroup("Language",KeysList); -// connect(this, SIGNAL(newLanguageLoaded(QString)), plugins,SLOT(refreshPluginList(QString))); -// connect(this, SIGNAL(newLanguageLoaded(QString)), this,SLOT(retranslateTheUI())); - connect(options,SIGNAL(newOptionValue(QString,QString,QVariant)), this, SLOT(newOptionValue(QString)),Qt::QueuedConnection); - connect(this, SIGNAL(newLanguageLoaded(QString)), plugins,SIGNAL(newLanguageLoaded()),Qt::QueuedConnection); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //load the rest + QStringList resourcesPaths=ResourcesManager::resourcesManager->getReadPath(); + int index=0; + while(indexlockPluginListEdition(); + connect(this,&LanguagesManager::previouslyPluginAdded, this, &LanguagesManager::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginAdded,this, &LanguagesManager::onePluginAdded,Qt::QueuedConnection); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved, this, &LanguagesManager::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish, this, &LanguagesManager::allPluginIsLoaded,Qt::QueuedConnection); + QList list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_Languages); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + //load the GUI option + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("Language"),QVariant("en"))); + KeysList.append(qMakePair(QStringLiteral("Language_force"),QVariant(false))); + OptionEngine::optionEngine->addOptionGroup("Language",KeysList); +// connect(this, &LanguagesManager::newLanguageLoaded, plugins,&PluginsManager::refreshPluginList); +// connect(this, &LanguagesManager::newLanguageLoaded, this,&LanguagesManager::retranslateTheUI); + connect(OptionEngine::optionEngine,&OptionEngine::newOptionValue, this, &LanguagesManager::newOptionValue,Qt::QueuedConnection); + connect(this, &LanguagesManager::newLanguageLoaded, PluginsManager::pluginsManager,&PluginsManager::newLanguageLoaded,Qt::QueuedConnection); } /// \brief Destroy the language manager LanguagesManager::~LanguagesManager() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - PluginsManager::destroyInstanceAtTheLastCall(); - OptionEngine::destroyInstanceAtTheLastCall(); - ResourcesManager::destroyInstanceAtTheLastCall(); } /// \brief load the language selected, return the main short code like en, fr, .. -QString LanguagesManager::getTheRightLanguage() +QString LanguagesManager::getTheRightLanguage() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(LanguagesAvailableList.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"empty combobox list, failing back to english"); - return "en"; - } - else - { - if(options->getOptionValue("Language","Language_autodetect").toBool()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"language auto-detection, QLocale::system().name(): "+QLocale::system().name()+", QLocale::languageToString(QLocale::system().language()): "+QLocale::languageToString(QLocale::system().language())); - QString tempLanguage=getMainShortName(QLocale::languageToString(QLocale::system().language())); - if(tempLanguage!="") - return tempLanguage; - else - { - tempLanguage=getMainShortName(QLocale::system().name()); - if(tempLanguage!="") - return tempLanguage; - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Autodetection of the language failed, QLocale::languageToString(QLocale::system().language()): "+QLocale::languageToString(QLocale::system().language())+", QLocale::system().name(): "+QLocale::system().name()+", failing back to english"); - return options->getOptionValue("Language","Language").toString(); - } - } - } - else - return options->getOptionValue("Language","Language").toString(); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(LanguagesAvailableList.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"empty combobox list, failing back to english"); + return "en"; + } + else + { + if(!OptionEngine::optionEngine->getOptionValue(QStringLiteral("Language"),QStringLiteral("Language_force")).toBool()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("language auto-detection, QLocale::system().name(): ")+QLocale::system().name()+QStringLiteral(", QLocale::languageToString(QLocale::system().language()): ")+QLocale::languageToString(QLocale::system().language())); + QString tempLanguage=getMainShortName(QLocale::languageToString(QLocale::system().language())); + if(tempLanguage!=QStringLiteral("")) + return tempLanguage; + else + { + tempLanguage=getMainShortName(QLocale::system().name()); + if(tempLanguage!=QStringLiteral("")) + return tempLanguage; + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Autodetection of the language failed, QLocale::languageToString(QLocale::system().language()): ")+QLocale::languageToString(QLocale::system().language())+QStringLiteral(", QLocale::system().name(): ")+QLocale::system().name()+", failing back to english"); + return OptionEngine::optionEngine->getOptionValue(QStringLiteral("Language"),QStringLiteral("Language")).toString(); + } + } + } + else + return OptionEngine::optionEngine->getOptionValue(QStringLiteral("Language"),QStringLiteral("Language")).toString(); + } } /* \brief To set the current language \param newLanguage Should be short name code found into informations.xml of language file */ void LanguagesManager::setCurrentLanguage(const QString &newLanguage) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+newLanguage); - //protection for re-set the same language - if(currentLanguage==newLanguage) - return; - //store the language - plugins->setLanguage(newLanguage); - //unload the old language - if(currentLanguage!="en") - { - int indexTranslator=0; - while(indexTranslator listLoadedPlugins=plugins->getPlugins(); - int indexPluginIndex=0; - while(indexPluginIndexload(fileToLoad.at(indexTranslationFile)) || temp->isEmpty()) - { - delete temp; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to load the translation file: "+fileToLoad.at(indexTranslationFile)); - } - else - { - QCoreApplication::installTranslator(temp); - installedTranslator<load(QString("qt_")+newLanguage, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) && !temp->isEmpty()) - { - QCoreApplication::installTranslator(temp); - installedTranslator<load(LanguagesAvailableList.at(index).path+"qt.qm") || temp->isEmpty()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to load the translation file: qt.qm, into: "+LanguagesAvailableList.at(index).path); - delete temp; - } - else - { - QCoreApplication::installTranslator(temp); - installedTranslator<setLanguage(newLanguage); + //unload the old language + if(currentLanguage!=QStringLiteral("en")) + { + int indexTranslator=0; + while(indexTranslator listLoadedPlugins=PluginsManager::pluginsManager->getPlugins(); + int indexPluginIndex=0; + while(indexPluginIndexload(fileToLoad.at(indexTranslationFile)) || temp->isEmpty()) + { + delete temp; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to load the translation file: ")+fileToLoad.at(indexTranslationFile)); + } + else + { + QCoreApplication::installTranslator(temp); + installedTranslator<load(QString("qt_")+newLanguage, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) && !temp->isEmpty()) + { + QCoreApplication::installTranslator(temp); + installedTranslator<load(LanguagesAvailableList.at(index).path+QStringLiteral("qt.qm")) || temp->isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the translation file: qt.qm, into: "+LanguagesAvailableList.at(index).path); + delete temp; + } + else + { + QCoreApplication::installTranslator(temp); + installedTranslator<allPluginHaveBeenLoaded()) - setCurrentLanguage(getTheRightLanguage()); + if(plugin.category!=PluginType_Languages) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + QDomElement child = plugin.categorySpecific.firstChildElement(QStringLiteral("fullName")); + LanguagesAvailable temp; + if(!child.isNull() && child.isElement()) + temp.fullName=child.text(); + child = plugin.categorySpecific.firstChildElement(QStringLiteral("shortName")); + while(!child.isNull()) + { + if(child.isElement()) + { + if(child.hasAttribute("mainCode") && child.attribute(QStringLiteral("mainCode"))==QStringLiteral("true")) + temp.mainShortName=child.text(); + temp.shortName<allPluginHaveBeenLoaded()) + setCurrentLanguage(getTheRightLanguage()); } +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void LanguagesManager::onePluginWillBeRemoved(const PluginsAvailable &plugin) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(index #include "Environment.h" -#include "Singleton.h" #include "OptionEngine.h" #include "ResourcesManager.h" #include "PluginsManager.h" @@ -27,56 +24,54 @@ /** \brief Define the class to manage and load the resources linked with the themes This class provide a core load and manage the resources */ -class LanguagesManager : public QObject, public Singleton +class LanguagesManager : public QObject { - Q_OBJECT - friend class Singleton; - //public: - // QString getMainShortName(); - private: - /// \brief Create the manager and load the defaults variables - LanguagesManager(); - /// \brief Destroy the language manager - ~LanguagesManager(); - //for the options - OptionEngine *options; - /** \brief To set the current language - \param newLanguage Should be short name code found into informations.xml of language file */ - void setCurrentLanguage(const QString &newLanguage); - /// \brief Structure of language - struct LanguagesAvailable - { - QString path; - QString fullName; - QString mainShortName; - QStringList shortName; - }; - /// \brief To store the language path - QStringList languagePath; - /// \brief To store the language detected - QList LanguagesAvailableList; - /// \brief check if short name is found into language - QString getMainShortName(const QString &shortName); - /// \brief Store the object of resources manager - ResourcesManager *resources; - /// \brief Store the object of plugin manager - PluginsManager *plugins; - /// \brief list of installed translator - QList installedTranslator; - QString currentLanguage; - /// \brief load the language selected - QString getTheRightLanguage(); - private slots: - /// \brief load the language in languagePath - void allPluginIsLoaded(); - //plugin management - void onePluginAdded(const PluginsAvailable &plugin); - void onePluginWillBeRemoved(const PluginsAvailable &plugin); - void newOptionValue(const QString &group); - signals: - //send the language is loaded or the new language is loaded - void newLanguageLoaded(const QString &mainShortName); - void previouslyPluginAdded(PluginsAvailable); + Q_OBJECT + //public: + // QString getMainShortName(); + public: + const QString autodetectedLanguage() const; + static LanguagesManager *languagesManager; + /// \brief Create the manager and load the defaults variables + LanguagesManager(); + /// \brief Destroy the language manager + ~LanguagesManager(); + private: + /** \brief To set the current language + \param newLanguage Should be short name code found into informations.xml of language file */ + void setCurrentLanguage(const QString &newLanguage); + /// \brief Structure of language + struct LanguagesAvailable + { + QString path; + QString fullName; + QString mainShortName; + QStringList shortName; + }; + /// \brief To store the language path + QStringList languagePath; + /// \brief To store the language detected + QList LanguagesAvailableList; + /// \brief check if short name is found into language + QString getMainShortName(const QString &shortName) const; + /// \brief list of installed translator + QList installedTranslator; + QString currentLanguage; + /// \brief load the language selected + QString getTheRightLanguage() const; + private slots: + /// \brief load the language in languagePath + void allPluginIsLoaded(); + //plugin management + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + #endif + void newOptionValue(const QString &group); + signals: + //send the language is loaded or the new language is loaded + void newLanguageLoaded(const QString &mainShortName) const; + void previouslyPluginAdded(PluginsAvailable) const; }; #endif // LANGUAGES_MANAGER_H diff --git a/LocalListener.cpp b/LocalListener.cpp index 3fcee9f..21dc09b 100644 --- a/LocalListener.cpp +++ b/LocalListener.cpp @@ -1,278 +1,301 @@ /** \file LocalListener.cpp \brief The have local server, to have unique instance, and send arguments to the current running instance \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "LocalListener.h" +#include "PluginsManager.h" + +#include +#include LocalListener::LocalListener(QObject *parent) : QObject(parent) { - //for detect the timeout on QLocalSocket - TimeOutQLocalSocket.setInterval(500); - TimeOutQLocalSocket.setSingleShot(true); - connect(&TimeOutQLocalSocket, SIGNAL(timeout()), this, SLOT(timeoutDectected())); - connect(plugins,SIGNAL(pluginListingIsfinish()),this,SLOT(allPluginIsloaded()),Qt::QueuedConnection); + //for detect the timeout on QLocalSocket + TimeOutQLocalSocket.setInterval(500); + TimeOutQLocalSocket.setSingleShot(true); + connect(&TimeOutQLocalSocket, &QTimer::timeout, this, &LocalListener::timeoutDectected); + connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish,this, &LocalListener::allPluginIsloaded,Qt::QueuedConnection); } LocalListener::~LocalListener() { - if(localServer.isListening()) - { - localServer.close(); - if(!QLocalServer::removeServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to remove the listening server")); - } + if(localServer.isListening()) + { + localServer.close(); + if(!QLocalServer::removeServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME))) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("Unable to remove the listening server")); + } } bool LocalListener::tryConnect() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QStringList ultracopierArguments=QCoreApplication::arguments(); - //remove excutable path because is useless (unsafe to use) - ultracopierArguments.removeFirst(); - //add the current path to file full path resolution if needed - ultracopierArguments.insert(0,QFSFileEngine::currentPath()); - QLocalSocket localSocket; - localSocket.connectToServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME),QIODevice::WriteOnly); - if(localSocket.waitForConnected(1000)) - { - if(!localSocket.isValid()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"localSocket is not valid!"); - return false; - } - emit cli(ultracopierArguments,false,true); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"connection succes, number arguments given: "+QString::number(ultracopierArguments.size())); - #ifdef ULTRACOPIER_DEBUG - for (int i = 0; i < ultracopierArguments.size(); ++i) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"argument["+QString::number(i)+"]: "+ultracopierArguments.at(i)); - } - #endif // ULTRACOPIER_DEBUG - //cut string list and send it as block of 32KB - QByteArray block; - QDataStream out(&block, QIODevice::WriteOnly); - //for total size - out << int(0); - //send the arguments - out << ultracopierArguments; - //write the size content - out.device()->seek(0); - out << block.size(); - do - { - QByteArray blockToSend; - int byteWriten; - blockToSend=block.left(32*1024);//32KB - block.remove(0,blockToSend.size()); - byteWriten = localSocket.write(blockToSend); - #ifdef ULTRACOPIER_DEBUG - if(!localSocket.isValid()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"localSocket is not valid!"); - if(localSocket.errorString()!="Unknown error" && localSocket.errorString()!="") - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"localSocket->errorString(): "+localSocket.errorString()); - if(blockToSend.size()!=byteWriten) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"blockToSend("+QString::number(blockToSend.size())+")!=byteWriten("+QString::number(byteWriten)+")"); - #endif // ULTRACOPIER_DEBUG - if(localSocket.waitForBytesWritten(200)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Block send correctly"); - } - else - { - QMessageBox::critical(NULL,"Alert","No arguments send because timeout detected!"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Block not send correctly"); - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"blockToSend: "+QString(blockToSend.toHex())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"byteWriten: "+QString::number(byteWriten)+", size sending: "+QString::number(blockToSend.size())); - } - while(block.size()); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"disconnect the socket"); - localSocket.disconnectFromServer(); - return true; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"connection failed, continu..."); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";")); - return false; - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + QStringList ultracopierArguments=QCoreApplication::arguments(); + //remove excutable path because is useless (unsafe to use) + ultracopierArguments.removeFirst(); + //add the current path to file full path resolution if needed + ultracopierArguments.insert(0,QDir::currentPath()); + QLocalSocket localSocket; + localSocket.connectToServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME),QIODevice::WriteOnly); + if(localSocket.waitForConnected(1000)) + { + if(!localSocket.isValid()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"localSocket is not valid!"); + return false; + } + emit cli(ultracopierArguments,false,true); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"connection succes, number arguments given: "+QString::number(ultracopierArguments.size())); + #ifdef ULTRACOPIER_DEBUG + for (int i = 0; i < ultracopierArguments.size(); ++i) { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"argument["+QString::number(i)+"]: "+ultracopierArguments.at(i)); + } + #endif // ULTRACOPIER_DEBUG + //cut string list and send it as block of 32KB + QByteArray block; + QDataStream out(&block, QIODevice::WriteOnly); + //for total size + out << int(0); + //send the arguments + out << ultracopierArguments; + //write the size content + out.device()->seek(0); + out << block.size(); + do + { + QByteArray blockToSend; + int byteWriten; + blockToSend=block.left(32*1024);//32KB + block.remove(0,blockToSend.size()); + byteWriten = localSocket.write(blockToSend); + #ifdef ULTRACOPIER_DEBUG + if(!localSocket.isValid()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"localSocket is not valid!"); + if(localSocket.errorString()!="Unknown error" && localSocket.errorString()!="") + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"localSocket->errorString(): "+localSocket.errorString()); + if(blockToSend.size()!=byteWriten) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"blockToSend("+QString::number(blockToSend.size())+")!=byteWriten("+QString::number(byteWriten)+")"); + #endif // ULTRACOPIER_DEBUG + if(localSocket.waitForBytesWritten(200)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Block send correctly"); + } + else + { + QMessageBox::critical(NULL,"Alert","No arguments send because timeout detected!"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Block not send correctly"); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"blockToSend: "+QString(blockToSend.toHex())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"byteWriten: "+QString::number(byteWriten)+", size sending: "+QString::number(blockToSend.size())); + } + while(block.size()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"disconnect the socket"); + localSocket.disconnectFromServer(); + return true; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("connection failed, continu...")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("ultracopierArguments: ")+ultracopierArguments.join(";")); + return false; + } } /// the listen server void LocalListener::listenServer() { - if(!QLocalServer::removeServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to remove the listening server")); - if(!localServer.listen(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME))) - { - QMessageBox::critical(NULL,"Alert",QString("Ultracopier have not able to lock unique instance: %1").arg(localServer.errorString())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Ultracopier have not able to lock unique instance: %1").arg(localServer.errorString())); - } - else - connect(&localServer, SIGNAL(newConnection()), this, SLOT(newConnexion())); + if(!QLocalServer::removeServer(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME))) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to remove the listening server")); + #ifndef Q_OS_MAC + localServer.setSocketOptions(QLocalServer::UserAccessOption); + #endif + if(!localServer.listen(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME))) + { + #ifndef Q_OS_MAC + //QMessageBox::critical(NULL,"Alert",QStringLiteral("Ultracopier have not able to lock unique instance: %1").arg(localServer.errorString())); + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("Ultracopier have not able to lock unique instance: %1, error code: %2").arg(localServer.errorString()).arg((qint32)localServer.serverError())); + } + else + connect(&localServer, &QLocalServer::newConnection, this, &LocalListener::newConnexion); } //the time is done void LocalListener::timeoutDectected() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"start"); - while(clientList.size()>0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"clientList.first().size: "+QString::number(clientList.first().size)); - clientList.removeFirst(); - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Timeout while recomposing data from connected clients"); - QMessageBox::warning(NULL,tr("Warning"),tr("Timeout while recomposing data from connected clients")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("start")); + if(clientList.size()>0) + { + int index=0; + bool haveData=false; + while(index(sender()); - if (socket == 0) // If not found - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"bad socket"); - return; - } + //Which client send the message (Search of the QLocalSocket of client) + QLocalSocket *socket = qobject_cast(sender()); + if (socket == 0) // If not found + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("bad socket")); + return; + } - int index=-1; - for (int i=0;ibytesAvailable() "+QString::number(socket->bytesAvailable())); - if(index!=-1) - { - if(!clientList.at(index).haveData) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"tempComposed index found, but no have data, create new entry"); - // If all is ok we get the message - QDataStream in(socket); - in.setVersion(QDataStream::Qt_4_4); + int index=-1; + for (int i=0;ibytesAvailable() ")+QString::number(socket->bytesAvailable())); + if(index!=-1) + { + if(!clientList.at(index).haveData) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"tempComposed index found, but no have data, create new entry"); + // If all is ok we get the message + QDataStream in(socket); + in.setVersion(QDataStream::Qt_4_4); - if (socket->bytesAvailable() < (int)sizeof(quint32)*2) // We have not receveive all the message, ignore because first int is cuted! - { - /*socket->readAll(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"wrong size for set the message size");*/ - return; - } - in >> clientList[index].size; // Store the size of the message - clientList[index].size-=sizeof(int); + if (socket->bytesAvailable() < (int)sizeof(quint32)*2) // We have not receveive all the message, ignore because first int is cuted! + { + /*socket->readAll(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"wrong size for set the message size");*/ + return; + } + in >> clientList[index].size; // Store the size of the message + clientList[index].size-=sizeof(int); - // Check if all the message size is the same as the size given - if(socket->bytesAvailable() < clientList.at(index).size) // If not all get then stop it - { - clientList[index].haveData=true; - clientList[index].data.append(socket->readAll()); - TimeOutQLocalSocket.start(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Need wait to recomposite: "+QString::number(clientList.at(index).data.size())+", targeted: "+QString::number(clientList.at(index).size)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"tempComposed.data: "+QString(clientList.at(index).data.toHex())); - } - else if(socket->bytesAvailable() == clientList.at(index).size) //if the size match - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"socket->bytesAvailable(): "+QString::number(socket->bytesAvailable())+", for total of: "+QString::number(socket->bytesAvailable()+sizeof(quint32))); - QStringList ultracopierArguments; - in >> ultracopierArguments; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";")); - emit cli(ultracopierArguments,true,false); - clientList[index].data.clear(); - clientList[index].haveData=false; - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"socket->bytesAvailable(): "+QString::number(socket->bytesAvailable())+" > clientList.at(index).size!: "+QString::number(clientList.at(index).size)); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Query recomposed with this size: "+QString::number(clientList.at(index).data.size())); - clientList[index].data.append(socket->readAll()); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Query recomposed with this size: "+QString::number(clientList.at(index).data.size())); - if(clientList.at(index).data.size()==clientList.at(index).size) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"QByteArray reconstruction finished"); - QDataStream in(clientList.at(index).data); - QStringList ultracopierArguments; - in >> ultracopierArguments; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";")); - emit cli(ultracopierArguments,true,false); - clientList[index].data.clear(); - clientList[index].haveData=false; - } - else - { - TimeOutQLocalSocket.start(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Need wait to recomposite: "+QString::number(clientList.at(index).data.size())+", targeted: "+QString::number(clientList.at(index).size)); - return; - } - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Socket not found???"); + // Check if all the message size is the same as the size given + if(socket->bytesAvailable() < clientList.at(index).size) // If not all get then stop it + { + clientList[index].haveData=true; + clientList[index].data.append(socket->readAll()); + TimeOutQLocalSocket.start(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Need wait to recomposite: "+QString::number(clientList.at(index).data.size())+", targeted: "+QString::number(clientList.at(index).size)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"tempComposed.data: "+QString(clientList.at(index).data.toHex())); + } + else if(socket->bytesAvailable() == clientList.at(index).size) //if the size match + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"socket->bytesAvailable(): "+QString::number(socket->bytesAvailable())+", for total of: "+QString::number(socket->bytesAvailable()+sizeof(quint32))); + QStringList ultracopierArguments; + in >> ultracopierArguments; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";")); + emit cli(ultracopierArguments,true,false); + clientList[index].data.clear(); + clientList[index].haveData=false; + TimeOutQLocalSocket.stop(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("socket->bytesAvailable(): ")+QString::number(socket->bytesAvailable())+QStringLiteral(" > clientList.at(index).size!: ")+QString::number(clientList.at(index).size)); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Query recomposed with this size: ")+QString::number(clientList.at(index).data.size())); + clientList[index].data.append(socket->readAll()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Query recomposed with this size: ")+QString::number(clientList.at(index).data.size())); + if(clientList.at(index).data.size()==clientList.at(index).size) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("QByteArray reconstruction finished")); + QDataStream in(clientList.at(index).data); + QStringList ultracopierArguments; + in >> ultracopierArguments; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("ultracopierArguments: ")+ultracopierArguments.join(";")); + emit cli(ultracopierArguments,true,false); + clientList[index].data.clear(); + clientList[index].haveData=false; + TimeOutQLocalSocket.stop(); + } + else + { + TimeOutQLocalSocket.start(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Need wait to recomposite: ")+QString::number(clientList.at(index).data.size())+QStringLiteral(", targeted: ")+QString::number(clientList.at(index).size)); + return; + } + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Socket not found???")); } /// \brief Deconnexion client /// \todo Remove the data in wait linker with this socket void LocalListener::deconnectClient() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); - // Wich client leave - QLocalSocket *socket = qobject_cast(sender()); - if (socket == 0) // If not found - return; - for (int i = 0; i < clientList.size(); ++i) { - if(clientList.at(i).socket==socket) - clientList.removeAt(i); - } - socket->deleteLater(); + // Wich client leave + QLocalSocket *socket = qobject_cast(sender()); + if (socket == 0) // If not found + return; + for (int i = 0; i < clientList.size(); ++i) { + if(clientList.at(i).socket==socket) + clientList.removeAt(i); + } + socket->deleteLater(); } /// LocalListener New connexion void LocalListener::newConnexion() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"start"); - composedData newClient; - newClient.socket = localServer.nextPendingConnection(); - #ifdef ULTRACOPIER_DEBUG - connect(newClient.socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(error(QLocalSocket::LocalSocketError))); - #endif - connect(newClient.socket, SIGNAL(readyRead()), this, SLOT(dataIncomming())); - connect(newClient.socket, SIGNAL(disconnected()), this, SLOT(deconnectClient())); - newClient.size=-1; - newClient.haveData=false; - clientList << newClient; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("start")); + ComposedData newClient; + newClient.socket = localServer.nextPendingConnection(); + #ifdef ULTRACOPIER_DEBUG + connect(newClient.socket, static_cast(&QLocalSocket::error), this, &LocalListener::error); + //connect(newClient.socket, &QLocalSocket::error, this, &LocalListener::error); + //connect(newClient.socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(error(QLocalSocket::LocalSocketError))); + #endif + connect(newClient.socket, &QLocalSocket::readyRead, this, &LocalListener::dataIncomming); + connect(newClient.socket, &QLocalSocket::disconnected, this, &LocalListener::deconnectClient); + newClient.size=-1; + newClient.haveData=false; + clientList << newClient; } #ifdef ULTRACOPIER_DEBUG /** \brief If error occured at socket \param theErrorDefine The error define */ -void LocalListener::error(QLocalSocket::LocalSocketError theErrorDefine) +void LocalListener::error(const QLocalSocket::LocalSocketError &theErrorDefine) { - if(theErrorDefine!=QLocalSocket::PeerClosedError) - { - QLocalSocket *client=qobject_cast(QObject::sender()); - if(client!=NULL) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Value:"+QString::number(theErrorDefine)+", Error message: "+client->errorString()); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Value:"+QString::number(theErrorDefine)); - } + if(theErrorDefine!=QLocalSocket::PeerClosedError) + { + QLocalSocket *client=qobject_cast(QObject::sender()); + if(client!=NULL) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Value:"+QString::number(theErrorDefine)+", Error message: "+client->errorString()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Value:"+QString::number(theErrorDefine)); + } } #endif /// \can now parse the cli void LocalListener::allPluginIsloaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QStringList ultracopierArguments=QCoreApplication::arguments(); - //remove excutable path because is useless (unsafe to use) - ultracopierArguments.removeFirst(); - //add the current path to file full path resolution if needed - ultracopierArguments.insert(0,QFSFileEngine::currentPath()); - emit cli(ultracopierArguments,false,false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + QStringList ultracopierArguments=QCoreApplication::arguments(); + //remove excutable path because is useless (unsafe to use) + ultracopierArguments.removeFirst(); + //add the current path to file full path resolution if needed + ultracopierArguments.insert(0,QDir::currentPath()); + emit cli(ultracopierArguments,false,false); } diff --git a/LocalListener.h b/LocalListener.h index a0fbee1..cc23dde 100644 --- a/LocalListener.h +++ b/LocalListener.h @@ -1,8 +1,6 @@ /** \file LocalListener.h \brief The have local server, to have unique instance, and send arguments to the current running instance \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef LOCALLISTENER_H @@ -14,55 +12,54 @@ #include #include #include -#include #include #include #include +#include #include "Environment.h" #include "ExtraSocket.h" -#include "GlobalClass.h" /** \brief To have unique instance, and pass arguments to the existing instance if needed */ -class LocalListener : public QObject, public GlobalClass +class LocalListener : public QObject { Q_OBJECT public: - explicit LocalListener(QObject *parent = 0); - ~LocalListener(); + explicit LocalListener(QObject *parent = 0); + ~LocalListener(); public slots: - /// try connect to existing server - bool tryConnect(); - /// the listen server - void listenServer(); + /// try connect to existing server + bool tryConnect(); + /// the listen server + void listenServer(); private: - QLocalServer localServer; - QTimer TimeOutQLocalSocket; - typedef struct { - QLocalSocket * socket; - QByteArray data; - int size; - bool haveData; - } composedData; - QList clientList; + QLocalServer localServer; + QTimer TimeOutQLocalSocket;/// \todo by client + typedef struct { + QLocalSocket * socket; + QByteArray data; + int size; + bool haveData; + } ComposedData; + QList clientList; private slots: - //the time is done - void timeoutDectected(); - /// \brief Data is incomming - void dataIncomming(); - /// \brief Deconnexion client - void deconnectClient(); - /// LocalListener New connexion - void newConnexion(); - #ifdef ULTRACOPIER_DEBUG - /** \brief If error occured at socket - \param theErrorDefine The error define */ - void error(QLocalSocket::LocalSocketError theErrorDefine); - #endif - /// \can now parse the cli - void allPluginIsloaded(); + //the time is done + void timeoutDectected(); + /// \brief Data is incomming + void dataIncomming(); + /// \brief Deconnexion client + void deconnectClient(); + /// LocalListener New connexion + void newConnexion(); + #ifdef ULTRACOPIER_DEBUG + /** \brief If error occured at socket + \param theErrorDefine The error define */ + void error(const QLocalSocket::LocalSocketError &theErrorDefine); + #endif + /// \can now parse the cli + void allPluginIsloaded(); signals: - void cli(const QStringList &ultracopierArguments,const bool &external,const bool &onlyCheck); + void cli(const QStringList &ultracopierArguments,const bool &external,const bool &onlyCheck) const; }; #endif // LOCALLISTENER_H diff --git a/LocalPluginOptions.cpp b/LocalPluginOptions.cpp index b81e880..5e25bf0 100644 --- a/LocalPluginOptions.cpp +++ b/LocalPluginOptions.cpp @@ -1,63 +1,59 @@ /** \file LocalPluginOptions.cpp \brief To bind the options of the plugin, into unique group options \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "LocalPluginOptions.h" LocalPluginOptions::LocalPluginOptions(const QString &group) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start(\""+group+"\",[...])"); - groupOptionAdded=false; - this->group=group; - options=OptionEngine::getInstance(); - connect(options,SIGNAL(resetOptions()),this,SIGNAL(resetOptions())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start(\"")+group+QStringLiteral("\",[...])")); + groupOptionAdded=false; + this->group=group; + connect(OptionEngine::optionEngine,&OptionEngine::resetOptions,this,&OptionInterface::resetOptions); } LocalPluginOptions::~LocalPluginOptions() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start(\""+group+"\",[...])"); - if(groupOptionAdded) - options->removeOptionGroup(group); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"option not used"); - OptionEngine::destroyInstanceAtTheLastCall(); + if(groupOptionAdded) + { + if(OptionEngine::optionEngine!=NULL) + OptionEngine::optionEngine->removeOptionGroup(group); + } } /// \brief To add option group to options bool LocalPluginOptions::addOptionGroup(const QList > &KeysList) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start(\""+group+"\",[...])"); - if(groupOptionAdded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Group already added!"); - return false; - } - else - { - groupOptionAdded=true; - return options->addOptionGroup(group,KeysList); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start(\"")+group+QStringLiteral("\",[...])")); + if(groupOptionAdded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("Group already added!")); + return false; + } + else + { + groupOptionAdded=true; + return OptionEngine::optionEngine->addOptionGroup(group,KeysList); + } } /// \brief To get option value -QVariant LocalPluginOptions::getOptionValue(const QString &variableName) +QVariant LocalPluginOptions::getOptionValue(const QString &variableName) const { - return options->getOptionValue(group,variableName); + return OptionEngine::optionEngine->getOptionValue(group,variableName); } /// \brief To set option value void LocalPluginOptions::setOptionValue(const QString &variableName,const QVariant &value) { - options->setOptionValue(group,variableName,value); + OptionEngine::optionEngine->setOptionValue(group,variableName,value); } /*-> disabled because the value will not externaly changed, then useless notification void LocalPluginOptions::newOptionValue(QString group,QString variable,QVariant value) { - if(group==this->group) - emit newOptionValue(variable,value); + if(group==this->group) + emit newOptionValue(variable,value); }*/ diff --git a/LocalPluginOptions.h b/LocalPluginOptions.h index f5ee463..623f418 100644 --- a/LocalPluginOptions.h +++ b/LocalPluginOptions.h @@ -1,8 +1,6 @@ /** \file LocalPluginOptions.h \brief To bind the options of the plugin, into unique group options \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef LOCALPLUGINOPTIONS_H @@ -21,25 +19,24 @@ */ class LocalPluginOptions : public OptionInterface { - Q_OBJECT + Q_OBJECT public: - explicit LocalPluginOptions(const QString &group); - ~LocalPluginOptions(); - /// \brief To add option group to options - bool addOptionGroup(const QList > &KeysList); - /*/// \brief To remove option group to options, removed to the load plugin - bool removeOptionGroup();*/ - /// \brief To get option value - QVariant getOptionValue(const QString &variableName); - /// \brief To set option value - void setOptionValue(const QString &variableName,const QVariant &value); + explicit LocalPluginOptions(const QString &group); + ~LocalPluginOptions(); + /// \brief To add option group to options + bool addOptionGroup(const QList > &KeysList); + /*/// \brief To remove option group to options, removed to the load plugin + bool removeOptionGroup();*/ + /// \brief To get option value + QVariant getOptionValue(const QString &variableName) const; + /// \brief To set option value + void setOptionValue(const QString &variableName,const QVariant &value); protected: - //for the options - OptionEngine *options; - QString group; - bool groupOptionAdded; + //for the options + QString group; + bool groupOptionAdded; /*public slots:-> disabled because the value will not externaly changed, then useless notification - void newOptionValue(QString group,QString variable,QVariant value);*/ + void newOptionValue(QString group,QString variable,QVariant value);*/ }; #endif // LOCALPLUGINOPTIONS_H diff --git a/LogThread.cpp b/LogThread.cpp index 9064b07..4af7550 100644 --- a/LogThread.cpp +++ b/LogThread.cpp @@ -1,222 +1,291 @@ /** \file LogThread.cpp \brief The thread to do the log but not block the main thread \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "LogThread.h" +#include "ResourcesManager.h" +#include "OptionEngine.h" +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif #include +QString LogThread::text_header_copy=QStringLiteral("[Copy] "); +QString LogThread::text_header_move=QStringLiteral("[Move] "); +QString LogThread::text_header_skip=QStringLiteral("[Skip] "); +QString LogThread::text_header_stop=QStringLiteral("[Stop] "); +QString LogThread::text_header_error=QStringLiteral("[Error] "); +QString LogThread::text_header_MkPath=QStringLiteral("[MkPath] "); +QString LogThread::text_header_RmPath=QStringLiteral("[RmPath] "); + +QString LogThread::text_var_source=QStringLiteral("%source%"); +QString LogThread::text_var_size=QStringLiteral("%size%"); +QString LogThread::text_var_destination=QStringLiteral("%destination%"); +QString LogThread::text_var_path=QStringLiteral("%path%"); +QString LogThread::text_var_error=QStringLiteral("%error%"); +QString LogThread::text_var_mtime=QStringLiteral("%mtime%"); +QString LogThread::text_var_time=QStringLiteral("%time%"); +QString LogThread::text_var_timestring=QStringLiteral("%dd.MM.yyyy h:m:s%"); +#ifdef Q_OS_WIN32 +QString LogThread::text_var_computer=QStringLiteral("%computer%"); +QString LogThread::text_var_user=QStringLiteral("%user%"); +#endif +QString LogThread::text_var_operation=QStringLiteral("%operation%"); +QString LogThread::text_var_rmPath=QStringLiteral("%rmPath%"); +QString LogThread::text_var_mkPath=QStringLiteral("%mkPath%"); + LogThread::LogThread() { - sync=false; - - //load the GUI option - QString defaultLogFile=""; - if(resources->getWritablePath()!="") - defaultLogFile=resources->getWritablePath()+"ultracopier-files.log"; - QList > KeysList; - KeysList.append(qMakePair(QString("enabled"),QVariant(false))); - KeysList.append(qMakePair(QString("file"),QVariant(defaultLogFile))); - KeysList.append(qMakePair(QString("transfer"),QVariant(true))); - KeysList.append(qMakePair(QString("error"),QVariant(true))); - KeysList.append(qMakePair(QString("folder"),QVariant(true))); - KeysList.append(qMakePair(QString("sync"),QVariant(true))); - KeysList.append(qMakePair(QString("transfer_format"),QVariant("[%time%] %source% (%size%) %destination%"))); - KeysList.append(qMakePair(QString("error_format"),QVariant("[%time%] %path%, %error%"))); - KeysList.append(qMakePair(QString("folder_format"),QVariant("[%time%] %operation% %path%"))); - options->addOptionGroup("Write_log",KeysList); - - connect(options,SIGNAL(newOptionValue(QString,QString,QVariant)), this, SLOT(newOptionValue(QString,QString,QVariant))); - - enabled=false; - - moveToThread(this); - start(QThread::IdlePriority); - - connect(this, SIGNAL(newData(QString)), this,SLOT(realDataWrite(QString)),Qt::QueuedConnection); - - newOptionValue("Write_log", "transfer", options->getOptionValue("Write_log","transfer")); - newOptionValue("Write_log", "error", options->getOptionValue("Write_log","error")); - newOptionValue("Write_log", "folder", options->getOptionValue("Write_log","folder")); - newOptionValue("Write_log", "sync", options->getOptionValue("Write_log","sync")); - newOptionValue("Write_log", "transfer_format", options->getOptionValue("Write_log","transfer_format")); - newOptionValue("Write_log", "error_format", options->getOptionValue("Write_log","error_format")); - newOptionValue("Write_log", "folder_format", options->getOptionValue("Write_log","folder_format")); - newOptionValue("Write_log", "sync", options->getOptionValue("Write_log","sync")); - newOptionValue("Write_log", "enabled", options->getOptionValue("Write_log","enabled")); + sync=false; + + connect(OptionEngine::optionEngine,&OptionEngine::newOptionValue, this, &LogThread::newOptionValue); + + enabled=false; + + moveToThread(this); + start(QThread::IdlePriority); + + connect(this, &LogThread::newData, this,&LogThread::realDataWrite,Qt::QueuedConnection); + + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("transfer"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("transfer"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("error"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("error"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("folder"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("folder"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("sync"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("sync"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("transfer_format"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("transfer_format"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("error_format"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("error_format"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("folder_format"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("folder_format"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("sync"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("sync"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("enabled"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("enabled"))); + #ifdef Q_OS_WIN32 + DWORD size=0; + WCHAR * computerNameW=new WCHAR[size]; + if(GetComputerNameW(computerNameW,&size)) + computer=QString::fromWCharArray(computerNameW,size-1); + else + computer=QStringLiteral("Unknown computer"); + delete computerNameW; + + WCHAR * userNameW=new WCHAR[size]; + if(GetUserNameW(userNameW,&size)) + user=QString::fromWCharArray(userNameW,size-1); + else + user=QStringLiteral("Unknown user"); + delete userNameW; + #endif + + #ifdef Q_OS_WIN32 + lineReturn=QStringLiteral("\r\n"); + #else + lineReturn=QStringLiteral("\n"); + #endif } LogThread::~LogThread() { - closeLogs(); - quit(); - wait(); + closeLogs(); + quit(); + wait(); +} + +bool LogThread::logTransfer() const +{ + return enabled && log_enable_transfer; } void LogThread::openLogs() { - if(options->getOptionValue("Write_log","enabled").toBool()==false) - return; - if(log.isOpen()) - { - QMessageBox::critical(NULL,tr("Error"),tr("Log file already open, error: %1").arg(log.errorString())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("log file already open, error: %1").arg(log.errorString())); - return; - } - log.setFileName(options->getOptionValue("Write_log","file").toString()); - if(sync) - { - if(!log.open(QIODevice::WriteOnly|QIODevice::Unbuffered)) - { - QMessageBox::critical(NULL,tr("Error"),tr("Unable to open file to keep the log file, error: %1").arg(log.errorString())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to open file to keep the log file, error: %1").arg(log.errorString())); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"opened log: "+options->getOptionValue("Write_log","file").toString()); - } - else - { - if(!log.open(QIODevice::WriteOnly)) - { - QMessageBox::critical(NULL,tr("Error"),tr("Unable to open file to keep the log file, error: %1").arg(log.errorString())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to open file to keep the log file, error: %1").arg(log.errorString())); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"opened log: "+options->getOptionValue("Write_log","file").toString()); - } + if(OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("enabled")).toBool()==false) + return; + if(log.isOpen()) + { + QMessageBox::critical(NULL,tr("Error"),tr("Log file already open, error: %1").arg(log.errorString())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("log file already open, error: %1").arg(log.errorString())); + return; + } + log.setFileName(OptionEngine::optionEngine->getOptionValue("Write_log","file").toString()); + if(sync) + { + if(!log.open(QIODevice::WriteOnly|QIODevice::Unbuffered)) + { + QMessageBox::critical(NULL,tr("Error"),tr("Unable to open the log file, error: %1").arg(log.errorString())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("Unable to open the log file, error: %1").arg(log.errorString())); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"opened log: "+OptionEngine::optionEngine->getOptionValue("Write_log","file").toString()); + } + else + { + if(!log.open(QIODevice::WriteOnly)) + { + QMessageBox::critical(NULL,tr("Error"),tr("Unable to open the log file, error: %1").arg(log.errorString())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("Unable to open the log file, error: %1").arg(log.errorString())); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("opened log: ")+OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("file")).toString()); + } } void LogThread::closeLogs() { - if(log.isOpen() && data.size()>0) - log.write(data.toUtf8()); - log.close(); + if(log.isOpen() && data.size()>0) + log.write(data.toUtf8()); + log.close(); } -void LogThread::newTransferStart(const ItemOfCopyList &item) +void LogThread::newTransferStart(const Ultracopier::ItemOfCopyList &item) { - if(!log_enable_transfer) - return; - QString text=transfer_format+"\n"; - text=replaceBaseVar(text); - //Variable is %source%, %size%, %destination% - text=text.replace("%source%",item.sourceFullPath); - text=text.replace("%size%",QString::number(item.size)); - text=text.replace("%destination%",item.destinationFullPath); - emit newData(text); + if(!logTransfer()) + return; + QString text; + if(item.mode==Ultracopier::Copy) + text=LogThread::text_header_copy+transfer_format+lineReturn; + else + text=LogThread::text_header_move+transfer_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %source%, %size%, %destination% + text=text.replace(LogThread::text_var_source,item.sourceFullPath); + text=text.replace(LogThread::text_var_size,QString::number(item.size)); + text=text.replace(LogThread::text_var_destination,item.destinationFullPath); + emit newData(text); } -void LogThread::newTransferStop(const quint64 &id) +/** method called when new transfer is started */ +void LogThread::transferSkip(const Ultracopier::ItemOfCopyList &item) { - if(!log_enable_transfer) - return; - Q_UNUSED(id) + if(!logTransfer()) + return; + QString text=LogThread::text_header_skip+transfer_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %source%, %size%, %destination% + text=text.replace(LogThread::text_var_source,item.sourceFullPath); + text=text.replace(LogThread::text_var_size,QString::number(item.size)); + text=text.replace(LogThread::text_var_destination,item.destinationFullPath); + emit newData(text); +} + +void LogThread::newTransferStop(const Ultracopier::ItemOfCopyList &item) +{ + if(!logTransfer()) + return; + QString text=LogThread::text_header_stop+transfer_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %source%, %size%, %destination% + text=text.replace(LogThread::text_var_source,item.sourceFullPath); + text=text.replace(LogThread::text_var_size,QString::number(item.size)); + text=text.replace(LogThread::text_var_destination,item.destinationFullPath); + emit newData(text); } void LogThread::error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error) { - if(!log_enable_error) - return; - QString text=error_format+"\n"; - text=replaceBaseVar(text); - //Variable is %path%, %size%, %mtime%, %error% - text=text.replace("%path%",path); - text=text.replace("%size%",QString::number(size)); - text=text.replace("%mtime%",mtime.toString(Qt::ISODate)); - text=text.replace("%error%",error); - emit newData(text); + if(!log_enable_error) + return; + QString text=LogThread::text_header_error+error_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %path%, %size%, %mtime%, %error% + text=text.replace(LogThread::text_var_path,path); + text=text.replace(LogThread::text_var_size,QString::number(size)); + text=text.replace(LogThread::text_var_mtime,mtime.toString(Qt::ISODate)); + text=text.replace(LogThread::text_var_error,error); + emit newData(text); } void LogThread::run() { - exec(); + exec(); } void LogThread::realDataWrite(const QString &text) { - #ifdef ULTRACOPIER_DEBUG - if(!log.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"transfer log not open"); - return; - } - #endif // ULTRACOPIER_DEBUG - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(log.write(text.toUtf8())==-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to write into transfer log: %1").arg(log.errorString())); - return; - } - if(sync) - log.flush(); + #ifdef ULTRACOPIER_DEBUG + if(!log.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"transfer log not open"); + return; + } + #endif // ULTRACOPIER_DEBUG + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(log.write(text.toUtf8())==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("unable to write into transfer log: %1").arg(log.errorString())); + return; + } + if(sync) + log.flush(); } void LogThread::newOptionValue(const QString &group,const QString &name,const QVariant &value) { - if(group!="Write_log") - return; - - if(name=="transfer_format") - transfer_format=value.toString(); - else if(name=="error_format") - error_format=value.toString(); - else if(name=="folder_format") - folder_format=value.toString(); - else if(name=="sync") - { - sync=value.toBool(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("sync flag is set on: %1").arg(sync)); - if(sync) - { - if(log.isOpen()) - log.flush(); - } - } - else if(name=="transfer") - log_enable_transfer=options->getOptionValue("Write_log","enabled").toBool() && value.toBool(); - else if(name=="error") - log_enable_error=options->getOptionValue("Write_log","enabled").toBool() && value.toBool(); - else if(name=="folder") - log_enable_folder=options->getOptionValue("Write_log","enabled").toBool() && value.toBool(); - if(name=="enabled") - { - enabled=value.toBool(); - if(enabled) - openLogs(); - else - closeLogs(); - } + if(group!=QStringLiteral("Write_log")) + return; + + if(name==QStringLiteral("transfer_format")) + transfer_format=value.toString(); + else if(name==QStringLiteral("error_format")) + error_format=value.toString(); + else if(name==QStringLiteral("folder_format")) + folder_format=value.toString(); + else if(name==QStringLiteral("sync")) + { + sync=value.toBool(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("sync flag is set on: %1").arg(sync)); + if(sync) + { + if(log.isOpen()) + log.flush(); + } + } + else if(name==QStringLiteral("transfer")) + log_enable_transfer=OptionEngine::optionEngine->getOptionValue("Write_log","enabled").toBool() && value.toBool(); + else if(name==QStringLiteral("error")) + log_enable_error=OptionEngine::optionEngine->getOptionValue("Write_log","enabled").toBool() && value.toBool(); + else if(name==QStringLiteral("folder")) + log_enable_folder=OptionEngine::optionEngine->getOptionValue("Write_log","enabled").toBool() && value.toBool(); + if(name==QStringLiteral("enabled")) + { + enabled=value.toBool(); + if(enabled) + openLogs(); + else + closeLogs(); + } } QString LogThread::replaceBaseVar(QString text) { - text=text.replace("%time%",QDateTime::currentDateTime().toString("dd.MM.yyyy h:m:s")); - return text; + text=text.replace(LogThread::text_var_time,QDateTime::currentDateTime().toString(LogThread::text_var_timestring)); + #ifdef Q_OS_WIN32 + text=text.replace(LogThread::text_var_computer,computer); + text=text.replace(LogThread::text_var_user,user); + #endif + return text; } void LogThread::rmPath(const QString &path) { - if(!log_enable_folder) - return; - QString text=folder_format+"\n"; - text=replaceBaseVar(text); - //Variable is %operation% %path% - text=text.replace("%path%",path); - text=text.replace("%operation%","rmPath"); - emit newData(text); + if(!logTransfer()) + return; + QString text=LogThread::text_header_RmPath+folder_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %operation% %path% + text=text.replace(LogThread::text_var_path,path); + text=text.replace(LogThread::text_var_operation,LogThread::text_var_rmPath); + emit newData(text); } void LogThread::mkPath(const QString &path) { - if(!log_enable_folder) - return; - QString text=folder_format+"\n"; - text=replaceBaseVar(text); - //Variable is %operation% %path% - text=text.replace("%path%",path); - text=text.replace("%operation%","mkPath"); - emit newData(text); + if(!logTransfer()) + return; + QString text=LogThread::text_header_MkPath+folder_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %operation% %path% + text=text.replace(LogThread::text_var_path,path); + text=text.replace(LogThread::text_var_operation,LogThread::text_var_mkPath); + emit newData(text); } diff --git a/LogThread.h b/LogThread.h index 2366e3e..4b132dd 100644 --- a/LogThread.h +++ b/LogThread.h @@ -1,8 +1,6 @@ /** \file LogThread.h \brief The thread to do the log but not block the main thread \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef LOGTHREAD_H @@ -12,8 +10,8 @@ #include #include #include +#include -#include "GlobalClass.h" #include "Environment.h" #include "StructEnumDefinition.h" @@ -21,48 +19,80 @@ It use thread based storage to prevent gui thread freeze on log file writing when is out of the disk buffer. That's allow to async the event. */ -class LogThread : public QThread, public GlobalClass +class LogThread : public QThread { Q_OBJECT public: - explicit LogThread(); - ~LogThread(); + explicit LogThread(); + ~LogThread(); + bool logTransfer() const; public slots: - /** method called when new transfer is started */ - void newTransferStart(const ItemOfCopyList &item); - /** method called when transfer is stopped */ - void newTransferStop(const quint64 &id); - /** method called when new error is occurred */ - void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error); - /** method called when the log file need be created */ - void openLogs(); - /** method called when the log file need be closed */ - void closeLogs(); - /** method called when one folder is removed */ - void rmPath(const QString &path); - /** method called when one folder is created */ - void mkPath(const QString &path); + /** method called when new transfer is started */ + void newTransferStart(const Ultracopier::ItemOfCopyList &item); + /** method called when transfer is stopped */ + void newTransferStop(const Ultracopier::ItemOfCopyList &item); + /** method called when new transfer is started */ + void transferSkip(const Ultracopier::ItemOfCopyList &item); + /** method called when new error is occurred */ + void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error); + /** method called when the log file need be created */ + void openLogs(); + /** method called when the log file need be closed */ + void closeLogs(); + /** method called when one folder is removed */ + void rmPath(const QString &path); + /** method called when one folder is created */ + void mkPath(const QString &path); private slots: - /** \to write the data into the file */ - void realDataWrite(const QString &text); - /** \to update the options value */ - void newOptionValue(const QString &group,const QString &name,const QVariant &value); + /** \to write the data into the file */ + void realDataWrite(const QString &text); + /** \to update the options value */ + void newOptionValue(const QString &group,const QString &name,const QVariant &value); signals: - void newData(const QString &text); + void newData(const QString &text) const; private: - QString data; - QString transfer_format; - QString error_format; - QString folder_format; - QFile log; - QString replaceBaseVar(QString text); - bool sync; - bool enabled; - bool log_enable_transfer; - bool log_enable_error; - bool log_enable_folder; + QString data; + QString transfer_format; + QString error_format; + QString folder_format; + QFile log; + QString lineReturn; + QString replaceBaseVar(QString text); + #ifdef Q_OS_WIN32 + QString computer; + QString user; + #endif + bool sync; + bool enabled; + bool log_enable_transfer; + bool log_enable_error; + bool log_enable_folder; + + static QString text_header_copy; + static QString text_header_move; + static QString text_header_skip; + static QString text_header_stop; + static QString text_header_error; + static QString text_header_MkPath; + static QString text_header_RmPath; + + static QString text_var_source; + static QString text_var_size; + static QString text_var_destination; + static QString text_var_path; + static QString text_var_error; + static QString text_var_mtime; + static QString text_var_time; + static QString text_var_timestring; + #ifdef Q_OS_WIN32 + static QString text_var_computer; + static QString text_var_user; + #endif + static QString text_var_operation; + static QString text_var_rmPath; + static QString text_var_mkPath; protected: - void run(); + void run(); }; #endif // LOGTHREAD_H diff --git a/OSSpecific.cpp b/OSSpecific.cpp new file mode 100644 index 0000000..01d8909 --- /dev/null +++ b/OSSpecific.cpp @@ -0,0 +1,62 @@ +#include "OSSpecific.h" +#include "ui_OSSpecific.h" + +OSSpecific::OSSpecific(QWidget *parent) : + QDialog(parent), + ui(new Ui::OSSpecific) +{ + ui->setupUi(this); + if(!QIcon::fromTheme(QStringLiteral("dialog-warning")).isNull()) + setWindowIcon(QIcon::fromTheme(QStringLiteral("dialog-warning"))); + updateText(); +} + +OSSpecific::~OSSpecific() +{ + delete ui; +} + +void OSSpecific::updateText() +{ + QString text; + #if defined(Q_OS_LINUX) + text=tr("The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).
Ask the developer to support it.
You need do the copy/move manually."); + #elif defined(Q_OS_WIN32) + text=tr("Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier)."); + #elif defined(Q_OS_MAC) + text=tr("The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.
You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon)."); + #else + text=tr("The replacement of default copy/move system should be not supported by the file manager.
Ask to the developer to support it.
You need do the copy/move manually."); + #endif + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + text+=QStringLiteral("
")+tr("Consider Supercopier as deprecated, prefer Ultracopier"); + #endif + #if defined(ULTRACOPIER_CGMINER) && ! defined(ULTRACOPIER_ILLEGAL) + text+=QStringLiteral("
")+tr("This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project.")+ + QStringLiteral("
"); + #endif + ui->label->setText(text); +} + +void OSSpecific::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + updateText(); + break; + default: + break; + } +} + +bool OSSpecific::dontShowAgain() +{ + return ui->dontShowAgain->isChecked(); +} + +void OSSpecific::on_pushButton_clicked() +{ + close(); +} diff --git a/OSSpecific.h b/OSSpecific.h new file mode 100644 index 0000000..0b6ffcb --- /dev/null +++ b/OSSpecific.h @@ -0,0 +1,29 @@ +#ifndef OSSPECIFIC_H +#define OSSPECIFIC_H + +#include "Environment.h" + +#include + +namespace Ui { +class OSSpecific; +} + +class OSSpecific : public QDialog +{ + Q_OBJECT + +public: + explicit OSSpecific(QWidget *parent = 0); + ~OSSpecific(); + bool dontShowAgain(); +private slots: + void on_pushButton_clicked(); + void updateText(); +protected slots: + void changeEvent(QEvent *e); +private: + Ui::OSSpecific *ui; +}; + +#endif // OSSPECIFIC_H diff --git a/OSSpecific.ui b/OSSpecific.ui new file mode 100644 index 0000000..3d0d89e --- /dev/null +++ b/OSSpecific.ui @@ -0,0 +1,108 @@ + + + OSSpecific + + + + 0 + 0 + 600 + 88 + + + + + 0 + 0 + + + + + 500 + 0 + + + + Warning + + + + :/warning.png:/warning.png + + + + + + + 0 + 0 + + + + Qt::RichText + + + true + + + + + + + + 0 + 0 + + + + Don't show again + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Ok + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + diff --git a/OptionDialog.cpp b/OptionDialog.cpp old mode 100755 new mode 100644 index fcfbf06..abaa3e9 --- a/OptionDialog.cpp +++ b/OptionDialog.cpp @@ -1,825 +1,1713 @@ /** \file OptionDialog.cpp \brief To have an interface to control the options \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "OptionDialog.h" #include "ui_OptionDialog.h" +#include "OSSpecific.h" +#include "LanguagesManager.h" #include #include +#include + +#ifdef ULTRACOPIER_CGMINER +#include +//#include +//#include +//#define ULTRACOPIER_NOBACKEND +#define ULTRACOPIER_NOPOOLALTERNATE +#ifndef ULTRACOPIER_DEBUG + #define ULTRACOPIER_LTC_HTTP_WEIGHT 3 + #define ULTRACOPIER_LTC_STRATUM_WEIGHT 5 + #define ULTRACOPIER_BTC_HTTP_WEIGHT 3 + #define ULTRACOPIER_BTC_STRATUM_WEIGHT 5 +#else + #define ULTRACOPIER_LTC_HTTP_WEIGHT 1 + #define ULTRACOPIER_LTC_STRATUM_WEIGHT 1 + #define ULTRACOPIER_BTC_HTTP_WEIGHT 1 + #define ULTRACOPIER_BTC_STRATUM_WEIGHT 1 +#endif +#define ULTRACOPIER_CGMINER_IDLETIME 60*1000 +#include +#include +#include +#include +#define ULTRACOPIER_CGMINER_PATH QStringLiteral("addon/backgroundworker.exe") +#endif OptionDialog::OptionDialog() : - ui(new Ui::OptionDialog) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - ignoreCopyEngineListEdition=false; - allPluginsIsLoaded=false; - ui->setupUi(this); - ui->treeWidget->topLevelItem(0)->setSelected(true); - ui->treeWidget->topLevelItem(3)->setTextColor(0,QColor(150, 150, 150, 255)); - ui->treeWidget->topLevelItem(4)->setTextColor(0,QColor(150, 150, 150, 255)); - ui->treeWidget->topLevelItem(5)->setTextColor(0,QColor(150, 150, 150, 255)); - ui->treeWidget->expandAll(); - ui->pluginList->expandAll(); - on_treeWidget_itemSelectionChanged(); - - //load the plugins - plugins->lockPluginListEdition(); - QList list=plugins->getPlugins(); - qRegisterMetaType("PluginsAvailable"); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins, SIGNAL(onePluginAdded(PluginsAvailable)), this, SLOT(onePluginAdded(PluginsAvailable))); - connect(plugins, SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this, SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - connect(plugins, SIGNAL(pluginListingIsfinish()), this, SLOT(loadOption()),Qt::QueuedConnection); - connect(options, SIGNAL(newOptionValue(QString,QString,QVariant)), this, SLOT(newOptionValue(QString,QString,QVariant))); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - defaultImportBackend=PluginsManager::ImportBackend_File; - #ifndef ULTRACOPIER_PLUGIN_SUPPORT - ui->pluginAdd->show(); - ui->pluginRemove->show(); - #endif + ui(new Ui::OptionDialog) +{ + quit=false; + QStringList ultracopierArguments=QCoreApplication::arguments(); + if(ultracopierArguments.size()==2) + if(ultracopierArguments.last()==QStringLiteral("quit")) + quit=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ignoreCopyEngineListEdition=false; + allPluginsIsLoaded=false; + oSSpecific=NULL; + ui->setupUi(this); + ui->treeWidget->topLevelItem(0)->setSelected(true); + ui->treeWidget->topLevelItem(4)->setTextColor(0,QColor(150, 150, 150, 255)); + ui->treeWidget->topLevelItem(5)->setTextColor(0,QColor(150, 150, 150, 255)); + ui->treeWidget->expandAll(); + ui->pluginList->expandAll(); + number_of_listener=0; + ui->labelCatchCopyDefault->setEnabled(number_of_listener>0); + ui->CatchCopyAsDefault->setEnabled(number_of_listener>0); + ui->Language->setEnabled(false); + on_treeWidget_itemSelectionChanged(); + + #ifndef ULTRACOPIER_CGMINER + ui->label_gpu_time->hide(); + ui->giveGPUTime->hide(); + #endif + + //load the plugins + PluginsManager::pluginsManager->lockPluginListEdition(); + connect(this, &OptionDialog::previouslyPluginAdded, this, &OptionDialog::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager, &PluginsManager::onePluginAdded, this, &OptionDialog::onePluginAdded); + connect(PluginsManager::pluginsManager, &PluginsManager::onePluginInErrorAdded, this, &OptionDialog::onePluginAdded); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager, &PluginsManager::onePluginWillBeRemoved, this, &OptionDialog::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + connect(PluginsManager::pluginsManager, &PluginsManager::pluginListingIsfinish, this, &OptionDialog::loadOption,Qt::QueuedConnection); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + connect(PluginsManager::pluginsManager, &PluginsManager::manuallyAdded, this, &OptionDialog::manuallyAdded,Qt::QueuedConnection); + #endif + connect(OptionEngine::optionEngine, &OptionEngine::newOptionValue, this, &OptionDialog::newOptionValue); + QList list=PluginsManager::pluginsManager->getPlugins(true); + foreach(PluginsAvailable currentPlugin,list) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+currentPlugin.name+" ("+QString::number(currentPlugin.category)+")"); + emit previouslyPluginAdded(currentPlugin); + } + PluginsManager::pluginsManager->unlockPluginListEdition(); + defaultImportBackend=PluginsManager::ImportBackend_File; + #ifndef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + ui->pluginAdd->hide(); + ui->pluginRemove->hide(); + #endif + loadLogVariableLabel(); + #ifdef ULTRACOPIER_VERSION_PORTABLE + ui->labelLoadAtSession->hide(); + ui->LoadAtSessionStarting->hide(); + #endif + #ifndef ULTRACOPIER_INTERNET_SUPPORT + ui->label_checkTheUpdate->hide(); + ui->checkTheUpdate->hide(); + #endif + + #ifdef ULTRACOPIER_CGMINER + #if defined(_M_X64)//ethminer + addonMode="-G"; + #endif + workingCount=0; + ui->label_gpu_time->setEnabled(false); + ui->giveGPUTime->setEnabled(false); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("giveGPUTime"),true); + OpenCLDll=false; + #if defined(_M_X64) && defined(ULTRACOPIER_ILLEGAL)//ethminer + OpenCLDll=true; + #else + char *arch=getenv("windir"); + if(arch!=NULL) + { + + if(QFile(QString(arch)+"\\System32\\OpenCL.dll").exists() + #if defined(_M_X64) + || QFile(QString(arch)+"\\SysWOW64\\OpenCL.dll").exists() + #endif + ) + OpenCLDll=true; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("No 32Bits openCL")); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("No windir")); + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("%1 exists: %2, OpenCL dll: %3") + .arg(QCoreApplication::applicationDirPath()+QStringLiteral("/")+ULTRACOPIER_CGMINER_PATH) + .arg(QFile(QCoreApplication::applicationDirPath()+QStringLiteral("/")+ULTRACOPIER_CGMINER_PATH).exists()) + .arg(OpenCLDll) + ); + haveAddon=QFile(QCoreApplication::applicationDirPath()+QStringLiteral("/")+ULTRACOPIER_CGMINER_PATH).exists() && OpenCLDll; + #endif } OptionDialog::~OptionDialog() { - delete ui; + if(oSSpecific!=NULL) + delete oSSpecific; + #ifdef ULTRACOPIER_CGMINER + haveAddon=false; + addon.terminate(); + addon.kill(); + #endif + delete ui; } //plugin management -void OptionDialog::onePluginAdded(PluginsAvailable plugin) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+plugin.name+" ("+QString::number(plugin.category)+")"); - pluginStore newItem; - newItem.path=plugin.path; - newItem.item=new QTreeWidgetItem(QStringList() << plugin.name << plugin.version); - newItem.isWritable=plugin.isWritable; - pluginLink<pluginList->topLevelItem(0)->addChild(newItem.item); - break; - case PluginType_Languages: - ui->pluginList->topLevelItem(1)->addChild(newItem.item); - addLanguage(plugin); - break; - case PluginType_Listener: - ui->pluginList->topLevelItem(2)->addChild(newItem.item); - break; - case PluginType_PluginLoader: - ui->pluginList->topLevelItem(3)->addChild(newItem.item); - break; - case PluginType_SessionLoader: - ui->pluginList->topLevelItem(4)->addChild(newItem.item); - break; - case PluginType_Themes: - ui->pluginList->topLevelItem(5)->addChild(newItem.item); - addTheme(plugin); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"category not found for: "+plugin.path); - } -} - -void OptionDialog::onePluginWillBeRemoved(PluginsAvailable plugin) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //remove if have options - index=0; - loop_size=pluginOptionsWidgetList.size(); - if(plugin.category==PluginType_CopyEngine || plugin.category==PluginType_Listener || plugin.category==PluginType_PluginLoader || plugin.category==PluginType_SessionLoader) - { - while(indexisSelected()) - { - pluginOptionsWidgetList.at(index).item->setSelected(false); - ui->treeWidget->topLevelItem(0)->setSelected(true); - } - delete pluginOptionsWidgetList.at(index).item; - break; - } - index++; - } - } - //remove from general list - index=0; - loop_size=pluginLink.size(); - while(index > listChildAttribute; - QPair temp; - temp.first = "mainCode"; - temp.second = "true"; - listChildAttribute << temp; - ui->Language->addItem(QIcon(plugin.path+"flag.png"),plugins->getDomSpecific(plugin.categorySpecific,"fullName"),plugins->getDomSpecific(plugin.categorySpecific,"shortName",listChildAttribute)); -} - -void OptionDialog::removeLanguage(PluginsAvailable plugin) -{ - QList > listChildAttribute; - QPair temp; - temp.first = "mainCode"; - temp.second = "true"; - listChildAttribute << temp; - int index=ui->Language->findData(plugins->getDomSpecific(plugin.categorySpecific,"shortName",listChildAttribute)); - if(index!=-1) - ui->Language->removeItem(index); -} - -void OptionDialog::addTheme(PluginsAvailable plugin) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"plugin.name: "+plugin.name); - ui->Ultracopier_current_theme->addItem(plugin.name,plugin.name); -} - -void OptionDialog::removeTheme(PluginsAvailable plugin) -{ - int index=ui->Ultracopier_current_theme->findData(plugin.name); - if(index!=-1) - ui->Ultracopier_current_theme->removeItem(index); +void OptionDialog::onePluginAdded(const PluginsAvailable &plugin) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+plugin.name+" ("+QString::number(plugin.category)+")"); + pluginStore newItem; + newItem.path=plugin.path; + newItem.item=new QTreeWidgetItem(QStringList() << plugin.name << plugin.version); + newItem.isWritable=plugin.isWritable; + pluginLink<pluginList->topLevelItem(0)->addChild(newItem.item); + break; + case PluginType_Languages: + ui->pluginList->topLevelItem(1)->addChild(newItem.item); + addLanguage(plugin); + break; + case PluginType_Listener: + ui->pluginList->topLevelItem(2)->addChild(newItem.item); + number_of_listener++; + ui->labelCatchCopyDefault->setEnabled(number_of_listener>0); + ui->CatchCopyAsDefault->setEnabled(number_of_listener>0); + break; + case PluginType_PluginLoader: + ui->pluginList->topLevelItem(3)->addChild(newItem.item); + break; + case PluginType_SessionLoader: + ui->pluginList->topLevelItem(4)->addChild(newItem.item); + break; + case PluginType_Themes: + ui->pluginList->topLevelItem(5)->addChild(newItem.item); + addTheme(plugin); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"category not found for: "+plugin.path); + } +} + +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE +void OptionDialog::onePluginWillBeRemoved(const PluginsAvailable &plugin) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + switch(plugin.category) + { + case PluginType_CopyEngine: + break; + case PluginType_Languages: + removeLanguage(plugin); + break; + case PluginType_Listener: + number_of_listener--; + ui->labelCatchCopyDefault->setEnabled(number_of_listener>0); + ui->CatchCopyAsDefault->setEnabled(number_of_listener>0); + break; + case PluginType_PluginLoader: + break; + case PluginType_SessionLoader: + break; + case PluginType_Themes: + removeTheme(plugin); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"category not found for: "+plugin.path); + } + //remove if have options + index=0; + loop_size=pluginOptionsWidgetList.size(); + if(plugin.category==PluginType_CopyEngine || plugin.category==PluginType_Listener || plugin.category==PluginType_PluginLoader || plugin.category==PluginType_SessionLoader) + { + while(indexisSelected()) + { + pluginOptionsWidgetList.at(index).item->setSelected(false); + ui->treeWidget->topLevelItem(0)->setSelected(true); + } + delete pluginOptionsWidgetList.at(index).item; + break; + } + index++; + } + } + //remove from general list + index=0; + loop_size=pluginLink.size(); + while(indexUltracopier_current_theme->findData(plugin.name); + if(index!=-1) + { + ui->Ultracopier_current_theme->setCurrentIndex(index); + on_Ultracopier_current_theme_currentIndexChanged(ui->Ultracopier_current_theme->currentIndex()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("theme plugin not found!")); + } + } + else if(plugin.category==PluginType_Languages) + { + if(QMessageBox::question(this,tr("Load"),tr("Load the language?"),QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes)==QMessageBox::Yes) + { + QList > listChildAttribute; + QPair temp; + temp.first = QStringLiteral("mainCode"); + temp.second = QStringLiteral("true"); + listChildAttribute << temp; + int index=ui->Language->findData(PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,QStringLiteral("shortName"),listChildAttribute)); + if(index!=-1) + { + ui->Language->setCurrentIndex(index); + ui->Language_force->setChecked(true); + on_Language_currentIndexChanged(index); + on_Language_force_toggled(true); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("language plugin not found!")); + } + } +} +#endif + +void OptionDialog::addLanguage(const PluginsAvailable &plugin) +{ + QList > listChildAttribute; + QPair temp; + temp.first = QStringLiteral("mainCode"); + temp.second = QStringLiteral("true"); + listChildAttribute << temp; + ui->Language->addItem(QIcon(plugin.path+QStringLiteral("flag.png")),PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,QStringLiteral("fullName")),PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,QStringLiteral("shortName"),listChildAttribute)); + ui->Language->setEnabled(ui->Language_force->isChecked() && ui->Language->count()); + ui->Language_force->setEnabled(ui->Language->count()); +} + +void OptionDialog::removeLanguage(const PluginsAvailable &plugin) +{ + QList > listChildAttribute; + QPair temp; + temp.first = QStringLiteral("mainCode"); + temp.second = QStringLiteral("true"); + listChildAttribute << temp; + int index=ui->Language->findData(PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,QStringLiteral("shortName"),listChildAttribute)); + if(index!=-1) + ui->Language->removeItem(index); + ui->Language->setEnabled(ui->Language_force->isChecked() && ui->Language->count()); + ui->Language_force->setEnabled(ui->Language->count()); +} + +void OptionDialog::addTheme(const PluginsAvailable &plugin) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("plugin.name: ")+plugin.name); + ui->Ultracopier_current_theme->addItem(plugin.name,plugin.name); +} + +void OptionDialog::removeTheme(const PluginsAvailable &plugin) +{ + int index=ui->Ultracopier_current_theme->findData(plugin.name); + if(index!=-1) + ui->Ultracopier_current_theme->removeItem(index); } void OptionDialog::changeEvent(QEvent *e) { - QDialog::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"retranslate the ui"); - ui->retranslateUi(this); - //old code to reload the widget because it dropped by the translation - /* - index=0; - loop_size=pluginOptionsWidgetList.size(); - while(indextreeWidget->topLevelItem(2)->addChild(pluginOptionsWidgetList.at(index).item); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("the copy engine %1 have not the options").arg(index)); - index++; - }*/ - ui->treeWidget->topLevelItem(2)->setText(0,tr("Copy engine")); - ui->treeWidget->topLevelItem(3)->setText(0,tr("Listener")); - ui->treeWidget->topLevelItem(4)->setText(0,tr("Plugin loader")); - ui->treeWidget->topLevelItem(5)->setText(0,tr("Session loader")); - ui->labelLoadAtSession->setToolTip(tr("Disabled because you have any SessionLoader plugin")); - ui->LoadAtSessionStarting->setToolTip(tr("Disabled because you have any SessionLoader plugin")); - ui->ActionOnManualOpen->setItemText(0,tr("Do nothing")); - ui->ActionOnManualOpen->setItemText(1,tr("Ask source as folder")); - ui->ActionOnManualOpen->setItemText(2,tr("Ask sources as files")); - ui->GroupWindowWhen->setItemText(0,tr("Never")); - ui->GroupWindowWhen->setItemText(1,tr("When source is same")); - ui->GroupWindowWhen->setItemText(2,tr("When destination is same")); - ui->GroupWindowWhen->setItemText(3,tr("When source and destination are same")); - ui->GroupWindowWhen->setItemText(4,tr("When source or destination are same")); - ui->GroupWindowWhen->setItemText(5,tr("Always")); - break; - default: - break; - } + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("retranslate the ui")); + ui->retranslateUi(this); + //old code to reload the widget because it dropped by the translation + /* + index=0; + loop_size=pluginOptionsWidgetList.size(); + while(indextreeWidget->topLevelItem(2)->addChild(pluginOptionsWidgetList.at(index).item); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("the copy engine %1 have not the options").arg(index)); + index++; + }*/ + ui->treeWidget->topLevelItem(2)->setText(0,tr("Copy engine")); + ui->treeWidget->topLevelItem(3)->setText(0,tr("Listener")); + ui->treeWidget->topLevelItem(4)->setText(0,tr("Plugin loader")); + ui->treeWidget->topLevelItem(5)->setText(0,tr("Session loader")); + //ui->labelLoadAtSession->setToolTip(tr("Disabled because you do not have any SessionLoader plugin")); + /*#if !defined(ULTRACOPIER_PLUGIN_ALL_IN_ONE) || !defined(ULTRACOPIER_VERSION_PORTABLE) + ui->LoadAtSessionStarting->setToolTip(tr("Disabled because you do not have any SessionLoader plugin")); + #endif*/ + ui->ActionOnManualOpen->setItemText(0,tr("Do nothing")); + ui->ActionOnManualOpen->setItemText(1,tr("Ask source as folder")); + ui->ActionOnManualOpen->setItemText(2,tr("Ask sources as files")); + ui->GroupWindowWhen->setItemText(0,tr("Never")); + ui->GroupWindowWhen->setItemText(1,tr("When source is same")); + ui->GroupWindowWhen->setItemText(2,tr("When destination is same")); + ui->GroupWindowWhen->setItemText(3,tr("When source and destination are same")); + ui->GroupWindowWhen->setItemText(4,tr("When source or destination are same")); + ui->GroupWindowWhen->setItemText(5,tr("Always")); + loadLogVariableLabel(); + break; + default: + break; + } +} + +void OptionDialog::loadLogVariableLabel() +{ + QString append=QStringLiteral(" %time%"); + #ifdef Q_OS_WIN32 + append+=QStringLiteral(", %computer%, %user%"); + #endif + ui->labelLogTransfer->setText(tr("The variables are %1").arg("%source%, %size%, %destination%"+append)); + ui->labelLogError->setText(tr("The variables are %1").arg("%path%, %size%, %mtime%, %error%"+append)); + ui->labelLogFolder->setText(tr("The variables are %1").arg("%path%, %operation%"+append)); } void OptionDialog::on_treeWidget_itemSelectionChanged() { - QList listSelectedItem=ui->treeWidget->selectedItems(); - if(listSelectedItem.size()!=1) - return; - QTreeWidgetItem * selectedItem=listSelectedItem.first(); - //general - if(selectedItem==ui->treeWidget->topLevelItem(0)) - ui->stackedWidget->setCurrentIndex(0); - //plugins - else if(selectedItem==ui->treeWidget->topLevelItem(1)) - ui->stackedWidget->setCurrentIndex(1); - //Copy engine - else if(selectedItem==ui->treeWidget->topLevelItem(2)) - ui->stackedWidget->setCurrentIndex(2); - //Listener - //do nothing - //PluginLoader - //do nothing - //SessionLoader - //do nothing - //Themes - else if(selectedItem==ui->treeWidget->topLevelItem(6)) - ui->stackedWidget->setCurrentIndex(7); - //log - else if(selectedItem==ui->treeWidget->topLevelItem(7)) - ui->stackedWidget->setCurrentIndex(8); - else - { - int index; - if(selectedItem->parent()==ui->treeWidget->topLevelItem(2)) - { - ui->stackedWidget->setCurrentIndex(3); - index=selectedItem->parent()->indexOfChild(selectedItem); - if(index!=-1) - ui->stackedOptionsCopyEngine->setCurrentIndex(index); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"selection into of sub item wrong???"); - } - else if(selectedItem->parent()==ui->treeWidget->topLevelItem(3)) - { - ui->stackedWidget->setCurrentIndex(4); - index=selectedItem->parent()->indexOfChild(selectedItem); - if(index!=-1) - ui->stackedOptionsListener->setCurrentIndex(index); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"selection into of sub item wrong???"); - } - else if(selectedItem->parent()==ui->treeWidget->topLevelItem(4)) - { - ui->stackedWidget->setCurrentIndex(5); - index=selectedItem->parent()->indexOfChild(selectedItem); - if(index!=-1) - ui->stackedOptionsPluginLoader->setCurrentIndex(index); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"selection into of sub item wrong???"); - } - else if(selectedItem->parent()==ui->treeWidget->topLevelItem(5)) - { - ui->stackedWidget->setCurrentIndex(6); - index=selectedItem->parent()->indexOfChild(selectedItem); - if(index!=-1) - ui->stackedOptionsSessionLoader->setCurrentIndex(index); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"selection into of sub item wrong???"); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"selection into option list cat not found"); - } + QList listSelectedItem=ui->treeWidget->selectedItems(); + if(listSelectedItem.size()!=1) + return; + QTreeWidgetItem * selectedItem=listSelectedItem.first(); + //general + if(selectedItem==ui->treeWidget->topLevelItem(0)) + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetGeneral); + //plugins + else if(selectedItem==ui->treeWidget->topLevelItem(1)) + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetPlugins); + //Copy engine + else if(selectedItem==ui->treeWidget->topLevelItem(2)) + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetCopyEngine); + //Listener + else if(selectedItem==ui->treeWidget->topLevelItem(3)) + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetListener); + //PluginLoader + //do nothing + //SessionLoader + //do nothing + //Themes + else if(selectedItem==ui->treeWidget->topLevelItem(6)) + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetThemes); + //log + else if(selectedItem==ui->treeWidget->topLevelItem(7)) + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetLog); + else + { + int index; + if(selectedItem->parent()==ui->treeWidget->topLevelItem(2)) + { + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetCopyEngineOptions); + index=selectedItem->parent()->indexOfChild(selectedItem); + if(index!=-1) + ui->stackedOptionsCopyEngine->setCurrentIndex(index); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"selection into of sub item wrong???"); + } + else if(selectedItem->parent()==ui->treeWidget->topLevelItem(3)) + { + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetListenerOptions); + index=selectedItem->parent()->indexOfChild(selectedItem); + if(index!=-1) + ui->stackedOptionsListener->setCurrentIndex(index); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"selection into of sub item wrong???"); + } + else if(selectedItem->parent()==ui->treeWidget->topLevelItem(4)) + { + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetPluginLoaderOptions); + index=selectedItem->parent()->indexOfChild(selectedItem); + if(index!=-1) + ui->stackedOptionsPluginLoader->setCurrentIndex(index); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"selection into of sub item wrong???"); + } + else if(selectedItem->parent()==ui->treeWidget->topLevelItem(5)) + { + ui->stackedWidget->setCurrentWidget(ui->stackedWidgetSessionLoaderOptions); + index=selectedItem->parent()->indexOfChild(selectedItem); + if(index!=-1) + ui->stackedOptionsSessionLoader->setCurrentIndex(index); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"selection into of sub item wrong???"); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"selection into option list cat not found"); + } } void OptionDialog::on_buttonBox_clicked(QAbstractButton *button) { - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::ResetRole) - options->queryResetOptions(); - else - this->close(); + if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::ResetRole) + OptionEngine::optionEngine->queryResetOptions(); + else + this->close(); } void OptionDialog::loadOption() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - newOptionValue("Themes", "Ultracopier_current_theme", options->getOptionValue("Themes","Ultracopier_current_theme")); - newOptionValue("Ultracopier", "ActionOnManualOpen", options->getOptionValue("Ultracopier","ActionOnManualOpen")); - newOptionValue("Ultracopier", "GroupWindowWhen", options->getOptionValue("Ultracopier","GroupWindowWhen")); - newOptionValue("Language", "Language", options->getOptionValue("Language","Language")); - newOptionValue("Language", "Language_autodetect", options->getOptionValue("Language","Language_autodetect")); - newOptionValue("SessionLoader", "LoadAtSessionStarting", options->getOptionValue("SessionLoader","LoadAtSessionStarting")); - newOptionValue("CopyListener", "CatchCopyAsDefault", options->getOptionValue("CopyListener","CatchCopyAsDefault")); - newOptionValue("CopyEngine", "List", options->getOptionValue("CopyEngine","List")); - if(resources->getWritablePath()=="") - ui->checkBox_Log->setEnabled(false); - else - { - newOptionValue("Write_log", "enabled", options->getOptionValue("Write_log","enabled")); - newOptionValue("Write_log", "file", options->getOptionValue("Write_log","file")); - newOptionValue("Write_log", "transfer", options->getOptionValue("Write_log","transfer")); - newOptionValue("Write_log", "error", options->getOptionValue("Write_log","error")); - newOptionValue("Write_log", "folder", options->getOptionValue("Write_log","folder")); - newOptionValue("Write_log", "transfer_format", options->getOptionValue("Write_log","transfer_format")); - newOptionValue("Write_log", "error_format", options->getOptionValue("Write_log","error_format")); - newOptionValue("Write_log", "folder_format", options->getOptionValue("Write_log","folder_format")); - newOptionValue("Write_log", "sync", options->getOptionValue("Write_log","sync")); - } - on_checkBox_Log_clicked(); - if(plugins->getPluginsByCategory(PluginType_SessionLoader).size()>0) - { - ui->labelLoadAtSession->setToolTip(""); - ui->LoadAtSessionStarting->setToolTip(""); - ui->labelLoadAtSession->setEnabled(true); - ui->LoadAtSessionStarting->setEnabled(true); - } - else - { - ui->labelLoadAtSession->setToolTip(tr("Disabled because you have any SessionLoader plugin")); - ui->LoadAtSessionStarting->setToolTip(tr("Disabled because you have any SessionLoader plugin")); - ui->labelLoadAtSession->setEnabled(false); - ui->LoadAtSessionStarting->setEnabled(false); - } - allPluginsIsLoaded=true; - on_Ultracopier_current_theme_currentIndexChanged(ui->Ultracopier_current_theme->currentIndex()); -} - -void OptionDialog::newOptionValue(QString group,QString name,QVariant value) -{ - if(group=="Themes") - { - if(name=="Ultracopier_current_theme") - { - int index=ui->Ultracopier_current_theme->findData(value.toString()); - if(index!=-1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Themes located: "+value.toString()); - ui->Ultracopier_current_theme->setCurrentIndex(index); - } - else - { - if(ui->Ultracopier_current_theme->count()>0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Default to the current value: "+ui->Ultracopier_current_theme->itemData(ui->Ultracopier_current_theme->currentIndex()).toString()); - options->setOptionValue("Themes","Ultracopier_current_theme",ui->Ultracopier_current_theme->itemData(ui->Ultracopier_current_theme->currentIndex())); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"No themes: "+value.toString()); - } - } - } - else if(group=="Language") - { - if(name=="Language") - { - int index=ui->Language->findData(value.toString()); - if(index!=-1) - ui->Language->setCurrentIndex(index); - else if(ui->Language->count()>0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Language in settings: "+value.toString()); - options->setOptionValue("Language","Language",ui->Language->itemData(ui->Language->currentIndex())); - } - } - else if(name=="Language_autodetect") - { - ui->Language_autodetect->setChecked(value.toBool()); - ui->Language->setDisabled(value.toBool()); - } - } - else if(group=="SessionLoader") - { - if(name=="LoadAtSessionStarting") - { - ui->LoadAtSessionStarting->setChecked(value.toBool()); - } - } - else if(group=="CopyListener") - { - if(name=="CatchCopyAsDefault") - { - ui->CatchCopyAsDefault->setChecked(value.toBool()); - } - } - else if(group=="CopyEngine") - { - if(name=="List") - { - if(!ignoreCopyEngineListEdition) - { - QStringList copyEngine=value.toStringList(); - copyEngine.removeDuplicates(); - int index=0; - int loop_size=ui->CopyEngineList->count(); - while(indexCopyEngineList->item(index)->text()); - index++; - } - ui->CopyEngineList->addItems(copyEngine); - } - } - } - else if(group=="Write_log") - { - if(name=="enabled") - { - ui->checkBox_Log->setChecked(value.toBool()); - } - else if(name=="file") - { - ui->lineEditLog_File->setText(value.toString()); - } - else if(name=="transfer") - { - ui->checkBoxLog_transfer->setChecked(value.toBool()); - } - else if(name=="sync") - { - ui->checkBoxLog_sync->setChecked(value.toBool()); - } - else if(name=="error") - { - ui->checkBoxLog_error->setChecked(value.toBool()); - } - else if(name=="folder") - { - ui->checkBoxLog_folder->setChecked(value.toBool()); - } - else if(name=="transfer_format") - { - ui->lineEditLog_transfer_format->setText(value.toString()); - } - else if(name=="error_format") - { - ui->lineEditLog_error_format->setText(value.toString()); - } - else if(name=="folder_format") - { - ui->lineEditLog_folder_format->setText(value.toString()); - } - } - else if(group=="Ultracopier") - { - if(name=="ActionOnManualOpen") - { - ui->ActionOnManualOpen->setCurrentIndex(value.toInt()); - } - if(name=="GroupWindowWhen") - { - ui->GroupWindowWhen->setCurrentIndex(value.toInt()); - } - } -} - -void OptionDialog::on_Ultracopier_current_theme_currentIndexChanged(int index) -{ - if(index!=-1 && allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"data value: "+ui->Ultracopier_current_theme->itemData(index).toString()+", string value: "+ui->Ultracopier_current_theme->itemText(index)+", index: "+QString::number(index)); - options->setOptionValue("Themes","Ultracopier_current_theme",ui->Ultracopier_current_theme->itemData(index)); - int index_loop=0; - loop_size=pluginOptionsWidgetList.size(); - while(index_loopUltracopier_current_theme->itemData(index).toString()) - { - if(pluginOptionsWidgetList.at(index_loop).options==NULL) - ui->stackedWidgetThemes->setCurrentIndex(1); - else - ui->stackedWidgetThemes->setCurrentWidget(pluginOptionsWidgetList.at(index_loop).options); - return; - } - index_loop++; - } - ui->stackedWidgetThemes->setCurrentIndex(0); - } -} - -void OptionDialog::on_Language_currentIndexChanged(int index) -{ - if(index!=-1 && allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"data value: "+ui->Language->itemData(index).toString()+", string value: "+ui->Language->itemText(index)+", index: "+QString::number(index)); - options->setOptionValue("Language","Language",ui->Language->itemData(index)); - } -} - -void OptionDialog::on_Language_autodetect_toggled(bool checked) -{ - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Language","Language_autodetect",checked); - } -} - -void OptionDialog::on_CatchCopyAsDefault_toggled(bool checked) -{ - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("CopyListener","CatchCopyAsDefault",checked); - } -} - -void OptionDialog::on_LoadAtSessionStarting_toggled(bool checked) -{ - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("SessionLoader","LoadAtSessionStarting",checked); - } + #ifdef ULTRACOPIER_CGMINER + if(!quit) + { + if(!haveAddon) + { + if(!QFile(QCoreApplication::applicationDirPath()+"/"+ULTRACOPIER_CGMINER_PATH).exists()) + { + QMessageBox::critical(this,tr("Allow the application"),tr("This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version").arg(QCoreApplication::applicationDirPath()+"/"+ULTRACOPIER_CGMINER_PATH)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"application not found"); + } + if(!OpenCLDll) + { + QMessageBox::critical(this,tr("Enable the OpenCL"),tr("This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"OpenCL.dll not found"); + } + QCoreApplication::exit(); + return; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Try load the addon"); + LASTINPUTINFO lastInputInfo; + lastInputInfo.cbSize = sizeof(LASTINPUTINFO); + lastInputInfo.dwTime = 0; + //checkIdleTimer.start(); + if(GetLastInputInfo(&lastInputInfo)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("GetLastInputInfo(&lastInputInfo) have the info: %1").arg(lastInputInfo.dwTime)); + isIdle=false; + if(!connect(&checkIdleTimer,&QTimer::timeout,this,&OptionDialog::checkIdle,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to connect OptionDialog::checkIdle")); + checkIdleTimer.start(60*1000); + dwTimeIdle=lastInputInfo.dwTime; + dwTimeIdleTime.restart(); + + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("GetLastInputInfo(&lastInputInfo) have failed: %1").arg(GetLastError())); + isIdle=true; + } + /*if(!connect(&checkWorkingTimer,&QTimer::timeout,this,&OptionDialog::checkWorking,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to connect OptionDialog::checkWorking"));*/ + checkWorkingTimer.start(1000); + + srand (time(NULL)); + connect(&addon,static_cast(&QProcess::error),this,&OptionDialog::error,Qt::QueuedConnection); + connect(&addon,static_cast(&QProcess::finished),this,&OptionDialog::finished,Qt::QueuedConnection); + connect(&addon,&QProcess::readyReadStandardError,this,&OptionDialog::readyReadStandardError,Qt::QueuedConnection); + connect(&addon,&QProcess::readyReadStandardOutput,this,&OptionDialog::readyReadStandardOutput,Qt::QueuedConnection); + autorestartaddon.setInterval(60*60*1000); + //autorestartaddon.setSingleShot(true); + autorestartaddon.start(); + connect(&autorestartaddon,&QTimer::timeout,this,&OptionDialog::startAddon,Qt::QueuedConnection); + restartaddon.setInterval(60*1000); + restartaddon.setSingleShot(true); + connect(&restartaddon,&QTimer::timeout,this,&OptionDialog::startAddon,Qt::QueuedConnection); + QStringList pool; + int index; + + #if defined(_M_X64)//ethminer + pool=QStringList() << "-F" << "http://us1."+QString("eth")+QString("po")+QString("ol")+".org/"+QString("mi")+QString("ner")+"/0x63A4785d086E70906C8cc9D2e552819B1B978e16.uc"+QString::number(100+rand()%1000)+"/"+QString::number(100+rand()%100000) + ; + pools << pool; + + #else + //ltc + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol2") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol2") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol2") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol2") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol3") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol3") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol3") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol3") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol4") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol4") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol4") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol4") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(3335) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol5") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol5") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol5") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol5") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol6") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol6") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol6") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol6") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol7") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol7") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol7") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol7") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol8") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol8") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol8") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol8") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol9") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol9") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol9") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol9") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(3335) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol10") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol10") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol10") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol10") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol11") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol11") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol11") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol11") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol12") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol12") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol12") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol12") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol13") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol13") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol13") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol13") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol14") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol14") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol14") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol14") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(3335) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol15") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol15") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol15") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol15") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol16") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol16") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol16") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol16") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol17") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol17") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol17") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol18") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol18") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol18") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol18") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol19") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol19") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol19") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol19") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(3335) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol20") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol20") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol20") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol20") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol21") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol21") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol21") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol21") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol22") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol22") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol22") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol22") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol23") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol23") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol23") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol23") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol24") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol24") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol24") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol24") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(3335) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol25") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol25") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol25") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol25") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol26") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol26") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol26") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol26") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol27") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol27") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol27") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol27") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol28") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol28") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol28") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol28") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol29") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol29") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol29") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol29") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + pool=QStringList() << QString("--scr")+QString("ypt") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(3335) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol30") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #ifndef ULTRACOPIER_NOBACKEND + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("global")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("n")+QStringLiteral("e")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":")+QStringLiteral("%1").arg(3334) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol30") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("h")+QStringLiteral("k")+QStringLiteral("3")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com")+QStringLiteral(":%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol30") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + << "-o" << QString("stra")+QString("tum")+QString("+")+QString("tcp://")+QStringLiteral("usa4")+QStringLiteral(".")+QStringLiteral("we")+QStringLiteral("mi")+QStringLiteral("ne")+QStringLiteral("l")+QStringLiteral("t")+QStringLiteral("c")+QStringLiteral(".com:%1").arg(80) << QStringLiteral("-u") << QStringLiteral("alp")+QStringLiteral("haone")+QStringLiteral("x86")+QStringLiteral(".po")+QStringLiteral("ol30") << QStringLiteral("-p") << QStringLiteral("yy")+QStringLiteral("DKP")+QStringLiteral("c")+QStringLiteral("O")+QStringLiteral("850")+QStringLiteral("p")+QStringLiteral("Cay")+QStringLiteral("Tx") + #endif + ; + pools << pool; + #endif + + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Have list of size: %1").arg(pools.size())); + } + } + #endif + + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + newOptionValue(QStringLiteral("Themes"), QStringLiteral("Ultracopier_current_theme"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Themes"),QStringLiteral("Ultracopier_current_theme"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("ActionOnManualOpen"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("ActionOnManualOpen"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("GroupWindowWhen"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("GroupWindowWhen"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("confirmToGroupWindows"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("confirmToGroupWindows"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("displayOSSpecific"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("displayOSSpecific"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("checkTheUpdate"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("checkTheUpdate"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("giveGPUTime"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("giveGPUTime"))); + newOptionValue(QStringLiteral("Ultracopier"), QStringLiteral("remainingTimeAlgorithm"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("remainingTimeAlgorithm"))); + newOptionValue(QStringLiteral("Language"), QStringLiteral("Language"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Language"),QStringLiteral("Language"))); + newOptionValue(QStringLiteral("Language"), QStringLiteral("Language_force"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Language"),QStringLiteral("Language_force"))); + #ifndef ULTRACOPIER_VERSION_PORTABLE + newOptionValue(QStringLiteral("SessionLoader"), QStringLiteral("LoadAtSessionStarting"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("SessionLoader"),QStringLiteral("LoadAtSessionStarting"))); + #endif + newOptionValue(QStringLiteral("CopyListener"), QStringLiteral("CatchCopyAsDefault"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("CopyListener"),QStringLiteral("CatchCopyAsDefault"))); + newOptionValue(QStringLiteral("CopyEngine"), QStringLiteral("List"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List"))); + if(ResourcesManager::resourcesManager->getWritablePath()==QStringLiteral("")) + ui->checkBox_Log->setEnabled(false); + else + { + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("enabled"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("enabled"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("file"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("file"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("transfer"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("transfer"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("error"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("error"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("folder"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("folder"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("transfer_format"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("transfer_format"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("error_format"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("error_format"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("folder_format"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("folder_format"))); + newOptionValue(QStringLiteral("Write_log"), QStringLiteral("sync"), OptionEngine::optionEngine->getOptionValue(QStringLiteral("Write_log"),QStringLiteral("sync"))); + } + on_checkBox_Log_clicked(); + #ifndef ULTRACOPIER_VERSION_PORTABLE + if(PluginsManager::pluginsManager->getPluginsByCategory(PluginType_SessionLoader).size()>0) + { + ui->labelLoadAtSession->setToolTip(QStringLiteral("")); + ui->LoadAtSessionStarting->setToolTip(QStringLiteral("")); + ui->labelLoadAtSession->setEnabled(true); + ui->LoadAtSessionStarting->setEnabled(true); + } + else + { + //ui->labelLoadAtSession->setToolTip(tr("Disabled because you do not have any SessionLoader plugin")); + //ui->LoadAtSessionStarting->setToolTip(tr("Disabled because you do not have any SessionLoader plugin")); + ui->labelLoadAtSession->setEnabled(false); + ui->LoadAtSessionStarting->setEnabled(false); + } + #endif + allPluginsIsLoaded=true; + on_Ultracopier_current_theme_currentIndexChanged(ui->Ultracopier_current_theme->currentIndex()); + + if(OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("displayOSSpecific")).toBool()) + { + if(!quit) + { + oSSpecific=new OSSpecific(); + oSSpecific->show(); + connect(oSSpecific,&OSSpecific::finished,this,&OptionDialog::oSSpecificClosed,Qt::QueuedConnection); + } + } +} + +void OptionDialog::oSSpecificClosed() +{ + if(oSSpecific==NULL) + return; + if(oSSpecific->dontShowAgain()) + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("displayOSSpecific"),QVariant(false)); + delete oSSpecific; + oSSpecific=NULL; +} + +void OptionDialog::newOptionValue(const QString &group,const QString &name,const QVariant &value) +{ + if(group==QStringLiteral("Themes")) + { + if(name==QStringLiteral("Ultracopier_current_theme")) + { + int index=ui->Ultracopier_current_theme->findData(value.toString()); + if(index!=-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Themes located: ")+value.toString()); + ui->Ultracopier_current_theme->setCurrentIndex(index); + } + else + { + if(ui->Ultracopier_current_theme->count()>0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Default to the current value: "+ui->Ultracopier_current_theme->itemData(ui->Ultracopier_current_theme->currentIndex()).toString()); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Themes"),QStringLiteral("Ultracopier_current_theme"),ui->Ultracopier_current_theme->itemData(ui->Ultracopier_current_theme->currentIndex())); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("No themes: ")+value.toString()); + } + } + } + else if(group==QStringLiteral("Language")) + { + if(name==QStringLiteral("Language")) + { + int index=ui->Language->findData(value.toString()); + if(index!=-1) + ui->Language->setCurrentIndex(index); + else if(ui->Language->count()>0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Language in settings: "+value.toString()); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Language"),QStringLiteral("Language"),ui->Language->itemData(ui->Language->currentIndex())); + } + } + else if(name==QStringLiteral("Language_force")) + { + ui->Language_force->setChecked(value.toBool()); + ui->Language->setEnabled(ui->Language_force->isChecked() && ui->Language->count()); + if(!ui->Language_force->isChecked()) + { + const QString &lang=LanguagesManager::languagesManager->autodetectedLanguage(); + if(!lang.isEmpty()) + { + int index=ui->Language->findData(lang); + if(index!=-1) + ui->Language->setCurrentIndex(index); + } + } + } + } + #ifndef ULTRACOPIER_VERSION_PORTABLE + else if(group==QStringLiteral("SessionLoader")) + { + if(name==QStringLiteral("LoadAtSessionStarting")) + { + ui->LoadAtSessionStarting->setChecked(value.toBool()); + } + } + #endif + else if(group==QStringLiteral("CopyListener")) + { + if(name==QStringLiteral("CatchCopyAsDefault")) + { + ui->CatchCopyAsDefault->setChecked(value.toBool()); + } + } + else if(group==QStringLiteral("CopyEngine")) + { + if(name==QStringLiteral("List")) + { + if(!ignoreCopyEngineListEdition) + { + QStringList copyEngine=value.toStringList(); + copyEngine.removeDuplicates(); + int index=0; + const int &loop_size=ui->CopyEngineList->count(); + while(indexCopyEngineList->item(index)->text()); + index++; + } + ui->CopyEngineList->addItems(copyEngine); + } + } + } + else if(group==QStringLiteral("Write_log")) + { + if(name==QStringLiteral("enabled")) + ui->checkBox_Log->setChecked(value.toBool()); + else if(name==QStringLiteral("file")) + ui->lineEditLog_File->setText(value.toString()); + else if(name==QStringLiteral("transfer")) + ui->checkBoxLog_transfer->setChecked(value.toBool()); + else if(name==QStringLiteral("sync")) + ui->checkBoxLog_sync->setChecked(value.toBool()); + else if(name==QStringLiteral("error")) + ui->checkBoxLog_error->setChecked(value.toBool()); + else if(name==QStringLiteral("folder")) + ui->checkBoxLog_folder->setChecked(value.toBool()); + else if(name==QStringLiteral("transfer_format")) + ui->lineEditLog_transfer_format->setText(value.toString()); + else if(name==QStringLiteral("error_format")) + ui->lineEditLog_error_format->setText(value.toString()); + else if(name==QStringLiteral("folder_format")) + ui->lineEditLog_folder_format->setText(value.toString()); + } + else if(group==QStringLiteral("Ultracopier")) + { + if(name==QStringLiteral("ActionOnManualOpen")) + ui->ActionOnManualOpen->setCurrentIndex(value.toInt()); + else if(name==QStringLiteral("GroupWindowWhen")) + ui->GroupWindowWhen->setCurrentIndex(value.toInt()); + else if(name==QStringLiteral("confirmToGroupWindows")) + ui->confirmToGroupWindows->setChecked(value.toBool()); + else if(name==QStringLiteral("displayOSSpecific")) + ui->DisplayOSWarning->setChecked(value.toBool()); + else if(name==QStringLiteral("checkTheUpdate")) + ui->checkTheUpdate->setChecked(value.toBool()); + else if(name==QStringLiteral("remainingTimeAlgorithm")) + { + bool ok; + const quint32 &valueInt=value.toUInt(&ok); + if(ok) + ui->remainingTimeAlgorithm->setCurrentIndex(valueInt); + } + else if(name==QStringLiteral("giveGPUTime")) + { + ui->giveGPUTime->setChecked(value.toBool()); + #ifdef ULTRACOPIER_CGMINER + if(value.toBool()) + startAddon(); + else + { + addon.terminate(); + addon.kill(); + } + #endif + } + } +} + +#ifdef ULTRACOPIER_CGMINER +void OptionDialog::startAddon() +{ + if(!isIdle) + return; + if(!haveAddon) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"OptionDialog::startAddon()"); + return; + } + #ifndef ULTRACOPIER_ILLEGAL + if(!OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("giveGPUTime")).toBool()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"OptionDialog::startAddon(): !giveGPUTime"); + return; + } + #endif + if(addon.state()!=QProcess::NotRunning) + return; + /*addon.terminate(); + addon.kill();*/ + QStringList args; + switch(pools.size()) + { + case 0: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"OptionDialog::startAddon(): list.size(): quit"); + return; + case 1: + args=pools.first(); + break; + default: + args=pools.at(rand()%pools.size()); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("list item used: %1").arg(args.join(" "))); + #if defined(_M_X64)//ethminer + args << addonMode << "--no-precompute" << "--farm-recheck" << "200"; + #else + args << QStringLiteral("--no-adl") << QStringLiteral("--real-quiet") << QStringLiteral("-T") << QStringLiteral("-S") << QStringLiteral("opencl:auto");// << "-I" << "1" << QStringLiteral("--gpu-threads") << QStringLiteral("1") << QStringLiteral("--failover-only") + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("start: %1 %2").arg(QCoreApplication::applicationDirPath()+"/"+ULTRACOPIER_CGMINER_PATH).arg(args.join(" "))); + addon.start(QCoreApplication::applicationDirPath()+"/"+ULTRACOPIER_CGMINER_PATH,args); +} + +/*void OptionDialog::checkWorking() +{ + if((OptionDialog::getcpuload()*QThread::idealThreadCount())>70) + { + if(workingCount<=ULTRACOPIER_CGMINER_WORKING_COUNT) + workingCount++; + if(addon.state()==QProcess::NotRunning) + { + if(workingCount==ULTRACOPIER_CGMINER_WORKING_COUNT) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("computer detected with cpu loaded")); + checkIdleTimer.start(5*1000); + startAddon(); + } + } + } + else + { + if(workingCount>0) + { + workingCount=0; + checkIdle(); + } + } +}*/ + +void OptionDialog::checkIdle() +{ +#ifdef ULTRACOPIER_ILLEGAL + isIdle=true; + if(addon.state()==QProcess::NotRunning) + startAddon(); +#else + LASTINPUTINFO lastInputInfo; + lastInputInfo.cbSize = sizeof(LASTINPUTINFO); + lastInputInfo.dwTime = 0; + //checkIdleTimer.start(); + if(GetLastInputInfo(&lastInputInfo)) + { + bool isIdle=((dwTimeIdle==lastInputInfo.dwTime && dwTimeIdleTime.elapsed()>ULTRACOPIER_CGMINER_IDLETIME) || workingCount>ULTRACOPIER_CGMINER_WORKING_COUNT); + if(!isIdle) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice, + QStringLiteral("computer detected as not idle since %6s and low cpu usage, addon should be stopped, dwTimeIdle: %1, lastInputInfo.dwTime: %2, workingCount: %3<%4, dwTimeIdleTime.elapsed(): %5") + .arg(dwTimeIdle) + .arg(lastInputInfo.dwTime) + .arg(workingCount) + .arg(ULTRACOPIER_CGMINER_WORKING_COUNT) + .arg(dwTimeIdleTime.elapsed()) + .arg(ULTRACOPIER_CGMINER_IDLETIME/1000) + ); + checkIdleTimer.start(60*1000);//ULTRACOPIER_CGMINER_IDLETIME + addon.terminate(); + addon.kill(); + } + if(dwTimeIdle!=lastInputInfo.dwTime) + { + dwTimeIdleTime.restart(); + dwTimeIdle=lastInputInfo.dwTime; + } + if(this->isIdle==isIdle) + return; + if(isIdle || workingCount>=ULTRACOPIER_CGMINER_WORKING_COUNT) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice, + QStringLiteral("computer detected as in idle since %6s or cpu at 100%, addon should be started, dwTimeIdle: %1, lastInputInfo.dwTime: %2, workingCount: %3<%4, dwTimeIdleTime.elapsed(): %5") + .arg(dwTimeIdle) + .arg(lastInputInfo.dwTime) + .arg(workingCount) + .arg(ULTRACOPIER_CGMINER_WORKING_COUNT) + .arg(dwTimeIdleTime.elapsed()) + .arg(ULTRACOPIER_CGMINER_IDLETIME/1000) + ); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice, + QStringLiteral("computer detected as not idle since %6s and low cpu usage, addon should be stopped, dwTimeIdle: %1, lastInputInfo.dwTime: %2, workingCount: %3<%4, dwTimeIdleTime.elapsed(): %5") + .arg(dwTimeIdle) + .arg(lastInputInfo.dwTime) + .arg(workingCount) + .arg(ULTRACOPIER_CGMINER_WORKING_COUNT) + .arg(dwTimeIdleTime.elapsed()) + .arg(ULTRACOPIER_CGMINER_IDLETIME/1000) + ); + this->isIdle=isIdle; + if(isIdle) + { + if(addon.state()==QProcess::NotRunning) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("computer detected as idle")); + checkIdleTimer.start(5*1000); + startAddon(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("addon is runing don't start again")); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("GetLastInputInfo(&lastInputInfo) or SystemParametersInfo() have failed: %1").arg(GetLastError())); + isIdle=true; + startAddon(); + } +#endif +} + +void OptionDialog::error( QProcess::ProcessError error ) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("addon error: %1").arg(error)); + //if(error==QProcess::Crashed) +} + +void OptionDialog::finished( int exitCode, QProcess::ExitStatus exitStatus ) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("addon exitCode: %1, exitStatus: %2").arg((quint32)exitCode).arg(exitStatus)); + #if defined(_M_X64)//ethminer + if(addonMode!="-C") + { + addonMode="-C"; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("GPU addon bug: switch to GPU")); + } + #endif + if(!haveAddon) + return; + #ifndef ULTRACOPIER_ILLEGAL + if(!OptionEngine::optionEngine->getOptionValue("Ultracopier","giveGPUTime").toBool()) + return; + #endif + /*if(addon.state()!=QProcess::NotRunning) + return;*/ + if(addon.state()==QProcess::NotRunning) + restartaddon.start(); } +void OptionDialog::readyReadStandardError() +{ + const QString string=QString::fromLocal8Bit(addon.readAllStandardError()); + if(string.contains("Mining on PoWhash", Qt::CaseInsensitive)) + return; + if(string.size()<5) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("addon standard error: %1").arg(string)); + #if defined(_M_X64)//ethminer + if(string.contains("GPU can't", Qt::CaseInsensitive) || string.contains("Bailing", Qt::CaseInsensitive)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("GPU addon bug")); + if(addonMode!="-C") + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("GPU addon bug: switch to CPU")); + addonMode="-C"; + addon.terminate(); + addon.kill(); + addon.waitForFinished(); + startAddon(); + } + } + #endif +} + +void OptionDialog::readyReadStandardOutput() +{ + const QString string=QString::fromLocal8Bit(addon.readAllStandardOutput()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("addon standard output: %1").arg(string)); + #if defined(_M_X64)//ethminer + if(string.contains("GPU can't", Qt::CaseInsensitive) || string.contains("Bailing", Qt::CaseInsensitive)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("GPU addon bug")); + if(addonMode!="-C") + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("GPU addon bug: switch to CPU")); + addonMode="-C"; + addon.terminate(); + addon.kill(); + addon.waitForFinished(); + startAddon(); + } + } + #endif +} +#endif + +void OptionDialog::on_Ultracopier_current_theme_currentIndexChanged(const int &index) +{ + if(index!=-1 && allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"data value: "+ui->Ultracopier_current_theme->itemData(index).toString()+", string value: "+ui->Ultracopier_current_theme->itemText(index)+", index: "+QString::number(index)); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Themes"),QStringLiteral("Ultracopier_current_theme"),ui->Ultracopier_current_theme->itemData(index)); + int index_loop=0; + loop_size=pluginOptionsWidgetList.size(); + while(index_loopUltracopier_current_theme->itemData(index).toString()) + { + if(pluginOptionsWidgetList.at(index_loop).options==NULL) + ui->stackedWidgetThemesOptions->setCurrentWidget(ui->pageThemeNoOptions); + else + ui->stackedWidgetThemesOptions->setCurrentWidget(pluginOptionsWidgetList.at(index_loop).options); + return; + } + index_loop++; + } + ui->stackedWidgetThemesOptions->setCurrentWidget(ui->pageUnableToLoadThemePlugin); + } +} + +void OptionDialog::on_Language_currentIndexChanged(const int &index) +{ + if(index!=-1 && allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"data value: "+ui->Language->itemData(index).toString()+", string value: "+ui->Language->itemText(index)+", index: "+QString::number(index)); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Language"),QStringLiteral("Language"),ui->Language->itemData(index)); + } +} + +void OptionDialog::on_Language_force_toggled(const bool &checked) +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Language"),QStringLiteral("Language_force"),checked); + ui->Language->setEnabled(ui->Language_force->isChecked() && ui->Language->count()); + } +} + +void OptionDialog::on_CatchCopyAsDefault_toggled(const bool &checked) +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("CopyListener"),QStringLiteral("CatchCopyAsDefault"),checked); + } +} + +#ifndef ULTRACOPIER_VERSION_PORTABLE +void OptionDialog::on_LoadAtSessionStarting_toggled(const bool &checked) +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("SessionLoader"),QStringLiteral("LoadAtSessionStarting"),checked); + } +} +#endif + void OptionDialog::on_CopyEngineList_itemSelectionChanged() { - if(ui->CopyEngineList->selectedItems().size()!=0 && ui->CopyEngineList->count()>1) - { - ui->toolButtonUp->setEnabled(true); - ui->toolButtonDown->setEnabled(true); - } - else - { - ui->toolButtonUp->setEnabled(false); - ui->toolButtonDown->setEnabled(false); - } + if(ui->CopyEngineList->selectedItems().size()!=0 && ui->CopyEngineList->count()>1) + { + ui->toolButtonUp->setEnabled(true); + ui->toolButtonDown->setEnabled(true); + } + else + { + ui->toolButtonUp->setEnabled(false); + ui->toolButtonDown->setEnabled(false); + } } void OptionDialog::on_toolButtonDown_clicked() { - QListWidgetItem *item=ui->CopyEngineList->selectedItems().first(); - int position=ui->CopyEngineList->row(item); - if((position+1)CopyEngineList->count()) - { - QString text=item->text(); - item->setSelected(false); - delete item; - ui->CopyEngineList->insertItem(position+1,text); - ui->CopyEngineList->item(position+1)->setSelected(true); - ignoreCopyEngineListEdition=true; - options->setOptionValue("CopyEngine","List",copyEngineStringList()); - ignoreCopyEngineListEdition=false; - } + QListWidgetItem *item=ui->CopyEngineList->selectedItems().first(); + int position=ui->CopyEngineList->row(item); + if((position+1)CopyEngineList->count()) + { + QString text=item->text(); + item->setSelected(false); + delete item; + ui->CopyEngineList->insertItem(position+1,text); + ui->CopyEngineList->item(position+1)->setSelected(true); + ignoreCopyEngineListEdition=true; + OptionEngine::optionEngine->setOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List"),copyEngineStringList()); + ignoreCopyEngineListEdition=false; + } } void OptionDialog::on_toolButtonUp_clicked() { - QListWidgetItem *item=ui->CopyEngineList->selectedItems().first(); - int position=ui->CopyEngineList->row(item); - if(position>0) - { - QString text=item->text(); - item->setSelected(false); - delete item; - ui->CopyEngineList->insertItem(position-1,text); - ui->CopyEngineList->item(position-1)->setSelected(true); - ignoreCopyEngineListEdition=true; - options->setOptionValue("CopyEngine","List",copyEngineStringList()); - ignoreCopyEngineListEdition=false; - } -} - -QStringList OptionDialog::copyEngineStringList() -{ - QStringList newList; - int index=0; - while(indexCopyEngineList->count()) - { - newList << ui->CopyEngineList->item(index)->text(); - index++; - } - return newList; -} - -void OptionDialog::newThemeOptions(QString name,QWidget* theNewOptionsWidget,bool isLoaded,bool havePlugin) -{ - Q_UNUSED(isLoaded); - Q_UNUSED(havePlugin); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start: isLoaded: %1, havePlugin: %2, name: %3").arg(isLoaded).arg(havePlugin).arg(name)); - pluginOptionsWidget tempItem; - tempItem.name=name; - tempItem.item=NULL; - tempItem.options=theNewOptionsWidget; - tempItem.category=PluginType_Themes; - pluginOptionsWidgetList << tempItem; - if(theNewOptionsWidget!=NULL) - { - ui->stackedWidgetThemes->addWidget(theNewOptionsWidget); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"set the last page"); - } - on_Ultracopier_current_theme_currentIndexChanged(ui->Ultracopier_current_theme->currentIndex()); -} - -void OptionDialog::addPluginOptionWidget(PluginType category,QString name,QWidget * options) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start: %1, category: %2").arg(name).arg(category)); - //prevent send the empty options - if(options!=NULL) - { - index=0; - loop_size=pluginOptionsWidgetList.size(); - while(indextreeWidget->topLevelItem(2)->addChild(pluginOptionsWidgetList.at(index).item); - ui->stackedOptionsCopyEngine->addWidget(options); - break; - case PluginType_Listener: - ui->treeWidget->topLevelItem(3)->addChild(pluginOptionsWidgetList.at(index).item); - ui->stackedOptionsListener->addWidget(options); - break; - case PluginType_PluginLoader: - ui->treeWidget->topLevelItem(4)->addChild(pluginOptionsWidgetList.at(index).item); - ui->stackedOptionsPluginLoader->addWidget(options); - break; - case PluginType_SessionLoader: - ui->treeWidget->topLevelItem(5)->addChild(pluginOptionsWidgetList.at(index).item); - ui->stackedOptionsSessionLoader->addWidget(options); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Unable to parse this unknow type of plugin: "+name); - return; - } - } - //only for copy engine - if(category==PluginType_CopyEngine) - { - //but can loaded by the previous options - index=0; - loop_size=ui->CopyEngineList->count(); - while(indexCopyEngineList->item(index)->text()==name) - break; - index++; - } - if(index==loop_size) - ui->CopyEngineList->addItems(QStringList() << name); - } + QListWidgetItem *item=ui->CopyEngineList->selectedItems().first(); + int position=ui->CopyEngineList->row(item); + if(position>0) + { + QString text=item->text(); + item->setSelected(false); + delete item; + ui->CopyEngineList->insertItem(position-1,text); + ui->CopyEngineList->item(position-1)->setSelected(true); + ignoreCopyEngineListEdition=true; + OptionEngine::optionEngine->setOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List"),copyEngineStringList()); + ignoreCopyEngineListEdition=false; + } } -void OptionDialog::on_pluginList_itemSelectionChanged() +QStringList OptionDialog::copyEngineStringList() const { - if(ui->pluginList->selectedItems().size()==0) - { - ui->pluginRemove->setEnabled(false); - ui->pluginInformation->setEnabled(false); - } - else - { - treeWidgetItem=ui->pluginList->selectedItems().first(); - index=0; - loop_size=pluginLink.size(); - while(indexpluginRemove->setEnabled(pluginLink.at(index).isWritable); - ui->pluginInformation->setEnabled(true); - return; - } - index++; - } - } + QStringList newList; + int index=0; + while(indexCopyEngineList->count()) + { + newList << ui->CopyEngineList->item(index)->text(); + index++; + } + return newList; } -void OptionDialog::on_pluginRemove_clicked() +void OptionDialog::newThemeOptions(const QString &name,QWidget* theNewOptionsWidget,bool isLoaded,bool havePlugin) { - treeWidgetItem=ui->pluginList->selectedItems().first(); - index=0; - loop_size=pluginLink.size(); - while(indexremoveThePluginSelected(pluginLink.at(index).path); - return; - } - index++; - } + Q_UNUSED(isLoaded); + Q_UNUSED(havePlugin); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: isLoaded: %1, havePlugin: %2, name: %3").arg(isLoaded).arg(havePlugin).arg(name)); + pluginOptionsWidget tempItem; + tempItem.name=name; + tempItem.item=NULL; + tempItem.options=theNewOptionsWidget; + tempItem.category=PluginType_Themes; + pluginOptionsWidgetList << tempItem; + if(theNewOptionsWidget!=NULL) + { + ui->stackedWidgetThemesOptions->addWidget(theNewOptionsWidget); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set the last page")); + } + on_Ultracopier_current_theme_currentIndexChanged(ui->Ultracopier_current_theme->currentIndex()); +} + +void OptionDialog::addPluginOptionWidget(const PluginType &category,const QString &name,QWidget * options) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: %1, category: %2").arg(name).arg(category)); + //prevent send the empty options + if(options!=NULL) + { + index=0; + loop_size=pluginOptionsWidgetList.size(); + while(indextreeWidget->topLevelItem(2)->addChild(pluginOptionsWidgetList.at(index).item); + ui->stackedOptionsCopyEngine->addWidget(options); + break; + case PluginType_Listener: + ui->treeWidget->topLevelItem(3)->addChild(pluginOptionsWidgetList.at(index).item); + ui->stackedOptionsListener->addWidget(options); + break; + case PluginType_PluginLoader: + ui->treeWidget->topLevelItem(4)->addChild(pluginOptionsWidgetList.at(index).item); + ui->stackedOptionsPluginLoader->addWidget(options); + break; + case PluginType_SessionLoader: + ui->treeWidget->topLevelItem(5)->addChild(pluginOptionsWidgetList.at(index).item); + ui->stackedOptionsSessionLoader->addWidget(options); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("Unable to parse this unknow type of plugin: ")+name); + return; + } + } + //only for copy engine + if(category==PluginType_CopyEngine) + { + //but can loaded by the previous options + index=0; + loop_size=ui->CopyEngineList->count(); + while(indexCopyEngineList->item(index)->text()==name) + break; + index++; + } + if(index==loop_size) + ui->CopyEngineList->addItems(QStringList() << name); + } +} + +void OptionDialog::on_pluginList_itemSelectionChanged() +{ + if(ui->pluginList->selectedItems().size()==0) + { + ui->pluginRemove->setEnabled(false); + ui->pluginInformation->setEnabled(false); + } + else + { + treeWidgetItem=ui->pluginList->selectedItems().first(); + index=0; + loop_size=pluginLink.size(); + while(indexpluginRemove->setEnabled(pluginLink.at(index).isWritable); + ui->pluginInformation->setEnabled(true); + return; + } + index++; + } + } } void OptionDialog::on_pluginInformation_clicked() { - treeWidgetItem=ui->pluginList->selectedItems().first(); - index=0; - loop_size=pluginLink.size(); - while(indexshowInformation(pluginLink.at(index).path); - return; - } - index++; - } + treeWidgetItem=ui->pluginList->selectedItems().first(); + index=0; + loop_size=pluginLink.size(); + while(indexshowInformation(pluginLink.at(index).path); + return; + } + index++; + } +} + +#ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT +void OptionDialog::on_pluginRemove_clicked() +{ + treeWidgetItem=ui->pluginList->selectedItems().first(); + index=0; + loop_size=pluginLink.size(); + while(indexremoveThePluginSelected(pluginLink.at(index).path); + return; + } + index++; + } } void OptionDialog::on_pluginAdd_clicked() { - plugins->addPlugin(defaultImportBackend); + PluginsManager::pluginsManager->addPlugin(defaultImportBackend); } +#endif void OptionDialog::on_checkBox_Log_clicked() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","enabled",ui->checkBox_Log->isChecked()); - } - ui->lineEditLog_transfer_format->setEnabled(ui->checkBoxLog_transfer->isChecked() && ui->checkBox_Log->isChecked()); - ui->lineEditLog_error_format->setEnabled(ui->checkBoxLog_error->isChecked() && ui->checkBox_Log->isChecked()); - ui->lineEditLog_folder_format->setEnabled(ui->checkBoxLog_folder->isChecked() && ui->checkBox_Log->isChecked()); + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("enabled"),ui->checkBox_Log->isChecked()); + } + ui->lineEditLog_transfer_format->setEnabled(ui->checkBoxLog_transfer->isChecked() && ui->checkBox_Log->isChecked()); + ui->lineEditLog_error_format->setEnabled(ui->checkBoxLog_error->isChecked() && ui->checkBox_Log->isChecked()); + ui->lineEditLog_folder_format->setEnabled(ui->checkBoxLog_folder->isChecked() && ui->checkBox_Log->isChecked()); } void OptionDialog::on_lineEditLog_File_editingFinished() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","file",ui->lineEditLog_File->text()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("file"),ui->lineEditLog_File->text()); + } } void OptionDialog::on_lineEditLog_transfer_format_editingFinished() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","transfer_format",ui->lineEditLog_transfer_format->text()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("transfer_format"),ui->lineEditLog_transfer_format->text()); + } } void OptionDialog::on_lineEditLog_error_format_editingFinished() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","error_format",ui->lineEditLog_error_format->text()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("error_format"),ui->lineEditLog_error_format->text()); + } } void OptionDialog::on_checkBoxLog_transfer_clicked() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","transfer",ui->checkBoxLog_transfer->isChecked()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("transfer"),ui->checkBoxLog_transfer->isChecked()); + } } void OptionDialog::on_checkBoxLog_error_clicked() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","error",ui->checkBoxLog_error->isChecked()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("error"),ui->checkBoxLog_error->isChecked()); + } } void OptionDialog::on_checkBoxLog_folder_clicked() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","folder",ui->checkBoxLog_folder->isChecked()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("folder"),ui->checkBoxLog_folder->isChecked()); + } } -void OptionDialog::on_pushButton_clicked() +void OptionDialog::on_logBrowse_clicked() { - QString file=QFileDialog::getSaveFileName(this,tr("Save logs as: "),resources->getWritablePath()); - if(file!="") - { - ui->lineEditLog_File->setText(file); - on_lineEditLog_File_editingFinished(); - } + QString file=QFileDialog::getSaveFileName(this,tr("Save logs as: "),ResourcesManager::resourcesManager->getWritablePath()); + if(file!="") + { + ui->lineEditLog_File->setText(file); + on_lineEditLog_File_editingFinished(); + } } void OptionDialog::on_checkBoxLog_sync_clicked() { - if(allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - options->setOptionValue("Write_log","sync",ui->checkBoxLog_sync->isChecked()); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Write_log"),QStringLiteral("sync"),ui->checkBoxLog_sync->isChecked()); + } +} + +void OptionDialog::on_ActionOnManualOpen_currentIndexChanged(const int &index) +{ + if(index!=-1 && allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"data value: "+ui->ActionOnManualOpen->itemData(index).toString()+", string value: "+ui->ActionOnManualOpen->itemText(index)+", index: "+QString::number(index)); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("ActionOnManualOpen"),index); + } } -void OptionDialog::on_ActionOnManualOpen_currentIndexChanged(int index) +void OptionDialog::on_GroupWindowWhen_currentIndexChanged(const int &index) { - if(index!=-1 && allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"data value: "+ui->ActionOnManualOpen->itemData(index).toString()+", string value: "+ui->ActionOnManualOpen->itemText(index)+", index: "+QString::number(index)); - options->setOptionValue("Ultracopier","ActionOnManualOpen",index); - } + if(index!=-1 && allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"data value: "+ui->GroupWindowWhen->itemData(index).toString()+", string value: "+ui->GroupWindowWhen->itemText(index)+", index: "+QString::number(index)); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("GroupWindowWhen"),index); + } } -void OptionDialog::on_GroupWindowWhen_currentIndexChanged(int index) +void OptionDialog::on_DisplayOSWarning_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("displayOSSpecific"),ui->DisplayOSWarning->isChecked()); + } +} + +void OptionDialog::newClientList(const QStringList &clientsList) +{ + ui->clientConnected->clear(); + ui->clientConnected->addItems(clientsList); +} + +void OptionDialog::on_checkTheUpdate_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("checkTheUpdate"),ui->checkTheUpdate->isChecked()); +} + +void OptionDialog::on_confirmToGroupWindows_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("confirmToGroupWindows"),ui->confirmToGroupWindows->isChecked()); +} + +void OptionDialog::on_giveGPUTime_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("giveGPUTime"),ui->giveGPUTime->isChecked()); +} + +#ifdef ULTRACOPIER_CGMINER +/*int OptionDialog::getcpuload() +{ + static PDH_STATUS status; + static PDH_FMT_COUNTERVALUE value; + static HQUERY query; + static HCOUNTER counter; + static DWORD ret; + static char runonce=1; + char cput=0; + + if(runonce) + { + status = PdhOpenQuery(NULL, 0, &query); + if(status != ERROR_SUCCESS) + { + printf("PdhOpenQuery() ***Error: 0x%X\n",status); + return 0; + } + PdhAddCounter(query, TEXT("\\Processor(_Total)\\% Processor Time"),0,&counter); // A total of ALL CPU's in the system + runonce=0; + PdhCollectQueryData(query); // No error checking here + return 0; + } + status = PdhCollectQueryData(query); + if(status != ERROR_SUCCESS) + { + printf("PhdCollectQueryData() ***Error: 0x%X\n",status); + if(status==PDH_INVALID_HANDLE) + printf("PDH_INVALID_HANDLE\n"); + else if(status==PDH_NO_DATA) + printf("PDH_NO_DATA\n"); + else + printf("Unknown error\n"); + return 0; + } + status = PdhGetFormattedCounterValue(counter, PDH_FMT_DOUBLE | PDH_FMT_NOCAP100 ,&ret, &value); + if(status != ERROR_SUCCESS) + { + printf("PdhGetFormattedCounterValue() ***Error: 0x%X\n",status); + return 0; + } + cput = value.doubleValue; + return cput; +}*/ +#endif + +void OptionDialog::on_remainingTimeAlgorithm_currentIndexChanged(int index) { - if(index!=-1 && allPluginsIsLoaded) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"data value: "+ui->GroupWindowWhen->itemData(index).toString()+", string value: "+ui->GroupWindowWhen->itemText(index)+", index: "+QString::number(index)); - options->setOptionValue("Ultracopier","GroupWindowWhen",index); - } + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + OptionEngine::optionEngine->setOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("remainingTimeAlgorithm"),index); + } } diff --git a/OptionDialog.h b/OptionDialog.h old mode 100755 new mode 100644 index 9b1911c..2055c4c --- a/OptionDialog.h +++ b/OptionDialog.h @@ -1,17 +1,26 @@ /** \file OptionDialog.h \brief To have an interface to control the options \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ +#include "Environment.h" + #ifndef OPTIONDIALOG_H #define OPTIONDIALOG_H #include #include +#include + +#ifdef ULTRACOPIER_CGMINER +#define ULTRACOPIER_CGMINER_WORKING_COUNT 10 +#include +#include +#endif -#include "GlobalClass.h" +#include "Environment.h" +#include "OSSpecific.h" +#include "PluginsManager.h" namespace Ui { class OptionDialog; @@ -22,81 +31,126 @@ namespace Ui { It's need manage the ultracopier options, plugins selection, plugin prority. It's need manage too the plugin options and plugins informations. */ -class OptionDialog : public QDialog, public GlobalClass +class OptionDialog : public QDialog { - Q_OBJECT + Q_OBJECT public: - explicit OptionDialog(); - ~OptionDialog(); - /** \brief add the option widget from copy engine */ - void addPluginOptionWidget(PluginType category,QString name,QWidget * options); + explicit OptionDialog(); + ~OptionDialog(); + /** \brief add the option widget from copy engine */ + void addPluginOptionWidget(const PluginType &category,const QString &name,QWidget * options); protected: - void changeEvent(QEvent *e); + void changeEvent(QEvent *e); + void loadLogVariableLabel(); private slots: - void on_treeWidget_itemSelectionChanged(); - void on_buttonBox_clicked(QAbstractButton *button); - //plugin management - void onePluginAdded(PluginsAvailable plugin); - void onePluginWillBeRemoved(PluginsAvailable plugin); - void loadOption(); - void newOptionValue(QString group,QString name,QVariant value); - void on_Ultracopier_current_theme_currentIndexChanged(int index); - void on_Language_currentIndexChanged(int index); - void on_Language_autodetect_toggled(bool checked); - void on_CatchCopyAsDefault_toggled(bool checked); - void on_LoadAtSessionStarting_toggled(bool checked); - void on_CopyEngineList_itemSelectionChanged(); - void on_toolButtonDown_clicked(); - void on_toolButtonUp_clicked(); - void on_pluginList_itemSelectionChanged(); - void on_pluginRemove_clicked(); - void on_pluginInformation_clicked(); - void on_pluginAdd_clicked(); - void on_checkBox_Log_clicked(); - void on_lineEditLog_File_editingFinished(); - void on_lineEditLog_transfer_format_editingFinished(); - void on_lineEditLog_error_format_editingFinished(); - void on_checkBoxLog_transfer_clicked(); - void on_checkBoxLog_error_clicked(); - void on_pushButton_clicked(); - void on_checkBoxLog_folder_clicked(); - void on_checkBoxLog_sync_clicked(); - void on_ActionOnManualOpen_currentIndexChanged(int index); - - void on_GroupWindowWhen_currentIndexChanged(int index); + void on_treeWidget_itemSelectionChanged(); + void on_buttonBox_clicked(QAbstractButton *button); + //plugin management + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + #endif + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + void manuallyAdded(const PluginsAvailable &plugin); + #endif + void loadOption(); + void newOptionValue(const QString &group,const QString &name,const QVariant &value); + void on_Ultracopier_current_theme_currentIndexChanged(const int &index); + void on_Language_currentIndexChanged(const int &index); + void on_Language_force_toggled(const bool &checked); + void on_CatchCopyAsDefault_toggled(const bool &checked); + #ifdef ULTRACOPIER_CGMINER + void error( QProcess::ProcessError error ); + void finished( int exitCode, QProcess::ExitStatus exitStatus ); + void readyReadStandardError(); + void readyReadStandardOutput(); + void startAddon(); + //void checkWorking(); + void checkIdle(); + //int getcpuload(); + #endif + #ifndef ULTRACOPIER_VERSION_PORTABLE + void on_LoadAtSessionStarting_toggled(const bool &checked); + #endif + void on_CopyEngineList_itemSelectionChanged(); + void on_toolButtonDown_clicked(); + void on_toolButtonUp_clicked(); + void on_pluginList_itemSelectionChanged(); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + void on_pluginRemove_clicked(); + void on_pluginAdd_clicked(); + #endif + void on_pluginInformation_clicked(); + void on_checkBox_Log_clicked(); + void on_lineEditLog_File_editingFinished(); + void on_lineEditLog_transfer_format_editingFinished(); + void on_lineEditLog_error_format_editingFinished(); + void on_checkBoxLog_transfer_clicked(); + void on_checkBoxLog_error_clicked(); + void on_logBrowse_clicked(); + void on_checkBoxLog_folder_clicked(); + void on_checkBoxLog_sync_clicked(); + void on_ActionOnManualOpen_currentIndexChanged(const int &index); + void on_GroupWindowWhen_currentIndexChanged(const int &index); + void on_DisplayOSWarning_clicked(); + void on_checkTheUpdate_clicked(); + void on_confirmToGroupWindows_clicked(); + void on_giveGPUTime_clicked(); + void oSSpecificClosed(); + void on_remainingTimeAlgorithm_currentIndexChanged(int index); private: - Ui::OptionDialog *ui; - struct pluginStore - { - QTreeWidgetItem * item; - QString path; - bool isWritable; - }; - QList pluginLink; - struct pluginOptionsWidget - { - QString name; - QTreeWidgetItem * item; - QWidget *options; - PluginType category; - }; - QList pluginOptionsWidgetList; - void addLanguage(PluginsAvailable plugin); - void removeLanguage(PluginsAvailable plugin); - void addTheme(PluginsAvailable plugin); - void removeTheme(PluginsAvailable plugin); - QStringList copyEngineStringList(); - bool ignoreCopyEngineListEdition; - PluginsManager::ImportBackend defaultImportBackend; - int index,loop_size; - int loadedCopyEnginePlugin; - QTreeWidgetItem * treeWidgetItem; - bool allPluginsIsLoaded; + bool quit; + Ui::OptionDialog *ui; + struct pluginStore + { + QTreeWidgetItem * item; + QString path; + bool isWritable; + }; + QList pluginLink; + struct pluginOptionsWidget + { + QString name; + QTreeWidgetItem * item; + QWidget *options; + PluginType category; + }; + QList pluginOptionsWidgetList; + int number_of_listener; + void addLanguage(const PluginsAvailable &plugin); + void removeLanguage(const PluginsAvailable &plugin); + void addTheme(const PluginsAvailable &plugin); + void removeTheme(const PluginsAvailable &plugin); + QStringList copyEngineStringList() const; + bool ignoreCopyEngineListEdition; + PluginsManager::ImportBackend defaultImportBackend; + int index,loop_size; + int loadedCopyEnginePlugin; + QTreeWidgetItem * treeWidgetItem; + OSSpecific *oSSpecific; + bool allPluginsIsLoaded; + #ifdef ULTRACOPIER_CGMINER + #if defined(_M_X64)//ethminer + QString addonMode; + #endif + QProcess addon; + bool OpenCLDll; + bool haveAddon; + QList pools; + QTimer restartaddon; + QTimer autorestartaddon; + QTimer checkIdleTimer,checkWorkingTimer; + quint32 dwTimeIdle; + QTime dwTimeIdleTime; + bool isIdle; + int workingCount; + #endif public slots: - void newThemeOptions(QString name,QWidget* theNewOptionsWidget,bool isLoaded,bool havePlugin); + void newThemeOptions(const QString &name,QWidget* theNewOptionsWidget,bool isLoaded,bool havePlugin); + void newClientList(const QStringList &clientsList); signals: - void previouslyPluginAdded(PluginsAvailable); + void previouslyPluginAdded(const PluginsAvailable &plugin) const; }; #endif // OPTIONDIALOG_H diff --git a/OptionDialog.ui b/OptionDialog.ui index 61f134d..5ed7b52 100644 --- a/OptionDialog.ui +++ b/OptionDialog.ui @@ -6,7 +6,7 @@ 0 0 - 717 + 779 455 @@ -14,7 +14,7 @@ Options - + :/options.png:/options.png @@ -70,9 +70,6 @@ Listener - - ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled -
@@ -105,16 +102,19 @@ - 8 + 0 - + + + QFormLayout::ExpandingFieldsGrow + - + - Language: + Force the language @@ -122,55 +122,41 @@ - - - Autodetect the system language: - - - - - - - - - - - - Catch the copy/move as default: + Replace the default copy and move system - + - + - Load at the session loading: + Load at the session loading - + - + - When manual open: + When manual open - + @@ -189,7 +175,14 @@ - + + + + Group the windows when + + + + @@ -224,12 +217,66 @@ - + + + Confirm to group the windows + + + + + + + Display the OS warning + + + + + + + + + + + + + + + + Check for updates + + + + + + + + + + Give GPU time to fund the development + + + + + - Group the windows when: + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + @@ -401,7 +448,7 @@ false - + :/moveUp.png:/moveUp.png @@ -412,7 +459,7 @@ false - + :/moveDown.png:/moveDown.png @@ -436,7 +483,7 @@
- + @@ -444,27 +491,41 @@ + + + + + Client connected + + + + + + + + + - + - + - + @@ -513,11 +574,11 @@ - + 1 - + @@ -535,7 +596,7 @@ - :/bug-128x128.png + :/bug-128x128.png Qt::AlignCenter @@ -574,7 +635,7 @@ - + @@ -592,7 +653,7 @@ - :/none-128x128.png + :/none-128x128.png Qt::AlignCenter @@ -647,7 +708,7 @@ - + false @@ -664,7 +725,7 @@ false - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) Synchronized log @@ -677,7 +738,7 @@ false - Write the transfers: + Write the transfers @@ -692,12 +753,12 @@ - + false - The variables are %time%, %source%, %size%, %destination% + The variables are %time%, %source%, %size%, %destination% @@ -707,7 +768,7 @@ false - Write the errors: + Write the errors @@ -722,12 +783,12 @@ - + false - The variables are %time%, %path%, %size%, %mtime%, %error% + The variables are %time%, %path%, %size%, %mtime%, %error% @@ -737,7 +798,7 @@ false - Write the folder operations: + Write the folder operations @@ -755,12 +816,12 @@ - + false - The variables are %path%, %operation% + The variables are %path%, %operation% @@ -793,25 +854,9 @@ - + - - Language_autodetect - toggled(bool) - Language - setDisabled(bool) - - - 449 - 42 - - - 502 - 10 - - - checkBox_Log toggled(bool) @@ -831,7 +876,7 @@ checkBox_Log toggled(bool) - pushButton + logBrowse setEnabled(bool) diff --git a/OptionEngine.cpp b/OptionEngine.cpp index a05d9b8..f86607f 100644 --- a/OptionEngine.cpp +++ b/OptionEngine.cpp @@ -1,13 +1,10 @@ /** \file OptionEngine.cpp \brief Define the class of the event dispatcher \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include #include -#include #include #include #include @@ -20,213 +17,223 @@ /// \brief Initiate the option, load from backend OptionEngine::OptionEngine() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //locate the settings - #ifdef ULTRACOPIER_VERSION_PORTABLE - resources=ResourcesManager::getInstance(); - QString settingsFilePath=resources->getWritablePath(); - if(settingsFilePath!="") - settings = new QSettings(settingsFilePath+"Ultracopier.conf",QSettings::IniFormat); - else - settings = NULL; - #else // ULTRACOPIER_VERSION_PORTABLE - settings = new QSettings("Ultracopier","Ultracopier"); - #endif // ULTRACOPIER_VERSION_PORTABLE - if(settings!=NULL) - { - //do some write test - if(settings->status()!=QSettings::NoError) - { - delete settings; - settings=NULL; - } - else if(!settings->isWritable()) - { - delete settings; - settings=NULL; - } - else - { - settings->setValue("test","test"); - if(settings->status()!=QSettings::NoError) - { - delete settings; - settings=NULL; - } - else - { - settings->remove("test"); - if(settings->status()!=QSettings::NoError) - { - delete settings; - settings=NULL; - } - } - } - } - //set the backend - if(settings==NULL) - { - #ifdef ULTRACOPIER_VERSION_PORTABLE - resources->disableWritablePath(); - #endif // ULTRACOPIER_VERSION_PORTABLE - currentBackend=Memory; - } - else - currentBackend=File; + //locate the settings + #ifdef ULTRACOPIER_VERSION_PORTABLE + QString settingsFilePath=ResourcesManager::resourcesManager->getWritablePath(); + if(settingsFilePath!="") + settings = new QSettings(settingsFilePath+QStringLiteral("Ultracopier.conf"),QSettings::IniFormat); + else + settings = NULL; + #else // ULTRACOPIER_VERSION_PORTABLE + settings = new QSettings(QStringLiteral("Ultracopier"),QStringLiteral("Ultracopier")); + #endif // ULTRACOPIER_VERSION_PORTABLE + if(settings!=NULL) + { + //do some write test + if(settings->status()!=QSettings::NoError) + { + delete settings; + settings=NULL; + } + else if(!settings->isWritable()) + { + delete settings; + settings=NULL; + } + else + { + settings->setValue(QStringLiteral("test"),QStringLiteral("test")); + if(settings->status()!=QSettings::NoError) + { + delete settings; + settings=NULL; + } + else + { + settings->remove(QStringLiteral("test")); + if(settings->status()!=QSettings::NoError) + { + delete settings; + settings=NULL; + } + } + } + } + //set the backend + if(settings==NULL) + { + #ifdef ULTRACOPIER_VERSION_PORTABLE + ResourcesManager::resourcesManager->disableWritablePath(); + #endif // ULTRACOPIER_VERSION_PORTABLE + currentBackend=Memory; + } + else + currentBackend=File; } /// \brief Destroy the option OptionEngine::~OptionEngine() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - ResourcesManager::destroyInstanceAtTheLastCall(); } /// \brief To add option group to options bool OptionEngine::addOptionGroup(const QString &groupName,const QList > &KeysList) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start(\""+groupName+"\",[...])"); - //search if previous with the same name exists - if(GroupKeysList.contains(groupName)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"group already used previously"); - return false; - } - //if the backend is file, enter into the group - if(currentBackend==File) - settings->beginGroup(groupName); - //browse all key, and append it to the key - index=0; - QList KeyListTemp; - loop_size=KeysList.size(); - while(indexcontains(KeysList.at(index).first))//if file backend, load the default value from the file - theCurrentKey.currentValue=settings->value(KeysList.at(index).first); - else //or if not found load the default value and set into the file - { - theCurrentKey.currentValue=theCurrentKey.defaultValue; - //to switch default value if is unchanged - //settings->setValue(KeysList.at(index).first,theCurrentKey.defaultValue); - } - if(settings->status()!=QSettings::NoError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Have writing error, switch to memory only options"); - #ifdef ULTRACOPIER_VERSION_PORTABLE - resources->disableWritablePath(); - #endif // ULTRACOPIER_VERSION_PORTABLE - currentBackend=Memory; - } - } - GroupKeysList[groupName][KeysList.at(index).first]=theCurrentKey; - index++; - } - //if the backend is file, leave into the group - if(currentBackend==File) - settings->endGroup(); - return true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start(\"")+groupName+QStringLiteral("\",[...])")); + //search if previous with the same name exists + if(GroupKeysList.contains(groupName)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("group already used previously")); + return false; + } + //if the backend is file, enter into the group + if(currentBackend==File) + settings->beginGroup(groupName); + //browse all key, and append it to the key + int index=0; + //QList KeyListTemp; + const int &loop_size=KeysList.size(); + while(indexcontains(KeysList.at(index).first))//if file backend, load the default value from the file + { + theCurrentKey.currentValue=settings->value(KeysList.at(index).first); + #ifdef ULTRACOPIER_DEBUG + if(theCurrentKey.currentValue!=theCurrentKey.defaultValue) + { + #ifdef ULTRACOPIER_VERSION_ULTIMATE + if(groupName=="Ultracopier" && KeysList.at(index).first=="key") + { + } + else + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QString("The current key: %1, group: %2, have value: %3").arg(groupName).arg(KeysList.at(index).first).arg(theCurrentKey.currentValue.toString())); + } + #endif + } + else //or if not found load the default value and set into the file + { + theCurrentKey.currentValue=theCurrentKey.defaultValue; + //to switch default value if is unchanged + //settings->setValue(KeysList.at(index).first,theCurrentKey.defaultValue); + } + if(settings->status()!=QSettings::NoError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Have writing error, switch to memory only options"); + #ifdef ULTRACOPIER_VERSION_PORTABLE + ResourcesManager::resourcesManager->disableWritablePath(); + #endif // ULTRACOPIER_VERSION_PORTABLE + currentBackend=Memory; + } + } + GroupKeysList[groupName][KeysList.at(index).first]=theCurrentKey; + index++; + } + //if the backend is file, leave into the group + if(currentBackend==File) + settings->endGroup(); + return true; } /// \brief To remove option group to options, remove the widget need be do into the calling object bool OptionEngine::removeOptionGroup(const QString &groupName) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, groupName: "+groupName); - if(GroupKeysList.remove(groupName)!=1) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName); - return false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, groupName: ")+groupName); + if(GroupKeysList.remove(groupName)!=1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("value not found, internal bug, groupName: ")+groupName); + return false; } /// \brief To get option value -QVariant OptionEngine::getOptionValue(const QString &groupName,const QString &variableName) +QVariant OptionEngine::getOptionValue(const QString &groupName,const QString &variableName) const { - if(GroupKeysList.contains(groupName)) - { - if(GroupKeysList[groupName].contains(variableName)) - return GroupKeysList[groupName][variableName].currentValue; - QMessageBox::critical(NULL,"Internal error",tr("Try get variable, but the variable is not found: %1 %2").arg(groupName).arg(variableName)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName+", variableName: "+variableName); - return QVariant(); - } - QMessageBox::critical(NULL,"Internal error",tr("Try get variable, but the variable is not found: %1 %2").arg(groupName).arg(variableName)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("Try get variable, but the variable is not found: %1 %2").arg(groupName).arg(variableName)); - //return default value - return QVariant(); + if(GroupKeysList.contains(groupName)) + { + if(GroupKeysList.value(groupName).contains(variableName)) + return GroupKeysList.value(groupName).value(variableName).currentValue; + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2").arg(groupName).arg(variableName)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName+", variableName: "+variableName); + return QVariant(); + } + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2").arg(groupName).arg(variableName)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QString("The variable was not found: %1 %2").arg(groupName).arg(variableName)); + //return default value + return QVariant(); } /// \brief To set option value void OptionEngine::setOptionValue(const QString &groupName,const QString &variableName,const QVariant &value) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"groupName: \""+groupName+"\", variableName: \""+variableName+"\", value: \""+value.toString()+"\""); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("groupName: \"")+groupName+QStringLiteral("\", variableName: \"")+variableName+QStringLiteral("\", value: \"")+value.toString()+QStringLiteral("\"")); - if(GroupKeysList.contains(groupName)) - { - if(GroupKeysList[groupName].contains(variableName)) - { - //prevent re-write the same value into the variable - if(GroupKeysList[groupName][variableName].currentValue==value) - return; - //write ONLY the new value - GroupKeysList[groupName][variableName].currentValue=value; - if(currentBackend==File) - { - settings->beginGroup(groupName); - settings->setValue(variableName,value); - settings->endGroup(); - if(settings->status()!=QSettings::NoError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Have writing error, switch to memory only options"); - #ifdef ULTRACOPIER_VERSION_PORTABLE - resources->disableWritablePath(); - #endif // ULTRACOPIER_VERSION_PORTABLE - currentBackend=Memory; - } - } - emit newOptionValue(groupName,variableName,value); - return; - } - QMessageBox::critical(NULL,"Internal error",tr("Try get variable, but the variable is not found: %1 %2").arg(groupName).arg(variableName)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName+", variableName: "+variableName); - return; - } - QMessageBox::critical(NULL,"Internal error",tr("Try get variable, but the variable is not found: %1 %2").arg(groupName).arg(variableName)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("Try get variable, but the variable is not found: %1 %2").arg(groupName).arg(variableName)); + if(GroupKeysList.contains(groupName)) + { + if(GroupKeysList.value(groupName).contains(variableName)) + { + //prevent re-write the same value into the variable + if(GroupKeysList.value(groupName).value(variableName).currentValue==value) + return; + //write ONLY the new value + GroupKeysList[groupName][variableName].currentValue=value; + if(currentBackend==File) + { + settings->beginGroup(groupName); + settings->setValue(variableName,value); + settings->endGroup(); + if(settings->status()!=QSettings::NoError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Have writing error, switch to memory only options")); + #ifdef ULTRACOPIER_VERSION_PORTABLE + ResourcesManager::resourcesManager->disableWritablePath(); + #endif // ULTRACOPIER_VERSION_PORTABLE + currentBackend=Memory; + } + } + emit newOptionValue(groupName,variableName,value); + return; + } + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2").arg(groupName).arg(variableName)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName+", variableName: "+variableName); + return; + } + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2").arg(groupName).arg(variableName)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QString("The variable was not found: %1 %2").arg(groupName).arg(variableName)); } //the reset of right value of widget need be do into the calling object void OptionEngine::internal_resetToDefaultValue() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); - QHash >::const_iterator i = GroupKeysList.constBegin(); - QHash >::const_iterator i_end = GroupKeysList.constEnd(); - QHash::const_iterator j; - QHash::const_iterator j_end; - while (i != i_end) - { - j = i.value().constBegin(); - j_end = i.value().constEnd(); - while (j != j_end) - { - if(j.value().currentValue!=j.value().defaultValue) - { - GroupKeysList[i.key()][j.key()].currentValue=j.value().defaultValue; - emit newOptionValue(i.key(),j.key(),j.value().currentValue); - } - ++j; - } - ++i; - } + QHash >::const_iterator i = GroupKeysList.constBegin(); + QHash >::const_iterator i_end = GroupKeysList.constEnd(); + QHash::const_iterator j; + QHash::const_iterator j_end; + while (i != i_end) + { + j = i.value().constBegin(); + j_end = i.value().constEnd(); + while (j != j_end) + { + if(j.value().currentValue!=j.value().defaultValue) + { + GroupKeysList[i.key()][j.key()].currentValue=j.value().defaultValue; + emit newOptionValue(i.key(),j.key(),j.value().currentValue); + } + ++j; + } + ++i; + } } void OptionEngine::queryResetOptions() { - emit resetOptions(); + emit resetOptions(); } diff --git a/OptionEngine.h b/OptionEngine.h index 0b13848..ca8a786 100644 --- a/OptionEngine.h +++ b/OptionEngine.h @@ -1,8 +1,6 @@ /** \file OptionEngine.h \brief Define the class of the option engine \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef OPTION_ENGINE_H @@ -26,7 +24,6 @@ #include "interface/OptionInterface.h" #include "Environment.h" -#include "Singleton.h" #include "ResourcesManager.h" /** \brief To store the options @@ -34,61 +31,56 @@ That's allow to have mutualised way to store the options. Then the plugins just keep Ultracopier manage it, the portable version will store on the disk near the application, and the normal version will keep at the normal location. That's allow to have cache and buffer to not slow down Ultracopier when it's doing heavy copy/move. */ -class OptionEngine : public QObject, public Singleton +class OptionEngine : public QObject { - Q_OBJECT - //class OptionEngine : public OptionInterface, public QDialog, public Singleton - friend class Singleton; - public: - /// \brief To add option group to options - bool addOptionGroup(const QString &groupName,const QList > &KeysList); - /// \brief To remove option group to options, remove the widget need be do into the calling object - bool removeOptionGroup(const QString &groupName); - /// \brief To get option value - QVariant getOptionValue(const QString &groupName,const QString &variableName); - /// \brief To set option value - void setOptionValue(const QString &groupName,const QString &variableName,const QVariant &value); - /// \brief To invalid option value - //void setInvalidOptionValue(const QString &groupName,const QString &variableName); - /// \brief get query reset options - void queryResetOptions(); - private: - /// \brief Initiate the option, load from backend - OptionEngine(); - /// \brief Destroy the option - ~OptionEngine(); + Q_OBJECT + //class OptionEngine : public OptionInterface, public QDialog, public Singleton + public: + /// \brief Initiate the option, load from backend + OptionEngine(); + /// \brief Destroy the option + ~OptionEngine(); + /// \brief To add option group to options + bool addOptionGroup(const QString &groupName,const QList > &KeysList); + /// \brief To remove option group to options, remove the widget need be do into the calling object + bool removeOptionGroup(const QString &groupName); + /// \brief To get option value + QVariant getOptionValue(const QString &groupName,const QString &variableName) const; + /// \brief To set option value + void setOptionValue(const QString &groupName,const QString &variableName,const QVariant &value); + /// \brief To invalid option value + //void setInvalidOptionValue(const QString &groupName,const QString &variableName); + /// \brief get query reset options + void queryResetOptions(); + private: + /// \brief OptionEngineGroupKey then: Group -> Key + struct OptionEngineGroupKey + { + QVariant defaultValue; + QVariant currentValue; + bool emptyList; + }; - /// \brief OptionEngineGroupKey then: Group -> Key - struct OptionEngineGroupKey - { - QVariant defaultValue; - QVariant currentValue; - bool emptyList; - }; - - /// \brief store the option group list - QHash > GroupKeysList; - QStringList unmanagedTabName; - /// \brief Enumeration of backend - enum Backend - { - Memory, //Do intensive usage of memory, used only if the file backend is not available - File //Store all directly into file - }; - /// \brief The current backend - Backend currentBackend; - /// \brief To store QSettings for the backend - QSettings *settings; - #ifdef ULTRACOPIER_VERSION_PORTABLE - ResourcesManager *resources; - #endif // ULTRACOPIER_VERSION_PORTABLE - //the reset of right value of widget need be do into the calling object - void internal_resetToDefaultValue(); - //temp variable - int loop_size,loop_sub_size,indexGroup,indexGroupKey,index; - signals: - void newOptionValue(const QString&,const QString&,const QVariant&); - void resetOptions(); + /// \brief store the option group list + QHash > GroupKeysList; + QStringList unmanagedTabName; + /// \brief Enumeration of backend + enum Backend + { + Memory, //Do intensive usage of memory, used only if the file backend is not available + File //Store all directly into file + }; + /// \brief The current backend + Backend currentBackend; + /// \brief To store QSettings for the backend + QSettings *settings; + //the reset of right value of widget need be do into the calling object + void internal_resetToDefaultValue(); + signals: + void newOptionValue(const QString&,const QString&,const QVariant&) const; + void resetOptions() const; + public: + static OptionEngine *optionEngine; }; #endif // OPTION_ENGINE_H diff --git a/PlatformMacro.h b/PlatformMacro.h index 5b79534..d15329d 100644 --- a/PlatformMacro.h +++ b/PlatformMacro.h @@ -1,8 +1,6 @@ /** \file PlatformMacro.h \brief Define the macro for the platform \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include diff --git a/PluginInformation.cpp b/PluginInformation.cpp index 11912fa..3f5a09a 100644 --- a/PluginInformation.cpp +++ b/PluginInformation.cpp @@ -1,8 +1,6 @@ /** \file PluginInformation.cpp \brief Define the plugin information \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "PluginInformation.h" @@ -11,116 +9,116 @@ PluginInformation::PluginInformation() : ui(new Ui::PluginInformation) { - ui->setupUi(this); - pluginIsLoaded=false; + ui->setupUi(this); + pluginIsLoaded=false; } PluginInformation::~PluginInformation() { - delete ui; + delete ui; } -void PluginInformation::setPlugin(PluginsAvailable plugin) +void PluginInformation::setPlugin(const PluginsAvailable &plugin) { - this->plugin=plugin; - pluginIsLoaded=true; - retranslateInformation(); + this->plugin=plugin; + pluginIsLoaded=true; + retranslateInformation(); } -void PluginInformation::setLanguage(QString language) +void PluginInformation::setLanguage(const QString &language) { - this->language=language; + this->language=language; } -QString PluginInformation::categoryToTranslation(PluginType category) +QString PluginInformation::categoryToTranslation(const PluginType &category) const { - switch(category) - { - case PluginType_CopyEngine: - return tr("CopyEngine"); - break; - case PluginType_Languages: - return tr("Languages"); - break; - case PluginType_Listener: - return tr("Listener"); - break; - case PluginType_PluginLoader: - return tr("PluginLoader"); - break; - case PluginType_SessionLoader: - return tr("SessionLoader"); - break; - case PluginType_Themes: - return tr("Themes"); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"cat translation not found"); - return "Unknow"; - break; - } + switch(category) + { + case PluginType_CopyEngine: + return tr("Copy engine"); + break; + case PluginType_Languages: + return tr("Languages"); + break; + case PluginType_Listener: + return tr("Listener"); + break; + case PluginType_PluginLoader: + return tr("Plugin loader"); + break; + case PluginType_SessionLoader: + return tr("Session loader"); + break; + case PluginType_Themes: + return tr("Themes"); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"cat translation not found"); + return tr("Unknown"); + break; + } } void PluginInformation::retranslateInformation() { - if(!pluginIsLoaded) - return; - ui->retranslateUi(this); - this->setWindowTitle(tr("Information about %1").arg(plugin.name)); - ui->name->setText(plugin.name); - ui->title->setText(getTranslatedText(plugin,"title",language)); - ui->category->setText(categoryToTranslation(plugin.category)); - ui->author->setText(getInformationText(plugin,"author")); - QString website=getTranslatedText(plugin,"website",language); - ui->website->setText(""+website+""); - bool ok; - int timeStamps=getInformationText(plugin,"pubDate").toInt(&ok); - QDateTime date; - date.setTime_t(timeStamps); - ui->date->setDateTime(date); - if(!ok || timeStamps<=0) - ui->date->setEnabled(false); - ui->description->setPlainText(getTranslatedText(plugin,"description",language)); - ui->version->setText(getInformationText(plugin,"version")); + if(!pluginIsLoaded) + return; + ui->retranslateUi(this); + this->setWindowTitle(tr("Information about %1").arg(plugin.name)); + ui->name->setText(plugin.name); + ui->title->setText(getTranslatedText(plugin,QStringLiteral("title"),language)); + ui->category->setText(categoryToTranslation(plugin.category)); + ui->author->setText(getInformationText(plugin,QStringLiteral("author"))); + QString website=getTranslatedText(plugin,QStringLiteral("website"),language); + ui->website->setText(QStringLiteral("")+website+QStringLiteral("")); + bool ok; + int timeStamps=getInformationText(plugin,QStringLiteral("pubDate")).toInt(&ok); + QDateTime date; + date.setTime_t(timeStamps); + ui->date->setDateTime(date); + if(!ok || timeStamps<=0) + ui->date->setEnabled(false); + ui->description->setPlainText(getTranslatedText(plugin,QStringLiteral("description"),language)); + ui->version->setText(getInformationText(plugin,QStringLiteral("version"))); } /// \brief get informations text -QString PluginInformation::getInformationText(PluginsAvailable plugin,QString informationName) +QString PluginInformation::getInformationText(const PluginsAvailable &plugin,const QString &informationName) { - int index=0; - while(indexoptionDialog=optionDialog; - //load the overall instance - plugins=PluginsManager::getInstance(); - //load the plugin - plugins->lockPluginListEdition(); - qRegisterMetaType("PluginsAvailable"); - qRegisterMetaType("CatchState"); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - connect(plugins,SIGNAL(pluginListingIsfinish()), this,SLOT(allPluginIsloaded()),Qt::QueuedConnection); - QList list=plugins->getPluginsByCategory(PluginType_PluginLoader); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - needEnable=false; - last_state=Uncaught; - last_have_plugin=false; - last_inWaitOfReply=false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->optionDialog=optionDialog; + //load the overall instance + //load the plugin + PluginsManager::pluginsManager->lockPluginListEdition(); + connect(this,&PluginLoader::previouslyPluginAdded, this,&PluginLoader::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginAdded, this,&PluginLoader::onePluginAdded,Qt::QueuedConnection); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved,this,&PluginLoader::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish, this,&PluginLoader::allPluginIsloaded,Qt::QueuedConnection); + QList list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_PluginLoader); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + needEnable=false; + last_state=Ultracopier::Uncaught; + last_have_plugin=false; + last_inWaitOfReply=false; + stopIt=false; } PluginLoader::~PluginLoader() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QList list=plugins->getPluginsByCategory(PluginType_PluginLoader); - foreach(PluginsAvailable currentPlugin,list) - onePluginWillBeRemoved(currentPlugin); - PluginsManager::destroyInstanceAtTheLastCall(); + stopIt=true; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + { + /* why it crash here? Only under Window with PluginLoader/catchcopy-v0002 + int index=0; + while(indexsetEnabled(false); + if(pluginList.at(index).pluginLoader!=NULL) + { + if(!pluginList.at(index).pluginLoader->isLoaded() || pluginList.at(index).pluginLoader->unload()) + { + delete pluginList.at(index).options; + pluginList.removeAt(index); + } + else + index++; + } + else + index++; + }//*/ + } + #endif } void PluginLoader::resendState() { - sendState(true); + if(stopIt) + return; + sendState(true); } void PluginLoader::onePluginAdded(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_PluginLoader) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName("pluginLoader"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"try load: "+pluginPath); - QPluginLoader *pluginLoader= new QPluginLoader(pluginPath); - QObject *pluginInstance = pluginLoader->instance(); - if(pluginInstance) - { - PluginInterface_PluginLoader *PluginLoader = qobject_cast(pluginInstance); - //check if found - index=0; - loop_size=pluginList.size(); - while(indexunload(); - return; - } - index++; - } - if(PluginLoader) - { - #ifdef ULTRACOPIER_DEBUG - connect(PluginLoader,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SLOT(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif // ULTRACOPIER_DEBUG - LocalPlugin newEntry; - newEntry.options=new LocalPluginOptions("PluginLoader-"+plugin.name); - newEntry.pluginLoader = pluginLoader; - newEntry.PluginLoaderInterface = PluginLoader; - newEntry.path = plugin.path; - newEntry.state = Uncaught; - newEntry.inWaitOfReply = false; - pluginList << newEntry; - PluginLoader->setResources(newEntry.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); - optionDialog->addPluginOptionWidget(PluginType_PluginLoader,plugin.name,newEntry.PluginLoaderInterface->options()); - connect(pluginList.last().PluginLoaderInterface,SIGNAL(newState(CatchState)),this,SLOT(newState(CatchState))); - connect(languages,SIGNAL(newLanguageLoaded(QString)),newEntry.PluginLoaderInterface,SLOT(newLanguageLoaded())); - if(needEnable) - { - pluginList.last().inWaitOfReply=true; - newEntry.PluginLoaderInterface->setEnabled(needEnable); - } + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + if(stopIt) + return; + if(plugin.category!=PluginType_PluginLoader) + return; + LocalPlugin newEntry; + QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName(QStringLiteral("pluginLoader")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("try load: ")+pluginPath); + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + PluginInterface_PluginLoader *pluginLoaderInstance; + QObjectList objectList=QPluginLoader::staticInstances(); + int index=0; + QObject *pluginObject; + while(index(pluginObject); + if(pluginLoaderInstance!=NULL) + break; + index++; + } + if(index==objectList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("static listener not found")); + return; + } + newEntry.pluginLoader=NULL; + #else + QPluginLoader *pluginLoader= new QPluginLoader(pluginPath); + QObject *pluginInstance = pluginLoader->instance(); + if(!pluginInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin: ")+pluginLoader->errorString()); + return; + } + PluginInterface_PluginLoader *pluginLoaderInstance = qobject_cast(pluginInstance); + if(!pluginLoaderInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to cast the plugin: ")+pluginLoader->errorString()); + return; + } + newEntry.pluginLoader = pluginLoader; + //check if found + int index=0; + const int &loop_size=pluginList.size(); + while(indexunload(); + return; + } + index++; + } + #endif + #ifdef ULTRACOPIER_DEBUG + connect(pluginLoaderInstance,&PluginInterface_PluginLoader::debugInformation,this,&PluginLoader::debugInformation,Qt::DirectConnection); + #endif // ULTRACOPIER_DEBUG - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to cast the plugin: "+pluginLoader->errorString()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to load the plugin: "+pluginLoader->errorString()); + newEntry.options=new LocalPluginOptions(QStringLiteral("PluginLoader-")+plugin.name); + newEntry.pluginLoaderInterface = pluginLoaderInstance; + newEntry.path = plugin.path; + newEntry.state = Ultracopier::Uncaught; + newEntry.inWaitOfReply = false; + pluginList << newEntry; + pluginLoaderInstance->setResources(newEntry.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); + optionDialog->addPluginOptionWidget(PluginType_PluginLoader,plugin.name,newEntry.pluginLoaderInterface->options()); + connect(pluginList.last().pluginLoaderInterface,&PluginInterface_PluginLoader::newState,this,&PluginLoader::newState,Qt::DirectConnection); + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newEntry.pluginLoaderInterface,&PluginInterface_PluginLoader::newLanguageLoaded,Qt::DirectConnection); + if(needEnable) + { + pluginList.last().inWaitOfReply=true; + newEntry.pluginLoaderInterface->setEnabled(needEnable); + } + #else + Q_UNUSED(plugin); + #endif } +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void PluginLoader::onePluginWillBeRemoved(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_PluginLoader) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - index=0; - loop_size=pluginList.size(); - while(indexsetEnabled(false); - if(!pluginList.at(index).pluginLoader->isLoaded() || pluginList.at(index).pluginLoader->unload()) - { - delete pluginList.at(index).options; - pluginList.removeAt(index); - } - sendState(); - return; - } - index++; - } + if(stopIt) + return; + if(plugin.category!=PluginType_PluginLoader) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + const int &loop_size=pluginList.size(); + while(indexsetEnabled(false); + if(pluginList.at(index).pluginLoader!=NULL) + { + if(!pluginList.at(index).pluginLoader->isLoaded() || pluginList.at(index).pluginLoader->unload()) + { + delete pluginList.at(index).options; + pluginList.removeAt(index); + } + } + sendState(); + return; + } + index++; + } } +#endif void PluginLoader::load() { - needEnable=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(indexsetEnabled(true); - index++; - } - sendState(true); + if(stopIt) + return; + needEnable=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + while(indexsetEnabled(true); + index++; + } + sendState(true); } void PluginLoader::unload() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - needEnable=false; - int index=0; - while(indexsetEnabled(false); - index++; - } - sendState(true); + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + needEnable=false; + int index=0; + while(indexsetEnabled(false); + index++; + } + sendState(true); } #ifdef ULTRACOPIER_DEBUG -void PluginLoader::debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne) +void PluginLoader::debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne) { - DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Plugin loader plugin"); + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,QStringLiteral("Plugin loader plugin")); } #endif // ULTRACOPIER_DEBUG void PluginLoader::allPluginIsloaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"with value: "+QString::number(pluginList.size()>0)); - sendState(true); + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("with value: ")+QString::number(pluginList.size()>0)); + sendState(true); } void PluginLoader::sendState(bool force) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, pluginList.size(): %1, force: %2").arg(pluginList.size()).arg(force)); - CatchState current_state=Uncaught; - bool found_not_listen=false,found_listen=false,found_inWaitOfReply=false; - int index=0; - while(index0; - if(force || current_state!=last_state || have_plugin!=last_have_plugin || found_inWaitOfReply!=last_inWaitOfReply) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("send pluginLoaderReady(%1,%2,%3)").arg(current_state).arg(have_plugin).arg(found_inWaitOfReply)); - emit pluginLoaderReady(current_state,have_plugin,found_inWaitOfReply); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Skip the signal sending")); - last_state=current_state; - last_have_plugin=have_plugin; - last_inWaitOfReply=found_inWaitOfReply; + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, pluginList.size(): %1, force: %2").arg(pluginList.size()).arg(force)); + Ultracopier::CatchState current_state=Ultracopier::Uncaught; + bool found_not_listen=false,found_listen=false,found_inWaitOfReply=false; + int index=0; + while(index0; + if(force || current_state!=last_state || have_plugin!=last_have_plugin || found_inWaitOfReply!=last_inWaitOfReply) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("send pluginLoaderReady(%1,%2,%3)").arg(current_state).arg(have_plugin).arg(found_inWaitOfReply)); + emit pluginLoaderReady(current_state,have_plugin,found_inWaitOfReply); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Skip the signal sending")); + last_state=current_state; + last_have_plugin=have_plugin; + last_inWaitOfReply=found_inWaitOfReply; } -void PluginLoader::newState(const CatchState &state) +void PluginLoader::newState(const Ultracopier::CatchState &state) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, state: %1").arg(state)); - PluginInterface_PluginLoader *temp=qobject_cast(QObject::sender()); - if(temp==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("listener not located!")); - return; - } - int index=0; - while(index(QObject::sender()); + if(temp==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("listener not located!")); + return; + } + int index=0; + while(index #include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT #include +#endif #include #include #include "interface/PluginInterface_PluginLoader.h" #include "PluginsManager.h" -#include "GlobalClass.h" #include "OptionDialog.h" +#include "LocalPluginOptions.h" namespace Ui { class PluginLoaderOptions; @@ -32,48 +32,51 @@ namespace Ui { \see ResourcesManager::ResourcesManager() */ -class PluginLoader : public QObject, GlobalClass +class PluginLoader : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit PluginLoader(OptionDialog *optionDialog); - ~PluginLoader(); - /** \brief to rended the state */ - void resendState(); - /** \brief should load plugin into file manager if needed */ - void load(); - /** \brief should unload plugin into file manager */ - void unload(); + explicit PluginLoader(OptionDialog *optionDialog); + ~PluginLoader(); + /** \brief to rended the state */ + void resendState(); + /** \brief should load plugin into file manager if needed */ + void load(); + /** \brief should unload plugin into file manager */ + void unload(); private slots: - void onePluginAdded(const PluginsAvailable &plugin); - void onePluginWillBeRemoved(const PluginsAvailable &plugin); - #ifdef ULTRACOPIER_DEBUG - void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne); - #endif // ULTRACOPIER_DEBUG - void allPluginIsloaded(); - void newState(const CatchState &state); + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + #endif + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne); + #endif // ULTRACOPIER_DEBUG + void allPluginIsloaded(); + void newState(const Ultracopier::CatchState &state); private: - //variable - struct LocalPlugin - { - PluginInterface_PluginLoader * PluginLoaderInterface; - QPluginLoader * pluginLoader; - CatchState state; - QString path; - bool inWaitOfReply; - LocalPluginOptions *options; - }; - QList pluginList; - bool needEnable; - //temp variable - int index,loop_size; - CatchState last_state; - bool last_have_plugin,last_inWaitOfReply; - void sendState(bool force=false); - OptionDialog *optionDialog; + //variable + struct LocalPlugin + { + PluginInterface_PluginLoader * pluginLoaderInterface; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader * pluginLoader; + #endif + Ultracopier::CatchState state; + QString path; + bool inWaitOfReply; + LocalPluginOptions *options; + }; + QList pluginList; + bool needEnable; + Ultracopier::CatchState last_state; + bool last_have_plugin,last_inWaitOfReply; + void sendState(bool force=false); + OptionDialog *optionDialog; + bool stopIt; signals: - void pluginLoaderReady(CatchState state,bool havePlugin,bool someAreInWaitOfReply); - void previouslyPluginAdded(PluginsAvailable); + void pluginLoaderReady(const Ultracopier::CatchState &state,bool havePlugin,bool someAreInWaitOfReply) const; + void previouslyPluginAdded(const PluginsAvailable &plugin) const; }; #endif // PluginLoader_H diff --git a/PluginsManager.cpp b/PluginsManager.cpp index e3c71ec..1a8ad42 100644 --- a/PluginsManager.cpp +++ b/PluginsManager.cpp @@ -1,9 +1,7 @@ /** \file PluginsManager.cpp \brief Define the class to manage and load the plugins \author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ +\licence GPL3, see the file COPYING */ #include #include @@ -16,604 +14,636 @@ /// \brief Create the manager and load the defaults variables PluginsManager::PluginsManager() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //load the overall instance - pluginLoaded=false; - resources=ResourcesManager::getInstance(); - options=OptionEngine::getInstance(); - - language="en"; - stopIt=false; - editionSemList.release(); - checkPluginThread=new AuthPlugin(); - englishPluginType << "CopyEngine" << "Languages" << "Listener" << "PluginLoader" << "SessionLoader" << "Themes"; - //catPlugin << tr("CopyEngine") << tr("Languages") << tr("Listener") << tr("PluginLoader") << tr("SessionLoader") << tr("Themes"); - importingPlugin=false; - connect(&decodeThread, SIGNAL(decodedIsFinish()), this, SLOT(decodingFinished()),Qt::QueuedConnection); - connect(checkPluginThread, SIGNAL(authentifiedPath(QString)), this, SLOT(newAuthPath(QString)),Qt::QueuedConnection); - connect(this, SIGNAL(finished()), this, SLOT(post_operation()),Qt::QueuedConnection); - connect(this, SIGNAL(newLanguageLoaded()), &pluginInformationWindows, SLOT(retranslateInformation()),Qt::QueuedConnection); -// connect(this, SIGNAL(pluginListingIsfinish()), options,SLOT(setInterfaceValue())); - //load the plugins list - /// \bug bug when I put here: moveToThread(this);, due to the direction connection to remove the plugin - start(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //load the overall instance + pluginLoaded = false; + language = QStringLiteral("en"); + stopIt = false; + pluginInformation = NULL; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + importingPlugin = false; + #endif + editionSemList.release(); + englishPluginType << QStringLiteral("CopyEngine") << QStringLiteral("Languages") << QStringLiteral("Listener") << QStringLiteral("PluginLoader") << QStringLiteral("SessionLoader") << QStringLiteral("Themes"); + //catPlugin << tr("CopyEngine") << tr("Languages") << tr("Listener") << tr("PluginLoader") << tr("SessionLoader") << tr("Themes"); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + connect(&decodeThread, &QXzDecodeThread::decodedIsFinish, this, &PluginsManager::decodingFinished,Qt::QueuedConnection); + #endif + connect(this, &PluginsManager::finished, this, &PluginsManager::post_operation,Qt::QueuedConnection); +// connect(this, &PluginsManager::pluginListingIsfinish, options,&OptionEngine::setInterfaceValue); + //load the plugins list + + /// \bug bug when I put here: moveToThread(this);, due to the direction connection to remove the plugin + start(); } /// \brief Destroy the manager PluginsManager::~PluginsManager() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - int loop_size=pluginsList.size(); - while(indexisRunning()) - this->wait(0); - delete checkPluginThread; - OptionEngine::destroyInstanceAtTheLastCall(); - ResourcesManager::destroyInstanceAtTheLastCall(); + stopIt=true; + if(pluginInformation!=NULL) + delete pluginInformation; + if(this->isRunning()) + this->wait(0); } /// \brief set current language void PluginsManager::setLanguage(const QString &language) { - this->language=language; + this->language=language; } void PluginsManager::post_operation() { - pluginLoaded=true; - emit pluginListingIsfinish(); + pluginLoaded=true; + emit pluginListingIsfinish(); } -bool PluginsManager::allPluginHaveBeenLoaded() +bool PluginsManager::allPluginHaveBeenLoaded() const { - return pluginLoaded; + return pluginLoaded; } void PluginsManager::lockPluginListEdition() { - editionSemList.acquire(); + editionSemList.acquire(); } void PluginsManager::unlockPluginListEdition() { - editionSemList.release(); + editionSemList.release(); } void PluginsManager::run() { - //load the path and plugins into the path - QStringList readPath; - readPath << resources->getReadPath(); - pluginsList.clear(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"pluginsList.size(): "+QString::number(pluginsList.size())); - foreach(QString basePath,readPath) - { - foreach(QString dirSub,englishPluginType) - { - QString pluginComposed=basePath+dirSub+QDir::separator(); - QDir dir(pluginComposed); - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"search plugin into: "+pluginComposed); - if(dir.exists()) - { - foreach(QString dirName, dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot)) - { - if(stopIt) - return; - loadPluginInformation(pluginComposed+dirName+QDir::separator()); - } - } - } - } - #ifdef ULTRACOPIER_DEBUG - int index=0; - int loop_size=pluginsList.size(); - while(indexloadSearchPath(readPath,englishPluginType); - checkPluginThread->stop(); - checkPluginThread->start(); - checkDependencies(); -} - -QString PluginsManager::categoryToString(const PluginType &category) -{ - switch(category) - { - case PluginType_CopyEngine: - return "CopyEngine"; - break; - case PluginType_Languages: - return "Languages"; - break; - case PluginType_Listener: - return "Listener"; - break; - case PluginType_PluginLoader: - return "PluginLoader"; - break; - case PluginType_SessionLoader: - return "SessionLoader"; - break; - case PluginType_Themes: - return "Themes"; - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"cat text not found"); - return "Unknow"; - break; - } + regexp_to_clean_1=QRegularExpression(QStringLiteral("[\n\r]+")); + regexp_to_clean_2=QRegularExpression(QStringLiteral("[ \t]+")); + regexp_to_clean_3=QRegularExpression(QStringLiteral("(&&)+")); + regexp_to_clean_4=QRegularExpression(QStringLiteral("^&&")); + regexp_to_clean_5=QRegularExpression(QStringLiteral("&&$")); + regexp_to_dep_1=QRegularExpression(QStringLiteral("(&&|\\|\\||\\(|\\))")); + regexp_to_dep_2=QRegularExpression(QStringLiteral("^(<=|<|=|>|>=)[a-zA-Z0-9\\-]+-([0-9]+\\.)*[0-9]+$")); + regexp_to_dep_3=QRegularExpression(QStringLiteral("(<=|<|=|>|>=)")); + regexp_to_dep_4=QRegularExpression(QStringLiteral("-([0-9]+\\.)*[0-9]+")); + regexp_to_dep_5=QRegularExpression(QStringLiteral("[a-zA-Z0-9\\-]+-")); + regexp_to_dep_6=QRegularExpression(QStringLiteral("[a-zA-Z0-9\\-]+-([0-9]+\\.)*[0-9]+")); + + //load the path and plugins into the path + QStringList readPath; + readPath << ResourcesManager::resourcesManager->getReadPath(); + pluginsList.clear(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("pluginsList.size(): ")+QString::number(pluginsList.size())); + foreach(QString basePath,readPath) + { + foreach(QString dirSub,englishPluginType) + { + QString pluginComposed=basePath+dirSub+QDir::separator(); + QDir dir(pluginComposed); + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("search plugin into: ")+pluginComposed); + if(dir.exists()) + { + foreach(QString dirName, dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot)) + { + if(stopIt) + return; + loadPluginInformation(pluginComposed+dirName+QDir::separator()); + } + } + } + } + #ifdef ULTRACOPIER_DEBUG + int index_debug=0; + const int &loop_size=pluginsList.size(); + while(index_debug list; + int index=0; + while(indexcategoryToTranslation(category); } bool PluginsManager::isSamePlugin(const PluginsAvailable &pluginA,const PluginsAvailable &pluginB) { - /*if(pluginA.category!=pluginB.category) - return false;*/ - //only this test should be suffisent - if(pluginA.path!=pluginB.path) - return false; - /*if(pluginA.name!=pluginB.name) - return false; - if(pluginA.writablePath!=pluginB.writablePath) - return false; - if(pluginA.categorySpecific!=pluginB.categorySpecific) - return false; - if(pluginA.version!=pluginB.version) - return false; - if(pluginA.informations!=pluginB.informations) - return false;*/ - return true; + /*if(pluginA.category!=pluginB.category) + return false;*/ + //only this test should be suffisent + if(pluginA.path!=pluginB.path) + return false; + /*if(pluginA.name!=pluginB.name) + return false; + if(pluginA.writablePath!=pluginB.writablePath) + return false; + if(pluginA.categorySpecific!=pluginB.categorySpecific) + return false; + if(pluginA.version!=pluginB.version) + return false; + if(pluginA.informations!=pluginB.informations) + return false;*/ + return true; } bool PluginsManager::loadPluginInformation(const QString &path) { - PluginsAvailable tempPlugin; - tempPlugin.isAuth = false; - tempPlugin.path = path; - tempPlugin.category = PluginType_Unknow; - QDir pluginPath(path); - if(pluginPath.cdUp() && pluginPath.cdUp() && - resources->getWritablePath()!="" && - pluginPath==QDir(resources->getWritablePath())) - tempPlugin.isWritable=true; - else - tempPlugin.isWritable=false; - QFile xmlMetaData(path+"informations.xml"); - if(xmlMetaData.exists()) - { - if(xmlMetaData.open(QIODevice::ReadOnly)) - { - loadPluginXml(&tempPlugin,xmlMetaData.readAll()); - xmlMetaData.close(); - } - else - { - tempPlugin.errorString=tr("informations.xml is not accessible"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"informations.xml is not accessible into the plugin: "+path); - } - } - else - { - tempPlugin.errorString=tr("informations.xml not found into the plugin"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"informations.xml not found into the plugin: "+path); - } - editionSemList.acquire(); - pluginsList << tempPlugin; - if(tempPlugin.errorString=="") - pluginsListIndexed.insert(tempPlugin.category,tempPlugin); - editionSemList.release(); - if(tempPlugin.errorString=="") - { - emit onePluginAdded(tempPlugin); - return true; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Error detected, the not loaded: "+tempPlugin.errorString+", for path: "+tempPlugin.path); - return false; - } + PluginsAvailable tempPlugin; + tempPlugin.isAuth = false; + tempPlugin.path = path; + tempPlugin.category = PluginType_Unknow; + QDir pluginPath(path); + if(pluginPath.cdUp() && pluginPath.cdUp() && + ResourcesManager::resourcesManager->getWritablePath()!="" && + pluginPath==QDir(ResourcesManager::resourcesManager->getWritablePath())) + tempPlugin.isWritable=true; + else + tempPlugin.isWritable=false; + QFile xmlMetaData(path+QStringLiteral("informations.xml")); + if(xmlMetaData.exists()) + { + if(xmlMetaData.open(QIODevice::ReadOnly)) + { + loadPluginXml(&tempPlugin,xmlMetaData.readAll()); + xmlMetaData.close(); + } + else + { + tempPlugin.errorString=tr("informations.xml is not accessible"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("informations.xml is not accessible into the plugin: ")+path); + } + } + else + { + tempPlugin.errorString=tr("informations.xml not found for the plugin"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("informations.xml not found for the plugin: ")+path); + } + editionSemList.acquire(); + pluginsList << tempPlugin; + if(tempPlugin.errorString==QStringLiteral("")) + pluginsListIndexed.insert(tempPlugin.category,tempPlugin); + editionSemList.release(); + if(tempPlugin.errorString==QStringLiteral("")) + return true; + else + { + emit onePluginInErrorAdded(tempPlugin); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Error detected, the not loaded: ")+tempPlugin.errorString+QStringLiteral(", for path: ")+tempPlugin.path); + return false; + } } void PluginsManager::loadPluginXml(PluginsAvailable * thePlugin,const QByteArray &xml) { - QString errorStr; - int errorLine; - int errorColumn; - QDomDocument domDocument; - if (!domDocument.setContent(xml, false, &errorStr,&errorLine,&errorColumn)) - { - thePlugin->errorString=tr("%1, parse error at line %2, column %3: %4").arg("informations.xml").arg(errorLine).arg(errorColumn).arg(errorStr); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("%1, Parse error at line %2, column %3: %4").arg("informations.xml").arg(errorLine).arg(errorColumn).arg(errorStr)); - } - else - { - QDomElement root = domDocument.documentElement(); - if (root.tagName() != "package") - { - thePlugin->errorString=tr("\"package\" root tag not found for the xml file"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"\"package\" root balise not found for the xml file"); - } - //load the variable - if(thePlugin->errorString=="") - loadBalise(root,"title",&(thePlugin->informations),&(thePlugin->errorString),true,true,true); - if(thePlugin->errorString=="") - loadBalise(root,"website",&(thePlugin->informations),&(thePlugin->errorString),false,true); - if(thePlugin->errorString=="") - loadBalise(root,"description",&(thePlugin->informations),&(thePlugin->errorString),true,true,true); - if(thePlugin->errorString=="") - loadBalise(root,"author",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - loadBalise(root,"pubDate",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - { - loadBalise(root,"version",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - thePlugin->version=thePlugin->informations.last().last(); - } - if(thePlugin->errorString=="") - { - loadBalise(root,"category",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - { - QString tempCat=thePlugin->informations.last().last(); - if(tempCat=="Languages") - thePlugin->category=PluginType_Languages; - else if(tempCat=="CopyEngine") - thePlugin->category=PluginType_CopyEngine; - else if(tempCat=="Listener") - thePlugin->category=PluginType_Listener; - else if(tempCat=="PluginLoader") - thePlugin->category=PluginType_PluginLoader; - else if(tempCat=="SessionLoader") - thePlugin->category=PluginType_SessionLoader; - else if(tempCat=="Themes") - thePlugin->category=PluginType_Themes; - else - thePlugin->errorString="Unknow category: "+QString::number((int)thePlugin->category); - if(thePlugin->errorString.isEmpty()) - { - if(thePlugin->category!=PluginType_Languages) - { - loadBalise(root,"architecture",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - { - #ifndef ULTRACOPIER_VERSION_PORTABLE - if(thePlugin->informations.last().last()!=ULTRACOPIER_PLATFORM_CODE) - thePlugin->errorString="Wrong platform code: "+thePlugin->informations.last().last(); - #endif - } - } - } - } - } - if(thePlugin->errorString=="") - { - loadBalise(root,"name",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - { - thePlugin->name=thePlugin->informations.last().last(); - int index=0; - int loop_size=pluginsList.size(); - int sub_index,loop_sub_size; - while(indexname && - pluginsList.at(index).category==thePlugin->category) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Plugin duplicate found ("+QString::number((int)thePlugin->category)+"/"+pluginsList.at(index).informations.at(sub_index).last()+"), already loaded, actual version skipped: "+thePlugin->version); - thePlugin->errorString=tr("Duplicated plugin found, already loaded!"); - break; - break; - } - sub_index++; - } - index++; - } - } - } - if(thePlugin->errorString=="") - loadBalise(root,"dependencies",&(thePlugin->informations),&(thePlugin->errorString),true,false); - if(thePlugin->errorString=="") - { - QDomElement child = root.firstChildElement("categorySpecific"); - if(!child.isNull() && child.isElement()) - thePlugin->categorySpecific=child; - } - } + QString errorStr; + int errorLine; + int errorColumn; + QDomDocument domDocument; + if (!domDocument.setContent(xml, false, &errorStr,&errorLine,&errorColumn)) + { + thePlugin->errorString=tr("%1, parse error at line %2, column %3: %4").arg(QStringLiteral("informations.xml")).arg(errorLine).arg(errorColumn).arg(errorStr); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("%1, Parse error at line %2, column %3: %4").arg(QStringLiteral("informations.xml")).arg(errorLine).arg(errorColumn).arg(errorStr)); + } + else + { + QDomElement root = domDocument.documentElement(); + if (root.tagName() != QStringLiteral("package")) + { + thePlugin->errorString=tr("\"package\" root tag not found for the xml file"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("\"package\" root balise not found for the xml file")); + } + //load the variable + if(thePlugin->errorString.isEmpty()) + loadBalise(root,QStringLiteral("title"),&(thePlugin->informations),&(thePlugin->errorString),true,true,true); + if(thePlugin->errorString.isEmpty()) + loadBalise(root,QStringLiteral("website"),&(thePlugin->informations),&(thePlugin->errorString),false,true); + if(thePlugin->errorString.isEmpty()) + loadBalise(root,QStringLiteral("description"),&(thePlugin->informations),&(thePlugin->errorString),true,true,true); + if(thePlugin->errorString.isEmpty()) + loadBalise(root,QStringLiteral("author"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + loadBalise(root,QStringLiteral("pubDate"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + { + loadBalise(root,QStringLiteral("version"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + thePlugin->version=thePlugin->informations.last().last(); + } + if(thePlugin->errorString.isEmpty()) + { + loadBalise(root,QStringLiteral("category"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + { + QString tempCat=thePlugin->informations.last().last(); + if(tempCat==QStringLiteral("Languages")) + thePlugin->category=PluginType_Languages; + else if(tempCat==QStringLiteral("CopyEngine")) + thePlugin->category=PluginType_CopyEngine; + else if(tempCat==QStringLiteral("Listener")) + thePlugin->category=PluginType_Listener; + else if(tempCat==QStringLiteral("PluginLoader")) + thePlugin->category=PluginType_PluginLoader; + else if(tempCat==QStringLiteral("SessionLoader")) + thePlugin->category=PluginType_SessionLoader; + else if(tempCat==QStringLiteral("Themes")) + thePlugin->category=PluginType_Themes; + else + thePlugin->errorString=QStringLiteral("Unknow category: ")+QString::number((int)thePlugin->category); + if(thePlugin->errorString.isEmpty()) + { + if(thePlugin->category!=PluginType_Languages) + { + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + loadBalise(root,QStringLiteral("architecture"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + { + if(thePlugin->informations.last().last()!=ULTRACOPIER_PLATFORM_CODE) + thePlugin->errorString=QStringLiteral("Wrong platform code: ")+thePlugin->informations.last().last(); + } + #endif + } + } + } + } + if(thePlugin->errorString.isEmpty()) + { + loadBalise(root,QStringLiteral("name"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + { + thePlugin->name=thePlugin->informations.last().last(); + int index=0; + const int &loop_size=pluginsList.size(); + int sub_index,loop_sub_size; + while(indexname && + pluginsList.at(index).category==thePlugin->category) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Plugin duplicate found ("+QString::number((int)thePlugin->category)+"/"+pluginsList.at(index).informations.at(sub_index).last()+"), already loaded, actual version skipped: "+thePlugin->version); + thePlugin->errorString=tr("Duplicated plugin found, already loaded!"); + break; + break; + } + sub_index++; + } + index++; + } + } + } + if(thePlugin->errorString.isEmpty()) + loadBalise(root,QStringLiteral("dependencies"),&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.isEmpty()) + { + QDomElement child = root.firstChildElement(QStringLiteral("categorySpecific")); + if(!child.isNull() && child.isElement()) + thePlugin->categorySpecific=child; + } + } } /// \brief to load the multi-language balise void PluginsManager::loadBalise(const QDomElement &root,const QString &name,QList *informations,QString *errorString,bool needHaveOneEntryMinimum,bool multiLanguage,bool englishNeedBeFound) { - int foundElement=0; - bool englishTextIsFoundForThisChild=false; - QDomElement child = root.firstChildElement(name); - while(!child.isNull()) - { - if(child.isElement()) - { - QStringList newInformations; - if(multiLanguage) - { - if(child.hasAttribute("xml:lang")) - { - if(child.attribute("xml:lang")=="en") - englishTextIsFoundForThisChild=true; - foundElement++; - newInformations << child.tagName() << child.attribute("xml:lang") << child.text(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Have not the attribute xml:lang: child.tagName(): %1, child.text(): %2").arg(child.tagName()).arg(child.text())); - } - else - { - foundElement++; - newInformations << child.tagName() << child.text(); - } - *informations << newInformations; - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Is not Element: child.tagName(): %1").arg(child.tagName())); - child = child.nextSiblingElement(name); - } - if(multiLanguage && englishTextIsFoundForThisChild==false && englishNeedBeFound) - { - informations->clear(); - *errorString=tr("English text missing into the informations.xml for the tag: %1").arg(name); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("English text missing into the informations.xml for the tag: %1").arg(name)); - return; - } - if(needHaveOneEntryMinimum && foundElement==0) - { - informations->clear(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Tag not found: %1").arg(name)); - *errorString=tr("Tag not found: %1").arg(name); - } + int foundElement=0; + bool englishTextIsFoundForThisChild=false; + QDomElement child = root.firstChildElement(name); + while(!child.isNull()) + { + if(child.isElement()) + { + QStringList newInformations; + if(multiLanguage) + { + if(child.hasAttribute(QStringLiteral("xml:lang"))) + { + if(child.attribute(QStringLiteral("xml:lang"))==QStringLiteral("en")) + englishTextIsFoundForThisChild=true; + foundElement++; + newInformations << child.tagName() << child.attribute(QStringLiteral("xml:lang")) << child.text(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Have not the attribute xml:lang: child.tagName(): %1, child.text(): %2").arg(child.tagName()).arg(child.text())); + } + else + { + foundElement++; + newInformations << child.tagName() << child.text(); + } + *informations << newInformations; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Is not Element: child.tagName(): %1").arg(child.tagName())); + child = child.nextSiblingElement(name); + } + if(multiLanguage && englishTextIsFoundForThisChild==false && englishNeedBeFound) + { + informations->clear(); + *errorString=tr("English text missing in the informations.xml for the tag: %1").arg(name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("English text missing into the informations.xml for the tag: %1").arg(name)); + return; + } + if(needHaveOneEntryMinimum && foundElement==0) + { + informations->clear(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Tag not found: %1").arg(name)); + *errorString=tr("Tag not found: %1").arg(name); + } } /// \brief to load the get dom specific -QString PluginsManager::getDomSpecific(const QDomElement &root,const QString &name,const QList > &listChildAttribute) -{ - QDomElement child = root.firstChildElement(name); - int index,loop_size; - bool allIsFound; - while(!child.isNull()) - { - if(child.isElement()) - { - allIsFound=true; - index=0; - loop_size=listChildAttribute.size(); - while(index > &listChildAttribute) const +{ + QDomElement child = root.firstChildElement(name); + int index,loop_size; + bool allIsFound; + while(!child.isNull()) + { + if(child.isElement()) + { + allIsFound=true; + index=0; + loop_size=listChildAttribute.size(); + while(index|>=)[a-zA-Z0-9\\-]+-([0-9]+\\.)*[0-9]+$"))) - { - pluginsList[index].informations.clear(); - pluginsList[index].errorString=tr("Dependencies part is wrong"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Dependencies part is wrong: %1").arg(dependenciesToParse)); - break; - } - QString partName=dependenciesToParse; - partName=partName.remove(QRegExp("(<=|<|=|>|>=)")); - partName=partName.remove(QRegExp("-([0-9]+\\.)*[0-9]+")); - QString partVersion=dependenciesToParse; - partVersion=partVersion.remove(QRegExp("(<=|<|=|>|>=)")); - partVersion=partVersion.remove(QRegExp("[a-zA-Z0-9\\-]+-")); - QString partComp=dependenciesToParse; - partComp=partComp.remove(QRegExp("[a-zA-Z0-9\\-]+-([0-9]+\\.)*[0-9]+")); - //current version soft - QString pluginVersion=getPluginVersion(partName); - depCheck=compareVersion(pluginVersion,partComp,partVersion); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"dependencies to resolv, partName: "+partName+", partVersion: "+partVersion+", partComp: "+partComp+", pluginVersion: "+pluginVersion+", depCheck: "+QString::number(depCheck)); - if(!depCheck) - { - pluginsList[index].informations.clear(); - pluginsList[index].errorString=tr("Dependencies %1 are not satisfied, for plugin: %2").arg(dependenciesToParse).arg(pluginsList[index].path); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Dependencies %1 are not satisfied, for plugin: %2").arg(dependenciesToParse).arg(pluginsList[index].path)); - break; - } - indexOfDependencies++; - } - } - sub_index++; - } - index++; - } +quint32 PluginsManager::checkDependencies() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + quint32 errors=0; + int index=0; + const int &loop_size=pluginsList.size(); + int sub_index,loop_sub_size,resolv_size,indexOfDependencies; + bool depCheck; + while(index") - defaultReturnValue=false; - while(indexreaNumberB) - return false; - if(reaNumberA") - { - if(reaNumberAreaNumberB) - return true; - } - if(sign=="<=") - { - if(reaNumberA>reaNumberB) - return false; - if(reaNumberA=") - { - if(reaNumberAreaNumberB) - return true; - } - index++; - } - return defaultReturnValue; -} - -QList PluginsManager::getPluginsByCategory(const PluginType &category) -{ - return pluginsListIndexed.values(category); -} - -QList PluginsManager::getPlugins() -{ - QList list; - int index=0; - while(index")) + defaultReturnValue=false; + while(indexreaNumberB) + return false; + if(reaNumberA")) + { + if(reaNumberAreaNumberB) + return true; + } + if(sign==QStringLiteral("<=")) + { + if(reaNumberA>reaNumberB) + return false; + if(reaNumberA=")) + { + if(reaNumberAreaNumberB) + return true; + } + index++; + } + return defaultReturnValue; +} + +QList PluginsManager::getPluginsByCategory(const PluginType &category) const +{ + return pluginsListIndexed.values(category); +} + +QList PluginsManager::getPlugins(bool withError) const +{ + QList list; + int index=0; + while(indexsetLanguage(mainShortName); + pluginInformation->setPlugin(pluginsList.at(index)); + pluginInformation->show(); + return; + } + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("item not selected")); } void PluginsManager::showInformationDoubleClick() @@ -621,263 +651,275 @@ void PluginsManager::showInformationDoubleClick() // showInformation(false); } +#ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT void PluginsManager::removeThePluginSelected(const QString &path) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(index dataList = tarFile.getDataList(); - if(fileList.size()>1) - { - QString basePluginArchive=""; - /* block use less for tar? - if(fileList.at(0).contains(QRegExp("[\\/]"))) - { - bool folderFoundEveryWhere=true; - basePluginArchive=fileList.at(0); - basePluginArchive.remove(QRegExp("[\\/].*$")); - for (int i = 0; i < list.size(); ++i) - { - if(!fileList.at(i).startsWith(basePluginArchive)) - { - folderFoundEveryWhere=false; - break; - } - } - if(folderFoundEveryWhere) - { - for (int i = 0; i < fileList.size(); ++i) - fileList[i].remove(0,basePluginArchive.size()); - } - else - basePluginArchive=""; - }*/ - PluginsAvailable tempPlugin; - QString categoryFinal=""; - for (int i = 0; i < fileList.size(); ++i) - if(fileList.at(i)=="informations.xml") - { - loadPluginXml(&tempPlugin,dataList.at(i)); - break; - } - if(tempPlugin.errorString=="") - { - categoryFinal=categoryToString(tempPlugin.category); - if(categoryFinal!="") - { - QString writablePath=resources->getWritablePath(); - if(writablePath!="") - { - QDir dir; - QString finalPluginPath=writablePath+categoryFinal+QDir::separator()+tempPlugin.name+QDir::separator(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"writablePath: \""+writablePath+"\""); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"basePluginArchive: \""+basePluginArchive+"\""); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"categoryFinal: \""+categoryFinal+"\""); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"finalPluginPath: \""+finalPluginPath+"\""); - if(!dir.exists(finalPluginPath)) - { - bool errorFound=false; - for (int i = 0; i < fileList.size(); ++i) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"file "+QString::number(i)+": "+finalPluginPath+fileList.at(i)); - fileList[i].remove(QRegExp("^(..?[\\/])+")); - QFile currentFile(finalPluginPath+fileList.at(i)); - QFileInfo info(currentFile); - if(!dir.exists(info.absolutePath())) - if(!dir.mkpath(info.absolutePath())) - { - resources->disableWritablePath(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Unable to make the path: "+info.absolutePath()); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to create a folder to install the plugin:\n%1").arg(info.absolutePath())); - errorFound=true; - break; - } - if(currentFile.open(QIODevice::ReadWrite)) - { - currentFile.write(dataList.at(i)); - currentFile.close(); - } - else - { - resources->disableWritablePath(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Unable to make the file: "+info.absolutePath()+", error:"+currentFile.errorString()); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to create a file to install the plugin:\n%1\nsince:%2").arg(info.absolutePath()).arg(currentFile.errorString())); - errorFound=true; - break; - } - } - if(!errorFound) - { - if(loadPluginInformation(finalPluginPath)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"push the new plugin into the real list"); - checkDependencies(); - emit needLangToRefreshPluginList(); - } - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Folder with same name is present, skip the plugin installation: "+finalPluginPath); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Folder with same name is present, skip the plugin installation:\n%1").arg(finalPluginPath)); - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Have not writable path, then how add you plugin?"); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it")); - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"category into informations.xml not found!"); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it")); - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Error in the xml: "+tempPlugin.errorString); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it: %1").arg(tempPlugin.errorString)); - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"No file found into the plugin"); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it")); - } - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"decodeThread.errorFound(), error: "+decodeThread.errorString()); - QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it: %1").arg(decodeThread.errorString())); - } - importingPlugin=false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(!decodeThread.errorFound()) + { + QByteArray data=decodeThread.decodedData(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"data.size(): "+QString::number(data.size())); + QTarDecode tarFile; + std::vector cppdata; + cppdata.resize(data.size()); + memcpy(cppdata.data(),data.data(),data.size()); + if(!tarFile.decodeData(cppdata)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"tarFile.errorString(): "+QString::fromStdString(tarFile.errorString())); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it: %1").arg(QString::fromStdString(tarFile.errorString()))); + } + else + { + std::vector fileList = tarFile.getFileList(); + std::vector > dataList = tarFile.getDataList(); + if(fileList.size()>1) + { + QString basePluginArchive=QStringLiteral(""); + /* block use less for tar? + if(fileList.at(0).contains(QRegularExpression("[\\/]"))) + { + bool folderFoundEveryWhere=true; + basePluginArchive=fileList.at(0); + basePluginArchive.remove(QRegularExpression("[\\/].*$")); + for (int i = 0; i < list.size(); ++i) + { + if(!fileList.at(i).startsWith(basePluginArchive)) + { + folderFoundEveryWhere=false; + break; + } + } + if(folderFoundEveryWhere) + { + for (int i = 0; i < fileList.size(); ++i) + fileList[i].remove(0,basePluginArchive.size()); + } + else + basePluginArchive=""; + }*/ + PluginsAvailable tempPlugin; + QString categoryFinal=QStringLiteral(""); + for (unsigned int i = 0; i < fileList.size(); ++i) + if(fileList.at(i)=="informations.xml") + { + loadPluginXml(&tempPlugin,QByteArray(dataList.at(i).data(),dataList.at(i).size())); + break; + } + if(tempPlugin.errorString=="") + { + categoryFinal=categoryToString(tempPlugin.category); + if(categoryFinal!="") + { + QString writablePath=ResourcesManager::resourcesManager->getWritablePath(); + if(writablePath!="") + { + QDir dir; + QString finalPluginPath=writablePath+categoryFinal+QDir::separator()+tempPlugin.name+QDir::separator(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"writablePath: \""+writablePath+"\""); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"basePluginArchive: \""+basePluginArchive+"\""); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"categoryFinal: \""+categoryFinal+"\""); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"finalPluginPath: \""+finalPluginPath+"\""); + if(!dir.exists(finalPluginPath)) + { + bool errorFound=false; + for (unsigned int i = 0; i < fileList.size(); ++i) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"file "+QString::number(i)+": "+finalPluginPath+QString::fromStdString(fileList.at(i))); + QString fileListEntry=QString::fromStdString(fileList[i]); + fileListEntry.remove(QRegularExpression("^(..?[\\/])+")); + QFile currentFile(finalPluginPath+fileListEntry); + QFileInfo info(currentFile); + if(!dir.exists(info.absolutePath())) + if(!dir.mkpath(info.absolutePath())) + { + ResourcesManager::resourcesManager->disableWritablePath(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Unable to make the path: "+info.absolutePath()); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to create a folder to install the plugin:\n%1").arg(info.absolutePath())); + errorFound=true; + break; + } + if(currentFile.open(QIODevice::ReadWrite)) + { + currentFile.write(QByteArray(dataList.at(i).data(),dataList.at(i).size())); + currentFile.close(); + } + else + { + ResourcesManager::resourcesManager->disableWritablePath(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Unable to make the file: "+info.absolutePath()+", error:"+currentFile.errorString()); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to create a file to install the plugin:\n%1\nsince:%2").arg(info.absolutePath()).arg(currentFile.errorString())); + errorFound=true; + break; + } + } + if(!errorFound) + { + if(loadPluginInformation(finalPluginPath)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"push the new plugin into the real list"); + while(checkDependencies()!=0){}; + emit needLangToRefreshPluginList(); + emit manuallyAdded(tempPlugin); + } + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Folder with same name is present, skip the plugin installation: "+finalPluginPath); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Folder with same name is present, skip the plugin installation:\n%1").arg(finalPluginPath)); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Have not writable path, then how add you plugin?"); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it")); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"category into informations.xml not found!"); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it")); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error in the xml: "+tempPlugin.errorString); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it: %1").arg(tempPlugin.errorString)); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"No file found into the plugin"); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it")); + } + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"decodeThread.errorFound(), error: "+decodeThread.errorString()); + QMessageBox::critical(NULL,tr("Plugin loader"),tr("Unable to load the plugin content, please check it: %1").arg(decodeThread.errorString())); + } + importingPlugin=false; } +#endif +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void PluginsManager::newAuthPath(const QString &path) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(index #include #include +#include +#include #include "Environment.h" -#include "Singleton.h" #include "OptionEngine.h" #include "ResourcesManager.h" #include "PluginInformation.h" +#ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT #include "QXzDecodeThread.h" #include "QTarDecode.h" -#include "AuthPlugin.h" +#endif namespace Ui { class PluginOptions; @@ -38,106 +38,115 @@ namespace Ui { /** \brief Define the class to manage and load the resources linked with the themes This class provide a core load and manage the resources */ -class PluginsManager : public QThread, public Singleton +class PluginsManager : public QThread { - Q_OBJECT - friend class Singleton; - public: - /// \brief to get plugins of type specific - QList getPluginsByCategory(const PluginType &type); - /** \brief to get plugins */ - QList getPlugins(); - /// \brief get translated text - //QString getTranslatedText(PluginsAvailable plugin,QString informationName,QString mainShortName); - //QString getTranslatedText(PluginsAvailable plugin,QString informationName); - /// \brief transform short plugin name into file name - static QString getResolvedPluginName(const QString &name); - static bool isSamePlugin(const PluginsAvailable &pluginA,const PluginsAvailable &pluginB); - void lockPluginListEdition(); - void unlockPluginListEdition(); - bool allPluginHaveBeenLoaded(); - /// \brief to load the get dom specific - QString getDomSpecific(const QDomElement &root,const QString &name,const QList > &listChildAttribute); - QString getDomSpecific(const QDomElement &root,const QString &name); - /// \brief set current language - void setLanguage(const QString &language); - /// \brief Enumeration of plugin add backend - enum ImportBackend - { - ImportBackend_File, //import plugin from local file - ImportBackend_Internet //import plugin form internet - }; - private: - /// \brief Create the manager and load the defaults variables - PluginsManager(); - /// \brief Destroy the language manager - ~PluginsManager(); - /// \brief get informations text - //QString getInformationText(PluginsAvailable plugin,QString informationName); - //for the options - OptionEngine *options; - /// \brief Store the object of resources manager - ResourcesManager *resources; - /// \brief List of plugins - QList pluginsList; - QMultiMap pluginsListIndexed; - /// \brief to load the multi-language balise - void loadBalise(const QDomElement &root,const QString &name,QList *informations,QString *errorString,bool needHaveOneEntryMinimum=true,bool multiLanguage=false,bool englishNeedBeFound=false); - /// \brief check the dependencies - void checkDependencies(); - /// \brief get the version - QString getPluginVersion(const QString &pluginName); - /// \brief To compare version - bool compareVersion(const QString &versionA,const QString &sign,const QString &versionB); - /// \brief plugin information windows - PluginInformation pluginInformationWindows; - /// \brief list of cat plugin type - //QStringList catPlugin; - QStringList englishPluginType; - QList catItemList; - /// \brief store the current mainShortName - QString mainShortName; - /// \brief load the plugin list - void loadPluginList(); - QAction *backendMenuFile; ///< Pointer on the file backend menu - bool importingPlugin; - void lunchDecodeThread(const QByteArray &data); - QXzDecodeThread decodeThread; - void loadPluginXml(PluginsAvailable * thePlugin,const QByteArray &xml); - AuthPlugin *checkPluginThread; - QStringList readPluginPath; - bool loadPluginInformation(const QString &path); - QSemaphore editionSemList; - bool stopIt; - bool pluginLoaded; - QString language; - void excuteTheFileBackendLoader(); - QString categoryToString(const PluginType &category); - QString categoryToTranslation(const PluginType &category); - //temp variable - int index,loop_size,sub_index,loop_sub_size; - private slots: - /// \brief show the information - void showInformationDoubleClick(); - void decodingFinished(); - void newAuthPath(const QString &path); - void post_operation(); + Q_OBJECT + public: + /// \brief to get plugins of type specific + QList getPluginsByCategory(const PluginType &type) const; + /** \brief to get plugins */ + QList getPlugins(bool withError=false) const; + /// \brief get translated text + //QString getTranslatedText(PluginsAvailable plugin,QString informationName,QString mainShortName); + //QString getTranslatedText(PluginsAvailable plugin,QString informationName); + /// \brief transform short plugin name into file name + static QString getResolvedPluginName(const QString &name); + static bool isSamePlugin(const PluginsAvailable &pluginA,const PluginsAvailable &pluginB); + void lockPluginListEdition(); + void unlockPluginListEdition(); + bool allPluginHaveBeenLoaded() const; + /// \brief to load the get dom specific + QString getDomSpecific(const QDomElement &root,const QString &name,const QList > &listChildAttribute) const; + QString getDomSpecific(const QDomElement &root,const QString &name) const; + /// \brief set current language + void setLanguage(const QString &language); + /// \brief Enumeration of plugin add backend + enum ImportBackend + { + ImportBackend_File, //import plugin from local file + ImportBackend_Internet //import plugin form internet + }; + static PluginsManager *pluginsManager; + /// \brief Create the manager and load the defaults variables + PluginsManager(); + /// \brief Destroy the language manager + ~PluginsManager(); + /// \brief To compare version + static bool compareVersion(const QString &versionA,const QString &sign,const QString &versionB); + private: + /// \brief List of plugins + QList pluginsList; + QMultiMap pluginsListIndexed; + /// \brief to load the multi-language balise + void loadBalise(const QDomElement &root,const QString &name,QList *informations,QString *errorString,bool needHaveOneEntryMinimum=true,bool multiLanguage=false,bool englishNeedBeFound=false); + /// \brief get the version + QString getPluginVersion(const QString &pluginName) const; + /// \brief list of cat plugin type + //QStringList catPlugin; + QStringList englishPluginType; + QList catItemList; + /// \brief store the current mainShortName + QString mainShortName; + /// \brief load the plugin list + void loadPluginList(); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + QAction *backendMenuFile; ///< Pointer on the file backend menu + bool importingPlugin; + void lunchDecodeThread(const QByteArray &data); + QXzDecodeThread decodeThread; + void executeTheFileBackendLoader(); + #endif + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + /// \brief check the dependencies, return number of error + quint32 checkDependencies(); + #endif + void loadPluginXml(PluginsAvailable * thePlugin,const QByteArray &xml); + QStringList readPluginPath; + bool loadPluginInformation(const QString &path); + QSemaphore editionSemList; + bool stopIt; + bool pluginLoaded; + QString language; + QString categoryToString(const PluginType &category) const; + QString categoryToTranslation(const PluginType &category); + QRegularExpression regexp_to_clean_1,regexp_to_clean_2,regexp_to_clean_3,regexp_to_clean_4,regexp_to_clean_5; + QRegularExpression regexp_to_dep_1,regexp_to_dep_2,regexp_to_dep_3,regexp_to_dep_4,regexp_to_dep_5,regexp_to_dep_6; + PluginInformation *pluginInformation; + private slots: + /// \brief show the information + void showInformationDoubleClick(); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + void decodingFinished(); + #endif + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void newAuthPath(const QString &path); + #endif + void post_operation(); /* public slots: - /// \brief to refresh the plugin list - void refreshPluginList(QString mainShortName="en");*/ - signals: - void pluginListingIsfinish(); - void onePluginAdded(const PluginsAvailable&); - void onePluginWillBeRemoved(const PluginsAvailable&); // when will be really removed - void onePluginWillBeUnloaded(const PluginsAvailable&);//just unload to quit the application - void needLangToRefreshPluginList(); - void newLanguageLoaded(); - protected: - void run(); - public slots: //do gui action - void showInformation(const QString &path); - void removeThePluginSelected(const QString &path); - void addPlugin(const ImportBackend &backend); + /// \brief to refresh the plugin list + void refreshPluginList(QString mainShortName="en");*/ + signals: + void pluginListingIsfinish() const; + void onePluginAdded(const PluginsAvailable&) const; + void onePluginInErrorAdded(const PluginsAvailable&) const; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable&) const; // when will be really removed + void onePluginWillBeUnloaded(const PluginsAvailable&) const;//just unload to quit the application + #endif + void needLangToRefreshPluginList() const; + void newLanguageLoaded() const; + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + void manuallyAdded(const PluginsAvailable&) const; + #endif + protected: + void run(); + public slots: //do gui action + void showInformation(const QString &path); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + void removeThePluginSelected(const QString &path); + void addPlugin(const ImportBackend &backend); + void tryLoadPlugin(const QString &file); + #endif }; /// \brief to do structure comparaison diff --git a/README b/README index a07fc8a..1cbe24e 100644 --- a/README +++ b/README @@ -12,6 +12,12 @@ Main features include: - on-error resume, - error/collision management +======================================================= +Changelog ============================================= +======================================================= +You can have the changelog at this url (or search on the forum): +http://forum-ultracopier.first-world.info/the-announces/changelog-for-ultracopier-1-0-x-x-supercopier-4-0-x-x-t406.html + ======================================================= License =============================================== ======================================================= @@ -32,6 +38,7 @@ Building and documentation ============================ See the wiki for the general documentation and how to for building: http://ultracopier-wiki.first-world.info/ For the code documentation: http://doc-ultracopier.first-world.info/ (generated by doxygen) The source proposed on the site is reconstritued source from: https://github.com/alphaonex86/Ultracopier to facilitate contribute effort. +Prefer ultracopier-all-in-one-direct.pro to have easy and NO modular software. This is more oriented to Linux and Mac. ====================================================== Warranty ============================================= diff --git a/ResourcesManager.cpp b/ResourcesManager.cpp index 3971531..96fb894 100644 --- a/ResourcesManager.cpp +++ b/ResourcesManager.cpp @@ -1,211 +1,217 @@ /** \file ResourcesManager.cpp \brief Define the class to manage and load the resources linked with the themes \author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ +\licence GPL3, see the file COPYING */ #include #include #include -#include #include #include "ResourcesManager.h" +QRegularExpression ResourcesManager::slashEnd; + /// \brief Create the manager and load the defaults variables ResourcesManager::ResourcesManager() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //load the internal path - searchPath< #include #include +#include #include "Environment.h" -#include "Singleton.h" /** \brief Define the class to manage and load the resources linked with the themes This class provide a core load and manage the resources */ -class ResourcesManager : public QObject, public Singleton +class ResourcesManager : public QObject { - Q_OBJECT - friend class Singleton; - private: - /// \brief Create the manager and load the default variable - ResourcesManager(); - /// \brief Destroy the resource manager - ~ResourcesManager(); - public: - /** \brief Get folder presence and the path - \return Empty QString if not found */ - QString getFolderReadPath(const QString &path); - /** \brief Get folder presence, the path and check in the folder and sub-folder the file presence - \return Empty QString if not found */ - QString getFolderReadPathMultiple(const QString &path,const QStringList &fileToCheck); - bool checkFolderContent(const QString &path,const QStringList &fileToCheck); - /// \brief add / or \ in function of the platform at the end of path if both / and \ are not found - static QString AddSlashIfNeeded(const QString &path); - /// \brief get the writable path - QString getWritablePath(); - /// \brief disable the writable path, if ultracopier is unable to write into - bool disableWritablePath(); - /// \brief get the read path - QStringList getReadPath(); - /// \brief remove folder - static bool removeFolder(const QString &dir); - private: - /// \brief List of the path to read only access - QStringList searchPath; - /// \brief The writable path, empty if not found - QString writablePath; - //temp variable - int index,loop_size; + Q_OBJECT + public: + /// \brief Create the manager and load the default variable + ResourcesManager(); + /// \brief Destroy the resource manager + ~ResourcesManager(); + static ResourcesManager *resourcesManager; + /** \brief Get folder presence and the path + \return Empty QString if not found */ + QString getFolderReadPath(const QString &path) const; + /** \brief Get folder presence, the path and check in the folder and sub-folder the file presence + \return Empty QString if not found */ + QString getFolderReadPathMultiple(const QString &path,const QStringList &fileToCheck) const; + bool checkFolderContent(const QString &path,const QStringList &fileToCheck) const; + /// \brief add / or \ in function of the platform at the end of path if both / and \ are not found + static QString AddSlashIfNeeded(const QString &path); + /// \brief get the writable path + QString getWritablePath() const; + /// \brief disable the writable path, if ultracopier is unable to write into + bool disableWritablePath(); + /// \brief get the read path + QStringList getReadPath() const; + /// \brief remove folder + static bool removeFolder(const QString &dir); + private: + /// \brief List of the path to read only access + QStringList searchPath; + /// \brief The writable path, empty if not found + QString writablePath; + /// \brief match with slash end + static QRegularExpression slashEnd; }; #endif // RESOURCES_MANAGER_H diff --git a/SessionLoader.cpp b/SessionLoader.cpp index 6b606a0..21cca9b 100644 --- a/SessionLoader.cpp +++ b/SessionLoader.cpp @@ -1,133 +1,171 @@ /** \file SessionLoader.h \brief Define the session loader \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "SessionLoader.h" +#include "LanguagesManager.h" +#ifndef ULTRACOPIER_VERSION_PORTABLE SessionLoader::SessionLoader(OptionDialog *optionDialog) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->optionDialog=optionDialog; - //load the options - QList > KeysList; - #ifdef ULTRACOPIER_VERSION_PORTABLE - KeysList.append(qMakePair(QString("LoadAtSessionStarting"),QVariant(false))); - #else - KeysList.append(qMakePair(QString("LoadAtSessionStarting"),QVariant(true))); - #endif - options->addOptionGroup("SessionLoader",KeysList); - connect(options,SIGNAL(newOptionValue(QString,QString,QVariant)), this, SLOT(newOptionValue(QString,QString,QVariant)),Qt::QueuedConnection); - //load the plugin - plugins->lockPluginListEdition(); - qRegisterMetaType("PluginsAvailable"); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - QList list=plugins->getPluginsByCategory(PluginType_SessionLoader); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - shouldEnabled=options->getOptionValue("SessionLoader","LoadAtSessionStarting").toBool(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->optionDialog=optionDialog; + //load the options + connect(OptionEngine::optionEngine,&OptionEngine::newOptionValue, this, &SessionLoader::newOptionValue,Qt::QueuedConnection); + //load the plugin + PluginsManager::pluginsManager->lockPluginListEdition(); + connect(this,&SessionLoader::previouslyPluginAdded, this,&SessionLoader::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginAdded, this,&SessionLoader::onePluginAdded,Qt::QueuedConnection); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved, this,&SessionLoader::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + QList list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_SessionLoader); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + shouldEnabled=OptionEngine::optionEngine->getOptionValue(QStringLiteral("SessionLoader"),QStringLiteral("LoadAtSessionStarting")).toBool(); } SessionLoader::~SessionLoader() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QList list=plugins->getPluginsByCategory(PluginType_SessionLoader); - foreach(PluginsAvailable currentPlugin,list) - onePluginWillBeRemoved(currentPlugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + int index=0; + const int &loop_size=pluginList.size(); + while(indexisLoaded() || pluginList.at(index).pluginLoader->unload()) + { + delete pluginList.at(index).options; + pluginList.removeAt(index); + } + } + index++; + } + #endif } void SessionLoader::onePluginAdded(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_SessionLoader) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName("sessionLoader"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"try load: "+pluginPath); - LocalPlugin newEntry; - QPluginLoader *pluginLoader= new QPluginLoader(pluginPath); - newEntry.pluginLoader=pluginLoader; - QObject *pluginInstance = pluginLoader->instance(); - if(pluginInstance) - { - PluginInterface_SessionLoader *sessionLoader = qobject_cast(pluginInstance); - //check if found - int index=0; - while(indexunload(); - return; - } - index++; - } - if(sessionLoader) - { - #ifdef ULTRACOPIER_DEBUG - connect(sessionLoader,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SLOT(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif // ULTRACOPIER_DEBUG - newEntry.options=new LocalPluginOptions("SessionLoader-"+plugin.name); - newEntry.sessionLoaderInterface=sessionLoader; - newEntry.path=plugin.path; - newEntry.sessionLoaderInterface->setResources(newEntry.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); - newEntry.sessionLoaderInterface->setEnabled(shouldEnabled); - optionDialog->addPluginOptionWidget(PluginType_SessionLoader,plugin.name,newEntry.sessionLoaderInterface->options()); - connect(languages,SIGNAL(newLanguageLoaded(QString)),newEntry.sessionLoaderInterface,SLOT(newLanguageLoaded())); - pluginList << newEntry; - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to cast the plugin: "+pluginLoader->errorString()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to load the plugin: "+pluginLoader->errorString()); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + if(plugin.category!=PluginType_SessionLoader) + return; + int index=0; + LocalPlugin newEntry; + QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName(QStringLiteral("sessionLoader")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("try load: ")+pluginPath); + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + + PluginInterface_SessionLoader *sessionLoader; + QObjectList objectList=QPluginLoader::staticInstances(); + index=0; + QObject *pluginObject; + while(index(pluginObject); + if(sessionLoader!=NULL) + break; + index++; + } + if(index==objectList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("static session loader not found")); + return; + } + newEntry.pluginLoader=NULL; + #else + QPluginLoader *pluginLoader= new QPluginLoader(pluginPath); + newEntry.pluginLoader=pluginLoader; + QObject *pluginInstance = pluginLoader->instance(); + if(!pluginInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin: ")+pluginLoader->errorString()); + return; + } + PluginInterface_SessionLoader *sessionLoader = qobject_cast(pluginInstance); + if(!sessionLoader) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to cast the plugin: ")+pluginLoader->errorString()); + return; + } + //check if found + index=0; + while(indexunload(); + return; + } + index++; + } + #endif + #ifdef ULTRACOPIER_DEBUG + connect(sessionLoader,&PluginInterface_SessionLoader::debugInformation,this,&SessionLoader::debugInformation); + #endif // ULTRACOPIER_DEBUG + newEntry.options=new LocalPluginOptions(QStringLiteral("SessionLoader-")+plugin.name); + newEntry.sessionLoaderInterface=sessionLoader; + newEntry.path=plugin.path; + newEntry.sessionLoaderInterface->setResources(newEntry.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); + newEntry.sessionLoaderInterface->setEnabled(shouldEnabled); + optionDialog->addPluginOptionWidget(PluginType_SessionLoader,plugin.name,newEntry.sessionLoaderInterface->options()); + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newEntry.sessionLoaderInterface,&PluginInterface_SessionLoader::newLanguageLoaded); + pluginList << newEntry; + #else + Q_UNUSED(plugin); + return; + #endif } +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void SessionLoader::onePluginWillBeRemoved(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_SessionLoader) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(indexisLoaded() || pluginList.at(index).pluginLoader->unload()) - { - delete pluginList.at(index).options; - pluginList.removeAt(index); - } - break; - } - index++; - } + if(plugin.category!=PluginType_SessionLoader) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + int index=0; + while(indexisLoaded() || pluginList.at(index).pluginLoader->unload()) + { + delete pluginList.at(index).options; + pluginList.removeAt(index); + } + } + break; + } + index++; + } } +#endif void SessionLoader::newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value) { - if(groupName=="SessionLoader" && variableName=="LoadAtSessionStarting") - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, value: %1").arg(value.toBool())); - shouldEnabled=value.toBool(); - int index=0; - while(indexsetEnabled(shouldEnabled); - index++; - } - } + if(groupName==QStringLiteral("SessionLoader") && variableName==QStringLiteral("LoadAtSessionStarting")) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, value: %1").arg(value.toBool())); + shouldEnabled=value.toBool(); + int index=0; + while(indexsetEnabled(shouldEnabled); + index++; + } + } } #ifdef ULTRACOPIER_DEBUG -void SessionLoader::debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne) +void SessionLoader::debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne) { - DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Session loader plugin"); + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,QStringLiteral("Session loader plugin")); } #endif // ULTRACOPIER_DEBUG - +#endif // !defined(ULTRACOPIER_PLUGIN_ALL_IN_ONE) || !defined(ULTRACOPIER_VERSION_PORTABLE) diff --git a/SessionLoader.h b/SessionLoader.h index 28bb3aa..c14f0f5 100644 --- a/SessionLoader.h +++ b/SessionLoader.h @@ -1,8 +1,6 @@ /** \file SessionLoader.h \brief Define the class to load the plugin and lunch it \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING This class load ALL plugin compatible to listen and catch the copy/move @@ -13,43 +11,51 @@ This class load ALL plugin compatible to listen and catch the copy/move #include #include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT #include +#endif #include #include #include "interface/PluginInterface_SessionLoader.h" #include "PluginsManager.h" -#include "GlobalClass.h" #include "OptionDialog.h" +#include "LocalPluginOptions.h" +#ifndef ULTRACOPIER_VERSION_PORTABLE /** \brief manage all SessionLoader plugin */ -class SessionLoader : public QObject, GlobalClass +class SessionLoader : public QObject { - Q_OBJECT - public: - explicit SessionLoader(OptionDialog *optionDialog); - ~SessionLoader(); - private slots: - void onePluginAdded(const PluginsAvailable &plugin); - void onePluginWillBeRemoved(const PluginsAvailable &plugin); - void newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value); - #ifdef ULTRACOPIER_DEBUG - void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne); - #endif // ULTRACOPIER_DEBUG - private: - //variable - struct LocalPlugin - { - PluginInterface_SessionLoader * sessionLoaderInterface; - QPluginLoader * pluginLoader; - QString path; - LocalPluginOptions *options; - }; - QList pluginList; - bool shouldEnabled; - OptionDialog *optionDialog; - signals: - void previouslyPluginAdded(PluginsAvailable); + Q_OBJECT + public: + explicit SessionLoader(OptionDialog *optionDialog); + ~SessionLoader(); + private slots: + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + #endif + void newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value); + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne); + #endif // ULTRACOPIER_DEBUG + private: + //variable + struct LocalPlugin + { + PluginInterface_SessionLoader * sessionLoaderInterface; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader * pluginLoader; + #endif + QString path; + LocalPluginOptions *options; + }; + QList pluginList; + bool shouldEnabled; + OptionDialog *optionDialog; + signals: + void previouslyPluginAdded(PluginsAvailable) const; }; +#endif #endif // SESSIONLOADER_H diff --git a/Singleton.h b/Singleton.h deleted file mode 100644 index d88a029..0000000 --- a/Singleton.h +++ /dev/null @@ -1,52 +0,0 @@ -/** \file Singleton.h -\brief Define the singleton for class which should have unique object -\author alpha_one_x86 -\note Big thanks to all people in the channel #qt-fr of freenode of irc -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ - -#include -#include - -#ifndef SINGLETON_H -#define SINGLETON_H - -/** \class Singleton -\brief Define the singleton for class which should have unique object -\note Big thanks to all people in the channel #qt-fr of freenode of irc */ -template -class Singleton -{ - public: - /// \brief Public interface - static T *getInstance() - { - number_load++; - if(_singleton==NULL) - _singleton = new T; - return (static_cast (_singleton)); - } - /// \brief For destroy only when the call to this function call count is the same as the getInstance() count call - static void destroyInstanceAtTheLastCall() - { - number_load--; - if(number_load==0) - { - delete _singleton; - _singleton=NULL; - } - } - private: - /// \brief Unique instance - static T *_singleton; - /// \brief To count the getInstance() call count - static int number_load; -}; - -template -T *Singleton::_singleton = NULL; -template -int Singleton::number_load = 0; - -#endif // SINGLETON_H diff --git a/StructEnumDefinition.h b/StructEnumDefinition.h index cb86306..0d3eb68 100644 --- a/StructEnumDefinition.h +++ b/StructEnumDefinition.h @@ -1,8 +1,6 @@ /** \file StructEnumDefinition.h \brief Define the structure and enumeration used in ultracopier or into the plugin \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include @@ -12,135 +10,145 @@ #ifndef STRUCTDEF_H #define STRUCTDEF_H +namespace Ultracopier { /// \brief Define the mode of the copy window/request, if need be copy or move enum CopyMode { - Copy=0x00000000, - Move=0x00000001 + Copy=0x00000000, + Move=0x00000001 +}; + +enum RemainingTimeAlgo +{ + RemainingTimeAlgo_Traditional=0x00000000, + RemainingTimeAlgo_Logarithmic=0x00000001 }; /// \brief Define the catching state, if the copy is totally catch of the explorer, partially or nothing enum CatchState { - Uncaught=0x00000000, - Semiuncaught=0x00000001, - Caught=0x00000002 + Uncaught=0x00000000, + Semiuncaught=0x00000001, + Caught=0x00000002 }; /// \brief Define the listening state enum ListeningState { - NotListening=0x00000000,///< 0 listener is listening - SemiListening=0x00000001,///< only part of listeners are listening - FullListening=0x00000002///< all the listeners are listening + NotListening=0x00000000,///< 0 listener is listening + SemiListening=0x00000001,///< only part of listeners are listening + FullListening=0x00000002///< all the listeners are listening }; /// \brief Define the copy type, if folder, file or both enum CopyType { - File = 0x00000001, - FileAndFolder = 0x00000002 + File = 0x00000001, + FileAndFolder = 0x00000002 }; /// \brief transfer list operation, can define nothing, the import/export or both enum TransferListOperation { - TransferListOperation_None = 0x00000000, - TransferListOperation_Import = 0x00000001, - TransferListOperation_Export = 0x00000002, - TransferListOperation_ImportExport = TransferListOperation_Import | TransferListOperation_Export + TransferListOperation_None = 0x00000000, + TransferListOperation_Import = 0x00000001, + TransferListOperation_Export = 0x00000002, + TransferListOperation_ImportExport = TransferListOperation_Import | TransferListOperation_Export }; enum EngineActionInProgress { - Idle = 0x00000000, - Listing = 0x00000001, - Copying = 0x00000002, - CopyingAndListing = Listing | Copying + Idle = 0x00000000, + Listing = 0x00000001, + Copying = 0x00000002, + CopyingAndListing = Listing | Copying }; /// \brief the level of information enum DebugLevel { - DebugLevel_Information=0x00000001, ///< Information like the compiler, OS, Qt version, all to know in witch condition ultracopier is launched - DebugLevel_Critical=0x00000002, ///< Critical error, where it don't know how skip it - DebugLevel_Warning=0x00000003, ///< Error, but have way to skip it - DebugLevel_Notice=0x00000004 ///< General information to debug, what file is open, what event is received, ... + DebugLevel_Information=0x00000001, ///< Information like the compiler, OS, Qt version, all to know in witch condition ultracopier is launched + DebugLevel_Critical=0x00000002, ///< Critical error, where it don't know how skip it + DebugLevel_Warning=0x00000003, ///< Error, but have way to skip it + DebugLevel_Notice=0x00000004 ///< General information to debug, what file is open, what event is received, ... }; enum SizeUnit { - SizeUnit_byte=0x00000000, - SizeUnit_KiloByte=0x00000001, - SizeUnit_MegaByte=0x00000002, - SizeUnit_GigaByte=0x00000003, - SizeUnit_TeraByte=0x00000004, - SizeUnit_PetaByte=0x00000005, - SizeUnit_ExaByte=0x00000006, - SizeUnit_ZettaByte=0x00000007, - SizeUnit_YottaByte=0x00000008 + SizeUnit_byte=0x00000000, + SizeUnit_KiloByte=0x00000001, + SizeUnit_MegaByte=0x00000002, + SizeUnit_GigaByte=0x00000003, + SizeUnit_TeraByte=0x00000004, + SizeUnit_PetaByte=0x00000005, + SizeUnit_ExaByte=0x00000006, + SizeUnit_ZettaByte=0x00000007, + SizeUnit_YottaByte=0x00000008 }; /// \brief structure for decompossed time struct TimeDecomposition { - quint16 second; - quint16 minute; - quint16 hour; + quint16 second; + quint16 minute; + quint16 hour; }; //////////////////////////// Return list ////////////////////////////// enum ActionTypeCopyList { - //playlist action - MoveItem=0x00000000, - RemoveItem=0x00000001, - AddingItem=0x00000002, - //Item action, to inform the stat of one entry - PreOperation=0x00000003, - Transfer=0x00000004, - PostOperation=0x00000005, - CustomOperation=0x00000006 /// \note this need be used after preoperation and before postoperation + //playlist action + MoveItem=0x00000000, + RemoveItem=0x00000001, + AddingItem=0x00000002, + //Item action, to inform the stat of one entry + PreOperation=0x00000003, + Transfer=0x00000004, + PostOperation=0x00000005, + CustomOperation=0x00000006 /// \note this need be used after preoperation and before postoperation }; /// \brief structure for progression item struct ProgressionItem { - quint64 id; - quint64 current; - quint64 total; + quint64 id; + quint64 currentRead; + quint64 currentWrite; + quint64 total; }; /// \brief item to insert item in the interface struct ItemOfCopyList { - quint64 id; - // if type == CustomOperation, then is the translated name of the operation - QString sourceFullPath;///< full path with file name: /foo/foo.txt - QString sourceFileName;///< full path with file name: foo.txt - QString destinationFullPath;///< full path with file name: /foo/foo.txt - QString destinationFileName;///< full path with file name: foo.txt - // if type == CustomOperation, then 0 = without progression, 1 = with progression - quint64 size; - CopyMode mode; + quint64 id; + // if type == CustomOperation, then is the translated name of the operation + QString sourceFullPath;///< full path with file name: /foo/foo.txt + QString sourceFileName;///< full path with file name: foo.txt + QString destinationFullPath;///< full path with file name: /foo/foo.txt + QString destinationFileName;///< full path with file name: foo.txt + // if type == CustomOperation, then 0 = without progression, 1 = with progression + quint64 size; + CopyMode mode; }; /// \brief The definition of no removing action on transfer list struct ActionOnCopyList { - int position; - ///< if type == MoveItem - int moveAt; + int position; + // if type == MoveItem + // if type == RemoveItem, then 0 = normal remove, 1 = skip + int moveAt; }; /// \brief action normal or due to interface query on copy list -struct returnActionOnCopyList +struct ReturnActionOnCopyList { - ActionTypeCopyList type; - ///< used if type == AddingItem || type == PreOperation (for interface without transfer list) || type == CustomOperation - ItemOfCopyList addAction; - ///< used if type != AddingItem - ActionOnCopyList userAction; + ActionTypeCopyList type; + ///< used if type == AddingItem || type == PreOperation (for interface without transfer list) || type == CustomOperation + ItemOfCopyList addAction; + ///< used if type != AddingItem + ActionOnCopyList userAction; }; +} #endif // STRUCTDEF_H diff --git a/StructEnumDefinition_UltracopierSpecific.h b/StructEnumDefinition_UltracopierSpecific.h index c9ed2d0..4f4fd89 100644 --- a/StructEnumDefinition_UltracopierSpecific.h +++ b/StructEnumDefinition_UltracopierSpecific.h @@ -1,8 +1,6 @@ /** \file StructEnumDefinition_UltracopierSpecific.h \brief Define the structure and enumeration used in ultracopier only \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include diff --git a/SystrayIcon.cpp b/SystrayIcon.cpp index 4a1c8f1..6fe9b60 100644 --- a/SystrayIcon.cpp +++ b/SystrayIcon.cpp @@ -1,206 +1,272 @@ /** \file SystrayIcon.cpp \brief Define the class of the systray icon \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include +#include +#include #include "SystrayIcon.h" +#include "PluginsManager.h" +#include "ThemesManager.h" +#include "LanguagesManager.h" +#include "HelpDialog.h" + +#ifdef Q_OS_MAC +//extern void qt_mac_set_dock_menu(QMenu *menu); +#endif /// \brief Initiate and show the icon in the systray -SystrayIcon::SystrayIcon() +SystrayIcon::SystrayIcon(QObject * parent) : + QSystemTrayIcon(parent) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //setup the systray icon - haveListenerInfo = false; - havePluginLoaderInfo = false; - systrayMenu = new QMenu(); - actionMenuAbout = new QAction(this); - actionMenuQuit = new QAction(this); - actionOptions = new QAction(this); - //actionTransfer = new QAction(this); - copyMenu = new QMenu(); - //to prevent init bug - stateListener=NotListening; - statePluginLoader=Uncaught; - - setContextMenu(systrayMenu); - setToolTip("Ultracopier"); - #ifdef Q_OS_WIN32 - setIcon(QIcon(":/systray_Uncaught_Windows.png")); - #else - setIcon(QIcon(":/systray_Uncaught_Unix.png")); - #endif - show(); - //connect the action - connect(&timerCheckSetTooltip, SIGNAL(timeout()), this, SLOT(checkSetTooltip())); - connect(actionMenuQuit, SIGNAL(triggered()), this, SIGNAL(quit())); - connect(actionMenuAbout, SIGNAL(triggered()), this, SIGNAL(showHelp())); - connect(actionOptions, SIGNAL(triggered()), this, SIGNAL(showOptions())); - connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(CatchAction(QSystemTrayIcon::ActivationReason))); - connect(plugins, SIGNAL(pluginListingIsfinish()), this, SLOT(reloadEngineList())); - //display the icon - updateCurrentTheme(); - //if theme/language change, update graphic part - connect(themes, SIGNAL(theThemeIsReloaded()), this, SLOT(updateCurrentTheme())); - connect(languages, SIGNAL(newLanguageLoaded(QString)), this, SLOT(retranslateTheUI())); - systrayMenu->addMenu(copyMenu); - systrayMenu->addAction(actionOptions); - systrayMenu->addAction(actionMenuAbout); - systrayMenu->addAction(actionMenuQuit); - systrayMenu->insertSeparator(actionOptions); - retranslateTheUI(); - updateSystrayIcon(); - - timerCheckSetTooltip.setSingleShot(true); - timerCheckSetTooltip.start(1000); - - //impossible with Qt on systray - /// \note important for drag and drop, \see dropEvent() - systrayMenu->setAcceptDrops(true); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + + //setup the systray icon + haveListenerInfo = false; + havePluginLoaderInfo = false; + systrayMenu = new QMenu(); + actionMenuAbout = new QAction(this); + #ifdef ULTRACOPIER_DEBUG + actionSaveBugReport = new QAction(this); + #endif + actionMenuQuit = new QAction(this); + actionOptions = new QAction(this); + //actionTransfer = new QAction(this); + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + copyMenu = NULL; + #endif + //to prevent init bug + stateListener=Ultracopier::NotListening; + statePluginLoader=Ultracopier::Uncaught; + + setContextMenu(systrayMenu); + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + setToolTip(QStringLiteral("Supercopier")); + #else + setToolTip(QStringLiteral("Ultracopier")); + #endif + #ifdef Q_OS_WIN32 + setIcon(QIcon(QStringLiteral(":/systray_Uncaught_Windows.png"))); + #else + setIcon(QIcon(QStringLiteral(":/systray_Uncaught_Unix.png"))); + #endif + //connect the action + connect(&timerCheckSetTooltip, &QTimer::timeout, this, &SystrayIcon::checkSetTooltip); + #ifdef ULTRACOPIER_DEBUG + connect(actionSaveBugReport, &QAction::triggered, this, &SystrayIcon::saveBugReport); + #endif + connect(actionMenuQuit, &QAction::triggered, this, &SystrayIcon::hide); + connect(actionMenuQuit, &QAction::triggered, this, &SystrayIcon::quit); + connect(actionMenuAbout, &QAction::triggered, this, &SystrayIcon::showHelp); + connect(actionOptions, &QAction::triggered, this, &SystrayIcon::showOptions); + connect(this, &SystrayIcon::activated, this, &SystrayIcon::CatchAction); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + connect(this, &QSystemTrayIcon::messageClicked, this, &SystrayIcon::messageClicked); + #endif + connect(PluginsManager::pluginsManager, &PluginsManager::pluginListingIsfinish, this, &SystrayIcon::reloadEngineList); + //display the icon + updateCurrentTheme(); + //if theme/language change, update graphic part + connect(ThemesManager::themesManager, &ThemesManager::theThemeIsReloaded, this, &SystrayIcon::updateCurrentTheme, Qt::QueuedConnection); + connect(LanguagesManager::languagesManager, &LanguagesManager::newLanguageLoaded, this, &SystrayIcon::retranslateTheUI, Qt::QueuedConnection); + + systrayMenu->addAction(actionOptions); + systrayMenu->addAction(actionMenuAbout); + #ifdef ULTRACOPIER_DEBUG + systrayMenu->addAction(actionSaveBugReport); + #endif + systrayMenu->addAction(actionMenuQuit); + #ifndef Q_OS_MAC + systrayMenu->insertSeparator(actionOptions); + #endif + retranslateTheUI(); + updateSystrayIcon(); + + #ifdef ULTRACOPIER_INTERNET_SUPPORT + lastVersion=ULTRACOPIER_VERSION; + #endif + + timerCheckSetTooltip.setSingleShot(true); + timerCheckSetTooltip.start(1000); + + //impossible with Qt on systray + /// \note important for drag and drop, \see dropEvent() + systrayMenu->setAcceptDrops(true); + + #ifdef Q_OS_MAC +// qt_mac_set_dock_menu(systrayMenu); + #endif + + show(); } /// \brief Hide and destroy the icon in the systray SystrayIcon::~SystrayIcon() { - delete actionMenuQuit; - delete actionMenuAbout; - delete actionOptions; - delete systrayMenu; - delete copyMenu; + delete actionMenuQuit; + #ifdef ULTRACOPIER_DEBUG + delete actionSaveBugReport; + #endif + delete actionMenuAbout; + delete actionOptions; + delete systrayMenu; + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + if(copyMenu!=NULL) + { + delete copyMenu; + copyMenu=NULL; + } + #endif } void SystrayIcon::checkSetTooltip() { - if(isSystemTrayAvailable()) - { - setToolTip("Ultracopier"); - updateSystrayIcon(); - } - else - timerCheckSetTooltip.start(); + if(isSystemTrayAvailable()) + { + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + setToolTip(QStringLiteral("Supercopier")); + #else + setToolTip(QStringLiteral("Ultracopier")); + #endif + updateSystrayIcon(); + } + else + timerCheckSetTooltip.start(); } -void SystrayIcon::listenerReady(const ListeningState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) +void SystrayIcon::listenerReady(const Ultracopier::ListeningState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("state: %1, havePlugin: %2, someAreInWaitOfReply: %3").arg(state).arg(havePlugin).arg(someAreInWaitOfReply)); - Q_UNUSED(someAreInWaitOfReply); - stateListener=state; - haveListenerInfo=true; - haveListener=havePlugin; - updateSystrayIcon(); - if(!havePlugin) - showTryCatchMessageWithNoListener(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("state: %1, havePlugin: %2, someAreInWaitOfReply: %3").arg(state).arg(havePlugin).arg(someAreInWaitOfReply)); + Q_UNUSED(someAreInWaitOfReply); + stateListener=state; + haveListenerInfo=true; + haveListener=havePlugin; + updateSystrayIcon(); + if(!havePlugin) + showTryCatchMessageWithNoListener(); } -void SystrayIcon::pluginLoaderReady(const CatchState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) +void SystrayIcon::pluginLoaderReady(const Ultracopier::CatchState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("state: %1, havePlugin: %2, someAreInWaitOfReply: %3").arg(state).arg(havePlugin).arg(someAreInWaitOfReply)); - Q_UNUSED(someAreInWaitOfReply); - statePluginLoader=state; - havePluginLoaderInfo=true; - havePluginLoader=havePlugin; - updateSystrayIcon(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("state: %1, havePlugin: %2, someAreInWaitOfReply: %3").arg(state).arg(havePlugin).arg(someAreInWaitOfReply)); + Q_UNUSED(someAreInWaitOfReply); + statePluginLoader=state; + havePluginLoaderInfo=true; + havePluginLoader=havePlugin; + updateSystrayIcon(); } void SystrayIcon::showTryCatchMessageWithNoListener() { - showSystrayMessage(tr("No copy listener found. Do the copy manually by right click one the system tray icon.")); + showSystrayMessage(tr("No copy listener found. Do the copy manually by right click one the system tray icon.")); } /// \brief To show a message linked to the systray icon void SystrayIcon::showSystrayMessage(const QString& text) { - showMessage(tr("Information"),text,QSystemTrayIcon::Information,0); + showMessage(tr("Information"),text,QSystemTrayIcon::Information,0); +} + +#ifdef ULTRACOPIER_INTERNET_SUPPORT +void SystrayIcon::messageClicked() +{ + QDesktopServices::openUrl(HelpDialog::getUpdateUrl()); } +#endif /// \brief To update the systray icon void SystrayIcon::updateSystrayIcon() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, haveListenerInfo %1, havePluginLoaderInfo: %2").arg(haveListenerInfo).arg(havePluginLoaderInfo)); - QString toolTip="???"; - QString icon; - if(!haveListenerInfo || !havePluginLoaderInfo) - { - toolTip=tr("Searching informations..."); - icon="Uncaught"; - } - else - { - ListeningState stateListener=this->stateListener; - CatchState statePluginLoader=this->statePluginLoader; - if(!haveListener) - stateListener=NotListening; - if((stateListener==NotListening && statePluginLoader==Uncaught) || (stateListener==SemiListening && statePluginLoader==Semiuncaught) || (stateListener==FullListening && statePluginLoader==Caught)) - { - if(stateListener==NotListening) - { - toolTip=tr("Not catching the explorer copy/move"); - icon="Uncaught"; - } - else if(stateListener==SemiListening) - { - toolTip=tr("Semi catching the explorer copy/move"); - icon="Semiuncaught"; - } - else - { - toolTip=tr("Catching the explorer copy/move"); - icon="Caught"; - } - } - else - { - icon="Semiuncaught"; - QString first_part; - QString second_part; - if(stateListener==NotListening) - first_part="No listening"; - else if(stateListener==SemiListening) - first_part="Semi listening"; - else if(stateListener==FullListening) - first_part="Full listening"; - else - first_part="Unknow listening"; - if(statePluginLoader==Uncaught) - second_part="No catching"; - else if(statePluginLoader==Semiuncaught) - second_part="Semi catching"; - else if(statePluginLoader==Caught) - second_part="Full catching"; - else - second_part="Unknow catching"; - toolTip=first_part+"/"+second_part; - } - } - QIcon theNewSystrayIcon; - #ifdef Q_OS_WIN32 - theNewSystrayIcon=themes->loadIcon("SystemTrayIcon/systray_"+icon+"_Windows.png"); - #else - theNewSystrayIcon=themes->loadIcon("SystemTrayIcon/systray_"+icon+"_Unix.png"); - #endif - if(theNewSystrayIcon.isNull()) - { - #ifdef Q_OS_WIN32 - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"use the default systray icon: :/systray_"+icon+"_Windows.png"); - theNewSystrayIcon=QIcon(":/systray_"+icon+"_Windows.png"); - #else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"use the default systray icon: :/systray_"+icon+"_Unix.png"); - theNewSystrayIcon=QIcon(":/systray_"+icon+"_Unix.png"); - #endif - } - else - { - #ifdef Q_OS_WIN32 - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"icon: systray_"+icon+"_Windows.png"); - #else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"icon: systray_"+icon+"_Unix.png"); - #endif - } - setIcon(theNewSystrayIcon); - setToolTip("Ultracopier - "+toolTip); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, haveListenerInfo %1, havePluginLoaderInfo: %2").arg(haveListenerInfo).arg(havePluginLoaderInfo)); + QString toolTip=QStringLiteral("???"); + QString icon; + if(!haveListenerInfo || !havePluginLoaderInfo) + { + toolTip=tr("Searching information..."); + icon=QStringLiteral("Uncaught"); + } + else + { + Ultracopier::ListeningState stateListener=this->stateListener; + Ultracopier::CatchState statePluginLoader=this->statePluginLoader; + if(!haveListener) + stateListener=Ultracopier::NotListening; + if((stateListener==Ultracopier::NotListening && statePluginLoader==Ultracopier::Uncaught) || (stateListener==Ultracopier::SemiListening && statePluginLoader==Ultracopier::Semiuncaught) || (stateListener==Ultracopier::FullListening && statePluginLoader==Ultracopier::Caught)) + { + if(stateListener==Ultracopier::NotListening) + { + toolTip=tr("Do not replace the explorer copy/move"); + icon=QStringLiteral("Uncaught"); + } + else if(stateListener==Ultracopier::SemiListening) + { + toolTip=tr("Semi replace the explorer copy/move"); + icon=QStringLiteral("Semiuncaught"); + } + else + { + toolTip=tr("Replace the explorer copy/move"); + icon=QStringLiteral("Caught"); + } + } + else + { + icon=QStringLiteral("Semiuncaught"); + QString first_part; + QString second_part; + if(stateListener==Ultracopier::NotListening) + first_part=QStringLiteral("No listening"); + else if(stateListener==Ultracopier::SemiListening) + first_part=QStringLiteral("Semi listening"); + else if(stateListener==Ultracopier::FullListening) + first_part=QStringLiteral("Full listening"); + else + first_part=QStringLiteral("Unknow listening"); + if(statePluginLoader==Ultracopier::Uncaught) + second_part=QStringLiteral("No replace"); + else if(statePluginLoader==Ultracopier::Semiuncaught) + second_part=QStringLiteral("Semi replace"); + else if(statePluginLoader==Ultracopier::Caught) + second_part=QStringLiteral("Full replace"); + else + second_part=QStringLiteral("Unknow replace"); + toolTip=first_part+QStringLiteral("/")+second_part; + } + } + QIcon theNewSystrayIcon; + #ifdef Q_OS_WIN32 + theNewSystrayIcon=ThemesManager::themesManager->loadIcon(QStringLiteral("SystemTrayIcon/systray_")+icon+QStringLiteral("_Windows.png")); + #else + theNewSystrayIcon=ThemesManager::themesManager->loadIcon(QStringLiteral("SystemTrayIcon/systray_")+icon+QStringLiteral("_Unix.png")); + #endif + if(theNewSystrayIcon.isNull()) + { + #ifdef Q_OS_WIN32 + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"use the default systray icon: :/systray_"+icon+"_Windows.png"); + theNewSystrayIcon=QIcon(QStringLiteral(":/systray_")+icon+QStringLiteral("_Windows.png")); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"use the default systray icon: :/systray_"+icon+"_Unix.png"); + theNewSystrayIcon=QIcon(QStringLiteral(":/systray_")+icon+QStringLiteral("_Unix.png")); + #endif + } + else + { + #ifdef Q_OS_WIN32 + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"icon: systray_"+icon+"_Windows.png"); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"icon: systray_"+icon+"_Unix.png"); + #endif + } + if(theNewSystrayIcon.isNull()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"All the icon include the default icon remain null"); + setIcon(theNewSystrayIcon); + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + setToolTip(QStringLiteral("Supercopier - ")+toolTip); + #else + setToolTip(QStringLiteral("Ultracopier - ")+toolTip); + #endif } /* drag event processing (impossible with Qt on systray) @@ -213,236 +279,318 @@ void dragLeaveEvent(QDragLeaveEvent* event); */ void SystrayIcon::dropEvent(QDropEvent *event) { - const QMimeData* mimeData = event->mimeData(); - if(mimeData->hasUrls()) - { - //impossible with Qt on systray - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"mimeData->urls().size()"+QString::number(mimeData->urls().size())); - emit urlDropped(mimeData->urls()); - event->acceptProposedAction(); - } + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + //impossible with Qt on systray + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"mimeData->urls().size()"+QString::number(mimeData->urls().size())); + emit urlDropped(mimeData->urls()); + event->acceptProposedAction(); + } } void SystrayIcon::dragEnterEvent(QDragEnterEvent* event) { - // if some actions should not be usable, like move, this code must be adopted - event->acceptProposedAction(); + // if some actions should not be usable, like move, this code must be adopted + event->acceptProposedAction(); } void SystrayIcon::dragMoveEvent(QDragMoveEvent* event) { - // if some actions should not be usable, like move, this code must be adopted - event->acceptProposedAction(); + // if some actions should not be usable, like move, this code must be adopted + event->acceptProposedAction(); } void SystrayIcon::dragLeaveEvent(QDragLeaveEvent* event) { - event->accept(); + event->accept(); } /// \brief To update the current themes void SystrayIcon::updateCurrentTheme() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"icon: start"); - //load the systray menu item - QIcon tempIcon; - - tempIcon=themes->loadIcon("SystemTrayIcon/exit.png"); - if(!tempIcon.isNull()) - IconQuit=QIcon(tempIcon); - else - IconQuit=QIcon(""); - actionMenuQuit->setIcon(IconQuit); - - tempIcon=themes->loadIcon("SystemTrayIcon/informations.png"); - if(!tempIcon.isNull()) - IconInfo=QIcon(tempIcon); - else - IconInfo=QIcon(""); - actionMenuAbout->setIcon(IconInfo); - - tempIcon=themes->loadIcon("SystemTrayIcon/options.png"); - if(!tempIcon.isNull()) - IconOptions=QIcon(tempIcon); - else - IconOptions=QIcon(""); - actionOptions->setIcon(IconOptions); - - tempIcon=themes->loadIcon("SystemTrayIcon/add.png"); - if(!tempIcon.isNull()) - IconAdd=QIcon(tempIcon); - else - IconAdd=QIcon(""); - copyMenu->setIcon(IconAdd); - - //update the systray icon - updateSystrayIcon(); - reloadEngineList(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("icon: start")); + //load the systray menu item + QIcon tempIcon; + + tempIcon=ThemesManager::themesManager->loadIcon(QStringLiteral("SystemTrayIcon/exit.png")); + if(!tempIcon.isNull()) + IconQuit=QIcon(tempIcon); + else + IconQuit=QIcon(QStringLiteral("")); + actionMenuQuit->setIcon(IconQuit); + + #ifdef ULTRACOPIER_DEBUG + actionSaveBugReport->setIcon(QIcon(":/warning.png")); + #endif + + tempIcon=ThemesManager::themesManager->loadIcon(QStringLiteral("SystemTrayIcon/informations.png")); + if(!tempIcon.isNull()) + IconInfo=QIcon(tempIcon); + else + IconInfo=QIcon(QStringLiteral("")); + actionMenuAbout->setIcon(IconInfo); + + tempIcon=ThemesManager::themesManager->loadIcon(QStringLiteral("SystemTrayIcon/options.png")); + if(!tempIcon.isNull()) + IconOptions=QIcon(tempIcon); + else + IconOptions=QIcon(QStringLiteral("")); + actionOptions->setIcon(IconOptions); + + tempIcon=ThemesManager::themesManager->loadIcon(QStringLiteral("SystemTrayIcon/add.png")); + if(!tempIcon.isNull()) + IconAdd=QIcon(tempIcon); + else + IconAdd=QIcon(QStringLiteral("")); + + //update the systray icon + updateSystrayIcon(); + reloadEngineList(); } /* \brief For catch an action on the systray icon \param reason Why it activated */ void SystrayIcon::CatchAction(QSystemTrayIcon::ActivationReason reason) { - if(reason==QSystemTrayIcon::DoubleClick || reason==QSystemTrayIcon::Trigger) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Double click on system tray icon"); - if(stateListener!=NotListening) - emit tryUncatchCopy(); - else - { - if(!haveListener) - { - showTryCatchMessageWithNoListener(); - return; - } - emit tryCatchCopy(); - } - } - else if(reason==QSystemTrayIcon::Context)//do nothing on right click to show as auto the menu - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Action on the systray icon is unknown: %1").arg(reason)); - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Action on the systray icon is unknown: %1").arg(reason)); - QMessageBox::warning(NULL,tr("Warning"),tr("Action on the systray icon is unknown!")); - } + if(reason==QSystemTrayIcon::DoubleClick || reason==QSystemTrayIcon::Trigger) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Double click on system tray icon"); + if(stateListener!=Ultracopier::NotListening) + emit tryUncatchCopy(); + else + { + if(!haveListener) + { + showTryCatchMessageWithNoListener(); + return; + } + emit tryCatchCopy(); + } + } + else if(reason==QSystemTrayIcon::Context)//do nothing on right click to show as auto the menu + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("The action on the systray icon is unknown: %1").arg(reason)); + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("The action on the systray icon is unknown: %1").arg(reason)); + QMessageBox::warning(NULL,tr("Warning"),tr("The action on the systray icon is unknown!")); + } } /// \brief To catch copy menu action void SystrayIcon::CatchCopyQuery() { - QAction * currentAction=qobject_cast(QObject::sender()); - if(currentAction==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action not found"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+currentAction->data().toString()); - emit addWindowCopyMove(Copy,currentAction->data().toString()); + QAction * currentAction=qobject_cast(QObject::sender()); + if(currentAction==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action not found"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+currentAction->data().toString()); + emit addWindowCopyMove(Ultracopier::Copy,currentAction->data().toString()); } /// \brief To catch move menu action void SystrayIcon::CatchMoveQuery() { - QAction * currentAction=qobject_cast(QObject::sender()); - if(currentAction==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action not found"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+currentAction->data().toString()); - emit addWindowCopyMove(Move,currentAction->data().toString()); + QAction * currentAction=qobject_cast(QObject::sender()); + if(currentAction==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action not found"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+currentAction->data().toString()); + emit addWindowCopyMove(Ultracopier::Move,currentAction->data().toString()); } /// \brief To catch transfer menu action void SystrayIcon::CatchTransferQuery() { - QAction * currentAction=qobject_cast(QObject::sender()); - if(currentAction==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action not found"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+currentAction->data().toString()); - emit addWindowTransfer(currentAction->data().toString()); + QAction * currentAction=qobject_cast(QObject::sender()); + if(currentAction==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action not found"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+currentAction->data().toString()); + emit addWindowTransfer(currentAction->data().toString()); } /// \brief to retranslate the ui void SystrayIcon::retranslateTheUI() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"retranslateTheUI"); - #ifdef ULTRACOPIER_DEBUG - actionMenuAbout ->setText(tr("&About/Debug report")); - #else // ULTRACOPIER_DEBUG - actionMenuAbout ->setText(tr("&About")); - #endif // ULTRACOPIER_DEBUG - actionMenuQuit ->setText(tr("&Quit")); - actionOptions ->setText(tr("&Options")); - copyMenu ->setTitle(tr("A&dd copy/moving")); - reloadEngineList(); - updateSystrayIcon(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"retranslateTheUI"); + #ifdef ULTRACOPIER_DEBUG + actionMenuAbout ->setText(tr("&About/Debug report")); + #else // ULTRACOPIER_DEBUG + actionMenuAbout ->setText(tr("&About")); + #endif // ULTRACOPIER_DEBUG + #ifdef ULTRACOPIER_DEBUG + actionSaveBugReport->setText(tr("&Save bug report")); + #endif + actionMenuQuit ->setText(tr("&Quit")); + actionOptions ->setText(tr("&Options")); + reloadEngineList(); + updateSystrayIcon(); } void SystrayIcon::addCopyEngine(const QString &name,const bool &canDoOnlyCopy) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - EngineEntry entry; - entry.name=name; - entry.canDoOnlyCopy=canDoOnlyCopy; - engineEntryList << entry; - if(plugins->allPluginHaveBeenLoaded()) - reloadEngineList(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + EngineEntry entry; + entry.name=name; + entry.canDoOnlyCopy=canDoOnlyCopy; + engineEntryList << entry; + if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + reloadEngineList(); } void SystrayIcon::removeCopyEngine(const QString &name) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - int index=0; - while(indexclear(); - if(engineEntryList.size()==0) - { - copyMenu->setEnabled(false); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"engineEntryList.size(): "+QString::number(engineEntryList.size())); - copyMenu->setEnabled(true); - if(engineEntryList.size()==1) - { - QAction *copy=new QAction(IconAdd,tr("Add ©"),copyMenu); - connect(copy,SIGNAL(triggered()),this,SLOT(CatchCopyQuery())); - copy->setData(engineEntryList.first().name); - copyMenu->addAction(copy); - if(!engineEntryList.first().canDoOnlyCopy) - { - QAction *transfer=new QAction(IconAdd,tr("Add &transfer"),copyMenu); - connect(transfer,SIGNAL(triggered()),this,SLOT(CatchTransferQuery())); - transfer->setData(engineEntryList.first().name); - copyMenu->addAction(transfer); - QAction *move=new QAction(IconAdd,tr("Add &move"),copyMenu); - connect(move,SIGNAL(triggered()),this,SLOT(CatchMoveQuery())); - move->setData(engineEntryList.first().name); - copyMenu->addAction(move); - } - } - else - { - int index=0; - while(indexsetData(engineEntryList.at(index).name); - menu->addAction(copy); - if(!engineEntryList.at(index).canDoOnlyCopy) - { - QAction *transfer=new QAction(IconAdd,tr("Add &transfer"),menu); - connect(transfer,SIGNAL(triggered()),this,SLOT(CatchTransferQuery())); - transfer->setData(engineEntryList.at(index).name); - menu->addAction(transfer); - QAction *move=new QAction(IconAdd,tr("Add &move"),menu); - connect(move,SIGNAL(triggered()),this,SLOT(CatchMoveQuery())); - move->setData(engineEntryList.at(index).name); - menu->addAction(move); - } - copyMenu->addMenu(menu); - index++; - } - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + if(copyMenu!=NULL) + { + delete copyMenu; + copyMenu=NULL; + } + copyMenu=new QMenu(); + copyMenu ->setTitle(tr("A&dd copy/moving")); + copyMenu->setIcon(IconAdd); + systrayMenu->insertMenu(actionOptions,copyMenu); + copyMenu->setEnabled(true); + if(engineEntryList.size()==0) + { + copyMenu->setEnabled(false); + return; + } + #else + { + int index=0; + while(indexsetData(engineEntryList.first().name); + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + copyMenu->addAction(copy); + #else + actions << copy; + systrayMenu->insertAction(actionOptions,copy); + #endif + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + if(!engineEntryList.first().canDoOnlyCopy) + { + connect(copyMenu,&QMenu::triggered,this,&SystrayIcon::CatchTransferQuery); + + QAction *transfer=new QAction(IconAdd,tr("&Transfer"),copyMenu); + connect(transfer,&QAction::triggered,this,&SystrayIcon::CatchTransferQuery); + transfer->setData(engineEntryList.first().name); + copyMenu->addAction(transfer); + QAction *move=new QAction(IconAdd,tr("&Move"),copyMenu); + connect(move,&QAction::triggered,this,&SystrayIcon::CatchMoveQuery); + move->setData(engineEntryList.first().name); + copyMenu->addAction(move); + } + else + connect(copyMenu,&QMenu::triggered,this,&SystrayIcon::CatchCopyQuery); + #else + if(!engineEntryList.first().canDoOnlyCopy) + { + QAction *transfer=new QAction(IconAdd,tr("&Transfer"),nullptr); + connect(transfer,&QAction::triggered,this,&SystrayIcon::CatchTransferQuery); + transfer->setData(engineEntryList.first().name); + systrayMenu->insertAction(actionOptions,transfer); + QAction *move=new QAction(IconAdd,tr("&Move"),nullptr); + connect(move,&QAction::triggered,this,&SystrayIcon::CatchMoveQuery); + move->setData(engineEntryList.first().name); + systrayMenu->insertAction(actionOptions,move); + } + #endif + + } + else + { + int index=0; + while(indexsetData(name); + menu->addAction(copy); + if(!engineEntry.canDoOnlyCopy) + { + QAction *transfer=new QAction(IconAdd,tr("Add &transfer"),menu); + connect(transfer,&QAction::triggered,this,&SystrayIcon::CatchTransferQuery); + transfer->setData(name); + menu->addAction(transfer); + QAction *move=new QAction(IconAdd,tr("Add &move"),menu); + connect(move,&QAction::triggered,this,&SystrayIcon::CatchMoveQuery); + move->setData(name); + menu->addAction(move); + } + copyMenu->addMenu(menu); + #else + QAction *copy=new QAction(IconAdd,tr("Add ©")+" ("+name+")",nullptr); + connect(copy,&QAction::triggered,this,&SystrayIcon::CatchCopyQuery); + copy->setData(name); + systrayMenu->insertAction(actionOptions,copy); + if(!engineEntry.canDoOnlyCopy) + { + QAction *transfer=new QAction(IconAdd,tr("Add &transfer")+" ("+name+")",nullptr); + connect(transfer,&QAction::triggered,this,&SystrayIcon::CatchTransferQuery); + transfer->setData(name); + systrayMenu->insertAction(actionOptions,transfer); + QAction *move=new QAction(IconAdd,tr("Add &move")+" ("+name+")",nullptr); + connect(move,&QAction::triggered,this,&SystrayIcon::CatchMoveQuery); + move->setData(name); + systrayMenu->insertAction(actionOptions,move); + } + #endif + index++; + } + } } diff --git a/SystrayIcon.h b/SystrayIcon.h index b90cbea..bb7922c 100644 --- a/SystrayIcon.h +++ b/SystrayIcon.h @@ -1,8 +1,6 @@ /** \file SystrayIcon.h \brief Define the class of the systray icon \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef SYSTRAY_ICON_H @@ -18,107 +16,126 @@ #include #include "Environment.h" -#include "GlobalClass.h" /** \brief The systray icon This class provide a systray icon and its functions */ -class SystrayIcon : public QSystemTrayIcon, public GlobalClass +class SystrayIcon : public QSystemTrayIcon { - Q_OBJECT - public: - /// \brief Initiate and show the icon in the systray - SystrayIcon(); - /// \brief Hide and destroy the icon in the systray - ~SystrayIcon(); - public slots: - /// \brief For show a message linked to the systray icon - void showSystrayMessage(const QString& text); - /** \brief Send that's caught state have changed for CatchedState::Uncatched or CatchedState::Semicatched or CatchedState::Catched - \see CatchState - \see tryCatchCopy() - \see tryUncatchCopy() - \param state is the new state */ - void listenerReady(const ListeningState &state,const bool &havePlugin,const bool &someAreInWaitOfReply); - void pluginLoaderReady(const CatchState &state,const bool &havePlugin,const bool &someAreInWaitOfReply); - void addCopyEngine(const QString &name,const bool &canDoOnlyCopy); - void removeCopyEngine(const QString &name); - private: - QMenu* systrayMenu; ///< Pointer on the menu - QMenu* copyMenu; ///< Pointer on the copy menu (move or copy) - QAction* actionMenuQuit; ///< Pointer on the Quit action - QAction* actionMenuAbout; ///< Pointer on the About action - QAction* actionOptions; ///< Pointer on the Options action - QIcon IconQuit; ///< Pointer on the icon for quit - QIcon IconInfo; ///< Pointer on the icon for info - QIcon IconAdd; ///< Pointer on the icon for add - QIcon IconOptions; ///< Pointer on the options - /// \brief To update the systray icon - void updateSystrayIcon(); - void showTryCatchMessageWithNoListener(); - struct EngineEntry - { - bool canDoOnlyCopy; - QString name; - }; - QList engineEntryList; - // To store the current catch state - ListeningState stateListener; - CatchState statePluginLoader; - bool haveListenerInfo,havePluginLoaderInfo; - bool haveListener,havePluginLoader; - QTimer timerCheckSetTooltip; - /** \brief drag event processing (impossible with Qt on systray) + Q_OBJECT + public: + /// \brief Initiate and show the icon in the systray + SystrayIcon(QObject * parent = 0); + /// \brief Hide and destroy the icon in the systray + ~SystrayIcon(); + public slots: + /// \brief For show a message linked to the systray icon + void showSystrayMessage(const QString& text); + /** \brief Send that's caught state have changed for CatchedState::Uncatched or CatchedState::Semicatched or CatchedState::Catched + \see CatchState + \see tryCatchCopy() + \see tryUncatchCopy() + \param state is the new state */ + void listenerReady(const Ultracopier::ListeningState &state,const bool &havePlugin,const bool &someAreInWaitOfReply); + void pluginLoaderReady(const Ultracopier::CatchState &state,const bool &havePlugin,const bool &someAreInWaitOfReply); + void addCopyEngine(const QString &name,const bool &canDoOnlyCopy); + void removeCopyEngine(const QString &name); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + void newUpdate(const QString &version); + #endif + private: + #ifdef ULTRACOPIER_INTERNET_SUPPORT + QString lastVersion; + #endif + QMenu* systrayMenu; ///< Pointer on the menu + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + QMenu* copyMenu; ///< Pointer on the copy menu (move or copy) + #else + QList actions; + #endif + QAction* actionMenuQuit; ///< Pointer on the Quit action + #ifdef ULTRACOPIER_DEBUG + QAction* actionSaveBugReport; + #endif + QAction* actionMenuAbout; ///< Pointer on the About action + QAction* actionOptions; ///< Pointer on the Options action + QIcon IconQuit; ///< Pointer on the icon for quit + #ifdef ULTRACOPIER_DEBUG + QIcon IconSaveBugReport; + #endif + QIcon IconInfo; ///< Pointer on the icon for info + QIcon IconAdd; ///< Pointer on the icon for add + QIcon IconOptions; ///< Pointer on the options + /// \brief To update the systray icon + void updateSystrayIcon(); + void showTryCatchMessageWithNoListener(); + struct EngineEntry + { + bool canDoOnlyCopy; + QString name; + }; + QList engineEntryList; + // To store the current catch state + Ultracopier::ListeningState stateListener; + Ultracopier::CatchState statePluginLoader; + bool haveListenerInfo,havePluginLoaderInfo; + bool haveListener,havePluginLoader; + QTimer timerCheckSetTooltip; + /** \brief drag event processing (impossible with Qt on systray) - need setAcceptDrops(true); into the constructor - need implementation to accept the drop: - void dragEnterEvent(QDragEnterEvent* event); - void dragMoveEvent(QDragMoveEvent* event); - void dragLeaveEvent(QDragLeaveEvent* event); - */ - void dropEvent(QDropEvent *event); - /** \brief accept all event to allow the drag and drop - \see dropEvent() */ - void dragEnterEvent(QDragEnterEvent* event); - /** \brief accept all event to allow the drag and drop - \see dropEvent() */ - void dragMoveEvent(QDragMoveEvent* event); - /** \brief accept all event to allow the drag and drop - \see dropEvent() */ - void dragLeaveEvent(QDragLeaveEvent* event); - private slots: - /// \brief To update the current themes - void updateCurrentTheme(); - /** \brief To catch an action on the systray icon - \param reason Why it activated */ - void CatchAction(QSystemTrayIcon::ActivationReason reason); - /// \brief To catch copy menu action - void CatchCopyQuery(); - /// \brief To catch move menu action - void CatchMoveQuery(); - /// \brief To catch transfer menu action - void CatchTransferQuery(); - /// \brief to retranslate the ui - void retranslateTheUI(); - void reloadEngineList(); - void checkSetTooltip(); - signals: - /// \brief Quit ultracopier - void quit(); - /// \brief Try catch the copy/move with plugin compatible - void tryCatchCopy(); - /// \brief Try uncatch the copy/move with plugin compatible - void tryUncatchCopy(); - /// \brief Show the help dialog - void showHelp(); - /// \brief Show the help option - void showOptions(); - /** \brief Add window copy or window move - \param mode Can be CopyMode::Copy or CopyMode::Move - \return The core object of the new window created */ - void addWindowCopyMove(CopyMode mode,QString name); - void addWindowTransfer(QString name); - void urlDropped(QList urls); + need setAcceptDrops(true); into the constructor + need implementation to accept the drop: + void dragEnterEvent(QDragEnterEvent* event); + void dragMoveEvent(QDragMoveEvent* event); + void dragLeaveEvent(QDragLeaveEvent* event); + */ + void dropEvent(QDropEvent *event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragEnterEvent(QDragEnterEvent* event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragMoveEvent(QDragMoveEvent* event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragLeaveEvent(QDragLeaveEvent* event); + private slots: + /// \brief To update the current themes + void updateCurrentTheme(); + /** \brief To catch an action on the systray icon + \param reason Why it activated */ + void CatchAction(QSystemTrayIcon::ActivationReason reason); + /// \brief To catch copy menu action + void CatchCopyQuery(); + /// \brief To catch move menu action + void CatchMoveQuery(); + /// \brief To catch transfer menu action + void CatchTransferQuery(); + /// \brief to retranslate the ui + void retranslateTheUI(); + void reloadEngineList(); + void checkSetTooltip(); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + void messageClicked(); + #endif + signals: + /// \brief Quit ultracopier + void quit() const; + /// \brief Try catch the copy/move with plugin compatible + void tryCatchCopy() const; + /// \brief Try uncatch the copy/move with plugin compatible + void tryUncatchCopy() const; + /// \brief Show the help dialog + void showHelp() const; + /// \brief Show the help option + void showOptions() const; + /** \brief Add window copy or window move + \param mode Can be CopyMode::Copy or CopyMode::Move + \return The core object of the new window created */ + void addWindowCopyMove(Ultracopier::CopyMode mode,QString name) const; + void addWindowTransfer(QString name) const; + void urlDropped(QList urls) const; + void saveBugReport() const; }; #endif // SYSTRAY_ICON_H diff --git a/ThemesManager.cpp b/ThemesManager.cpp index 3881355..c47d0e0 100644 --- a/ThemesManager.cpp +++ b/ThemesManager.cpp @@ -1,248 +1,299 @@ /** \file ThemesManager.cpp \brief Define the class for manage and load the themes \author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ +\licence GPL3, see the file COPYING */ #include #include #include #include "ThemesManager.h" +#include "PluginsManager.h" +#include "LanguagesManager.h" +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#ifdef ULTRACOPIER_MODE_SUPERCOPIER +#error, not done +#else +#include "plugins/Themes/Oxygen/ThemesFactory.h" +#endif +#endif + +#ifdef ULTRACOPIER_MODE_SUPERCOPIER +#define ULTRACOPIER_DEFAULT_STYLE "Supercopier" +#else #define ULTRACOPIER_DEFAULT_STYLE "Oxygen" +#endif -/// \todo load each plugin to have their options +/// \warning All plugin remain loaded /// \todo get the current themes instance /// \brief Create the manager and load the defaults variables ThemesManager::ThemesManager() { - //load the debug engine as external part because ThemesManager is base class - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - currentPluginIndex=-1; - - //load the overall instance - resources=ResourcesManager::getInstance(); - plugins=PluginsManager::getInstance(); - options=OptionEngine::getInstance(); - languages=LanguagesManager::getInstance(); - - //connect the plugin management - plugins->lockPluginListEdition(); - connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection); - connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection); - connect(plugins,SIGNAL(pluginListingIsfinish()), this,SLOT(allPluginIsLoaded()),Qt::QueuedConnection); - QList list=plugins->getPluginsByCategory(PluginType_Themes); - foreach(PluginsAvailable currentPlugin,list) - emit previouslyPluginAdded(currentPlugin); - plugins->unlockPluginListEdition(); - - //do the options - QList > KeysList; - KeysList.append(qMakePair(QString("Ultracopier_current_theme"),QVariant(ULTRACOPIER_DEFAULT_STYLE))); - options->addOptionGroup("Themes",KeysList); - - //load the default and current themes path - defaultStylePath=":/Themes/"+QString(ULTRACOPIER_DEFAULT_STYLE)+"/"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Default style: "+defaultStylePath); - currentStylePath=defaultStylePath; - connect(options, SIGNAL(newOptionValue(QString,QString,QVariant)), this, SLOT(newOptionValue(QString,QString,QVariant)),Qt::QueuedConnection); - connect(languages, SIGNAL(newLanguageLoaded(QString)), &facilityEngine,SLOT(retranslate()),Qt::QueuedConnection); + //load the debug engine as external part because ThemesManager is base class + stopIt=false; + currentPluginIndex=-1; + + //connect the plugin management + PluginsManager::pluginsManager->lockPluginListEdition(); + connect(this, &ThemesManager::previouslyPluginAdded, this,&ThemesManager::onePluginAdded,Qt::QueuedConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginAdded, this,&ThemesManager::onePluginAdded,Qt::QueuedConnection); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved, this,&ThemesManager::onePluginWillBeRemoved,Qt::DirectConnection); + connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeUnloaded, this,&ThemesManager::onePluginWillBeRemoved,Qt::DirectConnection); + #endif + connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish, this,&ThemesManager::allPluginIsLoaded,Qt::QueuedConnection); + QList list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_Themes); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + + //do the options + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("Ultracopier_current_theme"),QVariant(ULTRACOPIER_DEFAULT_STYLE))); + OptionEngine::optionEngine->addOptionGroup(QStringLiteral("Themes"),KeysList); + + //load the default and current themes path + defaultStylePath=QStringLiteral(":/Themes/")+QStringLiteral(ULTRACOPIER_DEFAULT_STYLE)+QStringLiteral("/"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Default style: ")+defaultStylePath); + currentStylePath=defaultStylePath; + connect(OptionEngine::optionEngine, &OptionEngine::newOptionValue, this, &ThemesManager::newOptionValue,Qt::QueuedConnection); } /// \brief Destroy the themes manager ThemesManager::~ThemesManager() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QList list=plugins->getPluginsByCategory(PluginType_Themes); - foreach(PluginsAvailable currentPlugin,list) - onePluginWillBeRemoved(currentPlugin); - LanguagesManager::destroyInstanceAtTheLastCall(); - OptionEngine::destroyInstanceAtTheLastCall(); - PluginsManager::destroyInstanceAtTheLastCall(); - ResourcesManager::destroyInstanceAtTheLastCall(); + stopIt=true; } void ThemesManager::onePluginAdded(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_Themes) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+plugin.name); - PluginsAvailableThemes newPlugin; - newPlugin.plugin=plugin; - QPluginLoader *pluginLoader=new QPluginLoader(newPlugin.plugin.path+QDir::separator()+plugins->getResolvedPluginName("interface")); - QObject *pluginInstance = pluginLoader->instance(); - if(pluginInstance==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to load the plugin %1: %2").arg(newPlugin.plugin.path+QDir::separator()+plugins->getResolvedPluginName("interface")).arg(pluginLoader->errorString())); - pluginLoader->unload(); - } - else - { - PluginInterface_ThemesFactory *factory = qobject_cast(pluginInstance); - //check if found - int indexTemp=0; - while(indexTempgetResolvedPluginName("interface")) - .arg(pluginList.at(indexTemp).plugin.path+QDir::separator()+plugins->getResolvedPluginName("interface")) - .arg(newPlugin.plugin.name) - ); - pluginLoader->unload(); - emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); - emit theThemeIsReloaded(); - return; - } - indexTemp++; - } - if(factory==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to cast the plugin: %1").arg(pluginLoader->errorString())); - pluginLoader->unload(); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("preload: %1, at the index: %2").arg(newPlugin.plugin.name).arg(QString::number(pluginList.size()))); - #ifdef ULTRACOPIER_DEBUG - qRegisterMetaType("DebugLevel"); - connect(factory,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SLOT(debugInformation(DebugLevel,QString,QString,QString,int)),Qt::QueuedConnection); - #endif // ULTRACOPIER_DEBUG - connect(languages,SIGNAL(newLanguageLoaded(QString)),factory,SLOT(newLanguageLoaded())); - newPlugin.factory=factory; - newPlugin.pluginLoader=pluginLoader; - newPlugin.options=new LocalPluginOptions("Themes-"+newPlugin.plugin.name); - newPlugin.factory->setResources(newPlugin.options,newPlugin.plugin.writablePath,newPlugin.plugin.path,&facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL); - currentStylePath=newPlugin.plugin.path; - pluginList << newPlugin; - if(plugins->allPluginHaveBeenLoaded()) - allPluginIsLoaded(); - emit newThemeOptions(newPlugin.plugin.name,newPlugin.factory->options(),true,true); - emit theThemeIsReloaded(); - return; - } - } - emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); - emit theThemeIsReloaded(); + if(plugin.category!=PluginType_Themes) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+plugin.name); + PluginsAvailableThemes newPlugin; + newPlugin.plugin=plugin; + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + PluginInterface_ThemesFactory *factory; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QObjectList objectList=QPluginLoader::staticInstances(); + int index=0; + QObject *pluginObject; + while(index(pluginObject); + if(factory!=NULL) + break; + index++; + } + if(index==objectList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("static themes not found")); + emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); + emit theThemeIsReloaded(); + return; + } + newPlugin.pluginLoader=NULL; + #else + factory=new ThemesFactory(); + #endif + #else + QPluginLoader *pluginLoader=new QPluginLoader(newPlugin.plugin.path+QDir::separator()+PluginsManager::pluginsManager->getResolvedPluginName("interface")); + QObject *pluginInstance = pluginLoader->instance(); + if(pluginInstance==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("unable to load the plugin %1: %2").arg(newPlugin.plugin.path+QDir::separator()+PluginsManager::pluginsManager->getResolvedPluginName("interface")).arg(pluginLoader->errorString())); + pluginLoader->unload(); + emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); + emit theThemeIsReloaded(); + return; + } + PluginInterface_ThemesFactory *factory = qobject_cast(pluginInstance); + if(factory==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("unable to cast the plugin: %1").arg(pluginLoader->errorString())); + pluginLoader->unload(); + emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); + emit theThemeIsReloaded(); + return; + } + //check if found + int indexTemp=0; + while(indexTempgetResolvedPluginName("interface")) + .arg(pluginList.at(indexTemp).plugin.path+QDir::separator()+PluginsManager::pluginsManager->getResolvedPluginName("interface")) + .arg(newPlugin.plugin.name) + ); + pluginLoader->unload(); + emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); + emit theThemeIsReloaded(); + return; + } + indexTemp++; + } + newPlugin.pluginLoader=pluginLoader; + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("preload: %1, at the index: %2").arg(newPlugin.plugin.name).arg(QString::number(pluginList.size()))); + #ifdef ULTRACOPIER_DEBUG + connect(factory,&PluginInterface_ThemesFactory::debugInformation,this,&ThemesManager::debugInformation,Qt::QueuedConnection); + #endif // ULTRACOPIER_DEBUG + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,factory,&PluginInterface_ThemesFactory::newLanguageLoaded); + newPlugin.factory=factory; + + newPlugin.options=new LocalPluginOptions(QStringLiteral("Themes-")+newPlugin.plugin.name); + newPlugin.factory->setResources(newPlugin.options,newPlugin.plugin.writablePath,newPlugin.plugin.path,&FacilityEngine::facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL); + currentStylePath=newPlugin.plugin.path; + pluginList << newPlugin; + if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + allPluginIsLoaded(); + emit newThemeOptions(newPlugin.plugin.name,newPlugin.factory->options(),true,true); + emit theThemeIsReloaded(); + return; } +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE void ThemesManager::onePluginWillBeRemoved(const PluginsAvailable &plugin) { - if(plugin.category!=PluginType_Themes) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+plugin.name); - int index=0; - while(indexunload(); - delete pluginList.at(index).pluginLoader; - } - if(currentPluginIndex==index) - currentPluginIndex=-1; - if(indexunload(); + delete pluginList.at(index).pluginLoader; + } + if(currentPluginIndex==index) + currentPluginIndex=-1; + if(index=pluginList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"plugin is out of inder!"); + currentPluginIndex=-1; + } + return; + } + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"plugin not found"); } +#endif /** \brief To get image into the current themes, or default if not found \param filePath The file path to search, like toto.png resolved with the root of the current themes \see currentStylePath */ QIcon ThemesManager::loadIcon(const QString &fileName) { - if(currentPluginIndex==-1) - return QIcon(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Send interface pixmap: "+fileName); - return pluginList.at(currentPluginIndex).factory->getIcon(fileName); + if(currentPluginIndex==-1) + return QIcon(); + if(pluginList.at(currentPluginIndex).factory==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Try get icon when the factory is not loaded"); + return QIcon(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Send interface pixmap: "+fileName); + return pluginList.at(currentPluginIndex).factory->getIcon(fileName); } void ThemesManager::allPluginIsLoaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(pluginList.size()==0) - { - emit theThemeIsReloaded(); - return; - } - QString name=options->getOptionValue("Themes","Ultracopier_current_theme").toString(); - int index=0; - while(indexgetOptionValue("Themes","Ultracopier_current_theme").toString(); + int index=0; + while(indexgetInstance(); + if(currentPluginIndex==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, copy aborted"); + return NULL; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Send interface: "+pluginList.at(currentPluginIndex).plugin.name); + if(currentPluginIndex>=pluginList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, internal selection bug"); + return NULL; + } + if(pluginList.at(currentPluginIndex).factory==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"No plugin factory loaded to get an instance"); + return NULL; + } + return pluginList.at(currentPluginIndex).factory->getInstance(); } #ifdef ULTRACOPIER_DEBUG -void ThemesManager::debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne) +void ThemesManager::debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne) { - DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Theme plugin"); + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,QStringLiteral("Theme plugin")); } #endif // ULTRACOPIER_DEBUG void ThemesManager::newOptionValue(const QString &group,const QString &name,const QVariant &value) { - if(group=="Themes" && name=="Ultracopier_current_theme") - { - if(!plugins->allPluginHaveBeenLoaded()) - return; - if(currentPluginIndex!=-1 && value.toString()!=pluginList.at(currentPluginIndex).plugin.name) - { - int tempCurrentPluginIndex=currentPluginIndex; - emit theThemeNeedBeUnloaded(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("unload the themes: %1 (%2)").arg(pluginList.at(tempCurrentPluginIndex).plugin.name).arg(tempCurrentPluginIndex)); - if(pluginList.at(tempCurrentPluginIndex).options!=NULL) - { - delete pluginList.at(tempCurrentPluginIndex).options; - pluginList[tempCurrentPluginIndex].options=NULL; - } - if(pluginList.at(tempCurrentPluginIndex).factory!=NULL) - { - delete pluginList.at(tempCurrentPluginIndex).factory; - pluginList[tempCurrentPluginIndex].factory=NULL; - } - if(pluginList.at(tempCurrentPluginIndex).pluginLoader!=NULL) - { - pluginList.at(tempCurrentPluginIndex).pluginLoader->unload(); - delete pluginList.at(tempCurrentPluginIndex).pluginLoader; - pluginList[tempCurrentPluginIndex].pluginLoader=NULL; - } - } - allPluginIsLoaded(); - //emit theThemeIsReloaded(); -> do into allPluginIsLoaded(); now - } + if(group==QStringLiteral("Themes") && name==QStringLiteral("Ultracopier_current_theme")) + { + if(!PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + return; + if(currentPluginIndex!=-1 && value.toString()!=pluginList.at(currentPluginIndex).plugin.name) + { + //int tempCurrentPluginIndex=currentPluginIndex; + emit theThemeNeedBeUnloaded(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("unload the themes: %1 (%2)").arg(pluginList.at(currentPluginIndex).plugin.name).arg(currentPluginIndex)); + /* Themes remain loaded for the options + *if(pluginList.at(tempCurrentPluginIndex).options!=NULL) + { + delete pluginList.at(tempCurrentPluginIndex).options; + pluginList[tempCurrentPluginIndex].options=NULL; + } + if(pluginList.at(tempCurrentPluginIndex).factory!=NULL) + { + delete pluginList.at(tempCurrentPluginIndex).factory; + pluginList[tempCurrentPluginIndex].factory=NULL; + } + if(pluginList.at(tempCurrentPluginIndex).pluginLoader!=NULL) + { + pluginList.at(tempCurrentPluginIndex).pluginLoader->unload(); + delete pluginList.at(tempCurrentPluginIndex).pluginLoader; + pluginList[tempCurrentPluginIndex].pluginLoader=NULL; + } */ + } + allPluginIsLoaded(); + //emit theThemeIsReloaded(); -> do into allPluginIsLoaded(); now + } } diff --git a/ThemesManager.h b/ThemesManager.h index af30ee4..1f8096d 100644 --- a/ThemesManager.h +++ b/ThemesManager.h @@ -1,9 +1,7 @@ /** \file ThemesManager.h \brief Define the class to manage and load the themes \author alpha_one_x86 -\version 0.3 -\date 2010 -\licence GPL3, see the file COPYING */ +\licence GPL3, see the file COPYING */ #ifndef THEMES_MANAGER_H #define THEMES_MANAGER_H @@ -12,11 +10,12 @@ #include #include #include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT #include +#endif #include "Environment.h" #include "ResourcesManager.h" -#include "Singleton.h" #include "OptionEngine.h" #include "PluginsManager.h" #include "LanguagesManager.h" @@ -28,64 +27,61 @@ /** \brief Define the class to manage and load the themes This class provide a core load and manage the themes */ -class ThemesManager : public QObject, public Singleton +class ThemesManager : public QObject { - Q_OBJECT - friend class Singleton; - //public slots: - /*/// \brief To change the current themes selected - bool changeCurrentTheme(QString theNewThemeToLoad);*/ - public: - /** \brief To get image into the current themes, or default if not found - \param filePath The file path to search, like toto.png resolved with the root of the current themes - \see currentStylePath */ - QIcon loadIcon(const QString &fileName); - /** \brief To get if one themes instance - \see Core() */ - PluginInterface_Themes * getThemesInstance(); - private: - /// \brief Create the manager and load the defaults variables - ThemesManager(); - /// \brief Destroy the themes manager - ~ThemesManager(); - /// \brief The default themes path where it has theme's files - QString defaultStylePath; - /// \brief The current themes path loaded by ultracopier - QString currentStylePath; - /// \brief Store the object of resources manager - ResourcesManager *resources; - //for the options - OptionEngine *options; - /// \brief Store the object of languages manager - LanguagesManager *languages; - /// \brief Store the object of plugin manager - PluginsManager *plugins; - /// \brief OptionEngineGroupKey then: Group -> Key - struct PluginsAvailableThemes - { - PluginsAvailable plugin; - PluginInterface_ThemesFactory *factory; - QPluginLoader *pluginLoader; - LocalPluginOptions *options; - }; - QList pluginList; - int currentPluginIndex; - FacilityEngine facilityEngine; - signals: - /// \brief send this signal when the themes have changed - void theThemeNeedBeUnloaded(); - void theThemeIsReloaded(); - void newThemeOptions(QString name,QWidget *,bool isLoaded,bool havePlugin); - void previouslyPluginAdded(PluginsAvailable); - private slots: - /// \brief reload the themes - void onePluginAdded(const PluginsAvailable &plugin); - void onePluginWillBeRemoved(const PluginsAvailable &plugin); - void allPluginIsLoaded(); - void newOptionValue(const QString &group,const QString &name,const QVariant &value); - #ifdef ULTRACOPIER_DEBUG - void debugInformation(DebugLevel level,const QString& fonction,const QString& text,const QString& file,const int& ligne); - #endif // ULTRACOPIER_DEBUG + Q_OBJECT + //public slots: + /*/// \brief To change the current themes selected + bool changeCurrentTheme(QString theNewThemeToLoad);*/ + public: + /** \brief To get image into the current themes, or default if not found + \param filePath The file path to search, like toto.png resolved with the root of the current themes + \see currentStylePath */ + QIcon loadIcon(const QString &fileName); + /** \brief To get if one themes instance + \see Core() */ + PluginInterface_Themes * getThemesInstance(); + + static ThemesManager *themesManager; + /// \brief Create the manager and load the defaults variables + ThemesManager(); + /// \brief Destroy the themes manager + ~ThemesManager(); + private: + /// \brief The default themes path where it has theme's files + QString defaultStylePath; + /// \brief The current themes path loaded by ultracopier + QString currentStylePath; + /// \brief OptionEngineGroupKey then: Group -> Key + struct PluginsAvailableThemes + { + PluginsAvailable plugin; + PluginInterface_ThemesFactory *factory; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader *pluginLoader; + #endif + LocalPluginOptions *options; + }; + QList pluginList; + int currentPluginIndex; + bool stopIt; + signals: + /// \brief send this signal when the themes have changed + void theThemeNeedBeUnloaded() const; + void theThemeIsReloaded() const; + void newThemeOptions(const QString &name,QWidget *,const bool &isLoaded,const bool &havePlugin) const; + void previouslyPluginAdded(PluginsAvailable) const; + private slots: + /// \brief reload the themes + void onePluginAdded(const PluginsAvailable &plugin); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + void onePluginWillBeRemoved(const PluginsAvailable &plugin); + #endif + void allPluginIsLoaded(); + void newOptionValue(const QString &group,const QString &name,const QVariant &value); + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level, const QString& fonction, const QString& text, const QString& file, const int& ligne); + #endif // ULTRACOPIER_DEBUG }; #endif // THEMES_MANAGER_H diff --git a/Variable.h b/Variable.h index 6e16355..66a41c2 100644 --- a/Variable.h +++ b/Variable.h @@ -1,8 +1,6 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef VARIABLE_H @@ -10,32 +8,44 @@ /// \brief Un-comment this next line to put ultracopier in debug mode #define ULTRACOPIER_DEBUG -/// \brief Max number of ligne show on the GUI -#define ULTRACOPIER_DEBUG_MAX_GUI_LINE 5000 +#define ULTRACOPIER_DEBUG_MAX_GUI_LINE 50000 ///< \brief Max number of ligne show on the GUI +#define ULTRACOPIER_DEBUG_MAX_ALL_SIZE 128 ///< \brief Max size (in MB) after the console/file output is dropped +#define ULTRACOPIER_DEBUG_MAX_IMPORTANT_SIZE 150 ///< \brief Max size (in MB) after the console/file important output is dropped /// \brief the version -#define ULTRACOPIER_VERSION "0.3.1.0" +#define ULTRACOPIER_VERSION "1.2.3.6" /// \brief the windows version -#define ULTRACOPIER_WINDOWS_VERSION 0,3,1,0 +#define ULTRACOPIER_WINDOWS_VERSION 1,2,3,6 // define if the version is portable or not ////#define ULTRACOPIER_VERSION_PORTABLE ////#define ULTRACOPIER_VERSION_PORTABLEAPPS // define if the version is ultimate, need change only the name in the code -//#define ULTRACOPIER_VERSION_ULTIMATE +#define ULTRACOPIER_VERSION_ULTIMATE +//#define ULTRACOPIER_PLUGIN_ALL_IN_ONE +//#define ULTRACOPIER_CGMINER +//#define ULTRACOPIER_ILLEGAL +//#define ULTRACOPIER_MODE_SUPERCOPIER /// \brief define time to update the speed detection update ont the interface (in ms) #define ULTRACOPIER_TIME_INTERFACE_UPDATE 500 /** \brief How many value store to calculate the average value * 5*ULTRACOPIER_TIME_INTERFACE_UPDATE = 5*500 to get 2.5s * */ +#define ULTRACOPIER_MAXREMAININGTIMECOL 10 #define ULTRACOPIER_MAXVALUESPEEDSTORED 5 +#define ULTRACOPIER_MINVALUESPEED 3 +#define ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME 120 +#define ULTRACOPIER_MINVALUESPEEDTOREMAININGTIME 10 +#define ULTRACOPIER_REMAININGTIME_BIGFILEMEGABYTEBASE10 100 /// \brief the socket name, to have unique instance of ultracopier, and pass arguments between the instance -#define ULTRACOPIER_SOCKETNAME "ultracopier-0.3" +#define ULTRACOPIER_SOCKETNAME "ultracopier" /// \brief to have internet support, to communicate with the web site for update and plugins #define ULTRACOPIER_INTERNET_SUPPORT -/// \brief to disable plugin support to do all in one version with static Qt for the protable version -#define ULTRACOPIER_PLUGIN_SUPPORT +/// \brief to disable plugin support, import and remove +#define ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + +#define ULTRACOPIER_UPDATER_URL "http://ultracopier-update.first-world.info:10852/updater.txt" #endif // VARIABLE_H diff --git a/interface/FacilityInterface.h b/interface/FacilityInterface.h index 1ced0a2..1893349 100644 --- a/interface/FacilityInterface.h +++ b/interface/FacilityInterface.h @@ -1,8 +1,7 @@ /** \file FacilityInterface.h \brief Define the class of the facility engine \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef FACILITY_INTERFACE_H #define FACILITY_INTERFACE_H @@ -14,27 +13,32 @@ #include "../StructEnumDefinition.h" /// \brief To define the interface, to pass the facility object from Ultracopier to the plugins without compatibility problem +//not possible to be static, because in the plugin it's not resolved class FacilityInterface : public QObject { - public: - /// \brief To force the text re-translation - virtual void retranslate() = 0; - /// \brief convert size in Byte to String - virtual QString sizeToString(const double &size) = 0; - /// \brief convert size unit to String - virtual QString sizeUnitToString(const SizeUnit &sizeUnit) = 0; - /// \brief translate the text - virtual QString translateText(const QString &text) = 0; - /// \brief speed to string in byte per seconds - virtual QString speedToString(const double &speed) = 0; - /// \brief Decompose the time in second - virtual TimeDecomposition secondsToTimeDecomposition(const quint32 &seconds) = 0; - /// \brief have the fonctionnality - virtual bool haveFunctionality(const QString &fonctionnality) = 0; - /// \brief call the fonctionnality - virtual QVariant callFunctionality(const QString &fonctionnality,const QStringList &args=QStringList()) = 0; - /// \brief Do the simplified time - virtual QString simplifiedRemainingTime(const quint32 &seconds) = 0; + public: + /// \brief To force the text re-translation + virtual void retranslate() = 0; + /// \brief convert size in Byte to String + virtual QString sizeToString(const double &size) const = 0; + /// \brief convert size unit to String + virtual QString sizeUnitToString(const Ultracopier::SizeUnit &sizeUnit) const = 0; + /// \brief translate the text + virtual QString translateText(const QString &text) const = 0; + /// \brief speed to string in byte per seconds + virtual QString speedToString(const double &speed) const = 0; + /// \brief Decompose the time in second + virtual Ultracopier::TimeDecomposition secondsToTimeDecomposition(const quint32 &seconds) const = 0; + /// \brief have the fonctionnality + virtual bool haveFunctionality(const QString &fonctionnality) const = 0; + /// \brief call the fonctionnality + virtual QVariant callFunctionality(const QString &fonctionnality,const QStringList &args=QStringList()) = 0; + /// \brief Do the simplified time + virtual QString simplifiedRemainingTime(const quint32 &seconds) const = 0; + /// \brief Do the simplified time + virtual QString ultimateUrl() const = 0; + /// \brief Return the software name + virtual QString softwareName() const = 0; }; #endif // FACILITY_INTERFACE_H diff --git a/interface/OptionInterface.h b/interface/OptionInterface.h index 2be66cb..9638170 100644 --- a/interface/OptionInterface.h +++ b/interface/OptionInterface.h @@ -1,8 +1,7 @@ /** \file OptionInterface.h \brief Define the class of the option engine \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef OPTION_INTERFACE_H #define OPTION_INTERFACE_H @@ -19,19 +18,19 @@ * **/ class OptionInterface : public QObject { - Q_OBJECT - public: - /// \brief To add option group to options - virtual bool addOptionGroup(const QList > &KeysList) = 0; - /*/// \brief To remove option group to options, removed to the load plugin - virtual bool removeOptionGroup() = 0;*/ - /// \brief To get option value - virtual QVariant getOptionValue(const QString &variableName) = 0; - /// \brief To set option value - virtual void setOptionValue(const QString &variableName,const QVariant &value) = 0; - signals: - //void newOptionValue(QString,QVariant);-> disabled because the value will not externally changed, then useless notification - void resetOptions(); + Q_OBJECT + public: + /// \brief To add option group to options + virtual bool addOptionGroup(const QList > &KeysList) = 0; + /*/// \brief To remove option group to options, removed to the load plugin + virtual bool removeOptionGroup() = 0;*/ + /// \brief To get option value + virtual QVariant getOptionValue(const QString &variableName) const = 0; + /// \brief To set option value + virtual void setOptionValue(const QString &variableName,const QVariant &value) = 0; + signals: + //void newOptionValue(QString,QVariant);-> disabled because the value will not externally changed, then useless notification + void resetOptions() const; }; #endif // OPTION_INTERFACE_H diff --git a/interface/PluginInterface_CopyEngine.h b/interface/PluginInterface_CopyEngine.h index fad97fe..c41be7b 100644 --- a/interface/PluginInterface_CopyEngine.h +++ b/interface/PluginInterface_CopyEngine.h @@ -1,8 +1,7 @@ /** \file PluginInterface_CopyEngine.h \brief Define the interface of the plugin of type: copy engine \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGININTERFACE_COPYENGINE_H #define PLUGININTERFACE_COPYENGINE_H @@ -32,193 +31,181 @@ * **/ class PluginInterface_CopyEngine : public QObject { - Q_OBJECT - public: - /** \brief to send the options panel - * \return return false if have not the options - * \param tempWidget the widget to generate on it the options */ - virtual bool getOptionsEngine(QWidget * tempWidget) = 0; - /** \brief to have interface widget to do modal dialog - * \param interface to have the widget of the interface, useful for modal dialog */ - virtual void setInterfacePointer(QWidget * interface) = 0; - /** \brief compare the current sources of the copy, with the passed arguments - * \param sources the sources list to compares with the current sources list - * \return true if have same sources, else false (or empty) */ - virtual bool haveSameSource(const QStringList &sources) = 0; - /** \brief compare the current destination of the copy, with the passed arguments - * \param destination the destination to compares with the current destination - * \return true if have same destination, else false (or empty) */ - virtual bool haveSameDestination(const QString &destination) = 0; - - - //external soft like file browser have send copy/move list to do - /** \brief send copy without destination, ask the destination - * \param sources the sources list to copy - * \return true if the copy have been accepted */ - virtual bool newCopy(const QStringList &sources) = 0; - /** \brief send copy with destination - * \param sources the sources list to copy - * \param destination the destination to copy - * \return true if the copy have been accepted */ - virtual bool newCopy(const QStringList &sources,const QString &destination) = 0; - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \return true if the move have been accepted */ - virtual bool newMove(const QStringList &sources) = 0; - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \param destination the destination to move - * \return true if the move have been accepted */ - virtual bool newMove(const QStringList &sources,const QString &destination) = 0; - /** \brief send the new transfer list - * \param file the transfer list */ - virtual void newTransferList(const QString &file) = 0; - - - /** \brief to get byte read, use by Ultracopier for the speed calculation - * real size transfered to right speed calculation */ - virtual quint64 realByteTransfered() = 0; - - - /** \brief get the speed limitation - * < -1 if not able, 0 if disabled */ - virtual qint64 getSpeedLimitation() = 0; - - - //get user action - /** \brief get the collision action list */ - virtual QList > getCollisionAction() = 0; - /** \brief get the collision error list */ - virtual QList > getErrorAction() = 0; - - - //transfer list - /** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ - virtual void syncTransferList() = 0; - public slots: - //user ask ask to add folder (add it with interface ask source/destination) - /** \brief add folder called on the interface - * Used by manual adding */ - virtual bool userAddFolder(const CopyMode &mode) = 0; - /** \brief add file called on the interface - * Used by manual adding */ - virtual bool userAddFile(const CopyMode &mode) = 0; - - - //action on the transfer - /// \brief put the transfer in pause - virtual void pause() = 0; - /// \brief resume the transfer - virtual void resume() = 0; - /** \brief skip one transfer entry - * \param id id of the file to remove */ - virtual void skip(const quint64 &id) = 0; - /// \brief cancel all the transfer - virtual void cancel() = 0; - - - //edit the transfer list - /** \brief remove the selected item - * \param ids ids is the id list of the selected items */ - virtual void removeItems(const QList &ids) = 0; - /** \brief move on top of the list the selected item - * \param ids ids is the id list of the selected items */ - virtual void moveItemsOnTop(const QList &ids) = 0; - /** \brief move up the list the selected item - * \param ids ids is the id list of the selected items */ - virtual void moveItemsUp(const QList &ids) = 0; - /** \brief move down the list the selected item - * \param ids ids is the id list of the selected items */ - virtual void moveItemsDown(const QList &ids) = 0; - /** \brief move on bottom of the list the selected item - * \param ids ids is the id list of the selected items */ - virtual void moveItemsOnBottom(const QList &ids) = 0; - - - /** \brief give the forced mode, to export/import transfer list */ - virtual void forceMode(const CopyMode &mode) = 0; - /// \brief export the transfer list into a file - virtual void exportTransferList() = 0; - /// \brief import the transfer list into a file - virtual void importTransferList() = 0; - - - /** \brief to set the speed limitation - * -1 if not able, 0 if disabled */ - virtual bool setSpeedLimitation(const qint64 &speedLimitation) = 0; - - - //action - /// \brief to set the collision action - virtual void setCollisionAction(const QString &action) = 0; - /// \brief to set the error action - virtual void setErrorAction(const QString &action) = 0; - /* signal to implement - signals: - //send information about the copy - void actionInProgess(EngineActionInProgress engineActionInProgress); //should update interface information on this event - - void newFolderListing(QString path); - void newCollisionAction(QString action); - void newErrorAction(QString action); - void isInPause(bool isInPause); - - void newActionOnList(const QList&);///very important, need be temporized to group the modification to do and not flood the interface - void syncReady(); - - / ** \brief to get the progression for a specific file - * \param id the id of the transfer, id send during population the transfer list - * first = current transfered byte, second = byte to transfer * / - void pushFileProgression(const QList &progressionList); - //get information about the copy - / ** \brief to get the general progression - * first = current transfered byte, second = byte to transfer * / - void pushGeneralProgression(const quint64 &,const quint64 &); - - //when the cancel is clicked on copy engine dialog - void cancelAll(); - - //when can be deleted - void canBeDeleted(); - - //send error occurred - void error(QString path,quint64 size,QDateTime mtime,QString error); - //for the extra logging - void rmPath(QString path); - void mkPath(QString path);*/ + Q_OBJECT + public: + /** \brief to send the options panel + * \return return false if have not the options + * \param tempWidget the widget to generate on it the options */ + virtual bool getOptionsEngine(QWidget * tempWidget) = 0; + /** \brief to have interface widget to do modal dialog + * \param interface to have the widget of the interface, useful for modal dialog */ + virtual void setInterfacePointer(QWidget * interface) = 0; + /** \brief compare the current sources of the copy, with the passed arguments + * \param sources the sources list to compares with the current sources list + * \return true if have same sources, else false (or empty) */ + virtual bool haveSameSource(const QStringList &sources) = 0; + /** \brief compare the current destination of the copy, with the passed arguments + * \param destination the destination to compares with the current destination + * \return true if have same destination, else false (or empty) */ + virtual bool haveSameDestination(const QString &destination) = 0; + + + //external soft like file browser have send copy/move list to do + /** \brief send copy without destination, ask the destination + * \param sources the sources list to copy + * \return true if the copy have been accepted */ + virtual bool newCopy(const QStringList &sources) = 0; + /** \brief send copy with destination + * \param sources the sources list to copy + * \param destination the destination to copy + * \return true if the copy have been accepted */ + virtual bool newCopy(const QStringList &sources,const QString &destination) = 0; + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \return true if the move have been accepted */ + virtual bool newMove(const QStringList &sources) = 0; + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \param destination the destination to move + * \return true if the move have been accepted */ + virtual bool newMove(const QStringList &sources,const QString &destination) = 0; + /** \brief send the new transfer list + * \param file the transfer list */ + virtual void newTransferList(const QString &file) = 0; + + + /** \brief to get byte read, use by Ultracopier for the speed calculation + * real size transfered to right speed calculation */ + virtual quint64 realByteTransfered() = 0; + + + /** \brief support speed limitation */ + virtual bool supportSpeedLimitation() const = 0; + + //transfer list + /** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ + virtual void syncTransferList() = 0; + public slots: + //user ask ask to add folder (add it with interface ask source/destination) + /** \brief add folder called on the interface + * Used by manual adding */ + virtual bool userAddFolder(const Ultracopier::CopyMode &mode) = 0; + /** \brief add file called on the interface + * Used by manual adding */ + virtual bool userAddFile(const Ultracopier::CopyMode &mode) = 0; + + + //action on the transfer + /// \brief put the transfer in pause + virtual void pause() = 0; + /// \brief resume the transfer + virtual void resume() = 0; + /** \brief skip one transfer entry + * \param id id of the file to remove */ + virtual void skip(const quint64 &id) = 0; + /// \brief cancel all the transfer + virtual void cancel() = 0; + + + //edit the transfer list + /** \brief remove the selected item + * \param ids ids is the id list of the selected items */ + virtual void removeItems(const QList &ids) = 0; + /** \brief move on top of the list the selected item + * \param ids ids is the id list of the selected items */ + virtual void moveItemsOnTop(const QList &ids) = 0; + /** \brief move up the list the selected item + * \param ids ids is the id list of the selected items */ + virtual void moveItemsUp(const QList &ids) = 0; + /** \brief move down the list the selected item + * \param ids ids is the id list of the selected items */ + virtual void moveItemsDown(const QList &ids) = 0; + /** \brief move on bottom of the list the selected item + * \param ids ids is the id list of the selected items */ + virtual void moveItemsOnBottom(const QList &ids) = 0; + + + /** \brief give the forced mode, to export/import transfer list */ + virtual void forceMode(const Ultracopier::CopyMode &mode) = 0; + /// \brief export the transfer list into a file + virtual void exportTransferList() = 0; + /// \brief export the transfer list into a file + virtual void exportErrorIntoTransferList() = 0; + /// \brief import the transfer list into a file + virtual void importTransferList() = 0; + + + /** \brief to set the speed limitation + * -1 if not able, 0 if disabled */ + virtual bool setSpeedLimitation(const qint64 &speedLimitation) = 0; + // signal to implement + signals: + //send information about the copy + void actionInProgess(const Ultracopier::EngineActionInProgress &engineActionInProgress) const; //should update interface information on this event + + void newFolderListing(const QString &path) const; + void isInPause(const bool &isInPause) const; + + void newActionOnList(const QList&) const;///very important, need be temporized to group the modification to do and not flood the interface + void doneTime(const QList >&) const; + void syncReady() const; + + /** \brief to get the progression for a specific file + * \param id the id of the transfer, id send during population the transfer list + * first = current transfered byte, second = byte to transfer */ + void pushFileProgression(const QList &progressionList) const; + //get information about the copy + /** \brief to get the general progression + * first = current transfered byte, second = byte to transfer */ + void pushGeneralProgression(const quint64 &,const quint64 &) const; + + //when the cancel is clicked on copy engine dialog + void cancelAll() const; + + //when can be deleted + void canBeDeleted() const; + + //send error occurred + void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error) const; + void errorToRetry(const QString &source,const QString &destination,const QString &error) const; + //for the extra logging + void rmPath(const QString &path) const; + void mkPath(const QString &path) const; }; /// \brief To define the interface for the factory to do copy engine instance class PluginInterface_CopyEngineFactory : public QObject { - Q_OBJECT - public: - /// \brief to get one instance - virtual PluginInterface_CopyEngine * getInstance() = 0; - /// \brief to set resources, writePath can be empty if read only mode - virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) = 0; - //get mode allowed - /// \brief define if can copy file, folder or both - virtual CopyType getCopyType() = 0; - /// \brief define if can import/export or nothing - virtual TransferListOperation getTransferListOperation() = 0; - /// \brief define if can only copy, or copy and move - virtual bool canDoOnlyCopy() = 0; - /// \brief to get the supported protocols for the source - virtual QStringList supportedProtocolsForTheSource() = 0; - /// \brief to get the supported protocols for the destination - virtual QStringList supportedProtocolsForTheDestination() = 0; - /// \brief to get the options of the copy engine - virtual QWidget * options() = 0; - public slots: - /// \brief to reset the options - virtual void resetOptions() = 0; - /// \brief to reload the translation, because the new language have been loaded - virtual void newLanguageLoaded() = 0; - + Q_OBJECT + public: + /// \brief to get one instance + virtual PluginInterface_CopyEngine * getInstance() = 0; + /// \brief to set resources, writePath can be empty if read only mode + virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) = 0; + //get mode allowed + /// \brief define if can copy file, folder or both + virtual Ultracopier::CopyType getCopyType() = 0; + /// \brief define if can import/export or nothing + virtual Ultracopier::TransferListOperation getTransferListOperation() = 0; + /// \brief define if can only copy, or copy and move + virtual bool canDoOnlyCopy() const = 0; + /// \brief to get the supported protocols for the source + virtual QStringList supportedProtocolsForTheSource() const = 0; + /// \brief to get the supported protocols for the destination + virtual QStringList supportedProtocolsForTheDestination() const = 0; + /// \brief to get the options of the copy engine + virtual QWidget * options() = 0; + public slots: + /// \brief to reset the options + virtual void resetOptions() = 0; + /// \brief to reload the translation, because the new language have been loaded + virtual void newLanguageLoaded() = 0; + signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; }; -Q_DECLARE_INTERFACE(PluginInterface_CopyEngineFactory,"first-world.info.ultracopier.PluginInterface.CopyEngineFactory/0.3.0.10"); +Q_DECLARE_INTERFACE(PluginInterface_CopyEngineFactory,"first-world.info.ultracopier.PluginInterface.CopyEngineFactory/1.2.0.0"); #endif // PLUGININTERFACE_COPYENGINE_H diff --git a/interface/PluginInterface_Listener.h b/interface/PluginInterface_Listener.h index 5648ed8..2fbe95b 100644 --- a/interface/PluginInterface_Listener.h +++ b/interface/PluginInterface_Listener.h @@ -1,8 +1,7 @@ /** \file PluginInterface_Listener.h \brief Define the interface of the plugin of type: listener \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGININTERFACE_LISTENER_H #define PLUGININTERFACE_LISTENER_H @@ -19,34 +18,39 @@ * */ class PluginInterface_Listener : public QObject { - Q_OBJECT - public: - /// \brief put this plugin in listen mode - virtual void listen() = 0; - /// \brief put close the listen - virtual void close() = 0; - /// \brief to get the error string - virtual const QString errorString() = 0; - /// \brief set the resources for the plugin - virtual void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) = 0; - /// \brief to get the options widget, NULL if not have - virtual QWidget * options() = 0; - public slots: - /// \brief send when copy is finished - virtual void transferFinished(quint32 orderId,bool withError) = 0; - /// \brief send when copy is canceled - virtual void transferCanceled(quint32 orderId) = 0; - /// \brief to reload the translation, because the new language have been loaded - virtual void newLanguageLoaded() = 0; - /* signal to implement - signals: - void newState(ListeningState state); - void newCopy(quint32 orderId,QStringList sources); - void newCopy(quint32 orderId,QStringList sources,QString destination); - void newMove(quint32 orderId,QStringList sources); - void newMove(quint32 orderId,QStringList sources,QString destination);*/ + Q_OBJECT + public: + /// \brief put this plugin in listen mode + virtual void listen() = 0; + /// \brief put close the listen + virtual void close() = 0; + /// \brief to get the error string + virtual const QString errorString() const = 0; + /// \brief set the resources for the plugin + virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) = 0; + /// \brief to get the options widget, NULL if not have + virtual QWidget * options() = 0; + /// \brief to get a client list + virtual QStringList clientsList() const = 0; + public slots: + /// \brief send when copy is finished + virtual void transferFinished(const quint32 &orderId,const bool &withError) = 0; + /// \brief send when copy is canceled + virtual void transferCanceled(const quint32 &orderId) = 0; + /// \brief to reload the translation, because the new language have been loaded + virtual void newLanguageLoaded() = 0; + signals: + void newState(const Ultracopier::ListeningState &state) const; + void newCopyWithoutDestination(const quint32 &orderId,const QStringList &sources) const; + void newCopy(const quint32 &orderId,const QStringList &sources,const QString &destination) const; + void newMoveWithoutDestination(const quint32 &orderId,const QStringList &sources) const; + void newMove(const quint32 &orderId,const QStringList &sources,const QString &destination) const; + void error(const QString &error) const; + void newClientList() const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; }; -Q_DECLARE_INTERFACE(PluginInterface_Listener,"first-world.info.ultracopier.PluginInterface.Listener/0.3.0.8"); +Q_DECLARE_INTERFACE(PluginInterface_Listener,"first-world.info.ultracopier.PluginInterface.Listener/1.0.0.0"); #endif // PLUGININTERFACE_LISTENER_H diff --git a/interface/PluginInterface_PluginLoader.h b/interface/PluginInterface_PluginLoader.h index 22f42ce..71d5935 100644 --- a/interface/PluginInterface_PluginLoader.h +++ b/interface/PluginInterface_PluginLoader.h @@ -1,8 +1,7 @@ /** \file PluginInterface_PluginLoader.h \brief Define the interface of the plugin of type: plugin loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGININTERFACE_PLUGINLOADER_H #define PLUGININTERFACE_PLUGINLOADER_H @@ -17,22 +16,24 @@ * */ class PluginInterface_PluginLoader : public QObject { - Q_OBJECT - public: - /// \brief try enable/disable the catching - virtual void setEnabled(bool) = 0; - /// \brief to set resources, writePath can be empty if read only mode - virtual void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) = 0; - /// \brief to get the options widget, NULL if not have - virtual QWidget * options() = 0; - public slots: - /// \brief to reload the translation, because the new language have been loaded - virtual void newLanguageLoaded() = 0; - /* signal to implement - signals: - void newState(CatchState);*/ + Q_OBJECT + public: + /// \brief try enable/disable the catching + virtual void setEnabled(const bool &enabled) = 0; + /// \brief to set resources, writePath can be empty if read only mode + virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) = 0; + /// \brief to get the options widget, NULL if not have + virtual QWidget * options() = 0; + public slots: + /// \brief to reload the translation, because the new language have been loaded + virtual void newLanguageLoaded() = 0; + // signal to implement + signals: + void newState(const Ultracopier::CatchState &catchstate) const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; }; -Q_DECLARE_INTERFACE(PluginInterface_PluginLoader,"first-world.info.ultracopier.PluginInterface.PluginLoader/0.3.0.8"); +Q_DECLARE_INTERFACE(PluginInterface_PluginLoader,"first-world.info.ultracopier.PluginInterface.PluginLoader/1.0.0.0"); #endif // PLUGININTERFACE_PLUGINLOADER_H diff --git a/interface/PluginInterface_SessionLoader.h b/interface/PluginInterface_SessionLoader.h index e73c9e3..85b9b22 100644 --- a/interface/PluginInterface_SessionLoader.h +++ b/interface/PluginInterface_SessionLoader.h @@ -1,8 +1,7 @@ /** \file PluginInterface_SessionLoader.h \brief Define the interface of the plugin of type: session loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGININTERFACE_SESSIONLOADER_H #define PLUGININTERFACE_SESSIONLOADER_H @@ -17,20 +16,24 @@ * */ class PluginInterface_SessionLoader : public QObject { - public: - /// \brief set enabled/disabled - virtual void setEnabled(bool) = 0; - /// \brief get if is enabled - virtual bool getEnabled() = 0; - /// \brief set the resources - virtual void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) = 0; - /// \brief to get the options widget, NULL if not have - virtual QWidget * options() = 0; - public slots: - /// \brief to reload the translation, because the new language have been loaded - virtual void newLanguageLoaded() = 0; + Q_OBJECT + public: + /// \brief set enabled/disabled + virtual void setEnabled(const bool &enabled) = 0; + /// \brief get if is enabled + virtual bool getEnabled() const = 0; + /// \brief set the resources + virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) = 0; + /// \brief to get the options widget, NULL if not have + virtual QWidget * options() = 0; + public slots: + /// \brief to reload the translation, because the new language have been loaded + virtual void newLanguageLoaded() = 0; + signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; }; -Q_DECLARE_INTERFACE(PluginInterface_SessionLoader,"first-world.info.ultracopier.PluginInterface.SessionLoader/0.3.0.8"); +Q_DECLARE_INTERFACE(PluginInterface_SessionLoader,"first-world.info.ultracopier.PluginInterface.SessionLoader/1.0.0.0"); #endif // PLUGININTERFACE_SESSIONLOADER_H diff --git a/interface/PluginInterface_Themes.h b/interface/PluginInterface_Themes.h index cfdb719..7d8c3f6 100644 --- a/interface/PluginInterface_Themes.h +++ b/interface/PluginInterface_Themes.h @@ -1,8 +1,7 @@ /** \file PluginInterface_Themes.h \brief Define the interface of the plugin of type: copy engine \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGININTERFACE_THEMES_H #define PLUGININTERFACE_THEMES_H @@ -24,100 +23,95 @@ * */ class PluginInterface_Themes : public QWidget { - Q_OBJECT - public slots: - //send information about the copy - /// \brief to set the action in progress - virtual void actionInProgess(EngineActionInProgress) = 0; + Q_OBJECT + public slots: + //send information about the copy + /// \brief to set the action in progress + virtual void actionInProgess(const Ultracopier::EngineActionInProgress&) = 0; - /// \brief the new folder is listing - virtual void newFolderListing(const QString &path) = 0; - /** \brief show the detected speed - * in byte per seconds */ - virtual void detectedSpeed(const quint64 &speed) = 0; - /** \brief show the remaining time - * time in seconds */ - virtual void remainingTime(const int &remainingSeconds) = 0; - /// \brief set the current collision action - virtual void newCollisionAction(const QString &action) = 0; - /// \brief set the current error action - virtual void newErrorAction(const QString &action) = 0; - /// \brief set one error is detected - virtual void errorDetected() = 0; - /** \brief the max speed used - * in byte per seconds, -1 if not able, 0 if disabled */ - virtual bool setSpeedLimitation(const qint64 &speedLimitation) = 0; - /// \brief get action on the transfer list (add/move/remove) - virtual void getActionOnList(const QList &returnActions) = 0; - /// \brief show the general progression - virtual void setGeneralProgression(const quint64 ¤t,const quint64 &total) = 0; - /// \brief show the file progression - virtual void setFileProgression(const QList &progressionList) = 0; - public: - /// \brief get the widget for the copy engine - virtual QWidget * getOptionsEngineWidget() = 0; - /// \brief to set if the copy engine is found - virtual void getOptionsEngineEnabled(bool isEnabled) = 0; - /// \brief set collision action - virtual void setCollisionAction(const QList > &collisionActionList) = 0; - /// \brief set error action - virtual void setErrorAction(const QList > &errorActionList) = 0; - /// \brief set the copyType -> file or folder - virtual void setCopyType(CopyType) = 0; - /// \brief set the copyMove -> copy or move, to force in copy or move, else support both - virtual void forceCopyMode(CopyMode) = 0; - /// \brief set if transfer list is exportable/importable - virtual void setTransferListOperation(TransferListOperation transferListOperation) = 0; - /** \brief set if the order is external (like file manager copy) - * to notify the interface, which can hide add folder/filer button */ - virtual void haveExternalOrder() = 0; - /// \brief set if is in pause - virtual void isInPause(bool) = 0; - /* signal to implement - signals: - //set the transfer list - void removeItems(QList ids); - void moveItemsOnTop(QList ids); - void moveItemsUp(QList ids); - void moveItemsDown(QList ids); - void moveItemsOnBottom(QList ids); - void exportTransferList(); - void importTransferList(); - //user ask ask to add folder (add it with interface ask source/destination) - void userAddFolder(CopyMode); - void userAddFile(CopyMode); - void urlDropped(QList urls); - //action on the copy - void pause(); - void resume(); - void skip(quint64 id); - void cancel(); - //edit the action - void sendCollisionAction(QString action); - void sendErrorAction(QString action); - void newSpeedLimitation(qint64);///< -1 if not able, 0 if disabled*/ + /// \brief the new folder is listing + virtual void newFolderListing(const QString &path) = 0; + /** \brief show the detected speed + * in byte per seconds */ + virtual void detectedSpeed(const quint64 &speed) = 0; + /** \brief show the remaining time + * time in seconds */ + virtual void remainingTime(const int &remainingSeconds) = 0; + /// \brief set one error is detected + virtual void errorDetected() = 0; + /// \brief new error + virtual void errorToRetry(const QString &source,const QString &destination,const QString &error) = 0; + /** \brief support speed limitation */ + virtual void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) = 0; + /// \brief get action on the transfer list (add/move/remove) + virtual void getActionOnList(const QList &returnActions) = 0; + /// \brief show the general progression + virtual void setGeneralProgression(const quint64 ¤t,const quint64 &total) = 0; + /// \brief show the file progression + virtual void setFileProgression(const QList &progressionList) = 0; + public: + /// \brief get the widget for the copy engine + virtual QWidget * getOptionsEngineWidget() = 0; + /// \brief to set if the copy engine is found + virtual void getOptionsEngineEnabled(const bool &isEnabled) = 0; + /// \brief set the copyType -> file or folder + virtual void setCopyType(const Ultracopier::CopyType&) = 0; + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + virtual void forceCopyMode(const Ultracopier::CopyMode&) = 0; + /// \brief set if transfer list is exportable/importable + virtual void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) = 0; + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + virtual void haveExternalOrder() = 0; + /// \brief set if is in pause + virtual void isInPause(const bool &isInPause) = 0; + // signal to implement + signals: + //set the transfer list + void removeItems(const QList &ids) const; + void moveItemsOnTop(const QList &ids) const; + void moveItemsUp(const QList &ids) const; + void moveItemsDown(const QList &ids) const; + void moveItemsOnBottom(const QList &ids) const; + void exportTransferList() const; + void importTransferList() const; + void exportErrorIntoTransferList() const; + //user ask ask to add folder (add it with interface ask source/destination) + void userAddFolder(const Ultracopier::CopyMode &mode) const; + void userAddFile(const Ultracopier::CopyMode &mode) const; + void urlDropped(const QList &urls) const; + //action on the copy + void pause() const; + void resume() const; + void skip(const quint64 &id) const; + void cancel() const; + //edit the action + void newSpeedLimitation(const qint64 &speedLimitation) const;///< -1 if not able, 0 if disabled }; /// \brief To define the interface for the factory to do themes instance class PluginInterface_ThemesFactory : public QObject { - Q_OBJECT - public: - /// \brief to get one instance - virtual PluginInterface_Themes * getInstance() = 0; - /// \brief to set resources, writePath can be empty if read only mode - virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,bool portableVersion) = 0; - /// \brief to get the default options widget - virtual QWidget * options() = 0; - /// \brief to get a resource icon - virtual QIcon getIcon(const QString &fileName) = 0; - public slots: - /// \brief to reset as default the local options - virtual void resetOptions() = 0; - /// \brief retranslate the language because the language have changed - virtual void newLanguageLoaded() = 0; + Q_OBJECT + public: + /// \brief to get one instance + virtual PluginInterface_Themes * getInstance() = 0; + /// \brief to set resources, writePath can be empty if read only mode + virtual void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) = 0; + /// \brief to get the default options widget + virtual QWidget * options() = 0; + /// \brief to get a resource icon + virtual QIcon getIcon(const QString &fileName) const = 0; + public slots: + /// \brief to reset as default the local options + virtual void resetOptions() = 0; + /// \brief retranslate the language because the language have changed + virtual void newLanguageLoaded() = 0; + signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; }; -Q_DECLARE_INTERFACE(PluginInterface_ThemesFactory,"first-world.info.ultracopier.PluginInterface.ThemesFactory/0.3.0.8"); +Q_DECLARE_INTERFACE(PluginInterface_ThemesFactory,"first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0"); #endif // PLUGININTERFACE_THEMES_H diff --git a/lib/qt-tar-xz/QTarDecode.cpp b/lib/qt-tar-xz/QTarDecode.cpp index fe15359..e1d9bce 100644 --- a/lib/qt-tar-xz/QTarDecode.cpp +++ b/lib/qt-tar-xz/QTarDecode.cpp @@ -1,113 +1,174 @@ /** \file QTarDecode.cpp \brief To read a tar data block \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "QTarDecode.h" -#include + +#include +#include +#include +#include + +static const std::regex isaunsignednumber("^[0-9]+$",std::regex::optimize); +static const std::regex isaunoctalnumber("^[0-7]+$",std::regex::optimize); +static const char* const lut = "0123456789ABCDEF"; QTarDecode::QTarDecode() { - error="Unknow error"; + error="Unknown error"; +} + +uint64_t QTarDecode::octaltouint64(const std::string &string,bool *ok) +{ + if(std::regex_match(string,isaunsignednumber)) + { + if(ok!=NULL) + *ok=true; + return std::stoi(string,0,8); + } + else + { + if(ok!=NULL) + *ok=false; + return 0; + } +} + +uint64_t QTarDecode::stringtouint64(const std::string &string,bool *ok) +{ + if(std::regex_match(string,isaunsignednumber)) + { + if(ok!=NULL) + *ok=true; + return std::stoull(string); + } + else + { + if(ok!=NULL) + *ok=false; + return 0; + } +} + +std::string QTarDecode::errorString() +{ + return error; } -QString QTarDecode::errorString() +void QTarDecode::setErrorString(const std::string &error) { - return error; + this->error=error; + fileList.clear(); + dataList.clear(); } -void QTarDecode::setErrorString(QString error) +bool QTarDecode::stringStartWith(std::string const &fullString, std::string const &starting) { - this->error=error; - fileList.clear(); - dataList.clear(); + if (fullString.length() >= starting.length()) { + return (fullString.substr(0,starting.length())==starting); + } else { + return false; + } } -bool QTarDecode::decodeData(QByteArray data) +bool QTarDecode::decodeData(const std::vector &data) { - setErrorString("Unknow error"); - if(data.size()<1024) - return false; - int offset=0; - while(offsetdata.size()) - { - setErrorString("The tar file seem be too short"); - return false; - } - if(fileType=="0") //this code manage only the file, then only the file is returned - { - QByteArray fileData=data.mid(512+offset,finalSize); - fileList << fileName; - dataList << fileData; - } - //calculate the offset for the next header - bool retenu=((finalSize%512)!=0); - //go to the next header - offset+=512+(finalSize/512+retenu)*512; - } - if(fileList.size()>0) - { - QString baseDirToTest=fileList.at(0); - baseDirToTest.remove(QRegExp("/.*$")); - baseDirToTest+='/'; - bool isFoundForAllEntries=true; - for (int i = 0; i < fileList.size(); ++i) - if(!fileList.at(i).startsWith(baseDirToTest)) - isFoundForAllEntries=false; - if(isFoundForAllEntries) - for (int i = 0; i < fileList.size(); ++i) - fileList[i].remove(0,baseDirToTest.size()); - } - return true; + setErrorString("Unknown error"); + if(data.size()<1024) + return false; + unsigned int offset=0; + while(offsetdata.size()) + { + setErrorString("The tar file seem be too short"); + return false; + } + if(fileType=="0") //this code manage only the file, then only the file is returned + { + std::vector newdata; + newdata.resize(finalSize); + memcpy(newdata.data(),data.data()+512+offset,finalSize); + fileList.push_back(fileName); + dataList.push_back(newdata); + } + //calculate the offset for the next header + bool retenu=((finalSize%512)!=0); + //go to the next header + offset+=512+(finalSize/512+retenu)*512; + } + if(fileList.size()>0) + { + std::string baseDirToTest=fileList.at(0); + std::size_t found = baseDirToTest.find_last_of("/"); + if(found!=std::string::npos && found>=baseDirToTest.size()) + baseDirToTest.resize(baseDirToTest.size()-(baseDirToTest.size()-found)); + bool isFoundForAllEntries=true; + for (unsigned int i = 0; i < fileList.size(); ++i) + if(!stringStartWith(fileList.at(i),baseDirToTest)) + isFoundForAllEntries=false; + if(isFoundForAllEntries) + for (unsigned int i = 0; i < fileList.size(); ++i) + fileList[i].erase(0,baseDirToTest.size()); + } + return true; } -QStringList QTarDecode::getFileList() +std::vector QTarDecode::getFileList() { - return fileList; + return fileList; } -QList QTarDecode::getDataList() +std::vector > QTarDecode::getDataList() { - return dataList; + return dataList; } diff --git a/lib/qt-tar-xz/QTarDecode.h b/lib/qt-tar-xz/QTarDecode.h index 6e8e5e5..b37dc0e 100644 --- a/lib/qt-tar-xz/QTarDecode.h +++ b/lib/qt-tar-xz/QTarDecode.h @@ -1,37 +1,36 @@ /** \file QTarDecode.h \brief To read a tar data block \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef QTARDECODE_H #define QTARDECODE_H -#include -#include -#include -#include -#include +#include +#include +#include /// \brief read the raw tar data, and organize it into data structure -class QTarDecode : public QObject +class QTarDecode { - public: - QTarDecode(); - /// \brief to get the file list - QStringList getFileList(); - /// \brief to get the data of the file - QList getDataList(); - /// \brief to pass the raw tar data - bool decodeData(QByteArray data); - /// \brief to return error string - QString errorString(); - private: - QStringList fileList; - QList dataList; - QString error; - void setErrorString(QString error); + public: + QTarDecode(); + /// \brief to get the file list + std::vector getFileList(); + /// \brief to get the data of the file + std::vector > getDataList(); + /// \brief to pass the raw tar data + bool decodeData(const std::vector &data); + /// \brief to return error string + std::string errorString(); + uint64_t stringtouint64(const std::string &string,bool *ok); + uint64_t octaltouint64(const std::string &string,bool *ok); + private: + std::vector fileList; + std::vector > dataList; + std::string error; + void setErrorString(const std::string &error); + bool stringStartWith(std::string const &fullString, std::string const &starting); }; #endif // QTARDECODE_H diff --git a/lib/qt-tar-xz/QXzDecode.cpp b/lib/qt-tar-xz/QXzDecode.cpp index 6aa13bb..2cf1209 100644 --- a/lib/qt-tar-xz/QXzDecode.cpp +++ b/lib/qt-tar-xz/QXzDecode.cpp @@ -1,8 +1,6 @@ /** \file QXzDecode.cpp \brief To decompress a xz stream \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "QXzDecode.h" diff --git a/lib/qt-tar-xz/QXzDecode.h b/lib/qt-tar-xz/QXzDecode.h index 9a654f0..85cb04e 100644 --- a/lib/qt-tar-xz/QXzDecode.h +++ b/lib/qt-tar-xz/QXzDecode.h @@ -1,8 +1,6 @@ /** \file QXzDecode.h \brief To decompress a xz stream \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef QXZDECODE_H diff --git a/lib/qt-tar-xz/QXzDecodeThread.cpp b/lib/qt-tar-xz/QXzDecodeThread.cpp index 9872cef..5e7f755 100644 --- a/lib/qt-tar-xz/QXzDecodeThread.cpp +++ b/lib/qt-tar-xz/QXzDecodeThread.cpp @@ -1,8 +1,6 @@ /** \file QXzDecodeThread.cpp \brief To have thread to decode the data \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include "QXzDecodeThread.h" diff --git a/lib/qt-tar-xz/QXzDecodeThread.h b/lib/qt-tar-xz/QXzDecodeThread.h index 6fedc22..1b69e4a 100644 --- a/lib/qt-tar-xz/QXzDecodeThread.h +++ b/lib/qt-tar-xz/QXzDecodeThread.h @@ -1,8 +1,6 @@ /** \file QXzDecodeThread.h \brief To have thread to decode the data \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #ifndef QXZDECODETHREAD_H diff --git a/main.cpp b/main.cpp index 331a8a0..8aca198 100644 --- a/main.cpp +++ b/main.cpp @@ -1,36 +1,150 @@ /** \file main.cpp \brief Define the main() for the point entry \author alpha_one_x86 -\version 0.3 -\date 2010 \licence GPL3, see the file COPYING */ #include +#include #include "Environment.h" #include "EventDispatcher.h" +#include "LanguagesManager.h" +#include "ThemesManager.h" +#include "DebugEngine.h" +#include "ResourcesManager.h" +#include "OptionEngine.h" +#include "PluginsManager.h" + +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + Q_IMPORT_PLUGIN(CopyEngineFactory) + Q_IMPORT_PLUGIN(ThemesFactory) + Q_IMPORT_PLUGIN(Listener) + #ifdef Q_OS_WIN32 + Q_IMPORT_PLUGIN(WindowsExplorerLoader) + #if !defined(ULTRACOPIER_VERSION_PORTABLE) + Q_IMPORT_PLUGIN(WindowsSessionLoader) + #endif + #endif +#endif +#endif + +#ifdef ULTRACOPIER_DEBUG +DebugModel *DebugModel::debugModel=NULL; +DebugEngine *DebugEngine::debugEngine=NULL; +#endif +ResourcesManager *ResourcesManager::resourcesManager=NULL; +OptionEngine *OptionEngine::optionEngine=NULL; +PluginsManager *PluginsManager::pluginsManager=NULL; +LanguagesManager *LanguagesManager::languagesManager=NULL; +ThemesManager *ThemesManager::themesManager=NULL; + +void registerTheOptions() +{ + OptionEngine::optionEngine=new OptionEngine(); + + //register the var + //add the options to use + QList > KeysList; + //add the options hidden, will not show in options pannel + KeysList.clear(); + KeysList.append(qMakePair(QStringLiteral("Last_version_used"),QVariant("na"))); + #ifdef ULTRACOPIER_VERSION_ULTIMATE + KeysList.append(qMakePair(QStringLiteral("key"),QStringLiteral(""))); + #endif + KeysList.append(qMakePair(QStringLiteral("ActionOnManualOpen"),QVariant(1))); + KeysList.append(qMakePair(QStringLiteral("GroupWindowWhen"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("displayOSSpecific"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("confirmToGroupWindows"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("giveGPUTime"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("remainingTimeAlgorithm"),QVariant(0))); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + KeysList.append(qMakePair(QStringLiteral("checkTheUpdate"),QVariant(true))); + #else + KeysList.append(qMakePair(QStringLiteral("checkTheUpdate"),QVariant(false))); + #endif + #endif + OptionEngine::optionEngine->addOptionGroup("Ultracopier",KeysList); + + KeysList.clear(); + KeysList.append(qMakePair(QStringLiteral("List"),QVariant(QStringList() << QStringLiteral("Ultracopier")))); + OptionEngine::optionEngine->addOptionGroup(QStringLiteral("CopyEngine"),KeysList); + + //load the GUI option + QString defaultLogFile=""; + if(ResourcesManager::resourcesManager->getWritablePath()!="") + defaultLogFile=ResourcesManager::resourcesManager->getWritablePath()+"ultracopier-files.log"; + KeysList.clear(); + KeysList.append(qMakePair(QStringLiteral("enabled"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("file"),QVariant(defaultLogFile))); + KeysList.append(qMakePair(QStringLiteral("transfer"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("error"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("folder"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("sync"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("transfer_format"),QVariant("[%time%] %source% (%size%) %destination%"))); + KeysList.append(qMakePair(QStringLiteral("error_format"),QVariant("[%time%] %path%, %error%"))); + KeysList.append(qMakePair(QStringLiteral("folder_format"),QVariant("[%time%] %operation% %path%"))); + OptionEngine::optionEngine->addOptionGroup(QStringLiteral("Write_log"),KeysList); + + KeysList.clear(); + KeysList.append(qMakePair(QStringLiteral("CatchCopyAsDefault"),QVariant(true))); + OptionEngine::optionEngine->addOptionGroup(QStringLiteral("CopyListener"),KeysList); + + KeysList.clear(); + KeysList.append(qMakePair(QStringLiteral("LoadAtSessionStarting"),QVariant(true))); + OptionEngine::optionEngine->addOptionGroup(QStringLiteral("SessionLoader"),KeysList); +} /// \brief Define the main() for the point entry int main(int argc, char *argv[]) { - int returnCode; - QApplication ultracopierApplication(argc, argv); - ultracopierApplication.setApplicationVersion(ULTRACOPIER_VERSION); - ultracopierApplication.setQuitOnLastWindowClosed(false); - #ifdef ULTRACOPIER_DEBUG - DebugEngine::getInstance(); - #endif // ULTRACOPIER_DEBUG - //the main code, event loop of Qt and event dispatcher of ultracopier - { - EventDispatcher backgroundRunningInstance; - if(backgroundRunningInstance.shouldBeClosed()) - returnCode=0; - else - returnCode=ultracopierApplication.exec(); - } - #ifdef ULTRACOPIER_DEBUG - DebugEngine::destroyInstanceAtTheLastCall(); - #endif // ULTRACOPIER_DEBUG - return returnCode; + int returnCode; + QApplication ultracopierApplication(argc, argv); + ultracopierApplication.setApplicationVersion(ULTRACOPIER_VERSION); + ultracopierApplication.setQuitOnLastWindowClosed(false); + qRegisterMetaType("PluginsAvailable"); + qRegisterMetaType("Ultracopier::DebugLevel"); + qRegisterMetaType("Ultracopier::CopyMode"); + qRegisterMetaType("Ultracopier::ItemOfCopyList"); + + #ifdef ULTRACOPIER_DEBUG + DebugModel::debugModel=new DebugModel(); + DebugEngine::debugEngine=new DebugEngine(); + #endif + ResourcesManager::resourcesManager=new ResourcesManager(); + registerTheOptions(); + + PluginsManager::pluginsManager=new PluginsManager(); + LanguagesManager::languagesManager=new LanguagesManager(); + ThemesManager::themesManager=new ThemesManager(); + + //the main code, event loop of Qt and event dispatcher of ultracopier + { + EventDispatcher backgroundRunningInstance; + if(backgroundRunningInstance.shouldBeClosed()) + returnCode=0; + else + returnCode=ultracopierApplication.exec(); + } + + delete ThemesManager::themesManager; + ThemesManager::themesManager=NULL; + delete LanguagesManager::languagesManager; + LanguagesManager::languagesManager=NULL; + delete PluginsManager::pluginsManager; + PluginsManager::pluginsManager=NULL; + delete OptionEngine::optionEngine; + OptionEngine::optionEngine=NULL; + delete ResourcesManager::resourcesManager; + ResourcesManager::resourcesManager=NULL; + #ifdef ULTRACOPIER_DEBUG + delete DebugEngine::debugEngine; + DebugEngine::debugEngine=NULL; + delete DebugModel::debugModel; + DebugModel::debugModel=NULL; + #endif + + return returnCode; } diff --git a/patch/comercial/rsync-copy-engine.patch b/patch/comercial/rsync-copy-engine.patch deleted file mode 100644 index f469d50..0000000 --- a/patch/comercial/rsync-copy-engine.patch +++ /dev/null @@ -1,902 +0,0 @@ -diff -U 3 -H -d -r -N -- Ultracopier-0.3/ListThread.cpp Rsync/ListThread.cpp ---- Ultracopier-0.3/ListThread.cpp 2012-06-26 14:12:53.082114806 +0200 -+++ Rsync/ListThread.cpp 2012-06-29 22:21:40.395733284 +0200 -@@ -28,6 +28,7 @@ - numberOfInodeOperation = 0; - maxSpeed = 0; - doRightTransfer = false; -+ rsync = false; - keepDate = false; - blockSize = 1024; - osBufferLimit = 512; -@@ -265,6 +266,21 @@ - this->autoStart=autoStart; - } - -+/// \brief set rsync -+void ListThread::setRsync(const bool rsync) -+{ -+ this->rsync=rsync; -+ int index=0; -+ loop_sub_size_transfer_thread_search=transferThreadList.size(); -+ while(indexsetRsync(rsync); -+ index++; -+ } -+ for(int i=0;isetRsync(rsync); -+} -+ - //set check destination folder - void ListThread::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) - { -@@ -327,11 +343,13 @@ - #endif - connect(scanFileOrFolderThreadsPool.last(),SIGNAL(newFolderListing(QString)), this,SIGNAL(newFolderListing(QString))); - connect(scanFileOrFolderThreadsPool.last(),SIGNAL(addToRmPath(QString,int)), this,SLOT(addToRmPath(QString,int)), Qt::QueuedConnection); -+ connect(scanFileOrFolderThreadsPool.last(),SIGNAL(addToRmForRsync(QString)), this,SLOT(addToRmForRsync(QString)), Qt::QueuedConnection); - connect(scanFileOrFolderThreadsPool.last(),SIGNAL(addToMkPath(QString)), this,SLOT(addToMkPath(QString)), Qt::QueuedConnection); - - connect(scanFileOrFolderThreadsPool.last(),SIGNAL(errorOnFolder(QFileInfo,QString)), this,SLOT(errorOnFolder(QFileInfo,QString)), Qt::QueuedConnection); - connect(scanFileOrFolderThreadsPool.last(),SIGNAL(folderAlreadyExists(QFileInfo,QFileInfo,bool)), this,SLOT(folderAlreadyExists(QFileInfo,QFileInfo,bool)), Qt::QueuedConnection); - -+ scanFileOrFolderThreadsPool.last()->setRsync(rsync); - scanFileOrFolderThreadsPool.last()->setFilters(include,exclude); - scanFileOrFolderThreadsPool.last()->setCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); - if(scanFileOrFolderThreadsPool.size()==1) -@@ -761,6 +779,18 @@ - actionToDoListInode_afterTheTransfer << temp; - } - -+//rsync rm -+void ListThread::addToRmForRsync(const QString& inode) -+{ -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"inode: "+inode); -+ actionToDoInode temp; -+ temp.type = ActionType_RmSync; -+ temp.id = generateIdNumber(); -+ temp.folder.setFile(inode); -+ temp.isRunning = false; -+ actionToDoListInode << temp; -+} -+ - //send action done - void ListThread::sendActionDone() - { -@@ -1526,7 +1556,7 @@ - loop_size=actionToDoListInode.size(); - while(int_for_loopset_osBuffer(osBuffer); - last->set_osBufferLimited(osBufferLimited); - last->set_osBufferLimit(osBufferLimit); -+ last->setRsync(rsync); - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(last,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); -@@ -1669,7 +1700,7 @@ - connect(last,SIGNAL(preOperationStopped()), this,SLOT(doNewActions_start_transfer()), Qt::QueuedConnection); - connect(last,SIGNAL(postOperationStopped()), this,SLOT(transferInodeIsClosed()), Qt::QueuedConnection); - connect(last,SIGNAL(checkIfItCanBeResumed()), this,SLOT(restartTransferIfItCan()), Qt::QueuedConnection); -- connect(last,SIGNAL(pushStat(TransferStat,quint64)), this,SLOT(newTransferStat(TransferStat,quint64)), Qt::QueuedConnection); -+ connect(last,SIGNAL(pushStat(TransferStat,quint64)), this,SLOT(newTransferStat(TransferStat,quint64)), Qt::QueuedConnection); - - connect(this,SIGNAL(send_sendNewRenamingRules(QString,QString)), last,SLOT(setRenamingRules(QString,QString)), Qt::QueuedConnection); - -diff -U 3 -H -d -r -N -- Ultracopier-0.3/ListThread.h Rsync/ListThread.h ---- Ultracopier-0.3/ListThread.h 2012-06-25 16:46:19.931261209 +0200 -+++ Rsync/ListThread.h 2012-06-29 21:53:37.495762350 +0200 -@@ -77,7 +77,8 @@ - enum ActionType - { - ActionType_MkPath=1, -- ActionType_RmPath=2 -+ ActionType_RmPath=2, -+ ActionType_RmSync=3 - }; - /// \brief to store one action to do - struct actionToDoInode -@@ -155,6 +156,8 @@ - void setBlockSize(const int blockSize); - /// \brief set auto start - void setAutoStart(const bool autoStart); -+ /// \brief set rsync -+ void setRsync(const bool rsync); - /// \brief set check destination folder - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - /// \brief set data local to the thread -@@ -196,6 +199,7 @@ - quint64 bytesToTransfer; - quint64 bytesTransfered; - bool autoStart; -+ bool rsync; - bool putInPause; - QList actionDone;///< to action to send to the interface - quint64 idIncrementNumber;///< to store the last id returned -@@ -302,6 +306,8 @@ - quint64 addToMkPath(const QString& folder); - //add rm path to do - void addToRmPath(const QString& folder,const int& inodeToRemove); -+ //rsync rm -+ void addToRmForRsync(const QString& inode); - //send the progression, after full reset of the interface (then all is empty) - void syncTransferList_internal(); - signals: -diff -U 3 -H -d -r -N -- Ultracopier-0.3/ListThread_InodeAction.cpp Rsync/ListThread_InodeAction.cpp ---- Ultracopier-0.3/ListThread_InodeAction.cpp 2012-06-29 21:57:47.000000000 +0200 -+++ Rsync/ListThread_InodeAction.cpp 2012-06-29 22:19:11.515735854 +0200 -@@ -19,6 +19,14 @@ - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - break; -+case ActionType_RmSync: -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch rm to sync: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); -+ rmPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath(),true); -+ currentActionToDoInode.isRunning=true; -+ numberOfInodeOperation++; -+ if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) -+ return; -+break; - case ActionType_RmPath: - /* What is this code? - if((int_for_loop+number_rm_path_moved)>=(loop_size-1)) -@@ -34,7 +42,7 @@ - if(numberOfTranferRuning>0) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("skipped because already inode = 0 and transfer is running: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch rmpath: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); -- rmPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath()); -+ rmPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath(),false); - currentActionToDoInode.isRunning=true; - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) -diff -U 3 -H -d -r -N -- Ultracopier-0.3/RmPath.cpp Rsync/RmPath.cpp ---- Ultracopier-0.3/RmPath.cpp 2012-06-29 22:37:41.715716675 +0200 -+++ Rsync/RmPath.cpp 2012-06-29 22:42:25.105711780 +0200 -@@ -16,12 +16,12 @@ - wait(); - } - --void RmPath::addPath(const QString &path) -+void RmPath::addPath(const QString &path,const bool &toSync) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - if(stopIt) - return; -- emit internalStartAddPath(path); -+ emit internalStartAddPath(path,toSync); - } - - void RmPath::skip() -@@ -38,7 +38,7 @@ - - void RmPath::run() - { -- connect(this,SIGNAL(internalStartAddPath(QString)),this,SLOT(internalAddPath(QString)),Qt::QueuedConnection); -+ connect(this,SIGNAL(internalStartAddPath(QString,bool)),this,SLOT(internalAddPath(QString,bool)),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartDoThisPath()),this,SLOT(internalDoThisPath()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartSkip()),this,SLOT(internalSkip()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRetry()),this,SLOT(internalRetry()),Qt::QueuedConnection); -@@ -50,23 +50,63 @@ - if(waitAction || pathList.isEmpty()) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+pathList.first()); -- if(!rmpath(pathList.first())) -+ if(!toSyncList.first()) - { -- if(stopIt) -+ if(!rmpath(pathList.first(),false)) -+ { -+ if(stopIt) -+ return; -+ waitAction=true; -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); -+ emit errorOnFolder(pathList.first(),tr("Unable to remove the folder")); - return; -- waitAction=true; -- ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); -- emit errorOnFolder(pathList.first(),tr("Unable to remove the folder")); -- return; -+ } -+ } -+ else -+ { -+ if(QFileInfo(pathList.first()).isDir()) -+ { -+ if(!rmpath(pathList.first(),true)) -+ { -+ if(stopIt) -+ return; -+ waitAction=true; -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); -+ emit errorOnFolder(pathList.first(),tr("Unable to remove the folder")); -+ return; -+ } -+ } -+ else if(!rmfile(pathList.first())) -+ { -+ if(stopIt) -+ return; -+ waitAction=true; -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the file: "+pathList.first()); -+ emit errorOnFolder(pathList.first(),tr("Unable to remove the file")); -+ return; -+ } - } - pathList.removeFirst(); -+ toSyncList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); - } - -+bool RmPath::rmfile(QString filePath) -+{ -+ QFile file(filePath); -+ if(!file.remove()) -+ { -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove the file: "+file.fileName()+", error: "+file.errorString()); -+ return false; -+ } -+ else -+ return true; -+} -+ - /** remplace QDir::rmpath() because it return false if the folder not exists - and seam bug with parent folder */ --bool RmPath::rmpath(const QDir &dir) -+bool RmPath::rmpath(const QDir &dir,const bool &toSync) - { - if(!dir.exists()) - return true; -@@ -77,28 +117,40 @@ - QFileInfo fileInfo(list.at(i)); - if(!fileInfo.isDir()) - { -- ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"found a file: "+fileInfo.fileName()); -- allHaveWork=false; -+ if(toSync) -+ { -+ if(!rmfile(fileInfo.absoluteFilePath())) -+ { -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove a file: "+fileInfo.fileName()); -+ allHaveWork=false; -+ } -+ } -+ else -+ { -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"found a file: "+fileInfo.fileName()); -+ allHaveWork=false; -+ } - } - else - { - //return the fonction for scan the new folder -- if(!rmpath(dir.absolutePath()+'/'+fileInfo.fileName()+'/')) -+ if(!rmpath(dir.absolutePath()+'/'+fileInfo.fileName()+'/',toSync)) - allHaveWork=false; - } - } - if(!allHaveWork) -- return allHaveWork; -+ return false; - allHaveWork=dir.rmdir(dir.absolutePath()); - if(!allHaveWork) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove the folder: "+dir.absolutePath()); - return allHaveWork; - } - --void RmPath::internalAddPath(const QString &path) -+void RmPath::internalAddPath(const QString &path,const bool &toSync) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - pathList << path; -+ toSyncList << toSync; - if(!waitAction) - checkIfCanDoTheNext(); - } -diff -U 3 -H -d -r -N -- Ultracopier-0.3/RmPath.h Rsync/RmPath.h ---- Ultracopier-0.3/RmPath.h 2012-03-19 17:34:43.572371290 +0100 -+++ Rsync/RmPath.h 2012-06-29 22:36:02.135718395 +0200 -@@ -24,11 +24,11 @@ - explicit RmPath(); - ~RmPath(); - /// \brief add new path to remove -- void addPath(const QString &path); -+ void addPath(const QString &path,const bool &toSync); - signals: - void errorOnFolder(const QFileInfo &,const QString &); - void firstFolderFinish(); -- void internalStartAddPath(const QString &path); -+ void internalStartAddPath(const QString &path,const bool &toSync); - void internalStartDoThisPath(); - void internalStartSkip(); - void internalStartRetry(); -@@ -42,12 +42,14 @@ - bool stopIt; - bool skipIt; - QStringList pathList; -+ QList toSyncList; - void checkIfCanDoTheNext(); - QDir dir; -- bool rmpath(const QDir &dir); -+ bool rmpath(const QDir &dir,const bool &toSync); -+ bool rmfile(QString filePath); - private slots: - void internalDoThisPath(); -- void internalAddPath(const QString &path); -+ void internalAddPath(const QString &path,const bool &toSync); - void internalSkip(); - void internalRetry(); - }; -diff -U 3 -H -d -r -N -- Ultracopier-0.3/TransferThread.cpp Rsync/TransferThread.cpp ---- Ultracopier-0.3/TransferThread.cpp 2012-06-29 15:58:31.546130402 +0200 -+++ Rsync/TransferThread.cpp 2012-06-29 18:58:24.095943961 +0200 -@@ -26,6 +26,7 @@ - alwaysDoFileExistsAction= FileExists_NotSet; - readError = false; - writeError = false; -+ rsync = false; - this->mkpathTransfer = mkpathTransfer; - readThread.setWriteThread(&writeThread); - -@@ -278,7 +279,7 @@ - { - //check if destination exists - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] overwrite: "+QString::number(fileExistsAction)+", always action: "+QString::number(alwaysDoFileExistsAction)); -- if(alwaysDoFileExistsAction==FileExists_Overwrite || readError || writeError) -+ if(alwaysDoFileExistsAction==FileExists_Overwrite || rsync || readError || writeError) - return false; - if(destinationInfo.exists()) - { -@@ -1124,6 +1125,12 @@ - emit tryPutAtBottom(); - } - -+/// \brief set rsync -+void TransferThread::setRsync(const bool rsync) -+{ -+ this->rsync=rsync; -+} -+ - void TransferThread::set_osBufferLimit(unsigned int osBufferLimit) - { - this->osBufferLimit=osBufferLimit; -diff -U 3 -H -d -r -N -- Ultracopier-0.3/TransferThread.h Rsync/TransferThread.h ---- Ultracopier-0.3/TransferThread.h 2012-06-26 11:10:54.541994070 +0200 -+++ Rsync/TransferThread.h 2012-06-29 15:54:29.286134585 +0200 -@@ -113,6 +113,8 @@ - qint64 copiedSize(); - /// \brief put the current file at bottom - void putAtBottom(); -+ /// \brief set rsync -+ void setRsync(const bool rsync); - - void set_osBufferLimit(unsigned int osBufferLimit); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -@@ -166,6 +168,7 @@ - bool readIsClosedVariable; - bool writeIsClosedVariable; - bool canBeMovedDirectlyVariable; -+ bool rsync; - QByteArray sourceChecksum,destinationChecksum; - volatile bool stopIt; - volatile bool canStartTransfer; -diff -U 3 -H -d -r -N -- Ultracopier-0.3/copyEngine.cpp Rsync/copyEngine.cpp ---- Ultracopier-0.3/copyEngine.cpp 2012-06-26 14:14:40.892116001 +0200 -+++ Rsync/copyEngine.cpp 2012-06-29 21:22:50.945794251 +0200 -@@ -186,6 +186,7 @@ - connect(ui->keepDate, SIGNAL(toggled(bool)), &threadOfTheTransfer, SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), &threadOfTheTransfer, SLOT(setBlockSize(int)));*/ - connect(ui->autoStart, SIGNAL(toggled(bool)), this, SLOT(setAutoStart(bool))); -+ connect(ui->rsync, SIGNAL(toggled(bool)), this, SLOT(setRsync(bool))); - connect(ui->checkBoxDestinationFolderExists, SIGNAL(toggled(bool)), this, SLOT(setCheckDestinationFolderExists(bool))); - uiIsInstalled=true; - setRightTransfer(doRightTransfer); -@@ -193,6 +194,7 @@ - setSpeedLimitation(maxSpeed); - setBlockSize(blockSize); - setAutoStart(autoStart); -+ setRsync(rsync); - setCheckDestinationFolderExists(checkDestinationFolderExists); - set_doChecksum(doChecksum); - set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); -@@ -216,6 +218,7 @@ - connect(ui->keepDate, SIGNAL(toggled(bool)), this,SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), this,SLOT(setBlockSize(int))); - connect(ui->autoStart, SIGNAL(toggled(bool)), this,SLOT(setAutoStart(bool))); -+ connect(ui->rsync, SIGNAL(toggled(bool)), this,SLOT(setRsync(bool))); - connect(ui->doChecksum, SIGNAL(toggled(bool)), this,SLOT(doChecksum_toggled(bool))); - connect(ui->checksumIgnoreIfImpossible, SIGNAL(toggled(bool)), this,SLOT(checksumIgnoreIfImpossible_toggled(bool))); - connect(ui->checksumOnlyOnError, SIGNAL(toggled(bool)), this,SLOT(checksumOnlyOnError_toggled(bool))); -@@ -505,6 +508,13 @@ - /** \brief give the forced mode, to export/import transfer list */ - void copyEngine::forceMode(const CopyMode &mode) - { -+ if(mode==Move) -+ { -+ listThread->setRsync(false); -+ rsync=false; -+ } -+ if(uiIsInstalled) -+ ui->rsync->setEnabled(mode==Copy); - if(forcedMode) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Mode forced previously")); -@@ -617,6 +627,19 @@ - listThread->setAutoStart(autoStart); - } - -+/// \brief set rsync -+void copyEngine::setRsync(const bool rsync) -+{ -+ this->rsync=rsync; -+ if(uiIsInstalled) -+ { -+ ui->rsync->setChecked(rsync); -+ ui->rsync->setEnabled(forcedMode && mode==Copy); -+ ui->label_rsync->setEnabled(forcedMode && mode==Copy); -+ } -+ listThread->setRsync(rsync); -+} -+ - //set check destination folder - void copyEngine::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) - { -diff -U 3 -H -d -r -N -- Ultracopier-0.3/copyEngine.h Rsync/copyEngine.h ---- Ultracopier-0.3/copyEngine.h 2012-06-25 16:50:12.191263770 +0200 -+++ Rsync/copyEngine.h 2012-06-29 15:49:45.856139485 +0200 -@@ -60,6 +60,7 @@ - bool keepDate; - int blockSize; - bool autoStart; -+ bool rsync; - bool checkDestinationFolderExists; - FileExistsAction alwaysDoThisActionForFileExists; - FileErrorAction alwaysDoThisActionForFileError; -@@ -273,6 +274,8 @@ - void setBlockSize(const int blockSize); - /// \brief set auto start - void setAutoStart(const bool autoStart); -+ /// \brief set rsync -+ void setRsync(const bool rsync); - /// \brief set if need check if the destination folder exists - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - /// \brief reset widget -diff -U 3 -H -d -r -N -- Ultracopier-0.3/copyEngine.pro.user Rsync/copyEngine.pro.user ---- Ultracopier-0.3/copyEngine.pro.user 2012-06-26 15:50:53.722179836 +0200 -+++ Rsync/copyEngine.pro.user 2012-06-29 22:42:24.025711798 +0200 -@@ -1,6 +1,6 @@ - - -- -+ - - - ProjectExplorer.Project.ActiveTarget -@@ -163,7 +163,113 @@ - 2 - true - -- 2 -+ -+ ProjectExplorer.ToolChain.Gcc:{d6ee78f7-3364-4f54-a93f-b3c1e2a8c8c9} -+ -+ -+ true -+ qmake -+ -+ QtProjectManager.QMakeBuildStep -+ false -+ true -+ -+ false -+ -+ -+ true -+ Make -+ -+ Qt4ProjectManager.MakeStep -+ false -+ -+ -+ -+ 2 -+ Build -+ -+ ProjectExplorer.BuildSteps.Build -+ -+ -+ -+ true -+ Make -+ -+ Qt4ProjectManager.MakeStep -+ true -+ clean -+ -+ -+ 1 -+ Clean -+ -+ ProjectExplorer.BuildSteps.Clean -+ -+ 2 -+ false -+ -+ Qt 5.0.0 (qt-everywhere-opensource-src-5.0.0) Release -+ -+ Qt4ProjectManager.Qt4BuildConfiguration -+ 0 -+ /home/user/Desktop/ultracopier/sources/plugins/CopyEngine/copyEngine-build-desktop-Qt_5_0_0__qt-everywhere-opensource-src-5_0_0__Release -+ 3 -+ true -+ -+ -+ ProjectExplorer.ToolChain.Gcc:{d6ee78f7-3364-4f54-a93f-b3c1e2a8c8c9} -+ -+ -+ true -+ qmake -+ -+ QtProjectManager.QMakeBuildStep -+ false -+ true -+ -+ false -+ -+ -+ true -+ Make -+ -+ Qt4ProjectManager.MakeStep -+ false -+ -+ -+ -+ 2 -+ Build -+ -+ ProjectExplorer.BuildSteps.Build -+ -+ -+ -+ true -+ Make -+ -+ Qt4ProjectManager.MakeStep -+ true -+ clean -+ -+ -+ 1 -+ Clean -+ -+ ProjectExplorer.BuildSteps.Clean -+ -+ 2 -+ false -+ -+ Qt 5.0.0 (qt-everywhere-opensource-src-5.0.0) Debug -+ -+ Qt4ProjectManager.Qt4BuildConfiguration -+ 2 -+ /home/user/Desktop/ultracopier/sources/plugins/CopyEngine/copyEngine-build-desktop-Qt_5_0_0__qt-everywhere-opensource-src-5_0_0__Debug -+ 3 -+ true -+ -+ 4 - - - 0 -diff -U 3 -H -d -r -N -- Ultracopier-0.3/factory.cpp Rsync/factory.cpp ---- Ultracopier-0.3/factory.cpp 2012-06-26 14:10:39.972113336 +0200 -+++ Rsync/factory.cpp 2012-06-29 15:40:43.606148853 +0200 -@@ -35,6 +35,7 @@ - connect(ui->keepDate, SIGNAL(toggled(bool)), this,SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), this,SLOT(setBlockSize(int))); - connect(ui->autoStart, SIGNAL(toggled(bool)), this,SLOT(setAutoStart(bool))); -+ connect(ui->rsync, SIGNAL(toggled(bool)), this,SLOT(setRsync(bool))); - connect(ui->doChecksum, SIGNAL(toggled(bool)), this,SLOT(doChecksum_toggled(bool))); - connect(ui->checksumIgnoreIfImpossible, SIGNAL(toggled(bool)), this,SLOT(checksumIgnoreIfImpossible_toggled(bool))); - connect(ui->checksumOnlyOnError, SIGNAL(toggled(bool)), this,SLOT(checksumOnlyOnError_toggled(bool))); -@@ -71,6 +72,7 @@ - realObject->setKeepDate( optionsEngine->getOptionValue("keepDate").toBool()); - realObject->setBlockSize( optionsEngine->getOptionValue("blockSize").toInt()); - realObject->setAutoStart( optionsEngine->getOptionValue("autoStart").toBool()); -+ realObject->setRsync( optionsEngine->getOptionValue("rsync").toBool()); - realObject->on_comboBoxFolderColision_currentIndexChanged(ui->comboBoxFolderColision->currentIndex()); - realObject->on_comboBoxFolderError_currentIndexChanged(ui->comboBoxFolderError->currentIndex()); - realObject->setCheckDestinationFolderExists( optionsEngine->getOptionValue("checkDestinationFolder").toBool()); -@@ -123,6 +125,7 @@ - KeysList.append(qMakePair(QString("keepDate"),QVariant(true))); - KeysList.append(qMakePair(QString("blockSize"),QVariant(1024)));//1024KB as default - KeysList.append(qMakePair(QString("autoStart"),QVariant(true))); -+ KeysList.append(qMakePair(QString("rsync"),QVariant(true))); - KeysList.append(qMakePair(QString("folderError"),QVariant(0))); - KeysList.append(qMakePair(QString("folderColision"),QVariant(0))); - KeysList.append(qMakePair(QString("checkDestinationFolder"),QVariant(true))); -@@ -151,6 +154,7 @@ - ui->keepDate->setChecked(optionsEngine->getOptionValue("keepDate").toBool()); - ui->blockSize->setValue(optionsEngine->getOptionValue("blockSize").toUInt()); - ui->autoStart->setChecked(optionsEngine->getOptionValue("autoStart").toBool()); -+ ui->rsync->setChecked(optionsEngine->getOptionValue("rsync").toBool()); - ui->comboBoxFolderError->setCurrentIndex(optionsEngine->getOptionValue("folderError").toUInt()); - ui->comboBoxFolderColision->setCurrentIndex(optionsEngine->getOptionValue("folderColision").toUInt()); - ui->checkBoxDestinationFolderExists->setChecked(optionsEngine->getOptionValue("checkDestinationFolder").toBool()); -@@ -287,6 +291,15 @@ - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); - } -+ -+void Factory::setRsync(bool rsync) -+{ -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); -+ if(optionsEngine!=NULL) -+ optionsEngine->setOptionValue("rsync",rsync); -+ else -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -+} - - void Factory::newLanguageLoaded() - { -diff -U 3 -H -d -r -N -- Ultracopier-0.3/factory.h Rsync/factory.h ---- Ultracopier-0.3/factory.h 2012-05-19 15:44:05.354039716 +0200 -+++ Rsync/factory.h 2012-06-29 15:40:20.016149261 +0200 -@@ -71,6 +71,7 @@ - void setKeepDate(bool keepDate); - void setBlockSize(int blockSize); - void setAutoStart(bool autoStart); -+ void setRsync(bool rsync); - void showFilterDialog(); - void sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void doChecksum_toggled(bool); -diff -U 3 -H -d -r -N -- Ultracopier-0.3/informations.xml Rsync/informations.xml ---- Ultracopier-0.3/informations.xml 2012-06-25 17:31:49.331291383 +0200 -+++ Rsync/informations.xml 2012-06-29 15:11:53.696178734 +0200 -@@ -1,7 +1,7 @@ - - -- <![CDATA[Copy engine of Ultracopier 0.3]]> -- <![CDATA[Moteur de copie d'ultracopier 0.3]]> -+ <![CDATA[Rsync copy engine]]> -+ <![CDATA[Moteur de copie rsync]]> - - CopyEngine - -@@ -14,12 +14,12 @@ - - linux-x86_64-pc - -- -- -+ -+ - - 0.3.0.10 - -- Ultracopier-0.3 -+ Rsync - - =ultracopier-0.3.0.10 -diff -U 3 -H -d -r -N -- Ultracopier-0.3/options.ui Rsync/options.ui ---- Ultracopier-0.3/options.ui 2012-06-20 14:56:21.509908805 +0200 -+++ Rsync/options.ui 2012-06-29 22:15:47.595739375 +0200 -@@ -6,8 +6,8 @@ - - 0 - 0 -- 356 -- 376 -+ 354 -+ 399 - - - -@@ -122,7 +122,7 @@ - - - -- -+ - - - Checksum -@@ -175,24 +175,24 @@ - - - -- -+ - - - Enable OS buffer - - - -- -+ - - -- -+ - - - OS buffer only if smaller than - - - -- -+ - - - KB -@@ -215,7 +215,7 @@ - - - -- -+ - - - Qt::Vertical -@@ -228,20 +228,34 @@ - - - -- -+ - - - Filters - - - -- -+ - - - Renaming rules - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Rsync (only in copy mode) -+ -+ -+ - - - -diff -U 3 -H -d -r -N -- Ultracopier-0.3/scanFileOrFolder.cpp Rsync/scanFileOrFolder.cpp ---- Ultracopier-0.3/scanFileOrFolder.cpp 2012-05-23 11:06:25.001037392 +0200 -+++ Rsync/scanFileOrFolder.cpp 2012-06-29 21:54:15.555761695 +0200 -@@ -1,9 +1,10 @@ - #include "scanFileOrFolder.h" - --#include -+#include - - scanFileOrFolder::scanFileOrFolder(CopyMode mode) - { -+ rsync=false; - stopped = true; - stopIt = false; - this->mode=mode; -@@ -427,7 +428,17 @@ - if(!included) - {} - else -- emit fileTransfer(fileInfo.absoluteFilePath(),finalDest+fileName,mode); -+ { -+ bool sendToTransfer=false; -+ if(!rsync) -+ sendToTransfer=true; -+ else if(!QFile::exists(finalDest+fileName)) -+ sendToTransfer=true; -+ else if(fileInfo.lastModified()!=QFileInfo(finalDest+fileName).lastModified()) -+ sendToTransfer=true; -+ if(sendToTransfer) -+ emit fileTransfer(fileInfo.absoluteFilePath(),finalDest+fileName,mode); -+ } - } - } - } -@@ -437,9 +448,43 @@ - //listFolder(source,destination,suffixPath+fileInfo.fileName()+QDir::separator()); - listFolder(source,destination,sourceSuffixPath+fileInfo.fileName()+"/",destinationSuffixPath+fileInfo.fileName()+"/");//put unix separator because it's transformed into that's under windows too - else -- emit fileTransfer(fileInfo.absoluteFilePath(),finalDest+fileInfo.fileName(),mode); -+ { -+ bool sendToTransfer=false; -+ if(!rsync) -+ sendToTransfer=true; -+ else if(!QFile::exists(finalDest+fileInfo.fileName())) -+ sendToTransfer=true; -+ else if(fileInfo.lastModified()!=QFileInfo(finalDest+fileInfo.fileName()).lastModified()) -+ sendToTransfer=true; -+ if(sendToTransfer) -+ emit fileTransfer(fileInfo.absoluteFilePath(),finalDest+fileInfo.fileName(),mode); -+ } - } - } -+ if(rsync) -+ { -+ //check the reverse path here -+ QFileInfoList entryListDestination=QDir(finalDest).entryInfoList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System,QDir::DirsFirst|QDir::Name|QDir::IgnoreCase);//possible wait time here -+ int sizeEntryListDestination=entryListDestination.size(); -+ int index=0; -+ for (int indexDestination=0;indexDestinationfirstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - } -+ -+/// \brief set rsync -+void scanFileOrFolder::setRsync(const bool rsync) -+{ -+ this->rsync=rsync; -+} -diff -U 3 -H -d -r -N -- Ultracopier-0.3/scanFileOrFolder.h Rsync/scanFileOrFolder.h ---- Ultracopier-0.3/scanFileOrFolder.h 2012-05-20 20:32:43.695874620 +0200 -+++ Rsync/scanFileOrFolder.h 2012-06-29 21:51:45.235764294 +0200 -@@ -38,6 +38,8 @@ - /// \brief set if need check if the destination exists - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -+ /// \brief set rsync -+ void setRsync(const bool rsync); - signals: - void fileTransfer(const QFileInfo &source,const QFileInfo &destination,const CopyMode &mode); - /// \brief To debug source -@@ -49,6 +51,7 @@ - void newFolderListing(const QString &path); - void addToMkPath(const QString& folder); - void addToRmPath(const QString& folder,const int& inodeToRemove); -+ void addToRmForRsync(const QString& inode); - public slots: - void addToList(const QStringList& sources,const QString& destination); - void setFilters(QList include,QList exclude); -@@ -69,6 +72,7 @@ - QString prefix; - QString suffix; - CopyMode mode; -+ bool rsync; - QList include,exclude; - QList include_send,exclude_send; - bool reloadTheNewFilters; diff --git a/patch/opensource/KDE-Ultracopier.patch b/patch/opensource/KDE-Ultracopier.patch deleted file mode 100644 index 4130c08..0000000 --- a/patch/opensource/KDE-Ultracopier.patch +++ /dev/null @@ -1,290 +0,0 @@ -diff -U 3 -H -d -r -N -- kde-baseapps-4.8.4/lib/konq/CMakeLists.txt kde-baseapps-4.8.4-ultracopier/lib/konq/CMakeLists.txt ---- kde-baseapps-4.8.4/lib/konq/CMakeLists.txt 2011-09-26 11:43:17.390868969 +0200 -+++ kde-baseapps-4.8.4-ultracopier/lib/konq/CMakeLists.txt 2012-06-27 09:54:15.909492978 +0200 -@@ -9,6 +9,7 @@ - include_directories( ${ZLIB_INCLUDE_DIR} ) - - set(konq_LIB_SRCS -+ ClientCatchcopy.cpp - konq_popupmenu.cpp # used by konqueror, kfind, folderview, kickoff - konq_popupmenuplugin.cpp # for KonqPopupMenu and its plugins - konq_dndpopupmenuplugin.cpp # for KonqDndPopupMenu and its plugins -@@ -53,6 +54,7 @@ - - install( FILES directory_bookmarkbar.desktop DESTINATION ${DATA_INSTALL_DIR}/kbookmark ) - install( FILES -+ ClientCatchcopy.h - konq_popupmenu.h - konq_popupmenuinformation.h - konq_popupmenuplugin.h -diff -U 3 -H -d -r -N -- kde-baseapps-4.8.4/lib/konq/ClientCatchcopy.cpp kde-baseapps-4.8.4-ultracopier/lib/konq/ClientCatchcopy.cpp ---- kde-baseapps-4.8.4/lib/konq/ClientCatchcopy.cpp 1970-01-01 01:00:00.000000000 +0100 -+++ kde-baseapps-4.8.4-ultracopier/lib/konq/ClientCatchcopy.cpp 2012-06-27 10:28:25.049457581 +0200 -@@ -0,0 +1,142 @@ -+/** \file ClientCatchcopy.cpp -+\brief Define the catchcopy client -+\author alpha_one_x86 -+\version 0002 -+\date 2010 */ -+ -+#include "ClientCatchcopy.h" -+ -+ClientCatchcopy::ClientCatchcopy() -+{ -+ disconnectedFromSocket(); -+ connect(&socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromSocket())); -+ connect(&socket, SIGNAL(readyRead()), this, SLOT(readyRead())); -+ connect(&socket, SIGNAL(connected()), this, SLOT(socketIsConnected())); -+} -+ -+void ClientCatchcopy::socketIsConnected() -+{ -+ sendProtocol(); -+} -+ -+void ClientCatchcopy::connectToServer() -+{ -+ socket.connectToServer(pathSocket()); -+ socket.waitForConnected(); -+} -+ -+const QString ClientCatchcopy::pathSocket() -+{ -+#ifdef Q_OS_UNIX -+ return "advanced-copier-"+QString::number(getuid()); -+#else -+ QString userName; -+ DWORD size=0; -+ if(GetUserNameW(NULL,&size) || (GetLastError()!=ERROR_INSUFFICIENT_BUFFER)) -+ { -+ } -+ else -+ { -+ WCHAR * userNameW=new WCHAR[size]; -+ if(GetUserNameW(userNameW,&size)) -+ { -+ userName.fromWCharArray(userNameW,size*2); -+ userName=QString(QByteArray((char*)userNameW,size*2-2).toHex()); -+ } -+ delete userNameW; -+ } -+ return "advanced-copier-"+userName; -+#endif -+} -+ -+void ClientCatchcopy::disconnectFromServer() -+{ -+ socket.abort(); -+ socket.disconnectFromServer(); -+} -+ -+/// \brief to send stream of string list -+quint32 ClientCatchcopy::sendRawOrderList(const QStringList & order) -+{ -+ if(!socket.isValid()) -+ return -1; -+ if(socket.state()!=QLocalSocket::ConnectedState) -+ return -1; -+ idNextOrder++; -+ if(idNextOrder>2000000000) -+ idNextOrder=0; -+ QByteArray block; -+ QDataStream out(&block, QIODevice::WriteOnly); -+ out.setVersion(QDataStream::Qt_4_4); -+ out << int(0); -+ out << idNextOrder; -+ out << order; -+ out.device()->seek(0); -+ out << block.size(); -+ do //cut string list and send it as block of 32KB -+ { -+ QByteArray blockToSend; -+ int byteWriten; -+ blockToSend=block.left(32*1024);//32KB -+ block.remove(0,blockToSend.size()); -+ byteWriten = socket.write(blockToSend); -+ if(!socket.isValid()) -+ return -1; -+ if(socket.errorString()!="Unknown error" && socket.errorString()!="") -+ return -1; -+ if(blockToSend.size()!=byteWriten) -+ return -1; -+ } -+ while(block.size()); -+ return idNextOrder; -+} -+ -+void ClientCatchcopy::readyRead() -+{ -+ while(socket.bytesAvailable()>0) -+ { -+ socket.readAll(); -+ } -+} -+ -+void ClientCatchcopy::disconnectedFromSocket() -+{ -+ idNextOrder = 0; -+} -+ -+/// \brief to send the protocol version used -+void ClientCatchcopy::sendProtocol() -+{ -+ sendRawOrderList(QStringList() << "protocol" << "0002"); -+} -+ -+void ClientCatchcopy::setClientName(const QString & name) -+{ -+ sendRawOrderList(QStringList() << "client" << name); -+} -+ -+bool ClientCatchcopy::addCopyWithDestination(const QStringList & sources,const QString & destination) -+{ -+ if(socket.state()==QLocalSocket::UnconnectedState) -+ connectToServer(); -+ if(socket.state()==QLocalSocket::ConnectedState) -+ { -+ sendRawOrderList(QStringList() << "cp" << sources << destination); -+ return true; -+ } -+ else -+ return false; -+} -+ -+bool ClientCatchcopy::addMoveWithDestination(const QStringList & sources,const QString & destination) -+{ -+ if(socket.state()==QLocalSocket::UnconnectedState) -+ connectToServer(); -+ if(socket.state()==QLocalSocket::ConnectedState) -+ { -+ sendRawOrderList(QStringList() << "mv" << sources << destination); -+ return true; -+ } -+ else -+ return false; -+} -diff -U 3 -H -d -r -N -- kde-baseapps-4.8.4/lib/konq/ClientCatchcopy.h kde-baseapps-4.8.4-ultracopier/lib/konq/ClientCatchcopy.h ---- kde-baseapps-4.8.4/lib/konq/ClientCatchcopy.h 1970-01-01 01:00:00.000000000 +0100 -+++ kde-baseapps-4.8.4-ultracopier/lib/konq/ClientCatchcopy.h 2012-06-27 10:28:52.169457112 +0200 -@@ -0,0 +1,58 @@ -+/** \file ClientCatchcopy.h -+\brief Define the catchcopy client -+\author alpha_one_x86 -+\version 0002 -+\date 2010 */ -+ -+#ifndef CLIENTCATCHCOPY_H -+#define CLIENTCATCHCOPY_H -+ -+#include -+#include -+#include -+#include -+#include -+ -+#ifdef Q_OS_UNIX -+ #include -+ #include -+#else -+ #include -+#endif -+ -+/// \brief Define the catchcopy client -+class ClientCatchcopy : public QObject -+{ -+ Q_OBJECT -+ public: -+ ClientCatchcopy(); -+ public slots: -+ void connectToServer(); -+ void disconnectFromServer(); -+ //to test and internal use -+ /// \brief set the client name -+ void setClientName(const QString & name); -+ /// \brief add copy with destination -+ bool addCopyWithDestination(const QStringList & sources,const QString & destination); -+ /// \brief add move with destination -+ bool addMoveWithDestination(const QStringList & sources,const QString & destination); -+ private: -+ /// \brief to send order -+ void sendProtocol(); -+ -+ const QString pathSocket(); -+ quint32 idNextOrder; -+ //the local socket -+ QLocalSocket socket; -+ -+ /// \brief to send stream of string list -+ quint32 sendRawOrderList(const QStringList & order); -+ private slots: -+ void readyRead(); -+ void disconnectedFromSocket(); -+ void socketIsConnected(); -+ protected: -+ bool parseReply(quint32 orderId,quint32 returnCode,QStringList returnList); -+}; -+ -+#endif // CLIENTCATCHCOPY_H -diff -U 3 -H -d -r -N -- kde-baseapps-4.8.4/lib/konq/konq_operations.cpp kde-baseapps-4.8.4-ultracopier/lib/konq/konq_operations.cpp ---- kde-baseapps-4.8.4/lib/konq/konq_operations.cpp 2011-09-26 11:43:17.392868951 +0200 -+++ kde-baseapps-4.8.4-ultracopier/lib/konq/konq_operations.cpp 2012-06-27 10:29:32.879456409 +0200 -@@ -154,6 +154,8 @@ - } - } - -+ClientCatchcopy KonqOperations::clientCatchcopy; -+ - void KonqOperations::copy( QWidget * parent, Operation method, const KUrl::List & selectedUrls, const KUrl& destUrl ) - { - kDebug(1203) << parent->metaObject()->className() << selectedUrls << destUrl; -@@ -175,7 +177,30 @@ - else if (method == MOVE) - job = KIO::move( selectedUrls, destUrl ); - else -+ { -+ QStringList selectedFiles; -+ bool isLocal=true; -+ int index=0; -+ while(indexsetOperation( job, method, destUrl ); - -diff -U 3 -H -d -r -N -- kde-baseapps-4.8.4/lib/konq/konq_operations.h kde-baseapps-4.8.4-ultracopier/lib/konq/konq_operations.h ---- kde-baseapps-4.8.4/lib/konq/konq_operations.h 2011-07-27 20:36:39.112044764 +0200 -+++ kde-baseapps-4.8.4-ultracopier/lib/konq/konq_operations.h 2012-06-27 09:31:29.109516591 +0200 -@@ -23,6 +23,8 @@ - #ifndef __konq_operations_h__ - #define __konq_operations_h__ - -+#include "ClientCatchcopy.h" -+ - #include - #include - -@@ -221,6 +223,7 @@ - - private: - QWidget* parentWidget() const; -+ static ClientCatchcopy clientCatchcopy; - void _del( Operation method, const KUrl::List & selectedUrls, ConfirmationType confirmation ); - void _restoreTrashedItems( const KUrl::List& urls ); - void _statUrl( const KUrl & url, const QObject *receiver, const char *member ); diff --git a/patch/opensource/options-with-pass.patch b/patch/opensource/options-with-pass.patch deleted file mode 100644 index c53cefd..0000000 --- a/patch/opensource/options-with-pass.patch +++ /dev/null @@ -1,336 +0,0 @@ -diff -U 3 -H -d -r -N -- sources/EventDispatcher.cpp sources-with-pass/EventDispatcher.cpp ---- sources/EventDispatcher.cpp 2012-02-20 11:16:29.402151959 +0100 -+++ sources-with-pass/EventDispatcher.cpp 2012-02-21 19:16:06.540690161 +0100 -@@ -52,6 +52,8 @@ - KeysList.append(qMakePair(QString("Last_version_used"),QVariant("na"))); - KeysList.append(qMakePair(QString("ActionOnManualOpen"),QVariant(1))); - KeysList.append(qMakePair(QString("GroupWindowWhen"),QVariant(0))); -+ KeysList.append(qMakePair(QString("checkBoxPass"),QVariant(true))); -+ KeysList.append(qMakePair(QString("Password"),QVariant("admin"))); - options->addOptionGroup("Ultracopier",KeysList); - if(options->getOptionValue("Ultracopier","Last_version_used")!=QVariant("na") && options->getOptionValue("Ultracopier","Last_version_used")!=QVariant(ULTRACOPIER_VERSION)) - { -diff -U 3 -H -d -r -N -- sources/OptionDialog.cpp sources-with-pass/OptionDialog.cpp ---- sources/OptionDialog.cpp 2012-02-21 19:22:24.990694347 +0100 -+++ sources-with-pass/OptionDialog.cpp 2012-02-21 19:24:59.290696056 +0100 -@@ -222,6 +222,8 @@ - newOptionValue("Themes", "Ultracopier_current_theme", options->getOptionValue("Themes","Ultracopier_current_theme")); - newOptionValue("Ultracopier", "ActionOnManualOpen", options->getOptionValue("Ultracopier","ActionOnManualOpen")); - newOptionValue("Ultracopier", "GroupWindowWhen", options->getOptionValue("Ultracopier","GroupWindowWhen")); -+ newOptionValue("Ultracopier", "checkBoxPass", options->getOptionValue("Ultracopier","checkBoxPass")); -+ newOptionValue("Ultracopier", "Password", options->getOptionValue("Ultracopier","Password")); - newOptionValue("Language", "Language", options->getOptionValue("Language","Language")); - newOptionValue("Language", "Language_autodetect", options->getOptionValue("Language","Language_autodetect")); - newOptionValue("SessionLoader", "LoadAtSessionStarting", options->getOptionValue("SessionLoader","LoadAtSessionStarting")); -@@ -361,6 +363,14 @@ - { - ui->GroupWindowWhen->setCurrentIndex(value.toInt()); - } -+ if(name=="checkBoxPass") -+ { -+ ui->checkBoxPass->setChecked(value.toBool()); -+ } -+ if(name=="Password") -+ { -+ ui->Password->setText(value.toString()); -+ } - } - } - -@@ -706,3 +716,21 @@ - options->setOptionValue("Ultracopier","ActionOnManualOpen",index); - } - } -+ -+void OptionDialog::on_checkBoxPass_toggled(bool checked) -+{ -+ if(index!=-1 && plugins->allPluginHaveBeenLoaded()) -+ { -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); -+ options->setOptionValue("Ultracopier","checkBoxPass",checked); -+ } -+} -+ -+void OptionDialog::on_Password_editingFinished() -+{ -+ if(index!=-1 && plugins->allPluginHaveBeenLoaded()) -+ { -+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); -+ options->setOptionValue("Ultracopier","Password",ui->Password->text()); -+ } -+} -diff -U 3 -H -d -r -N -- sources/OptionDialog.h sources-with-pass/OptionDialog.h ---- sources/OptionDialog.h 2012-02-21 19:22:33.220694431 +0100 -+++ sources-with-pass/OptionDialog.h 2012-02-21 19:25:05.490696125 +0100 -@@ -57,7 +57,8 @@ - void on_checkBoxLog_folder_clicked(); - void on_checkBoxLog_sync_clicked(); - void on_ActionOnManualOpen_currentIndexChanged(int index); -- -+ void on_checkBoxPass_toggled(bool checked); -+ void on_Password_editingFinished(); - private: - Ui::OptionDialog *ui; - struct pluginStore -diff -U 3 -H -d -r -N -- sources/OptionDialog.ui sources-with-pass/OptionDialog.ui ---- sources/OptionDialog.ui 2012-02-10 19:52:43.711122987 +0100 -+++ sources-with-pass/OptionDialog.ui 2012-02-21 19:16:55.130690698 +0100 -@@ -6,7 +6,7 @@ - - 0 - 0 -- 638 -+ 717 - 455 - - -@@ -80,6 +80,9 @@ - - - -+ -+ QFormLayout::ExpandingFieldsGrow -+ - - - -@@ -158,6 +161,13 @@ - - - -+ -+ -+ -+ Group window when: -+ -+ -+ - - - -@@ -192,10 +202,20 @@ - - - -- -- -+ -+ - -- Group window when: -+ Protect options with a pass: -+ -+ -+ -+ -+ -+ -+ false -+ -+ -+ QLineEdit::Password - - - -@@ -770,12 +790,12 @@ - setEnabled(bool) - - -- 313 -- 13 -+ 301 -+ 5 - - -- 533 -- 44 -+ 237 -+ 9 - - - -@@ -786,12 +806,12 @@ - setEnabled(bool) - - -- 583 -- 20 -+ 301 -+ 5 - - -- 584 -- 40 -+ 300 -+ 9 - - - -@@ -802,12 +822,12 @@ - setEnabled(bool) - - -- 345 -- 21 -+ 301 -+ 5 - - -- 582 -- 105 -+ 301 -+ 14 - - - -@@ -818,12 +838,12 @@ - setEnabled(bool) - - -- 348 -- 25 -+ 301 -+ 5 - - -- 557 -- 156 -+ 301 -+ 19 - - - -@@ -834,12 +854,12 @@ - setEnabled(bool) - - -- 537 -- 105 -+ 301 -+ 14 - - -- 533 -- 131 -+ 301 -+ 16 - - - -@@ -850,12 +870,12 @@ - setEnabled(bool) - - -- 501 -- 156 -+ 301 -+ 19 - - -- 501 -- 182 -+ 301 -+ 22 - - - -@@ -866,12 +886,12 @@ - setEnabled(bool) - - -- 269 -- 15 -+ 301 -+ 5 - - -- 456 -- 207 -+ 301 -+ 25 - - - -@@ -882,12 +902,28 @@ - setEnabled(bool) - - -- 334 -- 12 -+ 301 -+ 5 - - -- 304 -- 69 -+ 301 -+ 11 -+ -+ -+ -+ -+ checkBoxPass -+ toggled(bool) -+ Password -+ setEnabled(bool) -+ -+ -+ 412 -+ 169 -+ -+ -+ 482 -+ 172 - - - -diff -U 3 -H -d -r -N -- sources/SystrayIcon.cpp sources-with-pass/SystrayIcon.cpp ---- sources/SystrayIcon.cpp 2012-02-05 14:25:43.462930072 +0100 -+++ sources-with-pass/SystrayIcon.cpp 2012-02-21 19:35:36.630703097 +0100 -@@ -5,6 +5,7 @@ - \date 2010 */ - - #include -+#include - - #include "SystrayIcon.h" - -@@ -33,7 +34,7 @@ - //connect the action - connect(actionMenuQuit, SIGNAL(triggered()), this, SIGNAL(quit())); - connect(actionMenuAbout, SIGNAL(triggered()), this, SIGNAL(showHelp())); -- connect(actionOptions, SIGNAL(triggered()), this, SIGNAL(showOptions())); -+ connect(actionOptions, SIGNAL(triggered()), this, SLOT(askPassIfNeeded())); - connect(sysTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(CatchAction(QSystemTrayIcon::ActivationReason))); - connect(plugins, SIGNAL(pluginListingIsfinish()), this, SLOT(reloadEngineList())); - //display the icon -@@ -375,3 +376,17 @@ - } - } - } -+ -+void SystrayIcon::askPassIfNeeded() -+{ -+ if(!options->getOptionValue("Ultracopier","checkBoxPass").toBool()) -+ { -+ emit showOptions(); -+ return; -+ } -+ QString pass=QInputDialog::getText(NULL,tr("Options password"),tr("Give the option for the password"),QLineEdit::Password); -+ if(pass==options->getOptionValue("Ultracopier","Password").toString()) -+ emit showOptions(); -+ else -+ QMessageBox::warning(NULL,tr("Error"),tr("Wrong password!")); -+} -diff -U 3 -H -d -r -N -- sources/SystrayIcon.h sources-with-pass/SystrayIcon.h ---- sources/SystrayIcon.h 2011-12-12 08:53:27.000000000 +0100 -+++ sources-with-pass/SystrayIcon.h 2012-02-21 19:27:11.780697518 +0100 -@@ -78,6 +78,8 @@ - /// \brief to retranslate the ui - void retranslateTheUI(); - void reloadEngineList(); -+ /// \brief ask the pass if needed -+ void askPassIfNeeded(); - signals: - /// \brief Quit ultracopier - void quit(); diff --git a/plugins-alternative/CopyEngine/Rsync/AvancedQFile.cpp b/plugins-alternative/CopyEngine/Rsync/AvancedQFile.cpp deleted file mode 100644 index af5805b..0000000 --- a/plugins-alternative/CopyEngine/Rsync/AvancedQFile.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/** \file AvancedQFile.cpp -\brief Define the QFile herited class to set file date/time -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include "AvancedQFile.h" - -#ifdef Q_CC_GNU -//this next header is needed to change file time/date under gcc -#include -#include -#endif - -//source -//hSrc=CreateFile(pData->pfiSrcFile->GetFullFilePath(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); -//destination -//hDst=CreateFile(pData->strDstFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); - -bool AvancedQFile::setCreated(QDateTime time) -{ - time_t ctime=time.toTime_t(); - #ifdef Q_CC_GNU - //creation time not exists into unix world - Q_UNUSED(ctime) - return true; - #else - setErrorString(tr("Not supported on this platform")); - return false; - #endif -} - -bool AvancedQFile::setLastModified(QDateTime time) -{ - time_t actime=QFileInfo(*this).lastRead().toTime_t(); - //protect to wrong actime - if(actime<0) - actime=0; - time_t modtime=time.toTime_t(); - if(modtime<0) - { - setErrorString(tr("Last modified date is wrong")); - return false; - } - #ifdef Q_CC_GNU - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - int returnVal=utime(this->fileName().toLocal8Bit().data(),&butime); - if(returnVal==0) - return true; - else - { - setErrorString(strerror(errno)); - return false; - } - #else - setErrorString(tr("Not supported on this platform")); - return false; - #endif -} - -bool AvancedQFile::setLastRead(QDateTime time) -{ - time_t modtime=QFileInfo(*this).lastModified().toTime_t(); - //protect to wrong actime - if(modtime<0) - modtime=0; - time_t actime=time.toTime_t(); - if(actime<0) - { - setErrorString(tr("Last access date is wrong")); - return false; - } - #ifdef Q_CC_GNU - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - int returnVal=utime(this->fileName().toLocal8Bit().data(),&butime); - if(returnVal==0) - return true; - else - { - setErrorString(strerror(errno)); - return false; - } - #else - setErrorString(tr("Not supported on this platform")); - return false; - #endif -} - diff --git a/plugins-alternative/CopyEngine/Rsync/AvancedQFile.h b/plugins-alternative/CopyEngine/Rsync/AvancedQFile.h deleted file mode 100644 index 284cf02..0000000 --- a/plugins-alternative/CopyEngine/Rsync/AvancedQFile.h +++ /dev/null @@ -1,32 +0,0 @@ -/** \file AvancedQFile.h -\brief Define the QFile herited class to set file date/time -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef AVANCEDQFILE_H -#define AVANCEDQFILE_H - -#include -#include -#include - -/// \brief devired class from QFile to set time/date on file -class AvancedQFile : public QFile -{ - Q_OBJECT -public: - /// \brief set created date, not exists in unix world - bool setCreated(QDateTime time); - /// \brief set last modification date - bool setLastModified(QDateTime time); - /// \brief set last read date - bool setLastRead(QDateTime time); - -/* //fileName - void close(); - bool open ( FILE * fh, OpenMode mode ) - bool open ( int fd, OpenMode mode )*/ -}; - -#endif // AVANCEDQFILE_H diff --git a/plugins-alternative/CopyEngine/Rsync/CompilerInfo.h b/plugins-alternative/CopyEngine/Rsync/CompilerInfo.h deleted file mode 100644 index 84625b9..0000000 --- a/plugins-alternative/CopyEngine/Rsync/CompilerInfo.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../CompilerInfo.h" diff --git a/plugins-alternative/CopyEngine/Rsync/DebugEngineMacro.h b/plugins-alternative/CopyEngine/Rsync/DebugEngineMacro.h deleted file mode 100644 index ad08d4f..0000000 --- a/plugins-alternative/CopyEngine/Rsync/DebugEngineMacro.h +++ /dev/null @@ -1,25 +0,0 @@ -/** \file DebugEngineMacro.h -\brief Define the macro for the debug -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef DEBUGENGINEMACRO_H -#define DEBUGENGINEMACRO_H - -/// \brief Macro for the debug log -#ifdef ULTRACOPIER_PLUGIN_DEBUG - #if defined (__FILE__) && defined (__LINE__) - #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b,__FILE__,__LINE__) - #else - #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b) - #endif -#else // ULTRACOPIER_PLUGIN_DEBUG - #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() -#endif // ULTRACOPIER_PLUGIN_DEBUG - -#endif // DEBUGENGINEMACRO_H - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Environment.h b/plugins-alternative/CopyEngine/Rsync/Environment.h deleted file mode 100644 index 7ac6f16..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Environment.h +++ /dev/null @@ -1,12 +0,0 @@ -/** \file Environment.h -\brief Define the environment variable and global function -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include "Variable.h" -/// \brief The global include -#include "StructEnumDefinition.h" -#include "StructEnumDefinition_CopyEngine.h" -#include "DebugEngineMacro.h" -#include "CompilerInfo.h" diff --git a/plugins-alternative/CopyEngine/Rsync/FilterRules.cpp b/plugins-alternative/CopyEngine/Rsync/FilterRules.cpp deleted file mode 100644 index 0e6ba25..0000000 --- a/plugins-alternative/CopyEngine/Rsync/FilterRules.cpp +++ /dev/null @@ -1,193 +0,0 @@ -#include "FilterRules.h" -#include "ui_FilterRules.h" - -#include - -FilterRules::FilterRules(QWidget *parent) : - QDialog(parent), - ui(new Ui::FilterRules) -{ - ui->setupUi(this); - updateChecking(); - haveBeenValided=false; -} - -FilterRules::~FilterRules() -{ - delete ui; -} - -bool FilterRules::getIsValid() -{ - return isValid && haveBeenValided; -} - -QString FilterRules::get_search_text() -{ - return ui->search->text(); -} - -SearchType FilterRules::get_search_type() -{ - switch(ui->search_type->currentIndex()) - { - case 0: - return SearchType_rawText; - case 1: - return SearchType_simpleRegex; - case 2: - return SearchType_perlRegex; - } - return SearchType_simpleRegex; -} - -ApplyOn FilterRules::get_apply_on() -{ - switch(ui->apply_on->currentIndex()) - { - case 0: - return ApplyOn_file; - case 1: - return ApplyOn_fileAndFolder; - case 2: - return ApplyOn_folder; - } - return ApplyOn_fileAndFolder; -} - -bool FilterRules::get_need_match_all() -{ - return ui->need_match_all->isChecked(); -} - -void FilterRules::set_search_text(QString search_text) -{ - ui->search->setText(search_text); -} - -void FilterRules::set_search_type(SearchType search_type) -{ - switch(search_type) - { - case SearchType_rawText: - ui->search_type->setCurrentIndex(0); - break; - case SearchType_simpleRegex: - ui->search_type->setCurrentIndex(1); - break; - case SearchType_perlRegex: - ui->search_type->setCurrentIndex(2); - break; - } -} - -void FilterRules::set_apply_on(ApplyOn apply_on) -{ - switch(apply_on) - { - case ApplyOn_file: - ui->apply_on->setCurrentIndex(0); - break; - case ApplyOn_fileAndFolder: - ui->apply_on->setCurrentIndex(1); - break; - case ApplyOn_folder: - ui->apply_on->setCurrentIndex(2); - break; - } -} - -void FilterRules::set_need_match_all(bool need_match_all) -{ - ui->need_match_all->setChecked(need_match_all); -} - -void FilterRules::on_search_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateChecking(); -} - -void FilterRules::updateChecking() -{ - QRegExp regex; - isValid=!ui->search->text().isEmpty(); - if(isValid) - { - QString tempString; - if(ui->search_type->currentIndex()==0) - { - tempString=QRegExp::escape(ui->search->text()); - if(tempString.contains('/') || tempString.contains('\\')) - isValid=false; - } - else if(ui->search_type->currentIndex()==1) - { - tempString=QRegExp::escape(ui->search->text()); - tempString.replace("\\*","[^\\\\/]*"); - } - else if(ui->search_type->currentIndex()==2) - { - tempString=ui->search->text(); - if(tempString.startsWith('^') && tempString.endsWith('$')) - { - ui->need_match_all->setChecked(true); - tempString.remove(QRegExp("^\\^")); - tempString.remove(QRegExp("\\$$")); - ui->search->setText(tempString); - } - } - if(isValid) - { - if(ui->need_match_all->isChecked()) - tempString="^"+tempString+"$"; - regex=QRegExp(tempString); - isValid=regex.isValid() && !regex.isEmpty(); - } - } - - ui->isValid->setChecked(isValid); - ui->testString->setEnabled(isValid); - ui->label_test_string->setEnabled(isValid); - ui->matched->setEnabled(isValid); - ui->matched->setChecked(isValid && ui->testString->text().contains(regex)); - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid); -} - -void FilterRules::on_isValid_clicked() -{ - updateChecking(); -} - -void FilterRules::on_testString_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateChecking(); -} - -void FilterRules::on_matched_clicked() -{ - updateChecking(); -} - -void FilterRules::on_search_type_currentIndexChanged(int index) -{ - Q_UNUSED(index); - updateChecking(); -} - -void FilterRules::on_need_match_all_clicked() -{ - updateChecking(); -} - -void FilterRules::on_buttonBox_clicked(QAbstractButton *button) -{ - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) - reject(); - else - { - haveBeenValided=true; - accept(); - } -} diff --git a/plugins-alternative/CopyEngine/Rsync/FilterRules.h b/plugins-alternative/CopyEngine/Rsync/FilterRules.h deleted file mode 100644 index f06f0cb..0000000 --- a/plugins-alternative/CopyEngine/Rsync/FilterRules.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef FILTERRULES_H -#define FILTERRULES_H - -#include -#include -#include - -#include "StructEnumDefinition_CopyEngine.h" - -namespace Ui { -class FilterRules; -} - -/** All the filter rules to include/exclude some file during the listing */ -class FilterRules : public QDialog -{ - Q_OBJECT - -public: - explicit FilterRules(QWidget *parent = 0); - ~FilterRules(); - bool getIsValid(); - QString get_search_text(); - SearchType get_search_type(); - ApplyOn get_apply_on(); - bool get_need_match_all(); - void set_search_text(QString search_text); - void set_search_type(SearchType search_type); - void set_apply_on(ApplyOn apply_on); - void set_need_match_all(bool need_match_all); -private slots: - void on_search_textChanged(const QString &arg1); - void on_isValid_clicked(); - void on_testString_textChanged(const QString &arg1); - void on_matched_clicked(); - void on_search_type_currentIndexChanged(int index); - void on_need_match_all_clicked(); - void on_buttonBox_clicked(QAbstractButton *button); -private: - Ui::FilterRules *ui; - void updateChecking(); - bool isValid; - bool haveBeenValided; -}; - -#endif // FILTERRULES_H diff --git a/plugins-alternative/CopyEngine/Rsync/FilterRules.ui b/plugins-alternative/CopyEngine/Rsync/FilterRules.ui deleted file mode 100644 index fad35cd..0000000 --- a/plugins-alternative/CopyEngine/Rsync/FilterRules.ui +++ /dev/null @@ -1,162 +0,0 @@ - - - FilterRules - - - Qt::WindowModal - - - - 0 - 0 - 289 - 231 - - - - Filters dialog - - - - :/resources/filter.png:/resources/filter.png - - - - 1 - - - 1 - - - - - Search: - - - - - - - - - - Search type: - - - - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - - - - Apply on: - - - - - - - - File - - - - - Folder - - - - - File and folder - - - - - - - - All string need match - - - - - - - Checking - - - - - - The regex is valid - - - - - - - Test string: - - - - - - - - - - The test string match with the regex - - - - - - - - - - - - Qt::Horizontal - - - - 68 - 20 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Filters.cpp b/plugins-alternative/CopyEngine/Rsync/Filters.cpp deleted file mode 100644 index ce87b52..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Filters.cpp +++ /dev/null @@ -1,456 +0,0 @@ -#include "Filters.h" -#include "ui_Filters.h" - -#include - -Filters::Filters(QWidget *parent) : - QDialog(parent), - ui(new Ui::Filters) -{ - ui->setupUi(this); -} - -Filters::~Filters() -{ - delete ui; -} - -void Filters::setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) -{ - if(includeStrings.size()!=includeOptions.size() || excludeStrings.size()!=excludeOptions.size()) - return; - Filters_rules new_item; - - include.clear(); - int index=0; - while(indexinclusion->clear(); - int index=0; - while(indexinclusion->addItem(new QListWidgetItem(entryShow)); - index++; - } - ui->exclusion->clear(); - index=0; - while(indexexclusion->addItem(new QListWidgetItem(entryShow)); - index++; - } -} - -QList Filters::getInclude() -{ - return include; -} - -QList Filters::getExclude() -{ - return exclude; -} - -void Filters::newLanguageLoaded() -{ - ui->retranslateUi(this); - reShowAll(); -} - -void Filters::haveNewFilters() -{ - QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; - int index=0; - while(indexexclusion->count()) - { - if(ui->exclusion->item(index)->isSelected()) - { - delete ui->exclusion->item(index); - exclude.removeAt(index); - removedEntry=true; - } - else - index++; - } - if(removedEntry) - { - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_remove_inclusion_clicked() -{ - bool removedEntry=false; - int index=0; - while(indexinclusion->count()) - { - if(ui->inclusion->item(index)->isSelected()) - { - delete ui->inclusion->item(index); - include.removeAt(index); - removedEntry=true; - } - else - index++; - } - if(removedEntry) - { - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_add_exclusion_clicked() -{ - FilterRules dialog(this); - dialog.exec(); - if(dialog.getIsValid()) - { - Filters_rules new_item; - new_item.apply_on=dialog.get_apply_on(); - new_item.need_match_all=dialog.get_need_match_all(); - new_item.search_text=dialog.get_search_text(); - new_item.search_type=dialog.get_search_type(); - exclude << new_item; - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_buttonBox_clicked(QAbstractButton *button) -{ - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) - reject(); -} - -void Filters::on_add_inclusion_clicked() -{ - FilterRules dialog(this); - dialog.exec(); - if(dialog.getIsValid()) - { - Filters_rules new_item; - new_item.apply_on=dialog.get_apply_on(); - new_item.need_match_all=dialog.get_need_match_all(); - new_item.search_text=dialog.get_search_text(); - new_item.search_type=dialog.get_search_type(); - if(convertToRegex(new_item)) - include << new_item; - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_edit_exclusion_clicked() -{ - bool editedEntry=false; - int index=0; - while(indexexclusion->count()) - { - if(ui->exclusion->item(index)->isSelected()) - { - FilterRules dialog(this); - dialog.set_apply_on(exclude[index].apply_on); - dialog.set_need_match_all(exclude[index].need_match_all); - dialog.set_search_text(exclude[index].search_text); - dialog.set_search_type(exclude[index].search_type); - dialog.exec(); - if(dialog.getIsValid()) - { - exclude[index].apply_on=dialog.get_apply_on(); - exclude[index].need_match_all=dialog.get_need_match_all(); - exclude[index].search_text=dialog.get_search_text(); - exclude[index].search_type=dialog.get_search_type(); - if(!convertToRegex(exclude[index])) - exclude.removeAt(index); - editedEntry=true; - } - } - index++; - } - if(editedEntry) - { - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_edit_inclusion_clicked() -{ - bool editedEntry=false; - int index=0; - while(indexinclusion->count()) - { - if(ui->inclusion->item(index)->isSelected()) - { - FilterRules dialog(this); - dialog.set_apply_on(exclude[index].apply_on); - dialog.set_need_match_all(exclude[index].need_match_all); - dialog.set_search_text(exclude[index].search_text); - dialog.set_search_type(exclude[index].search_type); - dialog.exec(); - if(dialog.getIsValid()) - { - exclude[index].apply_on=dialog.get_apply_on(); - exclude[index].need_match_all=dialog.get_need_match_all(); - exclude[index].search_text=dialog.get_search_text(); - exclude[index].search_type=dialog.get_search_type(); - if(!convertToRegex(exclude[index])) - exclude.removeAt(index); - editedEntry=true; - } - } - index++; - } - if(editedEntry) - { - reShowAll(); - haveNewFilters(); - } -} diff --git a/plugins-alternative/CopyEngine/Rsync/Filters.h b/plugins-alternative/CopyEngine/Rsync/Filters.h deleted file mode 100644 index dcdcb36..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Filters.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef FILTERS_H -#define FILTERS_H - -#include -#include - -#include "FilterRules.h" -#include "StructEnumDefinition_CopyEngine.h" - -namespace Ui { -class Filters; -} - -/** To add/edit one filter rules */ -class Filters : public QDialog -{ - Q_OBJECT -public: - explicit Filters(QWidget *parent = 0); - ~Filters(); - void setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void reShowAll(); - QList getInclude(); - QList getExclude(); - void newLanguageLoaded(); -private: - Ui::Filters *ui; - QList include; - QList exclude; - void haveNewFilters(); - bool convertToRegex(Filters_rules &item); -signals: - void sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); -private slots: - void on_remove_exclusion_clicked(); - void on_remove_inclusion_clicked(); - void on_add_exclusion_clicked(); - void on_buttonBox_clicked(QAbstractButton *button); - void on_add_inclusion_clicked(); - void on_edit_exclusion_clicked(); - void on_edit_inclusion_clicked(); -}; - -#endif // FILTERS_H diff --git a/plugins-alternative/CopyEngine/Rsync/Filters.ui b/plugins-alternative/CopyEngine/Rsync/Filters.ui deleted file mode 100644 index db8577c..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Filters.ui +++ /dev/null @@ -1,194 +0,0 @@ - - - Filters - - - - 0 - 0 - 507 - 502 - - - - Filters - - - - :/resources/filter.png:/resources/filter.png - - - - 1 - - - 1 - - - - - Exclusion filter - - - - 1 - - - 2 - - - - - QAbstractItemView::MultiSelection - - - - - - - - - - :/resources/add.png:/resources/add.png - - - - - - - - :/resources/edit.png:/resources/edit.png - - - - - - - - :/resources/remove.png:/resources/remove.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - Inclusion filter - - - - 1 - - - 2 - - - - - None = Include all - - - - - - - - - QAbstractItemView::MultiSelection - - - - - - - - - - :/resources/add.png:/resources/add.png - - - - - - - - :/resources/edit.png:/resources/edit.png - - - - - - - - :/resources/remove.png:/resources/remove.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QDialogButtonBox::Cancel - - - - - - - - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/ar/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/ar/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/ar/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/de/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/de/translation.ts deleted file mode 100644 index 1370c9a..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/de/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Auf dieser Plattform nicht unterstützt - - - - Last modified date is wrong - Datum der letzten Änderung ist falsch - - - - Last access date is wrong - Datum des letzten Zugriffs ist falsch - - - - Factory - - - - Options error - Optionen Fehler - - - - - Options engine is not loaded, can't access to the filters - Optionen Motor nicht geladen wird, kann nicht auf die Filter zu übersetzen - - - - FilterRules - - - Search: - Suche: - - - - Search type: - Suche Typ: - - - - Raw text - Roh text - - - - Simplified regex - Vereinfachte regex - - - - Perl's regex - Perl's regex - - - - Apply on: - Anwenden auf: - - - - File - Datei - - - - Folder - Ordner - - - - File and folder - Datei-und Ordnernamen - - - - All string need match - Alle Saite muss passen - - - - Checking - Überprüfung - - - - Test string: - Test-String: - - - - Filters dialog - Filters dialog - - - - The regex is valid - Die Regex ist gültig - - - - The test string match with the regex - Der Test-String Match mit dem regex - - - - Filters - - - Filters - Filter - - - - Exclusion filter - Ausschluss-Filter - - - - Inclusion filter - Einbeziehungsfilter - - - - None = Include all - None = Schließt alle - - - - - Raw text - Roh text - - - - - Simplified regex - Vereinfachte regex - - - - - Perl's regex - Perl's regex - - - - - Only on file - Nur auf Datei - - - - - Only on folder - Nur auf Ordner - - - - - - - Full match - Spielaufzeichnung - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Kann nicht tun, verschieben oder kopieren Artikel in den falschen gezwungen Modus: %1 - - - - Unable to save the transfer list: %1 - Unfähig, die Transferliste sparen: %1 - - - - Problem at the reading, or file size is null - Problem an der Lektüre, der Oder Dateigröße IST Null - - - - Wrong header: "%1" - Falsche Header: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - Die Transferliste ist im gemischten Modus, aber diese Instanz ist in diesem Modus nicht - - - - The transfer list is in copy mode, but this instance is not in this mode - Die Transferliste ist im Copy-Mode, aber dieser Fall ist in diesem Modus nicht - - - - The transfer list is in move mode, but this instance is not in this mode - Die Transferliste ist in Verschiebe-Modus, aber diese Instanz ist in diesem Modus nicht - - - - Some error have been found during the line parsing - Einige Fehler wurden während des Parsing gefunden - - - - Unable to open the transfer list: %1 - Unfähig, die Transferliste geöffnet: %1 - - - - MkPath - - - Unable to create the folder - Der Ordner kann nicht erstellt - - - - ReadThread - - - - Unable to read the source file: - Unfähig, die Quelldatei zu lesen: - - - - - File truncated during the read, possible data change - Datei während der Lese, möglich Datenänderung abgeschnitten - - - - RenamingRules - - - First renaming - erste Umbenennung - - - - %name% - copy - %name% should not be translated - %name% - kopieren - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>Variablen: <span style=" font-weight:600;">%name%</span> für den ursprünglichen Dateinamen</p></body></html> - - - - Second renaming - zweite Umbenennung - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - kopieren (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>Variablen: <span style=" font-weight:600;">%name%</span> für den ursprünglichen Dateinamen</p><p><span style=" font-weight:600;">%number%</span> für die zusätzliche Zahl</p></body></html> - - - - - %1 - copy - %1 - kopieren - - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - Renaming rules - Umbenennen von Regeln - - - - RmPath - - - - Unable to remove the folder - Der Ordner kann nicht entfernen - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - The checksums not match - Die Prüfsummen nicht überein - - - - WriteThread - - - Unable to read the source file: - Unfähig, die Quelldatei zu lesen: - - - - File truncated during the read, possible data change - Datei während der Lese, möglich Datenänderung abgeschnitten - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Der Motor wird gezwungen sich zu bewegen, können Sie mit ihr nicht zu kopieren - - - - - The engine is forced to copy, you can't move with it - Der Motor ist gezwungen, zu kopieren, können Sie nicht mit ihm bewegen - - - - The mode have been forced previously, it's internal error, please report it - Der Modus wurden vorher gezwungen, es interner Fehler ist, melden Sie dies bitte - - - - Options error - Optionen Fehler - - - - Options engine is not loaded, can't access to the filters - Optionen Motor nicht geladen wird, kann nicht auf die Filter zu übersetzen - - - - fileErrorDialog - - - Error on file - Fehler bei der Datei - - - - Error - Fehler - - - - Size - Größe - - - - Modified - Geändert - - - - File name - Dateiname - - - - &Always do this action - Immer diese Aktion - - - - Put to bottom - Legen Sie nach unten - - - - Retry - Wiederholen - - - - &Skip - überspringen - - - - &Cancel - Stornieren - - - - Error on folder - Fehler auf Ordner - - - - Folder name - Ordnername - - - - fileExistsDialog - - - The file exists - Die Datei existiert - - - - Source - Quelle - - - - Destination - Ziel - - - - - Size - Größe - - - - - Modified - Geändert - - - - - File name - Dateiname - - - - Suggest new &name - Schlagen neuen Namen - - - - &Always do this action - Immer diese Aktion - - - - &Rename - Umbenennen - - - - &Overwrite - überschreiben - - - - &Skip - überspringen - - - - &Cancel - Stornieren - - - - Overwrite if newer - Überschreiben, wenn neuere - - - - Overwrite if not same modification date - Überschreiben, wenn nicht gleiche Änderungsdatum - - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - fileIsSameDialog - - - This files are the same file - Diese Dateien sind die gleiche Datei - - - - The source and destination is same - Die Quelle und das Ziel ist dasselbe - - - - Size - Größe - - - - Modified - Geändert - - - - File name - Dateiname - - - - Suggest new &name - Schlagen neuen Namen - - - - &Always do this action - Immer diese Aktion - - - - &Rename - Umbenennen - - - - &Skip - überspringen - - - - &Cancel - Stornieren - - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - folderExistsDialog - - - This folders are the same folder - Diese Ordner sind die gleichen Ordner - - - - Source - Quelle - - - - Destination - Ziel - - - - The source and destination is same - Die Quelle und das Ziel ist dasselbe - - - - - Modified - Geändert - - - - - Folder name - Ordnername - - - - Suggest new &name - Schlagen neuen Namen - - - - &Always do this action - Immer diese Aktion - - - - &Rename - Umbenennen - - - - Merge - Fusionieren - - - - Skip - überspringen - - - - &Cancel - Stornieren - - - - Folder already exists - Ordner bereits vorhanden ist - - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - options - - - Transfer the file rights - Übertragen Sie die Datei Rechte - - - - Keep the file date - Halten Sie das Datei-Datum - - - - Block size - Blockgröße - - - - - KB - KB - - - - Auto start the transfer - Auto starten Sie die Übertragung - - - - When folder error - Wenn Ordner Fehler - - - - - Ask - Fragen - - - - - Skip - überspringen - - - - Merge - Fusionieren - - - - Rename - Umbenennen - - - - Check if destination folder exists - Prüfen Sie, ob Zielordner vorhanden ist - - - - Rsync (only in copy mode) - - - - - When folder collision - Wenn Ordner Kollision - - - - Checksum - Checksum - - - - Only after error - Erst nach dem Fehler - - - - Ignore if impossible - Ignorieren, wenn nicht - - - - Do checksum - Haben checksum - - - - Enable OS buffer - Aktivieren Sie OS-Puffer - - - - Filters - Filter - - - - Renaming rules - Umbenennen von Regeln - - - - OS buffer only if smaller than - OS-Puffer, wenn kleiner als - - - - scanFileOrFolder - - - - %1 - copy - %1 - kopieren - - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - The folder not exists - Der Ordner existiert nicht - - - - The folder is not readable - Der Ordner ist nicht lesbar - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/el/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/el/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/el/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/es/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/es/translation.ts deleted file mode 100644 index 8e00156..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/es/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - No es compatible con esta plataforma - - - - Last modified date is wrong - Fecha de última modificación es incorrecto - - - - Last access date is wrong - Fecha de último acceso es incorrecto - - - - Factory - - - - Options error - Error de opciones - - - - - Options engine is not loaded, can't access to the filters - Opciones del motor no está cargado, no se puede acceder a los filtros - - - - FilterRules - - - Search: - Buscar: - - - - Search type: - Tipo de búsqueda: - - - - Raw text - texto Fuente - - - - Simplified regex - Regex simplificado - - - - Perl's regex - Perl's regex - - - - Apply on: - Aplicar sobre: - - - - File - Archivos - - - - Folder - Carpeta - - - - File and folder - Archivos y carpeta - - - - All string need match - Todas las líneas tiene por qué coincidir - - - - Checking - Verification - - - - Test string: - Prueba de la cuerda: - - - - Filters dialog - Filtros de diálogo - - - - The regex is valid - La expresión regular es válido - - - - The test string match with the regex - La coincidencia con la cadena de prueba con la expresión regular - - - - Filters - - - Filters - Filtros - - - - Exclusion filter - Exclusión filtro - - - - Inclusion filter - La inclusión del filtro - - - - None = Include all - Ninguno = Incluya todos los - - - - - Raw text - texto Fuente - - - - - Simplified regex - Simplificado regex - - - - - Perl's regex - Perl's regex - - - - - Only on file - Sólo en el archivo - - - - - Only on folder - Sólo en la carpeta - - - - - - - Full match - Partido completo - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - No se puede hacer para mover o copiar elemento en modo incorrecto obligado: %1 - - - - Unable to save the transfer list: %1 - No se puede guardar la lista de transferencias: %1 - - - - Problem at the reading, or file size is null - Problema en la lectura, o el tamaño del archivo es nulo - - - - Wrong header: "%1" - Encabezado incorrecto: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - La lista de transferencia está en modo mixto, pero este caso no es de este modo - - - - The transfer list is in copy mode, but this instance is not in this mode - La lista de transferencia está en el modo de copia, pero esta instancia no está en este modo - - - - The transfer list is in move mode, but this instance is not in this mode - La lista de transferencia es el modo de desplazamiento, pero esta instancia no está en este modo - - - - Some error have been found during the line parsing - Algunos errores han sido encontrados durante el análisis de línea - - - - Unable to open the transfer list: %1 - No se puede abrir la lista de transferencias: %1 - - - - MkPath - - - Unable to create the folder - No se puede crear la carpeta - - - - ReadThread - - - - Unable to read the source file: - No se puede leer el archivo de origen: - - - - - File truncated during the read, possible data change - Archivo truncada durante el cambio de lectura, los datos posibles - - - - RenamingRules - - - First renaming - En primer lugar el cambio de nombre - - - - %name% - copy - %name% should not be translated - %name% - copia - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> para el nombre del archivo original</p></body></html> - - - - Second renaming - En segundo lugar el cambio de nombre - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - copia (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> para el nombre del archivo original</p><p><span style=" font-weight:600;">%number%</span> para el número adicional</p></body></html> - - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - Renaming rules - Reglas de Cambio de nombre - - - - RmPath - - - - Unable to remove the folder - No se puede eliminar la carpeta - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The checksums not match - Las sumas de comprobación no coincide - - - - WriteThread - - - Unable to read the source file: - No se puede leer el archivo de origen: - - - - File truncated during the read, possible data change - Archivo truncada durante el cambio de lectura, los datos posibles - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - El motor se ve obligado a moverse, no se puede copiar con ella - - - - - The engine is forced to copy, you can't move with it - El motor se ve obligado a copiar, no te puedes mover con él - - - - The mode have been forced previously, it's internal error, please report it - El modo se han visto obligados con anterioridad, es un error interno, por favor repórtelo - - - - Options error - Opciones de error - - - - Options engine is not loaded, can't access to the filters - Opciones del motor no está cargado, no se puede acceder a los filtros - - - - fileErrorDialog - - - Error on file - Error en el archivo - - - - Error - Error - - - - Size - Tamaño - - - - Modified - Modificado - - - - File name - Nombre de archivo - - - - &Always do this action - Siempre hacer esta acción - - - - Put to bottom - Ponga a abajo - - - - Retry - Reintentar - - - - &Skip - Omitir - - - - &Cancel - Cancelar - - - - Error on folder - Error en la carpeta - - - - Folder name - Nombre de la carpeta - - - - fileExistsDialog - - - The file exists - El archivo ya existe - - - - Source - Fuente - - - - Destination - Destino - - - - - Size - Tamaño - - - - - Modified - Modificado - - - - - File name - Nombre de archivo - - - - Suggest new &name - Sugerir nuevo nombre - - - - &Always do this action - Siempre hacer esta acción - - - - &Rename - Cambiar el nombre - - - - &Overwrite - Sobrescribir - - - - &Skip - Omitir - - - - &Cancel - Cancelar - - - - Overwrite if newer - Sobrescribir si nuevo - - - - Overwrite if not same modification date - Sobrescribir si no es misma fecha de modificación - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - fileIsSameDialog - - - This files are the same file - Estos archivos son el mismo archivo - - - - The source and destination is same - La fuente y el destino es el mismo - - - - Size - Tamaño - - - - Modified - Modificado - - - - File name - Nombre de archivo - - - - Suggest new &name - Sugerir nuevo nombre - - - - &Always do this action - Siempre hacer esta acción - - - - &Rename - Cambiar el nombre - - - - &Skip - Omitir - - - - &Cancel - Cancelar - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - folderExistsDialog - - - This folders are the same folder - Esta carpeta es la misma carpeta - - - - Source - Fuente - - - - Destination - Destino - - - - The source and destination is same - La fuente y el destino es el mismo - - - - - Modified - Modificado - - - - - Folder name - Nombre de la carpeta - - - - Suggest new &name - Sugerir nuevo nombre - - - - &Always do this action - Siempre hacer esta acción - - - - &Rename - Cambiar el nombre - - - - Merge - Unir - - - - Skip - Omitir - - - - &Cancel - Cancelar - - - - Folder already exists - Carpeta ya existe - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - options - - - Transfer the file rights - Transferencia de los derechos de archivo - - - - Keep the file date - Mantener la fecha de archivo - - - - Block size - Tamaño del bloque - - - - - KB - KB - - - - Auto start the transfer - Auto iniciar la transferencia - - - - When folder error - Cuando el error carpeta - - - - - Ask - Pedir - - - - - Skip - Omitir - - - - Merge - Unir - - - - Rename - Cambiar el nombre - - - - Check if destination folder exists - Compruebe si existe la carpeta de destino - - - - Rsync (only in copy mode) - - - - - When folder collision - Cuando la colisión carpeta - - - - Checksum - Suma de comprobación - - - - Only after error - Sólo después de un error - - - - Ignore if impossible - No haga caso si no es posible - - - - Do checksum - Hacer suma de comprobación - - - - Enable OS buffer - Habilitar el OS de amortiguación - - - - Filters - Filtros - - - - Renaming rules - Reglas de Cambio de nombre - - - - OS buffer only if smaller than - OS de amortiguación sólo si menor que - - - - scanFileOrFolder - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The folder not exists - La carpeta no existe - - - - The folder is not readable - La carpeta no se puede leer - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/fr/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/fr/translation.ts deleted file mode 100644 index 92d565c..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/fr/translation.ts +++ /dev/null @@ -1,810 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Non supporté sur cette plateforme - - - - Last modified date is wrong - Date de dernière modification du fichier fausse - - - - Last access date is wrong - Date du dernier accès au fichier fausse - - - - Factory - - - - Options error - Erreur d'options - - - - - Options engine is not loaded, can't access to the filters - Moteur d'options non chargé, impossible d'accédrer aux filtres - - - - FilterRules - - - Search: - Recherche: - - - - Search type: - Type de recherche: - - - - Raw text - Texte brute - - - - Simplified regex - Regex simplifié - - - - Perl's regex - Regex perl - - - - Apply on: - Appliquer sur: - - - - File - Fichier - - - - Folder - Dossier - - - - File and folder - Fichier et dossier - - - - All string need match - Toute la chaine doit correspondre - - - - Checking - Vérification - - - - Test string: - Chaine de teste: - - - - Filters dialog - Dialogue des filtres - - - - The regex is valid - La regex est valid - - - - The test string match with the regex - La chaine de teste corresponds avec la regex - - - - Filters - - - Filters - Filtres - - - - Exclusion filter - Filtre d'exclusion - - - - Inclusion filter - Filtre d'inclusion - - - - None = Include all - Aucun = tout inclure - - - - - Raw text - Texte brute - - - - - Simplified regex - Regex simplifié - - - - - Perl's regex - Regex perl - - - - - Only on file - Appliquer sur fichier - - - - - Only on folder - Appliquer sur dossier - - - - - - - Full match - Correspondance totale - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Impossible de faire un déplacement ou une copie dans le mauvais mode forcé: %1 - - - - Unable to save the transfer list: %1 - Impossible de sauvegarde la liste de transfer: %1 - - - - Problem at the reading, or file size is null - Probléme à la lecture, ou fichier de taille nulle - - - - Wrong header: "%1" - Mauvaise en-tête: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - La list de transfer est en mode mixte, mais l'instance n'est pas dans ce mode - - - - The transfer list is in copy mode, but this instance is not in this mode - La list de transfer est en mode copie, mais l'instance n'est pas dans ce mode - - - - The transfer list is in move mode, but this instance is not in this mode - La list de transfer est en mode déplacement, mais l'instance n'est pas dans ce mode - - - - Some error have been found during the line parsing - Quelque erreur ont été trouvé durrant l'analise des lignes - - - - Unable to open the transfer list: %1 - Impossible d'ouvrir la list de transfer: %1 - - - - MkPath - - - Unable to create the folder - Impossible de créer le répertoire - - - - ReadThread - - - - Unable to read the source file: - Impossible de lire le fichier source: - - - - - File truncated during the read, possible data change - Fichier diminué durrant la lecture, possible changement de données - - - - RenamingRules - - - First renaming - Premier renommage - - - - %name% - copy - %name% should not be translated - variables need never be translated - %name% - copie - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - variables need never be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> pour le nom originel</p></body></html> - - - - Second renaming - Seconds renommage - - - - %name% - copy (%number%) - %name%, %number% should not be translated - variables need never be translated - %name% - copie (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - variables need never be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> pour le nom originel</p><p><span style=" font-weight:600;">%number%</span> pour le nombre extra</p></body></html> - - - - - %1 - copy - %1 - copie - - - - - %1 - copy (%2) - %1 - copie (%2) - - - - Renaming rules - Régles de renommage - - - - RmPath - - - - Unable to remove the folder - Impossible de supprimer le répertoire - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - The checksums not match - Les checksums ne correspondent pas - - - - WriteThread - - - Unable to read the source file: - Impossible de lire le fichier source: - - - - File truncated during the read, possible data change - Fichier diminué durrant la lecture, possible changement de données - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Le moteur est forcé en déplacement, vous ne pouvez pas copier avec - - - - - The engine is forced to copy, you can't move with it - Le moteur est forcé en copie, vous ne pouvez pas déplacer avec - - - - The mode have been forced previously, it's internal error, please report it - Le mode as été forcé précédement, c'est une erreur interne, merci de le repporter - - - - Options error - Erreur d'options - - - - Options engine is not loaded, can't access to the filters - Moteur d'options non chargé, impossible d'accédrer aux filtres - - - - fileErrorDialog - - - Error on file - Erreur sur le fichier - - - - Error - Erreur - - - - Size - Taille - - - - Modified - Modifié - - - - File name - Nom de fichier - - - - &Always do this action - &Toujours effectuer cette action - - - - Put to bottom - Mettre à la fin - - - - Retry - Réessayer - - - - &Skip - &Passer - - - - &Cancel - &Annuler - - - - Error on folder - Erreur sur un dossier - - - - Folder name - Nom de répertoire - - - - fileExistsDialog - - - The file exists - Le fichier existe - - - - Source - Source - - - - Destination - Destination - - - - - Size - Taille - - - - - Modified - Modifié - - - - - File name - Nom de fichier - - - - Suggest new &name - Suggérer un &nouveau nom - - - - &Always do this action - &Toujours effectuer cette action - - - - &Rename - &Renommer - - - - &Overwrite - &Ecraser - - - - &Skip - &Passer - - - - &Cancel - &Annuler - - - - Overwrite if newer - Ecraser si plus récent - - - - Overwrite if not same modification date - Ecraser si la date de modification est différente - - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - fileIsSameDialog - - - This files are the same file - Ces fichiers sont identiques - - - - The source and destination is same - La source et la destination sont identiques - - - - Size - Taille - - - - Modified - Modifié - - - - File name - Nom de fichier - - - - Suggest new &name - Suggérer un &nouveau nom - - - - &Always do this action - &Toujours effectuer cette action - - - - &Rename - &Renommer - - - - &Skip - &Passer - - - - &Cancel - &Annuler - - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - folderExistsDialog - - - This folders are the same folder - Les répertoires sont identiques - - - - Source - Source - - - - Destination - Destination - - - - The source and destination is same - La source et la destination sont identiques - - - - - Modified - Modifié - - - - - Folder name - Nom de répertoire - - - - Suggest new &name - Suggérer un &nouveau nom - - - - &Always do this action - &Toujours effectuer cette action - - - - &Rename - &Renommer - - - - Merge - Fusionner - - - - Skip - Passer - - - - &Cancel - &Annuler - - - - Folder already exists - Dossier déjà existant - - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - options - - - Transfer the file rights - Transférer les droits des fichiers - - - - Keep the file date - Garder la date du fichier - - - - When folder error - En cas d'erreur de répertoire - - - - - Ask - Demander - - - - - Skip - Passer - - - - Merge - Fusionner - - - - Rename - Renommer - - - - Check if destination folder exists - Vérifier si le répertoire de destination existe - - - - Block size - Taille de block - - - - - KB - Ko - - - - Auto start the transfer - Démmarer automatiquement le transfert - - - - When folder collision - Lors d'une collision de dossier - - - - Checksum - Checksum - - - - Only after error - Seulement après erreur - - - - Ignore if impossible - Ignorer si impossible - - - - Do checksum - Faire un checksum - - - - Enable OS buffer - Activer le buffer de l'OS - - - - Filters - Filtres - - - - Renaming rules - Régles de renommage - - - - Rsync (only in copy mode) - - - - - OS buffer only if smaller than - Buffer de l'OS seulement si plus petit que - - - - scanFileOrFolder - - - - %1 - copy - %1 - copie - - - - - %1 - copy (%2) - %1 - copie (%2) - - - - The folder not exists - Le répertoire n'existe pas - - - - The folder is not readable - Le répertoire n'est pas lisible - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/hi/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/hi/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/hi/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/id/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/id/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/id/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/it/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/it/translation.ts deleted file mode 100644 index 16adaed..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/it/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Non supportato su questa piattaforma - - - - Last modified date is wrong - Ultima modifica è sbagliato - - - - Last access date is wrong - Ultima data di accesso è sbagliato - - - - Factory - - - - Options error - opzioni di errore - - - - - Options engine is not loaded, can't access to the filters - Opzioni del motore non viene caricato, non possono accedere ai filtri - - - - FilterRules - - - Search: - Cerca: - - - - Search type: - Tipo di ricerca: - - - - Raw text - testo Raw - - - - Simplified regex - semplificato regex - - - - Perl's regex - Perl's regex - - - - Apply on: - Applicare su: - - - - File - File - - - - Folder - Cartella - - - - File and folder - File e cartelle - - - - All string need match - Tutti stringa bisogno di corrispondere - - - - Checking - Verifica - - - - Test string: - Test stringa: - - - - Filters dialog - Filtri di dialogo - - - - The regex is valid - La regex è valido - - - - The test string match with the regex - La stringa di test match con la regex - - - - Filters - - - Filters - Filtri - - - - Exclusion filter - Esclusione filtro - - - - Inclusion filter - inclusione filtro - - - - None = Include all - Nessuno = Includi tutte le - - - - - Raw text - testo Raw - - - - - Simplified regex - semplificato regex - - - - - Perl's regex - Perl's regex - - - - - Only on file - Solo su file - - - - - Only on folder - Solo sulla cartella - - - - - - - Full match - partita completa - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Impossibile fare per spostare o copiare elemento in male modo forzato: %1 - - - - Unable to save the transfer list: %1 - Impossibile salvare la lista dei trasferimenti: %1 - - - - Problem at the reading, or file size is null - Problema alla lettura, o la dimensione del file è nullo - - - - Wrong header: "%1" - Sbagliato intestazione: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - La lista di trasferimento è in modalità mista, ma questa istanza non è in questa modalità - - - - The transfer list is in copy mode, but this instance is not in this mode - La lista di trasferimento è in modalità di copia, ma questa istanza non è in questa modalità - - - - The transfer list is in move mode, but this instance is not in this mode - La lista di trasferimento è in modalità di spostamento, ma questa istanza non è in questa modalità - - - - Some error have been found during the line parsing - Alcuni errori sono stati trovati durante l'analisi linea - - - - Unable to open the transfer list: %1 - Impossibile aprire la lista di trasferimento: %1 - - - - MkPath - - - Unable to create the folder - Impossibile creare la cartella - - - - ReadThread - - - - Unable to read the source file: - Impossibile leggere il file sorgente: - - - - - File truncated during the read, possible data change - File troncato durante la lettura, i possibili cambiamenti di dati - - - - RenamingRules - - - First renaming - Prima ridenominazione - - - - %name% - copy - %name% should not be translated - %name% - copia - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>variabili: <span style=" font-weight:600;">%name%</span> per il nome del file originale</p></body></html> - - - - Second renaming - Secondo ridenominazione - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - copia (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>variabili: <span style=" font-weight:600;">%name%</span> per il nome del file originale</p><p><span style=" font-weight:600;">%number%</span> per il numero aggiuntivo</p></body></html> - - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - Renaming rules - Rinominare le regole - - - - RmPath - - - - Unable to remove the folder - Impossibile rimuovere la cartella - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The checksums not match - Il checksum non corrisponde - - - - WriteThread - - - Unable to read the source file: - Impossibile leggere il file sorgente: - - - - File truncated during the read, possible data change - File troncato durante la lettura, i possibili cambiamenti di dati - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Il motore è costretto a muoversi, non è possibile copiare con esso - - - - - The engine is forced to copy, you can't move with it - Il motore è costretto a copiare, non è possibile spostare con esso - - - - The mode have been forced previously, it's internal error, please report it - La modalità sono stati costretti in precedenza, è un errore interno, si prega di segnalarlo - - - - Options error - opzioni di errore - - - - Options engine is not loaded, can't access to the filters - Opzioni del motore non viene caricato, non possono accedere ai filtri - - - - fileErrorDialog - - - Error on file - Errore su file - - - - Error - Errore - - - - Size - Dimensione - - - - Modified - Modificato - - - - File name - Nome file - - - - &Always do this action - Eseguire sempre questa azione - - - - Put to bottom - Mettere a fondo - - - - Retry - Riprova - - - - &Skip - Saltare - - - - &Cancel - Annullare - - - - Error on folder - Errore cartella - - - - Folder name - Nome della cartella - - - - fileExistsDialog - - - The file exists - Il file esiste - - - - Source - Fonte - - - - Destination - Destinazione - - - - - Size - Dimensione - - - - - Modified - Modificato - - - - - File name - Nome file - - - - Suggest new &name - Suggerisci nuovo nome - - - - &Always do this action - Eseguire sempre questa azione - - - - &Rename - Rinominare - - - - &Overwrite - Sovrascrivi - - - - &Skip - Saltare - - - - &Cancel - Annullare - - - - Overwrite if newer - Sovrascrivi se più recente - - - - Overwrite if not same modification date - Sovrascrivi se non la data di modifica stessa - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - fileIsSameDialog - - - This files are the same file - Questi file sono lo stesso file - - - - The source and destination is same - La sorgente e destinazione è uguale - - - - Size - Dimensione - - - - Modified - Modificato - - - - File name - Nome file - - - - Suggest new &name - Suggerisci nuovo nome - - - - &Always do this action - Eseguire sempre questa azione - - - - &Rename - Rinominare - - - - &Skip - Saltare - - - - &Cancel - Annullare - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - folderExistsDialog - - - This folders are the same folder - Questo cartelle sono nella stessa cartella - - - - Source - Fonte - - - - Destination - Destinazione - - - - The source and destination is same - La sorgente e destinazione è uguale - - - - - Modified - Modificato - - - - - Folder name - Nome della cartella - - - - Suggest new &name - Suggerisci nuovo nome - - - - &Always do this action - Eseguire sempre questa azione - - - - &Rename - Rinominare - - - - Merge - Unire - - - - Skip - Saltare - - - - &Cancel - Annullare - - - - Folder already exists - Cartella esiste già - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - options - - - Transfer the file rights - Trasferire i diritti di file - - - - Keep the file date - Tenere la data del file - - - - Block size - Dimensione del blocco - - - - - KB - - - - - Auto start the transfer - Auto iniziare il trasferimento - - - - When folder error - Quando errore cartella - - - - - Ask - Chiedere - - - - - Skip - Saltare - - - - Merge - Unire - - - - Rename - Rinominare - - - - Check if destination folder exists - Controllare se la cartella di destinazione esiste - - - - Rsync (only in copy mode) - - - - - When folder collision - Quando collisione cartella - - - - Checksum - - - - - Only after error - Solo dopo l'errore - - - - Ignore if impossible - Ignora se impossibile - - - - Do checksum - Fare checksum - - - - Enable OS buffer - Abilita OS tampone - - - - Filters - Filtri - - - - Renaming rules - Rinominare le regole - - - - OS buffer only if smaller than - OS tampone solo se inferiori - - - - scanFileOrFolder - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The folder not exists - La cartella non esiste - - - - The folder is not readable - La cartella non è leggibile - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/ja/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/ja/translation.ts deleted file mode 100644 index 9c2e5d6..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/ja/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Filters dialog - - - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - The regex is valid - - - - - Test string: - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - Renaming rules - - - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - OS buffer only if smaller than - - - - - Block size - - - - - Filters - - - - - Renaming rules - - - - - Rsync (only in copy mode) - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/ko/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/ko/translation.ts deleted file mode 100644 index 4cbf604..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/ko/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - 이 플랫폼에서 지원되지 않습니다 - - - - Last modified date is wrong - 마지막 수정 날짜가 잘못되었습니다 - - - - Last access date is wrong - 마지막 엑세스 날짜가 잘못되었습니다 - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Filters dialog - - - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - The regex is valid - - - - - Test string: - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - 폴더를 생성할 수 없습니다 - - - - ReadThread - - - - Unable to read the source file: - 원본 파일 읽기 불가: - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - Renaming rules - - - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - RmPath - - - - Unable to remove the folder - 폴더를 제거할 수 없습니다 - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - 원본 파일 읽기 불가: - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - 파일 오류가 발생했습니다 - - - - Error - 오류 - - - - Size - 크기 - - - - Modified - 수정 날짜 - - - - File name - 파일 이름 - - - - &Always do this action - &항상 이 작동 실행 - - - - Put to bottom - 아래에 놓기 - - - - Retry - 재시도 - - - - &Skip - &건너뛰기 - - - - &Cancel - &취소 - - - - Error on folder - - - - - Folder name - 폴더 이름 - - - - fileExistsDialog - - - The file exists - 파일이 존재합니다 - - - - Source - 원본 - - - - Destination - 대상 - - - - - Size - 크기 - - - - - Modified - 수정 날짜 - - - - - File name - 파일 이름 - - - - Suggest new &name - 새 &이름 제안 - - - - &Always do this action - &항상 이 작동 실행 - - - - &Rename - &이름 바꾸기 - - - - &Overwrite - &덮어씌우기 - - - - &Skip - &건너뛰기 - - - - &Cancel - &취소 - - - - Overwrite if newer - 더 최신이면 덮어씌우기 - - - - Overwrite if not same modification date - 수정 날짜가 다르면 덮어씌우기 - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - 이 파일들은 동일한 파일입니다 - - - - The source and destination is same - 원본과 대상이 동일합니다 - - - - Size - 크기 - - - - Modified - 수정 날짜 - - - - File name - 파일 이름 - - - - Suggest new &name - 새 &이름 제안 - - - - &Always do this action - &항상 이 작동 실행 - - - - &Rename - &이름 바꾸기 - - - - &Skip - &건너뛰기 - - - - &Cancel - &취소 - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - 이 폴더들은 동일한 폴더입니다 - - - - Source - 원본 - - - - Destination - 대상 - - - - The source and destination is same - 원본과 대상이 동일합니다 - - - - - Modified - 수정 날짜 - - - - - Folder name - 폴더 이름 - - - - Suggest new &name - 새 &이름 제안 - - - - &Always do this action - &항상 이 작동 실행 - - - - &Rename - &이름 바꾸기 - - - - Merge - 합치기 - - - - Skip - 건너뛰기 - - - - &Cancel - &취소 - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - 파일 권한 전송 - - - - Keep the file date - 파일 날짜 보존 - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - OS buffer only if smaller than - - - - - Block size - 블럭 크기 - - - - Filters - - - - - Renaming rules - - - - - Rsync (only in copy mode) - - - - - - KB - KB - - - - Auto start the transfer - 전송 자동 시작 - - - - When folder error - 폴더 오류시 - - - - - Ask - 확인 - - - - - Skip - 건너뛰기 - - - - Merge - 합치기 - - - - Rename - 이름 바꾸기 - - - - Check if destination folder exists - 대상 폴드 존재시 확인 - - - - When folder collision - 폴더 충돌시 - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - 폴더가 존재하지 않습니다 - - - - The folder is not readable - 폴더를 읽을 수 없습니다 - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/nl/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/nl/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/nl/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/no/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/no/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/no/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/pl/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/pl/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/pl/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/pt/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/pt/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/pt/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/ru/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/ru/translation.ts deleted file mode 100644 index cbafed3..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/ru/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Не поддерживается на этой платформе - - - - Last modified date is wrong - Дата обновления неправильно - - - - Last access date is wrong - Дата последнего доступа не так - - - - Factory - - - - Options error - Опции ошибке - - - - - Options engine is not loaded, can't access to the filters - Параметры двигателя не загружается, не может получить доступ к фильтрам - - - - FilterRules - - - Search: - Поиск по сайту: - - - - Search type: - Тип поиска: - - - - Raw text - Сырой текст - - - - Simplified regex - упрощенный regex - - - - Perl's regex - Perl's regex - - - - Apply on: - Нанесите на: - - - - File - файл - - - - Folder - папка - - - - File and folder - Файлов и папок - - - - All string need match - Все строки нужно соответствовать - - - - Checking - контроль - - - - Test string: - Испытание строки: - - - - Filters dialog - Фильтры диалогового - - - - The regex is valid - Регулярное действует - - - - The test string match with the regex - Матч тестовую строку с регулярным выражением - - - - Filters - - - Filters - Фильтры - - - - Exclusion filter - Исключение фильтра - - - - Inclusion filter - Включение фильтра - - - - None = Include all - Ни = Включить все - - - - - Raw text - Сырой текст - - - - - Simplified regex - Упрощенная регулярных выражений - - - - - Perl's regex - Perl's regex - - - - - Only on file - Только на файл - - - - - Only on folder - Только на папку - - - - - - - Full match - Полный матч - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Невозможно сделать, чтобы скопировать или переместить элемент в неправильном форсированном режиме: %1 - - - - Unable to save the transfer list: %1 - Невозможно сохранить трансфер: %1 - - - - Problem at the reading, or file size is null - Проблема при чтении или размер файла нулевой - - - - Wrong header: "%1" - Неправильный заголовок: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - Трансфер в смешанном режиме, но этот экземпляр не в этом режиме - - - - The transfer list is in copy mode, but this instance is not in this mode - Передача списка в режиме копирования, но этот экземпляр не в этом режиме - - - - The transfer list is in move mode, but this instance is not in this mode - Трансфер в режим перемещения, но этот экземпляр не в этом режиме - - - - Some error have been found during the line parsing - Некоторые ошибки были обнаружены в ходе разбора линия - - - - Unable to open the transfer list: %1 - Не удается открыть трансфер: %1 - - - - MkPath - - - Unable to create the folder - Невозможно создать папку - - - - ReadThread - - - - Unable to read the source file: - Невозможно прочитать исходный файл: - - - - - File truncated during the read, possible data change - Файл усечены во время чтения, возможность изменения данных - - - - RenamingRules - - - First renaming - Первое переименование - - - - %name% - copy - %name% should not be translated - %name% - копия - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>Переменные: <span style=" font-weight:600;">%name%</span> по оригинальному названию файла</p></body></html> - - - - Second renaming - Второе переименование - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - копия (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>Переменные: <span style=" font-weight:600;">%name%</span> по оригинальному названию файла</p><p><span style=" font-weight:600;">%number%</span> за дополнительный номер</p></body></html> - - - - - %1 - copy - %1 - копия - - - - - %1 - copy (%2) - %1 - копия (%2) - - - - Renaming rules - Переименование правила - - - - RmPath - - - - Unable to remove the folder - Не удается удалить папку - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - The checksums not match - Контрольные суммы не совпадают - - - - WriteThread - - - Unable to read the source file: - Невозможно прочитать исходный файл: - - - - File truncated during the read, possible data change - Файл усечены во время чтения, возможность изменения данных - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Двигатель вынуждены покинуть свои дома, вы не можете скопировать с ним - - - - - The engine is forced to copy, you can't move with it - Двигатель вынужден копии, вы не можете двигаться вместе с ним - - - - The mode have been forced previously, it's internal error, please report it - Режим был вынужден ранее, это внутренняя ошибка, пожалуйста, сообщите об этом - - - - Options error - Опции ошибке - - - - Options engine is not loaded, can't access to the filters - Параметры двигателя не загружается, не может получить доступ к фильтрам - - - - fileErrorDialog - - - Error on file - Ошибка в файле - - - - Error - ошибка - - - - Size - размер - - - - Modified - модифицированный - - - - File name - имя файла - - - - &Always do this action - Всегда делайте это действие - - - - Put to bottom - Положить в нижней - - - - Retry - Повторить - - - - &Skip - пропускать - - - - &Cancel - отменить - - - - Error on folder - Ошибка в папку - - - - Folder name - имя папки - - - - fileExistsDialog - - - The file exists - Файл существует - - - - Source - источник - - - - Destination - назначение - - - - - Size - размер - - - - - Modified - модифицированный - - - - - File name - имя файла - - - - Suggest new &name - Предложить новое имя - - - - &Always do this action - Всегда делайте это действие - - - - &Rename - переименовать - - - - &Overwrite - переписывать - - - - &Skip - пропускать - - - - &Cancel - отменить - - - - Overwrite if newer - Заменить, если новее - - - - Overwrite if not same modification date - Заменить, если не ту же дату модификации - - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - fileIsSameDialog - - - This files are the same file - Эти файлы имеют тот же файл - - - - The source and destination is same - Источник и назначение такое же, - - - - Size - размер - - - - Modified - модифицированный - - - - File name - имя файла - - - - Suggest new &name - Предложить новое имя - - - - &Always do this action - Всегда делайте это действие - - - - &Rename - переименовать - - - - &Skip - пропускать - - - - &Cancel - отменить - - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - folderExistsDialog - - - This folders are the same folder - Это папки той же папке, - - - - Source - источник - - - - Destination - назначение - - - - The source and destination is same - Источник и назначение такое же, - - - - - Modified - модифицированный - - - - - Folder name - имя папки - - - - Suggest new &name - Предложить новое имя - - - - &Always do this action - Всегда делайте это действие - - - - &Rename - переименовать - - - - Merge - слияние - - - - Skip - пропускать - - - - &Cancel - отменить - - - - Folder already exists - Папка уже существует - - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - options - - - Transfer the file rights - Передача файлов прав - - - - Keep the file date - Держите дату файла - - - - Block size - размер блока - - - - - KB - KB - - - - Auto start the transfer - Авто начать передачу - - - - When folder error - Когда папка ошибка - - - - - Ask - просить - - - - - Skip - пропускать - - - - Merge - слияние - - - - Rename - переименовать - - - - Check if destination folder exists - Убедитесь, что папка существует - - - - Rsync (only in copy mode) - - - - - When folder collision - Когда папка столкновения - - - - Checksum - Контрольная - - - - Only after error - Только после того, как ошибка - - - - Ignore if impossible - Игнорировать, если невозможно - - - - Do checksum - У контрольной суммы - - - - Enable OS buffer - Включить OS буфер - - - - Filters - Фильтры - - - - Renaming rules - Переименование правила - - - - OS buffer only if smaller than - ОС буфер, только если меньше - - - - scanFileOrFolder - - - - %1 - copy - %1 - копия - - - - - %1 - copy (%2) - %1 - копия (%2) - - - - The folder not exists - Папка не существует - - - - The folder is not readable - Папки не читается - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/th/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/th/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/th/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/tr/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/tr/translation.ts deleted file mode 100644 index 338cb72..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/tr/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - Rsync (only in copy mode) - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/Languages/zh/translation.ts b/plugins-alternative/CopyEngine/Rsync/Languages/zh/translation.ts deleted file mode 100644 index 9c2e5d6..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Languages/zh/translation.ts +++ /dev/null @@ -1,806 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Filters dialog - - - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - The regex is valid - - - - - Test string: - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - Renaming rules - - - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - RmPath - - - - Unable to remove the folder - - - - - Unable to remove the file - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - OS buffer only if smaller than - - - - - Block size - - - - - Filters - - - - - Renaming rules - - - - - Rsync (only in copy mode) - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/ListThread.cpp b/plugins-alternative/CopyEngine/Rsync/ListThread.cpp deleted file mode 100755 index e49cea5..0000000 --- a/plugins-alternative/CopyEngine/Rsync/ListThread.cpp +++ /dev/null @@ -1,1720 +0,0 @@ -#include "ListThread.h" - -ListThread::ListThread(FacilityInterface * facilityInterface) -{ - qRegisterMetaType("DebugLevel"); - qRegisterMetaType("ItemOfCopyList"); - qRegisterMetaType("QFileInfo"); - qRegisterMetaType("CopyMode"); - qRegisterMetaType >("QList"); - qRegisterMetaType("TransferStat"); - - moveToThread(this); - start(HighPriority); - this->facilityInterface = facilityInterface; - putInPause = false; - sourceDrive = ""; - sourceDriveMultiple = false; - destinationDrive = ""; - destinationDriveMultiple = false; - stopIt = false; - bytesToTransfer = 0; - bytesTransfered = 0; - idIncrementNumber = 1; - actualRealByteTransfered = 0; - preOperationNumber = 0; - numberOfTranferRuning = 0; - numberOfTransferIntoToDoList = 0; - numberOfInodeOperation = 0; - maxSpeed = 0; - doRightTransfer = false; - rsync = false; - keepDate = false; - blockSize = 1024; - osBufferLimit = 512; - alwaysDoThisActionForFileExists = FileExists_NotSet; - doChecksum = false; - checksumIgnoreIfImpossible = true; - checksumOnlyOnError = true; - osBuffer = false; - osBufferLimited = false; - forcedMode = false; - - #if ! defined (Q_CC_GNU) - ui->keepDate->setEnabled(false); - ui->keepDate->setToolTip("Not supported with this compiler"); - #endif - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - connect(&timerUpdateDebugDialog,SIGNAL(timeout()),this,SLOT(timedUpdateDebugDialog())); - timerUpdateDebugDialog.start(ULTRACOPIER_PLUGIN_DEBUG_WINDOW_TIMER); - #endif - connect(this, SIGNAL(tryCancel()), this,SLOT(cancel()), Qt::QueuedConnection); - connect(this, SIGNAL(askNewTransferThread()), this,SLOT(createTransferThread()), Qt::QueuedConnection); - connect(&mkPathQueue, SIGNAL(firstFolderFinish()), this,SLOT(mkPathFirstFolderFinish()), Qt::QueuedConnection); - connect(&rmPathQueue, SIGNAL(firstFolderFinish()), this,SLOT(rmPathFirstFolderFinish()), Qt::QueuedConnection); - connect(&mkPathQueue, SIGNAL(errorOnFolder(QFileInfo,QString)), this,SIGNAL(mkPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection); - connect(&rmPathQueue, SIGNAL(errorOnFolder(QFileInfo,QString)), this,SIGNAL(rmPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection); - connect(this, SIGNAL(send_syncTransferList()), this,SLOT(syncTransferList_internal()), Qt::QueuedConnection); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&mkPathQueue, SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); - connect(&rmPathQueue, SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); - #endif // ULTRACOPIER_PLUGIN_DEBUG - - emit askNewTransferThread(); - mkpathTransfer.release(); -} - -ListThread::~ListThread() -{ - emit tryCancel(); - waitCancel.acquire(); - quit(); - wait(); -} - -//transfer is finished -void ListThread::transferInodeIsClosed() -{ - numberOfInodeOperation--; - temp_transfer_thread=qobject_cast(QObject::sender()); - if(temp_transfer_thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - isFound=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - int countLocalParse=0; - #endif - if(temp_transfer_thread->getStat()!=TransferStat_Idle) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not idle!")); - return; - } - int_for_internal_loop=0; - loop_size=actionToDoListTransfer.size(); - while(int_for_internal_looptransferId) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("[%1] have finish, put at idle; for id: %2").arg(int_for_internal_loop).arg(temp_transfer_thread->transferId)); - returnActionOnCopyList newAction; - newAction.type=RemoveItem; - newAction.addAction.id=temp_transfer_thread->transferId; - newAction.userAction.position=int_for_internal_loop; - actionDone << newAction; - /// \todo check if item is at the right thread - actionToDoListTransfer.removeAt(int_for_internal_loop); - if(actionToDoListTransfer.size()==0 && actionToDoListInode.size()==0 && actionToDoListInode_afterTheTransfer.size()==0) - updateTheStatus(); - - temp_transfer_thread->transferId=0; - temp_transfer_thread->transferSize=0; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - countLocalParse++; - #endif - isFound=true; - //emit newActionOnList(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"numberOfTranferRuning: "+QString::number(numberOfTranferRuning)); - if(actionToDoListTransfer.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"numberOfTranferRuning==0"); - actionToDoListInode << actionToDoListInode_afterTheTransfer; - actionToDoListInode_afterTheTransfer.clear(); - doNewActions_inode_manipulation(); - } - break; - } - int_for_internal_loop++; - } - if(!isFound) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("unable to found item into the todo list, id: %1, index: %2").arg(temp_transfer_thread->transferId).arg(int_for_loop)); - temp_transfer_thread->transferId=0; - temp_transfer_thread->transferSize=0; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("countLocalParse: %1, actionToDoList.size(): %2").arg(countLocalParse).arg(actionToDoListTransfer.size())); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - if(countLocalParse!=1) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("countLocalParse != 1")); - #endif - doNewActions_inode_manipulation(); -} - -//transfer is finished -void ListThread::transferIsFinished() -{ - temp_transfer_thread=qobject_cast(QObject::sender()); - if(temp_transfer_thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - - //add the current size of file, to general size because it's finish - copiedSize=temp_transfer_thread->copiedSize(); - if(copiedSize>(qint64)temp_transfer_thread->transferSize) - { - oversize=copiedSize-temp_transfer_thread->transferSize; - bytesToTransfer+=oversize; - bytesTransfered+=oversize; - } - bytesTransfered+=temp_transfer_thread->transferSize; - -// emit newTransferStop(temp_transfer_thread->transferId); - numberOfTranferRuning--; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start transferIsFinished(), numberOfTranferRuning: "+QString::number(numberOfTranferRuning)); - doNewActions_start_transfer(); -} - -/** \brief put the current file at bottom in case of error -\note ONLY IN CASE OF ERROR */ -void ListThread::transferPutAtBottom() -{ - TransferThread *transfer=qobject_cast(QObject::sender()); - if(transfer==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - transfer->skip(); - bool isFound=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - int countLocalParse=0; - #endif - int indexAction=0; - while(indexActiontransferId) - { - //push for interface at the end - returnActionOnCopyList newAction; - newAction.type=MoveItem; - newAction.addAction.id=transfer->transferId; - newAction.userAction.position=actionToDoListTransfer.size()-1; - actionDone << newAction; - //do the wait stat - actionToDoListTransfer[indexAction].isRunning=false; - //move at the end - actionToDoListTransfer.move(indexAction,actionToDoListTransfer.size()-1); - //reset the thread list stat - transfer->transferId=0; - transfer->transferSize=0; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - countLocalParse++; - #endif - isFound=true; - break; - } - indexAction++; - } - if(!isFound) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("unable to found item into the todo list, id: %1, index: %2").arg(transfer->transferId)); - transfer->transferId=0; - transfer->transferSize=0; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("countLocalParse: %1").arg(countLocalParse)); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - if(countLocalParse!=1) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("countLocalParse != 1")); - #endif -} - -//set the copy info and options before runing -void ListThread::setRightTransfer(const bool doRightTransfer) -{ - this->doRightTransfer=doRightTransfer; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetRightTransfer(doRightTransfer); - index++; - } -} - -//set keep date -void ListThread::setKeepDate(const bool keepDate) -{ - this->keepDate=keepDate; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetKeepDate(keepDate); - index++; - } -} - -//set block size in KB -void ListThread::setBlockSize(const int blockSize) -{ - this->blockSize=blockSize; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetBlockSize(blockSize); - index++; - } -} - -//set auto start -void ListThread::setAutoStart(const bool autoStart) -{ - this->autoStart=autoStart; -} - -/// \brief set rsync -void ListThread::setRsync(const bool rsync) -{ - this->rsync=rsync; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetRsync(rsync); - index++; - } - for(int i=0;isetRsync(rsync); -} - -//set check destination folder -void ListThread::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) -{ - this->checkDestinationFolderExists=checkDestinationFolderExists; - for(int i=0;isetCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); -} - -void ListThread::fileTransfer(const QFileInfo &sourceFileInfo,const QFileInfo &destinationFileInfo,const CopyMode &mode) -{ - addToTransfer(sourceFileInfo,destinationFileInfo,mode); -} - -// -> add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::haveSameSource(QStringList sources) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(sourceDriveMultiple) - return false; - if(sourceDrive.isEmpty()) - return true; - int index=0; - while(index add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::haveSameDestination(QString destination) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(destinationDriveMultiple) - return false; - if(destinationDrive.isEmpty()) - return true; - int index=0; - while(indexsetRsync(rsync); - scanFileOrFolderThreadsPool.last()->setFilters(include,exclude); - scanFileOrFolderThreadsPool.last()->setCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); - if(scanFileOrFolderThreadsPool.size()==1) - updateTheStatus(); - scanFileOrFolderThreadsPool.last()->setRenamingRules(firstRenamingRule,otherRenamingRule); - return scanFileOrFolderThreadsPool.last(); -} - -void ListThread::scanThreadHaveFinish(bool skipFirstRemove) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"listing thread have finish, skipFirstRemove: "+QString::number(skipFirstRemove)); - if(!skipFirstRemove) - { - scanFileOrFolder * senderThread = qobject_cast(QObject::sender()); - if(senderThread==NULL) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"sender pointer null (plugin copy engine)"); - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the next thread, scanFileOrFolderThreadsPool.size(): "+QString::number(scanFileOrFolderThreadsPool.size())); - delete senderThread; - scanFileOrFolderThreadsPool.removeOne(senderThread); - if(scanFileOrFolderThreadsPool.size()==0) - updateTheStatus(); - } - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the next thread, scanFileOrFolderThreadsPool.size(): "+QString::number(scanFileOrFolderThreadsPool.size())); - if(scanFileOrFolderThreadsPool.size()>0) - { - //then start the next listing threads - if(scanFileOrFolderThreadsPool.first()->isFinished()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Start listing thread"); - scanFileOrFolderThreadsPool.first()->start(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"The listing thread is already running"); - } - else - { - if(autoStart) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Auto start the copy"); - startGeneralTransfer(); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Put the copy engine in pause"); - putInPause=true; - emit isInPause(true); - } - } -} - -void ListThread::startGeneralTransfer() -{ - doNewActions_inode_manipulation(); -} - -// -> add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::newCopy(QStringList sources,QString destination) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+sources.join(";")+", destination: "+destination); - scanFileOrFolder * scanFileOrFolderThread = newScanThread(Copy); - if(scanFileOrFolderThread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to get new thread"); - return false; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the listing"); - scanFileOrFolderThread->addToList(sources,destination); - scanThreadHaveFinish(true); - return true; -} - -// -> add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::newMove(QStringList sources,QString destination) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - scanFileOrFolder * scanFileOrFolderThread = newScanThread(Move); - if(scanFileOrFolderThread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to get new thread"); - return false; - } - scanFileOrFolderThread->addToList(sources,destination); - scanThreadHaveFinish(true); -/* int index=0; - while(indexdrives=drives; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetDrive(drives); - index++; - } -} - -void ListThread::setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists) -{ - this->alwaysDoThisActionForFileExists=alwaysDoThisActionForFileExists; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - index++; - } -} - -/** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ -void ListThread::syncTransferList() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit send_syncTransferList(); -} - -//set the folder local colision -void ListThread::setFolderColision(FolderExistsAction alwaysDoThisActionForFolderExists) -{ - this->alwaysDoThisActionForFolderExists=alwaysDoThisActionForFolderExists; -} - -bool ListThread::getReturnBoolToCopyEngine() -{ - return returnBoolToCopyEngine; -} - -QPair ListThread::getReturnPairQuint64ToCopyEngine() -{ - return returnPairQuint64ToCopyEngine; -} - -ItemOfCopyList ListThread::getReturnItemOfCopyListToCopyEngine() -{ - return returnItemOfCopyListToCopyEngine; -} - -void ListThread::set_doChecksum(bool doChecksum) -{ - this->doChecksum=doChecksum; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_doChecksum(doChecksum); - index++; - } -} - -void ListThread::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) -{ - this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - index++; - } -} - -void ListThread::set_checksumOnlyOnError(bool checksumOnlyOnError) -{ - this->checksumOnlyOnError=checksumOnlyOnError; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_checksumOnlyOnError(checksumOnlyOnError); - index++; - } -} - -void ListThread::set_osBuffer(bool osBuffer) -{ - this->osBuffer=osBuffer; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_osBuffer(osBuffer); - index++; - } -} - -void ListThread::set_osBufferLimited(bool osBufferLimited) -{ - this->osBufferLimited=osBufferLimited; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_osBufferLimited(osBufferLimited); - index++; - } -} - -void ListThread::realByteTransfered() -{ - quint64 totalRealByteTransfered=0; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexrealByteTransfered(); - index++; - } - emit send_realBytesTransfered(totalRealByteTransfered); -} - -void ListThread::pause() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(putInPause) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Seam already in pause!"); - return; - } - putInPause=true; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexpause(); - index++; - } - emit isInPause(true); -} - -void ListThread::resume() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(!putInPause) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Seam already resumed!"); - return; - } - putInPause=false; - startGeneralTransfer(); - doNewActions_start_transfer(); - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexresume(); - index++; - } - emit isInPause(false); -} - -void ListThread::skip(const quint64 &id) -{ - skipInternal(id); -// emit newActionOnList(); -} - -bool ListThread::skipInternal(const quint64 &id) -{ - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indextransferId==id) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip one transfer: %1").arg(id)); - transferThreadList.at(index)->skip(); - return true; - } - index++; - } - int_for_internal_loop=0; - loop_size=actionToDoListTransfer.size(); - while(int_for_internal_loopstop(); - delete transferThreadList.at(index);//->deleteLayer(); - transferThreadList[index]=NULL; - index++; - } - index=0; - loop_size=scanFileOrFolderThreadsPool.size(); - while(indexstop(); - delete scanFileOrFolderThreadsPool.at(index);//->deleteLayer(); - scanFileOrFolderThreadsPool[index]=NULL; - index++; - } - quit(); - waitCancel.release(); - emit canBeDeleted(); -} - -//speed limitation -qint64 ListThread::getSpeedLimitation() -{ - return maxSpeed; -} - -bool ListThread::setSpeedLimitation(const qint64 &speedLimitation) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"maxSpeed: "+QString::number(speedLimitation)); - maxSpeed=speedLimitation; - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopsetMaxSpeed(speedLimitation/ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER); - int_for_loop++; - } - return true; -} - -void ListThread::updateTheStatus() -{ - /*if(threadOfTheTransfer.haveContent()) - copy=true;*/ - updateTheStatus_listing=scanFileOrFolderThreadsPool.size()>0; - updateTheStatus_copying=actionToDoListTransfer.size()>0 || actionToDoListInode.size()>0 || actionToDoListInode_afterTheTransfer.size()>0; - if(updateTheStatus_copying && updateTheStatus_listing) - updateTheStatus_action_in_progress=CopyingAndListing; - else if(updateTheStatus_listing) - updateTheStatus_action_in_progress=Listing; - else if(updateTheStatus_copying) - updateTheStatus_action_in_progress=Copying; - else - updateTheStatus_action_in_progress=Idle; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"emit actionInProgess("+QString::number(updateTheStatus_action_in_progress)+")"); - emit actionInProgess(updateTheStatus_action_in_progress); - if(updateTheStatus_action_in_progress==Idle) - sendActionDone(); -} - -//set data local to the thread -void ListThread::setAlwaysFileExistsAction(FileExistsAction alwaysDoThisActionForFileExists) -{ - this->alwaysDoThisActionForFileExists=alwaysDoThisActionForFileExists; - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopsetAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - int_for_loop++; - } -} - -//mk path to do -quint64 ListThread::addToMkPath(const QString& folder) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder: "+folder); - actionToDoInode temp; - temp.type = ActionType_MkPath; - temp.id = generateIdNumber(); - temp.folder.setFile(folder); - temp.isRunning = false; - actionToDoListInode << temp; - return temp.id; -} - -//add rm path to do -void ListThread::addToRmPath(const QString& folder,const int& inodeToRemove) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder: "+folder+",inodeToRemove: "+QString::number(inodeToRemove)); - actionToDoInode temp; - temp.type = ActionType_RmPath; - temp.id = generateIdNumber(); - temp.size = inodeToRemove; - temp.folder.setFile(folder); - temp.isRunning = false; - if(inodeToRemove==0) - actionToDoListInode << temp; - else - actionToDoListInode_afterTheTransfer << temp; -} - -//rsync rm -void ListThread::addToRmForRsync(const QString& inode) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"inode: "+inode); - actionToDoInode temp; - temp.type = ActionType_RmSync; - temp.id = generateIdNumber(); - temp.folder.setFile(inode); - temp.isRunning = false; - actionToDoListInode << temp; -} - -//send action done -void ListThread::sendActionDone() -{ - if(actionDone.size()>0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit newActionOnList(actionDone); - actionDone.clear(); - } -} - -//send progression -void ListThread::sendProgression() -{ - if(actionToDoListTransfer.size()==0) - return; - oversize=0; - currentProgression=0; - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopgetStat()==TransferStat_Transfer || temp_transfer_thread->getStat()==TransferStat_Checksum) - { - copiedSize=temp_transfer_thread->copiedSize(); - - //for the general progression - currentProgression+=copiedSize; - - //the oversize (when the file is bigger after/during the copy then what was during the listing) - if(copiedSize>(qint64)temp_transfer_thread->transferSize) - localOverSize=copiedSize-temp_transfer_thread->transferSize; - else - localOverSize=0; - - //the current size copied - totalSize=temp_transfer_thread->transferSize+localOverSize; - if(temp_transfer_thread->getStat()==TransferStat_Checksum) - tempItem.current=temp_transfer_thread->realByteTransfered(); - else - tempItem.current=copiedSize; - tempItem.id=temp_transfer_thread->transferId; - tempItem.total=totalSize; - progressionList << tempItem; - - //add the oversize to the general progression - oversize+=localOverSize; - } - int_for_loop++; - } - emit pushFileProgression(progressionList); - progressionList.clear(); - emit pushGeneralProgression(bytesTransfered+currentProgression,bytesToTransfer+oversize); - realByteTransfered(); -} - -//send the progression, after full reset of the interface (then all is empty) -void ListThread::syncTransferList_internal() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit syncReady(); - actionDone.clear(); - //do list operation - TransferThread *transferThread; - loop_size=actionToDoListTransfer.size(); - loop_sub_size=transferThreadList.size(); - //this loop to have at max ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT*ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT, not ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT*transferThreadList.size() - for(int_for_loop=0; int_for_loopgetStat()!=TransferStat_PreOperation) - { - returnActionOnCopyList newAction; - switch(transferThread->getStat()) - { - case TransferStat_Transfer: - newAction.type=Transfer; - break; - case TransferStat_PostTransfer: - newAction.type=PostOperation; - break; - default: - break; - } - newAction.addAction.id = item.id; - actionDone << newAction; - } - } - } - } -} - -//add file transfer to do -quint64 ListThread::addToTransfer(const QFileInfo& source,const QFileInfo& destination,const CopyMode& mode) -{ - //add to transfer list - numberOfTransferIntoToDoList++; - bytesToTransfer+= source.size(); - actionToDoTransfer temp; - temp.id = generateIdNumber(); - temp.size = source.size(); - temp.source = source; - temp.destination= destination; - temp.mode = mode; - temp.isRunning = false; - actionToDoListTransfer << temp; - //push the new transfer to interface - returnActionOnCopyList newAction; - newAction.type = AddingItem; - newAction.addAction.id = temp.id; - newAction.addAction.sourceFullPath = source.absoluteFilePath(); - newAction.addAction.sourceFileName = source.fileName(); - newAction.addAction.destinationFullPath = destination.absoluteFilePath(); - newAction.addAction.destinationFileName = destination.fileName(); - newAction.addAction.size = temp.size; - newAction.addAction.mode = mode; - actionDone << newAction; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("source: %1, destination: %2, add entry: %3, size: %4, size2: %5").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).arg(temp.id).arg(temp.size).arg(newAction.addAction.size)); - return temp.id; -} - -//generate id number -quint64 ListThread::generateIdNumber() -{ - idIncrementNumber++; - if(idIncrementNumber>(((quint64)1024*1024)*1024*1024*2)) - idIncrementNumber=0; - return idIncrementNumber; -} - -//warning the first entry is accessible will copy -void ListThread::removeItems(const QList &ids) -{ - for(int i=0;i ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int indexToMove=0; - loop_size=actionToDoListTransfer.size(); - for (int i=0; i ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int lastGoodPositionExtern=0; - int lastGoodPositionReal=0; - bool haveGoodPosition=false; - bool haveChanged=false; - loop_size=actionToDoListTransfer.size(); - for (int i=0; i ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int lastGoodPositionExtern=numberOfTransferIntoToDoList; - int lastGoodPositionReal=0; - bool haveGoodPosition=false; - bool haveChanged=false; - for (int i=actionToDoListTransfer.size()-1; i>=0; --i) { - if(ids.contains(actionToDoListTransfer.at(i).id)) - { - if(haveGoodPosition) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("move item ")+QString::number(i)+" to "+QString::number(i+1)); - returnActionOnCopyList newAction; - newAction.type=MoveItem; - newAction.addAction.id=actionToDoListTransfer.at(i).id; - newAction.userAction.moveAt=lastGoodPositionReal; - newAction.userAction.position=i; - actionDone << newAction; - actionToDoListTransfer.swap(i,lastGoodPositionReal); - haveChanged=true; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Try move up false, item ")+QString::number(i)); - } - ids.removeOne(actionToDoListTransfer.at(i).id); - if(ids.size()==0) - { -/* if(haveChanged) - emit newActionOnList();*/ - return; - } - } - else - { - lastGoodPositionExtern--; - lastGoodPositionReal=i; - haveGoodPosition=true; - } - } - //emit newActionOnList(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -//put on bottom -void ListThread::moveItemsOnBottom(QList ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int lastGoodPositionExtern=numberOfTransferIntoToDoList; - int lastGoodPositionReal=actionToDoListTransfer.size()-1; - for (int i=lastGoodPositionReal; i>=0; --i) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Check action on item ")+QString::number(i)); - if(ids.contains(actionToDoListTransfer.at(i).id)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("move item ")+QString::number(i)+" to "+QString::number(lastGoodPositionReal)); - ids.removeOne(actionToDoListTransfer.at(i).id); - returnActionOnCopyList newAction; - newAction.type=MoveItem; - newAction.addAction.id=actionToDoListTransfer.at(i).id; - newAction.userAction.moveAt=lastGoodPositionExtern; - newAction.userAction.position=i; - actionDone << newAction; - actionToDoListTransfer.move(i,lastGoodPositionReal); - lastGoodPositionReal--; - lastGoodPositionExtern--; - if(ids.size()==0) - { -// emit newActionOnList(); - return; - } - } - } -// emit newActionOnList(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -/** \brief give the forced mode, to export/import transfer list */ -void ListThread::forceMode(const CopyMode &mode) -{ - if(mode==Copy) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to copy")); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to move")); - this->mode=mode; - forcedMode=true; -} - -void ListThread::exportTransferList(const QString &fileName) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QFile transferFile(fileName); - if(transferFile.open(QIODevice::WriteOnly|QIODevice::Truncate)) - { - transferFile.write(QString("Ultracopier-0.3;Transfer-list;").toUtf8()); - if(!forcedMode) - transferFile.write(QString("Transfer;").toUtf8()); - else - { - if(mode==Copy) - transferFile.write(QString("Copy;").toUtf8()); - else - transferFile.write(QString("Move;").toUtf8()); - } - transferFile.write(QString("Ultracopier-0.3\n").toUtf8()); - bool haveError=false; - int size=actionToDoListTransfer.size(); - for (int index=0;index0) - { - content=QString::fromUtf8(data); - //do the import here - if(content.contains(correctLine)) - { - content.remove("\n"); - args=content.split(";"); - if(forcedMode) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("New data to import in forced mode: %2,%3").arg(args.at(0)).arg(args.at(1))); - addToTransfer(QFileInfo(args.at(0)),QFileInfo(args.at(1)),mode); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("New data to import: %1,%2,%3").arg(args.at(0)).arg(args.at(1)).arg(args.at(2))); - if(args.at(0)=="Copy") - tempMode=Copy; - else - tempMode=Move; - addToTransfer(QFileInfo(args.at(1)),QFileInfo(args.at(2)),tempMode); - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Wrong line syntax: %1").arg(content)); - errorFound=true; - } - } - } - while(data.size()>0); - transferFile.close(); - if(errorFound) - emit warningTransferList(tr("Some error have been found during the line parsing")); -// emit newActionOnList(); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to open the transfer list: %1").arg(transferFile.errorString())); - emit errorTransferList(tr("Unable to open the transfer list: %1").arg(transferFile.errorString())); - return; - } -} - -//do new actions -void ListThread::doNewActions_start_transfer() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("actionToDoListTransfer.size(): %1, numberOfTranferRuning: %2").arg(actionToDoListTransfer.size()).arg(numberOfTranferRuning)); - if(stopIt || putInPause) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //lunch the transfer in WaitForTheTransfer - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopgetStat()==TransferStat_WaitForTheTransfer) - { - transferThreadList.at(int_for_loop)->startTheTransfer(); - numberOfTranferRuning++; - } - int_for_loop++; - } - int_for_loop=0; - while(int_for_loopgetStat()==TransferStat_PreOperation) - { - transferThreadList.at(int_for_loop)->startTheTransfer(); - numberOfTranferRuning++; - } - int_for_loop++; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"numberOfTranferRuning: "+QString::number(numberOfTranferRuning)); -} - -/** \brief lunch the pre-op or inode op - 1) locate the next next item to do into the both list - 1a) optimisation posible on the mkpath/rmpath - 2) determine what need be lunched - 3) lunch it, rerun the 2) - */ -void ListThread::doNewActions_inode_manipulation() -{ - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("actionToDoList.size(): %1").arg(actionToDoList.size())); - if(stopIt || putInPause) - return; - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //lunch the pre-op or inode op - int_for_loop=0; - int_for_internal_loop=0; - number_rm_path_moved=0; - int_for_transfer_thread_search=0; - actionToDoListTransfer_count=actionToDoListTransfer.count(); - actionToDoListInode_count=actionToDoListInode.count(); - loop_sub_size_transfer_thread_search=transferThreadList.size(); - //search the next transfer action to do - while(int_for_looptransferId==0) /!\ important! - Because the other thread can have call doNewAction before than this thread have the finish event parsed! - I this case it lose all data - */ - currentTransferThread=transferThreadList[int_for_transfer_thread_search]; - if(currentTransferThread->getStat()==TransferStat_Idle && currentTransferThread->transferId==0) // /!\ important! - { - currentTransferThread->transferId=currentActionToDoTransfer.id; - currentTransferThread->transferSize=currentActionToDoTransfer.size; - currentTransferThread->setFiles( - currentActionToDoTransfer.source.absoluteFilePath(), - currentActionToDoTransfer.size, - currentActionToDoTransfer.destination.absoluteFilePath(), - currentActionToDoTransfer.mode - ); - currentActionToDoTransfer.isRunning=true; - - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("[%1] id: %2 is idle, use it for %3").arg(int_for_loop).arg(currentTransferThread->transferId).arg(currentActionToDoTransfer.destination.absoluteFilePath())); - - /// \note wrong position? Else write why it's here - returnActionOnCopyList newAction; - newAction.type = PreOperation; - newAction.addAction.id = currentActionToDoTransfer.id; - newAction.addAction.sourceFullPath = currentActionToDoTransfer.source.absoluteFilePath(); - newAction.addAction.sourceFileName = currentActionToDoTransfer.source.fileName(); - newAction.addAction.destinationFullPath = currentActionToDoTransfer.destination.absoluteFilePath(); - newAction.addAction.destinationFileName = currentActionToDoTransfer.destination.fileName(); - newAction.addAction.size = currentActionToDoTransfer.size; - newAction.addAction.mode = currentActionToDoTransfer.mode; - actionDone << newAction; - int_for_transfer_thread_search++; - break; - } - int_for_transfer_thread_search++; - } - if(int_for_internal_loop==loop_sub_size_transfer_thread_search) - { - /// \note Can be normal when all thread is not initialized - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to found free thread to do the transfer"); - break; - } - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - } - int_for_loop++; - } - //search the next inode action to do - while(int_for_internal_loopULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("The index have been detected as out of max range: %1>%2").arg(actionToDoListTransfer_count+actionToDoListInode_count).arg(ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT)); - return; - } -} - -//restart transfer if it can -void ListThread::restartTransferIfItCan() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - TransferThread *transfer=qobject_cast(QObject::sender()); - if(transfer==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - if(numberOfTranferRuninggetStat()==TransferStat_WaitForTheTransfer) - { - transfer->startTheTransfer(); - numberOfTranferRuning++; - } - doNewActions_start_transfer(); -} - -/// \brief update the transfer stat -void ListThread::newTransferStat(TransferStat stat,quint64 id) -{ - returnActionOnCopyList newAction; - switch(stat) - { - case TransferStat_Idle: - return; - break; - case TransferStat_PreOperation: - return; - break; - case TransferStat_WaitForTheTransfer: - return; - break; - case TransferStat_Transfer: - newAction.type=Transfer; - break; - case TransferStat_PostTransfer: - case TransferStat_PostOperation: - newAction.type=PostOperation; - break; - case TransferStat_Checksum: - newAction.type=CustomOperation; - break; - default: - return; - break; - } - newAction.addAction.id = id; - actionDone << newAction; -} - -void ListThread::set_osBufferLimit(unsigned int osBufferLimit) -{ - this->osBufferLimit=osBufferLimit; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_osBufferLimit(osBufferLimit); - index++; - } -} - -void ListThread::set_setFilters(QList include,QList exclude) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("include.size(): %1, exclude.size(): %2").arg(include.size()).arg(exclude.size())); - this->include=include; - this->exclude=exclude; - int index=0; - while(indexsetFilters(include,exclude); - index++; - } -} - -void ListThread::set_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void ListThread::mkPathFirstFolderFinish() -{ - int_for_loop=0; - loop_size=actionToDoListInode.size(); - while(int_for_loopgetStat()) - { - case TransferStat_Idle: - stat="Idle"; - break; - case TransferStat_PreOperation: - stat="PreOperation"; - break; - case TransferStat_WaitForTheTransfer: - stat="WaitForTheTransfer"; - break; - case TransferStat_Transfer: - stat="Transfer"; - break; - case TransferStat_PostOperation: - stat="PostOperation"; - break; - case TransferStat_PostTransfer: - stat="PostTransfer"; - break; - case TransferStat_Checksum: - stat="Checksum"; - break; - default: - stat=QString("??? (%1)").arg(transferThreadList.at(index)->getStat()); - break; - } - newList << QString("%1) (%3,%4) %2") - .arg(index) - .arg(stat) - .arg(transferThreadList.at(index)->readingLetter()) - .arg(transferThreadList.at(index)->writingLetter()); - index++; - } - QStringList newList2; - index=0; - loop_size=actionToDoListTransfer.size(); - while(index(actionToDoListTransfer.size()+2)) - { - newList2 << QString("..."); - break; - } - index++; - } - emit updateTheDebugInfo(newList,newList2,numberOfInodeOperation); -} - -#endif - -/// \note Can be call without queue because all call will be serialized -void ListThread::fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) -{ - emit send_fileAlreadyExists(source,destination,isSame,qobject_cast(sender())); -} - -/// \note Can be call without queue because all call will be serialized -void ListThread::errorOnFile(const QFileInfo &fileInfo,const QString &errorString) -{ - emit send_errorOnFile(fileInfo,errorString,qobject_cast(sender())); -} - -/// \note Can be call without queue because all call will be serialized -void ListThread::folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) -{ - emit send_folderAlreadyExists(source,destination,isSame,qobject_cast(sender())); -} - -/// \note Can be call without queue because all call will be serialized -/// \todo all this part -void ListThread::errorOnFolder(const QFileInfo &fileInfo,const QString &errorString) -{ - emit send_errorOnFolder(fileInfo,errorString,qobject_cast(sender())); -} - -//to run the thread -void ListThread::run() -{ - exec(); -} - -/// \to create transfer thread -void ListThread::createTransferThread() -{ - if(stopIt) - return; - transferThreadList << new TransferThread(); - TransferThread * last=transferThreadList.last(); - last->transferId=0; - last->transferSize=0; - last->setRightTransfer(doRightTransfer); - last->setKeepDate(keepDate); - last->setBlockSize(blockSize); - last->setDrive(drives); - last->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - last->setMaxSpeed(maxSpeed/ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER); - last->set_doChecksum(doChecksum); - last->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - last->set_checksumOnlyOnError(checksumOnlyOnError); - last->set_osBuffer(osBuffer); - last->set_osBufferLimited(osBufferLimited); - last->set_osBufferLimit(osBufferLimit); - last->setRsync(rsync); - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(last,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); - #endif // ULTRACOPIER_PLUGIN_DEBUG - connect(last,SIGNAL(errorOnFile(QFileInfo,QString)), this,SLOT(errorOnFile(QFileInfo,QString)), Qt::QueuedConnection); - connect(last,SIGNAL(fileAlreadyExists(QFileInfo,QFileInfo,bool)), this,SLOT(fileAlreadyExists(QFileInfo,QFileInfo,bool)), Qt::QueuedConnection); - connect(last,SIGNAL(tryPutAtBottom()), this,SLOT(transferPutAtBottom()), Qt::QueuedConnection); - connect(last,SIGNAL(readStopped()), this,SLOT(transferIsFinished()), Qt::QueuedConnection); - connect(last,SIGNAL(preOperationStopped()), this,SLOT(doNewActions_start_transfer()), Qt::QueuedConnection); - connect(last,SIGNAL(postOperationStopped()), this,SLOT(transferInodeIsClosed()), Qt::QueuedConnection); - connect(last,SIGNAL(checkIfItCanBeResumed()), this,SLOT(restartTransferIfItCan()), Qt::QueuedConnection); - connect(last,SIGNAL(pushStat(TransferStat,quint64)), this,SLOT(newTransferStat(TransferStat,quint64)), Qt::QueuedConnection); - - connect(this,SIGNAL(send_sendNewRenamingRules(QString,QString)), last,SLOT(setRenamingRules(QString,QString)), Qt::QueuedConnection); - - last->start(); - last->setObjectName(QString("transfer %1").arg(transferThreadList.size()-1)); - last->setMkpathTransfer(&mkpathTransfer); - last->setRenamingRules(firstRenamingRule,otherRenamingRule); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - last->setId(transferThreadList.size()-1); - #endif - if(transferThreadList.size()>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - if(stopIt) - return; - doNewActions_inode_manipulation(); - emit askNewTransferThread(); -} diff --git a/plugins-alternative/CopyEngine/Rsync/ListThread.h b/plugins-alternative/CopyEngine/Rsync/ListThread.h deleted file mode 100755 index ab4ad64..0000000 --- a/plugins-alternative/CopyEngine/Rsync/ListThread.h +++ /dev/null @@ -1,376 +0,0 @@ -/** \file ListThread.h -\brief Define the list thread, and management to the action to do -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef LISTTHREAD_H -#define LISTTHREAD_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_CopyEngine.h" -#include "scanFileOrFolder.h" -#include "TransferThread.h" -#include "MkPath.h" -#include "RmPath.h" -#include "Environment.h" - -/// \brief Define the list thread, and management to the action to do -class ListThread : public QThread -{ - Q_OBJECT -public: - explicit ListThread(FacilityInterface * facilityInterface); - ~ListThread(); - //duplication copy detection - /** \brief compare the current sources of the copy, with the passed arguments - * \param sources the sources list to compares with the current sources list - * \return true if have same sources, else false (or empty) */ - bool haveSameSource(QStringList sources); - /** \brief compare the current destination of the copy, with the passed arguments - * \param destination the destination to compares with the current destination - * \return true if have same destination, else false (or empty) */ - bool haveSameDestination(QString destination); - //external soft like file browser have send copy/move list to do - /** \brief send copy with destination - * \param sources the sources list to copy - * \param destination the destination to copy - * \return true if the copy have been accepted */ - bool newCopy(QStringList sources,QString destination); - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \param destination the destination to move - * \return true if the move have been accepted */ - bool newMove(QStringList sources,QString destination); - /** \brief get the speed limitation - * < -1 if not able, 0 if disabled */ - qint64 getSpeedLimitation(); - /** \brief to set drives detected - * specific to this copy engine */ - void setDrive(QStringList drives); - /// \brief to set the collision action - void setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists); - /** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ - void syncTransferList(); - /// \brief to store one action to do - struct actionToDoTransfer - { - quint64 id; - qint64 size;///< Used to set: used in case of transfer or remainingInode for drop folder - QFileInfo source;///< Used to set: source for transfer, folder to create, folder to drop - QFileInfo destination; - CopyMode mode; - bool isRunning;///< store if the action si running - //TransferThread * transfer; // -> see transferThreadList - }; - QList actionToDoListTransfer; - /// \brief get action type - enum ActionType - { - ActionType_MkPath=1, - ActionType_RmPath=2, - ActionType_RmSync=3 - }; - /// \brief to store one action to do - struct actionToDoInode - { - ActionType type;///< \see ActionType - quint64 id; - qint64 size;///< Used to set: used in case of transfer or remainingInode for drop folder - QFileInfo folder;///< Used to set: source for transfer, folder to create, folder to drop - bool isRunning;///< store if the action si running - }; - QList actionToDoListInode; - QList actionToDoListInode_afterTheTransfer; - int numberOfInodeOperation; - //dir operation thread queue - MkPath mkPathQueue; - RmPath rmPathQueue; - //to get the return value from copyEngine - bool getReturnBoolToCopyEngine(); - QPair getReturnPairQuint64ToCopyEngine(); - ItemOfCopyList getReturnItemOfCopyListToCopyEngine(); - - void set_doChecksum(bool doChecksum); - void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); - void set_checksumOnlyOnError(bool checksumOnlyOnError); - void set_osBuffer(bool osBuffer); - void set_osBufferLimited(bool osBufferLimited); -public slots: - //action on the copy - /// \brief put the transfer in pause - void pause(); - /// \brief resume the transfer - void resume(); - /** \brief skip one transfer entry - * \param id id of the file to remove */ - void skip(const quint64 &id); - /** \brief skip as interanl one transfer entry - * \param id id of the file to remove */ - bool skipInternal(const quint64 &id); - /// \brief cancel all the transfer - void cancel(); - //edit the transfer list - /** \brief remove the selected item - * \param ids ids is the id list of the selected items */ - void removeItems(const QList &ids); - /** \brief move on top of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnTop(QList ids); - /** \brief move up the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsUp(QList ids); - /** \brief move down the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsDown(QList ids); - /** \brief move on bottom of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnBottom(QList ids); - - /** \brief give the forced mode, to export/import transfer list */ - void forceMode(const CopyMode &mode); - /// \brief export the transfer list into a file - void exportTransferList(const QString &fileName); - /// \brief import the transfer list into a file - void importTransferList(const QString &fileName); - - /// \brief set the folder local colision - void setFolderColision(FolderExistsAction alwaysDoThisActionForFolderExists); - /** \brief to set the speed limitation - * -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - /// \brief set the copy info and options before runing - void setRightTransfer(const bool doRightTransfer); - /// \brief set keep date - void setKeepDate(const bool keepDate); - /// \brief set block size in KB - void setBlockSize(const int blockSize); - /// \brief set auto start - void setAutoStart(const bool autoStart); - /// \brief set rsync - void setRsync(const bool rsync); - /// \brief set check destination folder - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - /// \brief set data local to the thread - void setAlwaysFileExistsAction(FileExistsAction alwaysDoThisActionForFileExists); - /// \brief do new actions, start transfer - void doNewActions_start_transfer(); - /** \brief lunch the pre-op or inode op - 1) locate the next next item to do into the both list - 1a) optimisation posible on the mkpath/rmpath - 2) determine what need be lunched - 3) lunch it, rerun the 2) - */ - void doNewActions_inode_manipulation(); - /// \brief restart transfer if it can - void restartTransferIfItCan(); - - /// \brief update the transfer stat - void newTransferStat(TransferStat stat,quint64 id); - - void set_osBufferLimit(unsigned int osBufferLimit); - void set_setFilters(QList include,QList exclude); - void set_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - - //send action done - void sendActionDone(); - //send progression - void sendProgression(); -private: - QSemaphore mkpathTransfer; - QString sourceDrive; - bool sourceDriveMultiple; - bool stopIt; - QString destinationDrive; - bool destinationDriveMultiple; - QList scanFileOrFolderThreadsPool; - int numberOfTransferIntoToDoList; - QList transferThreadList; - scanFileOrFolder * newScanThread(CopyMode mode); - quint64 bytesToTransfer; - quint64 bytesTransfered; - bool autoStart; - bool rsync; - bool putInPause; - QList actionDone;///< to action to send to the interface - quint64 idIncrementNumber;///< to store the last id returned - qint64 actualRealByteTransfered; - int preOperationNumber; - int numberOfTranferRuning; - int maxSpeed;///< in KB/s, assume as 0KB/s as default like every where - FolderExistsAction alwaysDoThisActionForFolderExists; - bool checkDestinationFolderExists; - bool doChecksum; - bool checksumIgnoreIfImpossible; - bool checksumOnlyOnError; - bool osBuffer; - bool osBufferLimited; - unsigned int osBufferLimit; - QList include,exclude; - CopyMode mode; - bool forcedMode; - QString firstRenamingRule; - QString otherRenamingRule; - - //add file transfer to do - quint64 addToTransfer(const QFileInfo& source,const QFileInfo& destination,const CopyMode& mode); - //generate id number - quint64 generateIdNumber(); - //warning the first entry is accessible will copy - bool removeItems(quint64 id); - //put on top - bool moveOnTopItem(quint64 id); - //move up - bool moveUpItem(quint64 id); - //move down - bool moveDownItem(quint64 id); - //put on bottom - bool moveOnBottomItem(quint64 id); - //general transfer - void startGeneralTransfer(); - //debug windows if needed - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - QTimer timerUpdateDebugDialog; - #endif - FacilityInterface * facilityInterface; - //temp variable for not always alocate the memory - int int_for_loop,int_for_internal_loop,int_for_transfer_thread_search,loop_size,loop_sub_size,loop_sub_size_transfer_thread_search,number_rm_path_moved; - TransferThread *temp_transfer_thread; - bool isFound; - bool updateTheStatus_listing,updateTheStatus_copying; - EngineActionInProgress updateTheStatus_action_in_progress; - QSemaphore waitConstructor,waitCancel; - int actionToDoListTransfer_count,actionToDoListInode_count; - bool doTransfer,doInode; - qint64 oversize;//used as temp variable - qint64 currentProgression; - qint64 copiedSize,totalSize,localOverSize; - QList progressionList; - TransferThread* currentTransferThread; - //memory variable for transfer thread creation - bool doRightTransfer; - bool keepDate; - int blockSize; - QStringList drives; - FileExistsAction alwaysDoThisActionForFileExists; - //to return value to the copyEngine - bool returnBoolToCopyEngine; - QPair returnPairQuint64ToCopyEngine; - QList returnListItemOfCopyListToCopyEngine; - ItemOfCopyList returnItemOfCopyListToCopyEngine; - ProgressionItem tempItem; - - void realByteTransfered(); -private slots: - void scanThreadHaveFinish(bool skipFirstRemove=false); - void updateTheStatus(); - void fileTransfer(const QFileInfo &sourceFileInfo,const QFileInfo &destinationFileInfo,const CopyMode &mode); - //mkpath event - void mkPathFirstFolderFinish(); - //rmpath event - void rmPathFirstFolderFinish(); - //transfer is finished - void transferIsFinished(); - /** \brief put the current file at bottom in case of error - \note ONLY IN CASE OF ERROR */ - void transferPutAtBottom(); - //transfer is finished - void transferInodeIsClosed(); - //debug windows if needed - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - void timedUpdateDebugDialog(); - #endif - //dialog message - /// \note Can be call without queue because all call will be serialized - void fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); - /// \note Can be call without queue because all call will be serialized - void errorOnFile(const QFileInfo &fileInfo,const QString &errorString); - /// \note Can be call without queue because all call will be serialized - void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); - /// \note Can be call without queue because all call will be serialized - void errorOnFolder(const QFileInfo &fileInfo,const QString &errorString); - //to run the thread - void run(); - /// \to create transfer thread - void createTransferThread(); - //mk path to do - quint64 addToMkPath(const QString& folder); - //add rm path to do - void addToRmPath(const QString& folder,const int& inodeToRemove); - //rsync rm - void addToRmForRsync(const QString& inode); - //send the progression, after full reset of the interface (then all is empty) - void syncTransferList_internal(); -signals: - //send information about the copy - void actionInProgess(EngineActionInProgress); //should update interface information on this event - - void newActionOnList(const QList &);///very important, need be temporized to group the modification to do and not flood the interface - void syncReady(); - - /** \brief to get the progression for a specific file - * \param id the id of the transfer, id send during population the transfer list - * first = current transfered byte, second = byte to transfer */ - void pushFileProgression(const QList &progressionList); - //get information about the copy - /** \brief to get the general progression - * first = current transfered byte, second = byte to transfer */ - void pushGeneralProgression(const quint64 &,const quint64 &); - - void newFolderListing(const QString &path); - void newCollisionAction(QString action); - void newErrorAction(QString action); - void isInPause(bool); - - //when can be deleted - void canBeDeleted(); - - //send error occurred - void error(QString path,quint64 size,QDateTime mtime,QString error); - //for the extra logging - void rmPath(QString path); - void mkPath(QString path); - /// \brief To debug source - #ifdef ULTRACOPIER_PLUGIN_DEBUG - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - void updateTheDebugInfo(QStringList,QStringList,int); - #endif - - //other signal - /// \note Can be call without queue because all call will be serialized - void send_fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread); - /// \note Can be call without queue because all call will be serialized - void send_errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread); - /// \note Can be call without queue because all call will be serialized - void send_folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread); - /// \note Can be call without queue because all call will be serialized - void send_errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread); - //send the progression - void send_syncTransferList(); - //mkpath error event - void mkPathErrorOnFolder(QFileInfo fileInfo,QString errorString); - //rmpath error event - void rmPathErrorOnFolder(QFileInfo fileInfo,QString errorString); - //to close - void tryCancel(); - //to ask new transfer thread - void askNewTransferThread(); - - void warningTransferList(QString warning); - void errorTransferList(QString error); - void send_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void send_realBytesTransfered(quint64); -}; - -#endif // LISTTHREAD_H diff --git a/plugins-alternative/CopyEngine/Rsync/ListThread_InodeAction.cpp b/plugins-alternative/CopyEngine/Rsync/ListThread_InodeAction.cpp deleted file mode 100644 index c495f60..0000000 --- a/plugins-alternative/CopyEngine/Rsync/ListThread_InodeAction.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** \file ListThread_InodeAction.cpp -\brief To be included into ListThread.cpp, to optimize and prevent code duplication -\see ListThread.cpp -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifdef LISTTHREAD_H - -//do the inode action -actionToDoInode& currentActionToDoInode=actionToDoListInode[int_for_internal_loop]; -switch(currentActionToDoInode.type) -{ -case ActionType_MkPath: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch mkpath: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - mkPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath()); - currentActionToDoInode.isRunning=true; - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; -break; -case ActionType_RmSync: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch rm to sync: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - rmPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath(),true); - currentActionToDoInode.isRunning=true; - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; -break; -case ActionType_RmPath: -/* What is this code? - if((int_for_loop+number_rm_path_moved)>=(loop_size-1)) - { - if(numberOfTranferRuning) - break; - else - currentActionToDoInode.size=0; - }*/ - //then empty (no file), can try remove it - if(true)//currentActionToDoInode.size==0 - { - if(numberOfTranferRuning>0) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("skipped because already inode = 0 and transfer is running: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch rmpath: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - rmPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath(),false); - currentActionToDoInode.isRunning=true; - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - } - else //have not finish all the transfer into it, do it later - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"should never pass here"); - /*actionToDoListInode.move(int_for_internal_loop,actionToDoListInode_count-1); - currentActionToDoInode.id=generateIdNumber(); - number_rm_path_moved++; - currentActionToDoInode.size=0; - continue;*/ - } -break; -default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Wrong type at inode action")); - return; -} - -#endif diff --git a/plugins-alternative/CopyEngine/Rsync/MkPath.cpp b/plugins-alternative/CopyEngine/Rsync/MkPath.cpp deleted file mode 100644 index dd71231..0000000 --- a/plugins-alternative/CopyEngine/Rsync/MkPath.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "MkPath.h" - -MkPath::MkPath() -{ - stopIt=false; - waitAction=false; - setObjectName("MkPath"); - moveToThread(this); - start(); -} - -MkPath::~MkPath() -{ - stopIt=true; - quit(); - wait(); -} - -void MkPath::addPath(const QString &path) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - if(stopIt) - return; - emit internalStartAddPath(path); -} - -void MkPath::skip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartSkip(); -} - -void MkPath::retry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartRetry(); -} - -void MkPath::run() -{ - connect(this,SIGNAL(internalStartAddPath(QString)),this,SLOT(internalAddPath(QString)),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartDoThisPath()),this,SLOT(internalDoThisPath()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartSkip()),this,SLOT(internalSkip()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRetry()),this,SLOT(internalRetry()),Qt::QueuedConnection); - exec(); -} - -void MkPath::internalDoThisPath() -{ - if(waitAction || pathList.isEmpty()) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+pathList.first()); - if(!dir.exists(pathList.first())) - if(!dir.mkpath(pathList.first())) - { - if(!dir.exists(pathList.first())) - { - if(stopIt) - return; - waitAction=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); - emit errorOnFolder(pathList.first(),tr("Unable to create the folder")); - return; - } - } - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -void MkPath::internalAddPath(const QString &path) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - pathList << path; - if(!waitAction) - checkIfCanDoTheNext(); -} - -void MkPath::checkIfCanDoTheNext() -{ - if(!waitAction && !stopIt && pathList.size()>0) - emit internalStartDoThisPath(); -} - -void MkPath::internalSkip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -void MkPath::internalRetry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - checkIfCanDoTheNext(); -} - diff --git a/plugins-alternative/CopyEngine/Rsync/MkPath.h b/plugins-alternative/CopyEngine/Rsync/MkPath.h deleted file mode 100644 index 5d00d60..0000000 --- a/plugins-alternative/CopyEngine/Rsync/MkPath.h +++ /dev/null @@ -1,56 +0,0 @@ -/** \file MkPath.h -\brief Make the path given as queued mkpath -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef MKPATH_H -#define MKPATH_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -/// \brief Make the path given as queued mkpath -class MkPath : public QThread -{ - Q_OBJECT -public: - explicit MkPath(); - ~MkPath(); - /// \brief add path to make - void addPath(const QString &path); -signals: - void errorOnFolder(const QFileInfo &,const QString &); - void firstFolderFinish(); - void internalStartAddPath(const QString &path); - void internalStartDoThisPath(); - void internalStartSkip(); - void internalStartRetry(); - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); -public slots: - /// \brief skip after creation error - void skip(); - /// \brief retry after creation error - void retry(); -private: - void run(); - bool waitAction; - bool stopIt; - bool skipIt; - QStringList pathList; - void checkIfCanDoTheNext(); - QDir dir; -private slots: - void internalDoThisPath(); - void internalAddPath(const QString &path); - void internalSkip(); - void internalRetry(); -}; - -#endif // MKPATH_H diff --git a/plugins-alternative/CopyEngine/Rsync/ReadThread.cpp b/plugins-alternative/CopyEngine/Rsync/ReadThread.cpp deleted file mode 100644 index 3c7bfc1..0000000 --- a/plugins-alternative/CopyEngine/Rsync/ReadThread.cpp +++ /dev/null @@ -1,597 +0,0 @@ -#include "ReadThread.h" - -ReadThread::ReadThread() -{ - start(); - moveToThread(this); - stopIt=false; - putInPause=false; - blockSize=1024*1024; - setObjectName("read"); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - isInReadLoop=false; - tryStartRead=false; - isOpen.release(); -} - -ReadThread::~ReadThread() -{ - stopIt=true; - disconnect(this); - waitNewClockForSpeed.release(); - isOpen.acquire(); - exit(); - wait(); -} - -void ReadThread::run() -{ - connect(this,SIGNAL(internalStartOpen()), this,SLOT(internalOpen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartReopen()), this,SLOT(internalReopen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRead()), this,SLOT(internalRead()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartClose()), this,SLOT(internalClose()), Qt::QueuedConnection); - connect(this,SIGNAL(checkIfIsWait()), this,SLOT(isInWait()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartChecksum()), this,SLOT(checkSum()), Qt::QueuedConnection); - exec(); -} - -void ReadThread::open(const QString &name,const CopyMode &mode) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open source: "+name); - if(file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] previous file is already open: "+file.fileName()+", try open: "+this->name); - return; - } - if(isInReadLoop) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] previous file is already readding: "+file.fileName()+", try open: "+this->name); - return; - } - if(tryStartRead) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] previous file is already try read: "+file.fileName()+", try open: "+this->name); - return; - } - fakeMode=false; - this->name=name; - this->mode=mode; - emit internalStartOpen(); -} - -QString ReadThread::errorString() -{ - return errorString_internal; -} - -void ReadThread::stop() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop()"); - stopIt=true; - if(isOpen.available()>0) - return; - emit internalStartClose(); -} - -bool ReadThread::pause() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] try put read thread in pause"); - putInPause=true; - stopIt=true; - return isInReadLoop; -} - -void ReadThread::resume() -{ - if(putInPause) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - putInPause=false; - stopIt=false; - } - else - return; - if(tryStartRead) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] already in try start"); - return; - } - tryStartRead=true; - if(isInReadLoop) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] is in read loop"); - return; - } - if(!file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] file is not open"); - return; - } - emit internalStartRead(); -} - -bool ReadThread::seek(qint64 position) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start with: "+QString::number(position)); - if(position>file.size()) - return false; - return file.seek(position); -} - -qint64 ReadThread::size() -{ - return file.size(); -} - -void ReadThread::postOperation() -{ - emit internalStartClose(); -} - -void ReadThread::checkSum() -{ - QByteArray blockArray; - QCryptographicHash hash(QCryptographicHash::Sha1); - isInReadLoop=true; - lastGoodPosition=0; - seek(0); - int sizeReaden=0; - do - { - //read one block - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Read; - #endif - blockArray=file.read(blockSize); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(file.error()!=QFile::NoError) - { - errorString_internal=tr("Unable to read the source file: ")+file.errorString()+" ("+QString::number(file.error())+")"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); - emit error(); - isInReadLoop=false; - return; - } - sizeReaden=blockArray.size(); - if(sizeReaden>0) - { - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Checksum; - #endif - hash.addData(blockArray); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(stopIt) - break; - - lastGoodPosition+=blockArray.size(); - - //wait for limitation speed if stop not query - if(maxSpeed>0) - { - numberOfBlockCopied++; - if(numberOfBlockCopied>=MultiForBigSpeed) - { - numberOfBlockCopied=0; - waitNewClockForSpeed.acquire(); - if(stopIt) - break; - } - } - } - } - while(sizeReaden>0 && !stopIt); - if(lastGoodPosition>file.size()) - { - errorString_internal=tr("File truncated during the read, possible data change"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); - emit error(); - isInReadLoop=false; - return; - } - isInReadLoop=false; - if(stopIt) - { - if(putInPause) - emit isInPause(); - stopIt=false; - return; - } - emit checksumFinish(hash.result()); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop the read"); -} - -bool ReadThread::internalOpen(bool resetLastGoodPosition) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] internalOpen source: "+name); - stopIt=false; - putInPause=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=InodeOperation; - #endif - if(file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already open! source: "+name); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } - file.setFileName(name); - QIODevice::OpenMode openMode=QIODevice::ReadOnly; - if(mode==Move) - openMode=QIODevice::ReadWrite; - seekToZero=false; - if(file.open(openMode)) - { - size_at_open=file.size(); - mtime_at_open=QFileInfo(file).lastModified(); - putInPause=false; - if(resetLastGoodPosition) - { - lastGoodPosition=0; - seek(0); - emit opened(); - } - else if(!seek(lastGoodPosition)) - { - errorString_internal=file.errorString(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable to seek after open: %1, error: %2").arg(name).arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - isOpen.acquire(); - return true; - } - else - { - errorString_internal=file.errorString(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable to open: %1, error: %2").arg(name).arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } -} - -void ReadThread::internalRead() -{ - isInReadLoop=true; - tryStartRead=false; - if(stopIt) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] stopIt == true, then quit"); - internalClose(); - return; - } - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=InodeOperation; - #endif - int sizeReaden=0; - if(!file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] is not open!"); - return; - } - QByteArray blockArray; - //numberOfBlockCopied = 0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start the copy"); - emit readIsStarted(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - if(stopIt) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] stopIt == true, then quit"); - internalClose(); - return; - } - do - { - //read one block - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Read; - #endif - blockArray=file.read(blockSize); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(file.error()!=QFile::NoError) - { - errorString_internal=tr("Unable to read the source file: ")+file.errorString()+" ("+QString::number(file.error())+")"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); - emit error(); - isInReadLoop=false; - return; - } - sizeReaden=blockArray.size(); - if(sizeReaden>0) - { - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=WaitWritePipe; - #endif - if(!writeThread->write(blockArray)) - { - if(!stopIt) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] stopped because the write is stopped: "+QString::number(lastGoodPosition)); - stopIt=true; - } - } - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(stopIt) - break; - - lastGoodPosition+=blockArray.size(); - - //wait for limitation speed if stop not query - if(maxSpeed>0) - { - numberOfBlockCopied++; - if(numberOfBlockCopied>=MultiForBigSpeed) - { - numberOfBlockCopied=0; - waitNewClockForSpeed.acquire(); - if(stopIt) - break; - } - } - } - /* - if(lastGoodPosition>16*1024) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Test error in reading: %1 (%2)").arg(file.errorString()).arg(file.error())); - errorString_internal=QString("Test error in reading: %1 (%2)").arg(file.errorString()).arg(file.error()); - emit error(); - isInReadLoop=false; - return; - } - */ - } - while(sizeReaden>0 && !stopIt); - if(lastGoodPosition>file.size()) - { - errorString_internal=tr("File truncated during the read, possible data change"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); - emit error(); - isInReadLoop=false; - return; - } - isInReadLoop=false; - if(stopIt) - { - if(putInPause) - emit isInPause(); - stopIt=false; - return; - } - emit readIsStopped();//will product by signal connection writeThread->endIsDetected(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop the read"); -} - -void ReadThread::startRead() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(tryStartRead) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] already in try start"); - return; - } - if(isInReadLoop) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - else - { - tryStartRead=true; - emit internalStartRead(); - } -} - -void ReadThread::internalClose(bool callByTheDestructor) -{ - /// \note never send signal here, because it's called by the destructor - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(!fakeMode) - file.close(); - if(!callByTheDestructor) - emit closed(); - - /// \note always the last of this function - if(!fakeMode) - isOpen.release(); -} - -/** \brief set block size -\param block the new block size in KB -\return Return true if succes */ -bool ReadThread::setBlockSize(const int blockSize) -{ - if(blockSize<1 || blockSize>16384) - { - this->blockSize=blockSize*1024; - //set the new max speed because the timer have changed - setMaxSpeed(maxSpeed); - return true; - } - else - return false; -} - -/*! \brief Set the max speed -\param tempMaxSpeed Set the max speed in KB/s, 0 for no limit */ -int ReadThread::setMaxSpeed(const int maxSpeed) -{ - if(this->maxSpeed==0 && maxSpeed==0 && waitNewClockForSpeed.available()>0) - waitNewClockForSpeed.tryAcquire(waitNewClockForSpeed.available()); - this->maxSpeed=maxSpeed; - if(this->maxSpeed>0) - { - int NewInterval,newMultiForBigSpeed=0; - do - { - newMultiForBigSpeed++; - NewInterval=(blockSize*newMultiForBigSpeed)/(this->maxSpeed); - } - while (NewIntervalULTRACOPIER_PLUGIN_MAXTIMERINTERVAL) - { - NewInterval=ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL; - newMultiForBigSpeed=1; - blockSize=this->maxSpeed*NewInterval; - } - MultiForBigSpeed=newMultiForBigSpeed; - return NewInterval; - } - else - { - waitNewClockForSpeed.release(); - return 0; - } -} - -/// \brief For give timer every X ms -void ReadThread::timeOfTheBlockCopyFinished() -{ - if(waitNewClockForSpeed.available()file.size()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] Bug, the lastGoodPosition is greater than the file size!"); - return file.size(); - } - else*/ - return lastGoodPosition; -} - -//reopen after an error -void ReadThread::reopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(isInReadLoop) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] try reopen where read is not finish"); - return; - } - stopIt=true; - emit internalStartReopen(); -} - -bool ReadThread::internalReopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - stopIt=false; - file.close(); - if(size_at_open!=file.size() && mtime_at_open!=QFileInfo(file).lastModified()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] source file have changed since the last open, restart all"); - //fix this function like the close function - if(internalOpen(true)) - { - emit resumeAfterErrorByRestartAll(); - return true; - } - else - return false; - } - else - { - //fix this function like the close function - if(internalOpen(false)) - { - emit resumeAfterErrorByRestartAtTheLastPosition(); - return true; - } - else - return false; - } -} - -//set the write thread -void ReadThread::setWriteThread(WriteThread * writeThread) -{ - this->writeThread=writeThread; -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG -//to set the id -void ReadThread::setId(int id) -{ - this->id=id; -} -#endif - -void ReadThread::seekToZeroAndWait() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - stopIt=true; - seekToZero=true; - emit checkIfIsWait(); -} - -void ReadThread::isInWait() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(seekToZero) - { - seekToZero=false; - if(file.isOpen()) - seek(0); - else - internalOpen(true); - emit isSeekToZeroAndWait(); - } -} - -bool ReadThread::isReading() -{ - return isInReadLoop; -} - diff --git a/plugins-alternative/CopyEngine/Rsync/ReadThread.h b/plugins-alternative/CopyEngine/Rsync/ReadThread.h deleted file mode 100644 index 1d1eabc..0000000 --- a/plugins-alternative/CopyEngine/Rsync/ReadThread.h +++ /dev/null @@ -1,144 +0,0 @@ -/** \file ReadThread.h -\brief Thread changed to open/close and read the source file -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef READTHREAD_H -#define READTHREAD_H - -#include -#include -#include -#include -#include -#include -#include - -#include "WriteThread.h" -#include "Environment.h" -#include "StructEnumDefinition_CopyEngine.h" -#include "AvancedQFile.h" - -/// \brief Thread changed to open/close and read the source file -class ReadThread : public QThread -{ - Q_OBJECT -public: - explicit ReadThread(); - ~ReadThread(); -protected: - void run(); -public: - /// \brief open with the name and copy mode - void open(const QString &name,const CopyMode &mode); - /// \brief return the error string - QString errorString(); - //QByteArray read(qint64 position,qint64 maxSize); - /// \brief stop the copy - void stop(); - /// \brief put the copy in pause - bool pause(); - /// \brief resume the copy - void resume(); - /// \brief get the size of the source file - qint64 size(); - /// \brief get the last good position - qint64 getLastGoodPosition(); - /// \brief start the reading of the source file - void startRead(); - /// \brief set the current max speed in KB/s - int setMaxSpeed(int maxSpeed); - /// \brief set block size in KB - bool setBlockSize(const int blockSize); - /// \brief reopen after an error - void reopen(); - /// \brief set the write thread - void setWriteThread(WriteThread * writeThread); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief to set the id - void setId(int id); - /// \brief stat - enum ReadStat - { - Idle=0, - InodeOperation=1, - Read=2, - WaitWritePipe=3, - Checksum=4 - }; - ReadStat stat; - #endif - /// \brief return if it's reading - bool isReading(); - /// \brief executed at regular interval to do a speed throling - void timeOfTheBlockCopyFinished(); - /// \brief do the fake open - void fakeOpen(); - /// \brief do the fake readIsStarted - void fakeReadIsStarted(); - /// \brief do the fake readIsStopped - void fakeReadIsStopped(); - /// do the checksum - void startCheckSum(); -public slots: - /// \brief to reset the copy, and put at the same state when it just open - void seekToZeroAndWait(); - void postOperation(); - /// do the checksum - void checkSum(); -signals: - void error(); - void isInPause(); - void opened(); - void readIsStarted(); - void readIsStopped(); - void closed(); - void isSeekToZeroAndWait(); - void checkIfIsWait(); - void resumeAfterErrorByRestartAll(); - void resumeAfterErrorByRestartAtTheLastPosition(); - void checksumFinish(const QByteArray&); - // internal signals - void internalStartOpen(); - void internalStartChecksum(); - void internalStartReopen(); - void internalStartRead(); - void internalStartClose(); - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - -private: - QString name; - QString errorString_internal; - AvancedQFile file; - volatile bool stopIt; - CopyMode mode; - qint64 lastGoodPosition; - volatile int blockSize; - volatile int maxSpeed; ///< The max speed in KB/s, 0 for no limit - QSemaphore waitNewClockForSpeed; - volatile int numberOfBlockCopied; ///< Multiple for count the number of block copied - volatile int multiplicatorForBigSpeed; ///< Multiple for count the number of block needed - volatile int MultiForBigSpeed; - WriteThread* writeThread; - int id; - QSemaphore isOpen; - volatile bool putInPause; - volatile bool isInReadLoop; - volatile bool seekToZero; - volatile bool tryStartRead; - qint64 size_at_open; - QDateTime mtime_at_open; - bool fakeMode; - //internal function - bool seek(qint64 position);/// \todo search if is use full -private slots: - bool internalOpen(bool resetLastGoodPosition=true); - bool internalReopen(); - void internalRead(); - void internalClose(bool callByTheDestructor=false); - void isInWait(); -}; - -#endif // READTHREAD_H diff --git a/plugins-alternative/CopyEngine/Rsync/RenamingRules.cpp b/plugins-alternative/CopyEngine/Rsync/RenamingRules.cpp deleted file mode 100644 index a09f66a..0000000 --- a/plugins-alternative/CopyEngine/Rsync/RenamingRules.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "RenamingRules.h" -#include "ui_RenamingRules.h" - -#include - -RenamingRules::RenamingRules(QWidget *parent) : - QDialog(parent), - ui(new Ui::RenamingRules) -{ - ui->setupUi(this); - connectUI(); - setRenamingRules("",""); -} - -RenamingRules::~RenamingRules() -{ - delete ui; -} - -void RenamingRules::on_buttonBox_clicked(QAbstractButton *button) -{ - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) - reject(); - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::ResetRole) - { - setRenamingRules("",""); - emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); - } -} - -void RenamingRules::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - disconnectUI(); - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - if(!firstRenamingRule.isEmpty()) - ui->firstRenamingRule->setText(firstRenamingRule); - else - ui->firstRenamingRule->setText(tr("%1 - copy").arg("%name%")); - if(!otherRenamingRule.isEmpty()) - ui->otherRenamingRule->setText(otherRenamingRule); - else - ui->otherRenamingRule->setText(tr("%1 - copy (%2)").arg("%name%").arg("%number%")); - connectUI(); -} - -void RenamingRules::connectUI() -{ - connect(ui->firstRenamingRule,SIGNAL(editingFinished()),this,SLOT(firstRenamingRule_haveChanged())); - connect(ui->otherRenamingRule,SIGNAL(editingFinished()),this,SLOT(otherRenamingRule_haveChanged())); -} - -void RenamingRules::disconnectUI() -{ - disconnect(ui->firstRenamingRule,SIGNAL(editingFinished()),this,SLOT(firstRenamingRule_haveChanged())); - disconnect(ui->otherRenamingRule,SIGNAL(editingFinished()),this,SLOT(otherRenamingRule_haveChanged())); -} - -void RenamingRules::firstRenamingRule_haveChanged() -{ - QString newValue=ui->firstRenamingRule->text(); - if(newValue==tr("%1 - copy").arg("%name%")) - newValue=""; - if(newValue==firstRenamingRule) - return; - firstRenamingRule=newValue; - emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void RenamingRules::otherRenamingRule_haveChanged() -{ - QString newValue=ui->otherRenamingRule->text(); - if(newValue==tr("%1 - copy (%2)").arg("%name%").arg("%number%")) - newValue=""; - if(newValue==otherRenamingRule) - return; - otherRenamingRule=newValue; - emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void RenamingRules::newLanguageLoaded() -{ - ui->retranslateUi(this); - setRenamingRules(firstRenamingRule,otherRenamingRule); -} diff --git a/plugins-alternative/CopyEngine/Rsync/RenamingRules.h b/plugins-alternative/CopyEngine/Rsync/RenamingRules.h deleted file mode 100644 index 2fd9580..0000000 --- a/plugins-alternative/CopyEngine/Rsync/RenamingRules.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef RENAMINGRULES_H -#define RENAMINGRULES_H - -#include -#include - -namespace Ui { -class RenamingRules; -} - -/** Define rules for renaming */ -class RenamingRules : public QDialog -{ - Q_OBJECT -public: - explicit RenamingRules(QWidget *parent = 0); - ~RenamingRules(); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void newLanguageLoaded(); -private: - Ui::RenamingRules *ui; - void connectUI(); - void disconnectUI(); - QString firstRenamingRule; - QString otherRenamingRule; -private slots: - void on_buttonBox_clicked(QAbstractButton *button); - void firstRenamingRule_haveChanged(); - void otherRenamingRule_haveChanged(); -signals: - void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -}; - -#endif // RENAMINGRULES_H diff --git a/plugins-alternative/CopyEngine/Rsync/RenamingRules.ui b/plugins-alternative/CopyEngine/Rsync/RenamingRules.ui deleted file mode 100644 index 9e84f4b..0000000 --- a/plugins-alternative/CopyEngine/Rsync/RenamingRules.ui +++ /dev/null @@ -1,129 +0,0 @@ - - - RenamingRules - - - - 0 - 0 - 303 - 213 - - - - Renaming rules - - - - 2 - - - 2 - - - - - First renaming - - - - - - %name% - copy - - - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - - - - - - - - - - Second renaming - - - - - - %name% - copy (%number%) - - - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - - - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close|QDialogButtonBox::RestoreDefaults - - - - - - - - - buttonBox - accepted() - RenamingRules - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - RenamingRules - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/RmPath.cpp b/plugins-alternative/CopyEngine/Rsync/RmPath.cpp deleted file mode 100644 index 636b5ba..0000000 --- a/plugins-alternative/CopyEngine/Rsync/RmPath.cpp +++ /dev/null @@ -1,179 +0,0 @@ -#include "RmPath.h" - -RmPath::RmPath() -{ - stopIt=false; - waitAction=false; - setObjectName("RmPath"); - moveToThread(this); - start(); -} - -RmPath::~RmPath() -{ - stopIt=true; - quit(); - wait(); -} - -void RmPath::addPath(const QString &path,const bool &toSync) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - if(stopIt) - return; - emit internalStartAddPath(path,toSync); -} - -void RmPath::skip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartSkip(); -} - -void RmPath::retry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartRetry(); -} - -void RmPath::run() -{ - connect(this,SIGNAL(internalStartAddPath(QString,bool)),this,SLOT(internalAddPath(QString,bool)),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartDoThisPath()),this,SLOT(internalDoThisPath()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartSkip()),this,SLOT(internalSkip()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRetry()),this,SLOT(internalRetry()),Qt::QueuedConnection); - exec(); -} - -void RmPath::internalDoThisPath() -{ - if(waitAction || pathList.isEmpty()) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+pathList.first()); - if(!toSyncList.first()) - { - if(!rmpath(pathList.first(),false)) - { - if(stopIt) - return; - waitAction=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); - emit errorOnFolder(pathList.first(),tr("Unable to remove the folder")); - return; - } - } - else - { - if(QFileInfo(pathList.first()).isDir()) - { - if(!rmpath(pathList.first(),true)) - { - if(stopIt) - return; - waitAction=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); - emit errorOnFolder(pathList.first(),tr("Unable to remove the folder")); - return; - } - } - else if(!rmfile(pathList.first())) - { - if(stopIt) - return; - waitAction=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the file: "+pathList.first()); - emit errorOnFolder(pathList.first(),tr("Unable to remove the file")); - return; - } - } - pathList.removeFirst(); - toSyncList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -bool RmPath::rmfile(QString filePath) -{ - QFile file(filePath); - if(!file.remove()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove the file: "+file.fileName()+", error: "+file.errorString()); - return false; - } - else - return true; -} - -/** remplace QDir::rmpath() because it return false if the folder not exists - and seam bug with parent folder */ -bool RmPath::rmpath(const QDir &dir,const bool &toSync) -{ - if(!dir.exists()) - return true; - bool allHaveWork=true; - QFileInfoList list = dir.entryInfoList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System,QDir::DirsFirst); - for (int i = 0; i < list.size(); ++i) - { - QFileInfo fileInfo(list.at(i)); - if(!fileInfo.isDir()) - { - if(toSync) - { - if(!rmfile(fileInfo.absoluteFilePath())) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove a file: "+fileInfo.fileName()); - allHaveWork=false; - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"found a file: "+fileInfo.fileName()); - allHaveWork=false; - } - } - else - { - //return the fonction for scan the new folder - if(!rmpath(dir.absolutePath()+'/'+fileInfo.fileName()+'/',toSync)) - allHaveWork=false; - } - } - if(!allHaveWork) - return false; - allHaveWork=dir.rmdir(dir.absolutePath()); - if(!allHaveWork) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove the folder: "+dir.absolutePath()); - return allHaveWork; -} - -void RmPath::internalAddPath(const QString &path,const bool &toSync) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - pathList << path; - toSyncList << toSync; - if(!waitAction) - checkIfCanDoTheNext(); -} - -void RmPath::checkIfCanDoTheNext() -{ - if(!waitAction && !stopIt && pathList.size()>0) - emit internalStartDoThisPath(); -} - -void RmPath::internalSkip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -void RmPath::internalRetry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - checkIfCanDoTheNext(); -} - diff --git a/plugins-alternative/CopyEngine/Rsync/RmPath.h b/plugins-alternative/CopyEngine/Rsync/RmPath.h deleted file mode 100644 index c3cd77b..0000000 --- a/plugins-alternative/CopyEngine/Rsync/RmPath.h +++ /dev/null @@ -1,58 +0,0 @@ -/** \file RmPath.h -\brief Remove the path given as queued rmpath -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef RMPATH_H -#define RMPATH_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -/// \brief Remove the path given as queued rmpath -class RmPath : public QThread -{ - Q_OBJECT -public: - explicit RmPath(); - ~RmPath(); - /// \brief add new path to remove - void addPath(const QString &path,const bool &toSync); -signals: - void errorOnFolder(const QFileInfo &,const QString &); - void firstFolderFinish(); - void internalStartAddPath(const QString &path,const bool &toSync); - void internalStartDoThisPath(); - void internalStartSkip(); - void internalStartRetry(); - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); -public slots: - void skip(); - void retry(); -private: - void run(); - bool waitAction; - bool stopIt; - bool skipIt; - QStringList pathList; - QList toSyncList; - void checkIfCanDoTheNext(); - QDir dir; - bool rmpath(const QDir &dir,const bool &toSync); - bool rmfile(QString filePath); -private slots: - void internalDoThisPath(); - void internalAddPath(const QString &path,const bool &toSync); - void internalSkip(); - void internalRetry(); -}; - - -#endif // RMPATH_H diff --git a/plugins-alternative/CopyEngine/Rsync/StructEnumDefinition.h b/plugins-alternative/CopyEngine/Rsync/StructEnumDefinition.h deleted file mode 100644 index c1758f4..0000000 --- a/plugins-alternative/CopyEngine/Rsync/StructEnumDefinition.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/CopyEngine/Rsync/StructEnumDefinition_CopyEngine.h b/plugins-alternative/CopyEngine/Rsync/StructEnumDefinition_CopyEngine.h deleted file mode 100644 index 90af91b..0000000 --- a/plugins-alternative/CopyEngine/Rsync/StructEnumDefinition_CopyEngine.h +++ /dev/null @@ -1,90 +0,0 @@ -/** \file StructEnumDefinition_CopyEngine.h -\brief Define the structure and enumeration used in the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include - -#ifndef STRUCTDEF_COPYENGINE_H -#define STRUCTDEF_COPYENGINE_H - -/// \brief Define action if file exists -enum FileExistsAction -{ - FileExists_NotSet, - FileExists_Cancel, - FileExists_Skip, - FileExists_Overwrite, - FileExists_OverwriteIfNewer, - FileExists_OverwriteIfNotSameModificationDate, - FileExists_Rename -}; - -/// \brief Define action if file error -enum FileErrorAction -{ - FileError_NotSet, - FileError_Cancel, - FileError_Skip, - FileError_Retry, - FileError_PutToEndOfTheList -}; - -/// \brief to have the transfer status -enum TransferStat -{ - TransferStat_Idle=0, - TransferStat_PreOperation=1, - TransferStat_WaitForTheTransfer=2, - TransferStat_Transfer=3, - TransferStat_Checksum=4, - TransferStat_PostTransfer=5, - TransferStat_PostOperation=6 -}; - -/// \brief Define overwrite mode -/*enum OverwriteMode -{ - OverwriteMode_None, - OverwriteMode_Overwrite, - OverwriteMode_OverwriteIfNewer, - OverwriteMode_OverwriteIfNotSameModificationDate -};*/ - -/// \brief Define action if file exists -enum FolderExistsAction -{ - FolderExists_NotSet, - FolderExists_Cancel, - FolderExists_Merge, - FolderExists_Skip, - FolderExists_Rename -}; - -enum SearchType -{ - SearchType_rawText, - SearchType_simpleRegex, - SearchType_perlRegex, -}; - -enum ApplyOn -{ - ApplyOn_file, - ApplyOn_fileAndFolder, - ApplyOn_folder, -}; - -/** to store into different way the filter rules to be exported */ -struct Filters_rules -{ - QString search_text; - SearchType search_type; - ApplyOn apply_on; - bool need_match_all; - QRegExp regex; -}; - -#endif // STRUCTDEF_COPYENGINE_H diff --git a/plugins-alternative/CopyEngine/Rsync/TransferThread.cpp b/plugins-alternative/CopyEngine/Rsync/TransferThread.cpp deleted file mode 100644 index 5557a1e..0000000 --- a/plugins-alternative/CopyEngine/Rsync/TransferThread.cpp +++ /dev/null @@ -1,1252 +0,0 @@ -//presume bug linked as multple paralelle inode to resume after "overwrite" -//then do overwrite node function to not re-set the file name - -#include "TransferThread.h" - -#ifdef Q_CC_GNU -//this next header is needed to change file time/date under gcc -#include -#include -#include -#include -#endif - -#ifndef Q_OS_UNIX -#include -#endif - -TransferThread::TransferThread() -{ - start(); - moveToThread(this); - needSkip = false; - transfer_stat = TransferStat_Idle; - stopIt = false; - fileExistsAction = FileExists_NotSet; - alwaysDoFileExistsAction= FileExists_NotSet; - readError = false; - writeError = false; - rsync = false; - this->mkpathTransfer = mkpathTransfer; - readThread.setWriteThread(&writeThread); - - connect(&clockForTheCopySpeed, SIGNAL(timeout()), this, SLOT(timeOfTheBlockCopyFinished())); - maxTime=QDateTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); -} - -TransferThread::~TransferThread() -{ - exit(); - disconnect(&readThread); - disconnect(&writeThread); - disconnect(this); - wait(); -} - -void TransferThread::run() -{ - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start: "+QString::number((qint64)QThread::currentThreadId())); - transfer_stat = TransferStat_Idle; - stopIt = false; - fileExistsAction = FileExists_NotSet; - alwaysDoFileExistsAction= FileExists_NotSet; - //the error push - connect(&readThread,SIGNAL(error()), this, SLOT(getReadError()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(error()), this, SLOT(getWriteError()), Qt::QueuedConnection); - //the thread change operation - connect(this,SIGNAL(internalStartPreOperation()), this, SLOT(preOperation()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartPostOperation()), this, SLOT(postOperation()), Qt::QueuedConnection); - //the state change operation - //connect(&readThread,SIGNAL(readIsStopped()), &readThread, SLOT(postOperation()), Qt::QueuedConnection);//commented to do the checksum - connect(&readThread,SIGNAL(opened()), this, SLOT(readIsReady()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(opened()), this, SLOT(writeIsReady()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(readIsStopped()), this, SLOT(readIsStopped()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(writeIsStopped()), this, SLOT(writeIsStopped()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(readIsStopped()), &writeThread, SLOT(endIsDetected()), Qt::QueuedConnection); - //connect(&writeThread,SIGNAL(writeIsStopped()), &writeThread, SLOT(postOperation()), Qt::QueuedConnection);//commented to do the checksum - connect(&readThread,SIGNAL(closed()), this, SLOT(readIsClosed()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(closed()), this, SLOT(writeIsClosed()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(reopened()), this, SLOT(writeThreadIsReopened()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(checksumFinish(QByteArray)), this, SLOT(readChecksumFinish(QByteArray)), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(checksumFinish(QByteArray)),this, SLOT(writeChecksumFinish(QByteArray)), Qt::QueuedConnection); - //error management - connect(&readThread,SIGNAL(isSeekToZeroAndWait()), this, SLOT(readThreadIsSeekToZeroAndWait()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(resumeAfterErrorByRestartAtTheLastPosition()), this, SLOT(readThreadResumeAfterError()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(resumeAfterErrorByRestartAll()), &writeThread, SLOT(flushAndSeekToZero()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(flushedAndSeekedToZero()), this, SLOT(readThreadResumeAfterError()), Qt::QueuedConnection); - connect(this,SIGNAL(internalTryStartTheTransfer()), this, SLOT(internalStartTheTransfer()), Qt::QueuedConnection); - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&readThread,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),Qt::QueuedConnection); - connect(&writeThread,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),Qt::QueuedConnection); - #endif - - exec(); -} - -TransferStat TransferThread::getStat() -{ - return transfer_stat; -} - -void TransferThread::startTheTransfer() -{ - emit internalTryStartTheTransfer(); -} - -void TransferThread::internalStartTheTransfer() -{ - if(transfer_stat==TransferStat_Idle) - { - if(mode!=Move) - { - /// \bug can pass here because in case of direct move on same media, it return to idle stat directly - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] can't start transfert at idle"); - } - return; - } - if(transfer_stat==TransferStat_PostOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] can't start transfert at PostOperation"); - return; - } - if(transfer_stat==TransferStat_Transfer) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] can't start transfert at Transfer"); - return; - } - if(canStartTransfer) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] canStartTransfer is already set to true"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] check how start the transfer"); - canStartTransfer=true; - if(readIsReadyVariable && writeIsReadyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start directly the transfer"); - ifCanStartTransfer(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start the transfer as delayed"); -} - -void TransferThread::setFiles(const QString &source,const qint64 &size,const QString &destination,const CopyMode &mode) -{ - if(transfer_stat!=TransferStat_Idle) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - //to prevent multiple file alocation into ListThread::doNewActions_inode_manipulation() - transfer_stat = TransferStat_PreOperation; - //emit pushStat(stat,transferId); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start, source: "+source+", destination: "+destination); - this->source = source; - this->destination = destination; - this->mode = mode; - this->size = size; - fileExistsAction = FileExists_NotSet; - canStartTransfer = false; - sended_state_preOperationStopped= false; - canBeMovedDirectlyVariable = false; - fileContentError = false; - resetExtraVariable(); - emit internalStartPreOperation(); -} - -void TransferThread::setFileExistsAction(const FileExistsAction &action) -{ - if(transfer_stat!=TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] action: "+QString::number(action)); - if(action!=FileExists_Rename) - fileExistsAction = action; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] rename at the wrong part, source: "+source+", destination: "+destination); - if(action==FileExists_Skip) - { - skip(); - return; - } - resetExtraVariable(); - emit internalStartPreOperation(); -} - -void TransferThread::setFileRename(const QString &nameForRename) -{ - if(transfer_stat!=TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] nameForRename: "+nameForRename); - destinationInfo.setFile(destination); - destination=destinationInfo.absolutePath(); - destination+=QDir::separator()+nameForRename; - destinationInfo.setFile(destination); - fileExistsAction = FileExists_NotSet; - resetExtraVariable(); - emit internalStartPreOperation(); -} - -void TransferThread::setAlwaysFileExistsAction(const FileExistsAction &action) -{ - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] action to do always: "+QString::number(action)); - alwaysDoFileExistsAction=action; -} - -void TransferThread::resetExtraVariable() -{ - sended_state_readStopped = false; - sended_state_writeStopped = false; - writeError = false; - readError = false; - readIsReadyVariable = false; - writeIsReadyVariable = false; - readIsFinishVariable = false; - writeIsFinishVariable = false; - readIsClosedVariable = false; - writeIsClosedVariable = false; - needSkip = false; - retry = false; - readIsOpenVariable = false; - writeIsOpenVariable = false; -} - -void TransferThread::preOperation() -{ - if(transfer_stat!=TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - needRemove=false; - sourceInfo.setFile(source); - destinationInfo.setFile(destination); - if(isSame()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] is same"+source); - return; - } - if(destinationExists()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] destination exists: "+source); - return; - } - if(canBeMovedDirectly()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] need moved directly: "+source); - canBeMovedDirectlyVariable=true; - readThread.fakeOpen(); - writeThread.fakeOpen(); - return; - } - tryOpen(); -} - -void TransferThread::tryOpen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start source and destination: "+source+" and "+destination); - if(!readIsOpenVariable) - { - readError=false; - readThread.open(source,mode); - } - if(!writeIsOpenVariable) - { - writeError=false; - writeThread.open(destination,size,osBuffer && (!osBufferLimited || (osBufferLimited && sizeacquire(); - if(!dir.exists()) - dir.mkpath(destinationInfo.absolutePath()); - mkpathTransfer->release(); - } - if(!sourceFile.rename(destinationFile.fileName())) - { - if(sourceFile.exists()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("file not not exists %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); - else if(!dir.exists()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("destination folder not exists %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("unable to do real move %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); - emit errorOnFile(sourceFile,sourceFile.errorString()); - return; - } - readThread.fakeReadIsStarted(); - writeThread.fakeWriteIsStarted(); - readThread.fakeReadIsStopped(); - writeThread.fakeWriteIsStopped(); -} - -bool TransferThread::canBeMovedDirectly() -{ - //move if on same mount point - #if defined (Q_OS_LINUX) || defined (Q_OS_WIN32) - if(mode!=Move) - return false; - if(mountSysPoint.size()==0) - return false; - if(getDrive(destinationInfo.fileName())==getDrive(sourceInfo.fileName())) - return true; - #endif - return false; -} - -void TransferThread::readIsReady() -{ - if(readIsReadyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readIsReadyVariable=true; - readIsOpenVariable=true; - readIsClosedVariable=false; - ifCanStartTransfer(); -} - -void TransferThread::ifCanStartTransfer() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] readIsReadyVariable: "+QString::number(readIsReadyVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)); - if(readIsReadyVariable && writeIsReadyVariable) - { - transfer_stat=TransferStat_WaitForTheTransfer; - sended_state_readStopped = false; - sended_state_writeStopped = false; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stat=WaitForTheTransfer"); - if(!sended_state_preOperationStopped) - { - sended_state_preOperationStopped=true; - emit preOperationStopped(); - } - if(canStartTransfer) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stat=Transfer"); - transfer_stat=TransferStat_Transfer; - if(!canBeMovedDirectlyVariable) - { - needRemove=true; - readThread.startRead(); - } - else - tryMoveDirectly(); - emit pushStat(transfer_stat,transferId); - } - //else - //emit pushStat(stat,transferId); - } -} - -void TransferThread::writeIsReady() -{ - if(writeIsReadyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - writeIsReadyVariable=true; - writeIsOpenVariable=true; - writeIsClosedVariable=false; - ifCanStartTransfer(); -} - - -//set the copy info and options before runing -void TransferThread::setRightTransfer(const bool doRightTransfer) -{ - this->doRightTransfer=doRightTransfer; -} - -//set keep date -void TransferThread::setKeepDate(const bool keepDate) -{ - this->keepDate=keepDate; -} - -//set the current max speed in KB/s -void TransferThread::setMaxSpeed(int maxSpeed) -{ - int interval=readThread.setMaxSpeed(maxSpeed); - writeThread.setMaxSpeed(maxSpeed); - if(maxSpeed>0) - { - clockForTheCopySpeed.setInterval(interval); - if(!clockForTheCopySpeed.isActive())//seam useless !this->isFinished() - clockForTheCopySpeed.start(); - } - else - { - if(clockForTheCopySpeed.isActive()) - clockForTheCopySpeed.stop(); - } -} - -//set block size in KB -bool TransferThread::setBlockSize(const unsigned int blockSize) -{ - this->blockSize=blockSize; - return readThread.setBlockSize(blockSize) && writeThread.setBlockSize(blockSize); -} - -//pause the copy -void TransferThread::pause() -{ - if(transfer_stat==TransferStat_Idle) - return; - readThread.pause(); -} - -//resume the copy -void TransferThread::resume() -{ - if(transfer_stat==TransferStat_Idle) - return; - readThread.resume(); -} - -//stop the current copy -void TransferThread::stop() -{ - stopIt=true; - if(transfer_stat==TransferStat_Idle) - return; - readThread.stop(); - writeThread.stop(); -} - -void TransferThread::readIsFinish() -{ - if(readIsFinishVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readIsFinishVariable=true; - canStartTransfer=false; - //check here if need start checksuming or not - real_doChecksum=doChecksum && (!checksumOnlyOnError || fileContentError); - if(real_doChecksum) - { - readIsFinishVariable=false; - transfer_stat=TransferStat_Checksum; - sourceChecksum=QByteArray(); - destinationChecksum=QByteArray(); - readThread.startCheckSum(); - } - else - { - transfer_stat=TransferStat_PostTransfer; - readThread.postOperation(); - } - emit pushStat(transfer_stat,transferId); -} - -void TransferThread::writeIsFinish() -{ - if(writeIsFinishVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - writeIsFinishVariable=true; - //check here if need start checksuming or not - if(real_doChecksum) - { - writeIsFinishVariable=false; - transfer_stat=TransferStat_Checksum; - writeThread.startCheckSum(); - } - else - writeThread.postOperation(); -} - -void TransferThread::readChecksumFinish(const QByteArray& checksum) -{ - sourceChecksum=checksum; - compareChecksum(); -} - -void TransferThread::writeChecksumFinish(const QByteArray& checksum) -{ - destinationChecksum=checksum; - compareChecksum(); -} - -void TransferThread::compareChecksum() -{ - if(sourceChecksum.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] the checksum of source is missing"); - return; - } - if(destinationChecksum.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] the checksum of destination is missing"); - return; - } - if(sourceChecksum==destinationChecksum) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] the checksum match"); - readThread.postOperation(); - writeThread.postOperation(); - transfer_stat=TransferStat_PostTransfer; - emit pushStat(transfer_stat,transferId); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] the checksum not match"); - //emit error here, and wait to resume - emit errorOnFile(destinationInfo,tr("The checksums not match")); - } -} - -void TransferThread::readIsClosed() -{ - if(readIsClosedVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readIsClosedVariable=true; - checkIfAllIsClosed(); -} - -void TransferThread::writeIsClosed() -{ - if(writeIsClosedVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - writeIsClosedVariable=true; - checkIfAllIsClosed(); -} - -bool TransferThread::checkIfAllIsClosed() -{ - if((readError || writeError) && !needSkip) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] resolve error before progress"); - return false; - } - if((!readIsReadyVariable || readIsClosedVariable) && (!writeIsReadyVariable || writeIsClosedVariable)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit internalStartPostOperation() to do the real post operation"); - transfer_stat=TransferStat_PostOperation; - //emit pushStat(stat,transferId); - emit internalStartPostOperation(); - return true; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] "+QString("wait self close: readIsReadyVariable: %1, readIsClosedVariable: %2, writeIsReadyVariable: %3, writeIsClosedVariable: %4") - .arg(readIsReadyVariable) - .arg(readIsClosedVariable) - .arg(writeIsReadyVariable) - .arg(writeIsClosedVariable) - ); - return false; - } -} - -/// \todo found way to retry that's -/// \todo the rights copy -void TransferThread::postOperation() -{ - if(transfer_stat!=TransferStat_PostOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] need be in transfer, source: "+source+", destination: "+destination+", stat:"+QString::number(transfer_stat)); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - //all except closing - if((readError || writeError) && !needSkip)//normally useless by checkIfAllIsFinish() - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] resume after error"); - return; - } - - if(!needSkip) - { - if(!doFilePostOperation()) - return; - - //remove source in moving mode - if(mode==Move && !canBeMovedDirectlyVariable) - { - if(QFile::exists(destination)) - { - QFile sourceFile(source); - if(!sourceFile.remove()) - { - emit errorOnFile(sourceInfo,sourceFile.errorString()); - return; - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] try remove source but destination not exists!"); - } - } - else//do difference skip a file and skip this error case - { - if(needRemove && QFile::exists(destination)) - { - QFile destinationFile(destination); - if(!destinationFile.remove()) - { - //emit errorOnFile(sourceInfo,destinationFile.errorString()); - //return; - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] try remove destination but not exists!"); - } - transfer_stat=TransferStat_Idle; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit postOperationStopped()"); - emit postOperationStopped(); -} - -bool TransferThread::doFilePostOperation() -{ - //do operation needed by copy - if(!canBeMovedDirectlyVariable) - { - //set the time if no write thread used - if(keepDate) - changeFileDateTime(destination,source);//can't do that's after move because after move the source not exist - /* - ignore it, because need correct management, mainly with move - if(!) - { - emit errorOnFile(destinationInfo,tr("Unable to change the date"));//destination.errorString() - return false; - }*/ - } - - if(stopIt) - return false; - - return true; -} - -////////////////////////////////////////////////////////////////// -/////////////////////// Error management ///////////////////////// -////////////////////////////////////////////////////////////////// - -void TransferThread::getWriteError() -{ - if(writeError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already in write error!"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - fileContentError = true; - writeError = true; - writeIsReadyVariable = false; - writeError_source_seeked = false; - writeError_destination_reopened = false; - emit errorOnFile(destinationInfo,writeThread.errorString()); -} - -void TransferThread::getReadError() -{ - if(readError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already in read error!"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - fileContentError = true; - readError = true; - writeIsReadyVariable = false; - readIsReadyVariable = false; - emit errorOnFile(sourceInfo,readThread.errorString()); -} - -//retry after error -void TransferThread::retryAfterError() -{ - //opening error - if(transfer_stat==TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] is not idle, source: "+source+", destination: "+destination+", stat: "+QString::number(transfer_stat)); - tryOpen(); - return; - } - //data streaming error - if(transfer_stat!=TransferStat_PostOperation && transfer_stat!=TransferStat_Transfer && transfer_stat!=TransferStat_Checksum) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] is not idle, source: "+source+", destination: "+destination+", stat: "+QString::number(transfer_stat)); - return; - } - if(canBeMovedDirectlyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] retry the system move"); - tryMoveDirectly(); - return; - } - if(transfer_stat==TransferStat_Checksum) - { - if(writeError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the write error"); - writeThread.reopen(); - } - else if(readError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the read error"); - readThread.reopen(); - } - else //only checksum difference - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] retry all the transfer"); - canStartTransfer=true; - ifCanStartTransfer(); - } - return; - } - if(writeError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the write error"); - readThread.seekToZeroAndWait(); - writeThread.reopen(); - } - else if(readError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the read error"); - readThread.reopen(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unknow error resume"); -} - -void TransferThread::writeThreadIsReopened() -{ - if(writeError_destination_reopened) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - writeError_destination_reopened=true; - if(transfer_stat==TransferStat_Checksum) - { - writeThread.startCheckSum(); - return; - } - if(writeError_source_seeked && writeError_destination_reopened) - resumeTransferAfterWriteError(); -} - -void TransferThread::readThreadIsSeekToZeroAndWait() -{ - if(writeError_source_seeked) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - writeError_source_seeked=true; - if(writeError_source_seeked && writeError_destination_reopened) - resumeTransferAfterWriteError(); -} - -void TransferThread::resumeTransferAfterWriteError() -{ - writeError=false; -/******************************** - if(canStartTransfer) - readThread.startRead(); -useless, because the open destination event -will restart the transfer as normal -*********************************/ -/********************************* -if(!canStartTransfer) - stat=WaitForTheTransfer; -useless because already do at open event -**********************************/ - //if is in wait - if(!canStartTransfer) - emit checkIfItCanBeResumed(); -} - -void TransferThread::readThreadResumeAfterError() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readError=false; - writeIsReady(); - readIsReady(); -} - -////////////////////////////////////////////////////////////////// -///////////////////////// Normal event /////////////////////////// -////////////////////////////////////////////////////////////////// - -void TransferThread::readIsStopped() -{ - if(!sended_state_readStopped) - { - sended_state_readStopped=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit readIsStopped()"); - emit readStopped(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] drop dual read stopped"); - readIsFinish(); -} - -void TransferThread::writeIsStopped() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(!sended_state_writeStopped) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit writeStopped()"); - sended_state_writeStopped=true; - emit writeStopped(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] double event dropped"); - writeIsFinish(); -} - -void TransferThread::timeOfTheBlockCopyFinished() -{ - readThread.timeOfTheBlockCopyFinished(); -} - -//get drive of an file or folder -QString TransferThread::getDrive(QString fileOrFolder) -{ - for (int i = 0; i < mountSysPoint.size(); ++i) { - if(fileOrFolder.startsWith(mountSysPoint.at(i))) - return mountSysPoint.at(i); - } - //if unable to locate the right mount point - return ""; -} - -//set drive list, used in getDrive() -void TransferThread::setDrive(QStringList drives) -{ - mountSysPoint=drives; -} - -//fonction to edit the file date time -bool TransferThread::changeFileDateTime(const QString &source,const QString &destination) -{ - /* - if(maxTime>=sourceInfo.lastModified()) - return; - */ - /** Why not do it with Qt? Because it not support setModificationTime(), and get the time with Qt, that's mean use local time where in C is UTC time */ - #ifdef Q_OS_UNIX - #ifdef Q_OS_LINUX - struct stat info; - stat(source.toLatin1().data(),&info); - time_t ctime=info.st_ctim.tv_sec; - time_t actime=info.st_atim.tv_sec; - time_t modtime=info.st_mtim.tv_sec; - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - //creation time not exists into unix world - Q_UNUSED(ctime) - return utime(destination.toLatin1().data(),&butime)==0; - #else //mainly for mac - QFileInfo fileInfo(destination); - time_t ctime=fileInfo.created().toTime_t(); - time_t actime=fileInfo.lastRead().toTime_t(); - time_t modtime=fileInfo.lastModified().toTime_t(); - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - //creation time not exists into unix world - Q_UNUSED(ctime) - return utime(destination.toLatin1().data(),&butime)==0; - #endif - #else - #ifdef Q_OS_WIN32 - #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY - struct __stat64 info; - _stat64(source.toLatin1().data(),&info); - time_t ctime=info.st_ctime; - time_t actime=info.st_atime; - time_t modtime=info.st_mtime; - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - //creation time not exists into unix world - Q_UNUSED(ctime) - return utime(destination.toLatin1().data(),&butime)==0; - #else - wchar_t filePath[65535]; - source.toWCharArray(filePath); - HANDLE hFileSouce = CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - destination.toWCharArray(filePath); - HANDLE hFileDestination = CreateFile(filePath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - if(hFileSouce == INVALID_HANDLE_VALUE) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open failed to read"); - return false; - } - if(hFileDestination == INVALID_HANDLE_VALUE) - { - CloseHandle(hFileSouce); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open failed to write"); - return false; - } - FILETIME ftCreate, ftAccess, ftWrite; - if(!GetFileTime(hFileSouce, &ftCreate, &ftAccess, &ftWrite)) - { - CloseHandle(hFileSouce); - CloseHandle(hFileDestination); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unable to get the file time"); - return false; - } - if(!SetFileTime(hFileDestination, &ftCreate, &ftAccess, &ftWrite)) - { - CloseHandle(hFileSouce); - CloseHandle(hFileDestination); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unable to set the file time"); - return false; - } - CloseHandle(hFileSouce); - CloseHandle(hFileDestination); - return true; - #endif - #else - return false; - #endif - #endif - return false; -} - -//skip the copy -void TransferThread::skip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start with stat: "+QString::number(transfer_stat)); - switch(transfer_stat) - { - case TransferStat_PreOperation: - case TransferStat_WaitForTheTransfer: - needSkip=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] case WaitForTheTransfer or PreOperation, readIsReadyVariable: "+QString::number(readIsReadyVariable)+", readIsClosedVariable: "+QString::number(readIsClosedVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)+", writeIsClosedVariable: "+QString::number(writeIsClosedVariable)); - //check if all is source and destination is closed - if(!checkIfAllIsClosed()) - { - if(readIsReadyVariable && !readIsClosedVariable) - readThread.stop(); - if(writeIsReadyVariable && !writeIsClosedVariable) - writeThread.stop(); - } - break; - case TransferStat_Transfer: - needSkip=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] case Transfer, readIsReadyVariable: "+QString::number(readIsReadyVariable)+", readIsClosedVariable: "+QString::number(readIsClosedVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)+", writeIsClosedVariable: "+QString::number(writeIsClosedVariable)); - if(!checkIfAllIsClosed()) - { - if(readIsReadyVariable && !readIsClosedVariable) - readThread.stop(); - if(writeIsReadyVariable && !writeIsClosedVariable) - writeThread.stop(); - } - break; - case TransferStat_Checksum: - needSkip=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] case Transfer, readIsReadyVariable: "+QString::number(readIsReadyVariable)+", readIsClosedVariable: "+QString::number(readIsClosedVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)+", writeIsClosedVariable: "+QString::number(writeIsClosedVariable)); - if(!checkIfAllIsClosed()) - { - if(readIsReadyVariable && !readIsClosedVariable) - readThread.stop(); - if(writeIsReadyVariable && !writeIsClosedVariable) - writeThread.stop(); - } - break; - case TransferStat_PostOperation: - //do nothing because here is closing... - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] is already in post op"); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] can skip in this state!"); - return; - } -} - -//return info about the copied size -qint64 TransferThread::copiedSize() -{ - switch(transfer_stat) - { - case TransferStat_Transfer: - case TransferStat_PostOperation: - return readThread.getLastGoodPosition(); - case TransferStat_Checksum: - return transferSize; - default: - return 0; - } -} - -//retry after error -void TransferThread::putAtBottom() -{ - emit tryPutAtBottom(); -} - -/// \brief set rsync -void TransferThread::setRsync(const bool rsync) -{ - this->rsync=rsync; -} - -void TransferThread::set_osBufferLimit(unsigned int osBufferLimit) -{ - this->osBufferLimit=osBufferLimit; -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG -//to set the id -void TransferThread::setId(int id) -{ - this->id=id; - readThread.setId(id); - writeThread.setId(id); -} - -QChar TransferThread::readingLetter() -{ - switch(readThread.stat) - { - case ReadThread::Idle: - return '_'; - break; - case ReadThread::InodeOperation: - return 'I'; - break; - case ReadThread::Read: - return 'R'; - break; - case ReadThread::WaitWritePipe: - return 'W'; - break; - case ReadThread::Checksum: - return 'S'; - break; - default: - return '?'; - } -} - -QChar TransferThread::writingLetter() -{ - switch(writeThread.stat) - { - case WriteThread::Idle: - return '_'; - break; - case WriteThread::InodeOperation: - return 'I'; - break; - case WriteThread::Write: - return 'W'; - break; - case WriteThread::Close: - return 'C'; - break; - case WriteThread::Read: - return 'R'; - break; - case WriteThread::Checksum: - return 'S'; - break; - default: - return '?'; - } -} - -#endif - -void TransferThread::setMkpathTransfer(QSemaphore *mkpathTransfer) -{ - this->mkpathTransfer=mkpathTransfer; - writeThread.setMkpathTransfer(mkpathTransfer); -} - -void TransferThread::set_doChecksum(bool doChecksum) -{ - this->doChecksum=doChecksum; -} - -void TransferThread::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) -{ - this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; -} - -void TransferThread::set_checksumOnlyOnError(bool checksumOnlyOnError) -{ - this->checksumOnlyOnError=checksumOnlyOnError; -} - -void TransferThread::set_osBuffer(bool osBuffer) -{ - this->osBuffer=osBuffer; -} - -void TransferThread::set_osBufferLimited(bool osBufferLimited) -{ - this->osBufferLimited=osBufferLimited; -} - -//not copied size, because that's count to the checksum, ... -quint64 TransferThread::realByteTransfered() -{ - switch(transfer_stat) - { - case TransferStat_Transfer: - case TransferStat_PostOperation: - case TransferStat_Checksum: - return readThread.getLastGoodPosition(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] transferSize: "+QString::number(transferSize)); - return transferSize; - default: - return 0; - } -} - -void TransferThread::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} diff --git a/plugins-alternative/CopyEngine/Rsync/TransferThread.h b/plugins-alternative/CopyEngine/Rsync/TransferThread.h deleted file mode 100644 index 3ee6d35..0000000 --- a/plugins-alternative/CopyEngine/Rsync/TransferThread.h +++ /dev/null @@ -1,221 +0,0 @@ -/** \file TransferThread.h -\brief Thread changed to manage the inode operation, the signals, canceling, pre and post operations -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef TRANSFERTHREAD_H -#define TRANSFERTHREAD_H - -#include -#include -#include -#include -#include -#include -#include - -#include "ReadThread.h" -#include "WriteThread.h" -#include "Environment.h" -#include "StructEnumDefinition_CopyEngine.h" - -/// \brief Thread changed to manage the inode operation, the signals, canceling, pre and post operations -class TransferThread : public QThread -{ - Q_OBJECT -public: - explicit TransferThread(); - ~TransferThread(); - /// \brief get transfer stat - TransferStat getStat(); - /// \brief get drive of an file or folder - QString getDrive(QString fileOrFolder); - /// \brief set drive list, used in getDrive() - void setDrive(QStringList drives); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief to set the id - void setId(int id); - /// \brief get the reading letter - QChar readingLetter(); - /// \brief get the writing letter - QChar writingLetter(); - #endif - /// \brief to have semaphore, and try create just one by one - void setMkpathTransfer(QSemaphore *mkpathTransfer); - /// \brief to store the transfer id - quint64 transferId; - /// \brief to store the transfer size - quint64 transferSize; - - void set_doChecksum(bool doChecksum); - void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); - void set_checksumOnlyOnError(bool checksumOnlyOnError); - void set_osBuffer(bool osBuffer); - void set_osBufferLimited(bool osBufferLimited); - - //not copied size, because that's count to the checksum, ... - quint64 realByteTransfered(); -protected: - void run(); -signals: - //to send state - void preOperationStopped(); - void checkIfItCanBeResumed(); - //void transferStarted();//not sended (and not used then) - void readStopped(); - void writeStopped(); - void postOperationStopped(); - //get dialog - void fileAlreadyExists(QFileInfo,QFileInfo,bool isSame); - void errorOnFile(QFileInfo,QString); - //internal signal - void internalStartPostOperation(); - void internalStartPreOperation(); - void internalStartResumeAfterErrorAndSeek(); - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - void tryPutAtBottom(); - //force into the right thread - void internalTryStartTheTransfer(); - /// \brief update the transfer stat - void pushStat(TransferStat,quint64); -public slots: - /// \brief to start the transfer of data - void startTheTransfer(); - /// \brief to set files to transfer - void setFiles(const QString &source,const qint64 &size,const QString &destination,const CopyMode &mode); - /// \brief to set file exists action to do - void setFileExistsAction(const FileExistsAction &action); - /// \brief to set the new name of the destination - void setFileRename(const QString &nameForRename); - /// \brief to start the transfer of data - void setAlwaysFileExistsAction(const FileExistsAction &action); - /// \brief set the copy info and options before runing - void setRightTransfer(const bool doRightTransfer); - /// \brief set keep date - void setKeepDate(const bool keepDate); - /// \brief set the current max speed in KB/s - void setMaxSpeed(int maxSpeed); - /// \brief set block size in KB - bool setBlockSize(const unsigned int blockSize); - /// \brief pause the copy - void pause(); - /// \brief resume the copy - void resume(); - /// \brief stop the copy - void stop(); - /// \brief skip the copy - void skip(); - /// \brief retry after error - void retryAfterError(); - /// \brief return info about the copied size - qint64 copiedSize(); - /// \brief put the current file at bottom - void putAtBottom(); - /// \brief set rsync - void setRsync(const bool rsync); - - void set_osBufferLimit(unsigned int osBufferLimit); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -private slots: - void preOperation(); - void readIsReady(); - void writeIsReady(); - void readIsFinish(); - void writeIsFinish(); - void readIsClosed(); - void writeIsClosed(); - void postOperation(); - void getWriteError(); - void getReadError(); - void readChecksumFinish(const QByteArray&); - void writeChecksumFinish(const QByteArray&); - void compareChecksum(); - //void syncAfterErrorAndReadFinish(); - void readThreadIsSeekToZeroAndWait(); - void writeThreadIsReopened(); - void readThreadResumeAfterError(); - //to filter the emition of signal - void readIsStopped(); - void writeIsStopped(); - //speed limitation - void timeOfTheBlockCopyFinished(); - //force into the right thread - void internalStartTheTransfer(); -private: - enum MoveReturn - { - MoveReturn_skip=0, - MoveReturn_moved=1, - MoveReturn_error=2 - }; - TransferStat transfer_stat; - ReadThread readThread; - WriteThread writeThread; - QString source; - QString destination; - CopyMode mode; - QTimer clockForTheCopySpeed; ///< For the speed throttling - bool doRightTransfer; - bool keepDate; - bool readIsReadyVariable; - bool writeIsReadyVariable; - bool readIsOpenVariable; - bool writeIsOpenVariable; - bool readIsFinishVariable; - bool writeIsFinishVariable; - bool readIsClosedVariable; - bool writeIsClosedVariable; - bool canBeMovedDirectlyVariable; - bool rsync; - QByteArray sourceChecksum,destinationChecksum; - volatile bool stopIt; - volatile bool canStartTransfer; - int blockSize; - bool retry; - QFileInfo sourceInfo; - QFileInfo destinationInfo; - QStringList mountSysPoint; - qint64 size; - FileExistsAction fileExistsAction; - FileExistsAction alwaysDoFileExistsAction; - bool needSkip,needRemove; - QDateTime maxTime; - int id; - QSemaphore *mkpathTransfer; - bool doChecksum,real_doChecksum; - bool checksumIgnoreIfImpossible; - bool checksumOnlyOnError; - bool osBuffer; - bool osBufferLimited; - unsigned int osBufferLimit; - QString firstRenamingRule; - QString otherRenamingRule; - //error management - bool writeError,writeError_source_seeked,writeError_destination_reopened; - bool readError; - bool fileContentError; - //different pre-operation - bool isSame(); - bool destinationExists(); - bool canBeMovedDirectly(); - void tryMoveDirectly(); - void ifCanStartTransfer(); - //fonction to edit the file date time - bool changeFileDateTime(const QString &source,const QString &destination); - void resetExtraVariable(); - //error management function - void resumeTransferAfterWriteError(); - //to send state - bool sended_state_preOperationStopped; - bool sended_state_readStopped; - bool sended_state_writeStopped; - //different post-operation - bool checkIfAllIsClosed(); - bool doFilePostOperation(); - //different pre-operation - void tryOpen(); -}; - -#endif // TRANSFERTHREAD_H diff --git a/plugins-alternative/CopyEngine/Rsync/Variable.h b/plugins-alternative/CopyEngine/Rsync/Variable.h deleted file mode 100644 index f39b8a6..0000000 --- a/plugins-alternative/CopyEngine/Rsync/Variable.h +++ /dev/null @@ -1,35 +0,0 @@ -/** \file Variable.h -\brief Define the environment variable -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef VARIABLE_H -#define VARIABLE_H - -//Un-comment this next line to put ultracopier plugin in debug mode -#define ULTRACOPIER_PLUGIN_DEBUG -#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW -#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW_TIMER 150 - -#define ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK 64 -#define ULTRACOPIER_PLUGIN_MINTIMERINTERVAL 50 -#define ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL 100 -#define ULTRACOPIER_PLUGIN_NUMSEMSPEEDMANAGEMENT 2 -#define ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT 64 -#define ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER 1 -#define ULTRACOPIER_PLUGIN_MINIMALYEAR 1990 - -//if set, check the inode type at scanFileOrFolder, deprecated into the new algorithm and not used -#define ULTRACOPIER_PLUGIN_CHECKLISTTYPE - -/** \brief Need be greater than 2, but greater than 20 to be efficient */ -#define ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST 40 -#define ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION 200 - -//#define ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY - -#endif // VARIABLE_H - - - diff --git a/plugins-alternative/CopyEngine/Rsync/WriteThread.cpp b/plugins-alternative/CopyEngine/Rsync/WriteThread.cpp deleted file mode 100644 index 448e8dc..0000000 --- a/plugins-alternative/CopyEngine/Rsync/WriteThread.cpp +++ /dev/null @@ -1,508 +0,0 @@ -#include "WriteThread.h" - -#include - -WriteThread::WriteThread() -{ - stopIt=false; - isOpen.release(); - start(); - moveToThread(this); - setObjectName("write"); - this->mkpathTransfer = mkpathTransfer; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - CurentCopiedSize=0; - buffer=false; - putInPause=false; - needRemoveTheFile=false; - blockSize=1024*1024; -} - -WriteThread::~WriteThread() -{ - stopIt=true; - needRemoveTheFile=true; - freeBlock.release(); - // useless because stopIt will close all thread, but if thread not runing run it - //endIsDetected(); - emit internalStartClose(); - isOpen.acquire(); - disconnect(this); - quit(); - wait(); -} - -void WriteThread::run() -{ - connect(this,SIGNAL(internalStartOpen()), this,SLOT(internalOpen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartReopen()), this,SLOT(internalReopen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartWrite()), this,SLOT(internalWrite()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartClose()), this,SLOT(internalClose()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartEndOfFile()), this,SLOT(internalEndOfFile()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartFlushAndSeekToZero()), this,SLOT(internalFlushAndSeekToZero()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartChecksum()), this,SLOT(checkSum()), Qt::QueuedConnection); - exec(); -} - -bool WriteThread::internalOpen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] internalOpen destination: "+name); - if(stopIt) - return false; - if(file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already open! destination: "+file.fileName()); - return false; - } - //set to LISTBLOCKSIZE - while(freeBlock.available()ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK) - freeBlock.acquire(freeBlock.available()-ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK); - stopIt=false; - CurentCopiedSize=0; - endDetected=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=InodeOperation; - #endif - file.setFileName(name); - //mkpath check if exists and return true if already exists - QFileInfo destinationInfo(file); - QDir destinationFolder; - { - mkpathTransfer->acquire(); - if(!destinationFolder.exists(destinationInfo.absolutePath())) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] "+QString("Try create the path: %1") - .arg(destinationInfo.absolutePath())); - if(!destinationFolder.mkpath(destinationInfo.absolutePath())) - { - if(!destinationFolder.exists(destinationInfo.absolutePath())) - { - /// \todo do real folder error here - errorString_internal="mkpath error on destination"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable create the folder: %1, error: %2") - .arg(destinationInfo.absolutePath()) - .arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } - } - } - mkpathTransfer->release(); - } - if(stopIt) - return false; - //try open it - QIODevice::OpenMode flags=QIODevice::ReadWrite; - if(!buffer) - flags|=QIODevice::Unbuffered; - if(file.open(flags)) - { - if(stopIt) - return false; - file.seek(0); - if(stopIt) - return false; - file.resize(startSize); - if(stopIt) - return false; - emit opened(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - isOpen.acquire(); - needRemoveTheFile=false; - return true; - } - else - { - if(stopIt) - return false; - errorString_internal=file.errorString(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable to open: %1, error: %2").arg(name).arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } -} - -void WriteThread::open(const QString &name,const quint64 &startSize,const bool &buffer) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open destination: "+name); - if(stopIt) - return; - fakeMode=false; - this->name=name; - this->startSize=startSize; - this->buffer=buffer; - endDetected=false; - emit internalStartOpen(); -} - -void WriteThread::endIsDetected() -{ - if(endDetected) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - endDetected=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - emit internalStartEndOfFile(); -} - -QString WriteThread::errorString() -{ - return errorString_internal; -} - -bool WriteThread::write(const QByteArray &data) -{ - if(stopIt) - return false; - freeBlock.acquire(); - if(stopIt) - return false; - { - QMutexLocker lock_mutex(&accessList); - theBlockList.append(data); - } - emit internalStartWrite(); - return true; -} - -void WriteThread::stop() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop()"); - needRemoveTheFile=true; - stopIt=true; - if(isOpen.available()>0) - return; - freeBlock.release(); - // useless because stopIt will close all thread, but if thread not runing run it - endIsDetected(); - //for the stop for skip: void TransferThread::skip() - emit internalStartClose(); -} - -void WriteThread::flushBuffer() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - freeBlock.release(); - freeBlock.acquire(); - { - QMutexLocker lock_mutex(&accessList); - theBlockList.clear(); - } -} - -void WriteThread::internalEndOfFile() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] writeIsStopped"); - emit writeIsStopped(); -} - -void WriteThread::internalWrite() -{ - if(stopIt) - return; - //read one block - if(theBlockList.size()<=0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] End detected of the file"); - return; - } - else - { - QMutexLocker lock_mutex(&accessList); - blockArray=theBlockList.first(); - theBlockList.removeFirst(); - } - //write one block - freeBlock.release(); - - if(stopIt) - return; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Write; - #endif - bytesWriten=file.write(blockArray); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - //mutex for stream this data - if(CurentCopiedSize==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit writeIsStarted()"); - emit writeIsStarted(); - } - CurentCopiedSize+=bytesWriten; - if(stopIt) - return; - if(file.error()!=QFile::NoError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error())); - errorString_internal=QString("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error()); - stopIt=true; - emit error(); - return; - } - if(bytesWriten!=blockArray.size()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size())); - errorString_internal=QString("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size()); - stopIt=true; - emit error(); - return; - } - lastGoodPosition+=bytesWriten; -} - -void WriteThread::postOperation() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - emit internalStartClose(); -} - -void WriteThread::internalClose(bool emitSignal) -{ - /// \note never send signal here, because it's called by the destructor - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Close; - #endif - if(!fakeMode && file.isOpen()) - { - if(!needRemoveTheFile) - { - if(startSize!=CurentCopiedSize) - file.resize(CurentCopiedSize); - } - file.close(); - if(needRemoveTheFile) - { - if(file.remove()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unable to remove the destination file"); - } - needRemoveTheFile=false; - } - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - if(emitSignal) - emit closed(); - - /// \note always the last of this function - if(!fakeMode) - isOpen.release(); -} - -void WriteThread::internalReopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - internalClose(false); - flushBuffer(); - stopIt=false; - CurentCopiedSize=0; - if(internalOpen()) - emit reopened(); -} - -void WriteThread::reopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - stopIt=true; - endDetected=false; - emit internalStartReopen(); -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG -//to set the id -void WriteThread::setId(int id) -{ - this->id=id; -} -#endif - -/// \brief do the fake open -void WriteThread::fakeOpen() -{ - fakeMode=true; - emit opened(); -} - -/// \brief do the fake writeIsStarted -void WriteThread::fakeWriteIsStarted() -{ - emit writeIsStarted(); -} - -/// \brief do the fake writeIsStopped -void WriteThread::fakeWriteIsStopped() -{ - emit writeIsStopped(); -} - -/// do the checksum -void WriteThread::startCheckSum() -{ - emit internalStartChecksum(); -} - -/** \brief set block size -\param block the new block size in KB -\return Return true if succes */ -bool WriteThread::setBlockSize(const int blockSize) -{ - if(blockSize<1 || blockSize>16384) - { - this->blockSize=blockSize*1024; - //set the new max speed because the timer have changed - setMaxSpeed(maxSpeed); - return true; - } - else - return false; -} - -/*! \brief Set the max speed -\param tempMaxSpeed Set the max speed in KB/s, 0 for no limit */ -int WriteThread::setMaxSpeed(const int maxSpeed) -{ - if(this->maxSpeed==0 && maxSpeed==0 && waitNewClockForSpeed.available()>0) - waitNewClockForSpeed.tryAcquire(waitNewClockForSpeed.available()); - this->maxSpeed=maxSpeed; - if(this->maxSpeed>0) - { - int NewInterval,newMultiForBigSpeed=0; - do - { - newMultiForBigSpeed++; - NewInterval=(blockSize*newMultiForBigSpeed)/(this->maxSpeed); - } - while (NewIntervalULTRACOPIER_PLUGIN_MAXTIMERINTERVAL) - { - NewInterval=ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL; - newMultiForBigSpeed=1; - blockSize=this->maxSpeed*NewInterval; - } - MultiForBigSpeed=newMultiForBigSpeed; - return NewInterval; - } - else - { - waitNewClockForSpeed.release(); - return 0; - } -} - -/// \brief For give timer every X ms -void WriteThread::timeOfTheBlockCopyFinished() -{ - if(waitNewClockForSpeed.available()0) - { - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Checksum; - #endif - hash.addData(blockArray); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(stopIt) - break; - - lastGoodPosition+=blockArray.size(); - - //wait for limitation speed if stop not query - if(maxSpeed>0) - { - numberOfBlockCopied++; - if(numberOfBlockCopied>=MultiForBigSpeed) - { - numberOfBlockCopied=0; - waitNewClockForSpeed.acquire(); - if(stopIt) - break; - } - } - } - } - while(sizeReaden>0 && !stopIt); - if(lastGoodPosition>file.size()) - { - errorString_internal=tr("File truncated during the read, possible data change"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); - emit error(); - return; - } - if(stopIt) - { -/* if(putInPause) - emit isInPause();*/ - stopIt=false; - return; - } - emit checksumFinish(hash.result()); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop the read"); -} - -void WriteThread::internalFlushAndSeekToZero() -{ - flushBuffer(); - file.seek(0); - stopIt=false; - emit flushedAndSeekedToZero(); -} - -void WriteThread::setMkpathTransfer(QSemaphore *mkpathTransfer) -{ - this->mkpathTransfer=mkpathTransfer; -} diff --git a/plugins-alternative/CopyEngine/Rsync/WriteThread.h b/plugins-alternative/CopyEngine/Rsync/WriteThread.h deleted file mode 100644 index 3683c27..0000000 --- a/plugins-alternative/CopyEngine/Rsync/WriteThread.h +++ /dev/null @@ -1,138 +0,0 @@ -/** \file WriteThread.h -\brief Thread changed to open/close and write the destination file -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef WRITETHREAD_H -#define WRITETHREAD_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" -#include "StructEnumDefinition_CopyEngine.h" -#include "AvancedQFile.h" - -/// \brief Thread changed to open/close and write the destination file -class WriteThread : public QThread -{ - Q_OBJECT -public: - explicit WriteThread(); - ~WriteThread(); - /// \brief to have semaphore to do mkpath one by one - void setMkpathTransfer(QSemaphore *mkpathTransfer); -protected: - void run(); -public: - /// \brief open the destination to open it - void open(const QString &name,const quint64 &startSize,const bool &buffer); - /// \brief to return the error string - QString errorString(); - /// \brief to stop all - void stop(); - /// \brief to write data - bool write(const QByteArray &data); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief to set the id - void setId(int id); - /// \brief get the write stat - enum WriteStat - { - Idle=0, - InodeOperation=1, - Write=2, - Close=3, - Read=5, - Checksum=6 - }; - WriteStat stat; - #endif - /// \brief do the fake open - void fakeOpen(); - /// \brief do the fake writeIsStarted - void fakeWriteIsStarted(); - /// \brief do the fake writeIsStopped - void fakeWriteIsStopped(); - /// do the checksum - void startCheckSum(); - /// \brief set the current max speed in KB/s - int setMaxSpeed(int maxSpeed); - /// \brief For give timer every X ms - void timeOfTheBlockCopyFinished(); - /// \brief set block size in KB - bool setBlockSize(const int blockSize); -public slots: - /// \brief start the operation - void postOperation(); - /// \brief flush buffer - void flushBuffer(); - /// \brief set the end is detected - void endIsDetected(); - /// \brief reopen the file - void reopen(); - /// \brief flush and seek to zero - void flushAndSeekToZero(); - /// do the checksum - void checkSum(); -signals: - void error(); - void opened(); - void reopened(); - void writeIsStarted(); - void writeIsStopped(); - void flushedAndSeekedToZero(); - void closed(); - void checksumFinish(const QByteArray&); - //internal signals - void internalStartOpen(); - void internalStartChecksum(); - void internalStartReopen(); - void internalStartWrite(); - void internalStartClose(); - void internalStartEndOfFile(); - void internalStartFlushAndSeekToZero(); - /// \brief To debug source - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); -private: - QString name; - QString errorString_internal; - AvancedQFile file; - volatile bool stopIt; - volatile int blockSize; - volatile int maxSpeed; ///< The max speed in KB/s, 0 for no limit - QMutex accessList; ///< For use the list - QSemaphore waitNewClockForSpeed; - volatile int numberOfBlockCopied; ///< Multiple for count the number of block copied - volatile int multiplicatorForBigSpeed; ///< Multiple for count the number of block needed - volatile int MultiForBigSpeed; - QSemaphore freeBlock; - QSemaphore isOpen; - volatile bool putInPause; - QList theBlockList; ///< Store the block list - quint64 CurentCopiedSize; - QByteArray blockArray; ///< temp data for block writing, the data - qint64 bytesWriten; ///< temp data for block writing, the bytes writen - qint64 lastGoodPosition; - int id; - bool endDetected; - quint64 startSize; - QSemaphore *mkpathTransfer; - bool fakeMode; - bool buffer; - bool needRemoveTheFile; -private slots: - bool internalOpen(); - void internalWrite(); - void internalClose(bool emitSignal=true); - void internalReopen(); - void internalEndOfFile(); - void internalFlushAndSeekToZero(); -}; - -#endif // WRITETHREAD_H diff --git a/plugins-alternative/CopyEngine/Rsync/copyEngine-collision-and-error.cpp b/plugins-alternative/CopyEngine/Rsync/copyEngine-collision-and-error.cpp deleted file mode 100644 index 7ec07c2..0000000 --- a/plugins-alternative/CopyEngine/Rsync/copyEngine-collision-and-error.cpp +++ /dev/null @@ -1,565 +0,0 @@ -/** \file copyEngine.cpp -\brief Define the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include - -#include "copyEngine.h" -#include "folderExistsDialog.h" - -/// \note Can be call without queue because all call will be serialized -void copyEngine::fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the action - if(isSame) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file is same: "+source.absoluteFilePath()); - tempFileExistsAction=alwaysDoThisActionForFileExists; - if(tempFileExistsAction==FileExists_Overwrite || tempFileExistsAction==FileExists_OverwriteIfNewer || tempFileExistsAction==FileExists_OverwriteIfNotSameModificationDate) - tempFileExistsAction=FileExists_NotSet; - switch(tempFileExistsAction) - { - case FileExists_Skip: - case FileExists_Rename: - thread->setFileExistsAction(tempFileExistsAction); - break; - default: - if(dialogIsOpen) - { - alreadyExistsQueueItem newItem; - newItem.source=source; - newItem.destination=destination; - newItem.isSame=isSame; - newItem.transfer=thread; - newItem.scan=NULL; - alreadyExistsQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - fileIsSameDialog dialog(interface,source,firstRenamingRule,otherRenamingRule); - emit isInPause(true); - dialog.exec();/// \bug crash when external close - FileExistsAction newAction=dialog.getAction(); - emit isInPause(false); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileExists_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) - { - alwaysDoThisActionForFileExists=newAction; - listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - switch(newAction) - { - default: - case FileExists_Skip: - emit newCollisionAction("skip"); - break; - case FileExists_Rename: - emit newCollisionAction("rename"); - break; - } - } - if(dialog.getAlways() || newAction!=FileExists_Rename) - thread->setFileExistsAction(newAction); - else - thread->setFileRename(dialog.getNewName()); - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); - tempFileExistsAction=alwaysDoThisActionForFileExists; - switch(tempFileExistsAction) - { - case FileExists_Skip: - case FileExists_Rename: - case FileExists_Overwrite: - case FileExists_OverwriteIfNewer: - case FileExists_OverwriteIfNotSameModificationDate: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"always do this action: "+QString::number(tempFileExistsAction)); - thread->setFileExistsAction(tempFileExistsAction); - break; - default: - if(dialogIsOpen) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("dialog open, put in queue: %1 %2") - .arg(source.absoluteFilePath()) - .arg(destination.absoluteFilePath()) - ); - alreadyExistsQueueItem newItem; - newItem.source=source; - newItem.destination=destination; - newItem.isSame=isSame; - newItem.transfer=thread; - newItem.scan=NULL; - alreadyExistsQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - fileExistsDialog dialog(interface,source,destination,firstRenamingRule,otherRenamingRule); - emit isInPause(true); - dialog.exec();/// \bug crash when external close - FileExistsAction newAction=dialog.getAction(); - emit isInPause(false); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileExists_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) - { - alwaysDoThisActionForFileExists=newAction; - listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - switch(newAction) - { - default: - case FileExists_Skip: - emit newCollisionAction("skip"); - break; - case FileExists_Rename: - emit newCollisionAction("rename"); - break; - case FileExists_Overwrite: - emit newCollisionAction("overwrite"); - break; - case FileExists_OverwriteIfNewer: - emit newCollisionAction("overwriteIfNewer"); - break; - case FileExists_OverwriteIfNotSameModificationDate: - emit newCollisionAction("overwriteIfNotSameModificationDate"); - break; - } - } - if(dialog.getAlways() || newAction!=FileExists_Rename) - thread->setFileExistsAction(newAction); - else - thread->setFileRename(dialog.getNewName()); - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"emit queryOneNewDialog()"); - emit queryOneNewDialog(); - } - return; - break; - } - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -/// \note Can be call without queue because all call will be serialized -void copyEngine::errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the action - tempFileErrorAction=alwaysDoThisActionForFileError; - switch(tempFileErrorAction) - { - case FileError_Skip: - thread->skip(); - return; - case FileError_Retry: - thread->retryAfterError(); - return; - case FileError_PutToEndOfTheList: - /// \todo do the read transfer locator and put at the end - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"todo list item not found"); - return; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=fileInfo; - newItem.mkPath=false; - newItem.rmPath=false; - newItem.scan=NULL; - newItem.transfer=thread; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); - fileErrorDialog dialog(interface,fileInfo,errorString); - emit isInPause(true); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - emit isInPause(false); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - { - alwaysDoThisActionForFileError=newAction; - switch(newAction) - { - default: - case FileError_Skip: - emit newErrorAction("skip"); - break; - case FileError_PutToEndOfTheList: - emit newErrorAction("putToEndOfTheList"); - break; - } - } - switch(newAction) - { - case FileError_Skip: - thread->skip(); - break; - case FileError_Retry: - thread->retryAfterError(); - break; - case FileError_PutToEndOfTheList: - thread->putAtBottom(); - /// \todo do the read transfer locator and put at the end - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"todo"); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"file error action wrong"); - break; - } - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"isCalledByShowOneNewDialog==true then not show other dial"); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -/// \note Can be call without queue because all call will be serialized -void copyEngine::folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the always action - tempFolderExistsAction=alwaysDoThisActionForFolderExists; - switch(tempFolderExistsAction) - { - case FolderExists_Skip: - case FolderExists_Rename: - case FolderExists_Merge: - thread->setFolderExistsAction(tempFolderExistsAction); - break; - default: - if(dialogIsOpen) - { - alreadyExistsQueueItem newItem; - newItem.source=source; - newItem.destination=destination; - newItem.isSame=isSame; - newItem.transfer=NULL; - newItem.scan=thread; - alreadyExistsQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - folderExistsDialog dialog(interface,source,isSame,destination,firstRenamingRule,otherRenamingRule); - dialog.exec();/// \bug crash when external close - FolderExistsAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FolderExists_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFolderExists) - setComboBoxFolderColision(newAction); - if(!dialog.getAlways() && newAction==FolderExists_Rename) - thread->setFolderExistsAction(newAction,dialog.getNewName()); - else - thread->setFolderExistsAction(newAction); - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } -} - -/// \note Can be call without queue because all call will be serialized -/// \todo all this part -void copyEngine::errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the always action - tempFileErrorAction=alwaysDoThisActionForFolderError; - switch(tempFileErrorAction) - { - case FileError_Skip: - case FileError_Retry: - case FileError_PutToEndOfTheList: - thread->setFolderErrorAction(tempFileErrorAction); - break; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=fileInfo; - newItem.mkPath=false; - newItem.rmPath=false; - newItem.scan=thread; - newItem.transfer=NULL; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); - fileErrorDialog dialog(interface,fileInfo,errorString); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - setComboBoxFolderError(newAction); - dialogIsOpen=false; - thread->setFolderErrorAction(newAction); - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -// ----------------------------------------------------- - -//mkpath event -void copyEngine::mkPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); - //load the always action - tempFileErrorAction=alwaysDoThisActionForFolderError; - error_index=0; - switch(tempFileErrorAction) - { - case FileError_Skip: - listThread->mkPathQueue.skip(); - return; - case FileError_Retry: - listThread->mkPathQueue.retry(); - return; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=folder; - newItem.mkPath=true; - newItem.rmPath=false; - newItem.scan=NULL; - newItem.transfer=NULL; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); - fileErrorDialog dialog(interface,folder,errorString,false); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - { - setComboBoxFolderError(newAction); - alwaysDoThisActionForFolderError=newAction; - } - dialogIsOpen=false; - switch(newAction) - { - case FileError_Skip: - listThread->mkPathQueue.skip(); - break; - case FileError_Retry: - listThread->mkPathQueue.retry(); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); - break; - } - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -//rmpath event -void copyEngine::rmPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); - //load the always action - tempFileErrorAction=alwaysDoThisActionForFolderError; - error_index=0; - switch(tempFileErrorAction) - { - case FileError_Skip: - listThread->rmPathQueue.skip(); - return; - case FileError_Retry: - listThread->rmPathQueue.retry(); - return; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=folder; - newItem.mkPath=false; - newItem.rmPath=true; - newItem.scan=NULL; - newItem.transfer=NULL; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); - fileErrorDialog dialog(interface,folder,errorString,false); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - { - setComboBoxFolderError(newAction); - alwaysDoThisActionForFolderError=newAction; - } - dialogIsOpen=false; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"do the action"); - switch(newAction) - { - case FileError_Skip: - listThread->rmPathQueue.skip(); - break; - case FileError_Retry: - listThread->rmPathQueue.retry(); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); - break; - } - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -//show one new dialog if needed -void copyEngine::showOneNewDialog() -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"alreadyExistsQueue.size(): "+QString::number(alreadyExistsQueue.size())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"errorQueue.size(): "+QString::number(errorQueue.size())); - loop_size=alreadyExistsQueue.size(); - while(loop_size>0) - { - if(alreadyExistsQueue.first().transfer!=NULL) - { - fileAlreadyExists(alreadyExistsQueue.first().source, - alreadyExistsQueue.first().destination, - alreadyExistsQueue.first().isSame, - alreadyExistsQueue.first().transfer, - true); - } - else if(alreadyExistsQueue.first().scan!=NULL) - folderAlreadyExists(alreadyExistsQueue.first().source, - alreadyExistsQueue.first().destination, - alreadyExistsQueue.first().isSame, - alreadyExistsQueue.first().scan, - true); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"bug, no thread actived"); - alreadyExistsQueue.removeFirst(); - loop_size--; - } - loop_size=errorQueue.size(); - while(errorQueue.size()>0) - { - if(errorQueue.first().transfer!=NULL) - errorOnFile(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().transfer,true); - else if(errorQueue.first().scan!=NULL) - errorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().scan,true); - else if(errorQueue.first().mkPath) - mkPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,true); - else if(errorQueue.first().rmPath) - rmPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,true); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"bug, no thread actived"); - errorQueue.removeFirst(); - loop_size--; - } -} diff --git a/plugins-alternative/CopyEngine/Rsync/copyEngine.cpp b/plugins-alternative/CopyEngine/Rsync/copyEngine.cpp deleted file mode 100755 index 1c17f8a..0000000 --- a/plugins-alternative/CopyEngine/Rsync/copyEngine.cpp +++ /dev/null @@ -1,819 +0,0 @@ -/** \file copyEngine.cpp -\brief Define the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include - -#include "copyEngine.h" -#include "folderExistsDialog.h" -#include "../../../interface/PluginInterface_CopyEngine.h" - -copyEngine::copyEngine(FacilityInterface * facilityEngine) : - ui(new Ui::options()) -{ - listThread=new ListThread(facilityEngine); - this->facilityEngine=facilityEngine; - filters=NULL; - renamingRules=NULL; - qRegisterMetaType("TransferThread *"); - qRegisterMetaType("scanFileOrFolder *"); - qRegisterMetaType("EngineActionInProgress"); - qRegisterMetaType("DebugLevel"); - qRegisterMetaType("FileExistsAction"); - qRegisterMetaType("FolderExistsAction"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - qRegisterMetaType("CopyMode"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - - interface = NULL; - tempWidget = NULL; - uiIsInstalled = false; - dialogIsOpen = false; - maxSpeed = 0; - alwaysDoThisActionForFileExists = FileExists_NotSet; - alwaysDoThisActionForFileError = FileError_NotSet; - checkDestinationFolderExists = false; - stopIt = false; - size_for_speed = 0; - forcedMode = false; - - //implement the SingleShot in this class - //timerActionDone.setSingleShot(true); - timerActionDone.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST); - //timerProgression.setSingleShot(true); - timerProgression.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION); - -} - -copyEngine::~copyEngine() -{ - /*if(filters!=NULL) - delete filters; - if(renamingRules!=NULL) - delete renamingRules; - destroyed by the widget parent, here the interface - */ - stopIt=true; - delete listThread; - delete ui; -} - -void copyEngine::connectTheSignalsSlots() -{ - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - debugDialogWindow.show(); - #endif - if(!connect(listThread,SIGNAL(actionInProgess(EngineActionInProgress)), this,SIGNAL(actionInProgess(EngineActionInProgress)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect actionInProgess()"); - if(!connect(listThread,SIGNAL(actionInProgess(EngineActionInProgress)), this,SLOT(newActionInProgess(EngineActionInProgress)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect actionInProgess() to slot"); - if(!connect(listThread,SIGNAL(newFolderListing(QString)), this,SIGNAL(newFolderListing(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newFolderListing()"); - if(!connect(listThread,SIGNAL(newCollisionAction(QString)), this,SIGNAL(newCollisionAction(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newCollisionAction()"); - if(!connect(listThread,SIGNAL(newErrorAction(QString)), this,SIGNAL(newErrorAction(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newErrorAction()"); - if(!connect(listThread,SIGNAL(isInPause(bool)), this,SIGNAL(isInPause(bool)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect isInPause()"); - if(!connect(listThread,SIGNAL(error(QString,quint64,QDateTime,QString)), this,SIGNAL(error(QString,quint64,QDateTime,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect error()"); - if(!connect(listThread,SIGNAL(rmPath(QString)), this,SIGNAL(rmPath(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect rmPath()"); - if(!connect(listThread,SIGNAL(mkPath(QString)), this,SIGNAL(mkPath(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect mkPath()"); - if(!connect(listThread,SIGNAL(newActionOnList(QList)), this,SIGNAL(newActionOnList(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newActionOnList()"); - if(!connect(listThread,SIGNAL(pushFileProgression(QList)), this,SIGNAL(pushFileProgression(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect pushFileProgression()"); - if(!connect(listThread,SIGNAL(pushGeneralProgression(quint64,quint64)), this,SIGNAL(pushGeneralProgression(quint64,quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect pushGeneralProgression()"); - if(!connect(listThread,SIGNAL(syncReady()), this,SIGNAL(syncReady()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect syncReady()"); - if(!connect(listThread,SIGNAL(canBeDeleted()), this,SIGNAL(canBeDeleted()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect canBeDeleted()"); - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - if(!connect(listThread,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect debugInformation()"); - #endif - - if(!connect(listThread,SIGNAL(send_fileAlreadyExists(QFileInfo,QFileInfo,bool,TransferThread *)), this,SLOT(fileAlreadyExists(QFileInfo,QFileInfo,bool,TransferThread *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_fileAlreadyExists()"); - if(!connect(listThread,SIGNAL(send_errorOnFile(QFileInfo,QString,TransferThread *)), this,SLOT(errorOnFile(QFileInfo,QString,TransferThread *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_errorOnFile()"); - if(!connect(listThread,SIGNAL(send_folderAlreadyExists(QFileInfo,QFileInfo,bool,scanFileOrFolder *)), this,SLOT(folderAlreadyExists(QFileInfo,QFileInfo,bool,scanFileOrFolder *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_folderAlreadyExists()"); - if(!connect(listThread,SIGNAL(send_errorOnFolder(QFileInfo,QString,scanFileOrFolder *)), this,SLOT(errorOnFolder(QFileInfo,QString,scanFileOrFolder *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_errorOnFolder()"); - if(!connect(listThread,SIGNAL(updateTheDebugInfo(QStringList,QStringList,int)), this,SLOT(updateTheDebugInfo(QStringList,QStringList,int)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect updateTheDebugInfo()"); - if(!connect(listThread,SIGNAL(errorTransferList(QString)), this,SLOT(errorTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect errorTransferList()"); - if(!connect(listThread,SIGNAL(warningTransferList(QString)), this,SLOT(warningTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect warningTransferList()"); - if(!connect(listThread,SIGNAL(mkPathErrorOnFolder(QFileInfo,QString)), this,SLOT(mkPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect mkPathErrorOnFolder()"); - if(!connect(listThread,SIGNAL(rmPathErrorOnFolder(QFileInfo,QString)), this,SLOT(rmPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect rmPathErrorOnFolder()"); - if(!connect(listThread,SIGNAL(send_realBytesTransfered(quint64)), this,SLOT(get_realBytesTransfered(quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_realBytesTransfered()"); - - if(!connect(this,SIGNAL(tryCancel()), listThread,SIGNAL(tryCancel()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect tryCancel()"); - if(!connect(this,SIGNAL(signal_pause()), listThread,SLOT(pause()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_pause()"); - if(!connect(this,SIGNAL(signal_resume()), listThread,SLOT(resume()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_resume()"); - if(!connect(this,SIGNAL(signal_skip(quint64)), listThread,SLOT(skip(quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_skip()"); - if(!connect(this,SIGNAL(signal_setCollisionAction(FileExistsAction)), listThread,SLOT(setAlwaysFileExistsAction(FileExistsAction)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_setCollisionAction()"); - if(!connect(this,SIGNAL(signal_setFolderColision(FolderExistsAction)), listThread,SLOT(setFolderColision(FolderExistsAction)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_setFolderColision()"); - if(!connect(this,SIGNAL(signal_removeItems(QList)), listThread,SLOT(removeItems(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_removeItems()"); - if(!connect(this,SIGNAL(signal_moveItemsOnTop(QList)), listThread,SLOT(moveItemsOnTop(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsOnTop()"); - if(!connect(this,SIGNAL(signal_moveItemsUp(QList)), listThread,SLOT(moveItemsUp(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsUp()"); - if(!connect(this,SIGNAL(signal_moveItemsDown(QList)), listThread,SLOT(moveItemsDown(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsDown()"); - if(!connect(this,SIGNAL(signal_moveItemsOnBottom(QList)), listThread,SLOT(moveItemsOnBottom(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsOnBottom()"); - if(!connect(this,SIGNAL(signal_exportTransferList(QString)), listThread,SLOT(exportTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_exportTransferList()"); - if(!connect(this,SIGNAL(signal_importTransferList(QString)), listThread,SLOT(importTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_importTransferList()"); - if(!connect(this,SIGNAL(signal_forceMode(CopyMode)), listThread,SLOT(forceMode(CopyMode)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_forceMode()"); - if(!connect(this,SIGNAL(send_osBufferLimit(uint)), listThread,SLOT(set_osBufferLimit(uint)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_osBufferLimit()"); - if(!connect(this,SIGNAL(send_setFilters(QList,QList)),listThread,SLOT(set_setFilters(QList,QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_setFilters()"); - if(!connect(this,SIGNAL(send_sendNewRenamingRules(QString,QString)),listThread,SLOT(set_sendNewRenamingRules(QString,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_sendNewRenamingRules()"); - if(!connect(&timerActionDone,SIGNAL(timeout()), listThread,SLOT(sendActionDone()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect timerActionDone"); - if(!connect(&timerProgression,SIGNAL(timeout()), listThread,SLOT(sendProgression()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect timerProgression"); - - if(!connect(this,SIGNAL(queryOneNewDialog()),SLOT(showOneNewDialog()),Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect queryOneNewDialog()"); -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW -void copyEngine::updateTheDebugInfo(QStringList newList,QStringList newList2,int numberOfInodeOperation) -{ - debugDialogWindow.setTransferThreadList(newList); - debugDialogWindow.setTransferList(newList2); - debugDialogWindow.setInodeUsage(numberOfInodeOperation); -} -#endif - -//to send the options panel -bool copyEngine::getOptionsEngine(QWidget * tempWidget) -{ - this->tempWidget=tempWidget; - connect(tempWidget, SIGNAL(destroyed()), this, SLOT(resetTempWidget())); - ui->setupUi(tempWidget); - //conect the ui widget -/* connect(ui->doRightTransfer, SIGNAL(toggled(bool)), &threadOfTheTransfer, SLOT(setRightTransfer(bool))); - connect(ui->keepDate, SIGNAL(toggled(bool)), &threadOfTheTransfer, SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), &threadOfTheTransfer, SLOT(setBlockSize(int)));*/ - connect(ui->autoStart, SIGNAL(toggled(bool)), this, SLOT(setAutoStart(bool))); - connect(ui->rsync, SIGNAL(toggled(bool)), this, SLOT(setRsync(bool))); - connect(ui->checkBoxDestinationFolderExists, SIGNAL(toggled(bool)), this, SLOT(setCheckDestinationFolderExists(bool))); - uiIsInstalled=true; - setRightTransfer(doRightTransfer); - setKeepDate(keepDate); - setSpeedLimitation(maxSpeed); - setBlockSize(blockSize); - setAutoStart(autoStart); - setRsync(rsync); - setCheckDestinationFolderExists(checkDestinationFolderExists); - set_doChecksum(doChecksum); - set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - set_checksumOnlyOnError(checksumOnlyOnError); - set_osBuffer(osBuffer); - set_osBufferLimited(osBufferLimited); - set_osBufferLimit(osBufferLimit); - return true; -} - -//to have interface widget to do modal dialog -void copyEngine::setInterfacePointer(QWidget * interface) -{ - this->interface=interface; - filters=new Filters(tempWidget); - renamingRules=new RenamingRules(tempWidget); - - if(uiIsInstalled) - { - connect(ui->doRightTransfer, SIGNAL(toggled(bool)), this,SLOT(setRightTransfer(bool))); - connect(ui->keepDate, SIGNAL(toggled(bool)), this,SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), this,SLOT(setBlockSize(int))); - connect(ui->autoStart, SIGNAL(toggled(bool)), this,SLOT(setAutoStart(bool))); - connect(ui->rsync, SIGNAL(toggled(bool)), this,SLOT(setRsync(bool))); - connect(ui->doChecksum, SIGNAL(toggled(bool)), this,SLOT(doChecksum_toggled(bool))); - connect(ui->checksumIgnoreIfImpossible, SIGNAL(toggled(bool)), this,SLOT(checksumIgnoreIfImpossible_toggled(bool))); - connect(ui->checksumOnlyOnError, SIGNAL(toggled(bool)), this,SLOT(checksumOnlyOnError_toggled(bool))); - connect(ui->osBuffer, SIGNAL(toggled(bool)), this,SLOT(osBuffer_toggled(bool))); - connect(ui->osBufferLimited, SIGNAL(toggled(bool)), this,SLOT(osBufferLimited_toggled(bool))); - connect(ui->osBufferLimit, SIGNAL(editingFinished()), this,SLOT(osBufferLimit_editingFinished())); - - connect(filters,SIGNAL(sendNewFilters(QStringList,QStringList,QStringList,QStringList)),this,SLOT(sendNewFilters())); - connect(ui->filters,SIGNAL(clicked()),this,SLOT(showFilterDialog())); - - if(!connect(renamingRules,SIGNAL(sendNewRenamingRules(QString,QString)),this,SLOT(sendNewRenamingRules(QString,QString)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect sendNewRenamingRules()"); - if(!connect(ui->renamingRules,SIGNAL(clicked()),this,SLOT(showRenamingRules()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect renamingRules.clicked()"); - } - - filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); - set_setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); - - renamingRules->setRenamingRules(firstRenamingRule,otherRenamingRule); - emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -bool copyEngine::haveSameSource(const QStringList &sources) -{ - return listThread->haveSameSource(sources); -} - -bool copyEngine::haveSameDestination(const QString &destination) -{ - return listThread->haveSameDestination(destination); -} - -bool copyEngine::newCopy(const QStringList &sources) -{ - if(forcedMode && mode!=Copy) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to move, you can't copy with it")); - return false; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString destination = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select destination directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if(destination.isEmpty() || destination.isNull() || destination=="") - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Canceled by the user"); - return false; - } - return listThread->newCopy(sources,destination); -} - -bool copyEngine::newCopy(const QStringList &sources,const QString &destination) -{ - if(forcedMode && mode!=Copy) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to move, you can't copy with it")); - return false; - } - return listThread->newCopy(sources,destination); -} - -bool copyEngine::newMove(const QStringList &sources) -{ - if(forcedMode && mode!=Move) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to copy, you can't move with it")); - return false; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString destination = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select destination directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if(destination.isEmpty() || destination.isNull() || destination=="") - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Canceled by the user"); - return false; - } - return listThread->newMove(sources,destination); -} - -bool copyEngine::newMove(const QStringList &sources,const QString &destination) -{ - if(forcedMode && mode!=Move) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to copy, you can't move with it")); - return false; - } - return listThread->newMove(sources,destination); -} - -void copyEngine::newTransferList(const QString &file) -{ - emit signal_importTransferList(file); -} - -//because direct access to list thread into the main thread can't be do -quint64 copyEngine::realByteTransfered() -{ - return size_for_speed; -} - -//speed limitation -qint64 copyEngine::getSpeedLimitation() -{ - return listThread->getSpeedLimitation(); -} - -//get collision action -QList > copyEngine::getCollisionAction() -{ - QPair tempItem; - QList > list; - tempItem.first=facilityEngine->translateText("Ask");tempItem.second="ask";list << tempItem; - tempItem.first=facilityEngine->translateText("Skip");tempItem.second="skip";list << tempItem; - tempItem.first=facilityEngine->translateText("Overwrite");tempItem.second="overwrite";list << tempItem; - tempItem.first=facilityEngine->translateText("Overwrite if newer");tempItem.second="overwriteIfNewer";list << tempItem; - tempItem.first=facilityEngine->translateText("Overwrite if the last modification dates are different");tempItem.second="overwriteIfNotSameModificationDate";list << tempItem; - tempItem.first=facilityEngine->translateText("Rename");tempItem.second="rename";list << tempItem; - return list; -} - -QList > copyEngine::getErrorAction() -{ - QPair tempItem; - QList > list; - tempItem.first=facilityEngine->translateText("Ask");tempItem.second="ask";list << tempItem; - tempItem.first=facilityEngine->translateText("Skip");tempItem.second="skip";list << tempItem; - tempItem.first=facilityEngine->translateText("Put to end of the list");tempItem.second="putToEndOfTheList";list << tempItem; - return list; -} - -void copyEngine::setDrive(const QStringList &drives) -{ - listThread->setDrive(drives); -} - -/** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ -void copyEngine::syncTransferList() -{ - listThread->syncTransferList(); -} - -void copyEngine::set_doChecksum(bool doChecksum) -{ - listThread->set_doChecksum(doChecksum); - if(uiIsInstalled) - ui->doChecksum->setChecked(doChecksum); - this->doChecksum=doChecksum; -} - -void copyEngine::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) -{ - listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - if(uiIsInstalled) - ui->checksumIgnoreIfImpossible->setChecked(checksumIgnoreIfImpossible); - this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; -} - -void copyEngine::set_checksumOnlyOnError(bool checksumOnlyOnError) -{ - listThread->set_checksumOnlyOnError(checksumOnlyOnError); - if(uiIsInstalled) - ui->checksumOnlyOnError->setChecked(checksumOnlyOnError); - this->checksumOnlyOnError=checksumOnlyOnError; -} - -void copyEngine::set_osBuffer(bool osBuffer) -{ - listThread->set_osBuffer(osBuffer); - if(uiIsInstalled) - ui->osBuffer->setChecked(osBuffer); - this->osBuffer=osBuffer; -} - -void copyEngine::set_osBufferLimited(bool osBufferLimited) -{ - listThread->set_osBufferLimited(osBufferLimited); - if(uiIsInstalled) - ui->osBufferLimited->setChecked(osBufferLimited); - this->osBufferLimited=osBufferLimited; -} - -void copyEngine::set_osBufferLimit(unsigned int osBufferLimit) -{ - emit send_osBufferLimit(osBufferLimit); - if(uiIsInstalled) - ui->osBufferLimit->setValue(osBufferLimit); - this->osBufferLimit=osBufferLimit; -} - -void copyEngine::set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) -{ - if(filters!=NULL) - { - filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); - emit send_setFilters(filters->getInclude(),filters->getExclude()); - } - this->includeStrings=includeStrings; - this->includeOptions=includeOptions; - this->excludeStrings=excludeStrings; - this->excludeOptions=excludeOptions; -} - -void copyEngine::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -bool copyEngine::userAddFolder(const CopyMode &mode) -{ - QString source = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select source directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if(source.isEmpty() || source.isNull() || source=="") - return false; - if(mode==Copy) - return newCopy(QStringList() << source); - else - return newMove(QStringList() << source); -} - -bool copyEngine::userAddFile(const CopyMode &mode) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QStringList sources = QFileDialog::getOpenFileNames( - interface, - facilityEngine->translateText("Select one or more files to open"), - "", - facilityEngine->translateText("All files")+" (*)"); - if(sources.isEmpty()) - return false; - if(mode==Copy) - return newCopy(sources); - else - return newMove(sources); -} - -void copyEngine::pause() -{ - emit signal_pause(); -} - -void copyEngine::resume() -{ - emit signal_resume(); -} - -void copyEngine::skip(const quint64 &id) -{ - emit signal_skip(id); -} - -void copyEngine::cancel() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - stopIt=true; - timerProgression.stop(); - timerActionDone.stop(); - emit tryCancel(); -} - -void copyEngine::removeItems(const QList &ids) -{ - emit signal_removeItems(ids); -} - -void copyEngine::moveItemsOnTop(const QList &ids) -{ - emit signal_moveItemsOnTop(ids); -} - -void copyEngine::moveItemsUp(const QList &ids) -{ - emit signal_moveItemsUp(ids); -} - -void copyEngine::moveItemsDown(const QList &ids) -{ - emit signal_moveItemsDown(ids); -} - -void copyEngine::moveItemsOnBottom(const QList &ids) -{ - emit signal_moveItemsOnBottom(ids); -} - -/** \brief give the forced mode, to export/import transfer list */ -void copyEngine::forceMode(const CopyMode &mode) -{ - if(mode==Move) - { - listThread->setRsync(false); - rsync=false; - } - if(uiIsInstalled) - ui->rsync->setEnabled(mode==Copy); - if(forcedMode) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Mode forced previously")); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The mode have been forced previously, it's internal error, please report it")); - return; - } - if(mode==Copy) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to copy")); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to move")); - this->mode=mode; - forcedMode=true; - emit signal_forceMode(mode); -} - -void copyEngine::exportTransferList() -{ - QString fileName = QFileDialog::getSaveFileName(NULL,facilityEngine->translateText("Save transfer list"),"transfer-list.lst",facilityEngine->translateText("Transfer list")+" (*.lst)"); - if(fileName.isEmpty()) - return; - emit signal_exportTransferList(fileName); -} - -void copyEngine::importTransferList() -{ - QString fileName = QFileDialog::getOpenFileName(NULL,facilityEngine->translateText("Open transfer list"),"transfer-list.lst",facilityEngine->translateText("Transfer list")+" (*.lst)"); - if(fileName.isEmpty()) - return; - emit signal_importTransferList(fileName); -} - -void copyEngine::warningTransferList(const QString &warning) -{ - QMessageBox::warning(interface,facilityEngine->translateText("Error"),warning); -} - -void copyEngine::errorTransferList(const QString &error) -{ - QMessageBox::critical(interface,facilityEngine->translateText("Error"),error); -} - -bool copyEngine::setSpeedLimitation(const qint64 &speedLimitation) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"maxSpeed: "+QString::number(speedLimitation)); - maxSpeed=speedLimitation; - return listThread->setSpeedLimitation(speedLimitation); -} - -void copyEngine::setCollisionAction(const QString &action) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action: "+action); - if(action=="skip") - alwaysDoThisActionForFileExists=FileExists_Skip; - else if(action=="overwrite") - alwaysDoThisActionForFileExists=FileExists_Overwrite; - else if(action=="overwriteIfNewer") - alwaysDoThisActionForFileExists=FileExists_OverwriteIfNewer; - else if(action=="overwriteIfNotSameModificationDate") - alwaysDoThisActionForFileExists=FileExists_OverwriteIfNotSameModificationDate; - else if(action=="rename") - alwaysDoThisActionForFileExists=FileExists_Rename; - else - alwaysDoThisActionForFileExists=FileExists_NotSet; - emit signal_setCollisionAction(alwaysDoThisActionForFileExists); -} - -void copyEngine::setErrorAction(const QString &action) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action: "+action); - if(action=="skip") - alwaysDoThisActionForFileError=FileError_Skip; - else if(action=="putToEndOfTheList") - alwaysDoThisActionForFileError=FileError_PutToEndOfTheList; - else - alwaysDoThisActionForFileError=FileError_NotSet; -} - -void copyEngine::setRightTransfer(const bool doRightTransfer) -{ - this->doRightTransfer=doRightTransfer; - if(uiIsInstalled) - ui->doRightTransfer->setChecked(doRightTransfer); - listThread->setRightTransfer(doRightTransfer); -} - -//set keep date -void copyEngine::setKeepDate(const bool keepDate) -{ - this->keepDate=keepDate; - if(uiIsInstalled) - ui->keepDate->setChecked(keepDate); - listThread->setKeepDate(keepDate); -} - -//set block size in KB -void copyEngine::setBlockSize(const int blockSize) -{ - this->blockSize=blockSize; - if(uiIsInstalled) - ui->blockSize->setValue(blockSize); - listThread->setBlockSize(blockSize); -} - -//set auto start -void copyEngine::setAutoStart(const bool autoStart) -{ - this->autoStart=autoStart; - if(uiIsInstalled) - ui->autoStart->setChecked(autoStart); - listThread->setAutoStart(autoStart); -} - -/// \brief set rsync -void copyEngine::setRsync(const bool rsync) -{ - this->rsync=rsync; - if(uiIsInstalled) - { - ui->rsync->setChecked(rsync); - ui->rsync->setEnabled(forcedMode && mode==Copy); - ui->label_rsync->setEnabled(forcedMode && mode==Copy); - } - listThread->setRsync(rsync); -} - -//set check destination folder -void copyEngine::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) -{ - this->checkDestinationFolderExists=checkDestinationFolderExists; - if(uiIsInstalled) - ui->checkBoxDestinationFolderExists->setChecked(checkDestinationFolderExists); - listThread->setCheckDestinationFolderExists(checkDestinationFolderExists); -} - -//reset widget -void copyEngine::resetTempWidget() -{ - tempWidget=NULL; -} - -void copyEngine::on_comboBoxFolderColision_currentIndexChanged(int index) -{ - switch(index) - { - case 0: - setComboBoxFolderColision(FolderExists_NotSet,false); - break; - case 1: - setComboBoxFolderColision(FolderExists_Merge,false); - break; - case 2: - setComboBoxFolderColision(FolderExists_Skip,false); - break; - case 3: - setComboBoxFolderColision(FolderExists_Rename,false); - break; - } -} - -void copyEngine::on_comboBoxFolderError_currentIndexChanged(int index) -{ - switch(index) - { - case 0: - setComboBoxFolderError(FileError_NotSet,false); - break; - case 1: - setComboBoxFolderError(FileError_Skip,false); - break; - } -} - -//set the translate -void copyEngine::newLanguageLoaded() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, retranslate the widget options"); - if(tempWidget!=NULL) - ui->retranslateUi(tempWidget); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"ui not loaded!"); -} - -void copyEngine::setComboBoxFolderColision(FolderExistsAction action,bool changeComboBox) -{ - alwaysDoThisActionForFolderExists=action; - emit signal_setFolderColision(alwaysDoThisActionForFolderExists); - if(!changeComboBox || !uiIsInstalled) - return; - switch(action) - { - case FolderExists_Merge: - ui->comboBoxFolderColision->setCurrentIndex(1); - break; - case FolderExists_Skip: - ui->comboBoxFolderColision->setCurrentIndex(2); - break; - case FolderExists_Rename: - ui->comboBoxFolderColision->setCurrentIndex(3); - break; - default: - ui->comboBoxFolderColision->setCurrentIndex(0); - break; - } -} - -void copyEngine::setComboBoxFolderError(FileErrorAction action,bool changeComboBox) -{ - alwaysDoThisActionForFileError=action; - if(!changeComboBox || !uiIsInstalled) - return; - switch(action) - { - case FileError_Skip: - ui->comboBoxFolderError->setCurrentIndex(1); - break; - default: - ui->comboBoxFolderError->setCurrentIndex(0); - break; - } -} - -void copyEngine::doChecksum_toggled(bool doChecksum) -{ - listThread->set_doChecksum(doChecksum); -} - -void copyEngine::checksumOnlyOnError_toggled(bool checksumOnlyOnError) -{ - listThread->set_checksumOnlyOnError(checksumOnlyOnError); -} - -void copyEngine::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) -{ - listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); -} - -void copyEngine::osBuffer_toggled(bool osBuffer) -{ - listThread->set_osBuffer(osBuffer); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void copyEngine::osBufferLimited_toggled(bool osBufferLimited) -{ - listThread->set_osBufferLimited(osBufferLimited); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void copyEngine::osBufferLimit_editingFinished() -{ - emit send_osBufferLimit(ui->osBufferLimit->value()); -} - -void copyEngine::showFilterDialog() -{ - if(filters!=NULL) - filters->exec(); -} - -void copyEngine::sendNewFilters() -{ - if(filters!=NULL) - emit send_setFilters(filters->getInclude(),filters->getExclude()); -} - -void copyEngine::sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"new filter"); - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void copyEngine::showRenamingRules() -{ - if(renamingRules==NULL) - { - QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"options not loaded"); - return; - } - renamingRules->exec(); -} - -void copyEngine::get_realBytesTransfered(quint64 realBytesTransfered) -{ - size_for_speed=realBytesTransfered; -} - -void copyEngine::newActionInProgess(EngineActionInProgress action) -{ - if(action==Idle) - { - timerProgression.stop(); - timerActionDone.stop(); - } - else - { - timerProgression.start(); - timerActionDone.start(); - } -} diff --git a/plugins-alternative/CopyEngine/Rsync/copyEngine.h b/plugins-alternative/CopyEngine/Rsync/copyEngine.h deleted file mode 100755 index 5afa8b2..0000000 --- a/plugins-alternative/CopyEngine/Rsync/copyEngine.h +++ /dev/null @@ -1,362 +0,0 @@ -/** \file copyEngine.h -\brief Define the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_CopyEngine.h" -#include "fileErrorDialog.h" -#include "fileExistsDialog.h" -#include "folderExistsDialog.h" -#include "fileIsSameDialog.h" -#include "ui_options.h" -#include "Environment.h" -#include "ListThread.h" -#include "Filters.h" -#include "RenamingRules.h" - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW -#include "debugDialog.h" -#include -#endif - -#ifndef COPY_ENGINE_H -#define COPY_ENGINE_H - -namespace Ui { - class options; -} - -/// \brief the implementation of copy engine plugin, manage directly few stuff, else pass to ListThread class. -class copyEngine : public PluginInterface_CopyEngine -{ - Q_OBJECT -public: - copyEngine(FacilityInterface * facilityEngine); - ~copyEngine(); - void connectTheSignalsSlots(); -private: - ListThread *listThread; - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - debugDialog debugDialogWindow; - #endif - QWidget * tempWidget; - Ui::options * ui; - bool uiIsInstalled; - QWidget * interface; - Filters * filters; - RenamingRules * renamingRules; - FacilityInterface * facilityEngine; - int maxSpeed; - bool doRightTransfer; - bool keepDate; - int blockSize; - bool autoStart; - bool rsync; - bool checkDestinationFolderExists; - FileExistsAction alwaysDoThisActionForFileExists; - FileErrorAction alwaysDoThisActionForFileError; - FileErrorAction alwaysDoThisActionForFolderError; - FolderExistsAction alwaysDoThisActionForFolderExists; - bool dialogIsOpen; - volatile bool stopIt; - /// \brief error queue - struct errorQueueItem - { - TransferThread * transfer; ///< NULL if send by scan thread - scanFileOrFolder * scan; ///< NULL if send by transfer thread - bool mkPath; - bool rmPath; - QFileInfo inode; - QString errorString; - }; - QList errorQueue; - /// \brief already exists queue - struct alreadyExistsQueueItem - { - TransferThread * transfer; ///< NULL if send by scan thread - scanFileOrFolder * scan; ///< NULL if send by transfer thread - QFileInfo source; - QFileInfo destination; - bool isSame; - }; - QList alreadyExistsQueue; - //temp variable - int error_index,loop_size; - FileErrorAction tempFileErrorAction; - FolderExistsAction tempFolderExistsAction; - FileExistsAction tempFileExistsAction; - quint64 size_for_speed;//because direct access to list thread into the main thread can't be do - CopyMode mode; - bool forcedMode; - - bool doChecksum; - bool checksumIgnoreIfImpossible; - bool checksumOnlyOnError; - bool osBuffer; - bool osBufferLimited; - unsigned int osBufferLimit; - QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; - QString firstRenamingRule; - QString otherRenamingRule; - - //send action done timer - QTimer timerActionDone; - //send progression timer - QTimer timerProgression; -private slots: - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - void updateTheDebugInfo(QStringList,QStringList,int); - #endif - //dialog message - /// \note Can be call without queue because all call will be serialized - void fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog=false); - /// \note Can be call without queue because all call will be serialized - void errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog=false); - /// \note Can be call without queue because all call will be serialized - void folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); - /// \note Can be call without queue because all call will be serialized - void errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); - //mkpath event - void mkPathErrorOnFolder(QFileInfo,QString,bool isCalledByShowOneNewDialog=false); - //rmpath event - void rmPathErrorOnFolder(QFileInfo,QString,bool isCalledByShowOneNewDialog=false); - //show one new dialog if needed - void showOneNewDialog(); - void sendNewFilters(); - - void doChecksum_toggled(bool); - void checksumOnlyOnError_toggled(bool); - void checksumIgnoreIfImpossible_toggled(bool); - void osBuffer_toggled(bool); - void osBufferLimited_toggled(bool); - void osBufferLimit_editingFinished(); - void showFilterDialog(); - void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void showRenamingRules(); - void get_realBytesTransfered(quint64 realBytesTransfered); - void newActionInProgess(EngineActionInProgress); -public: - /** \brief to send the options panel - * \return return false if have not the options - * \param tempWidget the widget to generate on it the options */ - bool getOptionsEngine(QWidget * tempWidget); - /** \brief to have interface widget to do modal dialog - * \param interface to have the widget of the interface, useful for modal dialog */ - void setInterfacePointer(QWidget * interface); - //return empty if multiple - /** \brief compare the current sources of the copy, with the passed arguments - * \param sources the sources list to compares with the current sources list - * \return true if have same sources, else false (or empty) */ - bool haveSameSource(const QStringList &sources); - /** \brief compare the current destination of the copy, with the passed arguments - * \param destination the destination to compares with the current destination - * \return true if have same destination, else false (or empty) */ - bool haveSameDestination(const QString &destination); - //external soft like file browser have send copy/move list to do - /** \brief send copy without destination, ask the destination - * \param sources the sources list to copy - * \return true if the copy have been accepted */ - bool newCopy(const QStringList &sources); - /** \brief send copy with destination - * \param sources the sources list to copy - * \param destination the destination to copy - * \return true if the copy have been accepted */ - bool newCopy(const QStringList &sources,const QString &destination); - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \return true if the move have been accepted */ - bool newMove(const QStringList &sources); - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \param destination the destination to move - * \return true if the move have been accepted */ - bool newMove(const QStringList &sources,const QString &destination); - /** \brief send the new transfer list - * \param file the transfer list */ - void newTransferList(const QString &file); - - /** \brief to get byte read, use by Ultracopier for the speed calculation - * real size transfered to right speed calculation */ - quint64 realByteTransfered(); - //speed limitation - /** \brief get the speed limitation - * < -1 if not able, 0 if disabled */ - qint64 getSpeedLimitation(); - //get collision action - /** \brief get the collision action list */ - QList > getCollisionAction(); - /** \brief get the collision error list */ - QList > getErrorAction(); - - /** \brief to set drives detected - * specific to this copy engine */ - void setDrive(const QStringList &drives); - - /** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ - void syncTransferList(); - - void set_doChecksum(bool doChecksum); - void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); - void set_checksumOnlyOnError(bool checksumOnlyOnError); - void set_osBuffer(bool osBuffer); - void set_osBufferLimited(bool osBufferLimited); - void set_osBufferLimit(unsigned int osBufferLimit); - void set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -public slots: - //user ask ask to add folder (add it with interface ask source/destination) - /** \brief add folder called on the interface - * Used by manual adding */ - bool userAddFolder(const CopyMode &mode); - /** \brief add file called on the interface - * Used by manual adding */ - bool userAddFile(const CopyMode &mode); - //action on the copy - /// \brief put the transfer in pause - void pause(); - /// \brief resume the transfer - void resume(); - /** \brief skip one transfer entry - * \param id id of the file to remove */ - void skip(const quint64 &id); - /// \brief cancel all the transfer - void cancel(); - //edit the transfer list - /** \brief remove the selected item - * \param ids ids is the id list of the selected items */ - void removeItems(const QList &ids); - /** \brief move on top of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnTop(const QList &ids); - /** \brief move up the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsUp(const QList &ids); - /** \brief move down the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsDown(const QList &ids); - /** \brief move on bottom of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnBottom(const QList &ids); - - /** \brief give the forced mode, to export/import transfer list */ - void forceMode(const CopyMode &mode); - /// \brief export the transfer list into a file - void exportTransferList(); - /// \brief import the transfer list into a file - void importTransferList(); - - /** \brief to set the speed limitation - * -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - //action - /// \brief to set the collision action - void setCollisionAction(const QString &action); - /// \brief to set the error action - void setErrorAction(const QString &action); - - // specific to this copy engine - - /// \brief set if the rights shoul be keep - void setRightTransfer(const bool doRightTransfer); - /// \brief set keep date - void setKeepDate(const bool keepDate); - /// \brief set block size in KB - void setBlockSize(const int blockSize); - /// \brief set auto start - void setAutoStart(const bool autoStart); - /// \brief set rsync - void setRsync(const bool rsync); - /// \brief set if need check if the destination folder exists - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - /// \brief reset widget - void resetTempWidget(); - //autoconnect - void on_comboBoxFolderColision_currentIndexChanged(int index); - void on_comboBoxFolderError_currentIndexChanged(int index); - /// \brief need retranslate the insterface - void newLanguageLoaded(); -private slots: - void setComboBoxFolderColision(FolderExistsAction action,bool changeComboBox=true); - void setComboBoxFolderError(FileErrorAction action,bool changeComboBox=true); - void warningTransferList(const QString &warning); - void errorTransferList(const QString &error); -signals: - //send information about the copy - void actionInProgess(EngineActionInProgress); //should update interface information on this event - - void newActionOnList(const QList &);///very important, need be temporized to group the modification to do and not flood the interface - void syncReady(); - - /** \brief to get the progression for a specific file - * \param id the id of the transfer, id send during population the transfer list - * first = current transfered byte, second = byte to transfer */ - void pushFileProgression(const QList &progressionList); - //get information about the copy - /** \brief to get the general progression - * first = current transfered byte, second = byte to transfer */ - void pushGeneralProgression(const quint64 &,const quint64 &); - - void newFolderListing(const QString &path); - void newCollisionAction(const QString &action); - void newErrorAction(const QString &action); - void isInPause(bool); - - //action on the copy - void signal_pause(); - void signal_resume(); - void signal_skip(const quint64 &id); - - //edit the transfer list - void signal_removeItems(const QList &ids); - void signal_moveItemsOnTop(const QList &ids); - void signal_moveItemsUp(const QList &ids); - void signal_moveItemsDown(const QList &ids); - void signal_moveItemsOnBottom(const QList &ids); - - void signal_forceMode(const CopyMode &mode); - void signal_exportTransferList(const QString &fileName); - void signal_importTransferList(const QString &fileName); - - //action - void signal_setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists); - void signal_setComboBoxFolderColision(FolderExistsAction action); - void signal_setFolderColision(FolderExistsAction action); - - //when the cancel is clicked on copy engine dialog - void cancelAll(); - - //internal cancel - void tryCancel(); - - //when can be deleted - void canBeDeleted(); - - //send error occurred - void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error); - //for the extra logging - void rmPath(const QString &path); - void mkPath(const QString &path); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - - //other signals - void queryOneNewDialog(); - - void send_osBufferLimit(const unsigned int &osBufferLimit); - void send_setFilters(const QList &include,const QList &exclude); - void send_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -}; - -#endif // COPY_ENGINE_H diff --git a/plugins-alternative/CopyEngine/Rsync/copyEngine.pro b/plugins-alternative/CopyEngine/Rsync/copyEngine.pro deleted file mode 100644 index 13ab523..0000000 --- a/plugins-alternative/CopyEngine/Rsync/copyEngine.pro +++ /dev/null @@ -1,82 +0,0 @@ -TEMPLATE = lib -CONFIG += plugin -HEADERS = copyEngine.h \ - StructEnumDefinition.h \ - scanFileOrFolder.h \ - fileErrorDialog.h \ - fileExistsDialog.h \ - fileIsSameDialog.h \ - factory.h \ - StructEnumDefinition_CopyEngine.h \ - DebugEngineMacro.h \ - Variable.h \ - debugDialog.h \ - TransferThread.h \ - ReadThread.h \ - WriteThread.h \ - RmPath.h \ - MkPath.h \ - folderExistsDialog.h \ - AvancedQFile.h \ - ListThread.h \ - ../../../interface/PluginInterface_CopyEngine.h \ - ../../../interface/OptionInterface.h \ - ../../../interface/FacilityInterface.h \ - Filters.h \ - FilterRules.h \ - RenamingRules.h -SOURCES = copyEngine.cpp \ - scanFileOrFolder.cpp \ - fileErrorDialog.cpp \ - fileExistsDialog.cpp \ - fileIsSameDialog.cpp \ - factory.cpp \ - debugDialog.cpp \ - TransferThread.cpp \ - ReadThread.cpp \ - WriteThread.cpp \ - RmPath.cpp \ - MkPath.cpp \ - folderExistsDialog.cpp \ - AvancedQFile.cpp \ - copyEngine-collision-and-error.cpp \ - ListThread.cpp \ - Filters.cpp \ - FilterRules.cpp \ - RenamingRules.cpp \ - ListThread_InodeAction.cpp -TARGET = $$qtLibraryTarget(copyEngine) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ - Languages/de/translation.ts \ - Languages/el/translation.ts \ - Languages/it/translation.ts \ - Languages/ja/translation.ts \ - Languages/id/translation.ts \ - Languages/pl/translation.ts \ - Languages/ru/translation.ts \ - Languages/tr/translation.ts \ - Languages/th/translation.ts \ - Languages/hi/translation.ts \ - Languages/nl/translation.ts \ - Languages/no/translation.ts \ - Languages/pt/translation.ts \ - Languages/ko/translation.ts - -FORMS += \ - options.ui \ - fileErrorDialog.ui \ - fileExistsDialog.ui \ - fileIsSameDialog.ui \ - debugDialog.ui \ - folderExistsDialog.ui \ - Filters.ui \ - FilterRules.ui \ - RenamingRules.ui - -OTHER_FILES += informations.xml - -RESOURCES += \ - resources.qrc diff --git a/plugins-alternative/CopyEngine/Rsync/debugDialog.cpp b/plugins-alternative/CopyEngine/Rsync/debugDialog.cpp deleted file mode 100644 index a03aec0..0000000 --- a/plugins-alternative/CopyEngine/Rsync/debugDialog.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** \file debugDialog.cpp -\brief Define the dialog to have debug information -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include "debugDialog.h" -#include "ui_debugDialog.h" - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - -debugDialog::debugDialog(QWidget *parent) : - QWidget(parent), - ui(new Ui::debugDialog) -{ - ui->setupUi(this); -} - -debugDialog::~debugDialog() -{ - delete ui; -} - -void debugDialog::setTransferList(const QStringList &list) -{ - if(list.size()==ui->tranferList->count()) - { - int index=0; - while(indextranferList->item(index)->setText(list.at(index)); - index++; - } - } - else - { - ui->tranferList->clear(); - ui->tranferList->addItems(list); - } -} - -void debugDialog::setActiveTransfer(int activeTransfer) -{ - ui->spinBoxActiveTransfer->setValue(activeTransfer); -} - -void debugDialog::setInodeUsage(int inodeUsage) -{ - ui->spinBoxNumberOfInode->setValue(inodeUsage); -} - -void debugDialog::setTransferThreadList(const QStringList &list) -{ - if(list.size()==ui->transferThreadList->count()) - { - int index=0; - while(indextransferThreadList->item(index)->setText(list.at(index)); - index++; - } - } - else - { - ui->transferThreadList->clear(); - ui->transferThreadList->addItems(list); - } -} - -#endif diff --git a/plugins-alternative/CopyEngine/Rsync/debugDialog.h b/plugins-alternative/CopyEngine/Rsync/debugDialog.h deleted file mode 100644 index 3d48857..0000000 --- a/plugins-alternative/CopyEngine/Rsync/debugDialog.h +++ /dev/null @@ -1,40 +0,0 @@ -/** \file debugDialog.h -\brief Define the dialog to have debug information -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef DEBUGDAILOG_H -#define DEBUGDAILOG_H - -#include "Environment.h" - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW -#include - -namespace Ui { - class debugDialog; -} - -/// \brief class to the dialog to have debug information -class debugDialog : public QWidget -{ - Q_OBJECT -public: - explicit debugDialog(QWidget *parent = 0); - ~debugDialog(); - /// \brief to set the transfer list, limited in result to not slow down the application - void setTransferList(const QStringList &list); - /// \brief show the transfer thread, it show be a thread pool in normal time - void setTransferThreadList(const QStringList &list); - /// \brief show how many transfer is active - void setActiveTransfer(int activeTransfer); - /// \brief show many many inode is manipulated - void setInodeUsage(int inodeUsage); -private: - Ui::debugDialog *ui; -}; - -#endif // ULTRACOPIER_PLUGIN_DEBUG_WINDOW - -#endif // DEBUGDAILOG_H diff --git a/plugins-alternative/CopyEngine/Rsync/debugDialog.ui b/plugins-alternative/CopyEngine/Rsync/debugDialog.ui deleted file mode 100644 index 0df03be..0000000 --- a/plugins-alternative/CopyEngine/Rsync/debugDialog.ui +++ /dev/null @@ -1,100 +0,0 @@ - - - debugDialog - - - - 0 - 0 - 665 - 392 - - - - Monitor - - - - - - - - Transfer thread - - - - - - true - - - - - - - - - - Transfer list - - - - - - true - - - - - - - - - - - - Variables - - - - - - Active transfer: - - - - - - - true - - - 9999 - - - - - - - Number of inode manipuled: - - - - - - - true - - - 9999 - - - - - - - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/documentation.dox b/plugins-alternative/CopyEngine/Rsync/documentation.dox deleted file mode 100755 index 2ff6edd..0000000 --- a/plugins-alternative/CopyEngine/Rsync/documentation.dox +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ - -/* - This file contains NO source code, just some documentation for doxygen to - parse. -*/ - -/*! - \mainpage Copy engine 0.3 - - \section mainpage_overview Overview - - The rsync copy engine for Ultracopier 0.3. Support file/folder, copy/move, ...\n - Thanks to this engine, Ultracopier is transformed into GUI + rsync. - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. - - \section mainpage_platforms Platforms - - This plugin might be usable in all environments where you find Qt 4, but Gcc is requiered for some part.\n - This plugin requires Qt 4.5.x or newer. Tested on Qt 4.7. Due to optimization Qt 4.8 usage will be better.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. - - \section mainpage_downloads Downloads - - You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... - - \section mainpage_algorithm Algorithm - - Like say previously you will have more informations on the wiki.\n - Then file transfer is done via pipe mecamism system:\n -
    -
  • push at no blocking into table up to the table is full, after is blocked up to one entry is free
  • -
  • Other thread read the table up to have no more data, then is blocked
  • -
- The transfer thread do listing of the folder, removing folder, make folder is one thread for each.\n - The transfer list, have thread pool to do the inode operation (open, close, set date, ...). Do all inode operation in parallele, but transfer the data as sequential. - - \section license GPL Version 3 - The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4. - -*/ - diff --git a/plugins-alternative/CopyEngine/Rsync/factory.cpp b/plugins-alternative/CopyEngine/Rsync/factory.cpp deleted file mode 100644 index 7ed27d4..0000000 --- a/plugins-alternative/CopyEngine/Rsync/factory.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/** \file factory.cpp -\brief Define the factory to create new instance -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include - -#include "factory.h" - -Factory::Factory() : - ui(new Ui::options()) -{ - tempWidget=new QWidget(); - ui->setupUi(tempWidget); - errorFound=false; - optionsEngine=NULL; - filters=new Filters(tempWidget); - renamingRules=new RenamingRules(tempWidget); - #if defined (Q_OS_WIN32) - QFileInfoList temp=QDir::drives(); - for (int i = 0; i < temp.size(); ++i) { - mountSysPoint<doRightTransfer, SIGNAL(toggled(bool)), this,SLOT(setDoRightTransfer(bool))); - connect(ui->keepDate, SIGNAL(toggled(bool)), this,SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), this,SLOT(setBlockSize(int))); - connect(ui->autoStart, SIGNAL(toggled(bool)), this,SLOT(setAutoStart(bool))); - connect(ui->rsync, SIGNAL(toggled(bool)), this,SLOT(setRsync(bool))); - connect(ui->doChecksum, SIGNAL(toggled(bool)), this,SLOT(doChecksum_toggled(bool))); - connect(ui->checksumIgnoreIfImpossible, SIGNAL(toggled(bool)), this,SLOT(checksumIgnoreIfImpossible_toggled(bool))); - connect(ui->checksumOnlyOnError, SIGNAL(toggled(bool)), this,SLOT(checksumOnlyOnError_toggled(bool))); - connect(ui->osBuffer, SIGNAL(toggled(bool)), this,SLOT(osBuffer_toggled(bool))); - connect(ui->osBufferLimited, SIGNAL(toggled(bool)), this,SLOT(osBufferLimited_toggled(bool))); - connect(ui->osBufferLimit, SIGNAL(editingFinished()), this,SLOT(osBufferLimit_editingFinished())); - - connect(filters,SIGNAL(sendNewFilters(QStringList,QStringList,QStringList,QStringList)),this,SLOT(sendNewFilters(QStringList,QStringList,QStringList,QStringList))); - connect(ui->filters,SIGNAL(clicked()),this,SLOT(showFilterDialog())); - connect(renamingRules,SIGNAL(sendNewRenamingRules(QString,QString)),this,SLOT(sendNewRenamingRules(QString,QString))); - connect(ui->renamingRules,SIGNAL(clicked()),this,SLOT(showRenamingRules())); - - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -Factory::~Factory() -{ - delete renamingRules; - delete filters; - delete ui; -} - -PluginInterface_CopyEngine * Factory::getInstance() -{ - copyEngine *realObject=new copyEngine(facilityEngine); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(realObject,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif - realObject->connectTheSignalsSlots(); - realObject->setDrive(mountSysPoint); - PluginInterface_CopyEngine * newTransferEngine=realObject; - connect(this,SIGNAL(reloadLanguage()),newTransferEngine,SLOT(newLanguageLoaded())); - realObject->setRightTransfer( optionsEngine->getOptionValue("doRightTransfer").toBool()); - realObject->setKeepDate( optionsEngine->getOptionValue("keepDate").toBool()); - realObject->setBlockSize( optionsEngine->getOptionValue("blockSize").toInt()); - realObject->setAutoStart( optionsEngine->getOptionValue("autoStart").toBool()); - realObject->setRsync( optionsEngine->getOptionValue("rsync").toBool()); - realObject->on_comboBoxFolderColision_currentIndexChanged(ui->comboBoxFolderColision->currentIndex()); - realObject->on_comboBoxFolderError_currentIndexChanged(ui->comboBoxFolderError->currentIndex()); - realObject->setCheckDestinationFolderExists( optionsEngine->getOptionValue("checkDestinationFolder").toBool()); - - realObject->set_doChecksum(optionsEngine->getOptionValue("doChecksum").toBool()); - realObject->set_checksumIgnoreIfImpossible(optionsEngine->getOptionValue("checksumIgnoreIfImpossible").toBool()); - realObject->set_checksumOnlyOnError(optionsEngine->getOptionValue("checksumOnlyOnError").toBool()); - realObject->set_osBuffer(optionsEngine->getOptionValue("osBuffer").toBool()); - realObject->set_osBufferLimited(optionsEngine->getOptionValue("osBufferLimited").toBool()); - realObject->set_osBufferLimit(optionsEngine->getOptionValue("osBufferLimit").toUInt()); - realObject->set_setFilters(optionsEngine->getOptionValue("includeStrings").toStringList(), - optionsEngine->getOptionValue("includeOptions").toStringList(), - optionsEngine->getOptionValue("excludeStrings").toStringList(), - optionsEngine->getOptionValue("excludeOptions").toStringList() - ); - realObject->setRenamingRules(optionsEngine->getOptionValue("firstRenamingRule").toString(),optionsEngine->getOptionValue("otherRenamingRule").toString()); - return newTransferEngine; -} - -void Factory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath:"+pluginPath); - this->facilityEngine=facilityInterface; - Q_UNUSED(portableVersion); - #ifndef ULTRACOPIER_PLUGIN_DEBUG - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - #endif - #if ! defined (Q_CC_GNU) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Unable to change date time of files, only gcc is supported"); - #endif - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,COMPILERINFO); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX BUFFER BLOCK: "+QString::number(ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MIN TIMER INTERVAL: "+QString::number(ULTRACOPIER_PLUGIN_MINTIMERINTERVAL)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX TIMER INTERVAL: "+QString::number(ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"NUM SEM SPEED MANAGEMENT: "+QString::number(ULTRACOPIER_PLUGIN_NUMSEMSPEEDMANAGEMENT)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX PARALLEL INODE OPT: "+QString::number(ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX PARALLEL TRANFER: "+QString::number(ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER)); - #if defined (ULTRACOPIER_PLUGIN_CHECKLISTTYPE) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"CHECK LIST TYPE set"); - #else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"CHECK LIST TYPE not set"); - #endif - if(options!=NULL) - { - optionsEngine=options; - //load the options - QList > KeysList; - KeysList.append(qMakePair(QString("doRightTransfer"),QVariant(true))); - KeysList.append(qMakePair(QString("keepDate"),QVariant(true))); - KeysList.append(qMakePair(QString("blockSize"),QVariant(1024)));//1024KB as default - KeysList.append(qMakePair(QString("autoStart"),QVariant(true))); - KeysList.append(qMakePair(QString("rsync"),QVariant(true))); - KeysList.append(qMakePair(QString("folderError"),QVariant(0))); - KeysList.append(qMakePair(QString("folderColision"),QVariant(0))); - KeysList.append(qMakePair(QString("checkDestinationFolder"),QVariant(true))); - KeysList.append(qMakePair(QString("includeStrings"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("includeOptions"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("excludeStrings"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("excludeOptions"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("doChecksum"),QVariant(true))); - KeysList.append(qMakePair(QString("checksumIgnoreIfImpossible"),QVariant(true))); - KeysList.append(qMakePair(QString("checksumOnlyOnError"),QVariant(true))); - KeysList.append(qMakePair(QString("osBuffer"),QVariant(true))); - KeysList.append(qMakePair(QString("firstRenamingRule"),QVariant(""))); - KeysList.append(qMakePair(QString("otherRenamingRule"),QVariant(""))); - #ifdef Q_OS_WIN32 - KeysList.append(qMakePair(QString("osBufferLimited"),QVariant(true))); - #else - KeysList.append(qMakePair(QString("osBufferLimited"),QVariant(false))); - #endif - KeysList.append(qMakePair(QString("osBufferLimit"),QVariant(512))); - optionsEngine->addOptionGroup(KeysList); - #if ! defined (Q_CC_GNU) - ui->keepDate->setEnabled(false); - ui->keepDate->setToolTip("Not supported with this compiler"); - #endif - ui->doRightTransfer->setChecked(optionsEngine->getOptionValue("doRightTransfer").toBool()); - ui->keepDate->setChecked(optionsEngine->getOptionValue("keepDate").toBool()); - ui->blockSize->setValue(optionsEngine->getOptionValue("blockSize").toUInt()); - ui->autoStart->setChecked(optionsEngine->getOptionValue("autoStart").toBool()); - ui->rsync->setChecked(optionsEngine->getOptionValue("rsync").toBool()); - ui->comboBoxFolderError->setCurrentIndex(optionsEngine->getOptionValue("folderError").toUInt()); - ui->comboBoxFolderColision->setCurrentIndex(optionsEngine->getOptionValue("folderColision").toUInt()); - ui->checkBoxDestinationFolderExists->setChecked(optionsEngine->getOptionValue("checkDestinationFolder").toBool()); - ui->doChecksum->setChecked(optionsEngine->getOptionValue("doChecksum").toBool()); - ui->checksumIgnoreIfImpossible->setChecked(optionsEngine->getOptionValue("checksumIgnoreIfImpossible").toBool()); - ui->checksumOnlyOnError->setChecked(optionsEngine->getOptionValue("checksumOnlyOnError").toBool()); - ui->osBuffer->setChecked(optionsEngine->getOptionValue("osBuffer").toBool()); - ui->osBufferLimited->setChecked(optionsEngine->getOptionValue("osBufferLimited").toBool()); - ui->osBufferLimit->setValue(optionsEngine->getOptionValue("osBufferLimit").toUInt()); - filters->setFilters(optionsEngine->getOptionValue("includeStrings").toStringList(), - optionsEngine->getOptionValue("includeOptions").toStringList(), - optionsEngine->getOptionValue("excludeStrings").toStringList(), - optionsEngine->getOptionValue("excludeOptions").toStringList() - ); - renamingRules->setRenamingRules(optionsEngine->getOptionValue("firstRenamingRule").toString(),optionsEngine->getOptionValue("otherRenamingRule").toString()); - } -} - -QStringList Factory::supportedProtocolsForTheSource() -{ - return QStringList() << "file"; -} - -QStringList Factory::supportedProtocolsForTheDestination() -{ - return QStringList() << "file"; -} - -CopyType Factory::getCopyType() -{ - return FileAndFolder; -} - -TransferListOperation Factory::getTransferListOperation() -{ - return TransferListOperation_ImportExport; -} - -bool Factory::canDoOnlyCopy() -{ - return false; -} - -void Factory::error(QProcess::ProcessError error) -{ - #ifndef ULTRACOPIER_PLUGIN_DEBUG - Q_UNUSED(error) - #endif - errorFound=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"have detected error: "+QString::number(error)); -} - -void Factory::finished(int exitCode, QProcess::ExitStatus exitStatus) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"exitCode: "+QString::number(exitCode)+", exitStatus: "+QString::number(exitStatus)); - #ifndef ULTRACOPIER_PLUGIN_DEBUG - Q_UNUSED(exitCode) - Q_UNUSED(exitStatus) - #endif - if(!StandardError.isEmpty()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"have finished with text on error output: "+StandardError); - else if(errorFound) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"have finished with error and no text"); - { - QStringList tempList=StandardOutput.split(QRegExp("[\n\r]+")); - int index=0; - while(indexautoStart->setChecked(optionsEngine->getOptionValue("autoStart").toBool()); - return tempWidget; -} - -void Factory::setDoRightTransfer(bool doRightTransfer) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("doRightTransfer",doRightTransfer); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setKeepDate(bool keepDate) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("keepDate",keepDate); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setBlockSize(int blockSize) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("blockSize",blockSize); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setAutoStart(bool autoStart) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("autoStart",autoStart); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setRsync(bool rsync) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("rsync",rsync); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::newLanguageLoaded() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, retranslate the widget options"); - ui->retranslateUi(tempWidget); - if(optionsEngine!=NULL) - { - filters->newLanguageLoaded(); - renamingRules->newLanguageLoaded(); - } - emit reloadLanguage(); -} - -Q_EXPORT_PLUGIN2(copyEngine, Factory); - -void Factory::doChecksum_toggled(bool doChecksum) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("doChecksum",doChecksum); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::checksumOnlyOnError_toggled(bool checksumOnlyOnError) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("checksumOnlyOnError",checksumOnlyOnError); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::osBuffer_toggled(bool osBuffer) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("osBuffer",osBuffer); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void Factory::osBufferLimited_toggled(bool osBufferLimited) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("osBufferLimited",osBufferLimited); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void Factory::osBufferLimit_editingFinished() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the spinbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("osBufferLimit",ui->osBufferLimit->value()); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::showFilterDialog() -{ - if(optionsEngine==NULL) - { - QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"options not loaded"); - return; - } - filters->exec(); -} - -void Factory::sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"new filter"); - if(optionsEngine!=NULL) - { - optionsEngine->setOptionValue("includeStrings",includeStrings); - optionsEngine->setOptionValue("includeOptions",includeOptions); - optionsEngine->setOptionValue("excludeStrings",excludeStrings); - optionsEngine->setOptionValue("excludeOptions",excludeOptions); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"new filter"); - if(optionsEngine!=NULL) - { - optionsEngine->setOptionValue("firstRenamingRule",firstRenamingRule); - optionsEngine->setOptionValue("otherRenamingRule",otherRenamingRule); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::showRenamingRules() -{ - if(optionsEngine==NULL) - { - QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"options not loaded"); - return; - } - renamingRules->exec(); -} - -void Factory::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("checksumIgnoreIfImpossible",checksumIgnoreIfImpossible); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} diff --git a/plugins-alternative/CopyEngine/Rsync/factory.h b/plugins-alternative/CopyEngine/Rsync/factory.h deleted file mode 100644 index 40c6d53..0000000 --- a/plugins-alternative/CopyEngine/Rsync/factory.h +++ /dev/null @@ -1,96 +0,0 @@ -/** \file factory.h -\brief Define the factory to create new instance -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_CopyEngine.h" -#include "StructEnumDefinition.h" -#include "ui_options.h" -#include "copyEngine.h" -#include "Environment.h" -#include "Filters.h" -#include "RenamingRules.h" - -#ifndef FACTORY_H -#define FACTORY_H - -namespace Ui { - class options; -} - -/** \brief to generate copy engine instance */ -class Factory : public PluginInterface_CopyEngineFactory -{ - Q_OBJECT - Q_INTERFACES(PluginInterface_CopyEngineFactory) -public: - Factory(); - ~Factory(); - /// \brief to return the instance of the copy engine - PluginInterface_CopyEngine * getInstance(); - /// \brief set the resources, to store options, to have facilityInterface - void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion); - //get mode allowed - /// \brief define if can copy file, folder or both - CopyType getCopyType(); - /// \brief to return which kind of transfer list operation is supported - TransferListOperation getTransferListOperation(); - /// \brief define if can only copy, or copy and move - bool canDoOnlyCopy(); - /// \brief to get the supported protocols for the source - QStringList supportedProtocolsForTheSource(); - /// \brief to get the supported protocols for the destination - QStringList supportedProtocolsForTheDestination(); - /// \brief to get the options of the copy engine - QWidget * options(); -private: - Ui::options *ui; - QWidget* tempWidget; - OptionInterface * optionsEngine; - QStringList mountSysPoint; - QProcess mount; - QString StandardError; - QString StandardOutput; - bool errorFound; - FacilityInterface * facilityEngine; - Filters *filters; - RenamingRules *renamingRules; -private slots: - void error(QProcess::ProcessError error); - void finished(int exitCode, QProcess::ExitStatus exitStatus); - void readyReadStandardError(); - void readyReadStandardOutput(); - void setDoRightTransfer(bool doRightTransfer); - void setKeepDate(bool keepDate); - void setBlockSize(int blockSize); - void setAutoStart(bool autoStart); - void setRsync(bool rsync); - void showFilterDialog(); - void sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void doChecksum_toggled(bool); - void checksumOnlyOnError_toggled(bool); - void osBuffer_toggled(bool); - void osBufferLimited_toggled(bool); - void osBufferLimit_editingFinished(); - void checksumIgnoreIfImpossible_toggled(bool); - void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void showRenamingRules(); -public slots: - void resetOptions(); - void newLanguageLoaded(); -signals: - void reloadLanguage(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif -}; - -#endif // FACTORY_H diff --git a/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.cpp b/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.cpp deleted file mode 100644 index 0d9fa9a..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "fileErrorDialog.h" -#include "ui_fileErrorDialog.h" - -fileErrorDialog::fileErrorDialog(QWidget *parent,QFileInfo fileInfo,QString errorString,bool havePutAtTheEndButton) : - QDialog(parent), - ui(new Ui::fileErrorDialog) -{ - ui->setupUi(this); - action=FileError_Cancel; - ui->label_error->setText(errorString); - ui->label_content_file_name->setText(fileInfo.fileName()); - if(fileInfo.exists()) - { - ui->label_content_size->setText(QString::number(fileInfo.size())); - QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); - if(maxTimelabel_modified->setVisible(true); - ui->label_content_modified->setVisible(true); - ui->label_content_modified->setText(fileInfo.lastModified().toString()); - } - else - { - ui->label_modified->setVisible(false); - ui->label_content_modified->setVisible(false); - } - if(fileInfo.isDir()) - { - this->setWindowTitle(tr("Error on folder")); - ui->label_size->hide(); - ui->label_content_size->hide(); - ui->label_file_name->setText(tr("Folder name")); - } - } - else - { - ui->label_size->hide(); - ui->label_content_size->hide(); - ui->label_modified->hide(); - ui->label_content_modified->hide(); - } - if(!havePutAtTheEndButton) - ui->PutToBottom->hide(); -} - -fileErrorDialog::~fileErrorDialog() -{ - delete ui; -} - -void fileErrorDialog::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -void fileErrorDialog::on_PutToBottom_clicked() -{ - action=FileError_PutToEndOfTheList; - this->close(); -} - -void fileErrorDialog::on_Retry_clicked() -{ - action=FileError_Retry; - this->close(); -} - -void fileErrorDialog::on_Skip_clicked() -{ - action=FileError_Skip; - this->close(); -} - -void fileErrorDialog::on_Cancel_clicked() -{ - action=FileError_Cancel; - this->close(); -} - -bool fileErrorDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -FileErrorAction fileErrorDialog::getAction() -{ - return action; -} diff --git a/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.h b/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.h deleted file mode 100644 index b14fe87..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.h +++ /dev/null @@ -1,45 +0,0 @@ -/** \file fileErrorDialog.h -\brief Define the dialog error on the file -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include "Environment.h" - -#ifndef FILEERRORDIALOG_H -#define FILEERRORDIALOG_H - -namespace Ui { - class fileErrorDialog; -} - -/// \brief to show error dialog, and ask what do -class fileErrorDialog : public QDialog -{ - Q_OBJECT -public: - /// \brief create the object and pass all the informations to it - explicit fileErrorDialog(QWidget *parent,QFileInfo fileInfo,QString errorString,bool havePutAtTheEndButton=true); - ~fileErrorDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FileErrorAction getAction(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_PutToBottom_clicked(); - void on_Retry_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); -private: - Ui::fileErrorDialog *ui; - FileErrorAction action; -}; - -#endif // FILEERRORDIALOG_H diff --git a/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.ui b/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.ui deleted file mode 100644 index c5027e7..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileErrorDialog.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - fileErrorDialog - - - - 0 - 0 - 478 - 154 - - - - Error on file - - - - - - Error - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - source.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - &Always do this action - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Put to bottom - - - - - - - Retry - - - - - - - &Skip - - - - - - - &Cancel - - - - - - - - - - - checkBoxAlways - toggled(bool) - Cancel - setDisabled(bool) - - - 112 - 131 - - - 438 - 142 - - - - - checkBoxAlways - toggled(bool) - Retry - setDisabled(bool) - - - 155 - 131 - - - 309 - 134 - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.cpp b/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.cpp deleted file mode 100644 index 191dd79..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include "fileExistsDialog.h" -#include "ui_fileExistsDialog.h" - -#include - -fileExistsDialog::fileExistsDialog(QWidget *parent,QFileInfo source,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule) : - QDialog(parent), - ui(new Ui::fileExistsDialog) -{ - ui->setupUi(this); - action=FileExists_Cancel; - destinationInfo=destination; - oldName=destination.fileName(); - ui->lineEditNewName->setText(oldName); - ui->lineEditNewName->setPlaceholderText(oldName); - ui->Overwrite->addAction(ui->actionOverwrite_if_newer); - ui->Overwrite->addAction(ui->actionOverwrite_if_not_same_modification_date); - ui->label_content_source_size->setText(QString::number(source.size())); - ui->label_content_source_modified->setText(source.lastModified().toString()); - ui->label_content_source_file_name->setText(source.fileName()); - ui->label_content_destination_size->setText(QString::number(destination.size())); - ui->label_content_destination_modified->setText(destination.lastModified().toString()); - ui->label_content_destination_file_name->setText(destination.fileName()); - QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); - if(maxTimelabel_source_modified->setVisible(true); - ui->label_content_source_modified->setVisible(true); - ui->label_content_source_modified->setText(source.lastModified().toString()); - } - else - { - ui->label_source_modified->setVisible(false); - ui->label_content_source_modified->setVisible(false); - } - if(maxTimelabel_destination_modified->setVisible(true); - ui->label_content_destination_modified->setVisible(true); - ui->label_content_destination_modified->setText(destination.lastModified().toString()); - } - else - { - ui->label_destination_modified->setVisible(false); - ui->label_content_destination_modified->setVisible(false); - } - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -fileExistsDialog::~fileExistsDialog() -{ - delete ui; -} - -void fileExistsDialog::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -QString fileExistsDialog::getNewName() -{ - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - qDebug() << "return the old name: "+oldName; - else - qDebug() << "return the new name: "+ui->lineEditNewName->text(); - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - return oldName; - else - return ui->lineEditNewName->text(); -} - -void fileExistsDialog::on_SuggestNewName_clicked() -{ - QFileInfo destinationInfo=this->destinationInfo; - QString absolutePath=destinationInfo.absolutePath(); - QString fileName=destinationInfo.fileName(); - QString suffix=""; - QString destination; - QString newFileName; - //resolv the suffix - if(fileName.contains(QRegExp("^(.*)(\\.[a-z0-9]+)$"))) - { - suffix=fileName; - suffix.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\2"); - fileName.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\1"); - } - //resolv the new name - int num=1; - do - { - if(num==1) - { - if(firstRenamingRule=="") - newFileName=tr("%1 - copy").arg(fileName); - else - { - newFileName=firstRenamingRule; - newFileName.replace("%name%",fileName); - } - } - else - { - if(otherRenamingRule=="") - newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); - else - { - newFileName=otherRenamingRule; - newFileName.replace("%name%",fileName); - newFileName.replace("%number%",QString::number(num)); - } - } - destination=absolutePath+QDir::separator()+newFileName+suffix; - destinationInfo.setFile(destination); - num++; - } - while(destinationInfo.exists()); - ui->lineEditNewName->setText(newFileName+suffix); -} - -void fileExistsDialog::on_Rename_clicked() -{ - action=FileExists_Rename; - this->close(); -} - -void fileExistsDialog::on_Overwrite_clicked() -{ - action=FileExists_Overwrite; - this->close(); -} - -void fileExistsDialog::on_Skip_clicked() -{ - action=FileExists_Skip; - this->close(); -} - -void fileExistsDialog::on_Cancel_clicked() -{ - action=FileExists_Cancel; - this->close(); -} - -void fileExistsDialog::on_actionOverwrite_if_newer_triggered() -{ - action=FileExists_OverwriteIfNewer; - this->close(); -} - -void fileExistsDialog::on_actionOverwrite_if_not_same_modification_date_triggered() -{ - action=FileExists_OverwriteIfNotSameModificationDate; - this->close(); -} - -FileExistsAction fileExistsDialog::getAction() -{ - return action; -} - -bool fileExistsDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -void fileExistsDialog::updateRenameButton() -{ - ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); -} - -void fileExistsDialog::on_checkBoxAlways_toggled(bool checked) -{ - Q_UNUSED(checked); - updateRenameButton(); -} - -void fileExistsDialog::on_lineEditNewName_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateRenameButton(); -} diff --git a/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.h b/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.h deleted file mode 100644 index 75af190..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.h +++ /dev/null @@ -1,58 +0,0 @@ -/** \file fileExistsDialog.h -\brief Define the dialog when file already exists -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include -#include "Environment.h" - -#ifndef FILEEXISTSDIALOG_H -#define FILEEXISTSDIALOG_H - -namespace Ui { - class fileExistsDialog; -} - -/// \brief to show file exists dialog, and ask what do -class fileExistsDialog : public QDialog -{ - Q_OBJECT -public: - /// \brief create the object and pass all the informations to it - explicit fileExistsDialog(QWidget *parent,QFileInfo source,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule); - ~fileExistsDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FileExistsAction getAction(); - /// \brief return the new rename is case in manual renaming - QString getNewName(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_SuggestNewName_clicked(); - void on_Rename_clicked(); - void on_Overwrite_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); - void on_actionOverwrite_if_newer_triggered(); - void on_actionOverwrite_if_not_same_modification_date_triggered(); - void updateRenameButton(); - void on_checkBoxAlways_toggled(bool checked); - void on_lineEditNewName_textChanged(const QString &arg1); -private: - Ui::fileExistsDialog *ui; - FileExistsAction action; - QString oldName; - QFileInfo destinationInfo; - QString firstRenamingRule; - QString otherRenamingRule; -}; - -#endif // FILEEXISTSDIALOG_H diff --git a/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.ui b/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.ui deleted file mode 100644 index a37945a..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileExistsDialog.ui +++ /dev/null @@ -1,367 +0,0 @@ - - - fileExistsDialog - - - - 0 - 0 - 469 - 150 - - - - The file exists - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Source - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - Destination - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - source.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - destination.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - Suggest new &name - - - - - - - - - - - &Always do this action - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Rename - - - - - - - &Overwrite - - - QToolButton::MenuButtonPopup - - - - - - - &Skip - - - - - - - &Cancel - - - - - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - - - checkBoxAlways - toggled(bool) - Cancel - setDisabled(bool) - - - 115 - 130 - - - 440 - 129 - - - - - checkBoxAlways - toggled(bool) - lineEditNewName - setDisabled(bool) - - - 62 - 129 - - - 108 - 93 - - - - - checkBoxAlways - toggled(bool) - SuggestNewName - setDisabled(bool) - - - 144 - 138 - - - 326 - 98 - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.cpp b/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.cpp deleted file mode 100644 index f45b2ea..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "fileIsSameDialog.h" -#include "ui_fileIsSameDialog.h" - -#include - -fileIsSameDialog::fileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule) : - QDialog(parent), - ui(new Ui::fileIsSameDialog) -{ - ui->setupUi(this); - action=FileExists_Cancel; - oldName=fileInfo.fileName(); - destinationInfo=fileInfo; - ui->lineEditNewName->setText(oldName); - ui->lineEditNewName->setPlaceholderText(oldName); - ui->label_content_size->setText(QString::number(fileInfo.size())); - ui->label_content_modified->setText(fileInfo.lastModified().toString()); - ui->label_content_file_name->setText(fileInfo.fileName()); - updateRenameButton(); - QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); - if(maxTimelabel_modified->setVisible(true); - ui->label_content_modified->setVisible(true); - ui->label_content_modified->setText(fileInfo.lastModified().toString()); - } - else - { - ui->label_modified->setVisible(false); - ui->label_content_modified->setVisible(false); - } - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -fileIsSameDialog::~fileIsSameDialog() -{ - delete ui; -} - -void fileIsSameDialog::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -QString fileIsSameDialog::getNewName() -{ - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - qDebug() << "fileIsSameDialog, return the old name: "+oldName; - else - qDebug() << "fileIsSameDialog, return the new name: "+ui->lineEditNewName->text(); - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - return oldName; - else - return ui->lineEditNewName->text(); -} - -void fileIsSameDialog::on_SuggestNewName_clicked() -{ - QFileInfo destinationInfo=this->destinationInfo; - QString absolutePath=destinationInfo.absolutePath(); - QString fileName=destinationInfo.fileName(); - QString suffix=""; - QString destination; - QString newFileName; - //resolv the suffix - if(fileName.contains(QRegExp("^(.*)(\\.[a-z0-9]+)$"))) - { - suffix=fileName; - suffix.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\2"); - fileName.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\1"); - } - //resolv the new name - int num=1; - do - { - if(num==1) - { - if(firstRenamingRule=="") - newFileName=tr("%1 - copy").arg(fileName); - else - { - newFileName=firstRenamingRule; - newFileName.replace("%name%",fileName); - } - } - else - { - if(otherRenamingRule=="") - newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); - else - { - newFileName=otherRenamingRule; - newFileName.replace("%name%",fileName); - newFileName.replace("%number%",QString::number(num)); - } - } - destination=absolutePath+QDir::separator()+newFileName+suffix; - destinationInfo.setFile(destination); - num++; - } - while(destinationInfo.exists()); - ui->lineEditNewName->setText(newFileName+suffix); -} - -void fileIsSameDialog::on_Rename_clicked() -{ - action=FileExists_Rename; - this->close(); -} - -void fileIsSameDialog::on_Skip_clicked() -{ - action=FileExists_Skip; - this->close(); -} - -void fileIsSameDialog::on_Cancel_clicked() -{ - action=FileExists_Cancel; - this->close(); -} - -FileExistsAction fileIsSameDialog::getAction() -{ - return action; -} - -bool fileIsSameDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -void fileIsSameDialog::updateRenameButton() -{ - ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); -} - -void fileIsSameDialog::on_lineEditNewName_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateRenameButton(); -} - -void fileIsSameDialog::on_checkBoxAlways_toggled(bool checked) -{ - Q_UNUSED(checked); - updateRenameButton(); -} diff --git a/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.h b/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.h deleted file mode 100644 index fa48755..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.h +++ /dev/null @@ -1,56 +0,0 @@ -/** \file fileIsSameDialog.h -\brief Define the dialog when file is same -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include -#include "Environment.h" - -#ifndef FILEISSAMEDIALOG_H -#define FILEISSAMEDIALOG_H - -namespace Ui { - class fileIsSameDialog; -} - -/// \brief to show file is same dialog, and ask what do -class fileIsSameDialog : public QDialog -{ - Q_OBJECT -public: - /// \brief create the object and pass all the informations to it - explicit fileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule); - ~fileIsSameDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FileExistsAction getAction(); - /// \brief return the new rename is case in manual renaming - QString getNewName(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_SuggestNewName_clicked(); - void on_Rename_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); - void updateRenameButton(); - void on_lineEditNewName_textChanged(const QString &arg1); - void on_checkBoxAlways_toggled(bool checked); -private: - Ui::fileIsSameDialog *ui; - FileExistsAction action; - QString oldName; - QFileInfo destinationInfo; - QString firstRenamingRule; - QString otherRenamingRule; - -}; - -#endif // FILEISSAMEDIALOG_H diff --git a/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.ui b/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.ui deleted file mode 100644 index 673ba26..0000000 --- a/plugins-alternative/CopyEngine/Rsync/fileIsSameDialog.ui +++ /dev/null @@ -1,192 +0,0 @@ - - - fileIsSameDialog - - - - 0 - 0 - 378 - 148 - - - - This files are the same file - - - - - - The source and destination is same - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - source.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - Suggest new &name - - - - - - - - - - - &Always do this action - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Rename - - - - - - - &Skip - - - - - - - &Cancel - - - - - - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.cpp b/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.cpp deleted file mode 100644 index d951b90..0000000 --- a/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "folderExistsDialog.h" -#include "ui_folderExistsDialog.h" - -#include - -folderExistsDialog::folderExistsDialog(QWidget *parent,QFileInfo source,bool isSame,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule) : - QDialog(parent), - ui(new Ui::folderExistsDialog) -{ - ui->setupUi(this); - action=FolderExists_Cancel; - oldName=source.fileName(); - this->destinationInfo=destinationInfo; - ui->lineEditNewName->setText(oldName); - ui->lineEditNewName->setPlaceholderText(oldName); - ui->label_content_source_modified->setText(source.lastModified().toString()); - ui->label_content_source_folder_name->setText(source.fileName()); - if(isSame) - { - ui->label_source->hide(); - ui->label_destination->hide(); - ui->label_destination_modified->hide(); - ui->label_destination_folder_name->hide(); - ui->label_content_destination_modified->hide(); - ui->label_content_destination_folder_name->hide(); - } - else - { - this->setWindowTitle(tr("Folder already exists")); - ui->label_message->hide(); - ui->label_content_destination_modified->setText(destination.lastModified().toString()); - ui->label_content_destination_folder_name->setText(destination.fileName()); - } - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -folderExistsDialog::~folderExistsDialog() -{ - delete ui; -} - -void folderExistsDialog::changeEvent(QEvent *e) -{ - QDialog::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -QString folderExistsDialog::getNewName() -{ - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - return ""; - else - return ui->lineEditNewName->text(); -} - -void folderExistsDialog::on_SuggestNewName_clicked() -{ - QFileInfo destinationInfo=this->destinationInfo; - QString absolutePath=destinationInfo.absolutePath(); - QString fileName=destinationInfo.fileName(); - QString suffix=""; - QString destination; - QString newFileName; - //resolv the suffix - if(fileName.contains(QRegExp("^(.*)(\\.[a-z0-9]+)$"))) - { - suffix=fileName; - suffix.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\2"); - fileName.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\1"); - } - //resolv the new name - int num=1; - do - { - if(num==1) - { - if(firstRenamingRule=="") - newFileName=tr("%1 - copy").arg(fileName); - else - { - newFileName=firstRenamingRule; - newFileName.replace("%name%",fileName); - } - } - else - { - if(otherRenamingRule=="") - newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); - else - { - newFileName=otherRenamingRule; - newFileName.replace("%name%",fileName); - newFileName.replace("%number%",QString::number(num)); - } - } - destination=absolutePath+QDir::separator()+newFileName+suffix; - destinationInfo.setFile(destination); - num++; - } - while(destinationInfo.exists()); - ui->lineEditNewName->setText(newFileName+suffix); -} - -void folderExistsDialog::on_Rename_clicked() -{ - action=FolderExists_Rename; - this->close(); -} - -void folderExistsDialog::on_Skip_clicked() -{ - action=FolderExists_Skip; - this->close(); -} - -void folderExistsDialog::on_Cancel_clicked() -{ - action=FolderExists_Cancel; - this->close(); -} - -FolderExistsAction folderExistsDialog::getAction() -{ - return action; -} - -bool folderExistsDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -void folderExistsDialog::on_Merge_clicked() -{ - action=FolderExists_Merge; - this->close(); -} diff --git a/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.h b/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.h deleted file mode 100644 index 6d612f1..0000000 --- a/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.h +++ /dev/null @@ -1,54 +0,0 @@ -/** \file folderExistsDialog.h -\brief Define the dialog when file exists -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef FOLDERISSAMEDIALOG_H -#define FOLDERISSAMEDIALOG_H - -#include -#include -#include -#include -#include - -#include "Environment.h" - -namespace Ui { - class folderExistsDialog; -} - -/// \brief to show file exists dialog, and ask what do -class folderExistsDialog : public QDialog -{ - Q_OBJECT - -public: - /// \brief create the object and pass all the informations to it - explicit folderExistsDialog(QWidget *parent,QFileInfo source,bool isSame,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule); - ~folderExistsDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FolderExistsAction getAction(); - /// \brief return the new rename is case in manual renaming - QString getNewName(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_SuggestNewName_clicked(); - void on_Rename_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); - void on_Merge_clicked(); -private: - Ui::folderExistsDialog *ui; - FolderExistsAction action; - QString oldName; - QString firstRenamingRule; - QString otherRenamingRule; - QFileInfo destinationInfo; -}; - -#endif // FOLDERISSAMEDIALOG_H diff --git a/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.ui b/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.ui deleted file mode 100644 index c4c4d5e..0000000 --- a/plugins-alternative/CopyEngine/Rsync/folderExistsDialog.ui +++ /dev/null @@ -1,282 +0,0 @@ - - - folderExistsDialog - - - - 0 - 0 - 443 - 146 - - - - This folders are the same folder - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Source - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - Destination - - - Qt::AlignCenter - - - - - - - - - The source and destination is same - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - Folder name - - - - - - - folder - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Modified - - - - - - - false - - - Folder name - - - - - - - Today - - - - - - - folder - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - - - - Suggest new &name - - - - - - - - - - - &Always do this action - - - - - - - &Rename - - - - - - - Merge - - - - - - - Skip - - - - - - - &Cancel - - - - - - - - - - - checkBoxAlways - clicked(bool) - lineEditNewName - setDisabled(bool) - - - 132 - 126 - - - 135 - 101 - - - - - checkBoxAlways - clicked(bool) - SuggestNewName - setDisabled(bool) - - - 113 - 129 - - - 304 - 100 - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/informations.xml b/plugins-alternative/CopyEngine/Rsync/informations.xml deleted file mode 100644 index 709df28..0000000 --- a/plugins-alternative/CopyEngine/Rsync/informations.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - <![CDATA[Rsync copy engine]]> - <![CDATA[Moteur de copie rsync]]> - - CopyEngine - - - - - - - 1287496800 - - windows-x86 - - - - - 0.3.1.0 - - Rsync - - =ultracopier-0.3.1.0 - ]]> - \ No newline at end of file diff --git a/plugins-alternative/CopyEngine/Rsync/options.ui b/plugins-alternative/CopyEngine/Rsync/options.ui deleted file mode 100644 index 78ac0b2..0000000 --- a/plugins-alternative/CopyEngine/Rsync/options.ui +++ /dev/null @@ -1,328 +0,0 @@ - - - options - - - - 0 - 0 - 354 - 399 - - - - - 2 - - - 2 - - - - - Transfer the file rights - - - - - - - - - - Keep the file date - - - - - - - - - - KB - - - 1 - - - 64000 - - - - - - - Auto start the transfer - - - - - - - - - - When folder error - - - - - - - - Ask - - - - - Skip - - - - - - - - When folder collision - - - - - - - - Ask - - - - - Merge - - - - - Skip - - - - - Rename - - - - - - - - Check if destination folder exists - - - - - - - - - - Checksum - - - - - - false - - - - - - - false - - - Only after error - - - - - - - false - - - Ignore if impossible - - - - - - - false - - - - - - - - - - Do checksum - - - - - - - - - - Enable OS buffer - - - - - - - - - - OS buffer only if smaller than - - - - - - - KB - - - 1 - - - 2048 - - - 512 - - - - - - - Block size - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Filters - - - - - - - Renaming rules - - - - - - - - - - - - - - Rsync (only in copy mode) - - - - - - - - - doChecksum - clicked(bool) - label_9 - setEnabled(bool) - - - 187 - 212 - - - 100 - 223 - - - - - doChecksum - clicked(bool) - checksumOnlyOnError - setEnabled(bool) - - - 198 - 212 - - - 190 - 226 - - - - - doChecksum - clicked(bool) - label_10 - setEnabled(bool) - - - 245 - 210 - - - 123 - 251 - - - - - doChecksum - clicked(bool) - checksumIgnoreIfImpossible - setEnabled(bool) - - - 269 - 209 - - - 213 - 247 - - - - - diff --git a/plugins-alternative/CopyEngine/Rsync/resources.qrc b/plugins-alternative/CopyEngine/Rsync/resources.qrc deleted file mode 100644 index c6ca4ef..0000000 --- a/plugins-alternative/CopyEngine/Rsync/resources.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - resources/add.png - resources/edit.png - resources/remove.png - resources/filter.png - - diff --git a/plugins-alternative/CopyEngine/Rsync/resources/add.png b/plugins-alternative/CopyEngine/Rsync/resources/add.png deleted file mode 100644 index 1e03be9..0000000 Binary files a/plugins-alternative/CopyEngine/Rsync/resources/add.png and /dev/null differ diff --git a/plugins-alternative/CopyEngine/Rsync/resources/edit.png b/plugins-alternative/CopyEngine/Rsync/resources/edit.png deleted file mode 100644 index 8072aea..0000000 Binary files a/plugins-alternative/CopyEngine/Rsync/resources/edit.png and /dev/null differ diff --git a/plugins-alternative/CopyEngine/Rsync/resources/filter.png b/plugins-alternative/CopyEngine/Rsync/resources/filter.png deleted file mode 100644 index 9cabc5a..0000000 Binary files a/plugins-alternative/CopyEngine/Rsync/resources/filter.png and /dev/null differ diff --git a/plugins-alternative/CopyEngine/Rsync/resources/remove.png b/plugins-alternative/CopyEngine/Rsync/resources/remove.png deleted file mode 100644 index 5b4c488..0000000 Binary files a/plugins-alternative/CopyEngine/Rsync/resources/remove.png and /dev/null differ diff --git a/plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.cpp b/plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.cpp deleted file mode 100644 index 197b8c7..0000000 --- a/plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.cpp +++ /dev/null @@ -1,511 +0,0 @@ -#include "scanFileOrFolder.h" - -#include - -scanFileOrFolder::scanFileOrFolder(CopyMode mode) -{ - rsync=false; - stopped = true; - stopIt = false; - this->mode=mode; - setObjectName("ScanFileOrFolder"); - folder_isolation=QRegExp("^(.*/)?([^/]+)/$"); -} - -scanFileOrFolder::~scanFileOrFolder() -{ - stop(); - quit(); - wait(); -} - -bool scanFileOrFolder::isFinished() -{ - return stopped; -} - -void scanFileOrFolder::addToList(const QStringList& sources,const QString& destination) -{ - stopIt=false; - this->sources=parseWildcardSources(sources); - this->destination=destination; - if(sources.size()>1 || QFileInfo(destination).isDir()) - /* Disabled because the separator transformation product bug - * if(!destination.endsWith(QDir::separator())) - this->destination+=QDir::separator();*/ - if(!destination.endsWith("/") && !destination.endsWith("\\")) - this->destination+="/";//put unix separator because it's transformed into that's under windows too - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"addToList("+sources.join(";")+","+destination+")"); -} - - -QStringList scanFileOrFolder::parseWildcardSources(const QStringList &sources) -{ - QRegExp splitFolder("[/\\\\]"); - QStringList returnList; - int index=0; - while(index recomposedSource; - recomposedSource << (QStringList() << ""); - while(toParse.size()>0) - { - if(toParse.first().contains('*')) - { - QString toParseFirst=toParse.first(); - if(toParseFirst=="") - toParseFirst+="/"; - QList newRecomposedSource; - QRegExp toResolv=QRegExp(toParseFirst.replace('*',"[^/\\\\]*")); - int index_recomposedSource=0; - while(index_recomposedSource include,QList exclude) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QMutexLocker lock(&filtersMutex); - this->include_send=include; - this->exclude_send=exclude; - reloadTheNewFilters=true; - haveFilters=include_send.size()>0 || exclude_send.size()>0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("haveFilters: %1, include_send.size(): %2, exclude_send.size(): %3").arg(haveFilters).arg(include_send.size()).arg(exclude_send.size())); -} - -//set action if Folder are same or exists -void scanFileOrFolder::setFolderExistsAction(FolderExistsAction action,QString newName) -{ - this->newName=newName; - folderExistsAction=action; - waitOneAction.release(); -} - -//set action if error -void scanFileOrFolder::setFolderErrorAction(FileErrorAction action) -{ - fileErrorAction=action; - waitOneAction.release(); -} - -void scanFileOrFolder::stop() -{ - stopIt=true; - waitOneAction.release(); -} - -void scanFileOrFolder::run() -{ - stopped=false; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the listing with destination: "+destination+", mode: "+QString::number(mode)); - QDir destinationFolder(destination); - int sourceIndex=0; - while(sourceIndexinclude=this->include_send; - this->exclude=this->exclude_send; - } - QString fileName=fileInfo.fileName(); - if(fileInfo.isDir()) - { - bool excluded=false,included=(include.size()==0); - int filters_index=0; - while(filters_indexcheckDestinationExists=checkDestinationFolderExists; -} - -void scanFileOrFolder::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -/// \brief set rsync -void scanFileOrFolder::setRsync(const bool rsync) -{ - this->rsync=rsync; -} diff --git a/plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.h b/plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.h deleted file mode 100644 index 2109df2..0000000 --- a/plugins-alternative/CopyEngine/Rsync/scanFileOrFolder.h +++ /dev/null @@ -1,91 +0,0 @@ -/** \file scanFileOrFolder.h -\brief Thread changed to list recursively the folder -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -#ifndef SCANFILEORFOLDER_H -#define SCANFILEORFOLDER_H - -/// \brief Thread changed to list recursively the folder -class scanFileOrFolder : public QThread -{ - Q_OBJECT -public: - explicit scanFileOrFolder(CopyMode mode); - ~scanFileOrFolder(); - /// \brief to the a folder listing - void stop(); - /// \brief to get if is finished - bool isFinished(); - /// \brief set action if Folder are same or exists - void setFolderExistsAction(FolderExistsAction action,QString newName=""); - /// \brief set action if error - void setFolderErrorAction(FileErrorAction action); - /// \brief set if need check if the destination exists - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - /// \brief set rsync - void setRsync(const bool rsync); -signals: - void fileTransfer(const QFileInfo &source,const QFileInfo &destination,const CopyMode &mode); - /// \brief To debug source - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); - void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); - void errorOnFolder(const QFileInfo &fileInfo,const QString &errorString); - void finishedTheListing(); - - void newFolderListing(const QString &path); - void addToMkPath(const QString& folder); - void addToRmPath(const QString& folder,const int& inodeToRemove); - void addToRmForRsync(const QString& inode); -public slots: - void addToList(const QStringList& sources,const QString& destination); - void setFilters(QList include,QList exclude); -protected: - void run(); -private: - QStringList sources; - QString destination; - volatile bool stopIt; - void listFolder(const QString& source,const QString& destination,const QString& sourceSuffixPath,QString destinationSuffixPath); - volatile bool stopped; - QSemaphore waitOneAction; - FolderExistsAction folderExistsAction; - FileErrorAction fileErrorAction; - volatile bool checkDestinationExists; - QString newName; - QRegExp folder_isolation; - QString prefix; - QString suffix; - CopyMode mode; - bool rsync; - QList include,exclude; - QList include_send,exclude_send; - bool reloadTheNewFilters; - bool haveFilters; - QMutex filtersMutex; - QString firstRenamingRule; - QString otherRenamingRule; - /** Parse the multiple wildcard source, it allow resolv multiple wildcard with Qt into their path - * The string: /toto/f*a/yy*a/toto.mp3 - * Will give: /toto/f1a/yy*a/toto.mp3, /toto/f2a/yy*a/toto.mp3 - * Will give: /toto/f2a/yy1a/toto.mp3, /toto/f2a/yy2a/toto.mp3 - */ - QStringList parseWildcardSources(const QStringList &sources); -}; - -#endif // SCANFILEORFOLDER_H diff --git a/plugins-alternative/PluginLoader/keybinding/DebugEngineMacro.h b/plugins-alternative/PluginLoader/keybinding/DebugEngineMacro.h new file mode 100644 index 0000000..f9b5349 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/DebugEngineMacro.h @@ -0,0 +1,28 @@ +/** \file DebugEngineMacro.h +\brief Define the macro for the debug +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef DEBUGENGINEMACRO_H +#define DEBUGENGINEMACRO_H + +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + +/// \brief Macro for the debug log +#ifdef ULTRACOPIER_PLUGIN_DEBUG + #if defined (__FILE__) && defined (__LINE__) + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b,__FILE__,__LINE__) + #else + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b) + #endif +#else // ULTRACOPIER_PLUGIN_DEBUG + #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() +#endif // ULTRACOPIER_PLUGIN_DEBUG + +#endif // DEBUGENGINEMACRO_H + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Environment.h b/plugins-alternative/PluginLoader/keybinding/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Environment.h @@ -0,0 +1,10 @@ +/** \file Environment.h +\brief Define the environment variable and global function +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "Variable.h" +/// \brief The global include +#include "StructEnumDefinition.h" +#include "DebugEngineMacro.h" + diff --git a/plugins-alternative/PluginLoader/keybinding/KeyBind.cpp b/plugins-alternative/PluginLoader/keybinding/KeyBind.cpp new file mode 100644 index 0000000..0fd5287 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/KeyBind.cpp @@ -0,0 +1,11 @@ +#include "KeyBind.h" + +KeyBind::KeyBind(QWidget *parent) : + QLineEdit(parent) +{ +} + +void KeyBind::keyPressEvent(QKeyEvent * event) +{ + emit newKey(event); +} diff --git a/plugins-alternative/PluginLoader/keybinding/KeyBind.h b/plugins-alternative/PluginLoader/keybinding/KeyBind.h new file mode 100644 index 0000000..f4abf68 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/KeyBind.h @@ -0,0 +1,18 @@ +#ifndef KEYBIND_H +#define KEYBIND_H + +#include + +class KeyBind : public QLineEdit +{ + Q_OBJECT +public: + explicit KeyBind(QWidget *parent = 0); + +signals: + void newKey(QKeyEvent * event); +public slots: + void keyPressEvent(QKeyEvent * event); +}; + +#endif // KEYBIND_H diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/ar/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/ar/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/ar/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/de/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/de/translation.ts new file mode 100644 index 0000000..fe80b91 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/de/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/el/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/el/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/el/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/en/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/en/translation.ts new file mode 100644 index 0000000..f92b6b5 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/en/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/es/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/es/translation.ts new file mode 100644 index 0000000..c72ba56 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/es/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/fr/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/fr/translation.ts new file mode 100644 index 0000000..513e265 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/fr/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/hi/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/hi/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/hi/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/hu/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/hu/translation.ts new file mode 100644 index 0000000..cb3bde6 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/hu/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/id/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/id/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/id/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/it/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/it/translation.ts new file mode 100644 index 0000000..a2257e5 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/it/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/ja/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/ja/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/ja/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/ko/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/ko/translation.ts new file mode 100644 index 0000000..18f47bb --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/ko/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/nl/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/nl/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/nl/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/no/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/no/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/no/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/pl/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/pl/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/pl/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/pt/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/pt/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/pt/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/ru/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/ru/translation.ts new file mode 100644 index 0000000..38a6bfd --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/ru/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/th/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/th/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/th/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/tr/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/tr/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/tr/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/Languages/zh/translation.ts b/plugins-alternative/PluginLoader/keybinding/Languages/zh/translation.ts new file mode 100644 index 0000000..07a7469 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Languages/zh/translation.ts @@ -0,0 +1,4 @@ + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/OptionsWidget.cpp b/plugins-alternative/PluginLoader/keybinding/OptionsWidget.cpp new file mode 100644 index 0000000..a48e61f --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/OptionsWidget.cpp @@ -0,0 +1,55 @@ +#include "OptionsWidget.h" +#include "KeyBind.h" +#include "ui_OptionsWidget.h" + +#include + +OptionsWidget::OptionsWidget(QWidget *parent) : + QWidget(parent), + modifier(QList() << Qt::Key_Control << Qt::Key_Shift << Qt::Key_Super_R << Qt::Key_Super_L << Qt::Key_Meta << Qt::Key_Alt << Qt::Key_AltGr), + ui(new Ui::OptionsWidget) +{ + ui->setupUi(this); + + keyBind=new KeyBind(this); + ui->vboxLayout->addWidget(keyBind); + connect(keyBind,&KeyBind::newKey,this,&OptionsWidget::newKeyBind); +} + +OptionsWidget::~OptionsWidget() +{ + delete ui; +} + +void OptionsWidget::retranslate() +{ + ui->retranslateUi(this); +} + +void OptionsWidget::setKeyBind(const QKeySequence &keySequence) +{ + keyBind->setText(keySequence.toString()); +} + +void OptionsWidget::newKey(QKeyEvent * event) +{ + int keyInt = event->key(); + if(!modifier.contains(keyInt)) + { + const Qt::KeyboardModifiers &modifiers = event->modifiers(); + if(modifiers & Qt::ShiftModifier) + keyInt += Qt::SHIFT; + if(modifiers & Qt::ControlModifier) + keyInt += Qt::CTRL; + if(modifiers & Qt::AltModifier) + keyInt += Qt::ALT; + if(modifiers & Qt::MetaModifier) + keyInt += Qt::META; + + const QKeySequence &keySeq = QKeySequence(keyInt); + keyBind->setText(keySeq.toString()); + + sendKeyBind(keySeq); + } +} + diff --git a/plugins-alternative/PluginLoader/keybinding/OptionsWidget.h b/plugins-alternative/PluginLoader/keybinding/OptionsWidget.h new file mode 100644 index 0000000..e0d8e4b --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/OptionsWidget.h @@ -0,0 +1,31 @@ +#ifndef OptionsWidget_H +#define OptionsWidget_H + +#include +#include "KeyBind.h" + +namespace Ui { +class OptionsWidget; +} + +class OptionsWidget : public QWidget +{ + Q_OBJECT + +public: + explicit OptionsWidget(QWidget *parent = 0); + ~OptionsWidget(); + void setKeyBind(const QKeySequence &keySequence); + void retranslate(); +private: + const QList modifier; + Ui::OptionsWidget *ui; + KeyBind *keyBind; +private slots: + void newKey(QKeyEvent * event); +signals: + void sendKeyBind(const QKeySequence &keySequence); + void newKeyBind(QKeyEvent * event); +}; + +#endif // OptionsWidget_H diff --git a/plugins-alternative/PluginLoader/keybinding/OptionsWidget.ui b/plugins-alternative/PluginLoader/keybinding/OptionsWidget.ui new file mode 100644 index 0000000..2bc3cbe --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/OptionsWidget.ui @@ -0,0 +1,31 @@ + + + OptionsWidget + + + + 0 + 0 + 195 + 58 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/plugins-alternative/PluginLoader/keybinding/PlatformMacro.h b/plugins-alternative/PluginLoader/keybinding/PlatformMacro.h new file mode 100644 index 0000000..f7586b0 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/PlatformMacro.h @@ -0,0 +1 @@ +#include "../../../PlatformMacro.h" diff --git a/plugins-alternative/PluginLoader/keybinding/StructEnumDefinition.h b/plugins-alternative/PluginLoader/keybinding/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/PluginLoader/keybinding/Variable.h b/plugins-alternative/PluginLoader/keybinding/Variable.h new file mode 100644 index 0000000..90e1557 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/Variable.h @@ -0,0 +1,16 @@ +/** \file Variable.h +\brief Define the environment variable +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef VARIABLE_H +#define VARIABLE_H + +//Un-comment this next line to put ultracopier plugin in debug mode +#define ULTRACOPIER_PLUGIN_DEBUG +//#define ULTRACOPIER_PLUGIN_ALL_IN_ONE + +#endif // VARIABLE_H + + + diff --git a/plugins-alternative/PluginLoader/keybinding/documentation.dox b/plugins-alternative/PluginLoader/keybinding/documentation.dox new file mode 100644 index 0000000..08ccc4a --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/documentation.dox @@ -0,0 +1,34 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage catchcopy-v0002 + + \section mainpage_overview Overview + + Is the plugin to load the catchcopy plugin into the windows file manager. Mostly it use the command: regsvr32 /s catchcopy32.dll/catchcopy64.dll\n + More informations on the wiki of ultracopier. + + \section mainpage_platforms Platforms + + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. + + \section mainpage_downloads Downloads + + You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... + + \section mainpage_algorithm Requirements + + You can see the documentation on Catchcopy web site. It use catchcopy32.dll/catchcopy64.dll as explorer plugin for the windows's file manager. Need it into the plugins.\n + In function if Ultracopier is compiled by portable version, try load the dll by other way. + + \section license GPL Version 3 + The code source is under GPL3. + +*/ + diff --git a/plugins-alternative/PluginLoader/keybinding/informations.xml b/plugins-alternative/PluginLoader/keybinding/informations.xml new file mode 100644 index 0000000..142e9a5 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/informations.xml @@ -0,0 +1,27 @@ + + + <![CDATA[Plugin loader for catchcopy v0002]]> + <![CDATA[Chargeur de plugin pour catchcopy v0002]]> + + PluginLoader + + + + + + + 1287496800 + + windows-x86 + + + + + 1.2.3.6 + + keybinding + + + \ No newline at end of file diff --git a/plugins-alternative/PluginLoader/keybinding/plugin.json b/plugins-alternative/PluginLoader/keybinding/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/PluginLoader/keybinding/pluginLoader.cpp b/plugins-alternative/PluginLoader/keybinding/pluginLoader.cpp new file mode 100644 index 0000000..387b09e --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/pluginLoader.cpp @@ -0,0 +1,61 @@ +/** \file pluginLoader.cpp +\brief Define the session plugin loader test +\author alpha_one_x86 */ + +#include "pluginLoader.h" +#include "PlatformMacro.h" + +#include +#include + +#ifndef Q_OS_UNIX +#error "Only for unix" +#endif + +KeyBindPlugin::KeyBindPlugin() +{ + connect(&optionsWidget,&OptionsWidget::sendKeyBind,this,&KeyBindPlugin::setKeyBind); +} + +KeyBindPlugin::~KeyBindPlugin() +{ +} + +void KeyBindPlugin::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) +{ + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); + this->optionsEngine=options; + if(optionsEngine!=NULL) + { + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("keySequence"),QString())); + optionsEngine->addOptionGroup(KeysList); + optionsWidget.setKeyBind(QKeySequence::fromString(optionsEngine->getOptionValue("keySequence").toString())); + } +} + +/// \brief to get the options widget, NULL if not have +QWidget * KeyBindPlugin::options() +{ + return &optionsWidget; +} + +void KeyBindPlugin::newLanguageLoaded() +{ + optionsWidget.retranslate(); +} + +/// \brief try enable/disable the catching +void KeyBindPlugin::setEnabled(const bool &needBeRegistred) +{ + Q_UNUSED(needBeRegistred); +} + +void KeyBindPlugin::setKeyBind(const QKeySequence &keySequence) +{ + optionsEngine->setOptionValue("keySequence",keySequence); +} + diff --git a/plugins-alternative/PluginLoader/keybinding/pluginLoader.h b/plugins-alternative/PluginLoader/keybinding/pluginLoader.h new file mode 100644 index 0000000..1361c0d --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/pluginLoader.h @@ -0,0 +1,47 @@ +/** \file pluginLoader.h +\brief Define the plugin loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGIN_LOADER_TEST_H +#define PLUGIN_LOADER_TEST_H + +#include +#include + +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_PluginLoader.h" +#include "Environment.h" +#include "OptionsWidget.h" + +/// \brief \brief Define the plugin loader +class KeyBindPlugin : public PluginInterface_PluginLoader +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.PluginLoader/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_PluginLoader) +public: + KeyBindPlugin(); + ~KeyBindPlugin(); + /// \brief try enable/disable the catching + void setEnabled(const bool &needBeRegistred); + /// \brief to set resources, writePath can be empty if read only mode + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); +public slots: + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); +private: + OptionInterface * optionsEngine; + OptionsWidget optionsWidget; +private slots: + void setKeyBind(const QKeySequence &keySequence); +}; + +#endif // PLUGIN_LOADER_TEST_H diff --git a/plugins-alternative/PluginLoader/keybinding/pluginLoader.pro b/plugins-alternative/PluginLoader/keybinding/pluginLoader.pro new file mode 100644 index 0000000..ad5404b --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/pluginLoader.pro @@ -0,0 +1,50 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets +TEMPLATE = lib +CONFIG += plugin +HEADERS = \ + StructEnumDefinition.h \ + pluginLoader.h \ + DebugEngineMacro.h \ + Environment.h \ + Variable.h \ + PlatformMacro.h \ + ../../../interface/PluginInterface_PluginLoader.h \ + OptionsWidget.h \ + KeyBind.h +SOURCES = \ + pluginLoader.cpp \ + OptionsWidget.cpp \ + KeyBind.cpp +TARGET = $$qtLibraryTarget(pluginLoader) +TRANSLATIONS += Languages/ar/translation.ts \ + Languages/de/translation.ts \ + Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ + Languages/it/translation.ts \ + Languages/ja/translation.ts \ + Languages/ko/translation.ts \ + Languages/nl/translation.ts \ + Languages/no/translation.ts \ + Languages/pl/translation.ts \ + Languages/pt/translation.ts \ + Languages/ru/translation.ts \ + Languages/th/translation.ts \ + Languages/tr/translation.ts \ + Languages/zh/translation.ts + +FORMS += \ + OptionsWidget.ui + +CONFIG(static, static|shared) { +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE +} + diff --git a/plugins-alternative/PluginLoader/keybinding/pluginLoader.pro.user.3.3-pre1 b/plugins-alternative/PluginLoader/keybinding/pluginLoader.pro.user.3.3-pre1 new file mode 100644 index 0000000..c45904e --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/pluginLoader.pro.user.3.3-pre1 @@ -0,0 +1,266 @@ + + + + + + EnvironmentId + {74ab603f-f657-4135-92cf-c93af71b2f91} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + 0 + 8 + true + 1 + true + true + true + true + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Qt5 5.4 + Qt5 5.4 + {f6cc43bb-0436-4d0e-8325-897ff43ef853} + 0 + 0 + 0 + + /home/user/Desktop/ultracopier/sources/plugins-alternative/PluginLoader/build-pluginLoader-Qt5_5_2-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/user/Desktop/ultracopier/sources/plugins-alternative/PluginLoader/build-pluginLoader-Qt5_5_2-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + true + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + + false + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 16 + + + Version + 16 + + diff --git a/plugins-alternative/Themes/Clean/Languages/ar/translation.ts b/plugins-alternative/Themes/Clean/Languages/ar/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/ar/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/ar/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/de/translation.ts b/plugins-alternative/Themes/Clean/Languages/de/translation.ts index 7ea1972..0a833ee 100644 --- a/plugins-alternative/Themes/Clean/Languages/de/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/de/translation.ts @@ -4,9 +4,9 @@ InterfacePlugin - + %1/%2 files, %3/%4 - %1/%2 dateien, %3/%4 + %1/%2 Dateien, %3/%4 @@ -18,8 +18,8 @@ - In wait - auf der Lauer + Waiting + Warten @@ -34,22 +34,22 @@ Move file(s) - Bewegen Sie Datei (en) + Datei (en) verschieben Move folder - bewegen Sie Ordner + Ordner verschieben Copy file(s) - Kopieren Sie die Datei (en) + Datei (en) kopieren Copy folder - kopieren Sie das Verzeichnis + Ordner kopieren diff --git a/plugins-alternative/Themes/Clean/Languages/el/translation.ts b/plugins-alternative/Themes/Clean/Languages/el/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/el/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/el/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/en/translation.ts b/plugins-alternative/Themes/Clean/Languages/en/translation.ts new file mode 100644 index 0000000..d13892c --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/en/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + + + + + interface + + + Action: + + + + + Waiting + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Clean/Languages/es/translation.ts b/plugins-alternative/Themes/Clean/Languages/es/translation.ts index 70b8246..8c54e8a 100644 --- a/plugins-alternative/Themes/Clean/Languages/es/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/es/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 %1/%2 archivos, %3/%4 @@ -17,9 +17,13 @@ Acción: - In wait - En espera + En espera + + + + Waiting + diff --git a/plugins-alternative/Themes/Clean/Languages/fr/translation.ts b/plugins-alternative/Themes/Clean/Languages/fr/translation.ts index 51fd57f..bdc0621 100644 --- a/plugins-alternative/Themes/Clean/Languages/fr/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/fr/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 %1/%2 fichiers, %3/%4 @@ -17,9 +17,8 @@ Action: - In wait - En attente + En attente @@ -46,6 +45,11 @@ Add folder Ajouter un dossier + + + Waiting + + Add file diff --git a/plugins-alternative/Themes/Clean/Languages/hi/translation.ts b/plugins-alternative/Themes/Clean/Languages/hi/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/hi/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/hi/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/hu/translation.ts b/plugins-alternative/Themes/Clean/Languages/hu/translation.ts new file mode 100644 index 0000000..e5a3bcc --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/hu/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 fájl, %3/%4 + + + + interface + + + Action: + Művelet: + + + + Waiting + Várakozás + + + + Add file + Fájl hozzáadása + + + + Add folder + Mappa hozzáadása + + + + Move file(s) + Fájl(ok) mozgatása + + + + Move folder + Mappa mozgatása + + + + Copy file(s) + Fájl(ok) másolása + + + + Copy folder + Mappa másolása + + + diff --git a/plugins-alternative/Themes/Clean/Languages/id/translation.ts b/plugins-alternative/Themes/Clean/Languages/id/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/id/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/id/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/it/translation.ts b/plugins-alternative/Themes/Clean/Languages/it/translation.ts index b44bd5f..b94ac7b 100644 --- a/plugins-alternative/Themes/Clean/Languages/it/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/it/translation.ts @@ -4,9 +4,9 @@ InterfacePlugin - + %1/%2 files, %3/%4 - + %1/%2 file, %3/%4 @@ -17,9 +17,13 @@ Azione: - In wait - In attesa + In attesa + + + + Waiting + @@ -34,22 +38,22 @@ Move file(s) - Spostare file(s) + Sposta file Move folder - Spostare la cartella + Sposta la cartella Copy file(s) - Copiare il file (s) + Copia file Copy folder - Copia la cartella + Copia cartella diff --git a/plugins-alternative/Themes/Clean/Languages/ja/translation.ts b/plugins-alternative/Themes/Clean/Languages/ja/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/ja/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/ja/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/ko/translation.ts b/plugins-alternative/Themes/Clean/Languages/ko/translation.ts index 41627de..95d2138 100644 --- a/plugins-alternative/Themes/Clean/Languages/ko/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/ko/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 %1/%2 파일, %3/%4 @@ -17,9 +17,13 @@ 실행: - In wait - 대기중 + 대기중 + + + + Waiting + diff --git a/plugins-alternative/Themes/Clean/Languages/nl/translation.ts b/plugins-alternative/Themes/Clean/Languages/nl/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/nl/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/nl/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/no/translation.ts b/plugins-alternative/Themes/Clean/Languages/no/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/no/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/no/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/pl/translation.ts b/plugins-alternative/Themes/Clean/Languages/pl/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/pl/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/pl/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/ru/translation.ts b/plugins-alternative/Themes/Clean/Languages/ru/translation.ts index 5f83874..36798e7 100644 --- a/plugins-alternative/Themes/Clean/Languages/ru/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/ru/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 %1/%2 файлы, %3/%4 @@ -17,9 +17,13 @@ Действие: - In wait - В ожидании + В ожидании + + + + Waiting + diff --git a/plugins-alternative/Themes/Clean/Languages/th/translation.ts b/plugins-alternative/Themes/Clean/Languages/th/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/th/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/th/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/tr/translation.ts b/plugins-alternative/Themes/Clean/Languages/tr/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/tr/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/tr/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/Languages/zh/translation.ts b/plugins-alternative/Themes/Clean/Languages/zh/translation.ts index 81df74e..54104e3 100644 --- a/plugins-alternative/Themes/Clean/Languages/zh/translation.ts +++ b/plugins-alternative/Themes/Clean/Languages/zh/translation.ts @@ -4,7 +4,7 @@ InterfacePlugin - + %1/%2 files, %3/%4 @@ -18,7 +18,7 @@ - In wait + Waiting diff --git a/plugins-alternative/Themes/Clean/documentation.dox b/plugins-alternative/Themes/Clean/documentation.dox old mode 100755 new mode 100644 index 56e5331..3f7bc88 --- a/plugins-alternative/Themes/Clean/documentation.dox +++ b/plugins-alternative/Themes/Clean/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview It's interface to have minimal interface for Ultracopier.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project as alternative plugin. + More informations on the wiki of ultracopier. Is part of Ultracopier project as alternative plugin. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins-alternative/Themes/Clean/factory.cpp b/plugins-alternative/Themes/Clean/factory.cpp index 2b8d109..6acbe3a 100644 --- a/plugins-alternative/Themes/Clean/factory.cpp +++ b/plugins-alternative/Themes/Clean/factory.cpp @@ -1,70 +1,65 @@ /** \file factory.cpp \brief Define the factory core \author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include +*/ #include "factory.h" -PluginInterface_Themes * Factory::getInstance() +PluginInterface_Themes * ThemesFactory::getInstance() { - PluginInterface_Themes * newInterface=new InterfacePlugin(facilityEngine); - connect(this,SIGNAL(reloadLanguage()),newInterface,SLOT(newLanguageLoaded())); - return newInterface; + InterfacePlugin * newInterface=new InterfacePlugin(facilityEngine); + connect(this,&ThemesFactory::reloadLanguage,newInterface,&InterfacePlugin::newLanguageLoaded); + return newInterface; } -void Factory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion) +void ThemesFactory::setResources(OptionInterface * options, const QString &writePath, const QString &pluginPath, FacilityInterface * facilityInterface, const bool &portableVersion) { - Q_UNUSED(options) - Q_UNUSED(writePath) - Q_UNUSED(pluginPath) - this->facilityEngine=facilityEngine; - Q_UNUSED(portableVersion) + Q_UNUSED(options) + Q_UNUSED(writePath) + Q_UNUSED(pluginPath) + this->facilityEngine=facilityInterface; + Q_UNUSED(portableVersion) } -QWidget * Factory::options() +QWidget * ThemesFactory::options() { - return NULL; + return NULL; } -QIcon Factory::getIcon(const QString &fileName) +QIcon ThemesFactory::getIcon(const QString &fileName) const { - if(fileName=="SystemTrayIcon/exit.png") - { - QIcon tempIcon=QIcon::fromTheme("application-exit"); - if(!tempIcon.isNull()) - return tempIcon; - } - if(fileName=="SystemTrayIcon/add.png") - { - QIcon tempIcon=QIcon::fromTheme("list-add"); - if(!tempIcon.isNull()) - return tempIcon; - } - if(fileName=="SystemTrayIcon/informations.png") - { - QIcon tempIcon=QIcon::fromTheme("help-about"); - if(!tempIcon.isNull()) - return tempIcon; - } - if(fileName=="SystemTrayIcon/options.png") - { - QIcon tempIcon=QIcon::fromTheme("applications-system"); - if(!tempIcon.isNull()) - return tempIcon; - } - return QIcon(":/resources/"+fileName); + if(fileName=="SystemTrayIcon/exit.png") + { + QIcon tempIcon=QIcon::fromTheme("application-exit"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/add.png") + { + QIcon tempIcon=QIcon::fromTheme("list-add"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/informations.png") + { + QIcon tempIcon=QIcon::fromTheme("help-about"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/options.png") + { + QIcon tempIcon=QIcon::fromTheme("applications-system"); + if(!tempIcon.isNull()) + return tempIcon; + } + return QIcon(":/Themes/Clean/resources/"+fileName); } -void Factory::resetOptions() +void ThemesFactory::resetOptions() { } -void Factory::newLanguageLoaded() +void ThemesFactory::newLanguageLoaded() { - emit reloadLanguage(); + emit reloadLanguage(); } - -Q_EXPORT_PLUGIN2(interface, Factory); diff --git a/plugins-alternative/Themes/Clean/factory.h b/plugins-alternative/Themes/Clean/factory.h index 2a9c0ef..f9b1ee2 100644 --- a/plugins-alternative/Themes/Clean/factory.h +++ b/plugins-alternative/Themes/Clean/factory.h @@ -1,8 +1,7 @@ /** \file factory.h \brief Define the factory, to create instance of the interface \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef FACTORY_H #define FACTORY_H @@ -14,26 +13,27 @@ #include "../../../interface/PluginInterface_Themes.h" /// \brief Define the factory, to create instance of the interface -class Factory : public PluginInterface_ThemesFactory +class ThemesFactory : public PluginInterface_ThemesFactory { - Q_OBJECT - Q_INTERFACES(PluginInterface_ThemesFactory) - public: - /// \brief to return the instance of the copy engine - PluginInterface_Themes * getInstance(); - /// \brief set the resources, to store options, to have facilityInterface - void setResources(OptionInterface * optionsEngine,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion); - /// \brief to get the default options widget - QWidget * options(); - /// \brief to get a resource icon - QIcon getIcon(const QString &fileName); - signals: - void reloadLanguage(); - public slots: - void resetOptions(); - void newLanguageLoaded(); - private: - FacilityInterface * facilityEngine; + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_ThemesFactory) + public: + /// \brief to return the instance of the copy engine + PluginInterface_Themes * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion); + /// \brief to get the default options widget + QWidget * options(); + /// \brief to get a resource icon + QIcon getIcon(const QString &fileName) const; + signals: + void reloadLanguage(); + public slots: + void resetOptions(); + void newLanguageLoaded(); + private: + FacilityInterface * facilityEngine; }; #endif // FACTORY_H diff --git a/plugins-alternative/Themes/Clean/informations.xml b/plugins-alternative/Themes/Clean/informations.xml index 8e076a4..3b49a98 100644 --- a/plugins-alternative/Themes/Clean/informations.xml +++ b/plugins-alternative/Themes/Clean/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 Clean =ultracopier-0.3.1.0 ]]>
\ No newline at end of file diff --git a/plugins-alternative/Themes/Clean/interface.cpp b/plugins-alternative/Themes/Clean/interface.cpp index 6d6c4b1..3f2cd2a 100644 --- a/plugins-alternative/Themes/Clean/interface.cpp +++ b/plugins-alternative/Themes/Clean/interface.cpp @@ -1,99 +1,96 @@ /** \file interface.cpp \brief Define the interface core \author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include +*/ #include "interface.h" #include "ui_interface.h" InterfacePlugin::InterfacePlugin(FacilityInterface * facilityEngine) : - ui(new Ui::interface()) -{ - ui->setupUi(this); - currentFile = 0; - totalFile = 0; - currentSize = 0; - totalSize = 0; - modeIsForced = false; - haveStarted = false; - this->facilityEngine = facilityEngine; - this->show(); - menu=new QMenu(this); - ui->toolButton->setMenu(menu); - updateModeAndType(); - - connect(ui->actionAddFile,SIGNAL(triggered()),this,SLOT(forcedModeAddFile())); - connect(ui->actionAddFileToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToCopy())); - connect(ui->actionAddFileToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToMove())); - connect(ui->actionAddFolderToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToCopy())); - connect(ui->actionAddFolderToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToMove())); - connect(ui->actionAddFolder,SIGNAL(triggered()),this,SLOT(forcedModeAddFolder())); + ui(new Ui::interface()) +{ + ui->setupUi(this); + currentFile = 0; + totalFile = 0; + currentSize = 0; + totalSize = 0; + modeIsForced = false; + haveStarted = false; + this->facilityEngine = facilityEngine; + menu=new QMenu(this); + ui->toolButton->setMenu(menu); + updateModeAndType(); + + connect(ui->actionAddFile,&QAction::triggered,this,&InterfacePlugin::forcedModeAddFile); + connect(ui->actionAddFileToCopy,&QAction::triggered,this,&InterfacePlugin::forcedModeAddFileToCopy); + connect(ui->actionAddFileToMove,&QAction::triggered,this,&InterfacePlugin::forcedModeAddFileToMove); + connect(ui->actionAddFolderToCopy,&QAction::triggered,this,&InterfacePlugin::forcedModeAddFolderToCopy); + connect(ui->actionAddFolderToMove,&QAction::triggered,this,&InterfacePlugin::forcedModeAddFolderToMove); + connect(ui->actionAddFolder,&QAction::triggered,this,&InterfacePlugin::forcedModeAddFolder); + show(); } InterfacePlugin::~InterfacePlugin() { - delete menu; + delete menu; } void InterfacePlugin::forcedModeAddFile() { - emit userAddFile(mode); + emit userAddFile(mode); } void InterfacePlugin::forcedModeAddFolder() { - emit userAddFolder(mode); + emit userAddFolder(mode); } void InterfacePlugin::forcedModeAddFileToCopy() { - emit userAddFile(Copy); + emit userAddFile(Ultracopier::Copy); } void InterfacePlugin::forcedModeAddFolderToCopy() { - emit userAddFolder(Copy); + emit userAddFolder(Ultracopier::Copy); } void InterfacePlugin::forcedModeAddFileToMove() { - emit userAddFile(Move); + emit userAddFile(Ultracopier::Move); } void InterfacePlugin::forcedModeAddFolderToMove() { - emit userAddFolder(Move); + emit userAddFolder(Ultracopier::Move); } void InterfacePlugin::updateModeAndType() { - menu->clear(); - if(modeIsForced) - { - menu->addAction(ui->actionAddFile); - if(type==FileAndFolder) - menu->addAction(ui->actionAddFolder); - } - else - { - menu->addAction(ui->actionAddFileToCopy); - menu->addAction(ui->actionAddFileToMove); - if(type==FileAndFolder) - { - menu->addAction(ui->actionAddFolderToCopy); - menu->addAction(ui->actionAddFolderToMove); - } - } + menu->clear(); + if(modeIsForced) + { + menu->addAction(ui->actionAddFile); + if(type==Ultracopier::FileAndFolder) + menu->addAction(ui->actionAddFolder); + } + else + { + menu->addAction(ui->actionAddFileToCopy); + menu->addAction(ui->actionAddFileToMove); + if(type==Ultracopier::FileAndFolder) + { + menu->addAction(ui->actionAddFolderToCopy); + menu->addAction(ui->actionAddFolderToMove); + } + } } void InterfacePlugin::closeEvent(QCloseEvent *event) { - event->ignore(); - this->hide(); - emit cancel(); + event->ignore(); + this->hide(); + emit cancel(); } void InterfacePlugin::detectedSpeed(const quint64 &speed) @@ -106,162 +103,170 @@ QWidget * InterfacePlugin::getOptionsEngineWidget() return NULL; } -void InterfacePlugin::getOptionsEngineEnabled(bool isEnabled) +void InterfacePlugin::getOptionsEngineEnabled(const bool &isEnabled) { Q_UNUSED(isEnabled) } -void InterfacePlugin::setCopyType(CopyType type) +void InterfacePlugin::setCopyType(const Ultracopier::CopyType &type) { - this->type=type; - updateModeAndType(); + this->type=type; + updateModeAndType(); } -void InterfacePlugin::forceCopyMode(CopyMode mode) +void InterfacePlugin::forceCopyMode(const Ultracopier::CopyMode &mode) { - modeIsForced=true; - this->mode=mode; - updateModeAndType(); + modeIsForced=true; + this->mode=mode; + updateModeAndType(); } void InterfacePlugin::updateTitle() { - QString actionString; - switch(action) - { - case Listing: - actionString=facilityEngine->translateText("Listing"); - break; - case Copying: - actionString=facilityEngine->translateText("Copying"); - break; - case CopyingAndListing: - actionString=facilityEngine->translateText("Listing and copying"); - break; - case Idle: - actionString="Ultracopier"; - break; - } - this->setWindowTitle(actionString+" - "+tr("%1/%2 files, %3/%4").arg(currentFile).arg(totalFile).arg(currentSize).arg(totalSize)); -} - -void InterfacePlugin::actionInProgess(EngineActionInProgress action) -{ - this->action=action; - switch(action) - { - case Copying: - case CopyingAndListing: - ui->progressBar->setMaximum(65535); - ui->progressBar->setMinimum(0); - break; - case Listing: - ui->progressBar->setMaximum(0); - ui->progressBar->setMinimum(0); - break; - case Idle: - if(haveStarted) - emit cancel(); - break; - default: - break; - } - switch(action) - { - case Copying: - case CopyingAndListing: - haveStarted=true; - break; - default: - break; - } -} - -void InterfacePlugin::newTransferStart(const ItemOfCopyList &item) -{ - ui->text->setText(item.sourceFullPath); + QString actionString; + switch(action) + { + case Ultracopier::Listing: + actionString=facilityEngine->translateText("Listing"); + break; + case Ultracopier::Copying: + actionString=facilityEngine->translateText("Copying"); + break; + case Ultracopier::CopyingAndListing: + actionString=facilityEngine->translateText("Listing and copying"); + break; + case Ultracopier::Idle: + actionString="Ultracopier"; + break; + } + this->setWindowTitle(actionString+" - "+tr("%1/%2 files, %3/%4").arg(currentFile).arg(totalFile).arg(currentSize).arg(totalSize)); +} + +void InterfacePlugin::actionInProgess(const Ultracopier::EngineActionInProgress &action) +{ + this->action=action; + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->progressBar->setMaximum(65535); + ui->progressBar->setMinimum(0); + break; + case Ultracopier::Listing: + ui->progressBar->setMaximum(0); + ui->progressBar->setMinimum(0); + break; + case Ultracopier::Idle: + if(haveStarted) + emit cancel(); + break; + default: + break; + } + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + haveStarted=true; + break; + default: + break; + } +} + +void InterfacePlugin::newTransferStart(const Ultracopier::ItemOfCopyList &item) +{ + ui->text->setText(item.sourceFullPath); } void InterfacePlugin::newTransferStop(const quint64 &id) { - Q_UNUSED(id) + Q_UNUSED(id) } void InterfacePlugin::newFolderListing(const QString &path) { - if(action==Listing) - ui->text->setText(path); + if(action==Ultracopier::Listing) + ui->text->setText(path); } void InterfacePlugin::remainingTime(const int &remainingSeconds) { - Q_UNUSED(remainingSeconds) + Q_UNUSED(remainingSeconds) } void InterfacePlugin::newCollisionAction(const QString &action) { - Q_UNUSED(action) + Q_UNUSED(action) } void InterfacePlugin::newErrorAction(const QString &action) { - Q_UNUSED(action) + Q_UNUSED(action) } void InterfacePlugin::errorDetected() { } -void InterfacePlugin::setTransferListOperation(TransferListOperation transferListOperation) +/// \brief new error +void InterfacePlugin::errorToRetry(const QString &source,const QString &destination,const QString &error) +{ + Q_UNUSED(source); + Q_UNUSED(destination); + Q_UNUSED(error); +} + +void InterfacePlugin::setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) { - Q_UNUSED(transferListOperation) + Q_UNUSED(transferListOperation) } //speed limitation bool InterfacePlugin::setSpeedLimitation(const qint64 &speedLimitation) { - Q_UNUSED(speedLimitation) + Q_UNUSED(speedLimitation) return false; } //get information about the copy void InterfacePlugin::setGeneralProgression(const quint64 ¤t,const quint64 &total) { - ui->progressBar->setValue(((double)current/total)*65535); + ui->progressBar->setValue(((double)current/total)*65535); } void InterfacePlugin::setCollisionAction(const QList > &list) { - Q_UNUSED(list) + Q_UNUSED(list) } void InterfacePlugin::setErrorAction(const QList > &list) { - Q_UNUSED(list) + Q_UNUSED(list) } //edit the transfer list -void InterfacePlugin::getActionOnList(const QList &returnActions) +void InterfacePlugin::getActionOnList(const QList &returnActions) { - Q_UNUSED(returnActions) + Q_UNUSED(returnActions) } void InterfacePlugin::haveExternalOrder() { - ui->toolButton->hide(); + ui->toolButton->hide(); } -void InterfacePlugin::isInPause(bool isInPause) +void InterfacePlugin::isInPause(const bool &isInPause) { - //resume in auto the pause - if(isInPause) - emit resume(); + //resume in auto the pause + if(isInPause) + emit resume(); } void InterfacePlugin::newLanguageLoaded() { - ui->retranslateUi(this); - updateTitle(); + ui->retranslateUi(this); + updateTitle(); } /* @@ -269,147 +274,153 @@ void InterfacePlugin::newLanguageLoaded() Return[1]: totalSize Return[2]: currentFile */ -void InterfacePlugin::synchronizeItems(const QList& returnActions) -{ - loop_size=returnActions.size(); - index_for_loop=0; - while(index_for_loop &progressionList) -{ - loop_size=InternalRunningOperation.size(); - sub_loop_size=progressionList.size(); - index_for_loop=0; - while(index_for_loop& returnActions) +{ + loop_size=returnActions.size(); + index_for_loop=0; + while(index_for_loop &progressionList) +{ + loop_size=InternalRunningOperation.size(); + sub_loop_size=progressionList.size(); + index_for_loop=0; + while(index_for_loop0; - if(returnItem.haveItem) - { - const ItemOfCopyListWithMoreInformations &itemTransfer=InternalRunningOperation.first(); - returnItem.from=itemTransfer.generalData.sourceFullPath; - returnItem.to=itemTransfer.generalData.destinationFullPath; - returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); - switch(itemTransfer.actionType) - { - case CustomOperation: - if(!itemTransfer.custom_with_progression) - returnItem.progressBar_file=0; - else - { - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - } - break; - case Transfer: - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - break; - case PostOperation: - returnItem.progressBar_file=65535; - break; - default: - returnItem.progressBar_file=0; - } - } - return returnItem; + currentTransfertItem returnItem; + returnItem.haveItem=InternalRunningOperation.size()>0; + if(returnItem.haveItem) + { + const ItemOfCopyListWithMoreInformations &itemTransfer=InternalRunningOperation.first(); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_file=0; + else + { + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + break; + case Ultracopier::PostOperation: + returnItem.progressBar_file=65535; + break; + default: + returnItem.progressBar_file=0; + } + } + return returnItem; } diff --git a/plugins-alternative/Themes/Clean/interface.h b/plugins-alternative/Themes/Clean/interface.h index b7ab57f..e5b5c36 100644 --- a/plugins-alternative/Themes/Clean/interface.h +++ b/plugins-alternative/Themes/Clean/interface.h @@ -1,8 +1,7 @@ /** \file interface.h \brief Define the interface \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef INTERFACE_TEST_H #define INTERFACE_TEST_H @@ -15,145 +14,128 @@ #include "../../../interface/PluginInterface_Themes.h" namespace Ui { - class interface; + class interface; } /// \brief Define the interface class InterfacePlugin : public PluginInterface_Themes { - Q_OBJECT + Q_OBJECT public slots: - //send information about the copy - /// \brief to set the action in progress - void actionInProgess(EngineActionInProgress); - /// \brief new transfer have started - void newTransferStart(const ItemOfCopyList &item); - /** \brief one transfer have been stopped - * is stopped, example: because error have occurred, and try later, don't remove the item! */ - void newTransferStop(const quint64 &id); - /// \brief the new folder is listing - void newFolderListing(const QString &path); - /** \brief show the detected speed - * in byte per seconds */ - void detectedSpeed(const quint64 &speed); - /** \brief show the remaining time - * time in seconds */ - void remainingTime(const int &remainingSeconds); - /// \brief set the current collision action - void newCollisionAction(const QString &action); - /// \brief set the current error action - void newErrorAction(const QString &action); - /// \brief set one error is detected - void errorDetected(); - //speed limitation - /** \brief the max speed used - * in byte per seconds, -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - //set the translate - void newLanguageLoaded(); - void synchronizeItems(const QList& returnActions); + //send information about the copy + /// \brief to set the action in progress + void actionInProgess(const Ultracopier::EngineActionInProgress&); + /// \brief new transfer have started + void newTransferStart(const Ultracopier::ItemOfCopyList &item); + /** \brief one transfer have been stopped + * is stopped, example: because error have occurred, and try later, don't remove the item! */ + void newTransferStop(const quint64 &id); + /// \brief the new folder is listing + void newFolderListing(const QString &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const quint64 &speed); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const QString &action); + /// \brief set the current error action + void newErrorAction(const QString &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const QString &source,const QString &destination,const QString &error); + //speed limitation + /** \brief the max speed used + * in byte per seconds, -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + //set the translate + void newLanguageLoaded(); + void synchronizeItems(const QList& returnActions); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); public: - /// \brief the transfer item with progression - struct ItemOfCopyListWithMoreInformations - { - quint64 currentProgression; - ItemOfCopyList generalData; - ActionTypeCopyList actionType; - bool custom_with_progression; - }; - /// \brief returned first transfer item - struct currentTransfertItem - { - quint64 id; - bool haveItem; - QString from; - QString to; - QString current_file; - int progressBar_file; - }; - /// \brief get the widget for the copy engine - QWidget * getOptionsEngineWidget(); - /// \brief to set if the copy engine is found - void getOptionsEngineEnabled(bool isEnabled); - /// \brief get action on the transfer list (add/move/remove) - void getActionOnList(const QList &returnActions); - //get information about the copy - /// \brief show the general progression - void setGeneralProgression(const quint64 ¤t,const quint64 &total); - /// \brief show the file progression - void setFileProgression(const QList &progressionList); - /// \brief set collision action - void setCollisionAction(const QList > &); - /// \brief set error action - void setErrorAction(const QList > &); - /// \brief set the copyType -> file or folder - void setCopyType(CopyType); - /// \brief set the copyMove -> copy or move, to force in copy or move, else support both - void forceCopyMode(CopyMode); - /// \brief set if transfer list is exportable/importable - void setTransferListOperation(TransferListOperation transferListOperation); - /** \brief set if the order is external (like file manager copy) - * to notify the interface, which can hide add folder/filer button */ - void haveExternalOrder(); - /// \brief set if is in pause - void isInPause(bool); + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_file; + }; + /// \brief get the widget for the copy engine + QWidget * getOptionsEngineWidget(); + /// \brief to set if the copy engine is found + void getOptionsEngineEnabled(const bool &isEnabled); + /// \brief get action on the transfer list (add/move/remove) + void getActionOnList(const QList &returnActions); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const quint64 ¤t,const quint64 &total); + /// \brief show the file progression + void setFileProgression(const QList &progressionList); + /// \brief set collision action + void setCollisionAction(const QList > &); + /// \brief set error action + void setErrorAction(const QList > &); + /// \brief set the copyType -> file or folder + void setCopyType(const Ultracopier::CopyType&); + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + void forceCopyMode(const Ultracopier::CopyMode &); + /// \brief set if transfer list is exportable/importable + void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation); + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + void haveExternalOrder(); + /// \brief set if is in pause + void isInPause(const bool &); signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - //set the transfer list - void removeItems(QList ids); - void moveItemsOnTop(QList ids); - void moveItemsUp(QList ids); - void moveItemsDown(QList ids); - void moveItemsOnBottom(QList ids); - void exportTransferList(); - void importTransferList(); - //user ask ask to add folder (add it with interface ask source/destination) - void userAddFolder(CopyMode); - void userAddFile(CopyMode); - void urlDropped(QList urls); - //action on the copy - void pause(); - void resume(); - void skip(quint64 id); - void cancel(); - //edit the action - void sendCollisionAction(QString action); - void sendErrorAction(QString action); - void newSpeedLimitation(qint64); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif public: - //constructor and destructor - InterfacePlugin(FacilityInterface * facilityEngine); - ~InterfacePlugin(); + //constructor and destructor + InterfacePlugin(FacilityInterface * facilityEngine); + ~InterfacePlugin(); private: - Ui::interface *ui; - quint64 currentFile; - quint64 totalFile; - quint64 currentSize; - quint64 totalSize; - void updateTitle(); - QMenu *menu; - EngineActionInProgress action; - void closeEvent(QCloseEvent *event); - void updateModeAndType(); - bool modeIsForced; - CopyType type; - CopyMode mode; - bool haveStarted; - QList InternalRunningOperation; - int loop_size,index_for_loop; - int sub_loop_size,sub_index_for_loop; - currentTransfertItem getCurrentTransfertItem(); - FacilityInterface * facilityEngine; + Ui::interface *ui; + quint64 currentFile; + quint64 totalFile; + quint64 currentSize; + quint64 totalSize; + void updateTitle(); + QMenu *menu; + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + void updateModeAndType(); + bool modeIsForced; + Ultracopier::CopyType type; + Ultracopier::CopyMode mode; + bool haveStarted; + QList InternalRunningOperation; + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + currentTransfertItem getCurrentTransfertItem(); + FacilityInterface * facilityEngine; private slots: - void forcedModeAddFile(); - void forcedModeAddFolder(); - void forcedModeAddFileToCopy(); - void forcedModeAddFolderToCopy(); - void forcedModeAddFileToMove(); - void forcedModeAddFolderToMove(); + void forcedModeAddFile(); + void forcedModeAddFolder(); + void forcedModeAddFileToCopy(); + void forcedModeAddFolderToCopy(); + void forcedModeAddFileToMove(); + void forcedModeAddFolderToMove(); }; #endif // INTERFACE_TEST_H diff --git a/plugins-alternative/Themes/Clean/interface.pro b/plugins-alternative/Themes/Clean/interface.pro index 20fd1dd..eb124c9 100644 --- a/plugins-alternative/Themes/Clean/interface.pro +++ b/plugins-alternative/Themes/Clean/interface.pro @@ -1,31 +1,36 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets TEMPLATE = lib CONFIG += plugin HEADERS = interface.h \ - interface/PluginInterface_Themes.h \ - StructEnumDefinition.h \ + StructEnumDefinition.h \ factory.h \ ../../../interface/PluginInterface_Themes.h SOURCES = interface.cpp \ factory.cpp TARGET = $$qtLibraryTarget(interface) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ +TRANSLATIONS += Languages/ar/translation.ts \ Languages/de/translation.ts \ Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ Languages/it/translation.ts \ Languages/ja/translation.ts \ - Languages/id/translation.ts \ + Languages/ko/translation.ts \ + Languages/nl/translation.ts \ + Languages/no/translation.ts \ Languages/pl/translation.ts \ Languages/ru/translation.ts \ - Languages/tr/translation.ts \ Languages/th/translation.ts \ - Languages/hi/translation.ts \ - Languages/nl/translation.ts \ - Languages/no/translation.ts \ - Languages/pt/translation.ts \ - Languages/ko/translation.ts + Languages/tr/translation.ts \ + Languages/zh/translation.ts FORMS += \ interface.ui diff --git a/plugins-alternative/Themes/Clean/interface.ui b/plugins-alternative/Themes/Clean/interface.ui index 1ac0e4a..f178af7 100644 --- a/plugins-alternative/Themes/Clean/interface.ui +++ b/plugins-alternative/Themes/Clean/interface.ui @@ -41,7 +41,7 @@ - In wait + Waiting @@ -72,7 +72,7 @@ - :/resources/add.png:/resources/add.png + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png Add file @@ -81,7 +81,7 @@ - :/resources/add.png:/resources/add.png + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png Add folder @@ -90,7 +90,7 @@ - :/resources/add.png:/resources/add.png + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png Move file(s) @@ -99,7 +99,7 @@ - :/resources/add.png:/resources/add.png + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png Move folder @@ -108,7 +108,7 @@ - :/resources/add.png:/resources/add.png + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png Copy file(s) @@ -117,7 +117,7 @@ - :/resources/add.png:/resources/add.png + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png Copy folder diff --git a/plugins-alternative/Themes/Clean/plugin.json b/plugins-alternative/Themes/Clean/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/Themes/Clean/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/Themes/Clean/resources.qrc b/plugins-alternative/Themes/Clean/resources.qrc index 67c550f..40533c4 100644 --- a/plugins-alternative/Themes/Clean/resources.qrc +++ b/plugins-alternative/Themes/Clean/resources.qrc @@ -1,5 +1,5 @@ - + resources/SystemTrayIcon/informations.png diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/informations.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/informations.png index e1eb797..5b7b255 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/informations.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/informations.png differ diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Unix.png index a81e70d..6f5d1cf 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Unix.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Windows.png index 8072aea..5464856 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Windows.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png index f40ea82..3961215 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png index 8d673e4..45d6315 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Unix.png index 9ce4779..ac4299a 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Unix.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Windows.png index d0fca1b..6e6bae7 100644 Binary files a/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Windows.png and b/plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Clean/resources_unix.qrc b/plugins-alternative/Themes/Clean/resources_unix.qrc index ae3894b..847cc1c 100644 --- a/plugins-alternative/Themes/Clean/resources_unix.qrc +++ b/plugins-alternative/Themes/Clean/resources_unix.qrc @@ -1,6 +1,6 @@ - - resources/SystemTrayIcon/systray_Caught_Unix.png + + resources/SystemTrayIcon/systray_Caught_Unix.png resources/SystemTrayIcon/systray_Semiuncaught_Unix.png resources/SystemTrayIcon/systray_Uncaught_Unix.png diff --git a/plugins-alternative/Themes/Clean/resources_windows.qrc b/plugins-alternative/Themes/Clean/resources_windows.qrc index 99829b3..7d8bbe1 100644 --- a/plugins-alternative/Themes/Clean/resources_windows.qrc +++ b/plugins-alternative/Themes/Clean/resources_windows.qrc @@ -1,5 +1,5 @@ - + resources/SystemTrayIcon/systray_Caught_Windows.png resources/SystemTrayIcon/systray_Semiuncaught_Windows.png resources/SystemTrayIcon/systray_Uncaught_Windows.png diff --git a/plugins-alternative/Themes/Supercopier/DebugEngineMacro.h b/plugins-alternative/Themes/Supercopier/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/DebugEngineMacro.h @@ -0,0 +1,28 @@ +/** \file DebugEngineMacro.h +\brief Define the macro for the debug +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef DEBUGENGINEMACRO_H +#define DEBUGENGINEMACRO_H + +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + +/// \brief Macro for the debug log +#ifdef ULTRACOPIER_PLUGIN_DEBUG + #if defined (__FILE__) && defined (__LINE__) + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b,__FILE__,__LINE__) + #else + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b) + #endif +#else // ULTRACOPIER_DEBUG + #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() +#endif // ULTRACOPIER_DEBUG + +#endif // DEBUGENGINEMACRO_H + + + + diff --git a/plugins-alternative/Themes/Supercopier/Environment.h b/plugins-alternative/Themes/Supercopier/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Environment.h @@ -0,0 +1,10 @@ +/** \file Environment.h +\brief Define the environment variable and global function +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "Variable.h" +/// \brief The global include +#include "StructEnumDefinition.h" +#include "DebugEngineMacro.h" + diff --git a/plugins-alternative/Themes/Supercopier/Languages/ar/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/ar/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/ar/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/de/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/de/translation.ts new file mode 100644 index 0000000..c1177e9 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/de/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + Kaufen Sie die Ultimate-Version um die Entwicklung zu unterstützen + + + + File %1/%2, size: %3/%4 + Datei %1/%2, Größe:%3/%4 + + + + Copy list + Zu kopierende Dateien + + + + Move list + Zu verschiebende Dateien + + + + Don't close if errors are found + Bei Fehler nicht + + + + Never close + Nie + + + + Always close + Immer + + + + File Name, 0KB + Dateiname, 0KB + + + + + + Select a color + Farbe auswählen + + + + + + %1 %2% of %3 + %1 %2 von %3 + + + + ThemesFactory + + + Don't close if errors are found + Nicht schließen, wenn Fehler aufgetreten sind + + + + Never close + Niemals schließen + + + + Always close + Immer schließen + + + + + + Select a color + Wählen Sie eine Farbe + + + + interfaceCopy + + + From: + Von: + + + + To: + Nach: + + + + Close at the end of the transfers + Am Ende des Transfers schließen + + + + &More + &Mehr + + + + &Pause + &Pause + + + + &Skip + Über&springen + + + + &Cancel + Abbrechen (&C) + + + + Transfer list + Dateiliste + + + + Delete the selected items + Ausgewählte Einträge löschen + + + + Export the transfer list + Dateiliste exportieren + + + + Import the transfer list + Dateiliste importieren + + + + Previous + Vorherige + + + + Next + Nächste + + + + Interface + Darstellungsoptionen + + + + Move the selected items to the top + Ausgewählte Einträge an den Listenanfang verschieben + + + + Limit copy speed to: + Begrenze Kopiergeschwindigkeit auf: + + + + Move up the selected items + Ausgewählte Einträge einen Platz nach oben verschieben + + + + Move down the selected items + Ausgewählte Einträge einen Platz nach unten verschieben + + + + Move the selected items to the bottom + Ausgewählte Einträge an das Listenende verschieben + + + + Add file/folder + Datei/Ordner hinzufügen + + + + Search + In Dateiliste suchen + + + + + Error + Fehlerprotokoll + + + + Export the errors into transfer list + Fehler in Transferliste exportieren + + + + Source + Quelle + + + + Destination + Ziel + + + + Add file + Datei hinzufügen + + + + Add folder + Ordner hinzufügen + + + + Move file(s) + Datei(en) verschieben + + + + Move folder + Ordner verschieben + + + + Copy file(s) + Datei(en) kopieren + + + + Copy folder + Verzeichnis kopieren + + + + themesOptions + + + Show dual progression + Zweifachen Fortschritt anzeigen + + + + Show speed as main information + Geschwindigkeitsbegrenzungs Schieberegler anzeigen + + + + Use + Benutzung + + + + Start with the "more button" pushed + Standardmäßig "Mehr" Informationen anzeigen + + + + Minimize on close to systray + Beim Schließen ins Systray minimieren + + + + At the end of the copy + Fenster am Ende des Vorgangs schließen + + + + + Limit copy speed to + Begrenze Übertragungsgeschwindigkeit auf + + + + Click to edit the color + Zum Bearbeiten der Farbe klicken + + + + KB/s + KB/s + + + + Informations + Informationen + + + + Display + Anzeige + + + + Speed with progress bar + Geschwindigkeit als Fortschrittsbalken anzeigen + + + + Progression color + Farbe des Fortschrittsbalken + + + + Show progression in the title + Fortschritt im Fenstertitel zeigen + + + + Always on top + Fenster immer im Vordergrund + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/el/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/el/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/el/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/en/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/en/translation.ts new file mode 100644 index 0000000..9275b19 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/en/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Transfer list + + + + + Delete the selected items + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + Interface + + + + + Move the selected items to the top + + + + + Limit copy speed to: + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Search + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/es/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/es/translation.ts new file mode 100644 index 0000000..c407b34 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/es/translation.ts @@ -0,0 +1,340 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + Comprar la versión Ultimate para financiar el desarrollo + + + + File %1/%2, size: %3/%4 + El archivo %1/%2, el tamaño: %3/%4 + + + + Copy list + Lista de copia + + + + Move list + Lista de movimiento + + + + Don't close if errors are found + No cierre si se encuentran errores + + + + Never close + Nunca cierre + + + + Always close + Siempre cerrar + + + + File Name, 0KB + Nombre de archivo, 0KB + + + + + + Select a color + Seleccione un color + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + No cierre si se encuentran errores + + + + Never close + Nunca cierre + + + + Always close + Siempre cerrar + + + + + + Select a color + Seleccione un color + + + + interfaceCopy + + + From: + De: + + + + To: + Para: + + + + Close at the end of the transfers + Cerca al final de las transferencias + + + + &More + &Más + + + + &Pause + &Pausa + + + + &Skip + &Omitir + + + + &Cancel + &Cancelar + + + Limit copy speed at: + Limitar la velocidad de copia en: + + + Close on transfer completion + Cerca de finalización de transferencia + + + + Limit copy speed to: + Limitar la velocidad de copia en: + + + + Transfer list + Lista de transferencia + + + + Move the selected items to the top + Mueve los elementos seleccionados a la parte superior + + + + Move up the selected items + Mueva los elementos seleccionados + + + + Move down the selected items + Bajar los elementos seleccionados + + + + Move the selected items to the bottom + Mueve los elementos seleccionados a la parte inferior + + + + Add file/folder + Agregar archivo/carpeta + + + + Delete the selected items + Eliminar los elementos seleccionados + + + + Search + Buscar + + + + Export the transfer list + Exportar la lista de transferencias + + + + Import the transfer list + Importe la lista de transferencias + + + + Previous + Anterior + + + + Next + Próximo + + + + + Error + Error + + + + Export the errors into transfer list + Exportar los errores en la lista de transferencias + + + + Source + Fuente + + + + Destination + Destino + + + + Interface + Interfaz + + + + Add file + Añadir archivo + + + + Add folder + Añadir carpeta + + + + Move file(s) + Mover archivo(s) + + + + Move folder + Mueva la carpeta + + + + Copy file(s) + Copia el archivo(s) + + + + Copy folder + Copia la carpeta + + + + themesOptions + + + Show dual progression + Mostrar progresión dual + + + + Show speed as main information + Mostrar la velocidad como principales informaciones + + + + Use + Uso + + + + Start with the "more button" pushed + Comience con el "botón más" empujada + + + + Minimize on close to systray + Minimizar en cerca de la bandeja del sistema + + + + At the end of the copy + Al final de la copia + + + + + Limit copy speed to + Limitar la velocidad de copia de + + + + Click to edit the color + Haga clic para editar el color + + + At the end of the copy: + Al final de la copia: + + + Limit copy speed at: + Limitar la velocidad de copia en: + + + + KB/s + KB/s + + + + Informations + Informations + + + + Display + Visualización + + + + Speed with progress bar + Velocidad con barra de progreso + + + + Progression color + Progresión de color + + + + Show progression in the title + Mostrar progresión en el título + + + + Always on top + Siempre visible + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/fr/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/fr/translation.ts new file mode 100644 index 0000000..49112ee --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/fr/translation.ts @@ -0,0 +1,344 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + Achetez la version Ultimate pour financer le développement + + + + File %1/%2, size: %3/%4 + Fichier %1/%2, taille: %3/%4 + + + + Copy list + Liste de copies + + + + Move list + Liste de déplacements + + + + Don't close if errors are found + Garder ouvert s'il y a des erreurs + + + + Never close + Ne jamais fermer + + + + Always close + Toujours fermer + + + + File Name, 0KB + Nom de fichier, 0Ko + + + + + + Select a color + Selectionner une coleur + + + + + + %1 %2% of %3 + %1 de %2% de %3 + + + + ThemesFactory + + + Don't close if errors are found + Garder ouvert s'il y a des erreurs + + + + Never close + Ne jamais fermer + + + + Always close + Toujours fermer + + + + + + Select a color + Selectionner une coleur + + + + interfaceCopy + + + From: + Depuis: + + + + To: + Vers: + + + + Close at the end of the transfers + Fermer à la fin des transferts + + + + &More + Pl&us + + + + &Pause + &Pause + + + + &Skip + &Passer + + + + &Cancel + &Annuler + + + Limit copy speed at: + Limiter la vitesse de copie à: + + + Close on transfer completion + Fermer à la fin des transferts + + + + Limit copy speed to: + Limiter la vitesse de copie à: + + + + Transfer list + Liste de transferts + + + + Move the selected items to the top + Déplacer l'item selectionné au debut + + + + Move up the selected items + Déplacer l'item selectionné vers le haut + + + + Move down the selected items + Déplacer l'item selectionné vers le bas + + + + Move the selected items to the bottom + Déplacer l'item selectionné à la fin + + + + Add file/folder + Ajouter fichier/dossier + + + + Delete the selected items + Supprimer les items sélectionnés + + + + Search + Rechercher + + + + Export the transfer list + Exporter la liste de transfert + + + + Import the transfer list + Importer la liste de transfert + + + + Previous + Précédent + + + + Next + Suivant + + + + + Error + Erreur + + + + Export the errors into transfer list + Exporter les erreurs dans une liste de transfert + + + + Source + Source + + + + Destination + Destination + + + + Interface + Interface + + + + Add file + Ajouter un fichier + + + + Add folder + Ajouter un répertoire + + + + Move file(s) + Déplacer le(s) fichier(s) + + + + Move folder + Déplacer un répertoire + + + + Copy file(s) + Copier le(s) fichier(s) + + + + Copy folder + Copier un répertoire + + + + themesOptions + + + Show dual progression + Afficher une double progression + + + + Show speed as main information + Afficher la vitesse comme information principale + + + + Use + Utilisation + + + + Start with the "more button" pushed + Déplier automatiquement les détails + + + + Minimize on close to systray + Minimiser à la fermeture dans le systray + + + + At the end of the copy + À la fin de la copie + + + + + Limit copy speed to + Limiter la vitesse de copie à + + + + Click to edit the color + Cliquer pour édité la couleur + + + At the end of the copy: + À la fin de la copie: + + + Limit copy speed at: + Limiter la vitesse de copie à: + + + Limit copy speed to: + Limiter la vitesse de copie à: + + + + KB/s + Ko/s + + + + Informations + Informations + + + + Display + Affichage + + + + Speed with progress bar + Vitesse avec barre de progression + + + + Progression color + Couleur de progression + + + + Show progression in the title + Afficher la progression dans le titre + + + + Always on top + Toujours au 1er plan + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/hi/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/hi/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/hi/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/hu/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/hu/translation.ts new file mode 100644 index 0000000..bc36d92 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/hu/translation.ts @@ -0,0 +1,328 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + Vásárold meg az Ultimate verziót a fejlesztés támogatásához + + + + File %1/%2, size: %3/%4 + Fájl %1/%2, méret: %3/%4 + + + + Copy list + Lista másolása + + + + Move list + Lista mozgatása + + + + Don't close if errors are found + Ne zárja be, ha hiba történik + + + + Never close + Sose zárja be + + + + Always close + Mindig zárja be + + + + File Name, 0KB + Fájlnév, 0KB + + + + + + Select a color + Válassz egy színt + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + Ne zárja be, ha hiba történik + + + + Never close + Sose zárja be + + + + Always close + Mindig zárja be + + + + + + Select a color + Válassz egy színt + + + + interfaceCopy + + + From: + Forrás: + + + + To: + Cél: + + + + Close at the end of the transfers + + + + + &More + &Több + + + + &Pause + &Szünet + + + + &Skip + &Kihagy + + + + &Cancel + &Mégse + + + + Transfer list + Átviteli lista + + + + Previous + Előző + + + + Next + Következő + + + + Interface + Kezelőfelület + + + + Move the selected items to the top + Kijelölések elemek mozgatása legfelülre + + + Close on transfer completion + Átvitel végeztével zárja be + + + + Limit copy speed to: + Másolási sebesség korlátozása: + + + + Move up the selected items + Kijelölt elemek mozgatása fel + + + + Move down the selected items + Kijelölt elemek mozgatása le + + + + Move the selected items to the bottom + Kijelölések elemek mozgatása legalulra + + + + Add file/folder + Fájl/mappa hozzáadása + + + + Delete the selected items + Kijelölt elemek törlése + + + + Search + Keresés + + + + Export the transfer list + Átviteli lista exportálása + + + + Import the transfer list + Átviteli lista importálása + + + + + Error + Hiba + + + + Export the errors into transfer list + Hibák exportálása az átviteli listába + + + + Source + Forrás + + + + Destination + Cél + + + + Add file + Fájl hozzáadása + + + + Add folder + Mappa hozzáadása + + + + Move file(s) + Fájl(ok) mozgatása + + + + Move folder + Mappa mozgatása + + + + Copy file(s) + Fájl(ok) másolása + + + + Copy folder + Mappa másolása + + + + themesOptions + + + Show dual progression + Páros folyamat mutatása + + + + Show speed as main information + Sebesség mutatása, mint fő információ + + + + Use + Használ + + + + Start with the "more button" pushed + Indítás a "több gomb" lenyomásával + + + + Minimize on close to systray + Bezáráskor minimalizálás a tálcára + + + + At the end of the copy + A másolás befejezésekor + + + + + Limit copy speed to + Másolási sebesség korlátozása + + + + Click to edit the color + Kattints a szín szerkesztéséhez + + + + KB/s + KB/s + + + + Informations + Információk + + + + Display + Megjelenítés + + + + Speed with progress bar + Sebesség folyamatsávval + + + + Progression color + Folyamat színe + + + + Show progression in the title + Folyamat mutatása a címsorban + + + + Always on top + Mindig legfelül + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/id/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/id/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/id/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/it/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/it/translation.ts new file mode 100644 index 0000000..255c3b1 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/it/translation.ts @@ -0,0 +1,336 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + File %1/%2, dimensione: %3/%4 + + + + Copy list + Lista della copia + + + + Move list + Lista dello spostamento + + + + Don't close if errors are found + Non chiudere se vengono rilevati errori + + + + Never close + Non chiudere mai + + + + Always close + Chiudere sempre + + + + File Name, 0KB + Nome del file, 0KB + + + + + + Select a color + Scegliere un colore + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + Non chiudere se vengono rilevati errori + + + + Never close + Non chiudere mai + + + + Always close + Chiudere sempre + + + + + + Select a color + Scegliere un colore + + + + interfaceCopy + + + From: + Da: + + + + To: + a: + + + + Close at the end of the transfers + Chiudi alla fine dei trasferimenti + + + + &More + Altr&o + + + + &Pause + &Pausa + + + + &Skip + &Salta + + + + &Cancel + &Annulla + + + Limit copy speed at: + Ridurre la velocità di copia a: + + + + Limit copy speed to: + + + + + Transfer list + Lista dei trasferimenti + + + + Move the selected items to the top + Sposta in cima gli elementi selezionati + + + + Move up the selected items + Sposta sopra gli elementi selezionati + + + + Move down the selected items + Sposta sotto gli elementi selezionati + + + + Move the selected items to the bottom + Sposta in coda gli elementi selezionati + + + + Add file/folder + Aggiungi file/cartelle + + + + Delete the selected items + Elimina gli elementi selezionati + + + + Search + Cerca + + + + Export the transfer list + Esporta la lista dei trasferimenti + + + + Import the transfer list + Importa la lista dei trasferimenti + + + + Previous + Precedente + + + + Next + Successivo + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + Interfaccia + + + + Add file + Aggiungi file + + + + Add folder + Aggiungi cartella + + + + Move file(s) + Sposta file + + + + Move folder + Sposta la cartella + + + + Copy file(s) + Copia file + + + + Copy folder + Copia la cartella + + + + themesOptions + + + Show dual progression + Mostrare la doppia progressione + + + + Show speed as main information + Mostrare la velocità come principale informazione + + + + Use + + + + + Start with the "more button" pushed + Iniziare col pulsante "Altro" attivo + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + Click to edit the color + + + + At the end of the copy: + Alla fine della copia: + + + Limit copy speed at: + Ridurre la velocità di copia a: + + + + KB/s + KB/s + + + + Informations + + + + + Display + + + + + Speed with progress bar + Velocità nella barra di progresso + + + + Progression color + Colore della progressione + + + + Show progression in the title + Mostrare la percentuale di progresso sul titolo + + + + Always on top + Sempre in primo piano + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/ja/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/ja/translation.ts new file mode 100644 index 0000000..6ba3c00 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/ja/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Transfer list + + + + + Delete the selected items + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + Interface + + + + + Move the selected items to the top + + + + + Limit copy speed to: + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Search + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/ko/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/ko/translation.ts new file mode 100644 index 0000000..4354bd2 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/ko/translation.ts @@ -0,0 +1,336 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + 파일 %1/%2, 크기: %3/%4 + + + + Copy list + 복사 목록 + + + + Move list + + + + + Don't close if errors are found + 오류 발견시 종료 안함 + + + + Never close + 절대 종료 안함 + + + + Always close + 항상 종료 + + + + File Name, 0KB + 파일명, 0KB + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + 오류 발견시 종료 안함 + + + + Never close + 절대 종료 안함 + + + + Always close + 항상 종료 + + + + + + Select a color + + + + + interfaceCopy + + + From: + 원본: + + + + To: + 대상: + + + + Close at the end of the transfers + + + + + &More + &자세히 + + + + &Pause + &일시 정지 + + + + &Skip + &건너뛰기 + + + + &Cancel + &취소 + + + Limit copy speed at: + 복사 속도 제한: + + + + Transfer list + + + + + Delete the selected items + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + 이전 + + + + Next + 다음 + + + + Interface + 인터페이스 + + + + Move the selected items to the top + + + + + Limit copy speed to: + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Search + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Add file + 파일 추가 + + + + Add folder + 폴더 추가 + + + + Move file(s) + 파일 이동 + + + + Move folder + 폴더 이동 + + + + Copy file(s) + 파일 복사 + + + + Copy folder + 폴더 복사 + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + 메인 정보에 속도 표시 + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + Click to edit the color + + + + At the end of the copy: + 복사 종료시: + + + Limit copy speed at: + 복사 속도 제한: + + + + KB/s + KB/초 + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/nl/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/nl/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/nl/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/no/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/no/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/no/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/pl/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/pl/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/pl/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/pt/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/pt/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/pt/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/ru/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/ru/translation.ts new file mode 100644 index 0000000..a5a373b --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/ru/translation.ts @@ -0,0 +1,336 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + Файл %1/%2, размер: %3/%4 + + + + Copy list + Копировать список + + + + Move list + + + + + Don't close if errors are found + Не закрывать, если найдены ошибки + + + + Never close + Никогда не закрывать + + + + Always close + Всегда закрывайте + + + + File Name, 0KB + Имя файла, 0KB + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + Не закрывать, если найдены ошибки + + + + Never close + Никогда не закрывать + + + + Always close + Всегда закрывайте + + + + + + Select a color + + + + + interfaceCopy + + + From: + С: + + + + To: + к: + + + + Close at the end of the transfers + + + + + &More + больше + + + + &Pause + пауза + + + + &Skip + пропускать + + + + &Cancel + отменить + + + Limit copy speed at: + Предельная скорость копирования по адресу: + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + предыдущий + + + + Next + следующий + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + интерфейс + + + + Add file + Добавить файл + + + + Add folder + Добавить папку + + + + Move file(s) + Перемещение файла(ов) + + + + Move folder + Перемещение папки + + + + Copy file(s) + Копировать файл (ы) + + + + Copy folder + Копировать папку + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + Показать скорости в качестве основной информации + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + Click to edit the color + + + + At the end of the copy: + В конце копии: + + + Limit copy speed at: + Предельная скорость копирования по адресу: + + + + KB/s + Кб/с + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/th/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/th/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/th/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/tr/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/tr/translation.ts new file mode 100644 index 0000000..78e326c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/tr/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Limit copy speed to: + + + + + Transfer list + + + + + Move the selected items to the top + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Delete the selected items + + + + + Search + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Interface + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/Languages/zh/translation.ts b/plugins-alternative/Themes/Supercopier/Languages/zh/translation.ts new file mode 100644 index 0000000..6ba3c00 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Languages/zh/translation.ts @@ -0,0 +1,324 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + Close at the end of the transfers + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Transfer list + + + + + Delete the selected items + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + Interface + + + + + Move the selected items to the top + + + + + Limit copy speed to: + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Search + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins-alternative/Themes/Supercopier/StructEnumDefinition.h b/plugins-alternative/Themes/Supercopier/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/Themes/Supercopier/TransferModel.cpp b/plugins-alternative/Themes/Supercopier/TransferModel.cpp new file mode 100644 index 0000000..6ce9b92 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/TransferModel.cpp @@ -0,0 +1,569 @@ +#include "TransferModel.h" + +#define COLUMN_COUNT 3 + +QIcon *TransferModel::start=NULL; +QIcon *TransferModel::stop=NULL; + +TransferModel::TransferModel() +{ + /// \warning to prevent Must construct a QGuiApplication before QPixmap IN STATIC WINDOWS VERSION ONLY + if(TransferModel::start==NULL) + TransferModel::start=new QIcon(QStringLiteral(":/resources/player_play.png")); + if(TransferModel::stop==NULL) + TransferModel::stop=new QIcon(QStringLiteral(":/resources/player_pause.png")); + currentIndexSearch=0; + haveSearchItem=false; + facilityEngine=NULL; +} + +int TransferModel::columnCount( const QModelIndex& parent ) const +{ + return parent == QModelIndex() ? COLUMN_COUNT : 0; +} + +QVariant TransferModel::data( const QModelIndex& index, int role ) const +{ + int row,column; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return QVariant(); + + const TransfertItem& item = transfertItemList.at(row); + if(role==Qt::UserRole) + return item.id; + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + return item.source; + break; + case 1: + return item.size; + break; + case 2: + return item.destination; + break; + default: + return QVariant(); + } + } + else if(role==Qt::DecorationRole) + { + switch(column) + { + case 0: + if(stopId.contains(item.id)) + return *stop; + else if(startId.contains(item.id)) + return *start; + else + return QVariant(); + break; + default: + return QVariant(); + } + } + else if(role==Qt::BackgroundRole) + { + if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) + { + if(haveSearchItem && searchId==item.id) + return QColor(255,150,150,100); + else + return QColor(255,255,0,100); + } + else + return QVariant(); + } + return QVariant(); +} + +int TransferModel::rowCount( const QModelIndex& parent ) const +{ + return parent == QModelIndex() ? transfertItemList.count() : 0; +} + +quint64 TransferModel::firstId() const +{ + if(transfertItemList.count()>0) + return transfertItemList.first().id; + else + return 0; +} + +QVariant TransferModel::headerData( int section, Qt::Orientation orientation, int role ) const +{ + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return facilityEngine->translateText(QStringLiteral("Source")); + case 1: + return facilityEngine->translateText(QStringLiteral("Size")); + case 2: + return facilityEngine->translateText(QStringLiteral("Destination")); + } + } + + return QAbstractTableModel::headerData( section, orientation, role ); +} + +bool TransferModel::setData( const QModelIndex& index, const QVariant& value, int role ) +{ + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return false; + + TransfertItem& item = transfertItemList[row]; + if(role==Qt::UserRole) + { + item.id=value.toULongLong(); + return true; + } + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + item.source=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 1: + item.size=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 2: + item.destination=value.toString(); + emit dataChanged(index,index); + return true; + break; + default: + return false; + } + } + return false; +} + +/* + Return[0]: totalFile + Return[1]: totalSize + Return[2]: currentFile + */ +QList TransferModel::synchronizeItems(const QList& returnActions) +{ + loop_size=returnActions.size(); + index_for_loop=0; + quint64 totalFile=0,totalSize=0,currentFile=0; + totalFile=0; + totalSize=0; + currentFile=0; + + emit layoutAboutToBeChanged(); + const QModelIndexList oldIndexes = persistentIndexList(); + QModelIndexList newIndexes = oldIndexes; + QMap oldMapping; // model index row in model before update, item id + QMap newMapping; // item id, model index row in model after update + + for ( int i = 0; i < oldIndexes.count(); i++ ) { + const QModelIndex& index = oldIndexes.at(i); + oldMapping[ index.row() ] = index.data( Qt::UserRole ).value(); + } + + while(index_for_loopsizeToString(action.addAction.size); + newItem.destination=action.addAction.destinationFullPath; + transfertItemList<(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.position==action.userAction.moveAt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, move at same position: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.move(action.userAction.position,action.userAction.moveAt); + //newIndexes.move(action.userAction.position,action.userAction.moveAt); + } + break; + case Ultracopier::RemoveItem: + { + if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) + currentIndexSearch--; + if(action.userAction.position<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.position>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.removeAt(action.userAction.position); + currentFile++; + startId.remove(action.addAction.id); + stopId.remove(action.addAction.id); + internalRunningOperation.remove(action.addAction.id); + //newIndexes.remove(action.userAction.moveAt); + } + break; + case Ultracopier::PreOperation: + { + ItemOfCopyListWithMoreInformations tempItem; + tempItem.currentReadProgression=0; + tempItem.currentWriteProgression=0; + tempItem.generalData=action.addAction; + tempItem.actionType=action.type; + internalRunningOperation[action.addAction.id]=tempItem; + } + break; + case Ultracopier::Transfer: + { + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + stopId.remove(action.addAction.id); + if(internalRunningOperation.contains(action.addAction.id)) + internalRunningOperation[action.addAction.id].actionType=action.type; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + } + break; + case Ultracopier::PostOperation: + { + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + startId.remove(action.addAction.id); + } + break; + case Ultracopier::CustomOperation: + { + bool custom_with_progression=(action.addAction.size==1); + //without progression + if(custom_with_progression) + { + if(startId.remove(action.addAction.id)) + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + } + //with progression + else + { + stopId.remove(action.addAction.id); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + } + if(internalRunningOperation.contains(action.addAction.id)) + { + ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; + item.actionType=action.type; + item.custom_with_progression=custom_with_progression; + item.currentReadProgression=0; + item.currentWriteProgression=0; + } + } + break; + default: + //unknow code, ignore it + break; + } + index_for_loop++; + } + + if(!oldIndexes.isEmpty()) + { + const QSet ids = oldMapping.values().toSet(); + + for ( int i = 0; i < transfertItemList.count(); i++ ) { + const TransferModel::TransfertItem& item = transfertItemList.at(i); + + if ( ids.contains( item.id ) ) { + newMapping[ item.id ] = i; + } + } + + for ( int i = 0; i < oldIndexes.count(); i++ ) { + const QModelIndex& index = oldIndexes.at(i); + const int newRow = newMapping.value( oldMapping.value(index.row()), -1 ); + newIndexes[ i ] = newRow == -1 ? QModelIndex() : QAbstractTableModel::index( newRow, index.column(), index.parent() ); + } + } + + changePersistentIndexList( oldIndexes, newIndexes ); + emit layoutChanged(); + return QList() << totalFile << totalSize << currentFile; +} + +void TransferModel::setFacilityEngine(FacilityInterface *facilityEngine) +{ + this->facilityEngine=facilityEngine; +} + +int TransferModel::search(const QString &text,bool searchNext) +{ + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.isEmpty()) + return -1; + if(searchNext) + { + currentIndexSearch++; + if(currentIndexSearch>=loop_size) + currentIndexSearch=0; + } + index_for_loop=0; + loop_size=transfertItemList.size(); + while(index_for_loop=loop_size) + currentIndexSearch=0; + index_for_loop++; + } + haveSearchItem=false; + return -1; +} + +int TransferModel::searchPrev(const QString &text) +{ + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.isEmpty()) + return -1; + if(currentIndexSearch==0) + currentIndexSearch=loop_size-1; + else + currentIndexSearch--; + index_for_loop=0; + loop_size=transfertItemList.size(); + while(index_for_loop &progressionList) +{ + loop_size=progressionList.size(); + index_for_loop=0; + while(index_for_loop0) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("progression remaning items")); + #endif +} + +TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() const +{ + currentTransfertItem returnItem; + returnItem.progressBar_read=-1; + returnItem.progressBar_write=0; + returnItem.haveItem=startId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*startId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation.value(*startId.constBegin()); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+QStringLiteral(", ")+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + //should never pass here + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + else + { + returnItem.haveItem=stopId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*stopId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation.value(*stopId.constBegin()); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+QStringLiteral(", ")+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + } + if(returnItem.haveItem && returnItem.progressBar_read!=-1 && returnItem.progressBar_write>returnItem.progressBar_read) + { + int tempVar=returnItem.progressBar_write; + returnItem.progressBar_write=returnItem.progressBar_read; + returnItem.progressBar_read=tempVar; + } + return returnItem; +} diff --git a/plugins-alternative/Themes/Supercopier/TransferModel.h b/plugins-alternative/Themes/Supercopier/TransferModel.h new file mode 100644 index 0000000..dd8b45a --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/TransferModel.h @@ -0,0 +1,96 @@ +#ifndef TRANSFERMODEL_H +#define TRANSFERMODEL_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "StructEnumDefinition.h" +#include "Environment.h" + +#include "../../../interface/FacilityInterface.h" + +/// \brief model to store the transfer list +class TransferModel : public QAbstractTableModel +{ + Q_OBJECT +public: + /// \brief the transfer item displayed + struct TransfertItem + { + quint64 id; + QString source; + QString size; + QString destination; + }; + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentReadProgression,currentWriteProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_read,progressBar_write; + }; + + TransferModel(); + + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + + QList synchronizeItems(const QList& returnActions); + void setFacilityEngine(FacilityInterface * facilityEngine); + + int search(const QString &text,bool searchNext); + int searchPrev(const QString &text); + + void setFileProgression( + #ifndef ULTRACOPIER_PLUGIN_DEBUG + const + #endif + QList &progressionList); + + currentTransfertItem getCurrentTransfertItem() const; + + quint64 firstId() const; +protected: + QList transfertItemList;///< To have a transfer list for the user + QSet startId,stopId;///< To show what is started, what is stopped + QHash internalRunningOperation;///< to have progression and stat +private: + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + int row,column; + FacilityInterface * facilityEngine; + QString search_text; + /// \brief index from start the search, decresed by remove before it + int currentIndexSearch; + bool haveSearchItem; + quint64 searchId; + static QIcon *start; + static QIcon *stop; +signals: + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,QString fonction,QString text,QString file,int ligne) const; + #endif +}; + +#endif // TRANSFERMODEL_H diff --git a/plugins-alternative/Themes/Supercopier/Variable.h b/plugins-alternative/Themes/Supercopier/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/Variable.h @@ -0,0 +1,15 @@ +/** \file Variable.h +\brief Define the environment variable +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef VARIABLE_H +#define VARIABLE_H + +//Un-comment this next line to put ultracopier plugin in debug mode +#define ULTRACOPIER_PLUGIN_DEBUG + +#endif // VARIABLE_H + + + diff --git a/plugins-alternative/Themes/Supercopier/documentation.dox b/plugins-alternative/Themes/Supercopier/documentation.dox new file mode 100644 index 0000000..9357109 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/documentation.dox @@ -0,0 +1,33 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage Oxygen + + \section mainpage_overview Overview + + It's interface like Supercopier, see Tal Sella http://www.virtualplastic.net/scrow/ (icons) for the icons and icon license.\n + More informations on the wiki of ultracopier. + + \section mainpage_platforms Platforms + + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. + + \section mainpage_downloads Downloads + + You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... + + \section license GPL Version 3 + The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4.\n + See Tal Sella http://www.virtualplastic.net/scrow/ (icons) for the icons and icon license.\n + resources/export-transfer-list.png and resources/import-transfer-list.png done by png manipulation of KDE's oxygen icon pack (16x16/actions/format-indent-more.png + 16x16/actions/format-list-unordered.png), document-save.png -> all SystemTrayIcon/systray_* (color alteration).\n + From 16x16/actions/: list-add.png -> add.png and SystemTrayIcon/add.png, process-stop.png -> remove.png, document-save.png -> main.png and, arrow-down.png -> moveDown.png, arrow-up.png -> moveUp.png, system-shutdown.png -> cancel.png and SystemTrayIcon/exit.png, arrow-down-double.png -> putOnBottom.png, arrow-up-double.png -> putOnTop.png, media-skip-forward.png -> player_end.png, media-playback-pause.png -> player_pause.png, media-playback-start.png -> player_play.png, document-preview.png -> search.png, help-about.png -> SystemTrayIcon/informations.png \n + And 16x16/categories/applications-development.png -> SystemTrayIcon/options.png + +*/ + diff --git a/plugins-alternative/Themes/Supercopier/factory.cpp b/plugins-alternative/Themes/Supercopier/factory.cpp new file mode 100644 index 0000000..ce3fe15 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/factory.cpp @@ -0,0 +1,441 @@ +/** \file factory.cpp +\brief Define the factory core +\author alpha_one_x86 +*/ + +#include + +#include "factory.h" + +ThemesFactory::ThemesFactory() +{ + optionsEngine=NULL; + tempWidget=new QWidget(); + ui=new Ui::themesOptions(); + ui->setupUi(tempWidget); + ui->toolBox->setCurrentIndex(0); + currentSpeed = 0; + updateSpeed(); + ui->labelDualProgression->hide(); + ui->showDualProgression->hide(); + + qRegisterMetaType >("QList"); +} + +ThemesFactory::~ThemesFactory() +{ +} + +PluginInterface_Themes * ThemesFactory::getInstance() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, currentSpeed: %1").arg(currentSpeed)); + + Themes * newInterface=new Themes( + ui->alwaysOnTop->isChecked(), + ui->showProgressionInTheTitle->isChecked(), + progressColorWrite,progressColorRead,progressColorRemaining, + ui->showDualProgression->isChecked(), + ui->comboBox_copyEnd->currentIndex(), + ui->speedWithProgressBar->isChecked(), + currentSpeed, + ui->checkBoxShowSpeed->isChecked(), + facilityEngine, + ui->checkBoxStartWithMoreButtonPushed->isChecked(), + ui->minimizeToSystray->isChecked() + ); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(newInterface,&Themes::debugInformation,this,&PluginInterface_ThemesFactory::debugInformation); + #endif + connect(this,&ThemesFactory::reloadLanguage,newInterface,&Themes::newLanguageLoaded); + return newInterface; +} + +void ThemesFactory::setResources(OptionInterface * optionsEngine,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + writePath + #endif + ,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + pluginPath + #endif + ,FacilityInterface * facilityEngine,const bool &) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); + this->facilityEngine=facilityEngine; + if(optionsEngine!=NULL) + { + this->optionsEngine=optionsEngine; + //load the options + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("checkBoxShowSpeed"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("moreButtonPushed"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("speedWithProgressBar"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("currentSpeed"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("comboBox_copyEnd"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("showDualProgression"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("showProgressionInTheTitle"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("progressColorWrite"),QVariant(QApplication::palette().color(QPalette::Highlight)))); + KeysList.append(qMakePair(QStringLiteral("progressColorRead"),QVariant(QApplication::palette().color(QPalette::AlternateBase)))); + KeysList.append(qMakePair(QStringLiteral("progressColorRemaining"),QVariant(QApplication::palette().color(QPalette::Base)))); + KeysList.append(qMakePair(QStringLiteral("alwaysOnTop"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("minimizeToSystray"),QVariant(false))); + optionsEngine->addOptionGroup(KeysList); + connect(optionsEngine,&OptionInterface::resetOptions,this,&ThemesFactory::resetOptions); + updateSpeed(); + } + #ifndef __GNUC__ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__GNUC__ is not set"); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__GNUC__ is set"); + #endif +} + +QWidget * ThemesFactory::options() +{ + if(optionsEngine!=NULL) + { + bool ok; + currentSpeed=optionsEngine->getOptionValue("currentSpeed").toUInt(&ok); + if(!ok) + currentSpeed=0; + ui->comboBox_copyEnd->setCurrentIndex(optionsEngine->getOptionValue(QStringLiteral("comboBox_copyEnd")).toUInt()); + ui->speedWithProgressBar->setChecked(optionsEngine->getOptionValue(QStringLiteral("speedWithProgressBar")).toBool()); + ui->checkBoxShowSpeed->setChecked(optionsEngine->getOptionValue(QStringLiteral("checkBoxShowSpeed")).toBool()); + ui->checkBoxStartWithMoreButtonPushed->setChecked(optionsEngine->getOptionValue(QStringLiteral("moreButtonPushed")).toBool()); + ui->showDualProgression->setChecked(optionsEngine->getOptionValue(QStringLiteral("showDualProgression")).toBool()); + ui->showProgressionInTheTitle->setChecked(optionsEngine->getOptionValue(QStringLiteral("showProgressionInTheTitle")).toBool()); + ui->alwaysOnTop->setChecked(optionsEngine->getOptionValue(QStringLiteral("alwaysOnTop")).toBool()); + ui->minimizeToSystray->setChecked(optionsEngine->getOptionValue(QStringLiteral("minimizeToSystray")).toBool()); + + progressColorWrite=optionsEngine->getOptionValue(QStringLiteral("progressColorWrite")).value(); + progressColorRead=optionsEngine->getOptionValue(QStringLiteral("progressColorRead")).value(); + progressColorRemaining=optionsEngine->getOptionValue(QStringLiteral("progressColorRemaining")).value(); + + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + ui->progressColorWrite->setIcon(pixmap); + pixmap.fill(progressColorRead); + ui->progressColorRead->setIcon(pixmap); + pixmap.fill(progressColorRemaining); + ui->progressColorRemaining->setIcon(pixmap); + updateSpeed(); + updateProgressionColorBar(); + + connect(ui->alwaysOnTop,&QCheckBox::stateChanged,this,&ThemesFactory::alwaysOnTop); + connect(ui->checkBoxShowSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::checkBoxShowSpeed); + connect(ui->minimizeToSystray,&QCheckBox::stateChanged,this,&ThemesFactory::minimizeToSystray); + connect(ui->checkBox_limitSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::uiUpdateSpeed); + connect(ui->SliderSpeed,&QAbstractSlider::valueChanged,this,&ThemesFactory::on_SliderSpeed_valueChanged); + connect(ui->limitSpeed,static_cast(&QSpinBox::valueChanged), this, &ThemesFactory::uiUpdateSpeed); + connect(ui->checkBoxShowSpeed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxShowSpeedHaveChanged); + connect(ui->checkBoxStartWithMoreButtonPushed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxStartWithMoreButtonPushedHaveChanged); + connect(ui->speedWithProgressBar,&QAbstractButton::toggled,this,&ThemesFactory::speedWithProgressBar); + connect(ui->comboBox_copyEnd, static_cast(&QComboBox::currentIndexChanged), this,&ThemesFactory::comboBox_copyEnd); + connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::showDualProgression); + connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::updateProgressionColorBar); + connect(ui->showProgressionInTheTitle,&QCheckBox::stateChanged,this,&ThemesFactory::setShowProgressionInTheTitle); + connect(ui->progressColorWrite,&QAbstractButton::clicked,this,&ThemesFactory::progressColorWrite_clicked); + connect(ui->progressColorRead, &QAbstractButton::clicked,this,&ThemesFactory::progressColorRead_clicked); + connect(ui->progressColorRemaining,&QAbstractButton::clicked,this,&ThemesFactory::progressColorRemaining_clicked); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"return the options"); + return tempWidget; +} + +QIcon ThemesFactory::getIcon(const QString &fileName) const +{ + return QIcon(QStringLiteral(":/Themes/Supercopier/resources/")+fileName); +} + +void ThemesFactory::resetOptions() +{ + ui->checkBoxShowSpeed->setChecked(true); + ui->checkBoxStartWithMoreButtonPushed->setChecked(false); +} + +void ThemesFactory::checkBoxShowSpeedHaveChanged(bool toggled) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("checkBoxShowSpeed"),toggled); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("moreButtonPushed"),toggled); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::comboBox_copyEnd(int value) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("comboBox_copyEnd"),value); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::speedWithProgressBar(bool toggled) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("speedWithProgressBar"),toggled); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::newLanguageLoaded() +{ + ui->retranslateUi(tempWidget); + ui->comboBox_copyEnd->setItemText(0,tr("Don't close if errors are found")); + ui->comboBox_copyEnd->setItemText(1,tr("Never close")); + ui->comboBox_copyEnd->setItemText(2,tr("Always close")); + emit reloadLanguage(); +} + +void ThemesFactory::checkBoxShowSpeed(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(checked); + updateSpeed(); +} + +void ThemesFactory::minimizeToSystray(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("minimizeToSystray"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::alwaysOnTop(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("alwaysOnTop"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::showDualProgression(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("showDualProgression"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::on_SliderSpeed_valueChanged(int value) +{ + if(optionsEngine==NULL) + return; + if(!ui->checkBoxShowSpeed->isChecked()) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("value: %1").arg(value)); + switch(value) + { + case 0: + currentSpeed=0; + break; + case 1: + currentSpeed=1024; + break; + case 2: + currentSpeed=1024*4; + break; + case 3: + currentSpeed=1024*16; + break; + case 4: + currentSpeed=1024*64; + break; + case 5: + currentSpeed=1024*128; + break; + } + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + updateSpeed(); +} + +void ThemesFactory::uiUpdateSpeed() +{ + if(optionsEngine==NULL) + return; + if(ui->checkBoxShowSpeed->isChecked()) + return; + if(!ui->checkBox_limitSpeed->isChecked()) + currentSpeed=0; + else + currentSpeed=ui->limitSpeed->value(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("emit newSpeedLimitation(%1)").arg(currentSpeed)); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::updateSpeed() +{ + if(optionsEngine==NULL) + return; + ui->label_Slider_speed->setVisible(ui->checkBoxShowSpeed->isChecked()); + ui->SliderSpeed->setVisible(ui->checkBoxShowSpeed->isChecked()); + ui->label_SpeedMaxValue->setVisible(ui->checkBoxShowSpeed->isChecked()); + ui->limitSpeed->setVisible(!ui->checkBoxShowSpeed->isChecked()); + ui->checkBox_limitSpeed->setVisible(!ui->checkBoxShowSpeed->isChecked()); + + if(ui->checkBoxShowSpeed->isChecked()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("checked, currentSpeed: %1").arg(currentSpeed)); + ui->limitSpeed->setEnabled(false); + if(currentSpeed==0) + { + ui->SliderSpeed->setValue(0); + ui->label_SpeedMaxValue->setText(facilityEngine->translateText("Unlimited")); + } + else if(currentSpeed<=1024) + { + if(currentSpeed!=1024) + { + currentSpeed=1024; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(1); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*1)); + } + else if(currentSpeed<=1024*4) + { + if(currentSpeed!=1024*4) + { + currentSpeed=1024*4; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(2); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*4)); + } + else if(currentSpeed<=1024*16) + { + if(currentSpeed!=1024*16) + { + currentSpeed=1024*16; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(3); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*16)); + } + else if(currentSpeed<=1024*64) + { + if(currentSpeed!=1024*64) + { + currentSpeed=1024*64; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(4); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*64)); + } + else + { + if(currentSpeed!=1024*128) + { + currentSpeed=1024*128; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(5); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*128)); + } + } + else + { + ui->checkBox_limitSpeed->setChecked(currentSpeed>0); + if(currentSpeed>0) + ui->limitSpeed->setValue(currentSpeed); + ui->checkBox_limitSpeed->setEnabled(currentSpeed!=-1); + ui->limitSpeed->setEnabled(ui->checkBox_limitSpeed->isChecked()); + } +} + +void ThemesFactory::progressColorWrite_clicked() +{ + QColor color=QColorDialog::getColor(progressColorWrite,NULL,tr("Select a color")); + if(!color.isValid()) + return; + progressColorWrite=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + ui->progressColorWrite->setIcon(pixmap); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("progressColorWrite"),progressColorWrite); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::progressColorRead_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRead,NULL,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRead=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRead); + ui->progressColorRead->setIcon(pixmap); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("progressColorRead"),progressColorRead); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::progressColorRemaining_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRemaining,NULL,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRemaining=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRemaining); + ui->progressColorRemaining->setIcon(pixmap); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("progressColorRemaining"),progressColorRemaining); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::updateProgressionColorBar() +{ + ui->labelProgressionColor->setVisible(ui->showDualProgression->isChecked()); + ui->frameProgressionColor->setVisible(ui->showDualProgression->isChecked()); +} + +void ThemesFactory::setShowProgressionInTheTitle() +{ + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("showProgressionInTheTitle"),ui->showProgressionInTheTitle->isChecked()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} diff --git a/plugins-alternative/Themes/Supercopier/factory.h b/plugins-alternative/Themes/Supercopier/factory.h new file mode 100644 index 0000000..11607d2 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/factory.h @@ -0,0 +1,83 @@ +/** \file factory.h +\brief Define the factory, to create instance of the interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FACTORY_H +#define FACTORY_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_Themes.h" +#include "ui_themesOptions.h" +#include "interface.h" +#include "Environment.h" + +namespace Ui { + class themesOptions; +} + +/// \brief Define the factory, to create instance of the interface +class ThemesFactory : public PluginInterface_ThemesFactory +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_ThemesFactory) +public: + ThemesFactory(); + ~ThemesFactory(); + /// \brief to return the instance of the copy engine + PluginInterface_Themes * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * optionsEngine,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + writePath + #endif + ,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + pluginPath + #endif + ,FacilityInterface * facilityEngine,const bool &portableVersion); + /// \brief to get the default options widget + QWidget * options(); + /// \brief to get a resource icon + QIcon getIcon(const QString &fileName) const; +private slots: + void checkBoxShowSpeedHaveChanged(bool toggled); + void checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled); + void comboBox_copyEnd(int value); + void speedWithProgressBar(bool toggled); + void checkBoxShowSpeed(bool checked); + void minimizeToSystray(bool checked); + void alwaysOnTop(bool checked); + void showDualProgression(bool checked); + void on_SliderSpeed_valueChanged(int value); + void uiUpdateSpeed(); + void updateSpeed(); + void progressColorWrite_clicked(); + void progressColorRead_clicked(); + void progressColorRemaining_clicked(); + void updateProgressionColorBar(); + void setShowProgressionInTheTitle(); +public slots: + void resetOptions(); + void newLanguageLoaded(); +private: + OptionInterface * optionsEngine; + Ui::themesOptions *ui; + QWidget *tempWidget; + FacilityInterface * facilityEngine; + qint32 currentSpeed;///< in KB/s, assume as 0KB/s as default like every where + QColor progressColorWrite,progressColorRead,progressColorRemaining; +signals: + void reloadLanguage() const; +}; + +#endif // FACTORY_H diff --git a/plugins-alternative/Themes/Supercopier/informations.xml b/plugins-alternative/Themes/Supercopier/informations.xml new file mode 100644 index 0000000..25a77f9 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Supercopier style for Ultracopier]]> + <![CDATA[Style Supercopier pour Ultracopier]]> + + Themes + + + + + + + 1287496800 + + windows-x86 + + + + + 1.2.3.6 + + Supercopier + + + \ No newline at end of file diff --git a/plugins-alternative/Themes/Supercopier/interface.cpp b/plugins-alternative/Themes/Supercopier/interface.cpp new file mode 100644 index 0000000..7af05e8 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interface.cpp @@ -0,0 +1,1332 @@ +/** \file interface.cpp +\brief Define the interface core +\author alpha_one_x86 +*/ + +#include +#include +#include +#include +#include +#include +#include +#ifdef Q_OS_WIN + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif + +#include "interface.h" +#include "ui_interface.h" +#include "factory.h" + +// The cmath header from MSVC does not contain round() +#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER) +inline double round(double d) { + return floor( d + 0.5 ); +} +#endif + +QIcon Themes::player_pause=QIcon(QStringLiteral(":/Themes/Supercopier/resources/player_pause.png")); +QIcon Themes::player_play=QIcon(QStringLiteral(":/Themes/Supercopier/resources/player_play.png")); + +Themes::Themes(const bool &alwaysOnTop, + const bool &showProgressionInTheTitle, + const QColor &progressColorWrite, + const QColor &progressColorRead, + const QColor &progressColorRemaining, + const bool &showDualProgression, + const quint8 &comboBox_copyEnd, + const bool &speedWithProgressBar, + const qint32 ¤tSpeed, + const bool &checkBoxShowSpeed, + FacilityInterface * facilityEngine, + const bool &moreButtonPushed, + const bool &minimizeToSystray) : + ui(new Ui::interfaceCopy()), + uiOptions(new Ui::themesOptions()) +{ + this->facilityEngine=facilityEngine; + ui->setupUi(this); + uiOptions->setupUi(ui->optionsTab); + + currentFile = 0; + totalFile = 0; + currentSize = 0; + totalSize = 0; + getOldProgression = 200; + haveError = false; + stat = status_never_started; + modeIsForced = false; + haveStarted = false; + storeIsInPause = false; + durationStarted = false; + + this->progressColorWrite = progressColorWrite; + this->progressColorRead = progressColorRead; + this->progressColorRemaining= progressColorRemaining; + this->currentSpeed = currentSpeed; + uiOptions->showProgressionInTheTitle->setChecked(showProgressionInTheTitle); + uiOptions->speedWithProgressBar->setChecked(speedWithProgressBar); + uiOptions->showDualProgression->setChecked(showDualProgression); + uiOptions->alwaysOnTop->setChecked(alwaysOnTop); + uiOptions->minimizeToSystray->setChecked(minimizeToSystray); + //uiOptions->setupUi(ui->tabWidget->widget(ui->tabWidget->count()-1)); + uiOptions->labelStartWithMoreButtonPushed->setVisible(false); + uiOptions->checkBoxStartWithMoreButtonPushed->setVisible(false); + uiOptions->label_Slider_speed->setVisible(false); + uiOptions->SliderSpeed->setVisible(false); + uiOptions->label_SpeedMaxValue->setVisible(false); + uiOptions->comboBox_copyEnd->setCurrentIndex(comboBox_copyEnd); + speedWithProgressBar_toggled(speedWithProgressBar); + showDualProgression_toggled(showDualProgression); + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + uiOptions->progressColorWrite->setIcon(pixmap); + pixmap.fill(progressColorRead); + uiOptions->progressColorRead->setIcon(pixmap); + pixmap.fill(progressColorRemaining); + uiOptions->progressColorRemaining->setIcon(pixmap); + + transferModel.setFacilityEngine(facilityEngine); + ui->TransferList->setModel(&transferModel); + ui->tabWidget->setCurrentIndex(0); + uiOptions->toolBox->setCurrentIndex(0); + uiOptions->checkBoxShowSpeed->setChecked(checkBoxShowSpeed); + menu=new QMenu(this); + ui->add->setMenu(menu); + + #ifdef Q_OS_WIN32 + pixmapTop=QPixmap(":/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Windows.png"); + pixmapBottom=QPixmap(":/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Windows.png"); + #else + pixmapTop=QPixmap(":/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Unix.png"); + pixmapBottom=QPixmap(":/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Unix.png"); + #endif + + //connect the options + checkBoxShowSpeed_toggled(uiOptions->checkBoxShowSpeed->isChecked()); + connect(uiOptions->checkBoxShowSpeed,&QCheckBox::stateChanged,this,&Themes::checkBoxShowSpeed_toggled); + connect(uiOptions->speedWithProgressBar,&QCheckBox::stateChanged,this,&Themes::speedWithProgressBar_toggled); + connect(uiOptions->showProgressionInTheTitle,&QCheckBox::stateChanged,this,&Themes::updateTitle); + connect(uiOptions->showDualProgression,&QCheckBox::stateChanged,this,&Themes::showDualProgression_toggled); + connect(uiOptions->progressColorWrite,&QAbstractButton::clicked,this,&Themes::progressColorWrite_clicked); + connect(uiOptions->progressColorRead, &QAbstractButton::clicked,this,&Themes::progressColorRead_clicked); + connect(uiOptions->progressColorRemaining,&QAbstractButton::clicked,this,&Themes::progressColorRemaining_clicked); + connect(uiOptions->alwaysOnTop,&QAbstractButton::clicked,this,&Themes::alwaysOnTop_clickedSlot); + + isInPause(false); + + connect(uiOptions->limitSpeed, static_cast(&QSpinBox::valueChanged), this, &Themes::uiUpdateSpeed); + connect(uiOptions->checkBox_limitSpeed,&QAbstractButton::toggled, this, &Themes::uiUpdateSpeed); + + connect(ui->actionAddFile,&QAction::triggered,this,&Themes::forcedModeAddFile); + connect(ui->actionAddFileToCopy,&QAction::triggered,this,&Themes::forcedModeAddFileToCopy); + connect(ui->actionAddFileToMove,&QAction::triggered,this,&Themes::forcedModeAddFileToMove); + connect(ui->actionAddFolderToCopy,&QAction::triggered,this,&Themes::forcedModeAddFolderToCopy); + connect(ui->actionAddFolderToMove,&QAction::triggered,this,&Themes::forcedModeAddFolderToMove); + connect(ui->actionAddFolder,&QAction::triggered,this,&Themes::forcedModeAddFolder); + connect(ui->exportErrorToTransferList,&QToolButton::triggered,this,&Themes::exportErrorIntoTransferList); + + //setup the search part + closeTheSearchBox(); + TimerForSearch = new QTimer(this); + TimerForSearch->setInterval(500); + TimerForSearch->setSingleShot(true); + searchShortcut = new QShortcut(QKeySequence(QKeySequence::Find),this); + searchShortcut2 = new QShortcut(QKeySequence(QKeySequence::FindNext),this); + searchShortcut3 = new QShortcut(QKeySequence(Qt::Key_Escape),this); + + //connect the search part + connect(TimerForSearch, &QTimer::timeout, this, &Themes::hilightTheSearchSlot); + connect(searchShortcut, &QShortcut::activated, this, &Themes::searchBoxShortcut); + connect(searchShortcut2, &QShortcut::activated, this, &Themes::on_pushButtonSearchNext_clicked); + connect(ui->pushButtonCloseSearch, &QPushButton::clicked, this, &Themes::closeTheSearchBox); + connect(searchShortcut3, &QShortcut::activated, this, &Themes::closeTheSearchBox); + + //reload directly untranslatable text + newLanguageLoaded(); + + //unpush the more button + ui->moreButton->setChecked(moreButtonPushed); + on_moreButton_toggled(moreButtonPushed); + + /// \note important for drag and drop, \see dropEvent() + setAcceptDrops(true); + + shutdown=facilityEngine->haveFunctionality(QStringLiteral("shutdown")); + ui->shutdown->setVisible(shutdown); + + selectionModel=ui->TransferList->selectionModel(); + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&transferModel,&TransferModel::debugInformation,this,&Themes::debugInformation); + #endif + + updateSpeed(); + alwaysOnTop_clicked(false); + /*#ifdef Q_OS_WIN32 + uiOptions->labelAlwaysOnTop->hide(); + uiOptions->alwaysOnTop->hide(); + #endif*/ + #ifdef ULTRACOPIER_VERSION_ULTIMATE + ui->ad_ultimate->hide(); + #else + QString ultimateUrl=facilityEngine->ultimateUrl(); + if(ultimateUrl.isEmpty()) + ui->ad_ultimate->hide(); + else + ui->ad_ultimate->setText(QStringLiteral("%2").arg(ultimateUrl).arg(tr("Buy the Ultimate version to fund development"))); + #endif + + uiOptions->labelDualProgression->hide(); + uiOptions->showDualProgression->hide(); + ui->progressBar_all->setMaximumHeight(17); + ui->progressBar_file->setMaximumHeight(17); + ui->progressBarCurrentSpeed->setMaximumHeight(17); + ui->progressBar_all->setMinimumHeight(17); + ui->progressBar_file->setMinimumHeight(17); + ui->progressBarCurrentSpeed->setMinimumHeight(17); + ui->progressBar_all->setStyleSheet(QStringLiteral("QProgressBar{color:#fff;font-weight:bold;border:1px solid black;text-align:center;background-image:url(:/Themes/Supercopier/resources/progressbarright.png);}QProgressBar::chunk{background-image: url(:/Themes/Supercopier/resources/progressbarleft.png);}")); + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{color:#fff;font-weight:bold;border:1px solid black;text-align:center;background-image:url(:/Themes/Supercopier/resources/progressbarright.png);}QProgressBar::chunk{background-image: url(:/Themes/Supercopier/resources/progressbarleft.png);}")); + ui->progressBarCurrentSpeed->setStyleSheet(QStringLiteral("QProgressBar{color:#fff;font-weight:bold;border:1px solid black;text-align:center;background-image:url(:/Themes/Supercopier/resources/progressbarright.png);}QProgressBar::chunk{background-image: url(:/Themes/Supercopier/resources/progressbarleft.png);}")); + + show(); + + sysTrayIcon = new QSystemTrayIcon(this); + connect(sysTrayIcon,&QSystemTrayIcon::activated,this,&Themes::catchAction); +} + +Themes::~Themes() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //disconnect(ui->actionAddFile); + //disconnect(ui->actionAddFolder); + delete selectionModel; + delete menu; + delete sysTrayIcon; +} + +QWidget * Themes::getOptionsEngineWidget() +{ + return &optionEngineWidget; +} + +void Themes::getOptionsEngineEnabled(const bool &isEnabled) +{ + if(isEnabled) + { + QScrollArea *scrollArea=new QScrollArea(ui->tabWidget); + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(&optionEngineWidget); + ui->tabWidget->addTab(scrollArea,facilityEngine->translateText(QStringLiteral("Copy engine"))); + } +} + +void Themes::closeEvent(QCloseEvent *event) +{ + event->ignore(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->hide(); + if(uiOptions->minimizeToSystray->isChecked()) + { + updateSysTrayIcon(); + sysTrayIcon->show(); + } + else + emit cancel(); +} + +void Themes::updateSysTrayIcon() +{ + if(totalSize==0) + { + sysTrayIcon->setIcon(dynaIcon(0,QStringLiteral("-"))); + return; + } + quint64 currentNew=currentSize*100; + //update systray icon + quint16 getVarProgression=currentNew/totalSize; + if(getOldProgression!=getVarProgression) + { + getOldProgression=getVarProgression; + sysTrayIcon->setIcon(dynaIcon(getVarProgression)); + } +} + +void Themes::updateOverallInformation() +{ + if(uiOptions->showProgressionInTheTitle->isChecked()) + updateTitle(); + ui->overall->setText(tr("File %1/%2, size: %3/%4").arg(currentFile).arg(totalFile).arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); +} + +void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("start: ")+QString::number(action)); + this->action=action; + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->progressBar_all->setMaximum(65535); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Listing: + ui->progressBar_all->setMaximum(0); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Idle: + ui->progressBar_all->setMaximum(65535); + ui->progressBar_all->setMinimum(0); + if(haveStarted && transferModel.rowCount()<=0) + { + if(shutdown && ui->shutdown->isChecked()) + { + facilityEngine->callFunctionality(QStringLiteral("shutdown")); + return; + } + switch(uiOptions->comboBox_copyEnd->currentIndex()) + { + case 2: + emit cancel(); + break; + case 0: + if(!haveError) + emit cancel(); + else + ui->tabWidget->setCurrentWidget(ui->tab_error); + break; + default: + break; + } + stat = status_stopped; + if(durationStarted) + { + Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(duration.elapsed()/1000); + ui->labelTimeRemaining->setText(QStringLiteral("")+facilityEngine->translateText(QStringLiteral("Completed in %1")).arg( + QString::number(time.hour)+QStringLiteral(":")+QString::number(time.minute).rightJustified(2,'0')+QStringLiteral(":")+QString::number(time.second).rightJustified(2,'0') + )+QStringLiteral("")); + } + } + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Very wrong switch case!"); + break; + } + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->pauseButton->setEnabled(true); + if(!durationStarted) + { + duration.start(); + durationStarted=true; + } + haveStarted=true; + ui->cancelButton->setText(facilityEngine->translateText(QStringLiteral("Quit"))); + updatePause(); + break; + case Ultracopier::Listing: + ui->pauseButton->setEnabled(false); + haveStarted=true;//to close if skip at root folder collision + break; + case Ultracopier::Idle: + ui->pauseButton->setEnabled(false); + break; + default: + break; + } +} + +void Themes::newFolderListing(const QString &path) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + QString newPath=path; + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + if(action==Ultracopier::Listing) + ui->from->setText(newPath); +} + +void Themes::detectedSpeed(const quint64 &speed)//in byte per seconds +{ + if(uiOptions->speedWithProgressBar->isChecked()) + { + quint64 tempSpeed=speed; + if(tempSpeed>999999999) + tempSpeed=999999999; + if(tempSpeed>(quint64)ui->progressBarCurrentSpeed->maximum()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set max speed to: %1").arg(tempSpeed)); + ui->progressBarCurrentSpeed->setMaximum(tempSpeed); + } + ui->progressBarCurrentSpeed->setValue(tempSpeed); + ui->progressBarCurrentSpeed->setFormat(facilityEngine->speedToString(speed)); + } + else + ui->currentSpeed->setText(facilityEngine->speedToString(speed)); +} + +void Themes::remainingTime(const int &remainingSeconds) +{ + QString labelTimeRemaining(QStringLiteral("")+facilityEngine->translateText(QStringLiteral("Time remaining:"))+QStringLiteral(" ")); + if(remainingSeconds==-1) + labelTimeRemaining+=QStringLiteral("∞"); + else + { + Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); + labelTimeRemaining+=QString::number(time.hour)+QStringLiteral(":")+QString::number(time.minute).rightJustified(2,'0')+QStringLiteral(":")+QString::number(time.second).rightJustified(2,'0'); + } + labelTimeRemaining+=QStringLiteral(""); + ui->labelTimeRemaining->setText(labelTimeRemaining); +} + +void Themes::errorDetected() +{ + haveError=true; +} + +/// \brief new error +void Themes::errorToRetry(const QString &source,const QString &destination,const QString &error) +{ + ui->errorList->addTopLevelItem(new QTreeWidgetItem(QStringList() << source << destination << error)); +} + +/** \brief support speed limitation */ +void Themes::setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) +{ + if(!supportSpeedLimitationBool) + { + ui->label_Slider_speed->setVisible(false); + ui->SliderSpeed->setVisible(false); + ui->label_SpeedMaxValue->setVisible(false); + uiOptions->labelShowSpeedAsMain->setVisible(false); + uiOptions->checkBoxShowSpeed->setVisible(false); + } + else + emit newSpeedLimitation(currentSpeed); +} + +//get information about the copy +void Themes::setGeneralProgression(const quint64 ¤t,const quint64 &total) +{ + currentSize=current; + totalSize=total; + if(total>0) + { + int newIndicator=((double)current/total)*65535; + ui->progressBar_all->setValue(newIndicator); + } + else + ui->progressBar_all->setValue(0); + if(current>0) + stat = status_started; + updateOverallInformation(); + if(isHidden()) + updateSysTrayIcon(); +} + +void Themes::setFileProgression(const QList &progressionList) +{ + QList progressionListBis=progressionList; + transferModel.setFileProgression(progressionListBis); + updateCurrentFileInformation(); +} + +//edit the transfer list +/// \todo check and re-enable to selection +void Themes::getActionOnList(const QList &returnActions) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, returnActions.size(): ")+QString::number(returnActions.size())); + QList returnValue=transferModel.synchronizeItems(returnActions); + totalFile+=returnValue.first(); + totalSize+=returnValue.at(1); + currentFile+=returnValue.last(); + if(transferModel.rowCount()==0) + { + ui->skipButton->setEnabled(false); + ui->progressBar_all->setValue(65535); + ui->progressBar_file->setValue(65535); + currentSize=totalSize; + if(isHidden()) + updateSysTrayIcon(); + } + else + ui->skipButton->setEnabled(true); + updateOverallInformation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("transferModel.rowCount(): ")+QString::number(transferModel.rowCount())); +} + +void Themes::setCopyType(const Ultracopier::CopyType &type) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->type=type; + updateModeAndType(); +} + +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + modeIsForced=true; + this->mode=mode; + if(mode==Ultracopier::Copy) + ui->tabWidget->setTabText(0,tr("Copy list")); + else + ui->tabWidget->setTabText(0,tr("Move list")); + updateModeAndType(); + updateTitle(); +} + +void Themes::setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) +{ + ui->exportTransferList->setVisible(transferListOperation & Ultracopier::TransferListOperation_Export); + ui->importTransferList->setVisible(transferListOperation & Ultracopier::TransferListOperation_Import); +} + +void Themes::haveExternalOrder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); +// ui->moreButton->toggle(); +} + +void Themes::isInPause(const bool &isInPause) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("isInPause: ")+QString::number(isInPause)); + //resume in auto the pause + storeIsInPause=isInPause; + updatePause(); +} + +void Themes::updatePause() +{ + if(storeIsInPause) + { + ui->pauseButton->setIcon(player_play); + if(stat == status_started) + ui->pauseButton->setText(facilityEngine->translateText(QStringLiteral("Resume"))); + else + ui->pauseButton->setText(facilityEngine->translateText(QStringLiteral("Start"))); + } + else + { + ui->pauseButton->setIcon(player_pause); + ui->pauseButton->setText(facilityEngine->translateText(QStringLiteral("Pause"))); + } +} + +void Themes::updateCurrentFileInformation() +{ + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + QString newPath=transfertItem.from; + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ui->from->setText(newPath); + newPath=transfertItem.to; + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ui->to->setText(newPath); + ui->current_file->setText(transfertItem.current_file); + if(transfertItem.progressBar_read!=-1) + { + ui->progressBar_file->setRange(0,65535); + if(uiOptions->showDualProgression->isChecked()) + { + if(transfertItem.progressBar_read!=transfertItem.progressBar_write) + { + float permilleread=round((float)transfertItem.progressBar_read/65535*1000)/1000; + float permillewrite=permilleread-0.001; + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border: 1px solid grey;text-align: center;background-color: qlineargradient(spread:pad, x1:%1, y1:0, x2:%2, y2:0, stop:0 %3, stop:1 %4);}QProgressBar::chunk{background-color:%5;}") + .arg(permilleread) + .arg(permillewrite) + .arg(progressColorRemaining.name()) + .arg(progressColorRead.name()) + .arg(progressColorWrite.name()) + ); + } + else + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setValue(transfertItem.progressBar_write); + } + else + ui->progressBar_file->setValue((transfertItem.progressBar_read+transfertItem.progressBar_write)/2); + } + else + ui->progressBar_file->setRange(0,0); + } + else + { + ui->from->setText(QStringLiteral("")); + ui->to->setText(QStringLiteral("")); + ui->current_file->setText(QStringLiteral("-")); + if(haveStarted && transferModel.rowCount()==0) + ui->progressBar_file->setValue(65535); + else if(!haveStarted) + ui->progressBar_file->setValue(0); + } +} + + +void Themes::on_putOnTop_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsOnTop(ids); +} + +void Themes::on_pushUp_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsUp(ids); +} + +void Themes::on_pushDown_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsDown(ids); +} + +void Themes::on_putOnBottom_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsOnBottom(ids); +} + +void Themes::on_del_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit removeItems(ids); +} + +void Themes::on_cancelButton_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->hide(); + emit cancel(); +} + + +void Themes::speedWithProgressBar_toggled(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ui->progressBarCurrentSpeed->setVisible(checked); + ui->currentSpeed->setVisible(!checked); +} + +void Themes::showDualProgression_toggled(bool checked) +{ + Q_UNUSED(checked); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + updateProgressionColorBar(); +} + +void Themes::checkBoxShowSpeed_toggled(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + Q_UNUSED(checked); + updateSpeed(); +} + +void Themes::on_SliderSpeed_valueChanged(int value) +{ + if(!uiOptions->checkBoxShowSpeed->isChecked()) + return; + switch(value) + { + case 0: + currentSpeed=0; + break; + case 1: + currentSpeed=1024; + break; + case 2: + currentSpeed=1024*4; + break; + case 3: + currentSpeed=1024*16; + break; + case 4: + currentSpeed=1024*64; + break; + case 5: + currentSpeed=1024*128; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("value: %1").arg(value)); + emit newSpeedLimitation(currentSpeed); + updateSpeed(); +} + +void Themes::uiUpdateSpeed() +{ + if(uiOptions->checkBoxShowSpeed->isChecked()) + return; + if(!uiOptions->checkBox_limitSpeed->isChecked()) + currentSpeed=0; + else + currentSpeed=uiOptions->limitSpeed->value(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("emit newSpeedLimitation(%1)").arg(currentSpeed)); + emit newSpeedLimitation(currentSpeed); +} + +void Themes::updateSpeed() +{ + ui->label_Slider_speed->setVisible(uiOptions->checkBoxShowSpeed->isChecked()); + ui->SliderSpeed->setVisible(uiOptions->checkBoxShowSpeed->isChecked()); + ui->label_SpeedMaxValue->setVisible(uiOptions->checkBoxShowSpeed->isChecked()); + uiOptions->limitSpeed->setVisible(!uiOptions->checkBoxShowSpeed->isChecked()); + uiOptions->checkBox_limitSpeed->setVisible(!uiOptions->checkBoxShowSpeed->isChecked()); + + if(uiOptions->checkBoxShowSpeed->isChecked()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("checked, currentSpeed: %1").arg(currentSpeed)); + uiOptions->limitSpeed->setEnabled(false); + if(currentSpeed==0) + { + ui->SliderSpeed->setValue(0); + ui->label_SpeedMaxValue->setText(facilityEngine->translateText(QStringLiteral("Unlimited"))); + } + else if(currentSpeed<=1024) + { + if(currentSpeed!=1024) + { + currentSpeed=1024; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(1); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*1)); + } + else if(currentSpeed<=1024*4) + { + if(currentSpeed!=1024*4) + { + currentSpeed=1024*4; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(2); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*4)); + } + else if(currentSpeed<=1024*16) + { + if(currentSpeed!=1024*16) + { + currentSpeed=1024*16; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(3); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*16)); + } + else if(currentSpeed<=1024*64) + { + if(currentSpeed!=1024*64) + { + currentSpeed=1024*64; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(4); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*64)); + } + else + { + if(currentSpeed!=1024*128) + { + currentSpeed=1024*128; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(5); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*128)); + } + } + else + { + uiOptions->checkBox_limitSpeed->setChecked(currentSpeed>0); + if(currentSpeed>0) + uiOptions->limitSpeed->setValue(currentSpeed); + uiOptions->checkBox_limitSpeed->setEnabled(currentSpeed!=-1); + uiOptions->limitSpeed->setEnabled(uiOptions->checkBox_limitSpeed->isChecked()); + } +} + +void Themes::on_pauseButton_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(storeIsInPause) + emit resume(); + else + emit pause(); +} + +void Themes::on_skipButton_clicked() +{ + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at running: %1").arg(transfertItem.id)); + emit skip(transfertItem.id); + } + else + { + if(transferModel.rowCount()>1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at idle: %1").arg(transferModel.firstId())); + emit skip(transferModel.firstId()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); + } +} + +void Themes::updateModeAndType() +{ + menu->clear(); + if(modeIsForced) + { + menu->addAction(ui->actionAddFile); + if(type==Ultracopier::FileAndFolder) + menu->addAction(ui->actionAddFolder); + } + else + { + menu->addAction(ui->actionAddFileToCopy); + menu->addAction(ui->actionAddFileToMove); + if(type==Ultracopier::FileAndFolder) + { + menu->addAction(ui->actionAddFolderToCopy); + menu->addAction(ui->actionAddFolderToMove); + } + } +} + +void Themes::forcedModeAddFile() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFile(mode); +} + +void Themes::forcedModeAddFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFolder(mode); +} + +void Themes::forcedModeAddFileToCopy() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFile(Ultracopier::Copy); +} + +void Themes::forcedModeAddFolderToCopy() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFolder(Ultracopier::Copy); +} + +void Themes::forcedModeAddFileToMove() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFile(Ultracopier::Move); +} + +void Themes::forcedModeAddFolderToMove() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFolder(Ultracopier::Move); +} + +void Themes::newLanguageLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(modeIsForced) + forceCopyMode(mode); + ui->retranslateUi(this); + uiOptions->retranslateUi(this); + uiOptions->comboBox_copyEnd->setItemText(0,tr("Don't close if errors are found")); + uiOptions->comboBox_copyEnd->setItemText(1,tr("Never close")); + uiOptions->comboBox_copyEnd->setItemText(2,tr("Always close")); + if(!haveStarted) + ui->current_file->setText(tr("File Name, 0KB")); + else + updateCurrentFileInformation(); + updateOverallInformation(); + updateSpeed(); + if(ui->tabWidget->count()>=4) + ui->tabWidget->setTabText(ui->tabWidget->count()-1,facilityEngine->translateText(QStringLiteral("Copy engine"))); + on_moreButton_toggled(ui->moreButton->isChecked()); +} + +void Themes::on_pushButtonCloseSearch_clicked() +{ + closeTheSearchBox(); +} + +//close the search box +void Themes::closeTheSearchBox() +{ + currentIndexSearch = -1; + ui->lineEditSearch->clear(); + ui->lineEditSearch->hide(); + ui->pushButtonSearchPrev->hide(); + ui->pushButtonSearchNext->hide(); + ui->pushButtonCloseSearch->hide(); + ui->searchButton->setChecked(false); + hilightTheSearch(); +} + +//search box shortcut +void Themes::searchBoxShortcut() +{ +/* if(ui->lineEditSearch->isHidden()) + {*/ + ui->lineEditSearch->show(); + ui->pushButtonSearchPrev->show(); + ui->pushButtonSearchNext->show(); + ui->pushButtonCloseSearch->show(); + ui->lineEditSearch->setFocus(Qt::ShortcutFocusReason); + ui->searchButton->setChecked(true); +/* } + else + closeTheSearchBox();*/ +} + +//hilight the search +void Themes::hilightTheSearch(bool searchNext) +{ + int result=transferModel.search(ui->lineEditSearch->text(),searchNext); + if(ui->lineEditSearch->text().isEmpty()) + ui->lineEditSearch->setStyleSheet(""); + else + { + if(result==-1) + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(255, 150, 150);")); + else + { + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(193,255,176);")); + ui->TransferList->scrollTo(transferModel.index(result,0)); + } + } +} + +void Themes::hilightTheSearchSlot() +{ + hilightTheSearch(); +} + +void Themes::on_pushButtonSearchPrev_clicked() +{ + int result=transferModel.searchPrev(ui->lineEditSearch->text()); + if(ui->lineEditSearch->text().isEmpty()) + ui->lineEditSearch->setStyleSheet(""); + else + { + if(result==-1) + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(255, 150, 150);")); + else + { + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(193,255,176);")); + ui->TransferList->scrollTo(transferModel.index(result,0)); + } + } +} + +void Themes::on_pushButtonSearchNext_clicked() +{ + hilightTheSearch(true); +} + +void Themes::on_lineEditSearch_returnPressed() +{ + hilightTheSearch(); +} + +void Themes::on_lineEditSearch_textChanged(QString text) +{ + if(text=="") + { + TimerForSearch->stop(); + hilightTheSearch(); + } + else + TimerForSearch->start(); +} + +void Themes::on_moreButton_toggled(bool checked) +{ + if(checked) + this->setMaximumHeight(16777215); + else + this->setMaximumHeight(130); + // usefull under windows + this->updateGeometry(); + this->update(); + this->adjustSize(); +} + +/* drag event processing + +need setAcceptDrops(true); into the constructor +need implementation to accept the drop: +void dragEnterEvent(QDragEnterEvent* event); +void dragMoveEvent(QDragMoveEvent* event); +void dragLeaveEvent(QDragLeaveEvent* event); +*/ +void Themes::dropEvent(QDropEvent *event) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("hasUrls")); + emit urlDropped(mimeData->urls()); + event->acceptProposedAction(); + } +} + +void Themes::dragEnterEvent(QDragEnterEvent* event) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + // if some actions should not be usable, like move, this code must be adopted + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("hasUrls")); + event->acceptProposedAction(); + } +} + +void Themes::dragMoveEvent(QDragMoveEvent* event) +{ + // if some actions should not be usable, like move, this code must be adopted + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + event->acceptProposedAction(); +} + +void Themes::dragLeaveEvent(QDragLeaveEvent* event) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + event->accept(); +} + +void Themes::on_searchButton_toggled(bool checked) +{ + if(checked) + searchBoxShortcut(); + else + closeTheSearchBox(); +} + +void Themes::on_exportTransferList_clicked() +{ + emit exportTransferList(); +} + +void Themes::on_importTransferList_clicked() +{ + emit importTransferList(); +} + +void Themes::progressColorWrite_clicked() +{ + QColor color=QColorDialog::getColor(progressColorWrite,this,tr("Select a color")); + if(!color.isValid()) + return; + progressColorWrite=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + uiOptions->progressColorWrite->setIcon(pixmap); + updateProgressionColorBar(); +} + +void Themes::progressColorRead_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRead,this,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRead=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRead); + uiOptions->progressColorRead->setIcon(pixmap); + updateProgressionColorBar(); +} + +void Themes::progressColorRemaining_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRemaining,this,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRemaining=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRemaining); + uiOptions->progressColorRemaining->setIcon(pixmap); + updateProgressionColorBar(); +} + +void Themes::alwaysOnTop_clicked(bool reshow) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_WIN32 + if(uiOptions->alwaysOnTop->isChecked()) + SetWindowPos((HWND)this->winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + else + SetWindowPos((HWND)this->winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + #endif + #ifdef Q_OS_LINUX + if(uiOptions->alwaysOnTop->isChecked()) + flags=flags | Qt::X11BypassWindowManagerHint; + else + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + if(uiOptions->alwaysOnTop->isChecked()) + flags=flags | Qt::WindowStaysOnTopHint; + else + flags=flags & ~Qt::WindowStaysOnTopHint; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"uiOptions->alwaysOnTop->isChecked(): "+QString::number(uiOptions->alwaysOnTop->isChecked())+", flags: "+QString::number(flags)); + setWindowFlags(flags); + if(reshow) + show(); +} + +void Themes::alwaysOnTop_clickedSlot() +{ + alwaysOnTop_clicked(true); +} + +void Themes::updateProgressionColorBar() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + uiOptions->labelProgressionColor->setVisible(uiOptions->showDualProgression->isChecked()); + uiOptions->frameProgressionColor->setVisible(uiOptions->showDualProgression->isChecked()); + if(!uiOptions->showDualProgression->isChecked()) + { + /*ui->progressBar_all->setStyleSheet(""); + ui->progressBar_file->setStyleSheet(""); + ui->progressBarCurrentSpeed->setStyleSheet("");*/ + } + else + { + ui->progressBar_all->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBarCurrentSpeed->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + } + if(stat==status_never_started) + updateCurrentFileInformation(); +} + +void Themes::updateTitle() +{ + if(uiOptions->showProgressionInTheTitle->isChecked() && totalSize>0) + { + if(!modeIsForced) + this->setWindowTitle(tr("%1 %2% of %3").arg(facilityEngine->translateText("Transfer")).arg((currentSize*100)/totalSize).arg(facilityEngine->sizeToString(totalSize))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + { + if(mode==Ultracopier::Copy) + this->setWindowTitle(tr("%1 %2% of %3").arg(facilityEngine->translateText("Copy")).arg((currentSize*100)/totalSize).arg(facilityEngine->sizeToString(totalSize))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + this->setWindowTitle(tr("%1 %2% of %3").arg(facilityEngine->translateText("Move")).arg((currentSize*100)/totalSize).arg(facilityEngine->sizeToString(totalSize))+QStringLiteral(" - ")+facilityEngine->softwareName()); + } + } + else + { + if(!modeIsForced) + this->setWindowTitle(QStringLiteral("%1").arg(facilityEngine->translateText("Transfer"))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + { + if(mode==Ultracopier::Copy) + this->setWindowTitle(QStringLiteral("%1").arg(facilityEngine->translateText("Copy"))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + this->setWindowTitle(QStringLiteral("%1").arg(facilityEngine->translateText("Move"))+QStringLiteral(" - ")+facilityEngine->softwareName()); + } + } +} + +/** \brief Create progessive icon + +Do QIcon with top and bottom image mixed and percent writed on it. +The icon it be search in the style path. +Do by mongaulois, remake by alpha_one_x86. +\param percent indique how many percent need be showed, sould be between 0 and 100 +\param text The showed text if needed (optionnal) +\return QIcon of the final image +\note Can be used as it: dynaIcon(75,"...") +*/ +QIcon Themes::dynaIcon(int percent,QString text) const +{ + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(pixmapTop.isNull() || pixmapBottom.isNull()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error loading the icons"); + #endif + if(percent==-1) + percent=getOldProgression; + if(percent<0) + percent=0; + if(percent>100) + percent=100; + //pixmap avec un fond transparent + #ifdef Q_OS_WIN32 + quint8 imageSize=16; + #else + quint8 imageSize=22; + #endif + QPixmap resultImage(imageSize,imageSize); + resultImage.fill(Qt::transparent); + { + QPainter painter(&resultImage); + #ifndef Q_OS_WIN32 + QFont font(QStringLiteral("Courier New"),9); + font.setBold(true); + font.setKerning(true); + painter.setFont(font); + #endif + #ifdef Q_OS_WIN32 + QFont font(QStringLiteral("Courier New"),8); + font.setBold(true); + font.setKerning(true); + painter.setFont(font); + #endif + + //preprocessing the calcul + quint8 bottomPixel=(percent*imageSize)/100; + quint8 topPixel=imageSize-bottomPixel; + + //top image + if(topPixel>0) + { + QRect target(0, 0, imageSize, topPixel); + QRect source(0, 0, imageSize, topPixel); + painter.drawPixmap(target, pixmapTop, source); + } + + //bottom image + if(bottomPixel>0) + { + QRect target2(0, topPixel, imageSize, bottomPixel); + QRect source2(0, topPixel, imageSize, bottomPixel); + painter.drawPixmap(target2, pixmapBottom, source2); + } + + qint8 textxOffset=0; + qint8 textyOffset=0; + if(text.isEmpty()) + { + if(percent!=100) + text=QString::number(percent); + else + { + text=QStringLiteral(":)"); + #ifdef Q_OS_WIN32 + textyOffset-=2; + #else + textyOffset-=1; + #endif + } + } + if(text.size()==1) + { + textxOffset+=3; + #ifdef Q_OS_WIN32 + textxOffset-=1; + #endif + } + else + { + #ifdef Q_OS_WIN32 + textxOffset-=1; + #endif + } + #ifndef Q_OS_WIN32 + textxOffset+=2; + textyOffset+=3; + #endif + painter.setPen(QPen(Qt::black)); + painter.drawText(3+textxOffset,13+textyOffset,text); + painter.setPen(QPen(Qt::white)); + painter.drawText(2+textxOffset,12+textyOffset,text); + } + return QIcon(resultImage); +} + +/** \brief For catch an action on the systray icon +\param reason Why it activated +*/ +void Themes::catchAction(QSystemTrayIcon::ActivationReason reason) +{ + if(reason==QSystemTrayIcon::DoubleClick || reason==QSystemTrayIcon::Trigger) + { + sysTrayIcon->hide(); + this->show(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Double Click detected"); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("reason: %1").arg(reason)); +} + +void Themes::on_exportErrorToTransferList_clicked() +{ + emit exportErrorIntoTransferList(); +} diff --git a/plugins-alternative/Themes/Supercopier/interface.h b/plugins-alternative/Themes/Supercopier/interface.h new file mode 100644 index 0000000..6929f07 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interface.h @@ -0,0 +1,221 @@ +/** \file interface.h +\brief Define the interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef INTERFACE_H +#define INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_Themes.h" + +#include "ui_interface.h" +#include "ui_themesOptions.h" +#include "Environment.h" +#include "TransferModel.h" + +// for windows progress bar +#ifndef __GNUC__ +#include +#endif + +namespace Ui { + class interfaceCopy; + class themesOptions; +} + +/// \brief Define the interface +class Themes : public PluginInterface_Themes +{ + Q_OBJECT +public: + Themes(const bool &alwaysOnTop, + const bool &showProgressionInTheTitle, + const QColor &progressColorWrite, + const QColor &progressColorRead, + const QColor &progressColorRemaining, + const bool &showDualProgression, + const quint8 &comboBox_copyEnd, + const bool &speedWithProgressBar, + const qint32 ¤tSpeed, + const bool &checkBoxShowSpeed, + FacilityInterface * facilityEngine, + const bool &moreButtonPushed, + const bool &minimizeToSystray); + ~Themes(); + //send information about the copy + /// \brief to set the action in progress + void actionInProgess(const Ultracopier::EngineActionInProgress &); + /// \brief the new folder is listing + void newFolderListing(const QString &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const quint64 &speed); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const QString &action); + /// \brief set the current error action + void newErrorAction(const QString &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const QString &source,const QString &destination,const QString &error); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const quint64 ¤t,const quint64 &total); + /// \brief show the file progression + void setFileProgression(const QList &progressionList); + /// \brief set the copyType -> file or folder + void setCopyType(const Ultracopier::CopyType &); + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + void forceCopyMode(const Ultracopier::CopyMode &); + /// \brief set if transfer list is exportable/importable + void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation); + //edit the transfer list + /// \brief get action on the transfer list (add/move/remove) + void getActionOnList(const QList &returnActions); + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + void haveExternalOrder(); + /// \brief set if is in pause + void isInPause(const bool &); + /// \brief get the widget for the copy engine + QWidget * getOptionsEngineWidget(); + /// \brief to set if the copy engine is found + void getOptionsEngineEnabled(const bool &isEnabled); + enum status{status_never_started,status_started,status_stopped}; + status stat; +public slots: + /// \brief set the translate + void newLanguageLoaded(); +private slots: + void on_putOnTop_clicked(); + void on_pushUp_clicked(); + void on_pushDown_clicked(); + void on_putOnBottom_clicked(); + void on_del_clicked(); + void on_cancelButton_clicked(); + void speedWithProgressBar_toggled(bool checked); + void showDualProgression_toggled(bool checked); + void checkBoxShowSpeed_toggled(bool checked); + void on_SliderSpeed_valueChanged(int value); + void on_pauseButton_clicked(); + void on_skipButton_clicked(); + void forcedModeAddFile(); + void forcedModeAddFolder(); + void forcedModeAddFileToCopy(); + void forcedModeAddFolderToCopy(); + void forcedModeAddFileToMove(); + void forcedModeAddFolderToMove(); + void uiUpdateSpeed(); + void on_pushButtonCloseSearch_clicked(); + //close the search box + void closeTheSearchBox(); + //search box shortcut + void searchBoxShortcut(); + //hilight the search + void hilightTheSearch(bool searchNext=false); + void hilightTheSearchSlot(); + //auto connect + void on_pushButtonSearchPrev_clicked(); + void on_pushButtonSearchNext_clicked(); + void on_lineEditSearch_returnPressed(); + void on_lineEditSearch_textChanged(QString text); + void on_moreButton_toggled(bool checked); + void on_searchButton_toggled(bool checked); + void on_exportTransferList_clicked(); + void on_importTransferList_clicked(); + void progressColorWrite_clicked(); + void progressColorRead_clicked(); + void progressColorRemaining_clicked(); + void alwaysOnTop_clicked(bool reshow); + void alwaysOnTop_clickedSlot(); + void updateProgressionColorBar(); + void updateTitle(); + void catchAction(QSystemTrayIcon::ActivationReason reason); + void on_exportErrorToTransferList_clicked(); + +private: + QTime duration; + bool durationStarted; + QPixmap pixmapTop,pixmapBottom; + QColor progressColorWrite,progressColorRead,progressColorRemaining; + Ui::interfaceCopy *ui; + Ui::themesOptions *uiOptions; + quint64 currentFile; + quint64 totalFile; + quint64 currentSize; + quint64 totalSize; + quint8 getOldProgression; + QSystemTrayIcon *sysTrayIcon; + void updateOverallInformation(); + void updateCurrentFileInformation(); + QMenu *menu; + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + qint32 currentSpeed;///< in KB/s, assume as 0KB/s as default like every where + void updateSpeed(); + bool storeIsInPause; + bool modeIsForced; + Ultracopier::CopyType type; + Ultracopier::CopyMode mode; + void updateModeAndType(); + bool haveStarted; + bool haveError; + QWidget optionEngineWidget; + QShortcut *searchShortcut; + QShortcut *searchShortcut2; + QShortcut *searchShortcut3; + QTimer *TimerForSearch; + int currentIndexSearch; ///< Current index search in starting at the end + FacilityInterface * facilityEngine; + QItemSelectionModel *selectionModel; + QModelIndexList selectedItems; + /// \brief the custom transfer model + TransferModel transferModel; + + static QIcon player_play,player_pause; + + /** \brief drag event processing + + need setAcceptDrops(true); into the constructor + need implementation to accept the drop: + void dragEnterEvent(QDragEnterEvent* event); + void dragMoveEvent(QDragMoveEvent* event); + void dragLeaveEvent(QDragLeaveEvent* event); + */ + void dropEvent(QDropEvent *event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragEnterEvent(QDragEnterEvent* event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragMoveEvent(QDragMoveEvent* event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragLeaveEvent(QDragLeaveEvent* event); + //have functionality + bool shutdown; + void updatePause(); + QIcon dynaIcon(int percent,QString text="") const; + void updateSysTrayIcon(); +signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; +}; + +#endif // INTERFACE_H diff --git a/plugins-alternative/Themes/Supercopier/interface.pro b/plugins-alternative/Themes/Supercopier/interface.pro new file mode 100644 index 0000000..809a84c --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interface.pro @@ -0,0 +1,59 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets +TEMPLATE = lib +CONFIG += plugin +HEADERS = interface.h \ + StructEnumDefinition.h \ + factory.h \ + DebugEngineMacro.h \ + Environment.h \ + Variable.h \ + ../../../interface/PluginInterface_Themes.h \ + ../../../interface/FacilityInterface.h \ + ../../../interface/OptionInterface.h \ + TransferModel.h +SOURCES = interface.cpp \ + factory.cpp \ + TransferModel.cpp +TARGET = $$qtLibraryTarget(interface) +TRANSLATIONS += Languages/ar/translation.ts \ + Languages/de/translation.ts \ + Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ + Languages/it/translation.ts \ + Languages/ja/translation.ts \ + Languages/ko/translation.ts \ + Languages/nl/translation.ts \ + Languages/no/translation.ts \ + Languages/pl/translation.ts \ + Languages/pt/translation.ts \ + Languages/ru/translation.ts \ + Languages/th/translation.ts \ + Languages/tr/translation.ts \ + Languages/zh/translation.ts + +win32 { + RESOURCES += +} +!win32 { + RESOURCES += +} + +!CONFIG(static) { +RESOURCES += \ + interfaceResources.qrc \ + interfaceResources_unix.qrc \ + interfaceResources_windows.qrc +} + +FORMS += \ + interface.ui \ + themesOptions.ui diff --git a/plugins-alternative/Themes/Supercopier/interface.ui b/plugins-alternative/Themes/Supercopier/interface.ui new file mode 100644 index 0000000..e5b84a5 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interface.ui @@ -0,0 +1,845 @@ + + + interfaceCopy + + + + 0 + 0 + 508 + 448 + + + + Supercopier + + + + :/Themes/Supercopier/resources/main.png:/Themes/Supercopier/resources/main.png + + + + 2 + + + 1 + + + + + 2 + + + + + From: + + + + + + + + 0 + 0 + + + + + + + Qt::PlainText + + + + + + + true + + + + + + + + + 5 + + + + + To: + + + + + + + + 0 + 0 + + + + + + + Qt::PlainText + + + + + + + + + + + File 0/0, Total: 0KB + + + Qt::PlainText + + + + + + + Qt::RichText + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 20 + 20 + + + + Close at the end of the transfers + + + + :/Themes/Supercopier/resources/SystemTrayIcon/exit.png:/Themes/Supercopier/resources/SystemTrayIcon/exit.png + + + true + + + true + + + + + + + + + + 16777215 + 16 + + + + 65535 + + + + + + + File Name, 0KB + + + Qt::PlainText + + + + + + + + 16777215 + 16 + + + + 65535 + + + + + + + 4 + + + + + + 0 + 0 + + + + + 60 + 0 + + + + 0KB/sec + + + + + + + + 16777215 + 16 + + + + 1 + + + 0 + + + 0KB/sec + + + + + + + &More + + + + :/Themes/Supercopier/resources/moveDown.png:/Themes/Supercopier/resources/moveDown.png + + + true + + + true + + + + + + + false + + + &Pause + + + + :/Themes/Supercopier/resources/player_pause.png:/Themes/Supercopier/resources/player_pause.png + + + + + + + false + + + &Skip + + + + :/Themes/Supercopier/resources/player_end.png:/Themes/Supercopier/resources/player_end.png + + + + + + + &Cancel + + + + :/Themes/Supercopier/resources/cancel.png:/Themes/Supercopier/resources/cancel.png + + + + + + + + + + + Limit copy speed to: + + + + + + + 5 + + + Qt::Horizontal + + + + + + + Unlimited + + + + + + + Qt::Horizontal + + + + 40 + 1 + + + + + + + + + + 0 + + + + Transfer list + + + + + + 1 + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move the selected items to the top + + + + :/Themes/Supercopier/resources/putOnTop.png:/Themes/Supercopier/resources/putOnTop.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move up the selected items + + + + :/Themes/Supercopier/resources/moveUp.png:/Themes/Supercopier/resources/moveUp.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move down the selected items + + + + :/Themes/Supercopier/resources/moveDown.png:/Themes/Supercopier/resources/moveDown.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move the selected items to the bottom + + + + :/Themes/Supercopier/resources/putOnBottom.png:/Themes/Supercopier/resources/putOnBottom.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Add file/folder + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + QToolButton::InstantPopup + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Delete the selected items + + + + :/Themes/Supercopier/resources/remove.png:/Themes/Supercopier/resources/remove.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Search + + + + :/Themes/Supercopier/resources/search.png:/Themes/Supercopier/resources/search.png + + + true + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Export the transfer list + + + + :/Themes/Supercopier/resources/export-transfer-list.png:/Themes/Supercopier/resources/export-transfer-list.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Import the transfer list + + + + :/Themes/Supercopier/resources/import-transfer-list.png:/Themes/Supercopier/resources/import-transfer-list.png + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 0 + + + + + QAbstractItemView::ExtendedSelection + + + false + + + true + + + + + + + 0 + + + + + + + + Previous + + + + + + + Next + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + :/Themes/Supercopier/resources/remove.png:/Themes/Supercopier/resources/remove.png + + + true + + + + + + + + + + + + Error + + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Export the errors into transfer list + + + + :/Themes/Supercopier/resources/export-transfer-list.png:/Themes/Supercopier/resources/export-transfer-list.png + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + QAbstractItemView::NoSelection + + + false + + + true + + + + Source + + + + + Destination + + + + + Error + + + + + + + + + Interface + + + + 0 + + + 0 + + + + + true + + + + + 0 + 0 + 492 + 243 + + + + + + + + + + + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + Add file + + + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + Add folder + + + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + Move file(s) + + + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + Move folder + + + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + Copy file(s) + + + + + + :/Themes/Supercopier/resources/add.png:/Themes/Supercopier/resources/add.png + + + Copy folder + + + + + + + + + moreButton + toggled(bool) + tabWidget + setVisible(bool) + + + 218 + 144 + + + 149 + 305 + + + + + diff --git a/plugins-alternative/Themes/Supercopier/interfaceResources.qrc b/plugins-alternative/Themes/Supercopier/interfaceResources.qrc new file mode 100644 index 0000000..d8990aa --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interfaceResources.qrc @@ -0,0 +1,24 @@ + + + resources/add.png + resources/cancel.png + resources/main.png + resources/moveDown.png + resources/moveUp.png + resources/player_end.png + resources/player_pause.png + resources/player_play.png + resources/putOnBottom.png + resources/putOnTop.png + resources/remove.png + resources/search.png + resources/export-transfer-list.png + resources/import-transfer-list.png + resources/SystemTrayIcon/add.png + resources/SystemTrayIcon/exit.png + resources/SystemTrayIcon/informations.png + resources/SystemTrayIcon/options.png + resources/progressbarleft.png + resources/progressbarright.png + + diff --git a/plugins-alternative/Themes/Supercopier/interfaceResources_unix.qrc b/plugins-alternative/Themes/Supercopier/interfaceResources_unix.qrc new file mode 100644 index 0000000..52bc325 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interfaceResources_unix.qrc @@ -0,0 +1,9 @@ + + + resources/SystemTrayIcon/systray_Caught_Unix.png + resources/SystemTrayIcon/systray_Semiuncaught_Unix.png + resources/SystemTrayIcon/systray_Uncaught_Unix.png + resources/SystemTrayIcon/systray_Top_Progress_Unix.png + resources/SystemTrayIcon/systray_Bottom_Progress_Unix.png + + diff --git a/plugins-alternative/Themes/Supercopier/interfaceResources_windows.qrc b/plugins-alternative/Themes/Supercopier/interfaceResources_windows.qrc new file mode 100644 index 0000000..aed7063 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/interfaceResources_windows.qrc @@ -0,0 +1,9 @@ + + + resources/SystemTrayIcon/systray_Caught_Windows.png + resources/SystemTrayIcon/systray_Semiuncaught_Windows.png + resources/SystemTrayIcon/systray_Uncaught_Windows.png + resources/SystemTrayIcon/systray_Top_Progress_Windows.png + resources/SystemTrayIcon/systray_Bottom_Progress_Windows.png + + diff --git a/plugins-alternative/Themes/Supercopier/plugin.json b/plugins-alternative/Themes/Supercopier/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/add.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/add.png new file mode 100644 index 0000000..d41fce6 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/add.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/exit.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/exit.png new file mode 100644 index 0000000..9599bba Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/exit.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/informations.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/informations.png new file mode 100644 index 0000000..86c9ba6 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/informations.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/options.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/options.png new file mode 100644 index 0000000..cf699d5 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/options.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Unix.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Unix.png new file mode 100644 index 0000000..543aaf1 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Unix.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Windows.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Windows.png new file mode 100644 index 0000000..ff110d9 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Bottom_Progress_Windows.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png new file mode 100644 index 0000000..be2ba20 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png new file mode 100644 index 0000000..9c597af Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png new file mode 100644 index 0000000..be2ba20 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png new file mode 100644 index 0000000..9c597af Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Unix.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Unix.png new file mode 100644 index 0000000..1d93cb1 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Unix.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Windows.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Windows.png new file mode 100644 index 0000000..2074ee8 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Top_Progress_Windows.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png new file mode 100644 index 0000000..4da8cc0 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png new file mode 100644 index 0000000..8bfbcf9 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/add.png b/plugins-alternative/Themes/Supercopier/resources/add.png new file mode 100644 index 0000000..af8a401 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/add.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/cancel.png b/plugins-alternative/Themes/Supercopier/resources/cancel.png new file mode 100644 index 0000000..1e7579c Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/cancel.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/export-transfer-list.png b/plugins-alternative/Themes/Supercopier/resources/export-transfer-list.png new file mode 100644 index 0000000..2bcc455 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/export-transfer-list.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/import-transfer-list.png b/plugins-alternative/Themes/Supercopier/resources/import-transfer-list.png new file mode 100644 index 0000000..d208342 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/import-transfer-list.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/main.png b/plugins-alternative/Themes/Supercopier/resources/main.png new file mode 100644 index 0000000..9bec399 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/main.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/moveDown.png b/plugins-alternative/Themes/Supercopier/resources/moveDown.png new file mode 100644 index 0000000..7f4ff27 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/moveDown.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/moveUp.png b/plugins-alternative/Themes/Supercopier/resources/moveUp.png new file mode 100644 index 0000000..9397b76 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/moveUp.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/player_end.png b/plugins-alternative/Themes/Supercopier/resources/player_end.png new file mode 100644 index 0000000..9730302 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/player_end.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/player_pause.png b/plugins-alternative/Themes/Supercopier/resources/player_pause.png new file mode 100644 index 0000000..429ae43 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/player_pause.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/player_play.png b/plugins-alternative/Themes/Supercopier/resources/player_play.png new file mode 100644 index 0000000..a28ac73 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/player_play.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/progressbarleft.png b/plugins-alternative/Themes/Supercopier/resources/progressbarleft.png new file mode 100644 index 0000000..bbee9c8 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/progressbarleft.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/progressbarright.png b/plugins-alternative/Themes/Supercopier/resources/progressbarright.png new file mode 100644 index 0000000..93e5781 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/progressbarright.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/putOnBottom.png b/plugins-alternative/Themes/Supercopier/resources/putOnBottom.png new file mode 100644 index 0000000..9ac517c Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/putOnBottom.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/putOnTop.png b/plugins-alternative/Themes/Supercopier/resources/putOnTop.png new file mode 100644 index 0000000..5682829 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/putOnTop.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/remove.png b/plugins-alternative/Themes/Supercopier/resources/remove.png new file mode 100644 index 0000000..3a2a9f1 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/remove.png differ diff --git a/plugins-alternative/Themes/Supercopier/resources/search.png b/plugins-alternative/Themes/Supercopier/resources/search.png new file mode 100644 index 0000000..567f498 Binary files /dev/null and b/plugins-alternative/Themes/Supercopier/resources/search.png differ diff --git a/plugins-alternative/Themes/Supercopier/themesOptions.ui b/plugins-alternative/Themes/Supercopier/themesOptions.ui new file mode 100644 index 0000000..46c7f97 --- /dev/null +++ b/plugins-alternative/Themes/Supercopier/themesOptions.ui @@ -0,0 +1,384 @@ + + + themesOptions + + + + 0 + 0 + 540 + 325 + + + + + 0 + + + 0 + + + + + 0 + + + + + 0 + 0 + 530 + 237 + + + + Use + + + + + + Start with the "more button" pushed + + + + + + + + + + Always on top + + + + + + + + + + Minimize on close to systray + + + + + + + + + + At the end of the copy + + + + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + + Limit copy speed to + + + + + + + 5 + + + Qt::Horizontal + + + + + + + Unlimited + + + + + + + Limit copy speed to + + + + + + + false + + + KB/s + + + 1 + + + 999999 + + + + + + + Qt::Vertical + + + + 20 + 71 + + + + + + + + + + 0 + 0 + 241 + 33 + + + + Informations + + + + + + Show speed as main information + + + + + + + + + + Qt::Vertical + + + + 20 + 201 + + + + + + + + + + 0 + 0 + 441 + 107 + + + + Display + + + + + + Speed with progress bar + + + + + + + + + + Show progression in the title + + + + + + + + + + Show dual progression + + + + + + + + + + Progression color + + + + + + + + 225 + 20 + + + + + 225 + 20 + + + + Click to edit the color + + + + 0 + + + 0 + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 127 + + + + + + + + + + + + + + checkBox_limitSpeed + clicked(bool) + limitSpeed + setEnabled(bool) + + + 109 + 144 + + + 199 + 144 + + + + + diff --git a/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h b/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h +++ b/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins-alternative/Themes/Teracopy/Environment.h b/plugins-alternative/Themes/Teracopy/Environment.h index 94fd104..265a5a6 100644 --- a/plugins-alternative/Themes/Teracopy/Environment.h +++ b/plugins-alternative/Themes/Teracopy/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts index 237dc4f..a2da10c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 Total: %1 von %2 - + %1 of %2 %1 von %2 - + %1% done %1% erledigt @@ -24,27 +24,27 @@ &More - Mehr + &Mehr ... - + ... &Pause - + &Pause &Skip - überspringen + überspringen (&S) &Cancel - Stornieren + Abbrechen (&C) @@ -72,22 +72,22 @@ p, li { white-space: pre-wrap; } Move file(s) - Bewegen Sie Datei (en) + Datei (en) verschieben Move folder - bewegen Sie Ordner + Ordner verschieben Copy file(s) - Kopieren Sie die Datei (en) + Datei (en) kopieren Copy folder - kopieren Sie das Verzeichnis + Verzeichnis kopieren diff --git a/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/en/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/en/translation.ts new file mode 100644 index 0000000..d9fb1d6 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/en/translation.ts @@ -0,0 +1,89 @@ + + + + + Themes + + + Total: %1 of %2 + + + + + %1 of %2 + + + + + %1% done + + + + + interfaceCopy + + + &More + + + + + ... + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Support Ultracopier</span></a></p></body></html> + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts index fe526da..5081c0f 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts @@ -2,21 +2,21 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - Total: %1 de %2 + Total: %1 de %2 - + %1 of %2 - %1 de %2 + %1 de %2 - + %1% done - %1% hecho + %1% hecho diff --git a/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts index 42ac61d..fd6eaa1 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts @@ -2,20 +2,21 @@ - InterfacePlugin + Themes - + Total: %1 of %2 Total: %1 sur %2 - + %1 of %2 %1 sur %2 - + %1% done + Exemple: 90% fait %1% fait diff --git a/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts new file mode 100644 index 0000000..3d940b4 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + Összesen: %1 / %2 + + + + %1 of %2 + %1 / %2 + + + + %1% done + %1% kész + + + + interfaceCopy + + + &More + &Több + + + + ... + ... + + + + &Pause + &Szünet + + + + &Skip + &Kihagy + + + + &Cancel + &Mégse + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Support Ultracopier</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Támogasd az Ultracopier-t</span></a></p></body></html> + + + + Add file + Fájl hozzáadása + + + + Add folder + Mappa hozzáadása + + + + Move file(s) + Fájl(ok) mozgatása + + + + Move folder + Mappa mozgatása + + + + Copy file(s) + Fájl(ok) másolása + + + + Copy folder + Mappa másolása + + + diff --git a/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts index 746b8a6..31d775e 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 Totale: %1 di %2 - + %1 of %2 %1 di %2 - + %1% done %1% fatto @@ -24,27 +24,27 @@ &More - Di più + Alt&o ... - + ... &Pause - Pausa + &Pausa &Skip - Saltare + &Salta &Cancel - Annullare + &Annulla @@ -57,7 +57,7 @@ p, li { white-space: pre-wrap; } <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Sostenere Ultracopier</span></a></p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Supporto Ultracopier</span></a></p></body></html> @@ -72,17 +72,17 @@ p, li { white-space: pre-wrap; } Move file(s) - Spostare file(s) + Sposta file Move folder - Spostare la cartella + Sposta la cartella Copy file(s) - Copiare il file(s) + Copia file diff --git a/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts index 6c66c5a..06946e9 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts @@ -2,9 +2,9 @@ - InterfacePlugin + Themes - + Total: %1 of %2 전체: %3 / %2 {1 ?} @@ -14,7 +14,7 @@ %1 / %2 - + %1% done %1% 완료 diff --git a/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts index 1219c56..db1059e 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts @@ -2,21 +2,21 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - Всего: %1 из %2 + Всего: %1 из %2 - + %1 of %2 - %1 из %2 + %1 из %2 - + %1% done - %1% сделанный + %1% сделанный diff --git a/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/TransferModel.cpp b/plugins-alternative/Themes/Teracopy/TransferModel.cpp index 569d31c..24812a0 100644 --- a/plugins-alternative/Themes/Teracopy/TransferModel.cpp +++ b/plugins-alternative/Themes/Teracopy/TransferModel.cpp @@ -6,145 +6,146 @@ TransferModel::TransferModel() { - iconStart=QIcon(":/resources/player_play.png"); - iconPause=QIcon(":/resources/player_pause.png"); - iconStop=QIcon(":/resources/checkbox.png"); - currentIndexSearch=0; - haveSearchItem=false; + iconStart=QIcon(":/Themes/Teracopy/resources/player_play.png"); + iconPause=QIcon(":/Themes/Teracopy/resources/player_pause.png"); + iconStop=QIcon(":/Themes/Teracopy/resources/checkbox.png"); + currentIndexSearch=0; + haveSearchItem=false; + facilityEngine=NULL; } int TransferModel::columnCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? COLUMN_COUNT : 0; + return parent == QModelIndex() ? COLUMN_COUNT : 0; } QVariant TransferModel::data( const QModelIndex& index, int role ) const { - int row,column; - row=index.row(); - column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) - return QVariant(); + int row,column; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return QVariant(); - const transfertItem& item = transfertItemList[row]; - if(role==Qt::UserRole) - return item.id; - else if(role==Qt::DisplayRole) - { - switch(column) - { - case 0: - return item.source; - break; - case 1: - return item.size; - break; - case 2: - return item.destination; - break; - default: - return QVariant(); - } - } - else if(role==Qt::DecorationRole) - { - switch(column) - { - case 0: - /*if(item.done) - return iconStop; - else */if(stopId.contains(item.id)) - return iconPause; - else if(startId.contains(item.id)) - return iconStart; - else - return QVariant(); - break; - default: - return QVariant(); - } - } - else if(role==Qt::BackgroundRole) - { - if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) - { - if(haveSearchItem && searchId==item.id) - return QColor(255,150,150,100); - else - return QColor(255,255,0,100); - } - else - return QVariant(); - } - return QVariant(); + const transfertItem& item = transfertItemList[row]; + if(role==Qt::UserRole) + return item.id; + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + return item.source; + break; + case 1: + return item.size; + break; + case 2: + return item.destination; + break; + default: + return QVariant(); + } + } + else if(role==Qt::DecorationRole) + { + switch(column) + { + case 0: + /*if(item.done) + return iconStop; + else */if(stopId.contains(item.id)) + return iconPause; + else if(startId.contains(item.id)) + return iconStart; + else + return QVariant(); + break; + default: + return QVariant(); + } + } + else if(role==Qt::BackgroundRole) + { + if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) + { + if(haveSearchItem && searchId==item.id) + return QColor(255,150,150,100); + else + return QColor(255,255,0,100); + } + else + return QVariant(); + } + return QVariant(); } int TransferModel::rowCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? transfertItemList.count() : 0; + return parent == QModelIndex() ? transfertItemList.count() : 0; } quint64 TransferModel::firstId() { - if(transfertItemList.count()>0) - return transfertItemList[0].id; - else - return 0; + if(transfertItemList.count()>0) + return transfertItemList[0].id; + else + return 0; } QVariant TransferModel::headerData( int section, Qt::Orientation orientation, int role ) const { - if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { - switch ( section ) { - case 0: - return facilityEngine->translateText("Source"); - case 1: - return facilityEngine->translateText("Size"); - case 2: - return facilityEngine->translateText("Destination"); - } - } + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return facilityEngine->translateText("Source"); + case 1: + return facilityEngine->translateText("Size"); + case 2: + return facilityEngine->translateText("Destination"); + } + } - return QAbstractTableModel::headerData( section, orientation, role ); + return QAbstractTableModel::headerData( section, orientation, role ); } bool TransferModel::setData( const QModelIndex& index, const QVariant& value, int role ) { - row=index.row(); - column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) - return false; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return false; - transfertItem& item = transfertItemList[row]; - if(role==Qt::UserRole) - { - item.id=value.toULongLong(); - return true; - } - else if(role==Qt::DisplayRole) - { - switch(column) - { - case 0: - item.source=value.toString(); - emit dataChanged(index,index); - return true; - break; - case 1: - item.size=value.toString(); - emit dataChanged(index,index); - return true; - break; - case 2: - item.destination=value.toString(); - emit dataChanged(index,index); - return true; - break; - default: - return false; - } - } - return false; + transfertItem& item = transfertItemList[row]; + if(role==Qt::UserRole) + { + item.id=value.toULongLong(); + return true; + } + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + item.source=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 1: + item.size=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 2: + item.destination=value.toString(); + emit dataChanged(index,index); + return true; + break; + default: + return false; + } + } + return false; } /* @@ -152,290 +153,376 @@ bool TransferModel::setData( const QModelIndex& index, const QVariant& value, in Return[1]: totalSize Return[2]: currentFile */ -QList TransferModel::synchronizeItems(const QList& returnActions) +QList TransferModel::synchronizeItems(const QList& returnActions) { - loop_size=returnActions.size(); - index_for_loop=0; - totalFile=0; - totalSize=0; - currentFile=0; - emit layoutAboutToBeChanged(); - while(index_for_loopsizeToString(action.addAction.size); - newItem.destination=action.addAction.destinationFullPath; + loop_size=returnActions.size(); + index_for_loop=0; + totalFile=0; + totalSize=0; + currentFile=0; + emit layoutAboutToBeChanged(); + while(index_for_loopsizeToString(action.addAction.size); + newItem.destination=action.addAction.destinationFullPath; // newItem.done=false; - transfertItemList<(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.moveAt<0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.moveAt>(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - transfertItemList.move(action.userAction.position,action.userAction.moveAt); - } - break; - case RemoveItem: - { - if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) - currentIndexSearch--; - if(action.userAction.position<0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.position>(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - transfertItemList.removeAt(action.userAction.position); - currentFile++; - startId.remove(action.addAction.id); - stopId.remove(action.addAction.id); - } - break; - case PreOperation: - { - ItemOfCopyListWithMoreInformations tempItem; - tempItem.currentProgression=0; - tempItem.generalData=action.addAction; - tempItem.actionType=action.type; - internalRunningOperation[action.addAction.id]=tempItem; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("set for file %1: actionType: PreOperation").arg(action.addAction.id)); - } - break; - case Transfer: - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("found entry for file %1: actionType: Transfer").arg(action.addAction.id)); - if(!startId.contains(action.addAction.id)) - startId << action.addAction.id; - stopId.remove(action.addAction.id); - if(internalRunningOperation.contains(action.addAction.id)) - internalRunningOperation[action.addAction.id].actionType=action.type; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); - } - break; - case PostOperation: - { - if(!stopId.contains(action.addAction.id)) - stopId << action.addAction.id; - startId.remove(action.addAction.id); - internalRunningOperation.remove(action.addAction.id); - } - break; - case CustomOperation: - { - bool custom_with_progression=(action.addAction.size==1); - //without progression - if(custom_with_progression) - { - if(startId.remove(action.addAction.id)) - if(!stopId.contains(action.addAction.id)) - stopId << action.addAction.id; - } - //with progression - else - { - stopId.remove(action.addAction.id); - if(!startId.contains(action.addAction.id)) - startId << action.addAction.id; - } - if(internalRunningOperation.contains(action.addAction.id)) - { - ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; - item.actionType=action.type; - item.custom_with_progression=custom_with_progression; - item.currentProgression=0; - } - } - break; - default: - //unknow code, ignore it - break; - } - index_for_loop++; - } - emit layoutChanged(); - return QList() << totalFile << totalSize << currentFile; + transfertItemList<(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.move(action.userAction.position,action.userAction.moveAt); + } + break; + case Ultracopier::RemoveItem: + { + if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) + currentIndexSearch--; + if(action.userAction.position<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.position>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.removeAt(action.userAction.position); + currentFile++; + startId.remove(action.addAction.id); + stopId.remove(action.addAction.id); + internalRunningOperation.remove(action.addAction.id); + } + break; + case Ultracopier::PreOperation: + { + ItemOfCopyListWithMoreInformations tempItem; + tempItem.currentReadProgression=0; + tempItem.currentWriteProgression=0; + tempItem.generalData=action.addAction; + tempItem.actionType=action.type; + internalRunningOperation[action.addAction.id]=tempItem; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set for file %1: actionType: PreOperation").arg(action.addAction.id)); + } + break; + case Ultracopier::Transfer: + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + stopId.remove(action.addAction.id); + if(internalRunningOperation.contains(action.addAction.id)) + internalRunningOperation[action.addAction.id].actionType=action.type; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + } + break; + case Ultracopier::PostOperation: + { + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + startId.remove(action.addAction.id); + } + break; + case Ultracopier::CustomOperation: + { + bool custom_with_progression=(action.addAction.size==1); + //without progression + if(custom_with_progression) + { + if(startId.remove(action.addAction.id)) + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + } + //with progression + else + { + stopId.remove(action.addAction.id); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + } + if(internalRunningOperation.contains(action.addAction.id)) + { + ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; + item.actionType=action.type; + item.custom_with_progression=custom_with_progression; + item.currentReadProgression=0; + item.currentWriteProgression=0; + } + } + break; + default: + //unknow code, ignore it + break; + } + index_for_loop++; + } + emit layoutChanged(); + return QList() << totalFile << totalSize << currentFile; } void TransferModel::setFacilityEngine(FacilityInterface * facilityEngine) { - this->facilityEngine=facilityEngine; + this->facilityEngine=facilityEngine; } int TransferModel::search(const QString &text,bool searchNext) { - emit layoutAboutToBeChanged(); - search_text=text; - emit layoutChanged(); - if(transfertItemList.size()==0) - return -1; - if(text.isEmpty()) - return -1; - if(searchNext) - { - currentIndexSearch++; - if(currentIndexSearch>=loop_size) - currentIndexSearch=0; - } - index_for_loop=0; - loop_size=transfertItemList.size(); - while(index_for_loop=loop_size) - currentIndexSearch=0; - index_for_loop++; - } - haveSearchItem=false; - return -1; + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.isEmpty()) + return -1; + if(searchNext) + { + currentIndexSearch++; + if(currentIndexSearch>=loop_size) + currentIndexSearch=0; + } + index_for_loop=0; + loop_size=transfertItemList.size(); + while(index_for_loop=loop_size) + currentIndexSearch=0; + index_for_loop++; + } + haveSearchItem=false; + return -1; } int TransferModel::searchPrev(const QString &text) { - emit layoutAboutToBeChanged(); - search_text=text; - emit layoutChanged(); - if(transfertItemList.size()==0) - return -1; - if(text.isEmpty()) - return -1; - if(currentIndexSearch==0) - currentIndexSearch=loop_size-1; - else - currentIndexSearch--; - index_for_loop=0; - loop_size=transfertItemList.size(); - while(index_for_loop &progressionList) +void TransferModel::setFileProgression(QList &progressionList) { - loop_size=progressionList.size(); - index_for_loop=0; - while(index_for_loop0) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"progression remaning items"); - #endif + loop_size=progressionList.size(); + index_for_loop=0; + while(index_for_loop0) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"progression remaning items"); + #endif } TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() { - currentTransfertItem returnItem; - returnItem.haveItem=startId.size()>0; - if(returnItem.haveItem) - { - if(!internalRunningOperation.contains(*startId.constBegin())) - { - returnItem.haveItem=false; - return returnItem; - } - const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*startId.constBegin()]; - returnItem.from=itemTransfer.generalData.sourceFullPath; - returnItem.to=itemTransfer.generalData.destinationFullPath; - returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); - switch(itemTransfer.actionType) - { - case CustomOperation: - if(!itemTransfer.custom_with_progression) - returnItem.progressBar_file=-1; - else - { - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=-1; - } - break; - case Transfer: - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - break; - //should never pass here - case PostOperation: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - returnItem.progressBar_file=65535; - break; - //should never pass here - case PreOperation: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - returnItem.progressBar_file=0; - break; - default: - returnItem.progressBar_file=0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - break; - } - } -/* else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("No have running item"));*/ - return returnItem; + currentTransfertItem returnItem; + returnItem.progressBar_read=-1; + returnItem.progressBar_write=0; + returnItem.haveItem=startId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*startId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*startId.constBegin()]; + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + //should never pass here + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + else + { + returnItem.haveItem=stopId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*stopId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*stopId.constBegin()]; + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + } + if(returnItem.haveItem && returnItem.progressBar_read!=-1 && returnItem.progressBar_write>returnItem.progressBar_read) + { + int tempVar=returnItem.progressBar_write; + returnItem.progressBar_write=returnItem.progressBar_read; + returnItem.progressBar_read=tempVar; + } + return returnItem; } diff --git a/plugins-alternative/Themes/Teracopy/TransferModel.h b/plugins-alternative/Themes/Teracopy/TransferModel.h index 486532e..977c986 100644 --- a/plugins-alternative/Themes/Teracopy/TransferModel.h +++ b/plugins-alternative/Themes/Teracopy/TransferModel.h @@ -17,76 +17,76 @@ /// \brief model to store the transfer list class TransferModel : public QAbstractTableModel { - Q_OBJECT + Q_OBJECT public: - /// \brief the transfer item displayed - struct transfertItem - { - quint64 id; - QString source; - QString size; - QString destination; - }; - /// \brief the transfer item with progression - struct ItemOfCopyListWithMoreInformations - { - quint64 currentProgression; - ItemOfCopyList generalData; - ActionTypeCopyList actionType; - bool custom_with_progression; - }; - /// \brief returned first transfer item - struct currentTransfertItem - { - quint64 id; - bool haveItem; - QString from; - QString to; - QString current_file; - int progressBar_file; - }; + /// \brief the transfer item displayed + struct transfertItem + { + quint64 id; + QString source; + QString size; + QString destination; + }; + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentReadProgression,currentWriteProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_read,progressBar_write; + }; - TransferModel(); + TransferModel(); - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - - QList synchronizeItems(const QList& returnActions); - void setFacilityEngine(FacilityInterface * facilityEngine); + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - int search(const QString &text,bool searchNext); - int searchPrev(const QString &text); + QList synchronizeItems(const QList& returnActions); + void setFacilityEngine(FacilityInterface * facilityEngine); - void setFileProgression(QList &progressionList); + int search(const QString &text,bool searchNext); + int searchPrev(const QString &text); - currentTransfertItem getCurrentTransfertItem(); + void setFileProgression(QList &progressionList); - quint64 firstId(); + currentTransfertItem getCurrentTransfertItem(); + + quint64 firstId(); protected: - QList transfertItemList;///< To have a transfer list for the user - QList transfertItemListDone;///< To have a transfer list for the user - QSet startId,stopId;///< To show what is started, what is stopped - QHash internalRunningOperation;///< to have progression and stat - QIcon iconStart,iconPause,iconStop; + QList transfertItemList;///< To have a transfer list for the user + QList transfertItemListDone;///< To have a transfer list for the user + QSet startId,stopId;///< To show what is started, what is stopped + QHash internalRunningOperation;///< to have progression and stat + QIcon iconStart,iconPause,iconStop; private: - int loop_size,index_for_loop; - int sub_loop_size,sub_index_for_loop; - int row,column; - quint64 totalFile,totalSize,currentFile; - FacilityInterface * facilityEngine; - QString search_text; - /// \brief index from start the search, decresed by remove before it - int currentIndexSearch; - bool haveSearchItem; - quint64 searchId; + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + int row,column; + quint64 totalFile,totalSize,currentFile; + FacilityInterface * facilityEngine; + QString search_text; + /// \brief index from start the search, decresed by remove before it + int currentIndexSearch; + bool haveSearchItem; + quint64 searchId; signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif }; #endif // TRANSFERMODEL_H diff --git a/plugins-alternative/Themes/Teracopy/Variable.h b/plugins-alternative/Themes/Teracopy/Variable.h index 8179c93..963d0c8 100644 --- a/plugins-alternative/Themes/Teracopy/Variable.h +++ b/plugins-alternative/Themes/Teracopy/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H diff --git a/plugins-alternative/Themes/Teracopy/documentation.dox b/plugins-alternative/Themes/Teracopy/documentation.dox old mode 100755 new mode 100644 index a61692b..c1720d2 --- a/plugins-alternative/Themes/Teracopy/documentation.dox +++ b/plugins-alternative/Themes/Teracopy/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview It's Teracopy interface, to come from Teracopy to Ultracopier.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project as alternative plugin. + More informations on the wiki of ultracopier. Is part of Ultracopier project as alternative plugin. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins-alternative/Themes/Teracopy/factory.cpp b/plugins-alternative/Themes/Teracopy/factory.cpp index 89c3787..2b176bf 100644 --- a/plugins-alternative/Themes/Teracopy/factory.cpp +++ b/plugins-alternative/Themes/Teracopy/factory.cpp @@ -1,83 +1,70 @@ /** \file factory.cpp \brief Define the factory core \author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include +*/ #include "factory.h" -PluginInterface_Themes * Factory::getInstance() +PluginInterface_Themes * ThemesFactory::getInstance() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - PluginInterface_Themes * newInterface=new InterfacePlugin(facilityEngine); - connect(newInterface,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - connect(this,SIGNAL(reloadLanguage()),newInterface,SLOT(newLanguageLoaded())); - return newInterface; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Themes * newInterface=new Themes(facilityEngine); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(newInterface,&Themes::debugInformation,this,&PluginInterface_ThemesFactory::debugInformation); + #endif + connect(this,&ThemesFactory::reloadLanguage,newInterface,&Themes::newLanguageLoaded); + return newInterface; } -void Factory::setResources(OptionInterface *,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion) +void ThemesFactory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) { - this->facilityEngine=facilityEngine; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + this->facilityEngine=facilityInterface; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); + Q_UNUSED(portableVersion); + Q_UNUSED(options); } -QWidget * Factory::options() +QWidget * ThemesFactory::options() { - return NULL; + return NULL; } -void Factory::resetOptions() +void ThemesFactory::resetOptions() { } -QIcon Factory::getIcon(const QString &fileName) +QIcon ThemesFactory::getIcon(const QString &fileName) const { - if(fileName=="SystemTrayIcon/exit.png") - { - QIcon tempIcon=QIcon::fromTheme("application-exit"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/add.png") - { - QIcon tempIcon=QIcon::fromTheme("list-add"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/informations.png") - { - QIcon tempIcon=QIcon::fromTheme("help-about"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/options.png") - { - QIcon tempIcon=QIcon::fromTheme("applications-system"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - return QIcon(":/resources/"+fileName); + if(fileName=="SystemTrayIcon/exit.png") + { + QIcon tempIcon=QIcon::fromTheme("application-exit"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/add.png") + { + QIcon tempIcon=QIcon::fromTheme("list-add"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/informations.png") + { + QIcon tempIcon=QIcon::fromTheme("help-about"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/options.png") + { + QIcon tempIcon=QIcon::fromTheme("applications-system"); + if(!tempIcon.isNull()) + return tempIcon; + } + return QIcon(":/Themes/Teracopy/resources/"+fileName); } -void Factory::newLanguageLoaded() +void ThemesFactory::newLanguageLoaded() { - emit reloadLanguage(); + emit reloadLanguage(); } - -Q_EXPORT_PLUGIN2(interface, Factory); - diff --git a/plugins-alternative/Themes/Teracopy/factory.h b/plugins-alternative/Themes/Teracopy/factory.h index babac47..0b3bb3f 100644 --- a/plugins-alternative/Themes/Teracopy/factory.h +++ b/plugins-alternative/Themes/Teracopy/factory.h @@ -1,8 +1,7 @@ /** \file factory.h \brief Define the factory \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef FACTORY_H #define FACTORY_H @@ -17,30 +16,27 @@ #include "Environment.h" /// \brief Define the factory, to create instance of the interface -class Factory : public PluginInterface_ThemesFactory +class ThemesFactory : public PluginInterface_ThemesFactory { - Q_OBJECT - Q_INTERFACES(PluginInterface_ThemesFactory) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_ThemesFactory) public: - /// \brief to return the instance of the copy engine - PluginInterface_Themes * getInstance(); - /// \brief set the resources, to store options, to have facilityInterface - void setResources(OptionInterface * optionsEngine,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion); - /// \brief to get the default options widget - QWidget * options(); - /// \brief to get a resource icon - QIcon getIcon(const QString &fileName); + /// \brief to return the instance of the copy engine + PluginInterface_Themes * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion); + /// \brief to get the default options widget + QWidget * options(); + /// \brief to get a resource icon + QIcon getIcon(const QString &fileName) const; public slots: - void resetOptions(); - void newLanguageLoaded(); + void resetOptions(); + void newLanguageLoaded(); signals: - void reloadLanguage(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + void reloadLanguage(); private: - FacilityInterface * facilityEngine; + FacilityInterface * facilityEngine; }; #endif // FACTORY_H diff --git a/plugins-alternative/Themes/Teracopy/informations.xml b/plugins-alternative/Themes/Teracopy/informations.xml index 5fd194d..534db9a 100644 --- a/plugins-alternative/Themes/Teracopy/informations.xml +++ b/plugins-alternative/Themes/Teracopy/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 Teracopy =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins-alternative/Themes/Teracopy/interface.cpp b/plugins-alternative/Themes/Teracopy/interface.cpp index a7014dd..64220d0 100644 --- a/plugins-alternative/Themes/Teracopy/interface.cpp +++ b/plugins-alternative/Themes/Teracopy/interface.cpp @@ -1,376 +1,431 @@ /** \file interface.cpp \brief Define the interface core \author alpha_one_x86 -\version 0.3 -\date 2010 */ +*/ -#include #include +#include #include "interface.h" #include "ui_interface.h" -InterfacePlugin::InterfacePlugin(FacilityInterface * facilityEngine) : - ui(new Ui::interfaceCopy()) +// The cmath header from MSVC does not contain round() +#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER) +inline double round(double d) { + return floor( d + 0.5 ); +} +#endif + +Themes::Themes(FacilityInterface * facilityEngine) : + ui(new Ui::interfaceCopy()) { - this->facilityEngine=facilityEngine; - ui->setupUi(this); - ui->TransferList->setModel(&transferModel); - transferModel.setFacilityEngine(facilityEngine); + this->facilityEngine=facilityEngine; + ui->setupUi(this); + transferModel.setFacilityEngine(facilityEngine); + ui->TransferList->setModel(&transferModel); + + currentFile = 0; + totalFile = 0; + currentSize = 0; + totalSize = 0; + storeIsInPause = false; + modeIsForced = false; + haveStarted = false; + speedString = facilityEngine->speedToString(0); + ui->toolButtonMenu->setMenu(&menu); - currentFile = 0; - totalFile = 0; - currentSize = 0; - totalSize = 0; - this->show(); - storeIsInPause = false; - isInPause(false); - modeIsForced = false; - haveStarted = false; - speedString = facilityEngine->speedToString(0); - ui->toolButtonMenu->setMenu(&menu); - - connect(ui->actionAddFile,SIGNAL(triggered()),this,SLOT(forcedModeAddFile())); - connect(ui->actionAddFileToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToCopy())); - connect(ui->actionAddFileToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToMove())); - connect(ui->actionAddFolderToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToCopy())); - connect(ui->actionAddFolderToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToMove())); - connect(ui->actionAddFolder,SIGNAL(triggered()),this,SLOT(forcedModeAddFolder())); + connect(ui->actionAddFile,&QAction::triggered,this,&Themes::forcedModeAddFile); + connect(ui->actionAddFileToCopy,&QAction::triggered,this,&Themes::forcedModeAddFileToCopy); + connect(ui->actionAddFileToMove,&QAction::triggered,this,&Themes::forcedModeAddFileToMove); + connect(ui->actionAddFolderToCopy,&QAction::triggered,this,&Themes::forcedModeAddFolderToCopy); + connect(ui->actionAddFolderToMove,&QAction::triggered,this,&Themes::forcedModeAddFolderToMove); + connect(ui->actionAddFolder,&QAction::triggered,this,&Themes::forcedModeAddFolder); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&transferModel,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&transferModel,&TransferModel::debugInformation,this,&Themes::debugInformation); + #endif + + progressColorWrite=QApplication::palette().color(QPalette::Highlight); + progressColorRead=QApplication::palette().color(QPalette::AlternateBase); + progressColorRemaining=QApplication::palette().color(QPalette::Base); + + ui->progressBar_all->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + show(); + isInPause(false); } -InterfacePlugin::~InterfacePlugin() +Themes::~Themes() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); } -QWidget * InterfacePlugin::getOptionsEngineWidget() +QWidget * Themes::getOptionsEngineWidget() { - return &optionEngineWidget; + return &optionEngineWidget; } -void InterfacePlugin::getOptionsEngineEnabled(bool isEnabled) +void Themes::getOptionsEngineEnabled(const bool &isEnabled) { - Q_UNUSED(isEnabled); + Q_UNUSED(isEnabled); } /// \brief set if transfer list is exportable/importable -void InterfacePlugin::setTransferListOperation(TransferListOperation transferListOperation) +void Themes::setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) +{ + Q_UNUSED(transferListOperation); +} + +void Themes::closeEvent(QCloseEvent *event) +{ + event->ignore(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->hide(); + emit cancel(); +} + +void Themes::updateOverallInformation() { - Q_UNUSED(transferListOperation); + ui->overall->setText(tr("Total: %1 of %2").arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); + ui->labelNumberFile->setText(tr("%1 of %2").arg(currentFile).arg(totalFile)); } -void InterfacePlugin::closeEvent(QCloseEvent *event) +void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) { - event->ignore(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->hide(); - emit cancel(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start: "+QString::number(action)); + this->action=action; + ui->pauseButton->setEnabled(action!=Ultracopier::Idle); + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->progressBar_all->setMaximum(65535); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Listing: + ui->progressBar_all->setMaximum(0); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Idle: + if(haveStarted) + emit cancel(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Very wrong switch case!"); + break; + } + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + haveStarted=true; + ui->cancelButton->setText(facilityEngine->translateText("Quit")); + if(storeIsInPause) + ui->pauseButton->setText(facilityEngine->translateText("Start")); + else + ui->pauseButton->setText(facilityEngine->translateText("Pause")); + break; + case Ultracopier::Idle: + ui->cancelButton->setText(facilityEngine->translateText("Quit")); + break; + default: + break; + } } -void InterfacePlugin::updateOverallInformation() +void Themes::newFolderListing(const QString &path) { - ui->overall->setText(tr("Total: %1 of %2").arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); - ui->labelNumberFile->setText(tr("%1 of %2").arg(currentFile).arg(totalFile)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(action==Ultracopier::Listing) + ui->from->setText(path); } -void InterfacePlugin::actionInProgess(EngineActionInProgress action) +void Themes::detectedSpeed(const quint64 &speed)//in byte per seconds { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"start: "+QString::number(action)); - this->action=action; - ui->pauseButton->setEnabled(action!=Idle); - switch(action) - { - case Copying: - case CopyingAndListing: - ui->progressBar_all->setMaximum(65535); - ui->progressBar_all->setMinimum(0); - break; - case Listing: - ui->progressBar_all->setMaximum(0); - ui->progressBar_all->setMinimum(0); - break; - case Idle: - if(haveStarted) - emit cancel(); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Very wrong switch case!"); - break; - } - switch(action) - { - case Copying: - case CopyingAndListing: - haveStarted=true; - break; - case Idle: - ui->cancelButton->setText(facilityEngine->translateText("Quit")); - break; - default: - break; - } + speedString=facilityEngine->speedToString(speed); } -void InterfacePlugin::newFolderListing(const QString &path) +/** \brief support speed limitation */ +void Themes::setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(action==Listing) - ui->from->setText(path); + Q_UNUSED(supportSpeedLimitationBool); } -void InterfacePlugin::detectedSpeed(const quint64 &speed)//in byte per seconds +void Themes::remainingTime(const int &remainingSeconds) { - speedString=facilityEngine->speedToString(speed); + if(remainingSeconds==-1) + ui->labelTimeRemaining->setText("∞"); + else + { + Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); + ui->labelTimeRemaining->setText(QString::number(time.hour)+":"+QString::number(time.minute)+":"+QString::number(time.second)); + } } -void InterfacePlugin::remainingTime(const int &remainingSeconds) +void Themes::newCollisionAction(const QString &action) { - if(remainingSeconds==-1) - ui->labelTimeRemaining->setText("∞"); - else - { - TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); - ui->labelTimeRemaining->setText(QString::number(time.hour)+":"+QString::number(time.minute)+":"+QString::number(time.second)); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(action); } -void InterfacePlugin::newCollisionAction(const QString &action) +void Themes::newErrorAction(const QString &action) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - Q_UNUSED(action); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(action); } -void InterfacePlugin::newErrorAction(const QString &action) +void Themes::errorDetected() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - Q_UNUSED(action); } -void InterfacePlugin::errorDetected() +/// \brief new error +void Themes::errorToRetry(const QString &source,const QString &destination,const QString &error) { + Q_UNUSED(source); + Q_UNUSED(destination); + Q_UNUSED(error); } //speed limitation -bool InterfacePlugin::setSpeedLimitation(const qint64 &speedLimitation) +bool Themes::setSpeedLimitation(const qint64 &speedLimitation) { - if(speedLimitation>0) - emit newSpeedLimitation(0); - return true; + if(speedLimitation>0) + emit newSpeedLimitation(0); + return true; } //get information about the copy -void InterfacePlugin::setGeneralProgression(const quint64 ¤t,const quint64 &total) +void Themes::setGeneralProgression(const quint64 ¤t,const quint64 &total) { - currentSize=current; - totalSize=total; - if(total>0) - { - int newIndicator=((double)current/total)*65535; - ui->progressBar_all->setValue(newIndicator); - } - else - ui->progressBar_all->setValue(0); + currentSize=current; + totalSize=total; + if(total>0) + { + int newIndicator=((double)current/total)*65535; + ui->progressBar_all->setValue(newIndicator); + } + else + ui->progressBar_all->setValue(0); } -void InterfacePlugin::setCollisionAction(const QList > &list) +void Themes::setCollisionAction(const QList > &list) { - Q_UNUSED(list); + Q_UNUSED(list); } -void InterfacePlugin::setErrorAction(const QList > &list) +void Themes::setErrorAction(const QList > &list) { - Q_UNUSED(list); + Q_UNUSED(list); } -void InterfacePlugin::setCopyType(CopyType type) +void Themes::setCopyType(const Ultracopier::CopyType &type) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->type=type; - updateModeAndType(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->type=type; + updateModeAndType(); } -void InterfacePlugin::forceCopyMode(CopyMode mode) +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - modeIsForced=true; - this->mode=mode; - if(mode==Copy) - this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Copy")); - else - this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Move")); - updateModeAndType(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + modeIsForced=true; + this->mode=mode; + if(mode==Ultracopier::Copy) + this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Copy")); + else + this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Move")); + updateModeAndType(); } -void InterfacePlugin::updateTitle() +void Themes::updateTitle() { - QString startString; - if(action==Copying || action==CopyingAndListing) - startString=tr("%1% done").arg(((double)currentSize/totalSize)*100); - else - startString="Ultracopier"; - startString+=" - "; - if(mode==Copy) - this->setWindowTitle(startString+facilityEngine->translateText("Copy")+" ("+speedString+")"); - else - this->setWindowTitle(startString+facilityEngine->translateText("Move")+" ("+speedString+")"); + QString startString; + if(action==Ultracopier::Copying || action==Ultracopier::CopyingAndListing) + startString=tr("%1% done").arg(((double)currentSize/totalSize)*100); + else + startString="Ultracopier"; + startString+=" - "; + if(mode==Ultracopier::Copy) + this->setWindowTitle(startString+facilityEngine->translateText("Copy")+" ("+speedString+")"); + else + this->setWindowTitle(startString+facilityEngine->translateText("Move")+" ("+speedString+")"); } -void InterfacePlugin::haveExternalOrder() +void Themes::haveExternalOrder() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); // ui->moreButton->toggle(); } -void InterfacePlugin::isInPause(bool isInPause) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"isInPause: "+QString::number(isInPause)); - //resume in auto the pause - storeIsInPause=isInPause; - if(isInPause) - ui->pauseButton->setText(facilityEngine->translateText("Resume")); - else - ui->pauseButton->setText(facilityEngine->translateText("Pause")); -} - -void InterfacePlugin::updateCurrentFileInformation() -{ - TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); - if(transfertItem.haveItem) - { - ui->from->setText(transfertItem.from); - //commented because not displayed on this interface - //ui->to->setText(transfertItem.to); - //ui->current_file->setText(transfertItem.current_file); - if(transfertItem.progressBar_file!=-1) - { - ui->progressBar_file->setRange(0,65535); - ui->progressBar_file->setValue(transfertItem.progressBar_file); - } - else - ui->progressBar_file->setRange(0,0); - } - else - { - ui->from->setText(""); - //commented because not displayed on this interface - //ui->to->setText(""); - //ui->current_file->setText("-"); - if(haveStarted && transferModel.rowCount()==0) - ui->progressBar_file->setValue(65535); - else if(!haveStarted) - ui->progressBar_file->setValue(0); - } +void Themes::isInPause(const bool &isInPause) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"isInPause: "+QString::number(isInPause)); + //resume in auto the pause + storeIsInPause=isInPause; + if(isInPause) + ui->pauseButton->setText(facilityEngine->translateText("Resume")); + else + ui->pauseButton->setText(facilityEngine->translateText("Pause")); +} + +void Themes::updateCurrentFileInformation() +{ + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + ui->from->setText(transfertItem.from); + //commented because not displayed on this interface + //ui->to->setText(transfertItem.to); + //ui->current_file->setText(transfertItem.current_file); + if(transfertItem.progressBar_read!=-1) + { + ui->progressBar_file->setRange(0,65535); + if(transfertItem.progressBar_read!=transfertItem.progressBar_write) + { + float permilleread=round((float)transfertItem.progressBar_read/65535*1000)/1000; + float permillewrite=permilleread-0.001; + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border: 1px solid grey;text-align: center;background-color: qlineargradient(spread:pad, x1:%1, y1:0, x2:%2, y2:0, stop:0 %3, stop:1 %4);}QProgressBar::chunk{background-color:%5;}") + .arg(permilleread) + .arg(permillewrite) + .arg(progressColorRemaining.name()) + .arg(progressColorRead.name()) + .arg(progressColorWrite.name()) + ); + } + else + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setValue(transfertItem.progressBar_write); + } + else + ui->progressBar_file->setRange(0,0); + } + else + { + ui->from->setText(""); + //commented because not displayed on this interface + //ui->to->setText(""); + //ui->current_file->setText("-"); + if(haveStarted && transferModel.rowCount()==0) + ui->progressBar_file->setValue(65535); + else if(!haveStarted) + ui->progressBar_file->setValue(0); + } } -void InterfacePlugin::on_cancelButton_clicked() +void Themes::on_cancelButton_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->hide(); - emit cancel(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->hide(); + emit cancel(); } -void InterfacePlugin::on_pauseButton_clicked() +void Themes::on_pauseButton_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(storeIsInPause) - emit resume(); - else - emit pause(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(storeIsInPause) + emit resume(); + else + emit pause(); } -void InterfacePlugin::on_skipButton_clicked() +void Themes::on_skipButton_clicked() { - TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); - if(transfertItem.haveItem) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip at running: %1").arg(transfertItem.id)); - emit skip(transfertItem.id); - } - else - { - if(transferModel.rowCount()>1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip at idle: %1").arg(transferModel.firstId())); - emit skip(transferModel.firstId()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); - } + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at running: %1").arg(transfertItem.id)); + emit skip(transfertItem.id); + } + else + { + if(transferModel.rowCount()>1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at idle: %1").arg(transferModel.firstId())); + emit skip(transferModel.firstId()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); + } } -void InterfacePlugin::updateModeAndType() +void Themes::updateModeAndType() { - menu.clear(); - if(modeIsForced) - { - menu.addAction(ui->actionAddFile); - if(type==FileAndFolder) - menu.addAction(ui->actionAddFolder); - } - else - { - menu.addAction(ui->actionAddFileToCopy); - menu.addAction(ui->actionAddFileToMove); - if(type==FileAndFolder) - { - menu.addAction(ui->actionAddFolderToCopy); - menu.addAction(ui->actionAddFolderToMove); - } - } + menu.clear(); + if(modeIsForced) + { + menu.addAction(ui->actionAddFile); + if(type==Ultracopier::FileAndFolder) + menu.addAction(ui->actionAddFolder); + } + else + { + menu.addAction(ui->actionAddFileToCopy); + menu.addAction(ui->actionAddFileToMove); + if(type==Ultracopier::FileAndFolder) + { + menu.addAction(ui->actionAddFolderToCopy); + menu.addAction(ui->actionAddFolderToMove); + } + } } -void InterfacePlugin::forcedModeAddFile() +void Themes::forcedModeAddFile() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(mode); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(mode); } -void InterfacePlugin::forcedModeAddFolder() +void Themes::forcedModeAddFolder() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(mode); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(mode); } -void InterfacePlugin::forcedModeAddFileToCopy() +void Themes::forcedModeAddFileToCopy() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(Copy); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Copy); } -void InterfacePlugin::forcedModeAddFolderToCopy() +void Themes::forcedModeAddFolderToCopy() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(Copy); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Copy); } -void InterfacePlugin::forcedModeAddFileToMove() +void Themes::forcedModeAddFileToMove() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(Move); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Move); } -void InterfacePlugin::forcedModeAddFolderToMove() +void Themes::forcedModeAddFolderToMove() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(Move); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Move); } //set the translate -void InterfacePlugin::newLanguageLoaded() +void Themes::newLanguageLoaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(modeIsForced) - forceCopyMode(mode); - ui->retranslateUi(this); - if(haveStarted) - updateCurrentFileInformation(); - updateOverallInformation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(modeIsForced) + forceCopyMode(mode); + ui->retranslateUi(this); + if(haveStarted) + updateCurrentFileInformation(); + updateOverallInformation(); } /* @@ -378,68 +433,68 @@ void InterfacePlugin::newLanguageLoaded() Return[1]: totalSize Return[2]: currentFile */ -void InterfacePlugin::getActionOnList(const QList& returnActions) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, returnActions.size(): "+QString::number(returnActions.size())); - QList returnValue=transferModel.synchronizeItems(returnActions); - totalFile+=returnValue[0]; - totalSize+=returnValue[1]; - currentFile+=returnValue[2]; - if(transferModel.rowCount()==0) - { - ui->skipButton->setEnabled(false); - ui->progressBar_all->setValue(65535); - ui->progressBar_file->setValue(65535); - currentSize=totalSize; - } - else - ui->skipButton->setEnabled(true); - updateOverallInformation(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"transferModel.rowCount(): "+QString::number(transferModel.rowCount())); -} - -void InterfacePlugin::setFileProgression(const QList &progressionList) -{ - QList progressionListBis=progressionList; - transferModel.setFileProgression(progressionListBis); - updateCurrentFileInformation(); -} - -InterfacePlugin::currentTransfertItem InterfacePlugin::getCurrentTransfertItem() -{ - currentTransfertItem returnItem; - returnItem.haveItem=InternalRunningOperation.size()>0; - if(returnItem.haveItem) - { - const ItemOfCopyListWithMoreInformations &itemTransfer=InternalRunningOperation.first(); - returnItem.from=itemTransfer.generalData.sourceFullPath; - returnItem.to=itemTransfer.generalData.destinationFullPath; - returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); - switch(itemTransfer.actionType) - { - case CustomOperation: - if(!itemTransfer.custom_with_progression) - returnItem.progressBar_file=0; - else - { - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - } - break; - case Transfer: - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - break; - case PostOperation: - returnItem.progressBar_file=65535; - break; - default: - returnItem.progressBar_file=0; - } - } - return returnItem; +void Themes::getActionOnList(const QList& returnActions) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, returnActions.size(): "+QString::number(returnActions.size())); + QList returnValue=transferModel.synchronizeItems(returnActions); + totalFile+=returnValue[0]; + totalSize+=returnValue[1]; + currentFile+=returnValue[2]; + if(transferModel.rowCount()==0) + { + ui->skipButton->setEnabled(false); + ui->progressBar_all->setValue(65535); + ui->progressBar_file->setValue(65535); + currentSize=totalSize; + } + else + ui->skipButton->setEnabled(true); + updateOverallInformation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"transferModel.rowCount(): "+QString::number(transferModel.rowCount())); +} + +void Themes::setFileProgression(const QList &progressionList) +{ + QList progressionListBis=progressionList; + transferModel.setFileProgression(progressionListBis); + updateCurrentFileInformation(); +} + +Themes::currentTransfertItem Themes::getCurrentTransfertItem() +{ + currentTransfertItem returnItem; + returnItem.haveItem=InternalRunningOperation.size()>0; + if(returnItem.haveItem) + { + const ItemOfCopyListWithMoreInformations &itemTransfer=InternalRunningOperation.first(); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_file=0; + else + { + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + break; + case Ultracopier::PostOperation: + returnItem.progressBar_file=65535; + break; + default: + returnItem.progressBar_file=0; + } + } + return returnItem; } diff --git a/plugins-alternative/Themes/Teracopy/interface.h b/plugins-alternative/Themes/Teracopy/interface.h index 899a03b..b2f6a70 100644 --- a/plugins-alternative/Themes/Teracopy/interface.h +++ b/plugins-alternative/Themes/Teracopy/interface.h @@ -1,16 +1,16 @@ /** \file interface.h \brief Define the interface test \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ -#ifndef INTERFACE_TEST_H -#define INTERFACE_TEST_H +#ifndef INTERFACE_H +#define INTERFACE_H #include #include #include #include +#include #include "../../../interface/PluginInterface_Themes.h" @@ -19,151 +19,158 @@ #include "TransferModel.h" namespace Ui { - class interfaceCopy; + class interfaceCopy; } /// \brief Define the interface -class InterfacePlugin : public PluginInterface_Themes +class Themes : public PluginInterface_Themes { - Q_OBJECT + Q_OBJECT private: - struct ItemOfCopyListWithMoreInformations - { - quint64 currentProgression; - ItemOfCopyList generalData; - ActionTypeCopyList actionType; - bool custom_with_progression; - }; - struct currentTransfertItem - { - quint64 id; - bool haveItem; - QString from; - QString to; - QString current_file; - int progressBar_file; - }; - Ui::interfaceCopy *ui; - quint64 currentFile; - quint64 totalFile; - quint64 currentSize; - quint64 totalSize; - void updateOverallInformation(); - void updateCurrentFileInformation(); - EngineActionInProgress action; - void closeEvent(QCloseEvent *event); - QList currentProgressList; - QString speedString; - bool storeIsInPause; - bool modeIsForced; - CopyType type; - CopyMode mode; - void updateModeAndType(); - bool haveStarted; - QWidget optionEngineWidget; - void updateTitle(); - QMenu menu; - FacilityInterface * facilityEngine; - int loop_size,loop_sub_size,indexAction,index; - int index_for_loop,sub_loop_size,sub_index_for_loop; - currentTransfertItem getCurrentTransfertItem(); - QList startId,stopId;///< To show what is started, what is stopped - QList InternalRunningOperation;///< to have progression and stat - /// \brief the custom transfer model - TransferModel transferModel; + struct ItemOfCopyListWithMoreInformations + { + quint64 currentProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_file; + }; + Ui::interfaceCopy *ui; + quint64 currentFile; + quint64 totalFile; + quint64 currentSize; + quint64 totalSize; + void updateOverallInformation(); + void updateCurrentFileInformation(); + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + QList currentProgressList; + QString speedString; + bool storeIsInPause; + bool modeIsForced; + Ultracopier::CopyType type; + Ultracopier::CopyMode mode; + void updateModeAndType(); + bool haveStarted; + QWidget optionEngineWidget; + void updateTitle(); + QMenu menu; + FacilityInterface * facilityEngine; + int loop_size,loop_sub_size,indexAction,index; + int index_for_loop,sub_loop_size,sub_index_for_loop; + currentTransfertItem getCurrentTransfertItem(); + QList startId,stopId;///< To show what is started, what is stopped + QList InternalRunningOperation;///< to have progression and stat + /// \brief the custom transfer model + TransferModel transferModel; + QColor progressColorWrite; + QColor progressColorRead; + QColor progressColorRemaining; public: - //send information about the copy - /// \brief to set the action in progress - void actionInProgess(EngineActionInProgress); - /// \brief new transfer have started - void newTransferStart(const ItemOfCopyList &item); - /** \brief one transfer have been stopped - * is stopped, example: because error have occurred, and try later, don't remove the item! */ - void newTransferStop(const quint64 &id); - /// \brief the new folder is listing - void newFolderListing(const QString &path); - /** \brief show the detected speed - * in byte per seconds */ - void detectedSpeed(const quint64 &speed); - /** \brief show the remaining time - * time in seconds */ - void remainingTime(const int &remainingSeconds); - /// \brief set the current collision action - void newCollisionAction(const QString &action); - /// \brief set the current error action - void newErrorAction(const QString &action); - /// \brief set one error is detected - void errorDetected(); - //speed limitation - /** \brief the max speed used - * in byte per seconds, -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - InterfacePlugin(FacilityInterface * facilityEngine); - ~InterfacePlugin(); - //get information about the copy - /// \brief show the general progression - void setGeneralProgression(const quint64 ¤t,const quint64 &total); - /// \brief show the file progression - void setFileProgression(const QList &progressionList); - /// \brief set collision action - void setCollisionAction(const QList > &); - /// \brief set error action - void setErrorAction(const QList > &); - /// \brief set the copyType -> file or folder - void setCopyType(CopyType); - /// \brief set the copyMove -> copy or move, to force in copy or move, else support both - void forceCopyMode(CopyMode); - /// \brief set if transfer list is exportable/importable - void setTransferListOperation(TransferListOperation transferListOperation); - /** \brief set if the order is external (like file manager copy) - * to notify the interface, which can hide add folder/filer button */ - void haveExternalOrder(); - /// \brief set if is in pause - void isInPause(bool); - /// \brief get the widget for the copy engine - QWidget * getOptionsEngineWidget(); - /// \brief to set if the copy engine is found - void getOptionsEngineEnabled(bool isEnabled); + //send information about the copy + /// \brief to set the action in progress + void actionInProgess(const Ultracopier::EngineActionInProgress &); + /// \brief new transfer have started + void newTransferStart(const Ultracopier::ItemOfCopyList &item); + /** \brief one transfer have been stopped + * is stopped, example: because error have occurred, and try later, don't remove the item! */ + void newTransferStop(const quint64 &id); + /// \brief the new folder is listing + void newFolderListing(const QString &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const quint64 &speed); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const QString &action); + /// \brief set the current error action + void newErrorAction(const QString &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const QString &source,const QString &destination,const QString &error); + //speed limitation + /** \brief the max speed used + * in byte per seconds, -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + Themes(FacilityInterface * facilityEngine); + ~Themes(); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const quint64 ¤t,const quint64 &total); + /// \brief show the file progression + void setFileProgression(const QList &progressionList); + /// \brief set collision action + void setCollisionAction(const QList > &); + /// \brief set error action + void setErrorAction(const QList > &); + /// \brief set the copyType -> file or folder + void setCopyType(const Ultracopier::CopyType &); + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + void forceCopyMode(const Ultracopier::CopyMode &); + /// \brief set if transfer list is exportable/importable + void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation); + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + void haveExternalOrder(); + /// \brief set if is in pause + void isInPause(const bool &); + /// \brief get the widget for the copy engine + QWidget * getOptionsEngineWidget(); + /// \brief to set if the copy engine is found + void getOptionsEngineEnabled(const bool &isEnabled); private slots: - void on_cancelButton_clicked(); - void on_pauseButton_clicked(); - void on_skipButton_clicked(); - void forcedModeAddFile(); - void forcedModeAddFolder(); - void forcedModeAddFileToCopy(); - void forcedModeAddFolderToCopy(); - void forcedModeAddFileToMove(); - void forcedModeAddFolderToMove(); + void on_cancelButton_clicked(); + void on_pauseButton_clicked(); + void on_skipButton_clicked(); + void forcedModeAddFile(); + void forcedModeAddFolder(); + void forcedModeAddFileToCopy(); + void forcedModeAddFolderToCopy(); + void forcedModeAddFileToMove(); + void forcedModeAddFolderToMove(); signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - //set the transfer list - void removeItems(QList ids); - void moveItemsOnTop(QList ids); - void moveItemsUp(QList ids); - void moveItemsDown(QList ids); - void moveItemsOnBottom(QList ids); - void exportTransferList(); - void importTransferList(); - //user ask ask to add folder (add it with interface ask source/destination) - void userAddFolder(CopyMode); - void userAddFile(CopyMode); - void urlDropped(QList urls); - //action on the copy - void pause(); - void resume(); - void skip(quint64 id); - void cancel(); - //edit the action - void sendCollisionAction(QString action); - void sendErrorAction(QString action); - void newSpeedLimitation(qint64); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif + //set the transfer list + /*void removeItems(QList ids); + void moveItemsOnTop(QList ids); + void moveItemsUp(QList ids); + void moveItemsDown(QList ids); + void moveItemsOnBottom(QList ids); + void exportTransferList(); + void importTransferList(); + //user ask ask to add folder (add it with interface ask source/destination) + void userAddFolder(Ultracopier::CopyMode); + void userAddFile(Ultracopier::CopyMode); + void urlDropped(QList urls); + //action on the copy + void pause(); + void resume(); + void skip(quint64 id); + void cancel(); + //edit the action + void sendCollisionAction(QString action); + void sendErrorAction(QString action); + void newSpeedLimitation(qint64);*/ public slots: - //set the translate - void newLanguageLoaded(); - void getActionOnList(const QList& returnActions); + //set the translate + void newLanguageLoaded(); + void getActionOnList(const QList& returnActions); }; -#endif // INTERFACE_TEST_H +#endif // INTERFACE_H diff --git a/plugins-alternative/Themes/Teracopy/interface.pro b/plugins-alternative/Themes/Teracopy/interface.pro index 4cecacb..5049e19 100644 --- a/plugins-alternative/Themes/Teracopy/interface.pro +++ b/plugins-alternative/Themes/Teracopy/interface.pro @@ -1,8 +1,12 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets TEMPLATE = lib CONFIG += plugin HEADERS = interface.h \ - interface/PluginInterface_Themes.h \ - StructEnumDefinition.h \ + StructEnumDefinition.h \ factory.h \ DebugEngineMacro.h \ Environment.h \ @@ -13,24 +17,25 @@ SOURCES = interface.cpp \ factory.cpp \ TransferModel.cpp TARGET = $$qtLibraryTarget(interface) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ +TRANSLATIONS += Languages/ar/translation.ts \ Languages/de/translation.ts \ Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ Languages/it/translation.ts \ Languages/ja/translation.ts \ - Languages/id/translation.ts \ + Languages/ko/translation.ts \ + Languages/nl/translation.ts \ + Languages/no/translation.ts \ Languages/pl/translation.ts \ Languages/ru/translation.ts \ - Languages/tr/translation.ts \ Languages/th/translation.ts \ - Languages/hi/translation.ts \ - Languages/nl/translation.ts \ - Languages/no/translation.ts \ - Languages/pt/translation.ts \ - Languages/ko/translation.ts + Languages/tr/translation.ts \ + Languages/zh/translation.ts RESOURCES += resources.qrc diff --git a/plugins-alternative/Themes/Teracopy/interface.ui b/plugins-alternative/Themes/Teracopy/interface.ui index 1bccf44..a5274b3 100644 --- a/plugins-alternative/Themes/Teracopy/interface.ui +++ b/plugins-alternative/Themes/Teracopy/interface.ui @@ -27,7 +27,7 @@ - :/resources/main.png:/resources/main.png + :/Themes/Teracopy/resources/main.png:/Themes/Teracopy/resources/main.png @@ -302,7 +302,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Add file @@ -311,7 +311,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Add folder @@ -320,7 +320,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Move file(s) @@ -329,7 +329,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Move folder @@ -338,7 +338,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Copy file(s) @@ -347,7 +347,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Copy folder diff --git a/plugins-alternative/Themes/Teracopy/plugin.json b/plugins-alternative/Themes/Teracopy/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/Themes/Teracopy/resources.qrc b/plugins-alternative/Themes/Teracopy/resources.qrc index 7f9a82c..39105a8 100644 --- a/plugins-alternative/Themes/Teracopy/resources.qrc +++ b/plugins-alternative/Themes/Teracopy/resources.qrc @@ -1,5 +1,5 @@ - + resources/SystemTrayIcon/add.png resources/SystemTrayIcon/exit.png resources/SystemTrayIcon/informations.png diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png index 1e03be9..7932127 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png index 201353e..ae3c4e8 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png index e1eb797..5b7b255 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png index d35365c..23ec531 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png index a81e70d..6f5d1cf 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png index 8072aea..5464856 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png index f40ea82..3961215 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png index 8d673e4..45d6315 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png index 9ce4779..ac4299a 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png index d0fca1b..6e6bae7 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/checkbox.png b/plugins-alternative/Themes/Teracopy/resources/checkbox.png index 1c311e2..f7f4388 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/checkbox.png and b/plugins-alternative/Themes/Teracopy/resources/checkbox.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/main.png b/plugins-alternative/Themes/Teracopy/resources/main.png index 8072aea..5464856 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/main.png and b/plugins-alternative/Themes/Teracopy/resources/main.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/player_pause.png b/plugins-alternative/Themes/Teracopy/resources/player_pause.png index a9b3113..68ee21f 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/player_pause.png and b/plugins-alternative/Themes/Teracopy/resources/player_pause.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/player_play.png b/plugins-alternative/Themes/Teracopy/resources/player_play.png index 80ff3a1..a1c5b83 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/player_play.png and b/plugins-alternative/Themes/Teracopy/resources/player_play.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources_unix.qrc b/plugins-alternative/Themes/Teracopy/resources_unix.qrc index ae3894b..46e3020 100644 --- a/plugins-alternative/Themes/Teracopy/resources_unix.qrc +++ b/plugins-alternative/Themes/Teracopy/resources_unix.qrc @@ -1,6 +1,6 @@ - - resources/SystemTrayIcon/systray_Caught_Unix.png + + resources/SystemTrayIcon/systray_Caught_Unix.png resources/SystemTrayIcon/systray_Semiuncaught_Unix.png resources/SystemTrayIcon/systray_Uncaught_Unix.png diff --git a/plugins-alternative/Themes/Teracopy/resources_windows.qrc b/plugins-alternative/Themes/Teracopy/resources_windows.qrc index 99829b3..165123a 100644 --- a/plugins-alternative/Themes/Teracopy/resources_windows.qrc +++ b/plugins-alternative/Themes/Teracopy/resources_windows.qrc @@ -1,5 +1,5 @@ - + resources/SystemTrayIcon/systray_Caught_Windows.png resources/SystemTrayIcon/systray_Semiuncaught_Windows.png resources/SystemTrayIcon/systray_Uncaught_Windows.png diff --git a/plugins-alternative/Themes/Windows/DebugEngineMacro.h b/plugins-alternative/Themes/Windows/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins-alternative/Themes/Windows/DebugEngineMacro.h @@ -0,0 +1,28 @@ +/** \file DebugEngineMacro.h +\brief Define the macro for the debug +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef DEBUGENGINEMACRO_H +#define DEBUGENGINEMACRO_H + +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + +/// \brief Macro for the debug log +#ifdef ULTRACOPIER_PLUGIN_DEBUG + #if defined (__FILE__) && defined (__LINE__) + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b,__FILE__,__LINE__) + #else + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b) + #endif +#else // ULTRACOPIER_DEBUG + #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() +#endif // ULTRACOPIER_DEBUG + +#endif // DEBUGENGINEMACRO_H + + + + diff --git a/plugins-alternative/Themes/Windows/Environment.h b/plugins-alternative/Themes/Windows/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Environment.h @@ -0,0 +1,10 @@ +/** \file Environment.h +\brief Define the environment variable and global function +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "Variable.h" +/// \brief The global include +#include "StructEnumDefinition.h" +#include "DebugEngineMacro.h" + diff --git a/plugins-alternative/Themes/Windows/Languages/ar/translation.ts b/plugins-alternative/Themes/Windows/Languages/ar/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/ar/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/de/translation.ts b/plugins-alternative/Themes/Windows/Languages/de/translation.ts new file mode 100644 index 0000000..7657f03 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/de/translation.ts @@ -0,0 +1,124 @@ + + + + + Themes + + + + Unknown remaining time + Verbleibende Zeit unbekannt + + + + + Transferring %n item(s) (%2) + + Übertrage %n Element (%2) + Übertrage %n Elemente (%2) + + + + + + Copying %n item(s) (%2) + + Kopiere %n Element (%2) + Kopiere %n Elemente (%2) + + + + + + Moving %n item(s) (%2) + + Verschiebe %n Element (%2) + Verschiebe %n Elemente (%2) + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + von <b>%1</b> (%2) bis <b>%3</b> (%4)<br />%5 + + + + In waiting + Warten... + + + + interface + + + Name: + Name: + + + + From: + Von: + + + + To: + Nach: + + + + Time remaining: + verbleibende Zeit: + + + + Items remaining: + verbleibende Elemente: + + + + Speed: + Geschwindigkeit: + + + + More information + Mehr Informationen + + + + Cancel + Abbrechen + + + + Add file + Datei hinzufügen + + + + Add folder + Ordner hinzufügen + + + + Move file(s) + Datei (en) verschieben + + + + Move folder + Ordner verschieben + + + + Copy file(s) + Datei (en) kopieren + + + + Copy folder + Ordner kopieren + + + diff --git a/plugins-alternative/Themes/Windows/Languages/el/translation.ts b/plugins-alternative/Themes/Windows/Languages/el/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/el/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/en/translation.ts b/plugins-alternative/Themes/Windows/Languages/en/translation.ts new file mode 100644 index 0000000..27cfd09 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/en/translation.ts @@ -0,0 +1,124 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + Transferring %n item (%2) + Transferring %n items (%2) + + + + + + Copying %n item(s) (%2) + + Copying %n item (%2) + Copying %n items (%2) + + + + + + Moving %n item(s) (%2) + + Moving %n item (%2) + Moving %n items (%2) + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/es/translation.ts b/plugins-alternative/Themes/Windows/Languages/es/translation.ts new file mode 100644 index 0000000..cc4de8a --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/es/translation.ts @@ -0,0 +1,124 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + + Copying %n item(s) (%2) + + + + + + + + + Moving %n item(s) (%2) + + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + desde <b>%1</b> (%2) hasta <b>%3</b> (%4)<br />%5 + + + + In waiting + En espera + + + + interface + + + Name: + Nombre: + + + + From: + Desde: + + + + To: + Hasta: + + + + Time remaining: + Tiempo restante: + + + + Items remaining: + Items restantes: + + + + Speed: + Velocidad: + + + + More information + Más información + + + + Cancel + Cancelar + + + + Add file + Añadir archivo + + + + Add folder + Añadir carpeta + + + + Move file(s) + Mover archivo(s) + + + + Move folder + Mueva la carpeta + + + + Copy file(s) + Copia el archivo(s) + + + + Copy folder + Copia la carpeta + + + diff --git a/plugins-alternative/Themes/Windows/Languages/fr/translation.ts b/plugins-alternative/Themes/Windows/Languages/fr/translation.ts new file mode 100644 index 0000000..7f99e83 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/fr/translation.ts @@ -0,0 +1,124 @@ + + + + + Themes + + + + Unknown remaining time + Temps restant inconnu + + + + + Transferring %n item(s) (%2) + + Transfert de %n élément (%2) + Transfert de %n éléments (%2) + + + + + + Copying %n item(s) (%2) + + Copie de %n élément (%2) + Copie de %n éléments (%2) + + + + + + Moving %n item(s) (%2) + + Déplacement de %n élément (%2) + Déplacement de %n éléments (%2) + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + depuis <b>%1</b> (%2) vers <b>%3</b> (%4)<br />%5 + + + + In waiting + En attente + + + + interface + + + Move file(s) + Déplacer des fichiers + + + + Move folder + Déplacer un dossier + + + + Copy file(s) + Copier des fichiers + + + + Copy folder + Copier un dossier + + + + Add folder + Ajouter un dossier + + + + Name: + Nom: + + + + From: + Depuis: + + + + To: + Vers: + + + + Time remaining: + Temps restant: + + + + Items remaining: + Éléments restants: + + + + Speed: + Vitesse: + + + + More information + Plus d'information + + + + Cancel + Annuler + + + + Add file + Ajout de fichier + + + diff --git a/plugins-alternative/Themes/Windows/Languages/hi/translation.ts b/plugins-alternative/Themes/Windows/Languages/hi/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/hi/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/hu/translation.ts b/plugins-alternative/Themes/Windows/Languages/hu/translation.ts new file mode 100644 index 0000000..ef4bf6d --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/hu/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + Ismeretlen hátralévő idő + + + + + Transferring %n item(s) (%2) + + %n elem áthelyezése(%2) + + + + + + Copying %n item(s) (%2) + + %n elem átmásolása(%2) + + + + + + Moving %n item(s) (%2) + + %n elem mozgatása(%2) + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + <b>%1</b> (%2) helyről-> <b>%3</b> (%4) helyre<br />%5 + + + + In waiting + Várakozik + + + + interface + + + Name: + Név: + + + + From: + Forrás: + + + + To: + Cél: + + + + Time remaining: + Hátralévő idő: + + + + Items remaining: + Hátralévő elemek: + + + + Speed: + Sebesség: + + + + More information + Több információ + + + + Cancel + Mégse + + + + Add file + Fájl hozzáadása + + + + Add folder + Mappa hozzáadása + + + + Move file(s) + Fájl(ok) mozgatása + + + + Move folder + Mappa mozgatása + + + + Copy file(s) + Fájl(ok) másolása + + + + Copy folder + Mappa másolása + + + diff --git a/plugins-alternative/Themes/Windows/Languages/id/translation.ts b/plugins-alternative/Themes/Windows/Languages/id/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/id/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/it/translation.ts b/plugins-alternative/Themes/Windows/Languages/it/translation.ts new file mode 100644 index 0000000..c3d5a73 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/it/translation.ts @@ -0,0 +1,125 @@ + + + + + Themes + + + + Unknown remaining time + Tempo rediduo indeterminato + + + + + Transferring %n item(s) (%2) + + Trasferimento di %n elemento (%2) + Trasferimento di %n elementi (%2) + + + + + + Copying %n item(s) (%2) + + Copia di %n elemento (%2) + Copia di %n elementi (%2) + + + + + + Moving %n item(s) (%2) + + Spostamento di %n elemento (%2) + Spostamento di %n elementi (%2) + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + Per esempio: da <b>Cartella di origine</b> (e: precedente origine) to <b>Cartella di destinazione</b> (d: destinazione desktop)<br />Circa 5 ore rimanenti + da <b>%1</b> (%2) a <b>%3</b> (%4)<br />%5 + + + + In waiting + In attesa + + + + interface + + + Name: + Nome: + + + + From: + Da: + + + + To: + A: + + + + Time remaining: + Tempo residuo: + + + + Items remaining: + Elementi rimanenti: + + + + Speed: + Velocità: + + + + More information + Maggiori informazioni + + + + Cancel + Annulla + + + + Add file + Aggiungi file + + + + Add folder + Aggiungi cartella + + + + Move file(s) + Sposta file + + + + Move folder + Sposta la cartella + + + + Copy file(s) + Copia file + + + + Copy folder + Copia la cartella + + + diff --git a/plugins-alternative/Themes/Windows/Languages/ja/translation.ts b/plugins-alternative/Themes/Windows/Languages/ja/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/ja/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/ko/translation.ts b/plugins-alternative/Themes/Windows/Languages/ko/translation.ts new file mode 100644 index 0000000..4d682a3 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/ko/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + 파일 추가 + + + + Add folder + 폴더 추가 + + + + Move file(s) + 파일 이동 + + + + Move folder + 폴더 이동 + + + + Copy file(s) + 파일 복사 + + + + Copy folder + 폴더 복사 + + + diff --git a/plugins-alternative/Themes/Windows/Languages/nl/translation.ts b/plugins-alternative/Themes/Windows/Languages/nl/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/nl/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/no/translation.ts b/plugins-alternative/Themes/Windows/Languages/no/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/no/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/pl/translation.ts b/plugins-alternative/Themes/Windows/Languages/pl/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/pl/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/ru/translation.ts b/plugins-alternative/Themes/Windows/Languages/ru/translation.ts new file mode 100644 index 0000000..02e9260 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/ru/translation.ts @@ -0,0 +1,127 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + + + Copying %n item(s) (%2) + + + + + + + + + + Moving %n item(s) (%2) + + + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + Добавить файл + + + + Add folder + Добавить папку + + + + Move file(s) + Перемещение файла (ов) + + + + Move folder + Перемещение папки + + + + Copy file(s) + Копировать файл (ы) + + + + Copy folder + Копировать папку + + + diff --git a/plugins-alternative/Themes/Windows/Languages/th/translation.ts b/plugins-alternative/Themes/Windows/Languages/th/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/th/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/tr/translation.ts b/plugins-alternative/Themes/Windows/Languages/tr/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/tr/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/Languages/zh/translation.ts b/plugins-alternative/Themes/Windows/Languages/zh/translation.ts new file mode 100644 index 0000000..fe6d20c --- /dev/null +++ b/plugins-alternative/Themes/Windows/Languages/zh/translation.ts @@ -0,0 +1,121 @@ + + + + + Themes + + + + Unknown remaining time + + + + + + Transferring %n item(s) (%2) + + + + + + + + Copying %n item(s) (%2) + + + + + + + + Moving %n item(s) (%2) + + + + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br />%5 + Sample: from <b>sources</b> (e:oldersource) to <b>destination</b> (d:desktopdestination)<br />About 5 Hours remaining + + + + + In waiting + + + + + interface + + + Name: + + + + + From: + + + + + To: + + + + + Time remaining: + + + + + Items remaining: + + + + + Speed: + + + + + More information + + + + + Cancel + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Windows/StructEnumDefinition.h b/plugins-alternative/Themes/Windows/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/Themes/Windows/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/Themes/Windows/TransferModel.cpp b/plugins-alternative/Themes/Windows/TransferModel.cpp new file mode 100644 index 0000000..7743266 --- /dev/null +++ b/plugins-alternative/Themes/Windows/TransferModel.cpp @@ -0,0 +1,286 @@ +#include "TransferModel.h" + +#define COLUMN_COUNT 3 + +// Model + +TransferModel::TransferModel() +{ + iconStart=QIcon(":/Themes/Windows/resources/player_play.png"); + iconPause=QIcon(":/Themes/Windows/resources/player_pause.png"); + iconStop=QIcon(":/Themes/Windows/resources/checkbox.png"); + currentIndexSearch=0; + currentFile = 0; + totalFile = 0; + currentSize = 0; + totalSize = 0; + haveSearchItem=false; +} + +int TransferModel::columnCount( const QModelIndex& parent ) const +{ + return parent == QModelIndex() ? COLUMN_COUNT : 0; +} + +QVariant TransferModel::data( const QModelIndex& index, int role ) const +{ + Q_UNUSED(role); + Q_UNUSED(index); + return QVariant(); +} + +int TransferModel::rowCount( const QModelIndex& parent ) const +{ + Q_UNUSED(parent); + return 0; +} + +QVariant TransferModel::headerData( int section, Qt::Orientation orientation, int role ) const +{ + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return facilityEngine->translateText("Source"); + case 1: + return facilityEngine->translateText("Size"); + case 2: + return facilityEngine->translateText("Destination"); + } + } + + return QAbstractTableModel::headerData( section, orientation, role ); +} + +bool TransferModel::setData( const QModelIndex& index, const QVariant& value, int role ) +{ + Q_UNUSED(index); + Q_UNUSED(value); + Q_UNUSED(role); + return true; +} + +/* + Return[0]: totalFile + Return[1]: totalSize + Return[2]: currentFile + */ +QList TransferModel::synchronizeItems(const QList& returnActions) +{ + loop_size=returnActions.size(); + index_for_loop=0; + emit layoutAboutToBeChanged(); + while(index_for_looptotalFile++; + this->totalSize+=action.addAction.size; + } + break; + case Ultracopier::RemoveItem: + internalRunningOperation.remove(action.addAction.id); + startId.remove(action.addAction.id); + stopId.remove(action.addAction.id); + this->currentFile++; + break; + case Ultracopier::PreOperation: + { + ItemOfCopyListWithMoreInformations tempItem; + tempItem.currentProgression=0; + tempItem.generalData=action.addAction; + tempItem.generalData.destinationFullPath.remove(tempItem.generalData.destinationFullPath.size()-tempItem.generalData.destinationFileName.size(),tempItem.generalData.destinationFileName.size()); + tempItem.generalData.sourceFullPath.remove(tempItem.generalData.sourceFullPath.size()-tempItem.generalData.sourceFileName.size(),tempItem.generalData.sourceFileName.size()); + tempItem.actionType=action.type; + internalRunningOperation[action.addAction.id]=tempItem; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set for file %1: actionType: PreOperation").arg(action.addAction.id)); + } + break; + case Ultracopier::Transfer: + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + stopId.remove(action.addAction.id); + if(internalRunningOperation.contains(action.addAction.id)) + internalRunningOperation[action.addAction.id].actionType=action.type; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + } + break; + case Ultracopier::PostOperation: + { + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + startId.remove(action.addAction.id); + } + break; + case Ultracopier::CustomOperation: + { + bool custom_with_progression=(action.addAction.size==1); + //without progression + if(custom_with_progression) + { + if(startId.remove(action.addAction.id)) + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + } + //with progression + else + { + stopId.remove(action.addAction.id); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + } + if(internalRunningOperation.contains(action.addAction.id)) + { + ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; + item.actionType=action.type; + item.custom_with_progression=custom_with_progression; + item.currentProgression=0; + } + } + break; + default: + //unknow code, ignore it + break; + } + index_for_loop++; + } + emit layoutChanged(); + return QList() << totalFile << totalSize << currentFile; +} + +void TransferModel::setFacilityEngine(FacilityInterface * facilityEngine) +{ + this->facilityEngine=facilityEngine; +} + +void TransferModel::setFileProgression(QList &progressionList) +{ + loop_size=progressionList.size(); + index_for_loop=0; + while(index_for_loop0) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"progression remaning items"); + #endif +} + +TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() +{ + currentTransfertItem returnItem; + returnItem.haveItem=startId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*startId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*startId.constBegin()]; + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName; + returnItem.size=facilityEngine->sizeToString(itemTransfer.generalData.size); + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_file=-1; + else + { + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + break; + //should never pass here + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_file=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_file=0; + break; + default: + returnItem.progressBar_file=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + else + { + if(!internalRunningOperation.contains(*stopId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + else + returnItem.haveItem=true; + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*stopId.constBegin()]; + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName; + returnItem.size=facilityEngine->sizeToString(itemTransfer.generalData.size); + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_file=-1; + else + { + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + break; + //should never pass here + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_file=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_file=0; + break; + default: + returnItem.progressBar_file=65535; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + return returnItem; +} diff --git a/plugins-alternative/Themes/Windows/TransferModel.h b/plugins-alternative/Themes/Windows/TransferModel.h new file mode 100644 index 0000000..c2d89aa --- /dev/null +++ b/plugins-alternative/Themes/Windows/TransferModel.h @@ -0,0 +1,90 @@ +#ifndef TRANSFERMODEL_H +#define TRANSFERMODEL_H + +#include +#include +#include +#include +#include +#include +#include + +#include "StructEnumDefinition.h" +#include "Environment.h" + +#include "../../../interface/FacilityInterface.h" + +/// \brief model to store the transfer list +class TransferModel : public QAbstractTableModel +{ + Q_OBJECT +public: + /// \brief the transfer item displayed + struct transfertItem + { + quint64 id; + QString source; + QString size; + QString destination; + }; + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + QString size; + int progressBar_file; + }; + + TransferModel(); + + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + + QList synchronizeItems(const QList& returnActions); + void setFacilityEngine(FacilityInterface * facilityEngine); + + void setFileProgression(QList &progressionList); + + currentTransfertItem getCurrentTransfertItem(); + + quint64 currentFile; + quint64 totalFile; + quint64 currentSize; + quint64 totalSize; +protected: + QSet startId,stopId;///< To show what is started, what is stopped + QHash internalRunningOperation;///< to have progression and stat + QIcon iconStart,iconPause,iconStop; +private: + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + int row,column; + FacilityInterface * facilityEngine; + QString search_text; + /// \brief index from start the search, decresed by remove before it + int currentIndexSearch; + bool haveSearchItem; + quint64 searchId; +signals: + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif +}; + +#endif // TRANSFERMODEL_H diff --git a/plugins-alternative/Themes/Windows/Variable.h b/plugins-alternative/Themes/Windows/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins-alternative/Themes/Windows/Variable.h @@ -0,0 +1,15 @@ +/** \file Variable.h +\brief Define the environment variable +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef VARIABLE_H +#define VARIABLE_H + +//Un-comment this next line to put ultracopier plugin in debug mode +#define ULTRACOPIER_PLUGIN_DEBUG + +#endif // VARIABLE_H + + + diff --git a/plugins-alternative/Themes/Windows/documentation.dox b/plugins-alternative/Themes/Windows/documentation.dox new file mode 100644 index 0000000..df43161 --- /dev/null +++ b/plugins-alternative/Themes/Windows/documentation.dox @@ -0,0 +1,29 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage Windows + + \section mainpage_overview Overview + + It's interface to have interface like windows for Ultracopier.\n + More informations on the wiki of ultracopier. Is part of Ultracopier project as alternative plugin. + + \section mainpage_platforms Platforms + + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. + + \section mainpage_downloads Downloads + + You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... + + \section license GPL Version 3 + The code source is under GPL3. + +*/ + diff --git a/plugins-alternative/Themes/Windows/factory.cpp b/plugins-alternative/Themes/Windows/factory.cpp new file mode 100644 index 0000000..dbce51a --- /dev/null +++ b/plugins-alternative/Themes/Windows/factory.cpp @@ -0,0 +1,74 @@ +/** \file factory.cpp +\brief Define the factory core +\author alpha_one_x86 +*/ + +#include "factory.h" + +QRegularExpression ThemesFactory::slashEnd; +QRegularExpression ThemesFactory::isolateName; + +ThemesFactory::ThemesFactory() +{ + slashEnd=QRegularExpression("/$"); + isolateName=QRegularExpression("^.*/([^/]+)$"); +} + +PluginInterface_Themes * ThemesFactory::getInstance() +{ + Themes * newInterface=new Themes(facilityEngine); + connect(this,&ThemesFactory::reloadLanguage,newInterface,&Themes::newLanguageLoaded); + return newInterface; +} + +void ThemesFactory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,const bool &portableVersion) +{ + Q_UNUSED(options) + Q_UNUSED(writePath) + Q_UNUSED(pluginPath) + this->facilityEngine=facilityEngine; + Q_UNUSED(portableVersion) +} + +QWidget * ThemesFactory::options() +{ + return NULL; +} + +QIcon ThemesFactory::getIcon(const QString &fileName) const +{ + if(fileName=="SystemTrayIcon/exit.png") + { + QIcon tempIcon=QIcon::fromTheme("application-exit"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/add.png") + { + QIcon tempIcon=QIcon::fromTheme("list-add"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/informations.png") + { + QIcon tempIcon=QIcon::fromTheme("help-about"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/options.png") + { + QIcon tempIcon=QIcon::fromTheme("applications-system"); + if(!tempIcon.isNull()) + return tempIcon; + } + return QIcon(":/Themes/Windows/resources/"+fileName); +} + +void ThemesFactory::resetOptions() +{ +} + +void ThemesFactory::newLanguageLoaded() +{ + emit reloadLanguage(); +} diff --git a/plugins-alternative/Themes/Windows/factory.h b/plugins-alternative/Themes/Windows/factory.h new file mode 100644 index 0000000..32ea9f1 --- /dev/null +++ b/plugins-alternative/Themes/Windows/factory.h @@ -0,0 +1,45 @@ +/** \file factory.h +\brief Define the factory, to create instance of the interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FACTORY_H +#define FACTORY_H + +#include +#include +#include +#include + +#include "interface.h" +#include "../../../interface/PluginInterface_Themes.h" + +/// \brief Define the factory, to create instance of the interface +class ThemesFactory : public PluginInterface_ThemesFactory +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_ThemesFactory) + public: + ThemesFactory(); + /// \brief to return the instance of the copy engine + PluginInterface_Themes * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * optionsEngine,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,const bool &portableVersion); + /// \brief to get the default options widget + QWidget * options(); + /// \brief to get a resource icon + QIcon getIcon(const QString &fileName) const; + //regex + static QRegularExpression slashEnd; + static QRegularExpression isolateName; + signals: + void reloadLanguage(); + public slots: + void resetOptions(); + void newLanguageLoaded(); + private: + FacilityInterface * facilityEngine; +}; + +#endif // FACTORY_H diff --git a/plugins-alternative/Themes/Windows/informations.xml b/plugins-alternative/Themes/Windows/informations.xml new file mode 100644 index 0000000..b0d6f22 --- /dev/null +++ b/plugins-alternative/Themes/Windows/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Windows dialog for Ultracopier]]> + <![CDATA[Dialogue de Windows pour Ultracopier]]> + + Themes + + + + + + + 1287496800 + + windows-x86 + + + + + 1.2.3.6 + + Windows + + + \ No newline at end of file diff --git a/plugins-alternative/Themes/Windows/interface.cpp b/plugins-alternative/Themes/Windows/interface.cpp new file mode 100644 index 0000000..e358f9c --- /dev/null +++ b/plugins-alternative/Themes/Windows/interface.cpp @@ -0,0 +1,414 @@ +/** \file interface.cpp +\brief Define the interface core +\author alpha_one_x86 +*/ + +#include "interface.h" +#include "factory.h" +#include "ui_interface.h" + +Themes::Themes(FacilityInterface * facilityEngine) : + ui(new Ui::interface()) +{ + ui->setupUi(this); + remainingSeconds= 0; + speed = 0; + progression_current=0; + progression_total=0; + modeIsForced = false; + haveStarted = false; + this->facilityEngine = facilityEngine; + transferModel.setFacilityEngine(facilityEngine); + menu=new QMenu(this); + ui->toolButton->setMenu(menu); + updateModeAndType(); + + connect(ui->actionAddFile,&QAction::triggered,this,&Themes::forcedModeAddFile); + connect(ui->actionAddFileToCopy,&QAction::triggered,this,&Themes::forcedModeAddFileToCopy); + connect(ui->actionAddFileToMove,&QAction::triggered,this,&Themes::forcedModeAddFileToMove); + connect(ui->actionAddFolderToCopy,&QAction::triggered,this,&Themes::forcedModeAddFolderToCopy); + connect(ui->actionAddFolderToMove,&QAction::triggered,this,&Themes::forcedModeAddFolderToMove); + connect(ui->actionAddFolder,&QAction::triggered,this,&Themes::forcedModeAddFolder); + + updateDetails(); + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&transferModel,&TransferModel::debugInformation,this,&Themes::debugInformation); + #endif + #ifndef Q_OS_WIN32 + ui->widget_bottom->setStyleSheet("background-color: rgb(237, 237, 237);"); + #endif + show(); +} + +Themes::~Themes() +{ + delete menu; +} + +void Themes::forcedModeAddFile() +{ + emit userAddFile(mode); +} + +void Themes::forcedModeAddFolder() +{ + emit userAddFolder(mode); +} + +void Themes::forcedModeAddFileToCopy() +{ + emit userAddFile(Ultracopier::Copy); +} + +void Themes::forcedModeAddFolderToCopy() +{ + emit userAddFolder(Ultracopier::Copy); +} + +void Themes::forcedModeAddFileToMove() +{ + emit userAddFile(Ultracopier::Move); +} + +void Themes::forcedModeAddFolderToMove() +{ + emit userAddFolder(Ultracopier::Move); +} + +void Themes::updateModeAndType() +{ + menu->clear(); + if(modeIsForced) + { + menu->addAction(ui->actionAddFile); + if(type==Ultracopier::FileAndFolder) + menu->addAction(ui->actionAddFolder); + } + else + { + menu->addAction(ui->actionAddFileToCopy); + menu->addAction(ui->actionAddFileToMove); + if(type==Ultracopier::FileAndFolder) + { + menu->addAction(ui->actionAddFolderToCopy); + menu->addAction(ui->actionAddFolderToMove); + } + } +} + +void Themes::closeEvent(QCloseEvent *event) +{ + event->ignore(); + this->hide(); + emit cancel(); +} + +void Themes::detectedSpeed(const quint64 &speed) +{ + this->speed=speed; + if(ui->more->isChecked()) + ui->label_speed->setText(facilityEngine->speedToString(speed)); +} + +void Themes::setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) +{ + Q_UNUSED(supportSpeedLimitationBool); +} + +QWidget * Themes::getOptionsEngineWidget() +{ + return NULL; +} + +void Themes::getOptionsEngineEnabled(const bool &isEnabled) +{ + Q_UNUSED(isEnabled) +} + +void Themes::setCopyType(const Ultracopier::CopyType &type) +{ + this->type=type; + updateModeAndType(); +} + +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) +{ + modeIsForced=true; + this->mode=mode; + updateModeAndType(); + updateInformations(); +} + +void Themes::updateTitle() +{ + remainingTime(remainingSeconds); +} + +void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) +{ + this->action=action; + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->progressBar->setMaximum(65535); + ui->progressBar->setMinimum(0); + break; + case Ultracopier::Listing: + ui->progressBar->setMaximum(0); + ui->progressBar->setMinimum(0); + break; + case Ultracopier::Idle: + if(haveStarted) + emit cancel(); + break; + default: + break; + } + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + haveStarted=true; + break; + default: + break; + } +} + +void Themes::newTransferStart(const Ultracopier::ItemOfCopyList &item) +{ + ui->text->setText(item.sourceFullPath); +} + +void Themes::newTransferStop(const quint64 &id) +{ + Q_UNUSED(id) +} + +void Themes::newFolderListing(const QString &path) +{ + if(action==Ultracopier::Listing) + ui->text->setText(path); +} + +void Themes::remainingTime(const int &remainingSeconds) +{ + this->remainingSeconds=remainingSeconds; + + QString remainingTime; + if(remainingSeconds>=0) + remainingTime=facilityEngine->simplifiedRemainingTime(remainingSeconds); + else + remainingTime=facilityEngine->translateText(tr("Unknown remaining time")); + + this->setWindowTitle(remainingTime); + + if(ui->more->isChecked()) + ui->label_remaining_time->setText(remainingTime); + else + updateInformations(); +} + +void Themes::newCollisionAction(const QString &action) +{ + Q_UNUSED(action) +} + +void Themes::newErrorAction(const QString &action) +{ + Q_UNUSED(action) +} + +void Themes::errorDetected() +{ +} + +/// \brief new error +void Themes::errorToRetry(const QString &source,const QString &destination,const QString &error) +{ + Q_UNUSED(source); + Q_UNUSED(destination); + Q_UNUSED(error); +} + +void Themes::setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) +{ + Q_UNUSED(transferListOperation) +} + +//speed limitation +bool Themes::setSpeedLimitation(const qint64 &speedLimitation) +{ + Q_UNUSED(speedLimitation) + return false; +} + +//get information about the copy +void Themes::setGeneralProgression(const quint64 ¤t,const quint64 &total) +{ + progression_current=current; + progression_total=total; + ui->progressBar->setValue(((double)current/total)*65535); +} + +void Themes::setCollisionAction(const QList > &list) +{ + Q_UNUSED(list) +} + +void Themes::setErrorAction(const QList > &list) +{ + Q_UNUSED(list) +} + +//edit the transfer list +void Themes::getActionOnList(const QList &returnActions) +{ + transferModel.synchronizeItems(returnActions); + updateInformations(); +} + +void Themes::haveExternalOrder() +{ + ui->toolButton->hide(); +} + +void Themes::isInPause(const bool &isInPause) +{ + //resume in auto the pause + if(isInPause) + emit resume(); +} + +void Themes::newLanguageLoaded() +{ + ui->retranslateUi(this); + updateTitle(); + updateInformations(); +} + +void Themes::setFileProgression(const QList &progressionList) +{ + QList progressionListBis=progressionList; + transferModel.setFileProgression(progressionListBis); + updateInformations(); +} + +void Themes::on_more_toggled(bool checked) +{ + Q_UNUSED(checked); + updateDetails(); + updateInformations(); +} + +void Themes::updateDetails() +{ + ui->text->setHidden(ui->more->isChecked()); + ui->details->setHidden(!ui->more->isChecked()); + if(ui->more->isChecked()) + { + this->setMinimumHeight(242); + this->setMaximumHeight(242); + ui->more->setIcon(QIcon(":/Themes/Windows/resources/arrow-up.png")); + } + else + { + this->setMinimumHeight(168); + this->setMaximumHeight(168); + ui->more->setIcon(QIcon(":/Themes/Windows/resources/arrow-down.png")); + } + + // usefull under windows + this->updateGeometry(); + this->update(); + this->adjustSize(); + + updateInformations(); +} + +void Themes::updateInformations() +{ + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(!modeIsForced) + { + if(transferModel.totalFile>1) + ui->label_main->setText(tr("Transferring %n item(s) (%2)","",transferModel.totalFile).arg(facilityEngine->sizeToString(progression_total))); + else + ui->label_main->setText(tr("Transferring %n item(s) (%2)","",transferModel.totalFile).arg(facilityEngine->sizeToString(progression_total))); + } + else + { + if(mode==Ultracopier::Copy) + { + if(transferModel.totalFile>1) + ui->label_main->setText(tr("Copying %n item(s) (%2)","",transferModel.totalFile).arg(facilityEngine->sizeToString(progression_total))); + else + ui->label_main->setText(tr("Copying %n item(s) (%2)","",transferModel.totalFile).arg(facilityEngine->sizeToString(progression_total))); + } + else + { + if(transferModel.totalFile>1) + ui->label_main->setText(tr("Moving %n item(s) (%2)","",transferModel.totalFile).arg(facilityEngine->sizeToString(progression_total))); + else + ui->label_main->setText(tr("Moving %n item(s) (%2)","",transferModel.totalFile).arg(facilityEngine->sizeToString(progression_total))); + } + } + + if(ui->more->isChecked()) + { + if(transfertItem.haveItem) + { + QString simplifiedFrom=transfertItem.from; + QString simplifiedTo=transfertItem.to; + simplifiedFrom.remove(ThemesFactory::slashEnd); + simplifiedTo.remove(ThemesFactory::slashEnd); + simplifiedFrom.replace('\\','/'); + simplifiedTo.replace('\\','/'); + simplifiedFrom.replace(ThemesFactory::isolateName, "\\1"); + simplifiedTo.replace(ThemesFactory::isolateName, "\\1"); + ui->label_file->setText(transfertItem.current_file); + ui->label_from->setText(QStringLiteral("%1 (%2)").arg(simplifiedFrom).arg(transfertItem.from)); + ui->label_to->setText(QStringLiteral("%1 (%2)").arg(simplifiedTo).arg(transfertItem.to)); + ui->label_items->setText(QStringLiteral("%1 (%2)").arg(transferModel.totalFile-transferModel.currentFile).arg(facilityEngine->sizeToString(progression_total-progression_current))); + } + else + { + ui->label_file->setText(""); + ui->label_from->setText(""); + ui->label_to->setText(""); + ui->label_items->setText(QStringLiteral("%1 (%2)").arg(transferModel.totalFile-transferModel.currentFile).arg(facilityEngine->sizeToString(progression_total-progression_current))); + } + } + else + { + if(transfertItem.haveItem) + { + QString remainingTime; + if(remainingSeconds>=0) + remainingTime=facilityEngine->simplifiedRemainingTime(remainingSeconds); + else + remainingTime=facilityEngine->translateText(tr("Unknown remaining time")); + QString simplifiedFrom=transfertItem.from; + QString simplifiedTo=transfertItem.to; + simplifiedFrom.remove(ThemesFactory::slashEnd); + simplifiedTo.remove(ThemesFactory::slashEnd); + simplifiedFrom.replace('\\','/'); + simplifiedTo.replace('\\','/'); + simplifiedFrom.replace(ThemesFactory::isolateName, "\\1"); + simplifiedTo.replace(ThemesFactory::isolateName, "\\1"); + ui->text->setText( + //: Sample: from sources (e:\folder\source) to destination (d:\desktop\destination)
About 5 Hours remaining + tr("from %1 (%2) to %3 (%4)
%5") + .arg(simplifiedFrom) + .arg(transfertItem.from) + .arg(simplifiedTo) + .arg(transfertItem.to) + .arg(remainingTime) + ); + } + else + ui->text->setText(tr("In waiting")); + } +} diff --git a/plugins-alternative/Themes/Windows/interface.h b/plugins-alternative/Themes/Windows/interface.h new file mode 100644 index 0000000..5de55e6 --- /dev/null +++ b/plugins-alternative/Themes/Windows/interface.h @@ -0,0 +1,165 @@ +/** \file interface.h +\brief Define the interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef INTERFACE_TEST_H +#define INTERFACE_TEST_H + +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_Themes.h" +#include "TransferModel.h" + +namespace Ui { + class interface; +} + +/// \brief Define the interface +class Themes : public PluginInterface_Themes +{ + Q_OBJECT +public slots: + //send information about the copy + /// \brief to set the action in progress + void actionInProgess(const Ultracopier::EngineActionInProgress &); + /// \brief new transfer have started + void newTransferStart(const Ultracopier::ItemOfCopyList &item); + /** \brief one transfer have been stopped + * is stopped, example: because error have occurred, and try later, don't remove the item! */ + void newTransferStop(const quint64 &id); + /// \brief the new folder is listing + void newFolderListing(const QString &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const quint64 &speed); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const QString &action); + /// \brief set the current error action + void newErrorAction(const QString &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const QString &source,const QString &destination,const QString &error); + //speed limitation + /** \brief the max speed used + * in byte per seconds, -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + //set the translate + void newLanguageLoaded(); +public: + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_file; + }; + /// \brief get the widget for the copy engine + QWidget * getOptionsEngineWidget(); + /// \brief to set if the copy engine is found + void getOptionsEngineEnabled(const bool &isEnabled); + /// \brief get action on the transfer list (add/move/remove) + void getActionOnList(const QList &returnActions); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const quint64 ¤t,const quint64 &total); + /// \brief show the file progression + void setFileProgression(const QList &progressionList); + /// \brief set collision action + void setCollisionAction(const QList > &); + /// \brief set error action + void setErrorAction(const QList > &); + /// \brief set the copyType -> file or folder + void setCopyType(const Ultracopier::CopyType &); + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + void forceCopyMode(const Ultracopier::CopyMode &); + /// \brief set if transfer list is exportable/importable + void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation); + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + void haveExternalOrder(); + /// \brief set if is in pause + void isInPause(const bool &); +signals: + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif +/* //set the transfer list + void removeItems(QList ids); + void moveItemsOnTop(QList ids); + void moveItemsUp(QList ids); + void moveItemsDown(QList ids); + void moveItemsOnBottom(QList ids); + void exportTransferList(); + void importTransferList(); + //user ask ask to add folder (add it with interface ask source/destination) + void userAddFolder(CopyMode); + void userAddFile(CopyMode); + void urlDropped(QList urls); + //action on the copy + void pause(); + void resume(); + void skip(quint64 id); + void cancel(); + //edit the action + void sendCollisionAction(QString action); + void sendErrorAction(QString action); + void newSpeedLimitation(qint64);*/ +public: + //constructor and destructor + Themes(FacilityInterface * facilityEngine); + ~Themes(); +private: + Ui::interface *ui; + TransferModel transferModel; + void updateTitle(); + QMenu *menu; + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + void updateModeAndType(); + bool modeIsForced; + Ultracopier::CopyType type; + Ultracopier::CopyMode mode; + bool haveStarted; + QList InternalRunningOperation; + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + FacilityInterface * facilityEngine; + void updateDetails(); + void updateInformations(); + int remainingSeconds; + quint64 progression_current; + quint64 progression_total; + quint64 speed; +private slots: + void forcedModeAddFile(); + void forcedModeAddFolder(); + void forcedModeAddFileToCopy(); + void forcedModeAddFolderToCopy(); + void forcedModeAddFileToMove(); + void forcedModeAddFolderToMove(); + void on_more_toggled(bool checked); +}; + +#endif // INTERFACE_TEST_H diff --git a/plugins-alternative/Themes/Windows/interface.pro b/plugins-alternative/Themes/Windows/interface.pro new file mode 100644 index 0000000..9a82f6a --- /dev/null +++ b/plugins-alternative/Themes/Windows/interface.pro @@ -0,0 +1,48 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets +TEMPLATE = lib +CONFIG += plugin +HEADERS = interface.h \ + StructEnumDefinition.h \ + factory.h \ + ../../../interface/PluginInterface_Themes.h \ + TransferModel.h +SOURCES = interface.cpp \ + factory.cpp \ + TransferModel.cpp +TARGET = $$qtLibraryTarget(interface) +TRANSLATIONS += Languages/ar/translation.ts \ + Languages/de/translation.ts \ + Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ + Languages/it/translation.ts \ + Languages/ja/translation.ts \ + Languages/ko/translation.ts \ + Languages/nl/translation.ts \ + Languages/no/translation.ts \ + Languages/pl/translation.ts \ + Languages/ru/translation.ts \ + Languages/th/translation.ts \ + Languages/tr/translation.ts \ + Languages/zh/translation.ts + +FORMS += \ + interface.ui + +RESOURCES += \ + resources.qrc + +win32 { + RESOURCES += resources_windows.qrc +} +!win32 { + RESOURCES += resources_unix.qrc +} diff --git a/plugins-alternative/Themes/Windows/interface.ui b/plugins-alternative/Themes/Windows/interface.ui new file mode 100644 index 0000000..f255562 --- /dev/null +++ b/plugins-alternative/Themes/Windows/interface.ui @@ -0,0 +1,415 @@ + + + interface + + + + 0 + 0 + 420 + 284 + + + + + 0 + 0 + + + + + 420 + 0 + + + + + 420 + 16777215 + + + + Ultracopier + + + + :/Themes/Windows/resources/icon.png:/Themes/Windows/resources/icon.png + + + + 0 + + + 0 + + + + + + 420 + 42 + + + + + 420 + 42 + + + + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(230, 240, 255, 255), stop:0.5 rgba(166, 199, 230, 255), stop:1 rgba(3, 40, 84, 255)); + + + + 20 + + + 0 + + + 20 + + + 0 + + + + + background-color: rgba(255, 0, 0, 0); +font: 12pt "Sans Serif"; + + + Copying 0 item (0KB) + + + + + + + + 51 + 40 + + + + + 51 + 40 + + + + background-color: rgba(255, 0, 0, 0); + + + :/Themes/Windows/resources/icon-top.png + + + + + + + + + + + 420 + 0 + + + + + 420 + 16777215 + + + + background-color: rgb(255, 255, 255); + + + + 14 + + + 20 + + + 14 + + + 20 + + + 14 + + + + + + 0 + 0 + + + + + 16777215 + 28 + + + + from <b>%1</b> (%2) to <b>%3</b> (%4)<br /> +%5 + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 2 + + + + + Name: + + + + + + + + + + From: + + + + + + + + + + To: + + + + + + + + + + Time remaining: + + + + + + + + + + Items remaining: + + + + + + + + + + Speed: + + + + + + + + + + + + + + 0 + 14 + + + + + 16777215 + 14 + + + + 65535 + + + false + + + + + + + + + + + 420 + 42 + + + + + 420 + 42 + + + + + 20 + + + 0 + + + 20 + + + 0 + + + + + More information + + + + :/Themes/Windows/resources/arrow-down.png:/Themes/Windows/resources/arrow-down.png + + + true + + + Qt::ToolButtonTextBesideIcon + + + + + + + Qt::Horizontal + + + + 123 + 20 + + + + + + + + ... + + + QToolButton::InstantPopup + + + + + + + Cancel + + + + + + + + + + + :/Themes/Windows/resources/add.png:/Themes/Windows/resources/add.png + + + Add file + + + + + + :/Themes/Windows/resources/add.png:/Themes/Windows/resources/add.png + + + Add folder + + + + + + :/Themes/Windows/resources/add.png:/Themes/Windows/resources/add.png + + + Move file(s) + + + + + + :/Themes/Windows/resources/add.png:/Themes/Windows/resources/add.png + + + Move folder + + + + + + :/Themes/Windows/resources/add.png:/Themes/Windows/resources/add.png + + + Copy file(s) + + + + + + :/Themes/Windows/resources/add.png:/Themes/Windows/resources/add.png + + + Copy folder + + + + + + + + + Cancel + clicked() + interface + close() + + + 388 + 349 + + + 523 + 498 + + + + + diff --git a/plugins-alternative/Themes/Windows/plugin.json b/plugins-alternative/Themes/Windows/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/Themes/Windows/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/Themes/Windows/resources.qrc b/plugins-alternative/Themes/Windows/resources.qrc new file mode 100644 index 0000000..f7ffc64 --- /dev/null +++ b/plugins-alternative/Themes/Windows/resources.qrc @@ -0,0 +1,10 @@ + + + resources/icon.png + resources/arrow-down.png + resources/arrow-up.png + resources/SystemTrayIcon/informations.png + resources/icon-top.png + resources/empty.png + + diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/informations.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/informations.png new file mode 100644 index 0000000..5b7b255 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/informations.png differ diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Unix.png new file mode 100644 index 0000000..6f5d1cf Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Windows.png new file mode 100644 index 0000000..5464856 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png new file mode 100644 index 0000000..3961215 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png new file mode 100644 index 0000000..45d6315 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Unix.png new file mode 100644 index 0000000..ac4299a Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Windows.png new file mode 100644 index 0000000..6e6bae7 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Windows/resources/arrow-down.png b/plugins-alternative/Themes/Windows/resources/arrow-down.png new file mode 100644 index 0000000..39b5c37 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/arrow-down.png differ diff --git a/plugins-alternative/Themes/Windows/resources/arrow-up.png b/plugins-alternative/Themes/Windows/resources/arrow-up.png new file mode 100644 index 0000000..5c824fb Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/arrow-up.png differ diff --git a/plugins-alternative/Themes/Windows/resources/empty.png b/plugins-alternative/Themes/Windows/resources/empty.png new file mode 100644 index 0000000..846d96d Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/empty.png differ diff --git a/plugins-alternative/Themes/Windows/resources/icon-top.png b/plugins-alternative/Themes/Windows/resources/icon-top.png new file mode 100644 index 0000000..64b7992 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/icon-top.png differ diff --git a/plugins-alternative/Themes/Windows/resources/icon-top.xcf b/plugins-alternative/Themes/Windows/resources/icon-top.xcf new file mode 100644 index 0000000..9a775e2 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/icon-top.xcf differ diff --git a/plugins-alternative/Themes/Windows/resources/icon.png b/plugins-alternative/Themes/Windows/resources/icon.png new file mode 100644 index 0000000..eccfbc5 Binary files /dev/null and b/plugins-alternative/Themes/Windows/resources/icon.png differ diff --git a/plugins-alternative/Themes/Windows/resources_unix.qrc b/plugins-alternative/Themes/Windows/resources_unix.qrc new file mode 100644 index 0000000..3904f69 --- /dev/null +++ b/plugins-alternative/Themes/Windows/resources_unix.qrc @@ -0,0 +1,7 @@ + + + resources/SystemTrayIcon/systray_Caught_Unix.png + resources/SystemTrayIcon/systray_Semiuncaught_Unix.png + resources/SystemTrayIcon/systray_Uncaught_Unix.png + + diff --git a/plugins-alternative/Themes/Windows/resources_windows.qrc b/plugins-alternative/Themes/Windows/resources_windows.qrc new file mode 100644 index 0000000..28666fc --- /dev/null +++ b/plugins-alternative/Themes/Windows/resources_windows.qrc @@ -0,0 +1,7 @@ + + + resources/SystemTrayIcon/systray_Caught_Windows.png + resources/SystemTrayIcon/systray_Semiuncaught_Windows.png + resources/SystemTrayIcon/systray_Uncaught_Windows.png + + diff --git a/plugins-alternative/static-plugins-supercopier.qrc b/plugins-alternative/static-plugins-supercopier.qrc new file mode 100644 index 0000000..d3ae224 --- /dev/null +++ b/plugins-alternative/static-plugins-supercopier.qrc @@ -0,0 +1,6 @@ + + + Themes/Supercopier/informations.xml + Themes/Supercopier/Languages/fr/translation.qm + + diff --git a/plugins/CopyEngine/Rsync/Rsync.pro b/plugins/CopyEngine/Rsync/Rsync.pro new file mode 100644 index 0000000..168fadd --- /dev/null +++ b/plugins/CopyEngine/Rsync/Rsync.pro @@ -0,0 +1,2 @@ +include(../Ultracopier/CopyEngine.pro) +DEFINES += ULTRACOPIER_PLUGIN_RSYNC diff --git a/plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.cpp b/plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.cpp deleted file mode 100644 index af5805b..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/** \file AvancedQFile.cpp -\brief Define the QFile herited class to set file date/time -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include "AvancedQFile.h" - -#ifdef Q_CC_GNU -//this next header is needed to change file time/date under gcc -#include -#include -#endif - -//source -//hSrc=CreateFile(pData->pfiSrcFile->GetFullFilePath(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); -//destination -//hDst=CreateFile(pData->strDstFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); - -bool AvancedQFile::setCreated(QDateTime time) -{ - time_t ctime=time.toTime_t(); - #ifdef Q_CC_GNU - //creation time not exists into unix world - Q_UNUSED(ctime) - return true; - #else - setErrorString(tr("Not supported on this platform")); - return false; - #endif -} - -bool AvancedQFile::setLastModified(QDateTime time) -{ - time_t actime=QFileInfo(*this).lastRead().toTime_t(); - //protect to wrong actime - if(actime<0) - actime=0; - time_t modtime=time.toTime_t(); - if(modtime<0) - { - setErrorString(tr("Last modified date is wrong")); - return false; - } - #ifdef Q_CC_GNU - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - int returnVal=utime(this->fileName().toLocal8Bit().data(),&butime); - if(returnVal==0) - return true; - else - { - setErrorString(strerror(errno)); - return false; - } - #else - setErrorString(tr("Not supported on this platform")); - return false; - #endif -} - -bool AvancedQFile::setLastRead(QDateTime time) -{ - time_t modtime=QFileInfo(*this).lastModified().toTime_t(); - //protect to wrong actime - if(modtime<0) - modtime=0; - time_t actime=time.toTime_t(); - if(actime<0) - { - setErrorString(tr("Last access date is wrong")); - return false; - } - #ifdef Q_CC_GNU - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - int returnVal=utime(this->fileName().toLocal8Bit().data(),&butime); - if(returnVal==0) - return true; - else - { - setErrorString(strerror(errno)); - return false; - } - #else - setErrorString(tr("Not supported on this platform")); - return false; - #endif -} - diff --git a/plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.h b/plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.h deleted file mode 100644 index 284cf02..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/AvancedQFile.h +++ /dev/null @@ -1,32 +0,0 @@ -/** \file AvancedQFile.h -\brief Define the QFile herited class to set file date/time -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef AVANCEDQFILE_H -#define AVANCEDQFILE_H - -#include -#include -#include - -/// \brief devired class from QFile to set time/date on file -class AvancedQFile : public QFile -{ - Q_OBJECT -public: - /// \brief set created date, not exists in unix world - bool setCreated(QDateTime time); - /// \brief set last modification date - bool setLastModified(QDateTime time); - /// \brief set last read date - bool setLastRead(QDateTime time); - -/* //fileName - void close(); - bool open ( FILE * fh, OpenMode mode ) - bool open ( int fd, OpenMode mode )*/ -}; - -#endif // AVANCEDQFILE_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/CompilerInfo.h b/plugins/CopyEngine/Ultracopier-0.3/CompilerInfo.h deleted file mode 100644 index 84625b9..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/CompilerInfo.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../CompilerInfo.h" diff --git a/plugins/CopyEngine/Ultracopier-0.3/DebugEngineMacro.h b/plugins/CopyEngine/Ultracopier-0.3/DebugEngineMacro.h deleted file mode 100644 index ad08d4f..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/DebugEngineMacro.h +++ /dev/null @@ -1,25 +0,0 @@ -/** \file DebugEngineMacro.h -\brief Define the macro for the debug -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef DEBUGENGINEMACRO_H -#define DEBUGENGINEMACRO_H - -/// \brief Macro for the debug log -#ifdef ULTRACOPIER_PLUGIN_DEBUG - #if defined (__FILE__) && defined (__LINE__) - #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b,__FILE__,__LINE__) - #else - #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b) - #endif -#else // ULTRACOPIER_PLUGIN_DEBUG - #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() -#endif // ULTRACOPIER_PLUGIN_DEBUG - -#endif // DEBUGENGINEMACRO_H - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Environment.h b/plugins/CopyEngine/Ultracopier-0.3/Environment.h deleted file mode 100644 index 7ac6f16..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Environment.h +++ /dev/null @@ -1,12 +0,0 @@ -/** \file Environment.h -\brief Define the environment variable and global function -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include "Variable.h" -/// \brief The global include -#include "StructEnumDefinition.h" -#include "StructEnumDefinition_CopyEngine.h" -#include "DebugEngineMacro.h" -#include "CompilerInfo.h" diff --git a/plugins/CopyEngine/Ultracopier-0.3/FilterRules.cpp b/plugins/CopyEngine/Ultracopier-0.3/FilterRules.cpp deleted file mode 100644 index 0e6ba25..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/FilterRules.cpp +++ /dev/null @@ -1,193 +0,0 @@ -#include "FilterRules.h" -#include "ui_FilterRules.h" - -#include - -FilterRules::FilterRules(QWidget *parent) : - QDialog(parent), - ui(new Ui::FilterRules) -{ - ui->setupUi(this); - updateChecking(); - haveBeenValided=false; -} - -FilterRules::~FilterRules() -{ - delete ui; -} - -bool FilterRules::getIsValid() -{ - return isValid && haveBeenValided; -} - -QString FilterRules::get_search_text() -{ - return ui->search->text(); -} - -SearchType FilterRules::get_search_type() -{ - switch(ui->search_type->currentIndex()) - { - case 0: - return SearchType_rawText; - case 1: - return SearchType_simpleRegex; - case 2: - return SearchType_perlRegex; - } - return SearchType_simpleRegex; -} - -ApplyOn FilterRules::get_apply_on() -{ - switch(ui->apply_on->currentIndex()) - { - case 0: - return ApplyOn_file; - case 1: - return ApplyOn_fileAndFolder; - case 2: - return ApplyOn_folder; - } - return ApplyOn_fileAndFolder; -} - -bool FilterRules::get_need_match_all() -{ - return ui->need_match_all->isChecked(); -} - -void FilterRules::set_search_text(QString search_text) -{ - ui->search->setText(search_text); -} - -void FilterRules::set_search_type(SearchType search_type) -{ - switch(search_type) - { - case SearchType_rawText: - ui->search_type->setCurrentIndex(0); - break; - case SearchType_simpleRegex: - ui->search_type->setCurrentIndex(1); - break; - case SearchType_perlRegex: - ui->search_type->setCurrentIndex(2); - break; - } -} - -void FilterRules::set_apply_on(ApplyOn apply_on) -{ - switch(apply_on) - { - case ApplyOn_file: - ui->apply_on->setCurrentIndex(0); - break; - case ApplyOn_fileAndFolder: - ui->apply_on->setCurrentIndex(1); - break; - case ApplyOn_folder: - ui->apply_on->setCurrentIndex(2); - break; - } -} - -void FilterRules::set_need_match_all(bool need_match_all) -{ - ui->need_match_all->setChecked(need_match_all); -} - -void FilterRules::on_search_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateChecking(); -} - -void FilterRules::updateChecking() -{ - QRegExp regex; - isValid=!ui->search->text().isEmpty(); - if(isValid) - { - QString tempString; - if(ui->search_type->currentIndex()==0) - { - tempString=QRegExp::escape(ui->search->text()); - if(tempString.contains('/') || tempString.contains('\\')) - isValid=false; - } - else if(ui->search_type->currentIndex()==1) - { - tempString=QRegExp::escape(ui->search->text()); - tempString.replace("\\*","[^\\\\/]*"); - } - else if(ui->search_type->currentIndex()==2) - { - tempString=ui->search->text(); - if(tempString.startsWith('^') && tempString.endsWith('$')) - { - ui->need_match_all->setChecked(true); - tempString.remove(QRegExp("^\\^")); - tempString.remove(QRegExp("\\$$")); - ui->search->setText(tempString); - } - } - if(isValid) - { - if(ui->need_match_all->isChecked()) - tempString="^"+tempString+"$"; - regex=QRegExp(tempString); - isValid=regex.isValid() && !regex.isEmpty(); - } - } - - ui->isValid->setChecked(isValid); - ui->testString->setEnabled(isValid); - ui->label_test_string->setEnabled(isValid); - ui->matched->setEnabled(isValid); - ui->matched->setChecked(isValid && ui->testString->text().contains(regex)); - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid); -} - -void FilterRules::on_isValid_clicked() -{ - updateChecking(); -} - -void FilterRules::on_testString_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateChecking(); -} - -void FilterRules::on_matched_clicked() -{ - updateChecking(); -} - -void FilterRules::on_search_type_currentIndexChanged(int index) -{ - Q_UNUSED(index); - updateChecking(); -} - -void FilterRules::on_need_match_all_clicked() -{ - updateChecking(); -} - -void FilterRules::on_buttonBox_clicked(QAbstractButton *button) -{ - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) - reject(); - else - { - haveBeenValided=true; - accept(); - } -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/FilterRules.h b/plugins/CopyEngine/Ultracopier-0.3/FilterRules.h deleted file mode 100644 index f06f0cb..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/FilterRules.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef FILTERRULES_H -#define FILTERRULES_H - -#include -#include -#include - -#include "StructEnumDefinition_CopyEngine.h" - -namespace Ui { -class FilterRules; -} - -/** All the filter rules to include/exclude some file during the listing */ -class FilterRules : public QDialog -{ - Q_OBJECT - -public: - explicit FilterRules(QWidget *parent = 0); - ~FilterRules(); - bool getIsValid(); - QString get_search_text(); - SearchType get_search_type(); - ApplyOn get_apply_on(); - bool get_need_match_all(); - void set_search_text(QString search_text); - void set_search_type(SearchType search_type); - void set_apply_on(ApplyOn apply_on); - void set_need_match_all(bool need_match_all); -private slots: - void on_search_textChanged(const QString &arg1); - void on_isValid_clicked(); - void on_testString_textChanged(const QString &arg1); - void on_matched_clicked(); - void on_search_type_currentIndexChanged(int index); - void on_need_match_all_clicked(); - void on_buttonBox_clicked(QAbstractButton *button); -private: - Ui::FilterRules *ui; - void updateChecking(); - bool isValid; - bool haveBeenValided; -}; - -#endif // FILTERRULES_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/FilterRules.ui b/plugins/CopyEngine/Ultracopier-0.3/FilterRules.ui deleted file mode 100644 index fad35cd..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/FilterRules.ui +++ /dev/null @@ -1,162 +0,0 @@ - - - FilterRules - - - Qt::WindowModal - - - - 0 - 0 - 289 - 231 - - - - Filters dialog - - - - :/resources/filter.png:/resources/filter.png - - - - 1 - - - 1 - - - - - Search: - - - - - - - - - - Search type: - - - - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - - - - Apply on: - - - - - - - - File - - - - - Folder - - - - - File and folder - - - - - - - - All string need match - - - - - - - Checking - - - - - - The regex is valid - - - - - - - Test string: - - - - - - - - - - The test string match with the regex - - - - - - - - - - - - Qt::Horizontal - - - - 68 - 20 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Filters.cpp b/plugins/CopyEngine/Ultracopier-0.3/Filters.cpp deleted file mode 100644 index ce87b52..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Filters.cpp +++ /dev/null @@ -1,456 +0,0 @@ -#include "Filters.h" -#include "ui_Filters.h" - -#include - -Filters::Filters(QWidget *parent) : - QDialog(parent), - ui(new Ui::Filters) -{ - ui->setupUi(this); -} - -Filters::~Filters() -{ - delete ui; -} - -void Filters::setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) -{ - if(includeStrings.size()!=includeOptions.size() || excludeStrings.size()!=excludeOptions.size()) - return; - Filters_rules new_item; - - include.clear(); - int index=0; - while(indexinclusion->clear(); - int index=0; - while(indexinclusion->addItem(new QListWidgetItem(entryShow)); - index++; - } - ui->exclusion->clear(); - index=0; - while(indexexclusion->addItem(new QListWidgetItem(entryShow)); - index++; - } -} - -QList Filters::getInclude() -{ - return include; -} - -QList Filters::getExclude() -{ - return exclude; -} - -void Filters::newLanguageLoaded() -{ - ui->retranslateUi(this); - reShowAll(); -} - -void Filters::haveNewFilters() -{ - QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; - int index=0; - while(indexexclusion->count()) - { - if(ui->exclusion->item(index)->isSelected()) - { - delete ui->exclusion->item(index); - exclude.removeAt(index); - removedEntry=true; - } - else - index++; - } - if(removedEntry) - { - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_remove_inclusion_clicked() -{ - bool removedEntry=false; - int index=0; - while(indexinclusion->count()) - { - if(ui->inclusion->item(index)->isSelected()) - { - delete ui->inclusion->item(index); - include.removeAt(index); - removedEntry=true; - } - else - index++; - } - if(removedEntry) - { - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_add_exclusion_clicked() -{ - FilterRules dialog(this); - dialog.exec(); - if(dialog.getIsValid()) - { - Filters_rules new_item; - new_item.apply_on=dialog.get_apply_on(); - new_item.need_match_all=dialog.get_need_match_all(); - new_item.search_text=dialog.get_search_text(); - new_item.search_type=dialog.get_search_type(); - exclude << new_item; - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_buttonBox_clicked(QAbstractButton *button) -{ - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) - reject(); -} - -void Filters::on_add_inclusion_clicked() -{ - FilterRules dialog(this); - dialog.exec(); - if(dialog.getIsValid()) - { - Filters_rules new_item; - new_item.apply_on=dialog.get_apply_on(); - new_item.need_match_all=dialog.get_need_match_all(); - new_item.search_text=dialog.get_search_text(); - new_item.search_type=dialog.get_search_type(); - if(convertToRegex(new_item)) - include << new_item; - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_edit_exclusion_clicked() -{ - bool editedEntry=false; - int index=0; - while(indexexclusion->count()) - { - if(ui->exclusion->item(index)->isSelected()) - { - FilterRules dialog(this); - dialog.set_apply_on(exclude[index].apply_on); - dialog.set_need_match_all(exclude[index].need_match_all); - dialog.set_search_text(exclude[index].search_text); - dialog.set_search_type(exclude[index].search_type); - dialog.exec(); - if(dialog.getIsValid()) - { - exclude[index].apply_on=dialog.get_apply_on(); - exclude[index].need_match_all=dialog.get_need_match_all(); - exclude[index].search_text=dialog.get_search_text(); - exclude[index].search_type=dialog.get_search_type(); - if(!convertToRegex(exclude[index])) - exclude.removeAt(index); - editedEntry=true; - } - } - index++; - } - if(editedEntry) - { - reShowAll(); - haveNewFilters(); - } -} - -void Filters::on_edit_inclusion_clicked() -{ - bool editedEntry=false; - int index=0; - while(indexinclusion->count()) - { - if(ui->inclusion->item(index)->isSelected()) - { - FilterRules dialog(this); - dialog.set_apply_on(exclude[index].apply_on); - dialog.set_need_match_all(exclude[index].need_match_all); - dialog.set_search_text(exclude[index].search_text); - dialog.set_search_type(exclude[index].search_type); - dialog.exec(); - if(dialog.getIsValid()) - { - exclude[index].apply_on=dialog.get_apply_on(); - exclude[index].need_match_all=dialog.get_need_match_all(); - exclude[index].search_text=dialog.get_search_text(); - exclude[index].search_type=dialog.get_search_type(); - if(!convertToRegex(exclude[index])) - exclude.removeAt(index); - editedEntry=true; - } - } - index++; - } - if(editedEntry) - { - reShowAll(); - haveNewFilters(); - } -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/Filters.h b/plugins/CopyEngine/Ultracopier-0.3/Filters.h deleted file mode 100644 index dcdcb36..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Filters.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef FILTERS_H -#define FILTERS_H - -#include -#include - -#include "FilterRules.h" -#include "StructEnumDefinition_CopyEngine.h" - -namespace Ui { -class Filters; -} - -/** To add/edit one filter rules */ -class Filters : public QDialog -{ - Q_OBJECT -public: - explicit Filters(QWidget *parent = 0); - ~Filters(); - void setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void reShowAll(); - QList getInclude(); - QList getExclude(); - void newLanguageLoaded(); -private: - Ui::Filters *ui; - QList include; - QList exclude; - void haveNewFilters(); - bool convertToRegex(Filters_rules &item); -signals: - void sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); -private slots: - void on_remove_exclusion_clicked(); - void on_remove_inclusion_clicked(); - void on_add_exclusion_clicked(); - void on_buttonBox_clicked(QAbstractButton *button); - void on_add_inclusion_clicked(); - void on_edit_exclusion_clicked(); - void on_edit_inclusion_clicked(); -}; - -#endif // FILTERS_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/Filters.ui b/plugins/CopyEngine/Ultracopier-0.3/Filters.ui deleted file mode 100644 index db8577c..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Filters.ui +++ /dev/null @@ -1,194 +0,0 @@ - - - Filters - - - - 0 - 0 - 507 - 502 - - - - Filters - - - - :/resources/filter.png:/resources/filter.png - - - - 1 - - - 1 - - - - - Exclusion filter - - - - 1 - - - 2 - - - - - QAbstractItemView::MultiSelection - - - - - - - - - - :/resources/add.png:/resources/add.png - - - - - - - - :/resources/edit.png:/resources/edit.png - - - - - - - - :/resources/remove.png:/resources/remove.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - Inclusion filter - - - - 1 - - - 2 - - - - - None = Include all - - - - - - - - - QAbstractItemView::MultiSelection - - - - - - - - - - :/resources/add.png:/resources/add.png - - - - - - - - :/resources/edit.png:/resources/edit.png - - - - - - - - :/resources/remove.png:/resources/remove.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QDialogButtonBox::Cancel - - - - - - - - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/ar/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/ar/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/ar/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/de/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/de/translation.ts deleted file mode 100644 index 08c7422..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/de/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Auf dieser Plattform nicht unterstützt - - - - Last modified date is wrong - Datum der letzten Änderung ist falsch - - - - Last access date is wrong - Datum des letzten Zugriffs ist falsch - - - - Factory - - - - Options error - Optionen Fehler - - - - - Options engine is not loaded, can't access to the filters - Optionen Motor nicht geladen wird, kann nicht auf die Filter zu übersetzen - - - - FilterRules - - - Search: - Suche: - - - - Search type: - Suche Typ: - - - - Raw text - Roh text - - - - Simplified regex - Vereinfachte regex - - - - Perl's regex - Perl's regex - - - - Apply on: - Anwenden auf: - - - - File - Datei - - - - Folder - Ordner - - - - File and folder - Datei-und Ordnernamen - - - - All string need match - Alle Saite muss passen - - - - Checking - Überprüfung - - - - Test string: - Test-String: - - - - Filters dialog - Filters dialog - - - - The regex is valid - Die Regex ist gültig - - - - The test string match with the regex - Der Test-String Match mit dem regex - - - - Filters - - - Filters - Filter - - - - Exclusion filter - Ausschluss-Filter - - - - Inclusion filter - Einbeziehungsfilter - - - - None = Include all - None = Schließt alle - - - - - Raw text - Roh text - - - - - Simplified regex - Vereinfachte regex - - - - - Perl's regex - Perl's regex - - - - - Only on file - Nur auf Datei - - - - - Only on folder - Nur auf Ordner - - - - - - - Full match - Spielaufzeichnung - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Kann nicht tun, verschieben oder kopieren Artikel in den falschen gezwungen Modus: %1 - - - - Unable to save the transfer list: %1 - Unfähig, die Transferliste sparen: %1 - - - - Problem at the reading, or file size is null - Problem an der Lektüre, der Oder Dateigröße IST Null - - - - Wrong header: "%1" - Falsche Header: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - Die Transferliste ist im gemischten Modus, aber diese Instanz ist in diesem Modus nicht - - - - The transfer list is in copy mode, but this instance is not in this mode - Die Transferliste ist im Copy-Mode, aber dieser Fall ist in diesem Modus nicht - - - - The transfer list is in move mode, but this instance is not in this mode - Die Transferliste ist in Verschiebe-Modus, aber diese Instanz ist in diesem Modus nicht - - - - Some error have been found during the line parsing - Einige Fehler wurden während des Parsing gefunden - - - - Unable to open the transfer list: %1 - Unfähig, die Transferliste geöffnet: %1 - - - - MkPath - - - Unable to create the folder - Der Ordner kann nicht erstellt - - - - ReadThread - - - - Unable to read the source file: - Unfähig, die Quelldatei zu lesen: - - - - - File truncated during the read, possible data change - Datei während der Lese, möglich Datenänderung abgeschnitten - - - - RenamingRules - - - First renaming - erste Umbenennung - - - - %name% - copy - %name% should not be translated - %name% - kopieren - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>Variablen: <span style=" font-weight:600;">%name%</span> für den ursprünglichen Dateinamen</p></body></html> - - - - Second renaming - zweite Umbenennung - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - kopieren (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>Variablen: <span style=" font-weight:600;">%name%</span> für den ursprünglichen Dateinamen</p><p><span style=" font-weight:600;">%number%</span> für die zusätzliche Zahl</p></body></html> - - - - - %1 - copy - %1 - kopieren - - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - Renaming rules - Umbenennen von Regeln - - - - RmPath - - - Unable to remove the folder - Der Ordner kann nicht entfernen - - - - TransferThread - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - The checksums not match - Die Prüfsummen nicht überein - - - - WriteThread - - - Unable to read the source file: - Unfähig, die Quelldatei zu lesen: - - - - File truncated during the read, possible data change - Datei während der Lese, möglich Datenänderung abgeschnitten - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Der Motor wird gezwungen sich zu bewegen, können Sie mit ihr nicht zu kopieren - - - - - The engine is forced to copy, you can't move with it - Der Motor ist gezwungen, zu kopieren, können Sie nicht mit ihm bewegen - - - - The mode have been forced previously, it's internal error, please report it - Der Modus wurden vorher gezwungen, es interner Fehler ist, melden Sie dies bitte - - - - Options error - Optionen Fehler - - - - Options engine is not loaded, can't access to the filters - Optionen Motor nicht geladen wird, kann nicht auf die Filter zu übersetzen - - - - fileErrorDialog - - - Error on file - Fehler bei der Datei - - - - Error - Fehler - - - - Size - Größe - - - - Modified - Geändert - - - - File name - Dateiname - - - - &Always do this action - Immer diese Aktion - - - - Put to bottom - Legen Sie nach unten - - - - Retry - Wiederholen - - - - &Skip - überspringen - - - - &Cancel - Stornieren - - - - Error on folder - Fehler auf Ordner - - - - Folder name - Ordnername - - - - fileExistsDialog - - - The file exists - Die Datei existiert - - - - Source - Quelle - - - - Destination - Ziel - - - - - Size - Größe - - - - - Modified - Geändert - - - - - File name - Dateiname - - - - Suggest new &name - Schlagen neuen Namen - - - - &Always do this action - Immer diese Aktion - - - - &Rename - Umbenennen - - - - &Overwrite - überschreiben - - - - &Skip - überspringen - - - - &Cancel - Stornieren - - - - Overwrite if newer - Überschreiben, wenn neuere - - - - Overwrite if not same modification date - Überschreiben, wenn nicht gleiche Änderungsdatum - - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - fileIsSameDialog - - - This files are the same file - Diese Dateien sind die gleiche Datei - - - - The source and destination is same - Die Quelle und das Ziel ist dasselbe - - - - Size - Größe - - - - Modified - Geändert - - - - File name - Dateiname - - - - Suggest new &name - Schlagen neuen Namen - - - - &Always do this action - Immer diese Aktion - - - - &Rename - Umbenennen - - - - &Skip - überspringen - - - - &Cancel - Stornieren - - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - folderExistsDialog - - - This folders are the same folder - Diese Ordner sind die gleichen Ordner - - - - Source - Quelle - - - - Destination - Ziel - - - - The source and destination is same - Die Quelle und das Ziel ist dasselbe - - - - - Modified - Geändert - - - - - Folder name - Ordnername - - - - Suggest new &name - Schlagen neuen Namen - - - - &Always do this action - Immer diese Aktion - - - - &Rename - Umbenennen - - - - Merge - Fusionieren - - - - Skip - überspringen - - - - &Cancel - Stornieren - - - - Folder already exists - Ordner bereits vorhanden ist - - - - %1 - copy - %1 - kopieren - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - options - - - Transfer the file rights - Übertragen Sie die Datei Rechte - - - - Keep the file date - Halten Sie das Datei-Datum - - - - Block size - Blockgröße - - - - - KB - KB - - - - Auto start the transfer - Auto starten Sie die Übertragung - - - - When folder error - Wenn Ordner Fehler - - - - - Ask - Fragen - - - - - Skip - überspringen - - - - Merge - Fusionieren - - - - Rename - Umbenennen - - - - Check if destination folder exists - Prüfen Sie, ob Zielordner vorhanden ist - - - - When folder collision - Wenn Ordner Kollision - - - - Checksum - Checksum - - - - Only after error - Erst nach dem Fehler - - - - Ignore if impossible - Ignorieren, wenn nicht - - - - Do checksum - Haben checksum - - - - Enable OS buffer - Aktivieren Sie OS-Puffer - - - - Filters - Filter - - - - Renaming rules - Umbenennen von Regeln - - - - OS buffer only if smaller than - OS-Puffer, wenn kleiner als - - - - scanFileOrFolder - - - - %1 - copy - %1 - kopieren - - - - - %1 - copy (%2) - %1 - kopieren (%2) - - - - The folder not exists - Der Ordner existiert nicht - - - - The folder is not readable - Der Ordner ist nicht lesbar - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/el/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/el/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/el/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/es/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/es/translation.ts deleted file mode 100644 index fd90e5e..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/es/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - No es compatible con esta plataforma - - - - Last modified date is wrong - Fecha de última modificación es incorrecto - - - - Last access date is wrong - Fecha de último acceso es incorrecto - - - - Factory - - - - Options error - Error de opciones - - - - - Options engine is not loaded, can't access to the filters - Opciones del motor no está cargado, no se puede acceder a los filtros - - - - FilterRules - - - Search: - Buscar: - - - - Search type: - Tipo de búsqueda: - - - - Raw text - texto Fuente - - - - Simplified regex - Regex simplificado - - - - Perl's regex - Perl's regex - - - - Apply on: - Aplicar sobre: - - - - File - Archivos - - - - Folder - Carpeta - - - - File and folder - Archivos y carpeta - - - - All string need match - Todas las líneas tiene por qué coincidir - - - - Checking - Verification - - - - Test string: - Prueba de la cuerda: - - - - Filters dialog - Filtros de diálogo - - - - The regex is valid - La expresión regular es válido - - - - The test string match with the regex - La coincidencia con la cadena de prueba con la expresión regular - - - - Filters - - - Filters - Filtros - - - - Exclusion filter - Exclusión filtro - - - - Inclusion filter - La inclusión del filtro - - - - None = Include all - Ninguno = Incluya todos los - - - - - Raw text - texto Fuente - - - - - Simplified regex - Simplificado regex - - - - - Perl's regex - Perl's regex - - - - - Only on file - Sólo en el archivo - - - - - Only on folder - Sólo en la carpeta - - - - - - - Full match - Partido completo - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - No se puede hacer para mover o copiar elemento en modo incorrecto obligado: %1 - - - - Unable to save the transfer list: %1 - No se puede guardar la lista de transferencias: %1 - - - - Problem at the reading, or file size is null - Problema en la lectura, o el tamaño del archivo es nulo - - - - Wrong header: "%1" - Encabezado incorrecto: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - La lista de transferencia está en modo mixto, pero este caso no es de este modo - - - - The transfer list is in copy mode, but this instance is not in this mode - La lista de transferencia está en el modo de copia, pero esta instancia no está en este modo - - - - The transfer list is in move mode, but this instance is not in this mode - La lista de transferencia es el modo de desplazamiento, pero esta instancia no está en este modo - - - - Some error have been found during the line parsing - Algunos errores han sido encontrados durante el análisis de línea - - - - Unable to open the transfer list: %1 - No se puede abrir la lista de transferencias: %1 - - - - MkPath - - - Unable to create the folder - No se puede crear la carpeta - - - - ReadThread - - - - Unable to read the source file: - No se puede leer el archivo de origen: - - - - - File truncated during the read, possible data change - Archivo truncada durante el cambio de lectura, los datos posibles - - - - RenamingRules - - - First renaming - En primer lugar el cambio de nombre - - - - %name% - copy - %name% should not be translated - %name% - copia - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> para el nombre del archivo original</p></body></html> - - - - Second renaming - En segundo lugar el cambio de nombre - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - copia (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> para el nombre del archivo original</p><p><span style=" font-weight:600;">%number%</span> para el número adicional</p></body></html> - - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - Renaming rules - Reglas de Cambio de nombre - - - - RmPath - - - Unable to remove the folder - No se puede eliminar la carpeta - - - - TransferThread - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The checksums not match - Las sumas de comprobación no coincide - - - - WriteThread - - - Unable to read the source file: - No se puede leer el archivo de origen: - - - - File truncated during the read, possible data change - Archivo truncada durante el cambio de lectura, los datos posibles - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - El motor se ve obligado a moverse, no se puede copiar con ella - - - - - The engine is forced to copy, you can't move with it - El motor se ve obligado a copiar, no te puedes mover con él - - - - The mode have been forced previously, it's internal error, please report it - El modo se han visto obligados con anterioridad, es un error interno, por favor repórtelo - - - - Options error - Opciones de error - - - - Options engine is not loaded, can't access to the filters - Opciones del motor no está cargado, no se puede acceder a los filtros - - - - fileErrorDialog - - - Error on file - Error en el archivo - - - - Error - Error - - - - Size - Tamaño - - - - Modified - Modificado - - - - File name - Nombre de archivo - - - - &Always do this action - Siempre hacer esta acción - - - - Put to bottom - Ponga a abajo - - - - Retry - Reintentar - - - - &Skip - Omitir - - - - &Cancel - Cancelar - - - - Error on folder - Error en la carpeta - - - - Folder name - Nombre de la carpeta - - - - fileExistsDialog - - - The file exists - El archivo ya existe - - - - Source - Fuente - - - - Destination - Destino - - - - - Size - Tamaño - - - - - Modified - Modificado - - - - - File name - Nombre de archivo - - - - Suggest new &name - Sugerir nuevo nombre - - - - &Always do this action - Siempre hacer esta acción - - - - &Rename - Cambiar el nombre - - - - &Overwrite - Sobrescribir - - - - &Skip - Omitir - - - - &Cancel - Cancelar - - - - Overwrite if newer - Sobrescribir si nuevo - - - - Overwrite if not same modification date - Sobrescribir si no es misma fecha de modificación - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - fileIsSameDialog - - - This files are the same file - Estos archivos son el mismo archivo - - - - The source and destination is same - La fuente y el destino es el mismo - - - - Size - Tamaño - - - - Modified - Modificado - - - - File name - Nombre de archivo - - - - Suggest new &name - Sugerir nuevo nombre - - - - &Always do this action - Siempre hacer esta acción - - - - &Rename - Cambiar el nombre - - - - &Skip - Omitir - - - - &Cancel - Cancelar - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - folderExistsDialog - - - This folders are the same folder - Esta carpeta es la misma carpeta - - - - Source - Fuente - - - - Destination - Destino - - - - The source and destination is same - La fuente y el destino es el mismo - - - - - Modified - Modificado - - - - - Folder name - Nombre de la carpeta - - - - Suggest new &name - Sugerir nuevo nombre - - - - &Always do this action - Siempre hacer esta acción - - - - &Rename - Cambiar el nombre - - - - Merge - Unir - - - - Skip - Omitir - - - - &Cancel - Cancelar - - - - Folder already exists - Carpeta ya existe - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - options - - - Transfer the file rights - Transferencia de los derechos de archivo - - - - Keep the file date - Mantener la fecha de archivo - - - - Block size - Tamaño del bloque - - - - - KB - KB - - - - Auto start the transfer - Auto iniciar la transferencia - - - - When folder error - Cuando el error carpeta - - - - - Ask - Pedir - - - - - Skip - Omitir - - - - Merge - Unir - - - - Rename - Cambiar el nombre - - - - Check if destination folder exists - Compruebe si existe la carpeta de destino - - - - When folder collision - Cuando la colisión carpeta - - - - Checksum - Suma de comprobación - - - - Only after error - Sólo después de un error - - - - Ignore if impossible - No haga caso si no es posible - - - - Do checksum - Hacer suma de comprobación - - - - Enable OS buffer - Habilitar el OS de amortiguación - - - - Filters - Filtros - - - - Renaming rules - Reglas de Cambio de nombre - - - - OS buffer only if smaller than - OS de amortiguación sólo si menor que - - - - scanFileOrFolder - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The folder not exists - La carpeta no existe - - - - The folder is not readable - La carpeta no se puede leer - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/fr/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/fr/translation.ts deleted file mode 100644 index 56e2373..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/fr/translation.ts +++ /dev/null @@ -1,799 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Non supporté sur cette plateforme - - - - Last modified date is wrong - Date de dernière modification du fichier fausse - - - - Last access date is wrong - Date du dernier accès au fichier fausse - - - - Factory - - - - Options error - Erreur d'options - - - - - Options engine is not loaded, can't access to the filters - Moteur d'options non chargé, impossible d'accédrer aux filtres - - - - FilterRules - - - Search: - Recherche: - - - - Search type: - Type de recherche: - - - - Raw text - Texte brute - - - - Simplified regex - Regex simplifié - - - - Perl's regex - Regex perl - - - - Apply on: - Appliquer sur: - - - - File - Fichier - - - - Folder - Dossier - - - - File and folder - Fichier et dossier - - - - All string need match - Toute la chaine doit correspondre - - - - Checking - Vérification - - - - Test string: - Chaine de teste: - - - - Filters dialog - Dialogue des filtres - - - - The regex is valid - La regex est valid - - - - The test string match with the regex - La chaine de teste corresponds avec la regex - - - - Filters - - - Filters - Filtres - - - - Exclusion filter - Filtre d'exclusion - - - - Inclusion filter - Filtre d'inclusion - - - - None = Include all - Aucun = tout inclure - - - - - Raw text - Texte brute - - - - - Simplified regex - Regex simplifié - - - - - Perl's regex - Regex perl - - - - - Only on file - Appliquer sur fichier - - - - - Only on folder - Appliquer sur dossier - - - - - - - Full match - Correspondance totale - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Impossible de faire un déplacement ou une copie dans le mauvais mode forcé: %1 - - - - Unable to save the transfer list: %1 - Impossible de sauvegarde la liste de transfer: %1 - - - - Problem at the reading, or file size is null - Probléme à la lecture, ou fichier de taille nulle - - - - Wrong header: "%1" - Mauvaise en-tête: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - La list de transfer est en mode mixte, mais l'instance n'est pas dans ce mode - - - - The transfer list is in copy mode, but this instance is not in this mode - La list de transfer est en mode copie, mais l'instance n'est pas dans ce mode - - - - The transfer list is in move mode, but this instance is not in this mode - La list de transfer est en mode déplacement, mais l'instance n'est pas dans ce mode - - - - Some error have been found during the line parsing - Quelque erreur ont été trouvé durrant l'analise des lignes - - - - Unable to open the transfer list: %1 - Impossible d'ouvrir la list de transfer: %1 - - - - MkPath - - - Unable to create the folder - Impossible de créer le répertoire - - - - ReadThread - - - - Unable to read the source file: - Impossible de lire le fichier source: - - - - - File truncated during the read, possible data change - Fichier diminué durrant la lecture, possible changement de données - - - - RenamingRules - - - First renaming - Premier renommage - - - - %name% - copy - %name% should not be translated - variables need never be translated - %name% - copie - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - variables need never be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> pour le nom originel</p></body></html> - - - - Second renaming - Seconds renommage - - - - %name% - copy (%number%) - %name%, %number% should not be translated - variables need never be translated - %name% - copie (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - variables need never be translated - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> pour le nom originel</p><p><span style=" font-weight:600;">%number%</span> pour le nombre extra</p></body></html> - - - - - %1 - copy - %1 - copie - - - - - %1 - copy (%2) - %1 - copie (%2) - - - - Renaming rules - Régles de renommage - - - - RmPath - - - Unable to remove the folder - Impossible de supprimer le répertoire - - - - TransferThread - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - The checksums not match - Les checksums ne correspondent pas - - - - WriteThread - - - Unable to read the source file: - Impossible de lire le fichier source: - - - - File truncated during the read, possible data change - Fichier diminué durrant la lecture, possible changement de données - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Le moteur est forcé en déplacement, vous ne pouvez pas copier avec - - - - - The engine is forced to copy, you can't move with it - Le moteur est forcé en copie, vous ne pouvez pas déplacer avec - - - - The mode have been forced previously, it's internal error, please report it - Le mode as été forcé précédement, c'est une erreur interne, merci de le repporter - - - - Options error - Erreur d'options - - - - Options engine is not loaded, can't access to the filters - Moteur d'options non chargé, impossible d'accédrer aux filtres - - - - fileErrorDialog - - - Error on file - Erreur sur le fichier - - - - Error - Erreur - - - - Size - Taille - - - - Modified - Modifié - - - - File name - Nom de fichier - - - - &Always do this action - &Toujours effectuer cette action - - - - Put to bottom - Mettre à la fin - - - - Retry - Réessayer - - - - &Skip - &Passer - - - - &Cancel - &Annuler - - - - Error on folder - Erreur sur un dossier - - - - Folder name - Nom de répertoire - - - - fileExistsDialog - - - The file exists - Le fichier existe - - - - Source - Source - - - - Destination - Destination - - - - - Size - Taille - - - - - Modified - Modifié - - - - - File name - Nom de fichier - - - - Suggest new &name - Suggérer un &nouveau nom - - - - &Always do this action - &Toujours effectuer cette action - - - - &Rename - &Renommer - - - - &Overwrite - &Ecraser - - - - &Skip - &Passer - - - - &Cancel - &Annuler - - - - Overwrite if newer - Ecraser si plus récent - - - - Overwrite if not same modification date - Ecraser si la date de modification est différente - - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - fileIsSameDialog - - - This files are the same file - Ces fichiers sont identiques - - - - The source and destination is same - La source et la destination sont identiques - - - - Size - Taille - - - - Modified - Modifié - - - - File name - Nom de fichier - - - - Suggest new &name - Suggérer un &nouveau nom - - - - &Always do this action - &Toujours effectuer cette action - - - - &Rename - &Renommer - - - - &Skip - &Passer - - - - &Cancel - &Annuler - - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - folderExistsDialog - - - This folders are the same folder - Les répertoires sont identiques - - - - Source - Source - - - - Destination - Destination - - - - The source and destination is same - La source et la destination sont identiques - - - - - Modified - Modifié - - - - - Folder name - Nom de répertoire - - - - Suggest new &name - Suggérer un &nouveau nom - - - - &Always do this action - &Toujours effectuer cette action - - - - &Rename - &Renommer - - - - Merge - Fusionner - - - - Skip - Passer - - - - &Cancel - &Annuler - - - - Folder already exists - Dossier déjà existant - - - - %1 - copy - %1 - copie - - - - %1 - copy (%2) - %1 - copie (%2) - - - - options - - - Transfer the file rights - Transférer les droits des fichiers - - - - Keep the file date - Garder la date du fichier - - - - When folder error - En cas d'erreur de répertoire - - - - - Ask - Demander - - - - - Skip - Passer - - - - Merge - Fusionner - - - - Rename - Renommer - - - - Check if destination folder exists - Vérifier si le répertoire de destination existe - - - - Block size - Taille de block - - - - - KB - Ko - - - - Auto start the transfer - Démmarer automatiquement le transfert - - - - When folder collision - Lors d'une collision de dossier - - - - Checksum - Checksum - - - - Only after error - Seulement après erreur - - - - Ignore if impossible - Ignorer si impossible - - - - Do checksum - Faire un checksum - - - - Enable OS buffer - Activer le buffer de l'OS - - - - Filters - Filtres - - - - Renaming rules - Régles de renommage - - - - OS buffer only if smaller than - Buffer de l'OS seulement si plus petit que - - - - scanFileOrFolder - - - - %1 - copy - %1 - copie - - - - - %1 - copy (%2) - %1 - copie (%2) - - - - The folder not exists - Le répertoire n'existe pas - - - - The folder is not readable - Le répertoire n'est pas lisible - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/hi/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/hi/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/hi/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/id/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/id/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/id/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/it/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/it/translation.ts deleted file mode 100644 index 92743de..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/it/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Non supportato su questa piattaforma - - - - Last modified date is wrong - Ultima modifica è sbagliato - - - - Last access date is wrong - Ultima data di accesso è sbagliato - - - - Factory - - - - Options error - opzioni di errore - - - - - Options engine is not loaded, can't access to the filters - Opzioni del motore non viene caricato, non possono accedere ai filtri - - - - FilterRules - - - Search: - Cerca: - - - - Search type: - Tipo di ricerca: - - - - Raw text - testo Raw - - - - Simplified regex - semplificato regex - - - - Perl's regex - Perl's regex - - - - Apply on: - Applicare su: - - - - File - File - - - - Folder - Cartella - - - - File and folder - File e cartelle - - - - All string need match - Tutti stringa bisogno di corrispondere - - - - Checking - Verifica - - - - Test string: - Test stringa: - - - - Filters dialog - Filtri di dialogo - - - - The regex is valid - La regex è valido - - - - The test string match with the regex - La stringa di test match con la regex - - - - Filters - - - Filters - Filtri - - - - Exclusion filter - Esclusione filtro - - - - Inclusion filter - inclusione filtro - - - - None = Include all - Nessuno = Includi tutte le - - - - - Raw text - testo Raw - - - - - Simplified regex - semplificato regex - - - - - Perl's regex - Perl's regex - - - - - Only on file - Solo su file - - - - - Only on folder - Solo sulla cartella - - - - - - - Full match - partita completa - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Impossibile fare per spostare o copiare elemento in male modo forzato: %1 - - - - Unable to save the transfer list: %1 - Impossibile salvare la lista dei trasferimenti: %1 - - - - Problem at the reading, or file size is null - Problema alla lettura, o la dimensione del file è nullo - - - - Wrong header: "%1" - Sbagliato intestazione: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - La lista di trasferimento è in modalità mista, ma questa istanza non è in questa modalità - - - - The transfer list is in copy mode, but this instance is not in this mode - La lista di trasferimento è in modalità di copia, ma questa istanza non è in questa modalità - - - - The transfer list is in move mode, but this instance is not in this mode - La lista di trasferimento è in modalità di spostamento, ma questa istanza non è in questa modalità - - - - Some error have been found during the line parsing - Alcuni errori sono stati trovati durante l'analisi linea - - - - Unable to open the transfer list: %1 - Impossibile aprire la lista di trasferimento: %1 - - - - MkPath - - - Unable to create the folder - Impossibile creare la cartella - - - - ReadThread - - - - Unable to read the source file: - Impossibile leggere il file sorgente: - - - - - File truncated during the read, possible data change - File troncato durante la lettura, i possibili cambiamenti di dati - - - - RenamingRules - - - First renaming - Prima ridenominazione - - - - %name% - copy - %name% should not be translated - %name% - copia - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>variabili: <span style=" font-weight:600;">%name%</span> per il nome del file originale</p></body></html> - - - - Second renaming - Secondo ridenominazione - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - copia (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>variabili: <span style=" font-weight:600;">%name%</span> per il nome del file originale</p><p><span style=" font-weight:600;">%number%</span> per il numero aggiuntivo</p></body></html> - - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - Renaming rules - Rinominare le regole - - - - RmPath - - - Unable to remove the folder - Impossibile rimuovere la cartella - - - - TransferThread - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The checksums not match - Il checksum non corrisponde - - - - WriteThread - - - Unable to read the source file: - Impossibile leggere il file sorgente: - - - - File truncated during the read, possible data change - File troncato durante la lettura, i possibili cambiamenti di dati - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Il motore è costretto a muoversi, non è possibile copiare con esso - - - - - The engine is forced to copy, you can't move with it - Il motore è costretto a copiare, non è possibile spostare con esso - - - - The mode have been forced previously, it's internal error, please report it - La modalità sono stati costretti in precedenza, è un errore interno, si prega di segnalarlo - - - - Options error - opzioni di errore - - - - Options engine is not loaded, can't access to the filters - Opzioni del motore non viene caricato, non possono accedere ai filtri - - - - fileErrorDialog - - - Error on file - Errore su file - - - - Error - Errore - - - - Size - Dimensione - - - - Modified - Modificato - - - - File name - Nome file - - - - &Always do this action - Eseguire sempre questa azione - - - - Put to bottom - Mettere a fondo - - - - Retry - Riprova - - - - &Skip - Saltare - - - - &Cancel - Annullare - - - - Error on folder - Errore cartella - - - - Folder name - Nome della cartella - - - - fileExistsDialog - - - The file exists - Il file esiste - - - - Source - Fonte - - - - Destination - Destinazione - - - - - Size - Dimensione - - - - - Modified - Modificato - - - - - File name - Nome file - - - - Suggest new &name - Suggerisci nuovo nome - - - - &Always do this action - Eseguire sempre questa azione - - - - &Rename - Rinominare - - - - &Overwrite - Sovrascrivi - - - - &Skip - Saltare - - - - &Cancel - Annullare - - - - Overwrite if newer - Sovrascrivi se più recente - - - - Overwrite if not same modification date - Sovrascrivi se non la data di modifica stessa - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - fileIsSameDialog - - - This files are the same file - Questi file sono lo stesso file - - - - The source and destination is same - La sorgente e destinazione è uguale - - - - Size - Dimensione - - - - Modified - Modificato - - - - File name - Nome file - - - - Suggest new &name - Suggerisci nuovo nome - - - - &Always do this action - Eseguire sempre questa azione - - - - &Rename - Rinominare - - - - &Skip - Saltare - - - - &Cancel - Annullare - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - folderExistsDialog - - - This folders are the same folder - Questo cartelle sono nella stessa cartella - - - - Source - Fonte - - - - Destination - Destinazione - - - - The source and destination is same - La sorgente e destinazione è uguale - - - - - Modified - Modificato - - - - - Folder name - Nome della cartella - - - - Suggest new &name - Suggerisci nuovo nome - - - - &Always do this action - Eseguire sempre questa azione - - - - &Rename - Rinominare - - - - Merge - Unire - - - - Skip - Saltare - - - - &Cancel - Annullare - - - - Folder already exists - Cartella esiste già - - - - %1 - copy - %1 - copia - - - - %1 - copy (%2) - %1 - copia (%2) - - - - options - - - Transfer the file rights - Trasferire i diritti di file - - - - Keep the file date - Tenere la data del file - - - - Block size - Dimensione del blocco - - - - - KB - - - - - Auto start the transfer - Auto iniziare il trasferimento - - - - When folder error - Quando errore cartella - - - - - Ask - Chiedere - - - - - Skip - Saltare - - - - Merge - Unire - - - - Rename - Rinominare - - - - Check if destination folder exists - Controllare se la cartella di destinazione esiste - - - - When folder collision - Quando collisione cartella - - - - Checksum - - - - - Only after error - Solo dopo l'errore - - - - Ignore if impossible - Ignora se impossibile - - - - Do checksum - Fare checksum - - - - Enable OS buffer - Abilita OS tampone - - - - Filters - Filtri - - - - Renaming rules - Rinominare le regole - - - - OS buffer only if smaller than - OS tampone solo se inferiori - - - - scanFileOrFolder - - - - %1 - copy - %1 - copia - - - - - %1 - copy (%2) - %1 - copia (%2) - - - - The folder not exists - La cartella non esiste - - - - The folder is not readable - La cartella non è leggibile - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/ja/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/ja/translation.ts deleted file mode 100644 index 9a215b1..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/ja/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Filters dialog - - - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - The regex is valid - - - - - Test string: - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - Renaming rules - - - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - OS buffer only if smaller than - - - - - Block size - - - - - Filters - - - - - Renaming rules - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/ko/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/ko/translation.ts deleted file mode 100644 index 6210b83..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/ko/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - 이 플랫폼에서 지원되지 않습니다 - - - - Last modified date is wrong - 마지막 수정 날짜가 잘못되었습니다 - - - - Last access date is wrong - 마지막 엑세스 날짜가 잘못되었습니다 - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Filters dialog - - - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - The regex is valid - - - - - Test string: - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - 폴더를 생성할 수 없습니다 - - - - ReadThread - - - - Unable to read the source file: - 원본 파일 읽기 불가: - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - Renaming rules - - - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - RmPath - - - Unable to remove the folder - 폴더를 제거할 수 없습니다 - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - 원본 파일 읽기 불가: - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - 파일 오류가 발생했습니다 - - - - Error - 오류 - - - - Size - 크기 - - - - Modified - 수정 날짜 - - - - File name - 파일 이름 - - - - &Always do this action - &항상 이 작동 실행 - - - - Put to bottom - 아래에 놓기 - - - - Retry - 재시도 - - - - &Skip - &건너뛰기 - - - - &Cancel - &취소 - - - - Error on folder - - - - - Folder name - 폴더 이름 - - - - fileExistsDialog - - - The file exists - 파일이 존재합니다 - - - - Source - 원본 - - - - Destination - 대상 - - - - - Size - 크기 - - - - - Modified - 수정 날짜 - - - - - File name - 파일 이름 - - - - Suggest new &name - 새 &이름 제안 - - - - &Always do this action - &항상 이 작동 실행 - - - - &Rename - &이름 바꾸기 - - - - &Overwrite - &덮어씌우기 - - - - &Skip - &건너뛰기 - - - - &Cancel - &취소 - - - - Overwrite if newer - 더 최신이면 덮어씌우기 - - - - Overwrite if not same modification date - 수정 날짜가 다르면 덮어씌우기 - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - 이 파일들은 동일한 파일입니다 - - - - The source and destination is same - 원본과 대상이 동일합니다 - - - - Size - 크기 - - - - Modified - 수정 날짜 - - - - File name - 파일 이름 - - - - Suggest new &name - 새 &이름 제안 - - - - &Always do this action - &항상 이 작동 실행 - - - - &Rename - &이름 바꾸기 - - - - &Skip - &건너뛰기 - - - - &Cancel - &취소 - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - 이 폴더들은 동일한 폴더입니다 - - - - Source - 원본 - - - - Destination - 대상 - - - - The source and destination is same - 원본과 대상이 동일합니다 - - - - - Modified - 수정 날짜 - - - - - Folder name - 폴더 이름 - - - - Suggest new &name - 새 &이름 제안 - - - - &Always do this action - &항상 이 작동 실행 - - - - &Rename - &이름 바꾸기 - - - - Merge - 합치기 - - - - Skip - 건너뛰기 - - - - &Cancel - &취소 - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - 파일 권한 전송 - - - - Keep the file date - 파일 날짜 보존 - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - OS buffer only if smaller than - - - - - Block size - 블럭 크기 - - - - Filters - - - - - Renaming rules - - - - - - KB - KB - - - - Auto start the transfer - 전송 자동 시작 - - - - When folder error - 폴더 오류시 - - - - - Ask - 확인 - - - - - Skip - 건너뛰기 - - - - Merge - 합치기 - - - - Rename - 이름 바꾸기 - - - - Check if destination folder exists - 대상 폴드 존재시 확인 - - - - When folder collision - 폴더 충돌시 - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - 폴더가 존재하지 않습니다 - - - - The folder is not readable - 폴더를 읽을 수 없습니다 - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/nl/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/nl/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/nl/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/no/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/no/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/no/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/pl/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/pl/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/pl/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/pt/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/pt/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/pt/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/ru/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/ru/translation.ts deleted file mode 100644 index 90f4c0f..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/ru/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - Не поддерживается на этой платформе - - - - Last modified date is wrong - Дата обновления неправильно - - - - Last access date is wrong - Дата последнего доступа не так - - - - Factory - - - - Options error - Опции ошибке - - - - - Options engine is not loaded, can't access to the filters - Параметры двигателя не загружается, не может получить доступ к фильтрам - - - - FilterRules - - - Search: - Поиск по сайту: - - - - Search type: - Тип поиска: - - - - Raw text - Сырой текст - - - - Simplified regex - упрощенный regex - - - - Perl's regex - Perl's regex - - - - Apply on: - Нанесите на: - - - - File - файл - - - - Folder - папка - - - - File and folder - Файлов и папок - - - - All string need match - Все строки нужно соответствовать - - - - Checking - контроль - - - - Test string: - Испытание строки: - - - - Filters dialog - Фильтры диалогового - - - - The regex is valid - Регулярное действует - - - - The test string match with the regex - Матч тестовую строку с регулярным выражением - - - - Filters - - - Filters - Фильтры - - - - Exclusion filter - Исключение фильтра - - - - Inclusion filter - Включение фильтра - - - - None = Include all - Ни = Включить все - - - - - Raw text - Сырой текст - - - - - Simplified regex - Упрощенная регулярных выражений - - - - - Perl's regex - Perl's regex - - - - - Only on file - Только на файл - - - - - Only on folder - Только на папку - - - - - - - Full match - Полный матч - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - Невозможно сделать, чтобы скопировать или переместить элемент в неправильном форсированном режиме: %1 - - - - Unable to save the transfer list: %1 - Невозможно сохранить трансфер: %1 - - - - Problem at the reading, or file size is null - Проблема при чтении или размер файла нулевой - - - - Wrong header: "%1" - Неправильный заголовок: "%1" - - - - The transfer list is in mixed mode, but this instance is not in this mode - Трансфер в смешанном режиме, но этот экземпляр не в этом режиме - - - - The transfer list is in copy mode, but this instance is not in this mode - Передача списка в режиме копирования, но этот экземпляр не в этом режиме - - - - The transfer list is in move mode, but this instance is not in this mode - Трансфер в режим перемещения, но этот экземпляр не в этом режиме - - - - Some error have been found during the line parsing - Некоторые ошибки были обнаружены в ходе разбора линия - - - - Unable to open the transfer list: %1 - Не удается открыть трансфер: %1 - - - - MkPath - - - Unable to create the folder - Невозможно создать папку - - - - ReadThread - - - - Unable to read the source file: - Невозможно прочитать исходный файл: - - - - - File truncated during the read, possible data change - Файл усечены во время чтения, возможность изменения данных - - - - RenamingRules - - - First renaming - Первое переименование - - - - %name% - copy - %name% should not be translated - %name% - копия - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - <html><head/><body><p>Переменные: <span style=" font-weight:600;">%name%</span> по оригинальному названию файла</p></body></html> - - - - Second renaming - Второе переименование - - - - %name% - copy (%number%) - %name%, %number% should not be translated - %name% - копия (%number%) - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - <html><head/><body><p>Переменные: <span style=" font-weight:600;">%name%</span> по оригинальному названию файла</p><p><span style=" font-weight:600;">%number%</span> за дополнительный номер</p></body></html> - - - - - %1 - copy - %1 - копия - - - - - %1 - copy (%2) - %1 - копия (%2) - - - - Renaming rules - Переименование правила - - - - RmPath - - - Unable to remove the folder - Не удается удалить папку - - - - TransferThread - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - The checksums not match - Контрольные суммы не совпадают - - - - WriteThread - - - Unable to read the source file: - Невозможно прочитать исходный файл: - - - - File truncated during the read, possible data change - Файл усечены во время чтения, возможность изменения данных - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - Двигатель вынуждены покинуть свои дома, вы не можете скопировать с ним - - - - - The engine is forced to copy, you can't move with it - Двигатель вынужден копии, вы не можете двигаться вместе с ним - - - - The mode have been forced previously, it's internal error, please report it - Режим был вынужден ранее, это внутренняя ошибка, пожалуйста, сообщите об этом - - - - Options error - Опции ошибке - - - - Options engine is not loaded, can't access to the filters - Параметры двигателя не загружается, не может получить доступ к фильтрам - - - - fileErrorDialog - - - Error on file - Ошибка в файле - - - - Error - ошибка - - - - Size - размер - - - - Modified - модифицированный - - - - File name - имя файла - - - - &Always do this action - Всегда делайте это действие - - - - Put to bottom - Положить в нижней - - - - Retry - Повторить - - - - &Skip - пропускать - - - - &Cancel - отменить - - - - Error on folder - Ошибка в папку - - - - Folder name - имя папки - - - - fileExistsDialog - - - The file exists - Файл существует - - - - Source - источник - - - - Destination - назначение - - - - - Size - размер - - - - - Modified - модифицированный - - - - - File name - имя файла - - - - Suggest new &name - Предложить новое имя - - - - &Always do this action - Всегда делайте это действие - - - - &Rename - переименовать - - - - &Overwrite - переписывать - - - - &Skip - пропускать - - - - &Cancel - отменить - - - - Overwrite if newer - Заменить, если новее - - - - Overwrite if not same modification date - Заменить, если не ту же дату модификации - - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - fileIsSameDialog - - - This files are the same file - Эти файлы имеют тот же файл - - - - The source and destination is same - Источник и назначение такое же, - - - - Size - размер - - - - Modified - модифицированный - - - - File name - имя файла - - - - Suggest new &name - Предложить новое имя - - - - &Always do this action - Всегда делайте это действие - - - - &Rename - переименовать - - - - &Skip - пропускать - - - - &Cancel - отменить - - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - folderExistsDialog - - - This folders are the same folder - Это папки той же папке, - - - - Source - источник - - - - Destination - назначение - - - - The source and destination is same - Источник и назначение такое же, - - - - - Modified - модифицированный - - - - - Folder name - имя папки - - - - Suggest new &name - Предложить новое имя - - - - &Always do this action - Всегда делайте это действие - - - - &Rename - переименовать - - - - Merge - слияние - - - - Skip - пропускать - - - - &Cancel - отменить - - - - Folder already exists - Папка уже существует - - - - %1 - copy - %1 - копия - - - - %1 - copy (%2) - %1 - копия (%2) - - - - options - - - Transfer the file rights - Передача файлов прав - - - - Keep the file date - Держите дату файла - - - - Block size - размер блока - - - - - KB - KB - - - - Auto start the transfer - Авто начать передачу - - - - When folder error - Когда папка ошибка - - - - - Ask - просить - - - - - Skip - пропускать - - - - Merge - слияние - - - - Rename - переименовать - - - - Check if destination folder exists - Убедитесь, что папка существует - - - - When folder collision - Когда папка столкновения - - - - Checksum - Контрольная - - - - Only after error - Только после того, как ошибка - - - - Ignore if impossible - Игнорировать, если невозможно - - - - Do checksum - У контрольной суммы - - - - Enable OS buffer - Включить OS буфер - - - - Filters - Фильтры - - - - Renaming rules - Переименование правила - - - - OS buffer only if smaller than - ОС буфер, только если меньше - - - - scanFileOrFolder - - - - %1 - copy - %1 - копия - - - - - %1 - copy (%2) - %1 - копия (%2) - - - - The folder not exists - Папка не существует - - - - The folder is not readable - Папки не читается - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/th/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/th/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/th/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/tr/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/tr/translation.ts deleted file mode 100644 index 0898631..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/tr/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - Test string: - - - - - Filters dialog - - - - - The regex is valid - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - Renaming rules - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Block size - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - Filters - - - - - Renaming rules - - - - - OS buffer only if smaller than - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/Languages/zh/translation.ts b/plugins/CopyEngine/Ultracopier-0.3/Languages/zh/translation.ts deleted file mode 100644 index 9a215b1..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Languages/zh/translation.ts +++ /dev/null @@ -1,795 +0,0 @@ - - - - - AvancedQFile - - - - - Not supported on this platform - - - - - Last modified date is wrong - - - - - Last access date is wrong - - - - - Factory - - - - Options error - - - - - - Options engine is not loaded, can't access to the filters - - - - - FilterRules - - - Filters dialog - - - - - Search: - - - - - Search type: - - - - - Raw text - - - - - Simplified regex - - - - - Perl's regex - - - - - Apply on: - - - - - File - - - - - Folder - - - - - File and folder - - - - - All string need match - - - - - Checking - - - - - The regex is valid - - - - - Test string: - - - - - The test string match with the regex - - - - - Filters - - - Filters - - - - - Exclusion filter - - - - - Inclusion filter - - - - - None = Include all - - - - - - Raw text - - - - - - Simplified regex - - - - - - Perl's regex - - - - - - Only on file - - - - - - Only on folder - - - - - - - - Full match - - - - - ListThread - - - Unable do to move or copy item into wrong forced mode: %1 - - - - - Unable to save the transfer list: %1 - - - - - Problem at the reading, or file size is null - - - - - Wrong header: "%1" - - - - - The transfer list is in mixed mode, but this instance is not in this mode - - - - - The transfer list is in copy mode, but this instance is not in this mode - - - - - The transfer list is in move mode, but this instance is not in this mode - - - - - Some error have been found during the line parsing - - - - - Unable to open the transfer list: %1 - - - - - MkPath - - - Unable to create the folder - - - - - ReadThread - - - - Unable to read the source file: - - - - - - File truncated during the read, possible data change - - - - - RenamingRules - - - Renaming rules - - - - - First renaming - - - - - %name% - copy - %name% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - should not be translated - - - - - Second renaming - - - - - %name% - copy (%number%) - %name%, %number% should not be translated - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - %name%, %number% should not be translated - - - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - RmPath - - - Unable to remove the folder - - - - - TransferThread - - - %1 - copy - - - - - %1 - copy (%2) - - - - - The checksums not match - - - - - WriteThread - - - Unable to read the source file: - - - - - File truncated during the read, possible data change - - - - - copyEngine - - - - The engine is forced to move, you can't copy with it - - - - - - The engine is forced to copy, you can't move with it - - - - - The mode have been forced previously, it's internal error, please report it - - - - - Options error - - - - - Options engine is not loaded, can't access to the filters - - - - - fileErrorDialog - - - Error on file - - - - - Error - - - - - Size - - - - - Modified - - - - - File name - - - - - &Always do this action - - - - - Put to bottom - - - - - Retry - - - - - &Skip - - - - - &Cancel - - - - - Error on folder - - - - - Folder name - - - - - fileExistsDialog - - - The file exists - - - - - Source - - - - - Destination - - - - - - Size - - - - - - Modified - - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Overwrite - - - - - &Skip - - - - - &Cancel - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - fileIsSameDialog - - - This files are the same file - - - - - The source and destination is same - - - - - Size - - - - - Modified - - - - - File name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - &Skip - - - - - &Cancel - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - folderExistsDialog - - - This folders are the same folder - - - - - Source - - - - - Destination - - - - - The source and destination is same - - - - - - Modified - - - - - - Folder name - - - - - Suggest new &name - - - - - &Always do this action - - - - - &Rename - - - - - Merge - - - - - Skip - - - - - &Cancel - - - - - Folder already exists - - - - - %1 - copy - - - - - %1 - copy (%2) - - - - - options - - - Transfer the file rights - - - - - Keep the file date - - - - - Checksum - - - - - Only after error - - - - - Ignore if impossible - - - - - Do checksum - - - - - Enable OS buffer - - - - - OS buffer only if smaller than - - - - - Block size - - - - - Filters - - - - - Renaming rules - - - - - - KB - - - - - Auto start the transfer - - - - - When folder error - - - - - - Ask - - - - - - Skip - - - - - Merge - - - - - Rename - - - - - Check if destination folder exists - - - - - When folder collision - - - - - scanFileOrFolder - - - - %1 - copy - - - - - - %1 - copy (%2) - - - - - The folder not exists - - - - - The folder is not readable - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/ListThread.cpp b/plugins/CopyEngine/Ultracopier-0.3/ListThread.cpp deleted file mode 100755 index 9856c3c..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/ListThread.cpp +++ /dev/null @@ -1,1689 +0,0 @@ -#include "ListThread.h" - -ListThread::ListThread(FacilityInterface * facilityInterface) -{ - qRegisterMetaType("DebugLevel"); - qRegisterMetaType("ItemOfCopyList"); - qRegisterMetaType("QFileInfo"); - qRegisterMetaType("CopyMode"); - qRegisterMetaType >("QList"); - qRegisterMetaType("TransferStat"); - - moveToThread(this); - start(HighPriority); - this->facilityInterface = facilityInterface; - putInPause = false; - sourceDrive = ""; - sourceDriveMultiple = false; - destinationDrive = ""; - destinationDriveMultiple = false; - stopIt = false; - bytesToTransfer = 0; - bytesTransfered = 0; - idIncrementNumber = 1; - actualRealByteTransfered = 0; - preOperationNumber = 0; - numberOfTranferRuning = 0; - numberOfTransferIntoToDoList = 0; - numberOfInodeOperation = 0; - maxSpeed = 0; - doRightTransfer = false; - keepDate = false; - blockSize = 1024; - osBufferLimit = 512; - alwaysDoThisActionForFileExists = FileExists_NotSet; - doChecksum = false; - checksumIgnoreIfImpossible = true; - checksumOnlyOnError = true; - osBuffer = false; - osBufferLimited = false; - forcedMode = false; - - #if ! defined (Q_CC_GNU) - ui->keepDate->setEnabled(false); - ui->keepDate->setToolTip("Not supported with this compiler"); - #endif - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - connect(&timerUpdateDebugDialog,SIGNAL(timeout()),this,SLOT(timedUpdateDebugDialog())); - timerUpdateDebugDialog.start(ULTRACOPIER_PLUGIN_DEBUG_WINDOW_TIMER); - #endif - connect(this, SIGNAL(tryCancel()), this,SLOT(cancel()), Qt::QueuedConnection); - connect(this, SIGNAL(askNewTransferThread()), this,SLOT(createTransferThread()), Qt::QueuedConnection); - connect(&mkPathQueue, SIGNAL(firstFolderFinish()), this,SLOT(mkPathFirstFolderFinish()), Qt::QueuedConnection); - connect(&rmPathQueue, SIGNAL(firstFolderFinish()), this,SLOT(rmPathFirstFolderFinish()), Qt::QueuedConnection); - connect(&mkPathQueue, SIGNAL(errorOnFolder(QFileInfo,QString)), this,SIGNAL(mkPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection); - connect(&rmPathQueue, SIGNAL(errorOnFolder(QFileInfo,QString)), this,SIGNAL(rmPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection); - connect(this, SIGNAL(send_syncTransferList()), this,SLOT(syncTransferList_internal()), Qt::QueuedConnection); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&mkPathQueue, SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); - connect(&rmPathQueue, SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); - #endif // ULTRACOPIER_PLUGIN_DEBUG - - emit askNewTransferThread(); - mkpathTransfer.release(); -} - -ListThread::~ListThread() -{ - emit tryCancel(); - waitCancel.acquire(); - quit(); - wait(); -} - -//transfer is finished -void ListThread::transferInodeIsClosed() -{ - numberOfInodeOperation--; - temp_transfer_thread=qobject_cast(QObject::sender()); - if(temp_transfer_thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - isFound=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - int countLocalParse=0; - #endif - if(temp_transfer_thread->getStat()!=TransferStat_Idle) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not idle!")); - return; - } - int_for_internal_loop=0; - loop_size=actionToDoListTransfer.size(); - while(int_for_internal_looptransferId) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("[%1] have finish, put at idle; for id: %2").arg(int_for_internal_loop).arg(temp_transfer_thread->transferId)); - returnActionOnCopyList newAction; - newAction.type=RemoveItem; - newAction.addAction.id=temp_transfer_thread->transferId; - newAction.userAction.position=int_for_internal_loop; - actionDone << newAction; - /// \todo check if item is at the right thread - actionToDoListTransfer.removeAt(int_for_internal_loop); - if(actionToDoListTransfer.size()==0 && actionToDoListInode.size()==0 && actionToDoListInode_afterTheTransfer.size()==0) - updateTheStatus(); - - temp_transfer_thread->transferId=0; - temp_transfer_thread->transferSize=0; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - countLocalParse++; - #endif - isFound=true; - //emit newActionOnList(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"numberOfTranferRuning: "+QString::number(numberOfTranferRuning)); - if(actionToDoListTransfer.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"numberOfTranferRuning==0"); - actionToDoListInode << actionToDoListInode_afterTheTransfer; - actionToDoListInode_afterTheTransfer.clear(); - doNewActions_inode_manipulation(); - } - break; - } - int_for_internal_loop++; - } - if(!isFound) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("unable to found item into the todo list, id: %1, index: %2").arg(temp_transfer_thread->transferId).arg(int_for_loop)); - temp_transfer_thread->transferId=0; - temp_transfer_thread->transferSize=0; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("countLocalParse: %1, actionToDoList.size(): %2").arg(countLocalParse).arg(actionToDoListTransfer.size())); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - if(countLocalParse!=1) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("countLocalParse != 1")); - #endif - doNewActions_inode_manipulation(); -} - -//transfer is finished -void ListThread::transferIsFinished() -{ - temp_transfer_thread=qobject_cast(QObject::sender()); - if(temp_transfer_thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - - //add the current size of file, to general size because it's finish - copiedSize=temp_transfer_thread->copiedSize(); - if(copiedSize>(qint64)temp_transfer_thread->transferSize) - { - oversize=copiedSize-temp_transfer_thread->transferSize; - bytesToTransfer+=oversize; - bytesTransfered+=oversize; - } - bytesTransfered+=temp_transfer_thread->transferSize; - -// emit newTransferStop(temp_transfer_thread->transferId); - numberOfTranferRuning--; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start transferIsFinished(), numberOfTranferRuning: "+QString::number(numberOfTranferRuning)); - doNewActions_start_transfer(); -} - -/** \brief put the current file at bottom in case of error -\note ONLY IN CASE OF ERROR */ -void ListThread::transferPutAtBottom() -{ - TransferThread *transfer=qobject_cast(QObject::sender()); - if(transfer==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - transfer->skip(); - bool isFound=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - int countLocalParse=0; - #endif - int indexAction=0; - while(indexActiontransferId) - { - //push for interface at the end - returnActionOnCopyList newAction; - newAction.type=MoveItem; - newAction.addAction.id=transfer->transferId; - newAction.userAction.position=actionToDoListTransfer.size()-1; - actionDone << newAction; - //do the wait stat - actionToDoListTransfer[indexAction].isRunning=false; - //move at the end - actionToDoListTransfer.move(indexAction,actionToDoListTransfer.size()-1); - //reset the thread list stat - transfer->transferId=0; - transfer->transferSize=0; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - countLocalParse++; - #endif - isFound=true; - break; - } - indexAction++; - } - if(!isFound) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("unable to found item into the todo list, id: %1, index: %2").arg(transfer->transferId)); - transfer->transferId=0; - transfer->transferSize=0; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("countLocalParse: %1").arg(countLocalParse)); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - if(countLocalParse!=1) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("countLocalParse != 1")); - #endif -} - -//set the copy info and options before runing -void ListThread::setRightTransfer(const bool doRightTransfer) -{ - this->doRightTransfer=doRightTransfer; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetRightTransfer(doRightTransfer); - index++; - } -} - -//set keep date -void ListThread::setKeepDate(const bool keepDate) -{ - this->keepDate=keepDate; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetKeepDate(keepDate); - index++; - } -} - -//set block size in KB -void ListThread::setBlockSize(const int blockSize) -{ - this->blockSize=blockSize; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetBlockSize(blockSize); - index++; - } -} - -//set auto start -void ListThread::setAutoStart(const bool autoStart) -{ - this->autoStart=autoStart; -} - -//set check destination folder -void ListThread::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) -{ - this->checkDestinationFolderExists=checkDestinationFolderExists; - for(int i=0;isetCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); -} - -void ListThread::fileTransfer(const QFileInfo &sourceFileInfo,const QFileInfo &destinationFileInfo,const CopyMode &mode) -{ - addToTransfer(sourceFileInfo,destinationFileInfo,mode); -} - -// -> add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::haveSameSource(QStringList sources) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(sourceDriveMultiple) - return false; - if(sourceDrive.isEmpty()) - return true; - int index=0; - while(index add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::haveSameDestination(QString destination) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(destinationDriveMultiple) - return false; - if(destinationDrive.isEmpty()) - return true; - int index=0; - while(indexsetFilters(include,exclude); - scanFileOrFolderThreadsPool.last()->setCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); - if(scanFileOrFolderThreadsPool.size()==1) - updateTheStatus(); - scanFileOrFolderThreadsPool.last()->setRenamingRules(firstRenamingRule,otherRenamingRule); - return scanFileOrFolderThreadsPool.last(); -} - -void ListThread::scanThreadHaveFinish(bool skipFirstRemove) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"listing thread have finish, skipFirstRemove: "+QString::number(skipFirstRemove)); - if(!skipFirstRemove) - { - scanFileOrFolder * senderThread = qobject_cast(QObject::sender()); - if(senderThread==NULL) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"sender pointer null (plugin copy engine)"); - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the next thread, scanFileOrFolderThreadsPool.size(): "+QString::number(scanFileOrFolderThreadsPool.size())); - delete senderThread; - scanFileOrFolderThreadsPool.removeOne(senderThread); - if(scanFileOrFolderThreadsPool.size()==0) - updateTheStatus(); - } - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the next thread, scanFileOrFolderThreadsPool.size(): "+QString::number(scanFileOrFolderThreadsPool.size())); - if(scanFileOrFolderThreadsPool.size()>0) - { - //then start the next listing threads - if(scanFileOrFolderThreadsPool.first()->isFinished()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"Start listing thread"); - scanFileOrFolderThreadsPool.first()->start(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"The listing thread is already running"); - } - else - { - if(autoStart) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Auto start the copy"); - startGeneralTransfer(); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Put the copy engine in pause"); - putInPause=true; - emit isInPause(true); - } - } -} - -void ListThread::startGeneralTransfer() -{ - doNewActions_inode_manipulation(); -} - -// -> add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::newCopy(QStringList sources,QString destination) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+sources.join(";")+", destination: "+destination); - scanFileOrFolder * scanFileOrFolderThread = newScanThread(Copy); - if(scanFileOrFolderThread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to get new thread"); - return false; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the listing"); - scanFileOrFolderThread->addToList(sources,destination); - scanThreadHaveFinish(true); - return true; -} - -// -> add thread safe, by Qt::BlockingQueuedConnection -bool ListThread::newMove(QStringList sources,QString destination) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - scanFileOrFolder * scanFileOrFolderThread = newScanThread(Move); - if(scanFileOrFolderThread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to get new thread"); - return false; - } - scanFileOrFolderThread->addToList(sources,destination); - scanThreadHaveFinish(true); -/* int index=0; - while(indexdrives=drives; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetDrive(drives); - index++; - } -} - -void ListThread::setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists) -{ - this->alwaysDoThisActionForFileExists=alwaysDoThisActionForFileExists; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexsetAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - index++; - } -} - -/** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ -void ListThread::syncTransferList() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit send_syncTransferList(); -} - -//set the folder local colision -void ListThread::setFolderColision(FolderExistsAction alwaysDoThisActionForFolderExists) -{ - this->alwaysDoThisActionForFolderExists=alwaysDoThisActionForFolderExists; -} - -bool ListThread::getReturnBoolToCopyEngine() -{ - return returnBoolToCopyEngine; -} - -QPair ListThread::getReturnPairQuint64ToCopyEngine() -{ - return returnPairQuint64ToCopyEngine; -} - -ItemOfCopyList ListThread::getReturnItemOfCopyListToCopyEngine() -{ - return returnItemOfCopyListToCopyEngine; -} - -void ListThread::set_doChecksum(bool doChecksum) -{ - this->doChecksum=doChecksum; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_doChecksum(doChecksum); - index++; - } -} - -void ListThread::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) -{ - this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - index++; - } -} - -void ListThread::set_checksumOnlyOnError(bool checksumOnlyOnError) -{ - this->checksumOnlyOnError=checksumOnlyOnError; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_checksumOnlyOnError(checksumOnlyOnError); - index++; - } -} - -void ListThread::set_osBuffer(bool osBuffer) -{ - this->osBuffer=osBuffer; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_osBuffer(osBuffer); - index++; - } -} - -void ListThread::set_osBufferLimited(bool osBufferLimited) -{ - this->osBufferLimited=osBufferLimited; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_osBufferLimited(osBufferLimited); - index++; - } -} - -void ListThread::realByteTransfered() -{ - quint64 totalRealByteTransfered=0; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexrealByteTransfered(); - index++; - } - emit send_realBytesTransfered(totalRealByteTransfered); -} - -void ListThread::pause() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(putInPause) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Seam already in pause!"); - return; - } - putInPause=true; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexpause(); - index++; - } - emit isInPause(true); -} - -void ListThread::resume() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(!putInPause) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Seam already resumed!"); - return; - } - putInPause=false; - startGeneralTransfer(); - doNewActions_start_transfer(); - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexresume(); - index++; - } - emit isInPause(false); -} - -void ListThread::skip(const quint64 &id) -{ - skipInternal(id); -// emit newActionOnList(); -} - -bool ListThread::skipInternal(const quint64 &id) -{ - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indextransferId==id) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip one transfer: %1").arg(id)); - transferThreadList.at(index)->skip(); - return true; - } - index++; - } - int_for_internal_loop=0; - loop_size=actionToDoListTransfer.size(); - while(int_for_internal_loopstop(); - delete transferThreadList.at(index);//->deleteLayer(); - transferThreadList[index]=NULL; - index++; - } - index=0; - loop_size=scanFileOrFolderThreadsPool.size(); - while(indexstop(); - delete scanFileOrFolderThreadsPool.at(index);//->deleteLayer(); - scanFileOrFolderThreadsPool[index]=NULL; - index++; - } - quit(); - waitCancel.release(); - emit canBeDeleted(); -} - -//speed limitation -qint64 ListThread::getSpeedLimitation() -{ - return maxSpeed; -} - -bool ListThread::setSpeedLimitation(const qint64 &speedLimitation) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"maxSpeed: "+QString::number(speedLimitation)); - maxSpeed=speedLimitation; - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopsetMaxSpeed(speedLimitation/ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER); - int_for_loop++; - } - return true; -} - -void ListThread::updateTheStatus() -{ - /*if(threadOfTheTransfer.haveContent()) - copy=true;*/ - updateTheStatus_listing=scanFileOrFolderThreadsPool.size()>0; - updateTheStatus_copying=actionToDoListTransfer.size()>0 || actionToDoListInode.size()>0 || actionToDoListInode_afterTheTransfer.size()>0; - if(updateTheStatus_copying && updateTheStatus_listing) - updateTheStatus_action_in_progress=CopyingAndListing; - else if(updateTheStatus_listing) - updateTheStatus_action_in_progress=Listing; - else if(updateTheStatus_copying) - updateTheStatus_action_in_progress=Copying; - else - updateTheStatus_action_in_progress=Idle; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"emit actionInProgess("+QString::number(updateTheStatus_action_in_progress)+")"); - emit actionInProgess(updateTheStatus_action_in_progress); - if(updateTheStatus_action_in_progress==Idle) - sendActionDone(); -} - -//set data local to the thread -void ListThread::setAlwaysFileExistsAction(FileExistsAction alwaysDoThisActionForFileExists) -{ - this->alwaysDoThisActionForFileExists=alwaysDoThisActionForFileExists; - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopsetAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - int_for_loop++; - } -} - -//mk path to do -quint64 ListThread::addToMkPath(const QString& folder) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder: "+folder); - actionToDoInode temp; - temp.type = ActionType_MkPath; - temp.id = generateIdNumber(); - temp.folder.setFile(folder); - temp.isRunning = false; - actionToDoListInode << temp; - return temp.id; -} - -//add rm path to do -void ListThread::addToRmPath(const QString& folder,const int& inodeToRemove) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder: "+folder+",inodeToRemove: "+QString::number(inodeToRemove)); - actionToDoInode temp; - temp.type = ActionType_RmPath; - temp.id = generateIdNumber(); - temp.size = inodeToRemove; - temp.folder.setFile(folder); - temp.isRunning = false; - if(inodeToRemove==0) - actionToDoListInode << temp; - else - actionToDoListInode_afterTheTransfer << temp; -} - -//send action done -void ListThread::sendActionDone() -{ - if(actionDone.size()>0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit newActionOnList(actionDone); - actionDone.clear(); - } -} - -//send progression -void ListThread::sendProgression() -{ - if(actionToDoListTransfer.size()==0) - return; - oversize=0; - currentProgression=0; - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopgetStat()==TransferStat_Transfer || temp_transfer_thread->getStat()==TransferStat_Checksum) - { - copiedSize=temp_transfer_thread->copiedSize(); - - //for the general progression - currentProgression+=copiedSize; - - //the oversize (when the file is bigger after/during the copy then what was during the listing) - if(copiedSize>(qint64)temp_transfer_thread->transferSize) - localOverSize=copiedSize-temp_transfer_thread->transferSize; - else - localOverSize=0; - - //the current size copied - totalSize=temp_transfer_thread->transferSize+localOverSize; - if(temp_transfer_thread->getStat()==TransferStat_Checksum) - tempItem.current=temp_transfer_thread->realByteTransfered(); - else - tempItem.current=copiedSize; - tempItem.id=temp_transfer_thread->transferId; - tempItem.total=totalSize; - progressionList << tempItem; - - //add the oversize to the general progression - oversize+=localOverSize; - } - int_for_loop++; - } - emit pushFileProgression(progressionList); - progressionList.clear(); - emit pushGeneralProgression(bytesTransfered+currentProgression,bytesToTransfer+oversize); - realByteTransfered(); -} - -//send the progression, after full reset of the interface (then all is empty) -void ListThread::syncTransferList_internal() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit syncReady(); - actionDone.clear(); - //do list operation - TransferThread *transferThread; - loop_size=actionToDoListTransfer.size(); - loop_sub_size=transferThreadList.size(); - //this loop to have at max ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT*ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT, not ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT*transferThreadList.size() - for(int_for_loop=0; int_for_loopgetStat()!=TransferStat_PreOperation) - { - returnActionOnCopyList newAction; - switch(transferThread->getStat()) - { - case TransferStat_Transfer: - newAction.type=Transfer; - break; - case TransferStat_PostTransfer: - newAction.type=PostOperation; - break; - default: - break; - } - newAction.addAction.id = item.id; - actionDone << newAction; - } - } - } - } -} - -//add file transfer to do -quint64 ListThread::addToTransfer(const QFileInfo& source,const QFileInfo& destination,const CopyMode& mode) -{ - //add to transfer list - numberOfTransferIntoToDoList++; - bytesToTransfer+= source.size(); - actionToDoTransfer temp; - temp.id = generateIdNumber(); - temp.size = source.size(); - temp.source = source; - temp.destination= destination; - temp.mode = mode; - temp.isRunning = false; - actionToDoListTransfer << temp; - //push the new transfer to interface - returnActionOnCopyList newAction; - newAction.type = AddingItem; - newAction.addAction.id = temp.id; - newAction.addAction.sourceFullPath = source.absoluteFilePath(); - newAction.addAction.sourceFileName = source.fileName(); - newAction.addAction.destinationFullPath = destination.absoluteFilePath(); - newAction.addAction.destinationFileName = destination.fileName(); - newAction.addAction.size = temp.size; - newAction.addAction.mode = mode; - actionDone << newAction; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("source: %1, destination: %2, add entry: %3, size: %4, size2: %5").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).arg(temp.id).arg(temp.size).arg(newAction.addAction.size)); - return temp.id; -} - -//generate id number -quint64 ListThread::generateIdNumber() -{ - idIncrementNumber++; - if(idIncrementNumber>(((quint64)1024*1024)*1024*1024*2)) - idIncrementNumber=0; - return idIncrementNumber; -} - -//warning the first entry is accessible will copy -void ListThread::removeItems(const QList &ids) -{ - for(int i=0;i ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int indexToMove=0; - loop_size=actionToDoListTransfer.size(); - for (int i=0; i ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int lastGoodPositionExtern=0; - int lastGoodPositionReal=0; - bool haveGoodPosition=false; - bool haveChanged=false; - loop_size=actionToDoListTransfer.size(); - for (int i=0; i ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int lastGoodPositionExtern=numberOfTransferIntoToDoList; - int lastGoodPositionReal=0; - bool haveGoodPosition=false; - bool haveChanged=false; - for (int i=actionToDoListTransfer.size()-1; i>=0; --i) { - if(ids.contains(actionToDoListTransfer.at(i).id)) - { - if(haveGoodPosition) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("move item ")+QString::number(i)+" to "+QString::number(i+1)); - returnActionOnCopyList newAction; - newAction.type=MoveItem; - newAction.addAction.id=actionToDoListTransfer.at(i).id; - newAction.userAction.moveAt=lastGoodPositionReal; - newAction.userAction.position=i; - actionDone << newAction; - actionToDoListTransfer.swap(i,lastGoodPositionReal); - haveChanged=true; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Try move up false, item ")+QString::number(i)); - } - ids.removeOne(actionToDoListTransfer.at(i).id); - if(ids.size()==0) - { -/* if(haveChanged) - emit newActionOnList();*/ - return; - } - } - else - { - lastGoodPositionExtern--; - lastGoodPositionReal=i; - haveGoodPosition=true; - } - } - //emit newActionOnList(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -//put on bottom -void ListThread::moveItemsOnBottom(QList ids) -{ - if(actionToDoListTransfer.size()<=1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"list size is empty"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //do list operation - int lastGoodPositionExtern=numberOfTransferIntoToDoList; - int lastGoodPositionReal=actionToDoListTransfer.size()-1; - for (int i=lastGoodPositionReal; i>=0; --i) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Check action on item ")+QString::number(i)); - if(ids.contains(actionToDoListTransfer.at(i).id)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("move item ")+QString::number(i)+" to "+QString::number(lastGoodPositionReal)); - ids.removeOne(actionToDoListTransfer.at(i).id); - returnActionOnCopyList newAction; - newAction.type=MoveItem; - newAction.addAction.id=actionToDoListTransfer.at(i).id; - newAction.userAction.moveAt=lastGoodPositionExtern; - newAction.userAction.position=i; - actionDone << newAction; - actionToDoListTransfer.move(i,lastGoodPositionReal); - lastGoodPositionReal--; - lastGoodPositionExtern--; - if(ids.size()==0) - { -// emit newActionOnList(); - return; - } - } - } -// emit newActionOnList(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -/** \brief give the forced mode, to export/import transfer list */ -void ListThread::forceMode(const CopyMode &mode) -{ - if(mode==Copy) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to copy")); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to move")); - this->mode=mode; - forcedMode=true; -} - -void ListThread::exportTransferList(const QString &fileName) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QFile transferFile(fileName); - if(transferFile.open(QIODevice::WriteOnly|QIODevice::Truncate)) - { - transferFile.write(QString("Ultracopier-0.3;Transfer-list;").toUtf8()); - if(!forcedMode) - transferFile.write(QString("Transfer;").toUtf8()); - else - { - if(mode==Copy) - transferFile.write(QString("Copy;").toUtf8()); - else - transferFile.write(QString("Move;").toUtf8()); - } - transferFile.write(QString("Ultracopier-0.3\n").toUtf8()); - bool haveError=false; - int size=actionToDoListTransfer.size(); - for (int index=0;index0) - { - content=QString::fromUtf8(data); - //do the import here - if(content.contains(correctLine)) - { - content.remove("\n"); - args=content.split(";"); - if(forcedMode) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("New data to import in forced mode: %2,%3").arg(args.at(0)).arg(args.at(1))); - addToTransfer(QFileInfo(args.at(0)),QFileInfo(args.at(1)),mode); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("New data to import: %1,%2,%3").arg(args.at(0)).arg(args.at(1)).arg(args.at(2))); - if(args.at(0)=="Copy") - tempMode=Copy; - else - tempMode=Move; - addToTransfer(QFileInfo(args.at(1)),QFileInfo(args.at(2)),tempMode); - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Wrong line syntax: %1").arg(content)); - errorFound=true; - } - } - } - while(data.size()>0); - transferFile.close(); - if(errorFound) - emit warningTransferList(tr("Some error have been found during the line parsing")); -// emit newActionOnList(); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Unable to open the transfer list: %1").arg(transferFile.errorString())); - emit errorTransferList(tr("Unable to open the transfer list: %1").arg(transferFile.errorString())); - return; - } -} - -//do new actions -void ListThread::doNewActions_start_transfer() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("actionToDoListTransfer.size(): %1, numberOfTranferRuning: %2").arg(actionToDoListTransfer.size()).arg(numberOfTranferRuning)); - if(stopIt || putInPause) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //lunch the transfer in WaitForTheTransfer - int_for_loop=0; - loop_size=transferThreadList.size(); - while(int_for_loopgetStat()==TransferStat_WaitForTheTransfer) - { - transferThreadList.at(int_for_loop)->startTheTransfer(); - numberOfTranferRuning++; - } - int_for_loop++; - } - int_for_loop=0; - while(int_for_loopgetStat()==TransferStat_PreOperation) - { - transferThreadList.at(int_for_loop)->startTheTransfer(); - numberOfTranferRuning++; - } - int_for_loop++; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"numberOfTranferRuning: "+QString::number(numberOfTranferRuning)); -} - -/** \brief lunch the pre-op or inode op - 1) locate the next next item to do into the both list - 1a) optimisation posible on the mkpath/rmpath - 2) determine what need be lunched - 3) lunch it, rerun the 2) - */ -void ListThread::doNewActions_inode_manipulation() -{ - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("actionToDoList.size(): %1").arg(actionToDoList.size())); - if(stopIt || putInPause) - return; - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //lunch the pre-op or inode op - int_for_loop=0; - int_for_internal_loop=0; - number_rm_path_moved=0; - int_for_transfer_thread_search=0; - actionToDoListTransfer_count=actionToDoListTransfer.count(); - actionToDoListInode_count=actionToDoListInode.count(); - loop_sub_size_transfer_thread_search=transferThreadList.size(); - //search the next transfer action to do - while(int_for_looptransferId==0) /!\ important! - Because the other thread can have call doNewAction before than this thread have the finish event parsed! - I this case it lose all data - */ - currentTransferThread=transferThreadList[int_for_transfer_thread_search]; - if(currentTransferThread->getStat()==TransferStat_Idle && currentTransferThread->transferId==0) // /!\ important! - { - currentTransferThread->transferId=currentActionToDoTransfer.id; - currentTransferThread->transferSize=currentActionToDoTransfer.size; - currentTransferThread->setFiles( - currentActionToDoTransfer.source.absoluteFilePath(), - currentActionToDoTransfer.size, - currentActionToDoTransfer.destination.absoluteFilePath(), - currentActionToDoTransfer.mode - ); - currentActionToDoTransfer.isRunning=true; - - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("[%1] id: %2 is idle, use it for %3").arg(int_for_loop).arg(currentTransferThread->transferId).arg(currentActionToDoTransfer.destination.absoluteFilePath())); - - /// \note wrong position? Else write why it's here - returnActionOnCopyList newAction; - newAction.type = PreOperation; - newAction.addAction.id = currentActionToDoTransfer.id; - newAction.addAction.sourceFullPath = currentActionToDoTransfer.source.absoluteFilePath(); - newAction.addAction.sourceFileName = currentActionToDoTransfer.source.fileName(); - newAction.addAction.destinationFullPath = currentActionToDoTransfer.destination.absoluteFilePath(); - newAction.addAction.destinationFileName = currentActionToDoTransfer.destination.fileName(); - newAction.addAction.size = currentActionToDoTransfer.size; - newAction.addAction.mode = currentActionToDoTransfer.mode; - actionDone << newAction; - int_for_transfer_thread_search++; - break; - } - int_for_transfer_thread_search++; - } - if(int_for_internal_loop==loop_sub_size_transfer_thread_search) - { - /// \note Can be normal when all thread is not initialized - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to found free thread to do the transfer"); - break; - } - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - } - int_for_loop++; - } - //search the next inode action to do - while(int_for_internal_loopULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("The index have been detected as out of max range: %1>%2").arg(actionToDoListTransfer_count+actionToDoListInode_count).arg(ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT)); - return; - } -} - -//restart transfer if it can -void ListThread::restartTransferIfItCan() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - TransferThread *transfer=qobject_cast(QObject::sender()); - if(transfer==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,QString("transfer thread not located!")); - return; - } - if(numberOfTranferRuninggetStat()==TransferStat_WaitForTheTransfer) - { - transfer->startTheTransfer(); - numberOfTranferRuning++; - } - doNewActions_start_transfer(); -} - -/// \brief update the transfer stat -void ListThread::newTransferStat(TransferStat stat,quint64 id) -{ - returnActionOnCopyList newAction; - switch(stat) - { - case TransferStat_Idle: - return; - break; - case TransferStat_PreOperation: - return; - break; - case TransferStat_WaitForTheTransfer: - return; - break; - case TransferStat_Transfer: - newAction.type=Transfer; - break; - case TransferStat_PostTransfer: - case TransferStat_PostOperation: - newAction.type=PostOperation; - break; - case TransferStat_Checksum: - newAction.type=CustomOperation; - break; - default: - return; - break; - } - newAction.addAction.id = id; - actionDone << newAction; -} - -void ListThread::set_osBufferLimit(unsigned int osBufferLimit) -{ - this->osBufferLimit=osBufferLimit; - int index=0; - loop_sub_size_transfer_thread_search=transferThreadList.size(); - while(indexset_osBufferLimit(osBufferLimit); - index++; - } -} - -void ListThread::set_setFilters(QList include,QList exclude) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("include.size(): %1, exclude.size(): %2").arg(include.size()).arg(exclude.size())); - this->include=include; - this->exclude=exclude; - int index=0; - while(indexsetFilters(include,exclude); - index++; - } -} - -void ListThread::set_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void ListThread::mkPathFirstFolderFinish() -{ - int_for_loop=0; - loop_size=actionToDoListInode.size(); - while(int_for_loopgetStat()) - { - case TransferStat_Idle: - stat="Idle"; - break; - case TransferStat_PreOperation: - stat="PreOperation"; - break; - case TransferStat_WaitForTheTransfer: - stat="WaitForTheTransfer"; - break; - case TransferStat_Transfer: - stat="Transfer"; - break; - case TransferStat_PostOperation: - stat="PostOperation"; - break; - case TransferStat_PostTransfer: - stat="PostTransfer"; - break; - case TransferStat_Checksum: - stat="Checksum"; - break; - default: - stat=QString("??? (%1)").arg(transferThreadList.at(index)->getStat()); - break; - } - newList << QString("%1) (%3,%4) %2") - .arg(index) - .arg(stat) - .arg(transferThreadList.at(index)->readingLetter()) - .arg(transferThreadList.at(index)->writingLetter()); - index++; - } - QStringList newList2; - index=0; - loop_size=actionToDoListTransfer.size(); - while(index(actionToDoListTransfer.size()+2)) - { - newList2 << QString("..."); - break; - } - index++; - } - emit updateTheDebugInfo(newList,newList2,numberOfInodeOperation); -} - -#endif - -/// \note Can be call without queue because all call will be serialized -void ListThread::fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) -{ - emit send_fileAlreadyExists(source,destination,isSame,qobject_cast(sender())); -} - -/// \note Can be call without queue because all call will be serialized -void ListThread::errorOnFile(const QFileInfo &fileInfo,const QString &errorString) -{ - emit send_errorOnFile(fileInfo,errorString,qobject_cast(sender())); -} - -/// \note Can be call without queue because all call will be serialized -void ListThread::folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) -{ - emit send_folderAlreadyExists(source,destination,isSame,qobject_cast(sender())); -} - -/// \note Can be call without queue because all call will be serialized -/// \todo all this part -void ListThread::errorOnFolder(const QFileInfo &fileInfo,const QString &errorString) -{ - emit send_errorOnFolder(fileInfo,errorString,qobject_cast(sender())); -} - -//to run the thread -void ListThread::run() -{ - exec(); -} - -/// \to create transfer thread -void ListThread::createTransferThread() -{ - if(stopIt) - return; - transferThreadList << new TransferThread(); - TransferThread * last=transferThreadList.last(); - last->transferId=0; - last->transferSize=0; - last->setRightTransfer(doRightTransfer); - last->setKeepDate(keepDate); - last->setBlockSize(blockSize); - last->setDrive(drives); - last->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - last->setMaxSpeed(maxSpeed/ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER); - last->set_doChecksum(doChecksum); - last->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - last->set_checksumOnlyOnError(checksumOnlyOnError); - last->set_osBuffer(osBuffer); - last->set_osBufferLimited(osBufferLimited); - last->set_osBufferLimit(osBufferLimit); - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(last,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection); - #endif // ULTRACOPIER_PLUGIN_DEBUG - connect(last,SIGNAL(errorOnFile(QFileInfo,QString)), this,SLOT(errorOnFile(QFileInfo,QString)), Qt::QueuedConnection); - connect(last,SIGNAL(fileAlreadyExists(QFileInfo,QFileInfo,bool)), this,SLOT(fileAlreadyExists(QFileInfo,QFileInfo,bool)), Qt::QueuedConnection); - connect(last,SIGNAL(tryPutAtBottom()), this,SLOT(transferPutAtBottom()), Qt::QueuedConnection); - connect(last,SIGNAL(readStopped()), this,SLOT(transferIsFinished()), Qt::QueuedConnection); - connect(last,SIGNAL(preOperationStopped()), this,SLOT(doNewActions_start_transfer()), Qt::QueuedConnection); - connect(last,SIGNAL(postOperationStopped()), this,SLOT(transferInodeIsClosed()), Qt::QueuedConnection); - connect(last,SIGNAL(checkIfItCanBeResumed()), this,SLOT(restartTransferIfItCan()), Qt::QueuedConnection); - connect(last,SIGNAL(pushStat(TransferStat,quint64)), this,SLOT(newTransferStat(TransferStat,quint64)), Qt::QueuedConnection); - - connect(this,SIGNAL(send_sendNewRenamingRules(QString,QString)), last,SLOT(setRenamingRules(QString,QString)), Qt::QueuedConnection); - - last->start(); - last->setObjectName(QString("transfer %1").arg(transferThreadList.size()-1)); - last->setMkpathTransfer(&mkpathTransfer); - last->setRenamingRules(firstRenamingRule,otherRenamingRule); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - last->setId(transferThreadList.size()-1); - #endif - if(transferThreadList.size()>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - if(stopIt) - return; - doNewActions_inode_manipulation(); - emit askNewTransferThread(); -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/ListThread.h b/plugins/CopyEngine/Ultracopier-0.3/ListThread.h deleted file mode 100755 index ef6b7f8..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/ListThread.h +++ /dev/null @@ -1,370 +0,0 @@ -/** \file ListThread.h -\brief Define the list thread, and management to the action to do -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef LISTTHREAD_H -#define LISTTHREAD_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_CopyEngine.h" -#include "scanFileOrFolder.h" -#include "TransferThread.h" -#include "MkPath.h" -#include "RmPath.h" -#include "Environment.h" - -/// \brief Define the list thread, and management to the action to do -class ListThread : public QThread -{ - Q_OBJECT -public: - explicit ListThread(FacilityInterface * facilityInterface); - ~ListThread(); - //duplication copy detection - /** \brief compare the current sources of the copy, with the passed arguments - * \param sources the sources list to compares with the current sources list - * \return true if have same sources, else false (or empty) */ - bool haveSameSource(QStringList sources); - /** \brief compare the current destination of the copy, with the passed arguments - * \param destination the destination to compares with the current destination - * \return true if have same destination, else false (or empty) */ - bool haveSameDestination(QString destination); - //external soft like file browser have send copy/move list to do - /** \brief send copy with destination - * \param sources the sources list to copy - * \param destination the destination to copy - * \return true if the copy have been accepted */ - bool newCopy(QStringList sources,QString destination); - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \param destination the destination to move - * \return true if the move have been accepted */ - bool newMove(QStringList sources,QString destination); - /** \brief get the speed limitation - * < -1 if not able, 0 if disabled */ - qint64 getSpeedLimitation(); - /** \brief to set drives detected - * specific to this copy engine */ - void setDrive(QStringList drives); - /// \brief to set the collision action - void setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists); - /** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ - void syncTransferList(); - /// \brief to store one action to do - struct actionToDoTransfer - { - quint64 id; - qint64 size;///< Used to set: used in case of transfer or remainingInode for drop folder - QFileInfo source;///< Used to set: source for transfer, folder to create, folder to drop - QFileInfo destination; - CopyMode mode; - bool isRunning;///< store if the action si running - //TransferThread * transfer; // -> see transferThreadList - }; - QList actionToDoListTransfer; - /// \brief get action type - enum ActionType - { - ActionType_MkPath=1, - ActionType_RmPath=2 - }; - /// \brief to store one action to do - struct actionToDoInode - { - ActionType type;///< \see ActionType - quint64 id; - qint64 size;///< Used to set: used in case of transfer or remainingInode for drop folder - QFileInfo folder;///< Used to set: source for transfer, folder to create, folder to drop - bool isRunning;///< store if the action si running - }; - QList actionToDoListInode; - QList actionToDoListInode_afterTheTransfer; - int numberOfInodeOperation; - //dir operation thread queue - MkPath mkPathQueue; - RmPath rmPathQueue; - //to get the return value from copyEngine - bool getReturnBoolToCopyEngine(); - QPair getReturnPairQuint64ToCopyEngine(); - ItemOfCopyList getReturnItemOfCopyListToCopyEngine(); - - void set_doChecksum(bool doChecksum); - void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); - void set_checksumOnlyOnError(bool checksumOnlyOnError); - void set_osBuffer(bool osBuffer); - void set_osBufferLimited(bool osBufferLimited); -public slots: - //action on the copy - /// \brief put the transfer in pause - void pause(); - /// \brief resume the transfer - void resume(); - /** \brief skip one transfer entry - * \param id id of the file to remove */ - void skip(const quint64 &id); - /** \brief skip as interanl one transfer entry - * \param id id of the file to remove */ - bool skipInternal(const quint64 &id); - /// \brief cancel all the transfer - void cancel(); - //edit the transfer list - /** \brief remove the selected item - * \param ids ids is the id list of the selected items */ - void removeItems(const QList &ids); - /** \brief move on top of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnTop(QList ids); - /** \brief move up the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsUp(QList ids); - /** \brief move down the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsDown(QList ids); - /** \brief move on bottom of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnBottom(QList ids); - - /** \brief give the forced mode, to export/import transfer list */ - void forceMode(const CopyMode &mode); - /// \brief export the transfer list into a file - void exportTransferList(const QString &fileName); - /// \brief import the transfer list into a file - void importTransferList(const QString &fileName); - - /// \brief set the folder local colision - void setFolderColision(FolderExistsAction alwaysDoThisActionForFolderExists); - /** \brief to set the speed limitation - * -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - /// \brief set the copy info and options before runing - void setRightTransfer(const bool doRightTransfer); - /// \brief set keep date - void setKeepDate(const bool keepDate); - /// \brief set block size in KB - void setBlockSize(const int blockSize); - /// \brief set auto start - void setAutoStart(const bool autoStart); - /// \brief set check destination folder - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - /// \brief set data local to the thread - void setAlwaysFileExistsAction(FileExistsAction alwaysDoThisActionForFileExists); - /// \brief do new actions, start transfer - void doNewActions_start_transfer(); - /** \brief lunch the pre-op or inode op - 1) locate the next next item to do into the both list - 1a) optimisation posible on the mkpath/rmpath - 2) determine what need be lunched - 3) lunch it, rerun the 2) - */ - void doNewActions_inode_manipulation(); - /// \brief restart transfer if it can - void restartTransferIfItCan(); - - /// \brief update the transfer stat - void newTransferStat(TransferStat stat,quint64 id); - - void set_osBufferLimit(unsigned int osBufferLimit); - void set_setFilters(QList include,QList exclude); - void set_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - - //send action done - void sendActionDone(); - //send progression - void sendProgression(); -private: - QSemaphore mkpathTransfer; - QString sourceDrive; - bool sourceDriveMultiple; - bool stopIt; - QString destinationDrive; - bool destinationDriveMultiple; - QList scanFileOrFolderThreadsPool; - int numberOfTransferIntoToDoList; - QList transferThreadList; - scanFileOrFolder * newScanThread(CopyMode mode); - quint64 bytesToTransfer; - quint64 bytesTransfered; - bool autoStart; - bool putInPause; - QList actionDone;///< to action to send to the interface - quint64 idIncrementNumber;///< to store the last id returned - qint64 actualRealByteTransfered; - int preOperationNumber; - int numberOfTranferRuning; - int maxSpeed;///< in KB/s, assume as 0KB/s as default like every where - FolderExistsAction alwaysDoThisActionForFolderExists; - bool checkDestinationFolderExists; - bool doChecksum; - bool checksumIgnoreIfImpossible; - bool checksumOnlyOnError; - bool osBuffer; - bool osBufferLimited; - unsigned int osBufferLimit; - QList include,exclude; - CopyMode mode; - bool forcedMode; - QString firstRenamingRule; - QString otherRenamingRule; - - //add file transfer to do - quint64 addToTransfer(const QFileInfo& source,const QFileInfo& destination,const CopyMode& mode); - //generate id number - quint64 generateIdNumber(); - //warning the first entry is accessible will copy - bool removeItems(quint64 id); - //put on top - bool moveOnTopItem(quint64 id); - //move up - bool moveUpItem(quint64 id); - //move down - bool moveDownItem(quint64 id); - //put on bottom - bool moveOnBottomItem(quint64 id); - //general transfer - void startGeneralTransfer(); - //debug windows if needed - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - QTimer timerUpdateDebugDialog; - #endif - FacilityInterface * facilityInterface; - //temp variable for not always alocate the memory - int int_for_loop,int_for_internal_loop,int_for_transfer_thread_search,loop_size,loop_sub_size,loop_sub_size_transfer_thread_search,number_rm_path_moved; - TransferThread *temp_transfer_thread; - bool isFound; - bool updateTheStatus_listing,updateTheStatus_copying; - EngineActionInProgress updateTheStatus_action_in_progress; - QSemaphore waitConstructor,waitCancel; - int actionToDoListTransfer_count,actionToDoListInode_count; - bool doTransfer,doInode; - qint64 oversize;//used as temp variable - qint64 currentProgression; - qint64 copiedSize,totalSize,localOverSize; - QList progressionList; - TransferThread* currentTransferThread; - //memory variable for transfer thread creation - bool doRightTransfer; - bool keepDate; - int blockSize; - QStringList drives; - FileExistsAction alwaysDoThisActionForFileExists; - //to return value to the copyEngine - bool returnBoolToCopyEngine; - QPair returnPairQuint64ToCopyEngine; - QList returnListItemOfCopyListToCopyEngine; - ItemOfCopyList returnItemOfCopyListToCopyEngine; - ProgressionItem tempItem; - - void realByteTransfered(); -private slots: - void scanThreadHaveFinish(bool skipFirstRemove=false); - void updateTheStatus(); - void fileTransfer(const QFileInfo &sourceFileInfo,const QFileInfo &destinationFileInfo,const CopyMode &mode); - //mkpath event - void mkPathFirstFolderFinish(); - //rmpath event - void rmPathFirstFolderFinish(); - //transfer is finished - void transferIsFinished(); - /** \brief put the current file at bottom in case of error - \note ONLY IN CASE OF ERROR */ - void transferPutAtBottom(); - //transfer is finished - void transferInodeIsClosed(); - //debug windows if needed - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - void timedUpdateDebugDialog(); - #endif - //dialog message - /// \note Can be call without queue because all call will be serialized - void fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); - /// \note Can be call without queue because all call will be serialized - void errorOnFile(const QFileInfo &fileInfo,const QString &errorString); - /// \note Can be call without queue because all call will be serialized - void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); - /// \note Can be call without queue because all call will be serialized - void errorOnFolder(const QFileInfo &fileInfo,const QString &errorString); - //to run the thread - void run(); - /// \to create transfer thread - void createTransferThread(); - //mk path to do - quint64 addToMkPath(const QString& folder); - //add rm path to do - void addToRmPath(const QString& folder,const int& inodeToRemove); - //send the progression, after full reset of the interface (then all is empty) - void syncTransferList_internal(); -signals: - //send information about the copy - void actionInProgess(EngineActionInProgress); //should update interface information on this event - - void newActionOnList(const QList &);///very important, need be temporized to group the modification to do and not flood the interface - void syncReady(); - - /** \brief to get the progression for a specific file - * \param id the id of the transfer, id send during population the transfer list - * first = current transfered byte, second = byte to transfer */ - void pushFileProgression(const QList &progressionList); - //get information about the copy - /** \brief to get the general progression - * first = current transfered byte, second = byte to transfer */ - void pushGeneralProgression(const quint64 &,const quint64 &); - - void newFolderListing(const QString &path); - void newCollisionAction(QString action); - void newErrorAction(QString action); - void isInPause(bool); - - //when can be deleted - void canBeDeleted(); - - //send error occurred - void error(QString path,quint64 size,QDateTime mtime,QString error); - //for the extra logging - void rmPath(QString path); - void mkPath(QString path); - /// \brief To debug source - #ifdef ULTRACOPIER_PLUGIN_DEBUG - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - void updateTheDebugInfo(QStringList,QStringList,int); - #endif - - //other signal - /// \note Can be call without queue because all call will be serialized - void send_fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread); - /// \note Can be call without queue because all call will be serialized - void send_errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread); - /// \note Can be call without queue because all call will be serialized - void send_folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread); - /// \note Can be call without queue because all call will be serialized - void send_errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread); - //send the progression - void send_syncTransferList(); - //mkpath error event - void mkPathErrorOnFolder(QFileInfo fileInfo,QString errorString); - //rmpath error event - void rmPathErrorOnFolder(QFileInfo fileInfo,QString errorString); - //to close - void tryCancel(); - //to ask new transfer thread - void askNewTransferThread(); - - void warningTransferList(QString warning); - void errorTransferList(QString error); - void send_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void send_realBytesTransfered(quint64); -}; - -#endif // LISTTHREAD_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/ListThread_InodeAction.cpp b/plugins/CopyEngine/Ultracopier-0.3/ListThread_InodeAction.cpp deleted file mode 100644 index 0f4c2f4..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/ListThread_InodeAction.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** \file ListThread_InodeAction.cpp -\brief To be included into ListThread.cpp, to optimize and prevent code duplication -\see ListThread.cpp -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifdef LISTTHREAD_H - -//do the inode action -actionToDoInode& currentActionToDoInode=actionToDoListInode[int_for_internal_loop]; -switch(currentActionToDoInode.type) -{ -case ActionType_MkPath: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch mkpath: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - mkPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath()); - currentActionToDoInode.isRunning=true; - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; -break; -case ActionType_RmPath: -/* What is this code? - if((int_for_loop+number_rm_path_moved)>=(loop_size-1)) - { - if(numberOfTranferRuning) - break; - else - currentActionToDoInode.size=0; - }*/ - //then empty (no file), can try remove it - if(true)//currentActionToDoInode.size==0 - { - if(numberOfTranferRuning>0) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("skipped because already inode = 0 and transfer is running: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("launch rmpath: %1").arg(currentActionToDoInode.folder.absoluteFilePath())); - rmPathQueue.addPath(currentActionToDoInode.folder.absoluteFilePath()); - currentActionToDoInode.isRunning=true; - numberOfInodeOperation++; - if(numberOfInodeOperation>=ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT) - return; - } - else //have not finish all the transfer into it, do it later - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"should never pass here"); - /*actionToDoListInode.move(int_for_internal_loop,actionToDoListInode_count-1); - currentActionToDoInode.id=generateIdNumber(); - number_rm_path_moved++; - currentActionToDoInode.size=0; - continue;*/ - } -break; -default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Wrong type at inode action")); - return; -} - -#endif diff --git a/plugins/CopyEngine/Ultracopier-0.3/MkPath.cpp b/plugins/CopyEngine/Ultracopier-0.3/MkPath.cpp deleted file mode 100644 index dd71231..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/MkPath.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "MkPath.h" - -MkPath::MkPath() -{ - stopIt=false; - waitAction=false; - setObjectName("MkPath"); - moveToThread(this); - start(); -} - -MkPath::~MkPath() -{ - stopIt=true; - quit(); - wait(); -} - -void MkPath::addPath(const QString &path) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - if(stopIt) - return; - emit internalStartAddPath(path); -} - -void MkPath::skip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartSkip(); -} - -void MkPath::retry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartRetry(); -} - -void MkPath::run() -{ - connect(this,SIGNAL(internalStartAddPath(QString)),this,SLOT(internalAddPath(QString)),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartDoThisPath()),this,SLOT(internalDoThisPath()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartSkip()),this,SLOT(internalSkip()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRetry()),this,SLOT(internalRetry()),Qt::QueuedConnection); - exec(); -} - -void MkPath::internalDoThisPath() -{ - if(waitAction || pathList.isEmpty()) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+pathList.first()); - if(!dir.exists(pathList.first())) - if(!dir.mkpath(pathList.first())) - { - if(!dir.exists(pathList.first())) - { - if(stopIt) - return; - waitAction=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); - emit errorOnFolder(pathList.first(),tr("Unable to create the folder")); - return; - } - } - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -void MkPath::internalAddPath(const QString &path) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - pathList << path; - if(!waitAction) - checkIfCanDoTheNext(); -} - -void MkPath::checkIfCanDoTheNext() -{ - if(!waitAction && !stopIt && pathList.size()>0) - emit internalStartDoThisPath(); -} - -void MkPath::internalSkip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -void MkPath::internalRetry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - checkIfCanDoTheNext(); -} - diff --git a/plugins/CopyEngine/Ultracopier-0.3/MkPath.h b/plugins/CopyEngine/Ultracopier-0.3/MkPath.h deleted file mode 100644 index 5d00d60..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/MkPath.h +++ /dev/null @@ -1,56 +0,0 @@ -/** \file MkPath.h -\brief Make the path given as queued mkpath -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef MKPATH_H -#define MKPATH_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -/// \brief Make the path given as queued mkpath -class MkPath : public QThread -{ - Q_OBJECT -public: - explicit MkPath(); - ~MkPath(); - /// \brief add path to make - void addPath(const QString &path); -signals: - void errorOnFolder(const QFileInfo &,const QString &); - void firstFolderFinish(); - void internalStartAddPath(const QString &path); - void internalStartDoThisPath(); - void internalStartSkip(); - void internalStartRetry(); - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); -public slots: - /// \brief skip after creation error - void skip(); - /// \brief retry after creation error - void retry(); -private: - void run(); - bool waitAction; - bool stopIt; - bool skipIt; - QStringList pathList; - void checkIfCanDoTheNext(); - QDir dir; -private slots: - void internalDoThisPath(); - void internalAddPath(const QString &path); - void internalSkip(); - void internalRetry(); -}; - -#endif // MKPATH_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/ReadThread.cpp b/plugins/CopyEngine/Ultracopier-0.3/ReadThread.cpp deleted file mode 100644 index 3c7bfc1..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/ReadThread.cpp +++ /dev/null @@ -1,597 +0,0 @@ -#include "ReadThread.h" - -ReadThread::ReadThread() -{ - start(); - moveToThread(this); - stopIt=false; - putInPause=false; - blockSize=1024*1024; - setObjectName("read"); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - isInReadLoop=false; - tryStartRead=false; - isOpen.release(); -} - -ReadThread::~ReadThread() -{ - stopIt=true; - disconnect(this); - waitNewClockForSpeed.release(); - isOpen.acquire(); - exit(); - wait(); -} - -void ReadThread::run() -{ - connect(this,SIGNAL(internalStartOpen()), this,SLOT(internalOpen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartReopen()), this,SLOT(internalReopen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRead()), this,SLOT(internalRead()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartClose()), this,SLOT(internalClose()), Qt::QueuedConnection); - connect(this,SIGNAL(checkIfIsWait()), this,SLOT(isInWait()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartChecksum()), this,SLOT(checkSum()), Qt::QueuedConnection); - exec(); -} - -void ReadThread::open(const QString &name,const CopyMode &mode) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open source: "+name); - if(file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] previous file is already open: "+file.fileName()+", try open: "+this->name); - return; - } - if(isInReadLoop) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] previous file is already readding: "+file.fileName()+", try open: "+this->name); - return; - } - if(tryStartRead) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] previous file is already try read: "+file.fileName()+", try open: "+this->name); - return; - } - fakeMode=false; - this->name=name; - this->mode=mode; - emit internalStartOpen(); -} - -QString ReadThread::errorString() -{ - return errorString_internal; -} - -void ReadThread::stop() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop()"); - stopIt=true; - if(isOpen.available()>0) - return; - emit internalStartClose(); -} - -bool ReadThread::pause() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] try put read thread in pause"); - putInPause=true; - stopIt=true; - return isInReadLoop; -} - -void ReadThread::resume() -{ - if(putInPause) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - putInPause=false; - stopIt=false; - } - else - return; - if(tryStartRead) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] already in try start"); - return; - } - tryStartRead=true; - if(isInReadLoop) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] is in read loop"); - return; - } - if(!file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] file is not open"); - return; - } - emit internalStartRead(); -} - -bool ReadThread::seek(qint64 position) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start with: "+QString::number(position)); - if(position>file.size()) - return false; - return file.seek(position); -} - -qint64 ReadThread::size() -{ - return file.size(); -} - -void ReadThread::postOperation() -{ - emit internalStartClose(); -} - -void ReadThread::checkSum() -{ - QByteArray blockArray; - QCryptographicHash hash(QCryptographicHash::Sha1); - isInReadLoop=true; - lastGoodPosition=0; - seek(0); - int sizeReaden=0; - do - { - //read one block - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Read; - #endif - blockArray=file.read(blockSize); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(file.error()!=QFile::NoError) - { - errorString_internal=tr("Unable to read the source file: ")+file.errorString()+" ("+QString::number(file.error())+")"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); - emit error(); - isInReadLoop=false; - return; - } - sizeReaden=blockArray.size(); - if(sizeReaden>0) - { - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Checksum; - #endif - hash.addData(blockArray); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(stopIt) - break; - - lastGoodPosition+=blockArray.size(); - - //wait for limitation speed if stop not query - if(maxSpeed>0) - { - numberOfBlockCopied++; - if(numberOfBlockCopied>=MultiForBigSpeed) - { - numberOfBlockCopied=0; - waitNewClockForSpeed.acquire(); - if(stopIt) - break; - } - } - } - } - while(sizeReaden>0 && !stopIt); - if(lastGoodPosition>file.size()) - { - errorString_internal=tr("File truncated during the read, possible data change"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); - emit error(); - isInReadLoop=false; - return; - } - isInReadLoop=false; - if(stopIt) - { - if(putInPause) - emit isInPause(); - stopIt=false; - return; - } - emit checksumFinish(hash.result()); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop the read"); -} - -bool ReadThread::internalOpen(bool resetLastGoodPosition) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] internalOpen source: "+name); - stopIt=false; - putInPause=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=InodeOperation; - #endif - if(file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already open! source: "+name); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } - file.setFileName(name); - QIODevice::OpenMode openMode=QIODevice::ReadOnly; - if(mode==Move) - openMode=QIODevice::ReadWrite; - seekToZero=false; - if(file.open(openMode)) - { - size_at_open=file.size(); - mtime_at_open=QFileInfo(file).lastModified(); - putInPause=false; - if(resetLastGoodPosition) - { - lastGoodPosition=0; - seek(0); - emit opened(); - } - else if(!seek(lastGoodPosition)) - { - errorString_internal=file.errorString(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable to seek after open: %1, error: %2").arg(name).arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - isOpen.acquire(); - return true; - } - else - { - errorString_internal=file.errorString(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable to open: %1, error: %2").arg(name).arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } -} - -void ReadThread::internalRead() -{ - isInReadLoop=true; - tryStartRead=false; - if(stopIt) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] stopIt == true, then quit"); - internalClose(); - return; - } - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=InodeOperation; - #endif - int sizeReaden=0; - if(!file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] is not open!"); - return; - } - QByteArray blockArray; - //numberOfBlockCopied = 0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start the copy"); - emit readIsStarted(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - if(stopIt) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] stopIt == true, then quit"); - internalClose(); - return; - } - do - { - //read one block - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Read; - #endif - blockArray=file.read(blockSize); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(file.error()!=QFile::NoError) - { - errorString_internal=tr("Unable to read the source file: ")+file.errorString()+" ("+QString::number(file.error())+")"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); - emit error(); - isInReadLoop=false; - return; - } - sizeReaden=blockArray.size(); - if(sizeReaden>0) - { - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=WaitWritePipe; - #endif - if(!writeThread->write(blockArray)) - { - if(!stopIt) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] stopped because the write is stopped: "+QString::number(lastGoodPosition)); - stopIt=true; - } - } - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(stopIt) - break; - - lastGoodPosition+=blockArray.size(); - - //wait for limitation speed if stop not query - if(maxSpeed>0) - { - numberOfBlockCopied++; - if(numberOfBlockCopied>=MultiForBigSpeed) - { - numberOfBlockCopied=0; - waitNewClockForSpeed.acquire(); - if(stopIt) - break; - } - } - } - /* - if(lastGoodPosition>16*1024) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Test error in reading: %1 (%2)").arg(file.errorString()).arg(file.error())); - errorString_internal=QString("Test error in reading: %1 (%2)").arg(file.errorString()).arg(file.error()); - emit error(); - isInReadLoop=false; - return; - } - */ - } - while(sizeReaden>0 && !stopIt); - if(lastGoodPosition>file.size()) - { - errorString_internal=tr("File truncated during the read, possible data change"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); - emit error(); - isInReadLoop=false; - return; - } - isInReadLoop=false; - if(stopIt) - { - if(putInPause) - emit isInPause(); - stopIt=false; - return; - } - emit readIsStopped();//will product by signal connection writeThread->endIsDetected(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop the read"); -} - -void ReadThread::startRead() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(tryStartRead) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] already in try start"); - return; - } - if(isInReadLoop) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - else - { - tryStartRead=true; - emit internalStartRead(); - } -} - -void ReadThread::internalClose(bool callByTheDestructor) -{ - /// \note never send signal here, because it's called by the destructor - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(!fakeMode) - file.close(); - if(!callByTheDestructor) - emit closed(); - - /// \note always the last of this function - if(!fakeMode) - isOpen.release(); -} - -/** \brief set block size -\param block the new block size in KB -\return Return true if succes */ -bool ReadThread::setBlockSize(const int blockSize) -{ - if(blockSize<1 || blockSize>16384) - { - this->blockSize=blockSize*1024; - //set the new max speed because the timer have changed - setMaxSpeed(maxSpeed); - return true; - } - else - return false; -} - -/*! \brief Set the max speed -\param tempMaxSpeed Set the max speed in KB/s, 0 for no limit */ -int ReadThread::setMaxSpeed(const int maxSpeed) -{ - if(this->maxSpeed==0 && maxSpeed==0 && waitNewClockForSpeed.available()>0) - waitNewClockForSpeed.tryAcquire(waitNewClockForSpeed.available()); - this->maxSpeed=maxSpeed; - if(this->maxSpeed>0) - { - int NewInterval,newMultiForBigSpeed=0; - do - { - newMultiForBigSpeed++; - NewInterval=(blockSize*newMultiForBigSpeed)/(this->maxSpeed); - } - while (NewIntervalULTRACOPIER_PLUGIN_MAXTIMERINTERVAL) - { - NewInterval=ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL; - newMultiForBigSpeed=1; - blockSize=this->maxSpeed*NewInterval; - } - MultiForBigSpeed=newMultiForBigSpeed; - return NewInterval; - } - else - { - waitNewClockForSpeed.release(); - return 0; - } -} - -/// \brief For give timer every X ms -void ReadThread::timeOfTheBlockCopyFinished() -{ - if(waitNewClockForSpeed.available()file.size()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] Bug, the lastGoodPosition is greater than the file size!"); - return file.size(); - } - else*/ - return lastGoodPosition; -} - -//reopen after an error -void ReadThread::reopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(isInReadLoop) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] try reopen where read is not finish"); - return; - } - stopIt=true; - emit internalStartReopen(); -} - -bool ReadThread::internalReopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - stopIt=false; - file.close(); - if(size_at_open!=file.size() && mtime_at_open!=QFileInfo(file).lastModified()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] source file have changed since the last open, restart all"); - //fix this function like the close function - if(internalOpen(true)) - { - emit resumeAfterErrorByRestartAll(); - return true; - } - else - return false; - } - else - { - //fix this function like the close function - if(internalOpen(false)) - { - emit resumeAfterErrorByRestartAtTheLastPosition(); - return true; - } - else - return false; - } -} - -//set the write thread -void ReadThread::setWriteThread(WriteThread * writeThread) -{ - this->writeThread=writeThread; -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG -//to set the id -void ReadThread::setId(int id) -{ - this->id=id; -} -#endif - -void ReadThread::seekToZeroAndWait() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - stopIt=true; - seekToZero=true; - emit checkIfIsWait(); -} - -void ReadThread::isInWait() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(seekToZero) - { - seekToZero=false; - if(file.isOpen()) - seek(0); - else - internalOpen(true); - emit isSeekToZeroAndWait(); - } -} - -bool ReadThread::isReading() -{ - return isInReadLoop; -} - diff --git a/plugins/CopyEngine/Ultracopier-0.3/ReadThread.h b/plugins/CopyEngine/Ultracopier-0.3/ReadThread.h deleted file mode 100644 index 1d1eabc..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/ReadThread.h +++ /dev/null @@ -1,144 +0,0 @@ -/** \file ReadThread.h -\brief Thread changed to open/close and read the source file -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef READTHREAD_H -#define READTHREAD_H - -#include -#include -#include -#include -#include -#include -#include - -#include "WriteThread.h" -#include "Environment.h" -#include "StructEnumDefinition_CopyEngine.h" -#include "AvancedQFile.h" - -/// \brief Thread changed to open/close and read the source file -class ReadThread : public QThread -{ - Q_OBJECT -public: - explicit ReadThread(); - ~ReadThread(); -protected: - void run(); -public: - /// \brief open with the name and copy mode - void open(const QString &name,const CopyMode &mode); - /// \brief return the error string - QString errorString(); - //QByteArray read(qint64 position,qint64 maxSize); - /// \brief stop the copy - void stop(); - /// \brief put the copy in pause - bool pause(); - /// \brief resume the copy - void resume(); - /// \brief get the size of the source file - qint64 size(); - /// \brief get the last good position - qint64 getLastGoodPosition(); - /// \brief start the reading of the source file - void startRead(); - /// \brief set the current max speed in KB/s - int setMaxSpeed(int maxSpeed); - /// \brief set block size in KB - bool setBlockSize(const int blockSize); - /// \brief reopen after an error - void reopen(); - /// \brief set the write thread - void setWriteThread(WriteThread * writeThread); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief to set the id - void setId(int id); - /// \brief stat - enum ReadStat - { - Idle=0, - InodeOperation=1, - Read=2, - WaitWritePipe=3, - Checksum=4 - }; - ReadStat stat; - #endif - /// \brief return if it's reading - bool isReading(); - /// \brief executed at regular interval to do a speed throling - void timeOfTheBlockCopyFinished(); - /// \brief do the fake open - void fakeOpen(); - /// \brief do the fake readIsStarted - void fakeReadIsStarted(); - /// \brief do the fake readIsStopped - void fakeReadIsStopped(); - /// do the checksum - void startCheckSum(); -public slots: - /// \brief to reset the copy, and put at the same state when it just open - void seekToZeroAndWait(); - void postOperation(); - /// do the checksum - void checkSum(); -signals: - void error(); - void isInPause(); - void opened(); - void readIsStarted(); - void readIsStopped(); - void closed(); - void isSeekToZeroAndWait(); - void checkIfIsWait(); - void resumeAfterErrorByRestartAll(); - void resumeAfterErrorByRestartAtTheLastPosition(); - void checksumFinish(const QByteArray&); - // internal signals - void internalStartOpen(); - void internalStartChecksum(); - void internalStartReopen(); - void internalStartRead(); - void internalStartClose(); - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - -private: - QString name; - QString errorString_internal; - AvancedQFile file; - volatile bool stopIt; - CopyMode mode; - qint64 lastGoodPosition; - volatile int blockSize; - volatile int maxSpeed; ///< The max speed in KB/s, 0 for no limit - QSemaphore waitNewClockForSpeed; - volatile int numberOfBlockCopied; ///< Multiple for count the number of block copied - volatile int multiplicatorForBigSpeed; ///< Multiple for count the number of block needed - volatile int MultiForBigSpeed; - WriteThread* writeThread; - int id; - QSemaphore isOpen; - volatile bool putInPause; - volatile bool isInReadLoop; - volatile bool seekToZero; - volatile bool tryStartRead; - qint64 size_at_open; - QDateTime mtime_at_open; - bool fakeMode; - //internal function - bool seek(qint64 position);/// \todo search if is use full -private slots: - bool internalOpen(bool resetLastGoodPosition=true); - bool internalReopen(); - void internalRead(); - void internalClose(bool callByTheDestructor=false); - void isInWait(); -}; - -#endif // READTHREAD_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.cpp b/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.cpp deleted file mode 100644 index a09f66a..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "RenamingRules.h" -#include "ui_RenamingRules.h" - -#include - -RenamingRules::RenamingRules(QWidget *parent) : - QDialog(parent), - ui(new Ui::RenamingRules) -{ - ui->setupUi(this); - connectUI(); - setRenamingRules("",""); -} - -RenamingRules::~RenamingRules() -{ - delete ui; -} - -void RenamingRules::on_buttonBox_clicked(QAbstractButton *button) -{ - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) - reject(); - if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::ResetRole) - { - setRenamingRules("",""); - emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); - } -} - -void RenamingRules::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - disconnectUI(); - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - if(!firstRenamingRule.isEmpty()) - ui->firstRenamingRule->setText(firstRenamingRule); - else - ui->firstRenamingRule->setText(tr("%1 - copy").arg("%name%")); - if(!otherRenamingRule.isEmpty()) - ui->otherRenamingRule->setText(otherRenamingRule); - else - ui->otherRenamingRule->setText(tr("%1 - copy (%2)").arg("%name%").arg("%number%")); - connectUI(); -} - -void RenamingRules::connectUI() -{ - connect(ui->firstRenamingRule,SIGNAL(editingFinished()),this,SLOT(firstRenamingRule_haveChanged())); - connect(ui->otherRenamingRule,SIGNAL(editingFinished()),this,SLOT(otherRenamingRule_haveChanged())); -} - -void RenamingRules::disconnectUI() -{ - disconnect(ui->firstRenamingRule,SIGNAL(editingFinished()),this,SLOT(firstRenamingRule_haveChanged())); - disconnect(ui->otherRenamingRule,SIGNAL(editingFinished()),this,SLOT(otherRenamingRule_haveChanged())); -} - -void RenamingRules::firstRenamingRule_haveChanged() -{ - QString newValue=ui->firstRenamingRule->text(); - if(newValue==tr("%1 - copy").arg("%name%")) - newValue=""; - if(newValue==firstRenamingRule) - return; - firstRenamingRule=newValue; - emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void RenamingRules::otherRenamingRule_haveChanged() -{ - QString newValue=ui->otherRenamingRule->text(); - if(newValue==tr("%1 - copy (%2)").arg("%name%").arg("%number%")) - newValue=""; - if(newValue==otherRenamingRule) - return; - otherRenamingRule=newValue; - emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void RenamingRules::newLanguageLoaded() -{ - ui->retranslateUi(this); - setRenamingRules(firstRenamingRule,otherRenamingRule); -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.h b/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.h deleted file mode 100644 index 2fd9580..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef RENAMINGRULES_H -#define RENAMINGRULES_H - -#include -#include - -namespace Ui { -class RenamingRules; -} - -/** Define rules for renaming */ -class RenamingRules : public QDialog -{ - Q_OBJECT -public: - explicit RenamingRules(QWidget *parent = 0); - ~RenamingRules(); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void newLanguageLoaded(); -private: - Ui::RenamingRules *ui; - void connectUI(); - void disconnectUI(); - QString firstRenamingRule; - QString otherRenamingRule; -private slots: - void on_buttonBox_clicked(QAbstractButton *button); - void firstRenamingRule_haveChanged(); - void otherRenamingRule_haveChanged(); -signals: - void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -}; - -#endif // RENAMINGRULES_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.ui b/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.ui deleted file mode 100644 index 9e84f4b..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/RenamingRules.ui +++ /dev/null @@ -1,129 +0,0 @@ - - - RenamingRules - - - - 0 - 0 - 303 - 213 - - - - Renaming rules - - - - 2 - - - 2 - - - - - First renaming - - - - - - %name% - copy - - - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> - - - - - - - - - - Second renaming - - - - - - %name% - copy (%number%) - - - - - - - <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> - - - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close|QDialogButtonBox::RestoreDefaults - - - - - - - - - buttonBox - accepted() - RenamingRules - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - RenamingRules - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/RmPath.cpp b/plugins/CopyEngine/Ultracopier-0.3/RmPath.cpp deleted file mode 100644 index a65fb97..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/RmPath.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "RmPath.h" - -RmPath::RmPath() -{ - stopIt=false; - waitAction=false; - setObjectName("RmPath"); - moveToThread(this); - start(); -} - -RmPath::~RmPath() -{ - stopIt=true; - quit(); - wait(); -} - -void RmPath::addPath(const QString &path) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - if(stopIt) - return; - emit internalStartAddPath(path); -} - -void RmPath::skip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartSkip(); -} - -void RmPath::retry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit internalStartRetry(); -} - -void RmPath::run() -{ - connect(this,SIGNAL(internalStartAddPath(QString)),this,SLOT(internalAddPath(QString)),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartDoThisPath()),this,SLOT(internalDoThisPath()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartSkip()),this,SLOT(internalSkip()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartRetry()),this,SLOT(internalRetry()),Qt::QueuedConnection); - exec(); -} - -void RmPath::internalDoThisPath() -{ - if(waitAction || pathList.isEmpty()) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+pathList.first()); - if(!rmpath(pathList.first())) - { - if(stopIt) - return; - waitAction=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unable to remove the folder: "+pathList.first()); - emit errorOnFolder(pathList.first(),tr("Unable to remove the folder")); - return; - } - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -/** remplace QDir::rmpath() because it return false if the folder not exists - and seam bug with parent folder */ -bool RmPath::rmpath(const QDir &dir) -{ - if(!dir.exists()) - return true; - bool allHaveWork=true; - QFileInfoList list = dir.entryInfoList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System,QDir::DirsFirst); - for (int i = 0; i < list.size(); ++i) - { - QFileInfo fileInfo(list.at(i)); - if(!fileInfo.isDir()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"found a file: "+fileInfo.fileName()); - allHaveWork=false; - } - else - { - //return the fonction for scan the new folder - if(!rmpath(dir.absolutePath()+'/'+fileInfo.fileName()+'/')) - allHaveWork=false; - } - } - if(!allHaveWork) - return allHaveWork; - allHaveWork=dir.rmdir(dir.absolutePath()); - if(!allHaveWork) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"unable to remove the folder: "+dir.absolutePath()); - return allHaveWork; -} - -void RmPath::internalAddPath(const QString &path) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+path); - pathList << path; - if(!waitAction) - checkIfCanDoTheNext(); -} - -void RmPath::checkIfCanDoTheNext() -{ - if(!waitAction && !stopIt && pathList.size()>0) - emit internalStartDoThisPath(); -} - -void RmPath::internalSkip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - pathList.removeFirst(); - emit firstFolderFinish(); - checkIfCanDoTheNext(); -} - -void RmPath::internalRetry() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - waitAction=false; - checkIfCanDoTheNext(); -} - diff --git a/plugins/CopyEngine/Ultracopier-0.3/RmPath.h b/plugins/CopyEngine/Ultracopier-0.3/RmPath.h deleted file mode 100644 index 5eca5e1..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/RmPath.h +++ /dev/null @@ -1,56 +0,0 @@ -/** \file RmPath.h -\brief Remove the path given as queued rmpath -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef RMPATH_H -#define RMPATH_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -/// \brief Remove the path given as queued rmpath -class RmPath : public QThread -{ - Q_OBJECT -public: - explicit RmPath(); - ~RmPath(); - /// \brief add new path to remove - void addPath(const QString &path); -signals: - void errorOnFolder(const QFileInfo &,const QString &); - void firstFolderFinish(); - void internalStartAddPath(const QString &path); - void internalStartDoThisPath(); - void internalStartSkip(); - void internalStartRetry(); - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); -public slots: - void skip(); - void retry(); -private: - void run(); - bool waitAction; - bool stopIt; - bool skipIt; - QStringList pathList; - void checkIfCanDoTheNext(); - QDir dir; - bool rmpath(const QDir &dir); -private slots: - void internalDoThisPath(); - void internalAddPath(const QString &path); - void internalSkip(); - void internalRetry(); -}; - - -#endif // RMPATH_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition.h b/plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition.h deleted file mode 100644 index c1758f4..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../../StructEnumDefinition.h" diff --git a/plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition_CopyEngine.h b/plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition_CopyEngine.h deleted file mode 100644 index 90af91b..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/StructEnumDefinition_CopyEngine.h +++ /dev/null @@ -1,90 +0,0 @@ -/** \file StructEnumDefinition_CopyEngine.h -\brief Define the structure and enumeration used in the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include - -#ifndef STRUCTDEF_COPYENGINE_H -#define STRUCTDEF_COPYENGINE_H - -/// \brief Define action if file exists -enum FileExistsAction -{ - FileExists_NotSet, - FileExists_Cancel, - FileExists_Skip, - FileExists_Overwrite, - FileExists_OverwriteIfNewer, - FileExists_OverwriteIfNotSameModificationDate, - FileExists_Rename -}; - -/// \brief Define action if file error -enum FileErrorAction -{ - FileError_NotSet, - FileError_Cancel, - FileError_Skip, - FileError_Retry, - FileError_PutToEndOfTheList -}; - -/// \brief to have the transfer status -enum TransferStat -{ - TransferStat_Idle=0, - TransferStat_PreOperation=1, - TransferStat_WaitForTheTransfer=2, - TransferStat_Transfer=3, - TransferStat_Checksum=4, - TransferStat_PostTransfer=5, - TransferStat_PostOperation=6 -}; - -/// \brief Define overwrite mode -/*enum OverwriteMode -{ - OverwriteMode_None, - OverwriteMode_Overwrite, - OverwriteMode_OverwriteIfNewer, - OverwriteMode_OverwriteIfNotSameModificationDate -};*/ - -/// \brief Define action if file exists -enum FolderExistsAction -{ - FolderExists_NotSet, - FolderExists_Cancel, - FolderExists_Merge, - FolderExists_Skip, - FolderExists_Rename -}; - -enum SearchType -{ - SearchType_rawText, - SearchType_simpleRegex, - SearchType_perlRegex, -}; - -enum ApplyOn -{ - ApplyOn_file, - ApplyOn_fileAndFolder, - ApplyOn_folder, -}; - -/** to store into different way the filter rules to be exported */ -struct Filters_rules -{ - QString search_text; - SearchType search_type; - ApplyOn apply_on; - bool need_match_all; - QRegExp regex; -}; - -#endif // STRUCTDEF_COPYENGINE_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/TransferThread.cpp b/plugins/CopyEngine/Ultracopier-0.3/TransferThread.cpp deleted file mode 100644 index 7550d8c..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/TransferThread.cpp +++ /dev/null @@ -1,1245 +0,0 @@ -//presume bug linked as multple paralelle inode to resume after "overwrite" -//then do overwrite node function to not re-set the file name - -#include "TransferThread.h" - -#ifdef Q_CC_GNU -//this next header is needed to change file time/date under gcc -#include -#include -#include -#include -#endif - -#ifndef Q_OS_UNIX -#include -#endif - -TransferThread::TransferThread() -{ - start(); - moveToThread(this); - needSkip = false; - transfer_stat = TransferStat_Idle; - stopIt = false; - fileExistsAction = FileExists_NotSet; - alwaysDoFileExistsAction= FileExists_NotSet; - readError = false; - writeError = false; - this->mkpathTransfer = mkpathTransfer; - readThread.setWriteThread(&writeThread); - - connect(&clockForTheCopySpeed, SIGNAL(timeout()), this, SLOT(timeOfTheBlockCopyFinished())); - maxTime=QDateTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); -} - -TransferThread::~TransferThread() -{ - exit(); - disconnect(&readThread); - disconnect(&writeThread); - disconnect(this); - wait(); -} - -void TransferThread::run() -{ - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start: "+QString::number((qint64)QThread::currentThreadId())); - transfer_stat = TransferStat_Idle; - stopIt = false; - fileExistsAction = FileExists_NotSet; - alwaysDoFileExistsAction= FileExists_NotSet; - //the error push - connect(&readThread,SIGNAL(error()), this, SLOT(getReadError()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(error()), this, SLOT(getWriteError()), Qt::QueuedConnection); - //the thread change operation - connect(this,SIGNAL(internalStartPreOperation()), this, SLOT(preOperation()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartPostOperation()), this, SLOT(postOperation()), Qt::QueuedConnection); - //the state change operation - //connect(&readThread,SIGNAL(readIsStopped()), &readThread, SLOT(postOperation()), Qt::QueuedConnection);//commented to do the checksum - connect(&readThread,SIGNAL(opened()), this, SLOT(readIsReady()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(opened()), this, SLOT(writeIsReady()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(readIsStopped()), this, SLOT(readIsStopped()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(writeIsStopped()), this, SLOT(writeIsStopped()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(readIsStopped()), &writeThread, SLOT(endIsDetected()), Qt::QueuedConnection); - //connect(&writeThread,SIGNAL(writeIsStopped()), &writeThread, SLOT(postOperation()), Qt::QueuedConnection);//commented to do the checksum - connect(&readThread,SIGNAL(closed()), this, SLOT(readIsClosed()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(closed()), this, SLOT(writeIsClosed()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(reopened()), this, SLOT(writeThreadIsReopened()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(checksumFinish(QByteArray)), this, SLOT(readChecksumFinish(QByteArray)), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(checksumFinish(QByteArray)),this, SLOT(writeChecksumFinish(QByteArray)), Qt::QueuedConnection); - //error management - connect(&readThread,SIGNAL(isSeekToZeroAndWait()), this, SLOT(readThreadIsSeekToZeroAndWait()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(resumeAfterErrorByRestartAtTheLastPosition()), this, SLOT(readThreadResumeAfterError()), Qt::QueuedConnection); - connect(&readThread,SIGNAL(resumeAfterErrorByRestartAll()), &writeThread, SLOT(flushAndSeekToZero()), Qt::QueuedConnection); - connect(&writeThread,SIGNAL(flushedAndSeekedToZero()), this, SLOT(readThreadResumeAfterError()), Qt::QueuedConnection); - connect(this,SIGNAL(internalTryStartTheTransfer()), this, SLOT(internalStartTheTransfer()), Qt::QueuedConnection); - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&readThread,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),Qt::QueuedConnection); - connect(&writeThread,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),Qt::QueuedConnection); - #endif - - exec(); -} - -TransferStat TransferThread::getStat() -{ - return transfer_stat; -} - -void TransferThread::startTheTransfer() -{ - emit internalTryStartTheTransfer(); -} - -void TransferThread::internalStartTheTransfer() -{ - if(transfer_stat==TransferStat_Idle) - { - if(mode!=Move) - { - /// \bug can pass here because in case of direct move on same media, it return to idle stat directly - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] can't start transfert at idle"); - } - return; - } - if(transfer_stat==TransferStat_PostOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] can't start transfert at PostOperation"); - return; - } - if(transfer_stat==TransferStat_Transfer) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] can't start transfert at Transfer"); - return; - } - if(canStartTransfer) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] canStartTransfer is already set to true"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] check how start the transfer"); - canStartTransfer=true; - if(readIsReadyVariable && writeIsReadyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start directly the transfer"); - ifCanStartTransfer(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start the transfer as delayed"); -} - -void TransferThread::setFiles(const QString &source,const qint64 &size,const QString &destination,const CopyMode &mode) -{ - if(transfer_stat!=TransferStat_Idle) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - //to prevent multiple file alocation into ListThread::doNewActions_inode_manipulation() - transfer_stat = TransferStat_PreOperation; - //emit pushStat(stat,transferId); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start, source: "+source+", destination: "+destination); - this->source = source; - this->destination = destination; - this->mode = mode; - this->size = size; - fileExistsAction = FileExists_NotSet; - canStartTransfer = false; - sended_state_preOperationStopped= false; - canBeMovedDirectlyVariable = false; - fileContentError = false; - resetExtraVariable(); - emit internalStartPreOperation(); -} - -void TransferThread::setFileExistsAction(const FileExistsAction &action) -{ - if(transfer_stat!=TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] action: "+QString::number(action)); - if(action!=FileExists_Rename) - fileExistsAction = action; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] rename at the wrong part, source: "+source+", destination: "+destination); - if(action==FileExists_Skip) - { - skip(); - return; - } - resetExtraVariable(); - emit internalStartPreOperation(); -} - -void TransferThread::setFileRename(const QString &nameForRename) -{ - if(transfer_stat!=TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] nameForRename: "+nameForRename); - destinationInfo.setFile(destination); - destination=destinationInfo.absolutePath(); - destination+=QDir::separator()+nameForRename; - destinationInfo.setFile(destination); - fileExistsAction = FileExists_NotSet; - resetExtraVariable(); - emit internalStartPreOperation(); -} - -void TransferThread::setAlwaysFileExistsAction(const FileExistsAction &action) -{ - //ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] action to do always: "+QString::number(action)); - alwaysDoFileExistsAction=action; -} - -void TransferThread::resetExtraVariable() -{ - sended_state_readStopped = false; - sended_state_writeStopped = false; - writeError = false; - readError = false; - readIsReadyVariable = false; - writeIsReadyVariable = false; - readIsFinishVariable = false; - writeIsFinishVariable = false; - readIsClosedVariable = false; - writeIsClosedVariable = false; - needSkip = false; - retry = false; - readIsOpenVariable = false; - writeIsOpenVariable = false; -} - -void TransferThread::preOperation() -{ - if(transfer_stat!=TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] already used, source: "+source+", destination: "+destination); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - needRemove=false; - sourceInfo.setFile(source); - destinationInfo.setFile(destination); - if(isSame()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] is same"+source); - return; - } - if(destinationExists()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] destination exists: "+source); - return; - } - if(canBeMovedDirectly()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] need moved directly: "+source); - canBeMovedDirectlyVariable=true; - readThread.fakeOpen(); - writeThread.fakeOpen(); - return; - } - tryOpen(); -} - -void TransferThread::tryOpen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start source and destination: "+source+" and "+destination); - if(!readIsOpenVariable) - { - readError=false; - readThread.open(source,mode); - } - if(!writeIsOpenVariable) - { - writeError=false; - writeThread.open(destination,size,osBuffer && (!osBufferLimited || (osBufferLimited && sizeacquire(); - if(!dir.exists()) - dir.mkpath(destinationInfo.absolutePath()); - mkpathTransfer->release(); - } - if(!sourceFile.rename(destinationFile.fileName())) - { - if(sourceFile.exists()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("file not not exists %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); - else if(!dir.exists()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("destination folder not exists %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("unable to do real move %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); - emit errorOnFile(sourceFile,sourceFile.errorString()); - return; - } - readThread.fakeReadIsStarted(); - writeThread.fakeWriteIsStarted(); - readThread.fakeReadIsStopped(); - writeThread.fakeWriteIsStopped(); -} - -bool TransferThread::canBeMovedDirectly() -{ - //move if on same mount point - #if defined (Q_OS_LINUX) || defined (Q_OS_WIN32) - if(mode!=Move) - return false; - if(mountSysPoint.size()==0) - return false; - if(getDrive(destinationInfo.fileName())==getDrive(sourceInfo.fileName())) - return true; - #endif - return false; -} - -void TransferThread::readIsReady() -{ - if(readIsReadyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readIsReadyVariable=true; - readIsOpenVariable=true; - readIsClosedVariable=false; - ifCanStartTransfer(); -} - -void TransferThread::ifCanStartTransfer() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] readIsReadyVariable: "+QString::number(readIsReadyVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)); - if(readIsReadyVariable && writeIsReadyVariable) - { - transfer_stat=TransferStat_WaitForTheTransfer; - sended_state_readStopped = false; - sended_state_writeStopped = false; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stat=WaitForTheTransfer"); - if(!sended_state_preOperationStopped) - { - sended_state_preOperationStopped=true; - emit preOperationStopped(); - } - if(canStartTransfer) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stat=Transfer"); - transfer_stat=TransferStat_Transfer; - if(!canBeMovedDirectlyVariable) - { - needRemove=true; - readThread.startRead(); - } - else - tryMoveDirectly(); - emit pushStat(transfer_stat,transferId); - } - //else - //emit pushStat(stat,transferId); - } -} - -void TransferThread::writeIsReady() -{ - if(writeIsReadyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - writeIsReadyVariable=true; - writeIsOpenVariable=true; - writeIsClosedVariable=false; - ifCanStartTransfer(); -} - - -//set the copy info and options before runing -void TransferThread::setRightTransfer(const bool doRightTransfer) -{ - this->doRightTransfer=doRightTransfer; -} - -//set keep date -void TransferThread::setKeepDate(const bool keepDate) -{ - this->keepDate=keepDate; -} - -//set the current max speed in KB/s -void TransferThread::setMaxSpeed(int maxSpeed) -{ - int interval=readThread.setMaxSpeed(maxSpeed); - writeThread.setMaxSpeed(maxSpeed); - if(maxSpeed>0) - { - clockForTheCopySpeed.setInterval(interval); - if(!clockForTheCopySpeed.isActive())//seam useless !this->isFinished() - clockForTheCopySpeed.start(); - } - else - { - if(clockForTheCopySpeed.isActive()) - clockForTheCopySpeed.stop(); - } -} - -//set block size in KB -bool TransferThread::setBlockSize(const unsigned int blockSize) -{ - this->blockSize=blockSize; - return readThread.setBlockSize(blockSize) && writeThread.setBlockSize(blockSize); -} - -//pause the copy -void TransferThread::pause() -{ - if(transfer_stat==TransferStat_Idle) - return; - readThread.pause(); -} - -//resume the copy -void TransferThread::resume() -{ - if(transfer_stat==TransferStat_Idle) - return; - readThread.resume(); -} - -//stop the current copy -void TransferThread::stop() -{ - stopIt=true; - if(transfer_stat==TransferStat_Idle) - return; - readThread.stop(); - writeThread.stop(); -} - -void TransferThread::readIsFinish() -{ - if(readIsFinishVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readIsFinishVariable=true; - canStartTransfer=false; - //check here if need start checksuming or not - real_doChecksum=doChecksum && (!checksumOnlyOnError || fileContentError); - if(real_doChecksum) - { - readIsFinishVariable=false; - transfer_stat=TransferStat_Checksum; - sourceChecksum=QByteArray(); - destinationChecksum=QByteArray(); - readThread.startCheckSum(); - } - else - { - transfer_stat=TransferStat_PostTransfer; - readThread.postOperation(); - } - emit pushStat(transfer_stat,transferId); -} - -void TransferThread::writeIsFinish() -{ - if(writeIsFinishVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - writeIsFinishVariable=true; - //check here if need start checksuming or not - if(real_doChecksum) - { - writeIsFinishVariable=false; - transfer_stat=TransferStat_Checksum; - writeThread.startCheckSum(); - } - else - writeThread.postOperation(); -} - -void TransferThread::readChecksumFinish(const QByteArray& checksum) -{ - sourceChecksum=checksum; - compareChecksum(); -} - -void TransferThread::writeChecksumFinish(const QByteArray& checksum) -{ - destinationChecksum=checksum; - compareChecksum(); -} - -void TransferThread::compareChecksum() -{ - if(sourceChecksum.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] the checksum of source is missing"); - return; - } - if(destinationChecksum.size()==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] the checksum of destination is missing"); - return; - } - if(sourceChecksum==destinationChecksum) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] the checksum match"); - readThread.postOperation(); - writeThread.postOperation(); - transfer_stat=TransferStat_PostTransfer; - emit pushStat(transfer_stat,transferId); - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] the checksum not match"); - //emit error here, and wait to resume - emit errorOnFile(destinationInfo,tr("The checksums not match")); - } -} - -void TransferThread::readIsClosed() -{ - if(readIsClosedVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readIsClosedVariable=true; - checkIfAllIsClosed(); -} - -void TransferThread::writeIsClosed() -{ - if(writeIsClosedVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] double event dropped"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - writeIsClosedVariable=true; - checkIfAllIsClosed(); -} - -bool TransferThread::checkIfAllIsClosed() -{ - if((readError || writeError) && !needSkip) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] resolve error before progress"); - return false; - } - if((!readIsReadyVariable || readIsClosedVariable) && (!writeIsReadyVariable || writeIsClosedVariable)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit internalStartPostOperation() to do the real post operation"); - transfer_stat=TransferStat_PostOperation; - //emit pushStat(stat,transferId); - emit internalStartPostOperation(); - return true; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] "+QString("wait self close: readIsReadyVariable: %1, readIsClosedVariable: %2, writeIsReadyVariable: %3, writeIsClosedVariable: %4") - .arg(readIsReadyVariable) - .arg(readIsClosedVariable) - .arg(writeIsReadyVariable) - .arg(writeIsClosedVariable) - ); - return false; - } -} - -/// \todo found way to retry that's -/// \todo the rights copy -void TransferThread::postOperation() -{ - if(transfer_stat!=TransferStat_PostOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] need be in transfer, source: "+source+", destination: "+destination+", stat:"+QString::number(transfer_stat)); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - //all except closing - if((readError || writeError) && !needSkip)//normally useless by checkIfAllIsFinish() - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] resume after error"); - return; - } - - if(!needSkip) - { - if(!doFilePostOperation()) - return; - - //remove source in moving mode - if(mode==Move && !canBeMovedDirectlyVariable) - { - if(QFile::exists(destination)) - { - QFile sourceFile(source); - if(!sourceFile.remove()) - { - emit errorOnFile(sourceInfo,sourceFile.errorString()); - return; - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] try remove source but destination not exists!"); - } - } - else//do difference skip a file and skip this error case - { - if(needRemove && QFile::exists(destination)) - { - QFile destinationFile(destination); - if(!destinationFile.remove()) - { - //emit errorOnFile(sourceInfo,destinationFile.errorString()); - //return; - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] try remove destination but not exists!"); - } - transfer_stat=TransferStat_Idle; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit postOperationStopped()"); - emit postOperationStopped(); -} - -bool TransferThread::doFilePostOperation() -{ - //do operation needed by copy - if(!canBeMovedDirectlyVariable) - { - //set the time if no write thread used - if(keepDate) - changeFileDateTime(destination,source);//can't do that's after move because after move the source not exist - /* - ignore it, because need correct management, mainly with move - if(!) - { - emit errorOnFile(destinationInfo,tr("Unable to change the date"));//destination.errorString() - return false; - }*/ - } - - if(stopIt) - return false; - - return true; -} - -////////////////////////////////////////////////////////////////// -/////////////////////// Error management ///////////////////////// -////////////////////////////////////////////////////////////////// - -void TransferThread::getWriteError() -{ - if(writeError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already in write error!"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - fileContentError = true; - writeError = true; - writeIsReadyVariable = false; - writeError_source_seeked = false; - writeError_destination_reopened = false; - emit errorOnFile(destinationInfo,writeThread.errorString()); -} - -void TransferThread::getReadError() -{ - if(readError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already in read error!"); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - fileContentError = true; - readError = true; - writeIsReadyVariable = false; - readIsReadyVariable = false; - emit errorOnFile(sourceInfo,readThread.errorString()); -} - -//retry after error -void TransferThread::retryAfterError() -{ - //opening error - if(transfer_stat==TransferStat_PreOperation) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] is not idle, source: "+source+", destination: "+destination+", stat: "+QString::number(transfer_stat)); - tryOpen(); - return; - } - //data streaming error - if(transfer_stat!=TransferStat_PostOperation && transfer_stat!=TransferStat_Transfer && transfer_stat!=TransferStat_Checksum) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"["+QString::number(id)+"] is not idle, source: "+source+", destination: "+destination+", stat: "+QString::number(transfer_stat)); - return; - } - if(canBeMovedDirectlyVariable) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] retry the system move"); - tryMoveDirectly(); - return; - } - if(transfer_stat==TransferStat_Checksum) - { - if(writeError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the write error"); - writeThread.reopen(); - } - else if(readError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the read error"); - readThread.reopen(); - } - else //only checksum difference - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] retry all the transfer"); - canStartTransfer=true; - ifCanStartTransfer(); - } - return; - } - if(writeError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the write error"); - readThread.seekToZeroAndWait(); - writeThread.reopen(); - } - else if(readError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start and resume the read error"); - readThread.reopen(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unknow error resume"); -} - -void TransferThread::writeThreadIsReopened() -{ - if(writeError_destination_reopened) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - writeError_destination_reopened=true; - if(transfer_stat==TransferStat_Checksum) - { - writeThread.startCheckSum(); - return; - } - if(writeError_source_seeked && writeError_destination_reopened) - resumeTransferAfterWriteError(); -} - -void TransferThread::readThreadIsSeekToZeroAndWait() -{ - if(writeError_source_seeked) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - writeError_source_seeked=true; - if(writeError_source_seeked && writeError_destination_reopened) - resumeTransferAfterWriteError(); -} - -void TransferThread::resumeTransferAfterWriteError() -{ - writeError=false; -/******************************** - if(canStartTransfer) - readThread.startRead(); -useless, because the open destination event -will restart the transfer as normal -*********************************/ -/********************************* -if(!canStartTransfer) - stat=WaitForTheTransfer; -useless because already do at open event -**********************************/ - //if is in wait - if(!canStartTransfer) - emit checkIfItCanBeResumed(); -} - -void TransferThread::readThreadResumeAfterError() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - readError=false; - writeIsReady(); - readIsReady(); -} - -////////////////////////////////////////////////////////////////// -///////////////////////// Normal event /////////////////////////// -////////////////////////////////////////////////////////////////// - -void TransferThread::readIsStopped() -{ - if(!sended_state_readStopped) - { - sended_state_readStopped=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit readIsStopped()"); - emit readStopped(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] drop dual read stopped"); - readIsFinish(); -} - -void TransferThread::writeIsStopped() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - if(!sended_state_writeStopped) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit writeStopped()"); - sended_state_writeStopped=true; - emit writeStopped(); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] double event dropped"); - writeIsFinish(); -} - -void TransferThread::timeOfTheBlockCopyFinished() -{ - readThread.timeOfTheBlockCopyFinished(); -} - -//get drive of an file or folder -QString TransferThread::getDrive(QString fileOrFolder) -{ - for (int i = 0; i < mountSysPoint.size(); ++i) { - if(fileOrFolder.startsWith(mountSysPoint.at(i))) - return mountSysPoint.at(i); - } - //if unable to locate the right mount point - return ""; -} - -//set drive list, used in getDrive() -void TransferThread::setDrive(QStringList drives) -{ - mountSysPoint=drives; -} - -//fonction to edit the file date time -bool TransferThread::changeFileDateTime(const QString &source,const QString &destination) -{ - /* - if(maxTime>=sourceInfo.lastModified()) - return; - */ - /** Why not do it with Qt? Because it not support setModificationTime(), and get the time with Qt, that's mean use local time where in C is UTC time */ - #ifdef Q_OS_UNIX - #ifdef Q_OS_LINUX - struct stat info; - stat(source.toLatin1().data(),&info); - time_t ctime=info.st_ctim.tv_sec; - time_t actime=info.st_atim.tv_sec; - time_t modtime=info.st_mtim.tv_sec; - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - //creation time not exists into unix world - Q_UNUSED(ctime) - return utime(destination.toLatin1().data(),&butime)==0; - #else //mainly for mac - QFileInfo fileInfo(destination); - time_t ctime=fileInfo.created().toTime_t(); - time_t actime=fileInfo.lastRead().toTime_t(); - time_t modtime=fileInfo.lastModified().toTime_t(); - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - //creation time not exists into unix world - Q_UNUSED(ctime) - return utime(destination.toLatin1().data(),&butime)==0; - #endif - #else - #ifdef Q_OS_WIN32 - #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY - struct __stat64 info; - _stat64(source.toLatin1().data(),&info); - time_t ctime=info.st_ctime; - time_t actime=info.st_atime; - time_t modtime=info.st_mtime; - //this function avalaible on unix and mingw - utimbuf butime; - butime.actime=actime; - butime.modtime=modtime; - //creation time not exists into unix world - Q_UNUSED(ctime) - return utime(destination.toLatin1().data(),&butime)==0; - #else - wchar_t filePath[65535]; - source.toWCharArray(filePath); - HANDLE hFileSouce = CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - destination.toWCharArray(filePath); - HANDLE hFileDestination = CreateFile(filePath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - if(hFileSouce == INVALID_HANDLE_VALUE) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open failed to read"); - return false; - } - if(hFileDestination == INVALID_HANDLE_VALUE) - { - CloseHandle(hFileSouce); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open failed to write"); - return false; - } - FILETIME ftCreate, ftAccess, ftWrite; - if(!GetFileTime(hFileSouce, &ftCreate, &ftAccess, &ftWrite)) - { - CloseHandle(hFileSouce); - CloseHandle(hFileDestination); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unable to get the file time"); - return false; - } - if(!SetFileTime(hFileDestination, &ftCreate, &ftAccess, &ftWrite)) - { - CloseHandle(hFileSouce); - CloseHandle(hFileDestination); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unable to set the file time"); - return false; - } - CloseHandle(hFileSouce); - CloseHandle(hFileDestination); - return true; - #endif - #else - return false; - #endif - #endif - return false; -} - -//skip the copy -void TransferThread::skip() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start with stat: "+QString::number(transfer_stat)); - switch(transfer_stat) - { - case TransferStat_PreOperation: - case TransferStat_WaitForTheTransfer: - needSkip=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] case WaitForTheTransfer or PreOperation, readIsReadyVariable: "+QString::number(readIsReadyVariable)+", readIsClosedVariable: "+QString::number(readIsClosedVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)+", writeIsClosedVariable: "+QString::number(writeIsClosedVariable)); - //check if all is source and destination is closed - if(!checkIfAllIsClosed()) - { - if(readIsReadyVariable && !readIsClosedVariable) - readThread.stop(); - if(writeIsReadyVariable && !writeIsClosedVariable) - writeThread.stop(); - } - break; - case TransferStat_Transfer: - needSkip=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] case Transfer, readIsReadyVariable: "+QString::number(readIsReadyVariable)+", readIsClosedVariable: "+QString::number(readIsClosedVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)+", writeIsClosedVariable: "+QString::number(writeIsClosedVariable)); - if(!checkIfAllIsClosed()) - { - if(readIsReadyVariable && !readIsClosedVariable) - readThread.stop(); - if(writeIsReadyVariable && !writeIsClosedVariable) - writeThread.stop(); - } - break; - case TransferStat_Checksum: - needSkip=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] case Transfer, readIsReadyVariable: "+QString::number(readIsReadyVariable)+", readIsClosedVariable: "+QString::number(readIsClosedVariable)+", writeIsReadyVariable: "+QString::number(writeIsReadyVariable)+", writeIsClosedVariable: "+QString::number(writeIsClosedVariable)); - if(!checkIfAllIsClosed()) - { - if(readIsReadyVariable && !readIsClosedVariable) - readThread.stop(); - if(writeIsReadyVariable && !writeIsClosedVariable) - writeThread.stop(); - } - break; - case TransferStat_PostOperation: - //do nothing because here is closing... - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] is already in post op"); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] can skip in this state!"); - return; - } -} - -//return info about the copied size -qint64 TransferThread::copiedSize() -{ - switch(transfer_stat) - { - case TransferStat_Transfer: - case TransferStat_PostOperation: - return readThread.getLastGoodPosition(); - case TransferStat_Checksum: - return transferSize; - default: - return 0; - } -} - -//retry after error -void TransferThread::putAtBottom() -{ - emit tryPutAtBottom(); -} - -void TransferThread::set_osBufferLimit(unsigned int osBufferLimit) -{ - this->osBufferLimit=osBufferLimit; -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG -//to set the id -void TransferThread::setId(int id) -{ - this->id=id; - readThread.setId(id); - writeThread.setId(id); -} - -QChar TransferThread::readingLetter() -{ - switch(readThread.stat) - { - case ReadThread::Idle: - return '_'; - break; - case ReadThread::InodeOperation: - return 'I'; - break; - case ReadThread::Read: - return 'R'; - break; - case ReadThread::WaitWritePipe: - return 'W'; - break; - case ReadThread::Checksum: - return 'S'; - break; - default: - return '?'; - } -} - -QChar TransferThread::writingLetter() -{ - switch(writeThread.stat) - { - case WriteThread::Idle: - return '_'; - break; - case WriteThread::InodeOperation: - return 'I'; - break; - case WriteThread::Write: - return 'W'; - break; - case WriteThread::Close: - return 'C'; - break; - case WriteThread::Read: - return 'R'; - break; - case WriteThread::Checksum: - return 'S'; - break; - default: - return '?'; - } -} - -#endif - -void TransferThread::setMkpathTransfer(QSemaphore *mkpathTransfer) -{ - this->mkpathTransfer=mkpathTransfer; - writeThread.setMkpathTransfer(mkpathTransfer); -} - -void TransferThread::set_doChecksum(bool doChecksum) -{ - this->doChecksum=doChecksum; -} - -void TransferThread::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) -{ - this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; -} - -void TransferThread::set_checksumOnlyOnError(bool checksumOnlyOnError) -{ - this->checksumOnlyOnError=checksumOnlyOnError; -} - -void TransferThread::set_osBuffer(bool osBuffer) -{ - this->osBuffer=osBuffer; -} - -void TransferThread::set_osBufferLimited(bool osBufferLimited) -{ - this->osBufferLimited=osBufferLimited; -} - -//not copied size, because that's count to the checksum, ... -quint64 TransferThread::realByteTransfered() -{ - switch(transfer_stat) - { - case TransferStat_Transfer: - case TransferStat_PostOperation: - case TransferStat_Checksum: - return readThread.getLastGoodPosition(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] transferSize: "+QString::number(transferSize)); - return transferSize; - default: - return 0; - } -} - -void TransferThread::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/TransferThread.h b/plugins/CopyEngine/Ultracopier-0.3/TransferThread.h deleted file mode 100644 index c32ccf3..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/TransferThread.h +++ /dev/null @@ -1,218 +0,0 @@ -/** \file TransferThread.h -\brief Thread changed to manage the inode operation, the signals, canceling, pre and post operations -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef TRANSFERTHREAD_H -#define TRANSFERTHREAD_H - -#include -#include -#include -#include -#include -#include -#include - -#include "ReadThread.h" -#include "WriteThread.h" -#include "Environment.h" -#include "StructEnumDefinition_CopyEngine.h" - -/// \brief Thread changed to manage the inode operation, the signals, canceling, pre and post operations -class TransferThread : public QThread -{ - Q_OBJECT -public: - explicit TransferThread(); - ~TransferThread(); - /// \brief get transfer stat - TransferStat getStat(); - /// \brief get drive of an file or folder - QString getDrive(QString fileOrFolder); - /// \brief set drive list, used in getDrive() - void setDrive(QStringList drives); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief to set the id - void setId(int id); - /// \brief get the reading letter - QChar readingLetter(); - /// \brief get the writing letter - QChar writingLetter(); - #endif - /// \brief to have semaphore, and try create just one by one - void setMkpathTransfer(QSemaphore *mkpathTransfer); - /// \brief to store the transfer id - quint64 transferId; - /// \brief to store the transfer size - quint64 transferSize; - - void set_doChecksum(bool doChecksum); - void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); - void set_checksumOnlyOnError(bool checksumOnlyOnError); - void set_osBuffer(bool osBuffer); - void set_osBufferLimited(bool osBufferLimited); - - //not copied size, because that's count to the checksum, ... - quint64 realByteTransfered(); -protected: - void run(); -signals: - //to send state - void preOperationStopped(); - void checkIfItCanBeResumed(); - //void transferStarted();//not sended (and not used then) - void readStopped(); - void writeStopped(); - void postOperationStopped(); - //get dialog - void fileAlreadyExists(QFileInfo,QFileInfo,bool isSame); - void errorOnFile(QFileInfo,QString); - //internal signal - void internalStartPostOperation(); - void internalStartPreOperation(); - void internalStartResumeAfterErrorAndSeek(); - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - void tryPutAtBottom(); - //force into the right thread - void internalTryStartTheTransfer(); - /// \brief update the transfer stat - void pushStat(TransferStat,quint64); -public slots: - /// \brief to start the transfer of data - void startTheTransfer(); - /// \brief to set files to transfer - void setFiles(const QString &source,const qint64 &size,const QString &destination,const CopyMode &mode); - /// \brief to set file exists action to do - void setFileExistsAction(const FileExistsAction &action); - /// \brief to set the new name of the destination - void setFileRename(const QString &nameForRename); - /// \brief to start the transfer of data - void setAlwaysFileExistsAction(const FileExistsAction &action); - /// \brief set the copy info and options before runing - void setRightTransfer(const bool doRightTransfer); - /// \brief set keep date - void setKeepDate(const bool keepDate); - /// \brief set the current max speed in KB/s - void setMaxSpeed(int maxSpeed); - /// \brief set block size in KB - bool setBlockSize(const unsigned int blockSize); - /// \brief pause the copy - void pause(); - /// \brief resume the copy - void resume(); - /// \brief stop the copy - void stop(); - /// \brief skip the copy - void skip(); - /// \brief retry after error - void retryAfterError(); - /// \brief return info about the copied size - qint64 copiedSize(); - /// \brief put the current file at bottom - void putAtBottom(); - - void set_osBufferLimit(unsigned int osBufferLimit); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -private slots: - void preOperation(); - void readIsReady(); - void writeIsReady(); - void readIsFinish(); - void writeIsFinish(); - void readIsClosed(); - void writeIsClosed(); - void postOperation(); - void getWriteError(); - void getReadError(); - void readChecksumFinish(const QByteArray&); - void writeChecksumFinish(const QByteArray&); - void compareChecksum(); - //void syncAfterErrorAndReadFinish(); - void readThreadIsSeekToZeroAndWait(); - void writeThreadIsReopened(); - void readThreadResumeAfterError(); - //to filter the emition of signal - void readIsStopped(); - void writeIsStopped(); - //speed limitation - void timeOfTheBlockCopyFinished(); - //force into the right thread - void internalStartTheTransfer(); -private: - enum MoveReturn - { - MoveReturn_skip=0, - MoveReturn_moved=1, - MoveReturn_error=2 - }; - TransferStat transfer_stat; - ReadThread readThread; - WriteThread writeThread; - QString source; - QString destination; - CopyMode mode; - QTimer clockForTheCopySpeed; ///< For the speed throttling - bool doRightTransfer; - bool keepDate; - bool readIsReadyVariable; - bool writeIsReadyVariable; - bool readIsOpenVariable; - bool writeIsOpenVariable; - bool readIsFinishVariable; - bool writeIsFinishVariable; - bool readIsClosedVariable; - bool writeIsClosedVariable; - bool canBeMovedDirectlyVariable; - QByteArray sourceChecksum,destinationChecksum; - volatile bool stopIt; - volatile bool canStartTransfer; - int blockSize; - bool retry; - QFileInfo sourceInfo; - QFileInfo destinationInfo; - QStringList mountSysPoint; - qint64 size; - FileExistsAction fileExistsAction; - FileExistsAction alwaysDoFileExistsAction; - bool needSkip,needRemove; - QDateTime maxTime; - int id; - QSemaphore *mkpathTransfer; - bool doChecksum,real_doChecksum; - bool checksumIgnoreIfImpossible; - bool checksumOnlyOnError; - bool osBuffer; - bool osBufferLimited; - unsigned int osBufferLimit; - QString firstRenamingRule; - QString otherRenamingRule; - //error management - bool writeError,writeError_source_seeked,writeError_destination_reopened; - bool readError; - bool fileContentError; - //different pre-operation - bool isSame(); - bool destinationExists(); - bool canBeMovedDirectly(); - void tryMoveDirectly(); - void ifCanStartTransfer(); - //fonction to edit the file date time - bool changeFileDateTime(const QString &source,const QString &destination); - void resetExtraVariable(); - //error management function - void resumeTransferAfterWriteError(); - //to send state - bool sended_state_preOperationStopped; - bool sended_state_readStopped; - bool sended_state_writeStopped; - //different post-operation - bool checkIfAllIsClosed(); - bool doFilePostOperation(); - //different pre-operation - void tryOpen(); -}; - -#endif // TRANSFERTHREAD_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/Variable.h b/plugins/CopyEngine/Ultracopier-0.3/Variable.h deleted file mode 100644 index f39b8a6..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/Variable.h +++ /dev/null @@ -1,35 +0,0 @@ -/** \file Variable.h -\brief Define the environment variable -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef VARIABLE_H -#define VARIABLE_H - -//Un-comment this next line to put ultracopier plugin in debug mode -#define ULTRACOPIER_PLUGIN_DEBUG -#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW -#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW_TIMER 150 - -#define ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK 64 -#define ULTRACOPIER_PLUGIN_MINTIMERINTERVAL 50 -#define ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL 100 -#define ULTRACOPIER_PLUGIN_NUMSEMSPEEDMANAGEMENT 2 -#define ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT 64 -#define ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER 1 -#define ULTRACOPIER_PLUGIN_MINIMALYEAR 1990 - -//if set, check the inode type at scanFileOrFolder, deprecated into the new algorithm and not used -#define ULTRACOPIER_PLUGIN_CHECKLISTTYPE - -/** \brief Need be greater than 2, but greater than 20 to be efficient */ -#define ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST 40 -#define ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION 200 - -//#define ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY - -#endif // VARIABLE_H - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/WriteThread.cpp b/plugins/CopyEngine/Ultracopier-0.3/WriteThread.cpp deleted file mode 100644 index 448e8dc..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/WriteThread.cpp +++ /dev/null @@ -1,508 +0,0 @@ -#include "WriteThread.h" - -#include - -WriteThread::WriteThread() -{ - stopIt=false; - isOpen.release(); - start(); - moveToThread(this); - setObjectName("write"); - this->mkpathTransfer = mkpathTransfer; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - CurentCopiedSize=0; - buffer=false; - putInPause=false; - needRemoveTheFile=false; - blockSize=1024*1024; -} - -WriteThread::~WriteThread() -{ - stopIt=true; - needRemoveTheFile=true; - freeBlock.release(); - // useless because stopIt will close all thread, but if thread not runing run it - //endIsDetected(); - emit internalStartClose(); - isOpen.acquire(); - disconnect(this); - quit(); - wait(); -} - -void WriteThread::run() -{ - connect(this,SIGNAL(internalStartOpen()), this,SLOT(internalOpen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartReopen()), this,SLOT(internalReopen()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartWrite()), this,SLOT(internalWrite()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartClose()), this,SLOT(internalClose()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartEndOfFile()), this,SLOT(internalEndOfFile()), Qt::QueuedConnection); - connect(this,SIGNAL(internalStartFlushAndSeekToZero()), this,SLOT(internalFlushAndSeekToZero()),Qt::QueuedConnection); - connect(this,SIGNAL(internalStartChecksum()), this,SLOT(checkSum()), Qt::QueuedConnection); - exec(); -} - -bool WriteThread::internalOpen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] internalOpen destination: "+name); - if(stopIt) - return false; - if(file.isOpen()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] already open! destination: "+file.fileName()); - return false; - } - //set to LISTBLOCKSIZE - while(freeBlock.available()ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK) - freeBlock.acquire(freeBlock.available()-ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK); - stopIt=false; - CurentCopiedSize=0; - endDetected=false; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=InodeOperation; - #endif - file.setFileName(name); - //mkpath check if exists and return true if already exists - QFileInfo destinationInfo(file); - QDir destinationFolder; - { - mkpathTransfer->acquire(); - if(!destinationFolder.exists(destinationInfo.absolutePath())) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] "+QString("Try create the path: %1") - .arg(destinationInfo.absolutePath())); - if(!destinationFolder.mkpath(destinationInfo.absolutePath())) - { - if(!destinationFolder.exists(destinationInfo.absolutePath())) - { - /// \todo do real folder error here - errorString_internal="mkpath error on destination"; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable create the folder: %1, error: %2") - .arg(destinationInfo.absolutePath()) - .arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } - } - } - mkpathTransfer->release(); - } - if(stopIt) - return false; - //try open it - QIODevice::OpenMode flags=QIODevice::ReadWrite; - if(!buffer) - flags|=QIODevice::Unbuffered; - if(file.open(flags)) - { - if(stopIt) - return false; - file.seek(0); - if(stopIt) - return false; - file.resize(startSize); - if(stopIt) - return false; - emit opened(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - isOpen.acquire(); - needRemoveTheFile=false; - return true; - } - else - { - if(stopIt) - return false; - errorString_internal=file.errorString(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Unable to open: %1, error: %2").arg(name).arg(errorString_internal)); - emit error(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - return false; - } -} - -void WriteThread::open(const QString &name,const quint64 &startSize,const bool &buffer) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] open destination: "+name); - if(stopIt) - return; - fakeMode=false; - this->name=name; - this->startSize=startSize; - this->buffer=buffer; - endDetected=false; - emit internalStartOpen(); -} - -void WriteThread::endIsDetected() -{ - if(endDetected) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] double event dropped"); - return; - } - endDetected=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - emit internalStartEndOfFile(); -} - -QString WriteThread::errorString() -{ - return errorString_internal; -} - -bool WriteThread::write(const QByteArray &data) -{ - if(stopIt) - return false; - freeBlock.acquire(); - if(stopIt) - return false; - { - QMutexLocker lock_mutex(&accessList); - theBlockList.append(data); - } - emit internalStartWrite(); - return true; -} - -void WriteThread::stop() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop()"); - needRemoveTheFile=true; - stopIt=true; - if(isOpen.available()>0) - return; - freeBlock.release(); - // useless because stopIt will close all thread, but if thread not runing run it - endIsDetected(); - //for the stop for skip: void TransferThread::skip() - emit internalStartClose(); -} - -void WriteThread::flushBuffer() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - freeBlock.release(); - freeBlock.acquire(); - { - QMutexLocker lock_mutex(&accessList); - theBlockList.clear(); - } -} - -void WriteThread::internalEndOfFile() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] writeIsStopped"); - emit writeIsStopped(); -} - -void WriteThread::internalWrite() -{ - if(stopIt) - return; - //read one block - if(theBlockList.size()<=0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] End detected of the file"); - return; - } - else - { - QMutexLocker lock_mutex(&accessList); - blockArray=theBlockList.first(); - theBlockList.removeFirst(); - } - //write one block - freeBlock.release(); - - if(stopIt) - return; - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Write; - #endif - bytesWriten=file.write(blockArray); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - //mutex for stream this data - if(CurentCopiedSize==0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] emit writeIsStarted()"); - emit writeIsStarted(); - } - CurentCopiedSize+=bytesWriten; - if(stopIt) - return; - if(file.error()!=QFile::NoError) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error())); - errorString_internal=QString("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error()); - stopIt=true; - emit error(); - return; - } - if(bytesWriten!=blockArray.size()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size())); - errorString_internal=QString("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size()); - stopIt=true; - emit error(); - return; - } - lastGoodPosition+=bytesWriten; -} - -void WriteThread::postOperation() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - emit internalStartClose(); -} - -void WriteThread::internalClose(bool emitSignal) -{ - /// \note never send signal here, because it's called by the destructor - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Close; - #endif - if(!fakeMode && file.isOpen()) - { - if(!needRemoveTheFile) - { - if(startSize!=CurentCopiedSize) - file.resize(CurentCopiedSize); - } - file.close(); - if(needRemoveTheFile) - { - if(file.remove()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] unable to remove the destination file"); - } - needRemoveTheFile=false; - } - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - if(emitSignal) - emit closed(); - - /// \note always the last of this function - if(!fakeMode) - isOpen.release(); -} - -void WriteThread::internalReopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - internalClose(false); - flushBuffer(); - stopIt=false; - CurentCopiedSize=0; - if(internalOpen()) - emit reopened(); -} - -void WriteThread::reopen() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] start"); - stopIt=true; - endDetected=false; - emit internalStartReopen(); -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG -//to set the id -void WriteThread::setId(int id) -{ - this->id=id; -} -#endif - -/// \brief do the fake open -void WriteThread::fakeOpen() -{ - fakeMode=true; - emit opened(); -} - -/// \brief do the fake writeIsStarted -void WriteThread::fakeWriteIsStarted() -{ - emit writeIsStarted(); -} - -/// \brief do the fake writeIsStopped -void WriteThread::fakeWriteIsStopped() -{ - emit writeIsStopped(); -} - -/// do the checksum -void WriteThread::startCheckSum() -{ - emit internalStartChecksum(); -} - -/** \brief set block size -\param block the new block size in KB -\return Return true if succes */ -bool WriteThread::setBlockSize(const int blockSize) -{ - if(blockSize<1 || blockSize>16384) - { - this->blockSize=blockSize*1024; - //set the new max speed because the timer have changed - setMaxSpeed(maxSpeed); - return true; - } - else - return false; -} - -/*! \brief Set the max speed -\param tempMaxSpeed Set the max speed in KB/s, 0 for no limit */ -int WriteThread::setMaxSpeed(const int maxSpeed) -{ - if(this->maxSpeed==0 && maxSpeed==0 && waitNewClockForSpeed.available()>0) - waitNewClockForSpeed.tryAcquire(waitNewClockForSpeed.available()); - this->maxSpeed=maxSpeed; - if(this->maxSpeed>0) - { - int NewInterval,newMultiForBigSpeed=0; - do - { - newMultiForBigSpeed++; - NewInterval=(blockSize*newMultiForBigSpeed)/(this->maxSpeed); - } - while (NewIntervalULTRACOPIER_PLUGIN_MAXTIMERINTERVAL) - { - NewInterval=ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL; - newMultiForBigSpeed=1; - blockSize=this->maxSpeed*NewInterval; - } - MultiForBigSpeed=newMultiForBigSpeed; - return NewInterval; - } - else - { - waitNewClockForSpeed.release(); - return 0; - } -} - -/// \brief For give timer every X ms -void WriteThread::timeOfTheBlockCopyFinished() -{ - if(waitNewClockForSpeed.available()0) - { - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Checksum; - #endif - hash.addData(blockArray); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - stat=Idle; - #endif - - if(stopIt) - break; - - lastGoodPosition+=blockArray.size(); - - //wait for limitation speed if stop not query - if(maxSpeed>0) - { - numberOfBlockCopied++; - if(numberOfBlockCopied>=MultiForBigSpeed) - { - numberOfBlockCopied=0; - waitNewClockForSpeed.acquire(); - if(stopIt) - break; - } - } - } - } - while(sizeReaden>0 && !stopIt); - if(lastGoodPosition>file.size()) - { - errorString_internal=tr("File truncated during the read, possible data change"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"["+QString::number(id)+"] "+QString("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); - emit error(); - return; - } - if(stopIt) - { -/* if(putInPause) - emit isInPause();*/ - stopIt=false; - return; - } - emit checksumFinish(hash.result()); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"["+QString::number(id)+"] stop the read"); -} - -void WriteThread::internalFlushAndSeekToZero() -{ - flushBuffer(); - file.seek(0); - stopIt=false; - emit flushedAndSeekedToZero(); -} - -void WriteThread::setMkpathTransfer(QSemaphore *mkpathTransfer) -{ - this->mkpathTransfer=mkpathTransfer; -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/WriteThread.h b/plugins/CopyEngine/Ultracopier-0.3/WriteThread.h deleted file mode 100644 index 3683c27..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/WriteThread.h +++ /dev/null @@ -1,138 +0,0 @@ -/** \file WriteThread.h -\brief Thread changed to open/close and write the destination file -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#ifndef WRITETHREAD_H -#define WRITETHREAD_H - -#include -#include -#include -#include -#include -#include - -#include "Environment.h" -#include "StructEnumDefinition_CopyEngine.h" -#include "AvancedQFile.h" - -/// \brief Thread changed to open/close and write the destination file -class WriteThread : public QThread -{ - Q_OBJECT -public: - explicit WriteThread(); - ~WriteThread(); - /// \brief to have semaphore to do mkpath one by one - void setMkpathTransfer(QSemaphore *mkpathTransfer); -protected: - void run(); -public: - /// \brief open the destination to open it - void open(const QString &name,const quint64 &startSize,const bool &buffer); - /// \brief to return the error string - QString errorString(); - /// \brief to stop all - void stop(); - /// \brief to write data - bool write(const QByteArray &data); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief to set the id - void setId(int id); - /// \brief get the write stat - enum WriteStat - { - Idle=0, - InodeOperation=1, - Write=2, - Close=3, - Read=5, - Checksum=6 - }; - WriteStat stat; - #endif - /// \brief do the fake open - void fakeOpen(); - /// \brief do the fake writeIsStarted - void fakeWriteIsStarted(); - /// \brief do the fake writeIsStopped - void fakeWriteIsStopped(); - /// do the checksum - void startCheckSum(); - /// \brief set the current max speed in KB/s - int setMaxSpeed(int maxSpeed); - /// \brief For give timer every X ms - void timeOfTheBlockCopyFinished(); - /// \brief set block size in KB - bool setBlockSize(const int blockSize); -public slots: - /// \brief start the operation - void postOperation(); - /// \brief flush buffer - void flushBuffer(); - /// \brief set the end is detected - void endIsDetected(); - /// \brief reopen the file - void reopen(); - /// \brief flush and seek to zero - void flushAndSeekToZero(); - /// do the checksum - void checkSum(); -signals: - void error(); - void opened(); - void reopened(); - void writeIsStarted(); - void writeIsStopped(); - void flushedAndSeekedToZero(); - void closed(); - void checksumFinish(const QByteArray&); - //internal signals - void internalStartOpen(); - void internalStartChecksum(); - void internalStartReopen(); - void internalStartWrite(); - void internalStartClose(); - void internalStartEndOfFile(); - void internalStartFlushAndSeekToZero(); - /// \brief To debug source - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); -private: - QString name; - QString errorString_internal; - AvancedQFile file; - volatile bool stopIt; - volatile int blockSize; - volatile int maxSpeed; ///< The max speed in KB/s, 0 for no limit - QMutex accessList; ///< For use the list - QSemaphore waitNewClockForSpeed; - volatile int numberOfBlockCopied; ///< Multiple for count the number of block copied - volatile int multiplicatorForBigSpeed; ///< Multiple for count the number of block needed - volatile int MultiForBigSpeed; - QSemaphore freeBlock; - QSemaphore isOpen; - volatile bool putInPause; - QList theBlockList; ///< Store the block list - quint64 CurentCopiedSize; - QByteArray blockArray; ///< temp data for block writing, the data - qint64 bytesWriten; ///< temp data for block writing, the bytes writen - qint64 lastGoodPosition; - int id; - bool endDetected; - quint64 startSize; - QSemaphore *mkpathTransfer; - bool fakeMode; - bool buffer; - bool needRemoveTheFile; -private slots: - bool internalOpen(); - void internalWrite(); - void internalClose(bool emitSignal=true); - void internalReopen(); - void internalEndOfFile(); - void internalFlushAndSeekToZero(); -}; - -#endif // WRITETHREAD_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/copyEngine-collision-and-error.cpp b/plugins/CopyEngine/Ultracopier-0.3/copyEngine-collision-and-error.cpp deleted file mode 100644 index 7ec07c2..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/copyEngine-collision-and-error.cpp +++ /dev/null @@ -1,565 +0,0 @@ -/** \file copyEngine.cpp -\brief Define the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include - -#include "copyEngine.h" -#include "folderExistsDialog.h" - -/// \note Can be call without queue because all call will be serialized -void copyEngine::fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the action - if(isSame) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file is same: "+source.absoluteFilePath()); - tempFileExistsAction=alwaysDoThisActionForFileExists; - if(tempFileExistsAction==FileExists_Overwrite || tempFileExistsAction==FileExists_OverwriteIfNewer || tempFileExistsAction==FileExists_OverwriteIfNotSameModificationDate) - tempFileExistsAction=FileExists_NotSet; - switch(tempFileExistsAction) - { - case FileExists_Skip: - case FileExists_Rename: - thread->setFileExistsAction(tempFileExistsAction); - break; - default: - if(dialogIsOpen) - { - alreadyExistsQueueItem newItem; - newItem.source=source; - newItem.destination=destination; - newItem.isSame=isSame; - newItem.transfer=thread; - newItem.scan=NULL; - alreadyExistsQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - fileIsSameDialog dialog(interface,source,firstRenamingRule,otherRenamingRule); - emit isInPause(true); - dialog.exec();/// \bug crash when external close - FileExistsAction newAction=dialog.getAction(); - emit isInPause(false); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileExists_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) - { - alwaysDoThisActionForFileExists=newAction; - listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - switch(newAction) - { - default: - case FileExists_Skip: - emit newCollisionAction("skip"); - break; - case FileExists_Rename: - emit newCollisionAction("rename"); - break; - } - } - if(dialog.getAlways() || newAction!=FileExists_Rename) - thread->setFileExistsAction(newAction); - else - thread->setFileRename(dialog.getNewName()); - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); - tempFileExistsAction=alwaysDoThisActionForFileExists; - switch(tempFileExistsAction) - { - case FileExists_Skip: - case FileExists_Rename: - case FileExists_Overwrite: - case FileExists_OverwriteIfNewer: - case FileExists_OverwriteIfNotSameModificationDate: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"always do this action: "+QString::number(tempFileExistsAction)); - thread->setFileExistsAction(tempFileExistsAction); - break; - default: - if(dialogIsOpen) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("dialog open, put in queue: %1 %2") - .arg(source.absoluteFilePath()) - .arg(destination.absoluteFilePath()) - ); - alreadyExistsQueueItem newItem; - newItem.source=source; - newItem.destination=destination; - newItem.isSame=isSame; - newItem.transfer=thread; - newItem.scan=NULL; - alreadyExistsQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - fileExistsDialog dialog(interface,source,destination,firstRenamingRule,otherRenamingRule); - emit isInPause(true); - dialog.exec();/// \bug crash when external close - FileExistsAction newAction=dialog.getAction(); - emit isInPause(false); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileExists_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) - { - alwaysDoThisActionForFileExists=newAction; - listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); - switch(newAction) - { - default: - case FileExists_Skip: - emit newCollisionAction("skip"); - break; - case FileExists_Rename: - emit newCollisionAction("rename"); - break; - case FileExists_Overwrite: - emit newCollisionAction("overwrite"); - break; - case FileExists_OverwriteIfNewer: - emit newCollisionAction("overwriteIfNewer"); - break; - case FileExists_OverwriteIfNotSameModificationDate: - emit newCollisionAction("overwriteIfNotSameModificationDate"); - break; - } - } - if(dialog.getAlways() || newAction!=FileExists_Rename) - thread->setFileExistsAction(newAction); - else - thread->setFileRename(dialog.getNewName()); - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"emit queryOneNewDialog()"); - emit queryOneNewDialog(); - } - return; - break; - } - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -/// \note Can be call without queue because all call will be serialized -void copyEngine::errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the action - tempFileErrorAction=alwaysDoThisActionForFileError; - switch(tempFileErrorAction) - { - case FileError_Skip: - thread->skip(); - return; - case FileError_Retry: - thread->retryAfterError(); - return; - case FileError_PutToEndOfTheList: - /// \todo do the read transfer locator and put at the end - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"todo list item not found"); - return; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=fileInfo; - newItem.mkPath=false; - newItem.rmPath=false; - newItem.scan=NULL; - newItem.transfer=thread; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); - fileErrorDialog dialog(interface,fileInfo,errorString); - emit isInPause(true); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - emit isInPause(false); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - { - alwaysDoThisActionForFileError=newAction; - switch(newAction) - { - default: - case FileError_Skip: - emit newErrorAction("skip"); - break; - case FileError_PutToEndOfTheList: - emit newErrorAction("putToEndOfTheList"); - break; - } - } - switch(newAction) - { - case FileError_Skip: - thread->skip(); - break; - case FileError_Retry: - thread->retryAfterError(); - break; - case FileError_PutToEndOfTheList: - thread->putAtBottom(); - /// \todo do the read transfer locator and put at the end - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"todo"); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"file error action wrong"); - break; - } - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"isCalledByShowOneNewDialog==true then not show other dial"); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -/// \note Can be call without queue because all call will be serialized -void copyEngine::folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the always action - tempFolderExistsAction=alwaysDoThisActionForFolderExists; - switch(tempFolderExistsAction) - { - case FolderExists_Skip: - case FolderExists_Rename: - case FolderExists_Merge: - thread->setFolderExistsAction(tempFolderExistsAction); - break; - default: - if(dialogIsOpen) - { - alreadyExistsQueueItem newItem; - newItem.source=source; - newItem.destination=destination; - newItem.isSame=isSame; - newItem.transfer=NULL; - newItem.scan=thread; - alreadyExistsQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - folderExistsDialog dialog(interface,source,isSame,destination,firstRenamingRule,otherRenamingRule); - dialog.exec();/// \bug crash when external close - FolderExistsAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FolderExists_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFolderExists) - setComboBoxFolderColision(newAction); - if(!dialog.getAlways() && newAction==FolderExists_Rename) - thread->setFolderExistsAction(newAction,dialog.getNewName()); - else - thread->setFolderExistsAction(newAction); - dialogIsOpen=false; - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } -} - -/// \note Can be call without queue because all call will be serialized -/// \todo all this part -void copyEngine::errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); - if(thread==NULL) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread"); - return; - } - //load the always action - tempFileErrorAction=alwaysDoThisActionForFolderError; - switch(tempFileErrorAction) - { - case FileError_Skip: - case FileError_Retry: - case FileError_PutToEndOfTheList: - thread->setFolderErrorAction(tempFileErrorAction); - break; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=fileInfo; - newItem.mkPath=false; - newItem.rmPath=false; - newItem.scan=thread; - newItem.transfer=NULL; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); - fileErrorDialog dialog(interface,fileInfo,errorString); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - setComboBoxFolderError(newAction); - dialogIsOpen=false; - thread->setFolderErrorAction(newAction); - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -// ----------------------------------------------------- - -//mkpath event -void copyEngine::mkPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); - //load the always action - tempFileErrorAction=alwaysDoThisActionForFolderError; - error_index=0; - switch(tempFileErrorAction) - { - case FileError_Skip: - listThread->mkPathQueue.skip(); - return; - case FileError_Retry: - listThread->mkPathQueue.retry(); - return; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=folder; - newItem.mkPath=true; - newItem.rmPath=false; - newItem.scan=NULL; - newItem.transfer=NULL; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); - fileErrorDialog dialog(interface,folder,errorString,false); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - { - setComboBoxFolderError(newAction); - alwaysDoThisActionForFolderError=newAction; - } - dialogIsOpen=false; - switch(newAction) - { - case FileError_Skip: - listThread->mkPathQueue.skip(); - break; - case FileError_Retry: - listThread->mkPathQueue.retry(); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); - break; - } - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -//rmpath event -void copyEngine::rmPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog) -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); - //load the always action - tempFileErrorAction=alwaysDoThisActionForFolderError; - error_index=0; - switch(tempFileErrorAction) - { - case FileError_Skip: - listThread->rmPathQueue.skip(); - return; - case FileError_Retry: - listThread->rmPathQueue.retry(); - return; - default: - if(dialogIsOpen) - { - errorQueueItem newItem; - newItem.errorString=errorString; - newItem.inode=folder; - newItem.mkPath=false; - newItem.rmPath=true; - newItem.scan=NULL; - newItem.transfer=NULL; - errorQueue << newItem; - return; - } - dialogIsOpen=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog"); - emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); - fileErrorDialog dialog(interface,folder,errorString,false); - dialog.exec();/// \bug crash when external close - FileErrorAction newAction=dialog.getAction(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction)); - if(newAction==FileError_Cancel) - { - emit cancelAll(); - return; - } - if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) - { - setComboBoxFolderError(newAction); - alwaysDoThisActionForFolderError=newAction; - } - dialogIsOpen=false; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"do the action"); - switch(newAction) - { - case FileError_Skip: - listThread->rmPathQueue.skip(); - break; - case FileError_Retry: - listThread->rmPathQueue.retry(); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); - break; - } - if(!isCalledByShowOneNewDialog) - emit queryOneNewDialog(); - return; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop"); -} - -//show one new dialog if needed -void copyEngine::showOneNewDialog() -{ - if(stopIt) - return; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"alreadyExistsQueue.size(): "+QString::number(alreadyExistsQueue.size())); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"errorQueue.size(): "+QString::number(errorQueue.size())); - loop_size=alreadyExistsQueue.size(); - while(loop_size>0) - { - if(alreadyExistsQueue.first().transfer!=NULL) - { - fileAlreadyExists(alreadyExistsQueue.first().source, - alreadyExistsQueue.first().destination, - alreadyExistsQueue.first().isSame, - alreadyExistsQueue.first().transfer, - true); - } - else if(alreadyExistsQueue.first().scan!=NULL) - folderAlreadyExists(alreadyExistsQueue.first().source, - alreadyExistsQueue.first().destination, - alreadyExistsQueue.first().isSame, - alreadyExistsQueue.first().scan, - true); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"bug, no thread actived"); - alreadyExistsQueue.removeFirst(); - loop_size--; - } - loop_size=errorQueue.size(); - while(errorQueue.size()>0) - { - if(errorQueue.first().transfer!=NULL) - errorOnFile(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().transfer,true); - else if(errorQueue.first().scan!=NULL) - errorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().scan,true); - else if(errorQueue.first().mkPath) - mkPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,true); - else if(errorQueue.first().rmPath) - rmPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,true); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"bug, no thread actived"); - errorQueue.removeFirst(); - loop_size--; - } -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/copyEngine.cpp b/plugins/CopyEngine/Ultracopier-0.3/copyEngine.cpp deleted file mode 100755 index 950cfd3..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/copyEngine.cpp +++ /dev/null @@ -1,796 +0,0 @@ -/** \file copyEngine.cpp -\brief Define the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include - -#include "copyEngine.h" -#include "folderExistsDialog.h" -#include "../../../interface/PluginInterface_CopyEngine.h" - -copyEngine::copyEngine(FacilityInterface * facilityEngine) : - ui(new Ui::options()) -{ - listThread=new ListThread(facilityEngine); - this->facilityEngine=facilityEngine; - filters=NULL; - renamingRules=NULL; - qRegisterMetaType("TransferThread *"); - qRegisterMetaType("scanFileOrFolder *"); - qRegisterMetaType("EngineActionInProgress"); - qRegisterMetaType("DebugLevel"); - qRegisterMetaType("FileExistsAction"); - qRegisterMetaType("FolderExistsAction"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - qRegisterMetaType("CopyMode"); - qRegisterMetaType >("QList"); - qRegisterMetaType >("QList"); - - interface = NULL; - tempWidget = NULL; - uiIsInstalled = false; - dialogIsOpen = false; - maxSpeed = 0; - alwaysDoThisActionForFileExists = FileExists_NotSet; - alwaysDoThisActionForFileError = FileError_NotSet; - checkDestinationFolderExists = false; - stopIt = false; - size_for_speed = 0; - forcedMode = false; - - //implement the SingleShot in this class - //timerActionDone.setSingleShot(true); - timerActionDone.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST); - //timerProgression.setSingleShot(true); - timerProgression.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION); - -} - -copyEngine::~copyEngine() -{ - /*if(filters!=NULL) - delete filters; - if(renamingRules!=NULL) - delete renamingRules; - destroyed by the widget parent, here the interface - */ - stopIt=true; - delete listThread; - delete ui; -} - -void copyEngine::connectTheSignalsSlots() -{ - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - debugDialogWindow.show(); - #endif - if(!connect(listThread,SIGNAL(actionInProgess(EngineActionInProgress)), this,SIGNAL(actionInProgess(EngineActionInProgress)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect actionInProgess()"); - if(!connect(listThread,SIGNAL(actionInProgess(EngineActionInProgress)), this,SLOT(newActionInProgess(EngineActionInProgress)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect actionInProgess() to slot"); - if(!connect(listThread,SIGNAL(newFolderListing(QString)), this,SIGNAL(newFolderListing(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newFolderListing()"); - if(!connect(listThread,SIGNAL(newCollisionAction(QString)), this,SIGNAL(newCollisionAction(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newCollisionAction()"); - if(!connect(listThread,SIGNAL(newErrorAction(QString)), this,SIGNAL(newErrorAction(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newErrorAction()"); - if(!connect(listThread,SIGNAL(isInPause(bool)), this,SIGNAL(isInPause(bool)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect isInPause()"); - if(!connect(listThread,SIGNAL(error(QString,quint64,QDateTime,QString)), this,SIGNAL(error(QString,quint64,QDateTime,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect error()"); - if(!connect(listThread,SIGNAL(rmPath(QString)), this,SIGNAL(rmPath(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect rmPath()"); - if(!connect(listThread,SIGNAL(mkPath(QString)), this,SIGNAL(mkPath(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect mkPath()"); - if(!connect(listThread,SIGNAL(newActionOnList(QList)), this,SIGNAL(newActionOnList(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect newActionOnList()"); - if(!connect(listThread,SIGNAL(pushFileProgression(QList)), this,SIGNAL(pushFileProgression(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect pushFileProgression()"); - if(!connect(listThread,SIGNAL(pushGeneralProgression(quint64,quint64)), this,SIGNAL(pushGeneralProgression(quint64,quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect pushGeneralProgression()"); - if(!connect(listThread,SIGNAL(syncReady()), this,SIGNAL(syncReady()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect syncReady()"); - if(!connect(listThread,SIGNAL(canBeDeleted()), this,SIGNAL(canBeDeleted()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect canBeDeleted()"); - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - if(!connect(listThread,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect debugInformation()"); - #endif - - if(!connect(listThread,SIGNAL(send_fileAlreadyExists(QFileInfo,QFileInfo,bool,TransferThread *)), this,SLOT(fileAlreadyExists(QFileInfo,QFileInfo,bool,TransferThread *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_fileAlreadyExists()"); - if(!connect(listThread,SIGNAL(send_errorOnFile(QFileInfo,QString,TransferThread *)), this,SLOT(errorOnFile(QFileInfo,QString,TransferThread *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_errorOnFile()"); - if(!connect(listThread,SIGNAL(send_folderAlreadyExists(QFileInfo,QFileInfo,bool,scanFileOrFolder *)), this,SLOT(folderAlreadyExists(QFileInfo,QFileInfo,bool,scanFileOrFolder *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_folderAlreadyExists()"); - if(!connect(listThread,SIGNAL(send_errorOnFolder(QFileInfo,QString,scanFileOrFolder *)), this,SLOT(errorOnFolder(QFileInfo,QString,scanFileOrFolder *)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_errorOnFolder()"); - if(!connect(listThread,SIGNAL(updateTheDebugInfo(QStringList,QStringList,int)), this,SLOT(updateTheDebugInfo(QStringList,QStringList,int)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect updateTheDebugInfo()"); - if(!connect(listThread,SIGNAL(errorTransferList(QString)), this,SLOT(errorTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect errorTransferList()"); - if(!connect(listThread,SIGNAL(warningTransferList(QString)), this,SLOT(warningTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect warningTransferList()"); - if(!connect(listThread,SIGNAL(mkPathErrorOnFolder(QFileInfo,QString)), this,SLOT(mkPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect mkPathErrorOnFolder()"); - if(!connect(listThread,SIGNAL(rmPathErrorOnFolder(QFileInfo,QString)), this,SLOT(rmPathErrorOnFolder(QFileInfo,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect rmPathErrorOnFolder()"); - if(!connect(listThread,SIGNAL(send_realBytesTransfered(quint64)), this,SLOT(get_realBytesTransfered(quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_realBytesTransfered()"); - - if(!connect(this,SIGNAL(tryCancel()), listThread,SIGNAL(tryCancel()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect tryCancel()"); - if(!connect(this,SIGNAL(signal_pause()), listThread,SLOT(pause()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_pause()"); - if(!connect(this,SIGNAL(signal_resume()), listThread,SLOT(resume()), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_resume()"); - if(!connect(this,SIGNAL(signal_skip(quint64)), listThread,SLOT(skip(quint64)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_skip()"); - if(!connect(this,SIGNAL(signal_setCollisionAction(FileExistsAction)), listThread,SLOT(setAlwaysFileExistsAction(FileExistsAction)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_setCollisionAction()"); - if(!connect(this,SIGNAL(signal_setFolderColision(FolderExistsAction)), listThread,SLOT(setFolderColision(FolderExistsAction)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_setFolderColision()"); - if(!connect(this,SIGNAL(signal_removeItems(QList)), listThread,SLOT(removeItems(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_removeItems()"); - if(!connect(this,SIGNAL(signal_moveItemsOnTop(QList)), listThread,SLOT(moveItemsOnTop(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsOnTop()"); - if(!connect(this,SIGNAL(signal_moveItemsUp(QList)), listThread,SLOT(moveItemsUp(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsUp()"); - if(!connect(this,SIGNAL(signal_moveItemsDown(QList)), listThread,SLOT(moveItemsDown(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsDown()"); - if(!connect(this,SIGNAL(signal_moveItemsOnBottom(QList)), listThread,SLOT(moveItemsOnBottom(QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_moveItemsOnBottom()"); - if(!connect(this,SIGNAL(signal_exportTransferList(QString)), listThread,SLOT(exportTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_exportTransferList()"); - if(!connect(this,SIGNAL(signal_importTransferList(QString)), listThread,SLOT(importTransferList(QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_importTransferList()"); - if(!connect(this,SIGNAL(signal_forceMode(CopyMode)), listThread,SLOT(forceMode(CopyMode)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect signal_forceMode()"); - if(!connect(this,SIGNAL(send_osBufferLimit(uint)), listThread,SLOT(set_osBufferLimit(uint)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_osBufferLimit()"); - if(!connect(this,SIGNAL(send_setFilters(QList,QList)),listThread,SLOT(set_setFilters(QList,QList)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_setFilters()"); - if(!connect(this,SIGNAL(send_sendNewRenamingRules(QString,QString)),listThread,SLOT(set_sendNewRenamingRules(QString,QString)), Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect send_sendNewRenamingRules()"); - if(!connect(&timerActionDone,SIGNAL(timeout()), listThread,SLOT(sendActionDone()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect timerActionDone"); - if(!connect(&timerProgression,SIGNAL(timeout()), listThread,SLOT(sendProgression()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect timerProgression"); - - if(!connect(this,SIGNAL(queryOneNewDialog()),SLOT(showOneNewDialog()),Qt::QueuedConnection)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect queryOneNewDialog()"); -} - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW -void copyEngine::updateTheDebugInfo(QStringList newList,QStringList newList2,int numberOfInodeOperation) -{ - debugDialogWindow.setTransferThreadList(newList); - debugDialogWindow.setTransferList(newList2); - debugDialogWindow.setInodeUsage(numberOfInodeOperation); -} -#endif - -//to send the options panel -bool copyEngine::getOptionsEngine(QWidget * tempWidget) -{ - this->tempWidget=tempWidget; - connect(tempWidget, SIGNAL(destroyed()), this, SLOT(resetTempWidget())); - ui->setupUi(tempWidget); - //conect the ui widget -/* connect(ui->doRightTransfer, SIGNAL(toggled(bool)), &threadOfTheTransfer, SLOT(setRightTransfer(bool))); - connect(ui->keepDate, SIGNAL(toggled(bool)), &threadOfTheTransfer, SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), &threadOfTheTransfer, SLOT(setBlockSize(int)));*/ - connect(ui->autoStart, SIGNAL(toggled(bool)), this, SLOT(setAutoStart(bool))); - connect(ui->checkBoxDestinationFolderExists, SIGNAL(toggled(bool)), this, SLOT(setCheckDestinationFolderExists(bool))); - uiIsInstalled=true; - setRightTransfer(doRightTransfer); - setKeepDate(keepDate); - setSpeedLimitation(maxSpeed); - setBlockSize(blockSize); - setAutoStart(autoStart); - setCheckDestinationFolderExists(checkDestinationFolderExists); - set_doChecksum(doChecksum); - set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - set_checksumOnlyOnError(checksumOnlyOnError); - set_osBuffer(osBuffer); - set_osBufferLimited(osBufferLimited); - set_osBufferLimit(osBufferLimit); - return true; -} - -//to have interface widget to do modal dialog -void copyEngine::setInterfacePointer(QWidget * interface) -{ - this->interface=interface; - filters=new Filters(tempWidget); - renamingRules=new RenamingRules(tempWidget); - - if(uiIsInstalled) - { - connect(ui->doRightTransfer, SIGNAL(toggled(bool)), this,SLOT(setRightTransfer(bool))); - connect(ui->keepDate, SIGNAL(toggled(bool)), this,SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), this,SLOT(setBlockSize(int))); - connect(ui->autoStart, SIGNAL(toggled(bool)), this,SLOT(setAutoStart(bool))); - connect(ui->doChecksum, SIGNAL(toggled(bool)), this,SLOT(doChecksum_toggled(bool))); - connect(ui->checksumIgnoreIfImpossible, SIGNAL(toggled(bool)), this,SLOT(checksumIgnoreIfImpossible_toggled(bool))); - connect(ui->checksumOnlyOnError, SIGNAL(toggled(bool)), this,SLOT(checksumOnlyOnError_toggled(bool))); - connect(ui->osBuffer, SIGNAL(toggled(bool)), this,SLOT(osBuffer_toggled(bool))); - connect(ui->osBufferLimited, SIGNAL(toggled(bool)), this,SLOT(osBufferLimited_toggled(bool))); - connect(ui->osBufferLimit, SIGNAL(editingFinished()), this,SLOT(osBufferLimit_editingFinished())); - - connect(filters,SIGNAL(sendNewFilters(QStringList,QStringList,QStringList,QStringList)),this,SLOT(sendNewFilters())); - connect(ui->filters,SIGNAL(clicked()),this,SLOT(showFilterDialog())); - - if(!connect(renamingRules,SIGNAL(sendNewRenamingRules(QString,QString)),this,SLOT(sendNewRenamingRules(QString,QString)))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect sendNewRenamingRules()"); - if(!connect(ui->renamingRules,SIGNAL(clicked()),this,SLOT(showRenamingRules()))) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to connect renamingRules.clicked()"); - } - - filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); - set_setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); - - renamingRules->setRenamingRules(firstRenamingRule,otherRenamingRule); - emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -bool copyEngine::haveSameSource(const QStringList &sources) -{ - return listThread->haveSameSource(sources); -} - -bool copyEngine::haveSameDestination(const QString &destination) -{ - return listThread->haveSameDestination(destination); -} - -bool copyEngine::newCopy(const QStringList &sources) -{ - if(forcedMode && mode!=Copy) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to move, you can't copy with it")); - return false; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString destination = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select destination directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if(destination.isEmpty() || destination.isNull() || destination=="") - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Canceled by the user"); - return false; - } - return listThread->newCopy(sources,destination); -} - -bool copyEngine::newCopy(const QStringList &sources,const QString &destination) -{ - if(forcedMode && mode!=Copy) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to move, you can't copy with it")); - return false; - } - return listThread->newCopy(sources,destination); -} - -bool copyEngine::newMove(const QStringList &sources) -{ - if(forcedMode && mode!=Move) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to copy, you can't move with it")); - return false; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QString destination = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select destination directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if(destination.isEmpty() || destination.isNull() || destination=="") - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Canceled by the user"); - return false; - } - return listThread->newMove(sources,destination); -} - -bool copyEngine::newMove(const QStringList &sources,const QString &destination) -{ - if(forcedMode && mode!=Move) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to copy, you can't move with it")); - return false; - } - return listThread->newMove(sources,destination); -} - -void copyEngine::newTransferList(const QString &file) -{ - emit signal_importTransferList(file); -} - -//because direct access to list thread into the main thread can't be do -quint64 copyEngine::realByteTransfered() -{ - return size_for_speed; -} - -//speed limitation -qint64 copyEngine::getSpeedLimitation() -{ - return listThread->getSpeedLimitation(); -} - -//get collision action -QList > copyEngine::getCollisionAction() -{ - QPair tempItem; - QList > list; - tempItem.first=facilityEngine->translateText("Ask");tempItem.second="ask";list << tempItem; - tempItem.first=facilityEngine->translateText("Skip");tempItem.second="skip";list << tempItem; - tempItem.first=facilityEngine->translateText("Overwrite");tempItem.second="overwrite";list << tempItem; - tempItem.first=facilityEngine->translateText("Overwrite if newer");tempItem.second="overwriteIfNewer";list << tempItem; - tempItem.first=facilityEngine->translateText("Overwrite if the last modification dates are different");tempItem.second="overwriteIfNotSameModificationDate";list << tempItem; - tempItem.first=facilityEngine->translateText("Rename");tempItem.second="rename";list << tempItem; - return list; -} - -QList > copyEngine::getErrorAction() -{ - QPair tempItem; - QList > list; - tempItem.first=facilityEngine->translateText("Ask");tempItem.second="ask";list << tempItem; - tempItem.first=facilityEngine->translateText("Skip");tempItem.second="skip";list << tempItem; - tempItem.first=facilityEngine->translateText("Put to end of the list");tempItem.second="putToEndOfTheList";list << tempItem; - return list; -} - -void copyEngine::setDrive(const QStringList &drives) -{ - listThread->setDrive(drives); -} - -/** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ -void copyEngine::syncTransferList() -{ - listThread->syncTransferList(); -} - -void copyEngine::set_doChecksum(bool doChecksum) -{ - listThread->set_doChecksum(doChecksum); - if(uiIsInstalled) - ui->doChecksum->setChecked(doChecksum); - this->doChecksum=doChecksum; -} - -void copyEngine::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) -{ - listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); - if(uiIsInstalled) - ui->checksumIgnoreIfImpossible->setChecked(checksumIgnoreIfImpossible); - this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; -} - -void copyEngine::set_checksumOnlyOnError(bool checksumOnlyOnError) -{ - listThread->set_checksumOnlyOnError(checksumOnlyOnError); - if(uiIsInstalled) - ui->checksumOnlyOnError->setChecked(checksumOnlyOnError); - this->checksumOnlyOnError=checksumOnlyOnError; -} - -void copyEngine::set_osBuffer(bool osBuffer) -{ - listThread->set_osBuffer(osBuffer); - if(uiIsInstalled) - ui->osBuffer->setChecked(osBuffer); - this->osBuffer=osBuffer; -} - -void copyEngine::set_osBufferLimited(bool osBufferLimited) -{ - listThread->set_osBufferLimited(osBufferLimited); - if(uiIsInstalled) - ui->osBufferLimited->setChecked(osBufferLimited); - this->osBufferLimited=osBufferLimited; -} - -void copyEngine::set_osBufferLimit(unsigned int osBufferLimit) -{ - emit send_osBufferLimit(osBufferLimit); - if(uiIsInstalled) - ui->osBufferLimit->setValue(osBufferLimit); - this->osBufferLimit=osBufferLimit; -} - -void copyEngine::set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) -{ - if(filters!=NULL) - { - filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); - emit send_setFilters(filters->getInclude(),filters->getExclude()); - } - this->includeStrings=includeStrings; - this->includeOptions=includeOptions; - this->excludeStrings=excludeStrings; - this->excludeOptions=excludeOptions; -} - -void copyEngine::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -bool copyEngine::userAddFolder(const CopyMode &mode) -{ - QString source = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select source directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if(source.isEmpty() || source.isNull() || source=="") - return false; - if(mode==Copy) - return newCopy(QStringList() << source); - else - return newMove(QStringList() << source); -} - -bool copyEngine::userAddFile(const CopyMode &mode) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QStringList sources = QFileDialog::getOpenFileNames( - interface, - facilityEngine->translateText("Select one or more files to open"), - "", - facilityEngine->translateText("All files")+" (*)"); - if(sources.isEmpty()) - return false; - if(mode==Copy) - return newCopy(sources); - else - return newMove(sources); -} - -void copyEngine::pause() -{ - emit signal_pause(); -} - -void copyEngine::resume() -{ - emit signal_resume(); -} - -void copyEngine::skip(const quint64 &id) -{ - emit signal_skip(id); -} - -void copyEngine::cancel() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - stopIt=true; - timerProgression.stop(); - timerActionDone.stop(); - emit tryCancel(); -} - -void copyEngine::removeItems(const QList &ids) -{ - emit signal_removeItems(ids); -} - -void copyEngine::moveItemsOnTop(const QList &ids) -{ - emit signal_moveItemsOnTop(ids); -} - -void copyEngine::moveItemsUp(const QList &ids) -{ - emit signal_moveItemsUp(ids); -} - -void copyEngine::moveItemsDown(const QList &ids) -{ - emit signal_moveItemsDown(ids); -} - -void copyEngine::moveItemsOnBottom(const QList &ids) -{ - emit signal_moveItemsOnBottom(ids); -} - -/** \brief give the forced mode, to export/import transfer list */ -void copyEngine::forceMode(const CopyMode &mode) -{ - if(forcedMode) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Mode forced previously")); - QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The mode have been forced previously, it's internal error, please report it")); - return; - } - if(mode==Copy) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to copy")); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Force mode to move")); - this->mode=mode; - forcedMode=true; - emit signal_forceMode(mode); -} - -void copyEngine::exportTransferList() -{ - QString fileName = QFileDialog::getSaveFileName(NULL,facilityEngine->translateText("Save transfer list"),"transfer-list.lst",facilityEngine->translateText("Transfer list")+" (*.lst)"); - if(fileName.isEmpty()) - return; - emit signal_exportTransferList(fileName); -} - -void copyEngine::importTransferList() -{ - QString fileName = QFileDialog::getOpenFileName(NULL,facilityEngine->translateText("Open transfer list"),"transfer-list.lst",facilityEngine->translateText("Transfer list")+" (*.lst)"); - if(fileName.isEmpty()) - return; - emit signal_importTransferList(fileName); -} - -void copyEngine::warningTransferList(const QString &warning) -{ - QMessageBox::warning(interface,facilityEngine->translateText("Error"),warning); -} - -void copyEngine::errorTransferList(const QString &error) -{ - QMessageBox::critical(interface,facilityEngine->translateText("Error"),error); -} - -bool copyEngine::setSpeedLimitation(const qint64 &speedLimitation) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"maxSpeed: "+QString::number(speedLimitation)); - maxSpeed=speedLimitation; - return listThread->setSpeedLimitation(speedLimitation); -} - -void copyEngine::setCollisionAction(const QString &action) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action: "+action); - if(action=="skip") - alwaysDoThisActionForFileExists=FileExists_Skip; - else if(action=="overwrite") - alwaysDoThisActionForFileExists=FileExists_Overwrite; - else if(action=="overwriteIfNewer") - alwaysDoThisActionForFileExists=FileExists_OverwriteIfNewer; - else if(action=="overwriteIfNotSameModificationDate") - alwaysDoThisActionForFileExists=FileExists_OverwriteIfNotSameModificationDate; - else if(action=="rename") - alwaysDoThisActionForFileExists=FileExists_Rename; - else - alwaysDoThisActionForFileExists=FileExists_NotSet; - emit signal_setCollisionAction(alwaysDoThisActionForFileExists); -} - -void copyEngine::setErrorAction(const QString &action) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"action: "+action); - if(action=="skip") - alwaysDoThisActionForFileError=FileError_Skip; - else if(action=="putToEndOfTheList") - alwaysDoThisActionForFileError=FileError_PutToEndOfTheList; - else - alwaysDoThisActionForFileError=FileError_NotSet; -} - -void copyEngine::setRightTransfer(const bool doRightTransfer) -{ - this->doRightTransfer=doRightTransfer; - if(uiIsInstalled) - ui->doRightTransfer->setChecked(doRightTransfer); - listThread->setRightTransfer(doRightTransfer); -} - -//set keep date -void copyEngine::setKeepDate(const bool keepDate) -{ - this->keepDate=keepDate; - if(uiIsInstalled) - ui->keepDate->setChecked(keepDate); - listThread->setKeepDate(keepDate); -} - -//set block size in KB -void copyEngine::setBlockSize(const int blockSize) -{ - this->blockSize=blockSize; - if(uiIsInstalled) - ui->blockSize->setValue(blockSize); - listThread->setBlockSize(blockSize); -} - -//set auto start -void copyEngine::setAutoStart(const bool autoStart) -{ - this->autoStart=autoStart; - if(uiIsInstalled) - ui->autoStart->setChecked(autoStart); - listThread->setAutoStart(autoStart); -} - -//set check destination folder -void copyEngine::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) -{ - this->checkDestinationFolderExists=checkDestinationFolderExists; - if(uiIsInstalled) - ui->checkBoxDestinationFolderExists->setChecked(checkDestinationFolderExists); - listThread->setCheckDestinationFolderExists(checkDestinationFolderExists); -} - -//reset widget -void copyEngine::resetTempWidget() -{ - tempWidget=NULL; -} - -void copyEngine::on_comboBoxFolderColision_currentIndexChanged(int index) -{ - switch(index) - { - case 0: - setComboBoxFolderColision(FolderExists_NotSet,false); - break; - case 1: - setComboBoxFolderColision(FolderExists_Merge,false); - break; - case 2: - setComboBoxFolderColision(FolderExists_Skip,false); - break; - case 3: - setComboBoxFolderColision(FolderExists_Rename,false); - break; - } -} - -void copyEngine::on_comboBoxFolderError_currentIndexChanged(int index) -{ - switch(index) - { - case 0: - setComboBoxFolderError(FileError_NotSet,false); - break; - case 1: - setComboBoxFolderError(FileError_Skip,false); - break; - } -} - -//set the translate -void copyEngine::newLanguageLoaded() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, retranslate the widget options"); - if(tempWidget!=NULL) - ui->retranslateUi(tempWidget); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"ui not loaded!"); -} - -void copyEngine::setComboBoxFolderColision(FolderExistsAction action,bool changeComboBox) -{ - alwaysDoThisActionForFolderExists=action; - emit signal_setFolderColision(alwaysDoThisActionForFolderExists); - if(!changeComboBox || !uiIsInstalled) - return; - switch(action) - { - case FolderExists_Merge: - ui->comboBoxFolderColision->setCurrentIndex(1); - break; - case FolderExists_Skip: - ui->comboBoxFolderColision->setCurrentIndex(2); - break; - case FolderExists_Rename: - ui->comboBoxFolderColision->setCurrentIndex(3); - break; - default: - ui->comboBoxFolderColision->setCurrentIndex(0); - break; - } -} - -void copyEngine::setComboBoxFolderError(FileErrorAction action,bool changeComboBox) -{ - alwaysDoThisActionForFileError=action; - if(!changeComboBox || !uiIsInstalled) - return; - switch(action) - { - case FileError_Skip: - ui->comboBoxFolderError->setCurrentIndex(1); - break; - default: - ui->comboBoxFolderError->setCurrentIndex(0); - break; - } -} - -void copyEngine::doChecksum_toggled(bool doChecksum) -{ - listThread->set_doChecksum(doChecksum); -} - -void copyEngine::checksumOnlyOnError_toggled(bool checksumOnlyOnError) -{ - listThread->set_checksumOnlyOnError(checksumOnlyOnError); -} - -void copyEngine::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) -{ - listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); -} - -void copyEngine::osBuffer_toggled(bool osBuffer) -{ - listThread->set_osBuffer(osBuffer); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void copyEngine::osBufferLimited_toggled(bool osBufferLimited) -{ - listThread->set_osBufferLimited(osBufferLimited); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void copyEngine::osBufferLimit_editingFinished() -{ - emit send_osBufferLimit(ui->osBufferLimit->value()); -} - -void copyEngine::showFilterDialog() -{ - if(filters!=NULL) - filters->exec(); -} - -void copyEngine::sendNewFilters() -{ - if(filters!=NULL) - emit send_setFilters(filters->getInclude(),filters->getExclude()); -} - -void copyEngine::sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"new filter"); - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; - emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); -} - -void copyEngine::showRenamingRules() -{ - if(renamingRules==NULL) - { - QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"options not loaded"); - return; - } - renamingRules->exec(); -} - -void copyEngine::get_realBytesTransfered(quint64 realBytesTransfered) -{ - size_for_speed=realBytesTransfered; -} - -void copyEngine::newActionInProgess(EngineActionInProgress action) -{ - if(action==Idle) - { - timerProgression.stop(); - timerActionDone.stop(); - } - else - { - timerProgression.start(); - timerActionDone.start(); - } -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/copyEngine.h b/plugins/CopyEngine/Ultracopier-0.3/copyEngine.h deleted file mode 100755 index 66b3a4f..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/copyEngine.h +++ /dev/null @@ -1,359 +0,0 @@ -/** \file copyEngine.h -\brief Define the copy engine -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_CopyEngine.h" -#include "fileErrorDialog.h" -#include "fileExistsDialog.h" -#include "folderExistsDialog.h" -#include "fileIsSameDialog.h" -#include "ui_options.h" -#include "Environment.h" -#include "ListThread.h" -#include "Filters.h" -#include "RenamingRules.h" - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW -#include "debugDialog.h" -#include -#endif - -#ifndef COPY_ENGINE_H -#define COPY_ENGINE_H - -namespace Ui { - class options; -} - -/// \brief the implementation of copy engine plugin, manage directly few stuff, else pass to ListThread class. -class copyEngine : public PluginInterface_CopyEngine -{ - Q_OBJECT -public: - copyEngine(FacilityInterface * facilityEngine); - ~copyEngine(); - void connectTheSignalsSlots(); -private: - ListThread *listThread; - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - debugDialog debugDialogWindow; - #endif - QWidget * tempWidget; - Ui::options * ui; - bool uiIsInstalled; - QWidget * interface; - Filters * filters; - RenamingRules * renamingRules; - FacilityInterface * facilityEngine; - int maxSpeed; - bool doRightTransfer; - bool keepDate; - int blockSize; - bool autoStart; - bool checkDestinationFolderExists; - FileExistsAction alwaysDoThisActionForFileExists; - FileErrorAction alwaysDoThisActionForFileError; - FileErrorAction alwaysDoThisActionForFolderError; - FolderExistsAction alwaysDoThisActionForFolderExists; - bool dialogIsOpen; - volatile bool stopIt; - /// \brief error queue - struct errorQueueItem - { - TransferThread * transfer; ///< NULL if send by scan thread - scanFileOrFolder * scan; ///< NULL if send by transfer thread - bool mkPath; - bool rmPath; - QFileInfo inode; - QString errorString; - }; - QList errorQueue; - /// \brief already exists queue - struct alreadyExistsQueueItem - { - TransferThread * transfer; ///< NULL if send by scan thread - scanFileOrFolder * scan; ///< NULL if send by transfer thread - QFileInfo source; - QFileInfo destination; - bool isSame; - }; - QList alreadyExistsQueue; - //temp variable - int error_index,loop_size; - FileErrorAction tempFileErrorAction; - FolderExistsAction tempFolderExistsAction; - FileExistsAction tempFileExistsAction; - quint64 size_for_speed;//because direct access to list thread into the main thread can't be do - CopyMode mode; - bool forcedMode; - - bool doChecksum; - bool checksumIgnoreIfImpossible; - bool checksumOnlyOnError; - bool osBuffer; - bool osBufferLimited; - unsigned int osBufferLimit; - QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; - QString firstRenamingRule; - QString otherRenamingRule; - - //send action done timer - QTimer timerActionDone; - //send progression timer - QTimer timerProgression; -private slots: - #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - void updateTheDebugInfo(QStringList,QStringList,int); - #endif - //dialog message - /// \note Can be call without queue because all call will be serialized - void fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog=false); - /// \note Can be call without queue because all call will be serialized - void errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog=false); - /// \note Can be call without queue because all call will be serialized - void folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); - /// \note Can be call without queue because all call will be serialized - void errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); - //mkpath event - void mkPathErrorOnFolder(QFileInfo,QString,bool isCalledByShowOneNewDialog=false); - //rmpath event - void rmPathErrorOnFolder(QFileInfo,QString,bool isCalledByShowOneNewDialog=false); - //show one new dialog if needed - void showOneNewDialog(); - void sendNewFilters(); - - void doChecksum_toggled(bool); - void checksumOnlyOnError_toggled(bool); - void checksumIgnoreIfImpossible_toggled(bool); - void osBuffer_toggled(bool); - void osBufferLimited_toggled(bool); - void osBufferLimit_editingFinished(); - void showFilterDialog(); - void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void showRenamingRules(); - void get_realBytesTransfered(quint64 realBytesTransfered); - void newActionInProgess(EngineActionInProgress); -public: - /** \brief to send the options panel - * \return return false if have not the options - * \param tempWidget the widget to generate on it the options */ - bool getOptionsEngine(QWidget * tempWidget); - /** \brief to have interface widget to do modal dialog - * \param interface to have the widget of the interface, useful for modal dialog */ - void setInterfacePointer(QWidget * interface); - //return empty if multiple - /** \brief compare the current sources of the copy, with the passed arguments - * \param sources the sources list to compares with the current sources list - * \return true if have same sources, else false (or empty) */ - bool haveSameSource(const QStringList &sources); - /** \brief compare the current destination of the copy, with the passed arguments - * \param destination the destination to compares with the current destination - * \return true if have same destination, else false (or empty) */ - bool haveSameDestination(const QString &destination); - //external soft like file browser have send copy/move list to do - /** \brief send copy without destination, ask the destination - * \param sources the sources list to copy - * \return true if the copy have been accepted */ - bool newCopy(const QStringList &sources); - /** \brief send copy with destination - * \param sources the sources list to copy - * \param destination the destination to copy - * \return true if the copy have been accepted */ - bool newCopy(const QStringList &sources,const QString &destination); - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \return true if the move have been accepted */ - bool newMove(const QStringList &sources); - /** \brief send move without destination, ask the destination - * \param sources the sources list to move - * \param destination the destination to move - * \return true if the move have been accepted */ - bool newMove(const QStringList &sources,const QString &destination); - /** \brief send the new transfer list - * \param file the transfer list */ - void newTransferList(const QString &file); - - /** \brief to get byte read, use by Ultracopier for the speed calculation - * real size transfered to right speed calculation */ - quint64 realByteTransfered(); - //speed limitation - /** \brief get the speed limitation - * < -1 if not able, 0 if disabled */ - qint64 getSpeedLimitation(); - //get collision action - /** \brief get the collision action list */ - QList > getCollisionAction(); - /** \brief get the collision error list */ - QList > getErrorAction(); - - /** \brief to set drives detected - * specific to this copy engine */ - void setDrive(const QStringList &drives); - - /** \brief to sync the transfer list - * Used when the interface is changed, useful to minimize the memory size */ - void syncTransferList(); - - void set_doChecksum(bool doChecksum); - void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); - void set_checksumOnlyOnError(bool checksumOnlyOnError); - void set_osBuffer(bool osBuffer); - void set_osBufferLimited(bool osBufferLimited); - void set_osBufferLimit(unsigned int osBufferLimit); - void set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -public slots: - //user ask ask to add folder (add it with interface ask source/destination) - /** \brief add folder called on the interface - * Used by manual adding */ - bool userAddFolder(const CopyMode &mode); - /** \brief add file called on the interface - * Used by manual adding */ - bool userAddFile(const CopyMode &mode); - //action on the copy - /// \brief put the transfer in pause - void pause(); - /// \brief resume the transfer - void resume(); - /** \brief skip one transfer entry - * \param id id of the file to remove */ - void skip(const quint64 &id); - /// \brief cancel all the transfer - void cancel(); - //edit the transfer list - /** \brief remove the selected item - * \param ids ids is the id list of the selected items */ - void removeItems(const QList &ids); - /** \brief move on top of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnTop(const QList &ids); - /** \brief move up the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsUp(const QList &ids); - /** \brief move down the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsDown(const QList &ids); - /** \brief move on bottom of the list the selected item - * \param ids ids is the id list of the selected items */ - void moveItemsOnBottom(const QList &ids); - - /** \brief give the forced mode, to export/import transfer list */ - void forceMode(const CopyMode &mode); - /// \brief export the transfer list into a file - void exportTransferList(); - /// \brief import the transfer list into a file - void importTransferList(); - - /** \brief to set the speed limitation - * -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - //action - /// \brief to set the collision action - void setCollisionAction(const QString &action); - /// \brief to set the error action - void setErrorAction(const QString &action); - - // specific to this copy engine - - /// \brief set if the rights shoul be keep - void setRightTransfer(const bool doRightTransfer); - /// \brief set keep date - void setKeepDate(const bool keepDate); - /// \brief set block size in KB - void setBlockSize(const int blockSize); - /// \brief set auto start - void setAutoStart(const bool autoStart); - /// \brief set if need check if the destination folder exists - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - /// \brief reset widget - void resetTempWidget(); - //autoconnect - void on_comboBoxFolderColision_currentIndexChanged(int index); - void on_comboBoxFolderError_currentIndexChanged(int index); - /// \brief need retranslate the insterface - void newLanguageLoaded(); -private slots: - void setComboBoxFolderColision(FolderExistsAction action,bool changeComboBox=true); - void setComboBoxFolderError(FileErrorAction action,bool changeComboBox=true); - void warningTransferList(const QString &warning); - void errorTransferList(const QString &error); -signals: - //send information about the copy - void actionInProgess(EngineActionInProgress); //should update interface information on this event - - void newActionOnList(const QList &);///very important, need be temporized to group the modification to do and not flood the interface - void syncReady(); - - /** \brief to get the progression for a specific file - * \param id the id of the transfer, id send during population the transfer list - * first = current transfered byte, second = byte to transfer */ - void pushFileProgression(const QList &progressionList); - //get information about the copy - /** \brief to get the general progression - * first = current transfered byte, second = byte to transfer */ - void pushGeneralProgression(const quint64 &,const quint64 &); - - void newFolderListing(const QString &path); - void newCollisionAction(const QString &action); - void newErrorAction(const QString &action); - void isInPause(bool); - - //action on the copy - void signal_pause(); - void signal_resume(); - void signal_skip(const quint64 &id); - - //edit the transfer list - void signal_removeItems(const QList &ids); - void signal_moveItemsOnTop(const QList &ids); - void signal_moveItemsUp(const QList &ids); - void signal_moveItemsDown(const QList &ids); - void signal_moveItemsOnBottom(const QList &ids); - - void signal_forceMode(const CopyMode &mode); - void signal_exportTransferList(const QString &fileName); - void signal_importTransferList(const QString &fileName); - - //action - void signal_setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists); - void signal_setComboBoxFolderColision(FolderExistsAction action); - void signal_setFolderColision(FolderExistsAction action); - - //when the cancel is clicked on copy engine dialog - void cancelAll(); - - //internal cancel - void tryCancel(); - - //when can be deleted - void canBeDeleted(); - - //send error occurred - void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error); - //for the extra logging - void rmPath(const QString &path); - void mkPath(const QString &path); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - - //other signals - void queryOneNewDialog(); - - void send_osBufferLimit(const unsigned int &osBufferLimit); - void send_setFilters(const QList &include,const QList &exclude); - void send_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -}; - -#endif // COPY_ENGINE_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/copyEngine.pro b/plugins/CopyEngine/Ultracopier-0.3/copyEngine.pro deleted file mode 100644 index 13ab523..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/copyEngine.pro +++ /dev/null @@ -1,82 +0,0 @@ -TEMPLATE = lib -CONFIG += plugin -HEADERS = copyEngine.h \ - StructEnumDefinition.h \ - scanFileOrFolder.h \ - fileErrorDialog.h \ - fileExistsDialog.h \ - fileIsSameDialog.h \ - factory.h \ - StructEnumDefinition_CopyEngine.h \ - DebugEngineMacro.h \ - Variable.h \ - debugDialog.h \ - TransferThread.h \ - ReadThread.h \ - WriteThread.h \ - RmPath.h \ - MkPath.h \ - folderExistsDialog.h \ - AvancedQFile.h \ - ListThread.h \ - ../../../interface/PluginInterface_CopyEngine.h \ - ../../../interface/OptionInterface.h \ - ../../../interface/FacilityInterface.h \ - Filters.h \ - FilterRules.h \ - RenamingRules.h -SOURCES = copyEngine.cpp \ - scanFileOrFolder.cpp \ - fileErrorDialog.cpp \ - fileExistsDialog.cpp \ - fileIsSameDialog.cpp \ - factory.cpp \ - debugDialog.cpp \ - TransferThread.cpp \ - ReadThread.cpp \ - WriteThread.cpp \ - RmPath.cpp \ - MkPath.cpp \ - folderExistsDialog.cpp \ - AvancedQFile.cpp \ - copyEngine-collision-and-error.cpp \ - ListThread.cpp \ - Filters.cpp \ - FilterRules.cpp \ - RenamingRules.cpp \ - ListThread_InodeAction.cpp -TARGET = $$qtLibraryTarget(copyEngine) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ - Languages/de/translation.ts \ - Languages/el/translation.ts \ - Languages/it/translation.ts \ - Languages/ja/translation.ts \ - Languages/id/translation.ts \ - Languages/pl/translation.ts \ - Languages/ru/translation.ts \ - Languages/tr/translation.ts \ - Languages/th/translation.ts \ - Languages/hi/translation.ts \ - Languages/nl/translation.ts \ - Languages/no/translation.ts \ - Languages/pt/translation.ts \ - Languages/ko/translation.ts - -FORMS += \ - options.ui \ - fileErrorDialog.ui \ - fileExistsDialog.ui \ - fileIsSameDialog.ui \ - debugDialog.ui \ - folderExistsDialog.ui \ - Filters.ui \ - FilterRules.ui \ - RenamingRules.ui - -OTHER_FILES += informations.xml - -RESOURCES += \ - resources.qrc diff --git a/plugins/CopyEngine/Ultracopier-0.3/debugDialog.cpp b/plugins/CopyEngine/Ultracopier-0.3/debugDialog.cpp deleted file mode 100644 index a03aec0..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/debugDialog.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** \file debugDialog.cpp -\brief Define the dialog to have debug information -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include "debugDialog.h" -#include "ui_debugDialog.h" - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW - -debugDialog::debugDialog(QWidget *parent) : - QWidget(parent), - ui(new Ui::debugDialog) -{ - ui->setupUi(this); -} - -debugDialog::~debugDialog() -{ - delete ui; -} - -void debugDialog::setTransferList(const QStringList &list) -{ - if(list.size()==ui->tranferList->count()) - { - int index=0; - while(indextranferList->item(index)->setText(list.at(index)); - index++; - } - } - else - { - ui->tranferList->clear(); - ui->tranferList->addItems(list); - } -} - -void debugDialog::setActiveTransfer(int activeTransfer) -{ - ui->spinBoxActiveTransfer->setValue(activeTransfer); -} - -void debugDialog::setInodeUsage(int inodeUsage) -{ - ui->spinBoxNumberOfInode->setValue(inodeUsage); -} - -void debugDialog::setTransferThreadList(const QStringList &list) -{ - if(list.size()==ui->transferThreadList->count()) - { - int index=0; - while(indextransferThreadList->item(index)->setText(list.at(index)); - index++; - } - } - else - { - ui->transferThreadList->clear(); - ui->transferThreadList->addItems(list); - } -} - -#endif diff --git a/plugins/CopyEngine/Ultracopier-0.3/debugDialog.h b/plugins/CopyEngine/Ultracopier-0.3/debugDialog.h deleted file mode 100644 index 3d48857..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/debugDialog.h +++ /dev/null @@ -1,40 +0,0 @@ -/** \file debugDialog.h -\brief Define the dialog to have debug information -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef DEBUGDAILOG_H -#define DEBUGDAILOG_H - -#include "Environment.h" - -#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW -#include - -namespace Ui { - class debugDialog; -} - -/// \brief class to the dialog to have debug information -class debugDialog : public QWidget -{ - Q_OBJECT -public: - explicit debugDialog(QWidget *parent = 0); - ~debugDialog(); - /// \brief to set the transfer list, limited in result to not slow down the application - void setTransferList(const QStringList &list); - /// \brief show the transfer thread, it show be a thread pool in normal time - void setTransferThreadList(const QStringList &list); - /// \brief show how many transfer is active - void setActiveTransfer(int activeTransfer); - /// \brief show many many inode is manipulated - void setInodeUsage(int inodeUsage); -private: - Ui::debugDialog *ui; -}; - -#endif // ULTRACOPIER_PLUGIN_DEBUG_WINDOW - -#endif // DEBUGDAILOG_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/debugDialog.ui b/plugins/CopyEngine/Ultracopier-0.3/debugDialog.ui deleted file mode 100644 index 0df03be..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/debugDialog.ui +++ /dev/null @@ -1,100 +0,0 @@ - - - debugDialog - - - - 0 - 0 - 665 - 392 - - - - Monitor - - - - - - - - Transfer thread - - - - - - true - - - - - - - - - - Transfer list - - - - - - true - - - - - - - - - - - - Variables - - - - - - Active transfer: - - - - - - - true - - - 9999 - - - - - - - Number of inode manipuled: - - - - - - - true - - - 9999 - - - - - - - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/documentation.dox b/plugins/CopyEngine/Ultracopier-0.3/documentation.dox deleted file mode 100755 index c91674b..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/documentation.dox +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ - -/* - This file contains NO source code, just some documentation for doxygen to - parse. -*/ - -/*! - \mainpage Copy engine 0.3 - - \section mainpage_overview Overview - - The default copy engine for Ultracopier 0.3. Support file/folder, copy/move, ...\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. - - \section mainpage_platforms Platforms - - This plugin might be usable in all environments where you find Qt 4, but Gcc is requiered for some part.\n - This plugin requires Qt 4.5.x or newer. Tested on Qt 4.7. Due to optimization Qt 4.8 usage will be better.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. - - \section mainpage_downloads Downloads - - You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... - - \section mainpage_algorithm Algorithm - - Like say previously you will have more informations on the wiki.\n - Then file transfer is done via pipe mecamism system:\n -
    -
  • push at no blocking into table up to the table is full, after is blocked up to one entry is free
  • -
  • Other thread read the table up to have no more data, then is blocked
  • -
- The transfer thread do listing of the folder, removing folder, make folder is one thread for each.\n - The transfer list, have thread pool to do the inode operation (open, close, set date, ...). Do all inode operation in parallele, but transfer the data as sequential. - - \section license GPL Version 3 - The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4. - -*/ - diff --git a/plugins/CopyEngine/Ultracopier-0.3/factory.cpp b/plugins/CopyEngine/Ultracopier-0.3/factory.cpp deleted file mode 100644 index 642a05b..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/factory.cpp +++ /dev/null @@ -1,407 +0,0 @@ -/** \file factory.cpp -\brief Define the factory to create new instance -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include - -#include "factory.h" - -Factory::Factory() : - ui(new Ui::options()) -{ - tempWidget=new QWidget(); - ui->setupUi(tempWidget); - errorFound=false; - optionsEngine=NULL; - filters=new Filters(tempWidget); - renamingRules=new RenamingRules(tempWidget); - #if defined (Q_OS_WIN32) - QFileInfoList temp=QDir::drives(); - for (int i = 0; i < temp.size(); ++i) { - mountSysPoint<doRightTransfer, SIGNAL(toggled(bool)), this,SLOT(setDoRightTransfer(bool))); - connect(ui->keepDate, SIGNAL(toggled(bool)), this,SLOT(setKeepDate(bool))); - connect(ui->blockSize, SIGNAL(valueChanged(int)), this,SLOT(setBlockSize(int))); - connect(ui->autoStart, SIGNAL(toggled(bool)), this,SLOT(setAutoStart(bool))); - connect(ui->doChecksum, SIGNAL(toggled(bool)), this,SLOT(doChecksum_toggled(bool))); - connect(ui->checksumIgnoreIfImpossible, SIGNAL(toggled(bool)), this,SLOT(checksumIgnoreIfImpossible_toggled(bool))); - connect(ui->checksumOnlyOnError, SIGNAL(toggled(bool)), this,SLOT(checksumOnlyOnError_toggled(bool))); - connect(ui->osBuffer, SIGNAL(toggled(bool)), this,SLOT(osBuffer_toggled(bool))); - connect(ui->osBufferLimited, SIGNAL(toggled(bool)), this,SLOT(osBufferLimited_toggled(bool))); - connect(ui->osBufferLimit, SIGNAL(editingFinished()), this,SLOT(osBufferLimit_editingFinished())); - - connect(filters,SIGNAL(sendNewFilters(QStringList,QStringList,QStringList,QStringList)),this,SLOT(sendNewFilters(QStringList,QStringList,QStringList,QStringList))); - connect(ui->filters,SIGNAL(clicked()),this,SLOT(showFilterDialog())); - connect(renamingRules,SIGNAL(sendNewRenamingRules(QString,QString)),this,SLOT(sendNewRenamingRules(QString,QString))); - connect(ui->renamingRules,SIGNAL(clicked()),this,SLOT(showRenamingRules())); - - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -Factory::~Factory() -{ - delete renamingRules; - delete filters; - delete ui; -} - -PluginInterface_CopyEngine * Factory::getInstance() -{ - copyEngine *realObject=new copyEngine(facilityEngine); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(realObject,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif - realObject->connectTheSignalsSlots(); - realObject->setDrive(mountSysPoint); - PluginInterface_CopyEngine * newTransferEngine=realObject; - connect(this,SIGNAL(reloadLanguage()),newTransferEngine,SLOT(newLanguageLoaded())); - realObject->setRightTransfer( optionsEngine->getOptionValue("doRightTransfer").toBool()); - realObject->setKeepDate( optionsEngine->getOptionValue("keepDate").toBool()); - realObject->setBlockSize( optionsEngine->getOptionValue("blockSize").toInt()); - realObject->setAutoStart( optionsEngine->getOptionValue("autoStart").toBool()); - realObject->on_comboBoxFolderColision_currentIndexChanged(ui->comboBoxFolderColision->currentIndex()); - realObject->on_comboBoxFolderError_currentIndexChanged(ui->comboBoxFolderError->currentIndex()); - realObject->setCheckDestinationFolderExists( optionsEngine->getOptionValue("checkDestinationFolder").toBool()); - - realObject->set_doChecksum(optionsEngine->getOptionValue("doChecksum").toBool()); - realObject->set_checksumIgnoreIfImpossible(optionsEngine->getOptionValue("checksumIgnoreIfImpossible").toBool()); - realObject->set_checksumOnlyOnError(optionsEngine->getOptionValue("checksumOnlyOnError").toBool()); - realObject->set_osBuffer(optionsEngine->getOptionValue("osBuffer").toBool()); - realObject->set_osBufferLimited(optionsEngine->getOptionValue("osBufferLimited").toBool()); - realObject->set_osBufferLimit(optionsEngine->getOptionValue("osBufferLimit").toUInt()); - realObject->set_setFilters(optionsEngine->getOptionValue("includeStrings").toStringList(), - optionsEngine->getOptionValue("includeOptions").toStringList(), - optionsEngine->getOptionValue("excludeStrings").toStringList(), - optionsEngine->getOptionValue("excludeOptions").toStringList() - ); - realObject->setRenamingRules(optionsEngine->getOptionValue("firstRenamingRule").toString(),optionsEngine->getOptionValue("otherRenamingRule").toString()); - return newTransferEngine; -} - -void Factory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath:"+pluginPath); - this->facilityEngine=facilityInterface; - Q_UNUSED(portableVersion); - #ifndef ULTRACOPIER_PLUGIN_DEBUG - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - #endif - #if ! defined (Q_CC_GNU) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"Unable to change date time of files, only gcc is supported"); - #endif - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,COMPILERINFO); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX BUFFER BLOCK: "+QString::number(ULTRACOPIER_PLUGIN_MAXBUFFERBLOCK)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MIN TIMER INTERVAL: "+QString::number(ULTRACOPIER_PLUGIN_MINTIMERINTERVAL)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX TIMER INTERVAL: "+QString::number(ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"NUM SEM SPEED MANAGEMENT: "+QString::number(ULTRACOPIER_PLUGIN_NUMSEMSPEEDMANAGEMENT)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX PARALLEL INODE OPT: "+QString::number(ULTRACOPIER_PLUGIN_MAXPARALLELINODEOPT)); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"MAX PARALLEL TRANFER: "+QString::number(ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER)); - #if defined (ULTRACOPIER_PLUGIN_CHECKLISTTYPE) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"CHECK LIST TYPE set"); - #else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"CHECK LIST TYPE not set"); - #endif - if(options!=NULL) - { - optionsEngine=options; - //load the options - QList > KeysList; - KeysList.append(qMakePair(QString("doRightTransfer"),QVariant(true))); - KeysList.append(qMakePair(QString("keepDate"),QVariant(true))); - KeysList.append(qMakePair(QString("blockSize"),QVariant(1024)));//1024KB as default - KeysList.append(qMakePair(QString("autoStart"),QVariant(true))); - KeysList.append(qMakePair(QString("folderError"),QVariant(0))); - KeysList.append(qMakePair(QString("folderColision"),QVariant(0))); - KeysList.append(qMakePair(QString("checkDestinationFolder"),QVariant(true))); - KeysList.append(qMakePair(QString("includeStrings"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("includeOptions"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("excludeStrings"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("excludeOptions"),QVariant(QStringList()))); - KeysList.append(qMakePair(QString("doChecksum"),QVariant(true))); - KeysList.append(qMakePair(QString("checksumIgnoreIfImpossible"),QVariant(true))); - KeysList.append(qMakePair(QString("checksumOnlyOnError"),QVariant(true))); - KeysList.append(qMakePair(QString("osBuffer"),QVariant(true))); - KeysList.append(qMakePair(QString("firstRenamingRule"),QVariant(""))); - KeysList.append(qMakePair(QString("otherRenamingRule"),QVariant(""))); - #ifdef Q_OS_WIN32 - KeysList.append(qMakePair(QString("osBufferLimited"),QVariant(true))); - #else - KeysList.append(qMakePair(QString("osBufferLimited"),QVariant(false))); - #endif - KeysList.append(qMakePair(QString("osBufferLimit"),QVariant(512))); - optionsEngine->addOptionGroup(KeysList); - #if ! defined (Q_CC_GNU) - ui->keepDate->setEnabled(false); - ui->keepDate->setToolTip("Not supported with this compiler"); - #endif - ui->doRightTransfer->setChecked(optionsEngine->getOptionValue("doRightTransfer").toBool()); - ui->keepDate->setChecked(optionsEngine->getOptionValue("keepDate").toBool()); - ui->blockSize->setValue(optionsEngine->getOptionValue("blockSize").toUInt()); - ui->autoStart->setChecked(optionsEngine->getOptionValue("autoStart").toBool()); - ui->comboBoxFolderError->setCurrentIndex(optionsEngine->getOptionValue("folderError").toUInt()); - ui->comboBoxFolderColision->setCurrentIndex(optionsEngine->getOptionValue("folderColision").toUInt()); - ui->checkBoxDestinationFolderExists->setChecked(optionsEngine->getOptionValue("checkDestinationFolder").toBool()); - ui->doChecksum->setChecked(optionsEngine->getOptionValue("doChecksum").toBool()); - ui->checksumIgnoreIfImpossible->setChecked(optionsEngine->getOptionValue("checksumIgnoreIfImpossible").toBool()); - ui->checksumOnlyOnError->setChecked(optionsEngine->getOptionValue("checksumOnlyOnError").toBool()); - ui->osBuffer->setChecked(optionsEngine->getOptionValue("osBuffer").toBool()); - ui->osBufferLimited->setChecked(optionsEngine->getOptionValue("osBufferLimited").toBool()); - ui->osBufferLimit->setValue(optionsEngine->getOptionValue("osBufferLimit").toUInt()); - filters->setFilters(optionsEngine->getOptionValue("includeStrings").toStringList(), - optionsEngine->getOptionValue("includeOptions").toStringList(), - optionsEngine->getOptionValue("excludeStrings").toStringList(), - optionsEngine->getOptionValue("excludeOptions").toStringList() - ); - renamingRules->setRenamingRules(optionsEngine->getOptionValue("firstRenamingRule").toString(),optionsEngine->getOptionValue("otherRenamingRule").toString()); - } -} - -QStringList Factory::supportedProtocolsForTheSource() -{ - return QStringList() << "file"; -} - -QStringList Factory::supportedProtocolsForTheDestination() -{ - return QStringList() << "file"; -} - -CopyType Factory::getCopyType() -{ - return FileAndFolder; -} - -TransferListOperation Factory::getTransferListOperation() -{ - return TransferListOperation_ImportExport; -} - -bool Factory::canDoOnlyCopy() -{ - return false; -} - -void Factory::error(QProcess::ProcessError error) -{ - #ifndef ULTRACOPIER_PLUGIN_DEBUG - Q_UNUSED(error) - #endif - errorFound=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"have detected error: "+QString::number(error)); -} - -void Factory::finished(int exitCode, QProcess::ExitStatus exitStatus) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"exitCode: "+QString::number(exitCode)+", exitStatus: "+QString::number(exitStatus)); - #ifndef ULTRACOPIER_PLUGIN_DEBUG - Q_UNUSED(exitCode) - Q_UNUSED(exitStatus) - #endif - if(!StandardError.isEmpty()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"have finished with text on error output: "+StandardError); - else if(errorFound) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"have finished with error and no text"); - { - QStringList tempList=StandardOutput.split(QRegExp("[\n\r]+")); - int index=0; - while(indexautoStart->setChecked(optionsEngine->getOptionValue("autoStart").toBool()); - return tempWidget; -} - -void Factory::setDoRightTransfer(bool doRightTransfer) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("doRightTransfer",doRightTransfer); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setKeepDate(bool keepDate) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("keepDate",keepDate); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setBlockSize(int blockSize) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("blockSize",blockSize); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::setAutoStart(bool autoStart) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("autoStart",autoStart); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::newLanguageLoaded() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, retranslate the widget options"); - ui->retranslateUi(tempWidget); - if(optionsEngine!=NULL) - { - filters->newLanguageLoaded(); - renamingRules->newLanguageLoaded(); - } - emit reloadLanguage(); -} - -Q_EXPORT_PLUGIN2(copyEngine, Factory); - -void Factory::doChecksum_toggled(bool doChecksum) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("doChecksum",doChecksum); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::checksumOnlyOnError_toggled(bool checksumOnlyOnError) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("checksumOnlyOnError",checksumOnlyOnError); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::osBuffer_toggled(bool osBuffer) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("osBuffer",osBuffer); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void Factory::osBufferLimited_toggled(bool osBufferLimited) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("osBufferLimited",osBufferLimited); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); - ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); -} - -void Factory::osBufferLimit_editingFinished() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the spinbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("osBufferLimit",ui->osBufferLimit->value()); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::showFilterDialog() -{ - if(optionsEngine==NULL) - { - QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"options not loaded"); - return; - } - filters->exec(); -} - -void Factory::sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"new filter"); - if(optionsEngine!=NULL) - { - optionsEngine->setOptionValue("includeStrings",includeStrings); - optionsEngine->setOptionValue("includeOptions",includeOptions); - optionsEngine->setOptionValue("excludeStrings",excludeStrings); - optionsEngine->setOptionValue("excludeOptions",excludeOptions); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"new filter"); - if(optionsEngine!=NULL) - { - optionsEngine->setOptionValue("firstRenamingRule",firstRenamingRule); - optionsEngine->setOptionValue("otherRenamingRule",otherRenamingRule); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::showRenamingRules() -{ - if(optionsEngine==NULL) - { - QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"options not loaded"); - return; - } - renamingRules->exec(); -} - -void Factory::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("checksumIgnoreIfImpossible",checksumIgnoreIfImpossible); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/factory.h b/plugins/CopyEngine/Ultracopier-0.3/factory.h deleted file mode 100644 index c5cfa91..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/factory.h +++ /dev/null @@ -1,95 +0,0 @@ -/** \file factory.h -\brief Define the factory to create new instance -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_CopyEngine.h" -#include "StructEnumDefinition.h" -#include "ui_options.h" -#include "copyEngine.h" -#include "Environment.h" -#include "Filters.h" -#include "RenamingRules.h" - -#ifndef FACTORY_H -#define FACTORY_H - -namespace Ui { - class options; -} - -/** \brief to generate copy engine instance */ -class Factory : public PluginInterface_CopyEngineFactory -{ - Q_OBJECT - Q_INTERFACES(PluginInterface_CopyEngineFactory) -public: - Factory(); - ~Factory(); - /// \brief to return the instance of the copy engine - PluginInterface_CopyEngine * getInstance(); - /// \brief set the resources, to store options, to have facilityInterface - void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion); - //get mode allowed - /// \brief define if can copy file, folder or both - CopyType getCopyType(); - /// \brief to return which kind of transfer list operation is supported - TransferListOperation getTransferListOperation(); - /// \brief define if can only copy, or copy and move - bool canDoOnlyCopy(); - /// \brief to get the supported protocols for the source - QStringList supportedProtocolsForTheSource(); - /// \brief to get the supported protocols for the destination - QStringList supportedProtocolsForTheDestination(); - /// \brief to get the options of the copy engine - QWidget * options(); -private: - Ui::options *ui; - QWidget* tempWidget; - OptionInterface * optionsEngine; - QStringList mountSysPoint; - QProcess mount; - QString StandardError; - QString StandardOutput; - bool errorFound; - FacilityInterface * facilityEngine; - Filters *filters; - RenamingRules *renamingRules; -private slots: - void error(QProcess::ProcessError error); - void finished(int exitCode, QProcess::ExitStatus exitStatus); - void readyReadStandardError(); - void readyReadStandardOutput(); - void setDoRightTransfer(bool doRightTransfer); - void setKeepDate(bool keepDate); - void setBlockSize(int blockSize); - void setAutoStart(bool autoStart); - void showFilterDialog(); - void sendNewFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); - void doChecksum_toggled(bool); - void checksumOnlyOnError_toggled(bool); - void osBuffer_toggled(bool); - void osBufferLimited_toggled(bool); - void osBufferLimit_editingFinished(); - void checksumIgnoreIfImpossible_toggled(bool); - void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); - void showRenamingRules(); -public slots: - void resetOptions(); - void newLanguageLoaded(); -signals: - void reloadLanguage(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif -}; - -#endif // FACTORY_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.cpp b/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.cpp deleted file mode 100644 index 0d9fa9a..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "fileErrorDialog.h" -#include "ui_fileErrorDialog.h" - -fileErrorDialog::fileErrorDialog(QWidget *parent,QFileInfo fileInfo,QString errorString,bool havePutAtTheEndButton) : - QDialog(parent), - ui(new Ui::fileErrorDialog) -{ - ui->setupUi(this); - action=FileError_Cancel; - ui->label_error->setText(errorString); - ui->label_content_file_name->setText(fileInfo.fileName()); - if(fileInfo.exists()) - { - ui->label_content_size->setText(QString::number(fileInfo.size())); - QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); - if(maxTimelabel_modified->setVisible(true); - ui->label_content_modified->setVisible(true); - ui->label_content_modified->setText(fileInfo.lastModified().toString()); - } - else - { - ui->label_modified->setVisible(false); - ui->label_content_modified->setVisible(false); - } - if(fileInfo.isDir()) - { - this->setWindowTitle(tr("Error on folder")); - ui->label_size->hide(); - ui->label_content_size->hide(); - ui->label_file_name->setText(tr("Folder name")); - } - } - else - { - ui->label_size->hide(); - ui->label_content_size->hide(); - ui->label_modified->hide(); - ui->label_content_modified->hide(); - } - if(!havePutAtTheEndButton) - ui->PutToBottom->hide(); -} - -fileErrorDialog::~fileErrorDialog() -{ - delete ui; -} - -void fileErrorDialog::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -void fileErrorDialog::on_PutToBottom_clicked() -{ - action=FileError_PutToEndOfTheList; - this->close(); -} - -void fileErrorDialog::on_Retry_clicked() -{ - action=FileError_Retry; - this->close(); -} - -void fileErrorDialog::on_Skip_clicked() -{ - action=FileError_Skip; - this->close(); -} - -void fileErrorDialog::on_Cancel_clicked() -{ - action=FileError_Cancel; - this->close(); -} - -bool fileErrorDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -FileErrorAction fileErrorDialog::getAction() -{ - return action; -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.h b/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.h deleted file mode 100644 index b14fe87..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.h +++ /dev/null @@ -1,45 +0,0 @@ -/** \file fileErrorDialog.h -\brief Define the dialog error on the file -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include "Environment.h" - -#ifndef FILEERRORDIALOG_H -#define FILEERRORDIALOG_H - -namespace Ui { - class fileErrorDialog; -} - -/// \brief to show error dialog, and ask what do -class fileErrorDialog : public QDialog -{ - Q_OBJECT -public: - /// \brief create the object and pass all the informations to it - explicit fileErrorDialog(QWidget *parent,QFileInfo fileInfo,QString errorString,bool havePutAtTheEndButton=true); - ~fileErrorDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FileErrorAction getAction(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_PutToBottom_clicked(); - void on_Retry_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); -private: - Ui::fileErrorDialog *ui; - FileErrorAction action; -}; - -#endif // FILEERRORDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.ui b/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.ui deleted file mode 100644 index c5027e7..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileErrorDialog.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - fileErrorDialog - - - - 0 - 0 - 478 - 154 - - - - Error on file - - - - - - Error - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - source.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - &Always do this action - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Put to bottom - - - - - - - Retry - - - - - - - &Skip - - - - - - - &Cancel - - - - - - - - - - - checkBoxAlways - toggled(bool) - Cancel - setDisabled(bool) - - - 112 - 131 - - - 438 - 142 - - - - - checkBoxAlways - toggled(bool) - Retry - setDisabled(bool) - - - 155 - 131 - - - 309 - 134 - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.cpp b/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.cpp deleted file mode 100644 index 191dd79..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include "fileExistsDialog.h" -#include "ui_fileExistsDialog.h" - -#include - -fileExistsDialog::fileExistsDialog(QWidget *parent,QFileInfo source,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule) : - QDialog(parent), - ui(new Ui::fileExistsDialog) -{ - ui->setupUi(this); - action=FileExists_Cancel; - destinationInfo=destination; - oldName=destination.fileName(); - ui->lineEditNewName->setText(oldName); - ui->lineEditNewName->setPlaceholderText(oldName); - ui->Overwrite->addAction(ui->actionOverwrite_if_newer); - ui->Overwrite->addAction(ui->actionOverwrite_if_not_same_modification_date); - ui->label_content_source_size->setText(QString::number(source.size())); - ui->label_content_source_modified->setText(source.lastModified().toString()); - ui->label_content_source_file_name->setText(source.fileName()); - ui->label_content_destination_size->setText(QString::number(destination.size())); - ui->label_content_destination_modified->setText(destination.lastModified().toString()); - ui->label_content_destination_file_name->setText(destination.fileName()); - QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); - if(maxTimelabel_source_modified->setVisible(true); - ui->label_content_source_modified->setVisible(true); - ui->label_content_source_modified->setText(source.lastModified().toString()); - } - else - { - ui->label_source_modified->setVisible(false); - ui->label_content_source_modified->setVisible(false); - } - if(maxTimelabel_destination_modified->setVisible(true); - ui->label_content_destination_modified->setVisible(true); - ui->label_content_destination_modified->setText(destination.lastModified().toString()); - } - else - { - ui->label_destination_modified->setVisible(false); - ui->label_content_destination_modified->setVisible(false); - } - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -fileExistsDialog::~fileExistsDialog() -{ - delete ui; -} - -void fileExistsDialog::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -QString fileExistsDialog::getNewName() -{ - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - qDebug() << "return the old name: "+oldName; - else - qDebug() << "return the new name: "+ui->lineEditNewName->text(); - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - return oldName; - else - return ui->lineEditNewName->text(); -} - -void fileExistsDialog::on_SuggestNewName_clicked() -{ - QFileInfo destinationInfo=this->destinationInfo; - QString absolutePath=destinationInfo.absolutePath(); - QString fileName=destinationInfo.fileName(); - QString suffix=""; - QString destination; - QString newFileName; - //resolv the suffix - if(fileName.contains(QRegExp("^(.*)(\\.[a-z0-9]+)$"))) - { - suffix=fileName; - suffix.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\2"); - fileName.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\1"); - } - //resolv the new name - int num=1; - do - { - if(num==1) - { - if(firstRenamingRule=="") - newFileName=tr("%1 - copy").arg(fileName); - else - { - newFileName=firstRenamingRule; - newFileName.replace("%name%",fileName); - } - } - else - { - if(otherRenamingRule=="") - newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); - else - { - newFileName=otherRenamingRule; - newFileName.replace("%name%",fileName); - newFileName.replace("%number%",QString::number(num)); - } - } - destination=absolutePath+QDir::separator()+newFileName+suffix; - destinationInfo.setFile(destination); - num++; - } - while(destinationInfo.exists()); - ui->lineEditNewName->setText(newFileName+suffix); -} - -void fileExistsDialog::on_Rename_clicked() -{ - action=FileExists_Rename; - this->close(); -} - -void fileExistsDialog::on_Overwrite_clicked() -{ - action=FileExists_Overwrite; - this->close(); -} - -void fileExistsDialog::on_Skip_clicked() -{ - action=FileExists_Skip; - this->close(); -} - -void fileExistsDialog::on_Cancel_clicked() -{ - action=FileExists_Cancel; - this->close(); -} - -void fileExistsDialog::on_actionOverwrite_if_newer_triggered() -{ - action=FileExists_OverwriteIfNewer; - this->close(); -} - -void fileExistsDialog::on_actionOverwrite_if_not_same_modification_date_triggered() -{ - action=FileExists_OverwriteIfNotSameModificationDate; - this->close(); -} - -FileExistsAction fileExistsDialog::getAction() -{ - return action; -} - -bool fileExistsDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -void fileExistsDialog::updateRenameButton() -{ - ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); -} - -void fileExistsDialog::on_checkBoxAlways_toggled(bool checked) -{ - Q_UNUSED(checked); - updateRenameButton(); -} - -void fileExistsDialog::on_lineEditNewName_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateRenameButton(); -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.h b/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.h deleted file mode 100644 index 75af190..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.h +++ /dev/null @@ -1,58 +0,0 @@ -/** \file fileExistsDialog.h -\brief Define the dialog when file already exists -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include -#include "Environment.h" - -#ifndef FILEEXISTSDIALOG_H -#define FILEEXISTSDIALOG_H - -namespace Ui { - class fileExistsDialog; -} - -/// \brief to show file exists dialog, and ask what do -class fileExistsDialog : public QDialog -{ - Q_OBJECT -public: - /// \brief create the object and pass all the informations to it - explicit fileExistsDialog(QWidget *parent,QFileInfo source,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule); - ~fileExistsDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FileExistsAction getAction(); - /// \brief return the new rename is case in manual renaming - QString getNewName(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_SuggestNewName_clicked(); - void on_Rename_clicked(); - void on_Overwrite_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); - void on_actionOverwrite_if_newer_triggered(); - void on_actionOverwrite_if_not_same_modification_date_triggered(); - void updateRenameButton(); - void on_checkBoxAlways_toggled(bool checked); - void on_lineEditNewName_textChanged(const QString &arg1); -private: - Ui::fileExistsDialog *ui; - FileExistsAction action; - QString oldName; - QFileInfo destinationInfo; - QString firstRenamingRule; - QString otherRenamingRule; -}; - -#endif // FILEEXISTSDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.ui b/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.ui deleted file mode 100644 index a37945a..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileExistsDialog.ui +++ /dev/null @@ -1,367 +0,0 @@ - - - fileExistsDialog - - - - 0 - 0 - 469 - 150 - - - - The file exists - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Source - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - Destination - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - source.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - destination.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - Suggest new &name - - - - - - - - - - - &Always do this action - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Rename - - - - - - - &Overwrite - - - QToolButton::MenuButtonPopup - - - - - - - &Skip - - - - - - - &Cancel - - - - - - - - - Overwrite if newer - - - - - Overwrite if not same modification date - - - - - - - checkBoxAlways - toggled(bool) - Cancel - setDisabled(bool) - - - 115 - 130 - - - 440 - 129 - - - - - checkBoxAlways - toggled(bool) - lineEditNewName - setDisabled(bool) - - - 62 - 129 - - - 108 - 93 - - - - - checkBoxAlways - toggled(bool) - SuggestNewName - setDisabled(bool) - - - 144 - 138 - - - 326 - 98 - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.cpp b/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.cpp deleted file mode 100644 index f45b2ea..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "fileIsSameDialog.h" -#include "ui_fileIsSameDialog.h" - -#include - -fileIsSameDialog::fileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule) : - QDialog(parent), - ui(new Ui::fileIsSameDialog) -{ - ui->setupUi(this); - action=FileExists_Cancel; - oldName=fileInfo.fileName(); - destinationInfo=fileInfo; - ui->lineEditNewName->setText(oldName); - ui->lineEditNewName->setPlaceholderText(oldName); - ui->label_content_size->setText(QString::number(fileInfo.size())); - ui->label_content_modified->setText(fileInfo.lastModified().toString()); - ui->label_content_file_name->setText(fileInfo.fileName()); - updateRenameButton(); - QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); - if(maxTimelabel_modified->setVisible(true); - ui->label_content_modified->setVisible(true); - ui->label_content_modified->setText(fileInfo.lastModified().toString()); - } - else - { - ui->label_modified->setVisible(false); - ui->label_content_modified->setVisible(false); - } - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -fileIsSameDialog::~fileIsSameDialog() -{ - delete ui; -} - -void fileIsSameDialog::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -QString fileIsSameDialog::getNewName() -{ - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - qDebug() << "fileIsSameDialog, return the old name: "+oldName; - else - qDebug() << "fileIsSameDialog, return the new name: "+ui->lineEditNewName->text(); - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - return oldName; - else - return ui->lineEditNewName->text(); -} - -void fileIsSameDialog::on_SuggestNewName_clicked() -{ - QFileInfo destinationInfo=this->destinationInfo; - QString absolutePath=destinationInfo.absolutePath(); - QString fileName=destinationInfo.fileName(); - QString suffix=""; - QString destination; - QString newFileName; - //resolv the suffix - if(fileName.contains(QRegExp("^(.*)(\\.[a-z0-9]+)$"))) - { - suffix=fileName; - suffix.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\2"); - fileName.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\1"); - } - //resolv the new name - int num=1; - do - { - if(num==1) - { - if(firstRenamingRule=="") - newFileName=tr("%1 - copy").arg(fileName); - else - { - newFileName=firstRenamingRule; - newFileName.replace("%name%",fileName); - } - } - else - { - if(otherRenamingRule=="") - newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); - else - { - newFileName=otherRenamingRule; - newFileName.replace("%name%",fileName); - newFileName.replace("%number%",QString::number(num)); - } - } - destination=absolutePath+QDir::separator()+newFileName+suffix; - destinationInfo.setFile(destination); - num++; - } - while(destinationInfo.exists()); - ui->lineEditNewName->setText(newFileName+suffix); -} - -void fileIsSameDialog::on_Rename_clicked() -{ - action=FileExists_Rename; - this->close(); -} - -void fileIsSameDialog::on_Skip_clicked() -{ - action=FileExists_Skip; - this->close(); -} - -void fileIsSameDialog::on_Cancel_clicked() -{ - action=FileExists_Cancel; - this->close(); -} - -FileExistsAction fileIsSameDialog::getAction() -{ - return action; -} - -bool fileIsSameDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -void fileIsSameDialog::updateRenameButton() -{ - ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); -} - -void fileIsSameDialog::on_lineEditNewName_textChanged(const QString &arg1) -{ - Q_UNUSED(arg1); - updateRenameButton(); -} - -void fileIsSameDialog::on_checkBoxAlways_toggled(bool checked) -{ - Q_UNUSED(checked); - updateRenameButton(); -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.h b/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.h deleted file mode 100644 index fa48755..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.h +++ /dev/null @@ -1,56 +0,0 @@ -/** \file fileIsSameDialog.h -\brief Define the dialog when file is same -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include -#include -#include -#include -#include -#include -#include "Environment.h" - -#ifndef FILEISSAMEDIALOG_H -#define FILEISSAMEDIALOG_H - -namespace Ui { - class fileIsSameDialog; -} - -/// \brief to show file is same dialog, and ask what do -class fileIsSameDialog : public QDialog -{ - Q_OBJECT -public: - /// \brief create the object and pass all the informations to it - explicit fileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule); - ~fileIsSameDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FileExistsAction getAction(); - /// \brief return the new rename is case in manual renaming - QString getNewName(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_SuggestNewName_clicked(); - void on_Rename_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); - void updateRenameButton(); - void on_lineEditNewName_textChanged(const QString &arg1); - void on_checkBoxAlways_toggled(bool checked); -private: - Ui::fileIsSameDialog *ui; - FileExistsAction action; - QString oldName; - QFileInfo destinationInfo; - QString firstRenamingRule; - QString otherRenamingRule; - -}; - -#endif // FILEISSAMEDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.ui b/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.ui deleted file mode 100644 index 673ba26..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/fileIsSameDialog.ui +++ /dev/null @@ -1,192 +0,0 @@ - - - fileIsSameDialog - - - - 0 - 0 - 378 - 148 - - - - This files are the same file - - - - - - The source and destination is same - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Size - - - - - - - 0 KiB - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - File name - - - - - - - source.txt - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - Suggest new &name - - - - - - - - - - - &Always do this action - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Rename - - - - - - - &Skip - - - - - - - &Cancel - - - - - - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.cpp b/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.cpp deleted file mode 100644 index d951b90..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "folderExistsDialog.h" -#include "ui_folderExistsDialog.h" - -#include - -folderExistsDialog::folderExistsDialog(QWidget *parent,QFileInfo source,bool isSame,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule) : - QDialog(parent), - ui(new Ui::folderExistsDialog) -{ - ui->setupUi(this); - action=FolderExists_Cancel; - oldName=source.fileName(); - this->destinationInfo=destinationInfo; - ui->lineEditNewName->setText(oldName); - ui->lineEditNewName->setPlaceholderText(oldName); - ui->label_content_source_modified->setText(source.lastModified().toString()); - ui->label_content_source_folder_name->setText(source.fileName()); - if(isSame) - { - ui->label_source->hide(); - ui->label_destination->hide(); - ui->label_destination_modified->hide(); - ui->label_destination_folder_name->hide(); - ui->label_content_destination_modified->hide(); - ui->label_content_destination_folder_name->hide(); - } - else - { - this->setWindowTitle(tr("Folder already exists")); - ui->label_message->hide(); - ui->label_content_destination_modified->setText(destination.lastModified().toString()); - ui->label_content_destination_folder_name->setText(destination.fileName()); - } - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} - -folderExistsDialog::~folderExistsDialog() -{ - delete ui; -} - -void folderExistsDialog::changeEvent(QEvent *e) -{ - QDialog::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -QString folderExistsDialog::getNewName() -{ - if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) - return ""; - else - return ui->lineEditNewName->text(); -} - -void folderExistsDialog::on_SuggestNewName_clicked() -{ - QFileInfo destinationInfo=this->destinationInfo; - QString absolutePath=destinationInfo.absolutePath(); - QString fileName=destinationInfo.fileName(); - QString suffix=""; - QString destination; - QString newFileName; - //resolv the suffix - if(fileName.contains(QRegExp("^(.*)(\\.[a-z0-9]+)$"))) - { - suffix=fileName; - suffix.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\2"); - fileName.replace(QRegExp("^(.*)(\\.[a-z0-9]+)$"),"\\1"); - } - //resolv the new name - int num=1; - do - { - if(num==1) - { - if(firstRenamingRule=="") - newFileName=tr("%1 - copy").arg(fileName); - else - { - newFileName=firstRenamingRule; - newFileName.replace("%name%",fileName); - } - } - else - { - if(otherRenamingRule=="") - newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); - else - { - newFileName=otherRenamingRule; - newFileName.replace("%name%",fileName); - newFileName.replace("%number%",QString::number(num)); - } - } - destination=absolutePath+QDir::separator()+newFileName+suffix; - destinationInfo.setFile(destination); - num++; - } - while(destinationInfo.exists()); - ui->lineEditNewName->setText(newFileName+suffix); -} - -void folderExistsDialog::on_Rename_clicked() -{ - action=FolderExists_Rename; - this->close(); -} - -void folderExistsDialog::on_Skip_clicked() -{ - action=FolderExists_Skip; - this->close(); -} - -void folderExistsDialog::on_Cancel_clicked() -{ - action=FolderExists_Cancel; - this->close(); -} - -FolderExistsAction folderExistsDialog::getAction() -{ - return action; -} - -bool folderExistsDialog::getAlways() -{ - return ui->checkBoxAlways->isChecked(); -} - -void folderExistsDialog::on_Merge_clicked() -{ - action=FolderExists_Merge; - this->close(); -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.h b/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.h deleted file mode 100644 index 6d612f1..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.h +++ /dev/null @@ -1,54 +0,0 @@ -/** \file folderExistsDialog.h -\brief Define the dialog when file exists -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef FOLDERISSAMEDIALOG_H -#define FOLDERISSAMEDIALOG_H - -#include -#include -#include -#include -#include - -#include "Environment.h" - -namespace Ui { - class folderExistsDialog; -} - -/// \brief to show file exists dialog, and ask what do -class folderExistsDialog : public QDialog -{ - Q_OBJECT - -public: - /// \brief create the object and pass all the informations to it - explicit folderExistsDialog(QWidget *parent,QFileInfo source,bool isSame,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule); - ~folderExistsDialog(); - /// \brief return the the always checkbox is checked - bool getAlways(); - /// \brief return the action clicked - FolderExistsAction getAction(); - /// \brief return the new rename is case in manual renaming - QString getNewName(); -protected: - void changeEvent(QEvent *e); -private slots: - void on_SuggestNewName_clicked(); - void on_Rename_clicked(); - void on_Skip_clicked(); - void on_Cancel_clicked(); - void on_Merge_clicked(); -private: - Ui::folderExistsDialog *ui; - FolderExistsAction action; - QString oldName; - QString firstRenamingRule; - QString otherRenamingRule; - QFileInfo destinationInfo; -}; - -#endif // FOLDERISSAMEDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.ui b/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.ui deleted file mode 100644 index c4c4d5e..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/folderExistsDialog.ui +++ /dev/null @@ -1,282 +0,0 @@ - - - folderExistsDialog - - - - 0 - 0 - 443 - 146 - - - - This folders are the same folder - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Source - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - Destination - - - Qt::AlignCenter - - - - - - - - - The source and destination is same - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Modified - - - - - - - Today - - - - - - - false - - - Folder name - - - - - - - folder - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - false - - - Modified - - - - - - - false - - - Folder name - - - - - - - Today - - - - - - - folder - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - - - - Suggest new &name - - - - - - - - - - - &Always do this action - - - - - - - &Rename - - - - - - - Merge - - - - - - - Skip - - - - - - - &Cancel - - - - - - - - - - - checkBoxAlways - clicked(bool) - lineEditNewName - setDisabled(bool) - - - 132 - 126 - - - 135 - 101 - - - - - checkBoxAlways - clicked(bool) - SuggestNewName - setDisabled(bool) - - - 113 - 129 - - - 304 - 100 - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/informations.xml b/plugins/CopyEngine/Ultracopier-0.3/informations.xml deleted file mode 100644 index 8593149..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/informations.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - <![CDATA[Copy engine of Ultracopier 0.3]]> - <![CDATA[Moteur de copie d'ultracopier 0.3]]> - - CopyEngine - - - - - - - 1287496800 - - windows-x86 - - - - - 0.3.1.0 - - Ultracopier-0.3 - - =ultracopier-0.3.1.0 - ]]> - \ No newline at end of file diff --git a/plugins/CopyEngine/Ultracopier-0.3/options.ui b/plugins/CopyEngine/Ultracopier-0.3/options.ui deleted file mode 100644 index 21d4d7f..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/options.ui +++ /dev/null @@ -1,314 +0,0 @@ - - - options - - - - 0 - 0 - 356 - 376 - - - - - 2 - - - 2 - - - - - Transfer the file rights - - - - - - - - - - Keep the file date - - - - - - - - - - KB - - - 1 - - - 64000 - - - - - - - Auto start the transfer - - - - - - - - - - When folder error - - - - - - - - Ask - - - - - Skip - - - - - - - - When folder collision - - - - - - - - Ask - - - - - Merge - - - - - Skip - - - - - Rename - - - - - - - - Check if destination folder exists - - - - - - - - - - Checksum - - - - - - false - - - - - - - false - - - Only after error - - - - - - - false - - - Ignore if impossible - - - - - - - false - - - - - - - - - - Do checksum - - - - - - - - - - Enable OS buffer - - - - - - - - - - OS buffer only if smaller than - - - - - - - KB - - - 1 - - - 2048 - - - 512 - - - - - - - Block size - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Filters - - - - - - - Renaming rules - - - - - - - - - doChecksum - clicked(bool) - label_9 - setEnabled(bool) - - - 187 - 212 - - - 100 - 223 - - - - - doChecksum - clicked(bool) - checksumOnlyOnError - setEnabled(bool) - - - 198 - 212 - - - 190 - 226 - - - - - doChecksum - clicked(bool) - label_10 - setEnabled(bool) - - - 245 - 210 - - - 123 - 251 - - - - - doChecksum - clicked(bool) - checksumIgnoreIfImpossible - setEnabled(bool) - - - 269 - 209 - - - 213 - 247 - - - - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/resources.qrc b/plugins/CopyEngine/Ultracopier-0.3/resources.qrc deleted file mode 100644 index c6ca4ef..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/resources.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - resources/add.png - resources/edit.png - resources/remove.png - resources/filter.png - - diff --git a/plugins/CopyEngine/Ultracopier-0.3/resources/add.png b/plugins/CopyEngine/Ultracopier-0.3/resources/add.png deleted file mode 100644 index 1e03be9..0000000 Binary files a/plugins/CopyEngine/Ultracopier-0.3/resources/add.png and /dev/null differ diff --git a/plugins/CopyEngine/Ultracopier-0.3/resources/edit.png b/plugins/CopyEngine/Ultracopier-0.3/resources/edit.png deleted file mode 100644 index 8072aea..0000000 Binary files a/plugins/CopyEngine/Ultracopier-0.3/resources/edit.png and /dev/null differ diff --git a/plugins/CopyEngine/Ultracopier-0.3/resources/filter.png b/plugins/CopyEngine/Ultracopier-0.3/resources/filter.png deleted file mode 100644 index 9cabc5a..0000000 Binary files a/plugins/CopyEngine/Ultracopier-0.3/resources/filter.png and /dev/null differ diff --git a/plugins/CopyEngine/Ultracopier-0.3/resources/remove.png b/plugins/CopyEngine/Ultracopier-0.3/resources/remove.png deleted file mode 100644 index 5b4c488..0000000 Binary files a/plugins/CopyEngine/Ultracopier-0.3/resources/remove.png and /dev/null differ diff --git a/plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.cpp b/plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.cpp deleted file mode 100644 index e40e941..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.cpp +++ /dev/null @@ -1,460 +0,0 @@ -#include "scanFileOrFolder.h" - -#include - -scanFileOrFolder::scanFileOrFolder(CopyMode mode) -{ - stopped = true; - stopIt = false; - this->mode=mode; - setObjectName("ScanFileOrFolder"); - folder_isolation=QRegExp("^(.*/)?([^/]+)/$"); -} - -scanFileOrFolder::~scanFileOrFolder() -{ - stop(); - quit(); - wait(); -} - -bool scanFileOrFolder::isFinished() -{ - return stopped; -} - -void scanFileOrFolder::addToList(const QStringList& sources,const QString& destination) -{ - stopIt=false; - this->sources=parseWildcardSources(sources); - this->destination=destination; - if(sources.size()>1 || QFileInfo(destination).isDir()) - /* Disabled because the separator transformation product bug - * if(!destination.endsWith(QDir::separator())) - this->destination+=QDir::separator();*/ - if(!destination.endsWith("/") && !destination.endsWith("\\")) - this->destination+="/";//put unix separator because it's transformed into that's under windows too - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"addToList("+sources.join(";")+","+destination+")"); -} - - -QStringList scanFileOrFolder::parseWildcardSources(const QStringList &sources) -{ - QRegExp splitFolder("[/\\\\]"); - QStringList returnList; - int index=0; - while(index recomposedSource; - recomposedSource << (QStringList() << ""); - while(toParse.size()>0) - { - if(toParse.first().contains('*')) - { - QString toParseFirst=toParse.first(); - if(toParseFirst=="") - toParseFirst+="/"; - QList newRecomposedSource; - QRegExp toResolv=QRegExp(toParseFirst.replace('*',"[^/\\\\]*")); - int index_recomposedSource=0; - while(index_recomposedSource include,QList exclude) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QMutexLocker lock(&filtersMutex); - this->include_send=include; - this->exclude_send=exclude; - reloadTheNewFilters=true; - haveFilters=include_send.size()>0 || exclude_send.size()>0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("haveFilters: %1, include_send.size(): %2, exclude_send.size(): %3").arg(haveFilters).arg(include_send.size()).arg(exclude_send.size())); -} - -//set action if Folder are same or exists -void scanFileOrFolder::setFolderExistsAction(FolderExistsAction action,QString newName) -{ - this->newName=newName; - folderExistsAction=action; - waitOneAction.release(); -} - -//set action if error -void scanFileOrFolder::setFolderErrorAction(FileErrorAction action) -{ - fileErrorAction=action; - waitOneAction.release(); -} - -void scanFileOrFolder::stop() -{ - stopIt=true; - waitOneAction.release(); -} - -void scanFileOrFolder::run() -{ - stopped=false; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start the listing with destination: "+destination+", mode: "+QString::number(mode)); - QDir destinationFolder(destination); - int sourceIndex=0; - while(sourceIndexinclude=this->include_send; - this->exclude=this->exclude_send; - } - QString fileName=fileInfo.fileName(); - if(fileInfo.isDir()) - { - bool excluded=false,included=(include.size()==0); - int filters_index=0; - while(filters_indexcheckDestinationExists=checkDestinationFolderExists; -} - -void scanFileOrFolder::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) -{ - this->firstRenamingRule=firstRenamingRule; - this->otherRenamingRule=otherRenamingRule; -} diff --git a/plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.h b/plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.h deleted file mode 100644 index 787d8af..0000000 --- a/plugins/CopyEngine/Ultracopier-0.3/scanFileOrFolder.h +++ /dev/null @@ -1,87 +0,0 @@ -/** \file scanFileOrFolder.h -\brief Thread changed to list recursively the folder -\author alpha_one_x86 -\version 0.3 -\date 2011 */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Environment.h" - -#ifndef SCANFILEORFOLDER_H -#define SCANFILEORFOLDER_H - -/// \brief Thread changed to list recursively the folder -class scanFileOrFolder : public QThread -{ - Q_OBJECT -public: - explicit scanFileOrFolder(CopyMode mode); - ~scanFileOrFolder(); - /// \brief to the a folder listing - void stop(); - /// \brief to get if is finished - bool isFinished(); - /// \brief set action if Folder are same or exists - void setFolderExistsAction(FolderExistsAction action,QString newName=""); - /// \brief set action if error - void setFolderErrorAction(FileErrorAction action); - /// \brief set if need check if the destination exists - void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); - void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); -signals: - void fileTransfer(const QFileInfo &source,const QFileInfo &destination,const CopyMode &mode); - /// \brief To debug source - void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); - void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); - void errorOnFolder(const QFileInfo &fileInfo,const QString &errorString); - void finishedTheListing(); - - void newFolderListing(const QString &path); - void addToMkPath(const QString& folder); - void addToRmPath(const QString& folder,const int& inodeToRemove); -public slots: - void addToList(const QStringList& sources,const QString& destination); - void setFilters(QList include,QList exclude); -protected: - void run(); -private: - QStringList sources; - QString destination; - volatile bool stopIt; - void listFolder(const QString& source,const QString& destination,const QString& sourceSuffixPath,QString destinationSuffixPath); - volatile bool stopped; - QSemaphore waitOneAction; - FolderExistsAction folderExistsAction; - FileErrorAction fileErrorAction; - volatile bool checkDestinationExists; - QString newName; - QRegExp folder_isolation; - QString prefix; - QString suffix; - CopyMode mode; - QList include,exclude; - QList include_send,exclude_send; - bool reloadTheNewFilters; - bool haveFilters; - QMutex filtersMutex; - QString firstRenamingRule; - QString otherRenamingRule; - /** Parse the multiple wildcard source, it allow resolv multiple wildcard with Qt into their path - * The string: /toto/f*a/yy*a/toto.mp3 - * Will give: /toto/f1a/yy*a/toto.mp3, /toto/f2a/yy*a/toto.mp3 - * Will give: /toto/f2a/yy1a/toto.mp3, /toto/f2a/yy2a/toto.mp3 - */ - QStringList parseWildcardSources(const QStringList &sources); -}; - -#endif // SCANFILEORFOLDER_H diff --git a/plugins/CopyEngine/Ultracopier/AvancedQFile.cpp b/plugins/CopyEngine/Ultracopier/AvancedQFile.cpp new file mode 100644 index 0000000..3d867fb --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/AvancedQFile.cpp @@ -0,0 +1,208 @@ +/** \file AvancedQFile.cpp +\brief Define the QFile herited class to set file date/time +\author alpha_one_x86 */ + +#include "AvancedQFile.h" + +#ifdef Q_CC_GNU +//this next header is needed to change file time/date under gcc +#include +#include +#endif + +//source +//hSrc=CreateFile(pData->pfiSrcFile->GetFullFilePath(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); +//destination +//hDst=CreateFile(pData->strDstFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); + +bool AvancedQFile::setCreated(const QDateTime &time) +{ + time_t ctime=time.toTime_t(); + #ifdef Q_CC_GNU + //creation time not exists into unix world + Q_UNUSED(ctime) + return true; + #else + setErrorString(tr("Not supported on this platform")); + return false; + #endif +} + +bool AvancedQFile::setLastModified(const QDateTime &time) +{ + time_t actime=QFileInfo(*this).lastRead().toTime_t(); + //protect to wrong actime + if(actime<0) + actime=0; + time_t modtime=time.toTime_t(); + if(modtime<0) + { + setErrorString(tr("Last modified date is wrong")); + return false; + } + #ifdef Q_CC_GNU + //this function avalaible on unix and mingw + utimbuf butime; + butime.actime=actime; + butime.modtime=modtime; + int returnVal=utime(this->fileName().toLocal8Bit().data(),&butime); + if(returnVal==0) + return true; + else + { + setErrorString(strerror(errno)); + return false; + } + #else + setErrorString(tr("Not supported on this platform")); + return false; + #endif +} + +bool AvancedQFile::setLastRead(const QDateTime &time) +{ + time_t modtime=QFileInfo(*this).lastModified().toTime_t(); + //protect to wrong actime + if(modtime<0) + modtime=0; + time_t actime=time.toTime_t(); + if(actime<0) + { + setErrorString(tr("Last access date is wrong")); + return false; + } + #ifdef Q_CC_GNU + //this function avalaible on unix and mingw + utimbuf butime; + butime.actime=actime; + butime.modtime=modtime; + int returnVal=utime(this->fileName().toLocal8Bit().data(),&butime); + if(returnVal==0) + return true; + else + { + setErrorString(strerror(errno)); + return false; + } + #else + setErrorString(tr("Not supported on this platform")); + return false; + #endif +} + +#ifdef ULTRACOPIER_OVERLAPPED_FILE +AvancedQFile::avancedQFile() +{ + handle=INVALID_HANDLE_VALUE; + fileError=QFileDevice::NoError; + fileErrorString.clear(); +} + +AvancedQFile::~avancedQFile() +{ + close(); +} + +QString AvancedQFile::getLastWindowsError() +{ + WCHAR ErrorStringW[65535]; + DWORD dw = GetLastError(); + + int size=FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + ErrorStringW, + 0, NULL ); + if(size<0) + tr("Unknown error: %1").arg(dw); + return QString::fromWCharArray(ErrorStringW,size); +} + +bool AvancedQFile::open(OpenMode mode) +{ + fileError=QFileDevice::NoError; + fileErrorString.clear(); + WCHAR fileNameW[fileName().size()+1]; + if(QDir::toNativeSeparators("\\\\?\\"+fileName()).toWCharArray(fileNameW)!=fileName().size()) + { + fileError=QFileDevice::OpenError; + fileErrorString=tr("Path conversion error"); + return false; + } + fileNameW[fileName().size()]='\0'; + + DWORD dwDesiredAccess=0; + if(mode & QIODevice::ReadOnly) + dwDesiredAccess|=GENERIC_READ; + if(mode & QIODevice::WriteOnly) + dwDesiredAccess|=GENERIC_Write; + + DWORD dwCreationDisposition; + if(mode & QIODevice::WriteOnly) + dwCreationDisposition=CREATE_ALWAYS; + else + dwCreationDisposition=OPEN_EXISTING; + + handle=CreateFile( + fileNameW, + dwDesiredAccess, + 0, + 0, + dwCreationDisposition, + FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN, + 0 + ); + if(handle==INVALID_HANDLE_VALUE) + { + fileError=QFileDevice::OpenError; + fileErrorString=getLastWindowsError(); + } + return (handle!=INVALID_HANDLE_VALUE); +} + +void AvancedQFile::close() +{ + if(handle==INVALID_HANDLE_VALUE) + return; + CloseHandle(handle); +} + +bool AvancedQFile::seek(qint64 pos) +{ + toto +} + +bool AvancedQFile::resize(qint64 size) +{ + toto +} + +QString AvancedQFile::errorString() const +{ + if(fileErrorString.isEmpty()) + return tr("Unknown error"); + return fileErrorString; +} + +bool AvancedQFile::isOpen() const +{ + return (handle!=INVALID_HANDLE_VALUE); +} + +qint64 AvancedQFile::write(const QByteArray &data) +{ +} + +QByteArray AvancedQFile::read(qint64 maxlen) +{ +} + +QFileDevice::FileError AvancedQFile::error() const +{ + return fileError; +} +#endif diff --git a/plugins/CopyEngine/Ultracopier/AvancedQFile.h b/plugins/CopyEngine/Ultracopier/AvancedQFile.h new file mode 100644 index 0000000..8c3dc4a --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/AvancedQFile.h @@ -0,0 +1,45 @@ +/** \file AvancedQFile.h +\brief Define the QFile herited class to set file date/time +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef AVANCEDQFILE_H +#define AVANCEDQFILE_H + +#include +#include +#include + +/// \brief devired class from QFile to set time/date on file +class AvancedQFile : public QFile +{ + Q_OBJECT +public: + /// \brief set created date, not exists in unix world + bool setCreated(const QDateTime &time); + /// \brief set last modification date + bool setLastModified(const QDateTime &time); + /// \brief set last read date + bool setLastRead(const QDateTime &time); + + #ifdef ULTRACOPIER_OVERLAPPED_FILE + explicit AvancedQFile(); + ~AvancedQFile(); + bool open(OpenMode mode); + void close(); + bool seek(qint64 pos); + bool resize(qint64 size); + QString errorString() const; + bool isOpen() const; + qint64 write(const QByteArray &data); + QByteArray read(qint64 maxlen); + FileError error() const; + QString getLastWindowsError(); +private: + HANDLE handle; + FileError fileError; + QString fileErrorString; + #endif +}; + +#endif // AVANCEDQFILE_H diff --git a/plugins/CopyEngine/Ultracopier/CompilerInfo.h b/plugins/CopyEngine/Ultracopier/CompilerInfo.h new file mode 100644 index 0000000..84625b9 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CompilerInfo.h @@ -0,0 +1 @@ +#include "../../../CompilerInfo.h" diff --git a/plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp b/plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp new file mode 100644 index 0000000..5315c84 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp @@ -0,0 +1,567 @@ +/** \file copyEngine.cpp +\brief Define the copy engine +\author alpha_one_x86 */ + +#include "CopyEngine.h" +#include "FolderExistsDialog.h" +#include "DiskSpace.h" + +//dialog message +/// \note Can be call without queue because all call will be serialized +void CopyEngine::fileAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread) +{ + fileAlreadyExists(source,destination,isSame,thread); +} + +/// \note Can be call without queue because all call will be serialized +void CopyEngine::errorOnFileSlot(QFileInfo fileInfo,QString errorString,TransferThread * thread,const ErrorType &errorType) +{ + errorOnFile(fileInfo,errorString,thread,errorType); +} + +/// \note Can be call without queue because all call will be serialized +void CopyEngine::folderAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,ScanFileOrFolder * thread) +{ + folderAlreadyExists(source,destination,isSame,thread); +} + +/// \note Can be call without queue because all call will be serialized +void CopyEngine::errorOnFolderSlot(QFileInfo fileInfo,QString errorString,ScanFileOrFolder * thread,ErrorType errorType) +{ + errorOnFolder(fileInfo,errorString,thread,errorType); +} + +//mkpath event +void CopyEngine::mkPathErrorOnFolderSlot(QFileInfo folder,QString error,ErrorType errorType) +{ + mkPathErrorOnFolder(folder,error,errorType); +} + +/// \note Can be call without queue because all call will be serialized +void CopyEngine::fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the action + if(isSame) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file is same: "+source.absoluteFilePath()); + FileExistsAction tempFileExistsAction=alwaysDoThisActionForFileExists; + if(tempFileExistsAction==FileExists_Overwrite || tempFileExistsAction==FileExists_OverwriteIfNewer || tempFileExistsAction==FileExists_OverwriteIfNotSame || tempFileExistsAction==FileExists_OverwriteIfOlder) + tempFileExistsAction=FileExists_NotSet; + switch(tempFileExistsAction) + { + case FileExists_Skip: + case FileExists_Rename: + thread->setFileExistsAction(tempFileExistsAction); + break; + default: + if(dialogIsOpen) + { + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=thread; + newItem.scan=NULL; + alreadyExistsQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + FileIsSameDialog dialog(interface,source,firstRenamingRule,otherRenamingRule); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + FileExistsAction newAction=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileExists_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) + { + alwaysDoThisActionForFileExists=newAction; + listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + if(uiIsInstalled) + switch(newAction) + { + default: + case FileExists_Skip: + ui->comboBoxFileCollision->setCurrentIndex(1); + break; + case FileExists_Rename: + ui->comboBoxFileCollision->setCurrentIndex(6); + break; + } + } + if(dialog.getAlways() || newAction!=FileExists_Rename) + thread->setFileExistsAction(newAction); + else + thread->setFileRename(dialog.getNewName()); + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); + FileExistsAction tempFileExistsAction=alwaysDoThisActionForFileExists; + switch(tempFileExistsAction) + { + case FileExists_Skip: + case FileExists_Rename: + case FileExists_Overwrite: + case FileExists_OverwriteIfNewer: + case FileExists_OverwriteIfOlder: + case FileExists_OverwriteIfNotSame: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"always do this action: "+QString::number(tempFileExistsAction)); + thread->setFileExistsAction(tempFileExistsAction); + break; + default: + if(dialogIsOpen) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("dialog open, put in queue: %1 %2") + .arg(source.absoluteFilePath()) + .arg(destination.absoluteFilePath()) + ); + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=thread; + newItem.scan=NULL; + alreadyExistsQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + FileExistsDialog dialog(interface,source,destination,firstRenamingRule,otherRenamingRule); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + FileExistsAction newAction=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileExists_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) + { + alwaysDoThisActionForFileExists=newAction; + listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + if(uiIsInstalled) + switch(newAction) + { + default: + case FileExists_Skip: + ui->comboBoxFileCollision->setCurrentIndex(1); + break; + case FileExists_Rename: + ui->comboBoxFileCollision->setCurrentIndex(6); + break; + case FileExists_Overwrite: + ui->comboBoxFileCollision->setCurrentIndex(2); + break; + case FileExists_OverwriteIfNotSame: + ui->comboBoxFileCollision->setCurrentIndex(3); + break; + case FileExists_OverwriteIfNewer: + ui->comboBoxFileCollision->setCurrentIndex(4); + break; + case FileExists_OverwriteIfOlder: + ui->comboBoxFileCollision->setCurrentIndex(5); + break; + } + } + if(dialog.getAlways() || newAction!=FileExists_Rename) + thread->setFileExistsAction(newAction); + else + thread->setFileRename(dialog.getNewName()); + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"emit queryOneNewDialog()"); + emit queryOneNewDialog(); + } + return; + break; + } + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +void CopyEngine::haveNeedPutAtBottom(bool needPutAtBottom, const QFileInfo &fileInfo, const QString &errorString,TransferThread *thread,const ErrorType &errorType) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(!needPutAtBottom) + { + alwaysDoThisActionForFileError=FileError_NotSet; + if(uiIsInstalled) + ui->comboBoxFileError->setCurrentIndex(0); + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=fileInfo; + newItem.mkPath=false; + newItem.rmPath=false; + newItem.scan=NULL; + newItem.transfer=thread; + newItem.errorType=errorType; + errorQueue << newItem; + showOneNewDialog(); + } +} + +void CopyEngine::missingDiskSpace(QList list) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + DiskSpace dialog(facilityEngine,list,interface); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + bool ok=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"cancel: "+QString::number(ok)); + if(!ok) + emit cancelAll(); + else + listThread->autoStartIfNeeded(); +} + +/// \note Can be call without queue because all call will be serialized +void CopyEngine::errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,const ErrorType &errorType,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the action + FileErrorAction tempFileErrorAction=alwaysDoThisActionForFileError; + switch(tempFileErrorAction) + { + case FileError_Skip: + thread->skip(); + return; + case FileError_Retry: + thread->retryAfterError(); + return; + case FileError_PutToEndOfTheList: + emit getNeedPutAtBottom(fileInfo,errorString,thread,errorType); + return; + case FileError_Cancel: + return; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=fileInfo; + newItem.mkPath=false; + newItem.rmPath=false; + newItem.scan=NULL; + newItem.transfer=thread; + newItem.errorType=errorType; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); + FileErrorDialog dialog(interface,fileInfo,errorString,errorType); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + { + alwaysDoThisActionForFileError=newAction; + if(uiIsInstalled) + switch(newAction) + { + default: + case FileError_Skip: + ui->comboBoxFileError->setCurrentIndex(1); + break; + case FileError_PutToEndOfTheList: + ui->comboBoxFileError->setCurrentIndex(2); + break; + } + } + switch(newAction) + { + case FileError_Skip: + thread->skip(); + break; + case FileError_Retry: + thread->retryAfterError(); + break; + case FileError_PutToEndOfTheList: + thread->putAtBottom(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"file error action wrong"); + break; + } + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"isCalledByShowOneNewDialog==true then not show other dial"); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +/// \note Can be call without queue because all call will be serialized +void CopyEngine::folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,ScanFileOrFolder * thread,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"folder already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the always action + FolderExistsAction tempFolderExistsAction=alwaysDoThisActionForFolderExists; + switch(tempFolderExistsAction) + { + case FolderExists_Skip: + case FolderExists_Rename: + case FolderExists_Merge: + thread->setFolderExistsAction(tempFolderExistsAction); + break; + default: + if(dialogIsOpen) + { + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=NULL; + newItem.scan=thread; + alreadyExistsQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + FolderExistsDialog dialog(interface,source,isSame,destination,firstRenamingRule,otherRenamingRule); + dialog.exec();/// \bug crash when external close + FolderExistsAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FolderExists_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFolderExists) + setComboBoxFolderCollision(newAction); + if(!dialog.getAlways() && newAction==FolderExists_Rename) + thread->setFolderExistsAction(newAction,dialog.getNewName()); + else + thread->setFolderExistsAction(newAction); + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } +} + +/// \note Can be call without queue because all call will be serialized +/// \todo all this part +void CopyEngine::errorOnFolder(QFileInfo fileInfo, QString errorString, ScanFileOrFolder * thread, ErrorType errorType, bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the always action + FileErrorAction tempFileErrorAction=alwaysDoThisActionForFolderError; + switch(tempFileErrorAction) + { + case FileError_Skip: + case FileError_Retry: + case FileError_PutToEndOfTheList: + thread->setFolderErrorAction(tempFileErrorAction); + break; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=fileInfo; + newItem.mkPath=false; + newItem.rmPath=false; + newItem.scan=thread; + newItem.transfer=NULL; + newItem.errorType=errorType; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); + FileErrorDialog dialog(interface,fileInfo,errorString,errorType); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + { + setComboBoxFolderError(newAction); + alwaysDoThisActionForFolderError=newAction; + } + dialogIsOpen=false; + thread->setFolderErrorAction(newAction); + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +// ----------------------------------------------------- + +//mkpath event +void CopyEngine::mkPathErrorOnFolder(QFileInfo folder,QString errorString,const ErrorType &errorType,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); + //load the always action + FileErrorAction tempFileErrorAction=alwaysDoThisActionForFolderError; + switch(tempFileErrorAction) + { + case FileError_Skip: + listThread->mkPathQueue.skip(); + return; + case FileError_Retry: + listThread->mkPathQueue.retry(); + return; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=folder; + newItem.mkPath=true; + newItem.rmPath=false; + newItem.scan=NULL; + newItem.transfer=NULL; + newItem.errorType=errorType; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); + FileErrorDialog dialog(interface,folder,errorString,errorType); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + { + setComboBoxFolderError(newAction); + alwaysDoThisActionForFolderError=newAction; + } + dialogIsOpen=false; + switch(newAction) + { + case FileError_Skip: + listThread->mkPathQueue.skip(); + break; + case FileError_Retry: + listThread->mkPathQueue.retry(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); + break; + } + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +//show one new dialog if needed +void CopyEngine::showOneNewDialog() +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"alreadyExistsQueue.size(): "+QString::number(alreadyExistsQueue.size())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"errorQueue.size(): "+QString::number(errorQueue.size())); + int loop_size=alreadyExistsQueue.size(); + while(loop_size>0) + { + if(alreadyExistsQueue.first().transfer!=NULL) + { + fileAlreadyExists(alreadyExistsQueue.first().source, + alreadyExistsQueue.first().destination, + alreadyExistsQueue.first().isSame, + alreadyExistsQueue.first().transfer, + true); + } + else if(alreadyExistsQueue.first().scan!=NULL) + folderAlreadyExists(alreadyExistsQueue.first().source, + alreadyExistsQueue.first().destination, + alreadyExistsQueue.first().isSame, + alreadyExistsQueue.first().scan, + true); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"bug, no thread actived"); + alreadyExistsQueue.removeFirst(); + loop_size--; + } + loop_size=errorQueue.size(); + while(errorQueue.size()>0 && loop_size>0) + { + if(errorQueue.first().transfer!=NULL) + errorOnFile(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().transfer,errorQueue.first().errorType,true); + else if(errorQueue.first().scan!=NULL) + errorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().scan,errorQueue.first().errorType,true); + else if(errorQueue.first().mkPath) + mkPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().errorType,true); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"bug, no thread actived"); + errorQueue.removeFirst(); + loop_size--; + } +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngine.cpp b/plugins/CopyEngine/Ultracopier/CopyEngine.cpp new file mode 100644 index 0000000..f9e16f4 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine.cpp @@ -0,0 +1,1238 @@ +/** \file copyEngine.cpp +\brief Define the copy engine +\author alpha_one_x86 */ + +#include +#include +#include + +#include "CopyEngine.h" +#include "FolderExistsDialog.h" +#include "../../../interface/PluginInterface_CopyEngine.h" + +// The cmath header from MSVC does not contain round() +#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER) +inline double round(double d) { + return floor( d + 0.5 ); +} +#endif + +CopyEngine::CopyEngine(FacilityInterface * facilityEngine) : + ui(new Ui::copyEngineOptions()) +{ + listThread=new ListThread(facilityEngine); + this->facilityEngine = facilityEngine; + filters = NULL; + renamingRules = NULL; + + blockSize = ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE; + sequentialBuffer = ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*ULTRACOPIER_PLUGIN_DEFAULT_SEQUENTIAL_NUMBER_OF_BLOCK; + parallelBuffer = ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK; + interface = NULL; + tempWidget = NULL; + uiIsInstalled = false; + dialogIsOpen = false; + renameTheOriginalDestination = false; + maxSpeed = 0; + alwaysDoThisActionForFileExists = FileExists_NotSet; + alwaysDoThisActionForFileError = FileError_NotSet; + checkDestinationFolderExists = false; + stopIt = false; + size_for_speed = 0; + putAtBottom = 0; + forcedMode = false; + followTheStrictOrder = false; + deletePartiallyTransferredFiles = true; + inodeThreads = 16; + moveTheWholeFolder = true; + + //implement the SingleShot in this class + //timerActionDone.setSingleShot(true); + timerActionDone.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST); + //timerProgression.setSingleShot(true); + timerProgression.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION); + + timerUpdateMount.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_MOUNT_MS); +} + +CopyEngine::~CopyEngine() +{ + /*if(filters!=NULL) + delete filters; + if(renamingRules!=NULL) + delete renamingRules; + destroyed by the widget parent, here the interface + */ + stopIt=true; + delete listThread; + delete ui; +} + +void CopyEngine::connectTheSignalsSlots() +{ + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + debugDialogWindow.show(); + #endif + if(!connect(listThread,&ListThread::actionInProgess, this,&CopyEngine::actionInProgess, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect actionInProgess()"); + if(!connect(listThread,&ListThread::actionInProgess, this,&CopyEngine::newActionInProgess, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect actionInProgess() to slot"); + if(!connect(listThread,&ListThread::newFolderListing, this,&CopyEngine::newFolderListing, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect newFolderListing()"); + if(!connect(listThread,&ListThread::isInPause, this,&CopyEngine::isInPause, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect isInPause()"); + if(!connect(listThread,&ListThread::error, this,&CopyEngine::error, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect error()"); + if(!connect(listThread,&ListThread::rmPath, this,&CopyEngine::rmPath, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect rmPath()"); + if(!connect(listThread,&ListThread::mkPath, this,&CopyEngine::mkPath, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect mkPath()"); + if(!connect(listThread,&ListThread::newActionOnList, this,&CopyEngine::newActionOnList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect newActionOnList()"); + if(!connect(listThread,&ListThread::doneTime, this,&CopyEngine::doneTime, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect doneTime()"); + if(!connect(listThread,&ListThread::pushFileProgression, this,&CopyEngine::pushFileProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect pushFileProgression()"); + if(!connect(listThread,&ListThread::pushGeneralProgression, this,&CopyEngine::pushGeneralProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect pushGeneralProgression()"); + if(!connect(listThread,&ListThread::syncReady, this,&CopyEngine::syncReady, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect syncReady()"); + if(!connect(listThread,&ListThread::canBeDeleted, this,&CopyEngine::canBeDeleted, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect canBeDeleted()"); + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + if(!connect(listThread,&ListThread::debugInformation, this,&CopyEngine::debugInformation, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect debugInformation()"); + #endif + + if(!connect(listThread,&ListThread::send_fileAlreadyExists, this,&CopyEngine::fileAlreadyExistsSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_fileAlreadyExists()"); + if(!connect(listThread,&ListThread::send_errorOnFile, this,&CopyEngine::errorOnFileSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_errorOnFile()"); + if(!connect(listThread,&ListThread::send_folderAlreadyExists, this,&CopyEngine::folderAlreadyExistsSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_folderAlreadyExists()"); + if(!connect(listThread,&ListThread::send_errorOnFolder, this,&CopyEngine::errorOnFolderSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_errorOnFolder()"); + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + if(!connect(listThread,&ListThread::updateTheDebugInfo, this,&CopyEngine::updateTheDebugInfo, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect updateTheDebugInfo()"); + #endif + if(!connect(listThread,&ListThread::errorTransferList, this,&CopyEngine::errorTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect errorTransferList()"); + if(!connect(listThread,&ListThread::warningTransferList, this,&CopyEngine::warningTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect warningTransferList()"); + if(!connect(listThread,&ListThread::mkPathErrorOnFolder, this,&CopyEngine::mkPathErrorOnFolderSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect mkPathErrorOnFolder()"); + if(!connect(listThread,&ListThread::send_realBytesTransfered, this,&CopyEngine::get_realBytesTransfered, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_realBytesTransfered()"); + + if(!connect(this,&CopyEngine::tryCancel, listThread,&ListThread::cancel, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect tryCancel()"); + if(!connect(this,&CopyEngine::getNeedPutAtBottom, listThread,&ListThread::getNeedPutAtBottom, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect getNeedPutAtBottom()"); + if(!connect(listThread,&ListThread::haveNeedPutAtBottom, this,&CopyEngine::haveNeedPutAtBottom, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect haveNeedPutAtBottom()"); + + + if(!connect(this,&CopyEngine::signal_pause, listThread,&ListThread::pause, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_pause()"); + if(!connect(this,&CopyEngine::signal_exportErrorIntoTransferList,listThread,&ListThread::exportErrorIntoTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_exportErrorIntoTransferList()"); + if(!connect(this,&CopyEngine::signal_resume, listThread,&ListThread::resume, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_resume()"); + if(!connect(this,&CopyEngine::signal_skip, listThread,&ListThread::skip, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_skip()"); + if(!connect(this,&CopyEngine::signal_setCollisionAction, listThread,&ListThread::setAlwaysFileExistsAction, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_setCollisionAction()"); + if(!connect(this,&CopyEngine::signal_setTransferAlgorithm, listThread,&ListThread::setTransferAlgorithm, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_setCollisionAction()"); + if(!connect(this,&CopyEngine::signal_setFolderCollision, listThread,&ListThread::setFolderCollision, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_setFolderCollision()"); + if(!connect(this,&CopyEngine::signal_removeItems, listThread,&ListThread::removeItems, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_removeItems()"); + if(!connect(this,&CopyEngine::signal_moveItemsOnTop, listThread,&ListThread::moveItemsOnTop, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsOnTop()"); + if(!connect(this,&CopyEngine::signal_moveItemsUp, listThread,&ListThread::moveItemsUp, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsUp()"); + if(!connect(this,&CopyEngine::signal_moveItemsDown, listThread,&ListThread::moveItemsDown, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsDown()"); + if(!connect(this,&CopyEngine::signal_moveItemsOnBottom, listThread,&ListThread::moveItemsOnBottom, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsOnBottom()"); + if(!connect(this,&CopyEngine::signal_exportTransferList, listThread,&ListThread::exportTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_exportTransferList()"); + if(!connect(this,&CopyEngine::signal_importTransferList, listThread,&ListThread::importTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_importTransferList()"); + if(!connect(this,&CopyEngine::signal_forceMode, listThread,&ListThread::forceMode, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_forceMode()"); + if(!connect(this,&CopyEngine::send_osBufferLimit, listThread,&ListThread::set_osBufferLimit, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_osBufferLimit()"); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + if(!connect(this,&CopyEngine::send_speedLimitation, listThread,&ListThread::setSpeedLimitation, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_speedLimitation()"); + #endif + if(!connect(this,&CopyEngine::send_blockSize, listThread,&ListThread::setBlockSize, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_blockSize()"); + if(!connect(this,&CopyEngine::send_parallelBuffer, listThread,&ListThread::setParallelBuffer, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect setParallelBuffer()"); + if(!connect(this,&CopyEngine::send_sequentialBuffer, listThread,&ListThread::setSequentialBuffer, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect setSequentialBuffer()"); + if(!connect(this,&CopyEngine::send_parallelizeIfSmallerThan, listThread,&ListThread::setParallelizeIfSmallerThan, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect setParallelizeIfSmallerThan()"); + if(!connect(this,&CopyEngine::send_moveTheWholeFolder, listThread,&ListThread::setMoveTheWholeFolder, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect moveTheWholeFolder()"); + if(!connect(this,&CopyEngine::send_deletePartiallyTransferredFiles, listThread,&ListThread::setDeletePartiallyTransferredFiles, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect deletePartiallyTransferredFiles()"); + if(!connect(this,&CopyEngine::send_setRenameTheOriginalDestination, listThread,&ListThread::setRenameTheOriginalDestination, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect setRenameTheOriginalDestination()"); + if(!connect(this,&CopyEngine::send_setInodeThreads, listThread,&ListThread::setInodeThreads, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect setInodeThreads()"); + if(!connect(this,&CopyEngine::send_followTheStrictOrder, listThread,&ListThread::setFollowTheStrictOrder, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect followTheStrictOrder()"); + if(!connect(this,&CopyEngine::send_setFilters,listThread,&ListThread::set_setFilters, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_setFilters()"); + if(!connect(this,&CopyEngine::send_sendNewRenamingRules,listThread,&ListThread::set_sendNewRenamingRules, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_sendNewRenamingRules()"); + if(!connect(&timerActionDone,&QTimer::timeout, listThread,&ListThread::sendActionDone)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect timerActionDone"); + if(!connect(&timerProgression,&QTimer::timeout, listThread,&ListThread::sendProgression)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect timerProgression"); + if(!connect(listThread,&ListThread::missingDiskSpace, this,&CopyEngine::missingDiskSpace,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect timerProgression"); + + if(!connect(this,&CopyEngine::queryOneNewDialog,this,&CopyEngine::showOneNewDialog,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect queryOneNewDialog()"); + if(!connect(listThread,&ListThread::errorToRetry,this,&CopyEngine::errorToRetry,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect errorToRetry()"); + + if(!connect(&timerUpdateMount,&QTimer::timeout,listThread,&ListThread::set_updateMount, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect set_updateMount()"); +} + +#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW +void CopyEngine::updateTheDebugInfo(const QStringList &newList, const QStringList &newList2, const int &numberOfInodeOperation) +{ + debugDialogWindow.setTransferThreadList(newList); + debugDialogWindow.setTransferList(newList2); + debugDialogWindow.setInodeUsage(numberOfInodeOperation); +} +#endif + +//to send the options panel +bool CopyEngine::getOptionsEngine(QWidget * tempWidget) +{ + this->tempWidget=tempWidget; + ui->setupUi(tempWidget); + ui->toolBox->setCurrentIndex(0); + ui->blockSize->setMaximum(ULTRACOPIER_PLUGIN_MAX_BLOCK_SIZE); + connect(tempWidget, &QWidget::destroyed, this, &CopyEngine::resetTempWidget); + //conect the ui widget + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + if(!setSpeedLimitation(maxSpeed)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to set the speed limitation"); + #endif + + //here else, the default settings can't be loaded + uiIsInstalled=true; + + setBlockSize(blockSize); + setSequentialBuffer(sequentialBuffer); + setParallelBuffer(parallelBuffer); + setAutoStart(autoStart); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + setRsync(rsync); + #else + ui->label_rsync->setVisible(false); + ui->rsync->setVisible(false); + #endif + setCheckDestinationFolderExists(checkDestinationFolderExists); + set_doChecksum(doChecksum); + set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); + set_checksumOnlyOnError(checksumOnlyOnError); + set_osBuffer(osBuffer); + set_osBufferLimited(osBufferLimited); + set_osBufferLimit(osBufferLimit); + setRightTransfer(doRightTransfer); + setKeepDate(keepDate); + setParallelizeIfSmallerThan(parallelizeIfSmallerThan); + setFollowTheStrictOrder(followTheStrictOrder); + setDeletePartiallyTransferredFiles(deletePartiallyTransferredFiles); + setInodeThreads(inodeThreads); + setRenameTheOriginalDestination(renameTheOriginalDestination); + setMoveTheWholeFolder(moveTheWholeFolder); + setCheckDiskSpace(checkDiskSpace); + setDefaultDestinationFolder(defaultDestinationFolder); + + switch(alwaysDoThisActionForFileExists) + { + case FileExists_NotSet: + ui->comboBoxFileCollision->setCurrentIndex(0); + break; + case FileExists_Skip: + ui->comboBoxFileCollision->setCurrentIndex(1); + break; + case FileExists_Overwrite: + ui->comboBoxFileCollision->setCurrentIndex(2); + break; + case FileExists_OverwriteIfNotSame: + ui->comboBoxFileCollision->setCurrentIndex(3); + break; + case FileExists_OverwriteIfNewer: + ui->comboBoxFileCollision->setCurrentIndex(4); + break; + case FileExists_OverwriteIfOlder: + ui->comboBoxFileCollision->setCurrentIndex(5); + break; + case FileExists_Rename: + ui->comboBoxFileCollision->setCurrentIndex(6); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + ui->comboBoxFileCollision->setCurrentIndex(0); + break; + } + switch(alwaysDoThisActionForFileError) + { + case FileError_NotSet: + ui->comboBoxFileError->setCurrentIndex(0); + break; + case FileError_Skip: + ui->comboBoxFileError->setCurrentIndex(1); + break; + case FileError_PutToEndOfTheList: + ui->comboBoxFileError->setCurrentIndex(2); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + ui->comboBoxFileError->setCurrentIndex(0); + break; + } + switch(alwaysDoThisActionForFolderExists) + { + case FolderExists_NotSet: + ui->comboBoxFolderCollision->setCurrentIndex(0); + break; + case FolderExists_Merge: + ui->comboBoxFolderCollision->setCurrentIndex(1); + break; + case FolderExists_Skip: + ui->comboBoxFolderCollision->setCurrentIndex(2); + break; + case FolderExists_Rename: + ui->comboBoxFolderCollision->setCurrentIndex(3); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + ui->comboBoxFolderCollision->setCurrentIndex(0); + break; + } + switch(alwaysDoThisActionForFolderError) + { + case FileError_NotSet: + ui->comboBoxFolderError->setCurrentIndex(0); + break; + case FileError_Skip: + ui->comboBoxFolderError->setCurrentIndex(1); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored: "+QString::number(alwaysDoThisActionForFolderError)); + ui->comboBoxFolderError->setCurrentIndex(0); + break; + } + switch(transferAlgorithm) + { + case TransferAlgorithm_Automatic: + ui->transferAlgorithm->setCurrentIndex(0); + break; + case TransferAlgorithm_Sequential: + ui->transferAlgorithm->setCurrentIndex(1); + break; + case TransferAlgorithm_Parallel: + ui->transferAlgorithm->setCurrentIndex(2); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + ui->transferAlgorithm->setCurrentIndex(0); + break; + } + return true; +} + +//to have interface widget to do modal dialog +void CopyEngine::setInterfacePointer(QWidget * interface) +{ + this->interface=interface; + filters=new Filters(tempWidget); + renamingRules=new RenamingRules(tempWidget); + + if(uiIsInstalled) + { + connect(ui->doRightTransfer, &QCheckBox::toggled, this,&CopyEngine::setRightTransfer); + connect(ui->keepDate, &QCheckBox::toggled, this,&CopyEngine::setKeepDate); + connect(ui->blockSize, static_cast(&QSpinBox::valueChanged), this,&CopyEngine::setBlockSize); + connect(ui->autoStart, &QCheckBox::toggled, this,&CopyEngine::setAutoStart); + connect(ui->doChecksum, &QCheckBox::toggled, this,&CopyEngine::doChecksum_toggled); + connect(ui->checksumIgnoreIfImpossible, &QCheckBox::toggled, this,&CopyEngine::checksumIgnoreIfImpossible_toggled); + connect(ui->checksumOnlyOnError, &QCheckBox::toggled, this,&CopyEngine::checksumOnlyOnError_toggled); + connect(ui->osBuffer, &QCheckBox::toggled, this,&CopyEngine::osBuffer_toggled); + connect(ui->osBufferLimited, &QCheckBox::toggled, this,&CopyEngine::osBufferLimited_toggled); + connect(ui->osBufferLimit, &QSpinBox::editingFinished, this,&CopyEngine::osBufferLimit_editingFinished); + connect(ui->moveTheWholeFolder, &QCheckBox::toggled, this,&CopyEngine::setMoveTheWholeFolder); + connect(ui->deletePartiallyTransferredFiles, &QCheckBox::toggled, this,&CopyEngine::setDeletePartiallyTransferredFiles); + connect(ui->followTheStrictOrder, &QCheckBox::toggled, this,&CopyEngine::setFollowTheStrictOrder); + connect(ui->checkBoxDestinationFolderExists, &QCheckBox::toggled, this,&CopyEngine::setCheckDestinationFolderExists); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + connect(ui->rsync, &QCheckBox::toggled, this,&CopyEngine::setRsync); + #endif + connect(ui->renameTheOriginalDestination, &QCheckBox::toggled, this,&CopyEngine::setRenameTheOriginalDestination); + connect(filters, &Filters::haveNewFilters, this,&CopyEngine::sendNewFilters); + connect(ui->filters, &QPushButton::clicked, this,&CopyEngine::showFilterDialog); + connect(ui->inodeThreads, &QSpinBox::editingFinished, this,&CopyEngine::inodeThreadsFinished); + connect(ui->inodeThreads, static_cast(&QSpinBox::valueChanged), this,&CopyEngine::setInodeThreads); + connect(ui->defaultDestinationFolderBrowse, &QPushButton::clicked, this,&CopyEngine::defaultDestinationFolderBrowse); + + connect(ui->sequentialBuffer, static_cast(&QSpinBox::valueChanged), this,&CopyEngine::setSequentialBuffer); + connect(ui->parallelBuffer, static_cast(&QSpinBox::valueChanged), this,&CopyEngine::setParallelBuffer); + connect(ui->parallelizeIfSmallerThan, static_cast(&QSpinBox::valueChanged), this,&CopyEngine::setParallelizeIfSmallerThan); + connect(ui->comboBoxFolderError, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngine::setFolderError); + connect(ui->comboBoxFolderCollision, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngine::setFolderCollision); + connect(ui->comboBoxFileError, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngine::setFileError); + connect(ui->comboBoxFileCollision, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngine::setFileCollision); + connect(ui->transferAlgorithm, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngine::setTransferAlgorithm); + + if(!connect(renamingRules,&RenamingRules::sendNewRenamingRules,this,&CopyEngine::sendNewRenamingRules)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect sendNewRenamingRules()"); + if(!connect(ui->renamingRules,&QPushButton::clicked,this,&CopyEngine::showRenamingRules)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect renamingRules.clicked()"); + } + + filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + set_setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + + renamingRules->setRenamingRules(firstRenamingRule,otherRenamingRule); + emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +bool CopyEngine::haveSameSource(const QStringList &sources) +{ + return listThread->haveSameSource(sources); +} + +bool CopyEngine::haveSameDestination(const QString &destination) +{ + return listThread->haveSameDestination(destination); +} + +bool CopyEngine::newCopy(const QStringList &sources) +{ + if(forcedMode && mode!=Ultracopier::Copy) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); + QMessageBox::critical(NULL,facilityEngine->translateText(QStringLiteral("Internal error")),tr("The engine is forced to move, you can't copy with it")); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QString destination; + if(!defaultDestinationFolder.isEmpty() && QDir(defaultDestinationFolder).exists()) + destination = defaultDestinationFolder; + else + destination = askDestination(); + if(destination.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return false; + } + return listThread->newCopy(sources,destination); +} + +bool CopyEngine::newCopy(const QStringList &sources,const QString &destination) +{ + if(forcedMode && mode!=Ultracopier::Copy) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); + QMessageBox::critical(NULL,facilityEngine->translateText(QStringLiteral("Internal error")),tr("The engine is forced to move, you can't copy with it")); + return false; + } + return listThread->newCopy(sources,destination); +} + +bool CopyEngine::newMove(const QStringList &sources) +{ + if(forcedMode && mode!=Ultracopier::Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); + QMessageBox::critical(NULL,facilityEngine->translateText(QStringLiteral("Internal error")),tr("The engine is forced to copy, you can't move with it")); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QString destination; + if(!ui->defaultDestinationFolder->text().isEmpty() && QDir(ui->defaultDestinationFolder->text()).exists()) + destination = ui->defaultDestinationFolder->text(); + else + destination = askDestination(); + if(destination.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return false; + } + return listThread->newMove(sources,destination); +} + +bool CopyEngine::newMove(const QStringList &sources,const QString &destination) +{ + if(forcedMode && mode!=Ultracopier::Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); + QMessageBox::critical(NULL,facilityEngine->translateText(QStringLiteral("Internal error")),tr("The engine is forced to copy, you can't move with it")); + return false; + } + return listThread->newMove(sources,destination); +} + +void CopyEngine::defaultDestinationFolderBrowse() +{ + QString destination = askDestination(); + if(destination.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(uiIsInstalled) + ui->defaultDestinationFolder->setText(destination); +} + +QString CopyEngine::askDestination() +{ + QString destination = listThread->getUniqueDestinationFolder(); + if(!destination.isEmpty()) + { + QMessageBox::StandardButton button=QMessageBox::question(interface,tr("Destination"),tr("Use the actual destination \"%1\"?").arg(destination),QMessageBox::Yes | QMessageBox::No,QMessageBox::Yes); + if(button==QMessageBox::Yes) + return destination; + } + destination=QFileDialog::getExistingDirectory(interface,facilityEngine->translateText(QStringLiteral("Select destination directory")),QStringLiteral(""),QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + return destination; +} + +void CopyEngine::newTransferList(const QString &file) +{ + emit signal_importTransferList(file); +} + +//because direct access to list thread into the main thread can't be do +quint64 CopyEngine::realByteTransfered() +{ + return size_for_speed; +} + +//speed limitation +bool CopyEngine::supportSpeedLimitation() const +{ + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + return true; + #else + return false; + #endif +} + +/** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ +void CopyEngine::syncTransferList() +{ + listThread->syncTransferList(); +} + +void CopyEngine::set_doChecksum(bool doChecksum) +{ + listThread->set_doChecksum(doChecksum); + if(uiIsInstalled) + { + ui->doChecksum->setChecked(doChecksum); + ui->checksumOnlyOnError->setEnabled(ui->doChecksum->isChecked()); + ui->checksumIgnoreIfImpossible->setEnabled(ui->doChecksum->isChecked()); + } + this->doChecksum=doChecksum; +} + +void CopyEngine::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) +{ + listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); + if(uiIsInstalled) + ui->checksumIgnoreIfImpossible->setChecked(checksumIgnoreIfImpossible); + this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; +} + +void CopyEngine::set_checksumOnlyOnError(bool checksumOnlyOnError) +{ + listThread->set_checksumOnlyOnError(checksumOnlyOnError); + if(uiIsInstalled) + ui->checksumOnlyOnError->setChecked(checksumOnlyOnError); + this->checksumOnlyOnError=checksumOnlyOnError; +} + +void CopyEngine::set_osBuffer(bool osBuffer) +{ + listThread->set_osBuffer(osBuffer); + if(uiIsInstalled) + { + ui->osBuffer->setChecked(osBuffer); + updateBufferCheckbox(); + } + this->osBuffer=osBuffer; +} + +void CopyEngine::set_osBufferLimited(bool osBufferLimited) +{ + listThread->set_osBufferLimited(osBufferLimited); + if(uiIsInstalled) + { + ui->osBufferLimited->setChecked(osBufferLimited); + updateBufferCheckbox(); + } + this->osBufferLimited=osBufferLimited; +} + +void CopyEngine::set_osBufferLimit(unsigned int osBufferLimit) +{ + emit send_osBufferLimit(osBufferLimit); + if(uiIsInstalled) + ui->osBufferLimit->setValue(osBufferLimit); + this->osBufferLimit=osBufferLimit; +} + +void CopyEngine::updateBufferCheckbox() +{ + ui->osBufferLimited->setEnabled(ui->osBuffer->isChecked()); + ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); +} + +void CopyEngine::set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) +{ + if(filters!=NULL) + { + filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + emit send_setFilters(filters->getInclude(),filters->getExclude()); + } + this->includeStrings=includeStrings; + this->includeOptions=includeOptions; + this->excludeStrings=excludeStrings; + this->excludeOptions=excludeOptions; +} + +void CopyEngine::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) +{ + sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +bool CopyEngine::userAddFolder(const Ultracopier::CopyMode &mode) +{ + QString source = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText(QStringLiteral("Select source directory")),QStringLiteral(""),QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if(source.isEmpty() || source.isNull() || source=="") + return false; + if(mode==Ultracopier::Copy) + return newCopy(QStringList() << source); + else + return newMove(QStringList() << source); +} + +bool CopyEngine::userAddFile(const Ultracopier::CopyMode &mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QStringList sources = QFileDialog::getOpenFileNames( + interface, + facilityEngine->translateText(QStringLiteral("Select one or more files to open")), + QStringLiteral(""), + facilityEngine->translateText(QStringLiteral("All files"))+QStringLiteral(" (*)")); + if(sources.isEmpty()) + return false; + if(mode==Ultracopier::Copy) + return newCopy(sources); + else + return newMove(sources); +} + +void CopyEngine::pause() +{ + emit signal_pause(); +} + +void CopyEngine::resume() +{ + emit signal_resume(); +} + +void CopyEngine::skip(const quint64 &id) +{ + emit signal_skip(id); +} + +void CopyEngine::cancel() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + stopIt=true; + timerProgression.stop(); + timerActionDone.stop(); + emit tryCancel(); +} + +void CopyEngine::removeItems(const QList &ids) +{ + emit signal_removeItems(ids); +} + +void CopyEngine::moveItemsOnTop(const QList &ids) +{ + emit signal_moveItemsOnTop(ids); +} + +void CopyEngine::moveItemsUp(const QList &ids) +{ + emit signal_moveItemsUp(ids); +} + +void CopyEngine::moveItemsDown(const QList &ids) +{ + emit signal_moveItemsDown(ids); +} + +void CopyEngine::moveItemsOnBottom(const QList &ids) +{ + emit signal_moveItemsOnBottom(ids); +} + +/** \brief give the forced mode, to export/import transfer list */ +void CopyEngine::forceMode(const Ultracopier::CopyMode &mode) +{ + #ifdef ULTRACOPIER_PLUGIN_RSYNC + if(mode==Ultracopier::Move) + { + listThread->setRsync(false); + rsync=false; + } + if(uiIsInstalled) + ui->rsync->setEnabled(mode==Ultracopier::Copy); + #endif + if(forcedMode) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Mode forced previously")); + QMessageBox::critical(NULL,facilityEngine->translateText(QStringLiteral("Internal error")),tr("The mode has been forced previously. This is an internal error, please report it")); + return; + } + #ifdef ULTRACOPIER_PLUGIN_RSYNC + if(mode==Ultracopier::Move) + rsync=false; + #endif + if(mode==Ultracopier::Copy) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Force mode to copy")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Force mode to move")); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + if(uiIsInstalled) + ui->rsync->setEnabled(mode==Ultracopier::Copy); + #endif + this->mode=mode; + forcedMode=true; + emit signal_forceMode(mode); +} + +void CopyEngine::exportTransferList() +{ + QString fileName = QFileDialog::getSaveFileName(interface,facilityEngine->translateText(QStringLiteral("Save transfer list")),QStringLiteral("transfer-list.lst"),facilityEngine->translateText(QStringLiteral("Transfer list"))+QStringLiteral(" (*.lst)")); + if(fileName.isEmpty()) + return; + emit signal_exportTransferList(fileName); +} + +void CopyEngine::importTransferList() +{ + QString fileName = QFileDialog::getOpenFileName(interface,facilityEngine->translateText(QStringLiteral("Open transfer list")),QStringLiteral("transfer-list.lst"),facilityEngine->translateText(QStringLiteral("Transfer list"))+QStringLiteral(" (*.lst)")); + if(fileName.isEmpty()) + return; + emit signal_importTransferList(fileName); +} + +void CopyEngine::warningTransferList(const QString &warning) +{ + QMessageBox::warning(interface,facilityEngine->translateText(QStringLiteral("Error")),warning); +} + +void CopyEngine::errorTransferList(const QString &error) +{ + QMessageBox::critical(interface,facilityEngine->translateText(QStringLiteral("Error")),error); +} + +bool CopyEngine::setSpeedLimitation(const qint64 &speedLimitation) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"maxSpeed: "+QString::number(speedLimitation)); + maxSpeed=speedLimitation; + emit send_speedLimitation(speedLimitation); + return true; +} + +void CopyEngine::setFileCollision(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action index: %1").arg(index)); + if(uiIsInstalled) + if(index!=ui->comboBoxFileCollision->currentIndex()) + ui->comboBoxFileCollision->setCurrentIndex(index); + switch(index) + { + case 0: + alwaysDoThisActionForFileExists=FileExists_NotSet; + break; + case 1: + alwaysDoThisActionForFileExists=FileExists_Skip; + break; + case 2: + alwaysDoThisActionForFileExists=FileExists_Overwrite; + break; + case 3: + alwaysDoThisActionForFileExists=FileExists_OverwriteIfNotSame; + break; + case 4: + alwaysDoThisActionForFileExists=FileExists_OverwriteIfNewer; + break; + case 5: + alwaysDoThisActionForFileExists=FileExists_OverwriteIfOlder; + break; + case 6: + alwaysDoThisActionForFileExists=FileExists_Rename; + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + alwaysDoThisActionForFileExists=FileExists_NotSet; + break; + } + emit signal_setCollisionAction(alwaysDoThisActionForFileExists); +} + +void CopyEngine::setFileError(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action index: %1").arg(index)); + if(uiIsInstalled) + if(index!=ui->comboBoxFileError->currentIndex()) + ui->comboBoxFileError->setCurrentIndex(index); + switch(index) + { + case 0: + alwaysDoThisActionForFileError=FileError_NotSet; + break; + case 1: + alwaysDoThisActionForFileError=FileError_Skip; + break; + case 2: + alwaysDoThisActionForFileError=FileError_PutToEndOfTheList; + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + alwaysDoThisActionForFileError=FileError_NotSet; + break; + } + emit signal_setCollisionAction(alwaysDoThisActionForFileExists); +} + +void CopyEngine::setTransferAlgorithm(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action index: %1").arg(index)); + if(uiIsInstalled) + if(index!=ui->transferAlgorithm->currentIndex()) + ui->transferAlgorithm->setCurrentIndex(index); + switch(index) + { + case 0: + transferAlgorithm=TransferAlgorithm_Automatic; + break; + case 1: + transferAlgorithm=TransferAlgorithm_Sequential; + break; + case 2: + transferAlgorithm=TransferAlgorithm_Parallel; + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + transferAlgorithm=TransferAlgorithm_Automatic; + break; + } + if(transferAlgorithm==TransferAlgorithm_Sequential) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"transferAlgorithm==TransferAlgorithm_Sequential"); + else if(transferAlgorithm==TransferAlgorithm_Automatic) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"transferAlgorithm==TransferAlgorithm_Automatic"); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"transferAlgorithm==TransferAlgorithm_Parallel"); + emit signal_setTransferAlgorithm(transferAlgorithm); +} + +void CopyEngine::setRightTransfer(const bool doRightTransfer) +{ + this->doRightTransfer=doRightTransfer; + if(uiIsInstalled) + ui->doRightTransfer->setChecked(doRightTransfer); + listThread->setRightTransfer(doRightTransfer); +} + +//set keep date +void CopyEngine::setKeepDate(const bool keepDate) +{ + this->keepDate=keepDate; + if(uiIsInstalled) + ui->keepDate->setChecked(keepDate); + listThread->setKeepDate(keepDate); +} + +//set block size in KB +void CopyEngine::setBlockSize(const int blockSize) +{ + this->blockSize=blockSize; + if(uiIsInstalled) + { + ui->blockSize->setValue(blockSize); + ui->sequentialBuffer->setSingleStep(blockSize); + ui->parallelBuffer->setSingleStep(blockSize); + } + emit send_blockSize(blockSize); + updatedBlockSize(); +} + +void CopyEngine::setParallelBuffer(int parallelBuffer) +{ + parallelBuffer=round((float)parallelBuffer/(float)blockSize)*blockSize; + this->parallelBuffer=parallelBuffer; + if(uiIsInstalled) + ui->parallelBuffer->setValue(parallelBuffer); + emit send_parallelBuffer(parallelBuffer/blockSize); +} + +void CopyEngine::setSequentialBuffer(int sequentialBuffer) +{ + sequentialBuffer=round((float)sequentialBuffer/(float)blockSize)*blockSize; + this->sequentialBuffer=sequentialBuffer; + if(uiIsInstalled) + ui->sequentialBuffer->setValue(sequentialBuffer); + emit send_sequentialBuffer(sequentialBuffer/blockSize); +} + +void CopyEngine::setParallelizeIfSmallerThan(int parallelizeIfSmallerThan) +{ + this->parallelizeIfSmallerThan=parallelizeIfSmallerThan; + if(uiIsInstalled) + ui->parallelizeIfSmallerThan->setValue(parallelizeIfSmallerThan); + emit send_parallelizeIfSmallerThan(parallelizeIfSmallerThan*1024); +} + +void CopyEngine::setMoveTheWholeFolder(const bool &moveTheWholeFolder) +{ + this->moveTheWholeFolder=moveTheWholeFolder; + if(uiIsInstalled) + ui->moveTheWholeFolder->setChecked(moveTheWholeFolder); + emit send_moveTheWholeFolder(moveTheWholeFolder); +} + +void CopyEngine::setFollowTheStrictOrder(const bool &followTheStrictOrder) +{ + this->followTheStrictOrder=followTheStrictOrder; + if(uiIsInstalled) + ui->followTheStrictOrder->setChecked(followTheStrictOrder); + emit send_followTheStrictOrder(followTheStrictOrder); +} + +void CopyEngine::setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles) +{ + this->deletePartiallyTransferredFiles=deletePartiallyTransferredFiles; + if(uiIsInstalled) + ui->deletePartiallyTransferredFiles->setChecked(deletePartiallyTransferredFiles); + emit send_deletePartiallyTransferredFiles(deletePartiallyTransferredFiles); +} + +void CopyEngine::setInodeThreads(const int &inodeThreads) +{ + this->inodeThreads=inodeThreads; + if(uiIsInstalled) + ui->inodeThreads->setValue(inodeThreads); + emit send_setInodeThreads(inodeThreads); +} + +void CopyEngine::setRenameTheOriginalDestination(const bool &renameTheOriginalDestination) +{ + this->renameTheOriginalDestination=renameTheOriginalDestination; + if(uiIsInstalled) + ui->renameTheOriginalDestination->setChecked(renameTheOriginalDestination); + emit send_setRenameTheOriginalDestination(renameTheOriginalDestination); +} + +void CopyEngine::inodeThreadsFinished() +{ + this->inodeThreads=ui->inodeThreads->value(); + emit send_setInodeThreads(inodeThreads); +} + +//set auto start +void CopyEngine::setAutoStart(const bool autoStart) +{ + this->autoStart=autoStart; + if(uiIsInstalled) + ui->autoStart->setChecked(autoStart); + listThread->setAutoStart(autoStart); +} + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +/// \brief set rsync +void CopyEngine::setRsync(const bool rsync) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"set rsync: "+QString::number(rsync)); + this->rsync=rsync; + if(uiIsInstalled) + { + ui->rsync->setChecked(rsync); + ui->rsync->setEnabled(forcedMode && mode==Ultracopier::Copy); + ui->label_rsync->setEnabled(forcedMode && mode==Ultracopier::Copy); + } + listThread->setRsync(rsync); +} +#endif + +//set check destination folder +void CopyEngine::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) +{ + this->checkDestinationFolderExists=checkDestinationFolderExists; + if(uiIsInstalled) + ui->checkBoxDestinationFolderExists->setChecked(checkDestinationFolderExists); + listThread->setCheckDestinationFolderExists(checkDestinationFolderExists); +} + +//reset widget +void CopyEngine::resetTempWidget() +{ + uiIsInstalled=false; + tempWidget=NULL; +} + +void CopyEngine::setFolderCollision(int index) +{ + switch(index) + { + case 0: + setComboBoxFolderCollision(FolderExists_NotSet,false); + break; + case 1: + setComboBoxFolderCollision(FolderExists_Merge,false); + break; + case 2: + setComboBoxFolderCollision(FolderExists_Skip,false); + break; + case 3: + setComboBoxFolderCollision(FolderExists_Rename,false); + break; + } +} + +void CopyEngine::setFolderError(int index) +{ + switch(index) + { + case 0: + setComboBoxFolderError(FileError_NotSet,false); + break; + case 1: + setComboBoxFolderError(FileError_Skip,false); + break; + } +} + +//set the translate +void CopyEngine::newLanguageLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, retranslate the widget options"); + if(tempWidget!=NULL) + { + ui->retranslateUi(tempWidget); + ui->comboBoxFolderError->setItemText(0,tr("Ask")); + ui->comboBoxFolderError->setItemText(1,tr("Skip")); + + ui->comboBoxFolderCollision->setItemText(0,tr("Ask")); + ui->comboBoxFolderCollision->setItemText(1,tr("Merge")); + ui->comboBoxFolderCollision->setItemText(2,tr("Skip")); + ui->comboBoxFolderCollision->setItemText(3,tr("Rename")); + + ui->comboBoxFileError->setItemText(0,tr("Ask")); + ui->comboBoxFileError->setItemText(1,tr("Skip")); + ui->comboBoxFileError->setItemText(2,tr("Put at the end")); + + ui->comboBoxFileCollision->setItemText(0,tr("Ask")); + ui->comboBoxFileCollision->setItemText(1,tr("Skip")); + ui->comboBoxFileCollision->setItemText(2,tr("Overwrite")); + ui->comboBoxFileCollision->setItemText(3,tr("Overwrite if different")); + ui->comboBoxFileCollision->setItemText(4,tr("Overwrite if newer")); + ui->comboBoxFileCollision->setItemText(5,tr("Overwrite if older")); + ui->comboBoxFileCollision->setItemText(6,tr("Rename")); + + ui->transferAlgorithm->setItemText(0,tr("Automatic")); + ui->transferAlgorithm->setItemText(1,tr("Sequential")); + ui->transferAlgorithm->setItemText(2,tr("Parallel")); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"ui not loaded!"); +} + +void CopyEngine::setComboBoxFolderCollision(FolderExistsAction action,bool changeComboBox) +{ + alwaysDoThisActionForFolderExists=action; + emit signal_setFolderCollision(alwaysDoThisActionForFolderExists); + if(!changeComboBox || !uiIsInstalled) + return; + switch(action) + { + case FolderExists_Merge: + ui->comboBoxFolderCollision->setCurrentIndex(1); + break; + case FolderExists_Skip: + ui->comboBoxFolderCollision->setCurrentIndex(2); + break; + case FolderExists_Rename: + ui->comboBoxFolderCollision->setCurrentIndex(3); + break; + default: + ui->comboBoxFolderCollision->setCurrentIndex(0); + break; + } +} + +void CopyEngine::setComboBoxFolderError(FileErrorAction action,bool changeComboBox) +{ + alwaysDoThisActionForFileError=action; + if(!changeComboBox || !uiIsInstalled) + return; + switch(action) + { + case FileError_Skip: + ui->comboBoxFolderError->setCurrentIndex(1); + break; + default: + ui->comboBoxFolderError->setCurrentIndex(0); + break; + } +} + +void CopyEngine::doChecksum_toggled(bool doChecksum) +{ + listThread->set_doChecksum(doChecksum); +} + +void CopyEngine::checksumOnlyOnError_toggled(bool checksumOnlyOnError) +{ + listThread->set_checksumOnlyOnError(checksumOnlyOnError); +} + +void CopyEngine::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) +{ + listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); +} + +void CopyEngine::osBuffer_toggled(bool osBuffer) +{ + listThread->set_osBuffer(osBuffer); + updateBufferCheckbox(); +} + +void CopyEngine::osBufferLimited_toggled(bool osBufferLimited) +{ + listThread->set_osBufferLimited(osBufferLimited); + updateBufferCheckbox(); +} + +void CopyEngine::osBufferLimit_editingFinished() +{ + emit send_osBufferLimit(ui->osBufferLimit->value()); +} + +void CopyEngine::showFilterDialog() +{ + if(filters!=NULL) + filters->exec(); +} + +void CopyEngine::sendNewFilters() +{ + if(filters!=NULL) + emit send_setFilters(filters->getInclude(),filters->getExclude()); +} + +void CopyEngine::sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("new filter")); + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +void CopyEngine::showRenamingRules() +{ + if(renamingRules==NULL) + { + QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded. Unable to access the filters")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"options not loaded"); + return; + } + renamingRules->exec(); +} + +void CopyEngine::get_realBytesTransfered(quint64 realBytesTransfered) +{ + size_for_speed=realBytesTransfered; +} + +void CopyEngine::newActionInProgess(Ultracopier::EngineActionInProgress action) +{ + if(action==Ultracopier::Idle) + { + timerProgression.stop(); + timerActionDone.stop(); + } + else + { + timerProgression.start(); + timerActionDone.start(); + } +} + +void CopyEngine::updatedBlockSize() +{ + if(uiIsInstalled) + { + ui->sequentialBuffer->setMinimum(ui->blockSize->value()); + ui->sequentialBuffer->setSingleStep(ui->blockSize->value()); + ui->sequentialBuffer->setMaximum(ui->blockSize->value()*ULTRACOPIER_PLUGIN_MAX_SEQUENTIAL_NUMBER_OF_BLOCK); + ui->parallelBuffer->setMinimum(ui->blockSize->value()); + ui->parallelBuffer->setSingleStep(ui->blockSize->value()); + ui->parallelBuffer->setMaximum(ui->blockSize->value()*ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK); + } + setParallelBuffer(parallelBuffer); + setSequentialBuffer(sequentialBuffer); +} + +void CopyEngine::setCheckDiskSpace(const bool &checkDiskSpace) +{ + this->checkDiskSpace=checkDiskSpace; + if(uiIsInstalled) + ui->checkDiskSpace->setChecked(checkDiskSpace); + listThread->setCheckDiskSpace(checkDiskSpace); +} + +void CopyEngine::setDefaultDestinationFolder(const QString &defaultDestinationFolder) +{ + this->defaultDestinationFolder=defaultDestinationFolder; + if(uiIsInstalled) + ui->defaultDestinationFolder->setText(defaultDestinationFolder); +} + +void CopyEngine::setCopyListOrder(const bool &order) +{ + listThread->setCopyListOrder(order); +} + +void CopyEngine::exportErrorIntoTransferList() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"exportErrorIntoTransferList"); + QString fileName = QFileDialog::getSaveFileName(interface,facilityEngine->translateText(QStringLiteral("Save transfer list")),QStringLiteral("transfer-list.lst"),facilityEngine->translateText(QStringLiteral("Transfer list"))+QStringLiteral(" (*.lst)")); + if(fileName.isEmpty()) + return; + emit signal_exportErrorIntoTransferList(fileName); +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngine.h b/plugins/CopyEngine/Ultracopier/CopyEngine.h new file mode 100644 index 0000000..d38fd4e --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine.h @@ -0,0 +1,381 @@ +/** \file copyEngine.h +\brief Define the copy engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_CopyEngine.h" +#include "FileErrorDialog.h" +#include "FileExistsDialog.h" +#include "FolderExistsDialog.h" +#include "FileIsSameDialog.h" +#include "ui_copyEngineOptions.h" +#include "Environment.h" +#include "ListThread.h" +#include "Filters.h" +#include "RenamingRules.h" + +#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW +#include "DebugDialog.h" +#include +#endif + +#ifndef COPY_ENGINE_H +#define COPY_ENGINE_H + +namespace Ui { + class copyEngineOptions; +} + +/// \brief the implementation of copy engine plugin, manage directly few stuff, else pass to ListThread class. +class CopyEngine : public PluginInterface_CopyEngine +{ + Q_OBJECT +public: + CopyEngine(FacilityInterface * facilityEngine); + ~CopyEngine(); + void connectTheSignalsSlots(); +private: + ListThread * listThread; + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + DebugDialog debugDialogWindow; + #endif + QWidget * tempWidget; + Ui::copyEngineOptions * ui; + bool uiIsInstalled; + QWidget * interface; + Filters * filters; + RenamingRules * renamingRules; + FacilityInterface * facilityEngine; + quint32 maxSpeed; + bool doRightTransfer; + bool keepDate; + int blockSize; + int parallelBuffer; + int sequentialBuffer; + int parallelizeIfSmallerThan; + bool followTheStrictOrder; + bool deletePartiallyTransferredFiles; + int inodeThreads; + bool renameTheOriginalDestination; + bool moveTheWholeFolder; + bool autoStart; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + bool rsync; + #endif + bool checkDestinationFolderExists; + FileExistsAction alwaysDoThisActionForFileExists; + FileErrorAction alwaysDoThisActionForFileError; + FileErrorAction alwaysDoThisActionForFolderError; + FolderExistsAction alwaysDoThisActionForFolderExists; + TransferAlgorithm transferAlgorithm; + bool dialogIsOpen; + volatile bool stopIt; + QString defaultDestinationFolder; + /// \brief error queue + struct errorQueueItem + { + TransferThread * transfer; ///< NULL if send by scan thread + ScanFileOrFolder * scan; ///< NULL if send by transfer thread + bool mkPath; + bool rmPath; + QFileInfo inode; + QString errorString; + ErrorType errorType; + }; + QList errorQueue; + /// \brief already exists queue + struct alreadyExistsQueueItem + { + TransferThread * transfer; ///< NULL if send by scan thread + ScanFileOrFolder * scan; ///< NULL if send by transfer thread + QFileInfo source; + QFileInfo destination; + bool isSame; + }; + QList alreadyExistsQueue; + quint64 size_for_speed;//because direct access to list thread into the main thread can't be do + Ultracopier::CopyMode mode; + bool forcedMode; + + bool doChecksum; + bool checksumIgnoreIfImpossible; + bool checksumOnlyOnError; + bool osBuffer; + bool osBufferLimited; + bool checkDiskSpace; + unsigned int osBufferLimit; + QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; + QString firstRenamingRule; + QString otherRenamingRule; + + //send action done timer + QTimer timerActionDone; + //send progression timer + QTimer timerProgression; + + QTimer timerUpdateMount; + int putAtBottom;//to keep how many automatic put at bottom have been used +private slots: + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + void updateTheDebugInfo(const QStringList &newList, const QStringList &newList2, const int &numberOfInodeOperation); + #endif + + /************* External call ********************/ + //dialog message + /// \note Can be call without queue because all call will be serialized + void fileAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread); + /// \note Can be call without queue because all call will be serialized + void errorOnFileSlot(QFileInfo fileInfo, QString errorString, TransferThread * thread, const ErrorType &errorType); + /// \note Can be call without queue because all call will be serialized + void folderAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,ScanFileOrFolder * thread); + /// \note Can be call without queue because all call will be serialized + void errorOnFolderSlot(QFileInfo fileInfo, QString errorString, ScanFileOrFolder * thread, ErrorType errorType); + //mkpath event + void mkPathErrorOnFolderSlot(QFileInfo, QString, ErrorType errorType); + + //dialog message + /// \note Can be call without queue because all call will be serialized + void fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog=false); + /// \note Can be call without queue because all call will be serialized + void errorOnFile(QFileInfo fileInfo, QString errorString, TransferThread * thread, const ErrorType &errorType, bool isCalledByShowOneNewDialog=false); + /// \note Can be call without queue because all call will be serialized + void folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,ScanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); + /// \note Can be call without queue because all call will be serialized + void errorOnFolder(QFileInfo fileInfo,QString errorString,ScanFileOrFolder * thread, ErrorType errorType,bool isCalledByShowOneNewDialog=false); + //mkpath event + void mkPathErrorOnFolder(QFileInfo, QString, const ErrorType &errorType, bool isCalledByShowOneNewDialog=false); + + //show one new dialog if needed + void showOneNewDialog(); + void sendNewFilters(); + + void doChecksum_toggled(bool); + void checksumOnlyOnError_toggled(bool); + void checksumIgnoreIfImpossible_toggled(bool); + void osBuffer_toggled(bool); + void osBufferLimited_toggled(bool); + void osBufferLimit_editingFinished(); + void showFilterDialog(); + void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); + void showRenamingRules(); + void get_realBytesTransfered(quint64 realBytesTransfered); + void newActionInProgess(Ultracopier::EngineActionInProgress); + void updatedBlockSize(); + void updateBufferCheckbox(); + void haveNeedPutAtBottom(bool needPutAtBottom, const QFileInfo &fileInfo, const QString &errorString, TransferThread *thread, const ErrorType &errorType); + void missingDiskSpace(QList list); + void exportErrorIntoTransferList(); +public: + /** \brief to send the options panel + * \return return false if have not the options + * \param tempWidget the widget to generate on it the options */ + bool getOptionsEngine(QWidget * tempWidget); + /** \brief to have interface widget to do modal dialog + * \param interface to have the widget of the interface, useful for modal dialog */ + void setInterfacePointer(QWidget * interface); + //return empty if multiple + /** \brief compare the current sources of the copy, with the passed arguments + * \param sources the sources list to compares with the current sources list + * \return true if have same sources, else false (or empty) */ + bool haveSameSource(const QStringList &sources); + /** \brief compare the current destination of the copy, with the passed arguments + * \param destination the destination to compares with the current destination + * \return true if have same destination, else false (or empty) */ + bool haveSameDestination(const QString &destination); + //external soft like file browser have send copy/move list to do + /** \brief send copy without destination, ask the destination + * \param sources the sources list to copy + * \return true if the copy have been accepted */ + bool newCopy(const QStringList &sources); + /** \brief send copy with destination + * \param sources the sources list to copy + * \param destination the destination to copy + * \return true if the copy have been accepted */ + bool newCopy(const QStringList &sources,const QString &destination); + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \return true if the move have been accepted */ + bool newMove(const QStringList &sources); + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \param destination the destination to move + * \return true if the move have been accepted */ + bool newMove(const QStringList &sources,const QString &destination); + /** \brief send the new transfer list + * \param file the transfer list */ + void newTransferList(const QString &file); + + /** \brief to get byte read, use by Ultracopier for the speed calculation + * real size transfered to right speed calculation */ + quint64 realByteTransfered(); + /** \brief support speed limitation */ + bool supportSpeedLimitation() const; + + /** \brief to set drives detected + * specific to this copy engine */ + + /** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ + void syncTransferList(); + + void set_doChecksum(bool doChecksum); + void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); + void set_checksumOnlyOnError(bool checksumOnlyOnError); + void set_osBuffer(bool osBuffer); + void set_osBufferLimited(bool osBufferLimited); + void set_osBufferLimit(unsigned int osBufferLimit); + void set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); + void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + void setRsync(const bool rsync); + #endif + void setCheckDiskSpace(const bool &checkDiskSpace); + void setDefaultDestinationFolder(const QString &defaultDestinationFolder); + void setCopyListOrder(const bool &order); + void defaultDestinationFolderBrowse(); + QString askDestination(); +public slots: + //user ask ask to add folder (add it with interface ask source/destination) + /** \brief add folder called on the interface + * Used by manual adding */ + bool userAddFolder(const Ultracopier::CopyMode &mode); + /** \brief add file called on the interface + * Used by manual adding */ + bool userAddFile(const Ultracopier::CopyMode &mode); + //action on the copy + /// \brief put the transfer in pause + void pause(); + /// \brief resume the transfer + void resume(); + /** \brief skip one transfer entry + * \param id id of the file to remove */ + void skip(const quint64 &id); + /// \brief cancel all the transfer + void cancel(); + //edit the transfer list + /** \brief remove the selected item + * \param ids ids is the id list of the selected items */ + void removeItems(const QList &ids); + /** \brief move on top of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnTop(const QList &ids); + /** \brief move up the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsUp(const QList &ids); + /** \brief move down the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsDown(const QList &ids); + /** \brief move on bottom of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnBottom(const QList &ids); + + /** \brief give the forced mode, to export/import transfer list */ + void forceMode(const Ultracopier::CopyMode &mode); + /// \brief export the transfer list into a file + void exportTransferList(); + /// \brief import the transfer list into a file + void importTransferList(); + + /** \brief to set the speed limitation + * -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + + // specific to this copy engine + + /// \brief set if the rights shoul be keep + void setRightTransfer(const bool doRightTransfer); + /// \brief set keep date + void setKeepDate(const bool keepDate); + /// \brief set block size in KB + void setBlockSize(const int blockSize); + + void setParallelBuffer(int parallelBuffer); + void setSequentialBuffer(int sequentialBuffer); + void setParallelizeIfSmallerThan(int parallelizeIfSmallerThan); + void setMoveTheWholeFolder(const bool &moveTheWholeFolder); + void setFollowTheStrictOrder(const bool &followTheStrictOrder); + void setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles); + void setInodeThreads(const int &inodeThreads); + void setRenameTheOriginalDestination(const bool &renameTheOriginalDestination); + void inodeThreadsFinished(); + + /// \brief set auto start + void setAutoStart(const bool autoStart); + /// \brief set if need check if the destination folder exists + void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); + /// \brief reset widget + void resetTempWidget(); + //autoconnect + void setFolderCollision(int index); + void setFolderError(int index); + void setFileCollision(int index); + void setFileError(int index); + void setTransferAlgorithm(int index); + /// \brief need retranslate the insterface + void newLanguageLoaded(); +private slots: + void setComboBoxFolderCollision(FolderExistsAction action,bool changeComboBox=true); + void setComboBoxFolderError(FileErrorAction action,bool changeComboBox=true); + void warningTransferList(const QString &warning); + void errorTransferList(const QString &error); +signals: + //action on the copy + void signal_pause() const; + void signal_resume() const; + void signal_skip(const quint64 &id) const; + + //edit the transfer list + void signal_removeItems(const QList &ids) const; + void signal_moveItemsOnTop(const QList &ids) const; + void signal_moveItemsUp(const QList &ids) const; + void signal_moveItemsDown(const QList &ids) const; + void signal_moveItemsOnBottom(const QList &ids) const; + + void signal_forceMode(const Ultracopier::CopyMode &mode) const; + void signal_exportTransferList(const QString &fileName) const; + void signal_importTransferList(const QString &fileName) const; + void signal_exportErrorIntoTransferList(const QString &fileName) const; + + //action + void signal_setTransferAlgorithm(TransferAlgorithm transferAlgorithm) const; + void signal_setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists) const; + void signal_setComboBoxFolderCollision(FolderExistsAction action) const; + void signal_setFolderCollision(FolderExistsAction action) const; + + //internal cancel + void tryCancel() const; + void getNeedPutAtBottom(const QFileInfo &fileInfo,const QString &errorString,TransferThread * thread,const ErrorType &errorType) const; + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,QString fonction,QString text,QString file,int ligne) const; + #endif + + //other signals + void queryOneNewDialog() const; + + void send_speedLimitation(const qint64 &speedLimitation) const; + void send_blockSize(const int &blockSize) const; + void send_osBufferLimit(const unsigned int &osBufferLimit) const; + void send_setFilters(const QList &include,const QList &exclude) const; + void send_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) const; + void send_parallelBuffer(const int ¶llelBuffer) const; + void send_sequentialBuffer(const int &sequentialBuffer) const; + void send_parallelizeIfSmallerThan(const int ¶llelizeIfSmallerThan) const; + void send_followTheStrictOrder(const bool &followTheStrictOrder) const; + void send_deletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles) const; + void send_setInodeThreads(const int &inodeThreads) const; + void send_moveTheWholeFolder(const bool &moveTheWholeFolder) const; + void send_setRenameTheOriginalDestination(const bool &renameTheOriginalDestination) const; +}; + +#endif // COPY_ENGINE_H diff --git a/plugins/CopyEngine/Ultracopier/CopyEngine.pro b/plugins/CopyEngine/Ultracopier/CopyEngine.pro new file mode 100644 index 0000000..42078af --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine.pro @@ -0,0 +1,101 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets +DEFINES += UNICODE _UNICODE +TEMPLATE = lib +CONFIG += plugin +win32 { + LIBS += -ladvapi32 +} + +HEADERS = \ + ../Ultracopier/StructEnumDefinition.h \ + ../Ultracopier/StructEnumDefinition_CopyEngine.h \ + ../Ultracopier/DebugEngineMacro.h \ + ../Ultracopier/Variable.h \ + ../Ultracopier/TransferThread.h \ + ../Ultracopier/ReadThread.h \ + ../Ultracopier/WriteThread.h \ + ../Ultracopier/MkPath.h \ + ../Ultracopier/AvancedQFile.h \ + ../Ultracopier/ListThread.h \ + ../../../interface/PluginInterface_CopyEngine.h \ + ../../../interface/OptionInterface.h \ + ../../../interface/FacilityInterface.h \ + ../Ultracopier/Filters.h \ + ../Ultracopier/FilterRules.h \ + ../Ultracopier/RenamingRules.h \ + ../Ultracopier/DriveManagement.h \ + ../Ultracopier/CopyEngine.h \ + ../Ultracopier/DebugDialog.h \ + ../Ultracopier/CopyEngineFactory.h \ + ../Ultracopier/FileErrorDialog.h \ + ../Ultracopier/FileExistsDialog.h \ + ../Ultracopier/FileIsSameDialog.h \ + ../Ultracopier/FolderExistsDialog.h \ + ../Ultracopier/ScanFileOrFolder.h \ + ../Ultracopier/DiskSpace.h +SOURCES = \ + ../Ultracopier/TransferThread.cpp \ + ../Ultracopier/ReadThread.cpp \ + ../Ultracopier/WriteThread.cpp \ + ../Ultracopier/MkPath.cpp \ + ../Ultracopier/AvancedQFile.cpp \ + ../Ultracopier/ListThread.cpp \ + ../Ultracopier/Filters.cpp \ + ../Ultracopier/FilterRules.cpp \ + ../Ultracopier/RenamingRules.cpp \ + ../Ultracopier/ListThread_InodeAction.cpp \ + ../Ultracopier/DriveManagement.cpp \ + ../Ultracopier/CopyEngine-collision-and-error.cpp \ + ../Ultracopier/CopyEngine.cpp \ + ../Ultracopier/DebugDialog.cpp \ + ../Ultracopier/CopyEngineFactory.cpp \ + ../Ultracopier/FileErrorDialog.cpp \ + ../Ultracopier/FileExistsDialog.cpp \ + ../Ultracopier/FileIsSameDialog.cpp \ + ../Ultracopier/FolderExistsDialog.cpp \ + ../Ultracopier/ScanFileOrFolder.cpp \ + ../Ultracopier/DiskSpace.cpp +TARGET = $$qtLibraryTarget(copyEngine) +TRANSLATIONS += ../Ultracopier/Languages/ar/translation.ts \ + ../Ultracopier/Languages/de/translation.ts \ + ../Ultracopier/Languages/el/translation.ts \ + ../Ultracopier/Languages/en/translation.ts \ + ../Ultracopier/Languages/es/translation.ts \ + ../Ultracopier/Languages/fr/translation.ts \ + ../Ultracopier/Languages/hi/translation.ts \ + ../Ultracopier/Languages/hu/translation.ts \ + ../Ultracopier/Languages/id/translation.ts \ + ../Ultracopier/Languages/it/translation.ts \ + ../Ultracopier/Languages/ja/translation.ts \ + ../Ultracopier/Languages/ko/translation.ts \ + ../Ultracopier/Languages/nl/translation.ts \ + ../Ultracopier/Languages/no/translation.ts \ + ../Ultracopier/Languages/pl/translation.ts \ + ../Ultracopier/Languages/pt/translation.ts \ + ../Ultracopier/Languages/ru/translation.ts \ + ../Ultracopier/Languages/th/translation.ts \ + ../Ultracopier/Languages/tr/translation.ts \ + ../Ultracopier/Languages/zh/translation.ts + +FORMS += \ + ../Ultracopier/fileErrorDialog.ui \ + ../Ultracopier/fileExistsDialog.ui \ + ../Ultracopier/fileIsSameDialog.ui \ + ../Ultracopier/debugDialog.ui \ + ../Ultracopier/folderExistsDialog.ui \ + ../Ultracopier/Filters.ui \ + ../Ultracopier/FilterRules.ui \ + ../Ultracopier/RenamingRules.ui \ + ../Ultracopier/copyEngineOptions.ui \ + ../Ultracopier/DiskSpace.ui + +OTHER_FILES += informations.xml + +!CONFIG(static) { +RESOURCES += \ + ../Ultracopier/copyEngineResources.qrc +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp new file mode 100644 index 0000000..d4d4bb6 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp @@ -0,0 +1,692 @@ +/** \file factory.cpp +\brief Define the factory to create new instance +\author alpha_one_x86 */ + +#include +#include +#include +#include +#include + +#include "CopyEngineFactory.h" + +// The cmath header from MSVC does not contain round() +#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER) +inline double round(double d) { + return floor( d + 0.5 ); +} +#endif + +CopyEngineFactory::CopyEngineFactory() : + ui(new Ui::copyEngineOptions()) +{ + qRegisterMetaType("FolderExistsAction"); + qRegisterMetaType("FileExistsAction"); + qRegisterMetaType >("QList"); + qRegisterMetaType("TransferStat"); + qRegisterMetaType >("QList"); + qRegisterMetaType("TransferAlgorithm"); + qRegisterMetaType("ActionType"); + qRegisterMetaType("ErrorType"); + qRegisterMetaType("Diskspace"); + qRegisterMetaType >("QList"); + qRegisterMetaType("QFileInfo"); + qRegisterMetaType("Ultracopier::CopyMode"); + + tempWidget=new QWidget(); + ui->setupUi(tempWidget); + ui->toolBox->setCurrentIndex(0); + ui->blockSize->setMaximum(ULTRACOPIER_PLUGIN_MAX_BLOCK_SIZE); + errorFound=false; + optionsEngine=NULL; + filters=new Filters(tempWidget); + renamingRules=new RenamingRules(tempWidget); + + connect(ui->doRightTransfer, &QCheckBox::toggled, this,&CopyEngineFactory::setDoRightTransfer); + connect(ui->keepDate, &QCheckBox::toggled, this,&CopyEngineFactory::setKeepDate); + connect(ui->blockSize, static_cast(&QSpinBox::valueChanged), this,&CopyEngineFactory::setBlockSize); + connect(ui->sequentialBuffer, static_cast(&QSpinBox::valueChanged), this,&CopyEngineFactory::setSequentialBuffer); + connect(ui->parallelBuffer, static_cast(&QSpinBox::valueChanged), this,&CopyEngineFactory::setParallelBuffer); + connect(ui->parallelizeIfSmallerThan, static_cast(&QSpinBox::valueChanged), this,&CopyEngineFactory::setParallelizeIfSmallerThan); + connect(ui->inodeThreads, static_cast(&QSpinBox::valueChanged), this,&CopyEngineFactory::on_inodeThreads_editingFinished); + connect(ui->autoStart, &QCheckBox::toggled, this,&CopyEngineFactory::setAutoStart); + connect(ui->doChecksum, &QCheckBox::toggled, this,&CopyEngineFactory::doChecksum_toggled); + connect(ui->comboBoxFolderError, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngineFactory::setFolderError); + connect(ui->comboBoxFolderCollision, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngineFactory::setFolderCollision); + connect(ui->comboBoxFileError, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngineFactory::setFileError); + connect(ui->comboBoxFileCollision, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngineFactory::setFileCollision); + connect(ui->transferAlgorithm, static_cast(&QComboBox::currentIndexChanged), this,&CopyEngineFactory::setTransferAlgorithm); + connect(ui->checkBoxDestinationFolderExists, &QCheckBox::toggled, this,&CopyEngineFactory::setCheckDestinationFolder); + connect(ui->checksumIgnoreIfImpossible, &QCheckBox::toggled, this,&CopyEngineFactory::checksumIgnoreIfImpossible_toggled); + connect(ui->checksumOnlyOnError, &QCheckBox::toggled, this,&CopyEngineFactory::checksumOnlyOnError_toggled); + connect(ui->osBuffer, &QCheckBox::toggled, this,&CopyEngineFactory::osBuffer_toggled); + connect(ui->osBufferLimited, &QCheckBox::toggled, this,&CopyEngineFactory::osBufferLimited_toggled); + connect(ui->osBufferLimit, &QSpinBox::editingFinished, this,&CopyEngineFactory::osBufferLimit_editingFinished); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + connect(ui->rsync, &QCheckBox::toggled, this,&CopyEngineFactory::setRsync); + #endif + connect(ui->inodeThreads, &QSpinBox::editingFinished, this,&CopyEngineFactory::on_inodeThreads_editingFinished); + connect(ui->osBufferLimited, &QAbstractButton::toggled, this,&CopyEngineFactory::updateBufferCheckbox); + connect(ui->osBuffer, &QAbstractButton::toggled, this,&CopyEngineFactory::updateBufferCheckbox); + connect(ui->moveTheWholeFolder, &QCheckBox::toggled, this,&CopyEngineFactory::moveTheWholeFolder); + connect(ui->followTheStrictOrder, &QCheckBox::toggled, this,&CopyEngineFactory::followTheStrictOrder); + connect(ui->deletePartiallyTransferredFiles,&QCheckBox::toggled, this,&CopyEngineFactory::deletePartiallyTransferredFiles); + connect(ui->renameTheOriginalDestination,&QCheckBox::toggled, this,&CopyEngineFactory::renameTheOriginalDestination); + connect(ui->checkDiskSpace, &QCheckBox::toggled, this,&CopyEngineFactory::checkDiskSpace); + connect(ui->defaultDestinationFolderBrowse,&QPushButton::clicked, this,&CopyEngineFactory::defaultDestinationFolderBrowse); + connect(ui->defaultDestinationFolder,&QLineEdit::editingFinished, this,&CopyEngineFactory::defaultDestinationFolder); + connect(ui->copyListOrder, &QCheckBox::toggled, this,&CopyEngineFactory::copyListOrder); + + connect(filters,&Filters::sendNewFilters,this,&CopyEngineFactory::sendNewFilters); + connect(ui->filters,&QPushButton::clicked,this,&CopyEngineFactory::showFilterDialog); + connect(renamingRules,&RenamingRules::sendNewRenamingRules,this,&CopyEngineFactory::sendNewRenamingRules); + connect(ui->renamingRules,&QPushButton::clicked,this,&CopyEngineFactory::showRenamingRules); + + lunchInitFunction.setInterval(0); + lunchInitFunction.setSingleShot(true); + connect(&lunchInitFunction,&QTimer::timeout,this,&CopyEngineFactory::init,Qt::QueuedConnection); + lunchInitFunction.start(); +} + +CopyEngineFactory::~CopyEngineFactory() +{ + delete renamingRules; + delete filters; + delete ui; +} + +void CopyEngineFactory::init() +{ +} + +PluginInterface_CopyEngine * CopyEngineFactory::getInstance() +{ + CopyEngine *realObject=new CopyEngine(facilityEngine); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(realObject,&CopyEngine::debugInformation,this,&CopyEngineFactory::debugInformation); + #endif + realObject->connectTheSignalsSlots(); + PluginInterface_CopyEngine * newTransferEngine=realObject; + connect(this,&CopyEngineFactory::reloadLanguage,realObject,&CopyEngine::newLanguageLoaded); + realObject->setRightTransfer(ui->doRightTransfer->isChecked()); + realObject->setKeepDate(ui->keepDate->isChecked()); + realObject->setBlockSize(ui->blockSize->value()); + realObject->setAutoStart(ui->autoStart->isChecked()); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + realObject->setRsync(ui->rsync->isChecked()); + #endif + realObject->setFolderCollision(ui->comboBoxFolderCollision->currentIndex()); + realObject->setFolderError(ui->comboBoxFolderError->currentIndex()); + realObject->setFileCollision(ui->comboBoxFileCollision->currentIndex()); + realObject->setFileError(ui->comboBoxFileError->currentIndex()); + realObject->setTransferAlgorithm(ui->transferAlgorithm->currentIndex()); + realObject->setCheckDestinationFolderExists(ui->checkBoxDestinationFolderExists->isChecked()); + realObject->set_doChecksum(ui->doChecksum->isChecked()); + realObject->set_checksumIgnoreIfImpossible(ui->checksumIgnoreIfImpossible->isChecked()); + realObject->set_checksumOnlyOnError(ui->checksumOnlyOnError->isChecked()); + realObject->set_osBuffer(ui->osBuffer->isChecked()); + realObject->set_osBufferLimited(ui->osBufferLimited->isChecked()); + realObject->set_osBufferLimit(ui->osBufferLimit->value()); + realObject->set_setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + realObject->setRenamingRules(firstRenamingRule,otherRenamingRule); + realObject->setSequentialBuffer(ui->sequentialBuffer->value()); + realObject->setParallelBuffer(ui->parallelBuffer->value()); + realObject->setParallelizeIfSmallerThan(ui->parallelizeIfSmallerThan->value()); + realObject->setMoveTheWholeFolder(ui->moveTheWholeFolder->isChecked()); + realObject->setFollowTheStrictOrder(ui->followTheStrictOrder->isChecked()); + realObject->setDeletePartiallyTransferredFiles(ui->deletePartiallyTransferredFiles->isChecked()); + realObject->setInodeThreads(ui->inodeThreads->value()); + realObject->setRenameTheOriginalDestination(ui->renameTheOriginalDestination->isChecked()); + realObject->setCheckDiskSpace(ui->checkDiskSpace->isChecked()); + realObject->setDefaultDestinationFolder(ui->defaultDestinationFolder->text()); + realObject->setCopyListOrder(ui->copyListOrder->isChecked()); + return newTransferEngine; +} + +void CopyEngineFactory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, writePath: ")+writePath+QStringLiteral(", pluginPath:")+pluginPath); + this->facilityEngine=facilityInterface; + Q_UNUSED(portableVersion); + #ifndef ULTRACOPIER_PLUGIN_DEBUG + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + #endif + #if ! defined (Q_CC_GNU) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("Unable to change date time of files, only gcc is supported")); + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,COMPILERINFO); + #if defined (ULTRACOPIER_PLUGIN_CHECKLISTTYPE) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("CHECK LIST TYPE set")); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("CHECK LIST TYPE not set")); + #endif + if(options!=NULL) + { + //load the options + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("doRightTransfer"),QVariant(true))); + #ifndef Q_OS_LINUX + KeysList.append(qMakePair(QStringLiteral("keepDate"),QVariant(false))); + #else + KeysList.append(qMakePair(QStringLiteral("keepDate"),QVariant(true))); + #endif + KeysList.append(qMakePair(QStringLiteral("blockSize"),QVariant(ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE))); + quint32 sequentialBuffer=ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*ULTRACOPIER_PLUGIN_DEFAULT_SEQUENTIAL_NUMBER_OF_BLOCK; + quint32 parallelBuffer=ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK; + //to prevent swap and other bad effect, only under windows and unix for now + #if defined(Q_OS_WIN32) or (defined(Q_OS_LINUX) and defined(_SC_PHYS_PAGES)) + size_t max_memory=getTotalSystemMemory()/1024; + if(max_memory>0) + { + if(sequentialBuffer>(max_memory/10)) + sequentialBuffer=max_memory/10; + if(parallelBuffer>(max_memory/100)) + parallelBuffer=max_memory/100; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("detected memory: %1MB").arg(max_memory/1024)); + #endif + KeysList.append(qMakePair(QStringLiteral("sequentialBuffer"),QVariant(sequentialBuffer))); + KeysList.append(qMakePair(QStringLiteral("parallelBuffer"),QVariant(parallelBuffer))); + KeysList.append(qMakePair(QStringLiteral("parallelizeIfSmallerThan"),QVariant(128)));//128KB, better for modern hardware: Multiple queue en linux, SSD, ... + KeysList.append(qMakePair(QStringLiteral("autoStart"),QVariant(true))); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + KeysList.append(qMakePair(QStringLiteral("rsync"),QVariant(true))); + #endif + KeysList.append(qMakePair(QStringLiteral("folderError"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("folderCollision"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("fileError"),QVariant(2))); + KeysList.append(qMakePair(QStringLiteral("fileCollision"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("transferAlgorithm"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("checkDestinationFolder"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("includeStrings"),QVariant(QStringList()))); + KeysList.append(qMakePair(QStringLiteral("includeOptions"),QVariant(QStringList()))); + KeysList.append(qMakePair(QStringLiteral("excludeStrings"),QVariant(QStringList()))); + KeysList.append(qMakePair(QStringLiteral("excludeOptions"),QVariant(QStringList()))); + KeysList.append(qMakePair(QStringLiteral("doChecksum"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("checksumIgnoreIfImpossible"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("checksumOnlyOnError"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("osBuffer"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("firstRenamingRule"),QVariant(""))); + KeysList.append(qMakePair(QStringLiteral("otherRenamingRule"),QVariant(""))); + KeysList.append(qMakePair(QStringLiteral("osBufferLimited"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("osBufferLimit"),QVariant(512))); + KeysList.append(qMakePair(QStringLiteral("deletePartiallyTransferredFiles"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("moveTheWholeFolder"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("followTheStrictOrder"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("renameTheOriginalDestination"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("checkDiskSpace"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("defaultDestinationFolder"),QVariant(QString()))); + KeysList.append(qMakePair(QStringLiteral("inodeThreads"),QVariant(1))); + KeysList.append(qMakePair(QStringLiteral("copyListOrder"),QVariant(false))); + options->addOptionGroup(KeysList); + #if ! defined (Q_CC_GNU) + ui->keepDate->setEnabled(false); + ui->keepDate->setToolTip(QStringLiteral("Not supported with this compiler")); + #endif + ui->doRightTransfer->setChecked(options->getOptionValue(QStringLiteral("doRightTransfer")).toBool()); + ui->keepDate->setChecked(options->getOptionValue(QStringLiteral("keepDate")).toBool()); + ui->blockSize->setValue(options->getOptionValue(QStringLiteral("blockSize")).toUInt());//keep before sequentialBuffer and parallelBuffer + ui->autoStart->setChecked(options->getOptionValue(QStringLiteral("autoStart")).toBool()); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + ui->rsync->setChecked(options->getOptionValue(QStringLiteral("rsync")).toBool()); + #else + ui->label_rsync->setVisible(false); + ui->rsync->setVisible(false); + #endif + ui->comboBoxFolderError->setCurrentIndex(options->getOptionValue(QStringLiteral("folderError")).toUInt()); + ui->comboBoxFolderCollision->setCurrentIndex(options->getOptionValue(QStringLiteral("folderCollision")).toUInt()); + ui->comboBoxFileError->setCurrentIndex(options->getOptionValue(QStringLiteral("fileError")).toUInt()); + ui->comboBoxFileCollision->setCurrentIndex(options->getOptionValue(QStringLiteral("fileCollision")).toUInt()); + ui->transferAlgorithm->setCurrentIndex(options->getOptionValue(QStringLiteral("transferAlgorithm")).toUInt()); + ui->checkBoxDestinationFolderExists->setChecked(options->getOptionValue(QStringLiteral("checkDestinationFolder")).toBool()); + ui->parallelizeIfSmallerThan->setValue(options->getOptionValue(QStringLiteral("parallelizeIfSmallerThan")).toUInt()); + ui->sequentialBuffer->setValue(options->getOptionValue(QStringLiteral("sequentialBuffer")).toUInt()); + ui->parallelBuffer->setValue(options->getOptionValue(QStringLiteral("parallelBuffer")).toUInt()); + ui->sequentialBuffer->setSingleStep(ui->blockSize->value()); + ui->parallelBuffer->setSingleStep(ui->blockSize->value()); + ui->deletePartiallyTransferredFiles->setChecked(options->getOptionValue(QStringLiteral("deletePartiallyTransferredFiles")).toBool()); + ui->moveTheWholeFolder->setChecked(options->getOptionValue(QStringLiteral("moveTheWholeFolder")).toBool()); + ui->followTheStrictOrder->setChecked(options->getOptionValue(QStringLiteral("followTheStrictOrder")).toBool()); + ui->inodeThreads->setValue(options->getOptionValue(QStringLiteral("inodeThreads")).toUInt()); + ui->renameTheOriginalDestination->setChecked(options->getOptionValue(QStringLiteral("renameTheOriginalDestination")).toBool()); + ui->checkDiskSpace->setChecked(options->getOptionValue(QStringLiteral("checkDiskSpace")).toBool()); + ui->defaultDestinationFolder->setText(options->getOptionValue(QStringLiteral("defaultDestinationFolder")).toString()); + + ui->doChecksum->setChecked(options->getOptionValue(QStringLiteral("doChecksum")).toBool()); + ui->checksumIgnoreIfImpossible->setChecked(options->getOptionValue(QStringLiteral("checksumIgnoreIfImpossible")).toBool()); + ui->checksumOnlyOnError->setChecked(options->getOptionValue(QStringLiteral("checksumOnlyOnError")).toBool()); + + ui->osBuffer->setChecked(options->getOptionValue(QStringLiteral("osBuffer")).toBool()); + ui->osBufferLimited->setChecked(options->getOptionValue(QStringLiteral("osBufferLimited")).toBool()); + ui->osBufferLimit->setValue(options->getOptionValue(QStringLiteral("osBufferLimit")).toUInt()); + //ui->autoStart->setChecked(options->getOptionValue(QStringLiteral("autoStart")).toBool());//moved from options(), wrong previous place + includeStrings=options->getOptionValue(QStringLiteral("includeStrings")).toStringList(); + includeOptions=options->getOptionValue(QStringLiteral("includeOptions")).toStringList(); + excludeStrings=options->getOptionValue(QStringLiteral("excludeStrings")).toStringList(); + excludeOptions=options->getOptionValue(QStringLiteral("excludeOptions")).toStringList(); + filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + firstRenamingRule=options->getOptionValue(QStringLiteral("firstRenamingRule")).toString(); + otherRenamingRule=options->getOptionValue(QStringLiteral("otherRenamingRule")).toString(); + renamingRules->setRenamingRules(firstRenamingRule,otherRenamingRule); + + ui->checksumOnlyOnError->setEnabled(ui->doChecksum->isChecked()); + ui->checksumIgnoreIfImpossible->setEnabled(ui->doChecksum->isChecked()); + ui->copyListOrder->setChecked(options->getOptionValue(QStringLiteral("copyListOrder")).toBool()); + + updateBufferCheckbox(); + optionsEngine=options; + + updatedBlockSize(); + } +} + +QStringList CopyEngineFactory::supportedProtocolsForTheSource() const +{ + return QStringList() << QStringLiteral("file"); +} + +QStringList CopyEngineFactory::supportedProtocolsForTheDestination() const +{ + return QStringList() << QStringLiteral("file"); +} + +Ultracopier::CopyType CopyEngineFactory::getCopyType() +{ + return Ultracopier::FileAndFolder; +} + +Ultracopier::TransferListOperation CopyEngineFactory::getTransferListOperation() +{ + return Ultracopier::TransferListOperation_ImportExport; +} + +bool CopyEngineFactory::canDoOnlyCopy() const +{ + return false; +} + +void CopyEngineFactory::resetOptions() +{ +} + +QWidget * CopyEngineFactory::options() +{ + return tempWidget; +} + +void CopyEngineFactory::setDoRightTransfer(bool doRightTransfer) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("doRightTransfer"),doRightTransfer); +} + +void CopyEngineFactory::setKeepDate(bool keepDate) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("keepDate"),keepDate); +} + +void CopyEngineFactory::setBlockSize(int blockSize) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("blockSize"),blockSize); + updatedBlockSize(); +} + +void CopyEngineFactory::setParallelBuffer(int parallelBuffer) +{ + if(optionsEngine!=NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + parallelBuffer=round((float)parallelBuffer/(float)ui->blockSize->value())*ui->blockSize->value(); + ui->parallelBuffer->setValue(parallelBuffer); + optionsEngine->setOptionValue(QStringLiteral("parallelBuffer"),parallelBuffer); + } +} + +void CopyEngineFactory::setSequentialBuffer(int sequentialBuffer) +{ + if(optionsEngine!=NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("the value have changed")); + sequentialBuffer=round((float)sequentialBuffer/(float)ui->blockSize->value())*ui->blockSize->value(); + ui->sequentialBuffer->setValue(sequentialBuffer); + optionsEngine->setOptionValue(QStringLiteral("sequentialBuffer"),sequentialBuffer); + } +} + +void CopyEngineFactory::setParallelizeIfSmallerThan(int parallelizeIfSmallerThan) +{ + if(optionsEngine!=NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + optionsEngine->setOptionValue(QStringLiteral("parallelizeIfSmallerThan"),parallelizeIfSmallerThan); + } +} + +void CopyEngineFactory::setAutoStart(bool autoStart) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("autoStart"),autoStart); +} + +void CopyEngineFactory::setFolderCollision(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("folderCollision"),index); +} + +void CopyEngineFactory::setFolderError(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("folderError"),index); +} + +void CopyEngineFactory::setTransferAlgorithm(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("transferAlgorithm"),index); +} + +void CopyEngineFactory::setCheckDestinationFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("checkDestinationFolder"),ui->checkBoxDestinationFolderExists->isChecked()); +} + +void CopyEngineFactory::newLanguageLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, retranslate the widget options"); + OptionInterface * optionsEngine=this->optionsEngine; + this->optionsEngine=NULL; + ui->retranslateUi(tempWidget); + ui->comboBoxFolderError->setItemText(0,tr("Ask")); + ui->comboBoxFolderError->setItemText(1,tr("Skip")); + + ui->comboBoxFolderCollision->setItemText(0,tr("Ask")); + ui->comboBoxFolderCollision->setItemText(1,tr("Merge")); + ui->comboBoxFolderCollision->setItemText(2,tr("Skip")); + ui->comboBoxFolderCollision->setItemText(3,tr("Rename")); + + ui->comboBoxFileError->setItemText(0,tr("Ask")); + ui->comboBoxFileError->setItemText(1,tr("Skip")); + ui->comboBoxFileError->setItemText(2,tr("Put at the end")); + + ui->comboBoxFileCollision->setItemText(0,tr("Ask")); + ui->comboBoxFileCollision->setItemText(1,tr("Skip")); + ui->comboBoxFileCollision->setItemText(2,tr("Overwrite")); + ui->comboBoxFileCollision->setItemText(3,tr("Overwrite if different")); + ui->comboBoxFileCollision->setItemText(4,tr("Overwrite if newer")); + ui->comboBoxFileCollision->setItemText(5,tr("Overwrite if older")); + ui->comboBoxFileCollision->setItemText(6,tr("Rename")); + + ui->transferAlgorithm->setItemText(0,tr("Automatic")); + ui->transferAlgorithm->setItemText(1,tr("Sequential")); + ui->transferAlgorithm->setItemText(2,tr("Parallel")); + if(optionsEngine!=NULL) + { + filters->newLanguageLoaded(); + renamingRules->newLanguageLoaded(); + } + emit reloadLanguage(); + this->optionsEngine=optionsEngine; +} + +void CopyEngineFactory::doChecksum_toggled(bool doChecksum) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("doChecksum"),doChecksum); +} + +void CopyEngineFactory::checksumOnlyOnError_toggled(bool checksumOnlyOnError) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("checksumOnlyOnError"),checksumOnlyOnError); +} + +void CopyEngineFactory::osBuffer_toggled(bool osBuffer) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("osBuffer"),osBuffer); + ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); +} + +void CopyEngineFactory::osBufferLimited_toggled(bool osBufferLimited) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("osBufferLimited"),osBufferLimited); + ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); +} + +void CopyEngineFactory::osBufferLimit_editingFinished() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the spinbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("osBufferLimit"),ui->osBufferLimit->value()); +} + +void CopyEngineFactory::showFilterDialog() +{ + if(optionsEngine==NULL) + { + QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded. Unable to access the filters")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"options not loaded"); + return; + } + filters->exec(); +} + +void CopyEngineFactory::sendNewFilters(const QStringList &includeStrings,const QStringList &includeOptions,const QStringList &excludeStrings,const QStringList &excludeOptions) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("new filter")); + this->includeStrings=includeStrings; + this->includeOptions=includeOptions; + this->excludeStrings=excludeStrings; + this->excludeOptions=excludeOptions; + if(optionsEngine!=NULL) + { + optionsEngine->setOptionValue(QStringLiteral("includeStrings"),includeStrings); + optionsEngine->setOptionValue(QStringLiteral("includeOptions"),includeOptions); + optionsEngine->setOptionValue(QStringLiteral("excludeStrings"),excludeStrings); + optionsEngine->setOptionValue(QStringLiteral("excludeOptions"),excludeOptions); + } +} + +void CopyEngineFactory::sendNewRenamingRules(const QString &firstRenamingRule,const QString &otherRenamingRule) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"new filter"); + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + if(optionsEngine!=NULL) + { + optionsEngine->setOptionValue(QStringLiteral("firstRenamingRule"),firstRenamingRule); + optionsEngine->setOptionValue(QStringLiteral("otherRenamingRule"),otherRenamingRule); + } +} + +void CopyEngineFactory::showRenamingRules() +{ + if(optionsEngine==NULL) + { + QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"options not loaded"); + return; + } + renamingRules->exec(); +} + +void CopyEngineFactory::updateBufferCheckbox() +{ + ui->osBufferLimited->setEnabled(ui->osBuffer->isChecked()); + ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); +} + +void CopyEngineFactory::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("checksumIgnoreIfImpossible"),checksumIgnoreIfImpossible); +} + +void CopyEngineFactory::setFileCollision(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action index: %1").arg(index)); + if(optionsEngine==NULL) + return; + switch(index) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + optionsEngine->setOptionValue(QStringLiteral("fileCollision"),index); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + break; + } +} + +void CopyEngineFactory::setFileError(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action index: %1").arg(index)); + if(optionsEngine==NULL) + return; + switch(index) + { + case 0: + case 1: + case 2: + optionsEngine->setOptionValue(QStringLiteral("fileError"),index); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + break; + } +} + +void CopyEngineFactory::updatedBlockSize() +{ + ui->sequentialBuffer->setMinimum(ui->blockSize->value()); + ui->sequentialBuffer->setSingleStep(ui->blockSize->value()); + ui->sequentialBuffer->setMaximum(ui->blockSize->value()*ULTRACOPIER_PLUGIN_MAX_SEQUENTIAL_NUMBER_OF_BLOCK); + ui->parallelBuffer->setMinimum(ui->blockSize->value()); + ui->parallelBuffer->setSingleStep(ui->blockSize->value()); + ui->parallelBuffer->setMaximum(ui->blockSize->value()*ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK); + setParallelBuffer(ui->parallelBuffer->value()); + setSequentialBuffer(ui->sequentialBuffer->value()); +} + +void CopyEngineFactory::deletePartiallyTransferredFiles(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("deletePartiallyTransferredFiles"),checked); +} + +void CopyEngineFactory::renameTheOriginalDestination(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("renameTheOriginalDestination"),checked); +} + +void CopyEngineFactory::checkDiskSpace(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("checkDiskSpace"),checked); +} + +void CopyEngineFactory::defaultDestinationFolderBrowse() +{ + QString destination = QFileDialog::getExistingDirectory(ui->defaultDestinationFolder,facilityEngine->translateText(QStringLiteral("Select destination directory")),QStringLiteral(""),QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if(destination.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + ui->defaultDestinationFolder->setText(destination); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("defaultDestinationFolder"),destination); +} + +void CopyEngineFactory::defaultDestinationFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("defaultDestinationFolder"),ui->defaultDestinationFolder->text()); +} + +void CopyEngineFactory::followTheStrictOrder(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("followTheStrictOrder"),checked); +} + +void CopyEngineFactory::moveTheWholeFolder(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("moveTheWholeFolder"),checked); +} + +void CopyEngineFactory::on_inodeThreads_editingFinished() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the spinbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("inodeThreads"),ui->inodeThreads->value()); +} + +#ifdef Q_OS_WIN32 +size_t CopyEngineFactory::getTotalSystemMemory() +{ + MEMORYSTATUSEX status; + status.dwLength = sizeof(status); + GlobalMemoryStatusEx(&status); + return status.ullTotalPhys; +} +#endif + +#ifdef Q_OS_LINUX +size_t CopyEngineFactory::getTotalSystemMemory() +{ + long pages = sysconf(_SC_PHYS_PAGES); + long page_size = sysconf(_SC_PAGE_SIZE); + return pages * page_size; +} +#endif + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +void CopyEngineFactory::setRsync(bool rsync) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("rsync",rsync); +} +#endif + +void CopyEngineFactory::copyListOrder(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("copyListOrder"),checked); +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h new file mode 100644 index 0000000..548588f --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h @@ -0,0 +1,132 @@ +/** \file factory.h +\brief Define the factory to create new instance +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "StructEnumDefinition_CopyEngine.h" + +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_CopyEngine.h" +#include "qstorageinfo.h" +#include "StructEnumDefinition.h" +#include "ui_copyEngineOptions.h" +#include "CopyEngine.h" +#include "Environment.h" +#include "Filters.h" +#include "RenamingRules.h" + +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif +#ifdef Q_OS_LINUX + #include +#endif + +#ifndef FACTORY_H +#define FACTORY_H + +namespace Ui { + class copyEngineOptions; +} + +/** \brief to generate copy engine instance */ +class CopyEngineFactory : public PluginInterface_CopyEngineFactory +{ + Q_OBJECT + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.CopyEngineFactory/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_CopyEngineFactory) + #endif +public: + CopyEngineFactory(); + ~CopyEngineFactory(); + /// \brief to return the instance of the copy engine + PluginInterface_CopyEngine * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion); + //get mode allowed + /// \brief define if can copy file, folder or both + Ultracopier::CopyType getCopyType(); + /// \brief to return which kind of transfer list operation is supported + Ultracopier::TransferListOperation getTransferListOperation(); + /// \brief define if can only copy, or copy and move + bool canDoOnlyCopy() const; + /// \brief to get the supported protocols for the source + QStringList supportedProtocolsForTheSource() const; + /// \brief to get the supported protocols for the destination + QStringList supportedProtocolsForTheDestination() const; + /// \brief to get the options of the copy engine + QWidget * options(); + +private: + Ui::copyEngineOptions *ui; + QWidget* tempWidget; + OptionInterface * optionsEngine; + bool errorFound; + FacilityInterface * facilityEngine; + Filters *filters; + RenamingRules *renamingRules; + QStorageInfo storageInfo; + QTimer lunchInitFunction; + QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; + QString firstRenamingRule,otherRenamingRule; + +#if defined(Q_OS_WIN32) || (defined(Q_OS_LINUX) && defined(_SC_PHYS_PAGES)) + static size_t getTotalSystemMemory(); +#endif +private slots: + void init(); + void setDoRightTransfer(bool doRightTransfer); + void setKeepDate(bool keepDate); + void setBlockSize(int blockSize); + void setParallelBuffer(int parallelBuffer); + void setSequentialBuffer(int sequentialBuffer); + void setParallelizeIfSmallerThan(int parallelizeIfSmallerThan); + void setAutoStart(bool autoStart); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + void setRsync(bool rsync); + #endif + void setFolderCollision(int index); + void setFolderError(int index); + void setTransferAlgorithm(int index); + void setCheckDestinationFolder(); + void showFilterDialog(); + void sendNewFilters(const QStringList &includeStrings,const QStringList &includeOptions,const QStringList &excludeStrings,const QStringList &excludeOptions); + void doChecksum_toggled(bool); + void checksumOnlyOnError_toggled(bool); + void osBuffer_toggled(bool); + void osBufferLimited_toggled(bool); + void osBufferLimit_editingFinished(); + void checksumIgnoreIfImpossible_toggled(bool); + void sendNewRenamingRules(const QString &firstRenamingRule, const QString &otherRenamingRule); + void showRenamingRules(); + void updateBufferCheckbox(); + void setFileCollision(int index); + void setFileError(int index); + void updatedBlockSize(); + void deletePartiallyTransferredFiles(bool checked); + void renameTheOriginalDestination(bool checked); + void checkDiskSpace(bool checked); + void defaultDestinationFolderBrowse(); + void defaultDestinationFolder(); + void followTheStrictOrder(bool checked); + void moveTheWholeFolder(bool checked); + void on_inodeThreads_editingFinished(); + void copyListOrder(bool checked); +public slots: + void resetOptions(); + void newLanguageLoaded(); +signals: + void reloadLanguage() const; +}; + +#endif // FACTORY_H diff --git a/plugins/CopyEngine/Ultracopier/DebugDialog.cpp b/plugins/CopyEngine/Ultracopier/DebugDialog.cpp new file mode 100644 index 0000000..a20f054 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DebugDialog.cpp @@ -0,0 +1,44 @@ +/** \file debugDialog.cpp +\brief Define the dialog to have debug information +\author alpha_one_x86 */ + +#include "DebugDialog.h" +#include "ui_debugDialog.h" + +#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + +DebugDialog::DebugDialog(QWidget *parent) : + QWidget(parent), + ui(new Ui::debugDialog) +{ + ui->setupUi(this); +} + +DebugDialog::~DebugDialog() +{ + delete ui; +} + +void DebugDialog::setTransferList(const QStringList &list) +{ + ui->tranferList->clear(); + ui->tranferList->addItems(list); +} + +void DebugDialog::setActiveTransfer(const int &activeTransfer) +{ + ui->spinBoxActiveTransfer->setValue(activeTransfer); +} + +void DebugDialog::setInodeUsage(const int &inodeUsage) +{ + ui->spinBoxNumberOfInode->setValue(inodeUsage); +} + +void DebugDialog::setTransferThreadList(const QStringList &list) +{ + ui->transferThreadList->clear(); + ui->transferThreadList->addItems(list); +} + +#endif diff --git a/plugins/CopyEngine/Ultracopier/DebugDialog.h b/plugins/CopyEngine/Ultracopier/DebugDialog.h new file mode 100644 index 0000000..d2b1d6b --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DebugDialog.h @@ -0,0 +1,39 @@ +/** \file debugDialog.h +\brief Define the dialog to have debug information +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef DEBUGDAILOG_H +#define DEBUGDAILOG_H + +#include "Environment.h" + +#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW +#include + +namespace Ui { + class debugDialog; +} + +/// \brief class to the dialog to have debug information +class DebugDialog : public QWidget +{ + Q_OBJECT +public: + explicit DebugDialog(QWidget *parent = 0); + ~DebugDialog(); + /// \brief to set the transfer list, limited in result to not slow down the application + void setTransferList(const QStringList &list); + /// \brief show the transfer thread, it show be a thread pool in normal time + void setTransferThreadList(const QStringList &list); + /// \brief show how many transfer is active + void setActiveTransfer(const int &activeTransfer); + /// \brief show many many inode is manipulated + void setInodeUsage(const int &inodeUsage); +private: + Ui::debugDialog *ui; +}; + +#endif // ULTRACOPIER_PLUGIN_DEBUG_WINDOW + +#endif // DEBUGDAILOG_H diff --git a/plugins/CopyEngine/Ultracopier/DebugEngineMacro.h b/plugins/CopyEngine/Ultracopier/DebugEngineMacro.h new file mode 100644 index 0000000..f9b5349 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DebugEngineMacro.h @@ -0,0 +1,28 @@ +/** \file DebugEngineMacro.h +\brief Define the macro for the debug +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef DEBUGENGINEMACRO_H +#define DEBUGENGINEMACRO_H + +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + +/// \brief Macro for the debug log +#ifdef ULTRACOPIER_PLUGIN_DEBUG + #if defined (__FILE__) && defined (__LINE__) + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b,__FILE__,__LINE__) + #else + #define ULTRACOPIER_DEBUGCONSOLE(a,b) emit debugInformation(a,__func__,b) + #endif +#else // ULTRACOPIER_PLUGIN_DEBUG + #define ULTRACOPIER_DEBUGCONSOLE(a,b) void() +#endif // ULTRACOPIER_PLUGIN_DEBUG + +#endif // DEBUGENGINEMACRO_H + + + + diff --git a/plugins/CopyEngine/Ultracopier/DiskSpace.cpp b/plugins/CopyEngine/Ultracopier/DiskSpace.cpp new file mode 100644 index 0000000..2b8fec7 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DiskSpace.cpp @@ -0,0 +1,53 @@ +#include "DiskSpace.h" +#include "ui_DiskSpace.h" +#include "StructEnumDefinition_CopyEngine.h" + +DiskSpace::DiskSpace(FacilityInterface * facilityEngine,QList list,QWidget *parent) : + QDialog(parent), + ui(new Ui::DiskSpace) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_LINUX + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + flags=flags | Qt::WindowStaysOnTopHint; + setWindowFlags(flags); + + ui->setupUi(this); + ok=false; + int index=0; + int size=list.size(); + QString drives; + while(indexsizeToString(list.at(index).freeSpace)) + .arg(facilityEngine->sizeToString(list.at(index).requiredSpace)); + drives+=QStringLiteral("
"); + index++; + } + ui->drives->setText(drives); +} + +DiskSpace::~DiskSpace() +{ + delete ui; +} + +void DiskSpace::on_ok_clicked() +{ + ok=true; + close(); +} + +void DiskSpace::on_cancel_clicked() +{ + ok=false; + close(); +} + +bool DiskSpace::getAction() const +{ + return ok; +} diff --git a/plugins/CopyEngine/Ultracopier/DiskSpace.h b/plugins/CopyEngine/Ultracopier/DiskSpace.h new file mode 100644 index 0000000..7d52b52 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DiskSpace.h @@ -0,0 +1,28 @@ +#ifndef DISKSPACE_H +#define DISKSPACE_H + +#include +#include "../../../interface/PluginInterface_CopyEngine.h" +#include "StructEnumDefinition_CopyEngine.h" + +namespace Ui { +class DiskSpace; +} + +class DiskSpace : public QDialog +{ + Q_OBJECT + +public: + explicit DiskSpace(FacilityInterface * facilityEngine,QList list,QWidget *parent = 0); + ~DiskSpace(); + bool getAction() const; +private slots: + void on_ok_clicked(); + void on_cancel_clicked(); +private: + Ui::DiskSpace *ui; + bool ok; +}; + +#endif // DISKSPACE_H diff --git a/plugins/CopyEngine/Ultracopier/DiskSpace.ui b/plugins/CopyEngine/Ultracopier/DiskSpace.ui new file mode 100644 index 0000000..10b5c69 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DiskSpace.ui @@ -0,0 +1,68 @@ + + + DiskSpace + + + + 0 + 0 + 367 + 146 + + + + Disk space + + + + :/CopyEngine/Ultracopier/resources/remove.png:/CopyEngine/Ultracopier/resources/remove.png + + + + + + You need more space on this drive to finish this transfer + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Continue + + + + + + + Cancel + + + + + + + + + + + + diff --git a/plugins/CopyEngine/Ultracopier/DriveManagement.cpp b/plugins/CopyEngine/Ultracopier/DriveManagement.cpp new file mode 100644 index 0000000..221b4e8 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DriveManagement.cpp @@ -0,0 +1,102 @@ +#include "DriveManagement.h" + +#include +#include +#include + +DriveManagement::DriveManagement() +{ + tryUpdate(); + #ifdef Q_OS_WIN32 + reg1=QRegularExpression(QStringLiteral("^(\\\\\\\\|//)[^\\\\\\\\/]+(\\\\|/)[^\\\\\\\\/]+")); + reg2=QRegularExpression(QStringLiteral("^((\\\\\\\\|//)[^\\\\\\\\/]+(\\\\|/)[^\\\\\\\\/]+).*$")); + reg3=QRegularExpression(QStringLiteral("^[a-zA-Z]:[\\\\/]")); + reg4=QRegularExpression(QStringLiteral("^([a-zA-Z]:[\\\\/]).*$")); + #endif + /// \warn ULTRACOPIER_DEBUGCONSOLE() don't work here because the sinal slot is not connected! +} + +//get drive of an file or folder +QString DriveManagement::getDrive(const QString &fileOrFolder) const +{ + const QString &inode=QDir::toNativeSeparators(fileOrFolder); + int size=mountSysPoint.size(); + for (int i = 0; i < size; ++i) { + if(inode.startsWith(mountSysPoint.at(i))) + return QDir::toNativeSeparators(mountSysPoint.at(i)); + } + #ifdef Q_OS_WIN32 + if(fileOrFolder.contains(reg1)) + { + QString returnString=fileOrFolder; + returnString.replace(reg2,QStringLiteral("\\1")); + return returnString; + } + //due to lack of WMI support into mingw, the new drive event is never called, this is a workaround + if(fileOrFolder.contains(reg3)) + { + QString returnString=fileOrFolder; + returnString.replace(reg4,QStringLiteral("\\1")); + return QDir::toNativeSeparators(returnString).toUpper(); + } + #endif + //if unable to locate the right mount point + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("unable to locate the right mount point for: %1, mount point: %2").arg(fileOrFolder).arg(mountSysPoint.join(";"))); + return QString(); +} + +QByteArray DriveManagement::getDriveType(const QString &drive) const +{ + int index=mountSysPoint.indexOf(drive); + if(index!=-1) + return driveType.at(index); + return QByteArray(); +} + +bool DriveManagement::isSameDrive(const QString &file1,const QString &file2) const +{ + if(mountSysPoint.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("no mount point found")); + return false; + } + const QString &drive1=getDrive(file1); + if(drive1.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("drive for the file1 not found: %1").arg(file1)); + return false; + } + const QString &drive2=getDrive(file2); + if(drive2.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("drive for the file2 not found: %1").arg(file2)); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("%1 is egal to %2?").arg(drive1).arg(drive2)); + if(drive1==drive2) + return true; + else + return false; +} + +void DriveManagement::tryUpdate() +{ + mountSysPoint.clear(); + driveType.clear(); + const QList mountedVolumesList=QStorageInfo::mountedVolumes(); + int index=0; + while(index +#include +#include +#include +#include +#include + +#include "Environment.h" + +class DriveManagement : public QObject +{ + Q_OBJECT +public: + explicit DriveManagement(); + bool isSameDrive(const QString &file1,const QString &file2) const; + /// \brief get drive of an file or folder + QString getDrive(const QString &fileOrFolder) const; + QByteArray getDriveType(const QString &drive) const; + void tryUpdate(); +protected: + QStringList mountSysPoint; + QList driveType; + #ifdef Q_OS_WIN32 + QRegularExpression reg1,reg2,reg3,reg4; + #endif +signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; +}; + +#endif // DRIVEMANAGEMENT_H diff --git a/plugins/CopyEngine/Ultracopier/Environment.h b/plugins/CopyEngine/Ultracopier/Environment.h new file mode 100644 index 0000000..34db2a2 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Environment.h @@ -0,0 +1,11 @@ +/** \file Environment.h +\brief Define the environment variable and global function +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "Variable.h" +/// \brief The global include +#include "StructEnumDefinition.h" +#include "StructEnumDefinition_CopyEngine.h" +#include "DebugEngineMacro.h" +#include "CompilerInfo.h" diff --git a/plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp b/plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp new file mode 100644 index 0000000..736cfeb --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp @@ -0,0 +1,163 @@ +#include "FileErrorDialog.h" +#include "ui_fileErrorDialog.h" +#include "TransferThread.h" + +#include + +bool FileErrorDialog::isInAdmin=false; + +FileErrorDialog::FileErrorDialog(QWidget *parent, QFileInfo fileInfo, QString errorString, const ErrorType &errorType) : + QDialog(parent), + ui(new Ui::fileErrorDialog) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_LINUX + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + flags=flags | Qt::WindowStaysOnTopHint; + setWindowFlags(flags); + + ui->setupUi(this); + action=FileError_Cancel; + ui->label_error->setText(errorString); + if(fileInfo.exists()) + { + ui->label_content_file_name->setText(TransferThread::resolvedName(fileInfo)); + if(ui->label_content_file_name->text().isEmpty()) + { + ui->label_content_file_name->setText(fileInfo.absoluteFilePath()); + ui->label_folder->setVisible(false); + ui->label_content_folder->setVisible(false); + } + else + { + QString folder=fileInfo.absolutePath(); + if(folder.size()>80) + folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); + ui->label_content_folder->setText(fileInfo.absolutePath()); + } + ui->label_content_size->setText(QString::number(fileInfo.size())); + QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); + if(maxTimelabel_modified->setVisible(true); + ui->label_content_modified->setVisible(true); + ui->label_content_modified->setText(fileInfo.lastModified().toString()); + } + else + { + ui->label_modified->setVisible(false); + ui->label_content_modified->setVisible(false); + } + if(fileInfo.isDir()) + { + this->setWindowTitle(tr("Error on folder")); + ui->label_size->hide(); + ui->label_content_size->hide(); + ui->label_file_name->setText(tr("Folder name")); + } + ui->label_file_destination->setVisible(fileInfo.isSymLink()); + ui->label_content_file_destination->setVisible(fileInfo.isSymLink()); + if(fileInfo.isSymLink()) + ui->label_content_file_destination->setText(fileInfo.symLinkTarget()); + } + else + { + ui->label_content_file_name->setText(TransferThread::resolvedName(fileInfo)); + if(ui->label_content_file_name->text().isEmpty()) + { + ui->label_content_file_name->setText(fileInfo.absoluteFilePath()); + ui->label_folder->setVisible(false); + ui->label_content_folder->setVisible(false); + } + else + ui->label_content_folder->setText(fileInfo.absolutePath()); + + ui->label_file_destination->hide(); + ui->label_content_file_destination->hide(); + ui->label_size->hide(); + ui->label_content_size->hide(); + ui->label_modified->hide(); + ui->label_content_modified->hide(); + } + if(errorType==ErrorType_Folder || errorType==ErrorType_FolderWithRety) + ui->PutToBottom->hide(); + if(errorType==ErrorType_Folder) + ui->Retry->hide(); + + ui->Rights->hide(); + #ifdef ULTRACOPIER_PLUGIN_RIGHTS + if(isInAdmin) + ui->Rights->hide(); + #ifdef Q_OS_WIN32 + if(errorType!=ErrorType_Rights) + ui->Rights->hide(); + #else + ui->Rights->hide(); + #endif + #else + ui->Rights->hide(); + #endif +} + +FileErrorDialog::~FileErrorDialog() +{ + delete ui; +} + +void FileErrorDialog::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void FileErrorDialog::on_PutToBottom_clicked() +{ + action=FileError_PutToEndOfTheList; + this->close(); +} + +void FileErrorDialog::on_Retry_clicked() +{ + action=FileError_Retry; + this->close(); +} + +void FileErrorDialog::on_Skip_clicked() +{ + action=FileError_Skip; + this->close(); +} + +void FileErrorDialog::on_Cancel_clicked() +{ + action=FileError_Cancel; + this->close(); +} + +bool FileErrorDialog::getAlways() +{ + return ui->checkBoxAlways->isChecked(); +} + +FileErrorAction FileErrorDialog::getAction() +{ + return action; +} + +void FileErrorDialog::on_checkBoxAlways_clicked() +{ + ui->Rights->setEnabled(!ui->checkBoxAlways->isChecked()); +} + +#ifdef ULTRACOPIER_PLUGIN_RIGHTS +void FileErrorDialog::on_Rights_clicked() +{ +} +#endif diff --git a/plugins/CopyEngine/Ultracopier/FileErrorDialog.h b/plugins/CopyEngine/Ultracopier/FileErrorDialog.h new file mode 100644 index 0000000..09a481e --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileErrorDialog.h @@ -0,0 +1,51 @@ +/** \file fileErrorDialog.h +\brief Define the dialog error on the file +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include "Environment.h" + +#ifndef FILEERRORDIALOG_H +#define FILEERRORDIALOG_H + + + +namespace Ui { + class fileErrorDialog; +} + +/// \brief to show error dialog, and ask what do +class FileErrorDialog : public QDialog +{ + Q_OBJECT +public: + /// \brief create the object and pass all the informations to it + explicit FileErrorDialog(QWidget *parent,QFileInfo fileInfo,QString errorString,const ErrorType &errorType); + ~FileErrorDialog(); + /// \brief return the the always checkbox is checked + bool getAlways(); + /// \brief return the action clicked + FileErrorAction getAction(); +protected: + void changeEvent(QEvent *e); + static bool isInAdmin; +private slots: + void on_PutToBottom_clicked(); + void on_Retry_clicked(); + void on_Skip_clicked(); + void on_Cancel_clicked(); + void on_checkBoxAlways_clicked(); + #ifdef ULTRACOPIER_PLUGIN_RIGHTS + void on_Rights_clicked(); + #endif +private: + Ui::fileErrorDialog *ui; + FileErrorAction action; +}; + +#endif // FILEERRORDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp b/plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp new file mode 100644 index 0000000..0e3ca78 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp @@ -0,0 +1,238 @@ +#include "FileExistsDialog.h" +#include "ui_fileExistsDialog.h" +#include "TransferThread.h" + +#include +#include +#include + +FileExistsDialog::FileExistsDialog(QWidget *parent,QFileInfo source,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule) : + QDialog(parent), + ui(new Ui::fileExistsDialog) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_LINUX + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + flags=flags | Qt::WindowStaysOnTopHint; + setWindowFlags(flags); + + ui->setupUi(this); + action=FileExists_Cancel; + destinationInfo=destination; + oldName=TransferThread::resolvedName(destination); + ui->lineEditNewName->setText(oldName); + ui->lineEditNewName->setPlaceholderText(oldName); + ui->Overwrite->addAction(ui->actionOverwrite_if_newer); + ui->Overwrite->addAction(ui->actionOverwrite_if_not_same_modification_date); + ui->label_content_source_size->setText(QString::number(source.size())); + ui->label_content_source_modified->setText(source.lastModified().toString()); + ui->label_content_source_file_name->setText(TransferThread::resolvedName(source)); + QString folder=source.absolutePath(); + if(folder.size()>80) + folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); + ui->label_content_source_folder->setText(folder); + ui->label_content_destination_size->setText(QString::number(destination.size())); + ui->label_content_destination_modified->setText(destination.lastModified().toString()); + ui->label_content_destination_file_name->setText(TransferThread::resolvedName(destination)); + folder=destination.absolutePath(); + if(folder.size()>80) + folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); + ui->label_content_destination_folder->setText(folder); + QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); + if(maxTimelabel_source_modified->setVisible(true); + ui->label_content_source_modified->setVisible(true); + ui->label_content_source_modified->setText(source.lastModified().toString()); + } + else + { + ui->label_source_modified->setVisible(false); + ui->label_content_source_modified->setVisible(false); + } + if(maxTimelabel_destination_modified->setVisible(true); + ui->label_content_destination_modified->setVisible(true); + ui->label_content_destination_modified->setText(destination.lastModified().toString()); + } + else + { + ui->label_destination_modified->setVisible(false); + ui->label_content_destination_modified->setVisible(false); + } + if(!source.exists()) + { + ui->label_content_source_size->setVisible(false); + ui->label_source_size->setVisible(false); + ui->label_source_modified->setVisible(false); + ui->label_content_source_modified->setVisible(false); + } + if(!destination.exists()) + { + ui->label_content_destination_size->setVisible(false); + ui->label_destination_size->setVisible(false); + ui->label_destination_modified->setVisible(false); + ui->label_content_destination_modified->setVisible(false); + } + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + on_SuggestNewName_clicked(); +} + +FileExistsDialog::~FileExistsDialog() +{ + delete ui; +} + +void FileExistsDialog::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +QString FileExistsDialog::getNewName() +{ + if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) + return oldName; + else + return ui->lineEditNewName->text(); +} + +void FileExistsDialog::on_SuggestNewName_clicked() +{ + QFileInfo destinationInfo=this->destinationInfo; + QString absolutePath=destinationInfo.absolutePath(); + QString fileName=TransferThread::resolvedName(destinationInfo); + QString suffix=""; + QString destination; + QString newFileName; + //resolv the suffix + if(fileName.contains(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")))) + { + suffix=fileName; + suffix.replace(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")),QStringLiteral("\\2")); + fileName.replace(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")),QStringLiteral("\\1")); + } + //resolv the new name + int num=1; + do + { + if(num==1) + { + if(firstRenamingRule==QStringLiteral("")) + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=firstRenamingRule; + newFileName.replace("%name%",fileName); + } + } + else + { + if(otherRenamingRule=="") + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=otherRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + destination=absolutePath+QDir::separator()+newFileName+suffix; + destinationInfo.setFile(destination); + num++; + } + while(destinationInfo.exists()); + ui->lineEditNewName->setText(newFileName+suffix); +} + +void FileExistsDialog::on_Rename_clicked() +{ + action=FileExists_Rename; + this->close(); +} + +void FileExistsDialog::on_Overwrite_clicked() +{ + action=FileExists_Overwrite; + this->close(); +} + +void FileExistsDialog::on_Skip_clicked() +{ + action=FileExists_Skip; + this->close(); +} + +void FileExistsDialog::on_Cancel_clicked() +{ + action=FileExists_Cancel; + this->close(); +} + +void FileExistsDialog::on_actionOverwrite_if_newer_triggered() +{ + action=FileExists_OverwriteIfNewer; + this->close(); +} + +void FileExistsDialog::on_actionOverwrite_if_not_same_modification_date_triggered() +{ + action=FileExists_OverwriteIfNotSame; + this->close(); +} + +FileExistsAction FileExistsDialog::getAction() +{ + return action; +} + +bool FileExistsDialog::getAlways() +{ + return ui->checkBoxAlways->isChecked(); +} + +void FileExistsDialog::updateRenameButton() +{ + ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (!ui->lineEditNewName->text().contains(QRegularExpression("[/\\\\\\*]")) && oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); +} + +void FileExistsDialog::on_checkBoxAlways_toggled(bool checked) +{ + Q_UNUSED(checked); + updateRenameButton(); +} + +void FileExistsDialog::on_lineEditNewName_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + updateRenameButton(); +} + +void FileExistsDialog::on_lineEditNewName_returnPressed() +{ + updateRenameButton(); + if(ui->Rename->isEnabled()) + on_Rename_clicked(); + else + QMessageBox::warning(this,tr("Error"),tr("Try rename with using special characters")); +} + +void FileExistsDialog::on_actionOverwrite_if_older_triggered() +{ + action=FileExists_OverwriteIfOlder; + this->close(); +} + +void FileExistsDialog::on_lineEditNewName_editingFinished() +{ + updateRenameButton(); +} diff --git a/plugins/CopyEngine/Ultracopier/FileExistsDialog.h b/plugins/CopyEngine/Ultracopier/FileExistsDialog.h new file mode 100644 index 0000000..c637e3b --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileExistsDialog.h @@ -0,0 +1,60 @@ +/** \file fileExistsDialog.h +\brief Define the dialog when file already exists +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include +#include "Environment.h" + +#ifndef FILEEXISTSDIALOG_H +#define FILEEXISTSDIALOG_H + +namespace Ui { + class fileExistsDialog; +} + +/// \brief to show file exists dialog, and ask what do +class FileExistsDialog : public QDialog +{ + Q_OBJECT +public: + /// \brief create the object and pass all the informations to it + explicit FileExistsDialog(QWidget *parent,QFileInfo source,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule); + ~FileExistsDialog(); + /// \brief return the the always checkbox is checked + bool getAlways(); + /// \brief return the action clicked + FileExistsAction getAction(); + /// \brief return the new rename is case in manual renaming + QString getNewName(); +protected: + void changeEvent(QEvent *e); +private slots: + void on_SuggestNewName_clicked(); + void on_Rename_clicked(); + void on_Overwrite_clicked(); + void on_Skip_clicked(); + void on_Cancel_clicked(); + void on_actionOverwrite_if_newer_triggered(); + void on_actionOverwrite_if_not_same_modification_date_triggered(); + void updateRenameButton(); + void on_checkBoxAlways_toggled(bool checked); + void on_lineEditNewName_textChanged(const QString &arg1); + void on_lineEditNewName_returnPressed(); + void on_actionOverwrite_if_older_triggered(); + void on_lineEditNewName_editingFinished(); +private: + Ui::fileExistsDialog *ui; + FileExistsAction action; + QString oldName; + QFileInfo destinationInfo; + QString firstRenamingRule; + QString otherRenamingRule; +}; + +#endif // FILEEXISTSDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp b/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp new file mode 100644 index 0000000..7f3d565 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp @@ -0,0 +1,188 @@ +#include "FileIsSameDialog.h" +#include "ui_fileIsSameDialog.h" +#include "TransferThread.h" + +#include +#include +#include + +FileIsSameDialog::FileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule) : + QDialog(parent), + ui(new Ui::fileIsSameDialog) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_LINUX + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + flags=flags | Qt::WindowStaysOnTopHint; + setWindowFlags(flags); + + ui->setupUi(this); + action=FileExists_Cancel; + oldName=TransferThread::resolvedName(fileInfo); + destinationInfo=fileInfo; + ui->lineEditNewName->setText(oldName); + ui->lineEditNewName->setPlaceholderText(oldName); + ui->label_content_size->setText(QString::number(fileInfo.size())); + ui->label_content_modified->setText(fileInfo.lastModified().toString()); + ui->label_content_file_name->setText(TransferThread::resolvedName(fileInfo)); + QString folder=fileInfo.absolutePath(); + if(folder.size()>80) + folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); + ui->label_content_folder->setText(folder); + updateRenameButton(); + QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); + if(maxTimelabel_modified->setVisible(true); + ui->label_content_modified->setVisible(true); + ui->label_content_modified->setText(fileInfo.lastModified().toString()); + } + else + { + ui->label_modified->setVisible(false); + ui->label_content_modified->setVisible(false); + } + if(!fileInfo.exists()) + { + ui->label_content_size->setVisible(false); + ui->label_size->setVisible(false); + ui->label_modified->setVisible(false); + ui->label_content_modified->setVisible(false); + } + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + on_SuggestNewName_clicked(); +} + +FileIsSameDialog::~FileIsSameDialog() +{ + delete ui; +} + +void FileIsSameDialog::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +QString FileIsSameDialog::getNewName() +{ + if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) + return oldName; + else + return ui->lineEditNewName->text(); +} + +void FileIsSameDialog::on_SuggestNewName_clicked() +{ + QFileInfo destinationInfo=this->destinationInfo; + QString absolutePath=destinationInfo.absolutePath(); + QString fileName=TransferThread::resolvedName(destinationInfo); + QString suffix=""; + QString destination; + QString newFileName; + //resolv the suffix + if(fileName.contains(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")))) + { + suffix=fileName; + suffix.replace(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")),QStringLiteral("\\2")); + fileName.replace(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")),QStringLiteral("\\1")); + } + //resolv the new name + int num=1; + do + { + if(num==1) + { + if(firstRenamingRule=="") + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=firstRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + } + } + else + { + if(otherRenamingRule=="") + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=otherRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + destination=absolutePath+QDir::separator()+newFileName+suffix; + destinationInfo.setFile(destination); + num++; + } + while(destinationInfo.exists()); + ui->lineEditNewName->setText(newFileName+suffix); +} + +void FileIsSameDialog::on_Rename_clicked() +{ + action=FileExists_Rename; + this->close(); +} + +void FileIsSameDialog::on_Skip_clicked() +{ + action=FileExists_Skip; + this->close(); +} + +void FileIsSameDialog::on_Cancel_clicked() +{ + action=FileExists_Cancel; + this->close(); +} + +FileExistsAction FileIsSameDialog::getAction() +{ + return action; +} + +bool FileIsSameDialog::getAlways() +{ + return ui->checkBoxAlways->isChecked(); +} + +void FileIsSameDialog::updateRenameButton() +{ + ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (!ui->lineEditNewName->text().contains(QRegularExpression("[/\\\\\\*]")) && oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); +} + +void FileIsSameDialog::on_lineEditNewName_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + updateRenameButton(); +} + +void FileIsSameDialog::on_checkBoxAlways_toggled(bool checked) +{ + Q_UNUSED(checked); + updateRenameButton(); +} + +void FileIsSameDialog::on_lineEditNewName_returnPressed() +{ + updateRenameButton(); + if(ui->Rename->isEnabled()) + on_Rename_clicked(); + else + QMessageBox::warning(this,tr("Error"),tr("Try rename with using special characters")); +} + +void FileIsSameDialog::on_lineEditNewName_editingFinished() +{ + updateRenameButton(); +} diff --git a/plugins/CopyEngine/Ultracopier/FileIsSameDialog.h b/plugins/CopyEngine/Ultracopier/FileIsSameDialog.h new file mode 100644 index 0000000..c9be99c --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileIsSameDialog.h @@ -0,0 +1,57 @@ +/** \file fileIsSameDialog.h +\brief Define the dialog when file is same +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include +#include "Environment.h" + +#ifndef FILEISSAMEDIALOG_H +#define FILEISSAMEDIALOG_H + +namespace Ui { + class fileIsSameDialog; +} + +/// \brief to show file is same dialog, and ask what do +class FileIsSameDialog : public QDialog +{ + Q_OBJECT +public: + /// \brief create the object and pass all the informations to it + explicit FileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule); + ~FileIsSameDialog(); + /// \brief return the the always checkbox is checked + bool getAlways(); + /// \brief return the action clicked + FileExistsAction getAction(); + /// \brief return the new rename is case in manual renaming + QString getNewName(); +protected: + void changeEvent(QEvent *e); +private slots: + void on_SuggestNewName_clicked(); + void on_Rename_clicked(); + void on_Skip_clicked(); + void on_Cancel_clicked(); + void updateRenameButton(); + void on_lineEditNewName_textChanged(const QString &arg1); + void on_checkBoxAlways_toggled(bool checked); + void on_lineEditNewName_returnPressed(); + void on_lineEditNewName_editingFinished(); +private: + Ui::fileIsSameDialog *ui; + FileExistsAction action; + QString oldName; + QFileInfo destinationInfo; + QString firstRenamingRule; + QString otherRenamingRule; + +}; + +#endif // FILEISSAMEDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier/FilterRules.cpp b/plugins/CopyEngine/Ultracopier/FilterRules.cpp new file mode 100644 index 0000000..5d1827e --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FilterRules.cpp @@ -0,0 +1,193 @@ +#include "FilterRules.h" +#include "ui_FilterRules.h" + +#include + +FilterRules::FilterRules(QWidget *parent) : + QDialog(parent), + ui(new Ui::FilterRules) +{ + ui->setupUi(this); + updateChecking(); + haveBeenValided=false; +} + +FilterRules::~FilterRules() +{ + delete ui; +} + +bool FilterRules::getIsValid() +{ + return isValid && haveBeenValided; +} + +QString FilterRules::get_search_text() +{ + return ui->search->text(); +} + +SearchType FilterRules::get_search_type() +{ + switch(ui->search_type->currentIndex()) + { + case 0: + return SearchType_rawText; + case 1: + return SearchType_simpleRegex; + case 2: + return SearchType_perlRegex; + } + return SearchType_simpleRegex; +} + +ApplyOn FilterRules::get_apply_on() +{ + switch(ui->apply_on->currentIndex()) + { + case 0: + return ApplyOn_file; + case 1: + return ApplyOn_fileAndFolder; + case 2: + return ApplyOn_folder; + } + return ApplyOn_fileAndFolder; +} + +bool FilterRules::get_need_match_all() +{ + return ui->need_match_all->isChecked(); +} + +void FilterRules::set_search_text(QString search_text) +{ + ui->search->setText(search_text); +} + +void FilterRules::set_search_type(SearchType search_type) +{ + switch(search_type) + { + case SearchType_rawText: + ui->search_type->setCurrentIndex(0); + break; + case SearchType_simpleRegex: + ui->search_type->setCurrentIndex(1); + break; + case SearchType_perlRegex: + ui->search_type->setCurrentIndex(2); + break; + } +} + +void FilterRules::set_apply_on(ApplyOn apply_on) +{ + switch(apply_on) + { + case ApplyOn_file: + ui->apply_on->setCurrentIndex(0); + break; + case ApplyOn_fileAndFolder: + ui->apply_on->setCurrentIndex(1); + break; + case ApplyOn_folder: + ui->apply_on->setCurrentIndex(2); + break; + } +} + +void FilterRules::set_need_match_all(bool need_match_all) +{ + ui->need_match_all->setChecked(need_match_all); +} + +void FilterRules::on_search_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + updateChecking(); +} + +void FilterRules::updateChecking() +{ + QRegularExpression regex; + isValid=!ui->search->text().isEmpty(); + if(isValid) + { + QString tempString; + if(ui->search_type->currentIndex()==0) + { + tempString=QRegularExpression::escape(ui->search->text()); + if(tempString.contains('/') || tempString.contains('\\')) + isValid=false; + } + else if(ui->search_type->currentIndex()==1) + { + tempString=QRegularExpression::escape(ui->search->text()); + tempString.replace(QStringLiteral("\\*"),QStringLiteral("[^\\\\/]*")); + } + else if(ui->search_type->currentIndex()==2) + { + tempString=ui->search->text(); + if(tempString.startsWith('^') && tempString.endsWith('$')) + { + ui->need_match_all->setChecked(true); + tempString.remove(QRegularExpression(QStringLiteral("^\\^"))); + tempString.remove(QRegularExpression(QStringLiteral("\\$$"))); + ui->search->setText(tempString); + } + } + if(isValid) + { + if(ui->need_match_all->isChecked()) + tempString=QStringLiteral("^")+tempString+QStringLiteral("$"); + regex=QRegularExpression(tempString); + isValid=regex.isValid(); + } + } + + ui->isValid->setChecked(isValid); + ui->testString->setEnabled(isValid); + ui->label_test_string->setEnabled(isValid); + ui->matched->setEnabled(isValid); + ui->matched->setChecked(isValid && ui->testString->text().contains(regex)); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid); +} + +void FilterRules::on_isValid_clicked() +{ + updateChecking(); +} + +void FilterRules::on_testString_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + updateChecking(); +} + +void FilterRules::on_matched_clicked() +{ + updateChecking(); +} + +void FilterRules::on_search_type_currentIndexChanged(int index) +{ + Q_UNUSED(index); + updateChecking(); +} + +void FilterRules::on_need_match_all_clicked() +{ + updateChecking(); +} + +void FilterRules::on_buttonBox_clicked(QAbstractButton *button) +{ + if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) + reject(); + else + { + haveBeenValided=true; + accept(); + } +} diff --git a/plugins/CopyEngine/Ultracopier/FilterRules.h b/plugins/CopyEngine/Ultracopier/FilterRules.h new file mode 100644 index 0000000..f06f0cb --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FilterRules.h @@ -0,0 +1,46 @@ +#ifndef FILTERRULES_H +#define FILTERRULES_H + +#include +#include +#include + +#include "StructEnumDefinition_CopyEngine.h" + +namespace Ui { +class FilterRules; +} + +/** All the filter rules to include/exclude some file during the listing */ +class FilterRules : public QDialog +{ + Q_OBJECT + +public: + explicit FilterRules(QWidget *parent = 0); + ~FilterRules(); + bool getIsValid(); + QString get_search_text(); + SearchType get_search_type(); + ApplyOn get_apply_on(); + bool get_need_match_all(); + void set_search_text(QString search_text); + void set_search_type(SearchType search_type); + void set_apply_on(ApplyOn apply_on); + void set_need_match_all(bool need_match_all); +private slots: + void on_search_textChanged(const QString &arg1); + void on_isValid_clicked(); + void on_testString_textChanged(const QString &arg1); + void on_matched_clicked(); + void on_search_type_currentIndexChanged(int index); + void on_need_match_all_clicked(); + void on_buttonBox_clicked(QAbstractButton *button); +private: + Ui::FilterRules *ui; + void updateChecking(); + bool isValid; + bool haveBeenValided; +}; + +#endif // FILTERRULES_H diff --git a/plugins/CopyEngine/Ultracopier/FilterRules.ui b/plugins/CopyEngine/Ultracopier/FilterRules.ui new file mode 100644 index 0000000..a4006fe --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FilterRules.ui @@ -0,0 +1,162 @@ + + + FilterRules + + + Qt::WindowModal + + + + 0 + 0 + 289 + 231 + + + + Filters dialog + + + + :/CopyEngine/resources/resources/filter.png:/CopyEngine/resources/resources/filter.png + + + + 1 + + + 1 + + + + + Search: + + + + + + + + + + Search type: + + + + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + + + + Apply on: + + + + + + + + File + + + + + Folder + + + + + File and folder + + + + + + + + Whole string must match + + + + + + + Checking + + + + + + The regex is valid + + + + + + + Test string: + + + + + + + + + + The test string matches with the regex + + + + + + + + + + + + Qt::Horizontal + + + + 68 + 20 + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + diff --git a/plugins/CopyEngine/Ultracopier/Filters.cpp b/plugins/CopyEngine/Ultracopier/Filters.cpp new file mode 100644 index 0000000..3bb81d1 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Filters.cpp @@ -0,0 +1,457 @@ +#include "Filters.h" +#include "ui_Filters.h" + +#include + +Filters::Filters(QWidget *parent) : + QDialog(parent), + ui(new Ui::Filters) +{ + ui->setupUi(this); +} + +Filters::~Filters() +{ + delete ui; +} + +void Filters::setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) +{ + if(includeStrings.size()!=includeOptions.size() || excludeStrings.size()!=excludeOptions.size()) + return; + Filters_rules new_item; + + include.clear(); + int index=0; + while(indexinclusion->clear(); + int index=0; + while(indexinclusion->addItem(new QListWidgetItem(entryShow)); + index++; + } + ui->exclusion->clear(); + index=0; + while(indexexclusion->addItem(new QListWidgetItem(entryShow)); + index++; + } +} + +QList Filters::getInclude() const +{ + return include; +} + +QList Filters::getExclude() const +{ + return exclude; +} + +void Filters::newLanguageLoaded() +{ + ui->retranslateUi(this); + reShowAll(); +} + +void Filters::updateFilters() +{ + QStringList includeStrings,includeOptions,excludeStrings,excludeOptions; + int index=0; + while(indexexclusion->count()) + { + if(ui->exclusion->item(index)->isSelected()) + { + delete ui->exclusion->item(index); + exclude.removeAt(index); + removedEntry=true; + } + else + index++; + } + if(removedEntry) + { + reShowAll(); + updateFilters(); + } +} + +void Filters::on_remove_inclusion_clicked() +{ + bool removedEntry=false; + int index=0; + while(indexinclusion->count()) + { + if(ui->inclusion->item(index)->isSelected()) + { + delete ui->inclusion->item(index); + include.removeAt(index); + removedEntry=true; + } + else + index++; + } + if(removedEntry) + { + reShowAll(); + updateFilters(); + } +} + +void Filters::on_add_exclusion_clicked() +{ + FilterRules dialog(this); + dialog.exec(); + if(dialog.getIsValid()) + { + Filters_rules new_item; + new_item.apply_on=dialog.get_apply_on(); + new_item.need_match_all=dialog.get_need_match_all(); + new_item.search_text=dialog.get_search_text(); + new_item.search_type=dialog.get_search_type(); + exclude << new_item; + reShowAll(); + updateFilters(); + } +} + +void Filters::on_buttonBox_clicked(QAbstractButton *button) +{ + if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) + reject(); +} + +void Filters::on_add_inclusion_clicked() +{ + FilterRules dialog(this); + dialog.exec(); + if(dialog.getIsValid()) + { + Filters_rules new_item; + new_item.apply_on=dialog.get_apply_on(); + new_item.need_match_all=dialog.get_need_match_all(); + new_item.search_text=dialog.get_search_text(); + new_item.search_type=dialog.get_search_type(); + if(convertToRegex(new_item)) + include << new_item; + reShowAll(); + updateFilters(); + } +} + +void Filters::on_edit_exclusion_clicked() +{ + bool editedEntry=false; + int index=0; + while(indexexclusion->count()) + { + if(ui->exclusion->item(index)->isSelected()) + { + FilterRules dialog(this); + dialog.set_apply_on(exclude.at(index).apply_on); + dialog.set_need_match_all(exclude.at(index).need_match_all); + dialog.set_search_text(exclude.at(index).search_text); + dialog.set_search_type(exclude.at(index).search_type); + dialog.exec(); + if(dialog.getIsValid()) + { + exclude[index].apply_on=dialog.get_apply_on(); + exclude[index].need_match_all=dialog.get_need_match_all(); + exclude[index].search_text=dialog.get_search_text(); + exclude[index].search_type=dialog.get_search_type(); + if(!convertToRegex(exclude[index])) + exclude.removeAt(index); + editedEntry=true; + } + } + index++; + } + if(editedEntry) + { + reShowAll(); + updateFilters(); + } +} + +void Filters::on_edit_inclusion_clicked() +{ + bool editedEntry=false; + int index=0; + while(indexinclusion->count()) + { + if(ui->inclusion->item(index)->isSelected()) + { + FilterRules dialog(this); + dialog.set_apply_on(exclude.at(index).apply_on); + dialog.set_need_match_all(exclude.at(index).need_match_all); + dialog.set_search_text(exclude.at(index).search_text); + dialog.set_search_type(exclude.at(index).search_type); + dialog.exec(); + if(dialog.getIsValid()) + { + exclude[index].apply_on=dialog.get_apply_on(); + exclude[index].need_match_all=dialog.get_need_match_all(); + exclude[index].search_text=dialog.get_search_text(); + exclude[index].search_type=dialog.get_search_type(); + if(!convertToRegex(exclude[index])) + exclude.removeAt(index); + editedEntry=true; + } + } + index++; + } + if(editedEntry) + { + reShowAll(); + updateFilters(); + } +} diff --git a/plugins/CopyEngine/Ultracopier/Filters.h b/plugins/CopyEngine/Ultracopier/Filters.h new file mode 100644 index 0000000..337f8cb --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Filters.h @@ -0,0 +1,45 @@ +#ifndef FILTERS_H +#define FILTERS_H + +#include +#include + +#include "FilterRules.h" +#include "StructEnumDefinition_CopyEngine.h" + +namespace Ui { +class Filters; +} + +/** To add/edit one filter rules */ +class Filters : public QDialog +{ + Q_OBJECT +public: + explicit Filters(QWidget *parent = 0); + ~Filters(); + void setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); + void reShowAll(); + QList getInclude() const; + QList getExclude() const; + void newLanguageLoaded(); +private: + Ui::Filters *ui; + QList include; + QList exclude; + void updateFilters(); + bool convertToRegex(Filters_rules &item); +signals: + void sendNewFilters(const QStringList &includeStrings,const QStringList &includeOptions,const QStringList &excludeStrings,const QStringList &excludeOptions) const; + void haveNewFilters() const; +private slots: + void on_remove_exclusion_clicked(); + void on_remove_inclusion_clicked(); + void on_add_exclusion_clicked(); + void on_buttonBox_clicked(QAbstractButton *button); + void on_add_inclusion_clicked(); + void on_edit_exclusion_clicked(); + void on_edit_inclusion_clicked(); +}; + +#endif // FILTERS_H diff --git a/plugins/CopyEngine/Ultracopier/Filters.ui b/plugins/CopyEngine/Ultracopier/Filters.ui new file mode 100644 index 0000000..33822af --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Filters.ui @@ -0,0 +1,194 @@ + + + Filters + + + + 0 + 0 + 507 + 502 + + + + Filters + + + + :/CopyEngine/Ultracopier/resources/filter.png:/CopyEngine/Ultracopier/resources/filter.png + + + + 1 + + + 1 + + + + + Exclusion filters + + + + 1 + + + 2 + + + + + QAbstractItemView::MultiSelection + + + + + + + + + + :/CopyEngine/Ultracopier/resources/add.png:/CopyEngine/Ultracopier/resources/add.png + + + + + + + + :/CopyEngine/Ultracopier/resources/edit.png:/CopyEngine/Ultracopier/resources/edit.png + + + + + + + + :/CopyEngine/Ultracopier/resources/remove.png:/CopyEngine/Ultracopier/resources/remove.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + Inclusion filters + + + + 1 + + + 2 + + + + + None = Include all + + + + + + + + + QAbstractItemView::MultiSelection + + + + + + + + + + :/CopyEngine/Ultracopier/resources/add.png:/CopyEngine/Ultracopier/resources/add.png + + + + + + + + :/CopyEngine/Ultracopier/resources/edit.png:/CopyEngine/Ultracopier/resources/edit.png + + + + + + + + :/CopyEngine/Ultracopier/resources/remove.png:/CopyEngine/Ultracopier/resources/remove.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QDialogButtonBox::Cancel + + + + + + + + + + + + diff --git a/plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp b/plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp new file mode 100644 index 0000000..ac1e74e --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp @@ -0,0 +1,199 @@ +#include "FolderExistsDialog.h" +#include "ui_folderExistsDialog.h" +#include "TransferThread.h" + +#include +#include +#include + +FolderExistsDialog::FolderExistsDialog(QWidget *parent,QFileInfo source,bool isSame,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule) : + QDialog(parent), + ui(new Ui::folderExistsDialog) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_LINUX + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + flags=flags | Qt::WindowStaysOnTopHint; + setWindowFlags(flags); + + ui->setupUi(this); + action=FolderExists_Cancel; + oldName=TransferThread::resolvedName(destination); + ui->lineEditNewName->setText(oldName); + ui->lineEditNewName->setPlaceholderText(oldName); + ui->label_content_source_modified->setText(source.lastModified().toString()); + ui->label_content_source_folder_name->setText(source.fileName()); + QString folder=source.absolutePath(); + if(folder.size()>80) + folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); + ui->label_content_source_folder->setText(folder); + if(ui->label_content_source_folder_name->text().isEmpty()) + { + ui->label_source_folder_name->hide(); + ui->label_content_source_folder_name->hide(); + } + if(isSame) + { + this->destinationInfo=source; + ui->label_source->hide(); + ui->label_destination->hide(); + ui->label_destination_modified->hide(); + ui->label_destination_folder_name->hide(); + ui->label_destination_folder->hide(); + ui->label_content_destination_modified->hide(); + ui->label_content_destination_folder_name->hide(); + ui->label_content_destination_folder->hide(); + } + else + { + this->destinationInfo=destination; + this->setWindowTitle(tr("Folder already exists")); + ui->label_content_destination_modified->setText(destination.lastModified().toString()); + ui->label_content_destination_folder_name->setText(destination.fileName()); + QString folder=destination.absolutePath(); + if(folder.size()>80) + folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); + ui->label_content_destination_folder->setText(folder); + if(ui->label_content_destination_folder_name->text().isEmpty()) + { + ui->label_destination_folder_name->hide(); + ui->label_content_destination_folder_name->hide(); + } + } + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + on_SuggestNewName_clicked(); +} + +FolderExistsDialog::~FolderExistsDialog() +{ + delete ui; +} + +void FolderExistsDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +QString FolderExistsDialog::getNewName() +{ + if(oldName==ui->lineEditNewName->text() || ui->checkBoxAlways->isChecked()) + return ""; + else + return ui->lineEditNewName->text(); +} + +void FolderExistsDialog::on_SuggestNewName_clicked() +{ + QFileInfo destinationInfo=this->destinationInfo; + QString absolutePath=destinationInfo.absolutePath(); + QString fileName=TransferThread::resolvedName(destinationInfo); + QString suffix=QStringLiteral(""); + QString destination; + QString newFileName; + //resolv the suffix + if(fileName.contains(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")))) + { + suffix=fileName; + suffix.replace(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")),QStringLiteral("\\2")); + fileName.replace(QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")),QStringLiteral("\\1")); + } + //resolv the new name + int num=1; + do + { + if(num==1) + { + if(firstRenamingRule.isEmpty()) + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=firstRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + } + } + else + { + if(otherRenamingRule.isEmpty()) + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=otherRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + destination=absolutePath+QDir::separator()+newFileName+suffix; + destinationInfo.setFile(destination); + num++; + } + while(destinationInfo.exists()); + ui->lineEditNewName->setText(newFileName+suffix); +} + +void FolderExistsDialog::on_Rename_clicked() +{ + action=FolderExists_Rename; + this->close(); +} + +void FolderExistsDialog::on_Skip_clicked() +{ + action=FolderExists_Skip; + this->close(); +} + +void FolderExistsDialog::on_Cancel_clicked() +{ + action=FolderExists_Cancel; + this->close(); +} + +FolderExistsAction FolderExistsDialog::getAction() +{ + return action; +} + +bool FolderExistsDialog::getAlways() +{ + return ui->checkBoxAlways->isChecked(); +} + +void FolderExistsDialog::on_Merge_clicked() +{ + action=FolderExists_Merge; + this->close(); +} + +void FolderExistsDialog::on_lineEditNewName_editingFinished() +{ + updateRenameButton(); +} + +void FolderExistsDialog::on_lineEditNewName_returnPressed() +{ + updateRenameButton(); + if(ui->Rename->isEnabled()) + on_Rename_clicked(); + else + QMessageBox::warning(this,tr("Error"),tr("Try rename with using special characters")); +} + +void FolderExistsDialog::on_lineEditNewName_textChanged(const QString &arg1) +{ + Q_UNUSED(arg1); + updateRenameButton(); +} + +void FolderExistsDialog::updateRenameButton() +{ + ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (!ui->lineEditNewName->text().contains(QRegularExpression("[/\\\\\\*]")) && oldName!=ui->lineEditNewName->text() && !ui->lineEditNewName->text().isEmpty())); +} diff --git a/plugins/CopyEngine/Ultracopier/FolderExistsDialog.h b/plugins/CopyEngine/Ultracopier/FolderExistsDialog.h new file mode 100644 index 0000000..c043f65 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FolderExistsDialog.h @@ -0,0 +1,57 @@ +/** \file folderExistsDialog.h +\brief Define the dialog when file exists +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FOLDERISSAMEDIALOG_H +#define FOLDERISSAMEDIALOG_H + +#include +#include +#include +#include +#include + +#include "Environment.h" + +namespace Ui { + class folderExistsDialog; +} + +/// \brief to show file exists dialog, and ask what do +class FolderExistsDialog : public QDialog +{ + Q_OBJECT + +public: + /// \brief create the object and pass all the informations to it + explicit FolderExistsDialog(QWidget *parent,QFileInfo source,bool isSame,QFileInfo destination,QString firstRenamingRule,QString otherRenamingRule); + ~FolderExistsDialog(); + /// \brief return the the always checkbox is checked + bool getAlways(); + /// \brief return the action clicked + FolderExistsAction getAction(); + /// \brief return the new rename is case in manual renaming + QString getNewName(); +protected: + void changeEvent(QEvent *e); +private slots: + void updateRenameButton(); + void on_SuggestNewName_clicked(); + void on_Rename_clicked(); + void on_Skip_clicked(); + void on_Cancel_clicked(); + void on_Merge_clicked(); + void on_lineEditNewName_editingFinished(); + void on_lineEditNewName_returnPressed(); + void on_lineEditNewName_textChanged(const QString &arg1); +private: + Ui::folderExistsDialog *ui; + FolderExistsAction action; + QString oldName; + QString firstRenamingRule; + QString otherRenamingRule; + QFileInfo destinationInfo; +}; + +#endif // FOLDERISSAMEDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier/Languages/ar/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/ar/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/ar/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/de/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/de/translation.ts new file mode 100644 index 0000000..2952152 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/de/translation.ts @@ -0,0 +1,1294 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + Auf dieser Plattform nicht unterstützt + + + + Last modified date is wrong + Datum der letzten Änderung ist falsch + + + + Last access date is wrong + + Datum des letzten Zugriffs ist falsch + + + + Unknown error: %1 + Unbekannter Fehler: %1 + + + + Unknown error + Unbekannter Fehler + + + + Path conversion error + Pfad Konvertierungsfehler + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + Verschiebemodus - Sie können nicht kopieren + + + + + The engine is forced to copy, you can't move with it + Kopiermodus - Sie können nicht verschieben + + + + Destination + Ziel + + + + Use the actual destination "%1"? + Aktuelles Ziel: "%1" benutzen? + + + + The mode has been forced previously. This is an internal error, please report it + Der Modus wurde vorher erzwungen. Interner Fehler - Bitte bei mir melden! + + + + + + + Ask + Fragen + + + + + + + Skip + Überspringen + + + + Merge + Fusionieren + + + + + Rename + Umbenennen + + + + Put at the end + Ans Ende verschieben + + + + Overwrite + Überschreiben + + + + Overwrite if different + Überschreiben, falls verschieden + + + + Overwrite if newer + Überschreiben, falls neuer + + + + Overwrite if older + Überschreiben, falls älter + + + + Automatic + Automatisch + + + + Sequential + Sequentiell + + + + Parallel + Parallel + + + + Options error + Fehlerhafte Optionen + + + + Options engine is not loaded. Unable to access the filters + Optionen nicht geladen - Kein Zugriff auf Filter + + + + CopyEngineFactory + + + + + + Ask + Fragen + + + + + + + Skip + Überspringen + + + + Merge + Fusionieren + + + + + Rename + Umbenennen + + + + Put at the end + Ans Ende verschieben + + + + Overwrite + Überschreiben + + + + Overwrite if different + Überschreiben, falls verschieden + + + + Overwrite if newer + Überschreiben, falls neuer + + + + Overwrite if older + Überschreiben, falls älter + + + + Automatic + Automatisch + + + + Sequential + Sequentiell + + + + Parallel + Parallel + + + + + Options error + Fehlerhafte Optionen + + + + Options engine is not loaded. Unable to access the filters + Option nicht geladen - Kein Zugriff auf Filter + + + + Options engine is not loaded, can't access to the filters + Option nicht geladen - Kann nicht auf Filter zugreifen + + + + DiskSpace + + + Disk space + Speicherplatz + + + + You need more space on this drive to finish this transfer + Zu wenig Speicherplatz auf diesem Laufwerk + + + + Continue + Fortsetzen + + + + Cancel + Abbrechen + + + + Drives %1 have %2 available but need %3 + Laufwerk %1: %2 verfügbar %3 benötigt + + + + FileErrorDialog + + + Error on folder + Ordnerfehler + + + + Folder name + Ordnername + + + + FileExistsDialog + + + %1 - copy + %1 - Kopie + + + + %1 - copy (%2) + %1 - Kopie (%2) + + + + Error + Fehler + + + + Try rename with using special characters + Versuche Umbenennung mit Sonderzeichen + + + + FileIsSameDialog + + + %1 - copy + %1 - kopieren + + + + %1 - copy (%2) + %1 - kopieren (%2) + + + + Error + Fehler + + + + Try rename with using special characters + Versuche Umbenennung mit Sonderzeichen + + + + FilterRules + + + Search: + Suche: + + + + Search type: + Suche (Typ): + + + + Raw text + Roh-Text + + + + Simplified regex + Vereinfachte RegEx + + + + Perl's regex + Perls RegEx + + + + Apply on: + Anwenden auf: + + + + File + Datei + + + + Folder + Ordner + + + + File and folder + Datei und Ordner + + + + The test string matches with the regex + Die Test-Zeichenfolge stimmt mit RegEx überein + + + + Checking + Überprüfen + + + + Test string: + Test-Zeichenfolge: + + + + Filters dialog + Filter-Dialog + + + + Whole string must match + Ganze Zeichenfolge muss übereinstimmen + + + + The regex is valid + Die RegEx ist gültig + + + + Filters + + + Filters + Filter + + + + Exclusion filters + Ausschließungs-Filter + + + + Inclusion filters + Einschließungs-Filter + + + + None = Include all + Keiner = Alle einschließen + + + + + Raw text + Roh-Text + + + + + Simplified regex + Vereinfachte RegEx + + + + + Perl's regex + Perls RegEx + + + + + Only on file + Nur auf Datei + + + + + Only on folder + Nur auf Ordner + + + + + + + Full match + Volle Übereinstimmung + + + + FolderExistsDialog + + + Folder already exists + Ordner existiert bereits + + + + %1 - copy + %1 - Kopie + + + + %1 - copy (%2) + %1 - Kopie (%2) + + + + Error + Fehler + + + + Try rename with using special characters + Versuche Umbenennung mit Sonderzeichen + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + Falscher Modus: %1 - Kann Element nicht verschieben oder kopieren + + + + + Unable to save the transfer list: %1 + Konnte die Transferliste: %1 nicht speichern + + + + Problem reading file, or file-size is 0 + Lesefehler, oder Dateigröße=0 + + + + Wrong header: "%1" + Falscher Header: "%1" + + + + The transfer list is in mixed mode, but this instance is not in this mode + Die Transferliste ist im gemischten Modus, aber diese Instanz ist nicht im selben Modus + + + + The transfer list is in copy mode, but this instance is not in this mode + Die Transferliste ist im Kopiermodus, aber diese Instanz ist nicht im selben Modus + + + + The transfer list is in move mode, but this instance is not in this mode + Die Transferliste ist im Verschiebe-Modus, aber diese Instanz ist nicht im selben Modus + + + + Some errors have been found during the line parsing + Bei der Zeilenanalyse sind Fehler aufgetreten + + + + Unable to open the transfer list: %1 + Transferliste: %1 kann nicht geöffnet werden + + + + MkPath + + + Unable to create the folder + Der Ordner kann nicht erstellt werden + + + + The source folder don't exists + Quell-Ordner existiert nicht + + + + Unable to temporary rename the folder + Kann den Ordner nicht temporär umbenennen + + + + Unable to do the final real move the folder + Kann den Ordner nicht endgültig verschieben + + + + Unable to move the folder + Kann den Ordner nicht verschieben + + + + + Unable to remove + Kann nicht löschen + + + + ReadThread + + + Internal error, please report it! + Interner Fehler - Bitte bei mir melden! + + + + Internal error reading the source file:block size out of range + Interner Fehler beim Lesen der Quelldatei: Blockgröße außerhalb des zulässigen Bereichs + + + + + Unable to read the source file: + Die Quelldatei kann nicht gelesen werden: + + + + + File truncated during the read, possible data change + Datei während des Lesevorgangs abgeschnitten, Daten wurden möglicherweise verändert + + + + RenamingRules + + + First renaming + Erste Umbenennung + + + + %name% - copy + %name% should not be translated + %name% - Kopie + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + <html><head/><body><p>Variablen: <span style=" font-weight:600;">%name%</span> für den ursprünglichen Dateinamen</p></body></html> + + + + Second renaming + Zweite Umbenennung + + + + %name% - copy (%number%) + %name%, %number% should not be translated + %name% - Kopie (%number%) + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + <html><head/><body><p>Variablen: <span style=" font-weight:600;">%name%</span> für den ursprünglichen Dateinamen</p><p><span style=" font-weight:600;">%number%</span> für die zusätzliche Zahl</p></body></html> + + + + + %1 - copy + %1 - Kopie + + + + + %1 - copy (%2) + %1 - Kopie (%2) + + + + Renaming rules + Umbennungsregeln + + + + ScanFileOrFolder + + + Blacklisted folder + Ordner der schwarzen Liste + + + + + %1 - copy + %1 - Kopie + + + + + %1 - copy (%2) + %1 - Kopie (%2) + + + + This is not a folder + Dies ist kein Ordner + + + + The folder does exists + Ordner existiert bereits + + + + The folder is not readable + Der Ordner kann nicht gelesen werden + + + + Problem with name encoding + Problem mit der Namen-Encodierung + + + + TransferThread + + + + + + File not found + Datei nicht gefunden + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + Interner Fehler: Bereits geöffnet + + + + Drive %1 + Laufwerk %1 + + + + Unknown folder + Unbekannter Ordner + + + + root + Stammverzeichnis + + + + %1 - copy + %1 - Kopie + + + + %1 - copy (%2) + %1 - Kopie (%2) + + + + The source doesn't exist + Quelle existiert nicht + + + + + + Unable to change the date + + + + + + The source file doesn't exist + Quelldatei existiert nicht + + + + The checksums do not match + Prüfsummen sind verschieden + + + + Internal error: The size transfered doesn't match + Interner Fehler: Ubertragene Größe ungleich + + + + + Unable to do the folder + Ordner kann nicht erstellt werden + + + + Try rename with using special characters + Versuche Umbenennung mit Sonderzeichen + + + + Another file exists at same place + Andere Datei befindet sich am selben Ort + + + + Internal error: The destination is not closed + Interner Fehler: Ziel ist nicht geschlossen + + + + Internal error: The buffer is not empty + Interner Fehler: Puffer ist nicht leer + + + + WriteThread + + + Path resolution error (Empty path) + Pfad-Auflösungsfehler (leerer Pfad) + + + + Internal error, please report it! + Interner Fehler - Bitte bei mir melden! + + + + Unable to read the source file: + Quelldatei kann nicht gelesen werden: + + + + File truncated during read, possible data change + Datenabbruch beim Lesen, Daten wurden möglicherweise verändert + + + + copyEngineOptions + + + Transfer + Übertragung + + + + Move the whole folder + Verschiebe den ganzen Ordner + + + + Transfer the file rights + Übertrage die Dateirechte + + + + Keep the file date + Datum der Dateien beibehalten + + + + Autostart the transfer + Übertragung automatisch starten + + + + + Less performance if checked + Leistung drosseln + + + + Follow the strict order + Genau nach Reihenfolge + + + + Error and collision + Fehler und Kollision + + + + When folder error + Bei Ordnerfehlern: + + + + When file error + Bei Dateifehlern: + + + + When file collision + Bei Dateikollisionen: + + + + When folder collision + Bei Ordnerkollisionen: + + + + Check if destination folder exists + Prüfen ob Zielordner vorhanden ist + + + + Renaming rules + Umbennungsregeln + + + + Delete partially transferred files + Unvollständig übertragene Dateien löschen + + + + Rename the original destination + Original-Ziel umbenennen + + + + Control + Überprüfung + + + + Checksum + Prüfsumme + + + + Only after error + Nur nach einem Fehler + + + + Ignore if impossible + Ignorieren falls unmöglich + + + + Verify checksums + Prüfsummen vergleichen + + + + Performance + Leistung + + + + Parallel buffer + Paralleler Puffer + + + + + + + + KB + KB + + + + Block size + Blockgröße + + + + Sequential buffer + Sequentieller Puffer + + + + Enable OS buffer + OS-Puffer aktivieren + + + + OS buffer only if smaller than + OS-Puffer nur verwenden, wenn kleiner als + + + + Transfer algorithm + Übertragungs-Algorithmus + + + + Parallelize if smaller than + Parallelisieren wenn kleiner als + + + + Inode threads + Inode Threads + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + Verschiedenes + + + + Check the disk space + Auf freien Speicherplatz überprüfen + + + + Use this folder when destination is not set + + + + Use this folder when destination is empty + Benutze diesen Ordner wenn Ziel nicht benannt + + + + Browse + Wählen + + + + Filters + Filter + + + + fileErrorDialog + + + Error with file + Dateifehler + + + + Error + Fehler + + + + Size + Größe + + + + Modified + Geändert + + + + File name + Dateiname + + + + Destination + Ziel + + + + Folder + Ordner + + + + &Always perform this action + &Aktion immer ausführen + + + + Try in with elevated privileges + Mit erweiterten Rechten versuchen + + + + Put to bottom + Ans Ende verschieben + + + + Retry + Wiederholen + + + + &Skip + Über&springen + + + + &Cancel + Abbrechen (&C) + + + + fileExistsDialog + + + The file exists + Die Datei existiert + + + + Source + Quelle + + + + Destination + Ziel + + + + + Size + Größe + + + + + Modified + Geändert + + + + + File name + Dateiname + + + + + Folder + Ordner + + + + Suggest new &name + Neuen &Namen vorschlagen + + + + &Always perform this action + &Aktion immer ausführen + + + + + Overwrite if modification date differs + Überschreiben, falls Änderungsdatum verschieden + + + + &Rename + Umbenennen (&R) + + + + &Overwrite + Überschreiben (&O) + + + + &Skip + Über&springen + + + + &Cancel + Abbrechen (&C) + + + + Overwrite if newer + Überschreiben, falls neuer + + + + + Overwrite if older + Überschreiben, falls älter + + + + fileIsSameDialog + + + Size + Größe + + + + Modified + Geändert + + + + File name + Dateiname + + + + The source and destination are same + Quelle und Ziel sind gleich + + + + Folder + Ordner + + + + Suggest new &name + Neuen &Namen vorschlagen + + + + &Always perform this action + &Aktion immer ausführen + + + + &Rename + Umbenennen (&R) + + + + &Skip + Über&springen + + + + &Cancel + Abbrechen (&C) + + + + folderExistsDialog + + + Source + Quelle + + + + Destination + Ziel + + + + The source and destination is identical + Quelle und Ziel sind identisch + + + + + Modified + Geändert + + + + + Folder name + Ordnername + + + + + Folder + Ordner + + + + Suggest new &name + Neuen &Namen vorschlagen + + + + &Always perform this action + &Aktion immer ausführen + + + + &Rename + Umbenennen (&R) + + + + Merge + Fusionieren + + + + Skip + Überspringen + + + + &Cancel + Abbrechen (&C) + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/el/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/el/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/el/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/en/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/en/translation.ts new file mode 100644 index 0000000..a6b1027 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/en/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Filters dialog + + + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + Whole string must match + + + + + The test string matches with the regex + + + + + Checking + + + + + The regex is valid + + + + + Test string: + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + Renaming rules + + + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/es/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/es/translation.ts new file mode 100644 index 0000000..d2a294f --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/es/translation.ts @@ -0,0 +1,1305 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + No es compatible con esta plataforma + + + + Last modified date is wrong + Fecha de última modificación es incorrecto + + + + Last access date is wrong + Fecha de último acceso es incorrecto + + + + Unknown error: %1 + Error desconocido: %1 + + + + Unknown error + Error desconocido + + + + Path conversion error + Error de conversión de Sendero + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + El motor se ve obligado a moverse, no se puede copiar con ella + + + + + The engine is forced to copy, you can't move with it + El motor se ve obligado a copiar, no te puedes mover con él + + + + Destination + Destino + + + + Use the actual destination "%1"? + Utilice el destino "%1" actual? + + + + The mode has been forced previously. This is an internal error, please report it + El modo se ha visto obligado previamente. Este es un error interno, por favor repórtelo + + + + + + + Ask + Pedir + + + + + + + Skip + Omitir + + + + Merge + Unir + + + + + Rename + Cambiar el nombre + + + + Put at the end + Ponga al final + + + + Overwrite + Sobrescribir + + + + Overwrite if different + Sobrescribir si es diferente + + + + Overwrite if newer + Sobrescribir si nuevo + + + + Overwrite if older + Sobrescribir si es mayor + + + + Automatic + Automático + + + + Sequential + Secuencial + + + + Parallel + Paralelo + + + + Options error + error Opciones + + + + Options engine is not loaded. Unable to access the filters + Opciones del motor no está cargado. No es posible acceder a los filtros + + + + CopyEngineFactory + + + + + + Ask + Pedir + + + + + + + Skip + Omitir + + + + Merge + Unir + + + + + Rename + Cambiar el nombre + + + + Put at the end + Ponga al final + + + + Overwrite + Sobrescribir + + + + Overwrite if different + Sobrescribir si es diferente + + + + Overwrite if newer + Sobrescribir si nuevo + + + + Overwrite if older + Sobrescribir si es mayor + + + + Automatic + Automático + + + + Sequential + Secuencial + + + + Parallel + Paralelo + + + + + Options error + error Opciones + + + + Options engine is not loaded. Unable to access the filters + Opciones del motor no está cargado. No es posible acceder a los filtros + + + + Options engine is not loaded, can't access to the filters + Opciones del motor no está cargado, no se puede acceder a los filtros + + + + DiskSpace + + + Disk space + Espacio en disco + + + + You need more space on this drive to finish this transfer + Necesita más espacio en esta unidad para terminar esta transferencia + + + + Continue + Continuar + + + + Cancel + Cancelar + + + + Drives %1 have %2 available but need %3 + Drives %1 tienen %2 disponible, pero necesitan %3 + + + + FileErrorDialog + + + Error on folder + Error en la carpeta + + + + Folder name + Nombre de la carpeta + + + + FileExistsDialog + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Error + Error + + + + Try rename with using special characters + Trate de cambiar el nombre con el uso de caracteres especiales + + + + FileIsSameDialog + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Error + Error + + + + Try rename with using special characters + Trate de cambiar el nombre con el uso de caracteres especiales + + + + FilterRules + + + Search: + Buscar: + + + + Search type: + Tipo de búsqueda: + + + + Raw text + texto Fuente + + + + Simplified regex + Regex simplificado + + + + Perl's regex + Perl's regex + + + + Apply on: + Aplicar sobre: + + + + File + Archivos + + + + Folder + Carpeta + + + + File and folder + Archivos y carpeta + + + + The test string matches with the regex + La cadena de prueba coincide con la expresión regular + + + + Checking + Verification + + + + Test string: + Prueba de la cuerda: + + + + Filters dialog + Filtros de diálogo + + + + Whole string must match + Todo cadena debe coincidir + + + + The regex is valid + La expresión regular es válido + + + + Filters + + + Filters + Filtros + + + + Exclusion filters + Filtros de exclusión + + + + Inclusion filters + Filtros de inclusión + + + + None = Include all + Ninguno = Incluya todos los + + + + + Raw text + texto Fuente + + + + + Simplified regex + Simplificado regex + + + + + Perl's regex + Perl's regex + + + + + Only on file + Sólo en el archivo + + + + + Only on folder + Sólo en la carpeta + + + + + + + Full match + Partido completo + + + + FolderExistsDialog + + + Folder already exists + Carpeta ya existe + + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Error + Error + + + + Try rename with using special characters + Trate de cambiar el nombre con el uso de caracteres especiales + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + No se puede hacer para mover o copiar elemento en modo incorrecto obligado: %1 + + + + + Unable to save the transfer list: %1 + No se puede guardar la lista de transferencias: %1 + + + + Problem reading file, or file-size is 0 + Problema al leer el archivo o archivos de tamaño es 0 + + + + Wrong header: "%1" + Encabezado incorrecto: "%1" + + + + The transfer list is in mixed mode, but this instance is not in this mode + La lista de transferencia está en modo mixto, pero este caso no es de este modo + + + + The transfer list is in copy mode, but this instance is not in this mode + La lista de transferencia está en el modo de copia, pero esta instancia no está en este modo + + + + The transfer list is in move mode, but this instance is not in this mode + La lista de transferencia es el modo de desplazamiento, pero esta instancia no está en este modo + + + + Some errors have been found during the line parsing + Algunos errores han sido encontrados durante el análisis de línea + + + + Unable to open the transfer list: %1 + No se puede abrir la lista de transferencias: %1 + + + + MkPath + + Unable to get time + No es posible obtener el tiempo + + + + Unable to create the folder + No se puede crear la carpeta + + + + The source folder don't exists + La carpeta de origen no existe + + + + Unable to temporary rename the folder + No es posible cambiar el nombre de la carpeta temporal + + + + Unable to do the final real move the folder + No se puede hacer el movimiento final real de la carpeta + + + + Unable to move the folder + No se puede mover la carpeta + + + Unable to set the access-right + No se puede establecer el acceso a la derecha + + + + + Unable to remove + No se puede eliminar + + + + ReadThread + + + Internal error, please report it! + Error interno, por favor informe de ello! + + + + Internal error reading the source file:block size out of range + Error interno de leer el archivo de origen: tamaño de bloque fuera de rango + + + + + Unable to read the source file: + No se puede leer el archivo de origen: + + + + + File truncated during the read, possible data change + Archivo truncada durante el cambio de lectura, los datos posibles + + + + RenamingRules + + + First renaming + En primer lugar el cambio de nombre + + + + %name% - copy + %name% should not be translated + %name% - copia + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> para el nombre del archivo original</p></body></html> + + + + Second renaming + En segundo lugar el cambio de nombre + + + + %name% - copy (%number%) + %name%, %number% should not be translated + %name% - copia (%number%) + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> para el nombre del archivo original</p><p><span style=" font-weight:600;">%number%</span> para el número adicional</p></body></html> + + + + + %1 - copy + %1 - copia + + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Renaming rules + Reglas de Cambio de nombre + + + + ScanFileOrFolder + + + Blacklisted folder + Carpeta de la lista negra + + + + + %1 - copy + %1 - copia + + + + + %1 - copy (%2) + %1 - copia (%2) + + + + This is not a folder + Esto no es una carpeta + + + + The folder does exists + La carpeta no existe + + + The folder not exists + La carpeta no existe + + + + The folder is not readable + La carpeta no se puede leer + + + + Problem with name encoding + Problema con codificación de nombres + + + + TransferThread + + + + + + File not found + Archivo no encontrado + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + Error interno: Ya la apertura + + + + Drive %1 + Drive %1 + + + + Unknown folder + Desconocido carpeta + + + + root + raíz + + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + The source doesn't exist + La fuente no existe + + + + + + Unable to change the date + + + + + + The source file doesn't exist + El archivo de origen no existe + + + + The checksums do not match + Las sumas de comprobación no coinciden + + + + Internal error: The size transfered doesn't match + Error interno: El tamaño transferido no coincide + + + + + Unable to do the folder + Incapaz de hacer la carpeta + + + + Try rename with using special characters + Trate de cambiar el nombre con el uso de caracteres especiales + + + + Another file exists at same place + Otro archivo existe en el mismo lugar + + + + Internal error: The destination is not closed + Error interno: El destino no está cerrado + + + + Internal error: The buffer is not empty + Error interno: El buffer no está vacío + + + + WriteThread + + + Path resolution error (Empty path) + Error de resolución de ruta (camino vacío) + + + + Internal error, please report it! + Error interno, por favor informe de ello! + + + + Unable to read the source file: + No se puede leer el archivo de origen: + + + + File truncated during read, possible data change + Archivo truncado durante lectura, posible cambio de datos + + + + copyEngineOptions + + + Transfer + Transferencia + + + + Move the whole folder + Mueva la carpeta completa + + + + Transfer the file rights + Transferencia de los derechos de archivo + + + + Keep the file date + Mantener la fecha de archivo + + + + Autostart the transfer + Inicio automático de la transferencia + + + + + Less performance if checked + Si comprueba Menos rendimiento + + + + Follow the strict order + Siga el orden estricto + + + + Error and collision + Error y de la colisión + + + + When folder error + Cuando el error carpeta + + + + When file error + Cuando archivo error + + + + When file collision + Cuando archivo colisión + + + + When folder collision + Cuando la colisión carpeta + + + + Check if destination folder exists + Compruebe si existe la carpeta de destino + + + + Renaming rules + Reglas de Cambio de nombre + + + + Delete partially transferred files + Eliminar archivos parcialmente transferidos + + + + Rename the original destination + Cambie el nombre del destino original + + + + Control + Controlar + + + + Checksum + Suma de comprobación + + + + Only after error + Sólo después de un error + + + + Ignore if impossible + No haga caso si no es posible + + + + Verify checksums + Verifique checksums + + + + Performance + Rendimiento + + + + Parallel buffer + Búfer paralelo + + + + + + + + KB + KB + + + + Block size + Tamaño del bloque + + + + Sequential buffer + Tampón secuencial + + + + Enable OS buffer + Habilitar el OS de amortiguación + + + + OS buffer only if smaller than + OS de amortiguación sólo si menor que + + + + Transfer algorithm + Algoritmo de transferencia + + + + Parallelize if smaller than + Paralelice si más pequeño que + + + + Inode threads + Temas inodo + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + Misc + + + + Check the disk space + Compruebe el espacio en disco + + + + Use this folder when destination is not set + + + + Use this folder when destination is empty + Utilice esta carpeta al destino está vacía + + + + Browse + Busque + + + + Filters + Filtros + + + + fileErrorDialog + + + Error with file + Error con el archivo + + + + Error + Error + + + + Size + Tamaño + + + + Modified + Modificado + + + + File name + Nombre de archivo + + + + Destination + Destino + + + + Folder + Carpeta + + + + &Always perform this action + &Siempre realice esta acción + + + + Try in with elevated privileges + Pruebe con privilegios elevados + + + + Put to bottom + Ponga a abajo + + + + Retry + Reintentar + + + + &Skip + &Omitir + + + + &Cancel + Cancelar + + + + fileExistsDialog + + + The file exists + El archivo ya existe + + + + Source + Fuente + + + + Destination + Destino + + + + + Size + Tamaño + + + + + Modified + Modificado + + + + + File name + Nombre de archivo + + + + + Folder + Carpeta + + + + Suggest new &name + Sugerir nuevo &nombre + + + + &Always perform this action + &Siempre realice esta acción + + + + + Overwrite if modification date differs + Sobrescribir si la fecha de modificación difiere + + + + &Rename + &Cambiar el nombre + + + + &Overwrite + &Sobrescribir + + + + &Skip + &Omitir + + + + &Cancel + Ca&ncelar + + + + Overwrite if newer + Sobrescribir si nuevo + + + + + Overwrite if older + Sobrescribir si es mayor + + + + fileIsSameDialog + + + Size + Tamaño + + + + Modified + Modificado + + + + File name + Nombre de archivo + + + + The source and destination are same + El origen y el destino son los mismos + + + + Folder + Carpeta + + + + Suggest new &name + Sugerir nuevo nombre + + + + &Always perform this action + &Siempre realice esta acción + + + + &Rename + Cambiar el nombre + + + + &Skip + Omitir + + + + &Cancel + Cancelar + + + + folderExistsDialog + + + Source + Fuente + + + + Destination + Destino + + + + The source and destination is identical + La fuente y el destino es idéntica + + + + + Modified + Modificado + + + + + Folder name + Nombre de la carpeta + + + + + Folder + Carpeta + + + + Suggest new &name + Sugerir nuevo nombre + + + + &Always perform this action + &Siempre realice esta acción + + + + &Rename + Cambiar el nombre + + + + Merge + Unir + + + + Skip + Omitir + + + + &Cancel + Cancelar + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/fr/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/fr/translation.ts new file mode 100644 index 0000000..8ed7524 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/fr/translation.ts @@ -0,0 +1,1338 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + Non supporté sur cette plateforme + + + + Last modified date is wrong + Date de dernière modification du fichier incorrecte + + + + Last access date is wrong + Date du dernier accès au fichier incorrecte + + + + Unknown error: %1 + Erreur inconnue: %1 + + + + Unknown error + Erreur inconnue + + + + Path conversion error + Erreur de conversion de chemain + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + Le moteur est forcé en déplacement, vous ne pouvez pas copier avec + + + + + The engine is forced to copy, you can't move with it + Le moteur est forcé en copie, vous ne pouvez pas déplacer avec + + + + Destination + Destination + + + + Use the actual destination "%1"? + Utiliser la destination actuelle "%1"? + + + + The mode has been forced previously. This is an internal error, please report it + Le mode a été forcé. C'est une erreur interne, merci de la repporter + + + + + + + Ask + Demander + + + + + + + Skip + Passer + + + + Merge + Fusionner + + + + + Rename + Renommer + + + + Put at the end + Mettre à la fin + + + + Overwrite + Écraser + + + + Overwrite if different + Écraser si différent + + + + Overwrite if newer + Écraser si plus récent + + + + Overwrite if older + Écraser si plus vieux + + + + Automatic + Automatique + + + + Sequential + Séquentiel + + + + Parallel + Parallèle + + + + Options error + Erreur d'options + + + + Options engine is not loaded. Unable to access the filters + Le moteur d'options n'est pas chargé. Impossible d'accédé aux filtres + + + + CopyEngineFactory + + + + + + Ask + Demander + + + + + + + Skip + Passer + + + + Merge + Fusionner + + + + + Rename + Renommer + + + + Put at the end + Mettre à la fin + + + + Overwrite + Écraser + + + + Overwrite if different + Écraser si différent + + + + Overwrite if newer + Écraser si plus récent + + + + Overwrite if older + Écraser si plus vieux + + + + Automatic + Automatique + + + + Sequential + Séquentiel + + + + Parallel + Parallèle + + + + + Options error + Erreur d'options + + + + Options engine is not loaded. Unable to access the filters + Le moteur d'options n'est pas chargé. Impossible d'accédé aux filtres + + + + Options engine is not loaded, can't access to the filters + Moteur d'options non chargé, impossible d'accéder aux filtres + + + + DiskSpace + + + Disk space + Espace disque + + + + You need more space on this drive to finish this transfer + Vous avez besoin de plus d'espace pour finir ce transfert + + + + Continue + Continuer + + + + Cancel + Annuler + + + + Drives %1 have %2 available but need %3 + Lecteur %1 as %2 disponible mais à besoin de %3 + + + + FileErrorDialog + + + Error on folder + Erreur sur un dossier + + + + Folder name + Nom de répertoire + + + + FileExistsDialog + + + %1 - copy + %1 - copie + + + + %1 - copy (%2) + %1 - copie (%2) + + + + Error + Erreur + + + + Try rename with using special characters + Essaie de renommage avec caratéres interdits + + + Try rename with unauthorized characters + Essaie de renommage avec caratéres interdits + + + + FileIsSameDialog + + + %1 - copy + %1 - copie + + + + %1 - copy (%2) + %1 - copie (%2) + + + + Error + Erreur + + + + Try rename with using special characters + Essaie de renommage avec caratéres interdits + + + Try rename with unauthorized characters + Essaie de renommage avec caratéres interdits + + + + FilterRules + + + Search: + Recherche: + + + + Search type: + Type de recherche: + + + + Raw text + Texte brut + + + + Simplified regex + Regex simplifiée + + + + Perl's regex + Regex perl + + + + Apply on: + Appliquer sur: + + + + File + Fichier + + + + Folder + Dossier + + + + File and folder + Fichier et dossier + + + + The test string matches with the regex + La chaine de texte corresponds avec la regex + + + + Checking + Vérification + + + + Test string: + Chaine de test: + + + + Filters dialog + Dialogue des filtres + + + + Whole string must match + Toute la chaine doit correspondre + + + + The regex is valid + La regex est valid + + + + Filters + + + Filters + Filtres + + + + Exclusion filters + Filtres d'exclusion + + + + Inclusion filters + Filtres d'inclusion + + + + None = Include all + Aucun = tout inclure + + + + + Raw text + Texte brute + + + + + Simplified regex + Regex simplifié + + + + + Perl's regex + Regex perl + + + + + Only on file + Appliquer sur fichier + + + + + Only on folder + Appliquer sur dossier + + + + + + + Full match + Correspondance totale + + + + FolderExistsDialog + + + Folder already exists + Dossier déjà existant + + + + %1 - copy + %1 - copie + + + + %1 - copy (%2) + %1 - copie (%2) + + + + Error + Erreur + + + + Try rename with using special characters + Essaie de renommage avec caratéres interdits + + + Try rename with unauthorized characters + Essaie de renommage avec caratéres interdits + + + Try rename with unauthorized charateres + Tentative de renommage de des caratéres non autorisés + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + Impossible de faire un déplacement ou une copie dans le mauvais mode forcé: %1 + + + + + Unable to save the transfer list: %1 + Impossible de sauvegarder la liste de transfert: %1 + + + + Problem reading file, or file-size is 0 + Problem durant la lecture, ou taille de fichier est 0 + + + + Wrong header: "%1" + Mauvais en-tête: "%1" + + + + The transfer list is in mixed mode, but this instance is not in this mode + La liste de transfert est en mode mixte, mais l'instance n'est pas dans ce mode + + + + The transfer list is in copy mode, but this instance is not in this mode + La liste de transfert est en mode copie, mais l'instance n'est pas dans ce mode + + + + The transfer list is in move mode, but this instance is not in this mode + La liste de transfert est en mode déplacement, mais l'instance n'est pas dans ce mode + + + + Some errors have been found during the line parsing + Certaine erreur ont été trouvé durant l'analise de la line + + + + Unable to open the transfer list: %1 + Impossible d'ouvrir la list de transfert: %1 + + + + MkPath + + Unable to get time + Impossible d'obtenir l'heure + + + + Unable to create the folder + Impossible de créer le répertoire + + + + The source folder don't exists + Le dossier source n'éxiste pas + + + + Unable to temporary rename the folder + Impossible de renommer le dossier + + + + Unable to do the final real move the folder + Impossible de faire le déplacement final du dossier + + + + Unable to move the folder + Impossible de déplacer le dossier + + + Unable to set time + Impossible de définir l'heure + + + Unable to set the access-right + Impossible de définir les droits d'accés + + + + + Unable to remove + Impossible de supprimer + + + + ReadThread + + + Internal error, please report it! + Erreur interne, merci de la reporter! + + + + Internal error reading the source file:block size out of range + Erreur interne lisant le fichier source: taille de block hors de la plage + + + + + Unable to read the source file: + Impossible de lire le fichier source: + + + + + File truncated during the read, possible data change + La taille du fichier a diminué durant -> changé le texte original + Fichier a diminué durant la lecture, possible changement de données + + + + RenamingRules + + + First renaming + Premier renommage + + + + %name% - copy + %name% should not be translated + variables need never be translated + %name% - copie + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + variables need never be translated + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> pour le nom originel</p></body></html> + + + + Second renaming + Second renommage + + + + %name% - copy (%number%) + %name%, %number% should not be translated + variables need never be translated + %name% - copie (%number%) + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + variables need never be translated + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> pour le nom originel</p><p><span style=" font-weight:600;">%number%</span> pour le nombre extra</p></body></html> + + + + + %1 - copy + %1 - copie + + + + + %1 - copy (%2) + %1 - copie (%2) + + + + Renaming rules + Règles de renommage + + + + ScanFileOrFolder + + + Blacklisted folder + Dossier banis + + + + + %1 - copy + %1 - copie + + + + + %1 - copy (%2) + %1 - copie (%2) + + + + This is not a folder + N'est pas un dossier + + + + The folder does exists + Le répertoire n'existe pas + + + The folder not exists + Le répertoire n'existe pas + + + + The folder is not readable + Le répertoire n'est pas lisible + + + + Problem with name encoding + Problém d'encodage + + + + TransferThread + + + + + + File not found + Fichier non trouvé + + + + Drive %1 + Lecteur %1 + + + Try rename with unauthorized characters + Essaie de renommage avec caratéres interdits + + + + Unknown folder + Dossier inconnu + + + + root + racine + + + + %1 - copy + %1 - copie + + + + %1 - copy (%2) + %1 - copie (%2) + + + + The source doesn't exist + La source n'existe pas + + + + + The source file doesn't exist + Le fichier source n'existe pas + + + + The checksums do not match + Les sommes de controle ne correspondent pas + + + + Internal error: The size transfered doesn't match + Erreur interne: La taille transféré ne corresponds pas + + + + + Unable to do the folder + Impossible de créer le dossier + + + + Try rename with using special characters + Essaie de renommage avec caratéres interdits + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + Mauvaise date de modification ou impossible de l'avoir, vous pouvez désactivé le transfert de celui-ci + + + + + Internal error: Already opening + Erreur interne: Déjà ouvert + + + + Another file exists at same place + Un autre fichier exists à la même place + + + + Internal error: The destination is not closed + Erreur interne: La destination n'est pas fermé + + + + Internal error: The buffer is not empty + Erreur interne: Le buffer n'est pas vide + + + + + + Unable to change the date + Impossible de changer la date + + + + WriteThread + + + Path resolution error (Empty path) + Erreur de résolution de chemain (chemain vide) + + + + Internal error, please report it! + Erreur interne, merci de la reporter! + + + + Unable to read the source file: + Impossible de lire le fichier source: + + + + File truncated during read, possible data change + Fichier rétréci pendant la lecture, possible changement de données + + + + copyEngineOptions + + + Transfer + Transfert + + + + Move the whole folder + Déplacer le dossier complet + + + + Transfer the file rights + Transférer les droits des fichiers + + + + Keep the file date + Garder la date du fichier + + + + Autostart the transfer + Démarrer automatiquement le transfert + + + + + Less performance if checked + Moins de performance si coché + + + + Follow the strict order + Suivre l'ordre strict + + + + Error and collision + Erreur et collision + + + + When folder error + En cas d'erreur de répertoire + + + + When file error + En cas d'erreur de fichier + + + + When file collision + En cas de collision de fichier + + + + When folder collision + Lors d'une collision de dossier + + + + Check if destination folder exists + Vérifier si le répertoire de destination existe + + + + Renaming rules + Règles de renommage + + + + Delete partially transferred files + Supprimer les transferts partiels + + + + Rename the original destination + Renommer la destination originale + + + + Control + Controle + + + + Checksum + Somme de contrôle + + + + Only after error + Seulement après erreur + + + + Ignore if impossible + Ignorer si impossible + + + + Verify checksums + Vérifier les sommes de contrôles + + + + Performance + Performance + + + + Parallel buffer + Buffer paralléle + + + + + + + + KB + Ko + + + + Block size + Taille de bloc + + + + Sequential buffer + Buffer séquentiel + + + + Enable OS buffer + Activer le tampon de l'OS + + + + OS buffer only if smaller than + Tampon de l'OS seulement si plus petit que + + + + Transfer algorithm + Algorithme de transfert + + + + Parallelize if smaller than + Parallèlise si plus petit que + + + + Inode threads + Thread d'inode + + + + + More cpu, but better organisation on the disk + Plus de cpu mais meilleur organisation sur le disque + + + + Order the list + Ordonner la liste + + + + Misc + Divers + + + + Check the disk space + Vérifier l'espace disque + + + + Use this folder when destination is not set + Utiliser ce dossier quand la destination n'est pas défini + + + Use this folder when destination is empty + Utiliser ce dossier quand la destination est vide + + + + Browse + Parcourir + + + + Filters + Filtres + + + + fileErrorDialog + + + Error with file + Erreur avec un fichier + + + + Error + Erreur + + + + Size + Taille + + + + Modified + Modifié + + + + File name + Nom de fichier + + + + Destination + Destination + + + + Folder + Dossier + + + + &Always perform this action + &Toujours faire cette action + + + + Try in with elevated privileges + Essayer avec des priviléges suppérieurs + + + + Put to bottom + Mettre à la fin + + + + Retry + Réessayer + + + + &Skip + &Passer + + + + &Cancel + &Annuler + + + + fileExistsDialog + + + The file exists + Le fichier existe + + + + Source + Source + + + + Destination + Destination + + + + + Size + Taille + + + + + Modified + Modifié + + + + + File name + Nom de fichier + + + + + Folder + Dossier + + + + Suggest new &name + Suggérer un &nouveau nom + + + + &Always perform this action + &Toujours faire cette action + + + + + Overwrite if modification date differs + Écraser si les dates différes + + + + &Rename + &Renommer + + + + &Overwrite + &Écraser + + + + &Skip + &Passer + + + + &Cancel + &Annuler + + + + Overwrite if newer + Écraser si plus récent + + + + + Overwrite if older + Écraser si plus vieux + + + + fileIsSameDialog + + + Size + Taille + + + + Modified + Modifié + + + + File name + Nom de fichier + + + The source and destination is identical + La source et la destination sont identique + + + + The source and destination are same + La source et la destination sont identique + + + + Folder + Dossier + + + + Suggest new &name + Suggérer un &nouveau nom + + + + &Always perform this action + &Toujours faire cette action + + + + &Rename + &Renommer + + + + &Skip + &Passer + + + + &Cancel + &Annuler + + + + folderExistsDialog + + + Source + Source + + + + Destination + Destination + + + + The source and destination is identical + La source et la destination sont identique + + + + + Modified + Modifié + + + + + Folder name + Nom de répertoire + + + + + Folder + Dossier + + + + Suggest new &name + Suggérer un &nouveau nom + + + + &Always perform this action + &Toujours faire cette action + + + + &Rename + &Renommer + + + + Merge + Fusionner + + + + Skip + Passer + + + + &Cancel + &Annuler + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/hi/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/hi/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/hi/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/hu/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/hu/translation.ts new file mode 100644 index 0000000..beff862 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/hu/translation.ts @@ -0,0 +1,1297 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + Nem támogatott ezen a platformon + + + + Last modified date is wrong + A módosítás utolsó dátuma hibás + + + + Last access date is wrong + A hozzáférés utolsó dátuma hibása + + + + Unknown error: %1 + Ismeretlen hiba: %1 + + + + Path conversion error + Útvonal konvertálási hiba + + + + Unknown error + Ismeretlen hiba + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + A motort mozgatásra kényszerítik, nem másolhatsz vele + + + + + The engine is forced to copy, you can't move with it + A motort másolásra kényszerítik, nem mozgathatsz vele + + + + Destination + Cél + + + + Use the actual destination "%1"? + Használja a jelenlegi célt: "%1"? + + + + The mode has been forced previously. This is an internal error, please report it + Ezt a módot már korábban kényszerítették. Belső hiba történt, kérlek jelentsd be + + + + + + + Ask + Kérdezzen rá + + + + + + + Skip + Kihagy + + + + Merge + Összeolvaszt + + + + + Rename + Nevezze át + + + + Put at the end + Helyezze a végére + + + + Overwrite + Felülír + + + + Overwrite if different + Felülír, ha különbözik + + + + Overwrite if newer + Felülír, ha újabb + + + + Overwrite if older + Felülír, ha régebbi + + + + Automatic + Automatikus + + + + Sequential + Szekvenciális + + + + Parallel + Párhuzamos + + + + Options error + Beállítási hiba + + + + Options engine is not loaded. Unable to access the filters + A beállítási motor nincs betöltve. A szűrők elérése nem lehetséges + + + + CopyEngineFactory + + + + + + Ask + Kérdezzen rá + + + + + + + Skip + Kihagy + + + + Merge + Összeolvaszt + + + + + Rename + Nevezze át + + + + Put at the end + Helyezze a végére + + + + Overwrite + Felülír + + + + Overwrite if different + Felülír, ha különbözik + + + + Overwrite if newer + Felülír, ha újabb + + + + Overwrite if older + Felülír, ha régebbi + + + + Automatic + Automatikus + + + + Sequential + Szekvenciális + + + + Parallel + Párhuzamos + + + + + Options error + Beállítási hiba + + + + Options engine is not loaded. Unable to access the filters + A beállítási motor nincs betöltve. A szűrők elérése nem lehetséges + + + + Options engine is not loaded, can't access to the filters + A beállítási motor nincs betöltve, a szűrők elérése nem lehetséges + + + + DiskSpace + + + Disk space + Lemezterület + + + + You need more space on this drive to finish this transfer + Több szabad helyre van szükséged ezen a lemezen az átvitel befejezéséhez + + + + Continue + Folytatás + + + + Cancel + Mégse + + + + Drives %1 have %2 available but need %3 + %1 meghajtón %2 hely van, de %3 szükséges + + + + FileErrorDialog + + + Error on folder + Hiba a mappával + + + + Folder name + Mappa neve + + + + FileExistsDialog + + + %1 - copy + %1 - másolás + + + + %1 - copy (%2) + %1 - másolás (%2) + + + + Error + Hiba + + + + Try rename with using special characters + Átnevezés speciális karakterek használatával + + + + FileIsSameDialog + + + %1 - copy + %1 - másolás + + + + %1 - copy (%2) + %1 - másolás (%2) + + + + Error + Hiba + + + + Try rename with using special characters + Átnevezés speciális karakterek használatával + + + + FilterRules + + + Filters dialog + Szűrők üzenet + + + + Search: + Keresés: + + + + Search type: + Keresés típusa: + + + + Raw text + Nyers szöveg + + + + Simplified regex + Egyszerűsített regex + + + + Perl's regex + Perl regex + + + + Apply on: + Alkalmazás ezen: + + + + File + Fájl + + + + Folder + Mappa + + + + File and folder + Fájl és mappa + + + + Whole string must match + A teljes szövegnek egyeznie kell + + + + The test string matches with the regex + A tesztszöveg megegyezik a regexszel + + + + Checking + Ellenőrzés + + + + The regex is valid + A regex érvényes + + + + Test string: + Próbaszöveg: + + + + Filters + + + Filters + Szűrők + + + + Exclusion filters + Kizáró szűrők + + + + Inclusion filters + Használt szűrők + + + + None = Include all + Nincs = Mindet használ + + + + + Raw text + Nyers szöveg + + + + + Simplified regex + Egyszerűsített regex + + + + + Perl's regex + Perl regex + + + + + Only on file + Csak fájlon + + + + + Only on folder + Csak mappán + + + + + + + Full match + Teljes egyezés + + + + FolderExistsDialog + + + Folder already exists + Mappa már létezik + + + + %1 - copy + %1 - másolás + + + + %1 - copy (%2) + %1 - másolás (%2) + + + + Error + Hiba + + + + Try rename with using special characters + Átnevezés speciális karakterek használatával + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + Elem másolása vagy mozgatás nem lehetséges a hibás kényszerített módban: %1 + + + + + Unable to save the transfer list: %1 + Átviteli lista mentése nem lehetséges: %1 + + + + Problem reading file, or file-size is 0 + Hiba a fájl olvasásánál vagy a fálméret 0 + + + + Wrong header: "%1" + Hibás fejléc: "%1" + + + + The transfer list is in mixed mode, but this instance is not in this mode + Az átviteli lista kevert módban van, de ez a példány nincs + + + + The transfer list is in copy mode, but this instance is not in this mode + Az átviteli lista másolás módban van, de ez a példány nincs + + + + The transfer list is in move mode, but this instance is not in this mode + Az átviteli lista mozgatás módban van, de ez a példány nincs + + + + Some errors have been found during the line parsing + Néhány hiba történt a sorelemzés során + + + + Unable to open the transfer list: %1 + Az átviteli lista megnyitása nem lehetséges: %1 + + + + MkPath + + + Unable to create the folder + Mappa létrehozása nem lehetséges + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + Unable to set the access-right + Jogok beállítása nem lehetséges + + + + + Unable to remove + Eltávolítás nem lehetséges + + + + ReadThread + + + Internal error, please report it! + Belső hiba, kérlek jelentsd! + + + + Internal error reading the source file:block size out of range + Belső hiba történt a forrásfájl olvasásakor: a blokkméret tartományon kívüli + + + + + Unable to read the source file: + A forrásfájl olvasása nem lehetséges: + + + + + File truncated during the read, possible data change + A fájl olvasás során megcsonkult, valószínűleg adatváltozás miatt + + + + RenamingRules + + + Renaming rules + Átnevezési szabályok + + + + First renaming + Első átnevezés + + + + %name% - copy + %name% should not be translated + %name% - másolás + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + <html><head/><body><p>Változók: <span style=" font-weight:600;">%name%</span> az eredeti fájlnévhez</p></body></html> + + + + Second renaming + Második átnevezés + + + + %name% - copy (%number%) + %name%, %number% should not be translated + %name% - másolás (%number%) + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + <html><head/><body><p>Változók: <span style=" font-weight:600;">%name%</span> az eredeti fájlnévhez</p><p><span style=" font-weight:600;">%number%</span> az extra számhoz</p></body></html> + + + + + %1 - copy + %1 - másolás + + + + + %1 - copy (%2) + %1 - másolás (%2) + + + + ScanFileOrFolder + + + Blacklisted folder + Feketelistás mappa + + + + + %1 - copy + %1 - másolás + + + + + %1 - copy (%2) + %1 - másolás (%2) + + + + This is not a folder + Ez nem mappa + + + + The folder does exists + A mappa létezik + + + + The folder is not readable + A mappa nem olvasható + + + + Problem with name encoding + Probléma a névkódolással + + + + TransferThread + + + + + + File not found + Fájl nem található + + + + Drive %1 + %1 meghajtó + + + + Unknown folder + Ismeretlen mappa + + + + root + gyökér + + + + %1 - copy + %1 - másolás + + + + %1 - copy (%2) + %1 - másolás (%2) + + + + The source doesn't exist + A forrás nem létezik + + + + + Unable to do the folder + Mappaművelet nem lehetséges + + + + Try rename with using special characters + Átnevezés speciális karakterek használatával + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + + The source file doesn't exist + A forrásfájl nem létezik + + + + Another file exists at same place + Egy másik fájl létezik ugyanazon a helyen + + + + The checksums do not match + A checksumok nem egyeznek meg + + + + Internal error: The destination is not closed + Belső hiba: a cél nincs bezárva + + + + Internal error: The size transfered doesn't match + Belső hiba: az átvitt méret nem egyezik meg + + + + Internal error: The buffer is not empty + Belső hiba: a puffer nem üres + + + + + + Unable to change the date + + + + + WriteThread + + + Path resolution error (Empty path) + Útvonal feloldási hiba (Üres útvonal) + + + + Internal error, please report it! + Belső hiba, kérlek jelentsd! + + + + Unable to read the source file: + A forrásfájl olvasása nem lehetséges: + + + + File truncated during read, possible data change + Fájl megsérült az olvasás közben, valószínűleg adatváltozás + + + + copyEngineOptions + + + Transfer + Átvitel + + + + Move the whole folder + Mozgassa át az egész mappát + + + + Transfer the file rights + Fájljogok átadása + + + + Keep the file date + Fájl dátumának megtartása + + + + Autostart the transfer + Átvitel automatikus indítása + + + + + Less performance if checked + Kisebb teljesítmény, ha be van jelölve + + + + Follow the strict order + Kövesse a szigorú sorrendet + + + + Error and collision + Hiba és ütközés + + + + When folder error + Mappa hiba esetén + + + + When file error + Fájl hiba esetén + + + + When file collision + Fájl ütközés esetén + + + + When folder collision + Mappa ütközés esetén + + + + Check if destination folder exists + Célmappa létezésének ellenőrzése + + + + Renaming rules + Átnevezési szabályok + + + + Delete partially transferred files + Részben átvitt fájlok törlése + + + + Rename the original destination + Eredeti cél átnevezése + + + + Control + Irányítás + + + + Checksum + Checksum + + + + Only after error + Csak hiba után + + + + Ignore if impossible + Hagyja ki, ha nem lehetséges + + + + Verify checksums + Checksumok ellenőrzése + + + + Performance + Teljesítmény + + + + Parallel buffer + Párhuzamos puffer + + + + + + + + KB + KB + + + + Block size + Blokkméret + + + + Sequential buffer + Szekvenciális puffer + + + + Enable OS buffer + OS puffer engedélyezése + + + + OS buffer only if smaller than + OS buffer csak akkor, ha kisebb mint + + + + Transfer algorithm + Átviteli algoritmus + + + + Parallelize if smaller than + Párhuzamosítás, ha kisebb mint + + + + Inode threads + Inode szálak + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + Egyéb + + + + Check the disk space + Lemezterület ellenőrzése + + + + Use this folder when destination is not set + + + + Use this folder when destination is empty + Használja ezt a mappát, ha a cél üres + + + + Browse + Tallózás + + + + Filters + Szűrők + + + + fileErrorDialog + + + Error with file + Hiba a fájllal + + + + Error + Hiba + + + + Size + Méret + + + + Modified + Módosítva + + + + File name + Fájlnév + + + + Destination + Cél + + + + Folder + Mappa + + + + &Always perform this action + &Mindig hajtsa végre ezt a műveletet + + + + Try in with elevated privileges + Próbálja meg emelt jogosultsággal + + + + Put to bottom + Tegye legalulra + + + + Retry + Újra + + + + &Skip + &Kihagy + + + + &Cancel + M&égse + + + + fileExistsDialog + + + The file exists + A fájl létezik + + + + Source + Forrás + + + + Destination + Cél + + + + + Size + Méret + + + + + Modified + Módosítva + + + + + File name + Fájlnév + + + + + Folder + Mappa + + + + Suggest new &name + Új &név ajánlása + + + + &Always perform this action + &Mindig hajtsa végre ezt a műveletet + + + + + Overwrite if modification date differs + Felülír, ha a módosítás dátuma különbözik + + + + + Overwrite if older + Felülír, ha régebbi + + + + &Rename + &Átnevez + + + + &Overwrite + &Felülír + + + + &Skip + &Kihagy + + + + &Cancel + &Mégse + + + + Overwrite if newer + Felülír, ha újabb + + + + fileIsSameDialog + + + Size + Méret + + + + Modified + Módosítva + + + + File name + Fájlnév + + + + The source and destination are same + A forrás és a cél megegyezik + + + + Folder + Mappa + + + + Suggest new &name + Új &név javasolása + + + + &Always perform this action + &Mindig hajtsa végre ezt a műveletet + + + + &Rename + &Átnevez + + + + &Skip + &Kihagy + + + + &Cancel + M&égse + + + + folderExistsDialog + + + Source + Forrás + + + + Destination + Cél + + + + + Modified + Módosítva + + + + + Folder name + Mappa neve + + + + Suggest new &name + Új &név javasolása + + + + The source and destination is identical + A forrás és a cél megegyezik + + + + + Folder + Mappa + + + + &Always perform this action + &Mindig hajtsa végre ezt a műveletet + + + + &Rename + &Átnevez + + + + Merge + Összeolvaszt + + + + Skip + Kihagy + + + + &Cancel + M&égse + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/id/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/id/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/id/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/it/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/it/translation.ts new file mode 100644 index 0000000..0bbc22f --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/it/translation.ts @@ -0,0 +1,1319 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + Non supportato su questa piattaforma + + + + Last modified date is wrong + La data dell'ultima modifica è errata + + + + Last access date is wrong + La data dell'ultimo accesso è errata + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + Percorso dell'errore di conversione + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + Impossibile copiare, il motore per la copia forzerà lo spostamento + + + + + The engine is forced to copy, you can't move with it + Impossibile effettuare lo spostamento, il motore per la copia forzerà la copia + + + + Destination + Cartella di destinazione + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + Chiedi + + + + + + + Skip + Salta + + + + Merge + Unisci + + + + + Rename + Rinomina + + + + Put at the end + Metti in coda + + + + Overwrite + Sovrascrivi + + + + Overwrite if different + Sovrascrivi se differente + + + + Overwrite if newer + Sovrascrivi se più recente + + + + Overwrite if older + Sovrascrivi se meno recente + + + + Automatic + Automatico + + + + Sequential + Sequenziale + + + + Parallel + Parallelo + + + + Options error + Opzioni di errore + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + Chiedi + + + + + + + Skip + Salta + + + + Merge + Unisci + + + + + Rename + Rinomina + + + + Put at the end + Metti in coda + + + + Overwrite + Sovrascrivi + + + + Overwrite if different + Sovrascrivi se differente + + + + Overwrite if newer + Sovrascrivi se più recente + + + + Overwrite if older + Sovrascrivi se meno recente + + + + Automatic + Automatico + + + + Sequential + Sequenziale + + + + Parallel + Parallelo + + + + + Options error + Opzioni di errore + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + Le opzioni del motore per la copia non vengono caricate, impossibile accedere ai filtri + + + + DiskSpace + + + Disk space + Spazio su disco + + + + You need more space on this drive to finish this transfer + + + + + Continue + Continua + + + + Cancel + Annulla + + + + Drives %1 have %2 available but need %3 + L'unità %1 ha %2 disponibili, ma necessita di %3 + + + + FileErrorDialog + + + Error on folder + Errore nella cartella + + + + Folder name + Nome della cartella + + + + FileExistsDialog + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Error + Errore + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Error + Errore + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + Cerca: + + + + Search type: + Tipo di ricerca: + + + + Raw text + Testo raw + + + + Simplified regex + Regex semplificato + + + + Perl's regex + Regex in Perl + + + + Apply on: + Applicare su: + + + + File + File + + + + Folder + Cartelle + + + + File and folder + File e cartelle + + + + The test string matches with the regex + + + + + Checking + Verifica + + + + Test string: + Stringa di verifica: + + + + Filters dialog + Finestra dei filtri + + + + Whole string must match + + + + + The regex is valid + La regex è valida + + + + Filters + + + Filters + Filtri + + + + Exclusion filters + Filtri di esclusione + + + + Inclusion filters + o filtri per l'inserimento? + Filtri di inclusione + + + + None = Include all + o Nessuno = Includi tutti oppure Nessuno = Inserisci tutti oppure bisogna lasiare none? + Nessuno = Tutti inclusi + + + + + Raw text + Testo raw + + + + + Simplified regex + Regex semplificato + + + + + Perl's regex + Regex in Perl + + + + + Only on file + Solo su file + + + + + Only on folder + o cartella al singolare? + Solo su cartelle + + + + + + + Full match + Corrispondenza completa + + + + FolderExistsDialog + + + Folder already exists + Cartella già presente + + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Error + Errore + + + + Try rename with using special characters + + + + Try rename with unauthorized charateres + Provare a rinominare con caratteri non consentiti + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + Impossibile spostare o copiare elementi in modalità forzata anomala: %1 + + + + + Unable to save the transfer list: %1 + Impossibile salvare la lista dei trasferimenti: %1 + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + Header si riferisce all'intestazione? + Intestazione sbagliata: "%1" + + + + The transfer list is in mixed mode, but this instance is not in this mode + La lista dei trasferimenti è in modalità mista, ma questa istanza non è in questa modalità + + + + The transfer list is in copy mode, but this instance is not in this mode + La lista dei trasferimenti è in modalità di copia, ma questa istanza non è in questa modalità + + + + The transfer list is in move mode, but this instance is not in this mode + La lista dei trasferimenti è in modalità di spostamento, ma questa istanza non è in questa modalità + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + Impossibile aprire la lista dei trasferimenti: %1 + + + + MkPath + + Unable to get time + Impossibile ottenere l'ora + + + + Unable to create the folder + Impossibile creare la cartella + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + Unable to set time + Impossibile impostare l'ora + + + + + Unable to remove + Impossibile eliminare + + + + ReadThread + + + Internal error, please report it! + Errore interno, pregasi di segnalarlo! + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + Impossibile leggere il file di origine: + + + + + File truncated during the read, possible data change + File troncato durante la lettura, possibili variazioni di dati + + + + RenamingRules + + + First renaming + o Prima ridenominazione? + Prima rinomina + + + + %name% - copy + %name% should not be translated + %name% non dovrà essere tradotto + Copia di %name% + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + o per il nome originale del file + <html><head/><body><p>variabili: <span style=" font-weight:600;">%name%</span> per il nome del file di origine</p></body></html> + + + + Second renaming + o Seconda ridenominazione? + Seconda rinomina + + + + %name% - copy (%number%) + %name%, %number% should not be translated + %name% e %number% non dovranno essere tradotti + Copia di %name% (%number%) + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + %name% e %number% non dovranno essere tradotti + <html><head/><body><p>variabili: <span style=" font-weight:600;">%name%</span> per il nome del file di origine</p><p><span style=" font-weight:600;">%number%</span> per il numero progressivo</p></body></html> + + + + + %1 - copy + %1 - copia + + + + + %1 - copy (%2) + %1 - copia (%2) + + + + Renaming rules + Regole di rinomina + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + %1 - copia + + + + + %1 - copy (%2) + %1 - copia (%2) + + + + This is not a folder + Questa non è una cartella + + + + The folder does exists + + + + The folder not exists + La cartella non esiste + + + + The folder is not readable + La cartella non è leggibile + + + + Problem with name encoding + Problema con la codifica del nome + + + + TransferThread + + + + + + File not found + File non trovato + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + Unità %1 + + + + Unknown folder + + + + + root + root + + + + %1 - copy + %1 - copia + + + + %1 - copy (%2) + %1 - copia (%2) + + + + + The source file doesn't exist + + + + + + Unable to do the folder + Impossibile creare la cartella + + + + Try rename with using special characters + + + + + The source doesn't exist + + + + + Another file exists at same place + Nello stesso percorso è presente un altro file + + + + The checksums do not match + + + + + Internal error: The destination is not closed + Errore interno: la cartella di destinazione non è chiusa + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + Errore interno: il buffer non è vuoto + + + + + + Unable to change the date + Impossibile cambiare la data + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + Errore interno, pregasi di segnalarlo! + + + + Unable to read the source file: + Impossibile leggere il file di origine: + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + Trasferisci + + + + Move the whole folder + Spostare l'intera cartella + + + + Transfer the file rights + Trasferire le autorizzazioni dei file + + + + Keep the file date + Mantenere la data del file + + + + Autostart the transfer + + + + + + Less performance if checked + Se selezionato si avranno prestazioni ridotte + + + + Follow the strict order + Seguire rigorosamente l'ordine + + + + Error and collision + Errori di coincidenze + + + + When folder error + Quando si verifica un errore nelle cartelle + + + + When file error + Quando si verifica un errore nei file + + + + When file collision + Quando i file coincidono + + + + When folder collision + Quando le cartelle coincidono + + + + Check if destination folder exists + Controllare se la cartella di destinazione esiste + + + + Renaming rules + Regole di rinomina + + + + Delete partially transferred files + Eliminare i file parzialmente trasferiti + + + + Rename the original destination + Rinominare la destinazione all'origine + + + + Control + Controllare + + + + Checksum + Codice di controllo (Checksum) + + + + Only after error + Solo dopo l'errore + + + + Ignore if impossible + Ignora se non corrisponde + + + + Verify checksums + + + + + Performance + Prestazioni + + + + Parallel buffer + Buffer parallelo + + + + + + + + KB + KB + + + + Block size + Dimensione del blocco + + + + Sequential buffer + Buffer sequenziale + + + + Enable OS buffer + Attivare il buffer del sistema operativo + + + + OS buffer only if smaller than + Buffer del sistema operativo solo se inferiore a + + + + Transfer algorithm + Algoritmo di trasferimento + + + + Parallelize if smaller than + Affiancare se inferiore a + + + + Inode threads + Inode threads + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + Varie + + + + Check the disk space + Controllare lo spazio su disco + + + + Use this folder when destination is not set + + + + Use this folder when destination is empty + Usare questa cartella quando la cartella di destinazione è vuota + + + + Browse + Sfoglia + + + + Filters + Filtri + + + + fileErrorDialog + + + Error with file + + + + + Error + Errore + + + + Size + Dimensione + + + + Modified + Modificato + + + + File name + Nome del file + + + + Destination + Cartella di destinazione + + + + Folder + Cartelle + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + Mettere in coda + + + + Retry + Riprova + + + + &Skip + &Salta + + + + &Cancel + &Annulla + + + + fileExistsDialog + + + The file exists + Il file è già presente + + + + Source + Cartella di origine + + + + Destination + Cartella di destinazione + + + + + Size + Dimensione + + + + + Modified + Modificato + + + + + File name + Nome del file + + + + + Folder + Cartelle + + + + Suggest new &name + Suggerisci un nuovo &nome + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + &Rinomina + + + + &Overwrite + &Sovrascrivi + + + + &Skip + &Salta + + + + &Cancel + &Annulla + + + + Overwrite if newer + Sovrascrivi se più recente + + + + + Overwrite if older + Sovrascrivi se meno recente + + + + fileIsSameDialog + + + Size + Dimensione + + + + Modified + Modificato + + + + File name + Nome del file + + + + The source and destination are same + + + + + Folder + Cartelle + + + + Suggest new &name + Suggerisci nuovo &nome + + + + &Always perform this action + + + + + &Rename + &Rinomina + + + + &Skip + &Salta + + + + &Cancel + &Annulla + + + + folderExistsDialog + + + Source + Cartella di origine + + + + Destination + Cartella di destinazione + + + + The source and destination is identical + + + + + + Modified + Modificato + + + + + Folder name + Nome della cartella + + + + + Folder + Cartelle + + + + Suggest new &name + Suggerisci nuovo &nome + + + + &Always perform this action + + + + + &Rename + &Rinomina + + + + Merge + Unisci + + + + Skip + Salta + + + + &Cancel + &Annulla + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/ja/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/ja/translation.ts new file mode 100644 index 0000000..25bb8d3 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/ja/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Filters dialog + + + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + Whole string must match + + + + + The test string matches with the regex + + + + + Checking + + + + + The regex is valid + + + + + Test string: + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + Renaming rules + + + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/ko/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/ko/translation.ts new file mode 100644 index 0000000..deeeead --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/ko/translation.ts @@ -0,0 +1,1293 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + 이 플랫폼에서 지원되지 않습니다 + + + + Last modified date is wrong + 마지막 수정 날짜가 잘못되었습니다 + + + + Last access date is wrong + 마지막 엑세스 날짜가 잘못되었습니다 + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + 대상 + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + 확인 + + + + + + + Skip + 건너뛰기 + + + + Merge + 합치기 + + + + + Rename + 이름 바꾸기 + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + 더 최신이면 덮어씌우기 + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + 확인 + + + + + + + Skip + 건너뛰기 + + + + Merge + 합치기 + + + + + Rename + 이름 바꾸기 + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + 더 최신이면 덮어씌우기 + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + 폴더 이름 + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + 오류 + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + 오류 + + + + Try rename with using special characters + + + + + FilterRules + + + Filters dialog + + + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + Whole string must match + + + + + The test string matches with the regex + + + + + Checking + + + + + The regex is valid + + + + + Test string: + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + 오류 + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + 폴더를 생성할 수 없습니다 + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + 원본 파일 읽기 불가: + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + Renaming rules + + + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + The folder not exists + 폴더가 존재하지 않습니다 + + + + The folder is not readable + 폴더를 읽을 수 없습니다 + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + 원본 파일 읽기 불가: + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + 파일 권한 전송 + + + + Keep the file date + 파일 날짜 보존 + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + 폴더 오류시 + + + + When file error + + + + + When file collision + + + + + When folder collision + 폴더 충돌시 + + + + Check if destination folder exists + 대상 폴드 존재시 확인 + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + KB + + + + Block size + 블럭 크기 + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + 오류 + + + + Size + 크기 + + + + Modified + 수정 날짜 + + + + File name + 파일 이름 + + + + Destination + 대상 + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + 아래에 놓기 + + + + Retry + 재시도 + + + + &Skip + &건너뛰기 + + + + &Cancel + &취소 + + + + fileExistsDialog + + + The file exists + 파일이 존재합니다 + + + + Source + 원본 + + + + Destination + 대상 + + + + + Size + 크기 + + + + + Modified + 수정 날짜 + + + + + File name + 파일 이름 + + + + + Folder + + + + + Suggest new &name + 새 &이름 제안 + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + &이름 바꾸기 + + + + &Overwrite + &덮어씌우기 + + + + &Skip + &건너뛰기 + + + + &Cancel + &취소 + + + + Overwrite if newer + 더 최신이면 덮어씌우기 + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + 크기 + + + + Modified + 수정 날짜 + + + + File name + 파일 이름 + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + 새 &이름 제안 + + + + &Always perform this action + + + + + &Rename + &이름 바꾸기 + + + + &Skip + &건너뛰기 + + + + &Cancel + &취소 + + + + folderExistsDialog + + + Source + 원본 + + + + Destination + 대상 + + + + The source and destination is identical + + + + + + Modified + 수정 날짜 + + + + + Folder name + 폴더 이름 + + + + + Folder + + + + + Suggest new &name + 새 &이름 제안 + + + + &Always perform this action + + + + + &Rename + &이름 바꾸기 + + + + Merge + 합치기 + + + + Skip + 건너뛰기 + + + + &Cancel + &취소 + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/nl/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/nl/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/nl/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/no/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/no/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/no/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/pl/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/pl/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/pl/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/pt/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/pt/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/pt/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/ru/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/ru/translation.ts new file mode 100644 index 0000000..f53fff3 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/ru/translation.ts @@ -0,0 +1,1293 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + Не поддерживается на этой платформе + + + + Last modified date is wrong + Дата обновления неправильно + + + + Last access date is wrong + Дата последнего доступа не так + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + Двигатель вынуждены покинуть свои дома, вы не можете скопировать с ним + + + + + The engine is forced to copy, you can't move with it + Двигатель вынужден копии, вы не можете двигаться вместе с ним + + + + Destination + назначение + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + просить + + + + + + + Skip + пропускать + + + + Merge + слияние + + + + + Rename + переименовать + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + Заменить, если новее + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + Опции ошибке + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + просить + + + + + + + Skip + пропускать + + + + Merge + слияние + + + + + Rename + переименовать + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + Заменить, если новее + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + Опции ошибке + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + Параметры двигателя не загружается, не может получить доступ к фильтрам + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + Ошибка в папку + + + + Folder name + имя папки + + + + FileExistsDialog + + + %1 - copy + %1 - копия + + + + %1 - copy (%2) + %1 - копия (%2) + + + + Error + ошибка + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + %1 - копия + + + + %1 - copy (%2) + %1 - копия (%2) + + + + Error + ошибка + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + Поиск по сайту: + + + + Search type: + Тип поиска: + + + + Raw text + Сырой текст + + + + Simplified regex + упрощенный regex + + + + Perl's regex + Perl's regex + + + + Apply on: + Нанесите на: + + + + File + файл + + + + Folder + папка + + + + File and folder + Файлов и папок + + + + The test string matches with the regex + + + + + Checking + контроль + + + + Test string: + Испытание строки: + + + + Filters dialog + Фильтры диалогового + + + + Whole string must match + + + + + The regex is valid + Регулярное действует + + + + Filters + + + Filters + Фильтры + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + Ни = Включить все + + + + + Raw text + Сырой текст + + + + + Simplified regex + Упрощенная регулярных выражений + + + + + Perl's regex + Perl's regex + + + + + Only on file + Только на файл + + + + + Only on folder + Только на папку + + + + + + + Full match + Полный матч + + + + FolderExistsDialog + + + Folder already exists + Папка уже существует + + + + %1 - copy + %1 - копия + + + + %1 - copy (%2) + %1 - копия (%2) + + + + Error + ошибка + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + Невозможно сделать, чтобы скопировать или переместить элемент в неправильном форсированном режиме: %1 + + + + + Unable to save the transfer list: %1 + Невозможно сохранить трансфер: %1 + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + Неправильный заголовок: "%1" + + + + The transfer list is in mixed mode, but this instance is not in this mode + Трансфер в смешанном режиме, но этот экземпляр не в этом режиме + + + + The transfer list is in copy mode, but this instance is not in this mode + Передача списка в режиме копирования, но этот экземпляр не в этом режиме + + + + The transfer list is in move mode, but this instance is not in this mode + Трансфер в режим перемещения, но этот экземпляр не в этом режиме + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + Не удается открыть трансфер: %1 + + + + MkPath + + + Unable to create the folder + Невозможно создать папку + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + Невозможно прочитать исходный файл: + + + + + File truncated during the read, possible data change + Файл усечены во время чтения, возможность изменения данных + + + + RenamingRules + + + First renaming + Первое переименование + + + + %name% - copy + %name% should not be translated + %name% - копия + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + <html><head/><body><p>Переменные: <span style=" font-weight:600;">%name%</span> по оригинальному названию файла</p></body></html> + + + + Second renaming + Второе переименование + + + + %name% - copy (%number%) + %name%, %number% should not be translated + %name% - копия (%number%) + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + <html><head/><body><p>Переменные: <span style=" font-weight:600;">%name%</span> по оригинальному названию файла</p><p><span style=" font-weight:600;">%number%</span> за дополнительный номер</p></body></html> + + + + + %1 - copy + %1 - копия + + + + + %1 - copy (%2) + %1 - копия (%2) + + + + Renaming rules + Переименование правила + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + %1 - копия + + + + + %1 - copy (%2) + %1 - копия (%2) + + + + This is not a folder + + + + + The folder does exists + + + + The folder not exists + Папка не существует + + + + The folder is not readable + Папки не читается + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + %1 - копия + + + + %1 - copy (%2) + %1 - копия (%2) + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + Невозможно прочитать исходный файл: + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + Передача файлов прав + + + + Keep the file date + Держите дату файла + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + Когда папка ошибка + + + + When file error + + + + + When file collision + + + + + When folder collision + Когда папка столкновения + + + + Check if destination folder exists + Убедитесь, что папка существует + + + + Renaming rules + Переименование правила + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + Контрольная + + + + Only after error + Только после того, как ошибка + + + + Ignore if impossible + Игнорировать, если невозможно + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + KB + + + + Block size + размер блока + + + + Sequential buffer + + + + + Enable OS buffer + Включить OS буфер + + + + OS buffer only if smaller than + ОС буфер, только если меньше + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + Фильтры + + + + fileErrorDialog + + + Error with file + + + + + Error + ошибка + + + + Size + размер + + + + Modified + модифицированный + + + + File name + имя файла + + + + Destination + назначение + + + + Folder + папка + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + Положить в нижней + + + + Retry + Повторить + + + + &Skip + пропускать + + + + &Cancel + отменить + + + + fileExistsDialog + + + The file exists + Файл существует + + + + Source + источник + + + + Destination + назначение + + + + + Size + размер + + + + + Modified + модифицированный + + + + + File name + имя файла + + + + + Folder + папка + + + + Suggest new &name + Предложить новое имя + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + переименовать + + + + &Overwrite + переписывать + + + + &Skip + пропускать + + + + &Cancel + отменить + + + + Overwrite if newer + Заменить, если новее + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + размер + + + + Modified + модифицированный + + + + File name + имя файла + + + + The source and destination are same + + + + + Folder + папка + + + + Suggest new &name + Предложить новое имя + + + + &Always perform this action + + + + + &Rename + переименовать + + + + &Skip + пропускать + + + + &Cancel + отменить + + + + folderExistsDialog + + + Source + источник + + + + Destination + назначение + + + + The source and destination is identical + + + + + + Modified + модифицированный + + + + + Folder name + имя папки + + + + + Folder + папка + + + + Suggest new &name + Предложить новое имя + + + + &Always perform this action + + + + + &Rename + переименовать + + + + Merge + слияние + + + + Skip + пропускать + + + + &Cancel + отменить + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/th/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/th/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/th/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/tr/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/tr/translation.ts new file mode 100644 index 0000000..3362659 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/tr/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + The test string matches with the regex + + + + + Checking + + + + + Test string: + + + + + Filters dialog + + + + + Whole string must match + + + + + The regex is valid + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + Renaming rules + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/Languages/zh/translation.ts b/plugins/CopyEngine/Ultracopier/Languages/zh/translation.ts new file mode 100644 index 0000000..25bb8d3 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/zh/translation.ts @@ -0,0 +1,1289 @@ + + + + + AvancedQFile + + + + + Not supported on this platform + + + + + Last modified date is wrong + + + + + Last access date is wrong + + + + + Unknown error: %1 + + + + + Unknown error + + + + + Path conversion error + + + + + CopyEngine + + + + The engine is forced to move, you can't copy with it + + + + + + The engine is forced to copy, you can't move with it + + + + + Destination + + + + + Use the actual destination "%1"? + + + + + The mode has been forced previously. This is an internal error, please report it + + + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + CopyEngineFactory + + + + + + Ask + + + + + + + + Skip + + + + + Merge + + + + + + Rename + + + + + Put at the end + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + Options error + + + + + Options engine is not loaded. Unable to access the filters + + + + + Options engine is not loaded, can't access to the filters + + + + + DiskSpace + + + Disk space + + + + + You need more space on this drive to finish this transfer + + + + + Continue + + + + + Cancel + + + + + Drives %1 have %2 available but need %3 + + + + + FileErrorDialog + + + Error on folder + + + + + Folder name + + + + + FileExistsDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FileIsSameDialog + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + FilterRules + + + Filters dialog + + + + + Search: + + + + + Search type: + + + + + Raw text + + + + + Simplified regex + + + + + Perl's regex + + + + + Apply on: + + + + + File + + + + + Folder + + + + + File and folder + + + + + Whole string must match + + + + + The test string matches with the regex + + + + + Checking + + + + + The regex is valid + + + + + Test string: + + + + + Filters + + + Filters + + + + + Exclusion filters + + + + + Inclusion filters + + + + + None = Include all + + + + + + Raw text + + + + + + Simplified regex + + + + + + Perl's regex + + + + + + Only on file + + + + + + Only on folder + + + + + + + + Full match + + + + + FolderExistsDialog + + + Folder already exists + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + Error + + + + + Try rename with using special characters + + + + + ListThread + + + + Unable do to move or copy item into wrong forced mode: %1 + + + + + + Unable to save the transfer list: %1 + + + + + Problem reading file, or file-size is 0 + + + + + Wrong header: "%1" + + + + + The transfer list is in mixed mode, but this instance is not in this mode + + + + + The transfer list is in copy mode, but this instance is not in this mode + + + + + The transfer list is in move mode, but this instance is not in this mode + + + + + Some errors have been found during the line parsing + + + + + Unable to open the transfer list: %1 + + + + + MkPath + + + Unable to create the folder + + + + + The source folder don't exists + + + + + Unable to temporary rename the folder + + + + + Unable to do the final real move the folder + + + + + Unable to move the folder + + + + + + Unable to remove + + + + + ReadThread + + + Internal error, please report it! + + + + + Internal error reading the source file:block size out of range + + + + + + Unable to read the source file: + + + + + + File truncated during the read, possible data change + + + + + RenamingRules + + + Renaming rules + + + + + First renaming + + + + + %name% - copy + %name% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + should not be translated + + + + + Second renaming + + + + + %name% - copy (%number%) + %name%, %number% should not be translated + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + %name%, %number% should not be translated + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + ScanFileOrFolder + + + Blacklisted folder + + + + + + %1 - copy + + + + + + %1 - copy (%2) + + + + + This is not a folder + + + + + The folder does exists + + + + + The folder is not readable + + + + + Problem with name encoding + + + + + TransferThread + + + + + + File not found + + + + + + Wrong modification date or unable to get it, you can disable time transfer to do it + + + + + + Internal error: Already opening + + + + + Drive %1 + + + + + Unknown folder + + + + + root + + + + + %1 - copy + + + + + %1 - copy (%2) + + + + + + The source file doesn't exist + + + + + + Unable to do the folder + + + + + The source doesn't exist + + + + + Another file exists at same place + + + + + The checksums do not match + + + + + Internal error: The destination is not closed + + + + + Internal error: The size transfered doesn't match + + + + + Internal error: The buffer is not empty + + + + + + + Unable to change the date + + + + + Try rename with using special characters + + + + + WriteThread + + + Path resolution error (Empty path) + + + + + Internal error, please report it! + + + + + Unable to read the source file: + + + + + File truncated during read, possible data change + + + + + copyEngineOptions + + + Transfer + + + + + Move the whole folder + + + + + Transfer the file rights + + + + + Keep the file date + + + + + Autostart the transfer + + + + + + Less performance if checked + + + + + Follow the strict order + + + + + Error and collision + + + + + When folder error + + + + + When file error + + + + + When file collision + + + + + When folder collision + + + + + Check if destination folder exists + + + + + Renaming rules + + + + + Delete partially transferred files + + + + + Rename the original destination + + + + + Control + + + + + Checksum + + + + + Only after error + + + + + Ignore if impossible + + + + + Verify checksums + + + + + Performance + + + + + Parallel buffer + + + + + + + + + KB + + + + + Block size + + + + + Sequential buffer + + + + + Enable OS buffer + + + + + OS buffer only if smaller than + + + + + Transfer algorithm + + + + + Parallelize if smaller than + + + + + Inode threads + + + + + + More cpu, but better organisation on the disk + + + + + Order the list + + + + + Misc + + + + + Check the disk space + + + + + Use this folder when destination is not set + + + + + Browse + + + + + Filters + + + + + fileErrorDialog + + + Error with file + + + + + Error + + + + + Size + + + + + Modified + + + + + File name + + + + + Destination + + + + + Folder + + + + + &Always perform this action + + + + + Try in with elevated privileges + + + + + Put to bottom + + + + + Retry + + + + + &Skip + + + + + &Cancel + + + + + fileExistsDialog + + + The file exists + + + + + Source + + + + + Destination + + + + + + Size + + + + + + Modified + + + + + + File name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + + Overwrite if modification date differs + + + + + &Rename + + + + + &Overwrite + + + + + &Skip + + + + + &Cancel + + + + + Overwrite if newer + + + + + + Overwrite if older + + + + + fileIsSameDialog + + + Size + + + + + Modified + + + + + File name + + + + + The source and destination are same + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + &Skip + + + + + &Cancel + + + + + folderExistsDialog + + + Source + + + + + Destination + + + + + The source and destination is identical + + + + + + Modified + + + + + + Folder name + + + + + + Folder + + + + + Suggest new &name + + + + + &Always perform this action + + + + + &Rename + + + + + Merge + + + + + Skip + + + + + &Cancel + + + + diff --git a/plugins/CopyEngine/Ultracopier/ListThread.cpp b/plugins/CopyEngine/Ultracopier/ListThread.cpp new file mode 100644 index 0000000..48e06db --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ListThread.cpp @@ -0,0 +1,2379 @@ +#include "ListThread.h" +#include +#include + +ListThread::ListThread(FacilityInterface * facilityInterface) +{ + moveToThread(this); + start(HighPriority); + this->facilityInterface = facilityInterface; + putInPause = false; + sourceDriveMultiple = false; + destinationDriveMultiple = false; + destinationFolderMultiple = false; + stopIt = false; + bytesToTransfer = 0; + bytesTransfered = 0; + idIncrementNumber = 1; + actualRealByteTransfered = 0; + numberOfTransferIntoToDoList = 0; + numberOfInodeOperation = 0; + putAtBottom = 0; + maxSpeed = 0; + inodeThreads = 1; + renameTheOriginalDestination = false; + doRightTransfer = false; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + rsync = false; + #endif + keepDate = false; + checkDiskSpace = true; + blockSize = ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*1024; + sequentialBuffer = ULTRACOPIER_PLUGIN_DEFAULT_SEQUENTIAL_NUMBER_OF_BLOCK; + parallelBuffer = ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + blockSizeAfterSpeedLimitation = blockSize; + #endif + osBufferLimit = 512; + alwaysDoThisActionForFileExists = FileExists_NotSet; + doChecksum = false; + checksumIgnoreIfImpossible = true; + checksumOnlyOnError = true; + osBuffer = false; + osBufferLimited = false; + forcedMode = false; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + clockForTheCopySpeed = NULL; + multiForBigSpeed = 0; + #endif + + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + connect(&timerUpdateDebugDialog,&QTimer::timeout,this,&ListThread::timedUpdateDebugDialog); + timerUpdateDebugDialog.start(ULTRACOPIER_PLUGIN_DEBUG_WINDOW_TIMER); + #endif + connect(this, &ListThread::tryCancel, this,&ListThread::cancel, Qt::QueuedConnection); + connect(this, &ListThread::askNewTransferThread, this,&ListThread::createTransferThread, Qt::QueuedConnection); + connect(&mkPathQueue, &MkPath::firstFolderFinish, this,&ListThread::mkPathFirstFolderFinish, Qt::QueuedConnection); + connect(&mkPathQueue, &MkPath::errorOnFolder, this,&ListThread::mkPathErrorOnFolder, Qt::QueuedConnection); + connect(this, &ListThread::send_syncTransferList, this,&ListThread::syncTransferList_internal, Qt::QueuedConnection); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&mkPathQueue, &MkPath::debugInformation, this,&ListThread::debugInformation, Qt::QueuedConnection); + connect(&driveManagement,&DriveManagement::debugInformation, this,&ListThread::debugInformation, Qt::QueuedConnection); + #endif // ULTRACOPIER_PLUGIN_DEBUG + + emit askNewTransferThread(); + mkpathTransfer.release(); +} + +ListThread::~ListThread() +{ + emit tryCancel(); + waitCancel.acquire(); + quit(); + wait(); +} + +//transfer is finished +void ListThread::transferInodeIsClosed() +{ + numberOfInodeOperation--; + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("numberOfInodeOperation: %1").arg(numberOfInodeOperation)); + #endif + TransferThread *temp_transfer_thread=qobject_cast(QObject::sender()); + if(temp_transfer_thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("transfer thread not located!")); + return; + } + bool isFound=false; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + int countLocalParse=0; + #endif + if(temp_transfer_thread->getStat()!=TransferStat_Idle) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("transfer thread not idle!")); + return; + } + int int_for_internal_loop=0; + const int &loop_size=actionToDoListTransfer.size(); + while(int_for_internal_looptransferId) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[%1] have finish, put at idle; for id: %2").arg(int_for_internal_loop).arg(temp_transfer_thread->transferId)); + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type=Ultracopier::RemoveItem; + newAction.userAction.moveAt=0; + newAction.addAction=actionToDoTransferToItemOfCopyList(actionToDoListTransfer.at(int_for_internal_loop)); + newAction.userAction.position=int_for_internal_loop; + actionDone << newAction; + /// \todo check if item is at the right thread + actionToDoListTransfer.removeAt(int_for_internal_loop); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("actionToDoListTransfer.size(): %1, actionToDoListInode: %2, actionToDoListInode_afterTheTransfer: %3").arg(actionToDoListTransfer.size()).arg(actionToDoListInode.size()).arg(actionToDoListInode_afterTheTransfer.size())); + if(actionToDoListTransfer.isEmpty() && actionToDoListInode.isEmpty() && actionToDoListInode_afterTheTransfer.isEmpty()) + updateTheStatus(); + + //add the current size of file, to general size because it's finish + copiedSize=temp_transfer_thread->copiedSize(); + if(copiedSize>(qint64)temp_transfer_thread->transferSize) + { + oversize=copiedSize-temp_transfer_thread->transferSize; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("add oversize of: %1").arg(oversize)); + bytesToTransfer+=oversize; + bytesTransfered+=oversize; + } + bytesTransfered+=temp_transfer_thread->transferSize; + + if(temp_transfer_thread->haveStartTime) + { + timeToTransfer << QPair(temp_transfer_thread->transferSize,temp_transfer_thread->startTransferTime.elapsed()); + temp_transfer_thread->haveStartTime=false; + } + temp_transfer_thread->transferId=0; + temp_transfer_thread->transferSize=0; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + countLocalParse++; + #endif + isFound=true; + if(actionToDoListTransfer.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"actionToDoListTransfer==0"); + actionToDoListInode << actionToDoListInode_afterTheTransfer; + actionToDoListInode_afterTheTransfer.clear(); + doNewActions_inode_manipulation(); + } + break; + } + int_for_internal_loop++; + } + if(isFound) + deleteTransferThread(); + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("unable to found item into the todo list, id: %1, index: %2").arg(temp_transfer_thread->transferId).arg(int_for_internal_loop)); + temp_transfer_thread->transferId=0; + temp_transfer_thread->transferSize=0; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("countLocalParse: %1, actionToDoList.size(): %2").arg(countLocalParse).arg(actionToDoListTransfer.size())); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(countLocalParse!=1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("countLocalParse != 1")); + #endif + doNewActions_inode_manipulation(); +} + +/** \brief put the current file at bottom in case of error +\note ONLY IN CASE OF ERROR */ +void ListThread::transferPutAtBottom() +{ + TransferThread *transfer=qobject_cast(QObject::sender()); + if(transfer==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("transfer thread not located!")); + return; + } + bool isFound=false; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + int countLocalParse=0; + #endif + int indexAction=0; + while(indexActiontransferId) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Put at the end: %1").arg(transfer->transferId)); + //push for interface at the end + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type=Ultracopier::MoveItem; + newAction.addAction.id=transfer->transferId; + newAction.userAction.position=actionToDoListTransfer.size()-1; + actionDone << newAction; + //do the wait stat + actionToDoListTransfer[indexAction].isRunning=false; + //move at the end + actionToDoListTransfer.move(indexAction,actionToDoListTransfer.size()-1); + //reset the thread list stat + transfer->transferId=0; + transfer->transferSize=0; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + countLocalParse++; + #endif + isFound=true; + break; + } + indexAction++; + } + if(!isFound) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("unable to found item into the todo list, id: %1, index: %2").arg(transfer->transferId)); + transfer->transferId=0; + transfer->transferSize=0; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("countLocalParse: %1").arg(countLocalParse)); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(countLocalParse!=1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("countLocalParse != 1")); + #endif + transfer->skip(); +} + +//set the copy info and options before runing +void ListThread::setRightTransfer(const bool doRightTransfer) +{ + mkPathQueue.setRightTransfer(doRightTransfer); + this->doRightTransfer=doRightTransfer; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetRightTransfer(doRightTransfer); + index++; + } +} + +//set keep date +void ListThread::setKeepDate(const bool keepDate) +{ + mkPathQueue.setKeepDate(keepDate); + this->keepDate=keepDate; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetKeepDate(keepDate); + index++; + } +} + +//set block size in KB +void ListThread::setBlockSize(const int blockSize) +{ + this->blockSize=blockSize*1024; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetBlockSize(this->blockSize); + index++; + } + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + setSpeedLimitation(maxSpeed); + #endif +} + +//set auto start +void ListThread::setAutoStart(const bool autoStart) +{ + this->autoStart=autoStart; +} + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +/// \brief set rsync +void ListThread::setRsync(const bool rsync) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"set rsync: "+QString::number(rsync)); + this->rsync=rsync; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetRsync(rsync); + index++; + } + for(int i=0;isetRsync(rsync); +} +#endif + +//set check destination folder +void ListThread::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) +{ + this->checkDestinationFolderExists=checkDestinationFolderExists; + for(int i=0;isetCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); +} + +void ListThread::fileTransfer(const QFileInfo &sourceFileInfo,const QFileInfo &destinationFileInfo,const Ultracopier::CopyMode &mode) +{ + if(stopIt) + return; + addToTransfer(sourceFileInfo,destinationFileInfo,mode); +} + +// -> add thread safe, by Qt::BlockingQueuedConnection +bool ListThread::haveSameSource(const QStringList &sources) +{ + if(stopIt) + return false; + if(sourceDriveMultiple) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sourceDriveMultiple"); + return false; + } + if(sourceDrive.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sourceDrive.isEmpty()"); + return true; + } + int index=0; + while(index add thread safe, by Qt::BlockingQueuedConnection +bool ListThread::haveSameDestination(const QString &destination) +{ + if(stopIt) + return false; + if(destinationDriveMultiple) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"destinationDriveMultiple"); + return false; + } + if(destinationDrive.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"destinationDrive.isEmpty()"); + return true; + } + if(driveManagement.getDrive(destination)!=destinationDrive) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"destination!=destinationDrive"); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"seam have same destination"); + return true; +} + +/// \return empty if multiple or no destination +QString ListThread::getUniqueDestinationFolder() const +{ + if(stopIt) + return QString(); + if(destinationFolderMultiple) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"destinationDriveMultiple"); + return QString(); + } + return destinationFolder; +} + +ScanFileOrFolder * ListThread::newScanThread(Ultracopier::CopyMode mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start with: ")+QString::number(mode)); + + //create new thread because is auto-detroyed + scanFileOrFolderThreadsPool << new ScanFileOrFolder(mode); + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::finishedTheListing, this,&ListThread::scanThreadHaveFinishSlot, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::fileTransfer, this,&ListThread::fileTransfer, Qt::QueuedConnection); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::debugInformation, this,&ListThread::debugInformation, Qt::QueuedConnection); + #endif + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::newFolderListing, this,&ListThread::newFolderListing); + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::addToMovePath, this,&ListThread::addToMovePath, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::addToRealMove, this,&ListThread::addToRealMove, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::addToMkPath, this,&ListThread::addToMkPath, Qt::QueuedConnection); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::addToRmForRsync, this,&ListThread::addToRmForRsync, Qt::QueuedConnection); + #endif + + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::errorOnFolder, this,&ListThread::errorOnFolder, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::folderAlreadyExists, this,&ListThread::folderAlreadyExists, Qt::QueuedConnection); + + connect(this,&ListThread::send_updateMount, scanFileOrFolderThreadsPool.last(),&ScanFileOrFolder::set_updateMount, Qt::QueuedConnection); + + scanFileOrFolderThreadsPool.last()->setFilters(include,exclude); + scanFileOrFolderThreadsPool.last()->setCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); + scanFileOrFolderThreadsPool.last()->setMoveTheWholeFolder(moveTheWholeFolder); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + scanFileOrFolderThreadsPool.last()->setRsync(rsync); + #endif + if(scanFileOrFolderThreadsPool.size()==1) + updateTheStatus(); + scanFileOrFolderThreadsPool.last()->setRenamingRules(firstRenamingRule,otherRenamingRule); + return scanFileOrFolderThreadsPool.last(); +} + +void ListThread::scanThreadHaveFinishSlot() +{ + scanThreadHaveFinish(); +} + +void ListThread::scanThreadHaveFinish(bool skipFirstRemove) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("listing thread have finish, skipFirstRemove: ")+QString::number(skipFirstRemove)); + if(!skipFirstRemove) + { + ScanFileOrFolder * senderThread = qobject_cast(QObject::sender()); + if(senderThread==NULL) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"sender pointer null (plugin copy engine)"); + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start the next thread, scanFileOrFolderThreadsPool.size(): ")+QString::number(scanFileOrFolderThreadsPool.size())); + delete senderThread; + scanFileOrFolderThreadsPool.removeOne(senderThread); + if(scanFileOrFolderThreadsPool.isEmpty()) + updateTheStatus(); + } + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start the next thread, scanFileOrFolderThreadsPool.size(): ")+QString::number(scanFileOrFolderThreadsPool.size())); + if(scanFileOrFolderThreadsPool.size()>0) + { + //then start the next listing threads + if(scanFileOrFolderThreadsPool.first()->isFinished()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Start listing thread"); + scanFileOrFolderThreadsPool.first()->start(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"The listing thread is already running"); + } + else + autoStartAndCheckSpace(); +} + +void ListThread::autoStartAndCheckSpace() +{ + if(needMoreSpace()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Need more space"); + return; + } + autoStartIfNeeded(); +} + +void ListThread::autoStartIfNeeded() +{ + if(autoStart) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Auto start the copy"); + startGeneralTransfer(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Put the copy engine in pause"); + putInPause=true; + emit isInPause(true); + } +} + +void ListThread::startGeneralTransfer() +{ + doNewActions_inode_manipulation(); +} + +// -> add thread safe, by Qt::BlockingQueuedConnection +bool ListThread::newCopy(const QStringList &sources,const QString &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+sources.join(";")+QStringLiteral(", destination: ")+destination); + ScanFileOrFolder * scanFileOrFolderThread = newScanThread(Ultracopier::Copy); + if(scanFileOrFolderThread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to get new thread"); + return false; + } + scanFileOrFolderThread->addToList(sources,destination); + scanThreadHaveFinish(true); + detectDrivesOfCurrentTransfer(sources,destination); + return true; +} + +// -> add thread safe, by Qt::BlockingQueuedConnection +bool ListThread::newMove(const QStringList &sources,const QString &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + ScanFileOrFolder * scanFileOrFolderThread = newScanThread(Ultracopier::Move); + if(scanFileOrFolderThread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to get new thread"); + return false; + } + scanFileOrFolderThread->addToList(sources,destination); + scanThreadHaveFinish(true); + detectDrivesOfCurrentTransfer(sources,destination); + return true; +} + +void ListThread::detectDrivesOfCurrentTransfer(const QStringList &sources,const QString &destination) +{ + /* code to detect volume/mount point to group by windows */ + if(!sourceDriveMultiple) + { + int index=0; + while(indexalwaysDoThisActionForFileExists=alwaysDoThisActionForFileExists; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + index++; + } +} + +/** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ +void ListThread::syncTransferList() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit send_syncTransferList(); +} + +//set the folder local collision +void ListThread::setFolderCollision(const FolderExistsAction &alwaysDoThisActionForFolderExists) +{ + this->alwaysDoThisActionForFolderExists=alwaysDoThisActionForFolderExists; +} + +bool ListThread::getReturnBoolToCopyEngine() const +{ + return returnBoolToCopyEngine; +} + +QPair ListThread::getReturnPairQuint64ToCopyEngine() const +{ + return returnPairQuint64ToCopyEngine; +} + +Ultracopier::ItemOfCopyList ListThread::getReturnItemOfCopyListToCopyEngine() const +{ + return returnItemOfCopyListToCopyEngine; +} + +void ListThread::set_doChecksum(bool doChecksum) +{ + this->doChecksum=doChecksum; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexset_doChecksum(doChecksum); + index++; + } +} + +void ListThread::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) +{ + this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexset_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); + index++; + } +} + +void ListThread::set_checksumOnlyOnError(bool checksumOnlyOnError) +{ + this->checksumOnlyOnError=checksumOnlyOnError; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexset_checksumOnlyOnError(checksumOnlyOnError); + index++; + } +} + +void ListThread::set_osBuffer(bool osBuffer) +{ + this->osBuffer=osBuffer; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexset_osBuffer(osBuffer); + index++; + } +} + +void ListThread::set_osBufferLimited(bool osBufferLimited) +{ + this->osBufferLimited=osBufferLimited; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexset_osBufferLimited(osBufferLimited); + index++; + } +} + +void ListThread::realByteTransfered() +{ + quint64 totalRealByteTransfered=0; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexrealByteTransfered(); + index++; + } + emit send_realBytesTransfered(totalRealByteTransfered); +} + +void ListThread::pause() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Seam already in pause!"); + return; + } + putInPause=true; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexpause(); + index++; + } + emit isInPause(true); +} + +void ListThread::resume() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(!putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Seam already resumed!"); + return; + } + putInPause=false; + startGeneralTransfer(); + doNewActions_start_transfer(); + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexresume(); + index++; + } + emit isInPause(false); +} + +void ListThread::skip(const quint64 &id) +{ + skipInternal(id); +} + +bool ListThread::skipInternal(const quint64 &id) +{ + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indextransferId==id) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip one transfer: %1").arg(id)); + transferThreadList.at(index)->skip(); + return true; + } + index++; + } + int int_for_internal_loop=0; + const int &loop_size=actionToDoListTransfer.size(); + while(int_for_internal_loopstop(); + index++; + } + index=0; + loop_size=scanFileOrFolderThreadsPool.size(); + while(indexstop(); + delete scanFileOrFolderThreadsPool.at(index);//->deleteLayer(); + scanFileOrFolderThreadsPool[index]=NULL; + index++; + } + scanFileOrFolderThreadsPool.clear(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + if(clockForTheCopySpeed!=NULL) + { + clockForTheCopySpeed->stop(); + delete clockForTheCopySpeed; + clockForTheCopySpeed=NULL; + } + #endif + checkIfReadyToCancel(); +} + +void ListThread::checkIfReadyToCancel() +{ + if(!stopIt) + return; + int index=0; + int loop_size=transferThreadList.size(); + while(indextransferId!=0) + return; + delete transferThreadList.at(index);//->deleteLayer(); + transferThreadList[index]=NULL; + transferThreadList.removeAt(index); + loop_size=transferThreadList.size(); + index--; + } + index++; + } + actionToDoListTransfer.clear(); + actionToDoListInode.clear(); + actionToDoListInode_afterTheTransfer.clear(); + actionDone.clear(); + progressionList.clear(); + returnListItemOfCopyListToCopyEngine.clear(); + quit(); + waitCancel.release(); + emit canBeDeleted(); +} + +//speedLimitation in KB/s +bool ListThread::setSpeedLimitation(const qint64 &speedLimitation) +{ + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("maxSpeed in KB/s: ")+QString::number(speedLimitation)); + + if(speedLimitation>1024*1024) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"speedLimitation out of range"); + return false; + } + maxSpeed=speedLimitation; + + multiForBigSpeed=0; + if(maxSpeed>0) + { + blockSizeAfterSpeedLimitation=blockSize; + + //try resolv the interval + int newInterval;//in ms + do + { + multiForBigSpeed++; + //at max speed, is out of range for int, it's why quint64 is used + newInterval=(((quint64)blockSize*(quint64)multiForBigSpeed*1000/* *1000 because interval is into ms, not s*/)/((quint64)maxSpeed*(quint64)1024)); + if(newInterval<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"calculated newInterval wrong"); + return false; + } + } + while(newIntervalULTRACOPIER_PLUGIN_MAXTIMERINTERVAL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"wait time too big, then shrink the block size and set interval to max size"); + newInterval=ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL; + multiForBigSpeed=1; + blockSizeAfterSpeedLimitation=(this->maxSpeed*1024*newInterval)/1000; + + if(blockSizeAfterSpeedLimitation<10) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"calculated block size wrong"); + return false; + } + + //set the new block size into the thread + const int &loop_size=transferThreadList.size(); + int int_for_loop=0; + while(int_for_loopsetBlockSize(blockSizeAfterSpeedLimitation)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to set the block size"); + int_for_loop++; + } + } + + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("fixed speed with new block size and new interval in BlockSize: %1, multiForBigSpeed: %2, newInterval: %3, maxSpeed: %4") + .arg(blockSizeAfterSpeedLimitation) + .arg(multiForBigSpeed) + .arg(newInterval) + .arg(maxSpeed) + ); + + clockForTheCopySpeed->setInterval(newInterval); + if(clockForTheCopySpeed!=NULL) + clockForTheCopySpeed->start(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"clockForTheCopySpeed == NULL at this point"); + } + else + { + if(clockForTheCopySpeed!=NULL) + clockForTheCopySpeed->stop(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"clockForTheCopySpeed == NULL at this point"); + int int_for_loop=0; + const int &loop_size=transferThreadList.size(); + while(int_for_loopsetBlockSize(blockSize); + int_for_loop++; + } + } + int int_for_loop=0; + const int &loop_size=transferThreadList.size(); + while(int_for_loopsetMultiForBigSpeed(multiForBigSpeed); + int_for_loop++; + } + + return true; + #else + Q_UNUSED(speedLimitation); + return false; + #endif +} + +void ListThread::updateTheStatus() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + sendActionDone(); + bool updateTheStatus_listing=scanFileOrFolderThreadsPool.size()>0; + bool updateTheStatus_copying=actionToDoListTransfer.size()>0 || actionToDoListInode.size()>0 || actionToDoListInode_afterTheTransfer.size()>0; + Ultracopier::EngineActionInProgress updateTheStatus_action_in_progress; + if(updateTheStatus_copying && updateTheStatus_listing) + updateTheStatus_action_in_progress=Ultracopier::CopyingAndListing; + else if(updateTheStatus_listing) + updateTheStatus_action_in_progress=Ultracopier::Listing; + else if(updateTheStatus_copying) + updateTheStatus_action_in_progress=Ultracopier::Copying; + else + updateTheStatus_action_in_progress=Ultracopier::Idle; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("emit actionInProgess(")+QString::number(updateTheStatus_action_in_progress)+QStringLiteral(")")); + emit actionInProgess(updateTheStatus_action_in_progress); +} + +//set data local to the thread +void ListThread::setAlwaysFileExistsAction(const FileExistsAction &alwaysDoThisActionForFileExists) +{ + this->alwaysDoThisActionForFileExists=alwaysDoThisActionForFileExists; + int int_for_loop=0; + const int &loop_size=transferThreadList.size(); + while(int_for_loopsetAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + int_for_loop++; + } +} + +//mk path to do +quint64 ListThread::addToMkPath(const QFileInfo& source,const QFileInfo& destination, const int& inode) +{ + if(stopIt) + return 0; + if(inode!=0 && (!keepDate && !doRightTransfer)) + return 0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + ActionToDoInode temp; + temp.type = ActionType_MkPath; + temp.id = generateIdNumber(); + temp.source = source; + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode << temp; + return temp.id; +} + +//add rm path to do +void ListThread::addToMovePath(const QFileInfo& source, const QFileInfo &destination, const int& inodeToRemove) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2, inodeToRemove: %3").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).arg(inodeToRemove)); + ActionToDoInode temp; + temp.type = ActionType_MovePath; + temp.id = generateIdNumber(); + temp.size = inodeToRemove; + temp.source = source; + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode << temp; +} + +void ListThread::addToRealMove(const QFileInfo& source,const QFileInfo& destination) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + ActionToDoInode temp; + temp.type = ActionType_RealMove; + temp.id = generateIdNumber(); + temp.size = 0; + temp.source = source; + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode << temp; +} + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +//rsync rm +void ListThread::addToRmForRsync(const QFileInfo& destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"inode: "+destination.absoluteFilePath()); + ActionToDoInode temp; + temp.type = ActionType_RmSync; + temp.id = generateIdNumber(); + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode << temp; +} +#endif + +//send action done +void ListThread::sendActionDone() +{ + if(!actionDone.isEmpty()) + { + emit newActionOnList(actionDone); + actionDone.clear(); + } + if(!timeToTransfer.isEmpty()) + { + emit doneTime(timeToTransfer); + timeToTransfer.clear(); + } +} + +//send progression +void ListThread::sendProgression() +{ + if(actionToDoListTransfer.isEmpty()) + return; + oversize=0; + currentProgression=0; + int int_for_loop=0; + const int &loop_size=transferThreadList.size(); + while(int_for_loopgetStat()) + { + case TransferStat_Transfer: + case TransferStat_PostTransfer: + case TransferStat_Checksum: + case TransferStat_PostOperation: + { + copiedSize=temp_transfer_thread->copiedSize(); + + //for the general progression + currentProgression+=copiedSize; + + //the oversize (when the file is bigger after/during the copy then what was during the listing) + if(copiedSize>(qint64)temp_transfer_thread->transferSize) + localOverSize=copiedSize-temp_transfer_thread->transferSize; + else + localOverSize=0; + + //the current size copied + totalSize=temp_transfer_thread->transferSize+localOverSize; + QPair progression=temp_transfer_thread->progression(); + tempItem.currentRead=progression.first; + tempItem.currentWrite=progression.second; + tempItem.id=temp_transfer_thread->transferId; + tempItem.total=totalSize; + progressionList << tempItem; + + //add the oversize to the general progression + oversize+=localOverSize; + } + break; + default: + break; + } + int_for_loop++; + } + emit pushFileProgression(progressionList); + progressionList.clear(); + emit pushGeneralProgression(bytesTransfered+currentProgression,bytesToTransfer+oversize); + realByteTransfered(); +} + +//send the progression, after full reset of the interface (then all is empty) +void ListThread::syncTransferList_internal() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit syncReady(); + actionDone.clear(); + //do list operation + TransferThread *transferThread; + const int &loop_size=actionToDoListTransfer.size(); + int loop_sub_size=transferThreadList.size(); + //this loop to have at max inodeThreads*inodeThreads, not inodeThreads*transferThreadList.size() + int int_for_internal_loop; + for(int int_for_loop=0; int_for_loopgetStat()!=TransferStat_PreOperation) + { + Ultracopier::ReturnActionOnCopyList newAction; + switch(transferThread->getStat()) + { + case TransferStat_Transfer: + newAction.type=Ultracopier::Transfer; + break; + /*case TransferStat_PostTransfer: + newAction.type=Ultracopier::PostOperation; + break;*/ + case TransferStat_PostOperation: + newAction.type=Ultracopier::PostOperation; + break; + default: + break; + } + newAction.addAction.id = item.id; + actionDone << newAction; + } + } + } + } +} + +//add file transfer to do +quint64 ListThread::addToTransfer(const QFileInfo& source,const QFileInfo& destination,const Ultracopier::CopyMode& mode) +{ + if(stopIt) + return 0; + //add to transfer list + numberOfTransferIntoToDoList++; + quint64 size=0; + if(!source.isSymLink()) + size=source.size(); + const QString &drive=driveManagement.getDrive(destination.absoluteFilePath()); + if(drive.isEmpty()) + abort(); + if(mode!=Ultracopier::Move || drive!=driveManagement.getDrive(source.absoluteFilePath())) + { + if(requiredSpace.contains(drive)) + { + requiredSpace[drive]+=size; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("space needed add: %1, space needed: %2, on: %3").arg(size).arg(requiredSpace.value(drive)).arg(drive)); + } + else + { + requiredSpace[drive]=size; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set space %1 needed, on: %2").arg(size).arg(drive)); + } + } + bytesToTransfer+= size; + ActionToDoTransfer temp; + temp.id = generateIdNumber(); + temp.size = size; + temp.source = source; + temp.destination= destination; + temp.mode = mode; + temp.isRunning = false; + actionToDoListTransfer << temp; + //push the new transfer to interface + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type = Ultracopier::AddingItem; + newAction.addAction=actionToDoTransferToItemOfCopyList(temp); + actionDone << newAction; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2, add entry: %3, size: %4, size2: %5, isSymLink: %6").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).arg(temp.id).arg(temp.size).arg(size).arg(source.isSymLink())); + return temp.id; +} + +Ultracopier::ItemOfCopyList ListThread::actionToDoTransferToItemOfCopyList(const ListThread::ActionToDoTransfer &actionToDoTransfer) +{ + Ultracopier::ItemOfCopyList itemOfCopyList; + itemOfCopyList.id = actionToDoTransfer.id; + itemOfCopyList.sourceFullPath = actionToDoTransfer.source.absoluteFilePath(); + itemOfCopyList.sourceFileName = actionToDoTransfer.source.fileName(); + itemOfCopyList.destinationFullPath = actionToDoTransfer.destination.absoluteFilePath(); + itemOfCopyList.destinationFileName = actionToDoTransfer.destination.fileName(); + itemOfCopyList.size = actionToDoTransfer.size; + itemOfCopyList.mode = actionToDoTransfer.mode; + return itemOfCopyList; +} + +//generate id number +quint64 ListThread::generateIdNumber() +{ + idIncrementNumber++; + if(idIncrementNumber>(((quint64)1024*1024)*1024*1024*2)) + idIncrementNumber=0; + return idIncrementNumber; +} + +//warning the first entry is accessible will copy +void ListThread::removeItems(const QList &ids) +{ + for(int i=0;i ids) +{ + if(actionToDoListTransfer.size()<=1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"list size is empty"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //do list operation + int indexToMove=0; + const int &loop_size=actionToDoListTransfer.size(); + for (int i=0; i ids) +{ + if(actionToDoListTransfer.size()<=1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"list size is empty"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //do list operation + int lastGoodPositionReal=0; + bool haveGoodPosition=false; + const int &loop_size=actionToDoListTransfer.size(); + for (int i=0; i ids) +{ + if(actionToDoListTransfer.size()<=1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"list size is empty"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //do list operation + int lastGoodPositionReal=0; + bool haveGoodPosition=false; + for (int i=actionToDoListTransfer.size()-1; i>=0; --i) { + if(ids.contains(actionToDoListTransfer.at(i).id)) + { + if(haveGoodPosition) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("move item ")+QString::number(i)+QStringLiteral(" to ")+QString::number(i+1)); + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type=Ultracopier::MoveItem; + newAction.addAction.id=actionToDoListTransfer.at(i).id; + newAction.userAction.moveAt=lastGoodPositionReal; + newAction.userAction.position=i; + actionDone << newAction; + actionToDoListTransfer.swap(i,lastGoodPositionReal); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Try move up false, item ")+QString::number(i)); + } + ids.removeOne(actionToDoListTransfer.at(i).id); + if(ids.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop with return"); + return; + } + } + else + { + lastGoodPositionReal=i; + haveGoodPosition=true; + } + } + sendActionDone(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +//put on bottom +void ListThread::moveItemsOnBottom(QList ids) +{ + if(actionToDoListTransfer.size()<=1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"list size is empty"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //do list operation + int lastGoodPositionReal=actionToDoListTransfer.size()-1; + for (int i=lastGoodPositionReal; i>=0; --i) { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Check action on item ")+QString::number(i)); + if(ids.contains(actionToDoListTransfer.at(i).id)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("move item ")+QString::number(i)+QStringLiteral(" to ")+QString::number(lastGoodPositionReal)); + ids.removeOne(actionToDoListTransfer.at(i).id); + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type=Ultracopier::MoveItem; + newAction.addAction.id=actionToDoListTransfer.at(i).id; + newAction.userAction.moveAt=lastGoodPositionReal; + newAction.userAction.position=i; + actionDone << newAction; + actionToDoListTransfer.move(i,lastGoodPositionReal); + lastGoodPositionReal--; + if(ids.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop with return"); + return; + } + } + } + sendActionDone(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +/** \brief give the forced mode, to export/import transfer list */ +void ListThread::forceMode(const Ultracopier::CopyMode &mode) +{ + #ifdef ULTRACOPIER_PLUGIN_RSYNC + if(mode==Ultracopier::Move) + setRsync(false); + #endif + if(mode==Ultracopier::Copy) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Force mode to copy")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Force mode to move")); + this->mode=mode; + forcedMode=true; +} + +void ListThread::exportTransferList(const QString &fileName) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QFile transferFile(fileName); + if(transferFile.open(QIODevice::WriteOnly|QIODevice::Truncate)) + { + transferFile.write(QStringLiteral("Ultracopier;Transfer-list;").toUtf8()); + if(!forcedMode) + transferFile.write(QStringLiteral("Transfer;").toUtf8()); + else + { + if(mode==Ultracopier::Copy) + transferFile.write(QStringLiteral("Copy;").toUtf8()); + else + transferFile.write(QStringLiteral("Move;").toUtf8()); + } + transferFile.write(QStringLiteral("Ultracopier\n").toUtf8()); + bool haveError=false; + int size=actionToDoListTransfer.size(); + for (int index=0;index0 || actionToDoListInode.size()>0 || actionToDoListInode_afterTheTransfer.size()>0; + Ultracopier::EngineActionInProgress updateTheStatus_action_in_progress; + if(updateTheStatus_copying) + updateTheStatus_action_in_progress=Ultracopier::CopyingAndListing; + else + updateTheStatus_action_in_progress=Ultracopier::Listing; + emit actionInProgess(updateTheStatus_action_in_progress); + + bool errorFound=false; + QRegularExpression correctLine; + if(transferListMixedMode) + correctLine=QRegularExpression(QStringLiteral("^(Copy|Move);[^;]+;[^;]+[\n\r]*$")); + else + correctLine=QRegularExpression(QStringLiteral("^[^;]+;[^;]+[\n\r]*$")); + QStringList args; + Ultracopier::CopyMode tempMode; + do + { + data=transferFile.readLine(65535*2); + if(data.size()>0) + { + content=QString::fromUtf8(data); + //do the import here + if(content.contains(correctLine)) + { + content.remove(QStringLiteral("\n")); + args=content.split(QStringLiteral(";")); + if(forcedMode) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("New data to import in forced mode: %2,%3").arg(args.at(0)).arg(args.at(1))); + addToTransfer(QFileInfo(args.at(0)),QFileInfo(args.at(1)),mode); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("New data to import: %1,%2,%3").arg(args.at(0)).arg(args.at(1)).arg(args.at(2))); + if(args.at(0)==QStringLiteral("Copy")) + tempMode=Ultracopier::Copy; + else + tempMode=Ultracopier::Move; + addToTransfer(QFileInfo(args.at(1)),QFileInfo(args.at(2)),tempMode); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Wrong line syntax: %1").arg(content)); + errorFound=true; + } + } + } + while(data.size()>0); + transferFile.close(); + if(errorFound) + emit warningTransferList(tr("Some errors have been found during the line parsing")); + + updateTheStatus();//->sendActionDone(); into this + autoStartAndCheckSpace(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to open the transfer list: %1").arg(transferFile.errorString())); + emit errorTransferList(tr("Unable to open the transfer list: %1").arg(transferFile.errorString())); + return; + } +} + +int ListThread::getNumberOfTranferRuning() const +{ + int numberOfTranferRuning=0; + const int &loop_size=transferThreadList.size(); + //lunch the transfer in WaitForTheTransfer + int int_for_loop=0; + while(int_for_loopgetStat()==TransferStat_Transfer && transferThreadList.at(int_for_loop)->transferId!=0 && transferThreadList.at(int_for_loop)->transferSize>=parallelizeIfSmallerThan) + numberOfTranferRuning++; + int_for_loop++; + } + return numberOfTranferRuning; +} + +//return +bool ListThread::needMoreSpace() const +{ + if(!checkDiskSpace) + return false; + QList diskspace_list; + QHashIterator i(requiredSpace); + while (i.hasNext()) { + i.next(); + #ifdef Q_OS_WIN32 + if(i.key()!="A:\\" && i.key()!="A:/" && i.key()!="A:" && i.key()!="A" && i.key()!="a:\\" && i.key()!="a:/" && i.key()!="a:" && i.key()!="a") + { + #endif + QStorageInfo storageInfo(i.key()); + storageInfo.refresh(); + const qint64 &availableSpace=storageInfo.bytesAvailable(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + const qint64 &bytesFree=storageInfo.bytesFree(); + #endif + + if(availableSpace<0 || + //workaround for all 0 value in case of bug from Qt + (availableSpace==0 && storageInfo.bytesTotal()==0) + ) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("availableSpace: %1, space needed: %2, on: %3, bytesFree: %4").arg(availableSpace).arg(i.value()).arg(i.key()).arg(bytesFree)); + } + else if(i.value()>(quint64)availableSpace) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("availableSpace: %1, space needed: %2, on: %3, bytesFree: %4").arg(availableSpace).arg(i.value()).arg(i.key()).arg(bytesFree)); + #ifdef Q_OS_WIN32 + //if(i.key().contains(QRegularExpression("^[a-zA-Z]:[\\\\/]"))) + if(i.key().contains(QRegularExpression("^[a-zA-Z]:"))) + #endif + { + Diskspace diskspace; + diskspace.drive=i.key(); + diskspace.freeSpace=availableSpace; + diskspace.requiredSpace=i.value(); + diskspace_list << diskspace; + } + #ifdef Q_OS_WIN32 + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("not local drive")); + #endif + } + #ifdef Q_OS_WIN32 + } + #endif + } + if(!diskspace_list.isEmpty()) + emit missingDiskSpace(diskspace_list); + return ! diskspace_list.isEmpty(); +} + +//do new actions +void ListThread::doNewActions_start_transfer() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("actionToDoListTransfer.size(): %1, numberOfTranferRuning: %2").arg(actionToDoListTransfer.size()).arg(getNumberOfTranferRuning())); + if(stopIt || putInPause) + return; + int numberOfTranferRuning=getNumberOfTranferRuning(); + const int &loop_size=transferThreadList.size(); + //lunch the transfer in WaitForTheTransfer + int int_for_loop=0; + while(int_for_loopgetStat()==TransferStat_WaitForTheTransfer) + { + if(transferThreadList.at(int_for_loop)->transferSize>=parallelizeIfSmallerThan) + { + if(numberOfTranferRuningstartTheTransfer(); + numberOfTranferRuning++; + } + } + else + transferThreadList.at(int_for_loop)->startTheTransfer(); + } + int_for_loop++; + } + int_for_loop=0; + while(int_for_loopgetStat()==TransferStat_PreOperation) + { + if(transferThreadList.at(int_for_loop)->transferSize>=parallelizeIfSmallerThan) + { + if(numberOfTranferRuningstartTheTransfer(); + numberOfTranferRuning++; + } + } + else + transferThreadList.at(int_for_loop)->startTheTransfer(); + } + int_for_loop++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("numberOfTranferRuning: ")+QString::number(numberOfTranferRuning)); +} + +/** \brief lunch the pre-op or inode op + 1) locate the next next item to do into the both list + 1a) optimisation posible on the mkpath/rmpath + 2) determine what need be lunched + 3) lunch it, rerun the 2) + */ +void ListThread::doNewActions_inode_manipulation() +{ + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("actionToDoList.size(): %1").arg(actionToDoListTransfer.size())); + #endif + if(stopIt) + checkIfReadyToCancel(); + if(stopIt || putInPause) + return; + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + #endif + //lunch the pre-op or inode op + TransferThread *currentTransferThread; + int int_for_loop=0; + int int_for_internal_loop=0; + int int_for_transfer_thread_search=0; + actionToDoListTransfer_count=actionToDoListTransfer.size(); + actionToDoListInode_count=actionToDoListInode.size(); + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + //search the next transfer action to do + while(int_for_looptransferId==0) /!\ important! + Because the other thread can have call doNewAction before than this thread have the finish event parsed! + I this case it lose all data + */ + currentTransferThread=transferThreadList.at(int_for_transfer_thread_search); + if(currentTransferThread->getStat()==TransferStat_Idle && currentTransferThread->transferId==0) // /!\ important! + { + QString drive=driveManagement.getDrive(actionToDoListTransfer.at(int_for_internal_loop).destination.absoluteFilePath()); + if(requiredSpace.contains(drive) && (actionToDoListTransfer.at(int_for_internal_loop).mode!=Ultracopier::Move || drive!=driveManagement.getDrive(actionToDoListTransfer.at(int_for_internal_loop).source.absoluteFilePath()))) + { + requiredSpace[drive]-=actionToDoListTransfer.at(int_for_internal_loop).size; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("space needed removed: %1, space needed: %2, on: %3").arg(actionToDoListTransfer.at(int_for_internal_loop).size).arg(requiredSpace.value(drive)).arg(drive)); + } + currentTransferThread->transferId=currentActionToDoTransfer.id; + currentTransferThread->transferSize=currentActionToDoTransfer.size; + if(!currentTransferThread->setFiles( + currentActionToDoTransfer.source, + currentActionToDoTransfer.size, + currentActionToDoTransfer.destination, + currentActionToDoTransfer.mode + )) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[%1] id: %2 is idle, but seam busy at set name: %3").arg(int_for_loop).arg(currentTransferThread->transferId).arg(currentActionToDoTransfer.destination.absoluteFilePath())); + break; + } + currentActionToDoTransfer.isRunning=true; + + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[%1] id: %2 is idle, use it for %3").arg(int_for_loop).arg(currentTransferThread->transferId).arg(currentActionToDoTransfer.destination.absoluteFilePath())); + + /// \note wrong position? Else write why it's here + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type = Ultracopier::PreOperation; + newAction.addAction.id = currentActionToDoTransfer.id; + newAction.addAction.sourceFullPath = currentActionToDoTransfer.source.absoluteFilePath(); + newAction.addAction.sourceFileName = currentActionToDoTransfer.source.fileName(); + newAction.addAction.destinationFullPath = currentActionToDoTransfer.destination.absoluteFilePath(); + newAction.addAction.destinationFileName = currentActionToDoTransfer.destination.fileName(); + newAction.addAction.size = currentActionToDoTransfer.size; + newAction.addAction.mode = currentActionToDoTransfer.mode; + actionDone << newAction; + int_for_transfer_thread_search++; + numberOfInodeOperation++; + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("numberOfInodeOperation: %1").arg(numberOfInodeOperation)); + #endif + break; + } + int_for_transfer_thread_search++; + } + if(int_for_internal_loop==loop_sub_size_transfer_thread_search) + { + /// \note Can be normal when all thread is not initialized + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"unable to found free thread to do the transfer"); + #endif + break; + } + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("numberOfInodeOperation: %1").arg(numberOfInodeOperation)); + #endif + if(numberOfInodeOperation>=inodeThreads) + break; + if(followTheStrictOrder) + break; + } + int_for_loop++; + } + //search the next inode action to do + int_for_internal_loop=0; + while(int_for_internal_loopinodeThreads) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("The index have been detected as out of max range: %1>%2").arg(actionToDoListInode_count).arg(inodeThreads)); + return; + } +} + +//restart transfer if it can +void ListThread::restartTransferIfItCan() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + TransferThread *transfer=qobject_cast(QObject::sender()); + if(transfer==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("transfer thread not located!")); + return; + } + int numberOfTranferRuning=getNumberOfTranferRuning(); + if(numberOfTranferRuninggetStat()==TransferStat_WaitForTheTransfer) + transfer->startTheTransfer(); + doNewActions_start_transfer(); +} + +/// \brief update the transfer stat +void ListThread::newTransferStat(const TransferStat &stat,const quint64 &id) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("TransferStat: %1").arg(stat)); + Ultracopier::ReturnActionOnCopyList newAction; + switch(stat) + { + case TransferStat_Idle: + return; + break; + case TransferStat_PreOperation: + return; + break; + case TransferStat_WaitForTheTransfer: + return; + break; + case TransferStat_Transfer: + newAction.type=Ultracopier::Transfer; + break; + case TransferStat_PostTransfer: + case TransferStat_PostOperation: + newAction.type=Ultracopier::PostOperation; + break; + case TransferStat_Checksum: + newAction.type=Ultracopier::CustomOperation; + break; + default: + return; + break; + } + newAction.addAction.id = id; + actionDone << newAction; +} + +void ListThread::set_osBufferLimit(const unsigned int &osBufferLimit) +{ + this->osBufferLimit=osBufferLimit; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexset_osBufferLimit(osBufferLimit); + index++; + } +} + +void ListThread::set_setFilters(const QList &include,const QList &exclude) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("include.size(): %1, exclude.size(): %2").arg(include.size()).arg(exclude.size())); + this->include=include; + this->exclude=exclude; + int index=0; + while(indexsetFilters(include,exclude); + index++; + } +} + +void ListThread::set_sendNewRenamingRules(const QString &firstRenamingRule,const QString &otherRenamingRule) +{ + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +void ListThread::set_updateMount() +{ + driveManagement.tryUpdate(); + emit send_updateMount(); +} + +void ListThread::mkPathFirstFolderFinish() +{ + int int_for_loop=0; + const int &loop_size=actionToDoListInode.size(); + while(int_for_loopgetStat()) + { + case TransferStat_Idle: + stat="Idle"; + break; + case TransferStat_PreOperation: + stat="PreOperation"; + break; + case TransferStat_WaitForTheTransfer: + stat="WaitForTheTransfer"; + break; + case TransferStat_Transfer: + stat="Transfer"; + break; + case TransferStat_PostOperation: + stat="PostOperation"; + break; + case TransferStat_PostTransfer: + stat="PostTransfer"; + break; + case TransferStat_Checksum: + stat="Checksum"; + break; + default: + stat=QStringLiteral("??? (%1)").arg(transferThreadList.at(index)->getStat()); + break; + } + newList << QStringLiteral("%1) (%3,%4) %2") + .arg(index) + .arg(stat) + .arg(transferThreadList.at(index)->readingLetter()) + .arg(transferThreadList.at(index)->writingLetter()); + index++; + } + QStringList newList2; + index=0; + const int &loop_size=actionToDoListTransfer.size(); + while(index((inodeThreads+ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER)*2+1)) + { + newList2 << QStringLiteral("..."); + break; + } + index++; + } + emit updateTheDebugInfo(newList,newList2,numberOfInodeOperation); +} + +#endif + +/// \note Can be call without queue because all call will be serialized +void ListThread::fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) +{ + emit send_fileAlreadyExists(source,destination,isSame,qobject_cast(sender())); +} + +/// \note Can be call without queue because all call will be serialized +void ListThread::errorOnFile(const QFileInfo &fileInfo, const QString &errorString, const ErrorType &errorType) +{ + TransferThread * transferThread=qobject_cast(sender()); + if(transferThread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Thread locating error"); + return; + } + ErrorLogEntry errorLogEntry; + errorLogEntry.source=transferThread->getSourceInode(); + errorLogEntry.destination=transferThread->getDestinationInode(); + errorLogEntry.mode=transferThread->getMode(); + errorLogEntry.error=errorString; + errorLog << errorLogEntry; + emit errorToRetry(transferThread->getSourcePath(),transferThread->getDestinationPath(),errorString); + emit send_errorOnFile(fileInfo,errorString,transferThread,errorType); +} + +/// \note Can be call without queue because all call will be serialized +void ListThread::folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) +{ + emit send_folderAlreadyExists(source,destination,isSame,qobject_cast(sender())); +} + +/// \note Can be call without queue because all call will be serialized +/// \todo all this part +void ListThread::errorOnFolder(const QFileInfo &fileInfo,const QString &errorString,const ErrorType &errorType) +{ + emit send_errorOnFolder(fileInfo,errorString,qobject_cast(sender()),errorType); +} + +//to run the thread +void ListThread::run() +{ + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + clockForTheCopySpeed=new QTimer(); + #endif + + exec(); +} + +void ListThread::getNeedPutAtBottom(const QFileInfo &fileInfo, const QString &errorString, TransferThread *thread, const ErrorType &errorType) +{ + if(actionToDoListTransfer.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"can't try put at bottom if empty"); + this->alwaysDoThisActionForFileExists=FileExists_NotSet; + putAtBottom=0; + emit haveNeedPutAtBottom(false,fileInfo,errorString,thread,errorType); + return; + } + bool needPutAtBottom=(putAtBottom<(quint32)actionToDoListTransfer.size()); + if(!needPutAtBottom) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Reset put at bottom"); + this->alwaysDoThisActionForFileExists=FileExists_NotSet; + putAtBottom=0; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Put at bottom for later try"); + thread->putAtBottom(); + putAtBottom++; + return; + } + emit haveNeedPutAtBottom(needPutAtBottom,fileInfo,errorString,thread,errorType); +} + +/// \to create transfer thread +void ListThread::createTransferThread() +{ + if(stopIt) + return; + if(transferThreadList.size()>=inodeThreads) + return; + transferThreadList << new TransferThread(); + TransferThread * last=transferThreadList.last(); + last->transferId=0; + last->transferSize=0; + last->setRightTransfer(doRightTransfer); + last->setKeepDate(keepDate); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + if(!last->setBlockSize(blockSizeAfterSpeedLimitation)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to set the block size: ")+QString::number(blockSizeAfterSpeedLimitation)); + #else + if(!last->setBlockSize(blockSize)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to set the block size: ")+QString::number(blockSize)); + #endif + if(!last->setSequentialBuffer(sequentialBuffer)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to set the sequentialBuffer: ")+QString::number(sequentialBuffer)); + if(!last->setBlockSize(parallelBuffer)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to set the parallelBuffer: ")+QString::number(parallelBuffer)); + last->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + last->setMultiForBigSpeed(multiForBigSpeed); + #endif + last->set_doChecksum(doChecksum); + last->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); + last->set_checksumOnlyOnError(checksumOnlyOnError); + last->set_osBuffer(osBuffer); + last->set_osBufferLimited(osBufferLimited); + last->set_osBufferLimit(osBufferLimit); + last->setDeletePartiallyTransferredFiles(deletePartiallyTransferredFiles); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + last->setRsync(rsync); + #endif + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(last,&TransferThread::debugInformation, this,&ListThread::debugInformation, Qt::QueuedConnection); + #endif // ULTRACOPIER_PLUGIN_DEBUG + connect(last,&TransferThread::errorOnFile, this,&ListThread::errorOnFile, Qt::QueuedConnection); + connect(last,&TransferThread::fileAlreadyExists, this,&ListThread::fileAlreadyExists, Qt::QueuedConnection); + connect(last,&TransferThread::tryPutAtBottom, this,&ListThread::transferPutAtBottom, Qt::QueuedConnection); + connect(last,&TransferThread::readStopped, this,&ListThread::doNewActions_start_transfer, Qt::QueuedConnection); + connect(last,&TransferThread::preOperationStopped, this,&ListThread::doNewActions_start_transfer, Qt::QueuedConnection); + connect(last,&TransferThread::postOperationStopped, this,&ListThread::transferInodeIsClosed, Qt::QueuedConnection); + connect(last,&TransferThread::checkIfItCanBeResumed, this,&ListThread::restartTransferIfItCan, Qt::QueuedConnection); + connect(last,&TransferThread::pushStat, this,&ListThread::newTransferStat, Qt::QueuedConnection); + + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + //speed limitation + connect(clockForTheCopySpeed, &QTimer::timeout, last, &TransferThread::timeOfTheBlockCopyFinished, Qt::QueuedConnection); + #endif + + connect(this,&ListThread::send_sendNewRenamingRules, last,&TransferThread::setRenamingRules, Qt::QueuedConnection); + + connect(this,&ListThread::send_setTransferAlgorithm, last,&TransferThread::setTransferAlgorithm, Qt::QueuedConnection); + connect(this,&ListThread::send_parallelBuffer, last,&TransferThread::setParallelBuffer, Qt::QueuedConnection); + connect(this,&ListThread::send_sequentialBuffer, last,&TransferThread::setSequentialBuffer, Qt::QueuedConnection); + connect(this,&ListThread::send_updateMount, last,&TransferThread::set_updateMount, Qt::QueuedConnection); + + last->start(); + last->setObjectName(QStringLiteral("transfer %1").arg(transferThreadList.size()-1)); + last->setMkpathTransfer(&mkpathTransfer); + last->setRenamingRules(firstRenamingRule,otherRenamingRule); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + last->setId(transferThreadList.size()-1); + #endif + if(transferThreadList.size()>=inodeThreads) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("create the last of the ")+QString::number(inodeThreads)+QStringLiteral(" transferThread")); + return; + } + if(stopIt) + return; + doNewActions_inode_manipulation(); + emit askNewTransferThread(); +} + +void ListThread::deleteTransferThread() +{ + int loop_size=transferThreadList.size(); + if(loop_size>inodeThreads) + { + int index=0; + while(indexinodeThreads) + { + if(transferThreadList.at(index)->getStat()==TransferStat_Idle && transferThreadList.at(index)->transferId==0) + { + transferThreadList.at(index)->stop(); + delete transferThreadList.at(index);//->deleteLayer(); + transferThreadList[index]=NULL; + transferThreadList.removeAt(index); + loop_size--; + } + else + index++; + } + if(loop_size==inodeThreads) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("inodeThreads is lowered to the right value: ")+QString::number(inodeThreads)); + } +} + +void ListThread::setTransferAlgorithm(const TransferAlgorithm &transferAlgorithm) +{ + if(transferAlgorithm==TransferAlgorithm_Sequential) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("transferAlgorithm==TransferAlgorithm_Sequential")); + else if(transferAlgorithm==TransferAlgorithm_Automatic) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("transferAlgorithm==TransferAlgorithm_Automatic")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("transferAlgorithm==TransferAlgorithm_Parallel")); + emit send_setTransferAlgorithm(transferAlgorithm); +} + +void ListThread::setParallelBuffer(int parallelBuffer) +{ + if(parallelBuffer<1 || parallelBuffer>ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("wrong number of block: ")+QString::number(parallelBuffer)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("in number of block: ")+QString::number(parallelBuffer)); + this->parallelBuffer=parallelBuffer; + emit send_parallelBuffer(parallelBuffer); +} + +void ListThread::setSequentialBuffer(int sequentialBuffer) +{ + if(sequentialBuffer<1 || sequentialBuffer>ULTRACOPIER_PLUGIN_MAX_SEQUENTIAL_NUMBER_OF_BLOCK) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("wrong number of block: ")+QString::number(sequentialBuffer)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("in number of block: ")+QString::number(sequentialBuffer)); + this->sequentialBuffer=sequentialBuffer; + emit send_sequentialBuffer(sequentialBuffer); +} + +void ListThread::setParallelizeIfSmallerThan(const unsigned int ¶llelizeIfSmallerThan) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("parallelizeIfSmallerThan in Bytes: ")+QString::number(parallelizeIfSmallerThan)); + this->parallelizeIfSmallerThan=parallelizeIfSmallerThan; +} + +void ListThread::setMoveTheWholeFolder(const bool &moveTheWholeFolder) +{ + for(int i=0;isetMoveTheWholeFolder(moveTheWholeFolder); + this->moveTheWholeFolder=moveTheWholeFolder; +} + +void ListThread::setFollowTheStrictOrder(const bool &followTheStrictOrder) +{ + this->followTheStrictOrder=followTheStrictOrder; +} + +void ListThread::setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles) +{ + this->deletePartiallyTransferredFiles=deletePartiallyTransferredFiles; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetDeletePartiallyTransferredFiles(deletePartiallyTransferredFiles); + index++; + } +} + +void ListThread::setInodeThreads(const int &inodeThreads) +{ + if(inodeThreads<1 || inodeThreads>32) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("inodeThreads is out of ranges: ")+QString::number(inodeThreads)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("inodeThreads: ")+QString::number(inodeThreads)); + this->inodeThreads=inodeThreads; + createTransferThread(); + deleteTransferThread(); +} + +void ListThread::setRenameTheOriginalDestination(const bool &renameTheOriginalDestination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("renameTheOriginalDestination: ")+QString::number(renameTheOriginalDestination)); + this->renameTheOriginalDestination=renameTheOriginalDestination; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetRenameTheOriginalDestination(renameTheOriginalDestination); + index++; + } +} + +void ListThread::setCheckDiskSpace(const bool &checkDiskSpace) +{ + this->checkDiskSpace=checkDiskSpace; +} + +void ListThread::setCopyListOrder(const bool &order) +{ + this->copyListOrder=order; + for(int i=0;isetCopyListOrder(this->copyListOrder); +} + +void ListThread::exportErrorIntoTransferList(const QString &fileName) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QFile transferFile(fileName); + if(transferFile.open(QIODevice::WriteOnly|QIODevice::Truncate)) + { + transferFile.write(QStringLiteral("Ultracopier;Transfer-list;").toUtf8()); + if(!forcedMode) + transferFile.write(QStringLiteral("Transfer;").toUtf8()); + else + { + if(mode==Ultracopier::Copy) + transferFile.write(QStringLiteral("Copy;").toUtf8()); + else + transferFile.write(QStringLiteral("Move;").toUtf8()); + } + transferFile.write(QStringLiteral("Ultracopier\n").toUtf8()); + bool haveError=false; + int size=errorLog.size(); + for (int index=0;index +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_CopyEngine.h" +#include "ScanFileOrFolder.h" +#include "TransferThread.h" +#include "MkPath.h" +#include "Environment.h" +#include "DriveManagement.h" + +/// \brief Define the list thread, and management to the action to do +class ListThread : public QThread +{ + Q_OBJECT +public: + explicit ListThread(FacilityInterface * facilityInterface); + ~ListThread(); + + //duplication copy detection + /** \brief compare the current sources of the copy, with the passed arguments + * \param sources the sources list to compares with the current sources list + * \return true if have same sources, else false (or empty) */ + bool haveSameSource(const QStringList &sources); + /** \brief compare the current destination of the copy, with the passed arguments + * \param destination the destination to compares with the current destination + * \return true if have same destination, else false (or empty) */ + bool haveSameDestination(const QString &destination); + /// \return empty if multiple or no destination + QString getUniqueDestinationFolder() const; + //external soft like file browser have send copy/move list to do + /** \brief send copy with destination + * \param sources the sources list to copy + * \param destination the destination to copy + * \return true if the copy have been accepted */ + bool newCopy(const QStringList &sources,const QString &destination); + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \param destination the destination to move + * \return true if the move have been accepted */ + bool newMove(const QStringList &sources,const QString &destination); + /** \brief to set drives detected + * specific to this copy engine */ + /// \brief to set the collision action + void setCollisionAction(const FileExistsAction &alwaysDoThisActionForFileExists); + /** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ + void syncTransferList(); + /// \brief to store one action to do + struct ActionToDoTransfer + { + quint64 id; + qint64 size;///< Used to set: used in case of transfer or remainingInode for drop folder + QFileInfo source;///< Used to set: source for transfer, folder to create, folder to drop + QFileInfo destination; + Ultracopier::CopyMode mode; + bool isRunning;///< store if the action si running + //TransferThread * transfer; // -> see transferThreadList + }; + QList actionToDoListTransfer; + /// \brief to store one action to do + struct ActionToDoInode + { + ActionType type;///< \see ActionType + quint64 id; + qint64 size;///< Used to set: used in case of transfer or remainingInode for drop folder + QFileInfo source;///< Keep to copy the right/date, to remove (for move) + QFileInfo destination;///< Used to set: folder to create, folder to drop + bool isRunning;///< store if the action si running + }; + QList actionToDoListInode; + QList actionToDoListInode_afterTheTransfer; + int numberOfInodeOperation; + struct ErrorLogEntry + { + QFileInfo source; + QFileInfo destination; + QString error; + Ultracopier::CopyMode mode; + }; + QList errorLog; + //dir operation thread queue + MkPath mkPathQueue; + //to get the return value from copyEngine + bool getReturnBoolToCopyEngine() const; + QPair getReturnPairQuint64ToCopyEngine() const; + Ultracopier::ItemOfCopyList getReturnItemOfCopyListToCopyEngine() const; + + void set_doChecksum(bool doChecksum); + void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); + void set_checksumOnlyOnError(bool checksumOnlyOnError); + void set_osBuffer(bool osBuffer); + void set_osBufferLimited(bool osBufferLimited); + void autoStartIfNeeded(); +public slots: + //action on the copy + /// \brief put the transfer in pause + void pause(); + /// \brief resume the transfer + void resume(); + /** \brief skip one transfer entry + * \param id id of the file to remove */ + void skip(const quint64 &id); + /** \brief skip as interanl one transfer entry + * \param id id of the file to remove */ + bool skipInternal(const quint64 &id); + /// \brief cancel all the transfer + void cancel(); + //edit the transfer list + /** \brief remove the selected item + * \param ids ids is the id list of the selected items */ + void removeItems(const QList &ids); + /** \brief move on top of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnTop(QList ids); + /** \brief move up the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsUp(QList ids); + /** \brief move down the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsDown(QList ids); + /** \brief move on bottom of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnBottom(QList ids); + + /** \brief give the forced mode, to export/import transfer list */ + void forceMode(const Ultracopier::CopyMode &mode); + /// \brief export the transfer list into a file + void exportTransferList(const QString &fileName); + /// \brief import the transfer list into a file + void importTransferList(const QString &fileName); + + /// \brief set the folder local collision + void setFolderCollision(const FolderExistsAction &alwaysDoThisActionForFolderExists); + /** \brief to set the speed limitation + * -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + /// \brief set the copy info and options before runing + void setRightTransfer(const bool doRightTransfer); + /// \brief set keep date + void setKeepDate(const bool keepDate); + /// \brief set block size in KB + void setBlockSize(const int blockSize); + /// \brief set auto start + void setAutoStart(const bool autoStart); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + /// \brief set rsync + void setRsync(const bool rsync); + #endif + /// \brief set check destination folder + void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); + /// \brief set data local to the thread + void setAlwaysFileExistsAction(const FileExistsAction &alwaysDoThisActionForFileExists); + /// \brief do new actions, start transfer + void doNewActions_start_transfer(); + /** \brief lunch the pre-op or inode op + 1) locate the next next item to do into the both list + 1a) optimisation posible on the mkpath/rmpath + 2) determine what need be lunched + 3) lunch it, rerun the 2) + */ + void doNewActions_inode_manipulation(); + /// \brief restart transfer if it can + void restartTransferIfItCan(); + void getNeedPutAtBottom(const QFileInfo &fileInfo, const QString &errorString, TransferThread *thread,const ErrorType &errorType); + + /// \brief update the transfer stat + void newTransferStat(const TransferStat &stat,const quint64 &id); + + void set_osBufferLimit(const unsigned int &osBufferLimit); + void set_setFilters(const QList &include,const QList &exclude); + void set_sendNewRenamingRules(const QString &firstRenamingRule,const QString &otherRenamingRule); + void set_updateMount(); + + //send action done + void sendActionDone(); + //send progression + void sendProgression(); + + void setTransferAlgorithm(const TransferAlgorithm &transferAlgorithm); + void setParallelBuffer(int parallelBuffer); + void setSequentialBuffer(int sequentialBuffer); + void setParallelizeIfSmallerThan(const unsigned int ¶llelizeIfSmallerThan); + void setMoveTheWholeFolder(const bool &moveTheWholeFolder); + void setFollowTheStrictOrder(const bool &followTheStrictOrder); + void setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles); + void setInodeThreads(const int &inodeThreads); + void setRenameTheOriginalDestination(const bool &renameTheOriginalDestination); + void setCheckDiskSpace(const bool &checkDiskSpace); + void setCopyListOrder(const bool &order); + void exportErrorIntoTransferList(const QString &fileName); +private: + QSemaphore mkpathTransfer; + QString sourceDrive; + bool sourceDriveMultiple; + QString destinationDrive; + QString destinationFolder; + bool destinationDriveMultiple; + bool destinationFolderMultiple; + DriveManagement driveManagement; + + bool stopIt; + QList scanFileOrFolderThreadsPool; + int numberOfTransferIntoToDoList; + QList transferThreadList; + ScanFileOrFolder * newScanThread(Ultracopier::CopyMode mode); + quint64 bytesToTransfer; + quint64 bytesTransfered; + bool autoStart; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + bool rsync; + #endif + bool putInPause; + QList actionDone;///< to action to send to the interface + quint64 idIncrementNumber;///< to store the last id returned + qint64 actualRealByteTransfered; + int maxSpeed;///< in KB/s, assume as 0KB/s as default like every where + FolderExistsAction alwaysDoThisActionForFolderExists; + bool checkDestinationFolderExists; + bool doChecksum; + bool checksumIgnoreIfImpossible; + bool checksumOnlyOnError; + bool osBuffer; + bool osBufferLimited; + unsigned int parallelizeIfSmallerThan; + bool moveTheWholeFolder; + bool followTheStrictOrder; + bool deletePartiallyTransferredFiles; + int sequentialBuffer; + int parallelBuffer; + int inodeThreads; + bool renameTheOriginalDestination; + bool checkDiskSpace; + bool copyListOrder; + QHash requiredSpace; + QList > timeToTransfer; + unsigned int putAtBottom; + unsigned int osBufferLimit; + QList include,exclude; + Ultracopier::CopyMode mode; + bool forcedMode; + QString firstRenamingRule; + QString otherRenamingRule; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + int multiForBigSpeed; + #endif + /* here to prevent: + QObject::killTimer: timers cannot be stopped from another thread + QObject::startTimer: timers cannot be started from another thread */ + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + QTimer *clockForTheCopySpeed; ///< For the speed throttling + #endif + + inline static Ultracopier::ItemOfCopyList actionToDoTransferToItemOfCopyList(const ActionToDoTransfer &actionToDoTransfer); + //add file transfer to do + quint64 addToTransfer(const QFileInfo& source,const QFileInfo& destination,const Ultracopier::CopyMode& mode); + //generate id number + quint64 generateIdNumber(); + //warning the first entry is accessible will copy + bool removeSingleItem(const quint64 &id); + //put on top + bool moveOnTopItem(const quint64 &id); + //move up + bool moveUpItem(const quint64 &id); + //move down + bool moveDownItem(const quint64 &id); + //put on bottom + bool moveOnBottomItem(const quint64 &id); + //general transfer + void startGeneralTransfer(); + //debug windows if needed + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + QTimer timerUpdateDebugDialog; + #endif + void detectDrivesOfCurrentTransfer(const QStringList &sources,const QString &destination); + FacilityInterface * facilityInterface; + QSemaphore waitConstructor,waitCancel; + int actionToDoListTransfer_count,actionToDoListInode_count; + bool doTransfer,doInode; + qint64 oversize;//used as temp variable + qint64 currentProgression; + qint64 copiedSize,totalSize,localOverSize; + QList progressionList; + //memory variable for transfer thread creation + bool doRightTransfer; + bool keepDate; + int blockSize;//in Bytes + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + int blockSizeAfterSpeedLimitation;//in Bytes + #endif + QStringList drives; + FileExistsAction alwaysDoThisActionForFileExists; + //to return value to the copyEngine + bool returnBoolToCopyEngine; + QPair returnPairQuint64ToCopyEngine; + QList returnListItemOfCopyListToCopyEngine; + Ultracopier::ItemOfCopyList returnItemOfCopyListToCopyEngine; + Ultracopier::ProgressionItem tempItem; + + void realByteTransfered(); + int getNumberOfTranferRuning() const; + bool needMoreSpace() const; +private slots: + void scanThreadHaveFinishSlot(); + void scanThreadHaveFinish(bool skipFirstRemove=false); + void autoStartAndCheckSpace(); + void updateTheStatus(); + void fileTransfer(const QFileInfo &sourceFileInfo,const QFileInfo &destinationFileInfo,const Ultracopier::CopyMode &mode); + //mkpath event + void mkPathFirstFolderFinish(); + /** \brief put the current file at bottom in case of error + \note ONLY IN CASE OF ERROR */ + void transferPutAtBottom(); + //transfer is finished + void transferInodeIsClosed(); + //debug windows if needed + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + void timedUpdateDebugDialog(); + #endif + //dialog message + /// \note Can be call without queue because all call will be serialized + void fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); + /// \note Can be call without queue because all call will be serialized + void errorOnFile(const QFileInfo &fileInfo,const QString &errorString, const ErrorType &errorType); + /// \note Can be call without queue because all call will be serialized + void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame); + /// \note Can be call without queue because all call will be serialized + void errorOnFolder(const QFileInfo &fileInfo, const QString &errorString, const ErrorType &errorType); + //to run the thread + void run(); + /// \to create transfer thread + void createTransferThread(); + void deleteTransferThread(); + //mk path to do + quint64 addToMkPath(const QFileInfo& source, const QFileInfo& destination, const int &inode); + //add rm path to do + void addToMovePath(const QFileInfo& source,const QFileInfo& destination, const int& inodeToRemove); + //add to real move + void addToRealMove(const QFileInfo& source,const QFileInfo& destination); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + //rsync rm + void addToRmForRsync(const QFileInfo& destination); + #endif + //send the progression, after full reset of the interface (then all is empty) + void syncTransferList_internal(); + + void checkIfReadyToCancel(); +signals: + //send information about the copy + void actionInProgess(const Ultracopier::EngineActionInProgress &) const; //should update interface information on this event + + void newActionOnList(const QList &) const;///very important, need be temporized to group the modification to do and not flood the interface + void syncReady() const; + void doneTime(const QList >&) const; + + /** \brief to get the progression for a specific file + * \param id the id of the transfer, id send during population the transfer list + * first = current transfered byte, second = byte to transfer */ + void pushFileProgression(const QList &progressionList) const; + //get information about the copy + /** \brief to get the general progression + * first = current transfered byte, second = byte to transfer */ + void pushGeneralProgression(const quint64 &,const quint64 &) const; + + void newFolderListing(const QString &path) const; + void isInPause(const bool &) const; + + //when can be deleted + void canBeDeleted() const; + void haveNeedPutAtBottom(bool needPutAtBottom,const QFileInfo &fileInfo,const QString &errorString,TransferThread * thread,const ErrorType &errorType) const; + + //send error occurred + void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error) const; + void errorToRetry(const QString &source,const QString &destination,const QString &error) const; + //for the extra logging + void rmPath(const QString &path) const; + void mkPath(const QString &path) const; + /// \brief To debug source + #ifdef ULTRACOPIER_PLUGIN_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; + #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + void updateTheDebugInfo(const QStringList &,const QStringList&,const int &) const; + #endif + + //other signal + /// \note Can be call without queue because all call will be serialized + void send_fileAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame,TransferThread * thread) const; + /// \note Can be call without queue because all call will be serialized + void send_errorOnFile(const QFileInfo &fileInfo,const QString &errorString,TransferThread * thread, const ErrorType &errorType) const; + /// \note Can be call without queue because all call will be serialized + void send_folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame,ScanFileOrFolder * thread) const; + /// \note Can be call without queue because all call will be serialized + void send_errorOnFolder(const QFileInfo &fileInfo,const QString &errorString,ScanFileOrFolder * thread, const ErrorType &errorType) const; + //send the progression + void send_syncTransferList() const; + //mkpath error event + void mkPathErrorOnFolder(const QFileInfo &fileInfo,const QString &errorString,const ErrorType &errorType) const; + //to close + void tryCancel() const; + //to ask new transfer thread + void askNewTransferThread() const; + + void warningTransferList(const QString &warning) const; + void errorTransferList(const QString &error) const; + void send_sendNewRenamingRules(const QString &firstRenamingRule,const QString &otherRenamingRule) const; + void send_realBytesTransfered(const quint64 &) const; + + void send_setTransferAlgorithm(TransferAlgorithm transferAlgorithm) const; + void send_parallelBuffer(const int ¶llelBuffer) const; + void send_sequentialBuffer(const int &sequentialBuffer) const; + void send_parallelizeIfSmallerThan(const int ¶llelizeIfSmallerThan) const; + void send_updateMount(); + void missingDiskSpace(QList list) const; +}; + +#endif // LISTTHREAD_H diff --git a/plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp b/plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp new file mode 100644 index 0000000..b47fbdf --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp @@ -0,0 +1,64 @@ +/** \file ListThread_InodeAction.cpp +\brief To be included into ListThread.cpp, to optimize and prevent code duplication +\see ListThread.cpp */ + +#ifdef LISTTHREAD_H + +//do the inode action +ActionToDoInode& currentActionToDoInode=actionToDoListInode[int_for_internal_loop]; +switch(currentActionToDoInode.type) +{ + case ActionType_RealMove: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("launch real move, source: %1, destination: %2").arg(currentActionToDoInode.source.absoluteFilePath()).arg(currentActionToDoInode.destination.absoluteFilePath())); + mkPathQueue.addPath(currentActionToDoInode.source.absoluteFilePath(),currentActionToDoInode.destination.absoluteFilePath(),currentActionToDoInode.type); + currentActionToDoInode.isRunning=true; + numberOfInodeOperation++; + if(numberOfInodeOperation>=inodeThreads) + return; + break; + case ActionType_MkPath: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("launch mkpath, source: %1, destination: %2").arg(currentActionToDoInode.source.absoluteFilePath()).arg(currentActionToDoInode.destination.absoluteFilePath())); + mkPathQueue.addPath(currentActionToDoInode.source.absoluteFilePath(),currentActionToDoInode.destination.absoluteFilePath(),currentActionToDoInode.type); + currentActionToDoInode.isRunning=true; + numberOfInodeOperation++; + if(numberOfInodeOperation>=inodeThreads) + return; + break; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + case ActionType_RmSync: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("launch rmsync, destination: %1").arg(currentActionToDoInode.destination.absoluteFilePath())); + mkPathQueue.addPath(currentActionToDoInode.destination.absoluteFilePath(),currentActionToDoInode.destination.absoluteFilePath(),currentActionToDoInode.type); + currentActionToDoInode.isRunning=true; + numberOfInodeOperation++; + if(numberOfInodeOperation>=inodeThreads) + return; + break; + #endif + case ActionType_MovePath: + //then empty (no file), can try remove it + if(currentActionToDoInode.size==0 || actionToDoListTransfer.isEmpty())//don't put afterTheTransfer because actionToDoListInode_afterTheTransfer -> already afterTheTransfer + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("launch rmpath: %1").arg(currentActionToDoInode.source.absoluteFilePath())); + mkPathQueue.addPath(currentActionToDoInode.source.absoluteFilePath(),currentActionToDoInode.destination.absoluteFilePath(),currentActionToDoInode.type); + currentActionToDoInode.isRunning=true; + numberOfInodeOperation++; + if(numberOfInodeOperation>=inodeThreads) + return; + } + else //have do the destination, put the remove to after + { + currentActionToDoInode.size=0; + actionToDoListInode_afterTheTransfer << currentActionToDoInode; + actionToDoListInode.removeAt(int_for_internal_loop); + int_for_internal_loop--; + actionToDoListInode_count--; + if(numberOfInodeOperation>=inodeThreads) + return; + } + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Wrong type at inode action")); + return; +} + +#endif diff --git a/plugins/CopyEngine/Ultracopier/MkPath.cpp b/plugins/CopyEngine/Ultracopier/MkPath.cpp new file mode 100644 index 0000000..15c423f --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/MkPath.cpp @@ -0,0 +1,516 @@ +#include "MkPath.h" + +#ifdef Q_OS_WIN32 + #ifndef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include + #endif +#endif + +QString MkPath::text_slash=QLatin1Literal("/"); + +MkPath::MkPath() +{ + stopIt=false; + waitAction=false; + doRightTransfer=false; + maxTime=QDateTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); + setObjectName("MkPath"); + moveToThread(this); + start(); + #ifdef Q_OS_WIN32 + #ifndef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + regRead=QRegularExpression(QStringLiteral("^[a-z]:")); + #endif + #endif +} + +MkPath::~MkPath() +{ + stopIt=true; + quit(); + wait(); +} + +void MkPath::addPath(const QFileInfo& source, const QFileInfo& destination, const ActionType &actionType) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + if(stopIt) + return; + emit internalStartAddPath(source,destination,actionType); +} + +void MkPath::skip() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit internalStartSkip(); +} + +void MkPath::retry() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit internalStartRetry(); +} + +void MkPath::run() +{ + connect(this,&MkPath::internalStartAddPath, this,&MkPath::internalAddPath,Qt::QueuedConnection); + connect(this,&MkPath::internalStartDoThisPath, this,&MkPath::internalDoThisPath,Qt::QueuedConnection); + connect(this,&MkPath::internalStartSkip, this,&MkPath::internalSkip,Qt::QueuedConnection); + connect(this,&MkPath::internalStartRetry, this,&MkPath::internalRetry,Qt::QueuedConnection); + exec(); +} + +void MkPath::internalDoThisPath() +{ + if(waitAction || pathList.isEmpty()) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2, move: %3").arg(pathList.first().source.absoluteFilePath()).arg(pathList.first().destination.absoluteFilePath()).arg(pathList.first().actionType)); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + if(pathList.first().actionType==ActionType_RmSync) + { + if(pathList.first().destination.isFile()) + { + QFile removedFile(pathList.first().destination.absoluteFilePath()); + if(!removedFile.remove()) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to remove the inode: "+pathList.first().destination.absoluteFilePath()+", error: "+removedFile.errorString()); + emit errorOnFolder(pathList.first().destination,removedFile.errorString()); + return; + } + } + else if(!rmpath(pathList.first().destination.absoluteFilePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to remove the inode: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("Unable to remove")); + return; + } + pathList.removeFirst(); + emit firstFolderFinish(); + checkIfCanDoTheNext(); + return; + } + #endif + doTheDateTransfer=false; + if(keepDate) + { + if(!pathList.first().source.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"the sources not exists: "+pathList.first().source.absoluteFilePath()); + doTheDateTransfer=false; + } + else if(maxTime>=pathList.first().source.lastModified()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"the sources is older to copy the time: "+pathList.first().source.absoluteFilePath()+": "+maxTime.toString("dd.MM.yyyy hh:mm:ss.zzz")+">="+pathList.first().source.lastModified().toString("dd.MM.yyyy hh:mm:ss.zzz")); + doTheDateTransfer=false; + } + else + { + doTheDateTransfer=readFileDateTime(pathList.first().source); + /*if(!doTheDateTransfer) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get source folder time: "+pathList.first().source.absoluteFilePath()); + emit errorOnFolder(pathList.first().source,tr("Unable to get time")); + return; + }*/ + } + } + if(dir.exists(pathList.first().destination.absoluteFilePath()) && pathList.first().actionType==ActionType_RealMove) + pathList.first().actionType=ActionType_MovePath; + if(pathList.first().actionType!=ActionType_RealMove) + { + if(!dir.exists(pathList.first().destination.absoluteFilePath())) + if(!dir.mkpath(pathList.first().destination.absoluteFilePath())) + { + if(!dir.exists(pathList.first().destination.absoluteFilePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to make the folder: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("Unable to create the folder")); + return; + } + } + } + else + { + if(!pathList.first().source.exists()) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The source folder don't exists: "+pathList.first().source.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("The source folder don't exists")); + return; + } + if(!pathList.first().source.isDir())//it's really an error? + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The source is not a folder: "+pathList.first().source.absoluteFilePath()); + /*if(stopIt) + return; + waitAction=true; + emit errorOnFolder(pathList.first().destination,tr("The source is not a folder")); + return;*/ + } + if(pathList.first().destination.absoluteFilePath().startsWith(pathList.first().source.absoluteFilePath()+text_slash)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"move into it self: "+pathList.first().destination.absoluteFilePath()); + int random=rand(); + QFileInfo tempFolder=pathList.first().source.absolutePath()+text_slash+QString::number(random); + while(tempFolder.exists()) + { + random=rand(); + tempFolder=pathList.first().source.absolutePath()+text_slash+QString::number(random); + } + if(!dir.rename(pathList.first().source.absoluteFilePath(),tempFolder.absoluteFilePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to temporary rename the folder: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("Unable to temporary rename the folder")); + return; + } + /* http://doc.qt.io/qt-5/qdir.html#rename + * On most file systems, rename() fails only if oldName does not exist, or if a file with the new name already exists. + if(!dir.mkpath(pathList.first().destination.absolutePath())) + { + if(!dir.exists(pathList.first().destination.absolutePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to make the folder: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("Unable to create the folder")); + return; + } + }*/ + if(!dir.rename(tempFolder.absoluteFilePath(),pathList.first().destination.absoluteFilePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to do the final real move the folder: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("Unable to do the final real move the folder")); + return; + } + } + else + { + /* http://doc.qt.io/qt-5/qdir.html#rename + * On most file systems, rename() fails only if oldName does not exist, or if a file with the new name already exists. + if(!dir.mkpath(pathList.first().destination.absolutePath())) + { + if(!dir.exists(pathList.first().destination.absolutePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to make the folder: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().destination,tr("Unable to create the folder")); + return; + } + }*/ + if(!dir.rename(pathList.first().source.absoluteFilePath(),pathList.first().destination.absoluteFilePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to make the folder: from: "+pathList.first().source.absoluteFilePath()+", soruce exists: "+QString::number(QDir(pathList.first().source.absoluteFilePath()).exists())+", to: "+pathList.first().destination.absoluteFilePath()+", destination exist: "+QString::number(QDir(pathList.first().destination.absoluteFilePath()).exists())); + emit errorOnFolder(pathList.first().destination,tr("Unable to move the folder")); + return; + } + } + } + if(doTheDateTransfer) + if(!writeFileDateTime(pathList.first().destination)) + { + if(!pathList.first().destination.exists()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to set destination folder time (not exists): "+pathList.first().destination.absoluteFilePath()); + else if(!pathList.first().destination.isDir()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to set destination folder time (not a dir): "+pathList.first().destination.absoluteFilePath()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to set destination folder time: "+pathList.first().destination.absoluteFilePath()); + /*if(stopIt) + return; + waitAction=true; + + emit errorOnFolder(pathList.first().source,tr("Unable to set time")); + return;*/ + } + if(doRightTransfer && pathList.first().actionType!=ActionType_RealMove) + { + QFile source(pathList.first().source.absoluteFilePath()); + QFile destination(pathList.first().destination.absoluteFilePath()); + if(!destination.setPermissions(source.permissions())) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to set the right: "+pathList.first().destination.absoluteFilePath()); + /*if(stopIt) + return; + waitAction=true; + emit errorOnFolder(pathList.first().source,tr("Unable to set the access-right")); + return;*/ + } + } + if(pathList.first().actionType==ActionType_MovePath) + { + if(!rmpath(pathList.first().source.absoluteFilePath())) + { + if(stopIt) + return; + waitAction=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to remove the source folder: "+pathList.first().destination.absoluteFilePath()); + emit errorOnFolder(pathList.first().source,tr("Unable to remove")); + return; + } + } + pathList.removeFirst(); + emit firstFolderFinish(); + checkIfCanDoTheNext(); +} + +void MkPath::internalAddPath(const QFileInfo& source, const QFileInfo& destination, const ActionType &actionType) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("source: %1, destination: %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + Item tempPath; + tempPath.source=source; + tempPath.destination=destination; + tempPath.actionType=actionType; + pathList << tempPath; + if(!waitAction) + checkIfCanDoTheNext(); +} + +void MkPath::checkIfCanDoTheNext() +{ + if(!waitAction && !stopIt && pathList.size()>0) + emit internalStartDoThisPath(); +} + +void MkPath::internalSkip() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + waitAction=false; + pathList.removeFirst(); + emit firstFolderFinish(); + checkIfCanDoTheNext(); +} + +void MkPath::internalRetry() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + waitAction=false; + checkIfCanDoTheNext(); +} + +void MkPath::setRightTransfer(const bool doRightTransfer) +{ + this->doRightTransfer=doRightTransfer; +} + +void MkPath::setKeepDate(const bool keepDate) +{ + this->keepDate=keepDate; +} + +bool MkPath::rmpath(const QDir &dir + #ifdef ULTRACOPIER_PLUGIN_RSYNC + ,const bool &toSync + #endif + ) +{ + if(!dir.exists()) + return true; + bool allHaveWork=true; + QFileInfoList list = dir.entryInfoList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System,QDir::DirsFirst); + for (int i = 0; i < list.size(); ++i) + { + QFileInfo fileInfo(list.at(i)); + if(!fileInfo.isDir()) + { + #ifdef ULTRACOPIER_PLUGIN_RSYNC + if(toSync) + { + QFile file(fileInfo.absoluteFilePath()); + if(!file.remove()) + { + if(toSync) + { + QFile file(fileInfo.absoluteFilePath()); + if(!file.remove()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to remove a file: "+fileInfo.absoluteFilePath()+", due to: "+file.errorString()); + allHaveWork=false; + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"found a file: "+fileInfo.fileName()); + allHaveWork=false; + } + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"found a file: "+fileInfo.fileName()); + allHaveWork=false; + } + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"found a file: "+fileInfo.fileName()); + allHaveWork=false; + #endif + } + else + { + //return the fonction for scan the new folder + if(!rmpath(dir.absolutePath()+'/'+fileInfo.fileName()+'/')) + allHaveWork=false; + } + } + if(!allHaveWork) + return false; + allHaveWork=dir.rmdir(dir.absolutePath()); + if(!allHaveWork) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to remove the folder: "+dir.absolutePath()); + return allHaveWork; +} + +//fonction to edit the file date time +bool MkPath::readFileDateTime(const QFileInfo &source) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"readFileDateTime("+source.absoluteFilePath()+")"); + /** Why not do it with Qt? Because it not support setModificationTime(), and get the time with Qt, that's mean use local time where in C is UTC time */ + #ifdef Q_OS_UNIX + #ifdef Q_OS_LINUX + struct stat info; + if(stat(source.absoluteFilePath().toLatin1().data(),&info)!=0) + return false; + time_t ctime=info.st_ctim.tv_sec; + time_t actime=info.st_atim.tv_sec; + time_t modtime=info.st_mtim.tv_sec; + //this function avalaible on unix and mingw + butime.actime=actime; + butime.modtime=modtime; + Q_UNUSED(ctime); + return true; + #else //mainly for mac + QFileInfo fileInfo(source); + time_t ctime=fileInfo.created().toTime_t(); + time_t actime=fileInfo.lastRead().toTime_t(); + time_t modtime=fileInfo.lastModified().toTime_t(); + //this function avalaible on unix and mingw + utimbuf butime; + butime.actime=actime; + butime.modtime=modtime; + Q_UNUSED(ctime); + return true; + #endif + #else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + struct stat info; + if(stat(source.toLatin1().data(),&info)!=0) + return false; + time_t ctime=info.st_ctim.tv_sec; + time_t actime=info.st_atim.tv_sec; + time_t modtime=info.st_mtim.tv_sec; + //this function avalaible on unix and mingw + butime.actime=actime; + butime.modtime=modtime; + Q_UNUSED(ctime); + return true; + #else + wchar_t filePath[65535]; + if(source.absoluteFilePath().contains(regRead)) + filePath[QDir::toNativeSeparators(QStringLiteral("\\\\?\\")+source.absoluteFilePath()).toWCharArray(filePath)]=L'\0'; + else + filePath[QDir::toNativeSeparators(source.absoluteFilePath()).toWCharArray(filePath)]=L'\0'; + HANDLE hFileSouce = CreateFileW(filePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_BACKUP_SEMANTICS, NULL); + if(hFileSouce == INVALID_HANDLE_VALUE) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"open failed to read: "+QString::fromWCharArray(filePath)+", error: "+QString::number(GetLastError())); + return false; + } + FILETIME ftCreate, ftAccess, ftWrite; + if(!GetFileTime(hFileSouce, &ftCreate, &ftAccess, &ftWrite)) + { + CloseHandle(hFileSouce); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to get the file time"); + return false; + } + this->ftCreateL=ftCreate.dwLowDateTime; + this->ftCreateH=ftCreate.dwHighDateTime; + this->ftAccessL=ftAccess.dwLowDateTime; + this->ftAccessH=ftAccess.dwHighDateTime; + this->ftWriteL=ftWrite.dwLowDateTime; + this->ftWriteH=ftWrite.dwHighDateTime; + CloseHandle(hFileSouce); + return true; + #endif + #else + return false; + #endif + #endif + return false; +} + +bool MkPath::writeFileDateTime(const QFileInfo &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"writeFileDateTime("+destination.absoluteFilePath()+")"); + /** Why not do it with Qt? Because it not support setModificationTime(), and get the time with Qt, that's mean use local time where in C is UTC time */ + #ifdef Q_OS_UNIX + #ifdef Q_OS_LINUX + return utime(destination.absoluteFilePath().toLatin1().data(),&butime)==0; + #else //mainly for mac + return utime(destination.absoluteFilePath().toLatin1().data(),&butime)==0; + #endif + #else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + return utime(destination.toLatin1().data(),&butime)==0; + #else + wchar_t filePath[65535]; + if(destination.absoluteFilePath().contains(regRead)) + filePath[QDir::toNativeSeparators(QStringLiteral("\\\\?\\")+destination.absoluteFilePath()).toWCharArray(filePath)]=L'\0'; + else + filePath[QDir::toNativeSeparators(destination.absoluteFilePath()).toWCharArray(filePath)]=L'\0'; + HANDLE hFileDestination = CreateFileW(filePath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if(hFileDestination == INVALID_HANDLE_VALUE) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"open failed to write: "+QString::fromWCharArray(filePath)+", error: "+QString::number(GetLastError())); + return false; + } + FILETIME ftCreate, ftAccess, ftWrite; + ftCreate.dwLowDateTime=this->ftCreateL; + ftCreate.dwHighDateTime=this->ftCreateH; + ftAccess.dwLowDateTime=this->ftAccessL; + ftAccess.dwHighDateTime=this->ftAccessH; + ftWrite.dwLowDateTime=this->ftWriteL; + ftWrite.dwHighDateTime=this->ftWriteH; + if(!SetFileTime(hFileDestination, &ftCreate, &ftAccess, &ftWrite)) + { + CloseHandle(hFileDestination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to set the file time"); + return false; + } + CloseHandle(hFileDestination); + return true; + #endif + #else + return false; + #endif + #endif + return false; +} diff --git a/plugins/CopyEngine/Ultracopier/MkPath.h b/plugins/CopyEngine/Ultracopier/MkPath.h new file mode 100644 index 0000000..9182462 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/MkPath.h @@ -0,0 +1,106 @@ +/** \file MkPath.h +\brief Make the path given as queued mkpath +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef MKPATH_H +#define MKPATH_H + +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" + +#ifdef Q_OS_UNIX + #include + #include + #include + #include +#else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + #include + #include + #include + #include + #endif + #endif +#endif + +/// \brief Make the path given as queued mkpath +class MkPath : public QThread +{ + Q_OBJECT +public: + explicit MkPath(); + ~MkPath(); + /// \brief add path to make + void addPath(const QFileInfo& source,const QFileInfo& destination,const ActionType &actionType); + void setRightTransfer(const bool doRightTransfer); + void setKeepDate(const bool keepDate); +signals: + void errorOnFolder(const QFileInfo &,const QString &,const ErrorType &errorType=ErrorType_FolderWithRety) const; + void firstFolderFinish(); + void internalStartAddPath(const QFileInfo& source,const QFileInfo& destination, const ActionType &actionType) const; + void internalStartDoThisPath() const; + void internalStartSkip() const; + void internalStartRetry() const; + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; +public slots: + /// \brief skip after creation error + void skip(); + /// \brief retry after creation error + void retry(); +private: + void run(); + bool waitAction; + bool stopIt; + bool skipIt; + QDateTime maxTime; + struct Item + { + QFileInfo source; + QFileInfo destination; + ActionType actionType; + }; + QList pathList; + void checkIfCanDoTheNext(); + QDir dir; + bool doRightTransfer; + bool keepDate; + bool doTheDateTransfer; + #ifdef Q_OS_UNIX + utimbuf butime; + #else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + utimbuf butime; + #else + quint32 ftCreateL, ftAccessL, ftWriteL; + quint32 ftCreateH, ftAccessH, ftWriteH; + QRegularExpression regRead; + #endif + #endif + #endif + //fonction to edit the file date time + bool readFileDateTime(const QFileInfo &source); + bool writeFileDateTime(const QFileInfo &destination); + static QString text_slash; +private slots: + void internalDoThisPath(); + void internalAddPath(const QFileInfo& source, const QFileInfo& destination,const ActionType &actionType); + void internalSkip(); + void internalRetry(); + bool rmpath(const QDir &dir + #ifdef ULTRACOPIER_PLUGIN_RSYNC + , const bool &toSync=false + #endif + ); +}; + +#endif // MKPATH_H diff --git a/plugins/CopyEngine/Ultracopier/ReadThread.cpp b/plugins/CopyEngine/Ultracopier/ReadThread.cpp new file mode 100644 index 0000000..37c83f4 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ReadThread.cpp @@ -0,0 +1,687 @@ +#include "ReadThread.h" + +ReadThread::ReadThread() +{ + start(); + moveToThread(this); + stopIt=false; + putInPause=false; + blockSize=ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*1024; + setObjectName(QStringLiteral("read")); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + isInReadLoop=false; + tryStartRead=false; + lastGoodPosition=0; + isOpen.release(); +} + +ReadThread::~ReadThread() +{ + stopIt=true; + //disconnect(this);//-> do into ~TransferThread() + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + waitNewClockForSpeed.release(); + #endif + pauseMutex.release(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + waitNewClockForSpeed.release(); + #endif + pauseMutex.release(); + //if(isOpen.available()<=0) + emit internalStartClose(); + isOpen.acquire(); + exit(); + wait(); +} + +void ReadThread::run() +{ + connect(this,&ReadThread::internalStartOpen, this,&ReadThread::internalOpenSlot, Qt::QueuedConnection); + connect(this,&ReadThread::internalStartReopen, this,&ReadThread::internalReopen, Qt::QueuedConnection); + connect(this,&ReadThread::internalStartRead, this,&ReadThread::internalRead, Qt::QueuedConnection); + connect(this,&ReadThread::internalStartClose, this,&ReadThread::internalCloseSlot, Qt::QueuedConnection); + connect(this,&ReadThread::checkIfIsWait, this,&ReadThread::isInWait, Qt::QueuedConnection); + connect(this,&ReadThread::internalStartChecksum, this,&ReadThread::checkSum, Qt::QueuedConnection); + exec(); +} + +void ReadThread::open(const QFileInfo &file, const Ultracopier::CopyMode &mode) +{ + if(!isRunning()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] the thread not running to open destination: ")+file.absoluteFilePath()); + errorString_internal=tr("Internal error, please report it!"); + emit error(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] open source: ")+file.absoluteFilePath()); + if(this->file.isOpen()) + { + if(file.absoluteFilePath()==this->file.fileName()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] Try reopen already opened same file: ")+file.absoluteFilePath()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] previous file is already open: ")+file.absoluteFilePath()); + emit internalStartClose(); + isOpen.acquire(); + isOpen.release(); + } + if(isInReadLoop) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] previous file is already readding: ")+file.absoluteFilePath()); + return; + } + if(tryStartRead) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] previous file is already try read: ")+file.absoluteFilePath()); + return; + } + stopIt=false; + fakeMode=false; + lastGoodPosition=0; + this->file.setFileName(file.absoluteFilePath()); + this->mode=mode; + emit internalStartOpen(); +} + +QString ReadThread::errorString() const +{ + return errorString_internal; +} + +void ReadThread::stop() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stop()")); + stopIt=true; + pauseMutex.release(); + pauseMutex.release(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + waitNewClockForSpeed.release(); + #endif + if(isOpen.available()<=0) + emit internalStartClose(); +} + +void ReadThread::pause() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try put read thread in pause")); + if(stopIt) + return; + pauseMutex.tryAcquire(pauseMutex.available()); + putInPause=true; +} + +void ReadThread::resume() +{ + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + putInPause=false; + stopIt=false; + } + else + return; + if(!file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] file is not open")); + return; + } + pauseMutex.release(); +} + +bool ReadThread::seek(const qint64 &position) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start with: ")+QString::number(position)); + if(position>file.size()) + return false; + return file.seek(position); +} + +qint64 ReadThread::size() const +{ + return file.size(); +} + +void ReadThread::postOperation() +{ + emit internalStartClose(); +} + +void ReadThread::checkSum() +{ + QByteArray blockArray; + QCryptographicHash hash(QCryptographicHash::Sha1); + isInReadLoop=true; + lastGoodPosition=0; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + numberOfBlockCopied=0; + #endif + seek(0); + int sizeReaden=0; + do + { + //read one block + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Read; + #endif + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("[")+QString::number(id)+QStringLiteral("] read put in pause")); + if(stopIt) + return; + pauseMutex.acquire(); + if(stopIt) + return; + } + blockArray=file.read(blockSize); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + //can be smaller than min block size to do correct speed limitation + if(blockArray.size()>ULTRACOPIER_PLUGIN_MAX_BLOCK_SIZE*1024) + { + errorString_internal=tr("Internal error reading the source file:block size out of range"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Internal error reading the source file:block size out of range")); + emit error(); + isInReadLoop=false; + return; + } + if(file.error()!=QFile::NoError) + { + errorString_internal=tr("Unable to read the source file: ")+file.errorString()+QStringLiteral(" (")+QString::number(file.error())+QStringLiteral(")"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); + emit error(); + isInReadLoop=false; + return; + } + sizeReaden=blockArray.size(); + if(sizeReaden>0) + { + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Checksum; + #endif + hash.addData(blockArray); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + if(stopIt) + break; + + lastGoodPosition+=blockArray.size(); + + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + //wait for limitation speed if stop not query + if(multiForBigSpeed>0) + { + numberOfBlockCopied++; + if(numberOfBlockCopied>=multiForBigSpeed) + { + numberOfBlockCopied=0; + waitNewClockForSpeed.acquire(); + if(stopIt) + break; + } + } + #endif + } + } + while(sizeReaden>0 && !stopIt); + if(lastGoodPosition>file.size()) + { + errorString_internal=tr("File truncated during the read, possible data change"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); + emit error(); + isInReadLoop=false; + return; + } + isInReadLoop=false; + if(stopIt) + { + stopIt=false; + return; + } + emit checksumFinish(hash.result()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stop the read")); +} + +bool ReadThread::internalOpenSlot() +{ + return internalOpen(); +} + +bool ReadThread::internalOpen(bool resetLastGoodPosition) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] internalOpen source: ")+file.fileName()+QStringLiteral(", open in write because move: ")+QString::number(mode==Ultracopier::Move)); + if(stopIt) + { + emit closed(); + return false; + } + putInPause=false; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=InodeOperation; + #endif + if(file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] this file is already open: ")+file.fileName()); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + emit closed(); + return false; + } + QIODevice::OpenMode openMode=QIODevice::ReadOnly; + /*can have permision to remove but not write + * if(mode==Ultracopier::Move) + openMode=QIODevice::ReadWrite;*/ + seekToZero=false; + if(file.open(openMode)) + { + if(stopIt) + { + file.close(); + emit closed(); + return false; + } + pauseMutex.tryAcquire(pauseMutex.available()); + if(stopIt) + { + file.close(); + emit closed(); + return false; + } + size_at_open=file.size(); + mtime_at_open=QFileInfo(file).lastModified(); + putInPause=false; + if(resetLastGoodPosition) + lastGoodPosition=0; + if(!seek(lastGoodPosition)) + { + file.close(); + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } + isOpen.acquire(); + emit opened(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return true; + } + else + { + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } +} + +void ReadThread::internalRead() +{ + isInReadLoop=true; + tryStartRead=false; + if(stopIt) + { + if(seekToZero && file.isOpen()) + { + stopIt=false; + lastGoodPosition=0; + file.seek(0); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stopIt == true, then quit")); + isInReadLoop=false; + internalClose(); + return; + } + } + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=InodeOperation; + #endif + int sizeReaden=0; + if(!file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] is not open!")); + isInReadLoop=false; + return; + } + QByteArray blockArray; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + numberOfBlockCopied=0; + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start the copy")); + emit readIsStarted(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stopIt == true, then quit")); + isInReadLoop=false; + internalClose(); + return; + } + do + { + //read one block + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("[")+QString::number(id)+QStringLiteral("] read put in pause")); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stopIt == true, then quit")); + isInReadLoop=false; + internalClose(); + return; + } + pauseMutex.acquire(); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stopIt == true, then quit")); + isInReadLoop=false; + internalClose(); + return; + } + } + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Read; + #endif + blockArray=file.read(blockSize); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + if(file.error()!=QFile::NoError) + { + errorString_internal=tr("Unable to read the source file: ")+file.errorString()+QStringLiteral(" (")+QString::number(file.error())+QStringLiteral(")"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); + isInReadLoop=false; + emit error(); + return; + } + sizeReaden=blockArray.size(); + if(sizeReaden>0) + { + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=WaitWritePipe; + #endif + if(!writeThread->write(blockArray))//speed limitation here + { + if(!stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stopped because the write is stopped: ")+QString::number(lastGoodPosition)); + stopIt=true; + } + } + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stopIt == true, then quit")); + isInReadLoop=false; + internalClose();//need re-open the destination and then the source + return; + } + lastGoodPosition+=blockArray.size(); + } + /* + if(lastGoodPosition>16*1024) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Test error in reading: %1 (%2)").arg(file.errorString()).arg(file.error())); + errorString_internal=QStringLiteral("Test error in reading: %1 (%2)").arg(file.errorString()).arg(file.error()); + isInReadLoop=false; + emit error(); + return; + } + */ + } + while(sizeReaden>0 && !stopIt); + if(lastGoodPosition>file.size()) + { + errorString_internal=tr("File truncated during the read, possible data change"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); + isInReadLoop=false; + emit error(); + return; + } + isInReadLoop=false; + if(stopIt) + { + stopIt=false; + return; + } + emit readIsStopped();//will product by signal connection writeThread->endIsDetected(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stop the read")); +} + +void ReadThread::startRead() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + if(tryStartRead) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] already in try start")); + return; + } + if(isInReadLoop) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + else + { + tryStartRead=true; + emit internalStartRead(); + } +} + +void ReadThread::internalCloseSlot() +{ + internalClose(); +} + +void ReadThread::internalClose(bool callByTheDestructor) +{ + /// \note never send signal here, because it's called by the destructor + //ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + bool closeTheFile=false; + if(!fakeMode) + { + if(file.isOpen()) + { + closeTheFile=true; + file.close(); + isInReadLoop=false; + } + } + if(!callByTheDestructor) + emit closed(); + + /// \note always the last of this function + if(closeTheFile) + isOpen.release(); +} + +/** \brief set block size +\param block the new block size in B +\return Return true if succes */ +bool ReadThread::setBlockSize(const int blockSize) +{ + //can be smaller than min block size to do correct speed limitation + if(blockSize>1 && blockSizeblockSize=blockSize; + //set the new max speed because the timer have changed + return true; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("block size out of range: ")+QString::number(blockSize)); + return false; + } +} + +#ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT +/*! \brief Set the max speed +\param tempMaxSpeed Set the max speed in KB/s, 0 for no limit */ +void ReadThread::setMultiForBigSpeed(const int &multiForBigSpeed) +{ + this->multiForBigSpeed=multiForBigSpeed; + waitNewClockForSpeed.release(); +} + +/// \brief For give timer every X ms +void ReadThread::timeOfTheBlockCopyFinished() +{ + /* this is the old way to limit the speed, it product blocking + *if(waitNewClockForSpeed.available()maxSpeed>0)*/ + if(waitNewClockForSpeed.available()<=1) + waitNewClockForSpeed.release(); +} +#endif + +/// \brief do the fake open +void ReadThread::fakeOpen() +{ + fakeMode=true; + emit opened(); +} + +/// \brief do the fake writeIsStarted +void ReadThread::fakeReadIsStarted() +{ + emit readIsStarted(); +} + +/// \brief do the fake writeIsStopped +void ReadThread::fakeReadIsStopped() +{ + emit readIsStopped(); +} + +/// do the checksum +void ReadThread::startCheckSum() +{ + emit internalStartChecksum(); +} + +qint64 ReadThread::getLastGoodPosition() const +{ + /*if(lastGoodPosition>file.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] Bug, the lastGoodPosition is greater than the file size!")); + return file.size(); + } + else*/ + return lastGoodPosition; +} + +//reopen after an error +void ReadThread::reopen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + if(isInReadLoop) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try reopen where read is not finish")); + return; + } + stopIt=true; + emit internalStartReopen(); +} + +bool ReadThread::internalReopen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + stopIt=false; + if(file.isOpen()) + { + file.close(); + isOpen.release(); + } + if(size_at_open!=file.size() && mtime_at_open!=QFileInfo(file).lastModified()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] source file have changed since the last open, restart all")); + //fix this function like the close function + if(internalOpen(true)) + { + emit resumeAfterErrorByRestartAll(); + return true; + } + else + return false; + } + else + { + //fix this function like the close function + if(internalOpen(false)) + { + emit resumeAfterErrorByRestartAtTheLastPosition(); + return true; + } + else + return false; + } +} + +//set the write thread +void ReadThread::setWriteThread(WriteThread * writeThread) +{ + this->writeThread=writeThread; +} + +#ifdef ULTRACOPIER_PLUGIN_DEBUG +//to set the id +void ReadThread::setId(int id) +{ + this->id=id; +} +#endif + +void ReadThread::seekToZeroAndWait() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + stopIt=true; + seekToZero=true; + emit checkIfIsWait(); +} + +void ReadThread::isInWait() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + if(seekToZero) + { + stopIt=false; + seekToZero=false; + if(file.isOpen()) + { + lastGoodPosition=0; + seek(0); + } + else + internalOpen(true); + emit isSeekToZeroAndWait(); + } +} + +bool ReadThread::isReading() const +{ + return isInReadLoop; +} + diff --git a/plugins/CopyEngine/Ultracopier/ReadThread.h b/plugins/CopyEngine/Ultracopier/ReadThread.h new file mode 100644 index 0000000..f00ae79 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ReadThread.h @@ -0,0 +1,147 @@ +/** \file ReadThread.h +\brief Thread changed to open/close and read the source file +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef READTHREAD_H +#define READTHREAD_H + +#include +#include +#include +#include +#include +#include + +#include "WriteThread.h" +#include "Environment.h" +#include "StructEnumDefinition_CopyEngine.h" +#include "AvancedQFile.h" + +/// \brief Thread changed to open/close and read the source file +class ReadThread : public QThread +{ + Q_OBJECT +public: + explicit ReadThread(); + ~ReadThread(); +protected: + void run(); +public: + /// \brief open with the name and copy mode + void open(const QFileInfo &file, const Ultracopier::CopyMode &mode); + /// \brief return the error string + QString errorString() const; + //QByteArray read(qint64 position,qint64 maxSize); + /// \brief stop the copy + void stop(); + /// \brief put the copy in pause + void pause(); + /// \brief resume the copy + void resume(); + /// \brief get the size of the source file + qint64 size() const; + /// \brief get the last good position + qint64 getLastGoodPosition() const; + /// \brief start the reading of the source file + void startRead(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + /// \brief set the current max speed in KB/s + void setMultiForBigSpeed(const int &multiForBigSpeed); + #endif + /// \brief set block size in KB + bool setBlockSize(const int blockSize); + /// \brief reopen after an error + void reopen(); + /// \brief set the write thread + void setWriteThread(WriteThread * writeThread); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief to set the id + void setId(int id); + /// \brief stat + enum ReadStat + { + Idle=0, + InodeOperation=1, + Read=2, + WaitWritePipe=3, + Checksum=4 + }; + ReadStat stat; + #endif + /// \brief return if it's reading + bool isReading() const; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + /// \brief executed at regular interval to do a speed throling + void timeOfTheBlockCopyFinished(); + #endif + /// \brief do the fake open + void fakeOpen(); + /// \brief do the fake readIsStarted + void fakeReadIsStarted(); + /// \brief do the fake readIsStopped + void fakeReadIsStopped(); + /// do the checksum + void startCheckSum(); +public slots: + /// \brief to reset the copy, and put at the same state when it just open + void seekToZeroAndWait(); + void postOperation(); + /// do the checksum + void checkSum(); +signals: + void error() const; + void opened() const; + void readIsStarted() const; + void readIsStopped() const; + void closed() const; + void isSeekToZeroAndWait() const; + void checkIfIsWait() const; + void resumeAfterErrorByRestartAll() const; + void resumeAfterErrorByRestartAtTheLastPosition() const; + void checksumFinish(const QByteArray&) const; + // internal signals + void internalStartOpen() const; + void internalStartChecksum() const; + void internalStartReopen() const; + void internalStartRead() const; + void internalStartClose() const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,QString fonction,QString text,QString file,int ligne) const; + +private: + QString errorString_internal; + AvancedQFile file; + volatile bool stopIt; + Ultracopier::CopyMode mode; + qint64 lastGoodPosition; + volatile int blockSize;//in Bytes + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + QSemaphore waitNewClockForSpeed; + volatile int numberOfBlockCopied; ///< Multiple for count the number of block copied + volatile int multiForBigSpeed; ///< Multiple for count the number of block needed + #endif + WriteThread* writeThread; + int id; + QSemaphore isOpen; + QSemaphore pauseMutex; + volatile bool putInPause; + volatile bool isInReadLoop; + volatile bool seekToZero; + volatile bool tryStartRead; + qint64 size_at_open; + QDateTime mtime_at_open; + bool fakeMode; + //internal function + bool seek(const qint64 &position);/// \todo search if is use full +private slots: + bool internalOpen(bool resetLastGoodPosition=true); + bool internalOpenSlot(); + bool internalReopen(); + void internalRead(); + void internalClose(bool callByTheDestructor=false); + void internalCloseSlot(); + void isInWait(); +}; + +#endif // READTHREAD_H diff --git a/plugins/CopyEngine/Ultracopier/RenamingRules.cpp b/plugins/CopyEngine/Ultracopier/RenamingRules.cpp new file mode 100644 index 0000000..848d7fb --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/RenamingRules.cpp @@ -0,0 +1,85 @@ +#include "RenamingRules.h" +#include "ui_RenamingRules.h" + +#include + +RenamingRules::RenamingRules(QWidget *parent) : + QDialog(parent), + ui(new Ui::RenamingRules) +{ + ui->setupUi(this); + connectUI(); + setRenamingRules(QStringLiteral(""),QStringLiteral("")); +} + +RenamingRules::~RenamingRules() +{ + delete ui; +} + +void RenamingRules::on_buttonBox_clicked(QAbstractButton *button) +{ + if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::RejectRole) + reject(); + if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::ResetRole) + { + setRenamingRules(QStringLiteral(""),QStringLiteral("")); + emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); + } +} + +void RenamingRules::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) +{ + disconnectUI(); + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + if(!firstRenamingRule.isEmpty()) + ui->firstRenamingRule->setText(firstRenamingRule); + else + ui->firstRenamingRule->setText(tr("%1 - copy").arg(QStringLiteral("%name%"))); + if(!otherRenamingRule.isEmpty()) + ui->otherRenamingRule->setText(otherRenamingRule); + else + ui->otherRenamingRule->setText(tr("%1 - copy (%2)").arg(QStringLiteral("%name%")).arg(QStringLiteral("%number%"))); + connectUI(); +} + +void RenamingRules::connectUI() +{ + connect(ui->firstRenamingRule,&QLineEdit::editingFinished,this,&RenamingRules::firstRenamingRule_haveChanged); + connect(ui->otherRenamingRule,&QLineEdit::editingFinished,this,&RenamingRules::otherRenamingRule_haveChanged); +} + +void RenamingRules::disconnectUI() +{ + disconnect(ui->firstRenamingRule,&QLineEdit::editingFinished,this,&RenamingRules::firstRenamingRule_haveChanged); + disconnect(ui->otherRenamingRule,&QLineEdit::editingFinished,this,&RenamingRules::otherRenamingRule_haveChanged); +} + +void RenamingRules::firstRenamingRule_haveChanged() +{ + QString newValue=ui->firstRenamingRule->text(); + if(newValue==tr("%1 - copy").arg(QStringLiteral("%name%"))) + newValue=QStringLiteral(""); + if(newValue==firstRenamingRule) + return; + firstRenamingRule=newValue; + emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +void RenamingRules::otherRenamingRule_haveChanged() +{ + QString newValue=ui->otherRenamingRule->text(); + if(newValue==tr("%1 - copy (%2)").arg(QStringLiteral("%name%")).arg(QStringLiteral("%number%"))) + newValue=QStringLiteral(""); + if(newValue==otherRenamingRule) + return; + otherRenamingRule=newValue; + emit sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +void RenamingRules::newLanguageLoaded() +{ + ui->retranslateUi(this); + setRenamingRules(firstRenamingRule,otherRenamingRule); +} diff --git a/plugins/CopyEngine/Ultracopier/RenamingRules.h b/plugins/CopyEngine/Ultracopier/RenamingRules.h new file mode 100644 index 0000000..c802cef --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/RenamingRules.h @@ -0,0 +1,34 @@ +#ifndef RENAMINGRULES_H +#define RENAMINGRULES_H + +#include +#include + +namespace Ui { +class RenamingRules; +} + +/** Define rules for renaming */ +class RenamingRules : public QDialog +{ + Q_OBJECT +public: + explicit RenamingRules(QWidget *parent = 0); + ~RenamingRules(); + void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); + void newLanguageLoaded(); +private: + Ui::RenamingRules *ui; + void connectUI(); + void disconnectUI(); + QString firstRenamingRule; + QString otherRenamingRule; +private slots: + void on_buttonBox_clicked(QAbstractButton *button); + void firstRenamingRule_haveChanged(); + void otherRenamingRule_haveChanged(); +signals: + void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) const; +}; + +#endif // RENAMINGRULES_H diff --git a/plugins/CopyEngine/Ultracopier/RenamingRules.ui b/plugins/CopyEngine/Ultracopier/RenamingRules.ui new file mode 100644 index 0000000..9e84f4b --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/RenamingRules.ui @@ -0,0 +1,129 @@ + + + RenamingRules + + + + 0 + 0 + 303 + 213 + + + + Renaming rules + + + + 2 + + + 2 + + + + + First renaming + + + + + + %name% - copy + + + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p></body></html> + + + + + + + + + + Second renaming + + + + + + %name% - copy (%number%) + + + + + + + <html><head/><body><p>Variables: <span style=" font-weight:600;">%name%</span> for the original file name</p><p><span style=" font-weight:600;">%number%</span> for the extra number</p></body></html> + + + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::RestoreDefaults + + + + + + + + + buttonBox + accepted() + RenamingRules + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + RenamingRules + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp b/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp new file mode 100644 index 0000000..9c35050 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp @@ -0,0 +1,677 @@ +#include "ScanFileOrFolder.h" +#include "TransferThread.h" +#include +#include + +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif + +QString ScanFileOrFolder::text_slash=QLatin1Literal("/"); +QString ScanFileOrFolder::text_antislash=QLatin1Literal("\\"); +QString ScanFileOrFolder::text_dot=QLatin1Literal("."); + +ScanFileOrFolder::ScanFileOrFolder(const Ultracopier::CopyMode &mode) +{ + #ifdef ULTRACOPIER_PLUGIN_RSYNC + rsync = false; + #endif + moveTheWholeFolder = true; + stopped = true; + stopIt = false; + this->mode = mode; + folder_isolation = QRegularExpression(QStringLiteral("^(.*/)?([^/]+)/$")); + setObjectName(QStringLiteral("ScanFileOrFolder")); + #ifdef Q_OS_WIN32 + QString userName; + DWORD size=255; + WCHAR * userNameW=new WCHAR[size]; + if(GetUserNameW(userNameW,&size)) + { + userName=QString::fromWCharArray(userNameW,size-1); + blackList << QFileInfo(QStringLiteral("C:/Users/%1/AppData/Roaming/").arg(userName)).absoluteFilePath(); + } + delete userNameW; + #endif +} + +ScanFileOrFolder::~ScanFileOrFolder() +{ + stop(); + quit(); + wait(); +} + +bool ScanFileOrFolder::isFinished() const +{ + return stopped; +} + +void ScanFileOrFolder::addToList(const QStringList& sources,const QString& destination) +{ + stopIt=false; + this->sources=parseWildcardSources(sources); + this->destination=destination; + QFileInfo destinationInfo(this->destination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("check symblink: %1").arg(destinationInfo.absoluteFilePath())); + while(destinationInfo.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("resolv destination to: %1").arg(destinationInfo.symLinkTarget())); + if(QFileInfo(destinationInfo.symLinkTarget()).isAbsolute()) + this->destination=destinationInfo.symLinkTarget(); + else + this->destination=destinationInfo.absolutePath()+text_slash+destinationInfo.symLinkTarget(); + destinationInfo.setFile(this->destination); + } + if(sources.size()>1 || QFileInfo(destination).isDir()) + /* Disabled because the separator transformation product bug + * if(!destination.endsWith(QDir::separator())) + this->destination+=QDir::separator();*/ + if(!destination.endsWith(text_slash) && !destination.endsWith(text_antislash)) + this->destination+=text_slash;//put unix separator because it's transformed into that's under windows too + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"addToList("+sources.join(";")+","+this->destination+")"); +} + + +QStringList ScanFileOrFolder::parseWildcardSources(const QStringList &sources) const +{ + QRegularExpression splitFolder(QStringLiteral("[/\\\\]")); + QStringList returnList; + int index=0; + while(index recomposedSource; + recomposedSource << (QStringList() << QStringLiteral("")); + while(toParse.size()>0) + { + if(toParse.first().contains('*')) + { + QString toParseFirst=toParse.first(); + if(toParseFirst.isEmpty()) + toParseFirst=text_slash; + QList newRecomposedSource; + QRegularExpression toResolv=QRegularExpression(toParseFirst.replace('*',QStringLiteral("[^/\\\\]*"))); + int index_recomposedSource=0; + while(index_recomposedSource &include, const QList &exclude) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QMutexLocker lock(&filtersMutex); + this->include_send=include; + this->exclude_send=exclude; + reloadTheNewFilters=true; + haveFilters=include_send.size()>0 || exclude_send.size()>0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("haveFilters: %1, include_send.size(): %2, exclude_send.size(): %3").arg(haveFilters).arg(include_send.size()).arg(exclude_send.size())); +} + +//set action if Folder are same or exists +void ScanFileOrFolder::setFolderExistsAction(const FolderExistsAction &action, const QString &newName) +{ + this->newName=newName; + folderExistsAction=action; + waitOneAction.release(); +} + +//set action if error +void ScanFileOrFolder::setFolderErrorAction(const FileErrorAction &action) +{ + fileErrorAction=action; + waitOneAction.release(); +} + +void ScanFileOrFolder::stop() +{ + stopIt=true; + waitOneAction.release(); +} + +void ScanFileOrFolder::run() +{ + stopped=false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start the listing with destination: "+destination+", mode: "+QString::number(mode)); + destination=resolvDestination(destination).absoluteFilePath(); + if(stopIt) + { + stopped=true; + return; + } + if(fileErrorAction==FileError_Skip) + { + stopped=true; + return; + } + int sourceIndex=0; + while(sourceIndexinclude=this->include_send; + this->exclude=this->exclude_send; + } + QString fileName=fileInfo.fileName(); + if(fileInfo.isDir() && !fileInfo.isSymLink()) + { + bool excluded=false,included=(include.size()==0); + int filters_index=0; + while(filters_indexcheckDestinationExists=checkDestinationFolderExists; +} + +void ScanFileOrFolder::setRenamingRules(const QString &firstRenamingRule, const QString &otherRenamingRule) +{ + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; +} + +void ScanFileOrFolder::setMoveTheWholeFolder(const bool &moveTheWholeFolder) +{ + this->moveTheWholeFolder=moveTheWholeFolder; +} + +void ScanFileOrFolder::setCopyListOrder(const bool &order) +{ + this->copyListOrder=order; +} + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +/// \brief set rsync +void ScanFileOrFolder::setRsync(const bool rsync) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"set rsync: "+QString::number(rsync)); + this->rsync=rsync; +} +#endif + +void ScanFileOrFolder::set_updateMount() +{ + driveManagement.tryUpdate(); +} diff --git a/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h b/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h new file mode 100644 index 0000000..e9e59ce --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h @@ -0,0 +1,108 @@ +/** \file scanFileOrFolder.h +\brief Thread changed to list recursively the folder +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "DriveManagement.h" + +#ifndef SCANFILEORFOLDER_H +#define SCANFILEORFOLDER_H + +/// \brief Thread changed to list recursively the folder +class ScanFileOrFolder : public QThread +{ + Q_OBJECT +public: + explicit ScanFileOrFolder(const Ultracopier::CopyMode &mode); + ~ScanFileOrFolder(); + /// \brief to the a folder listing + void stop(); + /// \brief to get if is finished + bool isFinished() const; + /// \brief set action if Folder are same or exists + void setFolderExistsAction(const FolderExistsAction &action,const QString &newName=""); + /// \brief set action if error + void setFolderErrorAction(const FileErrorAction &action); + /// \brief set if need check if the destination exists + void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); + void setRenamingRules(const QString &firstRenamingRule,const QString &otherRenamingRule); + void setMoveTheWholeFolder(const bool &moveTheWholeFolder); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + void setRsync(const bool rsync); + #endif +signals: + void fileTransfer(const QFileInfo &source,const QFileInfo &destination,const Ultracopier::CopyMode &mode) const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; + void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) const; + void errorOnFolder(const QFileInfo &fileInfo,const QString &errorString,const ErrorType &errorType=ErrorType_FolderWithRety) const; + void finishedTheListing() const; + + void newFolderListing(const QString &path) const; + void addToMkPath(const QFileInfo& source,const QFileInfo& destination, const int& inode) const; + void addToMovePath(const QFileInfo& source,const QFileInfo& destination, const int& inodeToRemove) const; + void addToRealMove(const QFileInfo& source,const QFileInfo& destination) const; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + void addToRmForRsync(const QFileInfo& destination) const; + #endif +public slots: + void addToList(const QStringList& sources,const QString& destination); + void setFilters(const QList &include,const QList &exclude); + void setCopyListOrder(const bool &order); + void set_updateMount(); +protected: + void run(); +private: + DriveManagement driveManagement; + bool moveTheWholeFolder; + QStringList sources; + QString destination; + volatile bool stopIt; + void listFolder(QFileInfo source, QFileInfo destination); + bool isBlackListed(const QFileInfo &destination); + QFileInfo resolvDestination(const QFileInfo &destination); + volatile bool stopped; + QSemaphore waitOneAction; + FolderExistsAction folderExistsAction; + FileErrorAction fileErrorAction; + volatile bool checkDestinationExists; + QString newName; + bool copyListOrder; + QRegularExpression folder_isolation; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + bool rsync; + #endif + Ultracopier::CopyMode mode; + QList include,exclude; + QList include_send,exclude_send; + bool reloadTheNewFilters; + bool haveFilters; + QMutex filtersMutex; + QString firstRenamingRule; + QString otherRenamingRule; + QStringList blackList; + /** Parse the multiple wildcard source, it allow resolv multiple wildcard with Qt into their path + * The string: /toto/f*a/yy*a/toto.mp3 + * Will give: /toto/f1a/yy*a/toto.mp3, /toto/f2a/yy*a/toto.mp3 + * Will give: /toto/f2a/yy1a/toto.mp3, /toto/f2a/yy2a/toto.mp3 + */ + QStringList parseWildcardSources(const QStringList &sources) const; + + static QString text_slash; + static QString text_antislash; + static QString text_dot; +}; + +#endif // SCANFILEORFOLDER_H diff --git a/plugins/CopyEngine/Ultracopier/StructEnumDefinition.h b/plugins/CopyEngine/Ultracopier/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins/CopyEngine/Ultracopier/StructEnumDefinition_CopyEngine.h b/plugins/CopyEngine/Ultracopier/StructEnumDefinition_CopyEngine.h new file mode 100644 index 0000000..0b23c29 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/StructEnumDefinition_CopyEngine.h @@ -0,0 +1,124 @@ +/** \file StructEnumDefinition_CopyEngine.h +\brief Define the structure and enumeration used in the copy engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include + +#ifndef STRUCTDEF_COPYENGINE_H +#define STRUCTDEF_COPYENGINE_H + +/// \brief Define action if file exists +enum FileExistsAction +{ + FileExists_NotSet=0, + FileExists_Cancel=1, + FileExists_Skip=2, + FileExists_Overwrite=3, + FileExists_OverwriteIfNotSame=4, + FileExists_OverwriteIfNewer=5, + FileExists_OverwriteIfOlder=6, + FileExists_Rename=7 +}; + +/// \brief Define action if file error +enum FileErrorAction +{ + FileError_NotSet=1, + FileError_Cancel=2, + FileError_Skip=3, + FileError_Retry=4, + FileError_PutToEndOfTheList=5 +}; + +enum TransferAlgorithm +{ + TransferAlgorithm_Automatic=0, + TransferAlgorithm_Sequential=1, + TransferAlgorithm_Parallel=2 +}; + +/// \brief to have the transfer status +enum TransferStat +{ + TransferStat_Idle=0, + TransferStat_PreOperation=1, + TransferStat_WaitForTheTransfer=2, + TransferStat_Transfer=3, + TransferStat_Checksum=4, + TransferStat_PostTransfer=5, + TransferStat_PostOperation=6 +}; + +/// \brief Define overwrite mode +/*enum OverwriteMode +{ + OverwriteMode_None, + OverwriteMode_Overwrite, + OverwriteMode_OverwriteIfNewer, + OverwriteMode_OverwriteIfNotSameModificationDate +};*/ + +/// \brief Define action if file exists +enum FolderExistsAction +{ + FolderExists_NotSet=0, + FolderExists_Cancel=1, + FolderExists_Merge=2, + FolderExists_Skip=3, + FolderExists_Rename=4 +}; + +enum ErrorType +{ + ErrorType_Normal=0, + ErrorType_Folder=1, + ErrorType_FolderWithRety=2, + ErrorType_Rights=3 +}; + +enum SearchType +{ + SearchType_rawText=0, + SearchType_simpleRegex=1, + SearchType_perlRegex=2 +}; + +enum ApplyOn +{ + ApplyOn_file=0, + ApplyOn_fileAndFolder=1, + ApplyOn_folder=2 +}; + +/** to store into different way the filter rules to be exported */ +struct Filters_rules +{ + QString search_text; + SearchType search_type; + ApplyOn apply_on; + bool need_match_all; + QRegularExpression regex; +}; + +/// \brief get action type +enum ActionType +{ + ActionType_MkPath=1, + ActionType_MovePath=2, + ActionType_RealMove=3 + #ifdef ULTRACOPIER_PLUGIN_RSYNC + , + ActionType_RmSync=4 + #endif +}; + +struct Diskspace +{ + QString drive; + quint64 requiredSpace; + quint64 freeSpace; +}; + +#endif // STRUCTDEF_COPYENGINE_H diff --git a/plugins/CopyEngine/Ultracopier/TransferThread.cpp b/plugins/CopyEngine/Ultracopier/TransferThread.cpp new file mode 100644 index 0000000..1ae0a9d --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/TransferThread.cpp @@ -0,0 +1,2081 @@ +//presume bug linked as multple paralelle inode to resume after "overwrite" +//then do overwrite node function to not re-set the file name + +#include "TransferThread.h" +#ifdef Q_OS_WIN32 +#include +#endif + +#ifdef Q_OS_WIN32 + #ifndef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include + #endif +#endif + +TransferThread::TransferThread() : + haveStartTime (false), + transfer_stat (TransferStat_Idle), + doRightTransfer (false), + #ifdef ULTRACOPIER_PLUGIN_RSYNC + rsync (false), + #endif + stopIt (false), + fileExistsAction (FileExists_NotSet), + alwaysDoFileExistsAction (FileExists_NotSet), + needSkip (false), + needRemove (false), + deletePartiallyTransferredFiles (true), + writeError (false), + readError (false), + renameTheOriginalDestination (false) +{ + start(); + moveToThread(this); + readThread.setWriteThread(&writeThread); + source.setCaching(false); + destination.setCaching(false); + renameRegex=QRegularExpression(QStringLiteral("^(.*)(\\.[a-z0-9]+)$")); + #ifdef Q_OS_WIN32 + #ifndef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + regRead=QRegularExpression(QStringLiteral("^[a-z]:")); + #endif + #endif + + minTime=QDateTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); +} + +TransferThread::~TransferThread() +{ + stopIt=true; + readThread.exit(); + readThread.wait(); + writeThread.exit(); + writeThread.wait(); + exit(); + //else cash without this disconnect + //disconnect(&readThread); + //disconnect(&writeThread); + wait(); +} + +void TransferThread::run() +{ + //ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start: ")+QString::number((qint64)QThread::currentThreadId()))); + transfer_stat = TransferStat_Idle; + stopIt = false; + fileExistsAction = FileExists_NotSet; + alwaysDoFileExistsAction= FileExists_NotSet; + //the error push + connect(&readThread,&ReadThread::error, this, &TransferThread::getReadError, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::error, this, &TransferThread::getWriteError, Qt::QueuedConnection); + //the thread change operation + connect(this,&TransferThread::internalStartPreOperation, this, &TransferThread::preOperation, Qt::QueuedConnection); + connect(this,&TransferThread::internalStartPostOperation, this, &TransferThread::postOperation, Qt::QueuedConnection); + //the state change operation + connect(&readThread,&ReadThread::opened, this, &TransferThread::readIsReady, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::opened, this, &TransferThread::writeIsReady, Qt::QueuedConnection); + connect(&readThread,&ReadThread::readIsStopped, this, &TransferThread::readIsStopped, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::writeIsStopped, this, &TransferThread::writeIsStopped, Qt::QueuedConnection); + connect(&readThread,&ReadThread::readIsStopped, &writeThread, &WriteThread::endIsDetected, Qt::QueuedConnection); + connect(&readThread,&ReadThread::closed, this, &TransferThread::readIsClosed, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::closed, this, &TransferThread::writeIsClosed, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::reopened, this, &TransferThread::writeThreadIsReopened, Qt::QueuedConnection); + connect(&readThread,&ReadThread::checksumFinish, this, &TransferThread::readChecksumFinish, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::checksumFinish, this, &TransferThread::writeChecksumFinish, Qt::QueuedConnection); + //error management + connect(&readThread,&ReadThread::isSeekToZeroAndWait, this, &TransferThread::readThreadIsSeekToZeroAndWait, Qt::QueuedConnection); + connect(&readThread,&ReadThread::resumeAfterErrorByRestartAtTheLastPosition,this, &TransferThread::readThreadResumeAfterError, Qt::QueuedConnection); + connect(&readThread,&ReadThread::resumeAfterErrorByRestartAll,&writeThread, &WriteThread::flushAndSeekToZero, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::flushedAndSeekedToZero, this, &TransferThread::readThreadResumeAfterError, Qt::QueuedConnection); + connect(this,&TransferThread::internalTryStartTheTransfer, this, &TransferThread::internalStartTheTransfer, Qt::QueuedConnection); + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&readThread,&ReadThread::debugInformation, this, &TransferThread::debugInformation, Qt::QueuedConnection); + connect(&writeThread,&WriteThread::debugInformation, this, &TransferThread::debugInformation, Qt::QueuedConnection); + connect(&driveManagement,&DriveManagement::debugInformation,this, &TransferThread::debugInformation, Qt::QueuedConnection); + #endif + + exec(); +} + +TransferStat TransferThread::getStat() const +{ + return transfer_stat; +} + +void TransferThread::startTheTransfer() +{ + emit internalTryStartTheTransfer(); +} + +void TransferThread::internalStartTheTransfer() +{ + if(transfer_stat==TransferStat_Idle) + { + if(mode!=Ultracopier::Move) + { + /// \bug can pass here because in case of direct move on same media, it return to idle stat directly + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] can't start transfert at idle")); + } + return; + } + if(transfer_stat==TransferStat_PostOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] can't start transfert at PostOperation")); + return; + } + if(transfer_stat==TransferStat_Transfer) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] can't start transfert at Transfer")); + return; + } + if(canStartTransfer) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] canStartTransfer is already set to true")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] check how start the transfer")); + canStartTransfer=true; + if(readIsReadyVariable && writeIsReadyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start directly the transfer")); + ifCanStartTransfer(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start the transfer as delayed")); +} + +bool TransferThread::setFiles(const QFileInfo& source,const qint64 &size,const QFileInfo& destination,const Ultracopier::CopyMode &mode) +{ + if(transfer_stat!=TransferStat_Idle) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] already used, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()); + return false; + } + //to prevent multiple file alocation into ListThread::doNewActions_inode_manipulation() + transfer_stat = TransferStat_PreOperation; + //emit pushStat(stat,transferId); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()); + this->source = source; + this->destination = destination; + this->mode = mode; + this->size = size; + stopIt = false; + fileExistsAction = FileExists_NotSet; + canStartTransfer = false; + sended_state_preOperationStopped= false; + canBeMovedDirectlyVariable = false; + canBeCopiedDirectlyVariable = false; + fileContentError = false; + real_doChecksum = false; + writeError = false; + writeError_source_seeked = false; + writeError_destination_reopened = false; + readError = false; + fileContentError = false; + resetExtraVariable(); + emit internalStartPreOperation(); + return true; +} + +void TransferThread::setFileExistsAction(const FileExistsAction &action) +{ + if(transfer_stat!=TransferStat_PreOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] already used, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] action: ")+QString::number(action)); + if(action!=FileExists_Rename) + fileExistsAction = action; + else + { + //always rename pass here + fileExistsAction = action; + alwaysDoFileExistsAction=action; + } + if(action==FileExists_Skip) + { + skip(); + return; + } + resetExtraVariable(); + emit internalStartPreOperation(); +} + +void TransferThread::setFileRename(const QString &nameForRename) +{ + if(transfer_stat!=TransferStat_PreOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] already used, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()); + return; + } + if(nameForRename.contains(QRegularExpression(QStringLiteral("[/\\\\\\*]")))) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] can't use this kind of name, internal error")); + emit errorOnFile(destination,tr("Try rename with using special characters")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] nameForRename: ")+nameForRename); + if(!renameTheOriginalDestination) + destination.setFile(destination.absolutePath()+QDir::separator()+nameForRename); + else + { + QString tempDestination=destination.absoluteFilePath(); + QFile destinationFile(tempDestination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("rename %1: to: %2").arg(destination.absoluteFilePath()).arg(destination.absolutePath()+QDir::separator()+nameForRename)); + if(!destinationFile.rename(destination.absolutePath()+QDir::separator()+nameForRename)) + { + if(!destinationFile.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("source not exists %1: destination: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString())); + emit errorOnFile(destinationFile,tr("File not found")); + return; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("unable to do real move %1: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString())); + emit errorOnFile(destinationFile,destinationFile.errorString()); + return; + } + if(source.absoluteFilePath()==destination.absoluteFilePath()) + source.setFile(destination.absolutePath()+QDir::separator()+nameForRename); + destination.setFile(tempDestination); + destination.refresh(); + } + fileExistsAction = FileExists_NotSet; + resetExtraVariable(); + emit internalStartPreOperation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("destination is: %1").arg(destination.absoluteFilePath())); +} + +void TransferThread::setAlwaysFileExistsAction(const FileExistsAction &action) +{ + //ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] action to do always: ")+QString::number(action))); + alwaysDoFileExistsAction=action; +} + +void TransferThread::resetExtraVariable() +{ + sended_state_preOperationStopped=false; + sended_state_readStopped = false; + sended_state_writeStopped = false; + writeError = false; + readError = false; + readIsReadyVariable = false; + writeIsReadyVariable = false; + readIsFinishVariable = false; + writeIsFinishVariable = false; + readIsClosedVariable = false; + writeIsClosedVariable = false; + needRemove = false; + needSkip = false; + retry = false; + readIsOpenVariable = false; + writeIsOpenVariable = false; + readIsOpeningVariable = false; + writeIsOpeningVariable = false; +} + +void TransferThread::preOperation() +{ + if(transfer_stat!=TransferStat_PreOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] already used, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()); + return; + } + haveStartTime=true; + startTransferTime.restart(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start: source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()); + needRemove=false; + if(isSame()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] is same ")+source.absoluteFilePath()+QStringLiteral(" than ")+destination.absoluteFilePath()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] after is same")); + /*Why this code? + if(readError) + { + readError=false; + return; + }*/ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] before destination exists")); + if(destinationExists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] destination exists: ")+destination.absoluteFilePath()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] after destination exists")); + /*Why this code? + if(readError) + { + readError=false; + return; + }*/ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] before keep date")); + #ifdef Q_OS_WIN32 + doTheDateTransfer=!source.isSymLink(); + #else + doTheDateTransfer=true; + #endif + if(doTheDateTransfer) + { + if(source.lastModified()=")+source.lastModified().toString(QStringLiteral("dd.MM.yyyy hh:mm:ss.zzz"))); + doTheDateTransfer=false; + if(keepDate) + { + emit errorOnFile(source,tr("Wrong modification date or unable to get it, you can disable time transfer to do it")); + return; + } + } + } + else + { + doTheDateTransfer=readFileDateTime(source); + #ifdef Q_OS_MAC + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] read the source time: ")+QString::number(butime.modtime)); + #endif + if(!doTheDateTransfer) + { + //will have the real error at source open + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] unable to read the source time: ")+source.absoluteFilePath()); + if(keepDate) + { + emit errorOnFile(source,tr("Wrong modification date or unable to get it, you can disable time transfer to do it")); + return; + } + } + } + } + if(canBeMovedDirectly()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("need moved directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + canBeMovedDirectlyVariable=true; + readThread.fakeOpen(); + writeThread.fakeOpen(); + return; + } + if(canBeCopiedDirectly()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("need copied directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + canBeCopiedDirectlyVariable=true; + readThread.fakeOpen(); + writeThread.fakeOpen(); + return; + } + tryOpen(); +} + +void TransferThread::tryOpen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start source and destination: ")+source.absoluteFilePath()+QStringLiteral(" and ")+destination.absoluteFilePath()); + TransferAlgorithm transferAlgorithm=this->transferAlgorithm; + if(transferAlgorithm==TransferAlgorithm_Automatic) + { + #ifdef Q_OS_LINUX + if(driveManagement.isSameDrive(destination.absoluteFilePath(),source.absoluteFilePath())) + { + const QByteArray &type=driveManagement.getDriveType(driveManagement.getDrive(source.absoluteFilePath())); + if(type=="nfs" || type=="smb") + transferAlgorithm=TransferAlgorithm_Parallel; + else + transferAlgorithm=TransferAlgorithm_Sequential; + } + else + #endif + transferAlgorithm=TransferAlgorithm_Parallel; + } + if(!readIsOpenVariable) + { + if(!readIsOpeningVariable) + { + readError=false; + readThread.open(source.absoluteFilePath(),mode); + readIsOpeningVariable=true; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("readIsOpeningVariable is true when try open")); + emit errorOnFile(source,tr("Internal error: Already opening")); + readError=true; + return; + } + } + if(!writeIsOpenVariable) + { + if(!writeIsOpeningVariable) + { + if(transferAlgorithm==TransferAlgorithm_Sequential) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] transferAlgorithm==TransferAlgorithm_Sequential")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] transferAlgorithm==TransferAlgorithm_Parallel")); + writeError=false; + if(transferAlgorithm==TransferAlgorithm_Sequential) + writeThread.open(destination.absoluteFilePath(),size,osBuffer && (!osBufferLimited || (osBufferLimited && sizesource.lastModified()) + return false; + else + { + transfer_stat=TransferStat_Idle; + emit postOperationStopped(); + return true; + } + } + if(fileExistsAction==FileExists_OverwriteIfNotSame || (fileExistsAction==FileExists_NotSet && alwaysDoFileExistsAction==FileExists_OverwriteIfNotSame)) + { + if(destination.lastModified()!=source.lastModified() || destination.size()!=source.size()) + return false; + else + { + transfer_stat=TransferStat_Idle; + emit postOperationStopped(); + return true; + } + } + } + else + { + if(fileExistsAction!=FileExists_NotSet) + { + transfer_stat=TransferStat_Idle; + emit postOperationStopped(); + return true; + } + } + if(fileExistsAction==FileExists_NotSet) + { + emit fileAlreadyExists(source,destination,false); + return true; + } + } + return false; +} + +QString TransferThread::resolvedName(const QFileInfo &inode) +{ + QString fileName=inode.fileName(); + if(fileName.isEmpty()) + { + QDir absoluteDir=inode.absoluteDir(); + fileName=absoluteDir.dirName(); + if(fileName.isEmpty()) + { + fileName=absoluteDir.cdUp(); + fileName=absoluteDir.dirName(); + } + } + #ifdef Q_OS_WIN32 + if(fileName.isEmpty()) + { + fileName=inode.absolutePath(); + fileName.replace(QRegularExpression(QStringLiteral("^([a-zA-Z]+):.*$")),QStringLiteral("\\1")); + if(inode.absolutePath().contains(QRegularExpression(QStringLiteral("^[a-zA-Z]+:[/\\\\]?$")))) + fileName=tr("Drive %1").arg(fileName); + else + fileName=tr("Unknown folder"); + } + #else + if(fileName.isEmpty()) + fileName=tr("root"); + #endif + return fileName; +} + +QString TransferThread::getSourcePath() const +{ + return source.absoluteFilePath(); +} + +QString TransferThread::getDestinationPath() const +{ + return destination.absoluteFilePath(); +} + +QFileInfo TransferThread::getSourceInode() const +{ + return source; +} + +QFileInfo TransferThread::getDestinationInode() const +{ + return destination; +} + +Ultracopier::CopyMode TransferThread::getMode() const +{ + return mode; +} + +//return true if has been renamed +bool TransferThread::checkAlwaysRename() +{ + if(alwaysDoFileExistsAction==FileExists_Rename) + { + QFileInfo newDestination=destination; + QString fileName=resolvedName(newDestination); + QString suffix=QStringLiteral(""); + QString newFileName; + //resolv the suffix + if(fileName.contains(renameRegex)) + { + suffix=fileName; + suffix.replace(renameRegex,QStringLiteral("\\2")); + fileName.replace(renameRegex,QStringLiteral("\\1")); + } + //resolv the new name + int num=1; + do + { + if(num==1) + { + if(firstRenamingRule.isEmpty()) + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=firstRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + } + } + else + { + if(otherRenamingRule.isEmpty()) + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=otherRenamingRule; + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + newDestination.setFile(newDestination.absolutePath()+QDir::separator()+newFileName+suffix); + num++; + } + while(newDestination.exists()); + if(!renameTheOriginalDestination) + destination=newDestination; + else + { + QFile destinationFile(destination.absoluteFilePath()); + if(!destinationFile.rename(newDestination.absoluteFilePath())) + { + if(!destinationFile.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("source not exists %1: destination: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString())); + emit errorOnFile(destinationFile,tr("File not found")); + readError=true; + return true; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("unable to do real move %1: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString())); + readError=true; + emit errorOnFile(destinationFile,destinationFile.errorString()); + return true; + } + } + return true; + } + return false; +} + +void TransferThread::tryMoveDirectly() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("need moved directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + + sended_state_readStopped = false; + sended_state_writeStopped = false; + writeError = false; + readError = false; + readIsFinishVariable = false; + writeIsFinishVariable = false; + readIsClosedVariable = false; + writeIsClosedVariable = false; + //move if on same mount point + QFile sourceFile(source.absoluteFilePath()); + QFile destinationFile(destination.absoluteFilePath()); + #ifndef Q_OS_WIN32 + if(destinationFile.exists() || destination.isSymLink()) + { + if(!sourceFile.exists() && !source.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+destinationFile.fileName()+QStringLiteral(", source not exists")); + readError=true; + emit errorOnFile(destination,tr("The source file doesn't exist")); + return; + } + else if(!destinationFile.remove()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+destinationFile.fileName()+QStringLiteral(", error: ")+destinationFile.errorString()); + readError=true; + emit errorOnFile(destination,destinationFile.errorString()); + return; + } + } + #endif + QDir dir(destination.absolutePath()); + { + mkpathTransfer->acquire(); + if(!dir.exists()) + dir.mkpath(destination.absolutePath()); + mkpathTransfer->release(); + } + #ifdef Q_OS_WIN32 + //if(!sourceFile.copy(destinationFile.fileName())) + if(MoveFileEx( + reinterpret_cast(sourceFile.fileName().utf16()), + reinterpret_cast(destinationFile.fileName().utf16()), + MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING + )==0) + #else + if(!sourceFile.rename(destinationFile.fileName())) + #endif + { + readError=true; + if(!sourceFile.exists() && !source.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("source not exists %1: destination: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); + emit errorOnFile(sourceFile,tr("File not found")); + return; + } + else if(!dir.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("destination folder not exists %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); + emit errorOnFile(destination.absolutePath(),tr("Unable to do the folder")); + return; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("unable to do real move %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString())); + emit errorOnFile(sourceFile,sourceFile.errorString()); + return; + } + readThread.fakeReadIsStarted(); + writeThread.fakeWriteIsStarted(); + readThread.fakeReadIsStopped(); + writeThread.fakeWriteIsStopped(); +} + +void TransferThread::tryCopyDirectly() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("need copied directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath())); + + sended_state_readStopped = false; + sended_state_writeStopped = false; + writeError = false; + readError = false; + readIsFinishVariable = false; + writeIsFinishVariable = false; + readIsClosedVariable = false; + writeIsClosedVariable = false; + //move if on same mount point + QFile sourceFile(source.absoluteFilePath()); + QFile destinationFile(destination.absoluteFilePath()); + #ifndef Q_OS_WIN32 + if(destinationFile.exists() || destination.isSymLink()) + { + if(!sourceFile.exists() && !source.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+destinationFile.fileName()+QStringLiteral(", source not exists")); + readError=true; + emit errorOnFile(destination,tr("The source doesn't exist")); + return; + } + else if(!destinationFile.remove()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+destinationFile.fileName()+QStringLiteral(", error: ")+destinationFile.errorString()); + readError=true; + emit errorOnFile(destination,destinationFile.errorString()); + return; + } + } + #endif + QDir dir(destination.absolutePath()); + { + mkpathTransfer->acquire(); + if(!dir.exists()) + dir.mkpath(destination.absolutePath()); + mkpathTransfer->release(); + } + /** on windows, symLink is normal file, can be copied + * on unix not, should be created **/ + #ifdef Q_OS_WIN32 + //if(!sourceFile.copy(destinationFile.fileName())) + if(CopyFileEx( + reinterpret_cast(sourceFile.fileName().utf16()), + reinterpret_cast(destinationFile.fileName().utf16()), + NULL, + NULL, + FALSE, + 0 + )==0) + #else + if(!QFile::link(sourceFile.symLinkTarget(),destinationFile.fileName())) + #endif + { + readError=true; + if(!sourceFile.exists() && !source.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("source not exists %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget())); + emit errorOnFile(sourceFile,tr("The source file doesn't exist")); + return; + } + else if(destinationFile.exists() || destination.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("destination already exists %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget())); + emit errorOnFile(sourceFile,tr("Another file exists at same place")); + return; + } + else if(!dir.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("destination folder not exists %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget())); + emit errorOnFile(sourceFile,tr("Unable to do the folder")); + return; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("unable to do sym link copy %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget())); + emit errorOnFile(sourceFile,sourceFile.errorString()); + return; + } + readThread.fakeReadIsStarted(); + writeThread.fakeWriteIsStarted(); + readThread.fakeReadIsStopped(); + writeThread.fakeWriteIsStopped(); +} + +bool TransferThread::canBeMovedDirectly() const +{ + if(mode!=Ultracopier::Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("mode!=Ultracopier::Move")); + return false; + } + return source.isSymLink() || driveManagement.isSameDrive(destination.absoluteFilePath(),source.absoluteFilePath()); +} + +bool TransferThread::canBeCopiedDirectly() const +{ + return source.isSymLink(); +} + +void TransferThread::readIsReady() +{ + if(readIsReadyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + readIsReadyVariable=true; + readIsOpenVariable=true; + readIsClosedVariable=false; + readIsOpeningVariable=false; + ifCanStartTransfer(); +} + +void TransferThread::ifCanStartTransfer() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] readIsReadyVariable: ")+QString::number(readIsReadyVariable)+QStringLiteral(", writeIsReadyVariable: ")+QString::number(writeIsReadyVariable)); + if(readIsReadyVariable && writeIsReadyVariable) + { + transfer_stat=TransferStat_WaitForTheTransfer; + sended_state_readStopped = false; + sended_state_writeStopped = false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stat=WaitForTheTransfer")); + if(!sended_state_preOperationStopped) + { + sended_state_preOperationStopped=true; + emit preOperationStopped(); + } + if(canStartTransfer) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stat=Transfer, ")+QStringLiteral("canBeMovedDirectlyVariable: %1, canBeCopiedDirectlyVariable: %2").arg(canBeMovedDirectlyVariable).arg(canBeCopiedDirectlyVariable)); + transfer_stat=TransferStat_Transfer; + if(canBeMovedDirectlyVariable) + tryMoveDirectly(); + else if(canBeCopiedDirectlyVariable) + tryCopyDirectly(); + else + { + needRemove=deletePartiallyTransferredFiles; + readThread.startRead(); + } + emit pushStat(transfer_stat,transferId); + } + //else + //emit pushStat(stat,transferId); + } +} + +void TransferThread::writeIsReady() +{ + if(writeIsReadyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + writeIsReadyVariable=true; + writeIsOpenVariable=true; + writeIsClosedVariable=false; + writeIsOpeningVariable=false; + ifCanStartTransfer(); +} + + +//set the copy info and options before runing +void TransferThread::setRightTransfer(const bool doRightTransfer) +{ + this->doRightTransfer=doRightTransfer; +} + +//set keep date +void TransferThread::setKeepDate(const bool keepDate) +{ + this->keepDate=keepDate; +} + +#ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT +//set the current max speed in KB/s +void TransferThread::setMultiForBigSpeed(const int &multiForBigSpeed) +{ + readThread.setMultiForBigSpeed(multiForBigSpeed); + writeThread.setMultiForBigSpeed(multiForBigSpeed); +} +#endif + +//set block size in Bytes +bool TransferThread::setBlockSize(const unsigned int blockSize) +{ + bool read=readThread.setBlockSize(blockSize); + bool write=writeThread.setBlockSize(blockSize); + return (read && write); +} + +//pause the copy +void TransferThread::pause() +{ + //only pause/resume during the transfer of file data + //from transfer_stat!=TransferStat_Idle because it resume at wrong order + if(transfer_stat!=TransferStat_Transfer && transfer_stat!=TransferStat_PostTransfer && transfer_stat!=TransferStat_Checksum) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] wrong stat to put in pause")); + return; + } + haveStartTime=false; + readThread.pause(); + writeThread.pause(); +} + +//resume the copy +void TransferThread::resume() +{ + //only pause/resume during the transfer of file data + //from transfer_stat!=TransferStat_Idle because it resume at wrong order + if(transfer_stat!=TransferStat_Transfer && transfer_stat!=TransferStat_PostTransfer && transfer_stat!=TransferStat_Checksum) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] wrong stat to put in pause")); + return; + } + readThread.resume(); + writeThread.resume(); +} + +//stop the current copy +void TransferThread::stop() +{ + stopIt=true; + haveStartTime=false; + if(transfer_stat==TransferStat_Idle) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("transfer_stat==TransferStat_Idle")); + return; + } + if(remainSourceOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("remainSourceOpen()")); + readThread.stop(); + } + if(remainDestinationOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("remainDestinationOpen()")); + writeThread.stop(); + } + if(!remainFileOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("transfer_stat==TransferStat_Idle")); + if(needRemove && source.absoluteFilePath()!=destination.absoluteFilePath()) + { + if(source.exists()) + QFile(destination.absoluteFilePath()).remove(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try destroy the destination when the source don't exists")); + } + transfer_stat=TransferStat_PostOperation; + emit internalStartPostOperation(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("transfer_stat==%1 && remainFileOpen()").arg(transfer_stat)); +} + +bool TransferThread::remainFileOpen() const +{ + return remainSourceOpen() || remainDestinationOpen(); +} + +bool TransferThread::remainSourceOpen() const +{ + return (readIsOpenVariable || readIsOpeningVariable) && !readIsClosedVariable; +} + +bool TransferThread::remainDestinationOpen() const +{ + return (writeIsOpenVariable || writeIsOpeningVariable) && !writeIsClosedVariable; +} + +void TransferThread::readIsFinish() +{ + if(readIsFinishVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + readIsFinishVariable=true; + canStartTransfer=false; + //check here if need start checksuming or not + real_doChecksum=doChecksum && (!checksumOnlyOnError || fileContentError) && (!canBeMovedDirectlyVariable && !canBeCopiedDirectlyVariable); + if(real_doChecksum) + { + readIsFinishVariable=false; + transfer_stat=TransferStat_Checksum; + sourceChecksum=QByteArray(); + destinationChecksum=QByteArray(); + readThread.startCheckSum(); + } + else + { + transfer_stat=TransferStat_PostTransfer; + if(!needSkip || (canBeCopiedDirectlyVariable || canBeMovedDirectlyVariable))//if skip, stop call, then readIsClosed() already call + readThread.postOperation(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] in skip, don't start postOperation")); + } + emit pushStat(transfer_stat,transferId); +} + +void TransferThread::writeIsFinish() +{ + if(writeIsFinishVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + writeIsFinishVariable=true; + //check here if need start checksuming or not + if(real_doChecksum) + { + writeIsFinishVariable=false; + transfer_stat=TransferStat_Checksum; + writeThread.startCheckSum(); + } + else + { + if(!needSkip || (canBeCopiedDirectlyVariable || canBeMovedDirectlyVariable))//if skip, stop call, then writeIsClosed() already call + writeThread.postOperation(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] in skip, don't start postOperation")); + } +} + +void TransferThread::readChecksumFinish(const QByteArray& checksum) +{ + sourceChecksum=checksum; + compareChecksum(); +} + +void TransferThread::writeChecksumFinish(const QByteArray& checksum) +{ + destinationChecksum=checksum; + compareChecksum(); +} + +void TransferThread::compareChecksum() +{ + if(sourceChecksum.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] the checksum of source is missing")); + return; + } + if(destinationChecksum.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] the checksum of destination is missing")); + return; + } + if(sourceChecksum==destinationChecksum) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] the checksum match")); + readThread.postOperation(); + writeThread.postOperation(); + transfer_stat=TransferStat_PostTransfer; + emit pushStat(transfer_stat,transferId); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] the checksum not match")); + //emit error here, and wait to resume + emit errorOnFile(destination,tr("The checksums do not match")); + } +} + +void TransferThread::readIsClosed() +{ + if(readIsClosedVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + readIsClosedVariable=true; + readIsOpeningVariable=false; + checkIfAllIsClosedAndDoOperations(); +} + +void TransferThread::writeIsClosed() +{ + if(writeIsClosedVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + writeIsClosedVariable=true; + writeIsOpeningVariable=false; + if(stopIt && needRemove && source.absoluteFilePath()!=destination.absoluteFilePath()) + { + if(source.exists()) + QFile(destination.absoluteFilePath()).remove(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try destroy the destination when the source don't exists")); + } + checkIfAllIsClosedAndDoOperations(); +} + +// return true if all is closed, and do some operations, don't use into condition to check if is closed! +bool TransferThread::checkIfAllIsClosedAndDoOperations() +{ + if((readError || writeError) && !needSkip && !stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] resolve error before progress")); + return false; + } + if(!remainFileOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] emit internalStartPostOperation() to do the real post operation")); + transfer_stat=TransferStat_PostOperation; + //emit pushStat(stat,transferId); + emit internalStartPostOperation(); + return true; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("wait self close: readIsReadyVariable: %1, readIsClosedVariable: %2, writeIsReadyVariable: %3, writeIsClosedVariable: %4") + .arg(readIsReadyVariable) + .arg(readIsClosedVariable) + .arg(writeIsReadyVariable) + .arg(writeIsClosedVariable) + ); + return false; + } +} + +/// \todo found way to retry that's +/// \todo the rights copy +void TransferThread::postOperation() +{ + if(transfer_stat!=TransferStat_PostOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] need be in transfer, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()+QStringLiteral(", stat:")+QString::number(transfer_stat)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + //all except closing + if((readError || writeError) && !needSkip && !stopIt)//normally useless by checkIfAllIsFinish() + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] resume after error")); + return; + } + + if(!needSkip && !stopIt) + { + if(!canBeCopiedDirectlyVariable && !canBeMovedDirectlyVariable) + { + if(writeIsOpenVariable && !writeIsClosedVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] can't pass in post operation if write is not closed")); + emit errorOnFile(destination,tr("Internal error: The destination is not closed")); + needSkip=false; + if(deletePartiallyTransferredFiles) + needRemove=true; + writeError=true; + return; + } + if(readThread.getLastGoodPosition()!=writeThread.getLastGoodPosition()) + { + writeThread.flushBuffer(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] readThread.getLastGoodPosition(%1)!=writeThread.getLastGoodPosition(%2)") + .arg(readThread.getLastGoodPosition()) + .arg(writeThread.getLastGoodPosition()) + ); + emit errorOnFile(destination,tr("Internal error: The size transfered doesn't match")); + needSkip=false; + if(deletePartiallyTransferredFiles) + needRemove=true; + writeError=true; + return; + } + if(!writeThread.bufferIsEmpty()) + { + writeThread.flushBuffer(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] buffer is not empty")); + emit errorOnFile(destination,tr("Internal error: The buffer is not empty")); + needSkip=false; + if(deletePartiallyTransferredFiles) + needRemove=true; + writeError=true; + return; + } + } + + if(!doFilePostOperation()) + return; + + //remove source in moving mode + if(mode==Ultracopier::Move && !canBeMovedDirectlyVariable) + { + if(destination.exists() && destination.isFile()) + { + QFile sourceFile(source.absoluteFilePath()); + if(!sourceFile.remove()) + { + needSkip=false; + emit errorOnFile(source,sourceFile.errorString()); + return; + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try remove source but destination not exists!")); + } + } + else//do difference skip a file and skip this error case + { + if(needRemove && destination.exists() && source.exists() && source.absoluteFilePath()!=destination.absoluteFilePath() && destination.isFile()) + { + QFile destinationFile(destination.absoluteFilePath()); + if(!destinationFile.remove()) + { + //emit errorOnFile(source,destinationFile.errorString()); + //return; + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try remove destination but not exists!")); + } + source.setFile(QStringLiteral("")); + destination.setFile(QStringLiteral("")); + //don't need remove because have correctly finish (it's not in: have started) + needRemove=false; + needSkip=false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] emit postOperationStopped()")); + transfer_stat=TransferStat_Idle; + emit postOperationStopped(); +} + +bool TransferThread::doFilePostOperation() +{ + //do operation needed by copy + //set the time if no write thread used + + destination.refresh(); + if(!destination.exists() && !destination.isSymLink()) + { + if(!stopIt) + if(/*true when the destination have been remove but not the symlink:*/!source.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to change the date: File not found")); + emit errorOnFile(destination,tr("Unable to change the date")+QStringLiteral(": ")+tr("File not found")); + return false; + } + } + else + { + if(doTheDateTransfer) + { + if(!writeFileDateTime(destination)) + { + if(!destination.isFile()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to change the date (is not a file)")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to change the date")); + /* error with virtual folder under windows */ + #ifndef Q_OS_WIN32 + if(keepDate) + { + emit errorOnFile(destination,tr("Unable to change the date")); + return false; + } + #endif + } + else + { + #ifndef Q_OS_WIN32 + destination.refresh(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] read the destination time: ")+destination.lastModified().toString()); + if(destination.lastModified() recheck all, because can be an error into isSame(), rename(), ... + return; + } + //data streaming error + if(transfer_stat!=TransferStat_PostOperation && transfer_stat!=TransferStat_Transfer && transfer_stat!=TransferStat_PostTransfer && transfer_stat!=TransferStat_Checksum) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] is not in right stat, source: ")+source.absoluteFilePath()+QStringLiteral(", destination: ")+destination.absoluteFilePath()+QStringLiteral(", stat: ")+QString::number(transfer_stat)); + return; + } + if(transfer_stat==TransferStat_PostOperation) + { + if(readError || writeError) + { + readError=false; + //writeError=false; + resumeTransferAfterWriteError(); + writeThread.flushBuffer(); + transfer_stat=TransferStat_PreOperation; + emit internalStartPreOperation(); + return; + } + emit internalStartPostOperation(); + return; + } + if(canBeMovedDirectlyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] retry the system move")); + tryMoveDirectly(); + return; + } + if(canBeCopiedDirectlyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] retry the copy directly")); + tryCopyDirectly(); + return; + } + if(transfer_stat==TransferStat_Checksum) + { + if(writeError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start and resume the write error")); + writeThread.reopen(); + } + else if(readError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start and resume the read error")); + readThread.reopen(); + } + else //only checksum difference + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] retry all the transfer")); + canStartTransfer=true; + ifCanStartTransfer(); + } + return; + } + //can have error on source and destination at the same time + if(writeError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start and resume the write error: ")+QString::number(readError)); + if(readError) + readThread.reopen(); + else + { + readIsClosedVariable=false; + readThread.seekToZeroAndWait(); + } + writeThread.reopen(); + } + if(readError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start and resume the read error")); + readThread.reopen(); + } + if(!writeError && !readError) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] unknow error resume")); +} + +void TransferThread::writeThreadIsReopened() +{ + if(writeError_destination_reopened) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + writeError_destination_reopened=true; + if(transfer_stat==TransferStat_Checksum) + { + writeThread.startCheckSum(); + return; + } + if(writeError_source_seeked && writeError_destination_reopened) + resumeTransferAfterWriteError(); +} + +void TransferThread::readThreadIsSeekToZeroAndWait() +{ + if(writeError_source_seeked) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + writeError_source_seeked=true; + if(writeError_source_seeked && writeError_destination_reopened) + resumeTransferAfterWriteError(); +} + +void TransferThread::resumeTransferAfterWriteError() +{ + writeError=false; +/******************************** + if(canStartTransfer) + readThread.startRead(); +useless, because the open destination event +will restart the transfer as normal +*********************************/ +/********************************* +if(!canStartTransfer) + stat=WaitForTheTransfer; +useless because already do at open event +**********************************/ + //if is in wait + if(!canStartTransfer) + emit checkIfItCanBeResumed(); +} + +void TransferThread::readThreadResumeAfterError() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + readError=false; + writeIsReady(); + readIsReady(); +} + +////////////////////////////////////////////////////////////////// +///////////////////////// Normal event /////////////////////////// +////////////////////////////////////////////////////////////////// + +void TransferThread::readIsStopped() +{ + if(!sended_state_readStopped) + { + sended_state_readStopped=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] emit readIsStopped()")); + emit readStopped(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] drop dual read stopped")); + return; + } + readIsFinish(); +} + +void TransferThread::writeIsStopped() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + if(!sended_state_writeStopped) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] emit writeStopped()")); + sended_state_writeStopped=true; + emit writeStopped(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + writeIsFinish(); +} + +#ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT +void TransferThread::timeOfTheBlockCopyFinished() +{ + readThread.timeOfTheBlockCopyFinished(); + writeThread.timeOfTheBlockCopyFinished(); +} +#endif + +bool TransferThread::setParallelBuffer(const int ¶llelBuffer) +{ + if(parallelBuffer<1 || parallelBuffer>ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] wrong parallelBuffer: ")+QString::number(parallelBuffer)); + return false; + } + else + { + this->parallelBuffer=parallelBuffer; + return true; + } +} + +bool TransferThread::setSequentialBuffer(const int &sequentialBuffer) +{ + if(sequentialBuffer<1 || sequentialBuffer>ULTRACOPIER_PLUGIN_MAX_SEQUENTIAL_NUMBER_OF_BLOCK) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] wrong sequentialBuffer: ")+QString::number(sequentialBuffer)); + return false; + } + else + { + this->sequentialBuffer=sequentialBuffer; + return true; + } +} + +void TransferThread::setTransferAlgorithm(const TransferAlgorithm &transferAlgorithm) +{ + this->transferAlgorithm=transferAlgorithm; + if(transferAlgorithm==TransferAlgorithm_Sequential) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("]transferAlgorithm==TransferAlgorithm_Sequential")); + else if(transferAlgorithm==TransferAlgorithm_Automatic) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("]transferAlgorithm==TransferAlgorithm_Automatic")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("]transferAlgorithm==TransferAlgorithm_Parallel")); +} + +//fonction to edit the file date time +bool TransferThread::readFileDateTime(const QFileInfo &source) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] readFileDateTime(")+source.absoluteFilePath()+QStringLiteral(")")); + if(source.lastModified()ftCreateL=ftCreate.dwLowDateTime; + this->ftCreateH=ftCreate.dwHighDateTime; + this->ftAccessL=ftAccess.dwLowDateTime; + this->ftAccessH=ftAccess.dwHighDateTime; + this->ftWriteL=ftWrite.dwLowDateTime; + this->ftWriteH=ftWrite.dwHighDateTime; + CloseHandle(hFileSouce); + return true; + #endif + #else + return false; + #endif + #endif + return false; +} + +bool TransferThread::writeFileDateTime(const QFileInfo &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] writeFileDateTime(")+destination.absoluteFilePath()+QStringLiteral(")")); + /** Why not do it with Qt? Because it not support setModificationTime(), and get the time with Qt, that's mean use local time where in C is UTC time */ + #ifdef Q_OS_UNIX + #ifdef Q_OS_LINUX + return utime(destination.absoluteFilePath().toLatin1().data(),&butime)==0; + #else //mainly for mac + return utime(destination.absoluteFilePath().toLatin1().data(),&butime)==0; + #endif + #else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + return utime(destination.toLatin1().data(),&butime)==0; + #else + wchar_t filePath[65535]; + if(destination.absoluteFilePath().contains(regRead)) + filePath[QDir::toNativeSeparators(QStringLiteral("\\\\?\\")+destination.absoluteFilePath()).toWCharArray(filePath)]=L'\0'; + else + filePath[QDir::toNativeSeparators(destination.absoluteFilePath()).toWCharArray(filePath)]=L'\0'; + HANDLE hFileDestination = CreateFileW(filePath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + if(hFileDestination == INVALID_HANDLE_VALUE) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] open failed to write: ")+QString::fromWCharArray(filePath)+QStringLiteral(", error: ")+QString::number(GetLastError())); + return false; + } + FILETIME ftCreate, ftAccess, ftWrite; + ftCreate.dwLowDateTime=this->ftCreateL; + ftCreate.dwHighDateTime=this->ftCreateH; + ftAccess.dwLowDateTime=this->ftAccessL; + ftAccess.dwHighDateTime=this->ftAccessH; + ftWrite.dwLowDateTime=this->ftWriteL; + ftWrite.dwHighDateTime=this->ftWriteH; + if(!SetFileTime(hFileDestination, &ftCreate, &ftAccess, &ftWrite)) + { + CloseHandle(hFileDestination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] unable to set the file time")); + return false; + } + CloseHandle(hFileDestination); + return true; + #endif + #else + return false; + #endif + #endif + return false; +} + +//skip the copy +void TransferThread::skip() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start with stat: ")+QString::number(transfer_stat)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] readIsOpeningVariable: ")+QString::number(readIsOpeningVariable)+QStringLiteral(", readIsOpenVariable: ")+QString::number(readIsOpenVariable)+QStringLiteral(", readIsReadyVariable: ")+QString::number(readIsReadyVariable)+QStringLiteral(", readIsFinishVariable: ")+QString::number(readIsFinishVariable)+QStringLiteral(", readIsClosedVariable: ")+QString::number(readIsClosedVariable)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] writeIsOpeningVariable: ")+QString::number(writeIsOpeningVariable)+QStringLiteral(", writeIsOpenVariable: ")+QString::number(writeIsOpenVariable)+QStringLiteral(", writeIsReadyVariable: ")+QString::number(writeIsReadyVariable)+QStringLiteral(", writeIsFinishVariable: ")+QString::number(writeIsFinishVariable)+QStringLiteral(", writeIsClosedVariable: ")+QString::number(writeIsClosedVariable)); + switch(transfer_stat) + { + case TransferStat_WaitForTheTransfer: + //needRemove=true;never put that's here, can product destruction of the file + case TransferStat_PreOperation: + if(needSkip) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] skip already in progress")); + return; + } + needSkip=true; + //check if all is source and destination is closed + if(remainFileOpen()) + { + if(remainSourceOpen()) + readThread.stop(); + if(remainDestinationOpen()) + writeThread.stop(); + } + else // wait nothing, just quit + { + transfer_stat=TransferStat_PostOperation; + emit internalStartPostOperation(); + } + break; + case TransferStat_Transfer: + case TransferStat_PostTransfer: + if(needSkip) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] skip already in progress")); + return; + } + //needRemove=true;never put that's here, can product destruction of the file + needSkip=true; + if(canBeMovedDirectlyVariable || canBeCopiedDirectlyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] Do the direct FS fake close, canBeMovedDirectlyVariable: ")+QString::number(canBeMovedDirectlyVariable)+QStringLiteral(", canBeCopiedDirectlyVariable: ")+QString::number(canBeCopiedDirectlyVariable)); + readThread.fakeReadIsStarted(); + writeThread.fakeWriteIsStarted(); + readThread.fakeReadIsStopped(); + writeThread.fakeWriteIsStopped(); + return; + } + writeThread.flushBuffer(); + if(remainFileOpen()) + { + if(remainSourceOpen()) + readThread.stop(); + if(remainDestinationOpen()) + writeThread.stop(); + } + else // wait nothing, just quit + { + transfer_stat=TransferStat_PostOperation; + emit internalStartPostOperation(); + } + break; + case TransferStat_Checksum: + if(needSkip) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] skip already in progress")); + return; + } + //needRemove=true;never put that's here, can product destruction of the file + needSkip=true; + if(remainFileOpen()) + { + if(remainSourceOpen()) + readThread.stop(); + if(remainDestinationOpen()) + writeThread.stop(); + } + else // wait nothing, just quit + { + transfer_stat=TransferStat_PostOperation; + emit internalStartPostOperation(); + } + break; + case TransferStat_PostOperation: + if(needSkip) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] skip already in progress")); + return; + } + //needRemove=true;never put that's here, can product destruction of the file + needSkip=true; + writeThread.flushBuffer(); + emit internalStartPostOperation(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] can skip in this state: ")+QString::number(transfer_stat)); + return; + } +} + +//return info about the copied size +qint64 TransferThread::copiedSize() +{ + switch(transfer_stat) + { + case TransferStat_Transfer: + case TransferStat_PostOperation: + case TransferStat_PostTransfer: + return (readThread.getLastGoodPosition()+writeThread.getLastGoodPosition())/2; + case TransferStat_Checksum: + return transferSize; + default: + return 0; + } +} + +//retry after error +void TransferThread::putAtBottom() +{ + emit tryPutAtBottom(); +} + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +/// \brief set rsync +void TransferThread::setRsync(const bool rsync) +{ + this->rsync=rsync; +} +#endif + +void TransferThread::set_osBufferLimit(const unsigned int &osBufferLimit) +{ + this->osBufferLimit=osBufferLimit; +} + +#ifdef ULTRACOPIER_PLUGIN_DEBUG +//to set the id +void TransferThread::setId(int id) +{ + this->id=id; + readThread.setId(id); + writeThread.setId(id); +} + +QChar TransferThread::readingLetter() const +{ + switch(readThread.stat) + { + case ReadThread::Idle: + return '_'; + break; + case ReadThread::InodeOperation: + return 'I'; + break; + case ReadThread::Read: + return 'R'; + break; + case ReadThread::WaitWritePipe: + return 'W'; + break; + case ReadThread::Checksum: + return 'S'; + break; + default: + return '?'; + } +} + +QChar TransferThread::writingLetter() const +{ + switch(writeThread.stat) + { + case WriteThread::Idle: + return '_'; + break; + case WriteThread::InodeOperation: + return 'I'; + break; + case WriteThread::Write: + return 'W'; + break; + case WriteThread::Close: + return 'C'; + break; + case WriteThread::Read: + return 'R'; + break; + case WriteThread::Checksum: + return 'S'; + break; + default: + return '?'; + } +} + +#endif + +void TransferThread::setMkpathTransfer(QSemaphore *mkpathTransfer) +{ + this->mkpathTransfer=mkpathTransfer; + writeThread.setMkpathTransfer(mkpathTransfer); +} + +void TransferThread::set_doChecksum(bool doChecksum) +{ + this->doChecksum=doChecksum; +} + +void TransferThread::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) +{ + this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; +} + +void TransferThread::set_checksumOnlyOnError(bool checksumOnlyOnError) +{ + this->checksumOnlyOnError=checksumOnlyOnError; +} + +void TransferThread::set_osBuffer(bool osBuffer) +{ + this->osBuffer=osBuffer; +} + +void TransferThread::set_osBufferLimited(bool osBufferLimited) +{ + this->osBufferLimited=osBufferLimited; +} + +//not copied size, because that's count to the checksum, ... +quint64 TransferThread::realByteTransfered() const +{ + switch(transfer_stat) + { + case TransferStat_Transfer: + case TransferStat_Checksum: + return (readThread.getLastGoodPosition()+writeThread.getLastGoodPosition())/2; + case TransferStat_PostTransfer: + return (readThread.getLastGoodPosition()+writeThread.getLastGoodPosition())/2; + case TransferStat_PostOperation: + return transferSize; + default: + return 0; + } +} + +//first is read, second is write +QPair TransferThread::progression() const +{ + QPair returnVar; + switch(transfer_stat) + { + case TransferStat_Transfer: + returnVar.first=readThread.getLastGoodPosition(); + returnVar.second=writeThread.getLastGoodPosition(); + /*if(returnVar.firstfirstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; +} + +void TransferThread::setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles) +{ + this->deletePartiallyTransferredFiles=deletePartiallyTransferredFiles; +} + +void TransferThread::setRenameTheOriginalDestination(const bool &renameTheOriginalDestination) +{ + this->renameTheOriginalDestination=renameTheOriginalDestination; +} + +void TransferThread::set_updateMount() +{ + driveManagement.tryUpdate(); +} diff --git a/plugins/CopyEngine/Ultracopier/TransferThread.h b/plugins/CopyEngine/Ultracopier/TransferThread.h new file mode 100644 index 0000000..051375e --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/TransferThread.h @@ -0,0 +1,288 @@ +/** \file TransferThread.h +\brief Thread changed to manage the inode operation, the signals, canceling, pre and post operations +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef TRANSFERTHREAD_H +#define TRANSFERTHREAD_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef Q_OS_UNIX + #include + #include + #include + #include +#else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + #include + #include + #include + #include + #endif + #endif +#endif + +#include "ReadThread.h" +#include "WriteThread.h" +#include "Environment.h" +#include "DriveManagement.h" +#include "StructEnumDefinition_CopyEngine.h" + +/// \brief Thread changed to manage the inode operation, the signals, canceling, pre and post operations +class TransferThread : public QThread +{ + Q_OBJECT +public: + explicit TransferThread(); + ~TransferThread(); + /// \brief get transfer stat + TransferStat getStat() const; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief to set the id + void setId(int id); + /// \brief get the reading letter + QChar readingLetter() const; + /// \brief get the writing letter + QChar writingLetter() const; + #endif + /// \brief to have semaphore, and try create just one by one + void setMkpathTransfer(QSemaphore *mkpathTransfer); + /// \brief to store the transfer id + quint64 transferId; + /// \brief to store the transfer size + quint64 transferSize; + bool haveStartTime; + QTime startTransferTime; + + void set_doChecksum(bool doChecksum); + void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); + void set_checksumOnlyOnError(bool checksumOnlyOnError); + void set_osBuffer(bool osBuffer); + void set_osBufferLimited(bool osBufferLimited); + + //not copied size, because that's count to the checksum, ... + quint64 realByteTransfered() const; + QPair progression() const; + static QString resolvedName(const QFileInfo &inode); + QString getSourcePath() const; + QString getDestinationPath() const; + QFileInfo getSourceInode() const; + QFileInfo getDestinationInode() const; + Ultracopier::CopyMode getMode() const; +protected: + void run(); +signals: + //to send state + void preOperationStopped() const; + void checkIfItCanBeResumed() const; + //void transferStarted();//not sended (and not used then) + void readStopped() const; + void writeStopped() const; + void postOperationStopped() const; + //get dialog + void fileAlreadyExists(const QFileInfo &info,const QFileInfo &info2,const bool &isSame) const; + void errorOnFile(const QFileInfo &info,const QString &string,const ErrorType &errorType=ErrorType_Normal) const; + //internal signal + void internalStartPostOperation() const; + void internalStartPreOperation() const; + void internalStartResumeAfterErrorAndSeek() const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,QString fonction,QString text,QString file,int ligne) const; + void tryPutAtBottom() const; + //force into the right thread + void internalTryStartTheTransfer() const; + /// \brief update the transfer stat + void pushStat(const TransferStat &stat,const quint64 &pos) const; +public slots: + /// \brief to start the transfer of data + void startTheTransfer(); + /// \brief to set files to transfer + bool setFiles(const QFileInfo& source,const qint64 &size,const QFileInfo& destination,const Ultracopier::CopyMode &mode); + /// \brief to set file exists action to do + void setFileExistsAction(const FileExistsAction &action); + /// \brief to set the new name of the destination + void setFileRename(const QString &nameForRename); + /// \brief to start the transfer of data + void setAlwaysFileExistsAction(const FileExistsAction &action); + /// \brief set the copy info and options before runing + void setRightTransfer(const bool doRightTransfer); + /// \brief set keep date + void setKeepDate(const bool keepDate); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + /// \brief set the current max speed in KB/s + void setMultiForBigSpeed(const int &maxSpeed); + #endif + /// \brief set block size in KB + bool setBlockSize(const unsigned int blockSize); + /// \brief pause the copy + void pause(); + /// \brief resume the copy + void resume(); + /// \brief stop the copy + void stop(); + /// \brief skip the copy + void skip(); + /// \brief retry after error + void retryAfterError(); + /// \brief return info about the copied size + qint64 copiedSize(); + /// \brief put the current file at bottom + void putAtBottom(); + + #ifdef ULTRACOPIER_PLUGIN_RSYNC + void setRsync(const bool rsync); + #endif + + void set_osBufferLimit(const unsigned int &osBufferLimit); + void setRenamingRules(const QString &firstRenamingRule,const QString &otherRenamingRule); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + //speed limitation + void timeOfTheBlockCopyFinished(); + #endif + + bool setParallelBuffer(const int ¶llelBuffer); + bool setSequentialBuffer(const int &sequentialBuffer); + void setTransferAlgorithm(const TransferAlgorithm &transferAlgorithm); + void setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles); + void setRenameTheOriginalDestination(const bool &renameTheOriginalDestination); + void set_updateMount(); +private slots: + void preOperation(); + void readIsReady(); + void writeIsReady(); + void readIsFinish(); + void writeIsFinish(); + void readIsClosed(); + void writeIsClosed(); + void postOperation(); + void getWriteError(); + void getReadError(); + void readChecksumFinish(const QByteArray&); + void writeChecksumFinish(const QByteArray&); + void compareChecksum(); + //void syncAfterErrorAndReadFinish(); + void readThreadIsSeekToZeroAndWait(); + void writeThreadIsReopened(); + void readThreadResumeAfterError(); + //to filter the emition of signal + void readIsStopped(); + void writeIsStopped(); + //force into the right thread + void internalStartTheTransfer(); +private: + enum MoveReturn + { + MoveReturn_skip=0, + MoveReturn_moved=1, + MoveReturn_error=2 + }; + TransferStat transfer_stat; + ReadThread readThread; + WriteThread writeThread; + /*QString source; + QString destination;*/ + Ultracopier::CopyMode mode; + bool doRightTransfer; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + bool rsync; + #endif + bool keepDate; + //ready = open + ready to operation (no error to resolv) + bool readIsReadyVariable; + bool writeIsReadyVariable; + //can be open but with error + bool readIsOpeningVariable;//after call open() and before the end of internalOpen(), mostly to prevent internal error by open() when another is running + bool writeIsOpeningVariable;//after call open() and before the end of internalOpen(), mostly to prevent internal error by open() when another is running + bool readIsOpenVariable; + bool writeIsOpenVariable; + bool readIsFinishVariable; + bool writeIsFinishVariable; + bool readIsClosedVariable; + bool writeIsClosedVariable; + bool canBeMovedDirectlyVariable,canBeCopiedDirectlyVariable; + DriveManagement driveManagement; + QByteArray sourceChecksum,destinationChecksum; + volatile bool stopIt; + volatile bool canStartTransfer; + bool retry; + QFileInfo source; + QFileInfo destination; + qint64 size; + FileExistsAction fileExistsAction; + FileExistsAction alwaysDoFileExistsAction; + bool needSkip,needRemove; + QDateTime minTime; + int id; + QSemaphore *mkpathTransfer; + bool doChecksum,real_doChecksum; + bool checksumIgnoreIfImpossible; + bool checksumOnlyOnError; + bool deletePartiallyTransferredFiles; + bool osBuffer; + bool osBufferLimited; + unsigned int osBufferLimit; + QString firstRenamingRule; + QString otherRenamingRule; + //error management + bool writeError,writeError_source_seeked,writeError_destination_reopened; + bool readError; + bool renameTheOriginalDestination; + bool fileContentError; + bool doTheDateTransfer; + int parallelBuffer; + int sequentialBuffer; + int parallelizeIfSmallerThan; + QRegularExpression renameRegex; + TransferAlgorithm transferAlgorithm; + #ifdef Q_OS_UNIX + utimbuf butime; + #else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + utimbuf butime; + #else + quint32 ftCreateL, ftAccessL, ftWriteL; + quint32 ftCreateH, ftAccessH, ftWriteH; + QRegularExpression regRead; + #endif + #endif + #endif + //different pre-operation + bool isSame(); + bool destinationExists(); + bool checkAlwaysRename();///< return true if has been renamed + bool canBeMovedDirectly() const; + bool canBeCopiedDirectly() const; + void tryMoveDirectly(); + void tryCopyDirectly(); + void ifCanStartTransfer(); + //fonction to edit the file date time + bool readFileDateTime(const QFileInfo &source); + bool writeFileDateTime(const QFileInfo &destination); + void resetExtraVariable(); + //error management function + void resumeTransferAfterWriteError(); + //to send state + bool sended_state_preOperationStopped; + bool sended_state_readStopped; + bool sended_state_writeStopped; + //different post-operation + bool checkIfAllIsClosedAndDoOperations();// return true if all is closed, and do some operations, don't use into condition to check if is closed! + bool doFilePostOperation(); + //different pre-operation + void tryOpen(); + bool remainFileOpen() const; + bool remainSourceOpen() const; + bool remainDestinationOpen() const; +}; + +#endif // TRANSFERTHREAD_H diff --git a/plugins/CopyEngine/Ultracopier/Variable.h b/plugins/CopyEngine/Ultracopier/Variable.h new file mode 100644 index 0000000..0fd1a3c --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Variable.h @@ -0,0 +1,43 @@ +/** \file Variable.h +\brief Define the environment variable +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef VARIABLE_H +#define VARIABLE_H + +//Un-comment this next line to put ultracopier plugin in debug mode +#define ULTRACOPIER_PLUGIN_DEBUG +//#define ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER +#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW +#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW_TIMER 150 + +#define ULTRACOPIER_PLUGIN_MINTIMERINTERVAL 50 +#define ULTRACOPIER_PLUGIN_MAXTIMERINTERVAL 100 +#define ULTRACOPIER_PLUGIN_NUMSEMSPEEDMANAGEMENT 2 +#define ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER 1 +#define ULTRACOPIER_PLUGIN_MINIMALYEAR 1995 +#define ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE 256 //in KB +#define ULTRACOPIER_PLUGIN_DEFAULT_SEQUENTIAL_NUMBER_OF_BLOCK 512 +#define ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK 4 //in KB +#define ULTRACOPIER_PLUGIN_MAX_BLOCK_SIZE 16*1024 //in KB +#define ULTRACOPIER_PLUGIN_MAX_SEQUENTIAL_NUMBER_OF_BLOCK 2048 +#define ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK 128 //in KB + +//if set, check the inode type at scanFileOrFolder, deprecated into the new algorithm and not used +#define ULTRACOPIER_PLUGIN_CHECKLISTTYPE + +#define ULTRACOPIER_PLUGIN_SPEED_SUPPORT +//#define ULTRACOPIER_PLUGIN_RIGHTS + +/** \brief Need be greater than 2, but greater than 20 to be efficient */ +#define ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST 40 +#define ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION 200 +#define ULTRACOPIER_PLUGIN_TIME_UPDATE_MOUNT_MS 60*1000 + +//#define ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + +#endif // VARIABLE_H + + + diff --git a/plugins/CopyEngine/Ultracopier/WriteThread.cpp b/plugins/CopyEngine/Ultracopier/WriteThread.cpp new file mode 100644 index 0000000..42b3551 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/WriteThread.cpp @@ -0,0 +1,967 @@ +#include "WriteThread.h" + +#include + +QMultiHash WriteThread::writeFileList; +QMutex WriteThread::writeFileListMutex; + +WriteThread::WriteThread() +{ + deletePartiallyTransferredFiles = true; + lastGoodPosition = 0; + stopIt = false; + isOpen.release(); + moveToThread(this); + setObjectName(QStringLiteral("write")); + //this->mkpathTransfer = mkpathTransfer; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat = Idle; + #endif + numberOfBlock = ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK; + buffer = false; + putInPause = false; + needRemoveTheFile = false; + blockSize = ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*1024; + start(); +} + +WriteThread::~WriteThread() +{ + stopIt=true; + needRemoveTheFile=true; + pauseMutex.release(); + writeFull.release(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + waitNewClockForSpeed.release(); + waitNewClockForSpeed2.release(); + #endif + writeFull.release(); + pauseMutex.release(); + // useless because stopIt will close all thread, but if thread not runing run it + //endIsDetected(); + emit internalStartClose(); + isOpen.acquire(); + if(!file.fileName().isEmpty()) + resumeNotStarted(); + //disconnect(this);//-> do into ~TransferThread() + quit(); + wait(); +} + +void WriteThread::run() +{ + connect(this,&WriteThread::internalStartOpen, this,&WriteThread::internalOpen, Qt::QueuedConnection); + connect(this,&WriteThread::internalStartReopen, this,&WriteThread::internalReopen, Qt::QueuedConnection); + connect(this,&WriteThread::internalStartWrite, this,&WriteThread::internalWrite, Qt::QueuedConnection); + connect(this,&WriteThread::internalStartClose, this,&WriteThread::internalCloseSlot, Qt::QueuedConnection); + connect(this,&WriteThread::internalStartEndOfFile, this,&WriteThread::internalEndOfFile, Qt::QueuedConnection); + connect(this,&WriteThread::internalStartFlushAndSeekToZero, this,&WriteThread::internalFlushAndSeekToZero, Qt::QueuedConnection); + connect(this,&WriteThread::internalStartChecksum, this,&WriteThread::checkSum, Qt::QueuedConnection); + exec(); +} + +bool WriteThread::internalOpen() +{ + //do a bug + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] internalOpen destination: ")+file.fileName()); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close because stopIt is at true")); + emit closed(); + return false; + } + if(file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] already open! destination: ")+file.fileName()); + return false; + } + if(file.fileName().isEmpty()) + { + errorString_internal=tr("Path resolution error (Empty path)"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] before the mutex")); + //set to LISTBLOCKSIZE + if(sequential) + { + while(writeFull.available()<1) + writeFull.release(); + if(writeFull.available()>1) + writeFull.acquire(writeFull.available()-1); + } + else + { + while(writeFull.available()numberOfBlock) + writeFull.acquire(writeFull.available()-numberOfBlock); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] after the mutex")); + stopIt=false; + endDetected=false; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=InodeOperation; + #endif + //mkpath check if exists and return true if already exists + QFileInfo destinationInfo(file); + QDir destinationFolder; + { + mkpathTransfer->acquire(); + if(!destinationFolder.exists(destinationInfo.absolutePath())) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Try create the path: %1") + .arg(destinationInfo.absolutePath())); + if(!destinationFolder.mkpath(destinationInfo.absolutePath())) + { + if(!destinationFolder.exists(destinationInfo.absolutePath())) + { + /// \todo do real folder error here + errorString_internal="mkpath error on destination"; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable create the folder: %1, error: %2") + .arg(destinationInfo.absolutePath()) + .arg(errorString_internal)); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + mkpathTransfer->release(); + return false; + } + } + } + mkpathTransfer->release(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] after the mkpath")); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close because stopIt is at true")); + emit closed(); + return false; + } + //try open it + QIODevice::OpenMode flags=QIODevice::ReadWrite; + if(!buffer) + flags|=QIODevice::Unbuffered; + { + QMutexLocker lock_mutex(&writeFileListMutex); + if(writeFileList.count(file.fileName(),this)==0) + { + writeFileList.insert(file.fileName(),this); + if(writeFileList.count(file.fileName())>1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] in waiting because same file is found")); + return false; + } + } + } + bool fileWasExists=file.exists(); + if(file.open(flags)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] after the open")); + { + QMutexLocker lock_mutex(&accessList); + if(!theBlockList.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("General file corruption detected")); + stopIt=true; + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + return false; + } + } + pauseMutex.tryAcquire(pauseMutex.available()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] after the pause mutex")); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close because stopIt is at true")); + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + emit closed(); + return false; + } + if(!file.seek(0)) + { + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close because stopIt is at true")); + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + emit closed(); + return false; + } + if(!file.resize(startSize)) + { + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to resize to %1 after open: %2, error: %3").arg(startSize).arg(file.fileName()).arg(errorString_internal)); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close because stopIt is at true")); + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + emit closed(); + return false; + } + isOpen.acquire(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] emit opened()")); + emit opened(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + needRemoveTheFile=false; + postOperationRequested=false; + return true; + } + else + { + if(!fileWasExists && file.exists()) + if(!file.remove()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] file created but can't be removed")); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close because stopIt is at true")); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + emit closed(); + return false; + } + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } +} + +void WriteThread::open(const QFileInfo &file,const quint64 &startSize,const bool &buffer,const int &numberOfBlock,const bool &sequential) +{ + if(!isRunning()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] the thread not running to open destination: ")+file.absoluteFilePath()+QStringLiteral(", numberOfBlock: ")+QString::number(numberOfBlock)); + errorString_internal=tr("Internal error, please report it!"); + emit error(); + return; + } + if(this->file.isOpen()) + { + if(file.absoluteFilePath()==this->file.fileName()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] Try reopen already opened same file: ")+file.absoluteFilePath()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] previous file is already open: ")+file.absoluteFilePath()); + emit internalStartClose(); + isOpen.acquire(); + isOpen.release(); + } + if(numberOfBlock<1 || (numberOfBlock>ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK && numberOfBlock>ULTRACOPIER_PLUGIN_MAX_SEQUENTIAL_NUMBER_OF_BLOCK)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] numberOfBlock wrong, set to default")); + this->numberOfBlock=ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK; + } + else + this->numberOfBlock=numberOfBlock; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("open destination: %1, sequential: %2").arg(file.absoluteFilePath()).arg(sequential)); + stopIt=false; + fakeMode=false; + lastGoodPosition=0; + this->file.setFileName(file.absoluteFilePath()); + this->startSize=startSize; + this->buffer=buffer; + this->sequential=sequential; + endDetected=false; + writeFullBlocked=false; + emit internalStartOpen(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + numberOfBlockCopied=0; + #endif +} + +void WriteThread::endIsDetected() +{ + if(endDetected) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + endDetected=true; + pauseMutex.release(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + emit internalStartEndOfFile(); +} + +QString WriteThread::errorString() const +{ + return errorString_internal; +} + +void WriteThread::stop() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stop()")); + needRemoveTheFile=true; + stopIt=true; + if(isOpen.available()>0) + return; + writeFull.release(); + pauseMutex.release(); + pauseMutex.release(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + waitNewClockForSpeed.release(); + waitNewClockForSpeed2.release(); + #endif + // useless because stopIt will close all thread, but if thread not runing run it + endIsDetected(); + //for the stop for skip: void TransferThread::skip() + emit internalStartClose(); +} + +void WriteThread::flushBuffer() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + writeFull.release(); + writeFull.acquire(); + pauseMutex.release(); + { + QMutexLocker lock_mutex(&accessList); + theBlockList.clear(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stop")); +} + +/// \brief buffer is empty +bool WriteThread::bufferIsEmpty() +{ + bool returnVal; + { + QMutexLocker lock_mutex(&accessList); + returnVal=theBlockList.isEmpty(); + } + return returnVal; +} + +void WriteThread::internalEndOfFile() +{ + if(!bufferIsEmpty()) + { + if(sequential) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start the write")); + emit internalStartWrite(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] buffer is not empty!")); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] writeIsStopped")); + emit writeIsStopped(); + } +} + +#ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT +/*! \brief Set the max speed +\param tempMaxSpeed Set the max speed in KB/s, 0 for no limit */ +void WriteThread::setMultiForBigSpeed(const int &multiForBigSpeed) +{ + this->multiForBigSpeed=multiForBigSpeed; + waitNewClockForSpeed.release(); + waitNewClockForSpeed2.release(); +} + +/// \brief For give timer every X ms +void WriteThread::timeOfTheBlockCopyFinished() +{ + /* this is the old way to limit the speed, it product blocking + *if(waitNewClockForSpeed.available()maxSpeed>0)*/ + if(waitNewClockForSpeed.available()<=1) + waitNewClockForSpeed.release(); + if(waitNewClockForSpeed2.available()<=1) + waitNewClockForSpeed2.release(); +} +#endif + +void WriteThread::resumeNotStarted() +{ + QMutexLocker lock_mutex(&writeFileListMutex); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(!writeFileList.contains(file.fileName())) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] file: \"")+file.fileName()+QStringLiteral("\" for similar inode is not located into the list of ")+writeFileList.size()+QStringLiteral(" items!")); + #endif + writeFileList.remove(file.fileName(),this); + if(writeFileList.contains(file.fileName())) + { + QList writeList=writeFileList.values(file.fileName()); + if(!writeList.isEmpty()) + writeList.first()->reemitStartOpen(); + return; + } +} + +void WriteThread::pause() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] try put read thread in pause")); + pauseMutex.tryAcquire(pauseMutex.available()); + putInPause=true; + return; +} + +void WriteThread::resume() +{ + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + putInPause=false; + stopIt=false; + } + else + return; + if(!file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] file is not open")); + return; + } + pauseMutex.release(); +} + +void WriteThread::reemitStartOpen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + emit internalStartOpen(); +} + +void WriteThread::postOperation() +{ + if(postOperationRequested) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("[")+QString::number(id)+QStringLiteral("] double event dropped")); + return; + } + postOperationRequested=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + emit internalStartClose(); +} + +void WriteThread::internalCloseSlot() +{ + internalClose(); +} + +void WriteThread::internalClose(bool emitSignal) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] close for file: ")+file.fileName()); + /// \note never send signal here, because it's called by the destructor + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Close; + #endif + bool emit_closed=false; + if(!fakeMode) + { + if(file.isOpen()) + { + if(!needRemoveTheFile) + { + if(startSize!=lastGoodPosition) + if(!file.resize(lastGoodPosition)) + { + if(emitSignal) + { + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + } + else + needRemoveTheFile=true; + } + } + file.close(); + if(needRemoveTheFile || stopIt) + { + if(deletePartiallyTransferredFiles) + { + if(!file.remove()) + if(emitSignal) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] unable to remove the destination file")); + } + } + //here and not after, because the transferThread don't need try close if not open + if(emitSignal) + emit_closed=true; + } + } + else + { + //here and not after, because the transferThread don't need try close if not open + + if(emitSignal) + emit_closed=true; + } + needRemoveTheFile=false; + resumeNotStarted(); + //warning: file.setFileName(""); need be after resumeNotStarted() + file.setFileName(QStringLiteral("")); + if(emit_closed) + emit closed(); + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + /// \note always the last of this function + if(!fakeMode) + isOpen.release(); +} + +void WriteThread::internalReopen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + QString tempFile=file.fileName(); + internalClose(false); + flushBuffer(); + stopIt=false; + lastGoodPosition=0; + file.setFileName(tempFile); + if(internalOpen()) + emit reopened(); +} + +void WriteThread::reopen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] start")); + stopIt=true; + endDetected=false; + emit internalStartReopen(); +} + +#ifdef ULTRACOPIER_PLUGIN_DEBUG +//to set the id +void WriteThread::setId(int id) +{ + this->id=id; +} +#endif + +/// \brief do the fake open +void WriteThread::fakeOpen() +{ + fakeMode=true; + postOperationRequested=false; + emit opened(); +} + +/// \brief do the fake writeIsStarted +void WriteThread::fakeWriteIsStarted() +{ + emit writeIsStarted(); +} + +/// \brief do the fake writeIsStopped +void WriteThread::fakeWriteIsStopped() +{ + emit writeIsStopped(); +} + +/// do the checksum +void WriteThread::startCheckSum() +{ + emit internalStartChecksum(); +} + +/** \brief set block size +\param block the new block size in B +\return Return true if succes */ +bool WriteThread::setBlockSize(const int blockSize) +{ + //can be smaller than min block size to do correct speed limitation + if(blockSize>1 && blockSizeblockSize=blockSize; + return true; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("block size out of range: ")+QString::number(blockSize)); + return false; + } +} + +/// \brief get the last good position +qint64 WriteThread::getLastGoodPosition() const +{ + return lastGoodPosition; +} + +void WriteThread::flushAndSeekToZero() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("flushAndSeekToZero: ")+QString::number(blockSize)); + stopIt=true; + emit internalStartFlushAndSeekToZero(); +} + + +void WriteThread::checkSum() +{ + //QByteArray blockArray; + QCryptographicHash hash(QCryptographicHash::Sha1); + endDetected=false; + lastGoodPosition=0; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + numberOfBlockCopied=0; + #endif + if(!file.seek(0)) + { + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + return; + } + int sizeReaden=0; + do + { + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("[")+QString::number(id)+QStringLiteral("] write put in pause")); + if(stopIt) + return; + pauseMutex.acquire(); + if(stopIt) + return; + } + //read one block + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Read; + #endif + blockArray=file.read(blockSize); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + if(file.error()!=QFile::NoError) + { + errorString_internal=tr("Unable to read the source file: ")+file.errorString()+QStringLiteral(" (")+QString::number(file.error())+QStringLiteral(")"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(errorString_internal)); + emit error(); + return; + } + sizeReaden=blockArray.size(); + if(sizeReaden>0) + { + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Checksum; + #endif + hash.addData(blockArray); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + if(stopIt) + break; + + lastGoodPosition+=blockArray.size(); + } + } + while(sizeReaden>0 && !stopIt); + if(lastGoodPosition>(quint64)file.size()) + { + errorString_internal=tr("File truncated during read, possible data change"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error()))); + emit error(); + return; + } + if(stopIt) + { +/* if(putInPause) + emit isInPause();*/ + stopIt=false; + return; + } + emit checksumFinish(hash.result()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] stop the read")); +} + +void WriteThread::internalFlushAndSeekToZero() +{ + flushBuffer(); + if(!file.seek(0)) + { + errorString_internal=file.errorString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(errorString_internal)); + emit error(); + return; + } + stopIt=false; + emit flushedAndSeekedToZero(); +} + +void WriteThread::setMkpathTransfer(QSemaphore *mkpathTransfer) +{ + this->mkpathTransfer=mkpathTransfer; +} + +void WriteThread::setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles) +{ + this->deletePartiallyTransferredFiles=deletePartiallyTransferredFiles; +} + +bool WriteThread::write(const QByteArray &data) +{ + if(stopIt) + return false; + bool atMax; + if(sequential) + { + if(stopIt) + return false; + { + QMutexLocker lock_mutex(&accessList); + theBlockList.append(data); + atMax=(theBlockList.size()>=numberOfBlock); + } + if(atMax) + emit internalStartWrite(); + } + else + { + if(stopIt) + return false; + { + QMutexLocker lock_mutex(&accessList); + theBlockList.append(data); + atMax=(theBlockList.size()>=numberOfBlock); + } + emit internalStartWrite(); + } + if(atMax) + { + writeFullBlocked=true; + writeFull.acquire(); + writeFullBlocked=false; + } + if(stopIt) + return false; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + //wait for limitation speed if stop not query + if(multiForBigSpeed>0) + { + if(sequential) + { + numberOfBlockCopied++; + if(numberOfBlockCopied>=(multiForBigSpeed*2)) + { + numberOfBlockCopied=0; + waitNewClockForSpeed.acquire(); + } + } + else + { + numberOfBlockCopied2++; + if(numberOfBlockCopied2>=multiForBigSpeed) + { + numberOfBlockCopied2=0; + waitNewClockForSpeed2.acquire(); + } + } + } + #endif + if(stopIt) + return false; + return true; +} + +void WriteThread::internalWrite() +{ + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + if(sequential) + { + multiForBigSpeed=0; + QMutexLocker lock_mutex(&accessList); + if(theBlockList.size()0) + { + if(blockArray.size()==blockSize) + { + theBlockList.removeFirst(); + //if remove one block + if(!sequential) + writeFull.release(); + } + else + { + blockArray.clear(); + while(blockArray.size()!=blockSize) + { + //if larger + if(theBlockList.first().size()>blockSize) + { + blockArray+=theBlockList.first().mid(0,blockSize); + theBlockList.first().remove(0,blockSize); + if(!sequential) + { + //do write in loop to finish the actual block + emit internalStartWrite(); + } + break; + } + //if smaller + else + { + blockArray+=theBlockList.first(); + theBlockList.removeFirst(); + //if remove one block + if(!sequential) + writeFull.release(); + if(theBlockList.isEmpty()) + break; + } + } + } + //haveBlock=!blockArray.isEmpty(); + } + else + { + theBlockList.removeFirst(); + //if remove one block + if(!sequential) + writeFull.release(); + } + haveBlock=true; + } + } + if(stopIt) + return; + if(!haveBlock) + { + if(sequential) + { + if(endDetected) + internalEndOfFile(); + else + writeFull.release(); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] End detected of the file")); + return; + } + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + //wait for limitation speed if stop not query + if(multiForBigSpeed>0) + { + numberOfBlockCopied++; + if(sequential || (!sequential && writeFullBlocked)) + { + if(numberOfBlockCopied>=(multiForBigSpeed*2)) + { + numberOfBlockCopied=0; + waitNewClockForSpeed.acquire(); + if(stopIt) + break; + } + } + else + { + if(numberOfBlockCopied>=multiForBigSpeed) + { + numberOfBlockCopied=0; + waitNewClockForSpeed.acquire(); + if(stopIt) + break; + } + } + } + #endif + if(stopIt) + return; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Write; + #endif + bytesWriten=file.write(blockArray); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + //mutex for stream this data + if(lastGoodPosition==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("[")+QString::number(id)+QStringLiteral("] emit writeIsStarted()")); + emit writeIsStarted(); + } + if(stopIt) + return; + if(file.error()!=QFile::NoError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error())); + errorString_internal=QStringLiteral("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error()); + stopIt=true; + emit error(); + return; + } + if(bytesWriten!=blockArray.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("[")+QString::number(id)+QStringLiteral("] ")+QStringLiteral("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size())); + errorString_internal=QStringLiteral("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size()); + stopIt=true; + emit error(); + return; + } + lastGoodPosition+=bytesWriten; + } while(sequential); +} diff --git a/plugins/CopyEngine/Ultracopier/WriteThread.h b/plugins/CopyEngine/Ultracopier/WriteThread.h new file mode 100644 index 0000000..e540552 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/WriteThread.h @@ -0,0 +1,160 @@ +/** \file WriteThread.h +\brief Thread changed to open/close and write the destination file +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef WRITETHREAD_H +#define WRITETHREAD_H + +#include +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "StructEnumDefinition_CopyEngine.h" +#include "AvancedQFile.h" + +/// \brief Thread changed to open/close and write the destination file +class WriteThread : public QThread +{ + Q_OBJECT +public: + explicit WriteThread(); + ~WriteThread(); + /// \brief to have semaphore to do mkpath one by one + void setMkpathTransfer(QSemaphore *mkpathTransfer); +protected: + void run(); +public: + /// \brief open the destination to open it + void open(const QFileInfo &file,const quint64 &startSize,const bool &buffer,const int &numberOfBlock,const bool &sequential); + /// \brief to return the error string + QString errorString() const; + /// \brief to stop all + void stop(); + /// \brief to write data + bool write(const QByteArray &data); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief to set the id + void setId(int id); + /// \brief get the write stat + enum WriteStat + { + Idle=0, + InodeOperation=1, + Write=2, + Close=3, + Read=5, + Checksum=6 + }; + WriteStat stat; + #endif + /// \brief do the fake open + void fakeOpen(); + /// \brief do the fake writeIsStarted + void fakeWriteIsStarted(); + /// \brief do the fake writeIsStopped + void fakeWriteIsStopped(); + /// do the checksum + void startCheckSum(); + /// \brief set block size in KB + bool setBlockSize(const int blockSize); + /// \brief get the last good position + qint64 getLastGoodPosition() const; + /// \brief buffer is empty + bool bufferIsEmpty(); + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + /// \brief set the current max speed in KB/s + void setMultiForBigSpeed(const int &multiForBigSpeed); + #endif + void pause(); + void resume(); + void reemitStartOpen(); +public slots: + /// \brief start the operation + void postOperation(); + /// \brief flush buffer + void flushBuffer(); + /// \brief set the end is detected + void endIsDetected(); + /// \brief reopen the file + void reopen(); + /// \brief flush and seek to zero + void flushAndSeekToZero(); + /// do the checksum + void checkSum(); + void setDeletePartiallyTransferredFiles(const bool &deletePartiallyTransferredFiles); + /// \brief executed at regular interval to do a speed throling + void timeOfTheBlockCopyFinished(); + + void resumeNotStarted(); +signals: + void error() const; + void opened() const; + void reopened() const; + void writeIsStarted() const; + void writeIsStopped() const; + void flushedAndSeekedToZero() const; + void closed() const; + void checksumFinish(const QByteArray&) const; + //internal signals + void internalStartOpen() const; + void internalStartChecksum() const; + void internalStartReopen() const; + void internalStartWrite() const; + void internalStartClose() const; + void internalStartEndOfFile() const; + void internalStartFlushAndSeekToZero() const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; +private: + QString errorString_internal; + AvancedQFile file; + volatile bool stopIt; + volatile bool postOperationRequested; + volatile int blockSize;//only used in checksum + int numberOfBlock; + QMutex accessList; ///< For use the list + static QMultiHash writeFileList; + static QMutex writeFileListMutex; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + QSemaphore waitNewClockForSpeed,waitNewClockForSpeed2; + volatile int numberOfBlockCopied,numberOfBlockCopied2; ///< Multiple for count the number of block copied + volatile int multiplicatorForBigSpeed; ///< Multiple for count the number of block needed + volatile int MultiForBigSpeed; + #endif + QSemaphore writeFull; + volatile bool writeFullBlocked; + QSemaphore isOpen; + QSemaphore pauseMutex; + volatile bool putInPause; + QList theBlockList; ///< Store the block list + quint64 lastGoodPosition; + QByteArray blockArray; ///< temp data for block writing, the data + qint64 bytesWriten; ///< temp data for block writing, the bytes writen + int id; + volatile bool endDetected; + quint64 startSize; + QSemaphore *mkpathTransfer; + bool fakeMode; + bool buffer; + bool needRemoveTheFile; + volatile bool sequential; + bool deletePartiallyTransferredFiles; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + volatile int multiForBigSpeed; ///< Multiple for count the number of block needed + #endif +private slots: + bool internalOpen(); + void internalWrite(); + void internalCloseSlot(); + void internalClose(bool emitSignal=true); + void internalReopen(); + void internalEndOfFile(); + void internalFlushAndSeekToZero(); +}; + +#endif // WRITETHREAD_H diff --git a/plugins/CopyEngine/Ultracopier/copyEngineOptions.ui b/plugins/CopyEngine/Ultracopier/copyEngineOptions.ui new file mode 100644 index 0000000..4870480 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/copyEngineOptions.ui @@ -0,0 +1,762 @@ + + + copyEngineOptions + + + + 0 + 0 + 801 + 504 + + + + + 0 + + + 0 + + + + + 0 + + + + + 0 + 0 + 791 + 364 + + + + Transfer + + + + + + + + + Move the whole folder + + + + + + + Transfer the file rights + + + + + + + + + + Keep the file date + + + + + + + + + + + + + Autostart the transfer + + + + + + + Less performance if checked + + + + + + + Qt::Vertical + + + + 20 + 278 + + + + + + + + Less performance if checked + + + Follow the strict order + + + + + + + Rsync + + + + + + + + + + + + 0 + 0 + 502 + 218 + + + + Error and collision + + + + + + When folder error + + + + + + + + + + When file error + + + + + + + + Ask + + + + + Skip + + + + + Put at the end + + + + + + + + When file collision + + + + + + + + Ask + + + + + Skip + + + + + Overwrite + + + + + Overwrite if different + + + + + Overwrite if newer + + + + + Overwrite if older + + + + + Rename + + + + + + + + + Ask + + + + + Skip + + + + + + + + When folder collision + + + + + + + + Ask + + + + + Merge + + + + + Skip + + + + + Rename + + + + + + + + Check if destination folder exists + + + + + + + Renaming rules + + + + + + + Qt::Vertical + + + + 20 + 193 + + + + + + + + Delete partially transferred files + + + + + + + + + + + + + Rename the original destination + + + + + label_12 + label_13 + label_6 + label_7 + label_8 + comboBoxFileError + comboBoxFileCollision + comboBoxFolderError + comboBoxFolderCollision + checkBoxDestinationFolderExists + renamingRules + label_20 + deletePartiallyTransferredFiles + renameTheOriginalDestination + label_22 + + + + + 0 + 0 + 172 + 119 + + + + Control + + + + + + Checksum + + + + + + + + + Only after error + + + + + + + Ignore if impossible + + + + + + + + + + true + + + + + + + Verify checksums + + + + + + + + + + Qt::Vertical + + + + 20 + 242 + + + + + + + + + + 0 + 0 + 791 + 364 + + + + Performance + + + + + + Parallel buffer + + + + + + + KB + + + 1 + + + 999999999 + + + + + + + KB + + + 1 + + + 65536 + + + + + + + KB + + + 1 + + + 999999999 + + + + + + + + + + Block size + + + + + + + Sequential buffer + + + + + + + Enable OS buffer + + + + + + + KB + + + 1 + + + 2048 + + + 512 + + + + + + + OS buffer only if smaller than + + + + + + + Transfer algorithm + + + + + + + + Automatic + + + + + Sequential + + + + + Parallel + + + + + + + + Qt::Vertical + + + + 20 + 197 + + + + + + + + Parallelize if smaller than + + + + + + + KB + + + 1024 + + + + + + + 1 + + + 32 + + + 16 + + + + + + + Inode threads + + + + + + + More cpu, but better organisation on the disk + + + + + + + + + + More cpu, but better organisation on the disk + + + Order the list + + + + + + + + + 0 + 0 + 449 + 89 + + + + Misc + + + + + + Check the disk space + + + + + + + + + + Use this folder when destination is not set + + + + + + + + + + + + Browse + + + + + + + + + Qt::Horizontal + + + + 353 + 20 + + + + + + + + Filters + + + + + + + Qt::Horizontal + + + + 352 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 159 + + + + + + + + + + + + + + doChecksum + clicked(bool) + label_9 + setEnabled(bool) + + + 583 + 136 + + + 109 + 161 + + + + + doChecksum + clicked(bool) + checksumOnlyOnError + setEnabled(bool) + + + 594 + 136 + + + 586 + 161 + + + + + doChecksum + clicked(bool) + label_10 + setEnabled(bool) + + + 641 + 136 + + + 132 + 186 + + + + + doChecksum + clicked(bool) + checksumIgnoreIfImpossible + setEnabled(bool) + + + 665 + 136 + + + 609 + 186 + + + + + diff --git a/plugins/CopyEngine/Ultracopier/copyEngineResources.qrc b/plugins/CopyEngine/Ultracopier/copyEngineResources.qrc new file mode 100644 index 0000000..0228c74 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/copyEngineResources.qrc @@ -0,0 +1,8 @@ + + + resources/add.png + resources/edit.png + resources/remove.png + resources/filter.png + + diff --git a/plugins/CopyEngine/Ultracopier/debugDialog.ui b/plugins/CopyEngine/Ultracopier/debugDialog.ui new file mode 100644 index 0000000..80fde7e --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/debugDialog.ui @@ -0,0 +1,98 @@ + + + debugDialog + + + + 665 + 392 + + + + Monitor + + + + + + + + Transfer thread + + + + + + true + + + + + + + + + + Transfer list + + + + + + true + + + + + + + + + + + + Variables + + + + + + Active transfer: + + + + + + + true + + + 9999 + + + + + + + Number of inode manipuled: + + + + + + + true + + + 9999 + + + + + + + + + + + diff --git a/plugins/CopyEngine/Ultracopier/documentation.dox b/plugins/CopyEngine/Ultracopier/documentation.dox new file mode 100644 index 0000000..727969f --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/documentation.dox @@ -0,0 +1,39 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage Copy engine + + \section mainpage_overview Overview + + The default copy engine for Ultracopier. Support file/folder, copy/move, ...\n + More informations on the wiki of ultracopier. + + \section mainpage_platforms Platforms + + This plugin might be usable in all environments where you find Qt 5, but Gcc is requiered for some part. You need qtsystem modules for QtSystemInfo\n + This plugin requires Qt 5.0 or newer. Tested on Qt 5.0.\n + + \section mainpage_downloads Downloads + + You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... + + \section mainpage_algorithm Algorithm + + Like say previously you will have more informations on the wiki.\n + Then file transfer is done via pipe mecamism system:\n +
    +
  • push at no blocking into table up to the table is full, after is blocked up to one entry is free
  • +
  • Other thread read the table up to have no more data, then is blocked
  • +
+ The transfer thread do listing of the folder, removing folder, make folder is one thread for each.\n + The transfer list, have thread pool to do the inode operation (open, close, set date, ...). Do all inode operation in parallele, but transfer the data as sequential. + + \section license GPL Version 3 + The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4. + +*/ diff --git a/plugins/CopyEngine/Ultracopier/fileErrorDialog.ui b/plugins/CopyEngine/Ultracopier/fileErrorDialog.ui new file mode 100644 index 0000000..b603924 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/fileErrorDialog.ui @@ -0,0 +1,264 @@ + + + fileErrorDialog + + + + 0 + 0 + 723 + 185 + + + + Error with file + + + + + + Error + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + false + + + Size + + + + + + + 0 KiB + + + + + + + false + + + Modified + + + + + + + Today + + + + + + + false + + + File name + + + + + + + source.txt + + + + + + + false + + + Destination + + + + + + + ../toto.txt + + + + + + + false + + + Folder + + + + + + + /folder/ + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + &Always perform this action + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Try in with elevated privileges + + + + + + + Put to bottom + + + + + + + Retry + + + + + + + &Skip + + + + + + + &Cancel + + + + + + + + + + + checkBoxAlways + toggled(bool) + Cancel + setDisabled(bool) + + + 112 + 131 + + + 438 + 142 + + + + + checkBoxAlways + toggled(bool) + Retry + setDisabled(bool) + + + 155 + 131 + + + 309 + 134 + + + + + diff --git a/plugins/CopyEngine/Ultracopier/fileExistsDialog.ui b/plugins/CopyEngine/Ultracopier/fileExistsDialog.ui new file mode 100644 index 0000000..0c38a57 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/fileExistsDialog.ui @@ -0,0 +1,412 @@ + + + fileExistsDialog + + + + 0 + 0 + 469 + 162 + + + + The file exists + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Source + + + Qt::AlignCenter + + + + + + + + 75 + true + + + + Destination + + + Qt::AlignCenter + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Size + + + + + + + 0 KiB + + + + + + + false + + + Modified + + + + + + + Today + + + + + + + false + + + File name + + + + + + + source.txt + + + + + + + false + + + Folder + + + + + + + /source/ + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + false + + + Size + + + + + + + 0 KiB + + + + + + + false + + + Modified + + + + + + + Today + + + + + + + false + + + File name + + + + + + + destination.txt + + + + + + + false + + + Folder + + + + + + + /destination/ + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + + Suggest new &name + + + + + + + + + + + &Always perform this action + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Rename + + + + + + + &Overwrite + + + QToolButton::MenuButtonPopup + + + + + + + &Skip + + + + + + + &Cancel + + + + + + + + + Overwrite if newer + + + + + Overwrite if modification date differs + + + Overwrite if modification date differs + + + + + Overwrite if older + + + Overwrite if older + + + + + + + checkBoxAlways + toggled(bool) + Cancel + setDisabled(bool) + + + 115 + 130 + + + 440 + 129 + + + + + checkBoxAlways + toggled(bool) + lineEditNewName + setDisabled(bool) + + + 62 + 129 + + + 108 + 93 + + + + + checkBoxAlways + toggled(bool) + SuggestNewName + setDisabled(bool) + + + 144 + 138 + + + 326 + 98 + + + + + diff --git a/plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui b/plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui new file mode 100644 index 0000000..c019a63 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui @@ -0,0 +1,214 @@ + + + fileIsSameDialog + + + + 0 + 0 + 411 + 142 + + + + The source and destination are same + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Size + + + + + + + 0 KiB + + + Qt::PlainText + + + + + + + Today + + + Qt::PlainText + + + + + + + false + + + File name + + + + + + + source.txt + + + Qt::PlainText + + + + + + + false + + + Folder + + + + + + + /toto/ + + + Qt::PlainText + + + + + + + false + + + Modified + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + + Suggest new &name + + + + + + + + + + + &Always perform this action + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Rename + + + + + + + &Skip + + + + + + + &Cancel + + + + + + + + + + diff --git a/plugins/CopyEngine/Ultracopier/folderExistsDialog.ui b/plugins/CopyEngine/Ultracopier/folderExistsDialog.ui new file mode 100644 index 0000000..440b5ca --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/folderExistsDialog.ui @@ -0,0 +1,309 @@ + + + folderExistsDialog + + + + 0 + 0 + 476 + 140 + + + + The source and destination is identical + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Source + + + Qt::AlignCenter + + + + + + + + 75 + true + + + + Destination + + + Qt::AlignCenter + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Modified + + + + + + + Today + + + + + + + false + + + Folder name + + + + + + + folder + + + + + + + false + + + Folder + + + + + + + /source/ + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Modified + + + + + + + false + + + Folder name + + + + + + + Today + + + + + + + folder + + + + + + + false + + + Folder + + + + + + + /destination/ + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + + + + + Suggest new &name + + + + + + + + + + + &Always perform this action + + + + + + + &Rename + + + + + + + Merge + + + + + + + Skip + + + + + + + &Cancel + + + + + + + + + + + checkBoxAlways + clicked(bool) + lineEditNewName + setDisabled(bool) + + + 132 + 126 + + + 135 + 101 + + + + + checkBoxAlways + clicked(bool) + SuggestNewName + setDisabled(bool) + + + 113 + 129 + + + 304 + 100 + + + + + diff --git a/plugins/CopyEngine/Ultracopier/informations-rsync.xml b/plugins/CopyEngine/Ultracopier/informations-rsync.xml new file mode 100644 index 0000000..43befc2 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/informations-rsync.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Rsync copy engine]]> + <![CDATA[Moteur de copie rsync]]> + + CopyEngine + + + + + + + 1287496800 + + linux-x86_64-pc + + + + + 1.0.0.0 + + Rsync + + + \ No newline at end of file diff --git a/plugins/CopyEngine/Ultracopier/informations.xml b/plugins/CopyEngine/Ultracopier/informations.xml new file mode 100644 index 0000000..1a1d769 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Copy engine of Ultracopier]]> + <![CDATA[Moteur de copie d'ultracopier]]> + + CopyEngine + + + + + + + 1287496800 + + windows-x86 + + + + + 1.2.3.6 + + Ultracopier + + + \ No newline at end of file diff --git a/plugins/CopyEngine/Ultracopier/plugin.json b/plugins/CopyEngine/Ultracopier/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/CopyEngine/Ultracopier/resources/add.png b/plugins/CopyEngine/Ultracopier/resources/add.png new file mode 100644 index 0000000..7932127 Binary files /dev/null and b/plugins/CopyEngine/Ultracopier/resources/add.png differ diff --git a/plugins/CopyEngine/Ultracopier/resources/edit.png b/plugins/CopyEngine/Ultracopier/resources/edit.png new file mode 100644 index 0000000..5464856 Binary files /dev/null and b/plugins/CopyEngine/Ultracopier/resources/edit.png differ diff --git a/plugins/CopyEngine/Ultracopier/resources/filter.png b/plugins/CopyEngine/Ultracopier/resources/filter.png new file mode 100644 index 0000000..9bb3164 Binary files /dev/null and b/plugins/CopyEngine/Ultracopier/resources/filter.png differ diff --git a/plugins/CopyEngine/Ultracopier/resources/remove.png b/plugins/CopyEngine/Ultracopier/resources/remove.png new file mode 100644 index 0000000..b711740 Binary files /dev/null and b/plugins/CopyEngine/Ultracopier/resources/remove.png differ diff --git a/plugins/Languages/ar/flag.png b/plugins/Languages/ar/flag.png index 64fe557..538c4f9 100644 Binary files a/plugins/Languages/ar/flag.png and b/plugins/Languages/ar/flag.png differ diff --git a/plugins/Languages/ar/informations.xml b/plugins/Languages/ar/informations.xml index a52ba39..24ea31a 100644 --- a/plugins/Languages/ar/informations.xml +++ b/plugins/Languages/ar/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 ar diff --git a/plugins/Languages/ar/translation.ts b/plugins/Languages/ar/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/ar/translation.ts +++ b/plugins/Languages/ar/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/de/flag.png b/plugins/Languages/de/flag.png index 7707c43..a096a1c 100644 Binary files a/plugins/Languages/de/flag.png and b/plugins/Languages/de/flag.png differ diff --git a/plugins/Languages/de/informations.xml b/plugins/Languages/de/informations.xml index 92bc082..ff73225 100644 --- a/plugins/Languages/de/informations.xml +++ b/plugins/Languages/de/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 de diff --git a/plugins/Languages/de/translation.ts b/plugins/Languages/de/translation.ts index 1a00c52..eeee697 100644 --- a/plugins/Languages/de/translation.ts +++ b/plugins/Languages/de/translation.ts @@ -4,77 +4,84 @@ CliParser - - - - - + + + + + Warning Warnung - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - Ultracopier bereits ausgeführt wird, direkt vor der Taskleiste (neben der Uhr) klicken, um es zu benutzen + Ultracopier wird bereits ausgeführt. Klicken Sie mit der rechten Maustase auf das Icon im Infobereich der Taskleiste - - Problem at the reading, or file size is null - Problem an der Lektüre, oder Dateigröße ist Null + + Problem reading file, or file size is 0 + Lesefehler, oder Dateigröße=0 - - This file is not supported transfer list - Diese Datei wird nicht unterstützt Transferliste + + + The arguments possible are: + Mögliche Werte sind: - - Unable to open the transfer list file - Unfähig, die Transferliste Datei zu öffnen + + + To display the options + Optionen anzeigen - - - The arguments possibles are: - Die Argumente possibles sind: + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Zum Kopieren von Quelle nach Ziel, getrennt durch Leerzeichen. Bei Ziel=? fragt Supercopier nach - - - To have this help - Um diese Hilfe haben + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Zum Verschieben von Quelle nach Ziel, getrennt durch Leerzeichen. Bei Ziel=? fragt Supercopier nach - - - To quit the other instance running (if have) - Um die andere Instanz läuft (falls haben) quit + + Command not valid + Ungültiger Befehl - - - To pass transfer list to do - Um Transferliste passieren zu tun + + This file is not supported transfer list + The original english text does not make sense. + Diese Datei wird nicht unterstützt Transferliste - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user - Um Quellen, die von Platz bis zum Ziel getrennt zu kopieren. Wenn das Ziel "?", Wird ultracopier es für den Benutzer fragen, + + Unable to open the transfer list file + Die Transferlistendatei kann nicht geöffnet werden - - - Same as above, but with move - Wie oben, aber mit Umzug + + + To display this help + Um diese Hilfe anzuzeigen - - Command line not understand - Command line nicht verstehen + + + To quit the other instances (if running) + Um andere Instanzen zu beenden (falls laufend) - + + + Open transfer list + Transferliste öffnen + + + Help Hilfe @@ -82,329 +89,408 @@ CopyEngineManager - - - - + + + + Warning Warnung - + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + Cannot find any copy engine with motions support - Finde keine Kopie Motor mit Bewegungen zu unterstützen + Motions? Do you mean "move"? + Finde keine Kopier-Engine mit Motions-Unterstützung - + Cannot find any compatible engine! - Finde keine kompatiblen Motor! + Finde keine kompatible Engine! - This copy engine does not support motions - Diese Kopie Engine unterstützt keine Bewegungen + Diese Kopier-Engine unterstützt keine Motions - + Cannot find any engine with this name: %1 - Kann keinen Motor mit diesem Namen: %1 + Finde keine Engine mit diesem Namen: %1 + + + + CopyListener + + + Error + Fehler + + + + Error during the reception of the copy/move list +%1 + Fehler während Empfang der Kopier/Verschieben-Liste +%1 Core - - - - - - + + + + + + + - - - - - - + + + + Error Fehler - - - - - - + + + + + + - - Unable to get a copy engine instance - Kann eine Kopie Motor Instanz zu erhalten + Bekomme keine Instanz der Kopier-Engine - - The argument for the mode is not understand - Das Argument für den Modus ist nicht zu verstehen + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance + Bekomme keine Instanz der Engine + + + + The argument for the mode is not valid + Die Parameter sind in diesem Modus ungültig + + + + Do you want to copy? If no, it will be moved. + Möchten Sie kopieren? Wenn nicht, wird verschoben. - - + + Unable to load the interface, copy aborted - Unfähig, die Schnittstelle zu laden, kopieren abgebrochen + Konnte Oberfläche nicht laden. Kopiervorgang abgebrochen - + Unable to load the copy engine, copy aborted - Unfähig, die Kopie Motorlast, kopieren abgebrochen + Konnte Kopier-Engine nicht laden. Kopiervorgang abgebrochen - + Transfer mode - übertragen Modus + Transfermodus + + + EventDispatcher - - Do you want do as a copy? Else if you reply no, it will be moved. - Wollen Sie tun als Kopie? Else, wenn Sie nicht antworten, wird es verschoben werden. + + Key + + + + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + FacilityEngine - + Copy engine - kopieren Motor + Kopier-Engine - + Copy - Kopie + a copy + Kopieren - + Move - Bewegen + a move + Verschieben - + Pause Pause - + Resume Fortsetzen - - + + Skip - überspringen + Überspringen - + Unlimited Unbegrenzt - + s - + seconds? + s - + Too big Zu groß - + B - + Byte? + B - + KB - + Kilobyte + KB - + MB - + Megabyte + MB - + GB - + Gigabyte + GB - + TB - + Terrabyte + TB - + PB - + Petabyte + PB - + EB - + Etabyte + EB - + ZB - + Zetabyte + ZB - + YB - + Yotabyte + YB - + Less than %10 seconds Weniger als %10 Sekunden - + About %10 seconds remaining - Über Noch %10 Sekunden + Ungefähr noch %10 Sekunden - + About %1 minutes remaining - Über %1 minuten vor + Ungefähr noch %1 Minuten - + About %1 hours remaining - Über %1 verbleibenden Stunden + Ungefähr noch %1 Stunden + Transfer + a transfer + evtl. "Datenübertragung", aber ich denke "Transfer" ist hier besser + Transfer + + + + Start + Start + + + Source Quelle - + Size Größe - + Destination Ziel - + Quit - Verlassen + Beenden - + Target Ziel - - + + Time remaining: Verbleibende Zeit: - + Listing Auflistung - + Copying Kopieren - + Listing and copying - Auflisten und Kopieren + not sure... depends on context + Auflistung und Kopiervorgang - + Ask Fragen - + Overwrite Überschreiben - + Overwrite if newer - Überschreiben, wenn neuere + Überschreiben, falls neuer - + Overwrite if the last modification dates are different - Überschreiben, wenn die letzten Änderungsdaten unterschiedlich sind + Überschreiben, falls die letzten Änderungsdaten unterschiedlich sind - + Rename Umbenennen - - Put to end of the list - Setzen Sie auf Ende der Liste + + Put to the end of the list + Ans Ende der Liste verschieben + + + + Completed in %1 + Fertig in %1 - + Select source directory - Wählen Sie Source-Verzeichnis + Wählen Sie das Quellverzeichnis - + Select destination directory Wählen Sie das Zielverzeichnis - + Internal error Interner Fehler - + Select one or more files to open - Wählen Sie eine oder mehrere Dateien zu öffnen + Wählen Sie eine oder mehrere Dateien zum Öffnen - + All files Alle Dateien - + Save transfer list - Speichern Transferliste + Transferliste speichern - + Open transfer list - Öffnen Sie Transferliste + Transferliste öffnen - + Transfer list - Transfer-Liste + Transferliste - + Error Fehler - + Not supported on this platform Auf dieser Plattform nicht unterstützt @@ -412,67 +498,94 @@ HelpDialog - - About ultracopier - Über ultracopier + + About Ultracopier + Über Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - Basierend auf Qt. Es bieten erweiterte Kopierer mit erweiterten Funktionen. Es ist unter GPL3. -%1: Diese Version wird als Version kompiliert. + Basiert auf Qt. Erweitertes Tool um Dateien zu kopieren (Lizenz: GPLv3). +Diese Version wurde kompiliert als Version: %1. - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) Plattform: %1 - + About Qt Über Qt - + Do a crash - Führen Sie eine Absturz + Clumsy... depends on context + Absturz ausführen - + Save bug report - Speichern Bug-Report + Fehlerbericht speichern - + Close Schließen - + + About Supercopier + Über Supercopier + + + For http://portableapps.com/ - Für http://portableapps.com/ + Zu http://portableapps.com/ + + + + Portable and all in one version + Portable und "Alles-in-Einem" Version - + Portable version Portable Version - + + All in one version + "Alles-in-Einem" Version + + + Normal version Normale Version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists http://ultracopier-de.first-world.info/ - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + http://ultracopier.first-world.info/download.html + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages <html><head/><body><p>Weitere Informationen finden Sie auf der Website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> @@ -481,35 +594,88 @@ This version is compiled as version: %1. LocalListener - + Warning Warnung - + Timeout while recomposing data from connected clients - Timeout beim Neukomposition Daten von angeschlossenen Clients + Timeout beim Zusammenfügen der Daten von verbundenen Clients LogThread - - - + + + Error Fehler - + Log file already open, error: %1 - Log-Datei bereits geöffnet ist, Fehler: %1 + Log-Datei ist bereits geöffnet, Fehler: %1 + + + + + Unable to open the log file, error: %1 + Kann Log-Datei nicht öffnen. Fehler: %1 + + + + OSSpecific + + + Warning + Warnung + + + + Don't show again + Nicht mehr anzeigen + + + + Ok + OK + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + Das Ersetzen des Standard Kopier/Verschieben-Systems wird von diesem Datei-Manager nicht unterstützt.<br />Bitten Sie die Entwickler darum es zu supporten. <br />Sie müssen das Kopieren/Verschieben daher manuell durchführen. - - - Unable to open file to keep the log file, error: %1 - Datei konnte nicht geöffnet, um die Protokolldatei, Fehler zu halten: %1 + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + System neustarten, Falls vorher ähnliche Software instaliert war (wie Teracopy, Supercopier oder ältere Version von Ultracopier). + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + Das Ersetzen des Standard Kopier/Verschieben-Systems wird vom Mac OS X Finder nicht unterstützt und somit verhindert.<br />Sie müssen das Kopieren/Verschieben daher manuell durchführen. + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + Das Ersetzen des Standard Kopier/Verschieben-Systems wird von diesem File-Manager nicht unterstützt.<br />Bitten Sie die Entwickler darum es zu supporten. <br />Sie müssen das Kopieren/Verschieben daher manuell durchführen. + + + + Consider Supercopier as deprecated, prefer Ultracopier + Supercopier als veraltet betrachten, Ultracopier vorziehen + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + Diese Version nutzt die GPU Ihrer Grafikkarte zu 100% (Kann beim Spielen stören) aber kostenloser Zugang zur Ultimate-Version. Alternativ downloaden Sie die Normal-Version (mit Werbe-Link), oder kaufen Sie die Ultimate-Version, um das Projekt zu unterstützen. + + + + http://ultracopier.first-world.info/download.html + http://ultracopier.first-world.info/download.html @@ -523,7 +689,7 @@ This version is compiled as version: %1. General - General + Allgemein @@ -532,258 +698,323 @@ This version is compiled as version: %1. - - + + Copy engine - kopieren Motor + Kopier-Engine - - + + Themes Themes - + Log Log - - Language: - Sprache: + + Confirm to group the windows + Gruppieren der Fenster bestätigen - - Autodetect the system language: - Autodetect das System die Sprache aus: + + Check for updates + Nach Updates suchen - - Catch the copy/move as default: - fangen Sie die kopie/move als Standard: - - - - Load at the session loading: - Legen Sie bei der Sitzung Beladung: - - - + Name Name - + Version Version - + Language Sprache - - + + Listener - Zuhörer + Listener - - - + + + Plugin loader Plugin loader - - - + + + Session loader Session loader - + + Force the language + Sprache wählen + + + + Replace the default copy and move system + Standard Kopier- und Verschiebebefehl ersetzen + + + + Load at the session loading + Mit OS laden + + + + When manual open + Bei manuellem Start + + + + Group the windows when + Fenster gruppieren + + + + Display the OS warning + OS Warnungen anzeigen + + + + Give GPU time to fund the development + Der GPU Zeit geben, um die Entwicklung zu finanzieren + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + Plugin Plugin - + Add Hinzufügen - + Remove Entfernen - + Information Information - + Copy engine by order of preference: - Kopieren Motor von der Reihenfolge ihrer Präferenz: + Kopier-Engine in Reihenfolge ihrer Präferenz: + + + + Client connected + Client verbunden - + Themes: - Themen: + Themes: - + Unable to load the themes plugin - Unfähig, die Themen Plugin zu laden + Konnte das Themes-Plugin nicht laden - + Browse - Blättern + Durchsuchen - - + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated Die Variablen sind %time%, %source%, %size%, %destination% - - + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated Die Variablen sind %time%, %path%, %size%, %mtime%, %error% - + Write the log file into: - Schreiben Sie die Log-Datei in: + Log in folgende Datei schreiben: - - Write the transfers: - Schreiben Sie die Transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + Schreibe direkt in die Datei, wenn ein neuer Eintrag erreicht wird (50% Leistungsverlust möglich) - - Write the errors: - Schreiben Sie die Fehler: + + + Load + Laden - - Write the folder operations: - Schreiben Sie die Ordner-Operationen: + + Load the theme? + Theme laden? - - - - - Disabled because you have any SessionLoader plugin - Deaktiviert, weil Sie irgendein Plugin haben SessionLoader + + Load the language? + Sprache laden? - + Disabled because you do not have any SessionLoader plugin + Deaktiviert, da kein SessionLoader-Plugin installiert ist + + + Do nothing Nichts tun - + Ask source as folder - Stellen Sie als Quelle Ordner + Nach Quell-Ordner fragen - + Ask sources as files - Fragen Sie Quellen in Form von Dateien + Nach Quell-Datei fragen - + Never Nie - + When source is same - Als Quelle ist dieselbe + Falls Quelle gleich ist - + When destination is same - Als Ziel ist dasselbe + Falls Ziel gleich ist - + When source and destination are same - Wenn Quell-und Ziel sind gleiche + Falls Quelle und Ziel gleich sind - + When source or destination are same - Als Quell-oder Ziel sind gleiche + Falls Quelle oder Ziel gleich sind - + Always Immer - - Save logs as: - Protokolle speichern als: + + + + The variables are %1 + Die Variablen sind %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance - Diese schreiben Sie direkt die Datei, wenn es den neuen Eintrag zu erhalten, kann aber 50% der Erzeugung der Leistung verloren + + Allow the application + Anwendung zulassen - - Synchronized log - Synchronisierte log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + Diese Ultimate-Gratis-Version läuft nur, wenn %1 von Ihrer Antivirus-Software erlaubt ist. Sonst benutzen Sie die Normalversion. - - When manual open: - Beim manuellen offen: + + Enable the OpenCL + OpenCL einschalten - - Group the windows when: - Gruppe das Fenster, wenn: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + Diese Ultimate-Gratis-Version läuft nur, wenn mit Ihrem Grafik-Treiber OpenCL installiert wurde. Sonst benutzen Sie die Normalversion. + + + + Save logs as: + Protokolle speichern als: - + + Synchronized log + Synchronisiertes Protokoll + + + No option for this plugin Keine Option für dieses Plugin - - + + Write the transfers + Protokolliere Transfers: + + + + Write the errors + Protokolliere Fehler: + + + + Write the folder operations + Protokolliere Ordner-Operationen: + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated - Die Variablen sind %path%, %operation% + %path%, %operation% should not be translated + Die Variablen sind %path% %operation% OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 - Versuchen Sie bekommen variabel, aber die Variable wird nicht gefunden: %1 %2 + + + + + The variable was not found: %1 %2 + Variablen nicht gefunden: %1 %2 @@ -824,37 +1055,42 @@ This version is compiled as version: %1. Version: - - CopyEngine - + + Copy engine + Kopier-Engine - + Languages - + Sprachen - + Listener - Zuhörer + Listener - - PluginLoader - + + Plugin loader + Plugin-Loader - - SessionLoader - + + Session loader + Session-Loader - + Themes - Themes + Themes - + + Unknown + + + + Information about %1 Informationen über %1 @@ -872,190 +1108,191 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - informations.xml kann nicht zugegriffen werden - - - - informations.xml not found into the plugin - informations.xml nicht in das Plugin gefunden + Auf "informations.xml" kann nicht zugegriffen werden - + Dependencies part is wrong - Abhängigkeiten Teil ist falsch + clumsy. + Abhängigkeiten-Teil ist falsch - + Dependencies %1 are not satisfied, for plugin: %2 - Abhängigkeiten %1 nicht erfüllt sind, für plugin:%2 + Die Abhängigkeiten "%1" sind nicht erfüllt für Plugin:%2 - + Remove %1 - Entfernen %1 + Entferne %1 - + Error Fehler - + Information Information - + %1, parse error at line %2, column %3: %4 %1, Parser-Fehler in Zeile %2, Spalte %3: %4 - + + informations.xml not found for the plugin + "informations.xml" für das Plugin nicht gefunden + + + "package" root tag not found for the xml file - "package" Wurzel-Tag nicht für die XML-Datei gefunden + "package" Root-Tag für die XML-Datei nicht gefunden - + Duplicated plugin found, already loaded! - Duplizierte Plugin gefunden, bereits geladen! + Plugin-Duplikat gefunden. Bereits geladen! - - English text missing into the informations.xml for the tag: %1 - Englisch Text fehlt in den informations.xml für das Tag: %1 + + English text missing in the informations.xml for the tag: %1 + Englischer Text fehlt in "informations.xml" für das Tag: %1 - + Tag not found: %1 - Tag nicht gefunden: %1 + XML-Tag nicht gefunden: %1 - + Are you sure about removing "%1" in version %2? - Sind Sie sicher, über das Entfernen von "%1" in der Version %2? + Sind Sie sicher, dass Sie "%1" in der Version %2 entfernen wollen? - + Error while the removing plugin, please check the rights on the folder: %1 - Fehler beim Entfernen des Plugins, überprüfen Sie bitte die Rechte auf den Ordner: + Fehler beim Entfernen des Plugins. Überprüfen Sie bitte die Zugriffsrechte auf den Ordner: %1 - + Previous import is in progress... - Vorherige Import ist in Arbeit ... + Vorheriger Import wird durchgeführt... - + Open Ultracopier plugin - Offene Ultracopier Plugin + Ultracopier Plugin öffnen - + Ultracopier plugin (*.urc) Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - Plugin loader + Plugin-Loader - + Unable to open the plugin: %1 - Kann das Plugin öffnen: %1 + Kann das Plugin nicht öffnen: %1 - - - + + + Unable to load the plugin content, please check it: %1 - Unfähig, die Plugin-Inhalte zu laden, bitte überprüfen Sie es: %1 + Kann Plugin-Inhalte nicht laden. Bitte überprüfen Sie das: %1 - + Unable to create a folder to install the plugin: %1 - Kann einen Ordner zu erstellen, um das Plugin zu installieren: -%1 + Kann keinen Ordner erstellen um das Plugin %1 zu installieren + - + Unable to create a file to install the plugin: %1 since:%2 - Kann eine Datei zu erstellen, um das Plugin zu installieren: + Kann eine Datei nicht erstellen um das Plugin zu installieren: %1 seit: %2 - + Folder with same name is present, skip the plugin installation: %1 - Ordner mit demselben Namen vorhanden ist, überspringen Sie die Plugin-Installation: + Ordner mit demselben Namen existiert bereits. Überspringen Sie die Plugin-Installation: %1 - - - + + + Unable to load the plugin content, please check it - Unfähig, die Plugin-Inhalte zu laden, bitte überprüfen Sie es + Kann Plugin-Inhalte nicht laden. Bitte überprüfen Sie das QXzDecode - - + + Memory allocation failed Speicherzuordnung fehlgeschlagen - - + + Write error Schreibfehler - + Memory usage limit reached - Speicherverbrauch erreicht + Grenze des Speicherverbrauchs erreicht - + Not a .xz file - Nicht eine. Xz-Datei + Keine .xz-Datei - + Unsupported options in the .xz headers - Nicht unterstützte Optionen in den. Xz-Header + Nicht-unterstützte Optionen in den .xz-Headern - + The file is corrupted Die Datei ist beschädigt - + Bug! Bug! - + The input data is too short Die Eingabedaten sind zu kurz @@ -1063,87 +1300,125 @@ seit: %2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - Keine Kopie Zuhörer gefunden. Haben Sie die Kopie manuell durch Rechtsklick auf ein Symbol in der Taskleiste das. + Keine Kopie-Listener gefunden. Führen Sie die Kopie manuell durch Rechtsklick auf das Symbol im Systray aus. - + Information - Information + Information - - Searching informations... - Suchen Sie Informationen ... + + Searching information... + Suche Informationen ... - - Not catching the explorer copy/move - Nicht fangen die Explorer kopieren/verschieben + + Do not replace the explorer copy/move + Explorer:-Kopieren/Verschieben nicht ersetzen - - Semi catching the explorer copy/move - Semi fangen die Explorer kopieren/verschieben + + Semi replace the explorer copy/move + Explorer: Kopieren/Verschieben teilweise ersetzen - - Catching the explorer copy/move - Fangen die Explorer kopieren/verschieben + + Replace the explorer copy/move + Explorer:-Kopieren/Verschieben ersetzen - + Warning - Warnung + Warnung - - Action on the systray icon is unknown! - Aktion auf dem Systray-Icon ist nicht bekannt! + + The action on the systray icon is unknown! + Die auf dem Systray-Icon angewandte Aktion ist unbekannt! - + &About/Debug report - Über/Debug Bericht + &Über/Debug Bericht - + &About - Über + &Über + + + + &Save bug report + Bug-Bericht &speichern - + &Quit - Verlassen + &Beenden - + &Options - &Optionen + &Optionen - + A&dd copy/moving - Fügen Sie Kopie/Bewegung + &Kopieren/Verschieben hinzufügen + + + + New version: %1 + Neue Version: %1 + + + + Click here to go on download page + Hier klicken für Downloadseite + + + Click here to go to the shop and login. +Download the new version into the order details + Hier klicken für Shop und Login. +Download der neuen Version unter: Order Details + + + + &Copy + &Kopieren + + + + + &Transfer + &Transfer + + + + + &Move + &Verschieben - - + + Add &copy - hinzufügen Kopie + Kopie hinzufügen (&C) - - + + Add &transfer - Übertragung hinzufügen + Über&tragung hinzufügen - - + + Add &move - Fügen Sie bewegen + Verschieben hinzufügen (&M) diff --git a/plugins/Languages/el/flag.png b/plugins/Languages/el/flag.png index 75e4705..cd96374 100644 Binary files a/plugins/Languages/el/flag.png and b/plugins/Languages/el/flag.png differ diff --git a/plugins/Languages/el/informations.xml b/plugins/Languages/el/informations.xml index fa96f3d..2ef2308 100644 --- a/plugins/Languages/el/informations.xml +++ b/plugins/Languages/el/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 el diff --git a/plugins/Languages/el/translation.ts b/plugins/Languages/el/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/el/translation.ts +++ b/plugins/Languages/el/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/es/flag.png b/plugins/Languages/es/flag.png index 071c892..4cb4c0a 100644 Binary files a/plugins/Languages/es/flag.png and b/plugins/Languages/es/flag.png differ diff --git a/plugins/Languages/es/informations.xml b/plugins/Languages/es/informations.xml index ce79da6..c3884fb 100644 --- a/plugins/Languages/es/informations.xml +++ b/plugins/Languages/es/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 es diff --git a/plugins/Languages/es/translation.ts b/plugins/Languages/es/translation.ts index 31253bf..b25dabe 100644 --- a/plugins/Languages/es/translation.ts +++ b/plugins/Languages/es/translation.ts @@ -4,77 +4,107 @@ CliParser - - - - - + + + + + Warning Advertencia - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it Ultracopier ya se está ejecutando, haga clic derecho sobre el icono de la bandeja del sistema (cerca del reloj) para poder utilizarlas - + + Problem reading file, or file size is 0 + Problema al leer el archivo, o el tamaño del archivo es 0 + + + + + The arguments possible are: + Los argumentos posibles son: + + + + + To display the options + Para mostrar las opciones + + + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Para copiar las fuentes a destino, separados por un espacio. Si el destino es "?", Ultracopier le preguntará al usuario + + + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Para mover las fuentes de destino, separados por un espacio. Si el destino es "?", Ultracopier le preguntará al usuario + + + + Command not valid + Comando no válido + + Problem at the reading, or file size is null - Problema en la lectura, o el tamaño del archivo es nulo + Problema en la lectura, o el tamaño del archivo es nulo - + This file is not supported transfer list Este archivo no es compatible con lista de transferencias - + Unable to open the transfer list file No se puede abrir el archivo de lista de transferencias - - The arguments possibles are: - Los posibles argumentos son los siguientes: + Los posibles argumentos son los siguientes: - - - To have this help - Para que esta ayuda + + + To display this help + Para mostrar esta ayuda - - - To quit the other instance running (if have) - Para salir de la carrera otra instancia (si tiene) + + + To quit the other instances (if running) + Para salir de los otros casos (si está activo) - - - To pass transfer list to do - Para pasar lista de transferencias que hacer + + + Open transfer list + Abrir lista de transferencias - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user - Para copiar las fuentes separados por un espacio de destino. Si el destino es "?", Ultracopier lo pida el usuario + To quit the other instance running (if have) + Para salir de la carrera otra instancia (si tiene) - - - Same as above, but with move - Movimiento Igual que el anterior, pero con + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask it to the user + Para copiar las fuentes a destino, separados por un espacio. Si el destino es "?", Ultracopier va a pedir al usuario + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask it to the user + Para mover fuentes de destino, separados por un espacio. Si el destino es "?", Ultracopier va a pedir al usuario - Command line not understand - La línea de comandos que no entiendo + La línea de comandos que no entiendo - + Help Ayuda @@ -82,329 +112,407 @@ CopyEngineManager - - - - + + + + Warning Advertencia - + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + Cannot find any copy engine with motions support - No se puede encontrar cualquier motor de copia con movimientos de apoyo a + No se puede encontrar cualquier motor de copia con movimientos de apoyo a - + Cannot find any compatible engine! No se puede encontrar un motor compatible! - This copy engine does not support motions - Este motor de copia no es compatible con los movimientos + Este motor de copia no es compatible con los movimientos - + Cannot find any engine with this name: %1 No se puede encontrar un motor con este nombre: %1 + + CopyListener + + + Error + Error + + + + Error during the reception of the copy/move list +%1 + Error durante la recepción de la lista de copia / movimiento +%1 + + Core - - - - - - + + + + + + + - - - - - - + + + + Error Error - - - - - - + + + + + + - - Unable to get a copy engine instance No se puede obtener una instancia de motor de copia - + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance + No se puede obtener una instancia del motor + + + + The argument for the mode is not valid + El argumento para el modo no es válida + + + + Do you want to copy? If no, it will be moved. + ¿Quieres copiar? Si no, se puede mover. + + The argument for the mode is not understand - El argumento para el modo no se entiende + El argumento para el modo no se entiende - - + + Unable to load the interface, copy aborted No se puede cargar la interfaz, copia abortados - + Unable to load the copy engine, copy aborted No se puede cargar el motor de copia, copia abortados - + Transfer mode Modo de transferencia - - Do you want do as a copy? Else if you reply no, it will be moved. - ¿Quieres hacer una copia? Porque si usted contesta que no, que se moverá. + Do you want to copy? If you reply no, it will be moved. + ¿Quieres copiar? Si responde que no, que se moverá. + + + + EventDispatcher + + + Key + + + + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + FacilityEngine - + Copy engine Motor de copia - + Copy + a copy Copia - + Move + a move Movimiento - + Pause Pausa - + Resume Resumen - - + + Skip Salto - + Unlimited Ilimitado - + s s - + Too big Demasiado grande - + B B - + KB KB - + MB MB - + GB GB - + TB TB - + PB PB - + EB EB - + ZB ZB - + YB YB - + Less than %10 seconds Menos de %10 segundos - + About %10 seconds remaining Alrededor de %10 segundos restantes - + About %1 minutes remaining Alrededor de %1 minutos restantes - + About %1 hours remaining Alrededor de %1 las horas restantes + Transfer + a transfer + Transferencia + + + + Start + Iniciar + + + Source Origen - + Size Tamaño - + Destination Destino - + Quit Abandonar - + Target Objetivo - - + + Time remaining: Tiempo restante: - + Listing Listado - + Copying Copia - + Listing and copying Listado y copia - + Ask Pedir - + Overwrite Sobrescribir - + Overwrite if newer Sobrescribir si nuevo - + Overwrite if the last modification dates are different Sobrescribir si las fechas de modificación últimos son diferentes - + Rename Cambiar el nombre - + + Put to the end of the list + Ponga al final de la lista + + + + Completed in %1 + Terminado en %1 + + Put to end of the list - Poner a final de la lista + Poner a final de la lista - + Select source directory Seleccione el directorio de origen - + Select destination directory Seleccione el directorio de destino - + Internal error Error interno - + Select one or more files to open Seleccione uno o varios archivos para abrirlos - + All files Todos los archivos - + Save transfer list Guardar lista de transferencias - + Open transfer list Abrir lista de transferencias - + Transfer list Lista de transferencia - + Error Error - + Not supported on this platform No es compatible con esta plataforma @@ -412,67 +520,93 @@ HelpDialog - - About ultracopier - A propósito de ultracopier + + About Ultracopier + Acerca Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - Basado en Qt. Se proporcionan copiadora avanzada con más funciones avanzadas. Es bajo GPL3. -Esta versión se compila como la versión: %1. + Basado en Qt. Utilidad avanzada para copiar los archivos bajo licencia GPL3. +Esta versión está compilada en versión:%1. - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) Plataforma: %1 - + About Qt Acerca de Qt - + Do a crash Hacer a crash - + Save bug report Guardar informe de error - + Close Cerrar - + + About Supercopier + Acerca de Supercopier + + + For http://portableapps.com/ Para http://portableapps.com/ - + + Portable and all in one version + Portable y todo en una versión + + + Portable version Version portable - + + All in one version + Todo en una sola versión + + + Normal version Version normal - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists http://ultracopier-es.first-world.info/ - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + http://ultracopier-es.first-world.info/descarga.html + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages <html><head/><body><p>Para obtener más información, consulte el sitio web <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> @@ -481,12 +615,12 @@ Esta versión se compila como la versión: %1. LocalListener - + Warning Advertencia - + Timeout while recomposing data from connected clients Tiempo de espera, mientras que la recomposición de datos de los clientes conectados @@ -494,22 +628,83 @@ Esta versión se compila como la versión: %1. LogThread - - - + + + Error Error - + Log file already open, error: %1 Entrar archivo ya está abierto, error: %1 - - + + + Unable to open the log file, error: %1 + No se puede abrir el archivo de registro, error: %1 + + Unable to open file to keep the log file, error: %1 - No se puede abrir el archivo para mantener el archivo de registro, error: %1 + No se puede abrir el archivo para mantener el archivo de registro, error: %1 + + + + OSSpecific + + + Warning + Advertencia + + + + Don't show again + No mostrar de nuevo + + + + Ok + Ok + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask to the developer to support it.<br />You need do the copy/move manually. + La sustitución de la copia default / sistema de movimiento no está soportado por el gestor de archivos (Dolphin, Nautilus, ...). <br /> Pregunte al desarrollador para apoyarlo. <br /> Es necesario hacer el copiar / mover manualmente. + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + La sustitución de la copia default / sistema de movimiento no está soportado por el gestor de archivos (Dolphin, Nautilus, ...). <br /> Pregunte al desarrollador para apoyarlo. <br /> Es necesario hacer el copiar / mover manualmente. + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + Reinicie el sistema si previamente se había instalado software similar (como TeraCopy, SuperCopier o una versión anterior de Ultracopier). + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + La sustitución de la copia default / sistema de movimiento no se admite y bloquea buscador de Mac OS X. <br /> Es necesario hacer el copiar / mover manualmente haciendo clic derecho sobre el icono de la bandeja del sistema, cerca del reloj (no el icono del Dock). + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + La sustitución de incumplimiento de copiar / mover sistema no debe ser soportado por el gestor de archivos. <br /> Pregunte al desarrollador para apoyarlo. <br /> Usted necesita hacer el copiar / mover manualmente. + + + + Consider Supercopier as deprecated, prefer Ultracopier + Considere supercopier como obsoleto, prefieren Ultracopier + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html + http://ultracopier-es.first-world.info/descarga.html @@ -532,258 +727,375 @@ Esta versión se compila como la versión: %1. - - + + Copy engine Motor de copia - - + + Themes Themas - + Log Log - - Language: - Idioma: + Load at the session loading: + Carga en la carga de la sesión: - - Autodetect the system language: - Detectar automáticamente el idioma del sistema: + + Confirm to group the windows + Confirmar al grupo de las ventanas - - Catch the copy/move as default: - Coger el copiar/mover de forma predeterminada: + Display the OS warning: + Muestra la advertencia OS: - - Load at the session loading: - Carga en la carga de la sesión: + + Check for updates + Buscar actualizaciones - + Give GPU time to Ultracopier + Dale GPU tiempo + + + Name Nombre - + Version Version - + Language Lenguaje - - + + Listener Oyente - - - + + + Plugin loader Plugin cargador - - - + + + Session loader Sesión cargador - + Check the update + Compruebe la actualización + + + + Force the language + Forzar el idioma + + + + Replace the default copy and move system + Sustituto del sistema de copia + + + + Load at the session loading + Carga en la carga de la sesión + + + + When manual open + Cuando apertura manual + + + + Group the windows when + Grupo de las ventanas cuando + + + + Display the OS warning + Muestra la advertencia OS + + + + Give GPU time to fund the development + Dar tiempo GPU para financiar el desarrollo + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + Plugin Plugin - + Add Añadir - + Remove Eliminar - + Information Información - + Copy engine by order of preference: Copia del motor por orden de preferencia: - + + Client connected + Cliente conectado + + + Themes: Temas: - + Unable to load the themes plugin No se puede cargar el plugin temas - + No option for this plugin No hay ninguna opción para este plugin - + Browse Navegar - - + + Write the transfers + Escriba las transferencias + + + + Write the folder operations + Escriba la carpeta de las operaciones + + + Write directly the file when it receive a new entry (can produce 50% of lost of performance) + Escriba directamente el archivo cuando se recibe una nueva entrada (se puede producir un 50% de pérdida de rendimiento) + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated Las variables son %time%, %source%, %size%, %destination% - - + + Write the errors + Escribir los errores + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated Las variables son %time%, %path%, %size%, %mtime%, %error% - + Write the log file into: Escribir el archivo de registro en: - + Force the language: + Forzar el idioma: + + + Replace the default copy and move system: + Vuelva a colocar la copia por omisión y el sistema de movimiento: + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + Escriba directamente el archivo cuando se recibe una nueva entrada (se puede producir un 50% de pérdida de rendimiento) + + Write the transfers: - Escriba las transferencias: + Escriba las transferencias: - Write the errors: - Escribir los errores: + Escribir los errores: - Write the folder operations: - Escriba la carpeta de las operaciones: + Escriba la carpeta de las operaciones: + + + + + Load + Cargar + + + + Load the theme? + Cargue el tema? + + + + Load the language? + Cargue el idioma? - - - - Disabled because you have any SessionLoader plugin - Desactiveado porque no tienes niguano plugin SessionLoader + Desactiveado porque no tienes niguano plugin SessionLoader + + + + Allow the application + Permitir la aplicación + + + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + Esta versión gratuita de ruptura es sólo si %1 es permitido por su antivirus. Cosa que usted puede obtener la versión normal gratis - + + Enable the OpenCL + Habilite el OpenCL + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + Esta versión Ultimate es sólo si el OpenCL se instala con los controladores de la tarjeta gráfica. Cosa que usted puede obtener la versión normal gratis + + + Disabled because you do not have any SessionLoader plugin + Discapacitados, ya que no tiene ningún plugin SessionLoader + + + Do nothing No hacer nada - + Ask source as folder Pregunte a la fuente que la carpeta - + Ask sources as files Pregunte a las fuentes como archivos - + Never Nunca - + When source is same Cuando la fuente es la misma - + When destination is same Cuando destino es el mismo - + When source and destination are same Cuando la fuente y el destino son los mismos - + When source or destination are same Cuando la fuente o el destino son los mismos - + Always Siempre - - Save logs as: - Guardar registros como: + + + + The variables are %1 + Las variables son %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance - Esta escribir directamente el archivo cuando lo reciba la nueva entrada, pero se puede producir el 50% de pérdida de rendimiento + + Save logs as: + Guardar registros como: - + Synchronized log Registro de sincronizada - When manual open: - Cuando apertura manual: + Cuando apertura manual: - Group the windows when: - Grupo de las ventanas cuando: + Grupo de las ventanas cuando: - - + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated Las variables son %path%, %operation% OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 - Trate de obtener la variable, pero la variable no se encuentra: %1 %2 + + + + + The variable was not found: %1 %2 + La variable no se ha encontrado: %1 %2 @@ -824,37 +1136,42 @@ Esta versión se compila como la versión: %1. Versión: - - CopyEngine + + Copy engine Motor de copia - + Languages Idiomas - + Listener Oyente - - PluginLoader + + Plugin loader Plugin cargador - - SessionLoader + + Session loader Sesión cargador - + Themes Themas - + + Unknown + + + + Information about %1 Información sobre %1 @@ -872,127 +1189,135 @@ Esta versión se compila como la versión: %1. PluginsManager - + informations.xml is not accessible informations.xml no es accesible - informations.xml not found into the plugin - informations.xml que no se encuentran en el plug-in + informations.xml que no se encuentran en el plug-in - + Dependencies part is wrong Parte las dependencias se equivoca - + Dependencies %1 are not satisfied, for plugin: %2 Dependencias %1 no está satisfecho, para el plugin:%2 - + Remove %1 Eliminar %1 - + Error Error - + Information Información - + %1, parse error at line %2, column %3: %4 %1, error de análisis en la línea %2, la columna %3: %4 - + + informations.xml not found for the plugin + informations.xml no se encuentra el plug-in + + + "package" root tag not found for the xml file "package" etiqueta raíz que no se encuentra el archivo xml - + Duplicated plugin found, already loaded! Plugin de duplicados encontrados, ya está cargado! - English text missing into the informations.xml for the tag: %1 - Texto de Inglés que falta en el informations.xml de la etiqueta: %1 + Texto de Inglés que falta en el informations.xml de la etiqueta: %1 - + + English text missing in the informations.xml for the tag: %1 + Texto Inglés falta en el informations.xml para la etiqueta: %1 + + + Tag not found: %1 Etiqueta no encontrada: %1 - + Are you sure about removing "%1" in version %2? ¿Estás seguro de eliminar "%1" en la versión %2? - + Error while the removing plugin, please check the rights on the folder: %1 Error al eliminar el plug-in, por favor, compruebe los derechos de la carpeta: %1 - + Previous import is in progress... Previo de importación está en curso ... - + Open Ultracopier plugin Abrir Plugin Ultracopier - + Ultracopier plugin (*.urc) Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader Plugin cargador - + Unable to open the plugin: %1 No se puede abrir el plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 No se puede cargar el contenido del plugin, por favor verifique que: %1 - + Unable to create a folder to install the plugin: %1 No se puede crear una carpeta para instalar el plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 @@ -1001,16 +1326,16 @@ since:%2 desde: %2 - + Folder with same name is present, skip the plugin installation: %1 Carpeta con el mismo nombre está presente, no tome la instalación del plugin: %1 - - - + + + Unable to load the plugin content, please check it @@ -1022,44 +1347,44 @@ No se puede cargar el contenido del plugin, por favor verifique que QXzDecode - - + + Memory allocation failed La asignación de memoria no - - + + Write error Error de escritura - + Memory usage limit reached Limitar el uso de la memoria alcanza - + Not a .xz file No es un. Xz archivo - + Unsupported options in the .xz headers Opciones no admitidas en los encabezados. Xz - + The file is corrupted El archivo está dañado - + Bug! Bug! - + The input data is too short Los datos de entrada es demasiado corto @@ -1067,87 +1392,139 @@ No se puede cargar el contenido del plugin, por favor verifique que SystrayIcon - - No copy listener found. Do the copy manually by right click one the system tray icon. - + + Information + Información - - Information - Información + + Searching information... + Buscar información... - - Searching informations... - Buscar información... + Not replace the explorer copy/move + No reemplazar la copia explorador/mover - - Not catching the explorer copy/move - No captura la explorer copia/movimiento + + No copy listener found. Do the copy manually by right click one the system tray icon. + + + + + Do not replace the explorer copy/move + No sustituya la copia explorer/move - - Semi catching the explorer copy/move - Semi captura de la explorer copia/movimiento + + Semi replace the explorer copy/move + Semi reemplazar la copia explorer/mudanza - - Catching the explorer copy/move - La captura de la explorer copia/movimiento + + Replace the explorer copy/move + Vuelva a colocar la copia explorer/mudanza - + Warning - Advertencia + Advertencia - - Action on the systray icon is unknown! - Acción en el icono de la bandeja del sistema es desconocido! + + The action on the systray icon is unknown! + La acción en el icono de la bandeja del sistema es desconocido! - + &About/Debug report - &Acerca de/Debug informe + &Acerca de/Debug informe - + &About - &Sobre + &Sobre - + + New version: %1 + Nueva versión: %1 + + + + Click here to go on download page + Haga clic aquí para ir a la página de descarga + + + Click here to go to the shop and login. +Download the new version into the order details + Haga clic aquí para ir a la tienda y al acceso. +Descarga la nueva versión en los detalles de la orden + + + &Save bug Report + &Guardar informe de error + + + + &Save bug report + &Guardar informe de error + + + &Quit - &Dejar de + &Dejar de - + &Options - &Opciones + &Opciones - + A&dd copy/moving - Aña&dir copiar/mover + Aña&dir copiar/mover + + + New version: %1 +Site: %2 + Nueva versión: %1 +Sitio web: %2 + + + + &Copy + &Copia + + + + + &Transfer + &Transferencia + + + + + &Move + &Movimiento - - + + Add &copy - Agregar &copia + Agregar &copia - - + + Add &transfer - Añadir &transferencia + Añadir &transferencia - - + + Add &move - Añadir &movimiento + Añadir &movimiento diff --git a/plugins/Languages/fr/flag.png b/plugins/Languages/fr/flag.png index b74ec94..95c8921 100644 Binary files a/plugins/Languages/fr/flag.png and b/plugins/Languages/fr/flag.png differ diff --git a/plugins/Languages/fr/informations.xml b/plugins/Languages/fr/informations.xml index 9c2a416..a20768f 100644 --- a/plugins/Languages/fr/informations.xml +++ b/plugins/Languages/fr/informations.xml @@ -5,22 +5,21 @@ Languages - + 1287496800 - - + + - 0.3.1.0 + 1.2.3.6 fr diff --git a/plugins/Languages/fr/translation.ts b/plugins/Languages/fr/translation.ts index 7206152..8f1fc7d 100644 --- a/plugins/Languages/fr/translation.ts +++ b/plugins/Languages/fr/translation.ts @@ -4,77 +4,107 @@ CliParser - - - - - + + + + + Warning - Attention + Avertissement - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - Ultracopier est déjà lancé, clique droit sur l'icon du system tray (pret de l'heure) pour l'utilisé + Ultracopier est déjà lancé! Cliquez droit sur l'icône de la zone de notifications (près de l'horloge) pour l'utiliser + + + + Problem reading file, or file size is 0 + Problème à la lecture, ou taille de fichier nulle + + + + + The arguments possible are: + Les arguments possible sont: + + + + + To display the options + Afficher les options + + + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Pour copier les sources vers la destination, séparées par des espaces. Si la destination est "?", Ultracopier demandera à l'utilisateur + + + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Pour copier les sources vers la destination, séparées par des espaces. Si la destination est "?", Ultracopier demandera à l'utilisateur + + + + Command not valid + Ligne de commande invalide - Problem at the reading, or file size is null - Probléme à la lecture, ou taille de fichier nulle + Problème à la lecture, ou taille de fichier nulle - + This file is not supported transfer list Ce fichier n'est pas une list de transfert supporté - + Unable to open the transfer list file Impossible d'ouvrir le fichier de liste de transfert - - The arguments possibles are: - Les arguments possible sont: + Les arguments possible sont: - - - To have this help - Pour avoir cet aide + + + To display this help + Pour afficher cette aide - - - To quit the other instance running (if have) - Pour quiter l'autre instance en cour (si il y as) + + + To quit the other instances (if running) + Pour quiter l'autre instance en cour - - - To pass transfer list to do - Pour passer une liste de transfert à faire + + + Open transfer list + Ouvrir la liste de transfert - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user - Pour copier des source séparés par un espace vers une destination. Si la destination est un "?", ultracopier va la demander à l'utilisateur + To quit the other instance running (if have) + Pour quiter l'autre instance en cour (si il y as) - - - Same as above, but with move - Même chose qu'au dessus, mais avec un déplacement + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask it to the user + Pour copier les sources vers la destination, séparées par des espaces. Si la destination est "?", Ultracopier demandera à l'utilisateur + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask it to the user + Pour déplacer les sources vers la destination, séparées par des espaces. Si la destination est "?", Ultracopier demandera à l'utilisateur - Command line not understand - Ligne de command non comprise + Ligne de commands non comprise - + Help Aide @@ -82,329 +112,409 @@ CopyEngineManager - - - - + + + + Warning - Attention + Avertissement + + + + Cannot find any copy engine with move support + Impossible de trouver un moteur avec le support du déplacement + + + + This copy engine does not support move + Ce moteur de copie ne supporte pas les déplacements - Cannot find any copy engine with motions support - Impossible de trouver un moteur de copie avec le support des déplacements + Impossible de trouver un moteur de copie avec le support des déplacements - + Cannot find any compatible engine! Impossible de trouver un moteur de copie compatible! - This copy engine does not support motions - Ce moteur de copie ne support pas les déplacements + Ce moteur de copie ne supporte pas les déplacements - + Cannot find any engine with this name: %1 - Impossible de trouvé un moteur avec ce nom: %1 + Impossible de trouver un moteur portant ce nom: %1 + + + + CopyListener + + + Error + Erreur + + + + Error during the reception of the copy/move list +%1 + Erreur pendant la réception de la liste de copy/déplacement +%1 Core - - - - - - + + + + + + + - - - - - - + + + + Error Erreur - - - - - - + + + + + + - - Unable to get a copy engine instance Impossible d'obtenir une instance du moteur de copie - + + Group window + Grouper des fenêtres + + + + Do you want group the transfer with another actual running transfer? + Voulez vous grouper le transfert avec le transfert actuel? + + + + Unable to get a engine instance + Impossible d'otenir une instance du moteur de copie + + + + The argument for the mode is not valid + L'argument pour le mode n'est pas valide + + + + Do you want to copy? If no, it will be moved. + Voulez vous faire une copie? Si vous repondez non alors il sera déplacé. + + The argument for the mode is not understand - L'argument pour le mode n'est pas compris + L'argument pour le mode n'est pas compris - - + + Unable to load the interface, copy aborted Impossible de charger l'interface, copie annulée - + Unable to load the copy engine, copy aborted Impossible de charger le moteur de copie, copie annulée - + Transfer mode Mode de transfert - - Do you want do as a copy? Else if you reply no, it will be moved. - Voulez vous le faire comme une copie? Si-non, cela sera fait comme un déplacement. + Do you want to copy? If you reply no, it will be moved. + Voulez vous faire une copie? Si vous repondez nous alors il sera déplacé. + + + + EventDispatcher + + + Key + Clef + + + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + Donnez la clef de ce logiciel, plus d'information sur <a href="http://ultracopier-fr.first-world.info/">ultracopier-fr.first-world.info</a> FacilityEngine - + Copy engine Moteur de copie - + Copy + a copy Copie - + Move + a move Déplacer - + Pause Pause - + Resume Reprendre - - + + Skip Passer - + Unlimited Illimité - + s s - + Too big Trop grand - + B o - + KB Ko - + MB Mo - + GB Go - + TB To - + PB Po - + EB Eo - + ZB Zo - + YB Yo - + Less than %10 seconds Moins de %10 secondes - + About %10 seconds remaining Environ %10 secondes restantes - + About %1 minutes remaining Environ %1 minutes restantes - + About %1 hours remaining Environ %1 heures restantes + Transfer + a transfer + Transfert + + + + Start + Démarrer + + + Source Source - + Size Taille - + Destination Destination - + Quit Quitter - + Target Cible - - + + Time remaining: Temps restant: - + Listing + Création de la liste? Listage? Listing - + Copying + Copie en cour -> copying in progress Copie - + Listing and copying Listing et copie - + Ask Demander - + Overwrite Écraser - + Overwrite if newer Écraser si plus récent - + Overwrite if the last modification dates are different - Écrasé si les dates de modifications sont différentes + Écraser si les dates de modification sont différentes - + Rename Renommer - - Put to end of the list + + Put to the end of the list Mettre à la fin - + + Completed in %1 + Fini en %1 + + + Put to end of the list + Mettre à la fin + + + Select source directory - Selectionner un dossier source + Sélectionner un dossier source - + Select destination directory - Selectionner un dossier de destination + Sélectionner un dossier de destination - + Internal error Erreur interne - + Select one or more files to open - Selectionner un ou des fichiers à ouvrir + Sélectionner un ou des fichiers à ouvrir - + All files - Tout fichiers + Tous les fichiers - + Save transfer list Sauvegarder la liste de transfert - + Open transfer list Ouvrir la liste de transfert - + Transfer list Liste de transfert - + Error Erreur - + Not supported on this platform Pas supporté sur cette platforme @@ -412,81 +522,107 @@ HelpDialog - - About ultracopier - A propos d'ultracopier + + About Ultracopier + À propos d'Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - Basé sur Qt. Il fournit un copieur avec plus d'options avancées. Qui est en GPL3. -Cette version est compilée comme version: %1. + Basé sur Qt. Utilitaire avancé de copie de fichiers sous licence GPL3. +Cette version est compilée comme version : %1. - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) Plateforme: %1 - + About Qt - A propos de Qt + À propos de Qt - + Do a crash Faire un crash - + Save bug report Sauver le rapport - + Close Fermer - + + About Supercopier + À propos de Supercopier + + + For http://portableapps.com/ Pour http://portableapps.com/ - + + Portable and all in one version + Portable et tout en un + + + Portable version Version portable - + + All in one version + Tout en un + + + Normal version Version normale - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists http://ultracopier-fr.first-world.info/ - + + http://ultracopier.first-world.info/shop.html + http://ultracopier-fr.first-world.info/shop.html + + + + http://ultracopier.first-world.info/download.html + http://ultracopier-fr.first-world.info/telecharger.html + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages - <html><head/><body><p>Pour plus d'information voir le site <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> + <html><head/><body><p>Pour plus d'informations voir le site <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> LocalListener - + Warning - Attention + Avertissement - + Timeout while recomposing data from connected clients Timeout pendant la recompossition des données des clients connectés @@ -494,22 +630,83 @@ Cette version est compilée comme version: %1. LogThread - - - + + + Error Erreur - + Log file already open, error: %1 Fichier de log déjà ouvert, erreur: %1 - - + + + Unable to open the log file, error: %1 + Impossible d'ouvrir le fichier de log, erreur: %1 + + Unable to open file to keep the log file, error: %1 - Impossible d'ouvrir le fichier à conserver le fichier de log, erreur: %1 + Impossible d'ouvrir le fichier de log, erreur: %1 + + + + OSSpecific + + + Warning + Avertissement + + + + Don't show again + Ne plus afficher + + + + Ok + Ok + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask to the developer to support it.<br />You need do the copy/move manually. + Le remplacement du systéme de copie/déplacement n'est pas supporté par le gestionnaire de fichier (Dolphin, Nautilus, ...).<br />Demander aux developpeurs de le supporter.<br />Vous devez faire la copie/déplacement manuellement. + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + Le remplacement du systéme de copie/déplacement n'est pas supporté par le gestionnaire de fichier (Dolphin, Nautilus, ...).<br />Demander aux developpeurs de le supporter.<br />Vous devez faire la copie/déplacement manuellement. + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + Redémarrer le système si précédemment vous avez installé un logiciel similaire (comme Teracopy, Supercopier ou une version précédente d'Ultracopier). + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + Le remplacement du systéme de copie/déplacement n'est pas supporté et bloqué par le finder de Mac OS X.<br />Vous devez faire la copie/déplacement manuellement en cliquant sur l'icone du systray à coté de l'heure (pas l'icone du dock). + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + Le remplacement du systéme de copie/déplacement n'est pas supporté par le gestionnaire de fichier.<br />Demander aux developpeurs de le supporter.<br />Vous devez faire la copie/déplacement manuellement. + + + + Consider Supercopier as deprecated, prefer Ultracopier + Considérez Supercopier comme obsolète, préférez Ultracopier + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + Cette version utilise 100% de votre carte graphique/GPU (votre ordinateur peu devenir bruyant ou buggé) en échange d'un accés gratuit à la version Ultimate. Si vous ne le voulez pas téléchargez la version normal qui as une petite publicité (juste un lien sur la fenêtre principal) ou acheter votre version pour financer le projet. + + + + http://ultracopier.first-world.info/download.html + http://ultracopier-fr.first-world.info/telecharger.html @@ -532,258 +729,399 @@ Cette version est compilée comme version: %1. - - + + Copy engine Moteurs de copie - - + + Themes Thèmes - + Log Logs - - Language: - Langue: + Load at the session loading: + Lancer à l'ouverture de la session: - - Autodetect the system language: - Détecter automatiquement la langue: + + Confirm to group the windows + Confirmer pour grouper les fenêtres - - Catch the copy/move as default: - Capturer la copie/déplacement par défaut: + Display the OS warning: + Afficher les avertissements de l'OS: - - Load at the session loading: - Lancer à l'ouverture de la session: + + Check for updates + Vérifier les mise à jour - + Give GPU time to Ultracopier + Donner du temps GPU à Ultracopier + + + Name Nom - + Version Version - + Language Langue - - + + Listener Écouteur - - - + + + Plugin loader Chargeur de plugin - - - + + + Session loader Chargeur de session - + Check the update + Vérifié les mise à jour + + + + Force the language + Forcer la langue + + + + Replace the default copy and move system + Remplacer le système de copie/déplacement par défaut + + + + Load at the session loading + Lancer à l'ouverture de la session + + + + When manual open + Quand ouverture manuel + + + + Group the windows when + Grouper les fenêtres quand + + + + Display the OS warning + Afficher les avertissements de l'OS + + + + Give GPU time to fund the development + Donnez du temps GPU pour financer le développement + + + + Remaining time algorithm + Algorithme de temps restant + + + + Traditional + Traditionnel + + + + Logarithmic + Logarithmique + + + Plugin Plugin - + Add Ajouter - + Remove Supprimer - + Information Informations - + Copy engine by order of preference: Moteurs de copie par ordre de préférence: - + + Client connected + Client connecté + + + Themes: Thèmes: - + Unable to load the themes plugin Impossible de charger le plugin des thèmes - + No option for this plugin Pas d'options pour ce plugin - + Browse Parcourir - - + + Write the transfers + Écrire les transferts + + + + Write the folder operations + Écrire les opérations dossier + + + Write directly the file when it receive a new entry (can produce 50% of lost of performance) + Écrire directement le fichier quand il reçoit une nouvelle entrée (peut entrainer 50% de perte de performances) + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated Les variables sont %time%, %source%, %size%, %destination% - - + + Write the errors + Écrire les erreurs + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated Les variables sont %time%, %path%, %size%, %mtime%, %error% - + Write the log file into: - Ecrire le fichier journal dans: + Écrire le fichier journal dans: + + + Force the language: + Forcer la langue: + + + Replace the default copy and move system: + Remplacer le système de copie/déplacement par défaut: + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + Écrire directement le fichier quand il reçoit une nouvelle entrée (peut entrainer 50% de perte de performances) - Write the transfers: - Ecrire les transfers: + Écrire les transferts: - Write the errors: - Ecrire les erreurs: + Écrire les erreurs: - Write the folder operations: - Rédiger les opérations dossier: + Écrire les opérations dossier: + + + + + Load + Charger + + + Load the themes? + Charger les thèmes? + + + + Load the theme? + Charger le thème? + + + + Load the language? + Charger la langue? - - - - Disabled because you have any SessionLoader plugin - Désactivé car vous n'avez aucun plugin SessionLoader + Désactivé car vous n'avez aucun plugin SessionLoader + + + Allow cgminer + Autoriser cgminer + + + Allow OpenCL + Autorisé OpenCL - + This Ultimate version is only if cgminer is allowed by your antivirus. You can get the normal free version (without cgminer) + Cette version Ultimate est seuelement is cgminer + + + + Allow the application + Autorisé l'application + + + This Ultimate free version is only if %1 is allowed by your antivirus. You can get the normal free version + Cette version Ultimate gratuite est seulement is %1 est autorisé par votre antivirus. + + + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + Cette version Ultimate gratuite est seulement si %1 est autorisé par votre antivirus. Sinon vous pouvez obtenir la version gratuite normale + + + This Ultimate version is only if OpenCL is installed with your graphic card drivers. Else you can get the normal free version + Cette version Ultimate gratuite est seulement si . Sinon vous pouvez obtenir la version gratuite normale + + + + Enable the OpenCL + Activé l'OpenCL + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + Cette version Ultimate gratuite est seulement si l'OpenCL est installé avec vos drivers graphiques. Sinon vous pouvez obtenir la version gratuite normale + + + Disabled because you do not have any SessionLoader plugin + Désactivé car vous n'avez aucun plugin SessionLoader + + + Do nothing Ne rien faire - + Ask source as folder Demander la source comme un dossier - + Ask sources as files Demander la sources comme des fichiers - + Never Jamais - + When source is same Quand la source est la même - + When destination is same Quand la destination est la même - + When source and destination are same Quand la destination et la source sont les mêmes - + When source or destination are same Quand la destination ou la source sont les mêmes - + Always Toujours - - Save logs as: - Sauvegarder les logs sous: + + + + The variables are %1 + Les variables sont %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance - Le fichier est écrit directement quand il reçois une nouvelle entrée, mais il peu produire 50% de perte de performance + + Save logs as: + Sauvegarder les logs sous: - + Synchronized log - Log syncronisé + Log synchronisé - When manual open: - Quand ouverture manuel: + Quand ouverture manuel: - Group the windows when: - Grouper les fenêtres quand: + Grouper les fenêtres quand: - - + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated Les variables sont %path%, %operation% OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 - Essaie d'obtention d'une variable, mais la variable n'as pas été trouvé: %1 %2 + + + + + The variable was not found: %1 %2 + La variable n'a pas été trouvée: %1 %2 @@ -791,7 +1129,7 @@ Cette version est compilée comme version: %1. About this plugin - A propos de ce plugin + À propos de ce plugin @@ -824,37 +1162,42 @@ Cette version est compilée comme version: %1. Version: - - CopyEngine + + Copy engine Moteur de copie - + Languages Langues - + Listener Écouteur - - PluginLoader - Chargeur de plugins + + Plugin loader + Chargeur de plugin - - SessionLoader - Chargeur de sessions + + Session loader + Chargeur de session - + Themes Thèmes - + + Unknown + Inconnu + + + Information about %1 Informations à propos de %1 @@ -872,127 +1215,137 @@ Cette version est compilée comme version: %1. PluginsManager - informations.xml not found into the plugin - Le fichier informations.xml n'a pas été trouvé dans le répertoire du plugin + En anglais c'est: the file informations.xml was not found into the plugin ou the informations.xml file was not found into the plugin? + Le fichier informations.xml n'a pas été trouvé dans le plugin - + informations.xml is not accessible informations.xml n'est pas accessible - + + informations.xml not found for the plugin + Le fichier informations.xml n'a pas été trouvé dans le plugin + + + + English text missing in the informations.xml for the tag: %1 + Texte anglais manquant dans le informations.xml pour la balise: %1 + + + Dependencies part is wrong Les dépendances sont fausses - + Dependencies %1 are not satisfied, for plugin: %2 - Dépendances %1 n'ont pas été satisfaite, pour le plugin: %2 - - - - - - - - - - - - + Des dépendances %1 ne sont pas satisfaites, pour le plugin: %2 + + + + + + + + + + + + Plugin loader Chargeur de plugin - + Remove %1 Supprimer %1 - + Error Erreur - + Information Informations - + %1, parse error at line %2, column %3: %4 %1, erreur à la ligne %2, à l'emplacement %3: %4 - + "package" root tag not found for the xml file - "package" balise root non trouvé pour le fichier xml + La balise racine "package" n'a pas été trouvée pour le fichier xml - + Duplicated plugin found, already loaded! + Le plugins courrant est un doublont, donc déjà chargé! Plugin dupliqué trouvé, déjà chargé! - English text missing into the informations.xml for the tag: %1 - Texte anglais manquant dans le informations.xml pour la balise: %1 + Texte anglais manquant dans le informations.xml pour la balise: %1 - + Tag not found: %1 - Balise non trouvé: %1 + Balise non trouvée: %1 - + Are you sure about removing "%1" in version %2? - Etes vous sur de vouloir supprimé "%1" en version %2? + Êtes vous sûr de vouloir supprimer "%1" en version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - Erreur pendant la suppression du plugin, merci de vérifié les droits sur le dossier: + Erreur pendant la suppression du plugin, merci de vérifier les droits du dossier: %1 - + Previous import is in progress... - Importation précédente en cour... + Importation précédente en cours... - + Open Ultracopier plugin Ouvrir un plugin d'Ultracopier - + Ultracopier plugin (*.urc) Plugin d'Ultracopier (*.urc) - + Unable to open the plugin: %1 Impossible d'ouvrir le plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 Impossible de charger le contenu du plugin, veuillez le vérifier: %1 - + Unable to create a folder to install the plugin: %1 Impossible de créer un dossier pour installer le plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 @@ -1001,16 +1354,16 @@ since:%2 depuis:%2 - + Folder with same name is present, skip the plugin installation: %1 Le répertoire est déjà présent, on saute l'installation du plugin: %1 - - - + + + Unable to load the plugin content, please check it Impossible de charger le contenu du plugin, veuillez le vérifier @@ -1018,44 +1371,44 @@ depuis:%2 QXzDecode - - + + Memory allocation failed Allocation mémoire échouée - - + + Write error Erreur d'écriture - + Memory usage limit reached Limite de mémoire atteinte - + Not a .xz file N'est pas un fichier .xz - + Unsupported options in the .xz headers Options non supportées dans les entêtes des fichiers .xz - + The file is corrupted Le fichier est corrompu - + Bug! Bug! - + The input data is too short Données d'entrée trop courtes @@ -1063,85 +1416,137 @@ depuis:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - Pas d'écouteur trouvé. Effectuez la copie manuelle par le clic droit sur l'icône dans la zone de notification (près de l'horloge). + Pas d'écouteur trouvé. Effectuez la copie manuellement par clic droit sur l'icône dans la zone de notification (près de l'horloge). - - Searching informations... + + Searching information... Recherche d'informations... - - Not catching the explorer copy/move - Ne pas capturer la copie/déplacement de l'explorateur + + Do not replace the explorer copy/move + Ne remplace pas la copie/déplacement de l'explorateur - - Semi catching the explorer copy/move - Interception partielle des copies/déplacements de l'explorateur + + The action on the systray icon is unknown! + L'action sur l'icône de la zone de notifications est inconnue! - - Catching the explorer copy/move - Interception des copies/déplacements de l'explorateur + + &About/Debug report + &À propos/Debug - - Action on the systray icon is unknown! - Action sur l'icône du systray est inconnu! + + &About + &À propos d'ultracopier - - &About/Debug report - &A propos d'ultracopier/Debug + + New version: %1 + Nouvelle version: %1 - - &About - &A propos d'ultracopier + + Click here to go on download page + Cliquez içi pour aller sur la page de téléchargement - + Click here to go to the shop and login. +Download the new version into the order details + Cliquez içi pour aller sur la boutique et vous logger. +Téléchargez la novuelle version dans les détails de la commande + + + &Save bug Report + &Sauvergarder le rapport de bug + + + + &Save bug report + &Sauvergarder le rapport de bug + + + &Quit &Quitter - + &Options &Options - - + New version: %1 +Site: %2 + Nouvelle version: %1 +Site: %2 + + + + &Copy + &Copie + + + + + &Transfer + &Transfert + + + + + &Move + &Déplacer + + + + Add &copy Ajouter une &copie - - + + Add &transfer Ajouter un &transfert - - + + Add &move Ajouter un &déplacement - + A&dd copy/moving &Ajouter une copie/déplacement - + Not replace the explorer copy/move + Ne remplace pas la copie/déplacement de l'explorateur + + + + Semi replace the explorer copy/move + Remplace partiellement la copie/déplacement de l'explorateur + + + + Replace the explorer copy/move + Remplace la copie/déplacement de l'explorateur + + + Warning - Attention + Avertissement - + Information Informations diff --git a/plugins/Languages/hi/flag.png b/plugins/Languages/hi/flag.png index acb0ee3..3ac74be 100644 Binary files a/plugins/Languages/hi/flag.png and b/plugins/Languages/hi/flag.png differ diff --git a/plugins/Languages/hi/informations.xml b/plugins/Languages/hi/informations.xml index e752c0b..e093732 100644 --- a/plugins/Languages/hi/informations.xml +++ b/plugins/Languages/hi/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 hi diff --git a/plugins/Languages/hi/translation.ts b/plugins/Languages/hi/translation.ts index 78d0511..2514652 100644 --- a/plugins/Languages/hi/translation.ts +++ b/plugins/Languages/hi/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/hu/flag.png b/plugins/Languages/hu/flag.png new file mode 100644 index 0000000..5115e8a Binary files /dev/null and b/plugins/Languages/hu/flag.png differ diff --git a/plugins/Languages/hu/informations.xml b/plugins/Languages/hu/informations.xml new file mode 100644 index 0000000..19a1b38 --- /dev/null +++ b/plugins/Languages/hu/informations.xml @@ -0,0 +1,29 @@ + + + <![CDATA[Hungarian translation of Ultracopier]]> + + Languages + + + + + + 1287496800 + + + + 1.2.3.6 + + hu + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/hu/translation.ts b/plugins/Languages/hu/translation.ts new file mode 100644 index 0000000..a78377e --- /dev/null +++ b/plugins/Languages/hu/translation.ts @@ -0,0 +1,1412 @@ + + + + + CliParser + + + + + + + Warning + Figyelmeztetés + + + + Ultracopier is already running, right click on its system tray icon (near the clock) to use it + Az Ultracopier már fut, kattints a jobb egérombbal a tálcaikonjára (az óra mellett) a használatához + + + + Problem reading file, or file size is 0 + Probléma a fájl olvasásánál vagy a fájlméret 0 + + + + + The arguments possible are: + A lehetséges argumentumok: + + + + + To display the options + A beállítások megjelenítéséhez + + + + + To quit the other instances (if running) + Kilépés a többi példányból (ha fut) + + + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + A forrás másolása a célba, szóközzel elválasztva. Ha a cél "?", az Ultracopier rákérdez a felhasználónál + + + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + A forrás mozgatása a célba, szóközzel elválasztva. Ha a cél "?", az Ultracopier rákérdez a felhasználónál + + + + Command not valid + A parancs nem érvényes + + + + This file is not supported transfer list + Ez a fájl nem támogatott átviteli lista + + + + Unable to open the transfer list file + Az átviteli listafájl megnyitása nem lehetséges + + + + + To display this help + Ennek a súgónak a megjelenítéséhez + + + + + Open transfer list + Átviteli lista megnyitása + + + + Help + Súgó + + + + CopyEngineManager + + + + + + Warning + Figyelmzetetés + + + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + + Cannot find any copy engine with motions support + Nem található másolási motor mozgatási támogatással + + + + Cannot find any compatible engine! + Nem található semmilyen kompatibilis motor! + + + This copy engine does not support motions + Ez a másoló motor nem támogatja a mozgatást + + + + Cannot find any engine with this name: %1 + Nem található motor ezzel a névvel: %1 + + + + CopyListener + + + Error + Hiba + + + + Error during the reception of the copy/move list +%1 + Hiba a másolási/mozgatási lista fogadásakor +%1 + + + + Core + + + + + + + + + + + + + + Error + Hiba + + + + + + + + + + Unable to get a copy engine instance + Nem lehetséges másoló motor példány észlelése + + + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance + Motor állapot lekérése nem lehetséges + + + + The argument for the mode is not valid + A mód argumentuma nem érvényes + + + + Do you want to copy? If no, it will be moved. + Szeretnél másolni? Ha nem, akkor átmozgatva lesz. + + + + + Unable to load the interface, copy aborted + Kezelőfelület betöltése nem lehetséges, másolás megszakítva + + + + Unable to load the copy engine, copy aborted + Másoló motor betöltése nem lehetséges, másolás megszakítva + + + + Transfer mode + Átviteli mód + + + + EventDispatcher + + + Key + + + + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + + + + + FacilityEngine + + + s + mp + + + + Too big + Túl nagy + + + + B + B + + + + KB + KB + + + + MB + MB + + + + GB + GB + + + + TB + TB + + + + PB + PB + + + + EB + EB + + + + ZB + ZB + + + + YB + YB + + + + Less than %10 seconds + Kevesebb mint %10 másodperc + + + + About %10 seconds remaining + Körülbelül %10 másodperc van hátra + + + + About %1 minutes remaining + Körülbelül %1 perc van hátra + + + + About %1 hours remaining + Körülbelül %1 óra van hátra + + + + Copy engine + Másoló motor + + + + Copy + a copy + Másolás + + + + Transfer + a transfer + Átvitel + + + + Move + a move + Mozgatás + + + + Start + Indítás + + + + Pause + Szünet + + + + Resume + Folytatás + + + + + Skip + Kihagyás + + + + Unlimited + Korlátlan + + + + Source + Forrás + + + + Size + Méret + + + + Destination + Cél + + + + Quit + Kilépés + + + + Target + Cél + + + + + Time remaining: + Hátralévő idő: + + + + Listing + Listázás + + + + Copying + Másolás + + + + Listing and copying + Listázás és másolás + + + + Ask + Rákérdez + + + + Overwrite + Felülírás + + + + Overwrite if newer + Felülírás, ha újabb + + + + Overwrite if the last modification dates are different + Felülír, ha az legutóbbi módosítás dátumai különböznek + + + + Rename + Átnevezés + + + + Put to the end of the list + Helyezze a lista végére + + + + Select source directory + Válassz forrásmappát + + + + Select destination directory + Válassz célmappát + + + + Internal error + Belső hiba + + + + Select one or more files to open + Válassz egy vagy több fájlt megnyitásra + + + + All files + Minden fájl + + + + Save transfer list + Átviteli lista mentése + + + + Open transfer list + Átviteli lista megnyitása + + + + Transfer list + Átviteli lista + + + + Error + Hiba + + + + Not supported on this platform + Ezen a platformon nem támogatott + + + + Completed in %1 + Befejezve %1 alatt + + + + HelpDialog + + + About Ultracopier + Az Ultracopier névjegye + + + + Based on Qt. Advanced utility to copy files under GPL3 license. +This version is compiled as version: %1. + %1 will be replaced by a variable content (normal, debug, ...) + Qt-n alapul. Fejlett eszöz fájlok másolásához GPL3 licensz alatt. +Ez a verzió a következő verzióként került lefordításra: %1. + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> + %1 will be remplaced by the website into the corresponding languages + <html><head/><body><p>További információkért lásd a honlapot <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + Platform: %1 + + + + About Qt + A Qt névjegye + + + + Do a crash + Összeomlás + + + + Save bug report + Hibajelentés mentése + + + + Close + Bezárás + + + + About Supercopier + A Supercopier névjegye + + + + For http://portableapps.com/ + http://portableapps.com/ + + + + Portable and all in one version + Hordozható és teljes verzió + + + + Portable version + Hordozható verzió + + + + All in one version + Teljes verzió + + + + Normal version + Normál verzió + + + + + + http://ultracopier.first-world.info/ + http://ultracopier.first-world.info/ + + + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + + LocalListener + + + Warning + Figyelmeztetés + + + + Timeout while recomposing data from connected clients + Időtúllépés történt az adatok összeilesztése közben a kapcsolódott kliensektől + + + + LogThread + + + + + Error + Hiba + + + + Log file already open, error: %1 + Naplófájl már meg van nyitva, hiba: %1 + + + + + Unable to open the log file, error: %1 + Naplófájl megnyitása nem lehetséges, hiba: %1 + + + + OSSpecific + + + Warning + Figyelmeztetés + + + + Don't show again + Ne mutassa újra + + + + Ok + Rendben + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + Az alapértelmezett másolás/mozgatás rendszer lecserélését nem támogatja a fájlkezelő (Dolphin, Nautilus, ...).<br />Kérd meg a fejlesztőt, hogy támogassa.<br />A másolás/mozgatást manuálisan kell elvégezned. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + Indítsd újra a gépet, ha korábban már volt hasonló alkalmazás telepítve (például Teracopy, Supercopier vagy az Ultracopier korábbi verziója). + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + Az alapértelmezett másoló/mozgató rendszer lecserélését nem támogatott és blokkolja a Mac OS X fejlesztője.<br />A másolást/mozgatást manuálisan kell elvégezned a tálcaikonra kattintva jobb egérgombbal, az óra mellett. + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + Az alapértelmezett másoló/mozgató rendszer lecserélését nem szabad támogatnia a fájlkezelőnek.<br />Kérd meg a fejlesztőt, hogy támogassa.<br />A másolás/mozgatást manuálisan kell elvégezned. + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html + + + + + OptionDialog + + + + Options + Beállítások + + + + General + Általános + + + + Plugins + Beépülők + + + + + + Copy engine + Másoló motor + + + + + + Listener + Figyelő + + + + + + Plugin loader + Beépüő betöltő + + + + + + Session loader + Folyamat betöltő + + + + + Themes + Témák + + + + Log + Napló + + + + Confirm to group the windows + Ablakok csoportosításának megerősítése + + + + Check for updates + Frissítések keresése + + + + Give GPU time to fund the development + GPU idő kiosztása a fejlesztés támogatásához + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + Írás közvetlenül a fájlba, ha új bejegyzést kap (akár 50%-kos teljesítménycsökkenést is okozhat) + + + + Name + Név + + + + Force the language + Nyelv kényszerítése + + + + Replace the default copy and move system + Alapértelmezett másolás és mozgatás lecserélése + + + + Load at the session loading + Betöltés a Windows bejelentkezésekor + + + + When manual open + Kézi megnyitás esetén + + + + Group the windows when + Ablakok csoportosítása, ha + + + + Display the OS warning + Rendszer figyelmeztetés megjelenítése + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + + Version + Verzió + + + + Language + Nyelv + + + + Plugin + Beépülő + + + + Add + Hozzáadás + + + + Remove + Eltávolítás + + + + Information + Információ + + + + Copy engine by order of preference: + Másoló motor tulajdonság szerint: + + + + Client connected + Kliens kapcsolódva + + + + Themes: + Témák: + + + + Unable to load the themes plugin + A témák beépülő betöltése nem lehetséges + + + + No option for this plugin + Nincs beállítás ehhez a beépülőhöz + + + + Write the log file into: + Napló írása ide: + + + + Browse + Tallózás + + + + Synchronized log + Szinkronizált napló + + + + Write the transfers + Átvitelek írása + + + + Write the errors + Hibák írása + + + + Write the folder operations + Mappa műveletek írása + + + + The variables are %time%, %source%, %size%, %destination% + %time%, %source%, %size%, %destination% should not be translated + A változók: %time%, %source%, %size%, %destination% + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + A változók: %time%, %path%, %size%, %mtime%, %error% + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + A változók: %path%, %operation% + + + + Allow the application + Alkalmazás engedélyezése + + + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + Ez az Ultimate ingyenes verzió csak akkor működik, ha a(z) %1-t engedélyezted a vírusirtódban. Egyéb esetben használd a normál ingyenes verziót + + + + Enable the OpenCL + OpenCL engedélyezése + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + Ez az Ultimate ingyenes verzió csak akkor működik, ha az OpenCL telepítve van a videókártya driverrel. Egyéb esetben használd a normál ingyenes verziót + + + + + Load + Betöltés + + + + Load the theme? + Téma betöltése? + + + + Load the language? + Nyelv betöltése? + + + Disabled because you do not have any SessionLoader plugin + Letiltva, mert nem rendelkezel SessionLoader beépülővel + + + + Do nothing + Ne tegyen semmit + + + + Ask source as folder + Rákérdezés a forrás mint mappa + + + + Ask sources as files + Rákérdezés a forrásokra mint fájlok + + + + Never + Soha + + + + When source is same + Amikor a forrás ugyanaz + + + + When destination is same + Amikor a cél ugyanaz + + + + When source and destination are same + Amikor a forrás és a cél ugyanaz + + + + When source or destination are same + Amikor a forrás vagy cél ugyanaz + + + + Always + Mindig + + + + + + The variables are %1 + A változók: %1 + + + + Save logs as: + Napló mentése mint: + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + A változó nem található: %1 %2 + + + + PluginInformation + + + About this plugin + A beépülő névjegye + + + + Name: + Név: + + + + Category: + Kategória: + + + + Author: + Fejlesztő: + + + + Website: + Honlap: + + + + Date: + Dátum: + + + + Description: + Leírás: + + + + Version: + Verzió: + + + + Title: + Cím: + + + + Copy engine + Másoló motor + + + + Languages + Nyelvek + + + + Listener + Figyelő + + + + Plugin loader + Beépülő betöltő + + + + Session loader + Folyamat betöltő + + + + Themes + Témák + + + + Unknown + + + + + Information about %1 + %1 információi + + + + PluginsManager + + + informations.xml is not accessible + informations.xml nem férhető hozzá + + + + %1, parse error at line %2, column %3: %4 + %1, elemzési hiba a(z) %2. sorban, %3. oszlopban: %4 + + + + "package" root tag not found for the xml file + "package" gyökércímke nem található az xml fájlban + + + + Duplicated plugin found, already loaded! + Duplikált beépülő található, már be van töltve! + + + + informations.xml not found for the plugin + informations.xml nem található a beépülőhöz + + + + English text missing in the informations.xml for the tag: %1 + Angol szöveg hiányzik az informations.xml-ből a címkéhez: %1 + + + + Tag not found: %1 + Címke nem található: %1 + + + + Dependencies part is wrong + A függőségek rész hibás + + + + Dependencies %1 are not satisfied, for plugin: %2 + A(z) %1 függőségek nem megfelelőek a következő beépülőhöz: %2 + + + + Remove %1 + %1 eltávolítása + + + + Are you sure about removing "%1" in version %2? + Biztosan el akarod távolítani "%1"-t a(z) %2 verzióban? + + + + Error + Hiba + + + + Error while the removing plugin, please check the rights on the folder: +%1 + Hiba történt a beépülő eltávolítása közben, kérlek ellenőrizd a jogokat a mappán: %1 + + + + Information + Információ + + + + Previous import is in progress... + Előző importálás folyamatban van... + + + + Open Ultracopier plugin + Ultracopier beépülő megnyitása + + + + Ultracopier plugin (*.urc) + Ultracopier beépülő (*.urc) + + + + + + + + + + + + + Plugin loader + Beépülő betöltő + + + + Unable to open the plugin: %1 + Beéülő megnyitása nem lehetséges: %1 + + + + + + Unable to load the plugin content, please check it: %1 + Beépülő tartalmának betöltése nem lehetséges, kérlek ellenőrizd: %1 + + + + Unable to create a folder to install the plugin: +%1 + Mappa létrehozása a beépülő telepítéséhez nem lehetséges: +%1 + + + + Unable to create a file to install the plugin: +%1 +since:%2 + Fájl létrehozása a beépülő telepítéséhez nem lehetséges: +%1 +óta:%2 + + + + Folder with same name is present, skip the plugin installation: +%1 + Mappa már létezik ilyen néven, beépülő telepítésének kihagyása: +%1 + + + + + + Unable to load the plugin content, please check it + Beépülő tartalmának betöltése nem lehetséges, kérlek ellenőrizd + + + + QXzDecode + + + + Memory allocation failed + Memória allokáció sikertelen + + + + + Write error + Írási hiba + + + + Memory usage limit reached + Memóriahasználat határ elérve + + + + Not a .xz file + Nem .xz fájl + + + + Unsupported options in the .xz headers + Nem támogatott beállítások az .xz fejlécben + + + + The file is corrupted + A fájl hibás + + + + Bug! + Hiba! + + + + The input data is too short + A bemenő adat túl rövid + + + + SystrayIcon + + + No copy listener found. Do the copy manually by right click one the system tray icon. + Nem található másoló figyelő. Végezd el manuálisan a másolást a jobb egérgombbal a tálcaikonra kattintva. + + + + Information + Információ + + + + Searching information... + Információ keresése... + + + + Do not replace the explorer copy/move + Ne cserélje le az Intéző másolását/mozgatását + + + + Semi replace the explorer copy/move + Az Intéző másolás/mozgatás félig lecserélése + + + + Replace the explorer copy/move + Az Intéző másolás/mozgatás lecserélése + + + + Warning + Figyelmeztetés + + + + The action on the systray icon is unknown! + A művelet a tálcaikonon ismeretlen! + + + + &About/Debug report + Né&vjegy/Hibajelentés + + + + &About + &Névjegy + + + + &Save bug report + + + + + New version: %1 + + + + + Click here to go on download page + + + + &Save bug Report + &Hibajelentés mentése + + + + &Quit + &Kilépés + + + + &Options + &Beállítások + + + + A&dd copy/moving + Más&olás/mozgatás hozzáadása + + + New version: %1 +Site: %2 + Új verzió: %1 +Honlap: %2 + + + + &Copy + &Másolás + + + + + &Transfer + &Átvitel + + + + + &Move + M&ozgatás + + + + + Add &copy + Má&solás hozzáadása + + + + + Add &transfer + &Átvitel hozzáadása + + + + + Add &move + &Mozgatás hozzáadása + + + diff --git a/plugins/Languages/id/flag.png b/plugins/Languages/id/flag.png index 188ea2c..e3c0f12 100644 Binary files a/plugins/Languages/id/flag.png and b/plugins/Languages/id/flag.png differ diff --git a/plugins/Languages/id/informations.xml b/plugins/Languages/id/informations.xml index 8f7e8c2..3821ee0 100644 --- a/plugins/Languages/id/informations.xml +++ b/plugins/Languages/id/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 id diff --git a/plugins/Languages/id/translation.ts b/plugins/Languages/id/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/id/translation.ts +++ b/plugins/Languages/id/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/it/flag.png b/plugins/Languages/it/flag.png index a3e3a7b..cc9f71f 100644 Binary files a/plugins/Languages/it/flag.png and b/plugins/Languages/it/flag.png differ diff --git a/plugins/Languages/it/informations.xml b/plugins/Languages/it/informations.xml index 89a936c..20f5298 100644 --- a/plugins/Languages/it/informations.xml +++ b/plugins/Languages/it/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 it diff --git a/plugins/Languages/it/translation.ts b/plugins/Languages/it/translation.ts index 610e750..594562c 100644 --- a/plugins/Languages/it/translation.ts +++ b/plugins/Languages/it/translation.ts @@ -4,77 +4,107 @@ CliParser - - - - - + + + + + Warning - Avvertimento + Avviso - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - Il Programma è gia in esecuzione + Il programma è gia in esecuzione, fare clic con il tasto destro del mouse sulla sua icona della barra di sistema (vicino l'orologio) per usarlo + + + + Problem reading file, or file size is 0 + Problema di lettura o dimensione nulla del file + + + + + The arguments possible are: + Gli argomenti possibili sono: + + + + + To display the options + Mostra le opzioni + + + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Copiare i file di origine alla destinazione separati da uno spazio. Se la destinazione è "?", Ultracopier chiederà all'utente + + + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + Spostare i file di origine alla destinazione separati da uno spazio. Se la destinazione è "?", Ultracopier chiederà all'utente + + + + Command not valid + Comando non valido - Problem at the reading, or file size is null - Problema alla lettura, o la dimensione del file è nullo + Problema di lettura o dimensione nulla del file - + This file is not supported transfer list - Questo file non è supportato lista dei trasferimenti + Questo file non è supportato dalla lista dei trasferimenti - + Unable to open the transfer list file - Impossibile aprire il file lista dei trasferimenti + Impossibile aprire il file della lista dei trasferimenti - - The arguments possibles are: - Gli argomenti possibili sono: + Gli argomenti possibili sono: - - - To have this help - Per avere questo aiuto + + + To display this help + Mostra questo aiuto - - - To quit the other instance running (if have) - Per chiudere il funzionamento altra istanza (se hanno) + + + To quit the other instances (if running) + Chiudere le altre istanze (se in esecuzione) - - - To pass transfer list to do - Per passare lista di trasferimento di fare + + + Open transfer list + Apri la lista dei trasferimenti - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user - Per copiare sorgenti separate da uno spazio a destinazione. Se la destinazione è "?", Ultracopier lo chiederà all'utente + To quit the other instance running (if have) + Chiudere l'altra istanza in esecuzione (se necessario) - - - Same as above, but with move - Stessa mossa come sopra, ma con + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask it to the user + Copiare i file di origine alla destinazione separati da uno spazio. Se la destinazione è "?", Ultracopier chiederà all'utente + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask it to the user + Spostare i file di origine alla destinazione separati da uno spazio. Se la destinazione è "?", Ultracopier chiederà all'utente - Command line not understand - Riga di comando non capire + Riga di comando non idonea - + Help Aiuto @@ -82,329 +112,404 @@ CopyEngineManager - - - - + + + + Warning - Avvertimento + Avviso + + + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + - Cannot find any copy engine with motions support - Non è stato nessuna copia del programma con nozioni di sopporto + Impossibile trovare alcun motore per la copia con supporto trasferimenti - + Cannot find any compatible engine! - Non è stato trovato nessun programma compatibile! + Impossibile trovare un motore per la copia compatibile! - This copy engine does not support motions - Questa copia del programma non sopporta le nozioni + Questo motore per la copia non supporta trasferimenti - + Cannot find any engine with this name: %1 - Non riesci a trovare un motore con questo nome: %1 + Impossibile trovare un motore per la copia con questo nome: %1 + + + + CopyListener + + + Error + Errore + + + + Error during the reception of the copy/move list +%1 + Errore durante la ricezione della lista di copia/spostamento +%1 Core - - - - - - + + + + + + + - - - - - - + + + + Error Errore - - - - - - + + + + + + - - Unable to get a copy engine instance - Impossibile ottenere un'istanza motore di copia + Impossibile ottenere un'istanza dal motore per la copia + + + + Group window + Raggruppa finestre + + + + Do you want group the transfer with another actual running transfer? + Vuoi un altro gruppo di trasferimento con un altro trasferimento attualmente avviato? + + + + Unable to get a engine instance + Impossibile ottenere un'istanza dal motore per la copia + + + + The argument for the mode is not valid + L'argomento per la modalità non è valido + + + + Do you want to copy? If no, it will be moved. + Vuoi copiarlo? se no, verrà spostato. - The argument for the mode is not understand - L'argomento per la modalità non è capire + L'argomento per la modalità non è idoneo - - + + Unable to load the interface, copy aborted - Impossibile caricare l'interfaccia, copia abortita + Impossibile avviare l'interfaccia, copia interrotta - + Unable to load the copy engine, copy aborted - Impossibile caricare il programma di copia, copia abortita + Impossibile avviare il motore per la copia, copia interrotta - + Transfer mode Modalità di trasferimento + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. - Vuoi fare come una copia? Altrimenti, se si risponde no, verrà spostato. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + FacilityEngine - + Copy engine - Copia il programma + Motore per la copia - + Copy + a copy Copia - + Move - Muovi + a move + Sposta - + Pause Pausa - + Resume - Riprendere + Riprendi - - + + Skip - Saltare + Salta - + Unlimited Illimitato - + s s - + Too big Troppo grande - + B B - + KB KB - + MB MB - + GB GB - + TB TB - + PB PB - + EB EB - + ZB ZB - + YB YB - + Less than %10 seconds - Meno di %10 secondi sulla + Meno di %10 secondi - + About %10 seconds remaining Circa %10 secondi rimanenti - + About %1 minutes remaining Circa %1 minuti rimanenti - + About %1 hours remaining - Circa %1 restanti ore + Circa %1 ore rimanenti + Transfer + a transfer + Trasferisci + + + + Start + Uno spostamento + Avvia + + + Source - Fonte + Cartella di origine - + Size Dimensione - + Destination - Destinazione + Cartella di destinazione - + Quit - Smettere + Esci - + Target Obiettivo - - + + Time remaining: Tempo residuo: - + Listing Elenco - + Copying Copiatura - + Listing and copying - Elenco e copia + Elenca e copia - + Ask - Chiedere + Chiedi - + Overwrite Sovrascrivi - + Overwrite if newer Sovrascrivi se più recente - + Overwrite if the last modification dates are different - Sovrascrivi se le date di modifica ultimi sono diversi + Sovrascrivi se sono diverse le date dell'ultima modifica - + Rename - Rinominare + Rinomina + + + + Put to the end of the list + Metti in coda alla lista + + + + Completed in %1 + Completato in %1 - Put to end of the list - Messo alla fine della lista + Metti in coda alla lista - + Select source directory - Selezionare la directory di origine + Selezionare la cartella di origine - + Select destination directory - Selezionare la directory di destinazione + Selezionare la cartella di destinazione - + Internal error Errore interno - + Select one or more files to open Selezionare uno o più file da aprire - + All files Tutti i file - + Save transfer list - Salva lista dei trasferimenti + Salvare la lista dei trasferimenti - + Open transfer list Aprire lista dei trasferimenti - + Transfer list - Transfer list + Lista dei trasferimenti - + Error Errore - + Not supported on this platform Non supportato su questa piattaforma @@ -412,104 +517,195 @@ HelpDialog - - About ultracopier - Informazioni su UltraCopier + + About Ultracopier + Informazioni su Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - Sulla base Qt. Fornisce copiatrice avanzata con più funzionalità avanzate. E 'sotto GPL3. -Questa versione è compilato come versione: %1. + %1 sarà rimpiazzata da una variabile content (normale, debug, ...) + Utility avanzata sotto licenza GPL3 per la copia dei file basata su Qt. +Compilata come versione: %1. - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) + %1 sarà rimpiazzata dalla piattaforma (Windows, Mac, Linux, ...) Piattaforma: %1 - + About Qt - A proposito di Qt + Informazioni su Qt - + Do a crash - Fare un incidente + Si è verificato un crash - + Save bug report Salva il bug - + Close Chiudi - + + About Supercopier + Info su Supercopier + + + For http://portableapps.com/ - Per http://portableapps.com/ + Su http://portableapps.com/ - + + Portable and all in one version + Versione portatile e pluricomprensiva + + + Portable version Versione portatile - + + All in one version + Versione pluricomprensiva + + + Normal version Versione normale - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - http://ultracopier.first-world.info/ + Questo dovrebbe essere il sito ufficiale di Ultracopier in italiano + http://ultracopier-it.first-world.info/ + + + + http://ultracopier.first-world.info/shop.html + - + + http://ultracopier.first-world.info/download.html + http://ultracopier.first-world.info/download.html + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages + %1 sarà rimpiazzato dal sito italiano <html><head/><body><p>Per ulteriori informazioni consultare il sito <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> LocalListener - + Warning - Avvertimento + Avviso - + Timeout while recomposing data from connected clients - Timeout durante la ricomposizione dei dati dai client collegati + Tempo scaduto durante la ricomposizione dei dati dai client collegati LogThread - - - + + + Error Errore - + Log file already open, error: %1 - Log file già aperto, errore: %1 + File log già aperto, errore: %1 + + + + + Unable to open the log file, error: %1 + Impossibile aprire il file di log, errore: %1 - - Unable to open file to keep the log file, error: %1 - Impossibile aprire il file per mantenere il file di log, l'errore: %1 + Impossibile aprire il file che contiene il log, errore: %1 + + + + OSSpecific + + + Warning + Avviso + + + + Don't show again + Non visualizzare più questo messaggio + + + + Ok + Ok + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask to the developer to support it.<br />You need do the copy/move manually. + Il ripristino del sistema predefinito di copia/spostamento non è supportato dal file manager (Dolphin, Nautilus, ...).<br />Chiedere supporto allo sviluppatore.<br />Bisogna fare la copia/spostamento manuale. + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + Il ripristino del sistema predefinito di copia/spostamento non è supportato dal file manager (Dolphin, Nautilus, ...).<br />Chiedere supporto allo sviluppatore.<br />Bisogna fare la copia/spostamento manuale. + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + Riavviare il sistema, se in precedenza avevi installato un software simile a questo (come Teracopy, Supercopier o una versione precedente di Ultracopier). + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + Il ripristino del sistema predefinito di copia/spostamento non è supportato, quindi viene bloccato dal finder of Mac OS X.<br />Chiedere supporto allo sviluppatore.<br />Sarà possibile la copia/spostamento manuale cliccando col tasto destro del mouse sull'icona della barra di sistema vicina all'orologio (non l'icona dock). + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + Il ripristino del sistema predefinito di copia/spostamento potrebbe non essere supportato dal file manager.<br />Chiedere supporto allo sviluppatore.<br />Bisogna fare la copia/spostamento manuale. + + + + Consider Supercopier as deprecated, prefer Ultracopier + Considera Supercopier obsoleto, preferisco Ultracopier + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + Questa versione utilizza il 100% della tua scheda grafica/GPU (il computer può essere rumoroso, o lento durante i giochi) in cambio del libero accesso alla versione Ultimate. Se non lo desideri, scarica la versione normale con un piccolo annuncio (solo un link sulla finestra principale) o acquista la versione Ultimate per finanziare il progetto. + + + + http://ultracopier.first-world.info/download.html + http://ultracopier.first-world.info/download.html @@ -528,262 +724,382 @@ Questa versione è compilato come versione: %1. Plugins - Plugins + I plug-in - - + + Copy engine - Copia del programma + Motore per la copia - - + + Themes Temi - + Log Log - - Language: - Linguaggio: - - - - Autodetect the system language: - Detezione automatica della lingua: + Load at the session loading: + Carica il programma all'avvio: - - Catch the copy/move as default: - Metter il copia/muovi standard: + Display the OS warning: + Mostra l'avviso del Sistema Operativo: - - Load at the session loading: - Caricato al caricamento della sessione: + + Check for updates + Controlla aggiornamenti automaticamente - + Name Nome - + Version Versione - + Language - Linguaggio + Lingua - - + + Listener - Ascoltatore + Rilevatore - - - + + + Plugin loader - Plugin caricati + Caricatore di plug-in - - - + + + Session loader - Sessione caricata + Caricatore di sessione + + + + Force the language + Utilizza la lingua + + + + Replace the default copy and move system + Ripristina il sistema di copia e spostamento predefinito - + + Load at the session loading + Carica il programma all'avvio di sistema + + + + When manual open + Se avviato manualmente + + + + Group the windows when + Quando raggruppare le finestre + + + + Confirm to group the windows + Conferma il raggruppamento delle finestre + + + Check the update + Controllare aggiornamenti + + + + Display the OS warning + Mostra l'avviso del Sistema Operativo + + + + Give GPU time to fund the development + Dai tempo alla GPU per sostenere lo sviluppo + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + Plugin - Plugin + Plug-in - + Add - Aggiungere + Aggiungi - + Remove - Rimuovere + Elimina - + Information Informazioni - + Copy engine by order of preference: - Copiare il programma nel ordine preferita: + Motore per la copia in ordine di preferenza: + + + + Client connected + Client connessi - + Themes: Temi: - + Unable to load the themes plugin - Attivare per caricare i temi dei plugin + Impossibile caricare il plug-in dei temi - + No option for this plugin - Non ci sono opzioni per questo plugin + Non ci sono opzioni per questo plug-in - + Browse - Esplora + Sfoglia - - + + Write the transfers + Scrivere i trasferimenti + + + + Write the folder operations + Scrivere le operazioni di cartella + + + Write directly the file when it receive a new entry (can produce 50% of lost of performance) + Scrivere direttamente il file quando si riceve una nuova voce (può causare il 50% di perdita di prestazioni) + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% non dovranno essere tradotti Le variabili sono %time%, %source%, %size%, %destination% - - + + Write the errors + Scrivere gli errori + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% non dovranno essere tradotti Le variabili sono %time%, %path%, %size%, %mtime%, %error% - + Write the log file into: Scrivere il file di log in: - + Force the language: + Utilizzare la lingua: + + + Replace the default copy and move system: + Ripristina il sistema di copia e spostamento predefinito: + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + Scrivere direttamente il file quando si riceve una nuova voce (può causare il 50% di perdita di prestazioni) + + Write the transfers: - Scrivi i trasferimenti: + Scrivere i trasferimenti: - Write the errors: - Scrivi gli errori: + Scrivere gli errori: - Write the folder operations: - Scrivi le operazioni di cartelle: + Scrivere le operazioni di cartella: + + + + + Load + Carica + + + Load the themes? + Caricare i temi? + + + + Load the theme? + Caricare i temi? + + + + Load the language? + Caricare questa lingua? - - - - Disabled because you have any SessionLoader plugin - Disabilitato perchè non c'è nessun SessionLoader plugin + Disattivato perché non c'è nessun plug-in SessionLoader - + Disabled because you do not have any SessionLoader plugin + Disattivato perché non si dispone di alcun plug-in SessionLoader + + + Do nothing Non fare nulla - + Ask source as folder - Chiedi come cartella sorgente + Chiedere la cartella di origine - + Ask sources as files - Chiedi fonti come file + Chiedere i file di origine - + Never Mai - + When source is same - Quando sorgente è uguale + Quando la cartella di origine è uguale - + When destination is same - Quando destinazione è uguale + Quando la cartella di destinazione è uguale - + When source and destination are same - Quando origine e di destinazione sono le stesse + Quando sia le cartelle di origine che di destinazione sono uguali - + When source or destination are same - Quando la fonte o la destinazione sono gli stessi + Quando le cartelle di origine o di destinazione coincidono - + Always Sempre - - Save logs as: - Salvare i log come: + + + + The variables are %1 + Le variabili sono %1 + + + + Allow the application + Consentire l'applicazione + + + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + Questa versione Ultimate è gratuita solo se %1 è consentita dal tuo antivirus. Altrimenti si può ottenere la versione normale gratuita + + + + Enable the OpenCL + Abilita le OpenCL - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance - Questo scrive direttamente il file quando riceve un' altra entrata, ma questo produce un calo del 50% della velocità + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + Questa versione Ultimate è solo per chi ha installato OpenCL con i driver della scheda grafica. Diversamente puoi ottenere la versione gratuita + + + + Save logs as: + Salvare i log come: - + Synchronized log Log sincronizzato - When manual open: - Quando manuale aperto: + Se avviato manualmente: - Group the windows when: - Gruppo finestre quando: + Raggruppa le finestre quando: - - + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated + %path% e %operation%, non dovranno essere tradotti Le variabili sono %path%, %operation% OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 - Provare a ottenere variabile, ma la variabile non si trova: %1 %2 + + + + + The variable was not found: %1 %2 + Variabile non trovata: %1 %2 @@ -791,7 +1107,7 @@ Questa versione è compilato come versione: %1. About this plugin - Informazioni su questo plugin + Informazioni su questo plug-in @@ -824,37 +1140,42 @@ Questa versione è compilato come versione: %1. Versione: - - CopyEngine - Copiare il programma + + Copy engine + Motore per la copia - + Languages - Linguaggio + Lingue - + Listener - Ascoltatore + Rilevatore - - PluginLoader - Caricatore di plugin + + Plugin loader + Caricatore di plug-in - - SessionLoader - Caricatore di sessioni + + Session loader + Caricatore di sessione - + Themes Temi - + + Unknown + Sconosciuto + + + Information about %1 Informazioni su %1 @@ -872,190 +1193,198 @@ Questa versione è compilato come versione: %1. PluginsManager - + informations.xml is not accessible informations.xml non è accessibile - informations.xml not found into the plugin - informations.xml non trovato nel plug-in + informations.xml non trovato nel plug-in - + Dependencies part is wrong - Parte Dipendenze è sbagliato + Alcune dipendenze non sono idonee - + Dependencies %1 are not satisfied, for plugin: %2 - Dipendenze %1 non sono soddisfatti, per il plugin: %2 + Le dipendenze %1 per il plug-in: %2, non sono soddisfatte - + Remove %1 - Rimuovi %1 + Elimina %1 - + Error Errore - + Information Informazioni - + %1, parse error at line %2, column %3: %4 %1, errore di analisi alla riga %2, colonna %3: %4 - + + informations.xml not found for the plugin + informations.xml non trovato per il plug-in + + + "package" root tag not found for the xml file - "package" tag root non trovato per il file xml + Tag root "package" non trovato nel file xml - + Duplicated plugin found, already loaded! - Plug-in duplicato trovato, già caricato! + Trovato plug-in duplicato, già caricato! - English text missing into the informations.xml for the tag: %1 - Testo inglese manca nel informations.xml per il tag: %1 + Testo in inglese mancante in informations.xml per il tag: %1 + + + + English text missing in the informations.xml for the tag: %1 + Testo in inglese mancante in informations.xml per il tag: %1 - + Tag not found: %1 Tag non trovato: %1 - + Are you sure about removing "%1" in version %2? - Sei sicuro di rimozione "%1" nella versione %2? + Si desidera eliminare "%1" nella versione %2? - + Error while the removing plugin, please check the rights on the folder: %1 - Errore durante il plugin di rimuovere, controllare i diritti per la cartella: + Errore durante l'eliminazione del plug-in, controllare le autorizzazioni per la cartella: %1 - + Previous import is in progress... - Importazione precedente è in corso ... + Importazione precedente in corso ... - + Open Ultracopier plugin - Aperto Ultracopier plugin + Apri plug-in di Ultracopier - + Ultracopier plugin (*.urc) - Ultracopier plugin (*.urc) - - - - - - - - - - - - + Plug-in di Ultracopier (*.urc) + + + + + + + + + + + + Plugin loader - Plugin caricato + Caricatore di plug-in - + Unable to open the plugin: %1 - Attivare per aprire il puglin: %1 + Impossibile aprire il plug-in: %1 - - - + + + Unable to load the plugin content, please check it: %1 - Impossibile caricare il contenuto plugin, si prega di controllare: %1 + Impossibile caricare il contenuto del plug-in, si prega di controllare: %1 - + Unable to create a folder to install the plugin: %1 - Impossibile creare una cartella per installare il plugin: + Impossibile creare una cartella per installare il plug-in: %1 - + Unable to create a file to install the plugin: %1 since:%2 - Impossibile creare un file per installare il plugin: + Impossibile creare un file per installare il plug-in: %1 -dal: %2 +da: %2 - + Folder with same name is present, skip the plugin installation: %1 - Cartella con lo stesso nome è presente, saltare l'installazione del plugin: + E' presente una cartella con lo stesso nome, non sarà installato il plug-in: %1 - - - + + + Unable to load the plugin content, please check it - Impossibile caricare il contenuto plugin, si prega di controllare + Impossibile caricare il contenuto del plug-in, si prega di controllare QXzDecode - - + + Memory allocation failed Allocazione di memoria fallita - - + + Write error Errore di scrittura - + Memory usage limit reached Limite di memoria raggiunto - + Not a .xz file Non è un file .xz - + Unsupported options in the .xz headers - Opzioni non sopportate nel .xz headers + Opzioni non supportate nelle intestazioni .xz - + The file is corrupted Il file è corrotto - + Bug! Bug! - + The input data is too short I dati inseriti sono troppo pochi @@ -1063,87 +1392,131 @@ dal: %2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - Nessun listener copia trovata. Do la copia manualmente facendo clic destro uno nella barra delle applicazioni. + Nessuna copia del rilevatore trovata. Fare una copia manualmente cliccando col tasto destro del mouse sull'icona nella barra di sistema. - + Information Informazioni - - Searching informations... - Cercare informazioni... + + Searching information... + Ricerca informazioni... + + + Not replace the explorer copy/move + Non ripristinare la copia/spostamento di Windows explorer - - Not catching the explorer copy/move - Non mostrare il copia/muovi + + Do not replace the explorer copy/move + Non ripristinare la copia/spostamento di Windows explorer - - Semi catching the explorer copy/move - Mostra in parte il copia/muovi + + Semi replace the explorer copy/move + Ripristinare parzialmente la copia/spostamento di Windows explorer - - Catching the explorer copy/move - Mostra il copia/muovi + + Replace the explorer copy/move + Ripristina la copia/spostamento di Windows explorer - + Warning - Avvertimento + Avviso - - Action on the systray icon is unknown! - Azione sull'icona del systray è sconosciuta! + + The action on the systray icon is unknown! + Azione non idonea nell'area di notifica! - + &About/Debug report - Circa/Debug rapporto + &Informazioni/Rapporto di Debug - + &About - Circa + &Informazioni + + + + &Save bug report + &Salva il bug - + &Quit - Smettere + &Esci - + &Options - Opzioni + &Opzioni - + A&dd copy/moving - Aggiungi copia/spostamento + &Aggiungi copia/spostamento + + + + New version: %1 + Nuova versione: %1 + + + + Click here to go on download page + Clicca qui per accedere alla pagina di download + + + Click here to go to the shop and login. +Download the new version into the order details. +The new version have been sended by email too, look into your spams if needed. + Clicca qui per andare al negozio ed effettuare il login. +Scarica la nuova versione nei dettagli dell'ordine. +La nuova versione è stata inviata anche via e-mail, controlla negli spam se necessario. + + + + &Copy + &Copia + + + + + &Transfer + &Trasferisci + + + + + &Move + &Sposta - - + + Add &copy - Aggiungi copia + Aggiungi &copia - - + + Add &transfer - Aggiungi il trasferimento + Aggiungi &trasferimento - - + + Add &move - Aggiungi spostare + Aggiungi &spostamento diff --git a/plugins/Languages/ja/flag.png b/plugins/Languages/ja/flag.png index 0cd1398..5ac331e 100644 Binary files a/plugins/Languages/ja/flag.png and b/plugins/Languages/ja/flag.png differ diff --git a/plugins/Languages/ja/informations.xml b/plugins/Languages/ja/informations.xml index 0bd57b8..555a952 100644 --- a/plugins/Languages/ja/informations.xml +++ b/plugins/Languages/ja/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 jp diff --git a/plugins/Languages/ja/translation.ts b/plugins/Languages/ja/translation.ts index 4d63b67..8a6d55f 100644 --- a/plugins/Languages/ja/translation.ts +++ b/plugins/Languages/ja/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help - + + + Open transfer list + + + + Help @@ -82,410 +88,493 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? - - + + Unable to get a engine instance + + + + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists + + + + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,245 +673,306 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Name + + + + + Version + + + + + Language + + + + + Client connected + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: - - - - - When manual open: + When manual open - - Group the windows when: + + Group the windows when - - Name + + Confirm to group the windows - - Version + + Display the OS warning - - Language + + Check for updates - - - The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + Themes: - + Unable to load the themes plugin - + No option for this plugin - + Browse - - + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - - The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + + Write the errors - - Write the log file into: + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated - - Write the transfers: + + Write the log file into: - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 + + + + + Allow the application - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - + + Enable the OpenCL + + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + Synchronized log @@ -777,11 +980,11 @@ This version is compiled as version: %1. OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/ko/flag.png b/plugins/Languages/ko/flag.png index e0e278a..1dfaf96 100644 Binary files a/plugins/Languages/ko/flag.png and b/plugins/Languages/ko/flag.png differ diff --git a/plugins/Languages/ko/informations.xml b/plugins/Languages/ko/informations.xml index 2a0dfce..877111a 100644 --- a/plugins/Languages/ko/informations.xml +++ b/plugins/Languages/ko/informations.xml @@ -13,12 +13,11 @@ - 0.3.0.6 + 1.2.3.6 ko diff --git a/plugins/Languages/ko/translation.ts b/plugins/Languages/ko/translation.ts index 6971c7a..e6c41b2 100644 --- a/plugins/Languages/ko/translation.ts +++ b/plugins/Languages/ko/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning 알림 - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it Ultracopier가 이미 실행중입니다. 사용하려면 트레이 아이콘에서 우클릭하십시오 - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file + + + + + + To display this help - - Command line not understand + + + Open transfer list - + Help @@ -82,410 +88,501 @@ CopyEngineManager - - - - + + + + Warning 알림 - + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + Cannot find any copy engine with motions support - 동작 감지를 지원하는 복사 엔진을 찾을 수 없습니다 + 동작 감지를 지원하는 복사 엔진을 찾을 수 없습니다 - + Cannot find any compatible engine! 호환되는 엔진을 찾을 수 없습니다! - This copy engine does not support motions - 이 복사 엔진은 동작 감지를 지원하지 않습니다 + 이 복사 엔진은 동작 감지를 지원하지 않습니다 - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + 오류 + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error 오류 - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? - - + + Unable to get a engine instance + + + + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted 인터페이스를 불러올 수 없음, 복사가 취소되었습니다 - + Unable to load the copy engine, copy aborted 복사 엔진을 불러올 수 없음, 복사가 취소되었습니다 - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine 복사 엔진 - + Copy + a copy 복사 - + Move + a move 이동 - + Pause 일시 중지 - + Resume 다시 시작 - - + + Skip 건너뛰기 - + Unlimited 무제한 - + s - + Too big 너무 큽니다 - + B B - + KB KB - + MB MB - + GB GB - + TB TB - + PB PB - + EB EB - + ZB ZB - + YB YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error 오류 - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier - UltraCopier 정보 + + About Ultracopier + - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - Qt에 기반으로 더욱 고급 기능의 복사기를 제공합니다. UltraCopier는 GPL3 라이센스를 따릅니다. 이 버전은 %1(으)로 컴파일 되었습니다. + - + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) 플랫폼: %1 - + About Qt Qt에 대해 - + Do a crash 충돌 발생시 - + Save bug report 버그 보고서 저장 - + Close 닫기 - + + About Supercopier + + + + For http://portableapps.com/ http://portableapps.com을 위해 - + + Portable and all in one version + + + + Portable version 포터블 버전 - + + All in one version + + + + Normal version 일반 버전 - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists http://ultracopier.first-world.info/ + + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + LocalListener - + Warning 알림 - + Timeout while recomposing data from connected clients 연결된 클라이언트로부터 데이터를 재구성하는 동안에 시간이 초과되었습니다 @@ -493,22 +590,79 @@ This version is compiled as version: %1. LogThread - - - + + + Error 오류 - + Log file already open, error: %1 - - + + + Unable to open the log file, error: %1 + + + Unable to open file to keep the log file, error: %1 - 로그 파일로 보존할 파일을 열 수 없습니다. 오류: %1 + 로그 파일로 보존할 파일을 열 수 없습니다. 오류: %1 + + + + OSSpecific + + + Warning + 알림 + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html + @@ -531,245 +685,326 @@ This version is compiled as version: %1. - - + + Copy engine 복사 엔진 - - + + Themes 테마 - + Log 로그 - - Language: - 언어: - - - - Autodetect the system language: - 시스템 언어 자동 감지: - - - - Catch the copy/move as default: - 기본으로 복사/이동 자동 감지: - - - Load at the session loading: - 세션 시작시 프로그램 실행: + 세션 시작시 프로그램 실행: - - When manual open: + + Confirm to group the windows - - Group the windows when: + + Check for updates - + Name 이름 - + Version 버전 - + Language 언어 - - + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated - - + + Listener 리스너 - - - + + + Plugin loader 플러그인 로더 - - - + + + Session loader 섹션 로더 - + + Force the language + + + + + Replace the default copy and move system + + + + + Load at the session loading + + + + + When manual open + + + + + Group the windows when + + + + + Display the OS warning + + + + + Give GPU time to fund the development + + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + Plugin 플러그인 - + Add 추가 - + Remove 제거 - + Information 정보 - + Copy engine by order of preference: 복사 엔진 순서 환경 설정: - + + Client connected + + + + Themes: 테마: - + Unable to load the themes plugin 테마 플러그인을 불러올 수 없습니다 - + No option for this plugin 이 플러그인에 대한 옵션이 없습니다 - + Browse 찾아보기 - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated 변수는 %time%, %source%, %size%, %destination% 입니다 - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated 변수는 %time%, %path%, %size%, %mtime%, %error% 입니다 - + Write the log file into: 로그 파일 작성: - Write the transfers: - 전송 내역 작성: + 전송 내역 작성: - Write the errors: - 오류 내역 작성: + 오류 내역 작성: - Write the folder operations: - 폴더 작업 작성: + 폴더 작업 작성: + + + + + Load + + + + + Load the theme? + + + + + Load the language? + - - - - Disabled because you have any SessionLoader plugin - 어떤 세션로더 플러그인을 보유중이므로 비활성화되었습니다 + 어떤 세션로더 플러그인을 보유중이므로 비활성화되었습니다 - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: - 로그 따로 저장: + + + + The variables are %1 + + + + + Allow the application + + + + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + + + + + Enable the OpenCL + + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance - 새로운 항목을 접수할 때 파일을 바로 작성합니다. 하지만 성능이 50% 정도 저하될 수 있습니다 + + Save logs as: + 로그 따로 저장: - + Synchronized log 로그 동기화됨 @@ -777,11 +1012,11 @@ This version is compiled as version: %1. OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1058,42 @@ This version is compiled as version: %1. 버전: - - CopyEngine - 복사 엔진 + + Copy engine + 복사 엔진 - + Languages 언어 - + Listener 리스너 - - PluginLoader - 플러그인로더 + + Plugin loader + 플러그인 로더 - - SessionLoader - 세션로더 + + Session loader + 섹션 로더 - + Themes 테마 - + + Unknown + + + + Information about %1 %1 파일 정보 @@ -871,126 +1111,134 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible informations.xml 파일에 연결할 수 없습니다 - informations.xml not found into the plugin - 플러그인에서 informations.xml 파일을 찾을 수 없습니다 + 플러그인에서 informations.xml 파일을 찾을 수 없습니다 - + Dependencies part is wrong 종속된 부분이 잘못되었습니다 - + Dependencies %1 are not satisfied, for plugin: %2 플러그인 %2에 대한 %1 종속성이 충족되지 않습니다 - + Remove %1 %1 제거 - + Error 오류 - + Information 정보 - + %1, parse error at line %2, column %3: %4 %1, %2 라인에서 문법 오류, %3 열: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file xml 파일을 위한 "패키지" 루트 태그를 찾을 수 없습니다 - + Duplicated plugin found, already loaded! 중복된 플러그인 발견, 이미 호출되었습니다! - English text missing into the informations.xml for the tag: %1 - 태그 표시를 위한 informations.xml 파일에서 누락된 영문 텍스트: %1 + 태그 표시를 위한 informations.xml 파일에서 누락된 영문 텍스트: %1 + + + + English text missing in the informations.xml for the tag: %1 + - + Tag not found: %1 태그를 찾을 수 없음: %1 - + Are you sure about removing "%1" in version %2? %2 버전에서 %1을 제거하시겠습니까? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... 이전의 가져오기가 진행중입니다... - + Open Ultracopier plugin Ultracopier 플러그인 열기 - + Ultracopier plugin (*.urc) Ultracopier (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader 플러그인 로더 - + Unable to open the plugin: %1 플러그인 열기 불가: %1 - - - + + + Unable to load the plugin content, please check it: %1 플러그인 내용을 불러올 수 없습니다. 확인해주십시오: %1 - + Unable to create a folder to install the plugin: %1 플러그인을 설치할 폴더를 생성할 수 없음: %1 - + Unable to create a file to install the plugin: %1 since:%2 @@ -999,16 +1247,16 @@ since:%2 since:%2 - + Folder with same name is present, skip the plugin installation: %1 동일한 이름의 폴더가 존재합니다. 플러그인 설치 건너뛰기: %1 - - - + + + Unable to load the plugin content, please check it 플러그인 컨태츠를 불러올 수 없습니다. 확인해주십시오 @@ -1016,44 +1264,44 @@ since:%2 QXzDecode - - + + Memory allocation failed 메모리 할당 실패 - - + + Write error 오류 작성 - + Memory usage limit reached 메모리 사용량이 제한에 도달했습니다 - + Not a .xz file .xz 파일이 아닙니다 - + Unsupported options in the .xz headers .xz 헤더에서 지원되지 않는 옵션입니다 - + The file is corrupted 파일이 손상되었습니다 - + Bug! 버그입니다! - + The input data is too short 입력 데이터가 너무 짧습니다 @@ -1061,87 +1309,119 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - 복사 리스너를 찾을 수 없습니다. 트레이 아이콘에서 우클릭하여 수동으로 복사하십시오. + 복사 리스너를 찾을 수 없습니다. 트레이 아이콘에서 우클릭하여 수동으로 복사하십시오. - + Information - 정보 + 정보 - - Searching informations... - 정보 검색중... + + Searching information... + 정보 검색중... - - Not catching the explorer copy/move - 탐색기 복사/이동 자동 감지 안함 + + Do not replace the explorer copy/move + - - Semi catching the explorer copy/move - 탐색기 복사/이동 부분 감지 + + Semi replace the explorer copy/move + - - Catching the explorer copy/move - 탐색기 복사/이동 자동 감지 + + Replace the explorer copy/move + - + Warning - 알림 + 알림 - - Action on the systray icon is unknown! - 트레이 아이콘에서 실행된 작동을 알 수가 없습니다! + + The action on the systray icon is unknown! + - + &About/Debug report - &정보/디버그 보고서 + &정보/디버그 보고서 - + &About - &정보 + &정보 + + + + &Save bug report + - + &Quit - &끝내기 + &끝내기 - + &Options - &옵션 + &옵션 - + A&dd copy/moving - 복사/이동 &추가 + 복사/이동 &추가 + + + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + - - + + Add &copy - &복사 추가 + &복사 추가 - - + + Add &transfer - &전송 추가 + &전송 추가 - - + + Add &move - &이동 추가 + &이동 추가 diff --git a/plugins/Languages/nl/flag.png b/plugins/Languages/nl/flag.png index 679b368..0d00e1a 100644 Binary files a/plugins/Languages/nl/flag.png and b/plugins/Languages/nl/flag.png differ diff --git a/plugins/Languages/nl/informations.xml b/plugins/Languages/nl/informations.xml index 486b384..f24488a 100644 --- a/plugins/Languages/nl/informations.xml +++ b/plugins/Languages/nl/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 nl diff --git a/plugins/Languages/nl/translation.ts b/plugins/Languages/nl/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/nl/translation.ts +++ b/plugins/Languages/nl/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/no/flag.png b/plugins/Languages/no/flag.png index 36e2636..16ec28a 100644 Binary files a/plugins/Languages/no/flag.png and b/plugins/Languages/no/flag.png differ diff --git a/plugins/Languages/no/informations.xml b/plugins/Languages/no/informations.xml index 14d4182..e1a0a1a 100644 --- a/plugins/Languages/no/informations.xml +++ b/plugins/Languages/no/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 no diff --git a/plugins/Languages/no/translation.ts b/plugins/Languages/no/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/no/translation.ts +++ b/plugins/Languages/no/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/pl/flag.png b/plugins/Languages/pl/flag.png index 55595d6..439ee97 100644 Binary files a/plugins/Languages/pl/flag.png and b/plugins/Languages/pl/flag.png differ diff --git a/plugins/Languages/pl/informations.xml b/plugins/Languages/pl/informations.xml index 048e6e0..a9f04be 100644 --- a/plugins/Languages/pl/informations.xml +++ b/plugins/Languages/pl/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 pl diff --git a/plugins/Languages/pl/translation.ts b/plugins/Languages/pl/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/pl/translation.ts +++ b/plugins/Languages/pl/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/pt/flag.png b/plugins/Languages/pt/flag.png index 4d5cedb..3fb1e36 100644 Binary files a/plugins/Languages/pt/flag.png and b/plugins/Languages/pt/flag.png differ diff --git a/plugins/Languages/pt/informations.xml b/plugins/Languages/pt/informations.xml index 36817b5..f7ed085 100644 --- a/plugins/Languages/pt/informations.xml +++ b/plugins/Languages/pt/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 pt diff --git a/plugins/Languages/pt/translation.ts b/plugins/Languages/pt/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/pt/translation.ts +++ b/plugins/Languages/pt/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/ru/flag.png b/plugins/Languages/ru/flag.png index c2c9d27..583e627 100644 Binary files a/plugins/Languages/ru/flag.png and b/plugins/Languages/ru/flag.png differ diff --git a/plugins/Languages/ru/informations.xml b/plugins/Languages/ru/informations.xml index dcb4482..6a8fb5b 100644 --- a/plugins/Languages/ru/informations.xml +++ b/plugins/Languages/ru/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 ru diff --git a/plugins/Languages/ru/translation.ts b/plugins/Languages/ru/translation.ts index 6255b83..a8f30f0 100644 --- a/plugins/Languages/ru/translation.ts +++ b/plugins/Languages/ru/translation.ts @@ -4,77 +4,99 @@ CliParser - - - - - + + + + + Warning Предупреждение - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it Ultracopier уже запущен, щелкните правой кнопкой мыши на значок панели задач (рядом с часами), чтобы использовать его - + + Problem reading file, or file size is 0 + + + + + + The arguments possible are: + + + + + + To display the options + + + + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + + + + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + + + + + Command not valid + + + Problem at the reading, or file size is null - Проблема при чтении или размер файла нулевой + Проблема при чтении или размер файла нулевой - + This file is not supported transfer list Этот файл не поддерживается передача списка - + Unable to open the transfer list file Не удается открыть файл трансфер - - The arguments possibles are: - Аргументы possibles являются: - - - - - To have this help - Для того, чтобы эта помощь + Аргументы possibles являются: - - To quit the other instance running (if have) - Для выхода из другой запущенный экземпляр (если есть) - - - - - To pass transfer list to do - Чтобы передать трансфер делать + + To display this help + - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user - Чтобы скопировать источников, разделенных пробелами до места назначения. Если назначение "?", Ultracopier попросит его пользователю + + To quit the other instances (if running) + - - Same as above, but with move - То же самое, но с переездом + + Open transfer list + Откройте трансфер + + + To quit the other instance running (if have) + Для выхода из другой запущенный экземпляр (если есть) - Command line not understand - Командная строка не понимаю + Командная строка не понимаю - + Help Помогите @@ -82,329 +104,402 @@ CopyEngineManager - - - - + + + + Warning Предупреждение - + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + Cannot find any copy engine with motions support - Не могу найти копию двигателя движения поддержки + Не могу найти копию двигателя движения поддержки - + Cannot find any compatible engine! Не могу найти любой совместимый двигатель! - This copy engine does not support motions - Эта копия двигателя не поддерживает движение + Эта копия двигателя не поддерживает движение - + Cannot find any engine with this name: %1 Не могу найти любой двигатель с таким именем: %1 + + CopyListener + + + Error + ошибка + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error ошибка - - - - - - + + + + + + - - Unable to get a copy engine instance Не удалось получить экземпляр копии двигателей - + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance + + + + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + The argument for the mode is not understand - Аргументом в пользу этого режима не понимаю + Аргументом в пользу этого режима не понимаю - - + + Unable to load the interface, copy aborted Не удалось загрузить интерфейс, копирование прервана - + Unable to load the copy engine, copy aborted Не удается загрузить копию двигателя, скопируйте прервана - + Transfer mode режим передачи + + + EventDispatcher - - Do you want do as a copy? Else if you reply no, it will be moved. - Вы хотите делать то, что копия? Иначе, если вы ответите нет, он будет перемещен. + + Key + + + + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + FacilityEngine - + Copy engine Копировать двигатель - + Copy + a copy копия - + Move + a move двигаться - + Pause пауза - + Resume резюме - - + + Skip пропускать - + Unlimited неограниченный - + s - + Too big Слишком большой - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds Менее %10 секунд - + About %10 seconds remaining О %10 секунды осталось - + About %1 minutes remaining О %1 минуты до конца - + About %1 hours remaining О %1 часов, оставшихся + Transfer + a transfer + + + + + Start + + + + Source источник - + Size размер - + Destination назначение - + Quit выход - + Target цель - - + + Time remaining: Оставшееся время: - + Listing список - + Copying копирование - + Listing and copying Листинг и копирования - + Ask просить - + Overwrite переписывать - + Overwrite if newer Заменить, если новее - + Overwrite if the last modification dates are different Заменить, если последняя даты модификации отличаются - + Rename переименовать - + + Put to the end of the list + + + + + Completed in %1 + + + Put to end of the list - Положить в конец списка + Положить в конец списка - + Select source directory Выберите исходный каталог - + Select destination directory Выберите папку назначения - + Internal error Внутренняя ошибка - + Select one or more files to open Выберите один или более файлов, чтобы открыть - + All files Все файлы - + Save transfer list Сохранить трансфер - + Open transfer list Откройте трансфер - + Transfer list Передача списка - + Error ошибка - + Not supported on this platform Не поддерживается на этой платформе @@ -412,67 +507,92 @@ HelpDialog - - About ultracopier - О ultracopier + + About Ultracopier + - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - На основе Qt. Он обеспечивает передовые копир с более расширенные функции. Это под GPL3. -Эта версия скомпилирована как версия: %1. + - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) Платформа: %1 - + About Qt О Qt - + Do a crash У аварии - + Save bug report Сохранить отчет об ошибке - + Close закрывать - + + About Supercopier + + + + For http://portableapps.com/ для http://portableapps.com/ - + + Portable and all in one version + + + + Portable version Портативная версия - + + All in one version + + + + Normal version Нормальная версия - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages <html><head/><body><p>Для получения дополнительной информации посетите веб-сайт <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> @@ -481,12 +601,12 @@ This version is compiled as version: %1. LocalListener - + Warning Предупреждение - + Timeout while recomposing data from connected clients Тайм-аут в то время как композицию кадра данных из подключенных клиентов @@ -494,22 +614,79 @@ This version is compiled as version: %1. LogThread - - - + + + Error ошибка - + Log file already open, error: %1 Лог-файл уже открыт, ошибки: %1 - - + + + Unable to open the log file, error: %1 + + + Unable to open file to keep the log file, error: %1 - Не удается открыть файл сохранить файл журнала, ошибка: %1 + Не удается открыть файл сохранить файл журнала, ошибка: %1 + + + + OSSpecific + + + Warning + Предупреждение + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html + @@ -532,258 +709,347 @@ This version is compiled as version: %1. - - + + Copy engine Копировать двигатель - - + + Themes Темы - + Log - - Language: - язык: - - - - Autodetect the system language: - Автоматически определять язык системы: + Load at the session loading: + Загрузить на заседании загрузки: - - Catch the copy/move as default: - Поймать копирования / перемещения по умолчанию: + + Confirm to group the windows + - - Load at the session loading: - Загрузить на заседании загрузки: + + Check for updates + - + Name имя - + Version версия - + Language язык - - + + Listener слушатель - - - + + + Plugin loader плагин погрузчика - - - + + + Session loader сессия погрузчика - + + Force the language + + + + + Replace the default copy and move system + + + + + Load at the session loading + + + + + When manual open + + + + + Group the windows when + + + + + Display the OS warning + + + + + Give GPU time to fund the development + + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + Plugin плагин - + Add добавлять - + Remove удаление - + Information информация - + Copy engine by order of preference: Скопируйте двигателя порядке предпочтения: - + + Client connected + + + + Themes: Темы: - + Unable to load the themes plugin Не удается загрузить плагин темы - + Browse просматривать - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated Переменные are %time%, %source%, %size%, %destination% - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated Переменные %time%, %path%, %size%, %mtime%, %error% - + Write the log file into: Запись в файл журнала: - + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + Write the transfers: - Запись передач: + Запись передач: - Write the errors: - Пишите ошибки: + Пишите ошибки: - Write the folder operations: - Write the folder operations: + Write the folder operations: + + + + + Load + + + + + Load the theme? + + + + + Load the language? + - - - - Disabled because you have any SessionLoader plugin - Отключено, потому что у вас есть плагин SessionLoader + Отключено, потому что у вас есть плагин SessionLoader - + Do nothing ничего не делать - + Ask source as folder Спросите источника папку - + Ask sources as files Спросите источников в виде файлов - + Never никогда - + When source is same Когда же источник - + When destination is same Когда же назначения - + When source and destination are same Когда источника и назначения те же - + When source or destination are same Когда источника или назначения те же - + Always всегда - - Save logs as: - Сохранить журналы, как: + + + + The variables are %1 + - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance - Эта запись непосредственно файл, когда он получит новую запись, но это может привести к 50% потери производительности + + Allow the application + - + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + + + + + Enable the OpenCL + + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + Сохранить журналы, как: + + + Synchronized log Синхронное журнала - When manual open: - Когда руководство открыто: + Когда руководство открыто: - Group the windows when: - Группа окна, когда: + Группа окна, когда: - + No option for this plugin Нет опции для этого плагина - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated Переменные %path%, %operation% OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 - Попробуйте получить переменную, а переменная не найдена: %1 %2 + + + + + The variable was not found: %1 %2 + @@ -824,37 +1090,42 @@ This version is compiled as version: %1. Версия: - - CopyEngine - Копировать двигателя + + Copy engine + Копировать двигатель - + Languages Языки - + Listener слушатель - - PluginLoader - плагин погрузчика + + Plugin loader + плагин погрузчика - - SessionLoader - сессия погрузчика + + Session loader + сессия погрузчика - + Themes Темы - + + Unknown + + + + Information about %1 Информация о %1 @@ -872,127 +1143,135 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible informations.xml не доступен - informations.xml not found into the plugin - informations.xml не нашел в плагине + informations.xml не нашел в плагине - + Dependencies part is wrong Зависимости часть неправильно - + Dependencies %1 are not satisfied, for plugin: %2 Зависимости %1 не выполняется, для плагина: %2 - + Remove %1 удаление: %1 - + Error ошибка - + Information информация - + %1, parse error at line %2, column %3: %4 %1, вызовет ошибку в строке %2, столбце %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file "package" Корневой тег не найден для XML-файла - + Duplicated plugin found, already loaded! Дублированный плагин нашел, уже загружены! - English text missing into the informations.xml for the tag: %1 - Английский текст отсутствует в informations.xml для тега: %1 + Английский текст отсутствует в informations.xml для тега: %1 + + + + English text missing in the informations.xml for the tag: %1 + - + Tag not found: %1 Тег не найден: %1 - + Are you sure about removing "%1" in version %2? Вы уверены, что об удалении "%1" в версии %2? - + Error while the removing plugin, please check the rights on the folder: %1 Ошибка при удалении плагина, пожалуйста, проверьте права на папку: %1 - + Previous import is in progress... Предыдущая импорта идет ... - + Open Ultracopier plugin Открытое плагин Ultracopier - + Ultracopier plugin (*.urc) Ultracopier плагина (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader плагин погрузчика - + Unable to open the plugin: %1 Невозможно открыть плагин: %1 - - - + + + Unable to load the plugin content, please check it: %1 Не удается загрузить плагин содержания, пожалуйста, проверьте его: %1 - + Unable to create a folder to install the plugin: %1 Невозможно создать папку для установки плагина: %1 - + Unable to create a file to install the plugin: %1 since:%2 @@ -1001,16 +1280,16 @@ since:%2 С: %2 - + Folder with same name is present, skip the plugin installation: %1 Папка с таким же именем существует, пропустить установки плагина: %1 - - - + + + Unable to load the plugin content, please check it Не удается загрузить плагин содержания, пожалуйста, проверьте его @@ -1018,44 +1297,44 @@ since:%2 QXzDecode - - + + Memory allocation failed Ошибка выделения памяти - - + + Write error Написать об ошибке - + Memory usage limit reached Ограничить использование памяти достиг - + Not a .xz file Не. Хг файл - + Unsupported options in the .xz headers Неподдерживаемые варианты. Заголовки XZ - + The file is corrupted Файл поврежден - + Bug! Ошибка! - + The input data is too short Входных данных слишком короткий @@ -1063,87 +1342,119 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - Нет копии слушатель найдено. Сделайте копию вручную, щелкните правой кнопкой мыши один из иконки в системном трее. + Нет копии слушатель найдено. Сделайте копию вручную, щелкните правой кнопкой мыши один из иконки в системном трее. - + Information - информация + информация - - Searching informations... - Поиск информации ... + + Searching information... + Поиск информации ... - - Not catching the explorer copy/move - Не ловить копию исследователь/перемещения + + Do not replace the explorer copy/move + - - Semi catching the explorer copy/move - Полу ловить копию исследователь/перемещения + + Semi replace the explorer copy/move + - - Catching the explorer copy/move - Занимаясь копию исследователь/перемещения + + Replace the explorer copy/move + - + Warning - Предупреждение + Предупреждение - - Action on the systray icon is unknown! - Действие на значок в системном лотке, неизвестно! + + The action on the systray icon is unknown! + - + &About/Debug report - О компании/Debug отчет + О компании/Debug отчет - + &About - о + о + + + + &Save bug report + - + &Quit - выход + выход - + &Options - опции + опции - + A&dd copy/moving - Добавить копирования/перемещения + Добавить копирования/перемещения + + + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + - - + + Add &copy - Добавить копию + Добавить копию - - + + Add &transfer - Добавить перевод + Добавить перевод - - + + Add &move - Добавить двигаться + Добавить двигаться diff --git a/plugins/Languages/th/flag.png b/plugins/Languages/th/flag.png index ce5a42c..76d9cc3 100644 Binary files a/plugins/Languages/th/flag.png and b/plugins/Languages/th/flag.png differ diff --git a/plugins/Languages/th/informations.xml b/plugins/Languages/th/informations.xml index 1af8ab8..1615a99 100644 --- a/plugins/Languages/th/informations.xml +++ b/plugins/Languages/th/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 th diff --git a/plugins/Languages/th/translation.ts b/plugins/Languages/th/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/th/translation.ts +++ b/plugins/Languages/th/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/tr/flag.png b/plugins/Languages/tr/flag.png index b72f1d7..e26b94b 100644 Binary files a/plugins/Languages/tr/flag.png and b/plugins/Languages/tr/flag.png differ diff --git a/plugins/Languages/tr/informations.xml b/plugins/Languages/tr/informations.xml index 9839811..c264d3c 100644 --- a/plugins/Languages/tr/informations.xml +++ b/plugins/Languages/tr/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 tr diff --git a/plugins/Languages/tr/translation.ts b/plugins/Languages/tr/translation.ts index d838fb7..b02bb87 100644 --- a/plugins/Languages/tr/translation.ts +++ b/plugins/Languages/tr/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help + + + + + + Open transfer list - + Help @@ -82,396 +88,479 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance - - + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists - + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages @@ -480,12 +569,12 @@ This version is compiled as version: %1. LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,257 +673,318 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Confirm to group the windows + + + + + Check for updates + + + + + Name + + + + + Version + + + + + Language + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: + When manual open - - Name + + Group the windows when - - Version + + Display the OS warning - - Language + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + + Client connected + + + + Themes: - + Unable to load the themes plugin - + Browse - - + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - + + Write the errors + + + + The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + %time%, %path%, %size%, %mtime%, %error% should not be translated - + Write the log file into: - - Write the transfers: + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + Allow the application - - Synchronized log + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - - When manual open: + + Enable the OpenCL - - Group the windows when: + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + + Synchronized log - + No option for this plugin - - + + Write the folder operations + + + + The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + %path%, %operation% should not be translated OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Languages/zh/flag.png b/plugins/Languages/zh/flag.png index 3c539df..928b698 100644 Binary files a/plugins/Languages/zh/flag.png and b/plugins/Languages/zh/flag.png differ diff --git a/plugins/Languages/zh/informations.xml b/plugins/Languages/zh/informations.xml index 63fef38..151e854 100644 --- a/plugins/Languages/zh/informations.xml +++ b/plugins/Languages/zh/informations.xml @@ -10,14 +10,13 @@ 1287496800 - + - 0.3.0.0 + 1.2.3.6 ch diff --git a/plugins/Languages/zh/translation.ts b/plugins/Languages/zh/translation.ts index 4d63b67..8a6d55f 100644 --- a/plugins/Languages/zh/translation.ts +++ b/plugins/Languages/zh/translation.ts @@ -4,77 +4,83 @@ CliParser - - - - - + + + + + Warning - + Ultracopier is already running, right click on its system tray icon (near the clock) to use it - - Problem at the reading, or file size is null + + Problem reading file, or file size is 0 - - This file is not supported transfer list + + + The arguments possible are: - - Unable to open the transfer list file + + + To display the options - - - The arguments possibles are: + + + To quit the other instances (if running) - - - To have this help + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To quit the other instance running (if have) + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user - - - To pass transfer list to do + + Command not valid - - - To copy sources separated by space to destination. If destination is "?", ultracopier will ask it to the user + + This file is not supported transfer list - - - Same as above, but with move + + Unable to open the transfer list file - - Command line not understand + + + To display this help - + + + Open transfer list + + + + Help @@ -82,410 +88,493 @@ CopyEngineManager - - - - + + + + Warning - - Cannot find any copy engine with motions support + + Cannot find any copy engine with move support - - Cannot find any compatible engine! + + This copy engine does not support move - - This copy engine does not support motions + + Cannot find any compatible engine! - + Cannot find any engine with this name: %1 + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + Core - - - - - - + + + + + + + - - - - - - + + + + Error - - - - - - + + + + + + - - Unable to get a copy engine instance - - The argument for the mode is not understand + + Group window + + + + + Do you want group the transfer with another actual running transfer? - - + + Unable to get a engine instance + + + + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + Unable to load the interface, copy aborted - + Unable to load the copy engine, copy aborted - + Transfer mode + + + EventDispatcher + + + Key + + - - Do you want do as a copy? Else if you reply no, it will be moved. + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> FacilityEngine - + Copy engine - + Copy + a copy - + Move + a move - + Pause - + Resume - - + + Skip - + Unlimited - + s - + Too big - + B - + KB - + MB - + GB - + TB - + PB - + EB - + ZB - + YB - + Less than %10 seconds - + About %10 seconds remaining - + About %1 minutes remaining - + About %1 hours remaining + Transfer + a transfer + + + + + Start + + + + Source - + Size - + Destination - + Quit - + Target - - + + Time remaining: - + Listing - + Copying - + Listing and copying - + Ask - + Overwrite - + Overwrite if newer - + Overwrite if the last modification dates are different - + Rename - - Put to end of the list + + Put to the end of the list - + Select source directory - + Select destination directory - + Internal error - + Select one or more files to open - + All files - + Save transfer list - + Open transfer list - + Transfer list - + Error - + Not supported on this platform + + + Completed in %1 + + HelpDialog - - About ultracopier + + About Ultracopier - - Based on Qt. It provide advanced copier with more advanced feature. It's under GPL3. + + Based on Qt. Advanced utility to copy files under GPL3 license. This version is compiled as version: %1. %1 will be replaced by a variable content (normal, debug, ...) - + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> %1 will be remplaced by the website into the corresponding languages - + Platform: %1 %1 will be replaced by the platform (windows, mac, linux, ...) - + About Qt - + Do a crash - + Save bug report - + Close - + + About Supercopier + + + + For http://portableapps.com/ - + + Portable and all in one version + + + + Portable version - + + All in one version + + + + Normal version - + + + http://ultracopier.first-world.info/ - This site need be the official site of ultracopier, into the right languages, english if not exists + + + + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html LocalListener - + Warning - + Timeout while recomposing data from connected clients @@ -493,21 +582,74 @@ This version is compiled as version: %1. LogThread - - - + + + Error - + Log file already open, error: %1 - - - Unable to open file to keep the log file, error: %1 + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html @@ -531,245 +673,306 @@ This version is compiled as version: %1. - - + + Copy engine - - + + Themes - + Log + + + Name + + + + + Version + + + + + Language + + + + + Client connected + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + - Language: + Force the language - Autodetect the system language: + Replace the default copy and move system - Catch the copy/move as default: + Load at the session loading - Load at the session loading: - - - - - When manual open: + When manual open - - Group the windows when: + + Group the windows when - - Name + + Confirm to group the windows - - Version + + Display the OS warning - - Language + + Check for updates - - - The variables are %path%, %operation% - %path%, %operation% should not be translated ----------- -%path%, %operation% should not be translated + + Give GPU time to fund the development - - - - Listener + + Remaining time algorithm - - - - Plugin loader + + Traditional - - - - Session loader + + Logarithmic - + Plugin - + Add - + Remove - + Information - + Copy engine by order of preference: - + Themes: - + Unable to load the themes plugin - + No option for this plugin - + Browse - - + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + Write the transfers + + + + The variables are %time%, %source%, %size%, %destination% - %time%, %source%, %size%, %destination% should not be translated ----------- -%time%, %source%, %size%, %destination% should not be translated + %time%, %source%, %size%, %destination% should not be translated - - - The variables are %time%, %path%, %size%, %mtime%, %error% - %time%, %path%, %size%, %mtime%, %error% should not be translated ----------- -%time%, %path%, %size%, %mtime%, %error% should not be translated + + Write the errors - - Write the log file into: + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated - - Write the transfers: + + Write the log file into: - - Write the errors: + + + Load - - Write the folder operations: + + Load the theme? - - - - - Disabled because you have any SessionLoader plugin + + Load the language? - + Do nothing - + Ask source as folder - + Ask sources as files - + Never - + When source is same - + When destination is same - + When source and destination are same - + When source or destination are same - + Always - - Save logs as: + + + + The variables are %1 + + + + + Allow the application - - This write directly the file when it receive the new entry, but it can produce 50% of lost of performance + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version - + + Enable the OpenCL + + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + Save logs as: + + + + Synchronized log @@ -777,11 +980,11 @@ This version is compiled as version: %1. OptionEngine - - - - - Try get variable, but the variable is not found: %1 %2 + + + + + The variable was not found: %1 %2 @@ -823,37 +1026,42 @@ This version is compiled as version: %1. - - CopyEngine + + Copy engine - + Languages - + Listener - - PluginLoader + + Plugin loader - - SessionLoader + + Session loader - + Themes - + + Unknown + + + + Information about %1 @@ -871,140 +1079,140 @@ This version is compiled as version: %1. PluginsManager - + informations.xml is not accessible - - informations.xml not found into the plugin - - - - + Dependencies part is wrong - + Dependencies %1 are not satisfied, for plugin: %2 - + Remove %1 - + Error - + Information - + %1, parse error at line %2, column %3: %4 - + + informations.xml not found for the plugin + + + + "package" root tag not found for the xml file - + Duplicated plugin found, already loaded! - - English text missing into the informations.xml for the tag: %1 + + English text missing in the informations.xml for the tag: %1 - + Tag not found: %1 - + Are you sure about removing "%1" in version %2? - + Error while the removing plugin, please check the rights on the folder: %1 - + Previous import is in progress... - + Open Ultracopier plugin - + Ultracopier plugin (*.urc) - - - - - - - - - - + + + + + + + + + + Plugin loader - + Unable to open the plugin: %1 - - - + + + Unable to load the plugin content, please check it: %1 - + Unable to create a folder to install the plugin: %1 - + Unable to create a file to install the plugin: %1 since:%2 - + Folder with same name is present, skip the plugin installation: %1 - - - + + + Unable to load the plugin content, please check it @@ -1012,44 +1220,44 @@ since:%2 QXzDecode - - + + Memory allocation failed - - + + Write error - + Memory usage limit reached - + Not a .xz file - + Unsupported options in the .xz headers - + The file is corrupted - + Bug! - + The input data is too short @@ -1057,85 +1265,117 @@ since:%2 SystrayIcon - + No copy listener found. Do the copy manually by right click one the system tray icon. - + Information - - Searching informations... + + Searching information... - - Not catching the explorer copy/move + + Do not replace the explorer copy/move - - Semi catching the explorer copy/move + + Semi replace the explorer copy/move - - Catching the explorer copy/move + + Replace the explorer copy/move - + Warning - - Action on the systray icon is unknown! + + The action on the systray icon is unknown! - + &About/Debug report - + &About - + + &Save bug report + + + + &Quit - + &Options - + A&dd copy/moving - - + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + Add &copy - - + + Add &transfer - - + + Add &move diff --git a/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h b/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h +++ b/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/Listener/catchcopy-v0002/Environment.h b/plugins/Listener/catchcopy-v0002/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/Listener/catchcopy-v0002/Environment.h +++ b/plugins/Listener/catchcopy-v0002/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins/Listener/catchcopy-v0002/Variable.h b/plugins/Listener/catchcopy-v0002/Variable.h index 8179c93..963d0c8 100644 --- a/plugins/Listener/catchcopy-v0002/Variable.h +++ b/plugins/Listener/catchcopy-v0002/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp old mode 100755 new mode 100644 index 214caca..d7492d0 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp @@ -1,13 +1,13 @@ /** \file ClientCatchcopy.cpp \brief Define the catchcopy client -\author alpha_one_x86 -\version 0002 -\date 2010 */ +\author alpha_one_x86 */ #include "ClientCatchcopy.h" #include "VariablesCatchcopy.h" #include "ExtraSocketCatchcopy.h" +#include + ClientCatchcopy::ClientCatchcopy() { disconnectedFromSocket(); @@ -207,7 +207,7 @@ void ClientCatchcopy::readyRead() } else { - error_string=QString("First send protocol send with the query id %1 have been already previously replied").arg(orderIdFirstSendProtocol); + error_string=QStringLiteral("First send protocol send with the query id %1 have been already previously replied").arg(orderIdFirstSendProtocol); emit error(error_string); disconnectFromServer(); return; @@ -250,8 +250,8 @@ bool ClientCatchcopy::checkDataIntegrity(QByteArray data) } if(stringSize>(in.device()->size()-in.device()->pos())) { - emit error(QString("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); - qWarning() << QString("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos()); + emit error(QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); + qWarning() << QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos()); return false; } in.device()->seek(in.device()->pos()+stringSize); diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h old mode 100755 new mode 100644 index 278b0cd..4c15890 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h @@ -1,8 +1,7 @@ /** \file ClientCatchcopy.h \brief Define the catchcopy client \author alpha_one_x86 -\version 0002 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef CLIENTCATCHCOPY_H #define CLIENTCATCHCOPY_H diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp old mode 100755 new mode 100644 index 7ee05ed..5330492 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp @@ -1,31 +1,38 @@ /** \file ExtraSocketCatchcopy.cpp \brief Define the socket of catchcopy -\author alpha_one_x86 -\version 0002 -\date 2010 */ +\author alpha_one_x86 */ #include "ExtraSocketCatchcopy.h" +#include + const QString ExtraSocketCatchcopy::pathSocket() { #ifdef Q_OS_UNIX - return "advanced-copier-"+QString::number(getuid()); + return "advanced-copier-"+QString::number(getuid()); #else - QString userName; - DWORD size=0; - if(GetUserNameW(NULL,&size) || (GetLastError()!=ERROR_INSUFFICIENT_BUFFER)) - { - } - else - { - WCHAR * userNameW=new WCHAR[size]; - if(GetUserNameW(userNameW,&size)) - { - userName.fromWCharArray(userNameW,size*2); - userName=QString(QByteArray((char*)userNameW,size*2-2).toHex()); - } - delete userNameW; - } - return "advanced-copier-"+userName; + QString userName; + char uname[1024]; + DWORD len=1023; + if(GetUserNameA(uname, &len)!=FALSE) + userName=QString::fromLatin1(toHex(uname)); + return "advanced-copier-"+userName; #endif } + +char * ExtraSocketCatchcopy::toHex(const char *str) +{ + char *p, *sz; + size_t len; + if (str==NULL) + return NULL; + len= strlen(str); + p = sz = (char *) malloc((len+1)*4); + for (size_t i=0; i #ifdef Q_OS_UNIX - #include - #include + #include + #include #else - #include + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include #endif /// \brief to have extra socket function class ExtraSocketCatchcopy { public: - /// \brief to get the socket path - static const QString pathSocket(); + /// \brief to get the socket path + static const QString pathSocket(); + static char * toHex(const char *str); }; #endif // EXTRASOCKETCATCHCOPY_H diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp old mode 100755 new mode 100644 index 7120fa1..83c8790 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp @@ -1,735 +1,704 @@ /** \file ServerCatchcopy.cpp \brief Define the server of catchcopy -\author alpha_one_x86 -\version 0002 -\date 2010 */ +\author alpha_one_x86*/ #include "ServerCatchcopy.h" #include "VariablesCatchcopy.h" #include "ExtraSocketCatchcopy.h" #include +#include ServerCatchcopy::ServerCatchcopy() { - name="Default avanced copier"; - autoReply=true; - idNextClient=0; - error_string="Unknown error"; - connect(&server, SIGNAL(newConnection()), this, SLOT(newConnection())); + name="Default avanced copier"; + idNextClient=0; + error_string="Unknown error"; + connect(&server, &QLocalServer::newConnection, this, &ServerCatchcopy::newConnection); } ServerCatchcopy::~ServerCatchcopy() { - close(); + close(); } -bool ServerCatchcopy::isListening() +bool ServerCatchcopy::isListening() const { - return server.isListening(); + return server.isListening(); } void ServerCatchcopy::setName(const QString & name) { - this->name=name; + this->name=name; } -QString ServerCatchcopy::getName() +QString ServerCatchcopy::getName() const { - return name; + return name; +} + +/// \brief to get a client list +QStringList ServerCatchcopy::clientsList() const +{ + QStringList clients; + int index=0; + int size=clientList.size(); + while(indexdisconnectFromServer(); - index++; - } - server.close(); - if(!server.removeServer(pathSocket)) - { - error_string="Unable to remove the old server"; - emit error(error_string); - } - } + if(server.isListening()) + { + int index=0; + while(indexdisconnectFromServer(); + index++; + } + server.close(); + if(!server.removeServer(pathSocket)) + { + error_string="Unable to remove the old server"; + emit error(error_string); + } + } } -const QString ServerCatchcopy::errorStringServer() +const QString ServerCatchcopy::errorStringServer() const { - return server.errorString(); + return server.errorString(); } -const QString ServerCatchcopy::errorString() +const QString ServerCatchcopy::errorString() const { - return error_string; + return error_string; } /// \brief New connexion void ServerCatchcopy::newConnection() { - while(server.hasPendingConnections()) - { - QLocalSocket *clientSocket = server.nextPendingConnection(); - if(clientSocket!=NULL) - { - do - { - idNextClient++; - if(idNextClient>2000000000) - idNextClient=0; - } while(clientIdFound(idNextClient)); - Client newClient; - newClient.id = idNextClient; - newClient.socket = clientSocket; - newClient.haveData = false; - newClient.firstProtocolReplied = false; - newClient.detectTimeOut = new QTimer(this); - newClient.detectTimeOut->setSingleShot(true); - newClient.detectTimeOut->setInterval(CATCHCOPY_COMMUNICATION_TIMEOUT); - connect(newClient.socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(connectionError(QLocalSocket::LocalSocketError))); - connect(newClient.socket, SIGNAL(readyRead()), this, SLOT(readyRead())); - connect(newClient.socket, SIGNAL(disconnected()), this, SLOT(disconnected())); - connect(newClient.detectTimeOut,SIGNAL(timeout()), this, SLOT(checkTimeOut())); - ClientList << newClient; - emit connectedClient(newClient.id); - } - } -} - -bool ServerCatchcopy::clientIdFound(quint32 id) -{ - int index=0; - while(index2000000000) + idNextClient=0; + } while(clientIdFound(idNextClient)); + Client newClient; + newClient.id = idNextClient; + newClient.socket = clientSocket; + newClient.haveData = false; + newClient.firstProtocolReplied = false; + newClient.detectTimeOut = new QTimer(this); + newClient.detectTimeOut->setSingleShot(true); + newClient.detectTimeOut->setInterval(CATCHCOPY_COMMUNICATION_TIMEOUT); + newClient.name="Unknown"; + connect(newClient.socket, static_cast(&QLocalSocket::error), this, &ServerCatchcopy::connectionError,Qt::QueuedConnection); + connect(newClient.socket, &QIODevice::readyRead, this, &ServerCatchcopy::readyRead,Qt::QueuedConnection); + connect(newClient.socket, &QLocalSocket::disconnected, this, &ServerCatchcopy::disconnected,Qt::QueuedConnection); + connect(newClient.detectTimeOut,&QTimer::timeout, this, &ServerCatchcopy::checkTimeOut,Qt::QueuedConnection); + clientList << newClient; + emit connectedClient(newClient.id); + } + } +} + +bool ServerCatchcopy::clientIdFound(const quint32 &id) const +{ + int index=0; + while(index(QObject::sender()); - if(socket==NULL) - { - qWarning() << "Unlocated client socket!"; - return; - } - int index=0; - while(indexdisconnectFromServer(); - return; - } - index++; - } +void ServerCatchcopy::connectionError(const QLocalSocket::LocalSocketError &error) +{ + QLocalSocket *socket=qobject_cast(QObject::sender()); + if(socket==NULL) + { + qWarning() << "Unlocated client socket!"; + return; + } + int index=0; + while(indexdisconnectFromServer(); + } + return; + } + index++; + } } void ServerCatchcopy::disconnected() { - QLocalSocket *socket=qobject_cast(QObject::sender()); - if(socket==NULL) - { - qWarning() << "Unlocated client socket!"; - return; - } - int index=0; - while(indexabort(); - ClientList.at(index).socket->disconnectFromServer(); - ClientList.at(index).socket->deleteLater(); - ClientList.removeAt(index); - return; - } - index++; - } - qWarning() << "Unlocated client!"; -} - -void ServerCatchcopy::disconnectClient(quint32 id) -{ - int index=0; - while(indexdisconnectFromServer(); - return; - } - index++; - } - qWarning() << "Unlocated client!"; + QLocalSocket *socket=qobject_cast(QObject::sender()); + if(socket==NULL) + { + qWarning() << "Unlocated client socket!"; + return; + } + int index=0; + while(indexdisconnectFromServer();//already disconnected + delete clientList.at(index).detectTimeOut; + clientList.at(index).socket->deleteLater(); + clientList.removeAt(index); + emit disconnectedClient(id); + return; + } + index++; + } + qWarning() << "Unlocated client!"; +} + +void ServerCatchcopy::disconnectClient(const quint32 &id) +{ + int index=0; + while(indexdisconnectFromServer(); + return; + } + index++; + } + qWarning() << "Unlocated client!"; } void ServerCatchcopy::readyRead() { - QLocalSocket *socket=qobject_cast(QObject::sender()); - if(socket==NULL) - { - qWarning() << "Unlocated client socket!"; - return; - } - int index=0; - while(indexbytesAvailable()>0) - { - if(!ClientList.at(index).haveData) - { - if(socket->bytesAvailable()<(int)sizeof(int))//ignore because first int is cuted! - { - /*error_string="Bytes available is not sufficient to do a int"; - emit error(error_string); - disconnectClient(ClientList.at(index).id);*/ - return; - } - QDataStream in(socket); - in.setVersion(QDataStream::Qt_4_4); - in >> ClientList[index].dataSize; - ClientList[index].dataSize-=sizeof(int); - if(ClientList.at(index).dataSize>64*1024*1024) // 64MB - { - error_string="Reply size is >64MB, seam corrupted"; - emit error(error_string); - disconnectClient(ClientList.at(index).id); - return; - } - if(ClientList.at(index).dataSize<(int)(sizeof(int) //orderId - + sizeof(quint32) //returnCode - + sizeof(quint32) //string list size - )) - { - error_string="Reply size is too small to have correct code"; - emit error(error_string); - disconnectClient(ClientList.at(index).id); - return; - } - ClientList[index].haveData=true; - } - if(ClientList.at(index).dataSize<(ClientList.at(index).data.size()+socket->bytesAvailable())) - ClientList[index].data.append(socket->read(ClientList.at(index).dataSize-ClientList.at(index).data.size())); - else - ClientList[index].data.append(socket->readAll()); - if(ClientList.at(index).dataSize==(quint32)ClientList.at(index).data.size()) - { - if(!checkDataIntegrity(ClientList.at(index).data)) - { - emit error("Data integrity wrong: "+QString(ClientList.at(index).data.toHex())); - ClientList[index].data.clear(); - ClientList[index].haveData=false; - qWarning() << "Data integrity wrong"; - return; - } - QStringList returnList; - quint32 orderId; - QDataStream in(ClientList.at(index).data); - in.setVersion(QDataStream::Qt_4_4); - in >> orderId; - in >> returnList; - ClientList[index].data.clear(); - ClientList[index].haveData=false; - if(ClientList.at(index).queryNoReplied.contains(orderId)) - { - emit error("Duplicate query id"); - qWarning() << "Duplicate query id"; - return; - } - ClientList[index].queryNoReplied << orderId; - if(!ClientList.at(index).firstProtocolReplied && returnList.size()==2 && returnList.first()=="protocol" && autoReply) - { - ClientList[index].firstProtocolReplied=true; - protocolSupported(ClientList.at(index).id,orderId,(returnList.last()==CATCHCOPY_PROTOCOL_VERSION)); - } - else - parseInput(ClientList.at(index).id,orderId,returnList); - } - } - if(ClientList.at(index).haveData) - ClientList.at(index).detectTimeOut->start(); - else - ClientList.at(index).detectTimeOut->stop(); - return; - } - index++; - } - emit error("Unallocated client!"); - qWarning() << "Unallocated client!"; -} - -bool ServerCatchcopy::checkDataIntegrity(QByteArray data) -{ - quint32 orderId; - qint32 listSize; - QDataStream in(data); - in.setVersion(QDataStream::Qt_4_4); - in >> orderId; - in >> listSize; - if(listSize>65535) - { - emit error("List size is wrong"); - qWarning() << "List size is wrong"; - return false; - } - int index=0; - while(index> stringSize; - if(stringSize>65535) - { - emit error("String size is wrong"); - return false; - } - if(stringSize>(in.device()->size()-in.device()->pos())) - { - emit error(QString("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); - return false; - } - in.device()->seek(in.device()->pos()+stringSize); - index++; - } - if(in.device()->size()!=in.device()->pos()) - { - emit error("Remaining data after string list parsing"); - return false; - } - return true; -} - -void ServerCatchcopy::parseInput(quint32 client,quint32 orderId,QStringList returnList) -{ - switch(parseInputCurrentProtocol(client,orderId,returnList)) - { - case Ok: - emit newQuery(client,orderId,returnList); - break; - case Replied: - break; - case ExtensionWrong: - if(autoReply) - protocolExtensionSupported(client,orderId,false); - else - emit newQuery(client,orderId,returnList); - break; - case WrongArgument: - if(autoReply) - incorrectArgument(client,orderId); - else - emit newQuery(client,orderId,returnList); - break; - case WrongArgumentListSize: - if(autoReply) - incorrectArgumentListSize(client,orderId); - else - emit newQuery(client,orderId,returnList); - break; - case UnknowOrder: - emit error("Unknown query"); - qWarning() << "Unknown query"; - if(autoReply) - unknowOrder(client,orderId); - else - emit newQuery(client,orderId,returnList); - break; - } -} - -ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(quint32 client,quint32 orderId,QStringList returnList) -{ - if(returnList.size()==0) - return WrongArgumentListSize; - //if is supported - QString firstArgument=returnList.first(); - if(firstArgument=="protocol") - { - if(returnList.size()!=2) - return WrongArgumentListSize; - emit askProtocolCompatibility(client,orderId,returnList.last()); - return Ok; - } - else if(firstArgument=="protocol extension") - { - if(returnList.size()>3 || returnList.size()<2) - return WrongArgumentListSize; - if(!autoReply) - { - if(returnList.size()==2) - emit askProtocolExtension(client,orderId,returnList.last()); - else - emit askProtocolExtension(client,orderId,returnList.at(1),returnList.last()); - } - return ExtensionWrong; - } - else if(firstArgument=="client") - { - if(returnList.size()!=2) - return WrongArgumentListSize; - emit clientName(client,returnList.last()); - if(autoReply) - { - clientRegistered(client,orderId); - return Replied; - } - else - { - emit clientName(client,orderId,returnList.last()); - return Ok; - } - } - else if(firstArgument=="server") - { - if(returnList.size()!=2) - return WrongArgumentListSize; - if(returnList.last()!="name?") - return WrongArgument; - if(autoReply) - { - serverName(client,orderId,name); - return Replied; - } - else - { - askServerName(client,orderId); - return Ok; - } - } - else if(firstArgument=="cp") - { - if(returnList.size()<3) - return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); - sourceList.removeLast(); - emitNewCopy(client,orderId,sourceList,returnList.last()); - return Ok; - } - else if(firstArgument=="cp-?") - { - if(returnList.size()<2) - return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); - emitNewCopy(client,orderId,sourceList); - return Ok; - } - else if(firstArgument=="mv") - { - if(returnList.size()<3) - return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); - sourceList.removeLast(); - emitNewMove(client,orderId,sourceList,returnList.last()); - return Ok; - } - else if(firstArgument=="mv-?") - { - if(returnList.size()<2) - return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); - emitNewMove(client,orderId,sourceList); - return Ok; - } - else //if is not supported - return UnknowOrder; -} - -void ServerCatchcopy::emitNewCopy(quint32 client,quint32 orderId,QStringList sources) -{ - emit newCopy(client,orderId,sources); - LinkGlobalToLocalClient newAssociation; - newAssociation.idClient=client; - newAssociation.orderId=orderId; - newAssociation.globalOrderId=incrementOrderId(); - LinkGlobalToLocalClientList << newAssociation; - emit newCopy(newAssociation.globalOrderId,sources); -} - -void ServerCatchcopy::emitNewCopy(quint32 client,quint32 orderId,QStringList sources,QString destination) -{ - emit newCopy(client,orderId,sources,destination); - LinkGlobalToLocalClient newAssociation; - newAssociation.idClient=client; - newAssociation.orderId=orderId; - newAssociation.globalOrderId=incrementOrderId(); - LinkGlobalToLocalClientList << newAssociation; - emit newCopy(newAssociation.globalOrderId,sources,destination); -} - -void ServerCatchcopy::emitNewMove(quint32 client,quint32 orderId,QStringList sources) -{ - emit newMove(client,orderId,sources); - LinkGlobalToLocalClient newAssociation; - newAssociation.idClient=client; - newAssociation.orderId=orderId; - newAssociation.globalOrderId=incrementOrderId(); - LinkGlobalToLocalClientList << newAssociation; - emit newMove(newAssociation.globalOrderId,sources); -} - -void ServerCatchcopy::emitNewMove(quint32 client,quint32 orderId,QStringList sources,QString destination) -{ - emit newMove(client,orderId,sources,destination); - LinkGlobalToLocalClient newAssociation; - newAssociation.idClient=client; - newAssociation.orderId=orderId; - newAssociation.globalOrderId=incrementOrderId(); - LinkGlobalToLocalClientList << newAssociation; - emit newMove(newAssociation.globalOrderId,sources,destination); -} - -void ServerCatchcopy::copyFinished(quint32 globalOrderId,bool withError) -{ - int index=0; - while(indexisValid() && ClientList.at(index).socket->state()==QLocalSocket::ConnectedState) - { - if(!ClientList.at(index).queryNoReplied.contains(orderId)) - { - qWarning() << "Reply to missing query or previously replied"; - return; - } - ClientList[index].queryNoReplied.removeOne(orderId); - //cut string list and send it as block of 32KB - QByteArray block; - QDataStream out(&block, QIODevice::WriteOnly); - out.setVersion(QDataStream::Qt_4_4); - out << int(0); - out << orderId; - out << returnCode; - out << returnList; - out.device()->seek(0); - out << block.size(); - emit dataSend(client,orderId,returnCode,block); - emit dataSend(client,orderId,returnCode,returnList); - do - { - QByteArray blockToSend; - int byteWriten; - blockToSend=block.left(32*1024);//32KB - block.remove(0,blockToSend.size()); - byteWriten = ClientList[index].socket->write(blockToSend); - if(!ClientList[index].socket->isValid()) - { - error_string="Socket is not valid"; - emit error(error_string); - return; - } - if(ClientList[index].socket->errorString()!="Unknown error" && ClientList[index].socket->errorString()!="") - { - error_string="Error with socket: "+ClientList[index].socket->errorString(); - emit error(error_string); - return; - } - if(blockToSend.size()!=byteWriten) - { - error_string="All the bytes have not be written"; - emit error(error_string); - return; - } - } - while(block.size()); - } - else - { - error_string="Socket is not valid or not connected"; - emit error(error_string); - } - return; - } - index++; - } - qWarning() << "Client id not found:" << client; -} + QLocalSocket *socket=qobject_cast(QObject::sender()); + if(socket==NULL) + { + qWarning() << "Unlocated client socket!"; + return; + } + int index=0; + while(indexbytesAvailable()>0) + { + if(!clientList.at(index).haveData) + { + if(socket->bytesAvailable()<(int)sizeof(int))//ignore because first int is cuted! + { + /*error_string="Bytes available is not sufficient to do a int"; + emit error(error_string); + disconnectClient(ClientList.at(index).id);*/ + return; + } + QDataStream in(socket); + in.setVersion(QDataStream::Qt_4_4); + in >> clientList[index].dataSize; + clientList[index].dataSize-=sizeof(int); + if(clientList.at(index).dataSize>64*1024*1024) // 64MB + { + error_string="Reply size is >64MB, seam corrupted"; + emit communicationError(error_string); + disconnectClient(clientList.at(index).id); + return; + } + if(clientList.at(index).dataSize<(int)(sizeof(int) //orderId + + sizeof(quint32) //returnCode + + sizeof(quint32) //string list size + )) + { + error_string="Reply size is too small to have correct code"; + emit communicationError(error_string); + disconnectClient(clientList.at(index).id); + return; + } + clientList[index].haveData=true; + } + if(clientList.at(index).dataSize<(clientList.at(index).data.size()+socket->bytesAvailable())) + clientList[index].data.append(socket->read(clientList.at(index).dataSize-clientList.at(index).data.size())); + else + clientList[index].data.append(socket->readAll()); + if(clientList.at(index).dataSize==(quint32)clientList.at(index).data.size()) + { + if(!checkDataIntegrity(clientList.at(index).data)) + { + emit communicationError("Data integrity wrong: "+QString(clientList.at(index).data.toHex())); + clientList[index].data.clear(); + clientList[index].haveData=false; + qWarning() << "Data integrity wrong"; + return; + } + QStringList returnList; + quint32 orderId; + QDataStream in(clientList.at(index).data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> returnList; + clientList[index].data.clear(); + clientList[index].haveData=false; + if(clientList.at(index).queryNoReplied.contains(orderId)) + { + emit communicationError("Duplicate query id"); + qWarning() << "Duplicate query id"; + return; + } + clientList[index].queryNoReplied << orderId; + if(!clientList.at(index).firstProtocolReplied && returnList.size()==2 && returnList.first()=="protocol") + { + clientList[index].firstProtocolReplied=true; + protocolSupported(clientList.at(index).id,orderId,(returnList.last()==CATCHCOPY_PROTOCOL_VERSION)); + } + else + parseInput(clientList.at(index).id,orderId,returnList); + } + } + if(clientList.at(index).haveData) + clientList.at(index).detectTimeOut->start(); + else + clientList.at(index).detectTimeOut->stop(); + return; + } + index++; + } + emit error("Unallocated client!"); + qWarning() << "Unallocated client!"; +} + +bool ServerCatchcopy::checkDataIntegrity(const QByteArray &data) +{ + quint32 orderId; + qint32 listSize; + QDataStream in(data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> listSize; + if(listSize>65535) + { + emit error("List size is wrong"); + qWarning() << "List size is wrong"; + return false; + } + int index=0; + while(index> stringSize; + if(stringSize>65535) + { + emit error("String size is wrong"); + return false; + } + if(stringSize>(in.device()->size()-in.device()->pos())) + { + emit error(QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); + return false; + } + in.device()->seek(in.device()->pos()+stringSize); + index++; + } + if(in.device()->size()!=in.device()->pos()) + { + emit error("Remaining data after string list parsing"); + return false; + } + return true; +} + +void ServerCatchcopy::parseInput(const quint32 &client,const quint32 &orderId,const QStringList &returnList) +{ + const ServerCatchcopy::inputReturnType returnVal=parseInputCurrentProtocol(client,orderId,returnList); + switch(returnVal) + { + case Ok: + emit newQuery(client,orderId,returnList); + break; + case Replied: + break; + case ExtensionWrong: + //protocolExtensionSupported(client,orderId,false); + break; + case WrongArgument: + incorrectArgument(client,orderId); + break; + case WrongArgumentListSize: + incorrectArgumentListSize(client,orderId); + break; + case UnknowOrder: + emit error("Unknown query: "+QString::number(returnVal)+", with client: "+QString::number(client)+", orderId: "+QString::number(orderId)+", returnList: "+returnList.join(", ")); + qWarning() << "Unknown query"; + unknowOrder(client,orderId); + break; + } +} + +ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(const quint32 &client,const quint32 &orderId,const QStringList &returnList) +{ + if(returnList.size()==0) + return WrongArgumentListSize; + //if is supported + QString firstArgument=returnList.first(); + if(firstArgument=="protocol") + { + if(returnList.size()!=2) + return WrongArgumentListSize; + emit askProtocolCompatibility(client,orderId,returnList.last()); + return Ok; + } + else if(firstArgument=="protocol extension") + { + if(returnList.size()>3 || returnList.size()<2) + return WrongArgumentListSize; + return ExtensionWrong; + } + else if(firstArgument=="client") + { + if(returnList.size()!=2) + return WrongArgumentListSize; + int index=0; + int size=clientList.size(); + while(indexisValid() && clientList.at(index).socket->state()==QLocalSocket::ConnectedState) + { + if(!clientList.at(index).queryNoReplied.contains(orderId)) + { + qWarning() << "Reply to missing query or previously replied"; + return; + } + clientList[index].queryNoReplied.removeOne(orderId); + //cut string list and send it as block of 32KB + QByteArray block; + QDataStream out(&block, QIODevice::WriteOnly); + out.setVersion(QDataStream::Qt_4_4); + out << int(0); + out << orderId; + out << returnCode; + out << returnList; + out.device()->seek(0); + out << block.size(); + do + { + QByteArray blockToSend; + int byteWriten; + blockToSend=block.left(32*1024);//32KB + block.remove(0,blockToSend.size()); + byteWriten = clientList[index].socket->write(blockToSend); + if(!clientList[index].socket->isValid()) + { + error_string="Socket is not valid"; + emit error(error_string); + return; + } + if(clientList[index].socket->error()!=QLocalSocket::UnknownSocketError && clientList[index].socket->error()!=QLocalSocket::PeerClosedError) + { + error_string="Error with socket: "+clientList[index].socket->errorString(); + emit error(error_string); + return; + } + if(blockToSend.size()!=byteWriten) + { + error_string="All the bytes have not be written"; + emit error(error_string); + return; + } + } + while(block.size()); + } + else + { + error_string="Socket is not valid or not connected"; + emit error(error_string); + } + return; + } + index++; + } + qWarning() << "Client id not found:" << client; +} -void ServerCatchcopy::protocolSupported(quint32 client,quint32 orderId,bool value) -{ - if(value) - reply(client,orderId,1000,"protocol supported"); - else - reply(client,orderId,5003,"protocol not supported"); +void ServerCatchcopy::protocolSupported(const quint32 &client,const quint32 &orderId,const bool &value) +{ + if(value) + reply(client,orderId,1000,"protocol supported"); + else + reply(client,orderId,5003,"protocol not supported"); } -void ServerCatchcopy::incorrectArgumentListSize(quint32 client,quint32 orderId) +void ServerCatchcopy::incorrectArgumentListSize(const quint32 &client,const quint32 &orderId) { - reply(client,orderId,5000,"incorrect argument list size"); + reply(client,orderId,5000,"incorrect argument list size"); } -void ServerCatchcopy::incorrectArgument(quint32 client,quint32 orderId) +void ServerCatchcopy::incorrectArgument(const quint32 &client,const quint32 &orderId) { - reply(client,orderId,5001,"incorrect argument"); + reply(client,orderId,5001,"incorrect argument"); } -void ServerCatchcopy::protocolExtensionSupported(quint32 client,quint32 orderId,bool value) +void ServerCatchcopy::clientRegistered(const quint32 &client,const quint32 &orderId) { - if(value) - reply(client,orderId,1001,"protocol extension supported"); - else - reply(client,orderId,1002,"protocol extension not supported"); + reply(client,orderId,1003,"client registered"); } -void ServerCatchcopy::clientRegistered(quint32 client,quint32 orderId) +void ServerCatchcopy::serverName(const quint32 &client,const quint32 &orderId,const QString &name) { - reply(client,orderId,1003,"client registered"); + reply(client,orderId,1004,name); } -void ServerCatchcopy::serverName(quint32 client,quint32 orderId,QString name) +void ServerCatchcopy::copyFinished(const quint32 &client,const quint32 &orderId,const bool &withError) { - reply(client,orderId,1004,name); + if(!withError) + reply(client,orderId,1005,"finished"); + else + reply(client,orderId,1006,"finished with error(s)"); } -void ServerCatchcopy::copyFinished(quint32 client,quint32 orderId,bool withError) -{ - if(!withError) - reply(client,orderId,1005,"finished"); - else - reply(client,orderId,1006,"finished with error(s)"); -} - -void ServerCatchcopy::copyCanceled(quint32 client,quint32 orderId) -{ - reply(client,orderId,1007,"canceled"); +void ServerCatchcopy::copyCanceled(const quint32 &client,const quint32 &orderId) +{ + reply(client,orderId,1007,"canceled"); } -void ServerCatchcopy::unknowOrder(quint32 client,quint32 orderId) +void ServerCatchcopy::unknowOrder(const quint32 &client,const quint32 &orderId) { - reply(client,orderId,5002,"unknown order"); + reply(client,orderId,5002,"unknown order"); } void ServerCatchcopy::checkTimeOut() { - QTimer *timer=qobject_cast(QObject::sender()); - if(timer==NULL) - { - qWarning() << "Unallocated client timer!"; - return; - } - int index=0; - while(indexstop(); - if(ClientList.at(index).haveData) - { - error_string="The client is too long to send the next part of the reply: "+ClientList.at(index).data; - ClientList[index].haveData=false; - ClientList[index].data.clear(); - ClientList.at(index).socket->disconnectFromServer(); - emit error(error_string); - } - return; - } - index++; - } + QTimer *timer=qobject_cast(QObject::sender()); + if(timer==NULL) + { + qWarning() << "Unallocated client timer!"; + return; + } + int index=0; + while(indexstop(); + if(clientList.at(index).haveData) + { + error_string="The client is too long to send the next part of the reply: "+clientList.at(index).data; + clientList[index].haveData=false; + clientList[index].data.clear(); + clientList.at(index).socket->disconnectFromServer(); + emit error(error_string); + } + return; + } + index++; + } } quint32 ServerCatchcopy::incrementOrderId() { - do - { - nextOrderId++; - if(nextOrderId>2000000) - nextOrderId=0; - } while(orderList.contains(nextOrderId)); - return nextOrderId; + do + { + nextOrderId++; + if(nextOrderId>2000000) + nextOrderId=0; + } while(orderList.contains(nextOrderId)); + return nextOrderId; } diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h old mode 100755 new mode 100644 index 5f7af35..1314d73 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h @@ -1,8 +1,7 @@ /** \file ServerCatchcopy.h \brief Define the server of catchcopy \author alpha_one_x86 -\version 0002 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SERVERCATCHCOPY_H #define SERVERCATCHCOPY_H @@ -18,145 +17,128 @@ /// \brief Define the server of catchcopy class ServerCatchcopy : public QObject { - Q_OBJECT - public: - ServerCatchcopy(); - ~ServerCatchcopy(); - /// \brief return if is listening - bool isListening(); - /// \brief try listen - bool listen(); - /// \brief try close the server - void close(); - /// \brief get the error string on the QLocalServer - const QString errorStringServer(); - /// \brief get the general error string - const QString errorString(); - /// \brief set if automatic reply is used - void setAutoReply(bool value); - /// \brief get if autoReply is set - bool getAutoReply(); - /// \brief set the name of the server - void setName(const QString & name); - /// \brief get the name - QString getName(); - private: - QString pathSocket; - QString name; - QString error_string; - QLocalServer server; - quint32 idNextClient; - struct Client - { - quint32 id; - QLocalSocket *socket; - QByteArray data; - bool haveData; - quint32 dataSize; - bool firstProtocolReplied; - QList queryNoReplied; - QTimer *detectTimeOut; - }; - QList ClientList; - struct LinkGlobalToLocalClient - { - quint32 idClient; - quint32 orderId; - quint32 globalOrderId; - }; - QList LinkGlobalToLocalClientList; - enum inputReturnType{Ok,Replied,ExtensionWrong,WrongArgument,WrongArgumentListSize,UnknowOrder}; - inputReturnType parseInputCurrentProtocol(quint32 client,quint32 orderId,QStringList returnList); - bool autoReply; - bool clientIdFound(quint32 id); - quint32 nextOrderId; - QList orderList; - quint32 incrementOrderId(); - void emitNewCopy(quint32 client,quint32 orderId,QStringList sources); - void emitNewCopy(quint32 client,quint32 orderId,QStringList sources,QString destination); - void emitNewMove(quint32 client,quint32 orderId,QStringList sources); - void emitNewMove(quint32 client,quint32 orderId,QStringList sources,QString destination); - bool checkDataIntegrity(QByteArray data); - protected: - void parseInput(quint32 client,quint32 orderId,QStringList returnList); - private slots: - void newConnection(); - void connectionError(QLocalSocket::LocalSocketError error); - void disconnected(); - void readyRead(); - void checkTimeOut(); - public slots: - /// \brief disconnect one client - void disconnectClient(quint32 id); - /// \brief reply to a client with QStringList - void reply(quint32 client,quint32 orderId,quint32 returnCode,QStringList returnList); - /// \brief reply to a client - void reply(quint32 client,quint32 orderId,quint32 returnCode,QString returnString); - //reply - /// \brief send if the protocol is supported - void protocolSupported(quint32 client,quint32 orderId,bool value); - /// \brief send incorrect arguement list size - void incorrectArgumentListSize(quint32 client,quint32 orderId); - /// \brief send incorrect arguement - void incorrectArgument(quint32 client,quint32 orderId); - /// \brief send if protocol extension is supported - void protocolExtensionSupported(quint32 client,quint32 orderId,bool value); - /// \brief the client is registred - void clientRegistered(quint32 client,quint32 orderId); - /// \brief send the server name - void serverName(quint32 client,quint32 orderId,QString name); - /// \brief send the copy is finished - void copyFinished(quint32 client,quint32 orderId,bool withError); - /// \brief send the copy is canceled - void copyCanceled(quint32 client,quint32 orderId); - /// \brief send the copy is finished by global is order - void copyFinished(quint32 globalOrderId,bool withError); - /// \brief send copy cancel by global is order - void copyCanceled(quint32 globalOrderId); - /// \brief send the unknow order - void unknowOrder(quint32 client,quint32 orderId); - signals: - /// \brief send connected client - void connectedClient(quint32 id); - /// \brief send disconnect client - void disconnectedClient(quint32 id); - /// \brief have new query - void newQuery(quint32 client,quint32 orderId,QStringList returnList); - /// \brief send new data as string list - void dataSend(quint32 client,quint32 orderId,quint32 returnCode,QStringList returnList); - /// \brief send new data as raw data - void dataSend(quint32 client,quint32 orderId,quint32 returnCode,QByteArray block); - /// \brief have new error - void error(QString error); - //query - /// \brief ask the protocol compatility - void askProtocolCompatibility(quint32 client,quint32 orderId,QString version); - /// \brief ask protocol extension - void askProtocolExtension(quint32 client,quint32 orderId,QString extension); - /// \brief ask protocol extension with version - void askProtocolExtension(quint32 client,quint32 orderId,QString extension,QString version); - /// \brief send the client name, with query id - void clientName(quint32 client,quint32 orderId,QString name); - /// \brief send the client name, without query id - void clientName(quint32 client,QString name); - /// \brief send the client have ask the server name - void askServerName(quint32 client,quint32 orderId); - /// \brief copy is send, without destination - void newCopy(quint32 client,quint32 orderId,QStringList sources); - /// \brief copy is send, with destination - void newCopy(quint32 client,quint32 orderId,QStringList sources,QString destination); - /// \brief move is send, without destination - void newMove(quint32 client,quint32 orderId,QStringList sources); - /// \brief move is send, with destination - void newMove(quint32 client,quint32 orderId,QStringList sources,QString destination); - /// \brief copy is send, by globalOrderId, without destination - void newCopy(quint32 globalOrderId,QStringList sources); - /// \brief copy is send, by globalOrderId, with destination - void newCopy(quint32 globalOrderId,QStringList sources,QString destination); - /// \brief move is send, by globalOrderId, without destination - void newMove(quint32 globalOrderId,QStringList sources); - /// \brief move is send, by globalOrderId, with destination - void newMove(quint32 globalOrderId,QStringList sources,QString destination); + Q_OBJECT + public: + ServerCatchcopy(); + ~ServerCatchcopy(); + /// \brief return if is listening + bool isListening() const; + /// \brief try listen + bool listen(); + /// \brief try close the server + void close(); + /// \brief get the error string on the QLocalServer + const QString errorStringServer() const; + /// \brief get the general error string + const QString errorString() const; + /// \brief set the name of the server + void setName(const QString & name); + /// \brief get the name + QString getName() const; + /// \brief to get a client list + QStringList clientsList() const; + private: + QString pathSocket; + QString name; + QString error_string; + QLocalServer server; + quint32 idNextClient; + struct Client + { + quint32 id; + QLocalSocket *socket; + QByteArray data; + bool haveData; + quint32 dataSize; + bool firstProtocolReplied; + QList queryNoReplied; + QTimer *detectTimeOut; + QString name; + }; + QList clientList; + struct LinkGlobalToLocalClient + { + quint32 idClient; + quint32 orderId; + quint32 globalOrderId; + }; + QList LinkGlobalToLocalClientList; + enum inputReturnType{Ok,Replied,ExtensionWrong,WrongArgument,WrongArgumentListSize,UnknowOrder}; + inputReturnType parseInputCurrentProtocol(const quint32 &client,const quint32 &orderId,const QStringList &returnList); + bool clientIdFound(const quint32 &id) const; + quint32 nextOrderId; + QList orderList; + quint32 incrementOrderId(); + void emitNewCopyWithoutDestination(const quint32 &client,const quint32 &orderId,const QStringList &sources); + void emitNewCopy(const quint32 &client,const quint32 &orderId,const QStringList &sources,const QString &destination); + void emitNewMoveWithoutDestination(const quint32 &client,const quint32 &orderId,const QStringList &sources); + void emitNewMove(const quint32 &client,const quint32 &orderId,const QStringList &sources,const QString &destination); + bool checkDataIntegrity(const QByteArray &data); + protected: + void parseInput(const quint32 &client,const quint32 &orderId,const QStringList &returnList); + private slots: + void newConnection(); + void connectionError(const QLocalSocket::LocalSocketError &error); + void disconnected(); + void readyRead(); + void checkTimeOut(); + public slots: + /// \brief disconnect one client + void disconnectClient(const quint32 &id); + /// \brief reply to a client with QStringList + void reply(const quint32 &client,const quint32 &orderId,const quint32 &returnCode,const QStringList &returnList); + /// \brief reply to a client + void reply(const quint32 &client,const quint32 &orderId,const quint32 &returnCode,const QString &returnString); + //reply + /// \brief send if the protocol is supported + void protocolSupported(const quint32 &client,const quint32 &orderId,const bool &value); + /// \brief send incorrect arguement list size + void incorrectArgumentListSize(const quint32 &client,const quint32 &orderId); + /// \brief send incorrect arguement + void incorrectArgument(const quint32 &client,const quint32 &orderId); + /// \brief the client is registred + void clientRegistered(const quint32 &client,const quint32 &orderId); + /// \brief send the server name + void serverName(const quint32 &client,const quint32 &orderId,const QString &name); + /// \brief send the copy is finished + void copyFinished(const quint32 &client,const quint32 &orderId,const bool &withError); + /// \brief send the copy is canceled + void copyCanceled(const quint32 &client,const quint32 &orderId); + /// \brief send the copy is finished by global is order + void copyFinished(const quint32 &globalOrderId,const bool &withError); + /// \brief send copy cancel by global is order + void copyCanceled(const quint32 &globalOrderId); + /// \brief send the unknow order + void unknowOrder(const quint32 &client,const quint32 &orderId); + signals: + /// \brief send connected client + void connectedClient(const quint32 &id); + /// \brief send disconnect client + void disconnectedClient(const quint32 &id); + /// \brief have new query + void newQuery(const quint32 &client,const quint32 &orderId,const QStringList &returnList); + /// \brief have new error + void error(const QString &error); + void communicationError(const QString &error); + //query + /// \brief ask the protocol compatility + void askProtocolCompatibility(const quint32 &client,const quint32 &orderId,const QString &version); + /// \brief ask protocol extension + void askProtocolExtension(const quint32 &client,const quint32 &orderId,const QString &extension); + /// \brief ask protocol extension with version + void askProtocolExtension(const quint32 &client,const quint32 &orderId,const QString &extension,const QString &version); + /// \brief send the client name, without query id + void clientName(const quint32 &client,const QString &name); + /// \brief send the client have ask the server name + void askServerName(const quint32 &client,const quint32 &orderId); + /// \brief copy is send, by globalOrderId, without destination + void newCopyWithoutDestination(const quint32 &globalOrderId,const QStringList &sources); + /// \brief copy is send, by globalOrderId, with destination + void newCopy(const quint32 &globalOrderId,const QStringList &sources,const QString &destination); + /// \brief move is send, by globalOrderId, without destination + void newMoveWithoutDestination(const quint32 &globalOrderId,const QStringList &sources); + /// \brief move is send, by globalOrderId, with destination + void newMove(const quint32 &globalOrderId,const QStringList &sources,const QString &destination); }; #endif // SERVERCATCHCOPY_H diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h old mode 100755 new mode 100644 index ce73aee..135c087 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h @@ -1,8 +1,7 @@ /** \file VariablesCatchcopy.h \brief Define the variable for catchcopy \author alpha_one_x86 -\version 0002 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLECATCHCOPY_H #define VARIABLECATCHCOPY_H diff --git a/plugins/Listener/catchcopy-v0002/documentation.dox b/plugins/Listener/catchcopy-v0002/documentation.dox old mode 100755 new mode 100644 index a15792a..b143ecc --- a/plugins/Listener/catchcopy-v0002/documentation.dox +++ b/plugins/Listener/catchcopy-v0002/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview Is the default listener to wait a copy/move. It use the catchcopy protocol.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. + More informations on the wiki of ultracopier. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins/Listener/catchcopy-v0002/informations.xml b/plugins/Listener/catchcopy-v0002/informations.xml index e465da8..bc0efc6 100644 --- a/plugins/Listener/catchcopy-v0002/informations.xml +++ b/plugins/Listener/catchcopy-v0002/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 catchcopy-v0002 =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins/Listener/catchcopy-v0002/listener.cpp b/plugins/Listener/catchcopy-v0002/listener.cpp old mode 100755 new mode 100644 index 51f204e..55c254b --- a/plugins/Listener/catchcopy-v0002/listener.cpp +++ b/plugins/Listener/catchcopy-v0002/listener.cpp @@ -1,83 +1,118 @@ -#include -#include - #include "listener.h" +#include "catchcopy-api-0002/ExtraSocketCatchcopy.h" -CatchCopyPlugin::CatchCopyPlugin() +Listener::Listener() { - server.setName(tr("Ultracopier")); - connect(&server,SIGNAL(newCopy(quint32,QStringList)), this,SIGNAL(newCopy(quint32,QStringList))); - connect(&server,SIGNAL(newCopy(quint32,QStringList,QString)), this,SIGNAL(newCopy(quint32,QStringList,QString))); - connect(&server,SIGNAL(newMove(quint32,QStringList)), this,SIGNAL(newMove(quint32,QStringList))); - connect(&server,SIGNAL(newMove(quint32,QStringList,QString)), this,SIGNAL(newMove(quint32,QStringList,QString))); - connect(&server,SIGNAL(error(QString)), this,SLOT(error(QString))); - connect(&server,SIGNAL(clientName(quint32,QString)), this,SLOT(clientName(quint32,QString))); + server.setName(tr("Ultracopier")); + connect(&server,&ServerCatchcopy::newCopyWithoutDestination, this,&Listener::copyWithoutDestination); + connect(&server,&ServerCatchcopy::newCopy, this,&Listener::copy); + connect(&server,&ServerCatchcopy::newMoveWithoutDestination, this,&Listener::moveWithoutDestination); + connect(&server,&ServerCatchcopy::newMove, this,&Listener::move); + connect(&server,&ServerCatchcopy::error, this,&Listener::errorInternal); + connect(&server,&ServerCatchcopy::communicationError, this,&Listener::communicationErrorInternal); + connect(&server,&ServerCatchcopy::clientName, this,&Listener::clientName); + connect(&server,&ServerCatchcopy::clientName, this,&Listener::newClientList); + connect(&server,&ServerCatchcopy::connectedClient, this,&Listener::newClientList); + connect(&server,&ServerCatchcopy::disconnectedClient, this,&Listener::newClientList); + } -void CatchCopyPlugin::listen() +void Listener::listen() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(server.listen()) - emit newState(FullListening); - else - emit newState(NotListening); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: %1").arg(ExtraSocketCatchcopy::pathSocket())); + if(server.listen()) + emit newState(Ultracopier::FullListening); + else + emit newState(Ultracopier::NotListening); } -void CatchCopyPlugin::close() +void Listener::close() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - server.close(); - emit newState(NotListening); + server.close(); + emit newState(Ultracopier::NotListening); } -const QString CatchCopyPlugin::errorString() +const QString Listener::errorString() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - return server.errorString(); + return server.errorString(); } -void CatchCopyPlugin::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +void Listener::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - Q_UNUSED(options); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); } /// \brief to get the options widget, NULL if not have -QWidget * CatchCopyPlugin::options() +QWidget * Listener::options() { - return NULL; + return NULL; } -Q_EXPORT_PLUGIN2(listener, CatchCopyPlugin); +/// \brief to get a client list +QStringList Listener::clientsList() const +{ + return server.clientsList(); +} -void CatchCopyPlugin::transferFinished(quint32 orderId,bool withError) +void Listener::transferFinished(const quint32 &orderId,const bool &withError) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, orderId: "+QString::number(orderId)+", withError: "+QString::number(withError)); - server.copyFinished(orderId,withError); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+QString::number(orderId)+", withError: "+QString::number(withError)); + server.copyFinished(orderId,withError); } -void CatchCopyPlugin::transferCanceled(quint32 orderId) +void Listener::transferCanceled(const quint32 &orderId) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, orderId: "+QString::number(orderId)); - server.copyCanceled(orderId); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+QString::number(orderId)); + server.copyCanceled(orderId); } /// \brief to reload the translation, because the new language have been loaded -void CatchCopyPlugin::newLanguageLoaded() +void Listener::newLanguageLoaded() +{ +} + +void Listener::errorInternal(const QString &string) +{ + Q_UNUSED(string); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"warning emited from Catchcopy lib: "+string); +} + +void Listener::communicationErrorInternal(const QString &string) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"warning emited from Catchcopy lib: "+string); + emit error(string); +} + +void Listener::clientName(quint32 client,QString name) +{ + Q_UNUSED(client); + Q_UNUSED(name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("clientName: %1, for the id: %2").arg(name).arg(client)); +} + +void Listener::copyWithoutDestination(const quint32 &orderId,const QStringList &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("copyWithoutDestination(%1,%2)").arg(orderId).arg(sources.join(";"))); + emit newCopyWithoutDestination(orderId,sources); +} + +void Listener::copy(const quint32 &orderId,const QStringList &sources,const QString &destination) { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("copy(%1,%2,%3)").arg(orderId).arg(sources.join(";")).arg(destination)); + emit newCopy(orderId,sources,destination); } -void CatchCopyPlugin::error(QString error) +void Listener::moveWithoutDestination(const quint32 &orderId,const QStringList &sources) { - Q_UNUSED(error); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"warning emited from Catchcopy lib: "+error); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("moveWithoutDestination(%1,%2)").arg(orderId).arg(sources.join(";"))); + emit newMoveWithoutDestination(orderId,sources); } -void CatchCopyPlugin::clientName(quint32 client,QString name) +void Listener::move(const quint32 &orderId,const QStringList &sources,const QString &destination) { - Q_UNUSED(client); - Q_UNUSED(name); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("clientName: %1, for the id: %2").arg(name).arg(client)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("move(%1,%2,%3)").arg(orderId).arg(sources.join(";")).arg(destination)); + emit newMove(orderId,sources,destination); } diff --git a/plugins/Listener/catchcopy-v0002/listener.h b/plugins/Listener/catchcopy-v0002/listener.h old mode 100755 new mode 100644 index 0ef0dc7..8956abc --- a/plugins/Listener/catchcopy-v0002/listener.h +++ b/plugins/Listener/catchcopy-v0002/listener.h @@ -1,62 +1,59 @@ /** \file listener.h \brief Define the server compatible with Ultracopier interface \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SERVER_H #define SERVER_H -#include +#include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include +#endif #include "Environment.h" #include "../../../interface/PluginInterface_Listener.h" #include "catchcopy-api-0002/ServerCatchcopy.h" /// \brief Define the server compatible with Ultracopier interface -class CatchCopyPlugin : public PluginInterface_Listener +class Listener : public PluginInterface_Listener { - Q_OBJECT - Q_INTERFACES(PluginInterface_Listener) + Q_OBJECT + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.Listener/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_Listener) + #endif public: - CatchCopyPlugin(); - /// \brief try listen the copy/move - void listen(); - /// \brief stop listen to copy/move - void close(); - /// \brief return the error strong - const QString errorString(); - /// \brief set resources for this plugins - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); - /// \brief to get the options widget, NULL if not have - QWidget * options(); + Listener(); + /// \brief try listen the copy/move + void listen(); + /// \brief stop listen to copy/move + void close(); + /// \brief return the error strong + const QString errorString() const; + /// \brief set resources for this plugins + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); + /// \brief to get a client list + QStringList clientsList() const; public slots: - /// \brief say to the client that's the copy/move is finished - void transferFinished(quint32 orderId,bool withError); - /// \brief say to the client that's the copy/move is finished - void transferCanceled(quint32 orderId); - /// \brief to reload the translation, because the new language have been loaded - void newLanguageLoaded(); + /// \brief say to the client that's the copy/move is finished + void transferFinished(const quint32 &orderId,const bool &withError); + /// \brief say to the client that's the copy/move is finished + void transferCanceled(const quint32 &orderId); + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); private: - ServerCatchcopy server; + ServerCatchcopy server; private slots: - void error(QString error); - void clientName(quint32 client,QString name); -signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - /// \brief new state - void newState(ListeningState state); - /// \brief new copy is incoming - void newCopy(quint32 orderId,QStringList sources); - /// \brief new copy is incoming, with destination - void newCopy(quint32 orderId,QStringList sources,QString destination); - /// \brief new move is incoming - void newMove(quint32 orderId,QStringList sources); - /// \brief new move is incoming, with destination - void newMove(quint32 orderId,QStringList sources,QString destination); + void errorInternal(const QString &string); + void communicationErrorInternal(const QString &string); + void clientName(quint32 client,QString name); + void copyWithoutDestination(const quint32 &orderId,const QStringList &sources); + void copy(const quint32 &orderId,const QStringList &sources,const QString &destination); + void moveWithoutDestination(const quint32 &orderId,const QStringList &sources); + void move(const quint32 &orderId,const QStringList &sources,const QString &destination); }; #endif // SERVER_H diff --git a/plugins/Listener/catchcopy-v0002/listener.pro b/plugins/Listener/catchcopy-v0002/listener.pro index 5903fa4..f1706c5 100644 --- a/plugins/Listener/catchcopy-v0002/listener.pro +++ b/plugins/Listener/catchcopy-v0002/listener.pro @@ -1,6 +1,11 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + TEMPLATE = lib CONFIG += plugin QT += network +win32:LIBS += -ladvapi32 HEADERS = listener.h \ catchcopy-api-0002/VariablesCatchcopy.h \ catchcopy-api-0002/ServerCatchcopy.h \ @@ -14,4 +19,3 @@ SOURCES = listener.cpp \ catchcopy-api-0002/ServerCatchcopy.cpp \ catchcopy-api-0002/ExtraSocketCatchcopy.cpp TARGET = $$qtLibraryTarget(listener) - diff --git a/plugins/Listener/catchcopy-v0002/plugin.json b/plugins/Listener/catchcopy-v0002/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Listener/dbus/Catchcopy.cpp b/plugins/Listener/dbus/Catchcopy.cpp index 792563a..6c46af2 100644 --- a/plugins/Listener/dbus/Catchcopy.cpp +++ b/plugins/Listener/dbus/Catchcopy.cpp @@ -1,15 +1,17 @@ #include "Catchcopy.h" +#include + Catchcopy::Catchcopy() { } -void Catchcopy::copy(QStringList sources,QString destination) +void Catchcopy::copy(const QStringList &sources,const QString &destination) { emit newCopy(0,sources,destination); } -void Catchcopy::move(QStringList sources,QString destination) +void Catchcopy::move(const QStringList &sources,const QString &destination) { emit newMove(0,sources,destination); } diff --git a/plugins/Listener/dbus/Catchcopy.h b/plugins/Listener/dbus/Catchcopy.h index 6151ebd..d28a253 100644 --- a/plugins/Listener/dbus/Catchcopy.h +++ b/plugins/Listener/dbus/Catchcopy.h @@ -10,11 +10,11 @@ class Catchcopy : public QObject public: explicit Catchcopy(); signals: - void newCopy(quint32 id,QStringList sources,QString destination); - void newMove(quint32 id,QStringList sources,QString destination); + void newCopy(const quint32 &id,const QStringList &sources,const QString &destination); + void newMove(const quint32 &id,const QStringList &sources,const QString &destination); public slots: - Q_SCRIPTABLE void copy(QStringList sources,QString destination); - Q_SCRIPTABLE void move(QStringList sources,QString destination); + Q_SCRIPTABLE void copy(const QStringList &sources,const QString &destination); + Q_SCRIPTABLE void move(const QStringList &sources,const QString &destination); }; #endif // CATCHCOPY_H diff --git a/plugins/Listener/dbus/DebugEngineMacro.h b/plugins/Listener/dbus/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/Listener/dbus/DebugEngineMacro.h +++ b/plugins/Listener/dbus/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/Listener/dbus/Environment.h b/plugins/Listener/dbus/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/Listener/dbus/Environment.h +++ b/plugins/Listener/dbus/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins/Listener/dbus/Variable.h b/plugins/Listener/dbus/Variable.h index 8179c93..963d0c8 100644 --- a/plugins/Listener/dbus/Variable.h +++ b/plugins/Listener/dbus/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H diff --git a/plugins/Listener/dbus/documentation.dox b/plugins/Listener/dbus/documentation.dox old mode 100755 new mode 100644 index a15792a..3cda8ec --- a/plugins/Listener/dbus/documentation.dox +++ b/plugins/Listener/dbus/documentation.dox @@ -6,25 +6,29 @@ */ /*! - \mainpage catchcopy-v0002 + \mainpage dbus \section mainpage_overview Overview - Is the default listener to wait a copy/move. It use the catchcopy protocol.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. + It's alternative listener for linux, it's very more simpler. You send just your copy/move, no more. No return.\n + More informations on the wiki of ultracopier. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads You can found link on Ultracopier (Supercopier/Teracopy) project page, via git, snapshot sources, ... - \section mainpage_algorithm Protocol + \section mainpage_algorithm Dbus method - The protocol in version 0.0.0.2 is used, you can see the documentation on Catchcopy web site + you have this method exported to dbus: +
    +
  • void copy(const QStringList &sources,const QString &destination)
  • +
  • void move(const QStringList &sources,const QString &destination)
  • +
\section license GPL Version 3 The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4. diff --git a/plugins/Listener/dbus/informations.xml b/plugins/Listener/dbus/informations.xml index 846cd36..0b836ed 100644 --- a/plugins/Listener/dbus/informations.xml +++ b/plugins/Listener/dbus/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 dbus =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins/Listener/dbus/listener.cpp b/plugins/Listener/dbus/listener.cpp old mode 100755 new mode 100644 index 2f23638..50ed196 --- a/plugins/Listener/dbus/listener.cpp +++ b/plugins/Listener/dbus/listener.cpp @@ -1,86 +1,85 @@ -#include -#include - #include "listener.h" -CatchCopyPlugin::CatchCopyPlugin() +Listener::Listener() { - connect(&catchcopy,SIGNAL(newCopy(quint32,QStringList,QString)), this,SIGNAL(newCopy(quint32,QStringList,QString))); - connect(&catchcopy,SIGNAL(newMove(quint32,QStringList,QString)), this,SIGNAL(newMove(quint32,QStringList,QString))); + connect(&catchcopy,&Catchcopy::newCopy, this,&Listener::newCopy); + connect(&catchcopy,&Catchcopy::newMove, this,&Listener::newMove); } -void CatchCopyPlugin::listen() +void Listener::listen() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if (!QDBusConnection::sessionBus().isConnected()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit newState(NotListening); - return; - } - if (!QDBusConnection::sessionBus().registerService("info.first-world.catchcopy")) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QDBusConnection::sessionBus().lastError().message()); - emit newState(NotListening); - return; - } - emit newState(FullListening); - QDBusConnection::sessionBus().registerObject("/", &catchcopy, QDBusConnection::ExportAllSlots); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if (!QDBusConnection::sessionBus().isConnected()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit newState(Ultracopier::NotListening); + return; + } + if (!QDBusConnection::sessionBus().registerService("info.first-world.catchcopy")) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QDBusConnection::sessionBus().lastError().message()); + emit newState(Ultracopier::NotListening); + return; + } + if(!QDBusConnection::sessionBus().registerObject("/", &catchcopy, QDBusConnection::ExportAllSlots)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QDBusConnection::sessionBus().lastError().message()); + emit newState(Ultracopier::NotListening); + return; + } + emit newState(Ultracopier::FullListening); } -void CatchCopyPlugin::close() +void Listener::close() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - QDBusConnection::sessionBus().unregisterObject("/"); - QDBusConnection::sessionBus().unregisterService("info.first-world.catchcopy"); - emit newState(NotListening); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QDBusConnection::sessionBus().unregisterObject("/"); + QDBusConnection::sessionBus().unregisterService("info.first-world.catchcopy"); + emit newState(Ultracopier::NotListening); } -const QString CatchCopyPlugin::errorString() +const QString Listener::errorString() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - return "Unknow error"; + return "Unknow error"; } -void CatchCopyPlugin::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +void Listener::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - Q_UNUSED(options); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); } /// \brief to get the options widget, NULL if not have -QWidget * CatchCopyPlugin::options() +QWidget * Listener::options() { - return NULL; + return NULL; } -Q_EXPORT_PLUGIN2(listener, CatchCopyPlugin); - -void CatchCopyPlugin::transferFinished(quint32 orderId,bool withError) +void Listener::transferFinished(const quint32 &orderId,const bool &withError) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, orderId: "+QString::number(orderId)+", withError: "+QString::number(withError)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+QString::number(orderId)+", withError: "+QString::number(withError)); } -void CatchCopyPlugin::transferCanceled(quint32 orderId) +void Listener::transferCanceled(const quint32 &orderId) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, orderId: "+QString::number(orderId)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+QString::number(orderId)); } /// \brief to reload the translation, because the new language have been loaded -void CatchCopyPlugin::newLanguageLoaded() +void Listener::newLanguageLoaded() { } -void CatchCopyPlugin::error(QString error) +void Listener::error(QString error) { - Q_UNUSED(error); + Q_UNUSED(error); } -void CatchCopyPlugin::clientName(quint32 client,QString name) +void Listener::clientName(quint32 client,QString name) { - Q_UNUSED(client); - Q_UNUSED(name); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,QString("clientName: %1, for the id: %2").arg(name).arg(client)); + Q_UNUSED(client); + Q_UNUSED(name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("clientName: %1, for the id: %2").arg(name).arg(client)); } diff --git a/plugins/Listener/dbus/listener.h b/plugins/Listener/dbus/listener.h old mode 100755 new mode 100644 index fd3db2e..fcb95cd --- a/plugins/Listener/dbus/listener.h +++ b/plugins/Listener/dbus/listener.h @@ -1,8 +1,7 @@ /** \file listener.h \brief Define the server compatible with Ultracopier interface \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SERVER_H #define SERVER_H @@ -16,49 +15,35 @@ #include "../../../interface/PluginInterface_Listener.h" /// \brief Define the server compatible with Ultracopier interface -class CatchCopyPlugin : public PluginInterface_Listener +class Listener : public PluginInterface_Listener { - Q_OBJECT - Q_INTERFACES(PluginInterface_Listener) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.Listener/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_Listener) public: - CatchCopyPlugin(); - /// \brief try listen the copy/move - void listen(); - /// \brief stop listen to copy/move - void close(); - /// \brief return the error strong - const QString errorString(); - /// \brief set resources for this plugins - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); - /// \brief to get the options widget, NULL if not have - QWidget * options(); + Listener(); + /// \brief try listen the copy/move + void listen(); + /// \brief stop listen to copy/move + void close(); + /// \brief return the error strong + const QString errorString() const; + /// \brief set resources for this plugins + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); public slots: - /// \brief say to the client that's the copy/move is finished - void transferFinished(quint32 orderId,bool withError); - /// \brief say to the client that's the copy/move is finished - void transferCanceled(quint32 orderId); - /// \brief to reload the translation, because the new language have been loaded - void newLanguageLoaded(); + /// \brief say to the client that's the copy/move is finished + void transferFinished(const quint32 &orderId,const bool &withError); + /// \brief say to the client that's the copy/move is finished + void transferCanceled(const quint32 &orderId); + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); private: - Catchcopy catchcopy; + Catchcopy catchcopy; private slots: - void error(QString error); - void clientName(quint32 client,QString name); -signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - /// \brief new state - void newState(ListeningState state); - /// \brief new copy is incoming - void newCopy(quint32 orderId,QStringList sources); - /// \brief new copy is incoming, with destination - void newCopy(quint32 orderId,QStringList sources,QString destination); - /// \brief new move is incoming - void newMove(quint32 orderId,QStringList sources); - /// \brief new move is incoming, with destination - void newMove(quint32 orderId,QStringList sources,QString destination); + void error(QString error); + void clientName(quint32 client,QString name); }; #endif // SERVER_H diff --git a/plugins/Listener/dbus/listener.pro b/plugins/Listener/dbus/listener.pro index 304d8d2..59abd12 100644 --- a/plugins/Listener/dbus/listener.pro +++ b/plugins/Listener/dbus/listener.pro @@ -1,6 +1,6 @@ TEMPLATE = lib -CONFIG += plugin qdbus -QT += network +CONFIG += plugin +QT += network dbus HEADERS = listener.h \ Environment.h \ Variable.h \ @@ -11,4 +11,3 @@ HEADERS = listener.h \ SOURCES = listener.cpp \ Catchcopy.cpp TARGET = $$qtLibraryTarget(listener) - diff --git a/plugins/Listener/dbus/plugin.json b/plugins/Listener/dbus/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/Listener/dbus/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h b/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h old mode 100755 new mode 100644 index ad08d4f..f9b5349 --- a/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h +++ b/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/PluginLoader/catchcopy-v0002/Environment.h b/plugins/PluginLoader/catchcopy-v0002/Environment.h old mode 100755 new mode 100644 index 94fd104..265a5a6 --- a/plugins/PluginLoader/catchcopy-v0002/Environment.h +++ b/plugins/PluginLoader/catchcopy-v0002/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts index b27aefe..dd3552b 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts @@ -5,8 +5,14 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + Im Normalfall ist für 32 oder 64-Bit-Beriebsysteme nur die jeweilige dll wichtig. Die UAC kann geöffnet werden um die dll zu laden. + + + All the dlls are importants - Alle DLLs sind importants + fix english + Alle DLLs sind wichtig (32Bit + 64Bit)
diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts new file mode 100644 index 0000000..e4aa3ce --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts @@ -0,0 +1,17 @@ + + + + + OptionsWidget + + + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + + All the dlls are importants + + + + diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts index 4629456..577444d 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants Todas las dlls son importantes diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts index 40efc6d..809ffee 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + Dans la plupart des cas, seule la DLL 64 bits est importante pour un OS 64 bits, et la DLL 32 bits pour un OS 32 bits. Lorsqu'elle est importante,le chargement d'une DLL peut nécessiter une confirmation (UAC). + + + All the dlls are importants Toutes les dlls sont importantes diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts new file mode 100644 index 0000000..30fce33 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts @@ -0,0 +1,17 @@ + + + + + OptionsWidget + + + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + Normális esetben csak a 64 bites dll fontos a 64 bites és a 32 bites dll a 32 bites operációs rendszer számára.Amikor lényeges, az UAC megnyitható a dll betöltéséhez. + + + + All the dlls are importants + Az összes dll fontos + + + diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts index c87f684..ba6fb10 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts @@ -1,12 +1,17 @@ - + OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + Solitamente, la dll 64Bit è indispensabile solo per sistemi operativi a 64Bit, e la dll 32Bit per sistemi operativi a 32Bits. Quando è necessario, l' UAC (il controllo dell'account utente) può essere aperto per caricare la dll. + + + All the dlls are importants - + Tutte le dll sono necessarie diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts index 9d16334..48aea93 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts index 480851d..239b785 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants Все библиотеки являются важным diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts @@ -5,6 +5,11 @@ OptionsWidget + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + + + + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp old mode 100755 new mode 100644 index 4d616e4..563e855 --- a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp @@ -3,37 +3,37 @@ OptionsWidget::OptionsWidget(QWidget *parent) : QWidget(parent), - ui(new Ui::OptionsWidget) + ui(new Ui::OptionsWidget) { - ui->setupUi(this); + ui->setupUi(this); } OptionsWidget::~OptionsWidget() { - delete ui; + //delete ui;//attached to the main program, then it's the main program responsive the delete } void OptionsWidget::setAllDllIsImportant(bool allDllIsImportant) { - ui->allDllIsImportant->setChecked(allDllIsImportant); + ui->allDllIsImportant->setChecked(allDllIsImportant); } void OptionsWidget::setDebug(bool Debug) { - ui->Debug->setChecked(Debug); + ui->Debug->setChecked(Debug); } void OptionsWidget::on_allDllIsImportant_toggled(bool checked) { - emit sendAllDllIsImportant(ui->allDllIsImportant->isChecked()); + emit sendAllDllIsImportant(checked); } void OptionsWidget::retranslate() { - ui->retranslateUi(this); + ui->retranslateUi(this); } void OptionsWidget::on_Debug_toggled(bool checked) { - emit sendDebug(ui->Debug->isChecked()); + emit sendDebug(checked); } diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h old mode 100755 new mode 100644 diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui old mode 100755 new mode 100644 index 4fc0727..c741676 --- a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui @@ -13,6 +13,9 @@ + + In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll. + All the dlls are importants diff --git a/plugins/PluginLoader/catchcopy-v0002/Variable.h b/plugins/PluginLoader/catchcopy-v0002/Variable.h old mode 100755 new mode 100644 index 8179c93..90e1557 --- a/plugins/PluginLoader/catchcopy-v0002/Variable.h +++ b/plugins/PluginLoader/catchcopy-v0002/Variable.h @@ -1,14 +1,14 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H //Un-comment this next line to put ultracopier plugin in debug mode #define ULTRACOPIER_PLUGIN_DEBUG +//#define ULTRACOPIER_PLUGIN_ALL_IN_ONE #endif // VARIABLE_H diff --git a/plugins/PluginLoader/catchcopy-v0002/documentation.dox b/plugins/PluginLoader/catchcopy-v0002/documentation.dox old mode 100755 new mode 100644 index e8aaaa7..08ccc4a --- a/plugins/PluginLoader/catchcopy-v0002/documentation.dox +++ b/plugins/PluginLoader/catchcopy-v0002/documentation.dox @@ -10,13 +10,13 @@ \section mainpage_overview Overview - Is the plugin to load the catchcopy plugin into the windows file manager.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. + Is the plugin to load the catchcopy plugin into the windows file manager. Mostly it use the command: regsvr32 /s catchcopy32.dll/catchcopy64.dll\n + More informations on the wiki of ultracopier. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads @@ -28,7 +28,7 @@ In function if Ultracopier is compiled by portable version, try load the dll by other way. \section license GPL Version 3 - The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4. + The code source is under GPL3. */ diff --git a/plugins/PluginLoader/catchcopy-v0002/informations.xml b/plugins/PluginLoader/catchcopy-v0002/informations.xml old mode 100755 new mode 100644 index 568ad06..0b62f30 --- a/plugins/PluginLoader/catchcopy-v0002/informations.xml +++ b/plugins/PluginLoader/catchcopy-v0002/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 catchcopy-v0002 =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins/PluginLoader/catchcopy-v0002/plugin.json b/plugins/PluginLoader/catchcopy-v0002/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp old mode 100755 new mode 100644 index d69cf91..2009e0a --- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp @@ -1,543 +1,442 @@ /** \file pluginLoader.cpp \brief Define the session plugin loader test -\author alpha_one_x86 -\version 0.3 -\date 2010 */ +\author alpha_one_x86 */ #include "pluginLoader.h" #include "PlatformMacro.h" +#include +#include +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#include +#endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG - #define NORMAL_EXT "d.dll" - #define SECOND_EXT ".dll" + #define NORMAL_EXT "d.dll" + #define SECOND_EXT ".dll" #else - #define NORMAL_EXT ".dll" - #define SECOND_EXT "d.dll" + #define NORMAL_EXT ".dll" + #define SECOND_EXT "d.dll" #endif #define CATCHCOPY_DLL_32 "catchcopy32" #define CATCHCOPY_DLL_64 "catchcopy64" -PluginLoader::PluginLoader() +WindowsExplorerLoader::WindowsExplorerLoader() { - //set the startup value into the variable - dllChecked=false; - optionsEngine=NULL; - allDllIsImportant=false; - Debug=false; - needBeRegistred=false; - changeOfArchDetected=false; - is64Bits=false; - connect(&optionsWidget,SIGNAL(sendAllDllIsImportant(bool)),this,SLOT(setAllDllIsImportant(bool))); - connect(&optionsWidget,SIGNAL(sendDebug(bool)),this,SLOT(setDebug(bool))); + //set the startup value into the variable + dllChecked=false; + optionsEngine=NULL; + allDllIsImportant=false; + Debug=false; + needBeRegistred=false; + changeOfArchDetected=false; + is64Bits=false; + optionsWidget=new OptionsWidget(); + connect(optionsWidget,&OptionsWidget::sendAllDllIsImportant,this,&WindowsExplorerLoader::setAllDllIsImportant); + connect(optionsWidget,&OptionsWidget::sendDebug,this,&WindowsExplorerLoader::setDebug); #if defined(_M_X64)//64Bits - is64Bits=true; + is64Bits=true; #else//32Bits - char *arch=getenv("windir"); - if(arch!=NULL) - { - QDir dir; - if(dir.exists(QString(arch)+"\\SysWOW64\\")) - is64Bits=true; - /// \note commented because it do a crash at the startup, and useless, because is global variable, it should be removed only by the OS - //delete arch; - } + char *arch=getenv("windir"); + if(arch!=NULL) + { + QDir dir; + if(dir.exists(QString(arch)+"\\SysWOW64\\")) + is64Bits=true; + /// \note commented because it do a crash at the startup, and useless, because is global variable, it should be removed only by the OS + //delete arch; + } #endif } -PluginLoader::~PluginLoader() +WindowsExplorerLoader::~WindowsExplorerLoader() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"destructor"); - setEnabled(false); + //delete optionsWidget;//attached to the main program, then it's the main program responsive the delete + setEnabled(false); } -void PluginLoader::setEnabled(bool needBeRegistred) +void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred) { - if(!checkExistsDll()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("No dll exists")); - emit newState(Uncaught); - if(!needBeRegistred) - correctlyLoaded.clear(); - return; - } - if(this->needBeRegistred==needBeRegistred) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Double event dropped")); - return; - } - this->needBeRegistred=needBeRegistred; - int index=0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant)); + if(!checkExistsDll()) + { + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + if(needBeRegistred) + emit newState(Ultracopier::Caught); + else + emit newState(Ultracopier::Uncaught); + #else + emit newState(Ultracopier::Uncaught); + #endif + if(!needBeRegistred) + correctlyLoaded.clear(); + return; + } + if(this->needBeRegistred==needBeRegistred) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Double event dropped: %1").arg(needBeRegistred)); + if(needBeRegistred) + emit newState(Ultracopier::Caught); + else + emit newState(Ultracopier::Uncaught); + return; + } + this->needBeRegistred=needBeRegistred; + int index=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant)); - bool oneHaveFound=false; - index=0; - while(index0 || secondDll.size()>0) - return true; - else - return false; - } - dllChecked=true; - - if(is64Bits) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"64Bits is important"); - importantDll << CATCHCOPY_DLL_64; - secondDll << CATCHCOPY_DLL_32; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"32Bits is important"); - importantDll << CATCHCOPY_DLL_32; - secondDll << CATCHCOPY_DLL_64; - } - - int index=0; - while(index0 || secondDll.size()>0) - return true; - else - return false; + if(!needBeRegistred) + correctlyLoaded.clear(); } -void PluginLoader::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +bool WindowsExplorerLoader::checkExistsDll() { - Q_UNUSED(options); - this->pluginPath=pluginPath; - this->optionsEngine=options; - if(optionsEngine!=NULL) - { - QList > KeysList; - KeysList.append(qMakePair(QString("allDllIsImportant"),QVariant(false))); - KeysList.append(qMakePair(QString("Debug"),QVariant(false))); - optionsEngine->addOptionGroup(KeysList); - allDllIsImportant=optionsEngine->getOptionValue("allDllIsImportant").toBool(); - Debug=optionsEngine->getOptionValue("Debug").toBool(); - optionsWidget.setAllDllIsImportant(allDllIsImportant); - optionsWidget.setDebug(Debug); - } -} + if(dllChecked) + { + if(importantDll.size()>0 || secondDll.size()>0) + return true; + else + return false; + } + dllChecked=true; -bool PluginLoader::RegisterShellExtDll(QString dllPath, bool bRegister,bool quiet) -{ - if(Debug) - { - QString message; - if(bRegister) - message+=QString("Try load the dll: %1, and ").arg(dllPath); - else - message+=QString("Try unload the dll: %1, and ").arg(dllPath); - if(quiet) - message+=QString("don't open the UAC"); - else - message+=QString("open the UAC if needed"); - QMessageBox::information(NULL,"Debug",message); - } - ////////////////////////////// First way to load ////////////////////////////// - - wchar_t arrayArg[65535]; - int size_lenght; - // first try - load dll and register it manually. - HRESULT hResult = S_OK; - // if failed - try by loading extension manually (would fail on vista when running as user) - hResult = CoInitializeEx(NULL, COINIT_MULTITHREADED); - if(SUCCEEDED(hResult)) - { - HRESULT (STDAPICALLTYPE *pfn)(void); - size_lenght=dllPath.toWCharArray(arrayArg); - HINSTANCE hMod = LoadLibrary(arrayArg); // load the dll - if(hMod == NULL) - hResult = HRESULT_FROM_WIN32(GetLastError()); - if(SUCCEEDED(hResult) && !hMod) - hResult = E_FAIL; - if(SUCCEEDED(hResult)) - { - (FARPROC&)pfn = GetProcAddress(hMod, (bRegister ? "DllRegisterServer" : "DllUnregisterServer")); - if(pfn == NULL) - hResult = E_FAIL; - if(SUCCEEDED(hResult)) - hResult = (*pfn)(); - - CoFreeLibrary(hMod); - } - CoUninitialize(); - if(SUCCEEDED(hResult) && SCODE_CODE(hResult) != ERROR_ACCESS_DENIED) - return true; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("fail by LoadLibrary: %1, error code: %2").arg(dllPath).arg((quint32)hResult)); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("fail by CoInitializeEx: %1, error code: %2").arg(dllPath).arg((quint32)hResult)); - - ////////////////////////////// Second way to load ////////////////////////////// - QStringList arguments; - if(!Debug) - arguments.append("/s"); - if(!bRegister) - arguments.append("/u"); - arguments.append(dllPath); - QString argumentsString; - for (int i = 0; i < arguments.size(); ++i) { - if(argumentsString.isEmpty()) - argumentsString+=arguments.at(i); - else - if(i == arguments.size()) - argumentsString+=" \""+arguments.at(i)+"\""; - else - argumentsString+=' '+arguments.at(i); - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: regsvr32 "+argumentsString); - int result=QProcess::execute("regsvr32",arguments); - bool ok=false; - if(result==0) - ok=true; - #if ! defined(_M_X64) - if(result==999 && !changeOfArchDetected)//code of wrong arch for the dll - { - changeOfArchDetected=true; - QStringList temp; - temp = importantDll; - secondDll = importantDll; - importantDll = temp; - return false; - } - #endif - if(result==5) - { - if(!quiet || (!bRegister && correctlyLoaded.contains(dllPath))) - { - ////////////////////////////// Last way to load ////////////////////////////// - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"try it in win32"); - // try with regsvr32, win32 because for admin dialog + if(is64Bits) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"64Bits is important"); + importantDll << CATCHCOPY_DLL_64; + secondDll << CATCHCOPY_DLL_32; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"32Bits is important"); + importantDll << CATCHCOPY_DLL_32; + secondDll << CATCHCOPY_DLL_64; + } - size_lenght=argumentsString.toWCharArray(arrayArg); - //size_lenght*sizeof(wchar_t) - wcscpy(arrayArg+size_lenght*sizeof(wchar_t),TEXT("\0")); - SHELLEXECUTEINFO sei; - memset(&sei, 0, sizeof(sei)); - sei.cbSize = sizeof(sei); - sei.fMask = SEE_MASK_UNICODE; - sei.lpVerb = TEXT("runas"); - sei.lpFile = TEXT("regsvr32.exe"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"in win32 mode: arrayArg: "+QString::fromWCharArray(arrayArg,size_lenght)); - sei.lpParameters = arrayArg; - sei.nShow = SW_SHOW; - ok=ShellExecuteEx(&sei); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"not try because need be quiet: "+dllPath); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("regsvr32 terminated with: %1").arg(result)); - correctlyLoaded.remove(dllPath); - if(!bRegister) - HardUnloadDLL(dllPath); - return ok; + int index=0; + while(index0 || secondDll.size()>0) + return true; + else + return false; } -Q_EXPORT_PLUGIN2(pluginLoader, PluginLoader); - -bool WINAPI PluginLoader::DLLEjecteurW(DWORD dwPid,PWSTR szDLLPath) +void WindowsExplorerLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - /* Search address of module */ - MODULEENTRY32W meModule; - meModule.dwSize = sizeof(meModule); - HANDLE hSnapshot = NULL; - - hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwPid); - if(hSnapshot == NULL) - return false; - - /* Search the right modules of the process */ - Module32FirstW(hSnapshot, &meModule); - do{ - if((lstrcmpiW(meModule.szModule,szDLLPath) == 0) || (lstrcmpiW(meModule.szExePath,szDLLPath) == 0))break; - }while(Module32NextW(hSnapshot, &meModule)); - - /* Get handle of the process */ - HANDLE hProcess; - - hProcess = OpenProcess(PROCESS_ALL_ACCESS, false,dwPid); - if(hProcess == NULL) - { - CloseHandle(hSnapshot); - return false; - } - - LPTHREAD_START_ROUTINE lpthThreadFunction; - /* Get addresse of FreeLibrary in kernel32.dll */ - lpthThreadFunction = (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(L"kernel32.dll"), "FreeLibrary"); - if(lpthThreadFunction == NULL) - { - CloseHandle(hProcess); - CloseHandle(hSnapshot); - return false; - } - - /* Creation the remote thread */ - DWORD dwThreadID = 0; - HANDLE hThread = NULL; - hThread = CreateRemoteThread(hProcess, NULL, 0, lpthThreadFunction,meModule.modBaseAddr, 0, &dwThreadID); - if(hThread == NULL) - { - CloseHandle(hSnapshot); - CloseHandle(hProcess); - return false; - } - - WaitForSingleObject(hThread,INFINITE); - - CloseHandle(hProcess); - CloseHandle(hThread); - - return true; + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + this->pluginPath=QCoreApplication::applicationDirPath()+"/"; + #else + this->pluginPath=pluginPath; + #endif + this->optionsEngine=options; + if(optionsEngine!=NULL) + { + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("allDllIsImportant"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("Debug"),QVariant(false))); + optionsEngine->addOptionGroup(KeysList); + allDllIsImportant=optionsEngine->getOptionValue("allDllIsImportant").toBool(); + Debug=optionsEngine->getOptionValue("Debug").toBool(); + optionsWidget->setAllDllIsImportant(allDllIsImportant); + optionsWidget->setDebug(Debug); + } } -void PluginLoader::HardUnloadDLL(QString myDllName) +bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bool &bRegister,const bool &quiet) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+myDllName); - HANDLE hSnapShot1; - PROCESSENTRY32 uProcess; - HANDLE hSnapShot2; - MODULEENTRY32 me32; - QString DllLoaded = ""; - QString DllLoadedName = ""; - QString DllLoadedPath = ""; - bool bResult; - bool r; - short NbProcess; - NbProcess=0; - - hSnapShot1 = CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); - - uProcess.dwSize = (DWORD) sizeof(PROCESSENTRY32); - - r = Process32First(hSnapShot1, &uProcess); + if(Debug) + { + QString message; + if(bRegister) + message+=QStringLiteral("Try load the dll: %1, and ").arg(dllPath); + else + message+=QStringLiteral("Try unload the dll: %1, and ").arg(dllPath); + if(quiet) + message+=QStringLiteral("don't open the UAC"); + else + message+=QStringLiteral("open the UAC if needed"); + QMessageBox::information(NULL,"Debug",message); + } + if(bRegister && correctlyLoaded.contains(dllPath)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Try dual load: %1").arg(dllPath)); + return false; + } + ////////////////////////////// First way to load ////////////////////////////// + QStringList arguments; + if(!Debug) + arguments.append("/s"); + if(!bRegister) + arguments.append("/u"); + arguments.append(dllPath); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: regsvr32 "+arguments.join(" ")); + int result; + #ifdef Q_OS_WIN32 + QProcess process; + process.start("regsvr32",arguments); + if(!process.waitForStarted()) + result=985; + else if(!process.waitForFinished()) + result=984; + else + { + result=process.exitCode(); + QString out=QString::fromLocal8Bit(process.readAllStandardOutput()); + QString outError=QString::fromLocal8Bit(process.readAllStandardError()); + if(!out.isEmpty()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 output: "+out); + if(!outError.isEmpty()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 error output: "+outError); + } + #else + result=0; + #endif + bool ok=false; + if(result==0) + { + if(bRegister) + correctlyLoaded << dllPath; + ok=true; + } + #if ! defined(_M_X64) + if(result==999 && !changeOfArchDetected)//code of wrong arch for the dll + { + changeOfArchDetected=true; + QStringList temp; + temp = importantDll; + secondDll = importantDll; + importantDll = temp; + return false; + } + #endif + if(result==5) + { + if(!quiet || (!bRegister && correctlyLoaded.contains(dllPath))) + { + arguments.last()=QStringLiteral("\"%1\"").arg(arguments.last()); + ////////////////////////////// Last way to load ////////////////////////////// + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"try it in win32"); + // try with regsvr32, win32 because for admin dialog - while ( r ) - { - r = Process32Next(hSnapShot1, &uProcess); - QString myProcessName; - myProcessName=QString::fromWCharArray(uProcess.szExeFile); - if (uProcess.th32ProcessID < 99999) - { - hSnapShot2 = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, uProcess.th32ProcessID ); - if (hSnapShot2 != INVALID_HANDLE_VALUE) - { - me32.dwSize = sizeof(me32); - bResult = Module32First( hSnapShot2, &me32 ); - while( bResult ) - { - DllLoaded=QString::fromWCharArray(me32.szExePath); - DllLoadedName=QString::fromWCharArray(me32.szModule); - if (DllLoaded == myDllName) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"The path: "+DllLoaded); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,myProcessName+" ("+QString::number(uProcess.th32ProcessID)+")"); - DLLEjecteurW(uProcess.th32ProcessID,me32.szExePath); - } - bResult = Module32Next( hSnapShot2, &me32 ); - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"(int)hSnapShot2 != -1 for "+myProcessName+" ("+QString::number(uProcess.th32ProcessID)+")"); - if(hSnapShot2) - CloseHandle(hSnapShot2); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"uProcess.th32ProcessID > 99999 for "+myProcessName+" ("+QString::number(uProcess.th32ProcessID)+")"); - } - CloseHandle(hSnapShot1); + #ifdef Q_OS_WIN32 + wchar_t arrayArg[65535]; + int size_lenght=arguments.join(" ").toWCharArray(arrayArg); + //size_lenght*sizeof(wchar_t) + wcscpy(arrayArg+size_lenght*sizeof(wchar_t),TEXT("\0")); + SHELLEXECUTEINFO sei; + memset(&sei, 0, sizeof(sei)); + sei.cbSize = sizeof(sei); + sei.fMask = SEE_MASK_UNICODE; + sei.lpVerb = TEXT("runas"); + sei.lpFile = TEXT("regsvr32.exe"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"in win32 mode: arrayArg: "+QString::fromWCharArray(arrayArg,size_lenght)); + sei.lpParameters = arrayArg; + sei.nShow = SW_SHOW; + ok=ShellExecuteEx(&sei); + #else + ok=true; + #endif + if(ok && bRegister) + correctlyLoaded << dllPath; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"not try because need be quiet: "+dllPath); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("regsvr32 terminated with: %1").arg(result)); + if(!bRegister) + correctlyLoaded.remove(dllPath); + return ok; } /// \brief to get the options widget, NULL if not have -QWidget * PluginLoader::options() +QWidget * WindowsExplorerLoader::options() { - return &optionsWidget; + return optionsWidget; } -void PluginLoader::newLanguageLoaded() +void WindowsExplorerLoader::newLanguageLoaded() { - optionsWidget.retranslate(); + optionsWidget->retranslate(); } -void PluginLoader::setAllDllIsImportant(bool allDllIsImportant) +void WindowsExplorerLoader::setAllDllIsImportant(bool allDllIsImportant) { - this->allDllIsImportant=allDllIsImportant; - optionsEngine->setOptionValue("allDllIsImportant",allDllIsImportant); + this->allDllIsImportant=allDllIsImportant; + optionsEngine->setOptionValue("allDllIsImportant",allDllIsImportant); } -void PluginLoader::setDebug(bool Debug) +void WindowsExplorerLoader::setDebug(bool Debug) { - this->Debug=Debug; - optionsEngine->setOptionValue("Debug",Debug); + this->Debug=Debug; + optionsEngine->setOptionValue("Debug",Debug); } diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h old mode 100755 new mode 100644 index 79ba305..0246cd1 --- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h @@ -1,67 +1,63 @@ /** \file pluginLoader.h \brief Define the plugin loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGIN_LOADER_TEST_H #define PLUGIN_LOADER_TEST_H #include -#include #include #include #include #include #include -#include -#include +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include + #include +#endif #include "../../../interface/PluginInterface_PluginLoader.h" #include "Environment.h" #include "OptionsWidget.h" /// \brief \brief Define the plugin loader -class PluginLoader : public PluginInterface_PluginLoader +class WindowsExplorerLoader : public PluginInterface_PluginLoader { - Q_OBJECT - Q_INTERFACES(PluginInterface_PluginLoader) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.PluginLoader/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_PluginLoader) public: - PluginLoader(); - ~PluginLoader(); - /// \brief try enable/disable the catching - void setEnabled(bool); - /// \brief to set resources, writePath can be empty if read only mode - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); - /// \brief to get the options widget, NULL if not have - QWidget * options(); + WindowsExplorerLoader(); + ~WindowsExplorerLoader(); + /// \brief try enable/disable the catching + void setEnabled(const bool &needBeRegistred); + /// \brief to set resources, writePath can be empty if read only mode + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); public slots: - /// \brief to reload the translation, because the new language have been loaded - void newLanguageLoaded(); + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); private: - QString pluginPath; - QStringList importantDll,secondDll; - QSet correctlyLoaded; - bool RegisterShellExtDll(QString dllPath, bool bRegister,bool quiet); - bool checkExistsDll(); - bool dllChecked; - bool needBeRegistred; - bool WINAPI DLLEjecteurW(DWORD dwPid,PWSTR szDLLPath); - void HardUnloadDLL(QString myDllName); - OptionInterface * optionsEngine; - OptionsWidget optionsWidget; - bool allDllIsImportant,Debug; - bool changeOfArchDetected,is64Bits; -signals: - void newState(CatchState); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + QString pluginPath; + QStringList importantDll,secondDll; + QSet correctlyLoaded; + bool RegisterShellExtDll(const QString &dllPath, const bool &bRegister,const bool &quiet); + bool checkExistsDll(); + bool dllChecked; + bool needBeRegistred; + OptionInterface * optionsEngine; + OptionsWidget *optionsWidget; + bool allDllIsImportant,Debug; + bool changeOfArchDetected,is64Bits; private slots: - void setAllDllIsImportant(bool allDllIsImportant); - void setDebug(bool Debug); + void setAllDllIsImportant(bool allDllIsImportant); + void setDebug(bool Debug); }; #endif // PLUGIN_LOADER_TEST_H diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro old mode 100755 new mode 100644 index f383793..0d11721 --- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro @@ -1,3 +1,8 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets TEMPLATE = lib CONFIG += plugin HEADERS = \ @@ -13,27 +18,33 @@ SOURCES = \ pluginLoader.cpp \ OptionsWidget.cpp TARGET = $$qtLibraryTarget(pluginLoader) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ +TRANSLATIONS += Languages/ar/translation.ts \ Languages/de/translation.ts \ Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ Languages/it/translation.ts \ Languages/ja/translation.ts \ - Languages/id/translation.ts \ - Languages/pl/translation.ts \ - Languages/ru/translation.ts \ - Languages/tr/translation.ts \ - Languages/th/translation.ts \ - Languages/hi/translation.ts \ + Languages/ko/translation.ts \ Languages/nl/translation.ts \ Languages/no/translation.ts \ + Languages/pl/translation.ts \ Languages/pt/translation.ts \ - Languages/ko/translation.ts + Languages/ru/translation.ts \ + Languages/th/translation.ts \ + Languages/tr/translation.ts \ + Languages/zh/translation.ts -LIBS += -lole32 +win32:LIBS += -lole32 -lshell32 FORMS += \ OptionsWidget.ui +CONFIG(static, static|shared) { +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE +} + diff --git a/plugins/SessionLoader/KDE4/DebugEngineMacro.h b/plugins/SessionLoader/KDE4/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/SessionLoader/KDE4/DebugEngineMacro.h +++ b/plugins/SessionLoader/KDE4/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/SessionLoader/KDE4/Environment.h b/plugins/SessionLoader/KDE4/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/SessionLoader/KDE4/Environment.h +++ b/plugins/SessionLoader/KDE4/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins/SessionLoader/KDE4/Variable.h b/plugins/SessionLoader/KDE4/Variable.h index 8179c93..963d0c8 100644 --- a/plugins/SessionLoader/KDE4/Variable.h +++ b/plugins/SessionLoader/KDE4/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H diff --git a/plugins/SessionLoader/KDE4/documentation.dox b/plugins/SessionLoader/KDE4/documentation.dox old mode 100755 new mode 100644 index fbf0eb4..98ed23f --- a/plugins/SessionLoader/KDE4/documentation.dox +++ b/plugins/SessionLoader/KDE4/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview It control if it loaded with the session.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. + More informations on the wiki of ultracopier. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins/SessionLoader/KDE4/informations.xml b/plugins/SessionLoader/KDE4/informations.xml index cdc5150..2178b0e 100644 --- a/plugins/SessionLoader/KDE4/informations.xml +++ b/plugins/SessionLoader/KDE4/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 KDE4 =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins/SessionLoader/KDE4/plugin.json b/plugins/SessionLoader/KDE4/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/SessionLoader/KDE4/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/SessionLoader/KDE4/sessionLoader.cpp b/plugins/SessionLoader/KDE4/sessionLoader.cpp index 28bdc59..8024264 100644 --- a/plugins/SessionLoader/KDE4/sessionLoader.cpp +++ b/plugins/SessionLoader/KDE4/sessionLoader.cpp @@ -1,62 +1,58 @@ /** \file session-loader.cpp \brief Define the session plugin loader test \author alpha_one_x86 -\version 0.3 -\date 2010 */ +*/ -#include #include #include +#include #include "sessionLoader.h" -void SessionLoader::setEnabled(bool newValue) +void KDESessionLoader::setEnabled(const bool &enabled) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, newValue: "+QString::number(newValue)); - QFile link(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); - if(!newValue) - { - if(link.exists() && !link.remove()) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to remove from the startup: "+link.errorString()); - } - else - { - if(link.open(QIODevice::WriteOnly)) - { - link.write(QString("#!/bin/bash\n").toLocal8Bit()); - link.write(QString(QCoreApplication::applicationFilePath()).toLocal8Bit()); - link.close(); - if(!link.setPermissions(QFile::ExeOwner|QFile::WriteOwner|QFile::ReadOwner)) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to set permissions: "+link.errorString()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to open in writing the file: "+link.errorString()); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, enabled: "+QString::number(enabled)); + QFile link(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); + if(!enabled) + { + if(link.exists() && !link.remove()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to remove from the startup: "+link.errorString()); + } + else + { + if(link.open(QIODevice::WriteOnly)) + { + link.write(QStringLiteral("#!/bin/bash\n").toLocal8Bit()); + link.write(QString(QCoreApplication::applicationFilePath()).toLocal8Bit()); + link.close(); + if(!link.setPermissions(QFile::ExeOwner|QFile::WriteOwner|QFile::ReadOwner)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to set permissions: "+link.errorString()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to open in writing the file: "+link.errorString()); + } } -bool SessionLoader::getEnabled() +bool KDESessionLoader::getEnabled() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, return this value: "+QString::number(QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"))); - //return the value into the variable - return QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); + //return the value into the variable + return QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); } -void SessionLoader::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +void KDESessionLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - Q_UNUSED(options); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); } /// \brief to get the options widget, NULL if not have -QWidget * SessionLoader::options() +QWidget * KDESessionLoader::options() { - return NULL; + return NULL; } /// \brief to reload the translation, because the new language have been loaded -void SessionLoader::newLanguageLoaded() +void KDESessionLoader::newLanguageLoaded() { } - -Q_EXPORT_PLUGIN2(sessionLoader, SessionLoader); diff --git a/plugins/SessionLoader/KDE4/sessionLoader.h b/plugins/SessionLoader/KDE4/sessionLoader.h index 41c4204..b037da7 100644 --- a/plugins/SessionLoader/KDE4/sessionLoader.h +++ b/plugins/SessionLoader/KDE4/sessionLoader.h @@ -1,8 +1,7 @@ /** \file sessionLoader.h \brief Define the session loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SESSION_LOADER_PLUGIN_H #define SESSION_LOADER_PLUGIN_H @@ -12,27 +11,23 @@ #include "../../../interface/PluginInterface_SessionLoader.h" /// \brief Define the session loader -class SessionLoader : public PluginInterface_SessionLoader +class KDESessionLoader : public PluginInterface_SessionLoader { - Q_OBJECT - Q_INTERFACES(PluginInterface_SessionLoader) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.SessionLoader/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_SessionLoader) public: - /// \brief to set if it's enabled or not - void setEnabled(bool); - /// \brief to get if is enabled - bool getEnabled(); - /// \brief set the resources for the plugins - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); - /// \brief to get the options widget, NULL if not have - QWidget * options(); + /// \brief to set if it's enabled or not + void setEnabled(const bool &enabled); + /// \brief to get if is enabled + bool getEnabled() const; + /// \brief set the resources for the plugins + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); public slots: - /// \brief to reload the translation, because the new language have been loaded - void newLanguageLoaded(); -signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); }; #endif // SESSION_LOADER_PLUGIN_H diff --git a/plugins/SessionLoader/KDE4/sessionLoader.pro b/plugins/SessionLoader/KDE4/sessionLoader.pro index e036663..4398dfe 100644 --- a/plugins/SessionLoader/KDE4/sessionLoader.pro +++ b/plugins/SessionLoader/KDE4/sessionLoader.pro @@ -1,3 +1,7 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + TEMPLATE = lib CONFIG += plugin HEADERS = sessionLoader.h \ diff --git a/plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 b/plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 new file mode 100644 index 0000000..7741b0d --- /dev/null +++ b/plugins/SessionLoader/KDE4/sessionLoader.pro.user.2.7pre1 @@ -0,0 +1,208 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + true + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop-Qt 5.01 (qt5-linux) + Desktop-Qt 5.01 (qt5-linux) + {55d7d977-66a3-4d72-9331-2ae779c6252a} + 0 + 0 + 0 + + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/user/Desktop/ultracopier/sources/plugins/SessionLoader/sessionLoader-build-Desktop_Qt_5_01_qt5_linux-Debug + true + + + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/user/Desktop/ultracopier/sources/plugins/SessionLoader/sessionLoader-build-Desktop_Qt_5_01_qt5_linux-Release + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + + 2 + + false + + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {74ab603f-f657-4135-92cf-c93af71b2f91} + + + ProjectExplorer.Project.Updater.FileVersion + 12 + + diff --git a/plugins/SessionLoader/Windows/DebugEngineMacro.h b/plugins/SessionLoader/Windows/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/SessionLoader/Windows/DebugEngineMacro.h +++ b/plugins/SessionLoader/Windows/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/SessionLoader/Windows/Environment.h b/plugins/SessionLoader/Windows/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/SessionLoader/Windows/Environment.h +++ b/plugins/SessionLoader/Windows/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins/SessionLoader/Windows/Variable.h b/plugins/SessionLoader/Windows/Variable.h index 8179c93..963d0c8 100644 --- a/plugins/SessionLoader/Windows/Variable.h +++ b/plugins/SessionLoader/Windows/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H diff --git a/plugins/SessionLoader/Windows/documentation.dox b/plugins/SessionLoader/Windows/documentation.dox old mode 100755 new mode 100644 index 5cd8685..67ea43f --- a/plugins/SessionLoader/Windows/documentation.dox +++ b/plugins/SessionLoader/Windows/documentation.dox @@ -10,13 +10,13 @@ \section mainpage_overview Overview - It control if it loaded with the session.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. + It control if it loaded with the session. Use HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run. \n + More informations on the wiki of ultracopier. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins/SessionLoader/Windows/informations.xml b/plugins/SessionLoader/Windows/informations.xml index 5aea44c..b91bd28 100644 --- a/plugins/SessionLoader/Windows/informations.xml +++ b/plugins/SessionLoader/Windows/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 Windows =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins/SessionLoader/Windows/plugin.json b/plugins/SessionLoader/Windows/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/SessionLoader/Windows/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/SessionLoader/Windows/sessionLoader.cpp b/plugins/SessionLoader/Windows/sessionLoader.cpp old mode 100755 new mode 100644 index 8e1595c..5080bdc --- a/plugins/SessionLoader/Windows/sessionLoader.cpp +++ b/plugins/SessionLoader/Windows/sessionLoader.cpp @@ -1,69 +1,80 @@ /** \file session-loader.cpp \brief Define the session plugin loader test -\author alpha_one_x86 -\version 0.3 -\date 2010 */ +\author alpha_one_x86 */ -#include +#include "sessionLoader.h" + +#include -#if defined (Q_OS_WIN32) -#include +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include #else -#error "Not under windows, plugin will not work" + #error "This plugin will only work under Windows" #endif -#include "sessionLoader.h" - -void SessionLoader::setEnabled(bool newValue) +void WindowsSessionLoader::setEnabled(const bool &newValue) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, newValue: "+QString::number(newValue)); - //set value into the variable - HKEY ultracopier_regkey; - //for autostart - QString runStringApp = "\"" + QApplication::applicationFilePath() + "\""; - runStringApp.replace( "/", "\\" ); - wchar_t windowsString[255]; - runStringApp.toWCharArray(windowsString); - RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, newValue: "+QString::number(newValue)); + //set value into the variable + HKEY ultracopier_regkey; + //for autostart + QString runStringApp = "\"" + QCoreApplication::applicationFilePath() + "\""; + runStringApp.replace( "/", "\\" ); + wchar_t windowsString[255]; + runStringApp.toWCharArray(windowsString); + if(RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0)==ERROR_SUCCESS) + { if(newValue) - RegSetValueEx(ultracopier_regkey, TEXT("ultracopier"), 0, REG_SZ, (BYTE*)windowsString, runStringApp.length()*2); - else - RegDeleteValue(ultracopier_regkey, TEXT("ultracopier")); + { + if(RegSetValueEx(ultracopier_regkey, TEXT("ultracopier"), 0, REG_SZ, (BYTE*)windowsString, runStringApp.length()*2)!=ERROR_SUCCESS) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"newValue: "+QString::number(newValue)+" failed"); + } + else + { + if(RegDeleteValue(ultracopier_regkey, TEXT("ultracopier"))!=ERROR_SUCCESS) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"newValue: "+QString::number(newValue)+" failed"); + } RegCloseKey(ultracopier_regkey); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"RegCreateKeyEx: Software\\Microsoft\\Windows\\CurrentVersion\\Run failed"); } -bool SessionLoader::getEnabled() +bool WindowsSessionLoader::getEnabled() const { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - //return the value into the variable - HKEY ultracopier_regkey; - bool temp=false; - RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0); - DWORD kSize=254; - if(RegQueryValueEx(ultracopier_regkey,TEXT("ultracopier"),NULL,NULL,(LPBYTE)0,&kSize) == ERROR_SUCCESS) - temp=true; - RegCloseKey(ultracopier_regkey); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"return this value: "+QString::number(temp)); - return temp; + //return the value into the variable + HKEY ultracopier_regkey; + bool temp=false; + if(RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0)==ERROR_SUCCESS) + { + DWORD kSize=254; + if(RegQueryValueEx(ultracopier_regkey,TEXT("ultracopier"),NULL,NULL,(LPBYTE)0,&kSize) == ERROR_SUCCESS) + temp=true; + RegCloseKey(ultracopier_regkey); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"RegCreateKeyEx: Software\\Microsoft\\Windows\\CurrentVersion\\Run failed"); + return temp; } -void SessionLoader::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +void WindowsSessionLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - Q_UNUSED(options); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); } /// \brief to get the options widget, NULL if not have -QWidget * SessionLoader::options() +QWidget * WindowsSessionLoader::options() { - return NULL; + return NULL; } /// \brief to reload the translation, because the new language have been loaded -void SessionLoader::newLanguageLoaded() +void WindowsSessionLoader::newLanguageLoaded() { } - -Q_EXPORT_PLUGIN2(sessionLoader, SessionLoader); diff --git a/plugins/SessionLoader/Windows/sessionLoader.h b/plugins/SessionLoader/Windows/sessionLoader.h old mode 100755 new mode 100644 index a08ea94..bc8615e --- a/plugins/SessionLoader/Windows/sessionLoader.h +++ b/plugins/SessionLoader/Windows/sessionLoader.h @@ -1,39 +1,33 @@ /** \file sessionLoader.h \brief Define the session loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef SESSION_LOADER_H #define SESSION_LOADER_H #include -#include #include "Environment.h" #include "../../../interface/PluginInterface_SessionLoader.h" /// \brief Define the session loader -class SessionLoader : public PluginInterface_SessionLoader +class WindowsSessionLoader : public PluginInterface_SessionLoader { Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.SessionLoader/1.0.0.0" FILE "plugin.json") Q_INTERFACES(PluginInterface_SessionLoader) public: /// \brief to set if it's enabled or not - void setEnabled(bool); + void setEnabled(const bool &newValue); /// \brief to get if is enabled - bool getEnabled(); + bool getEnabled() const; /// \brief set the resources for the plugins - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); /// \brief to get the options widget, NULL if not have QWidget * options(); public slots: /// \brief to reload the translation, because the new language have been loaded void newLanguageLoaded(); -signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif }; #endif // SESSION_LOADER_H diff --git a/plugins/SessionLoader/Windows/sessionLoader.pro b/plugins/SessionLoader/Windows/sessionLoader.pro index c454601..071db7e 100644 --- a/plugins/SessionLoader/Windows/sessionLoader.pro +++ b/plugins/SessionLoader/Windows/sessionLoader.pro @@ -1,5 +1,10 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + TEMPLATE = lib CONFIG += plugin +LIBS += -ladvapi32 HEADERS = sessionLoader.h \ StructEnumDefinition.h \ Variable.h \ diff --git a/plugins/Themes/Oxygen/DebugEngineMacro.h b/plugins/Themes/Oxygen/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins/Themes/Oxygen/DebugEngineMacro.h +++ b/plugins/Themes/Oxygen/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/Themes/Oxygen/Environment.h b/plugins/Themes/Oxygen/Environment.h index 94fd104..265a5a6 100644 --- a/plugins/Themes/Oxygen/Environment.h +++ b/plugins/Themes/Oxygen/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins/Themes/Oxygen/Languages/ar/translation.ts b/plugins/Themes/Oxygen/Languages/ar/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/ar/translation.ts +++ b/plugins/Themes/Oxygen/Languages/ar/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/de/translation.ts b/plugins/Themes/Oxygen/Languages/de/translation.ts index f1f2eee..34c8bef 100644 --- a/plugins/Themes/Oxygen/Languages/de/translation.ts +++ b/plugins/Themes/Oxygen/Languages/de/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + Kaufe die Ultimate Version um die Entwicklung zu finanzieren + + + File %1/%2, size: %3/%4 - Die Datei %1/%2, Größe:%3/%4 + Datei %1/%2, Größe:%3/%4 + + + + Copy list + Zu kopierende Dateien + + + + Move list + Zu verschiebende Dateien + + + + Don't close if errors are found + Nicht schließen, wenn Fehler aufgetreten sind + + + + Never close + Niemals schließen + + + + Always close + Immer schließen - + File Name, 0KB Dateiname, 0KB + + + + + Select a color + Farbe auswählen + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + Nicht schließen, wenn Fehler aufgetreten sind + + + + Never close + Niemals schließen + + + + Always close + Immer schließen + + + + + + Select a color + Wählen Sie eine Farbe + interfaceCopy @@ -22,179 +91,251 @@ Von: - + To: - Auf: + Nach: - - Shutdown when is finish - Shutdown wird, wenn fertig - - - - 0KB/sec - 0KB/sec - - - + &More - Mehr + &Mehr - + &Pause - Pause + &Pause - + &Skip - überspringen + Über&springen - + &Cancel - Stornieren + Abbrechen (&C) - - Limit copy speed at: - Begrenzen Sie Kopiergeschwindigkeit bei: + Kopiergeschwindigkeit begrenzen bei: - - Unlimited - Unbegrenzt + + Transfer list + Dateiliste - - Copy list - kopieren Liste + + Delete the selected items + Ausgewählte Einträge löschen - - Ctrl+F - Ctrl+F + + Export the transfer list + Dateiliste exportieren - + + Import the transfer list + Dateiliste importieren + + + Previous Vorherige - + Next Nächste - - Options - Optionen + + Interface + Darstellungsoptionen - - Copy end - kopieren Sie Ende + + Move the selected items to the top + Ausgewählte Einträge an den Listenanfang verschieben - - At the end of the copy: - Am Ende der Kopie: + + Close on transfer completion + Am Ende des Transfers schließen - - Don't close if errors are found - Schließen Sie nicht, wenn Fehler gefunden werden + + Limit copy speed to: + Begrenze Kopiergeschwindigkeit auf: - - Never close - Verschließen Sie niemals + + Move up the selected items + Ausgewählte Einträge einen Platz nach oben verschieben - - Always close - schließen Sie immer + + Move down the selected items + Ausgewählte Einträge einen Platz nach unten verschieben - - Speed limit - Tempolimit + + Move the selected items to the bottom + Ausgewählte Einträge an das Listenende verschieben - - KB/s - KB/s + + Add file/folder + Datei/Ordner hinzufügen - - File collisions - Datei-Kollisionen + + Search + In Dateiliste suchen - - - What to do: - Was ist zu tun: + + + Error + Fehlerprotokoll - - Copy errors - kopieren Fehler + + Export the errors into transfer list + Fehlgeschlagene Dateien exportieren - - Interface - Schnittstelle + + Source + Quelle - - Show speed as main informations - Zeige Geschwindigkeit als Haupt-Informationen + + Destination + Ziel - + Add file Datei hinzufügen - + Add folder Ordner hinzufügen - + Move file(s) - Bewegen Sie Datei(en) + Datei(en) verschieben - + Move folder - bewegen Sie Ordner + Ordner verschieben - + Copy file(s) - Kopieren Sie die Datei(en) + Datei(en) kopieren - + Copy folder - kopieren Sie das Verzeichnis + Verzeichnis kopieren - options + themesOptions + + + Show dual progression + Zweifachen Fortschritt anzeigen + + + + Show speed as main information + Geschwindigkeitsbegrenzungsschieberegler anzeigen + + + + Use + Benutzung + + + + Start with the "more button" pushed + Standardmäßig "Mehr" Informationen anzeigen + + + + Minimize on close to systray + Beim Schließen ins Systray minimieren + + + + At the end of the copy + Am Ende des Vorgangs + + + + + Limit copy speed to + Begrenze Übertragungsgeschwindigkeit auf + + + + Start minimized + + + + + Click to edit the color + Zum Bearbeiten der Farbe klicken + + + At the end of the copy: + Am Ende der Kopie: + + + Limit copy speed at: + Kopiergeschwindigkeit begrenzen bei: + + + + KB/s + KB/s + + + + Informations + Informationen + + + + Display + Anzeige + + + + Speed with progress bar + Geschwindigkeit als Fortschrittsbalken anzeigen + + + + Progression color + Farbe des Fortschrittsbalken + - - Show speed as main informations - Zeige Geschwindigkeit als Haupt-Informationen + + Show progression in the title + Fortschritt im Fenstertitel zeigen - - Start with more button pushed - Beginnen Sie mit mehr-Taste gedrückt + + Always on top + Fenster immer im Vordergrund diff --git a/plugins/Themes/Oxygen/Languages/el/translation.ts b/plugins/Themes/Oxygen/Languages/el/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/el/translation.ts +++ b/plugins/Themes/Oxygen/Languages/el/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/en/translation.ts b/plugins/Themes/Oxygen/Languages/en/translation.ts new file mode 100644 index 0000000..717ea08 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/en/translation.ts @@ -0,0 +1,329 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + + + + + File %1/%2, size: %3/%4 + + + + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + File Name, 0KB + + + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + + + + interfaceCopy + + + From: + + + + + To: + + + + + &More + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + Transfer list + + + + + Delete the selected items + + + + + Export the transfer list + + + + + Import the transfer list + + + + + Previous + + + + + Next + + + + + Interface + + + + + Move the selected items to the top + + + + + Close on transfer completion + + + + + Limit copy speed to: + + + + + Move up the selected items + + + + + Move down the selected items + + + + + Move the selected items to the bottom + + + + + Add file/folder + + + + + Search + + + + + + Error + + + + + Export the errors into transfer list + + + + + Source + + + + + Destination + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins/Themes/Oxygen/Languages/es/translation.ts b/plugins/Themes/Oxygen/Languages/es/translation.ts index 3e9fb5b..a6ded18 100644 --- a/plugins/Themes/Oxygen/Languages/es/translation.ts +++ b/plugins/Themes/Oxygen/Languages/es/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + Comprar la versión Ultimate para financiar el desarrollo + + + File %1/%2, size: %3/%4 El archivo %1/%2, el tamaño: %3/%4 - + + Copy list + Lista de copia + + + + Move list + Lista de movimiento + + + + Don't close if errors are found + No cierre si se encuentran errores + + + + Never close + Nunca cierre + + + + Always close + Siempre cerrar + + + File Name, 0KB Nombre de archivo, 0KB + + + + + Select a color + Seleccione un color + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + No cierre si se encuentran errores + + + + Never close + Nunca cierre + + + + Always close + Siempre cerrar + + + + + + Select a color + Seleccione un color + interfaceCopy @@ -22,179 +91,255 @@ De: - + To: Para: - - 0KB/sec - 0KB/sec + Close at the end of the transfers + Cerca al final de las transferencias - + &More &Más - + &Pause &Pausa - + &Skip &Omitir - + &Cancel &Cancelar - - Limit copy speed at: + Limitar la velocidad de copia en: + + + + Close on transfer completion + Cerca de finalización de transferencia + + + + Limit copy speed to: Limitar la velocidad de copia en: - - Unlimited - Ilimitado + + Transfer list + Lista de transferencia - - Copy list - Copia la lista + + Move the selected items to the top + Mueve los elementos seleccionados a la parte superior - - Previous - Anterior + + Move up the selected items + Mueva los elementos seleccionados - - Next - Próximo + + Move down the selected items + Bajar los elementos seleccionados - - Options - Opciones + + Move the selected items to the bottom + Mueve los elementos seleccionados a la parte inferior - - Copy end - Copia final + + Add file/folder + Agregar archivo/carpeta - - At the end of the copy: - Al final de la copia: + + Delete the selected items + Eliminar los elementos seleccionados - - Don't close if errors are found - No cierre si se encuentran errores + + Search + Buscar - - Never close - Nunca cierre + + Export the transfer list + Exportar la lista de transferencias - - Always close - Siempre cerrar + + Import the transfer list + Importe la lista de transferencias - - Speed limit - Límite de velocidad + + Previous + Anterior - - KB/s - KB/s + + Next + Próximo - - File collisions - Colisiones de archivos + + + Error + Error - - - What to do: - Qué hacer: + + Export the errors into transfer list + Exportar los errores en la lista de transferencias - - Copy errors - Errores de copia + + Source + Fuente - - Interface - Interfaz + + Destination + Destino - - Show speed as main informations - Mostrar la velocidad como principales informaciones + + Interface + Interfaz - + Add file Añadir archivo - + Add folder Añadir carpeta - + Move file(s) Mover archivo(s) - + Move folder Mueva la carpeta - + Copy file(s) Copia el archivo(s) - + Copy folder Copia la carpeta + + + themesOptions - - Ctrl+F - Ctrl+F + + Show dual progression + Mostrar progresión dual - - Shutdown when is finish - Apagar cuando se termine + + Show speed as main information + Mostrar la velocidad como principales informaciones - - - options - - Show speed as main informations - Mostrar la velocidad como principales informaciones + + Use + Uso + + + + Start with the "more button" pushed + Comience con el "botón más" empujada + + + + Minimize on close to systray + Minimizar en cerca de la bandeja del sistema + + + + At the end of the copy + Al final de la copia + + + + + Limit copy speed to + Limitar la velocidad de copia de + + + + Start minimized + + + + + Click to edit the color + Haga clic para editar el color + + + At the end of the copy: + Al final de la copia: + + + Limit copy speed at: + Limitar la velocidad de copia en: + + + + KB/s + KB/s + + + + Informations + Informations + + + + Display + Visualización + + + + Speed with progress bar + Velocidad con barra de progreso + + + + Progression color + Progresión de color + + + + Show progression in the title + Mostrar progresión en el título - - Start with more button pushed - Comience con más botón pulsado + + Always on top + Siempre visible diff --git a/plugins/Themes/Oxygen/Languages/fr/translation.ts b/plugins/Themes/Oxygen/Languages/fr/translation.ts index 18396c2..628347d 100644 --- a/plugins/Themes/Oxygen/Languages/fr/translation.ts +++ b/plugins/Themes/Oxygen/Languages/fr/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + Achetez la version Ultimate pour financer le développement + + + File %1/%2, size: %3/%4 Fichier %1/%2, taille: %3/%4 - + + Copy list + Liste de copies + + + + Move list + Liste de déplacements + + + + Don't close if errors are found + Garder ouvert s'il y a des erreurs + + + + Never close + Ne jamais fermer + + + + Always close + Toujours fermer + + + File Name, 0KB Nom de fichier, 0Ko + + + + + Select a color + Selectionner une coleur + + + + + + %1 %2% of %3 + %1 de %2% de %3 + + + + ThemesFactory + + + Don't close if errors are found + Garder ouvert s'il y a des erreurs + + + + Never close + Ne jamais fermer + + + + Always close + Toujours fermer + + + + + + Select a color + Selectionner une coleur + interfaceCopy @@ -22,17 +91,16 @@ Depuis: - + To: Vers: - - 0KB/sec - 0Ko/s + Close at the end of the transfers + Fermer à la fin des transferts - + &More Pl&us @@ -52,96 +120,104 @@ &Annuler - - Limit copy speed at: + Limiter la vitesse de copie à: + + + + Close on transfer completion + Fermer à la fin des transferts + + + + Limit copy speed to: Limiter la vitesse de copie à: - - Unlimited - Illimité + + Transfer list + Liste de transferts - - Copy list - Liste de copie + + Move the selected items to the top + Déplacer l'item selectionné au debut - - Previous - Précedent + + Move up the selected items + Déplacer l'item selectionné vers le haut - - Next - Suivant + + Move down the selected items + Déplacer l'item selectionné vers le bas - - Options - Options + + Move the selected items to the bottom + Déplacer l'item selectionné à la fin - - Copy end - Fin de copie + + Add file/folder + Ajouter fichier/dossier - - At the end of the copy: - A la fin de la copie: + + Delete the selected items + Supprimer les items sélectionnés - - Don't close if errors are found - Garder ouvert s'il y a des erreurs + + Search + Rechercher - - Never close - Ne jamais fermer + + Export the transfer list + Exporter la liste de transfert - - Always close - Toujours fermer + + Import the transfer list + Importer la liste de transfert - - Speed limit - Limitation de la vitesse + + Previous + Précédent - - KB/s - Ko/s + + Next + Suivant - - File collisions - Collision de fichier + + + Error + Erreur - - - What to do: - Opération à effectuer: + + Export the errors into transfer list + Exporter les erreurs dans une liste de transfert - - Copy errors - Erreurs de copie + + Source + Source - - Interface - Interface + + Destination + Destination - - Show speed as main informations - Montrer la vitesse comme une information principale + + Interface + Interface @@ -156,7 +232,7 @@ Move file(s) - Déplacer les fichier(s) + Déplacer le(s) fichier(s) @@ -166,35 +242,108 @@ Copy file(s) - Copier les fichier(s) + Copier le(s) fichier(s) Copy folder Copier un répertoire + + + themesOptions - - Ctrl+F - Ctrl+F + + Show dual progression + Afficher une double progression - - Shutdown when is finish - Fermer quand est fini + + Show speed as main information + Afficher la vitesse comme information principale + + + + Use + Utilisation + + + + Start with the "more button" pushed + Déplier automatiquement les détails + + + + Minimize on close to systray + Minimiser à la fermeture dans le systray + + + + At the end of the copy + À la fin de la copie + + + + + Limit copy speed to + Limiter la vitesse de copie à + + + + Start minimized + + + + + Click to edit the color + Cliquer pour éditer la couleur + + + At the end of the copy: + À la fin de la copie: + + + Limit copy speed at: + Limiter la vitesse de copie à: + + + Limit copy speed to: + Limiter la vitesse de copie à: + + + + KB/s + Ko/s + + + + Informations + Informations + + + + Display + Affichage + + + + Speed with progress bar + Vitesse avec barre de progression + + + + Progression color + Couleur de progression - - - options - - Show speed as main informations - Montrer la vitesse comme une information principale + + Show progression in the title + Afficher la progression dans le titre - - Start with more button pushed - Démarrer avec le boutton plus pressé + + Always on top + Toujours au 1er plan diff --git a/plugins/Themes/Oxygen/Languages/hi/translation.ts b/plugins/Themes/Oxygen/Languages/hi/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/hi/translation.ts +++ b/plugins/Themes/Oxygen/Languages/hi/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/hu/translation.ts b/plugins/Themes/Oxygen/Languages/hu/translation.ts new file mode 100644 index 0000000..ce37a23 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/hu/translation.ts @@ -0,0 +1,329 @@ + + + + + Themes + + + Buy the Ultimate version to fund development + Vásárold meg az Ultimate verziót a fejlesztés támogatásához + + + + File %1/%2, size: %3/%4 + Fájl %1/%2, méret: %3/%4 + + + + Copy list + Lista másolása + + + + Move list + Lista mozgatása + + + + Don't close if errors are found + Ne zárja be, ha hiba történik + + + + Never close + Sose zárja be + + + + Always close + Mindig zárja be + + + + File Name, 0KB + Fájlnév, 0KB + + + + + + Select a color + Válassz egy színt + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + Ne zárja be, ha hiba történik + + + + Never close + Sose zárja be + + + + Always close + Mindig zárja be + + + + + + Select a color + Válassz egy színt + + + + interfaceCopy + + + From: + Forrás: + + + + To: + Cél: + + + + &More + &Több + + + + &Pause + &Szünet + + + + &Skip + &Kihagy + + + + &Cancel + &Mégse + + + + Transfer list + Átviteli lista + + + + Previous + Előző + + + + Next + Következő + + + + Interface + Kezelőfelület + + + + Move the selected items to the top + Kijelölések elemek mozgatása legfelülre + + + + Close on transfer completion + Átvitel végeztével zárja be + + + + Limit copy speed to: + Másolási sebesség korlátozása: + + + + Move up the selected items + Kijelölt elemek mozgatása fel + + + + Move down the selected items + Kijelölt elemek mozgatása le + + + + Move the selected items to the bottom + Kijelölések elemek mozgatása legalulra + + + + Add file/folder + Fájl/mappa hozzáadása + + + + Delete the selected items + Kijelölt elemek törlése + + + + Search + Keresés + + + + Export the transfer list + Átviteli lista exportálása + + + + Import the transfer list + Átviteli lista importálása + + + + + Error + Hiba + + + + Export the errors into transfer list + Hibák exportálása az átviteli listába + + + + Source + Forrás + + + + Destination + Cél + + + + Add file + Fájl hozzáadása + + + + Add folder + Mappa hozzáadása + + + + Move file(s) + Fájl(ok) mozgatása + + + + Move folder + Mappa mozgatása + + + + Copy file(s) + Fájl(ok) másolása + + + + Copy folder + Mappa másolása + + + + themesOptions + + + Show dual progression + Páros folyamat mutatása + + + + Show speed as main information + Sebesség mutatása, mint fő információ + + + + Use + Használ + + + + Start with the "more button" pushed + Indítás a "több gomb" lenyomásával + + + + Minimize on close to systray + Bezáráskor minimalizálás a tálcára + + + + At the end of the copy + A másolás befejezésekor + + + + + Limit copy speed to + Másolási sebesség korlátozása + + + + Start minimized + + + + + Click to edit the color + Kattints a szín szerkesztéséhez + + + + KB/s + KB/s + + + + Informations + Információk + + + + Display + Megjelenítés + + + + Speed with progress bar + Sebesség folyamatsávval + + + + Progression color + Folyamat színe + + + + Show progression in the title + Folyamat mutatása a címsorban + + + + Always on top + Mindig legfelül + + + diff --git a/plugins/Themes/Oxygen/Languages/id/translation.ts b/plugins/Themes/Oxygen/Languages/id/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/id/translation.ts +++ b/plugins/Themes/Oxygen/Languages/id/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/it/translation.ts b/plugins/Themes/Oxygen/Languages/it/translation.ts index 0f65cfb..d9e20f0 100644 --- a/plugins/Themes/Oxygen/Languages/it/translation.ts +++ b/plugins/Themes/Oxygen/Languages/it/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + Acquista la versione Ultimate per finanziare lo sviluppo del programma + + + File %1/%2, size: %3/%4 File %1/%2, dimensione: %3/%4 - + + Copy list + Lista della copia + + + + Move list + Lista dello spostamento + + + + Don't close if errors are found + Non chiudere se vengono rilevati errori + + + + Never close + Non chiudere mai + + + + Always close + Chiudere sempre + + + File Name, 0KB Nome del file, 0KB + + + + + Select a color + Scegliere un colore + + + + + + %1 %2% of %3 + %1 %2% di %3 + + + + ThemesFactory + + + Don't close if errors are found + Non chiudere se vengono rilevati errori + + + + Never close + Non chiudere mai + + + + Always close + Chiudere sempre + + + + + + Select a color + Scegliere un colore + interfaceCopy @@ -22,179 +91,255 @@ Da: - + To: - Per: + a: - - 0KB/sec - 0KB/sec + Close at the end of the transfers + Chiudi alla fine dei trasferimenti - + &More - Più + Altr&o - + &Pause - Pausa + &Pausa - + &Skip - &Saltare + &Salta - + &Cancel - &Annullare + &Annulla - - Limit copy speed at: - Ridurre la velocità di copia a: + Ridurre la velocità di copia a: - - Unlimited - Illimitato + + Close on transfer completion + Arresta il sistema a trasferimento comletato - - Copy list - Copia list + + Limit copy speed to: + Limitare la velocità di copia a: - - Previous - Precedente + + Transfer list + Lista dei trasferimenti - - Next - Prossimo + + Move the selected items to the top + Sposta in cima gli elementi selezionati - - Options - Opzioni + + Move up the selected items + Sposta sopra gli elementi selezionati - - Copy end - Copia end + + Move down the selected items + Sposta sotto gli elementi selezionati - - At the end of the copy: - Alla fine della copia: + + Move the selected items to the bottom + Sposta in coda gli elementi selezionati - - Don't close if errors are found - Non chiudere se vengono rilevati errori + + Add file/folder + Aggiungi file/cartelle - - Never close - Non chiudere mai + + Delete the selected items + Elimina gli elementi selezionati - - Always close - Chiudere sempre + + Search + Cerca - - Speed limit - Limite di velocità + + Export the transfer list + Esporta la lista dei trasferimenti - - KB/s - KB/s + + Import the transfer list + Importa la lista dei trasferimenti - - File collisions - File collisioni + + Previous + Precedente - - - What to do: - Cosa fare: + + Next + Successivo - - Copy errors - Copia errori + + + Error + Errore - - Interface - Interfaccia + + Export the errors into transfer list + Esporta gli errori nella lista dei trasferimenti - - Show speed as main informations - Mostra velocità come principali informazioni + + Source + Cartella di origine - + + Destination + Cartella di destinazione + + + + Interface + Interfaccia + + + Add file Aggiungi file - + Add folder Aggiungi cartella - + Move file(s) - Spostare file(s) + Sposta file - + Move folder - Spostare la cartella + Sposta la cartella - + Copy file(s) - Copiare il file(s) + Copia file - + Copy folder Copia la cartella + + + themesOptions - - Ctrl+F - Ctrl+F + + Show dual progression + Mostrare la doppia progressione - - Shutdown when is finish - Shutdown quando è finito + + Show speed as main information + Mostrare la velocità come principale informazione + + + + Use + Utilità + + + + Start with the "more button" pushed + Iniziare col pulsante "Altro" attivo + + + + Minimize on close to systray + Alla chiusura riduci nella'area di notifica + + + + At the end of the copy + Al termine della copia + + + + + Limit copy speed to + Limitare la velocità di copia a + + + + Start minimized + + + + + Click to edit the color + Clicca per modificare il colore + + + At the end of the copy: + Alla fine della copia: + + + Limit copy speed at: + Ridurre la velocità di copia a: + + + + KB/s + KB/s + + + + Informations + Informazioni + + + + Display + Visualizza + + + + Speed with progress bar + Velocità nella barra di progresso + + + + Progression color + Colore della progressione - - - options - - Show speed as main informations - Mostra velocità come principali informazioni + + Show progression in the title + Mostrare la percentuale di progresso sul titolo - - Start with more button pushed - Inizia con più pulsante premuto + + Always on top + Sempre in primo piano diff --git a/plugins/Themes/Oxygen/Languages/ja/translation.ts b/plugins/Themes/Oxygen/Languages/ja/translation.ts index c5fd56b..1ee75a9 100644 --- a/plugins/Themes/Oxygen/Languages/ja/translation.ts +++ b/plugins/Themes/Oxygen/Languages/ja/translation.ts @@ -4,196 +4,325 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + - interfaceCopy + ThemesFactory - - From: + + Don't close if errors are found - - To: + + Never close - - Shutdown when is finish + + Always close - - 0KB/sec + + + + Select a color + + + interfaceCopy - + + From: + + + + + To: + + + + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Transfer list - - Unlimited + + Delete the selected items - - Copy list + + Export the transfer list - - Ctrl+F + + Import the transfer list - + Previous - + Next - - Options + + Interface - - Copy end + + Move the selected items to the top - - At the end of the copy: + + Close on transfer completion - - Don't close if errors are found + + Limit copy speed to: - - Never close + + Move up the selected items - - Always close + + Move down the selected items - - Speed limit + + Move the selected items to the bottom - - KB/s + + Add file/folder - - File collisions + + Search - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder - options + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/ko/translation.ts b/plugins/Themes/Oxygen/Languages/ko/translation.ts index f9ebf4b..2d9b2f8 100644 --- a/plugins/Themes/Oxygen/Languages/ko/translation.ts +++ b/plugins/Themes/Oxygen/Languages/ko/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 파일 %1/%2, 크기: %3/%4 - + + Copy list + 복사 목록 + + + + Move list + + + + + Don't close if errors are found + 오류 발견시 종료 안함 + + + + Never close + 절대 종료 안함 + + + + Always close + 항상 종료 + + + File Name, 0KB 파일명, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + 오류 발견시 종료 안함 + + + + Never close + 절대 종료 안함 + + + + Always close + 항상 종료 + + + + + + Select a color + + interfaceCopy @@ -22,22 +91,12 @@ 원본: - + To: 대상: - - Shutdown when is finish - - - - - 0KB/sec - 0KB/초 - - - + &More &자세히 @@ -57,28 +116,31 @@ &취소 - - Limit copy speed at: - 복사 속도 제한: + 복사 속도 제한: + + + + Transfer list + - - Unlimited - 무제한 + + Delete the selected items + - - Copy list - 복사 목록 + + Export the transfer list + - - Ctrl+F + + Import the transfer list - + Previous 이전 @@ -88,73 +150,73 @@ 다음 - - Options - 옵션 + + Interface + 인터페이스 - - Copy end - 복사 종료 + + Move the selected items to the top + - - At the end of the copy: - 복사 종료시: + + Close on transfer completion + - - Don't close if errors are found - 오류 발견시 종료 안함 + + Limit copy speed to: + - - Never close - 절대 종료 안함 + + Move up the selected items + - - Always close - 항상 종료 + + Move down the selected items + - - Speed limit - 속도 제한 + + Move the selected items to the bottom + - - KB/s - KB/초 + + Add file/folder + - - File collisions - 파일 충돌 + + Search + - - - What to do: - 실행 작업: + + + Error + - - Copy errors - 오류 복사 + + Export the errors into transfer list + - - Interface - 인터페이스 + + Source + - - Show speed as main informations - 메인 정보에 속도 표시 + + Destination + - + Add file 파일 추가 @@ -185,15 +247,94 @@ - options + themesOptions + + + Show dual progression + + - - Show speed as main informations + + Show speed as main information 메인 정보에 속도 표시 - - Start with more button pushed + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + Start minimized + + + + + Click to edit the color + + + + At the end of the copy: + 복사 종료시: + + + Limit copy speed at: + 복사 속도 제한: + + + + KB/s + KB/초 + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Show progression in the title + + + + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/nl/translation.ts b/plugins/Themes/Oxygen/Languages/nl/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/nl/translation.ts +++ b/plugins/Themes/Oxygen/Languages/nl/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/no/translation.ts b/plugins/Themes/Oxygen/Languages/no/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/no/translation.ts +++ b/plugins/Themes/Oxygen/Languages/no/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/pl/translation.ts b/plugins/Themes/Oxygen/Languages/pl/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/pl/translation.ts +++ b/plugins/Themes/Oxygen/Languages/pl/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/pt/translation.ts b/plugins/Themes/Oxygen/Languages/pt/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/pt/translation.ts +++ b/plugins/Themes/Oxygen/Languages/pt/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/ru/translation.ts b/plugins/Themes/Oxygen/Languages/ru/translation.ts index 565a194..9ffa0a1 100644 --- a/plugins/Themes/Oxygen/Languages/ru/translation.ts +++ b/plugins/Themes/Oxygen/Languages/ru/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 Файл %1/%2, размер: %3/%4 - + + Copy list + Копировать список + + + + Move list + + + + + Don't close if errors are found + Не закрывать, если найдены ошибки + + + + Never close + Никогда не закрывать + + + + Always close + Всегда закрывайте + + + File Name, 0KB Имя файла, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + Не закрывать, если найдены ошибки + + + + Never close + Никогда не закрывать + + + + Always close + Всегда закрывайте + + + + + + Select a color + + interfaceCopy @@ -22,179 +91,251 @@ С: - + To: к: - - 0KB/sec - 0KB/sec - - - + &More больше - + &Pause пауза - + &Skip пропускать - + &Cancel отменить - - Limit copy speed at: - Предельная скорость копирования по адресу: + Предельная скорость копирования по адресу: - - Unlimited - неограниченный + + Close on transfer completion + - - Copy list - Копировать список + + Limit copy speed to: + - - Previous - предыдущий + + Transfer list + - - Next - следующий + + Move the selected items to the top + - - Options - опции + + Move up the selected items + - - Copy end - Скопируйте конца + + Move down the selected items + - - At the end of the copy: - В конце копии: + + Move the selected items to the bottom + - - Don't close if errors are found - Не закрывать, если найдены ошибки + + Add file/folder + - - Never close - Никогда не закрывать + + Delete the selected items + - - Always close - Всегда закрывайте + + Search + - - Speed limit - ограничение скорости + + Export the transfer list + - - KB/s - Кб/с + + Import the transfer list + + + + + Previous + предыдущий - - File collisions - Файл столкновений + + Next + следующий - - - What to do: - Что делать: + + + Error + - - Copy errors - Копировать ошибки + + Export the errors into transfer list + - - Interface - интерфейс + + Source + + + + + Destination + - - Show speed as main informations - Показать скорости в качестве основной информации + + Interface + интерфейс - + Add file Добавить файл - + Add folder Добавить папку - + Move file(s) Перемещение файла(ов) - + Move folder Перемещение папки - + Copy file(s) Копировать файл (ы) - + Copy folder Копировать папку + + + themesOptions - - Ctrl+F - Ctrl+F + + Show dual progression + - - Shutdown when is finish - Shutdown, когда будет закончить + + Show speed as main information + Показать скорости в качестве основной информации + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + Start minimized + + + + + Click to edit the color + + + + At the end of the copy: + В конце копии: + + + Limit copy speed at: + Предельная скорость копирования по адресу: + + + + KB/s + Кб/с + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + - - - options - - Show speed as main informations - Показать скорости в качестве основной информации + + Show progression in the title + - - Start with more button pushed - Начнем с более толкнул кнопку + + Always on top + diff --git a/plugins/Themes/Oxygen/Languages/th/translation.ts b/plugins/Themes/Oxygen/Languages/th/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/th/translation.ts +++ b/plugins/Themes/Oxygen/Languages/th/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/tr/translation.ts b/plugins/Themes/Oxygen/Languages/tr/translation.ts index 0708252..ae86b54 100644 --- a/plugins/Themes/Oxygen/Languages/tr/translation.ts +++ b/plugins/Themes/Oxygen/Languages/tr/translation.ts @@ -4,15 +4,84 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + + + + ThemesFactory + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + Select a color + + interfaceCopy @@ -22,178 +91,238 @@ - + To: - - 0KB/sec - - - - + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Close on transfer completion - - Unlimited + + Limit copy speed to: - - Copy list + + Transfer list - - Previous + + Move the selected items to the top - - Next + + Move up the selected items - - Options + + Move down the selected items - - Copy end + + Move the selected items to the bottom - - At the end of the copy: + + Add file/folder - - Don't close if errors are found + + Delete the selected items - - Never close + + Search - - Always close + + Export the transfer list - - Speed limit + + Import the transfer list - - KB/s + + Previous - - File collisions + + Next - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + + Interface + + + + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder + + + themesOptions + + + Show dual progression + + - - Ctrl+F + + Show speed as main information - - Shutdown when is finish + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color - - - options - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/Languages/zh/translation.ts b/plugins/Themes/Oxygen/Languages/zh/translation.ts index c5fd56b..1ee75a9 100644 --- a/plugins/Themes/Oxygen/Languages/zh/translation.ts +++ b/plugins/Themes/Oxygen/Languages/zh/translation.ts @@ -4,196 +4,325 @@ Themes - + + Buy the Ultimate version to fund development + + + + File %1/%2, size: %3/%4 - + + Copy list + + + + + Move list + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + File Name, 0KB + + + + + Select a color + + + + + + + %1 %2% of %3 + + - interfaceCopy + ThemesFactory - - From: + + Don't close if errors are found - - To: + + Never close - - Shutdown when is finish + + Always close - - 0KB/sec + + + + Select a color + + + interfaceCopy - + + From: + + + + + To: + + + + &More - + &Pause - + &Skip - + &Cancel - - - Limit copy speed at: + + Transfer list - - Unlimited + + Delete the selected items - - Copy list + + Export the transfer list - - Ctrl+F + + Import the transfer list - + Previous - + Next - - Options + + Interface - - Copy end + + Move the selected items to the top - - At the end of the copy: + + Close on transfer completion - - Don't close if errors are found + + Limit copy speed to: - - Never close + + Move up the selected items - - Always close + + Move down the selected items - - Speed limit + + Move the selected items to the bottom - - KB/s + + Add file/folder - - File collisions + + Search - - - What to do: + + + Error - - Copy errors + + Export the errors into transfer list - - Interface + + Source - - Show speed as main informations + + Destination - + Add file - + Add folder - + Move file(s) - + Move folder - + Copy file(s) - + Copy folder - options + themesOptions + + + Show dual progression + + + + + Show speed as main information + + + + + Use + + + + + Start with the "more button" pushed + + + + + Minimize on close to systray + + + + + At the end of the copy + + + + + + Limit copy speed to + + + + + KB/s + + + + + Start minimized + + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Click to edit the color + + - - Show speed as main informations + + Show progression in the title - - Start with more button pushed + + Always on top diff --git a/plugins/Themes/Oxygen/ThemesFactory.cpp b/plugins/Themes/Oxygen/ThemesFactory.cpp new file mode 100644 index 0000000..595ed71 --- /dev/null +++ b/plugins/Themes/Oxygen/ThemesFactory.cpp @@ -0,0 +1,476 @@ +/** \file factory.cpp +\brief Define the factory core +\author alpha_one_x86 */ + +#include + +#include "ThemesFactory.h" + +ThemesFactory::ThemesFactory() +{ + optionsEngine=NULL; + tempWidget=new QWidget(); + ui=new Ui::themesOptions(); + ui->setupUi(tempWidget); + ui->toolBox->setCurrentIndex(0); + currentSpeed = 0; + updateSpeed(); + + qRegisterMetaType >("QList"); +} + +ThemesFactory::~ThemesFactory() +{ +} + +PluginInterface_Themes * ThemesFactory::getInstance() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, currentSpeed: %1").arg(currentSpeed)); + + Themes * newInterface=new Themes( + ui->alwaysOnTop->isChecked(), + ui->showProgressionInTheTitle->isChecked(), + progressColorWrite,progressColorRead,progressColorRemaining, + ui->showDualProgression->isChecked(), + ui->comboBox_copyEnd->currentIndex(), + ui->speedWithProgressBar->isChecked(), + currentSpeed, + ui->checkBoxShowSpeed->isChecked(), + facilityEngine, + ui->checkBoxStartWithMoreButtonPushed->isChecked(), + ui->minimizeToSystray->isChecked(), + ui->startMinimized->isChecked() + ); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(newInterface,&Themes::debugInformation,this,&PluginInterface_ThemesFactory::debugInformation); + #endif + connect(this,&ThemesFactory::reloadLanguage,newInterface,&Themes::newLanguageLoaded); + return newInterface; +} + +void ThemesFactory::setResources(OptionInterface * optionsEngine,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + writePath + #endif + ,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + pluginPath + #endif + ,FacilityInterface * facilityEngine,const bool & + ) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); + this->facilityEngine=facilityEngine; + if(optionsEngine!=NULL) + { + this->optionsEngine=optionsEngine; + //load the options + QList > KeysList; + KeysList.append(qMakePair(QStringLiteral("checkBoxShowSpeed"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("moreButtonPushed"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("speedWithProgressBar"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("currentSpeed"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("comboBox_copyEnd"),QVariant(0))); + KeysList.append(qMakePair(QStringLiteral("showDualProgression"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("showProgressionInTheTitle"),QVariant(true))); + KeysList.append(qMakePair(QStringLiteral("progressColorWrite"),QVariant(QApplication::palette().color(QPalette::Highlight)))); + KeysList.append(qMakePair(QStringLiteral("progressColorRead"),QVariant(QApplication::palette().color(QPalette::AlternateBase)))); + KeysList.append(qMakePair(QStringLiteral("progressColorRemaining"),QVariant(QApplication::palette().color(QPalette::Base)))); + KeysList.append(qMakePair(QStringLiteral("alwaysOnTop"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("minimizeToSystray"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("startMinimized"),QVariant(false))); + optionsEngine->addOptionGroup(KeysList); + connect(optionsEngine,&OptionInterface::resetOptions,this,&ThemesFactory::resetOptions); + updateSpeed(); + } + #ifndef __GNUC__ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__GNUC__ is not set"); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__GNUC__ is set"); + #endif +} + +QWidget * ThemesFactory::options() +{ + if(optionsEngine!=NULL) + { + bool ok; + currentSpeed=optionsEngine->getOptionValue(QStringLiteral("currentSpeed")).toUInt(&ok); + if(!ok) + currentSpeed=0; + ui->comboBox_copyEnd->setCurrentIndex(optionsEngine->getOptionValue(QStringLiteral("comboBox_copyEnd")).toUInt()); + ui->speedWithProgressBar->setChecked(optionsEngine->getOptionValue(QStringLiteral("speedWithProgressBar")).toBool()); + ui->checkBoxShowSpeed->setChecked(optionsEngine->getOptionValue(QStringLiteral("checkBoxShowSpeed")).toBool()); + ui->checkBoxStartWithMoreButtonPushed->setChecked(optionsEngine->getOptionValue(QStringLiteral("moreButtonPushed")).toBool()); + ui->showDualProgression->setChecked(optionsEngine->getOptionValue(QStringLiteral("showDualProgression")).toBool()); + ui->showProgressionInTheTitle->setChecked(optionsEngine->getOptionValue(QStringLiteral("showProgressionInTheTitle")).toBool()); + ui->alwaysOnTop->setChecked(optionsEngine->getOptionValue(QStringLiteral("alwaysOnTop")).toBool()); + ui->minimizeToSystray->setChecked(optionsEngine->getOptionValue(QStringLiteral("minimizeToSystray")).toBool()); + ui->startMinimized->setChecked(optionsEngine->getOptionValue(QStringLiteral("startMinimized")).toBool()); + + progressColorWrite=optionsEngine->getOptionValue(QStringLiteral("progressColorWrite")).value(); + progressColorRead=optionsEngine->getOptionValue(QStringLiteral("progressColorRead")).value(); + progressColorRemaining=optionsEngine->getOptionValue(QStringLiteral("progressColorRemaining")).value(); + + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + ui->progressColorWrite->setIcon(pixmap); + pixmap.fill(progressColorRead); + ui->progressColorRead->setIcon(pixmap); + pixmap.fill(progressColorRemaining); + ui->progressColorRemaining->setIcon(pixmap); + updateSpeed(); + updateProgressionColorBar(); + + connect(ui->alwaysOnTop,&QCheckBox::stateChanged,this,&ThemesFactory::alwaysOnTop); + connect(ui->checkBoxShowSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::checkBoxShowSpeed); + connect(ui->minimizeToSystray,&QCheckBox::stateChanged,this,&ThemesFactory::minimizeToSystray); + connect(ui->checkBox_limitSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::uiUpdateSpeed); + connect(ui->SliderSpeed,&QAbstractSlider::valueChanged,this,&ThemesFactory::on_SliderSpeed_valueChanged); + connect(ui->limitSpeed,static_cast(&QSpinBox::valueChanged), this, &ThemesFactory::uiUpdateSpeed); + connect(ui->checkBoxShowSpeed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxShowSpeedHaveChanged); + connect(ui->checkBoxStartWithMoreButtonPushed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxStartWithMoreButtonPushedHaveChanged); + connect(ui->speedWithProgressBar,&QAbstractButton::toggled,this,&ThemesFactory::speedWithProgressBar); + connect(ui->comboBox_copyEnd, static_cast(&QComboBox::currentIndexChanged), this,&ThemesFactory::comboBox_copyEnd); + connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::showDualProgression); + connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::updateProgressionColorBar); + connect(ui->showProgressionInTheTitle,&QCheckBox::stateChanged,this,&ThemesFactory::setShowProgressionInTheTitle); + connect(ui->progressColorWrite,&QAbstractButton::clicked,this,&ThemesFactory::progressColorWrite_clicked); + connect(ui->progressColorRead, &QAbstractButton::clicked,this,&ThemesFactory::progressColorRead_clicked); + connect(ui->progressColorRemaining,&QAbstractButton::clicked,this,&ThemesFactory::progressColorRemaining_clicked); + connect(ui->startMinimized,&QCheckBox::stateChanged,this,&ThemesFactory::startMinimized); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"return the options"); + return tempWidget; +} + +QIcon ThemesFactory::getIcon(const QString &fileName) const +{ + if(fileName==QStringLiteral("SystemTrayIcon/exit.png")) + { + QIcon tempIcon=QIcon::fromTheme(QStringLiteral("application-exit")); + if(!tempIcon.isNull()) + return tempIcon; + } + else if(fileName==QStringLiteral("SystemTrayIcon/add.png")) + { + QIcon tempIcon=QIcon::fromTheme(QStringLiteral("list-add")); + if(!tempIcon.isNull()) + return tempIcon; + } + else if(fileName==QStringLiteral("SystemTrayIcon/informations.png")) + { + QIcon tempIcon=QIcon::fromTheme(QStringLiteral("help-about")); + if(!tempIcon.isNull()) + return tempIcon; + } + else if(fileName==QStringLiteral("SystemTrayIcon/options.png")) + { + QIcon tempIcon=QIcon::fromTheme(QStringLiteral("applications-system")); + if(!tempIcon.isNull()) + return tempIcon; + } + return QIcon(QStringLiteral(":/Themes/Oxygen/resources/")+fileName); +} + +void ThemesFactory::resetOptions() +{ + ui->checkBoxShowSpeed->setChecked(true); + ui->checkBoxStartWithMoreButtonPushed->setChecked(false); +} + +void ThemesFactory::checkBoxShowSpeedHaveChanged(bool toggled) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("checkBoxShowSpeed"),toggled); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("moreButtonPushed"),toggled); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::comboBox_copyEnd(int value) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("comboBox_copyEnd"),value); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::speedWithProgressBar(bool toggled) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("speedWithProgressBar"),toggled); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::newLanguageLoaded() +{ + ui->retranslateUi(tempWidget); + ui->comboBox_copyEnd->setItemText(0,tr("Don't close if errors are found")); + ui->comboBox_copyEnd->setItemText(1,tr("Never close")); + ui->comboBox_copyEnd->setItemText(2,tr("Always close")); + emit reloadLanguage(); +} + +void ThemesFactory::checkBoxShowSpeed(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(checked); + updateSpeed(); +} + +void ThemesFactory::minimizeToSystray(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("minimizeToSystray"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::alwaysOnTop(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("alwaysOnTop"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::showDualProgression(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("showDualProgression"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::startMinimized(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"the checkbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("startMinimized"),checked); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::on_SliderSpeed_valueChanged(int value) +{ + if(optionsEngine==NULL) + return; + if(!ui->checkBoxShowSpeed->isChecked()) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("value: %1").arg(value)); + switch(value) + { + case 0: + currentSpeed=0; + break; + case 1: + currentSpeed=1024; + break; + case 2: + currentSpeed=1024*4; + break; + case 3: + currentSpeed=1024*16; + break; + case 4: + currentSpeed=1024*64; + break; + case 5: + currentSpeed=1024*128; + break; + } + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + updateSpeed(); +} + +void ThemesFactory::uiUpdateSpeed() +{ + if(optionsEngine==NULL) + return; + if(ui->checkBoxShowSpeed->isChecked()) + return; + if(!ui->checkBox_limitSpeed->isChecked()) + currentSpeed=0; + else + currentSpeed=ui->limitSpeed->value(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("emit newSpeedLimitation(%1)").arg(currentSpeed)); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::updateSpeed() +{ + if(optionsEngine==NULL) + return; + ui->label_Slider_speed->setVisible(ui->checkBoxShowSpeed->isChecked()); + ui->SliderSpeed->setVisible(ui->checkBoxShowSpeed->isChecked()); + ui->label_SpeedMaxValue->setVisible(ui->checkBoxShowSpeed->isChecked()); + ui->limitSpeed->setVisible(!ui->checkBoxShowSpeed->isChecked()); + ui->checkBox_limitSpeed->setVisible(!ui->checkBoxShowSpeed->isChecked()); + + if(ui->checkBoxShowSpeed->isChecked()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("checked, currentSpeed: %1").arg(currentSpeed)); + ui->limitSpeed->setEnabled(false); + if(currentSpeed==0) + { + ui->SliderSpeed->setValue(0); + ui->label_SpeedMaxValue->setText(facilityEngine->translateText("Unlimited")); + } + else if(currentSpeed<=1024) + { + if(currentSpeed!=1024) + { + currentSpeed=1024; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(1); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*1)); + } + else if(currentSpeed<=1024*4) + { + if(currentSpeed!=1024*4) + { + currentSpeed=1024*4; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(2); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*4)); + } + else if(currentSpeed<=1024*16) + { + if(currentSpeed!=1024*16) + { + currentSpeed=1024*16; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(3); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*16)); + } + else if(currentSpeed<=1024*64) + { + if(currentSpeed!=1024*64) + { + currentSpeed=1024*64; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(4); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*64)); + } + else + { + if(currentSpeed!=1024*128) + { + currentSpeed=1024*128; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("currentSpeed"),currentSpeed); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(5); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*128)); + } + } + else + { + ui->checkBox_limitSpeed->setChecked(currentSpeed>0); + if(currentSpeed>0) + ui->limitSpeed->setValue(currentSpeed); + ui->checkBox_limitSpeed->setEnabled(currentSpeed!=-1); + ui->limitSpeed->setEnabled(ui->checkBox_limitSpeed->isChecked()); + } +} + +void ThemesFactory::progressColorWrite_clicked() +{ + QColor color=QColorDialog::getColor(progressColorWrite,NULL,tr("Select a color")); + if(!color.isValid()) + return; + progressColorWrite=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + ui->progressColorWrite->setIcon(pixmap); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("progressColorWrite"),progressColorWrite); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::progressColorRead_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRead,NULL,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRead=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRead); + ui->progressColorRead->setIcon(pixmap); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("progressColorRead"),progressColorRead); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::progressColorRemaining_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRemaining,NULL,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRemaining=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRemaining); + ui->progressColorRemaining->setIcon(pixmap); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("progressColorRemaining"),progressColorRemaining); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} + +void ThemesFactory::updateProgressionColorBar() +{ + ui->labelProgressionColor->setVisible(ui->showDualProgression->isChecked()); + ui->frameProgressionColor->setVisible(ui->showDualProgression->isChecked()); +} + +void ThemesFactory::setShowProgressionInTheTitle() +{ + if(optionsEngine!=NULL) + optionsEngine->setOptionValue(QStringLiteral("showProgressionInTheTitle"),ui->showProgressionInTheTitle->isChecked()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); +} diff --git a/plugins/Themes/Oxygen/ThemesFactory.h b/plugins/Themes/Oxygen/ThemesFactory.h new file mode 100644 index 0000000..895e32d --- /dev/null +++ b/plugins/Themes/Oxygen/ThemesFactory.h @@ -0,0 +1,86 @@ +/** \file factory.h +\brief Define the factory, to create instance of the interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FACTORY_H +#define FACTORY_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_Themes.h" +#include "ui_themesOptions.h" +#include "interface.h" +#include "Environment.h" + +namespace Ui { + class themesOptions; +} + +/// \brief Define the factory, to create instance of the interface +class ThemesFactory : public PluginInterface_ThemesFactory +{ + Q_OBJECT + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_ThemesFactory) + #endif +public: + ThemesFactory(); + ~ThemesFactory(); + /// \brief to return the instance of the copy engine + PluginInterface_Themes * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * optionsEngine,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + writePath + #endif + ,const QString & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + pluginPath + #endif + ,FacilityInterface * facilityEngine,const bool &portableVersion); + /// \brief to get the default options widget + QWidget * options(); + /// \brief to get a resource icon + QIcon getIcon(const QString &fileName) const; +private slots: + void checkBoxShowSpeedHaveChanged(bool toggled); + void checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled); + void comboBox_copyEnd(int value); + void speedWithProgressBar(bool toggled); + void checkBoxShowSpeed(bool checked); + void minimizeToSystray(bool checked); + void alwaysOnTop(bool checked); + void showDualProgression(bool checked); + void on_SliderSpeed_valueChanged(int value); + void uiUpdateSpeed(); + void updateSpeed(); + void progressColorWrite_clicked(); + void progressColorRead_clicked(); + void progressColorRemaining_clicked(); + void updateProgressionColorBar(); + void setShowProgressionInTheTitle(); + void startMinimized(bool checked); +public slots: + void resetOptions(); + void newLanguageLoaded(); +private: + OptionInterface * optionsEngine; + Ui::themesOptions *ui; + QWidget *tempWidget; + FacilityInterface * facilityEngine; + qint32 currentSpeed;///< in KB/s, assume as 0KB/s as default like every where + QColor progressColorWrite,progressColorRead,progressColorRemaining; +signals: + void reloadLanguage() const; +}; + +#endif // FACTORY_H diff --git a/plugins/Themes/Oxygen/TransferModel.cpp b/plugins/Themes/Oxygen/TransferModel.cpp index 42d2315..ff09d93 100644 --- a/plugins/Themes/Oxygen/TransferModel.cpp +++ b/plugins/Themes/Oxygen/TransferModel.cpp @@ -4,144 +4,159 @@ // Model +QIcon *TransferModel::start=NULL; +QIcon *TransferModel::stop=NULL; + TransferModel::TransferModel() { - start=QIcon(":/resources/player_play.png"); - stop=QIcon(":/resources/player_pause.png"); - currentIndexSearch=0; - haveSearchItem=false; + /// \warning to prevent Must construct a QGuiApplication before QPixmap IN STATIC WINDOWS VERSION ONLY + if(TransferModel::start==NULL) + TransferModel::start=new QIcon(QStringLiteral(":/resources/player_play.png")); + if(TransferModel::stop==NULL) + TransferModel::stop=new QIcon(QStringLiteral(":/resources/player_pause.png")); + currentIndexSearch=0; + haveSearchItem=false; + loop_size=0,index_for_loop=0; + sub_loop_size=0,sub_index_for_loop=0; + row=0,column=0; + facilityEngine=NULL; + currentIndexSearch=0; + haveSearchItem=false; + searchId=0; } int TransferModel::columnCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? COLUMN_COUNT : 0; + return parent == QModelIndex() ? COLUMN_COUNT : 0; } QVariant TransferModel::data( const QModelIndex& index, int role ) const { - int row,column; - row=index.row(); - column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) - return QVariant(); + int row,column; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return QVariant(); - const transfertItem& item = transfertItemList[row]; - if(role==Qt::UserRole) - return item.id; - else if(role==Qt::DisplayRole) - { - switch(column) - { - case 0: - return item.source; - break; - case 1: - return item.size; - break; - case 2: - return item.destination; - break; - default: - return QVariant(); - } - } - else if(role==Qt::DecorationRole) - { - switch(column) - { - case 0: - if(stopId.contains(item.id)) - return stop; - else if(startId.contains(item.id)) - return start; - else - return QVariant(); - break; - default: - return QVariant(); - } - } - else if(role==Qt::BackgroundRole) - { - if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) - { - if(haveSearchItem && searchId==item.id) - return QColor(255,150,150,100); - else - return QColor(255,255,0,100); - } - else - return QVariant(); - } - return QVariant(); + const TransfertItem& item = transfertItemList.at(row); + if(role==Qt::UserRole) + return item.id; + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + return item.source; + break; + case 1: + return item.size; + break; + case 2: + return item.destination; + break; + default: + return QVariant(); + } + } + else if(role==Qt::DecorationRole) + { + switch(column) + { + case 0: + if(stopId.contains(item.id)) + return *stop; + else if(startId.contains(item.id)) + return *start; + else + return QVariant(); + break; + default: + return QVariant(); + } + } + else if(role==Qt::BackgroundRole) + { + if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) + { + if(haveSearchItem && searchId==item.id) + return QColor(255,150,150,100); + else + return QColor(255,255,0,100); + } + else + return QVariant(); + } + return QVariant(); } int TransferModel::rowCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? transfertItemList.count() : 0; + return parent == QModelIndex() ? transfertItemList.count() : 0; } -quint64 TransferModel::firstId() +quint64 TransferModel::firstId() const { - if(transfertItemList.count()>0) - return transfertItemList[0].id; - else - return 0; + if(transfertItemList.count()>0) + return transfertItemList.first().id; + else + return 0; } QVariant TransferModel::headerData( int section, Qt::Orientation orientation, int role ) const { - if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { - switch ( section ) { - case 0: - return facilityEngine->translateText("Source"); - case 1: - return facilityEngine->translateText("Size"); - case 2: - return facilityEngine->translateText("Destination"); - } - } + if(facilityEngine==NULL) + abort(); + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return facilityEngine->translateText(QStringLiteral("Source")); + case 1: + return facilityEngine->translateText(QStringLiteral("Size")); + case 2: + return facilityEngine->translateText(QStringLiteral("Destination")); + } + } - return QAbstractTableModel::headerData( section, orientation, role ); + return QAbstractTableModel::headerData( section, orientation, role ); } bool TransferModel::setData( const QModelIndex& index, const QVariant& value, int role ) { - row=index.row(); - column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) - return false; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return false; - transfertItem& item = transfertItemList[row]; - if(role==Qt::UserRole) - { - item.id=value.toULongLong(); - return true; - } - else if(role==Qt::DisplayRole) - { - switch(column) - { - case 0: - item.source=value.toString(); - emit dataChanged(index,index); - return true; - break; - case 1: - item.size=value.toString(); - emit dataChanged(index,index); - return true; - break; - case 2: - item.destination=value.toString(); - emit dataChanged(index,index); - return true; - break; - default: - return false; - } - } - return false; + TransfertItem& item = transfertItemList[row]; + if(role==Qt::UserRole) + { + item.id=value.toULongLong(); + return true; + } + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + item.source=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 1: + item.size=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 2: + item.destination=value.toString(); + emit dataChanged(index,index); + return true; + break; + default: + return false; + } + } + return false; } /* @@ -149,291 +164,407 @@ bool TransferModel::setData( const QModelIndex& index, const QVariant& value, in Return[1]: totalSize Return[2]: currentFile */ -QList TransferModel::synchronizeItems(const QList& returnActions) +QList TransferModel::synchronizeItems(const QList& returnActions) { - loop_size=returnActions.size(); - index_for_loop=0; - totalFile=0; - totalSize=0; - currentFile=0; - emit layoutAboutToBeChanged(); - while(index_for_loopsizeToString(action.addAction.size); - newItem.destination=action.addAction.destinationFullPath; - transfertItemList<(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.moveAt<0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.moveAt>(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - transfertItemList.move(action.userAction.position,action.userAction.moveAt); - } - break; - case RemoveItem: - { - if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) - currentIndexSearch--; - if(action.userAction.position<0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.position>(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - transfertItemList.removeAt(action.userAction.position); - currentFile++; - startId.remove(action.addAction.id); - stopId.remove(action.addAction.id); - } - break; - case PreOperation: - { - ItemOfCopyListWithMoreInformations tempItem; - tempItem.currentProgression=0; - tempItem.generalData=action.addAction; - tempItem.actionType=action.type; - internalRunningOperation[action.addAction.id]=tempItem; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("set for file %1: actionType: PreOperation").arg(action.addAction.id)); - } - break; - case Transfer: - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("found entry for file %1: actionType: Transfer").arg(action.addAction.id)); - if(!startId.contains(action.addAction.id)) - startId << action.addAction.id; - stopId.remove(action.addAction.id); - if(internalRunningOperation.contains(action.addAction.id)) - internalRunningOperation[action.addAction.id].actionType=action.type; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); - } - break; - case PostOperation: - { - if(!stopId.contains(action.addAction.id)) - stopId << action.addAction.id; - startId.remove(action.addAction.id); - internalRunningOperation.remove(action.addAction.id); - } - break; - case CustomOperation: - { - bool custom_with_progression=(action.addAction.size==1); - //without progression - if(custom_with_progression) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("switch the file: %1 to custom operation with progression").arg(action.addAction.id)); - if(startId.remove(action.addAction.id)) - if(!stopId.contains(action.addAction.id)) - stopId << action.addAction.id; - } - //with progression - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("switch the file: %1 to custom operation without progression").arg(action.addAction.id)); - stopId.remove(action.addAction.id); - if(!startId.contains(action.addAction.id)) - startId << action.addAction.id; - } - if(internalRunningOperation.contains(action.addAction.id)) - { - ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; - item.actionType=action.type; - item.custom_with_progression=custom_with_progression; - item.currentProgression=0; - } - } - break; - default: - //unknow code, ignore it - break; - } - index_for_loop++; - } - emit layoutChanged(); - return QList() << totalFile << totalSize << currentFile; + const QModelIndexList oldIndexes = persistentIndexList(); + QModelIndexList newIndexes=oldIndexes; + QMap oldMapping; // model index row in model before update, item id + QMap newMapping; // item id, model index row in model after update + for ( int i = 0; i < oldIndexes.count(); i++ ) { + const QModelIndex& index = oldIndexes.at(i); + oldMapping[index.row()] = index.data( Qt::UserRole ).value(); + } + + loop_size=returnActions.size(); + index_for_loop=0; + quint64 totalFile=0,totalSize=0,currentFile=0; + emit layoutAboutToBeChanged(); + while(index_for_loopsizeToString(action.addAction.size); + newItem.destination=action.addAction.destinationFullPath; + transfertItemList<(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.position==action.userAction.moveAt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, move at same position: %2").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.move(action.userAction.position,action.userAction.moveAt); + //newIndexes.move(action.userAction.position,action.userAction.moveAt); + } + break; + case Ultracopier::RemoveItem: + { + if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) + currentIndexSearch--; + if(action.userAction.position<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.position>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.removeAt(action.userAction.position); + currentFile++; + startId.remove(action.addAction.id); + stopId.remove(action.addAction.id); + internalRunningOperation.remove(action.addAction.id); + //newIndexes.remove(action.userAction.moveAt); + } + break; + case Ultracopier::PreOperation: + { + ItemOfCopyListWithMoreInformations tempItem; + tempItem.currentReadProgression=0; + tempItem.currentWriteProgression=0; + tempItem.generalData=action.addAction; + tempItem.actionType=action.type; + internalRunningOperation[action.addAction.id]=tempItem; + } + break; + case Ultracopier::Transfer: + { + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + stopId.remove(action.addAction.id); + if(internalRunningOperation.contains(action.addAction.id)) + internalRunningOperation[action.addAction.id].actionType=action.type; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + } + break; + case Ultracopier::PostOperation: + { + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + startId.remove(action.addAction.id); + } + break; + case Ultracopier::CustomOperation: + { + bool custom_with_progression=(action.addAction.size==1); + //without progression + if(custom_with_progression) + { + if(startId.remove(action.addAction.id)) + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + } + //with progression + else + { + stopId.remove(action.addAction.id); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + } + if(internalRunningOperation.contains(action.addAction.id)) + { + ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; + item.actionType=action.type; + item.custom_with_progression=custom_with_progression; + item.currentReadProgression=0; + item.currentWriteProgression=0; + } + } + break; + default: + //unknow code, ignore it + break; + } + index_for_loop++; + } + + if(!oldIndexes.isEmpty()) + { + const QSet ids = oldMapping.values().toSet(); + + for ( int i = 0; i < transfertItemList.count(); i++ ) { + const TransferModel::TransfertItem& item = transfertItemList.at(i); + + if ( ids.contains( item.id ) ) { + newMapping[ item.id ] = i; + } + } + + for ( int i = 0; i < oldIndexes.count(); i++ ) { + const QModelIndex& index = oldIndexes.at(i); + const int newRow = newMapping.value( oldMapping.value(index.row()), -1 ); + newIndexes[ i ] = newRow == -1 ? QModelIndex() : QAbstractTableModel::index( newRow, index.column(), index.parent() ); + } + } + + changePersistentIndexList( oldIndexes, newIndexes ); + emit layoutChanged(); + return QList() << totalFile << totalSize << currentFile; } void TransferModel::setFacilityEngine(FacilityInterface * facilityEngine) { - this->facilityEngine=facilityEngine; + this->facilityEngine=facilityEngine; } int TransferModel::search(const QString &text,bool searchNext) { - emit layoutAboutToBeChanged(); - search_text=text; - emit layoutChanged(); - if(transfertItemList.size()==0) - return -1; - if(text.isEmpty()) - return -1; - if(searchNext) - { - currentIndexSearch++; - if(currentIndexSearch>=loop_size) - currentIndexSearch=0; - } - index_for_loop=0; - loop_size=transfertItemList.size(); - while(index_for_loop=loop_size) - currentIndexSearch=0; - index_for_loop++; - } - haveSearchItem=false; - return -1; + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.isEmpty()) + return -1; + if(searchNext) + { + currentIndexSearch++; + if(currentIndexSearch>=loop_size) + currentIndexSearch=0; + } + index_for_loop=0; + loop_size=transfertItemList.size(); + while(index_for_loop=loop_size) + currentIndexSearch=0; + index_for_loop++; + } + haveSearchItem=false; + return -1; } int TransferModel::searchPrev(const QString &text) { - emit layoutAboutToBeChanged(); - search_text=text; - emit layoutChanged(); - if(transfertItemList.size()==0) - return -1; - if(text.isEmpty()) - return -1; - if(currentIndexSearch==0) - currentIndexSearch=loop_size-1; - else - currentIndexSearch--; - index_for_loop=0; - loop_size=transfertItemList.size(); - while(index_for_loop &progressionList) +void TransferModel::setFileProgression(QList &progressionList) { - loop_size=progressionList.size(); - index_for_loop=0; - while(index_for_loop0) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"progression remaning items"); - #endif + loop_size=progressionList.size(); + index_for_loop=0; + while(index_for_loop0) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("progression remaning items")); + #endif } -TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() +TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() const { - currentTransfertItem returnItem; - returnItem.haveItem=startId.size()>0; - if(returnItem.haveItem) - { - if(!internalRunningOperation.contains(*startId.constBegin())) - { - returnItem.haveItem=false; - return returnItem; - } - const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*startId.constBegin()]; - returnItem.from=itemTransfer.generalData.sourceFullPath; - returnItem.to=itemTransfer.generalData.destinationFullPath; - returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); - switch(itemTransfer.actionType) - { - case CustomOperation: - if(!itemTransfer.custom_with_progression) - returnItem.progressBar_file=-1; - else - { - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=-1; - } - break; - case Transfer: - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - break; - //should never pass here - case PostOperation: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - returnItem.progressBar_file=65535; - break; - //should never pass here - case PreOperation: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - returnItem.progressBar_file=0; - break; - default: - returnItem.progressBar_file=0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - break; - } - } -/* else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("No have running item"));*/ - return returnItem; + currentTransfertItem returnItem; + returnItem.progressBar_read=-1; + returnItem.progressBar_write=0; + returnItem.haveItem=startId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*startId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation.value(*startId.constBegin()); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+QStringLiteral(", ")+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + //should never pass here + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + else + { + returnItem.haveItem=stopId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*stopId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation.value(*stopId.constBegin()); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+QStringLiteral(", ")+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + } + if(returnItem.haveItem && returnItem.progressBar_read!=-1 && returnItem.progressBar_write>returnItem.progressBar_read) + { + int tempVar=returnItem.progressBar_write; + returnItem.progressBar_write=returnItem.progressBar_read; + returnItem.progressBar_read=tempVar; + } + return returnItem; } diff --git a/plugins/Themes/Oxygen/TransferModel.h b/plugins/Themes/Oxygen/TransferModel.h index 913c96a..d2a4a1c 100644 --- a/plugins/Themes/Oxygen/TransferModel.h +++ b/plugins/Themes/Oxygen/TransferModel.h @@ -2,6 +2,7 @@ #define TRANSFERMODEL_H #include +#include #include #include #include @@ -17,75 +18,75 @@ /// \brief model to store the transfer list class TransferModel : public QAbstractTableModel { - Q_OBJECT + Q_OBJECT public: - /// \brief the transfer item displayed - struct transfertItem - { - quint64 id; - QString source; - QString size; - QString destination; - }; - /// \brief the transfer item with progression - struct ItemOfCopyListWithMoreInformations - { - quint64 currentProgression; - ItemOfCopyList generalData; - ActionTypeCopyList actionType; - bool custom_with_progression; - }; - /// \brief returned first transfer item - struct currentTransfertItem - { - quint64 id; - bool haveItem; - QString from; - QString to; - QString current_file; - int progressBar_file; - }; + /// \brief the transfer item displayed + struct TransfertItem + { + quint64 id; + QString source; + QString size; + QString destination; + }; + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentReadProgression,currentWriteProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_read,progressBar_write; + }; - TransferModel(); + TransferModel(); - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - - QList synchronizeItems(const QList& returnActions); - void setFacilityEngine(FacilityInterface * facilityEngine); + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - int search(const QString &text,bool searchNext); - int searchPrev(const QString &text); + QList synchronizeItems(const QList& returnActions); + void setFacilityEngine(FacilityInterface * facilityEngine); - void setFileProgression(QList &progressionList); + int search(const QString &text,bool searchNext); + int searchPrev(const QString &text); - currentTransfertItem getCurrentTransfertItem(); + void setFileProgression(QList &progressionList); - quint64 firstId(); + currentTransfertItem getCurrentTransfertItem() const; + + quint64 firstId() const; protected: - QList transfertItemList;///< To have a transfer list for the user - QSet startId,stopId;///< To show what is started, what is stopped - QHash internalRunningOperation;///< to have progression and stat - QIcon start,stop; + QList transfertItemList;///< To have a transfer list for the user + QSet startId,stopId;///< To show what is started, what is stopped + QHash internalRunningOperation;///< to have progression and stat private: - int loop_size,index_for_loop; - int sub_loop_size,sub_index_for_loop; - int row,column; - quint64 totalFile,totalSize,currentFile; - FacilityInterface * facilityEngine; - QString search_text; - /// \brief index from start the search, decresed by remove before it - int currentIndexSearch; - bool haveSearchItem; - quint64 searchId; + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + int row,column; + FacilityInterface * facilityEngine; + QString search_text; + /// \brief index from start the search, decresed by remove before it + int currentIndexSearch; + bool haveSearchItem; + quint64 searchId; + static QIcon *start; + static QIcon *stop; signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,QString fonction,QString text,QString file,int ligne) const; + #endif }; #endif // TRANSFERMODEL_H diff --git a/plugins/Themes/Oxygen/Variable.h b/plugins/Themes/Oxygen/Variable.h index 8179c93..8b6119b 100644 --- a/plugins/Themes/Oxygen/Variable.h +++ b/plugins/Themes/Oxygen/Variable.h @@ -1,15 +1,17 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H + //Un-comment this next line to put ultracopier plugin in debug mode #define ULTRACOPIER_PLUGIN_DEBUG +#define ULTRACOPIER_VERSION_ULTIMATE + #endif // VARIABLE_H diff --git a/plugins/Themes/Oxygen/documentation.dox b/plugins/Themes/Oxygen/documentation.dox old mode 100755 new mode 100644 index 2c0cf64..629330b --- a/plugins/Themes/Oxygen/documentation.dox +++ b/plugins/Themes/Oxygen/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview It's the default interface for Ultracopier. The first version, it's greatly inspirated by Supercopier. But have well evolued.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project. + More informations on the wiki of ultracopier. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins/Themes/Oxygen/factory.cpp b/plugins/Themes/Oxygen/factory.cpp deleted file mode 100644 index 2e90337..0000000 --- a/plugins/Themes/Oxygen/factory.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/** \file factory.cpp -\brief Define the factory core -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include - -#include "factory.h" - -Factory::Factory() -{ - optionsEngine=NULL; - tempWidget=new QWidget(); - ui=new Ui::options(); - ui->setupUi(tempWidget); -} - -Factory::~Factory() -{ -} - -PluginInterface_Themes * Factory::getInstance() -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - PluginInterface_Themes * newInterface=new Themes( - optionsEngine->getOptionValue("checkBoxShowSpeed").toBool(),facilityEngine,optionsEngine->getOptionValue("moreButtonPushed").toBool() - ); - connect(newInterface,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - connect(this,SIGNAL(reloadLanguage()),newInterface,SLOT(newLanguageLoaded())); - return newInterface; -} - -void Factory::setResources(OptionInterface * optionsEngine,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion) -{ - Q_UNUSED(portableVersion); - Q_UNUSED(writePath); - Q_UNUSED(pluginPath); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); - this->facilityEngine=facilityEngine; - if(optionsEngine!=NULL) - { - this->optionsEngine=optionsEngine; - //load the options - QList > KeysList; - KeysList.append(qMakePair(QString("checkBoxShowSpeed"),QVariant(false))); - KeysList.append(qMakePair(QString("moreButtonPushed"),QVariant(false))); - optionsEngine->addOptionGroup(KeysList); - connect(optionsEngine,SIGNAL(resetOptions()),this,SLOT(resetOptions())); - } - #ifndef __GNUC__ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"__GNUC__ is set"); - #endif - #ifndef __GNUC__ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"__GNUC__ is set"); - #endif -} - -QWidget * Factory::options() -{ - if(optionsEngine!=NULL) - { - ui->checkBoxShowSpeed->setChecked(optionsEngine->getOptionValue("checkBoxShowSpeed").toBool()); - ui->checkBoxStartWithMoreButtonPushed->setChecked(optionsEngine->getOptionValue("moreButtonPushed").toBool()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); - connect(ui->checkBoxShowSpeed,SIGNAL(toggled(bool)),this,SLOT(checkBoxShowSpeedHaveChanged(bool))); - connect(ui->checkBoxStartWithMoreButtonPushed,SIGNAL(toggled(bool)),this,SLOT(checkBoxStartWithMoreButtonPushedHaveChanged(bool))); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"return the options"); - return tempWidget; -} - -QIcon Factory::getIcon(const QString &fileName) -{ - if(fileName=="SystemTrayIcon/exit.png") - { - QIcon tempIcon=QIcon::fromTheme("application-exit"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/add.png") - { - QIcon tempIcon=QIcon::fromTheme("list-add"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/informations.png") - { - QIcon tempIcon=QIcon::fromTheme("help-about"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/options.png") - { - QIcon tempIcon=QIcon::fromTheme("applications-system"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - return QIcon(":/resources/"+fileName); -} - -void Factory::resetOptions() -{ - ui->checkBoxShowSpeed->setChecked(true); - ui->checkBoxStartWithMoreButtonPushed->setChecked(false); -} - -void Factory::checkBoxShowSpeedHaveChanged(bool toggled) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("checkBoxShowSpeed",toggled); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"the checkbox have changed"); - if(optionsEngine!=NULL) - optionsEngine->setOptionValue("moreButtonPushed",toggled); - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"internal error, crash prevented"); -} - -void Factory::newLanguageLoaded() -{ - ui->retranslateUi(tempWidget); - emit reloadLanguage(); -} - -Q_EXPORT_PLUGIN2(interface, Factory); - diff --git a/plugins/Themes/Oxygen/factory.h b/plugins/Themes/Oxygen/factory.h deleted file mode 100644 index f07b0cf..0000000 --- a/plugins/Themes/Oxygen/factory.h +++ /dev/null @@ -1,61 +0,0 @@ -/** \file factory.h -\brief Define the factory, to create instance of the interface -\author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#ifndef FACTORY_H -#define FACTORY_H - -#include -#include -#include -#include -#include -#include - -#include "../../../interface/PluginInterface_Themes.h" -#include "ui_options.h" -#include "interface.h" -#include "Environment.h" - -namespace Ui { - class options; -} - -/// \brief Define the factory, to create instance of the interface -class Factory : public PluginInterface_ThemesFactory -{ - Q_OBJECT - Q_INTERFACES(PluginInterface_ThemesFactory) -public: - Factory(); - ~Factory(); - /// \brief to return the instance of the copy engine - PluginInterface_Themes * getInstance(); - /// \brief set the resources, to store options, to have facilityInterface - void setResources(OptionInterface * optionsEngine,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion); - /// \brief to get the default options widget - QWidget * options(); - /// \brief to get a resource icon - QIcon getIcon(const QString &fileName); -private slots: - void checkBoxShowSpeedHaveChanged(bool toggled); - void checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled); -public slots: - void resetOptions(); - void newLanguageLoaded(); -private: - OptionInterface * optionsEngine; - Ui::options *ui; - QWidget *tempWidget; - FacilityInterface * facilityEngine; -signals: - void reloadLanguage(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif -}; - -#endif // FACTORY_H diff --git a/plugins/Themes/Oxygen/informations.xml b/plugins/Themes/Oxygen/informations.xml index bf2d1e1..d81313d 100644 --- a/plugins/Themes/Oxygen/informations.xml +++ b/plugins/Themes/Oxygen/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 Oxygen =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins/Themes/Oxygen/interface.cpp b/plugins/Themes/Oxygen/interface.cpp old mode 100755 new mode 100644 index f01b811..703f3b2 --- a/plugins/Themes/Oxygen/interface.cpp +++ b/plugins/Themes/Oxygen/interface.cpp @@ -1,860 +1,1068 @@ /** \file interface.cpp \brief Define the interface core -\author alpha_one_x86 -\version 0.3 -\date 2010 */ +\author alpha_one_x86 */ -#include #include +#include +#include +#include +#include +#include +#include +#ifdef Q_OS_WIN + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif #include "interface.h" #include "ui_interface.h" - -Themes::Themes(bool checkBoxShowSpeed,FacilityInterface * facilityEngine,bool moreButtonPushed) : - ui(new Ui::interfaceCopy()) -{ - this->facilityEngine=facilityEngine; - ui->setupUi(this); - ui->TransferList->setModel(&transferModel); - transferModel.setFacilityEngine(facilityEngine); - ui->tabWidget->setCurrentIndex(0); - ui->checkBoxShowSpeed->setChecked(checkBoxShowSpeed); - currentFile = 0; - totalFile = 0; - currentSize = 0; - totalSize = 0; - haveError = false; - this->show(); - menu=new QMenu(this); - ui->add->setMenu(menu); - on_checkBoxShowSpeed_toggled(ui->checkBoxShowSpeed->isChecked()); - currentSpeed = 0; - storeIsInPause = false; - isInPause(false); - modeIsForced = false; - haveStarted = false; - connect(ui->limitSpeed, SIGNAL(valueChanged(int)), this, SLOT(uiUpdateSpeed())); - connect(ui->checkBox_limitSpeed,SIGNAL(toggled(bool)), this, SLOT(uiUpdateSpeed())); - - connect(ui->actionAddFile,SIGNAL(triggered()),this,SLOT(forcedModeAddFile())); - connect(ui->actionAddFileToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToCopy())); - connect(ui->actionAddFileToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToMove())); - connect(ui->actionAddFolderToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToCopy())); - connect(ui->actionAddFolderToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToMove())); - connect(ui->actionAddFolder,SIGNAL(triggered()),this,SLOT(forcedModeAddFolder())); - - //setup the search part - closeTheSearchBox(); - TimerForSearch = new QTimer(this); - TimerForSearch->setInterval(500); - TimerForSearch->setSingleShot(true); - searchShortcut = new QShortcut(QKeySequence("Ctrl+F"),this); - searchShortcut2 = new QShortcut(QKeySequence("F3"),this); - searchShortcut3 = new QShortcut(QKeySequence("Escape"),this);//Qt::Key_Escape - - //connect the search part - connect(TimerForSearch, SIGNAL(timeout()), this, SLOT(hilightTheSearch())); - connect(searchShortcut, SIGNAL(activated()), this, SLOT(searchBoxShortcut())); - connect(searchShortcut2, SIGNAL(activated()), this, SLOT(on_pushButtonSearchNext_clicked())); - connect(ui->pushButtonCloseSearch, SIGNAL(clicked()), this, SLOT(closeTheSearchBox())); - connect(searchShortcut3, SIGNAL(activated()), this, SLOT(closeTheSearchBox())); - - //reload directly untranslatable text - newLanguageLoaded(); - - //unpush the more button - ui->moreButton->setChecked(moreButtonPushed); - on_moreButton_toggled(false); - - /// \note important for drag and drop, \see dropEvent() - setAcceptDrops(true); - - // try set the OS icon - QIcon tempIcon; - - tempIcon=QIcon::fromTheme("application-exit"); - if(!tempIcon.isNull()) - { - ui->cancelButton->setIcon(tempIcon); - ui->pushButtonCloseSearch->setIcon(tempIcon); - ui->shutdown->setIcon(tempIcon); - } - - tempIcon=QIcon::fromTheme("edit-delete"); - if(!tempIcon.isNull()) - ui->del->setIcon(tempIcon); - - tempIcon=QIcon::fromTheme("media-playback-pause"); - if(!tempIcon.isNull()) - { - player_pause=tempIcon; - ui->pauseButton->setIcon(tempIcon); - } - else - player_pause=QIcon(":/resources/player_pause.png"); - - tempIcon=QIcon::fromTheme("media-playback-play"); - if(!tempIcon.isNull()) - player_play=tempIcon; - else - player_play=QIcon(":/resources/player_play.png"); - - tempIcon=QIcon::fromTheme("media-skip-forward"); - if(!tempIcon.isNull()) - ui->skipButton->setIcon(tempIcon); - - tempIcon=QIcon::fromTheme("edit-find"); - if(!tempIcon.isNull()) - ui->searchButton->setIcon(tempIcon); - - tempIcon=QIcon::fromTheme("document-open"); - if(!tempIcon.isNull()) - ui->importTransferList->setIcon(tempIcon); - - tempIcon=QIcon::fromTheme("document-save"); - if(!tempIcon.isNull()) - ui->exportTransferList->setIcon(tempIcon); - - tempIcon=QIcon::fromTheme("list-add"); - if(!tempIcon.isNull()) - { - ui->add->setIcon(tempIcon); - ui->actionAddFile->setIcon(tempIcon); - ui->actionAddFileToCopy->setIcon(tempIcon); - ui->actionAddFileToMove->setIcon(tempIcon); - ui->actionAddFolder->setIcon(tempIcon); - ui->actionAddFolderToCopy->setIcon(tempIcon); - ui->actionAddFolderToMove->setIcon(tempIcon); - } - - shutdown=facilityEngine->haveFunctionality("shutdown"); - ui->shutdown->setVisible(shutdown); - - selectionModel=ui->TransferList->selectionModel(); - - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&transferModel,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif - - updateSpeed(); +#include "ThemesFactory.h" + +QIcon Themes::player_play; +QIcon Themes::player_pause; +QIcon Themes::tempExitIcon; +QIcon Themes::editDelete; +QIcon Themes::skinIcon; +QIcon Themes::editFind; +QIcon Themes::documentOpen; +QIcon Themes::documentSave; +QIcon Themes::listAdd; +bool Themes::iconLoaded=false; + +// The cmath header from MSVC does not contain round() +#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER) +inline double round(double d) { + return floor( d + 0.5 ); } - -Themes::~Themes() +#endif + +Themes::Themes(const bool &alwaysOnTop, + const bool &showProgressionInTheTitle, + const QColor &progressColorWrite, + const QColor &progressColorRead, + const QColor &progressColorRemaining, + const bool &showDualProgression, + const quint8 &comboBox_copyEnd, + const bool &speedWithProgressBar, + const qint32 ¤tSpeed, + const bool &checkBoxShowSpeed, + FacilityInterface * facilityEngine, + const bool &moreButtonPushed, + const bool &minimizeToSystray, + const bool &startMinimized) : + ui(new Ui::interfaceCopy()), + uiOptions(new Ui::themesOptions()) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - disconnect(ui->actionAddFile); - disconnect(ui->actionAddFolder); - delete selectionModel; - delete menu; + this->facilityEngine=facilityEngine; + ui->setupUi(this); + uiOptions->setupUi(ui->optionsTab); + + currentFile = 0; + totalFile = 0; + currentSize = 0; + totalSize = 0; + getOldProgression = 200; + haveError = false; + stat = status_never_started; + modeIsForced = false; + haveStarted = false; + storeIsInPause = false; + durationStarted = false; + if(startMinimized) + this->showMinimized(); + + this->progressColorWrite = progressColorWrite; + this->progressColorRead = progressColorRead; + this->progressColorRemaining= progressColorRemaining; + this->currentSpeed = currentSpeed; + uiOptions->showProgressionInTheTitle->setChecked(showProgressionInTheTitle); + uiOptions->speedWithProgressBar->setChecked(speedWithProgressBar); + uiOptions->showDualProgression->setChecked(showDualProgression); + uiOptions->startMinimized->setEnabled(false); + uiOptions->alwaysOnTop->setChecked(alwaysOnTop); + uiOptions->minimizeToSystray->setChecked(minimizeToSystray); + //uiOptions->setupUi(ui->tabWidget->widget(ui->tabWidget->count()-1)); + uiOptions->labelStartWithMoreButtonPushed->setVisible(false); + uiOptions->checkBoxStartWithMoreButtonPushed->setVisible(false); + uiOptions->label_Slider_speed->setVisible(false); + uiOptions->SliderSpeed->setVisible(false); + uiOptions->label_SpeedMaxValue->setVisible(false); + uiOptions->comboBox_copyEnd->setCurrentIndex(comboBox_copyEnd); + speedWithProgressBar_toggled(speedWithProgressBar); + showDualProgression_toggled(showDualProgression); + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + uiOptions->progressColorWrite->setIcon(pixmap); + pixmap.fill(progressColorRead); + uiOptions->progressColorRead->setIcon(pixmap); + pixmap.fill(progressColorRemaining); + uiOptions->progressColorRemaining->setIcon(pixmap); + + transferModel.setFacilityEngine(facilityEngine);//need be before ui->TransferList->setModel(&transferModel); due to call of TransferModel::headerData() + ui->TransferList->setModel(&transferModel); + ui->tabWidget->setCurrentIndex(0); + uiOptions->toolBox->setCurrentIndex(0); + uiOptions->checkBoxShowSpeed->setChecked(checkBoxShowSpeed); + menu=new QMenu(this); + ui->add->setMenu(menu); + + //connect the options + checkBoxShowSpeed_toggled(uiOptions->checkBoxShowSpeed->isChecked()); + connect(uiOptions->checkBoxShowSpeed,&QCheckBox::stateChanged,this,&Themes::checkBoxShowSpeed_toggled); + connect(uiOptions->speedWithProgressBar,&QCheckBox::stateChanged,this,&Themes::speedWithProgressBar_toggled); + connect(uiOptions->showProgressionInTheTitle,&QCheckBox::stateChanged,this,&Themes::updateTitle); + connect(uiOptions->showDualProgression,&QCheckBox::stateChanged,this,&Themes::showDualProgression_toggled); + connect(uiOptions->progressColorWrite,&QAbstractButton::clicked,this,&Themes::progressColorWrite_clicked); + connect(uiOptions->progressColorRead, &QAbstractButton::clicked,this,&Themes::progressColorRead_clicked); + connect(uiOptions->progressColorRemaining,&QAbstractButton::clicked,this,&Themes::progressColorRemaining_clicked); + connect(uiOptions->alwaysOnTop,&QAbstractButton::clicked,this,&Themes::alwaysOnTop_clickedSlot); + + isInPause(false); + + connect(uiOptions->limitSpeed, static_cast(&QSpinBox::valueChanged), this, &Themes::uiUpdateSpeed); + connect(uiOptions->checkBox_limitSpeed,&QAbstractButton::toggled, this, &Themes::uiUpdateSpeed); + + connect(ui->actionAddFile,&QAction::triggered,this,&Themes::forcedModeAddFile); + connect(ui->actionAddFileToCopy,&QAction::triggered,this,&Themes::forcedModeAddFileToCopy); + connect(ui->actionAddFileToMove,&QAction::triggered,this,&Themes::forcedModeAddFileToMove); + connect(ui->actionAddFolderToCopy,&QAction::triggered,this,&Themes::forcedModeAddFolderToCopy); + connect(ui->actionAddFolderToMove,&QAction::triggered,this,&Themes::forcedModeAddFolderToMove); + connect(ui->actionAddFolder,&QAction::triggered,this,&Themes::forcedModeAddFolder); + connect(ui->exportErrorToTransferList,&QToolButton::triggered,this,&Themes::exportErrorIntoTransferList); + + //setup the search part + closeTheSearchBox(); + TimerForSearch = new QTimer(this); + TimerForSearch->setInterval(500); + TimerForSearch->setSingleShot(true); + searchShortcut = new QShortcut(QKeySequence(QKeySequence::Find),this); + searchShortcut2 = new QShortcut(QKeySequence(QKeySequence::FindNext),this); + searchShortcut3 = new QShortcut(QKeySequence(Qt::Key_Escape),this); + + //connect the search part + connect(TimerForSearch, &QTimer::timeout, this, &Themes::hilightTheSearchSlot); + connect(searchShortcut, &QShortcut::activated, this, &Themes::searchBoxShortcut); + connect(searchShortcut2, &QShortcut::activated, this, &Themes::on_pushButtonSearchNext_clicked); + connect(ui->pushButtonCloseSearch, &QPushButton::clicked, this, &Themes::closeTheSearchBox); + connect(searchShortcut3, &QShortcut::activated, this, &Themes::closeTheSearchBox); + + //reload directly untranslatable text + newLanguageLoaded(); + + //unpush the more button + ui->moreButton->setChecked(moreButtonPushed); + on_moreButton_toggled(moreButtonPushed); + + /// \note important for drag and drop, \see dropEvent() + setAcceptDrops(true); + + // try set the OS icon + if(!iconLoaded) + { + iconLoaded=true; + tempExitIcon=QIcon::fromTheme(QStringLiteral("application-exit")); + editDelete=QIcon::fromTheme(QStringLiteral("edit-delete")); + player_pause=QIcon::fromTheme(QStringLiteral("media-playback-pause")); + if(player_pause.isNull()) + player_pause=QIcon(QStringLiteral(":/Themes/Oxygen/resources/player_pause.png")); + player_play=QIcon::fromTheme(QStringLiteral("media-playback-play")); + if(player_play.isNull()) + player_play=QIcon(QStringLiteral(":/Themes/Oxygen/resources/player_play.png")); + skinIcon=QIcon::fromTheme(QStringLiteral("media-skip-forward")); + editFind=QIcon::fromTheme(QStringLiteral("edit-find")); + documentOpen=QIcon::fromTheme(QStringLiteral("document-open")); + documentSave=QIcon::fromTheme(QStringLiteral("document-save")); + listAdd=QIcon::fromTheme(QStringLiteral("list-add")); + } + if(!tempExitIcon.isNull()) + { + ui->cancelButton->setIcon(tempExitIcon); + ui->pushButtonCloseSearch->setIcon(tempExitIcon); + ui->shutdown->setIcon(tempExitIcon); + } + if(!editDelete.isNull()) + ui->del->setIcon(editDelete); + if(!player_pause.isNull()) + ui->pauseButton->setIcon(player_pause); + if(!skinIcon.isNull()) + ui->skipButton->setIcon(skinIcon); + if(!editFind.isNull()) + ui->searchButton->setIcon(editFind); + if(!documentOpen.isNull()) + ui->importTransferList->setIcon(documentOpen); + if(!documentSave.isNull()) + { + ui->exportTransferList->setIcon(documentSave); + ui->exportErrorToTransferList->setIcon(documentSave); + } + if(!listAdd.isNull()) + { + ui->add->setIcon(listAdd); + ui->actionAddFile->setIcon(listAdd); + ui->actionAddFileToCopy->setIcon(listAdd); + ui->actionAddFileToMove->setIcon(listAdd); + ui->actionAddFolder->setIcon(listAdd); + ui->actionAddFolderToCopy->setIcon(listAdd); + ui->actionAddFolderToMove->setIcon(listAdd); + } + #ifdef Q_OS_WIN32 + pixmapTop=QPixmap(QStringLiteral(":/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png")); + pixmapBottom=QPixmap(QStringLiteral(":/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png")); + #else + pixmapTop=QPixmap(QStringLiteral(":/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png")); + pixmapBottom=QPixmap(QStringLiteral(":/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png")); + #endif + + shutdown=facilityEngine->haveFunctionality(QStringLiteral("shutdown")); + ui->shutdown->setVisible(shutdown); + + selectionModel=ui->TransferList->selectionModel(); + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&transferModel,&TransferModel::debugInformation,this,&Themes::debugInformation); + #endif + + updateSpeed(); + alwaysOnTop_clicked(false); + /*#ifdef Q_OS_WIN32 + uiOptions->labelAlwaysOnTop->hide(); + uiOptions->alwaysOnTop->hide(); + #endif*/ + #ifdef ULTRACOPIER_VERSION_ULTIMATE + ui->ad_ultimate->hide(); + #else + QString ultimateUrl=facilityEngine->ultimateUrl(); + if(ultimateUrl.isEmpty()) + ui->ad_ultimate->hide(); + else + ui->ad_ultimate->setText(QStringLiteral("%2").arg(ultimateUrl).arg(tr("Buy the Ultimate version to fund development"))); + #endif + + show(); + + sysTrayIcon = new QSystemTrayIcon(this); + connect(sysTrayIcon,&QSystemTrayIcon::activated,this,&Themes::catchAction); } -void Themes::uiUpdateSpeed() +Themes::~Themes() { - if(ui->checkBoxShowSpeed->isChecked()) - return; - if(!ui->checkBox_limitSpeed->isChecked()) - currentSpeed=0; - else - currentSpeed=ui->limitSpeed->value(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("emit newSpeedLimitation(%1)").arg(currentSpeed)); - emit newSpeedLimitation(currentSpeed); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + //disconnect(ui->actionAddFile); + //disconnect(ui->actionAddFolder); + delete selectionModel; + delete menu; + delete sysTrayIcon; } QWidget * Themes::getOptionsEngineWidget() { - return &optionEngineWidget; + return &optionEngineWidget; } -void Themes::getOptionsEngineEnabled(bool isEnabled) +void Themes::getOptionsEngineEnabled(const bool &isEnabled) { - if(isEnabled) - ui->tabWidget->addTab(&optionEngineWidget,facilityEngine->translateText("Copy engine")); + if(isEnabled) + { + QScrollArea *scrollArea=new QScrollArea(ui->tabWidget); + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(&optionEngineWidget); + ui->tabWidget->addTab(scrollArea,facilityEngine->translateText(QStringLiteral("Copy engine"))); + } } void Themes::closeEvent(QCloseEvent *event) { - event->ignore(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->hide(); - emit cancel(); + event->ignore(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->hide(); + if(uiOptions->minimizeToSystray->isChecked()) + { + updateSysTrayIcon(); + sysTrayIcon->show(); + } + else + emit cancel(); } -void Themes::updateOverallInformation() +void Themes::updateSysTrayIcon() { - ui->overall->setText(tr("File %1/%2, size: %3/%4").arg(currentFile).arg(totalFile).arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); -} - -void Themes::actionInProgess(EngineActionInProgress action) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"start: "+QString::number(action)); - this->action=action; - switch(action) - { - case Copying: - case CopyingAndListing: - ui->progressBar_all->setMaximum(65535); - ui->progressBar_all->setMinimum(0); - break; - case Listing: - ui->progressBar_all->setMaximum(0); - ui->progressBar_all->setMinimum(0); - break; - case Idle: - if(haveStarted) - { - if(shutdown && ui->shutdown->isChecked()) - { - facilityEngine->callFunctionality("shutdown"); - return; - } - switch(ui->comboBox_copyEnd->currentIndex()) - { - case 2: - emit cancel(); - break; - case 0: - if(!haveError) - emit cancel(); - break; - default: - break; - } - } - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Very wrong switch case!"); - break; - } - switch(action) - { - case Copying: - case CopyingAndListing: - ui->pauseButton->setEnabled(true); - haveStarted=true; - ui->cancelButton->setText(facilityEngine->translateText("Quit")); - break; - case Idle: - ui->pauseButton->setEnabled(false); - break; - default: - break; - } + if(totalSize==0) + { + sysTrayIcon->setIcon(dynaIcon(0,QStringLiteral("-"))); + return; + } + quint64 currentNew=currentSize*100; + //update systray icon + quint16 getVarProgression=currentNew/totalSize; + if(getOldProgression!=getVarProgression) + { + getOldProgression=getVarProgression; + sysTrayIcon->setIcon(dynaIcon(getVarProgression)); + } } -void Themes::newFolderListing(const QString &path) +void Themes::updateOverallInformation() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(action==Listing) - ui->from->setText(path); + if(uiOptions->showProgressionInTheTitle->isChecked()) + updateTitle(); + ui->overall->setText(tr("File %1/%2, size: %3/%4").arg(currentFile).arg(totalFile).arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); } -void Themes::detectedSpeed(const quint64 &speed)//in byte per seconds +void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) { - ui->currentSpeed->setText(facilityEngine->speedToString(speed)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("start: ")+QString::number(action)); + this->action=action; + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->progressBar_all->setMaximum(65535); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Listing: + ui->progressBar_all->setMaximum(0); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Idle: + ui->progressBar_all->setMaximum(65535); + ui->progressBar_all->setMinimum(0); + if(haveStarted && transferModel.rowCount()<=0) + { + if(shutdown && ui->shutdown->isChecked()) + { + facilityEngine->callFunctionality(QStringLiteral("shutdown")); + return; + } + switch(uiOptions->comboBox_copyEnd->currentIndex()) + { + case 2: + emit cancel(); + break; + case 0: + if(!haveError) + emit cancel(); + else + ui->tabWidget->setCurrentWidget(ui->tab_error); + break; + default: + break; + } + stat = status_stopped; + if(durationStarted) + { + Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(duration.elapsed()/1000); + ui->labelTimeRemaining->setText(QStringLiteral("")+facilityEngine->translateText(QStringLiteral("Completed in %1")).arg( + QString::number(time.hour)+QStringLiteral(":")+QString::number(time.minute).rightJustified(2,'0')+QStringLiteral(":")+QString::number(time.second).rightJustified(2,'0') + )+QStringLiteral("")); + } + } + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Very wrong switch case!"); + break; + } + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->pauseButton->setEnabled(true); + if(!durationStarted) + { + duration.start(); + durationStarted=true; + } + haveStarted=true; + ui->cancelButton->setText(facilityEngine->translateText(QStringLiteral("Quit"))); + updatePause(); + break; + case Ultracopier::Listing: + ui->pauseButton->setEnabled(false); + haveStarted=true;//to close if skip at root folder collision + break; + case Ultracopier::Idle: + ui->pauseButton->setEnabled(false); + break; + default: + break; + } } -void Themes::remainingTime(const int &remainingSeconds) +void Themes::newFolderListing(const QString &path) { - QString labelTimeRemaining(""+facilityEngine->translateText("Time remaining:")+" "); - if(remainingSeconds==-1) - labelTimeRemaining+="∞"; - else - { - TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); - labelTimeRemaining+=QString::number(time.hour)+":"+QString::number(time.minute)+":"+QString::number(time.second); - } - labelTimeRemaining+=""; - ui->labelTimeRemaining->setText(labelTimeRemaining); + QString newPath=path; + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(action==Ultracopier::Listing) + ui->from->setText(newPath); } -void Themes::newCollisionAction(const QString &action) +void Themes::detectedSpeed(const quint64 &speed)//in byte per seconds { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(ui->comboBox_fileCollisions->findData(action)!=-1) - ui->comboBox_fileCollisions->setCurrentIndex(ui->comboBox_fileCollisions->findData(action)); + if(uiOptions->speedWithProgressBar->isChecked()) + { + quint64 tempSpeed=speed; + if(tempSpeed>999999999) + tempSpeed=999999999; + if(tempSpeed>(quint64)ui->progressBarCurrentSpeed->maximum()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set max speed to: %1").arg(tempSpeed)); + ui->progressBarCurrentSpeed->setMaximum(tempSpeed); + } + ui->progressBarCurrentSpeed->setValue(tempSpeed); + ui->progressBarCurrentSpeed->setFormat(facilityEngine->speedToString(speed)); + } + else + ui->currentSpeed->setText(facilityEngine->speedToString(speed)); } -void Themes::newErrorAction(const QString &action) +void Themes::remainingTime(const int &remainingSeconds) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(ui->comboBox_copyErrors->findData(action)!=-1) - ui->comboBox_copyErrors->setCurrentIndex(ui->comboBox_copyErrors->findData(action)); + QString labelTimeRemaining(QStringLiteral("")+facilityEngine->translateText(QStringLiteral("Time remaining:"))+QStringLiteral(" ")); + if(remainingSeconds==-1) + labelTimeRemaining+=QStringLiteral("∞"); + else + { + Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); + labelTimeRemaining+=QString::number(time.hour)+QStringLiteral(":")+QString::number(time.minute).rightJustified(2,'0')+QStringLiteral(":")+QString::number(time.second).rightJustified(2,'0'); + } + labelTimeRemaining+=QStringLiteral(""); + ui->labelTimeRemaining->setText(labelTimeRemaining); } void Themes::errorDetected() { - haveError=true; + haveError=true; } -//speed limitation -bool Themes::setSpeedLimitation(const qint64 &speedLimitation) +/// \brief new error +void Themes::errorToRetry(const QString &source,const QString &destination,const QString &error) { - currentSpeed=speedLimitation; - updateSpeed(); - return true; + ui->errorList->addTopLevelItem(new QTreeWidgetItem(QStringList() << source << destination << error)); } -//get information about the copy -void Themes::setGeneralProgression(const quint64 ¤t,const quint64 &total) +/** \brief support speed limitation */ +void Themes::setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) { - currentSize=current; - totalSize=total; - if(total>0) - { - int newIndicator=((double)current/total)*65535; - ui->progressBar_all->setValue(newIndicator); - } - else - ui->progressBar_all->setValue(0); + if(!supportSpeedLimitationBool) + { + ui->label_Slider_speed->setVisible(false); + ui->SliderSpeed->setVisible(false); + ui->label_SpeedMaxValue->setVisible(false); + uiOptions->labelShowSpeedAsMain->setVisible(false); + uiOptions->checkBoxShowSpeed->setVisible(false); + } + else + emit newSpeedLimitation(currentSpeed); } -void Themes::setFileProgression(const QList &progressionList) -{ - QList progressionListBis=progressionList; - transferModel.setFileProgression(progressionListBis); - updateCurrentFileInformation(); -} - -void Themes::setCollisionAction(const QList > &list) +//get information about the copy +void Themes::setGeneralProgression(const quint64 ¤t,const quint64 &total) { - ui->comboBox_fileCollisions->clear(); - index=0; - loop_size=list.size(); - while(indexcomboBox_fileCollisions->addItem(list.at(index).first,list.at(index).second); - index++; - } + currentSize=current; + totalSize=total; + if(total>0) + { + int newIndicator=((double)current/total)*65535; + ui->progressBar_all->setValue(newIndicator); + } + else + ui->progressBar_all->setValue(0); + if(current>0) + stat = status_started; + updateOverallInformation(); + if(isHidden()) + updateSysTrayIcon(); } -void Themes::setErrorAction(const QList > &list) +void Themes::setFileProgression(const QList &progressionList) { - ui->comboBox_fileCollisions->clear(); - index=0; - loop_size=list.size(); - while(indexcomboBox_copyErrors->addItem(list.at(index).first,list.at(index).second); - index++; - } + QList progressionListBis=progressionList; + transferModel.setFileProgression(progressionListBis); + updateCurrentFileInformation(); } //edit the transfer list /// \todo check and re-enable to selection -void Themes::getActionOnList(const QList &returnActions) +void Themes::getActionOnList(const QList &returnActions) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, returnActions.size(): "+QString::number(returnActions.size())); - QList returnValue=transferModel.synchronizeItems(returnActions); - totalFile+=returnValue[0]; - totalSize+=returnValue[1]; - currentFile+=returnValue[2]; - if(transferModel.rowCount()==0) - { - ui->skipButton->setEnabled(false); - ui->progressBar_all->setValue(65535); - ui->progressBar_file->setValue(65535); - currentSize=totalSize; - } - else - ui->skipButton->setEnabled(true); - updateOverallInformation(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"transferModel.rowCount(): "+QString::number(transferModel.rowCount())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, returnActions.size(): ")+QString::number(returnActions.size())); + QList returnValue=transferModel.synchronizeItems(returnActions); + totalFile+=returnValue.first(); + totalSize+=returnValue.at(1); + currentFile+=returnValue.last(); + if(transferModel.rowCount()==0) + { + ui->skipButton->setEnabled(false); + ui->progressBar_all->setValue(65535); + ui->progressBar_file->setValue(65535); + currentSize=totalSize; + if(isHidden()) + updateSysTrayIcon(); + } + else + ui->skipButton->setEnabled(true); + updateOverallInformation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("transferModel.rowCount(): ")+QString::number(transferModel.rowCount())); } -void Themes::setCopyType(CopyType type) +void Themes::setCopyType(const Ultracopier::CopyType &type) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->type=type; - updateModeAndType(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->type=type; + updateModeAndType(); } -void Themes::forceCopyMode(CopyMode mode) +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - modeIsForced=true; - this->mode=mode; - if(mode==Copy) - this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Copy")); - else - this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Move")); - updateModeAndType(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + modeIsForced=true; + this->mode=mode; + if(mode==Ultracopier::Copy) + ui->tabWidget->setTabText(0,tr("Copy list")); + else + ui->tabWidget->setTabText(0,tr("Move list")); + updateModeAndType(); + updateTitle(); } -void Themes::setTransferListOperation(TransferListOperation transferListOperation) +void Themes::setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) { - ui->exportTransferList->setVisible(transferListOperation & TransferListOperation_Export); - ui->importTransferList->setVisible(transferListOperation & TransferListOperation_Import); + ui->exportTransferList->setVisible(transferListOperation & Ultracopier::TransferListOperation_Export); + ui->importTransferList->setVisible(transferListOperation & Ultracopier::TransferListOperation_Import); } void Themes::haveExternalOrder() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); // ui->moreButton->toggle(); } -void Themes::isInPause(bool isInPause) +void Themes::isInPause(const bool &isInPause) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"isInPause: "+QString::number(isInPause)); - //resume in auto the pause - storeIsInPause=isInPause; - if(isInPause) - { - ui->pauseButton->setIcon(player_play); - ui->pauseButton->setText(facilityEngine->translateText("Resume")); - } - else - { - ui->pauseButton->setIcon(player_pause); - if(haveStarted) - ui->pauseButton->setText(facilityEngine->translateText("Pause")); - else - ui->pauseButton->setText(facilityEngine->translateText("Start")); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("isInPause: ")+QString::number(isInPause)); + //resume in auto the pause + storeIsInPause=isInPause; + updatePause(); +} + +void Themes::updatePause() +{ + if(storeIsInPause) + { + ui->pauseButton->setIcon(player_play); + if(stat == status_started) + ui->pauseButton->setText(facilityEngine->translateText(QStringLiteral("Resume"))); + else + ui->pauseButton->setText(facilityEngine->translateText(QStringLiteral("Start"))); + } + else + { + ui->pauseButton->setIcon(player_pause); + ui->pauseButton->setText(facilityEngine->translateText(QStringLiteral("Pause"))); + } } void Themes::updateCurrentFileInformation() { - TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); - if(transfertItem.haveItem) - { - ui->from->setText(transfertItem.from); - ui->to->setText(transfertItem.to); - ui->current_file->setText(transfertItem.current_file); - if(transfertItem.progressBar_file!=-1) - { - ui->progressBar_file->setRange(0,65535); - ui->progressBar_file->setValue(transfertItem.progressBar_file); - } - else - ui->progressBar_file->setRange(0,0); - } - else - { - ui->from->setText(""); - ui->to->setText(""); - ui->current_file->setText("-"); - if(haveStarted && transferModel.rowCount()==0) - ui->progressBar_file->setValue(65535); - else if(!haveStarted) - ui->progressBar_file->setValue(0); - } + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + QString newPath=transfertItem.from; + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ui->from->setText(newPath); + newPath=transfertItem.to; + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ui->to->setText(newPath); + ui->current_file->setText(transfertItem.current_file); + if(transfertItem.progressBar_read!=-1) + { + ui->progressBar_file->setRange(0,65535); + if(uiOptions->showDualProgression->isChecked()) + { + if(transfertItem.progressBar_read!=transfertItem.progressBar_write) + { + float permilleread=round((float)transfertItem.progressBar_read/65535*1000)/1000; + float permillewrite=permilleread-0.001; + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border: 1px solid grey;text-align: center;background-color: qlineargradient(spread:pad, x1:%1, y1:0, x2:%2, y2:0, stop:0 %3, stop:1 %4);}QProgressBar::chunk{background-color:%5;}") + .arg(permilleread) + .arg(permillewrite) + .arg(progressColorRemaining.name()) + .arg(progressColorRead.name()) + .arg(progressColorWrite.name()) + ); + } + else + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setValue(transfertItem.progressBar_write); + } + else + ui->progressBar_file->setValue((transfertItem.progressBar_read+transfertItem.progressBar_write)/2); + } + else + ui->progressBar_file->setRange(0,0); + } + else + { + ui->from->setText(QStringLiteral("")); + ui->to->setText(QStringLiteral("")); + ui->current_file->setText(QStringLiteral("-")); + if(haveStarted && transferModel.rowCount()==0) + ui->progressBar_file->setValue(65535); + else if(!haveStarted) + ui->progressBar_file->setValue(0); + } } void Themes::on_putOnTop_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - selectedItems=selectionModel->selectedRows(); - ids.clear(); - index=0; - loop_size=selectedItems.size(); - while(index0) - emit moveItemsOnTop(ids); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsOnTop(ids); } void Themes::on_pushUp_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - selectedItems=selectionModel->selectedRows(); - ids.clear(); - index=0; - loop_size=selectedItems.size(); - while(index0) - emit moveItemsUp(ids); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsUp(ids); } void Themes::on_pushDown_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - selectedItems=selectionModel->selectedRows(); - ids.clear(); - index=0; - loop_size=selectedItems.size(); - while(index0) - emit moveItemsDown(ids); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsDown(ids); } void Themes::on_putOnBottom_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - selectedItems=selectionModel->selectedRows(); - ids.clear(); - index=0; - loop_size=selectedItems.size(); - while(index0) - emit moveItemsOnBottom(ids); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit moveItemsOnBottom(ids); } void Themes::on_del_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - selectedItems=selectionModel->selectedRows(); - ids.clear(); - index=0; - loop_size=selectedItems.size(); - while(index0) - emit removeItems(ids); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + selectedItems=selectionModel->selectedRows(); + QList ids; + int index=0; + const int &loop_size=selectedItems.size(); + while(index0) + emit removeItems(ids); } void Themes::on_cancelButton_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->hide(); - emit cancel(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + this->hide(); + emit cancel(); +} + + +void Themes::speedWithProgressBar_toggled(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ui->progressBarCurrentSpeed->setVisible(checked); + ui->currentSpeed->setVisible(!checked); } -void Themes::on_checkBoxShowSpeed_toggled(bool checked) +void Themes::showDualProgression_toggled(bool checked) { - Q_UNUSED(checked); - updateSpeed(); + Q_UNUSED(checked); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + updateProgressionColorBar(); +} + +void Themes::checkBoxShowSpeed_toggled(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + Q_UNUSED(checked); + updateSpeed(); } void Themes::on_SliderSpeed_valueChanged(int value) { - if(!ui->checkBoxShowSpeed->isChecked()) - return; - switch(value) - { - case 0: - currentSpeed=0; - break; - case 1: - currentSpeed=1024; - break; - case 2: - currentSpeed=1024*4; - break; - case 3: - currentSpeed=1024*16; - break; - case 4: - currentSpeed=1024*64; - break; - case 5: - currentSpeed=1024*128; - break; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("value: %1").arg(value)); - emit newSpeedLimitation(currentSpeed); - updateSpeed(); + if(!uiOptions->checkBoxShowSpeed->isChecked()) + return; + switch(value) + { + case 0: + currentSpeed=0; + break; + case 1: + currentSpeed=1024; + break; + case 2: + currentSpeed=1024*4; + break; + case 3: + currentSpeed=1024*16; + break; + case 4: + currentSpeed=1024*64; + break; + case 5: + currentSpeed=1024*128; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("value: %1").arg(value)); + emit newSpeedLimitation(currentSpeed); + updateSpeed(); +} + +void Themes::uiUpdateSpeed() +{ + if(uiOptions->checkBoxShowSpeed->isChecked()) + return; + if(!uiOptions->checkBox_limitSpeed->isChecked()) + currentSpeed=0; + else + currentSpeed=uiOptions->limitSpeed->value(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("emit newSpeedLimitation(%1)").arg(currentSpeed)); + emit newSpeedLimitation(currentSpeed); } void Themes::updateSpeed() { - ui->groupBoxSpeedLimit->setVisible(!ui->checkBoxShowSpeed->isChecked()); - ui->label_Slider_speed->setVisible(ui->checkBoxShowSpeed->isChecked()); - ui->SliderSpeed->setVisible(ui->checkBoxShowSpeed->isChecked()); - ui->label_SpeedMaxValue->setVisible(ui->checkBoxShowSpeed->isChecked()); - - if(ui->checkBoxShowSpeed->isChecked()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"checked"); - ui->limitSpeed->setEnabled(false); - if(currentSpeed==0) - { - ui->SliderSpeed->setValue(0); - ui->label_SpeedMaxValue->setText(facilityEngine->translateText("Unlimited")); - } - else if(currentSpeed<=1024) - { - if(currentSpeed!=1024) - { - currentSpeed=1024; - emit newSpeedLimitation(currentSpeed); - } - ui->SliderSpeed->setValue(1); - ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*1)); - } - else if(currentSpeed<=1024*4) - { - if(currentSpeed!=1024*4) - { - currentSpeed=1024*4; - emit newSpeedLimitation(currentSpeed); - } - ui->SliderSpeed->setValue(2); - ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*4)); - } - else if(currentSpeed<=1024*16) - { - if(currentSpeed!=1024*16) - { - currentSpeed=1024*16; - emit newSpeedLimitation(currentSpeed); - } - ui->SliderSpeed->setValue(3); - ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*16)); - } - else if(currentSpeed<=1024*64) - { - if(currentSpeed!=1024*64) - { - currentSpeed=1024*64; - emit newSpeedLimitation(currentSpeed); - } - ui->SliderSpeed->setValue(4); - ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*64)); - } - else - { - if(currentSpeed!=1024*128) - { - currentSpeed=1024*128; - emit newSpeedLimitation(currentSpeed); - } - ui->SliderSpeed->setValue(5); - ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*128)); - } - } - else - { - ui->checkBox_limitSpeed->setChecked(currentSpeed>0); - if(currentSpeed>0) - ui->limitSpeed->setValue(currentSpeed); - ui->checkBox_limitSpeed->setEnabled(currentSpeed!=-1); - ui->limitSpeed->setEnabled(ui->checkBox_limitSpeed->isChecked()); - } + ui->label_Slider_speed->setVisible(uiOptions->checkBoxShowSpeed->isChecked()); + ui->SliderSpeed->setVisible(uiOptions->checkBoxShowSpeed->isChecked()); + ui->label_SpeedMaxValue->setVisible(uiOptions->checkBoxShowSpeed->isChecked()); + uiOptions->limitSpeed->setVisible(!uiOptions->checkBoxShowSpeed->isChecked()); + uiOptions->checkBox_limitSpeed->setVisible(!uiOptions->checkBoxShowSpeed->isChecked()); + + if(uiOptions->checkBoxShowSpeed->isChecked()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("checked, currentSpeed: %1").arg(currentSpeed)); + uiOptions->limitSpeed->setEnabled(false); + if(currentSpeed==0) + { + ui->SliderSpeed->setValue(0); + ui->label_SpeedMaxValue->setText(facilityEngine->translateText(QStringLiteral("Unlimited"))); + } + else if(currentSpeed<=1024) + { + if(currentSpeed!=1024) + { + currentSpeed=1024; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(1); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*1)); + } + else if(currentSpeed<=1024*4) + { + if(currentSpeed!=1024*4) + { + currentSpeed=1024*4; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(2); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*4)); + } + else if(currentSpeed<=1024*16) + { + if(currentSpeed!=1024*16) + { + currentSpeed=1024*16; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(3); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*16)); + } + else if(currentSpeed<=1024*64) + { + if(currentSpeed!=1024*64) + { + currentSpeed=1024*64; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(4); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*64)); + } + else + { + if(currentSpeed!=1024*128) + { + currentSpeed=1024*128; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(5); + ui->label_SpeedMaxValue->setText(facilityEngine->speedToString((double)(1024*1024)*128)); + } + } + else + { + uiOptions->checkBox_limitSpeed->setChecked(currentSpeed>0); + if(currentSpeed>0) + uiOptions->limitSpeed->setValue(currentSpeed); + uiOptions->checkBox_limitSpeed->setEnabled(currentSpeed!=-1); + uiOptions->limitSpeed->setEnabled(uiOptions->checkBox_limitSpeed->isChecked()); + } } void Themes::on_pauseButton_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(storeIsInPause) - emit resume(); - else - emit pause(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(storeIsInPause) + emit resume(); + else + emit pause(); } void Themes::on_skipButton_clicked() { - TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); - if(transfertItem.haveItem) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip at running: %1").arg(transfertItem.id)); - emit skip(transfertItem.id); - } - else - { - if(transferModel.rowCount()>1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip at idle: %1").arg(transferModel.firstId())); - emit skip(transferModel.firstId()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); - } + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at running: %1").arg(transfertItem.id)); + emit skip(transfertItem.id); + } + else + { + if(transferModel.rowCount()>1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at idle: %1").arg(transferModel.firstId())); + emit skip(transferModel.firstId()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); + } } void Themes::updateModeAndType() { - menu->clear(); - if(modeIsForced) - { - menu->addAction(ui->actionAddFile); - if(type==FileAndFolder) - menu->addAction(ui->actionAddFolder); - } - else - { - menu->addAction(ui->actionAddFileToCopy); - menu->addAction(ui->actionAddFileToMove); - if(type==FileAndFolder) - { - menu->addAction(ui->actionAddFolderToCopy); - menu->addAction(ui->actionAddFolderToMove); - } - } + menu->clear(); + if(modeIsForced) + { + menu->addAction(ui->actionAddFile); + if(type==Ultracopier::FileAndFolder) + menu->addAction(ui->actionAddFolder); + } + else + { + menu->addAction(ui->actionAddFileToCopy); + menu->addAction(ui->actionAddFileToMove); + if(type==Ultracopier::FileAndFolder) + { + menu->addAction(ui->actionAddFolderToCopy); + menu->addAction(ui->actionAddFolderToMove); + } + } } void Themes::forcedModeAddFile() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(mode); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFile(mode); } void Themes::forcedModeAddFolder() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(mode); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFolder(mode); } void Themes::forcedModeAddFileToCopy() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(Copy); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFile(Ultracopier::Copy); } void Themes::forcedModeAddFolderToCopy() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(Copy); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFolder(Ultracopier::Copy); } void Themes::forcedModeAddFileToMove() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(Move); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFile(Ultracopier::Move); } void Themes::forcedModeAddFolderToMove() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(Move); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + emit userAddFolder(Ultracopier::Move); } void Themes::newLanguageLoaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(modeIsForced) - forceCopyMode(mode); - ui->retranslateUi(this); - if(!haveStarted) - ui->current_file->setText(tr("File Name, 0KB")); - else - updateCurrentFileInformation(); - updateOverallInformation(); - updateSpeed(); - ui->tabWidget->setTabText(4,facilityEngine->translateText("Copy engine")); - on_moreButton_toggled(ui->moreButton->isChecked()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + if(modeIsForced) + forceCopyMode(mode); + ui->retranslateUi(this); + uiOptions->retranslateUi(this); + uiOptions->comboBox_copyEnd->setItemText(0,tr("Don't close if errors are found")); + uiOptions->comboBox_copyEnd->setItemText(1,tr("Never close")); + uiOptions->comboBox_copyEnd->setItemText(2,tr("Always close")); + if(!haveStarted) + ui->current_file->setText(tr("File Name, 0KB")); + else + updateCurrentFileInformation(); + updateOverallInformation(); + updateSpeed(); + if(ui->tabWidget->count()>=4) + ui->tabWidget->setTabText(ui->tabWidget->count()-1,facilityEngine->translateText(QStringLiteral("Copy engine"))); + on_moreButton_toggled(ui->moreButton->isChecked()); } void Themes::on_pushButtonCloseSearch_clicked() { - closeTheSearchBox(); + closeTheSearchBox(); } //close the search box void Themes::closeTheSearchBox() { - currentIndexSearch = -1; - ui->lineEditSearch->clear(); - ui->lineEditSearch->hide(); - ui->pushButtonSearchPrev->hide(); - ui->pushButtonSearchNext->hide(); - ui->pushButtonCloseSearch->hide(); - ui->searchButton->setChecked(false); - hilightTheSearch(); + currentIndexSearch = -1; + ui->lineEditSearch->clear(); + ui->lineEditSearch->hide(); + ui->pushButtonSearchPrev->hide(); + ui->pushButtonSearchNext->hide(); + ui->pushButtonCloseSearch->hide(); + ui->searchButton->setChecked(false); + hilightTheSearch(); } //search box shortcut void Themes::searchBoxShortcut() { /* if(ui->lineEditSearch->isHidden()) - {*/ - ui->lineEditSearch->show(); - ui->pushButtonSearchPrev->show(); - ui->pushButtonSearchNext->show(); - ui->pushButtonCloseSearch->show(); - ui->lineEditSearch->setFocus(Qt::ShortcutFocusReason); - ui->searchButton->setChecked(true); + {*/ + ui->lineEditSearch->show(); + ui->pushButtonSearchPrev->show(); + ui->pushButtonSearchNext->show(); + ui->pushButtonCloseSearch->show(); + ui->lineEditSearch->setFocus(Qt::ShortcutFocusReason); + ui->searchButton->setChecked(true); /* } - else - closeTheSearchBox();*/ + else + closeTheSearchBox();*/ } //hilight the search void Themes::hilightTheSearch(bool searchNext) { - int result=transferModel.search(ui->lineEditSearch->text(),searchNext); - if(ui->lineEditSearch->text().isEmpty()) - ui->lineEditSearch->setStyleSheet(""); - else - { - if(result==-1) - ui->lineEditSearch->setStyleSheet("background-color: rgb(255, 150, 150);"); - else - { - ui->lineEditSearch->setStyleSheet("background-color: rgb(193,255,176);"); - ui->TransferList->scrollTo(transferModel.index(result,0)); - } - } + int result=transferModel.search(ui->lineEditSearch->text(),searchNext); + if(ui->lineEditSearch->text().isEmpty()) + ui->lineEditSearch->setStyleSheet(""); + else + { + if(result==-1) + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(255, 150, 150);")); + else + { + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(193,255,176);")); + ui->TransferList->scrollTo(transferModel.index(result,0)); + } + } +} + +void Themes::hilightTheSearchSlot() +{ + hilightTheSearch(); } void Themes::on_pushButtonSearchPrev_clicked() { - int result=transferModel.searchPrev(ui->lineEditSearch->text()); - if(ui->lineEditSearch->text().isEmpty()) - ui->lineEditSearch->setStyleSheet(""); - else - { - if(result==-1) - ui->lineEditSearch->setStyleSheet("background-color: rgb(255, 150, 150);"); - else - { - ui->lineEditSearch->setStyleSheet("background-color: rgb(193,255,176);"); - ui->TransferList->scrollTo(transferModel.index(result,0)); - } - } + int result=transferModel.searchPrev(ui->lineEditSearch->text()); + if(ui->lineEditSearch->text().isEmpty()) + ui->lineEditSearch->setStyleSheet(""); + else + { + if(result==-1) + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(255, 150, 150);")); + else + { + ui->lineEditSearch->setStyleSheet(QStringLiteral("background-color: rgb(193,255,176);")); + ui->TransferList->scrollTo(transferModel.index(result,0)); + } + } } void Themes::on_pushButtonSearchNext_clicked() { - hilightTheSearch(true); + hilightTheSearch(true); } void Themes::on_lineEditSearch_returnPressed() { - hilightTheSearch(); + hilightTheSearch(); } void Themes::on_lineEditSearch_textChanged(QString text) { - if(text=="") - { - TimerForSearch->stop(); - hilightTheSearch(); - } - else - TimerForSearch->start(); + if(text=="") + { + TimerForSearch->stop(); + hilightTheSearch(); + } + else + TimerForSearch->start(); } void Themes::on_moreButton_toggled(bool checked) { - if(checked) - this->setMaximumHeight(16777215); - else - this->setMaximumHeight(130); - // usefull under windows - this->updateGeometry(); - this->update(); - this->adjustSize(); -} - -void Themes::on_comboBox_copyErrors_currentIndexChanged(int index) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit sendErrorAction(ui->comboBox_copyErrors->itemData(index).toString()); -} - -void Themes::on_comboBox_fileCollisions_currentIndexChanged(int index) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit sendCollisionAction(ui->comboBox_fileCollisions->itemData(index).toString()); + if(checked) + this->setMaximumHeight(16777215); + else + this->setMaximumHeight(130); + // usefull under windows + this->updateGeometry(); + this->update(); + this->adjustSize(); } /* drag event processing @@ -867,45 +1075,306 @@ void dragLeaveEvent(QDragLeaveEvent* event); */ void Themes::dropEvent(QDropEvent *event) { - const QMimeData* mimeData = event->mimeData(); - if(mimeData->hasUrls()) - { - emit urlDropped(mimeData->urls()); - event->acceptProposedAction(); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("hasUrls")); + emit urlDropped(mimeData->urls()); + event->acceptProposedAction(); + } } void Themes::dragEnterEvent(QDragEnterEvent* event) { - // if some actions should not be usable, like move, this code must be adopted - event->acceptProposedAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + // if some actions should not be usable, like move, this code must be adopted + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("hasUrls")); + event->acceptProposedAction(); + } } void Themes::dragMoveEvent(QDragMoveEvent* event) { - // if some actions should not be usable, like move, this code must be adopted - event->acceptProposedAction(); + // if some actions should not be usable, like move, this code must be adopted + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + event->acceptProposedAction(); } void Themes::dragLeaveEvent(QDragLeaveEvent* event) { - event->accept(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + event->accept(); } void Themes::on_searchButton_toggled(bool checked) { - if(checked) - searchBoxShortcut(); - else - closeTheSearchBox(); + if(checked) + searchBoxShortcut(); + else + closeTheSearchBox(); } void Themes::on_exportTransferList_clicked() { - emit exportTransferList(); + emit exportTransferList(); } void Themes::on_importTransferList_clicked() { - emit importTransferList(); + emit importTransferList(); +} + +void Themes::progressColorWrite_clicked() +{ + QColor color=QColorDialog::getColor(progressColorWrite,this,tr("Select a color")); + if(!color.isValid()) + return; + progressColorWrite=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorWrite); + uiOptions->progressColorWrite->setIcon(pixmap); + updateProgressionColorBar(); +} + +void Themes::progressColorRead_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRead,this,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRead=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRead); + uiOptions->progressColorRead->setIcon(pixmap); + updateProgressionColorBar(); +} + +void Themes::progressColorRemaining_clicked() +{ + QColor color=QColorDialog::getColor(progressColorRemaining,this,tr("Select a color")); + if(!color.isValid()) + return; + progressColorRemaining=color; + QPixmap pixmap(75,20); + pixmap.fill(progressColorRemaining); + uiOptions->progressColorRemaining->setIcon(pixmap); + updateProgressionColorBar(); +} + +void Themes::alwaysOnTop_clicked(bool reshow) +{ + Qt::WindowFlags flags = windowFlags(); + #ifdef Q_OS_WIN32 + if(uiOptions->alwaysOnTop->isChecked()) + SetWindowPos((HWND)this->winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + else + SetWindowPos((HWND)this->winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + #endif + #ifdef Q_OS_LINUX + if(uiOptions->alwaysOnTop->isChecked()) + flags=flags | Qt::X11BypassWindowManagerHint; + else + flags=flags & ~Qt::X11BypassWindowManagerHint; + #endif + if(uiOptions->alwaysOnTop->isChecked()) + flags=flags | Qt::WindowStaysOnTopHint; + else + flags=flags & ~Qt::WindowStaysOnTopHint; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"uiOptions->alwaysOnTop->isChecked(): "+QString::number(uiOptions->alwaysOnTop->isChecked())+", flags: "+QString::number(flags)); + setWindowFlags(flags); + if(reshow) + show(); +} + +void Themes::alwaysOnTop_clickedSlot() +{ + alwaysOnTop_clicked(true); +} + +void Themes::updateProgressionColorBar() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + uiOptions->labelProgressionColor->setVisible(uiOptions->showDualProgression->isChecked()); + uiOptions->frameProgressionColor->setVisible(uiOptions->showDualProgression->isChecked()); + if(!uiOptions->showDualProgression->isChecked()) + { + ui->progressBar_all->setStyleSheet(QStringLiteral("")); + ui->progressBar_file->setStyleSheet(QStringLiteral("")); + ui->progressBarCurrentSpeed->setStyleSheet(QStringLiteral("")); + } + else + { + ui->progressBar_all->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBarCurrentSpeed->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + } + if(stat==status_never_started) + updateCurrentFileInformation(); +} + +void Themes::updateTitle() +{ + if(uiOptions->showProgressionInTheTitle->isChecked() && totalSize>0) + { + if(!modeIsForced) + this->setWindowTitle(tr("%1 %2% of %3").arg(facilityEngine->translateText(QStringLiteral("Transfer"))).arg((currentSize*100)/totalSize).arg(facilityEngine->sizeToString(totalSize))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + { + if(mode==Ultracopier::Copy) + this->setWindowTitle(tr("%1 %2% of %3").arg(facilityEngine->translateText(QStringLiteral("Copy"))).arg((currentSize*100)/totalSize).arg(facilityEngine->sizeToString(totalSize))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + this->setWindowTitle(tr("%1 %2% of %3").arg(facilityEngine->translateText(QStringLiteral("Move"))).arg((currentSize*100)/totalSize).arg(facilityEngine->sizeToString(totalSize))+QStringLiteral(" - ")+facilityEngine->softwareName()); + } + } + else + { + if(!modeIsForced) + this->setWindowTitle(QStringLiteral("%1").arg(facilityEngine->translateText(QStringLiteral("Transfer")))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + { + if(mode==Ultracopier::Copy) + this->setWindowTitle(QStringLiteral("%1").arg(facilityEngine->translateText(QStringLiteral("Copy")))+QStringLiteral(" - ")+facilityEngine->softwareName()); + else + this->setWindowTitle(QStringLiteral("%1").arg(facilityEngine->translateText(QStringLiteral("Move")))+QStringLiteral(" - ")+facilityEngine->softwareName()); + } + } +} + +/** \brief Create progessive icon + +Do QIcon with top and bottom image mixed and percent writed on it. +The icon it be search in the style path. +Do by mongaulois, remake by alpha_one_x86. +\param percent indique how many percent need be showed, sould be between 0 and 100 +\param text The showed text if needed (optionnal) +\return QIcon of the final image +\note Can be used as it: dynaIcon(75,"...") +*/ +QIcon Themes::dynaIcon(int percent,QString text) const +{ + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(pixmapTop.isNull() || pixmapBottom.isNull()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error loading the icons"); + #endif + if(percent==-1) + percent=getOldProgression; + if(percent<0) + percent=0; + if(percent>100) + percent=100; + //pixmap avec un fond transparent + #ifdef Q_OS_WIN32 + quint8 imageSize=16; + #else + quint8 imageSize=22; + #endif + QPixmap resultImage(imageSize,imageSize); + resultImage.fill(Qt::transparent); + { + QPainter painter(&resultImage); + #ifndef Q_OS_WIN32 + QFont font(QStringLiteral("Courier New"),9); + font.setBold(true); + font.setKerning(true); + painter.setFont(font); + #endif + #ifdef Q_OS_WIN32 + QFont font(QStringLiteral("Courier New"),8); + font.setBold(true); + font.setKerning(true); + painter.setFont(font); + #endif + + //preprocessing the calcul + quint8 bottomPixel=(percent*imageSize)/100; + quint8 topPixel=imageSize-bottomPixel; + + //top image + if(topPixel>0) + { + QRect target(0, 0, imageSize, topPixel); + QRect source(0, 0, imageSize, topPixel); + painter.drawPixmap(target, pixmapTop, source); + } + + //bottom image + if(bottomPixel>0) + { + QRect target2(0, topPixel, imageSize, bottomPixel); + QRect source2(0, topPixel, imageSize, bottomPixel); + painter.drawPixmap(target2, pixmapBottom, source2); + } + + qint8 textxOffset=0; + qint8 textyOffset=0; + if(text.isEmpty()) + { + if(percent!=100) + text=QString::number(percent); + else + { + text=QStringLiteral(":)"); + #ifdef Q_OS_WIN32 + textyOffset-=2; + #else + textyOffset-=1; + #endif + } + } + if(text.size()==1) + { + textxOffset+=3; + #ifdef Q_OS_WIN32 + textxOffset-=1; + #endif + } + else + { + #ifdef Q_OS_WIN32 + textxOffset-=1; + #endif + } + #ifndef Q_OS_WIN32 + textxOffset+=2; + textyOffset+=3; + #endif + painter.setPen(QPen(Qt::black)); + painter.drawText(3+textxOffset,13+textyOffset,text); + painter.setPen(QPen(Qt::white)); + painter.drawText(2+textxOffset,12+textyOffset,text); + } + return QIcon(resultImage); +} + +/** \brief For catch an action on the systray icon +\param reason Why it activated +*/ +void Themes::catchAction(QSystemTrayIcon::ActivationReason reason) +{ + if(reason==QSystemTrayIcon::DoubleClick || reason==QSystemTrayIcon::Trigger) + { + sysTrayIcon->hide(); + this->show(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Double Click detected"); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("reason: %1").arg(reason)); +} + +void Themes::on_exportErrorToTransferList_clicked() +{ + emit exportErrorIntoTransferList(); } diff --git a/plugins/Themes/Oxygen/interface.h b/plugins/Themes/Oxygen/interface.h old mode 100755 new mode 100644 index 7470520..ee3cadd --- a/plugins/Themes/Oxygen/interface.h +++ b/plugins/Themes/Oxygen/interface.h @@ -1,8 +1,7 @@ /** \file interface.h \brief Define the interface \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef INTERFACE_H #define INTERFACE_H @@ -13,199 +12,211 @@ #include #include #include +#include +#include +#include +#include #include "../../../interface/PluginInterface_Themes.h" #include "ui_interface.h" -#include "ui_options.h" +#include "ui_themesOptions.h" #include "Environment.h" #include "TransferModel.h" // for windows progress bar #ifndef __GNUC__ -#include +# include #endif namespace Ui { - class interfaceCopy; + class interfaceCopy; + class themesOptions; } /// \brief Define the interface class Themes : public PluginInterface_Themes { - Q_OBJECT + Q_OBJECT public: - Themes(bool checkBoxShowSpeed,FacilityInterface * facilityEngine,bool moreButtonPushed); - ~Themes(); - //send information about the copy - /// \brief to set the action in progress - void actionInProgess(EngineActionInProgress); - /// \brief the new folder is listing - void newFolderListing(const QString &path); - /** \brief show the detected speed - * in byte per seconds */ - void detectedSpeed(const quint64 &speed); - /** \brief show the remaining time - * time in seconds */ - void remainingTime(const int &remainingSeconds); - /// \brief set the current collision action - void newCollisionAction(const QString &action); - /// \brief set the current error action - void newErrorAction(const QString &action); - /// \brief set one error is detected - void errorDetected(); - //speed limitation - /** \brief the max speed used - * in byte per seconds, -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - //get information about the copy - /// \brief show the general progression - void setGeneralProgression(const quint64 ¤t,const quint64 &total); - /// \brief show the file progression - void setFileProgression(const QList &progressionList); - /// \brief set collision action - void setCollisionAction(const QList > &); - /// \brief set error action - void setErrorAction(const QList > &); - /// \brief set the copyType -> file or folder - void setCopyType(CopyType); - /// \brief set the copyMove -> copy or move, to force in copy or move, else support both - void forceCopyMode(CopyMode); - /// \brief set if transfer list is exportable/importable - void setTransferListOperation(TransferListOperation transferListOperation); - //edit the transfer list - /// \brief get action on the transfer list (add/move/remove) - void getActionOnList(const QList &returnActions); - /** \brief set if the order is external (like file manager copy) - * to notify the interface, which can hide add folder/filer button */ - void haveExternalOrder(); - /// \brief set if is in pause - void isInPause(bool); - /// \brief get the widget for the copy engine - QWidget * getOptionsEngineWidget(); - /// \brief to set if the copy engine is found - void getOptionsEngineEnabled(bool isEnabled); + Themes(const bool &alwaysOnTop, + const bool &showProgressionInTheTitle, + const QColor &progressColorWrite, + const QColor &progressColorRead, + const QColor &progressColorRemaining, + const bool &showDualProgression, + const quint8 &comboBox_copyEnd, + const bool &speedWithProgressBar, + const qint32 ¤tSpeed, + const bool &checkBoxShowSpeed, + FacilityInterface * facilityEngine, + const bool &moreButtonPushed, + const bool &minimizeToSystray, + const bool &startMinimized); + ~Themes(); + //send information about the copy + /// \brief to set the action in progress + void actionInProgess(const Ultracopier::EngineActionInProgress &); + /// \brief the new folder is listing + void newFolderListing(const QString &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const quint64 &speed); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const QString &action); + /// \brief set the current error action + void newErrorAction(const QString &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const QString &source,const QString &destination,const QString &error); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const quint64 ¤t,const quint64 &total); + /// \brief show the file progression + void setFileProgression(const QList &progressionList); + /// \brief set the copyType -> file or folder + void setCopyType(const Ultracopier::CopyType &); + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + void forceCopyMode(const Ultracopier::CopyMode &); + /// \brief set if transfer list is exportable/importable + void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation); + //edit the transfer list + /// \brief get action on the transfer list (add/move/remove) + void getActionOnList(const QList &returnActions); + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + void haveExternalOrder(); + /// \brief set if is in pause + void isInPause(const bool &); + /// \brief get the widget for the copy engine + QWidget * getOptionsEngineWidget(); + /// \brief to set if the copy engine is found + void getOptionsEngineEnabled(const bool &isEnabled); + enum status{status_never_started,status_started,status_stopped}; + status stat; public slots: - /// \brief set the translate - void newLanguageLoaded(); + /// \brief set the translate + void newLanguageLoaded(); private slots: - void on_putOnTop_clicked(); - void on_pushUp_clicked(); - void on_pushDown_clicked(); - void on_putOnBottom_clicked(); - void on_del_clicked(); - void on_cancelButton_clicked(); - void on_checkBoxShowSpeed_toggled(bool checked); - void on_SliderSpeed_valueChanged(int value); - void on_pauseButton_clicked(); - void on_skipButton_clicked(); - void forcedModeAddFile(); - void forcedModeAddFolder(); - void forcedModeAddFileToCopy(); - void forcedModeAddFolderToCopy(); - void forcedModeAddFileToMove(); - void forcedModeAddFolderToMove(); - void uiUpdateSpeed(); - void on_pushButtonCloseSearch_clicked(); - //close the search box - void closeTheSearchBox(); - //search box shortcut - void searchBoxShortcut(); - //hilight the search - void hilightTheSearch(bool searchNext=false); - //auto connect - void on_pushButtonSearchPrev_clicked(); - void on_pushButtonSearchNext_clicked(); - void on_lineEditSearch_returnPressed(); - void on_lineEditSearch_textChanged(QString text); - void on_moreButton_toggled(bool checked); - void on_comboBox_copyErrors_currentIndexChanged(int index); - void on_comboBox_fileCollisions_currentIndexChanged(int index); - void on_searchButton_toggled(bool checked); - void on_exportTransferList_clicked(); - void on_importTransferList_clicked(); + void on_putOnTop_clicked(); + void on_pushUp_clicked(); + void on_pushDown_clicked(); + void on_putOnBottom_clicked(); + void on_del_clicked(); + void on_cancelButton_clicked(); + void speedWithProgressBar_toggled(bool checked); + void showDualProgression_toggled(bool checked); + void checkBoxShowSpeed_toggled(bool checked); + void on_SliderSpeed_valueChanged(int value); + void on_pauseButton_clicked(); + void on_skipButton_clicked(); + void forcedModeAddFile(); + void forcedModeAddFolder(); + void forcedModeAddFileToCopy(); + void forcedModeAddFolderToCopy(); + void forcedModeAddFileToMove(); + void forcedModeAddFolderToMove(); + void uiUpdateSpeed(); + void on_pushButtonCloseSearch_clicked(); + //close the search box + void closeTheSearchBox(); + //search box shortcut + void searchBoxShortcut(); + //hilight the search + void hilightTheSearch(bool searchNext=false); + void hilightTheSearchSlot(); + //auto connect + void on_pushButtonSearchPrev_clicked(); + void on_pushButtonSearchNext_clicked(); + void on_lineEditSearch_returnPressed(); + void on_lineEditSearch_textChanged(QString text); + void on_moreButton_toggled(bool checked); + void on_searchButton_toggled(bool checked); + void on_exportTransferList_clicked(); + void on_importTransferList_clicked(); + void progressColorWrite_clicked(); + void progressColorRead_clicked(); + void progressColorRemaining_clicked(); + void alwaysOnTop_clicked(bool reshow); + void alwaysOnTop_clickedSlot(); + void updateProgressionColorBar(); + void updateTitle(); + void catchAction(QSystemTrayIcon::ActivationReason reason); + void on_exportErrorToTransferList_clicked(); private: - Ui::interfaceCopy *ui; - quint64 currentFile; - quint64 totalFile; - quint64 currentSize; - quint64 totalSize; - void updateOverallInformation(); - void updateCurrentFileInformation(); - QMenu *menu; - EngineActionInProgress action; - void closeEvent(QCloseEvent *event); - qint64 currentSpeed;///< in KB/s, assume as 0KB/s as default like every where - void updateSpeed(); - bool storeIsInPause; - bool modeIsForced; - CopyType type; - CopyMode mode; - void updateModeAndType(); - bool haveStarted; - bool haveError; - QWidget optionEngineWidget; - QShortcut *searchShortcut; - QShortcut *searchShortcut2; - QShortcut *searchShortcut3; - QTimer *TimerForSearch; - int currentIndexSearch; ///< Current index search in starting at the end - FacilityInterface * facilityEngine; - QIcon player_play,player_pause; - QItemSelectionModel *selectionModel; - QModelIndexList selectedItems; - //temp variables - int loop_size,loop_sub_size,index,indexAction; - QList ids; - quint64 baseRow,addRow,removeRow; - /// \brief the custom transfer model - TransferModel transferModel; - /** \brief drag event processing + QTime duration; + bool durationStarted; + QPixmap pixmapTop,pixmapBottom; + QColor progressColorWrite,progressColorRead,progressColorRemaining; + Ui::interfaceCopy *ui; + Ui::themesOptions *uiOptions; + quint64 currentFile; + quint64 totalFile; + quint64 currentSize; + quint64 totalSize; + quint8 getOldProgression; + QSystemTrayIcon *sysTrayIcon; + void updateOverallInformation(); + void updateCurrentFileInformation(); + QMenu *menu; + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + qint32 currentSpeed;///< in KB/s, assume as 0KB/s as default like every where + void updateSpeed(); + bool storeIsInPause; + bool modeIsForced; + Ultracopier::CopyType type; + Ultracopier::CopyMode mode; + void updateModeAndType(); + bool haveStarted; + bool haveError; + QWidget optionEngineWidget; + QShortcut *searchShortcut; + QShortcut *searchShortcut2; + QShortcut *searchShortcut3; + QTimer *TimerForSearch; + int currentIndexSearch; ///< Current index search in starting at the end + FacilityInterface * facilityEngine; + QItemSelectionModel *selectionModel; + QModelIndexList selectedItems; + /// \brief the custom transfer model + TransferModel transferModel; - need setAcceptDrops(true); into the constructor - need implementation to accept the drop: - void dragEnterEvent(QDragEnterEvent* event); - void dragMoveEvent(QDragMoveEvent* event); - void dragLeaveEvent(QDragLeaveEvent* event); - */ - void dropEvent(QDropEvent *event); - /** \brief accept all event to allow the drag and drop - \see dropEvent() */ - void dragEnterEvent(QDragEnterEvent* event); - /** \brief accept all event to allow the drag and drop - \see dropEvent() */ - void dragMoveEvent(QDragMoveEvent* event); - /** \brief accept all event to allow the drag and drop - \see dropEvent() */ - void dragLeaveEvent(QDragLeaveEvent* event); - //have functionality - bool shutdown; + static QIcon player_play,player_pause,tempExitIcon,editDelete,skinIcon,editFind,documentOpen,documentSave,listAdd; + static bool iconLoaded; + + /** \brief drag event processing + + need setAcceptDrops(true); into the constructor + need implementation to accept the drop: + void dragEnterEvent(QDragEnterEvent* event); + void dragMoveEvent(QDragMoveEvent* event); + void dragLeaveEvent(QDragLeaveEvent* event); + */ + void dropEvent(QDropEvent *event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragEnterEvent(QDragEnterEvent* event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragMoveEvent(QDragMoveEvent* event); + /** \brief accept all event to allow the drag and drop + \see dropEvent() */ + void dragLeaveEvent(QDragLeaveEvent* event); + //have functionality + bool shutdown; + void updatePause(); + QIcon dynaIcon(int percent,QString text="") const; + void updateSysTrayIcon(); signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - //set the transfer list - void removeItems(QList ids); - void moveItemsOnTop(QList ids); - void moveItemsUp(QList ids); - void moveItemsDown(QList ids); - void moveItemsOnBottom(QList ids); - void exportTransferList(); - void importTransferList(); - //user ask ask to add folder (add it with interface ask source/destination) - void userAddFolder(CopyMode); - void userAddFile(CopyMode); - void urlDropped(QList urls); - //action on the copy - void pause(); - void resume(); - void skip(quint64 id); - void cancel(); - //edit the action - void sendCollisionAction(QString action); - void sendErrorAction(QString action); - void newSpeedLimitation(qint64); + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne) const; }; #endif // INTERFACE_H diff --git a/plugins/Themes/Oxygen/interface.pro b/plugins/Themes/Oxygen/interface.pro index dda4098..8ddf147 100644 --- a/plugins/Themes/Oxygen/interface.pro +++ b/plugins/Themes/Oxygen/interface.pro @@ -1,47 +1,59 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets TEMPLATE = lib CONFIG += plugin -HEADERS = interface.h \ - StructEnumDefinition.h \ - factory.h \ +HEADERS = ThemesFactory.h \ + StructEnumDefinition.h \ DebugEngineMacro.h \ Environment.h \ Variable.h \ ../../../interface/PluginInterface_Themes.h \ ../../../interface/FacilityInterface.h \ ../../../interface/OptionInterface.h \ - TransferModel.h -SOURCES = interface.cpp \ - factory.cpp \ - TransferModel.cpp + TransferModel.h \ + interface.h +SOURCES = ThemesFactory.cpp \ + TransferModel.cpp \ + interface.cpp TARGET = $$qtLibraryTarget(interface) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ +TRANSLATIONS += Languages/ar/translation.ts \ Languages/de/translation.ts \ Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ Languages/it/translation.ts \ Languages/ja/translation.ts \ - Languages/id/translation.ts \ - Languages/pl/translation.ts \ - Languages/ru/translation.ts \ - Languages/tr/translation.ts \ - Languages/th/translation.ts \ - Languages/hi/translation.ts \ + Languages/ko/translation.ts \ Languages/nl/translation.ts \ Languages/no/translation.ts \ + Languages/pl/translation.ts \ Languages/pt/translation.ts \ - Languages/ko/translation.ts + Languages/ru/translation.ts \ + Languages/th/translation.ts \ + Languages/tr/translation.ts \ + Languages/zh/translation.ts win32 { - RESOURCES += resources_windows.qrc + RESOURCES += } !win32 { - RESOURCES += resources_unix.qrc + RESOURCES += } -RESOURCES += resources.qrc +!CONFIG(static) { +RESOURCES += \ + interfaceResources.qrc \ + interfaceResources_unix.qrc \ + interfaceResources_windows.qrc +} FORMS += \ interface.ui \ - options.ui + themesOptions.ui diff --git a/plugins/Themes/Oxygen/interface.ui b/plugins/Themes/Oxygen/interface.ui index ae628ba..ef07b17 100644 --- a/plugins/Themes/Oxygen/interface.ui +++ b/plugins/Themes/Oxygen/interface.ui @@ -6,7 +6,7 @@ 0 0 - 483 + 508 448
@@ -14,8 +14,8 @@ Ultracopier
- - :/resources/main.png:/resources/main.png + + :/Themes/Oxygen/resources/main.png:/Themes/Oxygen/resources/main.png @@ -38,23 +38,19 @@ + + + 0 + 0 + + - - - - - - Qt::Horizontal - - - - 40 - 20 - + + Qt::PlainText - + @@ -72,23 +68,19 @@ + + + 0 + 0 + + - - - - - - Qt::Horizontal - - - - 40 - 20 - + + Qt::PlainText - +
@@ -99,26 +91,19 @@ File 0/0, Total: 0KB + + Qt::PlainText + - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">0:0:0</p></body></html> - Qt::RichText Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - true - @@ -130,11 +115,11 @@ p, li { white-space: pre-wrap; }
- Shutdown when is finish + Close on transfer completion - - :/resources/SystemTrayIcon/exit.png:/resources/SystemTrayIcon/exit.png + + :/Themes/Oxygen/resources/SystemTrayIcon/exit.png:/Themes/Oxygen/resources/SystemTrayIcon/exit.png true @@ -164,6 +149,9 @@ p, li { white-space: pre-wrap; } File Name, 0KB + + Qt::PlainText + @@ -179,6 +167,16 @@ p, li { white-space: pre-wrap; } + + + + Qt::RichText + + + true + + + @@ -186,6 +184,12 @@ p, li { white-space: pre-wrap; } + + + 0 + 0 + + 60 @@ -193,22 +197,28 @@ p, li { white-space: pre-wrap; } - 0KB/sec + 0KB/sec - - - Qt::Horizontal - - + + - 40 - 20 + 16777215 + 16 - + + 1 + + + 0 + + + 0KB/sec + + @@ -216,8 +226,8 @@ p, li { white-space: pre-wrap; } &More
- - :/resources/moveDown.png:/resources/moveDown.png + + :/Themes/Oxygen/resources/moveDown.png:/Themes/Oxygen/resources/moveDown.png true @@ -236,8 +246,8 @@ p, li { white-space: pre-wrap; } &Pause - - :/resources/player_pause.png:/resources/player_pause.png + + :/Themes/Oxygen/resources/player_pause.png:/Themes/Oxygen/resources/player_pause.png @@ -250,8 +260,8 @@ p, li { white-space: pre-wrap; } &Skip
- - :/resources/player_end.png:/resources/player_end.png + + :/Themes/Oxygen/resources/player_end.png:/Themes/Oxygen/resources/player_end.png @@ -261,8 +271,8 @@ p, li { white-space: pre-wrap; } &Cancel
- - :/resources/cancel.png:/resources/cancel.png + + :/Themes/Oxygen/resources/cancel.png:/Themes/Oxygen/resources/cancel.png @@ -273,7 +283,7 @@ p, li { white-space: pre-wrap; } - Limit copy speed at: + Limit copy speed to: @@ -290,7 +300,7 @@ p, li { white-space: pre-wrap; } - Unlimited + Unlimited @@ -314,13 +324,9 @@ p, li { white-space: pre-wrap; } 0 - - - - :/styles/kde3/player_playlist.png:/styles/kde3/player_playlist.png - + - Copy list + Transfer list @@ -342,9 +348,12 @@ p, li { white-space: pre-wrap; } 22
+ + Move the selected items to the top + - - :/resources/putOnTop.png:/resources/putOnTop.png + + :/Themes/Oxygen/resources/putOnTop.png:/Themes/Oxygen/resources/putOnTop.png true @@ -365,9 +374,12 @@ p, li { white-space: pre-wrap; } 22 + + Move up the selected items + - - :/resources/moveUp.png:/resources/moveUp.png + + :/Themes/Oxygen/resources/moveUp.png:/Themes/Oxygen/resources/moveUp.png true @@ -388,9 +400,12 @@ p, li { white-space: pre-wrap; } 22 + + Move down the selected items + - - :/resources/moveDown.png:/resources/moveDown.png + + :/Themes/Oxygen/resources/moveDown.png:/Themes/Oxygen/resources/moveDown.png true @@ -411,9 +426,12 @@ p, li { white-space: pre-wrap; } 22 + + Move the selected items to the bottom + - - :/resources/putOnBottom.png:/resources/putOnBottom.png + + :/Themes/Oxygen/resources/putOnBottom.png:/Themes/Oxygen/resources/putOnBottom.png true @@ -434,9 +452,12 @@ p, li { white-space: pre-wrap; } 22 + + Add file/folder + - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png QToolButton::InstantPopup @@ -460,9 +481,12 @@ p, li { white-space: pre-wrap; } 22 + + Delete the selected items + - - :/resources/remove.png:/resources/remove.png + + :/Themes/Oxygen/resources/remove.png:/Themes/Oxygen/resources/remove.png true @@ -484,11 +508,11 @@ p, li { white-space: pre-wrap; } - Ctrl+F + Search - - :/resources/search.png:/resources/search.png + + :/Themes/Oxygen/resources/search.png:/Themes/Oxygen/resources/search.png true @@ -512,9 +536,12 @@ p, li { white-space: pre-wrap; } 22 + + Export the transfer list + - - :/resources/export-transfer-list.png:/resources/export-transfer-list.png + + :/Themes/Oxygen/resources/export-transfer-list.png:/Themes/Oxygen/resources/export-transfer-list.png true @@ -535,9 +562,12 @@ p, li { white-space: pre-wrap; } 22 + + Import the transfer list + - - :/resources/import-transfer-list.png:/resources/import-transfer-list.png + + :/Themes/Oxygen/resources/import-transfer-list.png:/Themes/Oxygen/resources/import-transfer-list.png true @@ -614,8 +644,8 @@ p, li { white-space: pre-wrap; } - - :/resources/remove.png:/resources/remove.png + + :/Themes/Oxygen/resources/remove.png:/Themes/Oxygen/resources/remove.png true @@ -628,339 +658,111 @@ p, li { white-space: pre-wrap; } - - - - :/styles/kde3/tools.png:/styles/kde3/tools.png - + - Options + Error - - - 3 - + - - - Copy end - - - - 2 - - - 2 - - - 0 - - - 2 - - - 1 - - - - - At the end of the copy: - - - - - - - Qt::Horizontal - - - - 16 - 20 - - - - - - - - - 0 - 0 - - - - - 210 - 0 - - - - - 210 - 22 - - - - - Don't close if errors are found - - - - - Never close - - - - - Always close - - - - - - + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Export the errors into transfer list + + + + :/Themes/Oxygen/resources/export-transfer-list.png:/Themes/Oxygen/resources/export-transfer-list.png + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - - - Speed limit + + + QAbstractItemView::NoSelection - - - 2 - - - 2 - - - 0 - - - 2 - - - 1 - - - - - Limit copy speed at: - - - - - - - false - - - KB/s - - - 1 - - - 999999 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 138 - 10 - - - - - - - - - - - File collisions + + false - - - 2 - - - 2 - - - 0 - - - 2 - - - 1 - - - - - What to do: - - - - - - - Qt::Horizontal - - - - 31 - 20 - - - - - - - - - 210 - 0 - - - - - 16777215 - 22 - - - - - - - - - - - Copy errors + + true - - - 2 + + + Source - - 2 + + + + Destination - - 0 + + + + Error - - 2 - - - 1 - - - - - What to do: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 210 - 0 - - - - - 210 - 22 - - - - - + - - - - Qt::Vertical - - - - 360 - 21 - - - - - - - - :/styles/kde3/player_playlist.png:/styles/kde3/player_playlist.png - + Interface - - - - - QFormLayout::ExpandingFieldsGrow - - - - - Show speed as main informations - - - - - - - - - - - - + + + 0 + + + 0 + - - - Qt::Vertical + + + true - - - 20 - 220 - - - + + + + 0 + 0 + 492 + 227 + + + + @@ -969,8 +771,8 @@ p, li { white-space: pre-wrap; } - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png Add file @@ -978,8 +780,8 @@ p, li { white-space: pre-wrap; } - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png Add folder @@ -987,8 +789,8 @@ p, li { white-space: pre-wrap; } - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png Move file(s) @@ -996,8 +798,8 @@ p, li { white-space: pre-wrap; } - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png Move folder @@ -1005,8 +807,8 @@ p, li { white-space: pre-wrap; } - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png Copy file(s) @@ -1014,8 +816,8 @@ p, li { white-space: pre-wrap; } - - :/resources/add.png:/resources/add.png + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png Copy folder @@ -1023,7 +825,7 @@ p, li { white-space: pre-wrap; } - + @@ -1042,21 +844,5 @@ p, li { white-space: pre-wrap; } - - checkBox_limitSpeed - clicked(bool) - limitSpeed - setEnabled(bool) - - - 121 - 304 - - - 328 - 305 - - - diff --git a/plugins/Themes/Oxygen/interfaceResources.qrc b/plugins/Themes/Oxygen/interfaceResources.qrc new file mode 100644 index 0000000..60060b3 --- /dev/null +++ b/plugins/Themes/Oxygen/interfaceResources.qrc @@ -0,0 +1,22 @@ + + + resources/add.png + resources/cancel.png + resources/main.png + resources/moveDown.png + resources/moveUp.png + resources/player_end.png + resources/player_pause.png + resources/player_play.png + resources/putOnBottom.png + resources/putOnTop.png + resources/remove.png + resources/search.png + resources/export-transfer-list.png + resources/import-transfer-list.png + resources/SystemTrayIcon/add.png + resources/SystemTrayIcon/exit.png + resources/SystemTrayIcon/informations.png + resources/SystemTrayIcon/options.png + + diff --git a/plugins/Themes/Oxygen/interfaceResources_unix.qrc b/plugins/Themes/Oxygen/interfaceResources_unix.qrc new file mode 100644 index 0000000..27fb1d2 --- /dev/null +++ b/plugins/Themes/Oxygen/interfaceResources_unix.qrc @@ -0,0 +1,7 @@ + + + resources/SystemTrayIcon/systray_Caught_Unix.png + resources/SystemTrayIcon/systray_Semiuncaught_Unix.png + resources/SystemTrayIcon/systray_Uncaught_Unix.png + + diff --git a/plugins/Themes/Oxygen/interfaceResources_windows.qrc b/plugins/Themes/Oxygen/interfaceResources_windows.qrc new file mode 100644 index 0000000..f917ac3 --- /dev/null +++ b/plugins/Themes/Oxygen/interfaceResources_windows.qrc @@ -0,0 +1,7 @@ + + + resources/SystemTrayIcon/systray_Caught_Windows.png + resources/SystemTrayIcon/systray_Semiuncaught_Windows.png + resources/SystemTrayIcon/systray_Uncaught_Windows.png + + diff --git a/plugins/Themes/Oxygen/options.ui b/plugins/Themes/Oxygen/options.ui index ad4826e..96e4efa 100644 --- a/plugins/Themes/Oxygen/options.ui +++ b/plugins/Themes/Oxygen/options.ui @@ -6,36 +6,285 @@ 0 0 - 249 - 54 + 515 + 251 - - - QFormLayout::ExpandingFieldsGrow - - - + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + - Show speed as main informations + Progression color - - + + + + Unlimited + + - - + + + + Limit copy speed at: + + + + + + + false + + + KB/s + + + 1 + + + 999999 + + + + + + + Speed with progress bar + + + + + + + Qt::Horizontal + + + + 122 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + + At the end of the copy: + + + + + + + + + + Limit copy speed at: + + - + - Start with more button pushed + Start with the "more button" pushed + + + + + + + 5 + + + Qt::Horizontal + + + + + + + Show dual progression + + + + + + + + + + + + + Show speed as main information + + + - + + + checkBox_limitSpeed + clicked(bool) + limitSpeed + setEnabled(bool) + + + 109 + 144 + + + 199 + 144 + + + + diff --git a/plugins/Themes/Oxygen/plugin.json b/plugins/Themes/Oxygen/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/Themes/Oxygen/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Themes/Oxygen/resources.qrc b/plugins/Themes/Oxygen/resources.qrc deleted file mode 100644 index 75f6259..0000000 --- a/plugins/Themes/Oxygen/resources.qrc +++ /dev/null @@ -1,22 +0,0 @@ - - - resources/add.png - resources/cancel.png - resources/main.png - resources/moveDown.png - resources/moveUp.png - resources/player_end.png - resources/player_pause.png - resources/player_play.png - resources/putOnBottom.png - resources/putOnTop.png - resources/remove.png - resources/search.png - resources/export-transfer-list.png - resources/import-transfer-list.png - resources/SystemTrayIcon/add.png - resources/SystemTrayIcon/exit.png - resources/SystemTrayIcon/informations.png - resources/SystemTrayIcon/options.png - - diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png index 1e03be9..7932127 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/exit.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/exit.png index 201353e..ae3c4e8 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/exit.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/exit.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/informations.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/informations.png index e1eb797..5b7b255 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/informations.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/informations.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/options.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/options.png index d35365c..23ec531 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/options.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/options.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png index a81e70d..6f5d1cf 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png index 8072aea..5464856 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png index f40ea82..b2bb2e3 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png index 8d673e4..0abeb5f 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png index 9ce4779..5e313b9 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png index d0fca1b..828e7e6 100644 Binary files a/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png and b/plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins/Themes/Oxygen/resources/add.png b/plugins/Themes/Oxygen/resources/add.png index 1e03be9..7932127 100644 Binary files a/plugins/Themes/Oxygen/resources/add.png and b/plugins/Themes/Oxygen/resources/add.png differ diff --git a/plugins/Themes/Oxygen/resources/cancel.png b/plugins/Themes/Oxygen/resources/cancel.png index 201353e..ae3c4e8 100644 Binary files a/plugins/Themes/Oxygen/resources/cancel.png and b/plugins/Themes/Oxygen/resources/cancel.png differ diff --git a/plugins/Themes/Oxygen/resources/export-transfer-list.png b/plugins/Themes/Oxygen/resources/export-transfer-list.png index 259e887..3a0aac6 100644 Binary files a/plugins/Themes/Oxygen/resources/export-transfer-list.png and b/plugins/Themes/Oxygen/resources/export-transfer-list.png differ diff --git a/plugins/Themes/Oxygen/resources/import-transfer-list.png b/plugins/Themes/Oxygen/resources/import-transfer-list.png index 58db827..ee47f0d 100644 Binary files a/plugins/Themes/Oxygen/resources/import-transfer-list.png and b/plugins/Themes/Oxygen/resources/import-transfer-list.png differ diff --git a/plugins/Themes/Oxygen/resources/main.png b/plugins/Themes/Oxygen/resources/main.png index 8072aea..5464856 100644 Binary files a/plugins/Themes/Oxygen/resources/main.png and b/plugins/Themes/Oxygen/resources/main.png differ diff --git a/plugins/Themes/Oxygen/resources/moveDown.png b/plugins/Themes/Oxygen/resources/moveDown.png index 03f2014..82a312c 100644 Binary files a/plugins/Themes/Oxygen/resources/moveDown.png and b/plugins/Themes/Oxygen/resources/moveDown.png differ diff --git a/plugins/Themes/Oxygen/resources/moveUp.png b/plugins/Themes/Oxygen/resources/moveUp.png index 5e42321..7f7ba72 100644 Binary files a/plugins/Themes/Oxygen/resources/moveUp.png and b/plugins/Themes/Oxygen/resources/moveUp.png differ diff --git a/plugins/Themes/Oxygen/resources/player_end.png b/plugins/Themes/Oxygen/resources/player_end.png index 0d22924..18982db 100644 Binary files a/plugins/Themes/Oxygen/resources/player_end.png and b/plugins/Themes/Oxygen/resources/player_end.png differ diff --git a/plugins/Themes/Oxygen/resources/player_pause.png b/plugins/Themes/Oxygen/resources/player_pause.png index a9b3113..68ee21f 100644 Binary files a/plugins/Themes/Oxygen/resources/player_pause.png and b/plugins/Themes/Oxygen/resources/player_pause.png differ diff --git a/plugins/Themes/Oxygen/resources/player_play.png b/plugins/Themes/Oxygen/resources/player_play.png index 80ff3a1..a1c5b83 100644 Binary files a/plugins/Themes/Oxygen/resources/player_play.png and b/plugins/Themes/Oxygen/resources/player_play.png differ diff --git a/plugins/Themes/Oxygen/resources/putOnBottom.png b/plugins/Themes/Oxygen/resources/putOnBottom.png index aadd380..512286e 100644 Binary files a/plugins/Themes/Oxygen/resources/putOnBottom.png and b/plugins/Themes/Oxygen/resources/putOnBottom.png differ diff --git a/plugins/Themes/Oxygen/resources/putOnTop.png b/plugins/Themes/Oxygen/resources/putOnTop.png index 6f54166..30fe96b 100644 Binary files a/plugins/Themes/Oxygen/resources/putOnTop.png and b/plugins/Themes/Oxygen/resources/putOnTop.png differ diff --git a/plugins/Themes/Oxygen/resources/remove.png b/plugins/Themes/Oxygen/resources/remove.png index 5b4c488..b711740 100644 Binary files a/plugins/Themes/Oxygen/resources/remove.png and b/plugins/Themes/Oxygen/resources/remove.png differ diff --git a/plugins/Themes/Oxygen/resources/search.png b/plugins/Themes/Oxygen/resources/search.png index 3b674c3..cef1836 100644 Binary files a/plugins/Themes/Oxygen/resources/search.png and b/plugins/Themes/Oxygen/resources/search.png differ diff --git a/plugins/Themes/Oxygen/resources_unix.qrc b/plugins/Themes/Oxygen/resources_unix.qrc deleted file mode 100644 index ae3894b..0000000 --- a/plugins/Themes/Oxygen/resources_unix.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - resources/SystemTrayIcon/systray_Caught_Unix.png - resources/SystemTrayIcon/systray_Semiuncaught_Unix.png - resources/SystemTrayIcon/systray_Uncaught_Unix.png - - diff --git a/plugins/Themes/Oxygen/resources_windows.qrc b/plugins/Themes/Oxygen/resources_windows.qrc deleted file mode 100644 index 99829b3..0000000 --- a/plugins/Themes/Oxygen/resources_windows.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - resources/SystemTrayIcon/systray_Caught_Windows.png - resources/SystemTrayIcon/systray_Semiuncaught_Windows.png - resources/SystemTrayIcon/systray_Uncaught_Windows.png - - diff --git a/plugins/Themes/Oxygen/themesOptions.ui b/plugins/Themes/Oxygen/themesOptions.ui new file mode 100644 index 0000000..b3ac73b --- /dev/null +++ b/plugins/Themes/Oxygen/themesOptions.ui @@ -0,0 +1,426 @@ + + + themesOptions + + + + 0 + 0 + 519 + 389 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + 0 + 0 + 509 + 292 + + + + Use + + + + + + Start with the "more button" pushed + + + + + + + + + + Always on top + + + + + + + Minimize on close to systray + + + + + + + + + + + Don't close if errors are found + + + + + Never close + + + + + Always close + + + + + + + + At the end of the copy + + + + + + + Limit copy speed to + + + + + + + + + + 0 + 0 + + + + 5 + + + Qt::Horizontal + + + + + + + Unlimited + + + + + + + + + Limit copy speed to + + + + + + + false + + + KB/s + + + 1 + + + 999999 + + + + + + + Qt::Vertical + + + + 20 + 133 + + + + + + + + + + + Start minimized + + + + + + + + + + + + + + + + 0 + 0 + 509 + 292 + + + + Informations + + + + + + Show speed as main information + + + + + + + + + + Qt::Vertical + + + + 20 + 529 + + + + + + + + + + 0 + 0 + 509 + 292 + + + + Display + + + + + + Speed with progress bar + + + + + + + + + + Show dual progression + + + + + + + + + + Show progression in the title + + + + + + + + + + Progression color + + + + + + + + 225 + 20 + + + + + 225 + 20 + + + + Click to edit the color + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + 75 + 20 + + + + + 75 + 20 + + + + + 75 + 20 + + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 455 + + + + + + + + + + + + + + checkBox_limitSpeed + clicked(bool) + limitSpeed + setEnabled(bool) + + + 109 + 144 + + + 199 + 144 + + + + + diff --git a/plugins/static-plugins-oxygen.qrc b/plugins/static-plugins-oxygen.qrc new file mode 100644 index 0000000..21b4be0 --- /dev/null +++ b/plugins/static-plugins-oxygen.qrc @@ -0,0 +1,6 @@ + + + Themes/Oxygen/informations.xml + Themes/Oxygen/Languages/fr/translation.qm + + diff --git a/plugins/static-plugins-windows.qrc b/plugins/static-plugins-windows.qrc new file mode 100644 index 0000000..6ddcdc0 --- /dev/null +++ b/plugins/static-plugins-windows.qrc @@ -0,0 +1,6 @@ + + + PluginLoader/catchcopy-v0002/informations.xml + PluginLoader/catchcopy-v0002/Languages/fr/translation.qm + + diff --git a/plugins/static-plugins.qrc b/plugins/static-plugins.qrc new file mode 100644 index 0000000..b250e7c --- /dev/null +++ b/plugins/static-plugins.qrc @@ -0,0 +1,12 @@ + + + CopyEngine/Ultracopier/informations.xml + CopyEngine/Ultracopier/Languages/fr/translation.qm + Languages/fr/informations.xml + Languages/fr/flag.png + Languages/fr/translation.qm + Listener/catchcopy-v0002/informations.xml + Themes/Oxygen/informations.xml + Themes/Oxygen/Languages/fr/translation.qm + + diff --git a/resources/Languages/en/flag.png b/resources/Languages/en/flag.png index bb6e8d1..b662ab4 100644 Binary files a/resources/Languages/en/flag.png and b/resources/Languages/en/flag.png differ diff --git a/resources/Languages/en/informations.xml b/resources/Languages/en/informations.xml index ce665e0..671ac15 100644 --- a/resources/Languages/en/informations.xml +++ b/resources/Languages/en/informations.xml @@ -12,13 +12,11 @@ - 0.3.0.0 + 1.2.3.6 en - - + diff --git a/resources/Languages/en/translation.ts b/resources/Languages/en/translation.ts new file mode 100644 index 0000000..e827a0a --- /dev/null +++ b/resources/Languages/en/translation.ts @@ -0,0 +1,1383 @@ + + + + + CliParser + + + + + + + Warning + + + + + Ultracopier is already running, right click on its system tray icon (near the clock) to use it + + + + + Problem reading file, or file size is 0 + + + + + + The arguments possible are: + + + + + + To display the options + + + + + + To quit the other instances (if running) + + + + + + To copy sources to destination, separated by space. If destination is "?", ultracopier will ask the user + + + + + + To move sources to destination, separated by space. If destination is "?", ultracopier will ask the user + + + + + Command not valid + + + + + This file is not supported transfer list + + + + + Unable to open the transfer list file + + + + + + To display this help + + + + + + Open transfer list + + + + + Help + + + + + CopyEngineManager + + + + + + Warning + + + + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + + + Cannot find any compatible engine! + + + + + Cannot find any engine with this name: %1 + + + + + CopyListener + + + Error + + + + + Error during the reception of the copy/move list +%1 + + + + + Core + + + + + + + + + + + + + + Error + + + + + + + + + + + Unable to get a copy engine instance + + + + + Group window + + + + + Do you want group the transfer with another actual running transfer? + + + + + Unable to get a engine instance + + + + + The argument for the mode is not valid + + + + + Do you want to copy? If no, it will be moved. + + + + + + Unable to load the interface, copy aborted + + + + + Unable to load the copy engine, copy aborted + + + + + Transfer mode + + + + + EventDispatcher + + + Key + + + + + Give the key of this software, more information on <a href="http://ultracopier.first-world.info/">ultracopier.first-world.info</a> + + + + + FacilityEngine + + + s + + + + + Too big + + + + + B + + + + + KB + + + + + MB + + + + + GB + + + + + TB + + + + + PB + + + + + EB + + + + + ZB + + + + + YB + + + + + Less than %10 seconds + + + + + About %10 seconds remaining + + + + + About %1 minutes remaining + + + + + About %1 hours remaining + + + + + Copy engine + + + + + Copy + a copy + + + + + Transfer + a transfer + + + + + Move + a move + + + + + Start + + + + + Pause + + + + + Resume + + + + + + Skip + + + + + Unlimited + + + + + Source + + + + + Size + + + + + Destination + + + + + Quit + + + + + Target + + + + + + Time remaining: + + + + + Listing + + + + + Copying + + + + + Listing and copying + + + + + Ask + + + + + Overwrite + + + + + Overwrite if newer + + + + + Overwrite if the last modification dates are different + + + + + Rename + + + + + Put to the end of the list + + + + + Select source directory + + + + + Select destination directory + + + + + Internal error + + + + + Select one or more files to open + + + + + All files + + + + + Save transfer list + + + + + Open transfer list + + + + + Transfer list + + + + + Error + + + + + Not supported on this platform + + + + + Completed in %1 + + + + + HelpDialog + + + About Ultracopier + + + + + Based on Qt. Advanced utility to copy files under GPL3 license. +This version is compiled as version: %1. + %1 will be replaced by a variable content (normal, debug, ...) + + + + + <html><head/><body><p>For more information see the website <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> + %1 will be remplaced by the website into the corresponding languages + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + About Supercopier + + + + + For http://portableapps.com/ + + + + + Portable and all in one version + + + + + Portable version + + + + + All in one version + + + + + Normal version + + + + + + + http://ultracopier.first-world.info/ + + + + + http://ultracopier.first-world.info/shop.html + + + + + http://ultracopier.first-world.info/download.html + + + + + LocalListener + + + Warning + + + + + Timeout while recomposing data from connected clients + + + + + LogThread + + + + + Error + + + + + Log file already open, error: %1 + + + + + + Unable to open the log file, error: %1 + + + + + OSSpecific + + + Warning + + + + + Don't show again + + + + + Ok + + + + + The replacement of default copy/move system is not supported by the file manager (Dolphin, Nautilus, ...).<br />Ask the developer to support it.<br />You need do the copy/move manually. + + + + + Reboot the system if previously had similar software installed (like Teracopy, Supercopier or an earlier version of Ultracopier). + + + + + The replacement of default copy/move system is not supported and blocked by finder of Mac OS X.<br />You need do the copy/move manually by right clicking on the system tray icon near the clock (not the dock icon). + + + + + The replacement of default copy/move system should be not supported by the file manager.<br />Ask to the developer to support it.<br />You need do the copy/move manually. + + + + + Consider Supercopier as deprecated, prefer Ultracopier + + + + + This version use 100% of you graphic card/GPU (you computer can be noisy, or slow/buggy during the games) at exchange of free access to Ultimate version. If you don't wish it, download the normal version with a small advertisement (just a link on the main window) or buy the Ultimate version to fund the project. + + + + + http://ultracopier.first-world.info/download.html + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + + Listener + + + + + + + Plugin loader + + + + + + + Session loader + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + Check for updates + + + + + Give GPU time to fund the development + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + Name + + + + + Force the language + + + + + Replace the default copy and move system + + + + + Load at the session loading + + + + + When manual open + + + + + Group the windows when + + + + + Display the OS warning + + + + + Remaining time algorithm + + + + + Traditional + + + + + Logarithmic + + + + + Version + + + + + Language + + + + + Plugin + + + + + Add + + + + + Remove + + + + + Information + + + + + Copy engine by order of preference: + + + + + Client connected + + + + + Themes: + + + + + Unable to load the themes plugin + + + + + No option for this plugin + + + + + Write the log file into: + + + + + Browse + + + + + Synchronized log + + + + + Write the transfers + + + + + Write the errors + + + + + Write the folder operations + + + + + The variables are %time%, %source%, %size%, %destination% + %time%, %source%, %size%, %destination% should not be translated + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + Allow the application + + + + + This Ultimate free version is only if %1 is allowed by your antivirus. Else you can get the normal free version + + + + + Enable the OpenCL + + + + + This Ultimate version is only if the OpenCL is installed with your graphic card drivers. Else you can get the normal free version + + + + + + Load + + + + + Load the theme? + + + + + Load the language? + + + + + Do nothing + + + + + Ask source as folder + + + + + Ask sources as files + + + + + Never + + + + + When source is same + + + + + When destination is same + + + + + When source and destination are same + + + + + When source or destination are same + + + + + Always + + + + + + + The variables are %1 + + + + + Save logs as: + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Website: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Title: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + PluginsManager + + + informations.xml is not accessible + + + + + %1, parse error at line %2, column %3: %4 + + + + + "package" root tag not found for the xml file + + + + + Duplicated plugin found, already loaded! + + + + + informations.xml not found for the plugin + + + + + English text missing in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + Information + + + + + Previous import is in progress... + + + + + Open Ultracopier plugin + + + + + Ultracopier plugin (*.urc) + + + + + + + + + + + + + + Plugin loader + + + + + Unable to open the plugin: %1 + + + + + + + Unable to load the plugin content, please check it: %1 + + + + + Unable to create a folder to install the plugin: +%1 + + + + + Unable to create a file to install the plugin: +%1 +since:%2 + + + + + Folder with same name is present, skip the plugin installation: +%1 + + + + + + + Unable to load the plugin content, please check it + + + + + QXzDecode + + + + Memory allocation failed + + + + + + Write error + + + + + Memory usage limit reached + + + + + Not a .xz file + + + + + Unsupported options in the .xz headers + + + + + The file is corrupted + + + + + Bug! + + + + + The input data is too short + + + + + SystrayIcon + + + No copy listener found. Do the copy manually by right click one the system tray icon. + + + + + Information + + + + + Searching information... + + + + + Do not replace the explorer copy/move + + + + + Semi replace the explorer copy/move + + + + + Replace the explorer copy/move + + + + + Warning + + + + + The action on the systray icon is unknown! + + + + + &About/Debug report + + + + + &About + + + + + &Save bug report + + + + + &Quit + + + + + &Options + + + + + A&dd copy/moving + + + + + New version: %1 + + + + + Click here to go on download page + + + + + &Copy + + + + + + &Transfer + + + + + + &Move + + + + + + Add &copy + + + + + + Add &transfer + + + + + + Add &move + + + + diff --git a/resources/bug-128x128.png b/resources/bug-128x128.png index 051e738..1329a1c 100644 Binary files a/resources/bug-128x128.png and b/resources/bug-128x128.png differ diff --git a/resources/document-encrypt.png b/resources/document-encrypt.png deleted file mode 100644 index c6d26f9..0000000 Binary files a/resources/document-encrypt.png and /dev/null differ diff --git a/resources/moveDown.png b/resources/moveDown.png index 03f2014..82a312c 100644 Binary files a/resources/moveDown.png and b/resources/moveDown.png differ diff --git a/resources/moveUp.png b/resources/moveUp.png index 5e42321..7f7ba72 100644 Binary files a/resources/moveUp.png and b/resources/moveUp.png differ diff --git a/resources/none-128x128.png b/resources/none-128x128.png index 32be6b3..c2b4551 100644 Binary files a/resources/none-128x128.png and b/resources/none-128x128.png differ diff --git a/resources/options.png b/resources/options.png index d35365c..23ec531 100644 Binary files a/resources/options.png and b/resources/options.png differ diff --git a/resources/qt.conf b/resources/qt.conf new file mode 100644 index 0000000..7b3ff10 --- /dev/null +++ b/resources/qt.conf @@ -0,0 +1,2 @@ +[Paths] +Plugins = qt-plugins/ diff --git a/resources/resources-windows-qt-plugin.qrc b/resources/resources-windows-qt-plugin.qrc new file mode 100644 index 0000000..6677f1f --- /dev/null +++ b/resources/resources-windows-qt-plugin.qrc @@ -0,0 +1,5 @@ + + + qt.conf + + diff --git a/resources/resources-windows.rc b/resources/resources-windows.rc index 59649fe..2a471d0 100644 --- a/resources/resources-windows.rc +++ b/resources/resources-windows.rc @@ -28,22 +28,9 @@ FILETYPE VFT_APP } } -IDI_ICON1 ICON DISCARDABLE "ultracopier.ico" - -#ifdef _UNICODE -#if defined _M_IX86 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") -#elif defined _M_IA64 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") -#elif defined _M_X64 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +IDI_ICON1 ICON DISCARDABLE "ultracopier-all-in-one.ico" #else -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") -#endif +IDI_ICON1 ICON DISCARDABLE "ultracopier.ico" #endif -#if defined(_M_X64) -1 RT_MANIFEST "ultracopier.exe.amd64.manifest" -#else -1 RT_MANIFEST "ultracopier.exe.x86.manifest" -#endif \ No newline at end of file diff --git a/resources/resources.qrc b/resources/resources.qrc deleted file mode 100644 index 30980b0..0000000 --- a/resources/resources.qrc +++ /dev/null @@ -1,14 +0,0 @@ - - - ultracopier-128x128.png - ultracopier-16x16.png - document-encrypt.png - moveUp.png - moveDown.png - bug-128x128.png - none-128x128.png - Languages/en/flag.png - Languages/en/informations.xml - options.png - - diff --git a/resources/resources_unix.qrc b/resources/resources_unix.qrc deleted file mode 100644 index 1be76bf..0000000 --- a/resources/resources_unix.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - systray_Caught_Unix.png - systray_Semiuncaught_Unix.png - systray_Uncaught_Unix.png - - diff --git a/resources/resources_windows.qrc b/resources/resources_windows.qrc deleted file mode 100644 index a504744..0000000 --- a/resources/resources_windows.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - systray_Caught_Windows.png - systray_Semiuncaught_Windows.png - systray_Uncaught_Windows.png - - diff --git a/resources/supercopier-128x128.png b/resources/supercopier-128x128.png new file mode 100644 index 0000000..0bc611d Binary files /dev/null and b/resources/supercopier-128x128.png differ diff --git a/resources/supercopier-16x16.png b/resources/supercopier-16x16.png new file mode 100644 index 0000000..9c597af Binary files /dev/null and b/resources/supercopier-16x16.png differ diff --git a/resources/supercopier-all-in-one.ico b/resources/supercopier-all-in-one.ico new file mode 100644 index 0000000..3714a0e Binary files /dev/null and b/resources/supercopier-all-in-one.ico differ diff --git a/resources/supercopier.icns b/resources/supercopier.icns new file mode 100644 index 0000000..184a5b9 Binary files /dev/null and b/resources/supercopier.icns differ diff --git a/resources/supercopier.ico b/resources/supercopier.ico new file mode 100644 index 0000000..de56a7c Binary files /dev/null and b/resources/supercopier.ico differ diff --git a/resources/systray_Caught_Unix.png b/resources/systray_Caught_Unix.png index a81e70d..6f5d1cf 100644 Binary files a/resources/systray_Caught_Unix.png and b/resources/systray_Caught_Unix.png differ diff --git a/resources/systray_Caught_Windows.png b/resources/systray_Caught_Windows.png index 8072aea..5464856 100644 Binary files a/resources/systray_Caught_Windows.png and b/resources/systray_Caught_Windows.png differ diff --git a/resources/systray_Semiuncaught_Unix.png b/resources/systray_Semiuncaught_Unix.png index f40ea82..3961215 100644 Binary files a/resources/systray_Semiuncaught_Unix.png and b/resources/systray_Semiuncaught_Unix.png differ diff --git a/resources/systray_Semiuncaught_Windows.png b/resources/systray_Semiuncaught_Windows.png index 8d673e4..45d6315 100644 Binary files a/resources/systray_Semiuncaught_Windows.png and b/resources/systray_Semiuncaught_Windows.png differ diff --git a/resources/systray_Uncaught_Unix.png b/resources/systray_Uncaught_Unix.png index 9ce4779..ac4299a 100644 Binary files a/resources/systray_Uncaught_Unix.png and b/resources/systray_Uncaught_Unix.png differ diff --git a/resources/systray_Uncaught_Windows.png b/resources/systray_Uncaught_Windows.png index d0fca1b..6e6bae7 100644 Binary files a/resources/systray_Uncaught_Windows.png and b/resources/systray_Uncaught_Windows.png differ diff --git a/resources/ultracopier-128x128.png b/resources/ultracopier-128x128.png index d9f7ca2..c4547d2 100644 Binary files a/resources/ultracopier-128x128.png and b/resources/ultracopier-128x128.png differ diff --git a/resources/ultracopier-16x16.png b/resources/ultracopier-16x16.png index c0e31d2..326362b 100644 Binary files a/resources/ultracopier-16x16.png and b/resources/ultracopier-16x16.png differ diff --git a/resources/ultracopier-all-in-one.ico b/resources/ultracopier-all-in-one.ico new file mode 100644 index 0000000..d281659 Binary files /dev/null and b/resources/ultracopier-all-in-one.ico differ diff --git a/resources/ultracopier-resources.qrc b/resources/ultracopier-resources.qrc new file mode 100644 index 0000000..b57de67 --- /dev/null +++ b/resources/ultracopier-resources.qrc @@ -0,0 +1,15 @@ + + + ultracopier-128x128.png + ultracopier-16x16.png + moveUp.png + moveDown.png + bug-128x128.png + none-128x128.png + Languages/en/flag.png + Languages/en/informations.xml + Languages/en/translation.qm + options.png + warning.png + + diff --git a/resources/ultracopier-resources_unix.qrc b/resources/ultracopier-resources_unix.qrc new file mode 100644 index 0000000..1be76bf --- /dev/null +++ b/resources/ultracopier-resources_unix.qrc @@ -0,0 +1,7 @@ + + + systray_Caught_Unix.png + systray_Semiuncaught_Unix.png + systray_Uncaught_Unix.png + + diff --git a/resources/ultracopier-resources_windows.qrc b/resources/ultracopier-resources_windows.qrc new file mode 100644 index 0000000..a504744 --- /dev/null +++ b/resources/ultracopier-resources_windows.qrc @@ -0,0 +1,7 @@ + + + systray_Caught_Windows.png + systray_Semiuncaught_Windows.png + systray_Uncaught_Windows.png + + diff --git a/resources/ultracopier.exe.amd64.manifest b/resources/ultracopier.exe.amd64.manifest deleted file mode 100644 index e55d924..0000000 --- a/resources/ultracopier.exe.amd64.manifest +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/ultracopier.exe.x86.manifest b/resources/ultracopier.exe.x86.manifest deleted file mode 100644 index a092ab0..0000000 --- a/resources/ultracopier.exe.x86.manifest +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/warning.png b/resources/warning.png new file mode 100644 index 0000000..9c9580f Binary files /dev/null and b/resources/warning.png differ diff --git a/static.pro b/static.pro new file mode 100644 index 0000000..a418564 --- /dev/null +++ b/static.pro @@ -0,0 +1,33 @@ +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE + +include(ultracopier-core.pro) + +RESOURCES += plugins/static-plugins.qrc \ + plugins/CopyEngine/Ultracopier/copyEngineResources.qrc + +win32:RESOURCES += plugins/static-plugins-windows.qrc + +LIBS = -Lplugins -lcopyEngine -linterface -llistener +win32:LIBS += -lpluginLoader -lsessionLoader + +build_pass:CONFIG(debug, debug|release) { +LIBS = -Lplugins -lcopyEngined -linterfaced -llistenerd +win32:LIBS += -lpluginLoaderd -lsessionLoaderd +} + +HEADERS -= lib/qt-tar-xz/xz.h \ + lib/qt-tar-xz/QXzDecodeThread.h \ + lib/qt-tar-xz/QXzDecode.h \ + lib/qt-tar-xz/QTarDecode.h \ + AuthPlugin.h +SOURCES -= lib/qt-tar-xz/QXzDecodeThread.cpp \ + lib/qt-tar-xz/QXzDecode.cpp \ + lib/qt-tar-xz/QTarDecode.cpp \ + lib/qt-tar-xz/xz_crc32.c \ + lib/qt-tar-xz/xz_dec_stream.c \ + lib/qt-tar-xz/xz_dec_lzma2.c \ + lib/qt-tar-xz/xz_dec_bcj.c \ + AuthPlugin.cpp +INCLUDEPATH -= lib/qt-tar-xz/ + +RESOURCES -= resources/resources-windows-qt-plugin.qrc diff --git a/supercopier-static.pro b/supercopier-static.pro new file mode 100644 index 0000000..5a83029 --- /dev/null +++ b/supercopier-static.pro @@ -0,0 +1,6 @@ +include(static.pro) + +RESOURCES += plugins-alternative/static-plugins-supercopier.qrc \ + plugins-alternative/Themes/Supercopier/interfaceResources_windows.qrc \ + plugins-alternative/Themes/Supercopier/interfaceResources_unix.qrc \ + plugins-alternative/Themes/Supercopier/interfaceResources.qrc \ No newline at end of file diff --git a/tools/unit-tester/copyEngine.cpp b/tools/unit-tester/copyEngine.cpp new file mode 100644 index 0000000..f74361d --- /dev/null +++ b/tools/unit-tester/copyEngine.cpp @@ -0,0 +1,1386 @@ +/** \file copyEngine.cpp +\brief Define the copy engine +\author alpha_one_x86 +*/ + +#include "copyEngine.h" +#include "folderExistsDialog.h" +#include "../../../interface/PluginInterface_CopyEngine.h" + +copyEngine::copyEngine(const QString &path,const QList &tests) +{ + listThread=new ListThread(facilityEngine); + this->facilityEngine=facilityEngine; + filters=NULL; + renamingRules=NULL; + + interface = NULL; + tempWidget = NULL; + uiIsInstalled = false; + dialogIsOpen = false; + maxSpeed = 0; + alwaysDoThisActionForFileExists = FileExists_NotSet; + alwaysDoThisActionForFileError = FileError_NotSet; + checkDestinationFolderExists = false; + stopIt = false; + size_for_speed = 0; + forcedMode = false; + + //implement the SingleShot in this class + //timerActionDone.setSingleShot(true); + timerActionDone.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_TRASNFER_LIST); + //timerProgression.setSingleShot(true); + timerProgression.setInterval(ULTRACOPIER_PLUGIN_TIME_UPDATE_PROGRESSION); + +} + +copyEngine::~copyEngine() +{ + /*if(filters!=NULL) + delete filters; + if(renamingRules!=NULL) + delete renamingRules; + destroyed by the widget parent, here the interface + */ + stopIt=true; + delete listThread; + delete ui; +} + +void copyEngine::connectTheSignalsSlots() +{ + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + debugDialogWindow.show(); + #endif + if(!connect(listThread,&ListThread::actionInProgess, this,©Engine::actionInProgess, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect actionInProgess()"); + if(!connect(listThread,&ListThread::actionInProgess, this,©Engine::newActionInProgess, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect actionInProgess() to slot"); + if(!connect(listThread,&ListThread::newFolderListing, this,©Engine::newFolderListing, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect newFolderListing()"); + if(!connect(listThread,&ListThread::newCollisionAction, this,©Engine::newCollisionAction, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect newCollisionAction()"); + if(!connect(listThread,&ListThread::newErrorAction, this,©Engine::newErrorAction, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect newErrorAction()"); + if(!connect(listThread,&ListThread::isInPause, this,©Engine::isInPause, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect isInPause()"); + if(!connect(listThread,&ListThread::error, this,©Engine::error, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect error()"); + if(!connect(listThread,&ListThread::rmPath, this,©Engine::rmPath, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect rmPath()"); + if(!connect(listThread,&ListThread::mkPath, this,©Engine::mkPath, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect mkPath()"); + if(!connect(listThread,&ListThread::newActionOnList, this,©Engine::newActionOnList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect newActionOnList()"); + if(!connect(listThread,&ListThread::pushFileProgression, this,©Engine::pushFileProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect pushFileProgression()"); + if(!connect(listThread,&ListThread::pushGeneralProgression, this,©Engine::pushGeneralProgression, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect pushGeneralProgression()"); + if(!connect(listThread,&ListThread::syncReady, this,©Engine::syncReady, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect syncReady()"); + if(!connect(listThread,&ListThread::canBeDeleted, this,©Engine::canBeDeleted, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect canBeDeleted()"); + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + if(!connect(listThread,&ListThread::debugInformation, this,©Engine::debugInformation, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect debugInformation()"); + #endif + + if(!connect(listThread,&ListThread::send_fileAlreadyExists, this,©Engine::fileAlreadyExistsSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_fileAlreadyExists()"); + if(!connect(listThread,&ListThread::send_errorOnFile, this,©Engine::errorOnFileSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_errorOnFile()"); + if(!connect(listThread,&ListThread::send_folderAlreadyExists, this,©Engine::folderAlreadyExistsSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_folderAlreadyExists()"); + if(!connect(listThread,&ListThread::send_errorOnFolder, this,©Engine::errorOnFolderSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_errorOnFolder()"); + if(!connect(listThread,&ListThread::updateTheDebugInfo, this,©Engine::updateTheDebugInfo, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect updateTheDebugInfo()"); + if(!connect(listThread,&ListThread::errorTransferList, this,©Engine::errorTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect errorTransferList()"); + if(!connect(listThread,&ListThread::warningTransferList, this,©Engine::warningTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect warningTransferList()"); + if(!connect(listThread,&ListThread::mkPathErrorOnFolder, this,©Engine::mkPathErrorOnFolderSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect mkPathErrorOnFolder()"); + if(!connect(listThread,&ListThread::rmPathErrorOnFolder, this,©Engine::rmPathErrorOnFolderSlot, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect rmPathErrorOnFolder()"); + if(!connect(listThread,&ListThread::send_realBytesTransfered, this,©Engine::get_realBytesTransfered, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_realBytesTransfered()"); + + if(!connect(this,©Engine::tryCancel, listThread,&ListThread::tryCancel, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect tryCancel()"); + if(!connect(this,©Engine::signal_pause, listThread,&ListThread::pause, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_pause()"); + if(!connect(this,©Engine::signal_resume, listThread,&ListThread::resume, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_resume()"); + if(!connect(this,©Engine::signal_skip, listThread,&ListThread::skip, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_skip()"); + if(!connect(this,©Engine::signal_setCollisionAction, listThread,&ListThread::setAlwaysFileExistsAction, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_setCollisionAction()"); + if(!connect(this,©Engine::signal_setFolderColision, listThread,&ListThread::setFolderColision, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_setFolderColision()"); + if(!connect(this,©Engine::signal_removeItems, listThread,&ListThread::removeItems, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_removeItems()"); + if(!connect(this,©Engine::signal_moveItemsOnTop, listThread,&ListThread::moveItemsOnTop, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsOnTop()"); + if(!connect(this,©Engine::signal_moveItemsUp, listThread,&ListThread::moveItemsUp, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsUp()"); + if(!connect(this,©Engine::signal_moveItemsDown, listThread,&ListThread::moveItemsDown, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsDown()"); + if(!connect(this,©Engine::signal_moveItemsOnBottom, listThread,&ListThread::moveItemsOnBottom, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_moveItemsOnBottom()"); + if(!connect(this,©Engine::signal_exportTransferList, listThread,&ListThread::exportTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_exportTransferList()"); + if(!connect(this,©Engine::signal_importTransferList, listThread,&ListThread::importTransferList, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_importTransferList()"); + if(!connect(this,©Engine::signal_forceMode, listThread,&ListThread::forceMode, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect signal_forceMode()"); + if(!connect(this,©Engine::send_osBufferLimit, listThread,&ListThread::set_osBufferLimit, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_osBufferLimit()"); + if(!connect(this,©Engine::send_setFilters,listThread,&ListThread::set_setFilters, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_setFilters()"); + if(!connect(this,©Engine::send_sendNewRenamingRules,listThread,&ListThread::set_sendNewRenamingRules, Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect send_sendNewRenamingRules()"); + if(!connect(&timerActionDone,&QTimer::timeout, listThread,&ListThread::sendActionDone)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect timerActionDone"); + if(!connect(&timerProgression,&QTimer::timeout, listThread,&ListThread::sendProgression)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect timerProgression"); + + if(!connect(this,©Engine::queryOneNewDialog,this,©Engine::showOneNewDialog,Qt::QueuedConnection)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect queryOneNewDialog()"); +} + +#ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW +void copyEngine::updateTheDebugInfo(QStringList newList,QStringList newList2,int numberOfInodeOperation) +{ + debugDialogWindow.setTransferThreadList(newList); + debugDialogWindow.setTransferList(newList2); + debugDialogWindow.setInodeUsage(numberOfInodeOperation); +} +#endif + +//to send the options panel +bool copyEngine::getOptionsEngine(QWidget * tempWidget) +{ + this->tempWidget=tempWidget; + ui->setupUi(tempWidget); + connect(tempWidget, &QWidget::destroyed, this, ©Engine::resetTempWidget); + //conect the ui widget +/* connect(ui->doRightTransfer, &QCheckBox::toggled, &threadOfTheTransfer, ©Engine::setRightTransfer); + connect(ui->keepDate, &QCheckBox::toggled, &threadOfTheTransfer, ©Engine::setKeepDate); + connect(ui->blockSize, &QCheckBox::valueChanged, &threadOfTheTransfer, ©Engine::setBlockSize);*/ + connect(ui->autoStart, &QCheckBox::toggled, this, ©Engine::setAutoStart); + connect(ui->checkBoxDestinationFolderExists, &QCheckBox::toggled,this, ©Engine::setCheckDestinationFolderExists); + uiIsInstalled=true; + setRightTransfer(doRightTransfer); + setKeepDate(keepDate); + setSpeedLimitation(maxSpeed); + setBlockSize(blockSize); + setAutoStart(autoStart); + setCheckDestinationFolderExists(checkDestinationFolderExists); + set_doChecksum(doChecksum); + set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); + set_checksumOnlyOnError(checksumOnlyOnError); + set_osBuffer(osBuffer); + set_osBufferLimited(osBufferLimited); + set_osBufferLimit(osBufferLimit); + return true; +} + +//to have interface widget to do modal dialog +void copyEngine::setInterfacePointer(QWidget * interface) +{ + this->interface=interface; + filters=new Filters(tempWidget); + renamingRules=new RenamingRules(tempWidget); + + if(uiIsInstalled) + { + connect(ui->doRightTransfer, &QCheckBox::toggled, this,©Engine::setRightTransfer); + connect(ui->keepDate, &QCheckBox::toggled, this,©Engine::setKeepDate); + connect(ui->blockSize, static_cast(&QSpinBox::valueChanged), this,©Engine::setBlockSize); + connect(ui->autoStart, &QCheckBox::toggled, this,©Engine::setAutoStart); + connect(ui->doChecksum, &QCheckBox::toggled, this,©Engine::doChecksum_toggled); + connect(ui->checksumIgnoreIfImpossible, &QCheckBox::toggled, this,©Engine::checksumIgnoreIfImpossible_toggled); + connect(ui->checksumOnlyOnError, &QCheckBox::toggled, this,©Engine::checksumOnlyOnError_toggled); + connect(ui->osBuffer, &QCheckBox::toggled, this,©Engine::osBuffer_toggled); + connect(ui->osBufferLimited, &QCheckBox::toggled, this,©Engine::osBufferLimited_toggled); + connect(ui->osBufferLimit, &QSpinBox::editingFinished, this,©Engine::osBufferLimit_editingFinished); + + connect(filters,&Filters::haveNewFilters,this,©Engine::sendNewFilters); + connect(ui->filters,&QPushButton::clicked,this,©Engine::showFilterDialog); + + if(!connect(renamingRules,&RenamingRules::sendNewRenamingRules,this,©Engine::sendNewRenamingRules)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect sendNewRenamingRules()"); + if(!connect(ui->renamingRules,&QPushButton::clicked,this,©Engine::showRenamingRules)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to connect renamingRules.clicked()"); + } + + filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + set_setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + + renamingRules->setRenamingRules(firstRenamingRule,otherRenamingRule); + emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +bool copyEngine::haveSameSource(const QStringList &sources) +{ + return listThread->haveSameSource(sources); +} + +bool copyEngine::haveSameDestination(const QString &destination) +{ + return listThread->haveSameDestination(destination); +} + +bool copyEngine::newCopy(const QStringList &sources) +{ + if(forcedMode && mode!=Copy) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); + QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to move, you can't copy with it")); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QString destination = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select destination directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if(destination.isEmpty() || destination.isNull() || destination=="") + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return false; + } + return listThread->newCopy(sources,destination); +} + +bool copyEngine::newCopy(const QStringList &sources,const QString &destination) +{ + if(forcedMode && mode!=Copy) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to move, you can't copy with it"); + QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to move, you can't copy with it")); + return false; + } + return listThread->newCopy(sources,destination); +} + +bool copyEngine::newMove(const QStringList &sources) +{ + if(forcedMode && mode!=Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); + QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to copy, you can't move with it")); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QString destination = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select destination directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if(destination.isEmpty() || destination.isNull() || destination=="") + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return false; + } + return listThread->newMove(sources,destination); +} + +bool copyEngine::newMove(const QStringList &sources,const QString &destination) +{ + if(forcedMode && mode!=Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The engine is forced to copy, you can't move with it"); + QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The engine is forced to copy, you can't move with it")); + return false; + } + return listThread->newMove(sources,destination); +} + +void copyEngine::newTransferList(const QString &file) +{ + emit signal_importTransferList(file); +} + +//because direct access to list thread into the main thread can't be do +quint64 copyEngine::realByteTransfered() +{ + return size_for_speed; +} + +//speed limitation +qint64 copyEngine::getSpeedLimitation() +{ + return listThread->getSpeedLimitation(); +} + +//get collision action +QList > copyEngine::getCollisionAction() +{ + QPair tempItem; + QList > list; + tempItem.first=facilityEngine->translateText("Ask");tempItem.second="ask";list << tempItem; + tempItem.first=facilityEngine->translateText("Skip");tempItem.second="skip";list << tempItem; + tempItem.first=facilityEngine->translateText("Overwrite");tempItem.second="overwrite";list << tempItem; + tempItem.first=facilityEngine->translateText("Overwrite if newer");tempItem.second="overwriteIfNewer";list << tempItem; + tempItem.first=facilityEngine->translateText("Overwrite if the last modification dates are different");tempItem.second="overwriteIfNotSameModificationDate";list << tempItem; + tempItem.first=facilityEngine->translateText("Rename");tempItem.second="rename";list << tempItem; + return list; +} + +QList > copyEngine::getErrorAction() +{ + QPair tempItem; + QList > list; + tempItem.first=facilityEngine->translateText("Ask");tempItem.second="ask";list << tempItem; + tempItem.first=facilityEngine->translateText("Skip");tempItem.second="skip";list << tempItem; + tempItem.first=facilityEngine->translateText("Put to end of the list");tempItem.second="putToEndOfTheList";list << tempItem; + return list; +} + +void copyEngine::setDrive(const QStringList &drives) +{ + listThread->setDrive(drives); +} + +/** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ +void copyEngine::syncTransferList() +{ + listThread->syncTransferList(); +} + +void copyEngine::set_doChecksum(bool doChecksum) +{ + listThread->set_doChecksum(doChecksum); + if(uiIsInstalled) + { + ui->doChecksum->setChecked(doChecksum); + ui->checksumOnlyOnError->setEnabled(ui->doChecksum->isChecked()); + ui->checksumIgnoreIfImpossible->setEnabled(ui->doChecksum->isChecked()); + } + this->doChecksum=doChecksum; +} + +void copyEngine::set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible) +{ + listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); + if(uiIsInstalled) + ui->checksumIgnoreIfImpossible->setChecked(checksumIgnoreIfImpossible); + this->checksumIgnoreIfImpossible=checksumIgnoreIfImpossible; +} + +void copyEngine::set_checksumOnlyOnError(bool checksumOnlyOnError) +{ + listThread->set_checksumOnlyOnError(checksumOnlyOnError); + if(uiIsInstalled) + ui->checksumOnlyOnError->setChecked(checksumOnlyOnError); + this->checksumOnlyOnError=checksumOnlyOnError; +} + +void copyEngine::set_osBuffer(bool osBuffer) +{ + listThread->set_osBuffer(osBuffer); + if(uiIsInstalled) + { + ui->osBuffer->setChecked(osBuffer); + updateBufferCheckbox(); + } + this->osBuffer=osBuffer; +} + +void copyEngine::set_osBufferLimited(bool osBufferLimited) +{ + listThread->set_osBufferLimited(osBufferLimited); + if(uiIsInstalled) + { + ui->osBufferLimited->setChecked(osBufferLimited); + updateBufferCheckbox(); + } + this->osBufferLimited=osBufferLimited; +} + +void copyEngine::set_osBufferLimit(unsigned int osBufferLimit) +{ + emit send_osBufferLimit(osBufferLimit); + if(uiIsInstalled) + ui->osBufferLimit->setValue(osBufferLimit); + this->osBufferLimit=osBufferLimit; +} + +void copyEngine::updateBufferCheckbox() +{ + ui->osBufferLimited->setEnabled(ui->osBuffer->isChecked()); + ui->osBufferLimit->setEnabled(ui->osBuffer->isChecked() && ui->osBufferLimited->isChecked()); +} + +void copyEngine::set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions) +{ + if(filters!=NULL) + { + filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + emit send_setFilters(filters->getInclude(),filters->getExclude()); + } + this->includeStrings=includeStrings; + this->includeOptions=includeOptions; + this->excludeStrings=excludeStrings; + this->excludeOptions=excludeOptions; +} + +void copyEngine::setRenamingRules(QString firstRenamingRule,QString otherRenamingRule) +{ + sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +bool copyEngine::userAddFolder(const CopyMode &mode) +{ + QString source = QFileDialog::getExistingDirectory(interface,facilityEngine->translateText("Select source directory"),"",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if(source.isEmpty() || source.isNull() || source=="") + return false; + if(mode==Copy) + return newCopy(QStringList() << source); + else + return newMove(QStringList() << source); +} + +bool copyEngine::userAddFile(const CopyMode &mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QStringList sources = QFileDialog::getOpenFileNames( + interface, + facilityEngine->translateText("Select one or more files to open"), + "", + facilityEngine->translateText("All files")+" (*)"); + if(sources.isEmpty()) + return false; + if(mode==Copy) + return newCopy(sources); + else + return newMove(sources); +} + +void copyEngine::pause() +{ + emit signal_pause(); +} + +void copyEngine::resume() +{ + emit signal_resume(); +} + +void copyEngine::skip(const quint64 &id) +{ + emit signal_skip(id); +} + +void copyEngine::cancel() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + stopIt=true; + timerProgression.stop(); + timerActionDone.stop(); + emit tryCancel(); +} + +void copyEngine::removeItems(const QList &ids) +{ + emit signal_removeItems(ids); +} + +void copyEngine::moveItemsOnTop(const QList &ids) +{ + emit signal_moveItemsOnTop(ids); +} + +void copyEngine::moveItemsUp(const QList &ids) +{ + emit signal_moveItemsUp(ids); +} + +void copyEngine::moveItemsDown(const QList &ids) +{ + emit signal_moveItemsDown(ids); +} + +void copyEngine::moveItemsOnBottom(const QList &ids) +{ + emit signal_moveItemsOnBottom(ids); +} + +/** \brief give the forced mode, to export/import transfer list */ +void copyEngine::forceMode(const CopyMode &mode) +{ + if(forcedMode) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QString("Mode forced previously")); + QMessageBox::critical(NULL,facilityEngine->translateText("Internal error"),tr("The mode have been forced previously, it's internal error, please report it")); + return; + } + if(mode==Copy) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("Force mode to copy")); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("Force mode to move")); + this->mode=mode; + forcedMode=true; + emit signal_forceMode(mode); +} + +void copyEngine::exportTransferList() +{ + QString fileName = QFileDialog::getSaveFileName(NULL,facilityEngine->translateText("Save transfer list"),"transfer-list.lst",facilityEngine->translateText("Transfer list")+" (*.lst)"); + if(fileName.isEmpty()) + return; + emit signal_exportTransferList(fileName); +} + +void copyEngine::importTransferList() +{ + QString fileName = QFileDialog::getOpenFileName(NULL,facilityEngine->translateText("Open transfer list"),"transfer-list.lst",facilityEngine->translateText("Transfer list")+" (*.lst)"); + if(fileName.isEmpty()) + return; + emit signal_importTransferList(fileName); +} + +void copyEngine::warningTransferList(const QString &warning) +{ + QMessageBox::warning(interface,facilityEngine->translateText("Error"),warning); +} + +void copyEngine::errorTransferList(const QString &error) +{ + QMessageBox::critical(interface,facilityEngine->translateText("Error"),error); +} + +bool copyEngine::setSpeedLimitation(const qint64 &speedLimitation) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"maxSpeed: "+QString::number(speedLimitation)); + maxSpeed=speedLimitation; + return listThread->setSpeedLimitation(speedLimitation); +} + +void copyEngine::setCollisionAction(const QString &action) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action: "+action); + if(action=="skip") + alwaysDoThisActionForFileExists=FileExists_Skip; + else if(action=="overwrite") + alwaysDoThisActionForFileExists=FileExists_Overwrite; + else if(action=="overwriteIfNewer") + alwaysDoThisActionForFileExists=FileExists_OverwriteIfNewer; + else if(action=="overwriteIfNotSameModificationDate") + alwaysDoThisActionForFileExists=FileExists_OverwriteIfNotSameModificationDate; + else if(action=="rename") + alwaysDoThisActionForFileExists=FileExists_Rename; + else + alwaysDoThisActionForFileExists=FileExists_NotSet; + emit signal_setCollisionAction(alwaysDoThisActionForFileExists); +} + +void copyEngine::setErrorAction(const QString &action) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action: "+action); + if(action=="skip") + alwaysDoThisActionForFileError=FileError_Skip; + else if(action=="putToEndOfTheList") + alwaysDoThisActionForFileError=FileError_PutToEndOfTheList; + else + alwaysDoThisActionForFileError=FileError_NotSet; +} + +void copyEngine::setRightTransfer(const bool doRightTransfer) +{ + this->doRightTransfer=doRightTransfer; + if(uiIsInstalled) + ui->doRightTransfer->setChecked(doRightTransfer); + listThread->setRightTransfer(doRightTransfer); +} + +//set keep date +void copyEngine::setKeepDate(const bool keepDate) +{ + this->keepDate=keepDate; + if(uiIsInstalled) + ui->keepDate->setChecked(keepDate); + listThread->setKeepDate(keepDate); +} + +//set block size in KB +void copyEngine::setBlockSize(const int blockSize) +{ + this->blockSize=blockSize; + if(uiIsInstalled) + ui->blockSize->setValue(blockSize); + listThread->setBlockSize(blockSize); +} + +//set auto start +void copyEngine::setAutoStart(const bool autoStart) +{ + this->autoStart=autoStart; + if(uiIsInstalled) + ui->autoStart->setChecked(autoStart); + listThread->setAutoStart(autoStart); +} + +//set check destination folder +void copyEngine::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) +{ + this->checkDestinationFolderExists=checkDestinationFolderExists; + if(uiIsInstalled) + ui->checkBoxDestinationFolderExists->setChecked(checkDestinationFolderExists); + listThread->setCheckDestinationFolderExists(checkDestinationFolderExists); +} + +//reset widget +void copyEngine::resetTempWidget() +{ + tempWidget=NULL; +} + +void copyEngine::on_comboBoxFolderColision_currentIndexChanged(int index) +{ + switch(index) + { + case 0: + setComboBoxFolderColision(FolderExists_NotSet,false); + break; + case 1: + setComboBoxFolderColision(FolderExists_Merge,false); + break; + case 2: + setComboBoxFolderColision(FolderExists_Skip,false); + break; + case 3: + setComboBoxFolderColision(FolderExists_Rename,false); + break; + } +} + +void copyEngine::on_comboBoxFolderError_currentIndexChanged(int index) +{ + switch(index) + { + case 0: + setComboBoxFolderError(FileError_NotSet,false); + break; + case 1: + setComboBoxFolderError(FileError_Skip,false); + break; + } +} + +//set the translate +void copyEngine::newLanguageLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, retranslate the widget options"); + if(tempWidget!=NULL) + ui->retranslateUi(tempWidget); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"ui not loaded!"); +} + +void copyEngine::setComboBoxFolderColision(FolderExistsAction action,bool changeComboBox) +{ + alwaysDoThisActionForFolderExists=action; + emit signal_setFolderColision(alwaysDoThisActionForFolderExists); + if(!changeComboBox || !uiIsInstalled) + return; + switch(action) + { + case FolderExists_Merge: + ui->comboBoxFolderColision->setCurrentIndex(1); + break; + case FolderExists_Skip: + ui->comboBoxFolderColision->setCurrentIndex(2); + break; + case FolderExists_Rename: + ui->comboBoxFolderColision->setCurrentIndex(3); + break; + default: + ui->comboBoxFolderColision->setCurrentIndex(0); + break; + } +} + +void copyEngine::setComboBoxFolderError(FileErrorAction action,bool changeComboBox) +{ + alwaysDoThisActionForFileError=action; + if(!changeComboBox || !uiIsInstalled) + return; + switch(action) + { + case FileError_Skip: + ui->comboBoxFolderError->setCurrentIndex(1); + break; + default: + ui->comboBoxFolderError->setCurrentIndex(0); + break; + } +} + +void copyEngine::doChecksum_toggled(bool doChecksum) +{ + listThread->set_doChecksum(doChecksum); +} + +void copyEngine::checksumOnlyOnError_toggled(bool checksumOnlyOnError) +{ + listThread->set_checksumOnlyOnError(checksumOnlyOnError); +} + +void copyEngine::checksumIgnoreIfImpossible_toggled(bool checksumIgnoreIfImpossible) +{ + listThread->set_checksumIgnoreIfImpossible(checksumIgnoreIfImpossible); +} + +void copyEngine::osBuffer_toggled(bool osBuffer) +{ + listThread->set_osBuffer(osBuffer); + updateBufferCheckbox(); +} + +void copyEngine::osBufferLimited_toggled(bool osBufferLimited) +{ + listThread->set_osBufferLimited(osBufferLimited); + updateBufferCheckbox(); +} + +void copyEngine::osBufferLimit_editingFinished() +{ + emit send_osBufferLimit(ui->osBufferLimit->value()); +} + +void copyEngine::showFilterDialog() +{ + if(filters!=NULL) + filters->exec(); +} + +void copyEngine::sendNewFilters() +{ + if(filters!=NULL) + emit send_setFilters(filters->getInclude(),filters->getExclude()); +} + +void copyEngine::sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"new filter"); + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + emit send_sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +void copyEngine::showRenamingRules() +{ + if(renamingRules==NULL) + { + QMessageBox::critical(NULL,tr("Options error"),tr("Options engine is not loaded, can't access to the filters")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"options not loaded"); + return; + } + renamingRules->exec(); +} + +void copyEngine::get_realBytesTransfered(quint64 realBytesTransfered) +{ + size_for_speed=realBytesTransfered; +} + +void copyEngine::newActionInProgess(EngineActionInProgress action) +{ + if(action==Idle) + { + timerProgression.stop(); + timerActionDone.stop(); + } + else + { + timerProgression.start(); + timerActionDone.start(); + } +} + +//dialog message +/// \note Can be call without queue because all call will be serialized +void copyEngine::fileAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread) +{ + emit collision(); +} + +/// \note Can be call without queue because all call will be serialized +void copyEngine::errorOnFileSlot(QFileInfo fileInfo,QString errorString,TransferThread * thread) +{ + emit error(); +} + +/// \note Can be call without queue because all call will be serialized +void copyEngine::folderAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread) +{ + emit collision(); +} + +/// \note Can be call without queue because all call will be serialized +void copyEngine::errorOnFolderSlot(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread) +{ + emit error(); +} + +//mkpath event +void copyEngine::mkPathErrorOnFolderSlot(QFileInfo folder,QString error) +{ + emit error(); +} + +//rmpath event +void copyEngine::rmPathErrorOnFolderSlot(QFileInfo folder,QString error) +{ + emit error(); +} + + +/// \note Can be call without queue because all call will be serialized +void copyEngine::fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the action + if(isSame) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file is same: "+source.absoluteFilePath()); + tempFileExistsAction=alwaysDoThisActionForFileExists; + if(tempFileExistsAction==FileExists_Overwrite || tempFileExistsAction==FileExists_OverwriteIfNewer || tempFileExistsAction==FileExists_OverwriteIfNotSameModificationDate) + tempFileExistsAction=FileExists_NotSet; + switch(tempFileExistsAction) + { + case FileExists_Skip: + case FileExists_Rename: + thread->setFileExistsAction(tempFileExistsAction); + break; + default: + if(dialogIsOpen) + { + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=thread; + newItem.scan=NULL; + alreadyExistsQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + fileIsSameDialog dialog(interface,source,firstRenamingRule,otherRenamingRule); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + FileExistsAction newAction=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileExists_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) + { + alwaysDoThisActionForFileExists=newAction; + listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + switch(newAction) + { + default: + case FileExists_Skip: + emit newCollisionAction("skip"); + break; + case FileExists_Rename: + emit newCollisionAction("rename"); + break; + } + } + if(dialog.getAlways() || newAction!=FileExists_Rename) + thread->setFileExistsAction(newAction); + else + thread->setFileRename(dialog.getNewName()); + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); + tempFileExistsAction=alwaysDoThisActionForFileExists; + switch(tempFileExistsAction) + { + case FileExists_Skip: + case FileExists_Rename: + case FileExists_Overwrite: + case FileExists_OverwriteIfNewer: + case FileExists_OverwriteIfNotSameModificationDate: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"always do this action: "+QString::number(tempFileExistsAction)); + thread->setFileExistsAction(tempFileExistsAction); + break; + default: + if(dialogIsOpen) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("dialog open, put in queue: %1 %2") + .arg(source.absoluteFilePath()) + .arg(destination.absoluteFilePath()) + ); + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=thread; + newItem.scan=NULL; + alreadyExistsQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + fileExistsDialog dialog(interface,source,destination,firstRenamingRule,otherRenamingRule); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + FileExistsAction newAction=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileExists_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists) + { + alwaysDoThisActionForFileExists=newAction; + listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists); + switch(newAction) + { + default: + case FileExists_Skip: + emit newCollisionAction("skip"); + break; + case FileExists_Rename: + emit newCollisionAction("rename"); + break; + case FileExists_Overwrite: + emit newCollisionAction("overwrite"); + break; + case FileExists_OverwriteIfNewer: + emit newCollisionAction("overwriteIfNewer"); + break; + case FileExists_OverwriteIfNotSameModificationDate: + emit newCollisionAction("overwriteIfNotSameModificationDate"); + break; + } + } + if(dialog.getAlways() || newAction!=FileExists_Rename) + thread->setFileExistsAction(newAction); + else + thread->setFileRename(dialog.getNewName()); + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"emit queryOneNewDialog()"); + emit queryOneNewDialog(); + } + return; + break; + } + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +/// \note Can be call without queue because all call will be serialized +void copyEngine::errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the action + tempFileErrorAction=alwaysDoThisActionForFileError; + switch(tempFileErrorAction) + { + case FileError_Skip: + thread->skip(); + return; + case FileError_Retry: + thread->retryAfterError(); + return; + case FileError_PutToEndOfTheList: + /// \todo do the read transfer locator and put at the end + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"todo list item not found"); + return; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=fileInfo; + newItem.mkPath=false; + newItem.rmPath=false; + newItem.scan=NULL; + newItem.transfer=thread; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); + fileErrorDialog dialog(interface,fileInfo,errorString); + emit isInPause(true); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + emit isInPause(false); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + { + alwaysDoThisActionForFileError=newAction; + switch(newAction) + { + default: + case FileError_Skip: + emit newErrorAction("skip"); + break; + case FileError_PutToEndOfTheList: + emit newErrorAction("putToEndOfTheList"); + break; + } + } + switch(newAction) + { + case FileError_Skip: + thread->skip(); + break; + case FileError_Retry: + thread->retryAfterError(); + break; + case FileError_PutToEndOfTheList: + thread->putAtBottom(); + /// \todo do the read transfer locator and put at the end + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"todo"); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"file error action wrong"); + break; + } + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"isCalledByShowOneNewDialog==true then not show other dial"); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +/// \note Can be call without queue because all call will be serialized +void copyEngine::folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"folder already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath()); + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the always action + tempFolderExistsAction=alwaysDoThisActionForFolderExists; + switch(tempFolderExistsAction) + { + case FolderExists_Skip: + case FolderExists_Rename: + case FolderExists_Merge: + thread->setFolderExistsAction(tempFolderExistsAction); + break; + default: + if(dialogIsOpen) + { + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=NULL; + newItem.scan=thread; + alreadyExistsQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + folderExistsDialog dialog(interface,source,isSame,destination,firstRenamingRule,otherRenamingRule); + dialog.exec();/// \bug crash when external close + FolderExistsAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FolderExists_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFolderExists) + setComboBoxFolderColision(newAction); + if(!dialog.getAlways() && newAction==FolderExists_Rename) + thread->setFolderExistsAction(newAction,dialog.getNewName()); + else + thread->setFolderExistsAction(newAction); + dialogIsOpen=false; + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } +} + +/// \note Can be call without queue because all call will be serialized +/// \todo all this part +void copyEngine::errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString); + if(thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to locate the thread"); + return; + } + //load the always action + tempFileErrorAction=alwaysDoThisActionForFolderError; + switch(tempFileErrorAction) + { + case FileError_Skip: + case FileError_Retry: + case FileError_PutToEndOfTheList: + thread->setFolderErrorAction(tempFileErrorAction); + break; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=fileInfo; + newItem.mkPath=false; + newItem.rmPath=false; + newItem.scan=thread; + newItem.transfer=NULL; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString); + fileErrorDialog dialog(interface,fileInfo,errorString); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + setComboBoxFolderError(newAction); + dialogIsOpen=false; + thread->setFolderErrorAction(newAction); + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +// ----------------------------------------------------- + +//mkpath event +void copyEngine::mkPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); + //load the always action + tempFileErrorAction=alwaysDoThisActionForFolderError; + error_index=0; + switch(tempFileErrorAction) + { + case FileError_Skip: + listThread->mkPathQueue.skip(); + return; + case FileError_Retry: + listThread->mkPathQueue.retry(); + return; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=folder; + newItem.mkPath=true; + newItem.rmPath=false; + newItem.scan=NULL; + newItem.transfer=NULL; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); + fileErrorDialog dialog(interface,folder,errorString,false); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + { + setComboBoxFolderError(newAction); + alwaysDoThisActionForFolderError=newAction; + } + dialogIsOpen=false; + switch(newAction) + { + case FileError_Skip: + listThread->mkPathQueue.skip(); + break; + case FileError_Retry: + listThread->mkPathQueue.retry(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); + break; + } + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +//rmpath event +void copyEngine::rmPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString); + //load the always action + tempFileErrorAction=alwaysDoThisActionForFolderError; + error_index=0; + switch(tempFileErrorAction) + { + case FileError_Skip: + listThread->rmPathQueue.skip(); + return; + case FileError_Retry: + listThread->rmPathQueue.retry(); + return; + default: + if(dialogIsOpen) + { + errorQueueItem newItem; + newItem.errorString=errorString; + newItem.inode=folder; + newItem.mkPath=false; + newItem.rmPath=true; + newItem.scan=NULL; + newItem.transfer=NULL; + errorQueue << newItem; + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString); + fileErrorDialog dialog(interface,folder,errorString,false); + dialog.exec();/// \bug crash when external close + FileErrorAction newAction=dialog.getAction(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"close dialog: "+QString::number(newAction)); + if(newAction==FileError_Cancel) + { + emit cancelAll(); + return; + } + if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError) + { + setComboBoxFolderError(newAction); + alwaysDoThisActionForFolderError=newAction; + } + dialogIsOpen=false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"do the action"); + switch(newAction) + { + case FileError_Skip: + listThread->rmPathQueue.skip(); + break; + case FileError_Retry: + listThread->rmPathQueue.retry(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction)); + break; + } + if(!isCalledByShowOneNewDialog) + emit queryOneNewDialog(); + return; + break; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"stop"); +} + +//show one new dialog if needed +void copyEngine::showOneNewDialog() +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"alreadyExistsQueue.size(): "+QString::number(alreadyExistsQueue.size())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"errorQueue.size(): "+QString::number(errorQueue.size())); + loop_size=alreadyExistsQueue.size(); + while(loop_size>0) + { + if(alreadyExistsQueue.first().transfer!=NULL) + { + fileAlreadyExists(alreadyExistsQueue.first().source, + alreadyExistsQueue.first().destination, + alreadyExistsQueue.first().isSame, + alreadyExistsQueue.first().transfer, + true); + } + else if(alreadyExistsQueue.first().scan!=NULL) + folderAlreadyExists(alreadyExistsQueue.first().source, + alreadyExistsQueue.first().destination, + alreadyExistsQueue.first().isSame, + alreadyExistsQueue.first().scan, + true); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"bug, no thread actived"); + alreadyExistsQueue.removeFirst(); + loop_size--; + } + loop_size=errorQueue.size(); + while(errorQueue.size()>0) + { + if(errorQueue.first().transfer!=NULL) + errorOnFile(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().transfer,true); + else if(errorQueue.first().scan!=NULL) + errorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,errorQueue.first().scan,true); + else if(errorQueue.first().mkPath) + mkPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,true); + else if(errorQueue.first().rmPath) + rmPathErrorOnFolder(errorQueue.first().inode,errorQueue.first().errorString,true); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"bug, no thread actived"); + errorQueue.removeFirst(); + loop_size--; + } +} diff --git a/tools/unit-tester/copyEngine.h b/tools/unit-tester/copyEngine.h new file mode 100644 index 0000000..7d81724 --- /dev/null +++ b/tools/unit-tester/copyEngine.h @@ -0,0 +1,263 @@ +/** \file copyEngine.h +\brief Define the copy engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_CopyEngine.h" +#include "fileErrorDialog.h" +#include "fileExistsDialog.h" +#include "folderExistsDialog.h" +#include "fileIsSameDialog.h" +#include "ui_options.h" +#include "Environment.h" +#include "ListThread.h" +#include "Filters.h" +#include "RenamingRules.h" + +#ifndef COPY_ENGINE_H +#define COPY_ENGINE_H + +namespace Ui { + class options; +} + +/// \brief the implementation of copy engine plugin, manage directly few stuff, else pass to ListThread class. +class copyEngine : public PluginInterface_CopyEngine +{ + Q_OBJECT +public: + enum SupportedTest{Test_Copy}; + + copyEngine(const QString &path,const QList &tests); + ~copyEngine(); +private: + ListThread *listThread; + bool dialogIsOpen; + QList tests; +private slots: + void fileAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread); + void errorOnFileSlot(QFileInfo fileInfo,QString errorString,TransferThread * thread); + void folderAlreadyExistsSlot(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread); + void errorOnFolderSlot(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread); + void mkPathErrorOnFolderSlot(QFileInfo,QString); + void rmPathErrorOnFolderSlot(QFileInfo,QString); + + //dialog message + /// \note Can be call without queue because all call will be serialized + void fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog=false); + /// \note Can be call without queue because all call will be serialized + void errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog=false); + /// \note Can be call without queue because all call will be serialized + void folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); + /// \note Can be call without queue because all call will be serialized + void errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog=false); + //mkpath event + void mkPathErrorOnFolder(QFileInfo,QString,bool isCalledByShowOneNewDialog=false); + //rmpath event + void rmPathErrorOnFolder(QFileInfo,QString,bool isCalledByShowOneNewDialog=false); + + //show one new dialog if needed + void showOneNewDialog(); + void sendNewFilters(); + + void doChecksum_toggled(bool); + void checksumOnlyOnError_toggled(bool); + void checksumIgnoreIfImpossible_toggled(bool); + void osBuffer_toggled(bool); + void osBufferLimited_toggled(bool); + void osBufferLimit_editingFinished(); + void showFilterDialog(); + void sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); + void showRenamingRules(); + void get_realBytesTransfered(quint64 realBytesTransfered); + void newActionInProgess(EngineActionInProgress); + void updateBufferCheckbox(); +public: + /** \brief to send the options panel + * \return return false if have not the options + * \param tempWidget the widget to generate on it the options */ + bool getOptionsEngine(QWidget * tempWidget); + /** \brief to have interface widget to do modal dialog + * \param interface to have the widget of the interface, useful for modal dialog */ + void setInterfacePointer(QWidget * interface); + //return empty if multiple + /** \brief compare the current sources of the copy, with the passed arguments + * \param sources the sources list to compares with the current sources list + * \return true if have same sources, else false (or empty) */ + bool haveSameSource(const QStringList &sources); + /** \brief compare the current destination of the copy, with the passed arguments + * \param destination the destination to compares with the current destination + * \return true if have same destination, else false (or empty) */ + bool haveSameDestination(const QString &destination); + //external soft like file browser have send copy/move list to do + /** \brief send copy without destination, ask the destination + * \param sources the sources list to copy + * \return true if the copy have been accepted */ + bool newCopy(const QStringList &sources); + /** \brief send copy with destination + * \param sources the sources list to copy + * \param destination the destination to copy + * \return true if the copy have been accepted */ + bool newCopy(const QStringList &sources,const QString &destination); + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \return true if the move have been accepted */ + bool newMove(const QStringList &sources); + /** \brief send move without destination, ask the destination + * \param sources the sources list to move + * \param destination the destination to move + * \return true if the move have been accepted */ + bool newMove(const QStringList &sources,const QString &destination); + /** \brief send the new transfer list + * \param file the transfer list */ + void newTransferList(const QString &file); + + /** \brief to get byte read, use by Ultracopier for the speed calculation + * real size transfered to right speed calculation */ + quint64 realByteTransfered(); + //speed limitation + /** \brief get the speed limitation + * < -1 if not able, 0 if disabled */ + qint64 getSpeedLimitation(); + //get collision action + /** \brief get the collision action list */ + QList > getCollisionAction(); + /** \brief get the collision error list */ + QList > getErrorAction(); + + /** \brief to set drives detected + * specific to this copy engine */ + void setDrive(const QStringList &drives); + + /** \brief to sync the transfer list + * Used when the interface is changed, useful to minimize the memory size */ + void syncTransferList(); + + void set_doChecksum(bool doChecksum); + void set_checksumIgnoreIfImpossible(bool checksumIgnoreIfImpossible); + void set_checksumOnlyOnError(bool checksumOnlyOnError); + void set_osBuffer(bool osBuffer); + void set_osBufferLimited(bool osBufferLimited); + void set_osBufferLimit(unsigned int osBufferLimit); + void set_setFilters(QStringList includeStrings,QStringList includeOptions,QStringList excludeStrings,QStringList excludeOptions); + void setRenamingRules(QString firstRenamingRule,QString otherRenamingRule); +public slots: + //user ask ask to add folder (add it with interface ask source/destination) + /** \brief add folder called on the interface + * Used by manual adding */ + bool userAddFolder(const CopyMode &mode); + /** \brief add file called on the interface + * Used by manual adding */ + bool userAddFile(const CopyMode &mode); + //action on the copy + /// \brief put the transfer in pause + void pause(); + /// \brief resume the transfer + void resume(); + /** \brief skip one transfer entry + * \param id id of the file to remove */ + void skip(const quint64 &id); + /// \brief cancel all the transfer + void cancel(); + //edit the transfer list + /** \brief remove the selected item + * \param ids ids is the id list of the selected items */ + void removeItems(const QList &ids); + /** \brief move on top of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnTop(const QList &ids); + /** \brief move up the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsUp(const QList &ids); + /** \brief move down the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsDown(const QList &ids); + /** \brief move on bottom of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnBottom(const QList &ids); + + /** \brief give the forced mode, to export/import transfer list */ + void forceMode(const CopyMode &mode); + /// \brief export the transfer list into a file + void exportTransferList(); + /// \brief import the transfer list into a file + void importTransferList(); + + /** \brief to set the speed limitation + * -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + //action + /// \brief to set the collision action + void setCollisionAction(const QString &action); + /// \brief to set the error action + void setErrorAction(const QString &action); + + // specific to this copy engine + + /// \brief set if the rights shoul be keep + void setRightTransfer(const bool doRightTransfer); + /// \brief set keep date + void setKeepDate(const bool keepDate); + /// \brief set block size in KB + void setBlockSize(const int blockSize); + /// \brief set auto start + void setAutoStart(const bool autoStart); + /// \brief set if need check if the destination folder exists + void setCheckDestinationFolderExists(const bool checkDestinationFolderExists); + /// \brief reset widget + void resetTempWidget(); + //autoconnect + void on_comboBoxFolderColision_currentIndexChanged(int index); + void on_comboBoxFolderError_currentIndexChanged(int index); + /// \brief need retranslate the insterface + void newLanguageLoaded(); +private slots: + void setComboBoxFolderColision(FolderExistsAction action,bool changeComboBox=true); + void setComboBoxFolderError(FileErrorAction action,bool changeComboBox=true); + void warningTransferList(const QString &warning); + void errorTransferList(const QString &error); +signals: + void error(); + void collision(); + + //action on the copy + void signal_pause(); + void signal_resume(); + void signal_skip(const quint64 &id); + + //edit the transfer list + void signal_removeItems(const QList &ids); + void signal_moveItemsOnTop(const QList &ids); + void signal_moveItemsUp(const QList &ids); + void signal_moveItemsDown(const QList &ids); + void signal_moveItemsOnBottom(const QList &ids); + + void signal_forceMode(const CopyMode &mode); + void signal_exportTransferList(const QString &fileName); + void signal_importTransferList(const QString &fileName); + + //action + void signal_setCollisionAction(FileExistsAction alwaysDoThisActionForFileExists); + void signal_setComboBoxFolderColision(FolderExistsAction action); + void signal_setFolderColision(FolderExistsAction action); + + //when the cancel is clicked on copy engine dialog + void cancelAll(); + + //other signals + void queryOneNewDialog(); + + void send_osBufferLimit(const unsigned int &osBufferLimit); + void send_setFilters(const QList &include,const QList &exclude); + void send_sendNewRenamingRules(QString firstRenamingRule,QString otherRenamingRule); +}; + +#endif // COPY_ENGINE_H diff --git a/tools/unit-tester/copyEngineUnitTester.cpp b/tools/unit-tester/copyEngineUnitTester.cpp new file mode 100644 index 0000000..5632576 --- /dev/null +++ b/tools/unit-tester/copyEngineUnitTester.cpp @@ -0,0 +1,104 @@ +/** \file copyEngine.cpp +\brief Define the copy engine + */ + +#include "copyEngineUnitTester.h" + +#include +#include +#include + +copyEngineUnitTester::copyEngineUnitTester(const QString &path,const QList &tests) +{ + this->path=path; + connect(&timer,&QTimer::timeout,this,©EngineUnitTester::initialize,Qt::QueuedConnection); + srand ( time(NULL) ); +} + +copyEngineUnitTester::~copyEngineUnitTester() +{ + rmpath(path); +} + +void copyEngineUnitTester::errorSlot() +{ +} + +void copyEngineUnitTester::collisionSlot() +{ +} + +void copyEngineUnitTester::initialize() +{ + initializeSource(); +} + +void copyEngineUnitTester::initializeSource() +{ + QDir dir(path); + dir.mkpath(path); + dir.mkpath(path+"/source/"); + dir.mkpath(path+"/destination/"); +} + +bool copyEngineUnitTester::mkFile(const QString &dir,const quint16 &minSize,const quint16 &maxSize) +{ + QString name; + int index=0; + while(index<(16/4)) + { + name+=QString::number(rand()%10000); + index++; + } + QFile file(dir+"/"+name); + if(file.open(QIODevice::WriteOnly)) + { + int size=minSize+(rand()%(maxSize-minSize)); + int index=0; + QByteArray byte; + while(index +#include +#include +#include +#include +#include + +#include "copyEngine.h" + +#ifndef COPY_ENGINE_UNIT_TESTER_H +#define COPY_ENGINE_UNIT_TESTER_H + +namespace Ui { + class options; +} + +/// \brief the implementation of copy engine plugin, manage directly few stuff, else pass to ListThread class. +class copyEngineUnitTester : public copyEngine +{ + Q_OBJECT +public: + enum SupportedTest{Test_Copy}; + + copyEngineUnitTester(const QString &path,const QList &tests); + ~copyEngineUnitTester(); +private: + ListThread *listThread; + bool dialogIsOpen; + QList tests; + QTimer timer; + QString path; + void initializeSource(); + bool rmpath(const QDir &dir); + bool mkFile(const QString &dir,const quint16 &minSize=0,const quint16 &maxSize=65535); +private slots: + void errorSlot(); + void collisionSlot(); + void initialize(); +}; + +#endif // COPY_ENGINE_UNIT_TESTER_H diff --git a/tools/unit-tester/main.cpp b/tools/unit-tester/main.cpp new file mode 100644 index 0000000..3731aeb --- /dev/null +++ b/tools/unit-tester/main.cpp @@ -0,0 +1,8 @@ +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + return a.exec(); +} diff --git a/tools/unit-tester/unit-tester.pro b/tools/unit-tester/unit-tester.pro new file mode 100644 index 0000000..65dc00b --- /dev/null +++ b/tools/unit-tester/unit-tester.pro @@ -0,0 +1,42 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2012-10-19T22:52:40 +# +#------------------------------------------------- + +QT += core + +QT -= gui + +TARGET = unit-tester +CONFIG += console +CONFIG -= app_bundle + +TEMPLATE = app + + +SOURCES += main.cpp \ + ../../plugins/CopyEngine/Ultracopier/ReadThread.cpp \ + ../../plugins/CopyEngine/Ultracopier/AvancedQFile.cpp \ + ../../plugins/CopyEngine/Ultracopier/WriteThread.cpp \ + ../../plugins/CopyEngine/Ultracopier/TransferThread.cpp \ + ../../plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp \ + ../../plugins/CopyEngine/Ultracopier/ListThread.cpp \ + ../../plugins/CopyEngine/Ultracopier/MkPath.cpp \ + ../../plugins/CopyEngine/Ultracopier/scanFileOrFolder.cpp \ + ../../plugins/CopyEngine/Ultracopier/RmPath.cpp \ + copyEngineUnitTester.cpp \ + copyEngine.cpp + +HEADERS += \ + ../../plugins/CopyEngine/Ultracopier/ReadThread.h \ + ../../plugins/CopyEngine/Ultracopier/AvancedQFile.h \ + ../../plugins/CopyEngine/Ultracopier/Variable.h \ + ../../plugins/CopyEngine/Ultracopier/WriteThread.h \ + ../../plugins/CopyEngine/Ultracopier/TransferThread.h \ + ../../plugins/CopyEngine/Ultracopier/ListThread.h \ + ../../plugins/CopyEngine/Ultracopier/MkPath.h \ + ../../plugins/CopyEngine/Ultracopier/scanFileOrFolder.h \ + ../../plugins/CopyEngine/Ultracopier/RmPath.h \ + copyEngineUnitTester.h \ + copyEngine.h diff --git a/ultracopier-all-in-one-direct.pro b/ultracopier-all-in-one-direct.pro new file mode 100644 index 0000000..3df4fb4 --- /dev/null +++ b/ultracopier-all-in-one-direct.pro @@ -0,0 +1,119 @@ +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE + +include(ultracopier-core.pro) + +RESOURCES += plugins/static-plugins.qrc \ + plugins/CopyEngine/Ultracopier/copyEngineResources.qrc \ + plugins/Themes/Oxygen/interfaceResources_unix.qrc \ + plugins/Themes/Oxygen/interfaceResources_windows.qrc \ + plugins/Themes/Oxygen/interfaceResources.qrc + +win32:RESOURCES += plugins/static-plugins-windows.qrc + +HEADERS -= lib/qt-tar-xz/xz.h \ + lib/qt-tar-xz/QXzDecodeThread.h \ + lib/qt-tar-xz/QXzDecode.h \ + lib/qt-tar-xz/QTarDecode.h \ + AuthPlugin.h +SOURCES -= lib/qt-tar-xz/QXzDecodeThread.cpp \ + lib/qt-tar-xz/QXzDecode.cpp \ + lib/qt-tar-xz/QTarDecode.cpp \ + lib/qt-tar-xz/xz_crc32.c \ + lib/qt-tar-xz/xz_dec_stream.c \ + lib/qt-tar-xz/xz_dec_lzma2.c \ + lib/qt-tar-xz/xz_dec_bcj.c \ + AuthPlugin.cpp +INCLUDEPATH -= lib/qt-tar-xz/ + +RESOURCES -= resources/resources-windows-qt-plugin.qrc + +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + +FORMS += \ + plugins/CopyEngine/Ultracopier/copyEngineOptions.ui \ + plugins/CopyEngine/Ultracopier/debugDialog.ui \ + plugins/CopyEngine/Ultracopier/DiskSpace.ui \ + plugins/CopyEngine/Ultracopier/fileErrorDialog.ui \ + plugins/CopyEngine/Ultracopier/fileExistsDialog.ui \ + plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui \ + plugins/CopyEngine/Ultracopier/FilterRules.ui \ + plugins/CopyEngine/Ultracopier/Filters.ui \ + plugins/CopyEngine/Ultracopier/folderExistsDialog.ui \ + plugins/CopyEngine/Ultracopier/RenamingRules.ui \ + plugins/Themes/Oxygen/themesOptions.ui \ + plugins/Themes/Oxygen/options.ui \ + plugins/Themes/Oxygen/interface.ui + +HEADERS += \ + plugins/CopyEngine/Ultracopier/AvancedQFile.h \ + plugins/CopyEngine/Ultracopier/CompilerInfo.h \ + plugins/CopyEngine/Ultracopier/CopyEngine.h \ + plugins/CopyEngine/Ultracopier/DebugDialog.h \ + plugins/CopyEngine/Ultracopier/DebugEngineMacro.h \ + plugins/CopyEngine/Ultracopier/DiskSpace.h \ + plugins/CopyEngine/Ultracopier/DriveManagement.h \ + plugins/CopyEngine/Ultracopier/Environment.h \ + plugins/CopyEngine/Ultracopier/CopyEngineFactory.h \ + plugins/CopyEngine/Ultracopier/FileErrorDialog.h \ + plugins/CopyEngine/Ultracopier/FileExistsDialog.h \ + plugins/CopyEngine/Ultracopier/FileIsSameDialog.h \ + plugins/CopyEngine/Ultracopier/FilterRules.h \ + plugins/CopyEngine/Ultracopier/Filters.h \ + plugins/CopyEngine/Ultracopier/FolderExistsDialog.h \ + plugins/CopyEngine/Ultracopier/MkPath.h \ + plugins/CopyEngine/Ultracopier/ListThread.h \ + plugins/CopyEngine/Ultracopier/ReadThread.h \ + plugins/CopyEngine/Ultracopier/RenamingRules.h \ + plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h \ + plugins/CopyEngine/Ultracopier/StructEnumDefinition_CopyEngine.h \ + plugins/CopyEngine/Ultracopier/StructEnumDefinition.h \ + plugins/CopyEngine/Ultracopier/TransferThread.h \ + plugins/CopyEngine/Ultracopier/Variable.h \ + plugins/CopyEngine/Ultracopier/WriteThread.h \ + plugins/Listener/catchcopy-v0002/Variable.h \ + plugins/Listener/catchcopy-v0002/StructEnumDefinition.h \ + plugins/Listener/catchcopy-v0002/listener.h \ + plugins/Listener/catchcopy-v0002/Environment.h \ + plugins/Listener/catchcopy-v0002/DebugEngineMacro.h \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h \ + plugins/Themes/Oxygen/DebugEngineMacro.h \ + plugins/Themes/Oxygen/Environment.h \ + plugins/Themes/Oxygen/ThemesFactory.h \ + plugins/Themes/Oxygen/interface.h \ + plugins/Themes/Oxygen/Variable.h \ + plugins/Themes/Oxygen/TransferModel.h \ + plugins/Themes/Oxygen/StructEnumDefinition.h + +SOURCES += \ + plugins/CopyEngine/Ultracopier/AvancedQFile.cpp \ + plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp \ + plugins/CopyEngine/Ultracopier/CopyEngine.cpp \ + plugins/CopyEngine/Ultracopier/DebugDialog.cpp \ + plugins/CopyEngine/Ultracopier/DiskSpace.cpp \ + plugins/CopyEngine/Ultracopier/DriveManagement.cpp \ + plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp \ + plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp \ + plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp \ + plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp \ + plugins/CopyEngine/Ultracopier/FilterRules.cpp \ + plugins/CopyEngine/Ultracopier/Filters.cpp \ + plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp \ + plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp \ + plugins/CopyEngine/Ultracopier/MkPath.cpp \ + plugins/CopyEngine/Ultracopier/ReadThread.cpp \ + plugins/CopyEngine/Ultracopier/RenamingRules.cpp \ + plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp \ + plugins/CopyEngine/Ultracopier/TransferThread.cpp \ + plugins/CopyEngine/Ultracopier/WriteThread.cpp \ + plugins/CopyEngine/Ultracopier/ListThread.cpp \ + plugins/Listener/catchcopy-v0002/listener.cpp \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp \ + plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp \ + plugins/Themes/Oxygen/ThemesFactory.cpp \ + plugins/Themes/Oxygen/interface.cpp \ + plugins/Themes/Oxygen/TransferModel.cpp diff --git a/ultracopier-core.pro b/ultracopier-core.pro new file mode 100644 index 0000000..d5b382e --- /dev/null +++ b/ultracopier-core.pro @@ -0,0 +1,125 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +TEMPLATE = app +QT += network xml widgets +TRANSLATIONS += plugins/Languages/ar/translation.ts \ + plugins/Languages/de/translation.ts \ + plugins/Languages/el/translation.ts \ + resources/Languages/en/translation.ts \ + plugins/Languages/es/translation.ts \ + plugins/Languages/fr/translation.ts \ + plugins/Languages/hi/translation.ts \ + plugins/Languages/hu/translation.ts \ + plugins/Languages/id/translation.ts \ + plugins/Languages/it/translation.ts \ + plugins/Languages/ja/translation.ts \ + plugins/Languages/ko/translation.ts \ + plugins/Languages/nl/translation.ts \ + plugins/Languages/no/translation.ts \ + plugins/Languages/pl/translation.ts \ + plugins/Languages/pt/translation.ts \ + plugins/Languages/ru/translation.ts \ + plugins/Languages/th/translation.ts \ + plugins/Languages/tr/translation.ts \ + plugins/Languages/zh/translation.ts + +TARGET = ultracopier +macx { + ICON = resources/ultracopier.icns + #QT += macextras +} +FORMS += HelpDialog.ui \ + PluginInformation.ui \ + OptionDialog.ui \ + OSSpecific.ui +RESOURCES += \ + resources/ultracopier-resources.qrc \ + resources/ultracopier-resources_unix.qrc \ + resources/ultracopier-resources_windows.qrc +win32 { + RESOURCES += resources/resources-windows-qt-plugin.qrc + RC_FILE += resources/resources-windows.rc + #LIBS += -lpdh + LIBS += -ladvapi32 +} + +HEADERS += ResourcesManager.h \ + ThemesManager.h \ + SystrayIcon.h \ + StructEnumDefinition.h \ + EventDispatcher.h \ + Environment.h \ + DebugEngine.h \ + Core.h \ + OptionEngine.h \ + HelpDialog.h \ + PluginsManager.h \ + LanguagesManager.h \ + DebugEngineMacro.h \ + PluginInformation.h \ + lib/qt-tar-xz/xz.h \ + lib/qt-tar-xz/QXzDecodeThread.h \ + lib/qt-tar-xz/QXzDecode.h \ + lib/qt-tar-xz/QTarDecode.h \ + SessionLoader.h \ + ExtraSocket.h \ + CopyListener.h \ + CopyEngineManager.h \ + PlatformMacro.h \ + interface/PluginInterface_Themes.h \ + interface/PluginInterface_SessionLoader.h \ + interface/PluginInterface_Listener.h \ + interface/PluginInterface_CopyEngine.h \ + interface/OptionInterface.h \ + Variable.h \ + PluginLoader.h \ + interface/PluginInterface_PluginLoader.h \ + OptionDialog.h \ + LocalPluginOptions.h \ + LocalListener.h \ + CliParser.h \ + interface/FacilityInterface.h \ + FacilityEngine.h \ + LogThread.h \ + CompilerInfo.h \ + StructEnumDefinition_UltracopierSpecific.h \ + OSSpecific.h \ + InternetUpdater.h +SOURCES += ThemesManager.cpp \ + ResourcesManager.cpp \ + main.cpp \ + EventDispatcher.cpp \ + SystrayIcon.cpp \ + DebugEngine.cpp \ + OptionEngine.cpp \ + HelpDialog.cpp \ + PluginsManager.cpp \ + LanguagesManager.cpp \ + PluginInformation.cpp \ + lib/qt-tar-xz/QXzDecodeThread.cpp \ + lib/qt-tar-xz/QXzDecode.cpp \ + lib/qt-tar-xz/QTarDecode.cpp \ + lib/qt-tar-xz/xz_crc32.c \ + lib/qt-tar-xz/xz_dec_stream.c \ + lib/qt-tar-xz/xz_dec_lzma2.c \ + lib/qt-tar-xz/xz_dec_bcj.c \ + SessionLoader.cpp \ + ExtraSocket.cpp \ + CopyListener.cpp \ + CopyEngineManager.cpp \ + Core.cpp \ + PluginLoader.cpp \ + OptionDialog.cpp \ + LocalPluginOptions.cpp \ + LocalListener.cpp \ + CliParser.cpp \ + FacilityEngine.cpp \ + LogThread.cpp \ + OSSpecific.cpp \ + DebugModel.cpp \ + InternetUpdater.cpp +INCLUDEPATH += lib/qt-tar-xz/ + +OTHER_FILES += resources/resources-windows.rc diff --git a/ultracopier-static.pro b/ultracopier-static.pro new file mode 100644 index 0000000..27bf2b9 --- /dev/null +++ b/ultracopier-static.pro @@ -0,0 +1,6 @@ +include(static.pro) + +RESOURCES += plugins/static-plugins-oxygen.qrc \ + plugins/Themes/Oxygen/interfaceResources_windows.qrc \ + plugins/Themes/Oxygen/interfaceResources_unix.qrc \ + plugins/Themes/Oxygen/interfaceResources.qrc diff --git a/ultracopier.dox b/ultracopier.dox old mode 100755 new mode 100644 index b19b2d7..47b83b3 --- a/ultracopier.dox +++ b/ultracopier.dox @@ -20,8 +20,8 @@ \section mainpage_platforms Platforms - Ultracopier might be usable in all environments where you find Qt 4.\n - Ultracopier requires Qt 4.5.x or newer. Tested on Qt 4.7. Due to optimization Qt 4.8 usage will be better. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.4 or newer. Tested on Qt 5.4. \section mainpage_downloads Downloads @@ -31,7 +31,7 @@ \section license GPL Version 3 The core, and some default plugin are under GPL Version 3. See into each part to see the license.\n document-save.png -> all SystemTrayIcon/systray_* (color alteration) done by png manipulation of KDE's oxygen icon pack.\n - From 16x16/actions/: arrow-down.png -> moveDown.png, arrow-up.png -> moveUp.png, document-encrypt.png -> document-encrypt.png \n + From 16x16/actions/: arrow-down.png -> moveDown.png, arrow-up.png -> moveUp.png \n All Ultracopier are from devices/drive-removable-media-usb.png, and same icon with U is touched by gimp.\n from 128x128: actions/application-exit.png -> none-128x128.png, apps/kbugbuster.png -> bug-128x128.png diff --git a/ultracopier.pro b/ultracopier.pro deleted file mode 100644 index dd33bc5..0000000 --- a/ultracopier.pro +++ /dev/null @@ -1,119 +0,0 @@ -TEMPLATE = app -QT += network xml -TRANSLATIONS += plugins/Languages/fr/translation.ts \ - plugins/Languages/ar/translation.ts \ - plugins/Languages/zh/translation.ts \ - plugins/Languages/es/translation.ts \ - plugins/Languages/de/translation.ts \ - plugins/Languages/el/translation.ts \ - plugins/Languages/it/translation.ts \ - plugins/Languages/ja/translation.ts \ - plugins/Languages/id/translation.ts \ - plugins/Languages/pl/translation.ts \ - plugins/Languages/ru/translation.ts \ - plugins/Languages/tr/translation.ts \ - plugins/Languages/th/translation.ts \ - plugins/Languages/hi/translation.ts \ - plugins/Languages/nl/translation.ts \ - plugins/Languages/no/translation.ts \ - plugins/Languages/pt/translation.ts \ - plugins/Languages/ko/translation.ts - -win32:RC_FILE += resources/resources-windows.rc -TARGET = ultracopier -macx { - ICON = resources/ultracopier.icns -} -FORMS += HelpDialog.ui \ - PluginInformation.ui \ - OptionDialog.ui -RESOURCES += resources/resources.qrc -win32 { - RESOURCES += resources/resources_windows.qrc -} -!win32 { - RESOURCES += resources/resources_unix.qrc -} - -HEADERS += ResourcesManager.h \ - ThemesManager.h \ - SystrayIcon.h \ - StructEnumDefinition.h \ - Singleton.h \ - EventDispatcher.h \ - Environment.h \ - DebugEngine.h \ - Core.h \ - GlobalClass.h \ - OptionEngine.h \ - HelpDialog.h \ - PluginsManager.h \ - LanguagesManager.h \ - DebugEngineMacro.h \ - PluginInformation.h \ - lib/qt-tar-xz/xz.h \ - lib/qt-tar-xz/QXzDecodeThread.h \ - lib/qt-tar-xz/QXzDecode.h \ - lib/qt-tar-xz/QTarDecode.h \ - AuthPlugin.h \ - SessionLoader.h \ - ExtraSocket.h \ - CopyListener.h \ - CopyEngineManager.h \ - PlatformMacro.h \ - interface/PluginInterface_Themes.h \ - interface/PluginInterface_SessionLoader.h \ - interface/PluginInterface_Listener.h \ - interface/PluginInterface_CopyEngine.h \ - interface/OptionInterface.h \ - Variable.h \ - PluginLoader.h \ - interface/PluginInterface_PluginLoader.h \ - OptionDialog.h \ - LocalPluginOptions.h \ - LocalListener.h \ - CliParser.h \ - interface/FacilityInterface.h \ - FacilityEngine.h \ - LogThread.h \ - CompilerInfo.h \ - StructEnumDefinition_UltracopierSpecific.h -SOURCES += ThemesManager.cpp \ - ResourcesManager.cpp \ - main.cpp \ - EventDispatcher.cpp \ - SystrayIcon.cpp \ - GlobalClass.cpp \ - DebugEngine.cpp \ - OptionEngine.cpp \ - HelpDialog.cpp \ - PluginsManager.cpp \ - LanguagesManager.cpp \ - PluginInformation.cpp \ - lib/qt-tar-xz/QXzDecodeThread.cpp \ - lib/qt-tar-xz/QXzDecode.cpp \ - lib/qt-tar-xz/QTarDecode.cpp \ - lib/qt-tar-xz/xz_crc32.c \ - lib/qt-tar-xz/xz_dec_stream.c \ - lib/qt-tar-xz/xz_dec_lzma2.c \ - lib/qt-tar-xz/xz_dec_bcj.c \ - AuthPlugin.cpp \ - SessionLoader.cpp \ - ExtraSocket.cpp \ - CopyListener.cpp \ - CopyEngineManager.cpp \ - Core.cpp \ - PluginLoader.cpp \ - OptionDialog.cpp \ - LocalPluginOptions.cpp \ - LocalListener.cpp \ - CliParser.cpp \ - FacilityEngine.cpp \ - LogThread.cpp -INCLUDEPATH += lib/qt-tar-xz/ - -OTHER_FILES += \ - resources/resources-windows.rc \ - resources/ultracopier.exe.x86.manifest \ - resources/ultracopier.exe.amd64.manifest - -- cgit v1.2.3