From fff98e1edbbd58747394308d93d58869c5902ca9 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Thu, 1 Mar 2018 22:42:01 +0000 Subject: Import ultracopier_1.4.0.4-1.debian.tar.xz [dgit import tarball ultracopier 1.4.0.4-1 ultracopier_1.4.0.4-1.debian.tar.xz] --- changelog | 140 ++++++++++++++++++++++++++++++++++++++++++ compat | 1 + control | 22 +++++++ copyright | 101 ++++++++++++++++++++++++++++++ rules | 30 +++++++++ source/format | 1 + ultracopier.1 | 44 +++++++++++++ ultracopier.lintian-overrides | 2 + ultracopier.manpages | 1 + ultracopier.menu | 5 ++ watch | 3 + 11 files changed, 350 insertions(+) create mode 100644 changelog create mode 100644 compat create mode 100644 control create mode 100644 copyright create mode 100755 rules create mode 100644 source/format create mode 100644 ultracopier.1 create mode 100644 ultracopier.lintian-overrides create mode 100644 ultracopier.manpages create mode 100644 ultracopier.menu create mode 100644 watch diff --git a/changelog b/changelog new file mode 100644 index 0000000..fee7679 --- /dev/null +++ b/changelog @@ -0,0 +1,140 @@ +ultracopier (1.4.0.4-1) unstable; urgency=medium + + * New upstream release: + + Drop all patches. + * debian/control: + + Make Vcs-Browser URL canonical. + + -- Thomas Preud'homme Thu, 01 Mar 2018 22:42:01 +0000 + +ultracopier (1.4.0.3-2) unstable; urgency=medium + + * debian/control: + + Update Vcs fields. + * debian/patches: + + Drop patch to disable ultimate build, no longer needed. + + Update meta-information on patch for Hurd support. + + -- Thomas Preud'homme Sun, 25 Feb 2018 14:22:33 +0000 + +ultracopier (1.4.0.3-1) unstable; urgency=medium + + * New upstream release. + * debian/rules: + + Build ultracopier.pro instead of ultracopier-all-in-one-direct.pro + * debian/patches: + + Add patch to accept Hurd as a supported platform. + + -- Thomas Preud'homme Fri, 23 Feb 2018 23:55:01 +0000 + +ultracopier (1.2.3.6-1) unstable; urgency=low + + * New upstream release (Closes: #875217): + + Drop all patches. + * debian/control: + + Build-depend on Qt5 libraries. + + Bump debhelper's Build-depend version + + Lower priority to optional. + + Bump standard version. + + Use secure and canonical VCS URIs. + * debian/rules: + + Update qmake project file to build. + + Generate and clean Qt message files. + + Select Qt5 libraries. + + Configure and enable installation. + + Enable all hardening flags. + + Stop patching architecture in informations.xml files. + + Stop fiddling with permissions of flag.png images. + * debian/patches: + + Disable ultimate build. + * debian/copyright: + + Remove inline GPL-3 paragraph. + + Use HTTPS URL for format field. + + Update copyright years. + * debian/watch: + + Fix URL to upstream tarballs (thanks Bart Martens). + * debian/compat: + + Bump compat version. + * Remove debian/detect_arch.cpp and debian/detect_arch.pro. + + -- Thomas Preud'homme Wed, 14 Feb 2018 22:54:13 +0000 + +ultracopier (0.3.1.0-1) unstable; urgency=low + + * New upstream release + * Remove merged patches: + - 0001-Also-search-resources-in-var-lib-ultracopier.patch + - 0002-Update-the-list-of-available-translations.patch + * debian/rules: + + Explicitly set ultracopier.pro as the main project file. + + Stop creating player_pause.png resource for Teracopy theme since it is + now in upstream tarball. + + Drop executable permissions on flag.png images at build time. + + Fix ultracopier platform value in source code before building it. + * Drop hardening-no-fortify-functions lintian override since it is a false + positive (thanks Paul Tagliamonte). + + -- Thomas Preud'homme Thu, 21 Mar 2013 15:31:34 +0100 + +ultracopier (0.3.0.5-1) unstable; urgency=low + + * New upstream release. + * debian/patches: + + 0001-Also-search-resources-in-var-lib-ultracopier.patch + + 0002-Update-the-list-of-available-translations.patch + + 0003-Create-a-rule-to-compile-.ts-into-.qm.patch + + 0004-Set-resources-installation-path.patch + + 0005-Build-ultracopier-with-resources.patch + + 0006-Avoid-linking-against-libpthread.patch + + 0007-Fix-typos-in-string-shown-to-the-user.patch + * debian/rules: + + Explicitly set build.pro as the main project file. + + Create missing resources/player_pause.png resource in + plugins-alternative/Themes/Teracopy via a symlink to + plugins/Themes/Oxygen/resources/player_pause.png. + + Stop making i18n files executable. + + Set QMAKE_CXXFLAGS_RELEASE and QMAKE_CXXFLAGS_DEBUG from CPPFLAGS and + CXXFLAGS when invoking qmake. + * debian/control: + + Bump Standards-Version to 3.9.4 (no changes needed). + + Update build dependency version on debhelper to reflect compatibility. + + Update maintainer email address. + * debian/copyright: + + Update and complete copyright information. + + Use version 1.0 of the format specification. + + Update maintainer email address. + * Bump debhelper compatibility to 9. + * Override no-upstream-changelog lintian warning as there simply is no + upstream changelog. + * Override hardening-no-fortify-functions warning as -D_FORTIFY_SOURCE=2 is + correctly passed to g++. + + -- Thomas Preud'homme Mon, 31 Dec 2012 20:00:53 +0100 + +ultracopier (0.2.0.16-2) unstable; urgency=low + + * debian/rules: + + Use dpkg-buildflags to set build flags (CPPFLAGS, CFLAGS and LDFLAGS). + * debian/copyright: + + Document global license and copyright. + + Add missing dots in Expat license block. + + -- Thomas Preud'homme Thu, 16 Jun 2011 16:16:43 +0200 + +ultracopier (0.2.0.16-1) unstable; urgency=low + + * Initial release (Closes: #599008). + * Modifications made to upstream archive: + + Remove the inclusion of a non-existent file in qmake project file. + + Set the name of the executable. + + Populate INSTALLS variable to create an install target in + generated Makefile. + + Avoid linking Ultracopier against libpthread. + + Remove deprecated TerminalOptions key in desktop entry. + + Fix two typos affecting the binary. + + Fix program version number + * Add a manpage. + * debian/copyright: + + Use DEP5 candidate format. + + -- Thomas Preud'homme Thu, 30 Sep 2010 21:58:07 +0200 diff --git a/compat b/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/compat @@ -0,0 +1 @@ +11 diff --git a/control b/control new file mode 100644 index 0000000..4d26a93 --- /dev/null +++ b/control @@ -0,0 +1,22 @@ +Source: ultracopier +Section: utils +Priority: optional +Maintainer: Thomas Preud'homme +Build-Depends: debhelper (>= 11), qtbase5-dev, kdelibs5-dev, qt5-qmake, + qttools5-dev-tools +Standards-Version: 4.1.3 +Homepage: http://ultracopier.first-world.info/ +Vcs-Git: https://salsa.debian.org/debian/ultracopier.git +Vcs-Browser: https://salsa.debian.org/debian/ultracopier + +Package: ultracopier +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: advanced graphical file copy system + Ultracopier is a graphical file copy system featuring: + - transfer suspend + - speed control + - transfer list management + - advanced name colision and error management + . + Ultracopier also supports multiple skins and languages. diff --git a/copyright b/copyright new file mode 100644 index 0000000..24491c6 --- /dev/null +++ b/copyright @@ -0,0 +1,101 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Ultracopier +Upstream-Contact: Herman Brule +Source: http://files.first-world.info/ultracopier/ +License: GPL-3 + +Files: * +Copyright: 2010-2017 Herman Brule +License: GPL-3 + +Files: debian/* +Copyright: 2010-2018 Thomas Preud'homme +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +Files: resources/*.png resources/img-src/* +Copyright: 2007 Nuno Pinheiro + 2007 David Vignoni + 2007 David Miller + 2007 Johann Ollivier Lapeyre + 2007 Kenneth Wimer + 2007 Riccardo Iaconelli +License: LGPL-3+ + +Files: plugins/Languages/*.png ./resources/Languages/*.png +Copyright: 2012 Matthieu Aubry +License: GPL-3+ + +Files: lib/qt-tar-xz/xz* +Copyright: Lasse Collin + Igor Pavlov +License: public-domain + XZ Embedded has been put into the public domain, thus you can do whatever you + want with it. All the files in XZ Embedded have been written by Lasse Collin, + but some files are heavily based on public domain code written by Igor Pavlov. + +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU General Public License version 3 + can be found in the file `/usr/share/common-licenses/GPL-3'. + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU General Public License version 3 + can be found in the file `/usr/share/common-licenses/GPL-3'. + +License: LGPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU Lesser General Public License + version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. diff --git a/rules b/rules new file mode 100755 index 0000000..da20b2d --- /dev/null +++ b/rules @@ -0,0 +1,30 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export QT_SELECT:=qt5 +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +override_dh_auto_configure: + lrelease ultracopier.pro + lrelease plugins/CopyEngine/Ultracopier/CopyEngine.pro + lrelease plugins/Themes/Oxygen/interface.pro + dh_auto_configure --buildsystem=qmake -- \ + QMAKE_CXXFLAGS_RELEASE="$(CXXFLAGS) $(CPPFLAGS)" \ + QMAKE_CXXFLAGS_DEBUG="$(CXXFLAGS) $(CPPFLAGS)" \ + target.path=/usr/bin "INSTALLS+=target" \ + ultracopier.pro + +clean: + rm -f build + dh clean --buildsystem=qmake + find -name \*.qm -delete + rm -f debian/detect_arch + +build: + dh build --buildsystem=qmake + touch build + +%: + dh $@ --buildsystem=qmake diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/ultracopier.1 b/ultracopier.1 new file mode 100644 index 0000000..61fa366 --- /dev/null +++ b/ultracopier.1 @@ -0,0 +1,44 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH ULTRACOPIER 1 "October 3, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +ultracopier \- Advanced graphical file copy system +.SH SYNOPSIS +.B ultracopier +.SH DESCRIPTION +This manual page documents briefly the +.B ultracopier +command. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBultracopier\fP is a program that offers a graphical user interface to +enhance control over file copying and renaming. Enhanced control +includes: + \- transfer suspend + \- speed control + \- transfer list management + \- advanced name colision and error management +.br +\fBultracopier\fP also supports multiple skins and languages, and takes +no argument. +.SH AUTHOR +ultracopier was written by Herman Brule . +.PP +This manual page was written by Thomas Preud'homme , +for the Debian project (and may be used by others). diff --git a/ultracopier.lintian-overrides b/ultracopier.lintian-overrides new file mode 100644 index 0000000..2ad535c --- /dev/null +++ b/ultracopier.lintian-overrides @@ -0,0 +1,2 @@ +# Upstream archive doesn't contain any changelog +ultracopier binary: no-upstream-changelog diff --git a/ultracopier.manpages b/ultracopier.manpages new file mode 100644 index 0000000..4965cfa --- /dev/null +++ b/ultracopier.manpages @@ -0,0 +1 @@ +debian/ultracopier.1 diff --git a/ultracopier.menu b/ultracopier.menu new file mode 100644 index 0000000..e764d51 --- /dev/null +++ b/ultracopier.menu @@ -0,0 +1,5 @@ +?package(ultracopier):\ + needs="X11"\ + section="Applications/File Management"\ + title="Ultracopier"\ + command="/usr/bin/ultracopier" diff --git a/watch b/watch new file mode 100644 index 0000000..47ebe9d --- /dev/null +++ b/watch @@ -0,0 +1,3 @@ +version=3 +http://files.first-world.info/ultracopier/(\d+(?:\.\d+)*)/ ultracopier-src(?:-|\.|_|_v|)(\d\S*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) debian uupdate +# Bart Martens Wed, 20 Mar 2013 19:32:45 +0000 -- cgit v1.2.3 From 3958fa914c8a524ed4b6a5b035b794e12708fa1d Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Thu, 1 Mar 2018 22:42:01 +0000 Subject: Import ultracopier_1.4.0.4.orig.tar.xz [dgit import orig ultracopier_1.4.0.4.orig.tar.xz] --- COPYING | 674 ++ CliParser.cpp | 197 + CliParser.h | 55 + CompilerInfo.h | 15 + CopyEngineManager.cpp | 385 + CopyEngineManager.h | 105 + CopyListener.cpp | 480 + CopyListener.h | 123 + Core.cpp | 1161 ++ Core.h | 197 + DebugEngine.cpp | 395 + DebugEngine.h | 131 + DebugEngineMacro.h | 28 + DebugModel.cpp | 158 + Environment.h | 21 + EventDispatcher.cpp | 699 ++ EventDispatcher.h | 97 + ExtraSocket.cpp | 60 + ExtraSocket.h | 30 + FacilityEngine.cpp | 251 + FacilityEngine.h | 76 + HelpDialog.cpp | 145 + HelpDialog.h | 48 + HelpDialog.ui | 191 + InternetUpdater.cpp | 110 + InternetUpdater.h | 33 + LanguagesManager.cpp | 287 + LanguagesManager.h | 78 + LocalListener.cpp | 348 + LocalListener.h | 65 + LocalPluginOptions.cpp | 59 + LocalPluginOptions.h | 42 + LogThread.cpp | 296 + LogThread.h | 98 + OSSpecific.cpp | 58 + OSSpecific.h | 29 + OSSpecific.ui | 108 + OptionDialog.cpp | 1015 ++ OptionDialog.h | 122 + OptionDialog.ui | 988 ++ OptionEngine.cpp | 242 + OptionEngine.h | 87 + PlatformMacro.h | 59 + PluginInformation.cpp | 120 + PluginInformation.h | 42 + PluginInformation.ui | 136 + PluginLoader.cpp | 339 + PluginLoader.h | 82 + PluginsManager.cpp | 932 ++ PluginsManager.h | 157 + README | 46 + README.sources | 32 + ResourcesManager.cpp | 216 + ResourcesManager.h | 54 + SessionLoader.cpp | 171 + SessionLoader.h | 61 + StructEnumDefinition.h | 153 + StructEnumDefinition_UltracopierSpecific.h | 55 + SystrayIcon.cpp | 559 + SystrayIcon.h | 144 + ThemesManager.cpp | 291 + ThemesManager.h | 87 + Variable.h | 50 + cpp11addition.cpp | 531 + cpp11addition.h | 203 + cpp11additionstringtointcpp.cpp | 485 + interface/FacilityInterface.h | 44 + interface/OptionInterface.h | 36 + interface/PluginInterface_CopyEngine.h | 208 + interface/PluginInterface_Listener.h | 56 + interface/PluginInterface_PluginLoader.h | 39 + interface/PluginInterface_SessionLoader.h | 39 + interface/PluginInterface_Themes.h | 115 + lib/qt-tar-xz/QTarDecode.cpp | 174 + lib/qt-tar-xz/QTarDecode.h | 36 + lib/qt-tar-xz/QXzDecode.cpp | 146 + lib/qt-tar-xz/QXzDecode.h | 40 + lib/qt-tar-xz/QXzDecodeThread.cpp | 48 + lib/qt-tar-xz/QXzDecodeThread.h | 37 + lib/qt-tar-xz/xz.h | 273 + lib/qt-tar-xz/xz_config.h | 123 + lib/qt-tar-xz/xz_crc32.c | 52 + lib/qt-tar-xz/xz_dec_bcj.c | 564 + lib/qt-tar-xz/xz_dec_lzma2.c | 1175 ++ lib/qt-tar-xz/xz_dec_stream.c | 822 ++ lib/qt-tar-xz/xz_lzma2.h | 204 + lib/qt-tar-xz/xz_private.h | 159 + lib/qt-tar-xz/xz_stream.h | 57 + main.cpp | 149 + other-pro/static.pro | 33 + other-pro/supercopier-core.pro | 3 + other-pro/ultracopier-core.pro | 131 + other-pro/ultracopier-static.pro | 6 + plugins-alternative/Listener/dbus/Catchcopy.cpp | 17 + plugins-alternative/Listener/dbus/Catchcopy.h | 20 + .../Listener/dbus/DebugEngineMacro.h | 28 + plugins-alternative/Listener/dbus/Environment.h | 10 + .../Listener/dbus/StructEnumDefinition.h | 1 + plugins-alternative/Listener/dbus/Variable.h | 15 + .../Listener/dbus/documentation.dox | 36 + plugins-alternative/Listener/dbus/informations.xml | 26 + plugins-alternative/Listener/dbus/listener.cpp | 85 + plugins-alternative/Listener/dbus/listener.h | 49 + plugins-alternative/Listener/dbus/listener.pro | 19 + plugins-alternative/Listener/dbus/plugin.json | 1 + .../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 | 33 + .../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 + .../SessionLoader/KDE4/DebugEngineMacro.h | 28 + .../SessionLoader/KDE4/Environment.h | 10 + .../SessionLoader/KDE4/StructEnumDefinition.h | 1 + plugins-alternative/SessionLoader/KDE4/Variable.h | 15 + .../SessionLoader/KDE4/documentation.dox | 32 + .../SessionLoader/KDE4/informations.xml | 26 + plugins-alternative/SessionLoader/KDE4/plugin.json | 1 + .../SessionLoader/KDE4/sessionLoader.cpp | 58 + .../SessionLoader/KDE4/sessionLoader.h | 33 + .../SessionLoader/KDE4/sessionLoader.pro | 15 + .../Themes/Clean/Languages/ar/translation.ts | 55 + .../Themes/Clean/Languages/de/translation.ts | 55 + .../Themes/Clean/Languages/el/translation.ts | 55 + .../Themes/Clean/Languages/en/translation.ts | 55 + .../Themes/Clean/Languages/es/translation.ts | 55 + .../Themes/Clean/Languages/fr/translation.ts | 55 + .../Themes/Clean/Languages/hi/translation.ts | 55 + .../Themes/Clean/Languages/hu/translation.ts | 55 + .../Themes/Clean/Languages/id/translation.ts | 55 + .../Themes/Clean/Languages/it/translation.ts | 55 + .../Themes/Clean/Languages/ja/translation.ts | 55 + .../Themes/Clean/Languages/ko/translation.ts | 55 + .../Themes/Clean/Languages/nl/translation.ts | 55 + .../Themes/Clean/Languages/no/translation.ts | 55 + .../Themes/Clean/Languages/pl/translation.ts | 55 + .../Themes/Clean/Languages/ru/translation.ts | 55 + .../Themes/Clean/Languages/th/translation.ts | 55 + .../Themes/Clean/Languages/tr/translation.ts | 55 + .../Themes/Clean/Languages/zh/translation.ts | 55 + .../Themes/Clean/StructEnumDefinition.h | 1 + plugins-alternative/Themes/Clean/documentation.dox | 28 + plugins-alternative/Themes/Clean/factory.cpp | 65 + plugins-alternative/Themes/Clean/factory.h | 39 + plugins-alternative/Themes/Clean/informations.xml | 26 + plugins-alternative/Themes/Clean/interface.cpp | 426 + plugins-alternative/Themes/Clean/interface.h | 141 + plugins-alternative/Themes/Clean/interface.pro | 46 + plugins-alternative/Themes/Clean/interface.ui | 131 + plugins-alternative/Themes/Clean/plugin.json | 1 + plugins-alternative/Themes/Clean/resources.qrc | 5 + .../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/Clean/resources_unix.qrc | 7 + .../Themes/Clean/resources_windows.qrc | 7 + .../Themes/Teracopy/DebugEngineMacro.h | 28 + plugins-alternative/Themes/Teracopy/Environment.h | 10 + .../Themes/Teracopy/Languages/ar/translation.ts | 89 + .../Themes/Teracopy/Languages/de/translation.ts | 93 + .../Themes/Teracopy/Languages/el/translation.ts | 89 + .../Themes/Teracopy/Languages/en/translation.ts | 89 + .../Themes/Teracopy/Languages/es/translation.ts | 93 + .../Themes/Teracopy/Languages/fr/translation.ts | 94 + .../Themes/Teracopy/Languages/hi/translation.ts | 89 + .../Themes/Teracopy/Languages/hu/translation.ts | 93 + .../Themes/Teracopy/Languages/id/translation.ts | 89 + .../Themes/Teracopy/Languages/it/translation.ts | 93 + .../Themes/Teracopy/Languages/ja/translation.ts | 89 + .../Themes/Teracopy/Languages/ko/translation.ts | 93 + .../Themes/Teracopy/Languages/nl/translation.ts | 89 + .../Themes/Teracopy/Languages/no/translation.ts | 89 + .../Themes/Teracopy/Languages/pl/translation.ts | 89 + .../Themes/Teracopy/Languages/ru/translation.ts | 93 + .../Themes/Teracopy/Languages/th/translation.ts | 89 + .../Themes/Teracopy/Languages/tr/translation.ts | 89 + .../Themes/Teracopy/Languages/zh/translation.ts | 89 + .../Themes/Teracopy/StructEnumDefinition.h | 1 + .../Themes/Teracopy/TransferModel.cpp | 528 + .../Themes/Teracopy/TransferModel.h | 92 + plugins-alternative/Themes/Teracopy/Variable.h | 15 + .../Themes/Teracopy/documentation.dox | 28 + plugins-alternative/Themes/Teracopy/factory.cpp | 70 + plugins-alternative/Themes/Teracopy/factory.h | 42 + .../Themes/Teracopy/informations.xml | 26 + plugins-alternative/Themes/Teracopy/interface.cpp | 500 + plugins-alternative/Themes/Teracopy/interface.h | 176 + plugins-alternative/Themes/Teracopy/interface.pro | 50 + plugins-alternative/Themes/Teracopy/interface.ui | 394 + plugins-alternative/Themes/Teracopy/plugin.json | 1 + plugins-alternative/Themes/Teracopy/resources.qrc | 12 + .../Teracopy/resources/SystemTrayIcon/add.png | Bin 0 -> 552 bytes .../Teracopy/resources/SystemTrayIcon/exit.png | Bin 0 -> 874 bytes .../resources/SystemTrayIcon/informations.png | Bin 0 -> 841 bytes .../Teracopy/resources/SystemTrayIcon/options.png | Bin 0 -> 624 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/Teracopy/resources/checkbox.png | Bin 0 -> 619 bytes .../Themes/Teracopy/resources/main.png | Bin 0 -> 623 bytes .../Themes/Teracopy/resources/player_pause.png | Bin 0 -> 640 bytes .../Themes/Teracopy/resources/player_play.png | Bin 0 -> 673 bytes .../Themes/Teracopy/resources_unix.qrc | 7 + .../Themes/Teracopy/resources_windows.qrc | 7 + .../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 | 28 + 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/CopyEngine/Rsync/Rsync.pro | 2 + plugins/CopyEngine/Rsync/informations.xml | 23 + plugins/CopyEngine/Ultracopier/AvancedQFile.cpp | 208 + plugins/CopyEngine/Ultracopier/AvancedQFile.h | 45 + plugins/CopyEngine/Ultracopier/CompilerInfo.h | 1 + .../Ultracopier/CopyEngine-collision-and-error.cpp | 568 + plugins/CopyEngine/Ultracopier/CopyEngine.cpp | 1253 ++ plugins/CopyEngine/Ultracopier/CopyEngine.h | 382 + plugins/CopyEngine/Ultracopier/CopyEngine.pro | 106 + .../CopyEngine/Ultracopier/CopyEngineFactory.cpp | 700 ++ plugins/CopyEngine/Ultracopier/CopyEngineFactory.h | 133 + plugins/CopyEngine/Ultracopier/DebugDialog.cpp | 54 + plugins/CopyEngine/Ultracopier/DebugDialog.h | 39 + plugins/CopyEngine/Ultracopier/DebugEngineMacro.h | 28 + plugins/CopyEngine/Ultracopier/DiskSpace.cpp | 53 + plugins/CopyEngine/Ultracopier/DiskSpace.h | 29 + plugins/CopyEngine/Ultracopier/DiskSpace.ui | 68 + plugins/CopyEngine/Ultracopier/DriveManagement.cpp | 105 + 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 | 244 + plugins/CopyEngine/Ultracopier/FileExistsDialog.h | 60 + .../CopyEngine/Ultracopier/FileIsSameDialog.cpp | 194 + 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 | 460 + plugins/CopyEngine/Ultracopier/Filters.h | 45 + plugins/CopyEngine/Ultracopier/Filters.ui | 194 + .../CopyEngine/Ultracopier/FolderExistsDialog.cpp | 205 + .../CopyEngine/Ultracopier/FolderExistsDialog.h | 57 + .../Ultracopier/Languages/ar/translation.ts | 1289 ++ .../Ultracopier/Languages/de/translation.ts | 1290 ++ .../Ultracopier/Languages/el/translation.ts | 1289 ++ .../Ultracopier/Languages/en/translation.ts | 1289 ++ .../Ultracopier/Languages/es/translation.ts | 1289 ++ .../Ultracopier/Languages/fr/translation.ts | 1294 ++ .../Ultracopier/Languages/hi/translation.ts | 1289 ++ .../Ultracopier/Languages/hu/translation.ts | 1289 ++ .../Ultracopier/Languages/id/translation.ts | 1289 ++ .../Ultracopier/Languages/it/translation.ts | 1299 ++ .../Ultracopier/Languages/ja/translation.ts | 1289 ++ .../Ultracopier/Languages/ko/translation.ts | 1289 ++ .../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 | 1289 ++ .../Ultracopier/Languages/th/translation.ts | 1289 ++ .../Ultracopier/Languages/tr/translation.ts | 1289 ++ .../Ultracopier/Languages/zh/translation.ts | 1289 ++ plugins/CopyEngine/Ultracopier/ListThread.cpp | 2399 ++++ plugins/CopyEngine/Ultracopier/ListThread.h | 432 + .../Ultracopier/ListThread_InodeAction.cpp | 64 + plugins/CopyEngine/Ultracopier/MkPath.cpp | 517 + 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 | 688 ++ plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h | 108 + .../CopyEngine/Ultracopier/StructEnumDefinition.h | 1 + .../Ultracopier/StructEnumDefinition_CopyEngine.h | 124 + plugins/CopyEngine/Ultracopier/TransferThread.cpp | 2091 ++++ plugins/CopyEngine/Ultracopier/TransferThread.h | 288 + plugins/CopyEngine/Ultracopier/Variable.h | 43 + plugins/CopyEngine/Ultracopier/WriteThread.cpp | 968 ++ 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 0 -> 585 bytes plugins/Languages/ar/informations.xml | 32 + plugins/Languages/ar/translation.ts | 1256 ++ plugins/Languages/de/flag.png | Bin 0 -> 712 bytes plugins/Languages/de/informations.xml | 32 + plugins/Languages/de/translation.ts | 1277 ++ plugins/Languages/el/flag.png | Bin 0 -> 726 bytes plugins/Languages/el/informations.xml | 32 + plugins/Languages/el/translation.ts | 1256 ++ plugins/Languages/es/flag.png | Bin 0 -> 726 bytes plugins/Languages/es/informations.xml | 32 + plugins/Languages/es/translation.ts | 1266 ++ plugins/Languages/fr/flag.png | Bin 0 -> 699 bytes plugins/Languages/fr/informations.xml | 35 + plugins/Languages/fr/translation.ts | 1265 ++ plugins/Languages/hi/flag.png | Bin 0 -> 728 bytes plugins/Languages/hi/informations.xml | 32 + plugins/Languages/hi/translation.ts | 1256 ++ plugins/Languages/hu/flag.png | Bin 0 -> 810 bytes plugins/Languages/hu/informations.xml | 29 + plugins/Languages/hu/translation.ts | 1263 ++ plugins/Languages/id/flag.png | Bin 0 -> 691 bytes plugins/Languages/id/informations.xml | 32 + plugins/Languages/id/translation.ts | 1256 ++ plugins/Languages/it/flag.png | Bin 0 -> 675 bytes plugins/Languages/it/informations.xml | 32 + plugins/Languages/it/translation.ts | 1270 ++ plugins/Languages/ja/flag.png | Bin 0 -> 595 bytes plugins/Languages/ja/informations.xml | 33 + plugins/Languages/ja/translation.ts | 1256 ++ plugins/Languages/ko/flag.png | Bin 0 -> 650 bytes plugins/Languages/ko/informations.xml | 30 + plugins/Languages/ko/translation.ts | 1260 ++ plugins/Languages/nl/flag.png | Bin 0 -> 709 bytes plugins/Languages/nl/informations.xml | 32 + plugins/Languages/nl/translation.ts | 1256 ++ plugins/Languages/no/flag.png | Bin 0 -> 715 bytes plugins/Languages/no/informations.xml | 32 + plugins/Languages/no/translation.ts | 1256 ++ plugins/Languages/pl/flag.png | Bin 0 -> 586 bytes plugins/Languages/pl/informations.xml | 32 + plugins/Languages/pl/translation.ts | 1256 ++ plugins/Languages/pt/flag.png | Bin 0 -> 686 bytes plugins/Languages/pt/informations.xml | 32 + plugins/Languages/pt/translation.ts | 1256 ++ plugins/Languages/ru/flag.png | Bin 0 -> 721 bytes plugins/Languages/ru/informations.xml | 32 + plugins/Languages/ru/translation.ts | 1260 ++ plugins/Languages/th/flag.png | Bin 0 -> 731 bytes plugins/Languages/th/informations.xml | 32 + plugins/Languages/th/translation.ts | 1256 ++ plugins/Languages/tr/flag.png | Bin 0 -> 634 bytes plugins/Languages/tr/informations.xml | 32 + plugins/Languages/tr/translation.ts | 1256 ++ plugins/Languages/zh/flag.png | Bin 0 -> 538 bytes plugins/Languages/zh/informations.xml | 35 + plugins/Languages/zh/translation.ts | 1256 ++ plugins/Languages/zh_TW/flag.png | Bin 0 -> 616 bytes plugins/Languages/zh_TW/informations.xml | 32 + plugins/Languages/zh_TW/translation.ts | 1256 ++ .../Listener/catchcopy-v0002/DebugEngineMacro.h | 28 + plugins/Listener/catchcopy-v0002/Environment.h | 10 + .../catchcopy-v0002/StructEnumDefinition.h | 1 + plugins/Listener/catchcopy-v0002/Variable.h | 15 + .../catchcopy-api-0002/ClientCatchcopy.cpp | 379 + .../catchcopy-api-0002/ClientCatchcopy.h | 113 + .../catchcopy-api-0002/ExtraSocketCatchcopy.cpp | 38 + .../catchcopy-api-0002/ExtraSocketCatchcopy.h | 31 + .../catchcopy-api-0002/ServerCatchcopy.cpp | 740 ++ .../catchcopy-api-0002/ServerCatchcopy.h | 144 + .../catchcopy-api-0002/VariablesCatchcopy.h | 13 + plugins/Listener/catchcopy-v0002/documentation.dox | 32 + plugins/Listener/catchcopy-v0002/informations.xml | 26 + plugins/Listener/catchcopy-v0002/listener.cpp | 123 + plugins/Listener/catchcopy-v0002/listener.h | 59 + plugins/Listener/catchcopy-v0002/listener.pro | 26 + plugins/Listener/catchcopy-v0002/plugin.json | 1 + .../catchcopy-v0002/DebugEngineMacro.h | 28 + plugins/PluginLoader/catchcopy-v0002/Environment.h | 10 + .../catchcopy-v0002/Languages/ar/translation.ts | 17 + .../catchcopy-v0002/Languages/de/translation.ts | 18 + .../catchcopy-v0002/Languages/el/translation.ts | 17 + .../catchcopy-v0002/Languages/en/translation.ts | 17 + .../catchcopy-v0002/Languages/es/translation.ts | 17 + .../catchcopy-v0002/Languages/fr/translation.ts | 17 + .../catchcopy-v0002/Languages/hi/translation.ts | 17 + .../catchcopy-v0002/Languages/hu/translation.ts | 17 + .../catchcopy-v0002/Languages/id/translation.ts | 17 + .../catchcopy-v0002/Languages/it/translation.ts | 17 + .../catchcopy-v0002/Languages/ja/translation.ts | 17 + .../catchcopy-v0002/Languages/ko/translation.ts | 17 + .../catchcopy-v0002/Languages/nl/translation.ts | 17 + .../catchcopy-v0002/Languages/no/translation.ts | 17 + .../catchcopy-v0002/Languages/pl/translation.ts | 17 + .../catchcopy-v0002/Languages/pt/translation.ts | 17 + .../catchcopy-v0002/Languages/ru/translation.ts | 17 + .../catchcopy-v0002/Languages/th/translation.ts | 17 + .../catchcopy-v0002/Languages/tr/translation.ts | 17 + .../catchcopy-v0002/Languages/zh/translation.ts | 17 + .../PluginLoader/catchcopy-v0002/OptionsWidget.cpp | 39 + .../PluginLoader/catchcopy-v0002/OptionsWidget.h | 30 + .../PluginLoader/catchcopy-v0002/OptionsWidget.ui | 48 + .../PluginLoader/catchcopy-v0002/PlatformMacro.h | 1 + .../catchcopy-v0002/StructEnumDefinition.h | 1 + plugins/PluginLoader/catchcopy-v0002/Variable.h | 16 + .../PluginLoader/catchcopy-v0002/documentation.dox | 33 + .../PluginLoader/catchcopy-v0002/informations.xml | 26 + plugins/PluginLoader/catchcopy-v0002/plugin.json | 1 + .../PluginLoader/catchcopy-v0002/pluginLoader.cpp | 450 + .../PluginLoader/catchcopy-v0002/pluginLoader.h | 64 + .../PluginLoader/catchcopy-v0002/pluginLoader.pro | 53 + plugins/SessionLoader/Windows/DebugEngineMacro.h | 28 + plugins/SessionLoader/Windows/Environment.h | 10 + .../SessionLoader/Windows/StructEnumDefinition.h | 1 + plugins/SessionLoader/Windows/Variable.h | 15 + plugins/SessionLoader/Windows/documentation.dox | 32 + plugins/SessionLoader/Windows/informations.xml | 26 + plugins/SessionLoader/Windows/plugin.json | 1 + plugins/SessionLoader/Windows/sessionLoader.cpp | 80 + plugins/SessionLoader/Windows/sessionLoader.h | 33 + plugins/SessionLoader/Windows/sessionLoader.pro | 16 + plugins/Themes/Oxygen/DebugEngineMacro.h | 28 + plugins/Themes/Oxygen/Environment.h | 10 + plugins/Themes/Oxygen/Languages/ar/translation.ts | 341 + plugins/Themes/Oxygen/Languages/de/translation.ts | 341 + plugins/Themes/Oxygen/Languages/el/translation.ts | 341 + plugins/Themes/Oxygen/Languages/en/translation.ts | 341 + plugins/Themes/Oxygen/Languages/es/translation.ts | 341 + plugins/Themes/Oxygen/Languages/fr/translation.ts | 341 + plugins/Themes/Oxygen/Languages/hi/translation.ts | 341 + plugins/Themes/Oxygen/Languages/hu/translation.ts | 341 + plugins/Themes/Oxygen/Languages/id/translation.ts | 341 + plugins/Themes/Oxygen/Languages/it/translation.ts | 341 + plugins/Themes/Oxygen/Languages/ja/translation.ts | 341 + plugins/Themes/Oxygen/Languages/ko/translation.ts | 341 + plugins/Themes/Oxygen/Languages/nl/translation.ts | 341 + plugins/Themes/Oxygen/Languages/no/translation.ts | 341 + plugins/Themes/Oxygen/Languages/pl/translation.ts | 341 + plugins/Themes/Oxygen/Languages/pt/translation.ts | 341 + plugins/Themes/Oxygen/Languages/ru/translation.ts | 341 + plugins/Themes/Oxygen/Languages/th/translation.ts | 341 + plugins/Themes/Oxygen/Languages/tr/translation.ts | 341 + plugins/Themes/Oxygen/Languages/zh/translation.ts | 341 + plugins/Themes/Oxygen/StructEnumDefinition.h | 1 + plugins/Themes/Oxygen/ThemesFactory.cpp | 481 + plugins/Themes/Oxygen/ThemesFactory.h | 86 + plugins/Themes/Oxygen/TransferModel.cpp | 588 + plugins/Themes/Oxygen/TransferModel.h | 96 + plugins/Themes/Oxygen/Variable.h | 18 + plugins/Themes/Oxygen/documentation.dox | 31 + plugins/Themes/Oxygen/informations.xml | 26 + plugins/Themes/Oxygen/interface.cpp | 1497 +++ plugins/Themes/Oxygen/interface.h | 222 + plugins/Themes/Oxygen/interface.pro | 8 + plugins/Themes/Oxygen/interface.ui | 848 ++ plugins/Themes/Oxygen/interfaceInclude.pri | 51 + plugins/Themes/Oxygen/interfaceResources.qrc | 22 + plugins/Themes/Oxygen/interfaceResources_unix.qrc | 7 + .../Themes/Oxygen/interfaceResources_windows.qrc | 7 + plugins/Themes/Oxygen/options.ui | 290 + plugins/Themes/Oxygen/plugin.json | 1 + .../Themes/Oxygen/resources/SystemTrayIcon/add.png | Bin 0 -> 552 bytes .../Oxygen/resources/SystemTrayIcon/exit.png | Bin 0 -> 874 bytes .../resources/SystemTrayIcon/informations.png | Bin 0 -> 841 bytes .../Oxygen/resources/SystemTrayIcon/options.png | Bin 0 -> 624 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 -> 1174 bytes .../systray_Semiuncaught_Windows.png | Bin 0 -> 677 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 0 -> 665 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 0 -> 439 bytes plugins/Themes/Oxygen/resources/add.png | Bin 0 -> 552 bytes plugins/Themes/Oxygen/resources/cancel.png | Bin 0 -> 874 bytes .../Oxygen/resources/export-transfer-list.png | Bin 0 -> 455 bytes .../Oxygen/resources/import-transfer-list.png | Bin 0 -> 454 bytes plugins/Themes/Oxygen/resources/main.png | Bin 0 -> 623 bytes plugins/Themes/Oxygen/resources/moveDown.png | Bin 0 -> 466 bytes plugins/Themes/Oxygen/resources/moveUp.png | Bin 0 -> 466 bytes plugins/Themes/Oxygen/resources/player_end.png | Bin 0 -> 696 bytes plugins/Themes/Oxygen/resources/player_pause.png | Bin 0 -> 640 bytes plugins/Themes/Oxygen/resources/player_play.png | Bin 0 -> 673 bytes plugins/Themes/Oxygen/resources/putOnBottom.png | Bin 0 -> 676 bytes plugins/Themes/Oxygen/resources/putOnTop.png | Bin 0 -> 681 bytes plugins/Themes/Oxygen/resources/remove.png | Bin 0 -> 683 bytes plugins/Themes/Oxygen/resources/search.png | Bin 0 -> 781 bytes plugins/Themes/Oxygen/themesOptions.ui | 426 + plugins/Themes/Supercopier/informations.xml | 26 + plugins/Themes/Supercopier/interface.pro | 10 + plugins/Themes/Supercopier/interfaceResources.qrc | 24 + .../Themes/Supercopier/interfaceResources_unix.qrc | 7 + .../Supercopier/interfaceResources_windows.qrc | 7 + .../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 .../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_Uncaught_Unix.png | Bin 0 -> 141 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 0 -> 139 bytes plugins/Themes/Supercopier/resources/add.png | Bin 0 -> 240 bytes plugins/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 plugins/Themes/Supercopier/resources/main.png | Bin 0 -> 148 bytes plugins/Themes/Supercopier/resources/moveDown.png | Bin 0 -> 191 bytes plugins/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 plugins/Themes/Supercopier/resources/putOnTop.png | Bin 0 -> 208 bytes plugins/Themes/Supercopier/resources/remove.png | Bin 0 -> 254 bytes plugins/Themes/Supercopier/resources/search.png | Bin 0 -> 237 bytes plugins/static-plugins-oxygen.qrc | 6 + plugins/static-plugins-windows.qrc | 6 + plugins/static-plugins.qrc | 12 + resources/Languages/en/flag.png | Bin 0 -> 741 bytes resources/Languages/en/informations.xml | 29 + resources/Languages/en/translation.ts | 1256 ++ resources/bug-128x128.png | Bin 0 -> 6042 bytes resources/img-src/application-exit.svgz | Bin 0 -> 6400 bytes resources/img-src/applications-development.svgz | Bin 0 -> 7861 bytes resources/img-src/arrow-down-double.svgz | Bin 0 -> 5704 bytes resources/img-src/arrow-down.svgz | Bin 0 -> 5072 bytes resources/img-src/arrow-up-double.svgz | Bin 0 -> 5698 bytes resources/img-src/arrow-up.svgz | Bin 0 -> 5071 bytes resources/img-src/checkbox.svgz | Bin 0 -> 3936 bytes resources/img-src/document-encrypt.svgz | Bin 0 -> 20939 bytes resources/img-src/document-preview.svgz | Bin 0 -> 19169 bytes resources/img-src/document-save_16.svgz | Bin 0 -> 4954 bytes resources/img-src/document-save_22.svgz | Bin 0 -> 30302 bytes resources/img-src/drive-removable-media-usb.svgz | Bin 0 -> 4247 bytes resources/img-src/help-about.svgz | Bin 0 -> 13549 bytes resources/img-src/kbugbuster.svgz | Bin 0 -> 20091 bytes resources/img-src/list-add.svgz | Bin 0 -> 4165 bytes resources/img-src/media-playback-pause.svgz | Bin 0 -> 2054 bytes resources/img-src/media-playback-start.svgz | Bin 0 -> 1916 bytes resources/img-src/media-skip-forward.svgz | Bin 0 -> 2065 bytes resources/img-src/process-stop.svgz | Bin 0 -> 4174 bytes resources/img-src/system-shutdown.svgz | Bin 0 -> 6070 bytes resources/img-src/text-formatting.svg | 11924 +++++++++++++++++++ resources/moveDown.png | Bin 0 -> 466 bytes resources/moveUp.png | Bin 0 -> 466 bytes resources/none-128x128.png | Bin 0 -> 4942 bytes resources/options.png | Bin 0 -> 624 bytes resources/qt.conf | 2 + resources/resources-windows-qt-plugin.qrc | 5 + resources/resources-windows.rc | 36 + 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 0 -> 1093 bytes resources/systray_Caught_Windows.png | Bin 0 -> 623 bytes resources/systray_Semiuncaught_Unix.png | Bin 0 -> 1296 bytes resources/systray_Semiuncaught_Windows.png | Bin 0 -> 841 bytes resources/systray_Uncaught_Unix.png | Bin 0 -> 754 bytes resources/systray_Uncaught_Windows.png | Bin 0 -> 485 bytes resources/ultracopier-128x128.png | Bin 0 -> 4928 bytes resources/ultracopier-16x16.png | Bin 0 -> 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.desktop | 20 + resources/ultracopier.icns | Bin 0 -> 36804 bytes resources/ultracopier.ico | Bin 0 -> 34118 bytes resources/warning.png | Bin 0 -> 511 bytes tools/doc/Doxyfile | 1790 +++ tools/doc/Doxyfile-plugin-template | 1789 +++ tools/doc/footer.html | 2 + tools/doc/ultracopier-logo.png | Bin 0 -> 3834 bytes tools/scripts/UltraCP | 28 + tools/scripts/UltraMV | 28 + tools/to-pack/1-pre-send.sh | 55 + tools/to-pack/1-update-translation.sh | 37 + tools/to-pack/2-compil-wine32.sh | 39 + tools/to-pack/2-compil-wine64.sh | 38 + tools/to-pack/2-send-sources.sh | 12 + tools/to-pack/3-compil-mac.sh | 37 + tools/to-pack/4-clean-all.sh | 35 + tools/to-pack/4-upload.sh | 38 + tools/to-pack/5-upload.sh | 35 + tools/to-pack/6-sendmail.sh | 35 + tools/to-pack/data/windows/install-static.nsi | 162 + tools/to-pack/data/windows/install.nsi | 162 + .../resources-windows-ultracopier-plugins.rc | 27 + tools/to-pack/data/windows/ultracopier.ico | Bin 0 -> 34118 bytes tools/to-pack/grouped.sh | 12 + tools/to-pack/old-3-compil-linux.sh | 37 + .../to-pack/sub-script/assemble-source-version.sh | 129 + .../sub-script/assemble-windows-version-32.sh | 153 + .../sub-script/assemble-windows-version-64.sh | 149 + tools/to-pack/sub-script/assemble.sh | 219 + tools/to-pack/sub-script/clean-all.sh | 16 + tools/to-pack/sub-script/compil-windows32.sh | 211 + tools/to-pack/sub-script/compil-windows64.sh | 200 + tools/to-pack/sub-script/compil.sh | 429 + tools/to-pack/sub-script/doc.sh | 119 + tools/to-pack/sub-script/linux.sh | 275 + tools/to-pack/sub-script/mac.sh | 275 + tools/to-pack/sub-script/sendmail.sh | 17 + tools/to-pack/sub-script/test.sh | 40 + tools/to-pack/sub-script/translation-local.sh | 30 + tools/to-pack/sub-script/translation.sh | 53 + tools/to-pack/sub-script/upload-local.sh | 33 + tools/to-pack/sub-script/upload.sh | 80 + tools/to-pack/test.sh | 55 + 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.dox | 39 + ultracopier.pro | 137 + 700 files changed, 136115 insertions(+) create mode 100644 COPYING create mode 100644 CliParser.cpp create mode 100644 CliParser.h create mode 100644 CompilerInfo.h create mode 100644 CopyEngineManager.cpp create mode 100644 CopyEngineManager.h create mode 100644 CopyListener.cpp create mode 100644 CopyListener.h create mode 100644 Core.cpp create mode 100644 Core.h create mode 100644 DebugEngine.cpp create mode 100644 DebugEngine.h create mode 100644 DebugEngineMacro.h create mode 100644 DebugModel.cpp create mode 100644 Environment.h create mode 100644 EventDispatcher.cpp create mode 100644 EventDispatcher.h create mode 100644 ExtraSocket.cpp create mode 100644 ExtraSocket.h create mode 100644 FacilityEngine.cpp create mode 100644 FacilityEngine.h create mode 100644 HelpDialog.cpp create mode 100644 HelpDialog.h create mode 100644 HelpDialog.ui create mode 100644 InternetUpdater.cpp create mode 100644 InternetUpdater.h create mode 100644 LanguagesManager.cpp create mode 100644 LanguagesManager.h create mode 100644 LocalListener.cpp create mode 100644 LocalListener.h create mode 100644 LocalPluginOptions.cpp create mode 100644 LocalPluginOptions.h create mode 100644 LogThread.cpp create mode 100644 LogThread.h create mode 100644 OSSpecific.cpp create mode 100644 OSSpecific.h create mode 100644 OSSpecific.ui create mode 100644 OptionDialog.cpp create mode 100644 OptionDialog.h create mode 100644 OptionDialog.ui create mode 100644 OptionEngine.cpp create mode 100644 OptionEngine.h create mode 100644 PlatformMacro.h create mode 100644 PluginInformation.cpp create mode 100644 PluginInformation.h create mode 100644 PluginInformation.ui create mode 100644 PluginLoader.cpp create mode 100644 PluginLoader.h create mode 100644 PluginsManager.cpp create mode 100644 PluginsManager.h create mode 100644 README create mode 100644 README.sources create mode 100644 ResourcesManager.cpp create mode 100644 ResourcesManager.h create mode 100644 SessionLoader.cpp create mode 100644 SessionLoader.h create mode 100644 StructEnumDefinition.h create mode 100644 StructEnumDefinition_UltracopierSpecific.h create mode 100644 SystrayIcon.cpp create mode 100644 SystrayIcon.h create mode 100644 ThemesManager.cpp create mode 100644 ThemesManager.h create mode 100644 Variable.h create mode 100644 cpp11addition.cpp create mode 100644 cpp11addition.h create mode 100644 cpp11additionstringtointcpp.cpp create mode 100644 interface/FacilityInterface.h create mode 100644 interface/OptionInterface.h create mode 100644 interface/PluginInterface_CopyEngine.h create mode 100644 interface/PluginInterface_Listener.h create mode 100644 interface/PluginInterface_PluginLoader.h create mode 100644 interface/PluginInterface_SessionLoader.h create mode 100644 interface/PluginInterface_Themes.h create mode 100644 lib/qt-tar-xz/QTarDecode.cpp create mode 100644 lib/qt-tar-xz/QTarDecode.h create mode 100644 lib/qt-tar-xz/QXzDecode.cpp create mode 100644 lib/qt-tar-xz/QXzDecode.h create mode 100644 lib/qt-tar-xz/QXzDecodeThread.cpp create mode 100644 lib/qt-tar-xz/QXzDecodeThread.h create mode 100644 lib/qt-tar-xz/xz.h create mode 100644 lib/qt-tar-xz/xz_config.h create mode 100644 lib/qt-tar-xz/xz_crc32.c create mode 100644 lib/qt-tar-xz/xz_dec_bcj.c create mode 100644 lib/qt-tar-xz/xz_dec_lzma2.c create mode 100644 lib/qt-tar-xz/xz_dec_stream.c create mode 100644 lib/qt-tar-xz/xz_lzma2.h create mode 100644 lib/qt-tar-xz/xz_private.h create mode 100644 lib/qt-tar-xz/xz_stream.h create mode 100644 main.cpp create mode 100644 other-pro/static.pro create mode 100644 other-pro/supercopier-core.pro create mode 100644 other-pro/ultracopier-core.pro create mode 100644 other-pro/ultracopier-static.pro create mode 100644 plugins-alternative/Listener/dbus/Catchcopy.cpp create mode 100644 plugins-alternative/Listener/dbus/Catchcopy.h create mode 100644 plugins-alternative/Listener/dbus/DebugEngineMacro.h create mode 100644 plugins-alternative/Listener/dbus/Environment.h create mode 100644 plugins-alternative/Listener/dbus/StructEnumDefinition.h create mode 100644 plugins-alternative/Listener/dbus/Variable.h create mode 100644 plugins-alternative/Listener/dbus/documentation.dox create mode 100644 plugins-alternative/Listener/dbus/informations.xml create mode 100644 plugins-alternative/Listener/dbus/listener.cpp create mode 100644 plugins-alternative/Listener/dbus/listener.h create mode 100644 plugins-alternative/Listener/dbus/listener.pro create mode 100644 plugins-alternative/Listener/dbus/plugin.json 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/SessionLoader/KDE4/DebugEngineMacro.h create mode 100644 plugins-alternative/SessionLoader/KDE4/Environment.h create mode 100644 plugins-alternative/SessionLoader/KDE4/StructEnumDefinition.h create mode 100644 plugins-alternative/SessionLoader/KDE4/Variable.h create mode 100644 plugins-alternative/SessionLoader/KDE4/documentation.dox create mode 100644 plugins-alternative/SessionLoader/KDE4/informations.xml create mode 100644 plugins-alternative/SessionLoader/KDE4/plugin.json create mode 100644 plugins-alternative/SessionLoader/KDE4/sessionLoader.cpp create mode 100644 plugins-alternative/SessionLoader/KDE4/sessionLoader.h create mode 100644 plugins-alternative/SessionLoader/KDE4/sessionLoader.pro create mode 100644 plugins-alternative/Themes/Clean/Languages/ar/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/de/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/el/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/es/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/fr/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/hi/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/hu/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/id/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/it/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/ja/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/ko/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/nl/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/no/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/pl/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/ru/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/th/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/tr/translation.ts create mode 100644 plugins-alternative/Themes/Clean/Languages/zh/translation.ts create mode 100644 plugins-alternative/Themes/Clean/StructEnumDefinition.h create mode 100644 plugins-alternative/Themes/Clean/documentation.dox create mode 100644 plugins-alternative/Themes/Clean/factory.cpp create mode 100644 plugins-alternative/Themes/Clean/factory.h create mode 100644 plugins-alternative/Themes/Clean/informations.xml create mode 100644 plugins-alternative/Themes/Clean/interface.cpp create mode 100644 plugins-alternative/Themes/Clean/interface.h create mode 100644 plugins-alternative/Themes/Clean/interface.pro create mode 100644 plugins-alternative/Themes/Clean/interface.ui create mode 100644 plugins-alternative/Themes/Clean/plugin.json create mode 100644 plugins-alternative/Themes/Clean/resources.qrc create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/informations.png create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Unix.png create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Caught_Windows.png create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Unix.png create mode 100644 plugins-alternative/Themes/Clean/resources/SystemTrayIcon/systray_Uncaught_Windows.png create mode 100644 plugins-alternative/Themes/Clean/resources_unix.qrc create mode 100644 plugins-alternative/Themes/Clean/resources_windows.qrc create mode 100644 plugins-alternative/Themes/Teracopy/DebugEngineMacro.h create mode 100644 plugins-alternative/Themes/Teracopy/Environment.h create mode 100644 plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/de/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/el/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/es/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/id/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/it/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/no/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/th/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/StructEnumDefinition.h create mode 100644 plugins-alternative/Themes/Teracopy/TransferModel.cpp create mode 100644 plugins-alternative/Themes/Teracopy/TransferModel.h create mode 100644 plugins-alternative/Themes/Teracopy/Variable.h create mode 100644 plugins-alternative/Themes/Teracopy/documentation.dox create mode 100644 plugins-alternative/Themes/Teracopy/factory.cpp create mode 100644 plugins-alternative/Themes/Teracopy/factory.h create mode 100644 plugins-alternative/Themes/Teracopy/informations.xml create mode 100644 plugins-alternative/Themes/Teracopy/interface.cpp create mode 100644 plugins-alternative/Themes/Teracopy/interface.h create mode 100644 plugins-alternative/Themes/Teracopy/interface.pro create mode 100644 plugins-alternative/Themes/Teracopy/interface.ui create mode 100644 plugins-alternative/Themes/Teracopy/plugin.json create mode 100644 plugins-alternative/Themes/Teracopy/resources.qrc create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/checkbox.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/main.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/player_pause.png create mode 100644 plugins-alternative/Themes/Teracopy/resources/player_play.png create mode 100644 plugins-alternative/Themes/Teracopy/resources_unix.qrc create mode 100644 plugins-alternative/Themes/Teracopy/resources_windows.qrc 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/CopyEngine/Rsync/Rsync.pro create mode 100644 plugins/CopyEngine/Rsync/informations.xml 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/ar/flag.png create mode 100644 plugins/Languages/ar/informations.xml create mode 100644 plugins/Languages/ar/translation.ts create mode 100644 plugins/Languages/de/flag.png create mode 100644 plugins/Languages/de/informations.xml create mode 100644 plugins/Languages/de/translation.ts create mode 100644 plugins/Languages/el/flag.png create mode 100644 plugins/Languages/el/informations.xml create mode 100644 plugins/Languages/el/translation.ts create mode 100644 plugins/Languages/es/flag.png create mode 100644 plugins/Languages/es/informations.xml create mode 100644 plugins/Languages/es/translation.ts create mode 100644 plugins/Languages/fr/flag.png create mode 100644 plugins/Languages/fr/informations.xml create mode 100644 plugins/Languages/fr/translation.ts create mode 100644 plugins/Languages/hi/flag.png create mode 100644 plugins/Languages/hi/informations.xml create mode 100644 plugins/Languages/hi/translation.ts create mode 100644 plugins/Languages/hu/flag.png create mode 100644 plugins/Languages/hu/informations.xml create mode 100644 plugins/Languages/hu/translation.ts create mode 100644 plugins/Languages/id/flag.png create mode 100644 plugins/Languages/id/informations.xml create mode 100644 plugins/Languages/id/translation.ts create mode 100644 plugins/Languages/it/flag.png create mode 100644 plugins/Languages/it/informations.xml create mode 100644 plugins/Languages/it/translation.ts create mode 100644 plugins/Languages/ja/flag.png create mode 100644 plugins/Languages/ja/informations.xml create mode 100644 plugins/Languages/ja/translation.ts create mode 100644 plugins/Languages/ko/flag.png create mode 100644 plugins/Languages/ko/informations.xml create mode 100644 plugins/Languages/ko/translation.ts create mode 100644 plugins/Languages/nl/flag.png create mode 100644 plugins/Languages/nl/informations.xml create mode 100644 plugins/Languages/nl/translation.ts create mode 100644 plugins/Languages/no/flag.png create mode 100644 plugins/Languages/no/informations.xml create mode 100644 plugins/Languages/no/translation.ts create mode 100644 plugins/Languages/pl/flag.png create mode 100644 plugins/Languages/pl/informations.xml create mode 100644 plugins/Languages/pl/translation.ts create mode 100644 plugins/Languages/pt/flag.png create mode 100644 plugins/Languages/pt/informations.xml create mode 100644 plugins/Languages/pt/translation.ts create mode 100644 plugins/Languages/ru/flag.png create mode 100644 plugins/Languages/ru/informations.xml create mode 100644 plugins/Languages/ru/translation.ts create mode 100644 plugins/Languages/th/flag.png create mode 100644 plugins/Languages/th/informations.xml create mode 100644 plugins/Languages/th/translation.ts create mode 100644 plugins/Languages/tr/flag.png create mode 100644 plugins/Languages/tr/informations.xml create mode 100644 plugins/Languages/tr/translation.ts create mode 100644 plugins/Languages/zh/flag.png create mode 100644 plugins/Languages/zh/informations.xml create mode 100644 plugins/Languages/zh/translation.ts create mode 100644 plugins/Languages/zh_TW/flag.png create mode 100644 plugins/Languages/zh_TW/informations.xml create mode 100644 plugins/Languages/zh_TW/translation.ts create mode 100644 plugins/Listener/catchcopy-v0002/DebugEngineMacro.h create mode 100644 plugins/Listener/catchcopy-v0002/Environment.h create mode 100644 plugins/Listener/catchcopy-v0002/StructEnumDefinition.h create mode 100644 plugins/Listener/catchcopy-v0002/Variable.h create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h create mode 100644 plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h create mode 100644 plugins/Listener/catchcopy-v0002/documentation.dox create mode 100644 plugins/Listener/catchcopy-v0002/informations.xml create mode 100644 plugins/Listener/catchcopy-v0002/listener.cpp create mode 100644 plugins/Listener/catchcopy-v0002/listener.h create mode 100644 plugins/Listener/catchcopy-v0002/listener.pro create mode 100644 plugins/Listener/catchcopy-v0002/plugin.json create mode 100644 plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/Environment.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts create mode 100644 plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp create mode 100644 plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui create mode 100644 plugins/PluginLoader/catchcopy-v0002/PlatformMacro.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/StructEnumDefinition.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/Variable.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/documentation.dox create mode 100644 plugins/PluginLoader/catchcopy-v0002/informations.xml create mode 100644 plugins/PluginLoader/catchcopy-v0002/plugin.json create mode 100644 plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp create mode 100644 plugins/PluginLoader/catchcopy-v0002/pluginLoader.h create mode 100644 plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro create mode 100644 plugins/SessionLoader/Windows/DebugEngineMacro.h create mode 100644 plugins/SessionLoader/Windows/Environment.h create mode 100644 plugins/SessionLoader/Windows/StructEnumDefinition.h create mode 100644 plugins/SessionLoader/Windows/Variable.h create mode 100644 plugins/SessionLoader/Windows/documentation.dox create mode 100644 plugins/SessionLoader/Windows/informations.xml create mode 100644 plugins/SessionLoader/Windows/plugin.json create mode 100644 plugins/SessionLoader/Windows/sessionLoader.cpp create mode 100644 plugins/SessionLoader/Windows/sessionLoader.h create mode 100644 plugins/SessionLoader/Windows/sessionLoader.pro create mode 100644 plugins/Themes/Oxygen/DebugEngineMacro.h create mode 100644 plugins/Themes/Oxygen/Environment.h create mode 100644 plugins/Themes/Oxygen/Languages/ar/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/de/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/el/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/en/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/es/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/fr/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/hi/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/hu/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/id/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/it/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/ja/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/ko/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/nl/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/no/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/pl/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/pt/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/ru/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/th/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/tr/translation.ts create mode 100644 plugins/Themes/Oxygen/Languages/zh/translation.ts create mode 100644 plugins/Themes/Oxygen/StructEnumDefinition.h create mode 100644 plugins/Themes/Oxygen/ThemesFactory.cpp create mode 100644 plugins/Themes/Oxygen/ThemesFactory.h create mode 100644 plugins/Themes/Oxygen/TransferModel.cpp create mode 100644 plugins/Themes/Oxygen/TransferModel.h create mode 100644 plugins/Themes/Oxygen/Variable.h create mode 100644 plugins/Themes/Oxygen/documentation.dox create mode 100644 plugins/Themes/Oxygen/informations.xml create mode 100644 plugins/Themes/Oxygen/interface.cpp create mode 100644 plugins/Themes/Oxygen/interface.h create mode 100644 plugins/Themes/Oxygen/interface.pro create mode 100644 plugins/Themes/Oxygen/interface.ui create mode 100644 plugins/Themes/Oxygen/interfaceInclude.pri 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/options.ui create mode 100644 plugins/Themes/Oxygen/plugin.json create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/exit.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/informations.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/options.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png create mode 100644 plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png create mode 100644 plugins/Themes/Oxygen/resources/add.png create mode 100644 plugins/Themes/Oxygen/resources/cancel.png create mode 100644 plugins/Themes/Oxygen/resources/export-transfer-list.png create mode 100644 plugins/Themes/Oxygen/resources/import-transfer-list.png create mode 100644 plugins/Themes/Oxygen/resources/main.png create mode 100644 plugins/Themes/Oxygen/resources/moveDown.png create mode 100644 plugins/Themes/Oxygen/resources/moveUp.png create mode 100644 plugins/Themes/Oxygen/resources/player_end.png create mode 100644 plugins/Themes/Oxygen/resources/player_pause.png create mode 100644 plugins/Themes/Oxygen/resources/player_play.png create mode 100644 plugins/Themes/Oxygen/resources/putOnBottom.png create mode 100644 plugins/Themes/Oxygen/resources/putOnTop.png create mode 100644 plugins/Themes/Oxygen/resources/remove.png create mode 100644 plugins/Themes/Oxygen/resources/search.png create mode 100644 plugins/Themes/Oxygen/themesOptions.ui create mode 100644 plugins/Themes/Supercopier/informations.xml create mode 100644 plugins/Themes/Supercopier/interface.pro create mode 100644 plugins/Themes/Supercopier/interfaceResources.qrc create mode 100644 plugins/Themes/Supercopier/interfaceResources_unix.qrc create mode 100644 plugins/Themes/Supercopier/interfaceResources_windows.qrc create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/add.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/exit.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/informations.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/options.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png create mode 100644 plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png create mode 100644 plugins/Themes/Supercopier/resources/add.png create mode 100644 plugins/Themes/Supercopier/resources/cancel.png create mode 100644 plugins/Themes/Supercopier/resources/export-transfer-list.png create mode 100644 plugins/Themes/Supercopier/resources/import-transfer-list.png create mode 100644 plugins/Themes/Supercopier/resources/main.png create mode 100644 plugins/Themes/Supercopier/resources/moveDown.png create mode 100644 plugins/Themes/Supercopier/resources/moveUp.png create mode 100644 plugins/Themes/Supercopier/resources/player_end.png create mode 100644 plugins/Themes/Supercopier/resources/player_pause.png create mode 100644 plugins/Themes/Supercopier/resources/player_play.png create mode 100644 plugins/Themes/Supercopier/resources/progressbarleft.png create mode 100644 plugins/Themes/Supercopier/resources/progressbarright.png create mode 100644 plugins/Themes/Supercopier/resources/putOnBottom.png create mode 100644 plugins/Themes/Supercopier/resources/putOnTop.png create mode 100644 plugins/Themes/Supercopier/resources/remove.png create mode 100644 plugins/Themes/Supercopier/resources/search.png 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/flag.png create mode 100644 resources/Languages/en/informations.xml create mode 100644 resources/Languages/en/translation.ts create mode 100644 resources/bug-128x128.png create mode 100644 resources/img-src/application-exit.svgz create mode 100644 resources/img-src/applications-development.svgz create mode 100644 resources/img-src/arrow-down-double.svgz create mode 100644 resources/img-src/arrow-down.svgz create mode 100644 resources/img-src/arrow-up-double.svgz create mode 100644 resources/img-src/arrow-up.svgz create mode 100644 resources/img-src/checkbox.svgz create mode 100644 resources/img-src/document-encrypt.svgz create mode 100644 resources/img-src/document-preview.svgz create mode 100644 resources/img-src/document-save_16.svgz create mode 100644 resources/img-src/document-save_22.svgz create mode 100644 resources/img-src/drive-removable-media-usb.svgz create mode 100644 resources/img-src/help-about.svgz create mode 100644 resources/img-src/kbugbuster.svgz create mode 100644 resources/img-src/list-add.svgz create mode 100644 resources/img-src/media-playback-pause.svgz create mode 100644 resources/img-src/media-playback-start.svgz create mode 100644 resources/img-src/media-skip-forward.svgz create mode 100644 resources/img-src/process-stop.svgz create mode 100644 resources/img-src/system-shutdown.svgz create mode 100644 resources/img-src/text-formatting.svg create mode 100644 resources/moveDown.png create mode 100644 resources/moveUp.png create mode 100644 resources/none-128x128.png create mode 100644 resources/options.png create mode 100644 resources/qt.conf create mode 100644 resources/resources-windows-qt-plugin.qrc create mode 100644 resources/resources-windows.rc 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/systray_Caught_Unix.png create mode 100644 resources/systray_Caught_Windows.png create mode 100644 resources/systray_Semiuncaught_Unix.png create mode 100644 resources/systray_Semiuncaught_Windows.png create mode 100644 resources/systray_Uncaught_Unix.png create mode 100644 resources/systray_Uncaught_Windows.png create mode 100644 resources/ultracopier-128x128.png create mode 100644 resources/ultracopier-16x16.png 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 create mode 100644 resources/ultracopier.desktop create mode 100644 resources/ultracopier.icns create mode 100644 resources/ultracopier.ico create mode 100644 resources/warning.png create mode 100644 tools/doc/Doxyfile create mode 100644 tools/doc/Doxyfile-plugin-template create mode 100644 tools/doc/footer.html create mode 100644 tools/doc/ultracopier-logo.png create mode 100644 tools/scripts/UltraCP create mode 100644 tools/scripts/UltraMV create mode 100755 tools/to-pack/1-pre-send.sh create mode 100755 tools/to-pack/1-update-translation.sh create mode 100755 tools/to-pack/2-compil-wine32.sh create mode 100755 tools/to-pack/2-compil-wine64.sh create mode 100755 tools/to-pack/2-send-sources.sh create mode 100755 tools/to-pack/3-compil-mac.sh create mode 100755 tools/to-pack/4-clean-all.sh create mode 100755 tools/to-pack/4-upload.sh create mode 100755 tools/to-pack/5-upload.sh create mode 100755 tools/to-pack/6-sendmail.sh create mode 100755 tools/to-pack/data/windows/install-static.nsi create mode 100755 tools/to-pack/data/windows/install.nsi create mode 100644 tools/to-pack/data/windows/resources-windows-ultracopier-plugins.rc create mode 100755 tools/to-pack/data/windows/ultracopier.ico create mode 100755 tools/to-pack/grouped.sh create mode 100755 tools/to-pack/old-3-compil-linux.sh create mode 100755 tools/to-pack/sub-script/assemble-source-version.sh create mode 100644 tools/to-pack/sub-script/assemble-windows-version-32.sh create mode 100644 tools/to-pack/sub-script/assemble-windows-version-64.sh create mode 100644 tools/to-pack/sub-script/assemble.sh create mode 100755 tools/to-pack/sub-script/clean-all.sh create mode 100644 tools/to-pack/sub-script/compil-windows32.sh create mode 100644 tools/to-pack/sub-script/compil-windows64.sh create mode 100644 tools/to-pack/sub-script/compil.sh create mode 100644 tools/to-pack/sub-script/doc.sh create mode 100644 tools/to-pack/sub-script/linux.sh create mode 100644 tools/to-pack/sub-script/mac.sh create mode 100644 tools/to-pack/sub-script/sendmail.sh create mode 100644 tools/to-pack/sub-script/test.sh create mode 100644 tools/to-pack/sub-script/translation-local.sh create mode 100755 tools/to-pack/sub-script/translation.sh create mode 100644 tools/to-pack/sub-script/upload-local.sh create mode 100644 tools/to-pack/sub-script/upload.sh create mode 100755 tools/to-pack/test.sh 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.dox create mode 100644 ultracopier.pro diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..818433e --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/CliParser.cpp b/CliParser.cpp new file mode 100644 index 0000000..7d375ac --- /dev/null +++ b/CliParser.cpp @@ -0,0 +1,197 @@ +/** \file CliParser.cpp +\brief To group into one class, the CLI parsing +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "CliParser.h" +#include "cpp11addition.h" +#include "Core.h" + +#include + +CliParser::CliParser(QObject *parent) : + QObject(parent) +{ + //this->core=core; +} + +/** \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 CliParser::cli(const std::vector &ultracopierArguments,const bool &external,const bool &onlyCheck) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"ultracopierArguments: "+stringimplode(ultracopierArguments,';')); + if(ultracopierArguments.size()==1) + { + if(external) + { + //if(!core->startNewTransferOneUniqueCopyEngine()) + { + #ifdef Q_OS_WIN32 + QString message(tr("Ultracopier is already running, right click on its system tray icon (near the clock) to use it or just copy and paste")); + #else + QString message(tr("Ultracopier is already running, view all notification area icons (near the clock), right click on its system tray icon to use it or just copy and paste")); + #endif + + QMessageBox::warning(NULL,tr("Warning"),message); + showSystrayMessage(message.toStdString()); + } + } + // else do nothing, is normal starting without arguements + return; + } + else if(ultracopierArguments.size()==2) + { + if(ultracopierArguments.back()=="quit") + { + if(onlyCheck) + return; + QCoreApplication::exit(); + return; + } + else if(ultracopierArguments.back()=="--help") + { + showHelp(false); + return; + } + else if(ultracopierArguments.back()=="--options") + { + emit showOptions(); + return; + } + else if(stringEndsWith(ultracopierArguments.back(),".urc")) + { + tryLoadPlugin(ultracopierArguments.back()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Command line not understand"); + showHelp(); + return; + } + else if(ultracopierArguments.size()==3) + { + if(ultracopierArguments.at(1)=="Transfer-list") + { + if(onlyCheck) + return; + QFile transferFile(QString::fromStdString(ultracopierArguments.back())); + if(transferFile.open(QIODevice::ReadOnly)) + { + QString content; + QByteArray data=transferFile.readLine(64); + if(data.size()<=0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"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); + std::vector transferListArguments=stringsplit(content.toStdString(),';'); + transferListArguments[3].erase(std::remove(transferListArguments[3].begin(), transferListArguments[3].end(),'\n'),transferListArguments[3].end()); + 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,"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.back()); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to open the transfer list file: "+transferFile.errorString().toStdString()); + 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)=="Copy" || ultracopierArguments.at(1)=="cp") + { + if(onlyCheck) + return; + std::vector transferList=ultracopierArguments; + transferList.erase(transferList.cbegin()); + transferList.erase(transferList.cbegin()); + if(transferList.back()=="?") + { + transferList.erase(transferList.cbegin()); + emit newCopyWithoutDestination(transferList); + } + else + { + std::string destination=transferList.back(); + transferList.erase(transferList.cbegin()); + emit newCopy(transferList,destination); + } + return; + } + else if(ultracopierArguments.at(1)=="Move" || ultracopierArguments.at(1)=="mv") + { + if(onlyCheck) + return; + std::vector transferList=ultracopierArguments; + transferList.erase(transferList.cbegin()); + transferList.erase(transferList.cbegin()); + if(transferList.back()=="?") + { + transferList.erase(transferList.cbegin()); + emit newMoveWithoutDestination(transferList); + } + else + { + std::string destination=transferList.back(); + transferList.erase(transferList.cbegin()); + emit newMove(transferList,destination); + } + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Command line not understand"); + showHelp(); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"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 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 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 new file mode 100644 index 0000000..edcf115 --- /dev/null +++ b/CliParser.h @@ -0,0 +1,55 @@ +/** \file CliParser.h +\brief To group into one class, the CLI parsing +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef CLIPARSER_H +#define CLIPARSER_H + +#include +#include +#include +#include + +#include "Environment.h" + +class Core; +/** \brief class to parse all command line options */ +class CliParser : public QObject +{ + Q_OBJECT +public: + explicit CliParser(/*Core *core,*/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 std::vector &ultracopierArguments,const bool &external,const bool &onlyCheck); +signals: + /** new copy without destination have been pased by the CLI */ + void newCopyWithoutDestination(std::vector sources) const; + /** new copy with destination have been pased by the CLI */ + void newCopy(std::vector sources,std::string destination) const; + /** new move without destination have been pased by the CLI */ + void newMoveWithoutDestination(std::vector sources) const; + /** new move with destination have been pased by the CLI */ + void newMove(std::vector sources,std::string destination) const; + /** new transfer list pased by the CLI */ + void newTransferList(std::string engine,std::string mode,std::string file) const; + + void tryLoadPlugin(const std::string &file) const; + /// \brief Show the help option + void showOptions() const; + + /// \brief For show a message linked to the systray icon + void showSystrayMessage(const std::string& text); +private: + /** \brief show the help + *\param incorrectArguments if the help is call because the arguments are wrong */ + void showHelp(const bool &incorrectArguments=true); + + //Core *core; +}; + +#endif // CLIPARSER_H diff --git a/CompilerInfo.h b/CompilerInfo.h new file mode 100644 index 0000000..78ba379 --- /dev/null +++ b/CompilerInfo.h @@ -0,0 +1,15 @@ +/** \file CompilerInfo.h +\brief Define the compiler info +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +/// \def COMPILERINFO the string to identify the compiler +#if defined(Q_CC_GNU) + #define COMPILERINFO std::string("GCC ")+std::to_string(__GNUC__)+"."+std::to_string(__GNUC_MINOR__)+"."+std::to_string(__GNUC_PATCHLEVEL__)+" build: "+__DATE__+" "+__TIME__ +#else + #if defined(__DATE__) && defined(__TIME__) + #define COMPILERINFO std::string("Unknown compiler: ")+__DATE__+" "+__TIME__ + #else + #define COMPILERINFO std::string("Unknown compiler") + #endif +#endif diff --git a/CopyEngineManager.cpp b/CopyEngineManager.cpp new file mode 100644 index 0000000..a3934b3 --- /dev/null +++ b/CopyEngineManager.cpp @@ -0,0 +1,385 @@ +/** \file CopyEngineManager.cpp +\brief Define the copy engine manager +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include + +#include "CopyEngineManager.h" +#include "LanguagesManager.h" +#include "cpp11addition.h" + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include "plugins/CopyEngine/Ultracopier/CopyEngineFactory.h" +#endif + +CopyEngineManager::CopyEngineManager(OptionDialog *optionDialog) +{ + 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); + std::vector 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 + std::string pluginPath=plugin.path+PluginsManager::getResolvedPluginName("copyEngine"); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + /*more IO + if(!QFile(pluginPath).exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The plugin binary is missing: "+pluginPath); + return; + }*/ + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+pluginPath); + //search into loaded session + unsigned int index=0; + while(index(pluginObject); + if(newItem.factory!=NULL) + break; + index++; + } + if(index==objectList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"static copy engine not found"); + return; + } + #else + QObject *pluginObject = newItem.pointer->instance(); + if(pluginObject==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin: "+newItem.pointer->errorString().toStdString()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin for "+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,"unable to cast the plugin: "+newItem.pointer->errorString().toStdString()); + 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("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,"plugin: "+newItem.name+" loaded, send options"); + //emit newCopyEngineOptions(plugin.path,newItem.name,newItem.optionsWidget); + pluginList.push_back(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) +{ + unsigned int index=0; + while(indexunload(); + return; + } + index++; + } +} +#endif + +CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode, + const std::vector &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, pluginList.size(): "+std::to_string(pluginList.size())+", mode: "+std::to_string((int)mode)+", and particular protocol"); + returnCopyEngine temp; + unsigned int index=0; + bool isTheGoodEngine=false; + while(indexgetInstance()); + temp.engine=pluginList.at(index).intances.back(); + 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,"protocolsUsedForTheSources: "+stringimplode(protocolsUsedForTheSources,";")+", protocolsUsedForTheDestination: "+protocolsUsedForTheDestination); + + temp.engine=NULL; + temp.type=Ultracopier::File; + temp.canDoOnlyCopy=true; + return temp; +} + +CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,const std::string &name) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, pluginList.size(): "+std::to_string(pluginList.size())+", with mode: "+std::to_string((int)mode)+", and name: "+name); + returnCopyEngine temp; + unsigned int index=0; + while(indexgetInstance()); + temp.engine=pluginList.at(index).intances.back(); + 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,"Cannot find any engine with this name: "+name); + QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name: %1").arg(QString::fromStdString(name))); + temp.engine=NULL; + temp.type=Ultracopier::File; + temp.canDoOnlyCopy=true; + return temp; +} + +#ifdef ULTRACOPIER_DEBUG +void CopyEngineManager::debugInformation(const Ultracopier::DebugLevel &level,const std::string& fonction,const std::string& text,const std::string& file,const int& ligne) +{ + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Copy Engine plugin"); +} +#endif // ULTRACOPIER_DEBUG + +/// \brief To notify when new value into a group have changed +void CopyEngineManager::newOptionValue(const std::string &groupName,const std::string &variableName,const std::string &value) +{ + if(groupName=="CopyEngine" && variableName=="List") + { + Q_UNUSED(value) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start(\""+groupName+"\",\""+variableName+"\",\""+value+"\")"); + allPluginIsloaded(); + } +} + +void CopyEngineManager::setIsConnected() +{ + /* ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + prevent bug, I don't know why, in one case it bug here + */ + isConnected=true; + unsigned int index=0; + while(index actualList; + unsigned int index=0; + while(index preferedList=stringsplit(OptionEngine::optionEngine->getOptionValue("CopyEngine","List"),';'); + vectorRemoveDuplicatesForSmallList(preferedList); + vectorRemoveDuplicatesForSmallList(actualList); + index=0; + while(indexsetOptionValue("CopyEngine","List",stringimplode(preferedList,';')); + std::vector newPluginList; + index=0; + while(index &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination) +{ + unsigned int index=0; + while(index +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include +#endif +#include +#include +#include + +#include "Environment.h" +#include "LocalPluginOptions.h" +#include "OptionDialog.h" +#include "interface/PluginInterface_CopyEngine.h" +#include "FacilityEngine.h" + +namespace Ui { + class CopyEngineOptions; +} + +/** \brief Manage copy engine plugins and their instance */ +class CopyEngineManager : public QObject +{ + 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) + 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 std::vector &protocolsUsedForTheSources,const std::string &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 std::string &name); + //bool currentEngineCanDoOnlyCopy(std::vector protocolsUsedForTheSources,std::string protocolsUsedForTheDestination=""); + //CopyType currentEngineGetCopyType(std::vector protocolsUsedForTheSources,std::string 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 std::vector &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination); +private slots: + 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 std::string& fonction, const std::string& text, const std::string& file, const int& ligne); + #endif // ULTRACOPIER_DEBUG + /// \brief To notify when new value into a group have changed + void newOptionValue(const std::string &groupName,const std::string &variableName,const std::string &value); + void allPluginIsloaded(); +private: + /// \brief the option interface + struct CopyEnginePlugin + { + std::string path; + std::string name; + std::string pluginPath; + std::vector supportedProtocolsForTheSource; + std::vector supportedProtocolsForTheDestination; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader * pointer; + #endif + PluginInterface_CopyEngineFactory * factory; + std::vector intances; + bool canDoOnlyCopy; + Ultracopier::CopyType type; + Ultracopier::TransferListOperation transferListOperation; + LocalPluginOptions *options; + QWidget *optionsWidget; + }; + std::vector pluginList; + OptionDialog *optionDialog; + bool isConnected; +signals: + //void newCopyEngineOptions(std::string,std::string,QWidget *); + void addCopyEngine(std::string name,bool canDoOnlyCopy) const; + void removeCopyEngine(std::string name) const; + void previouslyPluginAdded(PluginsAvailable) const; +}; + +#endif // COPYENGINEMANAGER_H diff --git a/CopyListener.cpp b/CopyListener.cpp new file mode 100644 index 0000000..3c72695 --- /dev/null +++ b/CopyListener.cpp @@ -0,0 +1,480 @@ +/** \file CopyListener.h +\brief Define the copy listener +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "CopyListener.h" +#include "LanguagesManager.h" +#include "cpp11addition.h" + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include "plugins/Listener/catchcopy-v0002/listener.h" +#endif + +#include +#include + +CopyListener::CopyListener(OptionDialog *optionDialog) +{ + stopIt=false; + this->optionDialog=optionDialog; + pluginLoader=new PluginLoader(optionDialog); + //load the options + tryListen=false; + PluginsManager::pluginsManager->lockPluginListEdition(); + std::vector 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=std::regex("[\\\\/]+$"); +} + +CopyListener::~CopyListener() +{ + stopIt=true; + if(pluginLoader!=NULL) + { + delete pluginLoader; + pluginLoader=NULL; + } +} + +void CopyListener::resendState() +{ + if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + { + sendState(true); + if(pluginLoader!=NULL) + pluginLoader->resendState(); + } +} + +void CopyListener::onePluginAdded(const PluginsAvailable &plugin) +{ + if(plugin.category!=PluginType_Listener) + return; + PluginListener newPluginListener; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"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(QString::fromStdString(plugin.path+PluginsManager::getResolvedPluginName("listener"))); + QObject *pluginInstance = pluginOfPluginLoader->instance(); + if(!pluginInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin: "+pluginOfPluginLoader->errorString().toStdString()); + return; + } + PluginInterface_Listener *listen = qobject_cast(pluginInstance); + if(!listen) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin: "+pluginOfPluginLoader->errorString().toStdString()); + return; + } + //check if found + unsigned int index=0; + while(indexunload(); + return; + } + index++; + } + newPluginListener.pluginLoader = pluginOfPluginLoader; + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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("listener"); + newPluginListener.state = Ultracopier::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(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newPluginListener.listenInterface,&PluginInterface_Listener::newLanguageLoaded,Qt::DirectConnection); + pluginList.push_back(newPluginListener); + connect(pluginList.back().listenInterface,&PluginInterface_Listener::newState,this,&CopyListener::newState,Qt::DirectConnection); + if(tryListen) + { + pluginList.back().inWaitOfReply=true; + listen->listen(); + } +} + +#ifdef ULTRACOPIER_DEBUG +void CopyListener::debugInformation(const Ultracopier::DebugLevel &level, const std::string& fonction, const std::string& text, const std::string& file, const int& ligne) +{ + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Listener plugin"); +} +#endif // ULTRACOPIER_DEBUG + +void CopyListener::error(const std::string &error) +{ + QMessageBox::critical(NULL,tr("Error"),tr("Error during the reception of the copy/move list\n%1").arg(QString::fromStdString(error))); +} + +bool CopyListener::oneListenerIsLoaded() +{ + return (pluginList.size()>0); +} + +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE +void CopyListener::onePluginWillBeRemoved(const PluginsAvailable &plugin) +{ + if(plugin.category!=PluginType_Listener) + return; + unsigned 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.erase(pluginList.cbegin()+indexPlugin); + sendState(); + return; + } + indexPlugin++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"not found"); +} +#endif + +void CopyListener::newState(const Ultracopier::ListeningState &state) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + PluginInterface_Listener *temp=qobject_cast(QObject::sender()); + if(temp==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"listener not located!"); + return; + } + unsigned int index=0; + while(indexlisten(); + index++; + } + if(pluginLoader!=NULL) + pluginLoader->load(); +} + +void CopyListener::close() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + tryListen=false; + if(pluginLoader!=NULL) + pluginLoader->unload(); + unsigned int index=0; + while(indexclose(); + index++; + } + copyRunningList.clear(); +} + +std::vector CopyListener::stripSeparator(std::vector sources) +{ + unsigned int index=0; + while(index sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + std::vector list; + list.push_back("file"); + emit newCopyWithoutDestination(incrementOrderId(),list,stripSeparator(sources)); +} + +/** new copy with destination have been pased by the CLI */ +void CopyListener::copy(std::vector sources,std::string destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + std::vector list; + list.push_back("file"); + emit newCopy(incrementOrderId(),list,stripSeparator(sources),"file",destination); +} + +/** new move without destination have been pased by the CLI */ +void CopyListener::moveWithoutDestination(std::vector sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + std::vector list; + list.push_back("file"); + emit newMoveWithoutDestination(incrementOrderId(),list,stripSeparator(sources)); +} + +/** new move with destination have been pased by the CLI */ +void CopyListener::move(std::vector sources,std::string destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + std::vector list; + list.push_back("file"); + emit newMove(incrementOrderId(),list,stripSeparator(sources),"file",destination); +} + +void CopyListener::copyFinished(const quint32 & orderId,const bool &withError) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(indextransferFinished(copyRunningList.at(index).pluginOrderId,withError); + copyRunningList.erase(copyRunningList.cbegin()+index); + return; + } + index++; + } +} + +void CopyListener::copyCanceled(const uint32_t & orderId) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(indextransferCanceled(copyRunningList.at(index).pluginOrderId); + copyRunningList.erase(copyRunningList.cbegin()+index); + return; + } + index++; + } +} + +void CopyListener::newPluginCopyWithoutDestination(const uint32_t &orderId,const std::vector &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sources: "+stringimplode(sources,";")); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList.push_back(newCopyInformation); + std::vector stringList;stringList.push_back("file"); + emit newCopyWithoutDestination(orderId,stringList,stripSeparator(sources)); +} + +void CopyListener::newPluginCopy(const quint32 &orderId,const std::vector &sources,const std::string &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sources: "+stringimplode(sources,";")+", destination: "+destination); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList.push_back(newCopyInformation); + std::vector stringList;stringList.push_back("file"); + emit newCopy(orderId,stringList,stripSeparator(sources),"file",destination); +} + +void CopyListener::newPluginMoveWithoutDestination(const uint32_t &orderId,const std::vector &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sources: "+stringimplode(sources,";")); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList.push_back(newCopyInformation); + std::vector stringList;stringList.push_back("file"); + emit newMoveWithoutDestination(orderId,stringList,stripSeparator(sources)); +} + +void CopyListener::newPluginMove(const quint32 &orderId,const std::vector &sources,const std::string &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sources: "+stringimplode(sources,";")+", destination: "+destination); + PluginInterface_Listener *plugin = qobject_cast(sender()); + CopyRunning newCopyInformation; + newCopyInformation.listenInterface = plugin; + newCopyInformation.pluginOrderId = orderId; + newCopyInformation.orderId = incrementOrderId(); + copyRunningList.push_back(newCopyInformation); + std::vector stringList;stringList.push_back("file"); + emit newMove(orderId,stringList,stripSeparator(sources),"file",destination); +} + +uint32_t CopyListener::incrementOrderId() +{ + do + { + nextOrderId++; + if(nextOrderId>2000000) + nextOrderId=0; + } while(vectorcontainsAtLeastOne(orderList,nextOrderId)); + return nextOrderId; +} + +void CopyListener::allPluginIsloaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"with value: "+std::to_string(pluginList.size()>0)); + sendState(true); + reloadClientList(); +} + +void CopyListener::reloadClientList() +{ + if(!PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + return; + std::vector clients; + unsigned int indexPlugin=0; + while(indexPlugin &clientsList=pluginListener.listenInterface->clientsList(); + clients.insert(clients.cbegin(),clientsList.cbegin(),clientsList.cend()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"ask client to: "+pluginList.at(indexPlugin).path); + } + indexPlugin++; + } + emit newClientList(clients); +} + +void CopyListener::sendState(bool force) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, pluginList.size(): "+std::to_string(pluginList.size())+", force: "+std::to_string(force)); + Ultracopier::ListeningState current_state=Ultracopier::NotListening; + bool found_not_listen=false,found_listen=false,found_inWaitOfReply=false; + unsigned 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,"send listenerReady("+std::to_string(current_state)+","+std::to_string(have_plugin)+","+std::to_string(found_inWaitOfReply)+")"); + emit listenerReady(current_state,have_plugin,found_inWaitOfReply); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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 new file mode 100644 index 0000000..3003aec --- /dev/null +++ b/CopyListener.h @@ -0,0 +1,123 @@ +/** \file CopyListener.h +\brief Define the class to load the plugin and lunch it +\author alpha_one_x86 +\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 "PluginLoader.h" +#include "OptionDialog.h" + +/** \brief to load all the listener and parse all event */ +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 newPluginCopyWithoutDestination(const uint32_t &orderId,const std::vector &sources); + void newPluginCopy(const uint32_t &orderId,const std::vector &sources,const std::string &destination); + void newPluginMoveWithoutDestination(const uint32_t &orderId,const std::vector &sources); + void newPluginMove(const uint32_t &orderId,const std::vector &sources,const std::string &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 std::string& fonction,const std::string& text,const std::string& file,const int& ligne); + #endif // ULTRACOPIER_DEBUG + void error(const std::string &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 uint32_t & 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 uint32_t & 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(std::vector sources); + /** new copy with destination have been pased by the CLI */ + void copy(std::vector sources,std::string destination); + /** new move without destination have been pased by the CLI */ + void moveWithoutDestination(std::vector sources); + /** new move with destination have been pased by the CLI */ + void move(std::vector sources,std::string destination); + signals: + void newCopyWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources) const; + void newCopy(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) const; + void newMoveWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources) const; + void newMove(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &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 std::vector &clientsList) const; + private: + struct PluginListener + { + PluginInterface_Listener *listenInterface; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader *pluginLoader; + #endif + std::string path; + Ultracopier::ListeningState state; + bool inWaitOfReply; + LocalPluginOptions *options; + }; + std::vector pluginList; + //for the options + uint32_t nextOrderId; + std::vector orderList; + //for the copy as suspend + struct CopyRunning + { + PluginInterface_Listener *listenInterface; + uint32_t pluginOrderId; + uint32_t orderId; + }; + std::vector copyRunningList; + uint32_t incrementOrderId(); + bool tryListen; + PluginLoader *pluginLoader; + Ultracopier::ListeningState last_state; + bool last_have_plugin,last_inWaitOfReply; + void sendState(bool force=false); + std::vector stripSeparator(std::vector sources); + OptionDialog *optionDialog; + bool stopIt; + std::regex stripSeparatorRegex; +}; + +#endif // COPYLISTENER_H diff --git a/Core.cpp b/Core.cpp new file mode 100644 index 0000000..9f0e8eb --- /dev/null +++ b/Core.cpp @@ -0,0 +1,1161 @@ +/** \file Core.cpp +\brief Define the class for the core +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include + +#include "Core.h" +#include "ThemesManager.h" +#include "cpp11addition.h" + +Core::Core(CopyEngineManager *copyEngineList) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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() +{ + unsigned 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 uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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.back().orderId.push_back(orderId); + copyList.back().engine->newCopy(sources); + copyList.back().interface->haveExternalOrder(); +} + +void Core::newTransfer(const Ultracopier::CopyMode &mode,const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+stringimplode(sources,";")+", dest: "+destination+", mode: "+std::to_string(mode)); + //search to group the window + int GroupWindowWhen=stringtoint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","GroupWindowWhen")); + bool haveSameSource=false,haveSameDestination=false; + if(GroupWindowWhen!=0) + { + bool needConfirmation=stringtobool(OptionEngine::optionEngine->getOptionValue("Ultracopier","confirmToGroupWindows")); + unsigned 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.push_back(orderId); + if(mode==Ultracopier::Copy) + copyList.at(index).engine->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,"Unable to get a engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a engine instance")); + return; + } + copyList.back().orderId.push_back(orderId); + if(mode==Ultracopier::Copy) + copyList.back().engine->newCopy(sources,destination); + else + copyList.back().engine->newMove(sources,destination); + copyList.back().interface->haveExternalOrder(); +} + +void Core::newCopy(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) +{ + newTransfer(Ultracopier::Copy,orderId,protocolsUsedForTheSources,sources,protocolsUsedForTheDestination,destination); +} + +void Core::newMove(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) +{ + newTransfer(Ultracopier::Move,orderId,protocolsUsedForTheSources,sources,protocolsUsedForTheDestination,destination); +} + +void Core::newMoveWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &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.back().orderId.push_back(orderId); + copyList.back().engine->newMove(sources); + copyList.back().interface->haveExternalOrder(); +} + +/// \brief name to open the right copy engine +void Core::addWindowCopyMove(const Ultracopier::CopyMode &mode,const std::string &name) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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=static_cast(stringtoint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","ActionOnManualOpen"))); + if(ActionOnManualOpen_value!=ActionOnManualOpen_Nothing) + { + if(ActionOnManualOpen_value==ActionOnManualOpen_Folder) + copyList.back().engine->userAddFolder(mode); + else + copyList.back().engine->userAddFile(mode); + } +} + +/// \brief name to open the right copy engine +void Core::addWindowTransfer(const std::string &name) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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(std::string engine,std::string mode,std::string file) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"engine: "+engine+", mode: "+mode+", file: "+file); + if(mode=="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=="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=="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.back().engine->newTransferList(file); +} + +bool Core::startNewTransferOneUniqueCopyEngine() +{ + if(copyList.size()!=1) + return false; + + if(openNewCopyEngineInstance(Ultracopier::Copy,true,std::string())==-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 false; + } + return true; +} + +void Core::loadInterface() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //load the extra files to check the themes availability + if(copyList.size()>0) + { + bool error=false; + unsigned 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(static_cast(copyList.size()-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(Ultracopier::DebugLevel_Notice,"start"); + size_t index=0; + while(index2000000) + nextId=0; + } while(vectorcontainsAtLeastOne(idList,nextId)); + return nextId; +} + +/** 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 Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode, + const std::vector &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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 +\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 Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const std::string &name) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, mode: "+std::to_string(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 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(stringtoint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","remainingTimeAlgorithm"))) + { + 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.push_back(newItem); + connectEngine(static_cast(copyList.size()-1)); + connectInterfaceAndSync(static_cast(copyList.size()-1)); + return static_cast(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(static_cast(index)); +} + +void Core::resetSpeedDetectedInterface() +{ + int index=indexCopySenderInterface(); + if(index!=-1) + resetSpeedDetected(static_cast(index)); +} + +void Core::resetSpeedDetected(const unsigned int &bindex) +{ + const size_t &index=bindex; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start on "+std::to_string(index)); + switch(copyList.at(index).remainingTimeAlgo) + { + case Ultracopier::RemainingTimeAlgo_Logarithmic: + { + size_t sub_index=0; + while(sub_index > &timeList) +{ + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + CopyInstance ©Instance=copyList[index]; + switch(copyInstance.remainingTimeAlgo) + { + case Ultracopier::RemainingTimeAlgo_Logarithmic: + if(copyInstance.remainingTimeLogarithmicValue.size() &timeUnit=timeList.at(sub_index); + const uint8_t &col=fileCatNumber(timeUnit.first); + RemainingTimeLogarithmicColumn &remainingTimeLogarithmicColumn=copyInstance.remainingTimeLogarithmicValue[col]; + if(copyInstance.remainingTimeLogarithmicValue.size()<=col) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"bug, copyInstance.remainingTimeLogarithmicValue.size() "+std::to_string(copyInstance.remainingTimeLogarithmicValue.size())+" < col %2"+std::to_string(col)); + break; + } + else + { + if(timeUnit.second>0) + { + remainingTimeLogarithmicColumn.lastProgressionSpeed.push_back(static_cast(timeUnit.first/timeUnit.second)); + if(remainingTimeLogarithmicColumn.lastProgressionSpeed.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + remainingTimeLogarithmicColumn.lastProgressionSpeed.pop_back(); + } + } + sub_index++; + } + } + break; + default: + case Ultracopier::RemainingTimeAlgo_Traditional: + break; + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the interface sender"); +} + +void Core::actionInProgess(const Ultracopier::EngineActionInProgress &action) +{ + int index=indexCopySenderCopyEngine(); + if(index!=-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action: "+std::to_string(action)+", from "+std::to_string(index)); + //drop here the duplicate action + if(copyList.at(index).action==action) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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) + { + unsigned int index_sub_loop=0; + while(index_sub_loopnewFolderListing(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); + } +} + +/// \brief get the right copy instance (copy engine + interface), by signal emited from copy engine +int Core::indexCopySenderCopyEngine() +{ + const 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 -1; + } + unsigned int 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(indexsetSupportSpeedLimitation(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() +{ + unsigned int index_sub_loop=0; + 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.push_back(lastProgressionTime.elapsed()); + currentCopyInstance.lastSpeedDetected.push_back(diffCopiedSize); + currentCopyInstance.lastAverageSpeedTime.push_back(lastProgressionTime.elapsed()); + currentCopyInstance.lastAverageSpeedDetected.push_back(diffCopiedSize); + while(currentCopyInstance.lastSpeedTime.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + currentCopyInstance.lastSpeedTime.erase(currentCopyInstance.lastSpeedTime.cbegin()); + while(currentCopyInstance.lastSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + currentCopyInstance.lastSpeedDetected.erase(currentCopyInstance.lastSpeedDetected.cbegin()); + while(currentCopyInstance.lastAverageSpeedTime.size()>ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME) + currentCopyInstance.lastAverageSpeedTime.erase(currentCopyInstance.lastAverageSpeedTime.cbegin()); + while(currentCopyInstance.lastAverageSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME) + currentCopyInstance.lastAverageSpeedDetected.erase(currentCopyInstance.lastAverageSpeedDetected.cbegin()); + double totTime=0,totAverageTime=0; + double totSpeed=0,totAverageSpeed=0; + + //current speed + unsigned int index_sub_loop=0; + while(index_sub_loop0) + if(currentCopyInstance.lastAverageSpeedDetected.size()>=ULTRACOPIER_MINVALUESPEED) + currentCopyInstance.interface->detectedSpeed(totSpeed/totTime); + + if(totAverageTime>0) + if(currentCopyInstance.lastAverageSpeedDetected.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; + while(index_sub_loop=ULTRACOPIER_MINVALUESPEED) + { + int average_speed=0; + unsigned 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(); + } + } +} + +uint8_t Core::fileCatNumber(uint64_t 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(Ultracopier::DebugLevel_Notice,"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(Ultracopier::DebugLevel_Notice,"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 unsigned int &index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, remove with the index: "+std::to_string(index)); + //disconnectEngine(index); + //disconnectInterface(index); + copyList[index].canceled=true; + CopyInstance& currentCopyInstance=copyList[index]; + currentCopyInstance.engine->cancel(); + delete currentCopyInstance.nextConditionalSync; + delete currentCopyInstance.interface; + unsigned int index_sub_loop=0; + 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(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 std::string &path,const uint64_t &size,const uint64_t &mtime,const std::string &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(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); +} + +//for the extra logging +void Core::rmPath(const std::string &path) +{ + log.rmPath(path); +} + +void Core::mkPath(const std::string &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(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); +} + +void Core::getActionOnList(const std::vector &actionList) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //send the the interface + const int &index=indexCopySenderCopyEngine(); + if(index!=-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start2"); + if(copyList.at(index).copyEngineIsSync) + copyList.at(index).interface->getActionOnList(actionList); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"start4"); + unsigned int sub_index=0; + if(log.logTransfer() && copyList.at(index).remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Logarithmic) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start5"); + while(sub_index &urls) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + int bindex=indexCopySenderInterface(); + if(bindex!=-1) + { + const unsigned int &index=static_cast(bindex); + std::vector sources; + unsigned 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 new file mode 100644 index 0000000..cd8733e --- /dev/null +++ b/Core.h @@ -0,0 +1,197 @@ +/** \file Core.h +\brief Define the class definition for core, the Copy of each copy/move window +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef CORE_H +#define CORE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "StructEnumDefinition.h" +#include "CopyEngineManager.h" +#include "LogThread.h" +#include "interface/PluginInterface_CopyEngine.h" +#include "interface/PluginInterface_Themes.h" + +/** \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 +{ + 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 + { + std::vector lastProgressionSpeed; + uint64_t totalSize; + uint64_t transferedSize; + }; + + struct CopyInstance + { + unsigned int id; + PluginInterface_CopyEngine * engine; + PluginInterface_Themes * interface; + bool ignoreMode; + Ultracopier::CopyMode mode; + uint64_t numberOfFile; + uint64_t numberOfTransferedFile; + uint64_t currentProgression,totalProgression;//store the file byte transfered, used into the remaining time + Ultracopier::EngineActionInProgress action; + uint64_t lastProgression;//store the real byte transfered, used in speed calculation + std::vector transferItemList;//full info of started item, to have wich progression to poll + std::vector orderId;//external order send via listener plugin + std::string folderListing; + std::string collisionAction; + std::string 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 + std::vector lastSpeedDetected;//stored in bytes + std::vector lastSpeedTime;//stored in ms + //this speed is average speed on more time to calculate the remaining time + std::vector lastAverageSpeedDetected;//stored in bytes + std::vector lastAverageSpeedTime;//stored in ms + + /** for RemainingTimeAlgo_Logarithmic **/ + std::vector remainingTimeLogarithmicValue; + }; + std::vector 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 std::vector &protocolsUsedForTheSources=std::vector(),const std::string &protocolsUsedForTheDestination=""); + /** open with specific copy engine + \param move Copy or move + \param ignoreMode if need ignore the mode + \param name protocols used for sources + */ + int openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const std::string &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 unsigned int &index); + void connectInterfaceAndSync(const unsigned 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 + unsigned int incrementId(); + unsigned int nextId; + std::vector idList; + QTime lastProgressionTime; + QTimer forUpateInformation;///< used to call \see periodicSynchronization() + void resetSpeedDetected(const unsigned int &bindex); + + /** 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, ... + uint64_t realByteTransfered; + + static uint8_t fileCatNumber(uint64_t size); + signals: + void copyFinished(const uint32_t & orderId,bool withError) const; + void copyCanceled(const uint32_t & orderId) const; + public slots: + /** \brief do copy with sources, but ask the destination */ + void newCopyWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources); + void newTransfer(const Ultracopier::CopyMode &mode,const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination); + /** \brief do copy with sources and destination */ + void newCopy(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination); + /** \brief do move with sources, but ask the destination */ + void newMoveWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources); + /** \brief do move with sources and destination */ + void newMove(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination); + /** \brief open copy/move windows with specific engine */ + void addWindowCopyMove(const Ultracopier::CopyMode &mode,const std::string &name); + /** \brief open transfer (copy+move) windows with specific engine */ + void addWindowTransfer(const std::string &name); + /** new transfer list pased by the CLI */ + void newTransferList(std::string engine,std::string mode,std::string file); + + bool startNewTransferOneUniqueCopyEngine(); + 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 unsigned 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 std::string &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 std::string &path,const uint64_t &size,const uint64_t &mtime,const std::string &error); + //for the extra logging + void rmPath(const std::string &path); + void mkPath(const std::string &path); + + /// \brief used to drag and drop files + void urlDropped(const std::vector &urls); + /// \brief to rsync after a new interface connection + void syncReady(); + void doneTime(const std::vector > &timeList); + + void getActionOnList(const std::vector & actionList); + void pushGeneralProgression(const uint64_t ¤t,const uint64_t &total); +}; + +#endif // CORE_H diff --git a/DebugEngine.cpp b/DebugEngine.cpp new file mode 100644 index 0000000..2168210 --- /dev/null +++ b/DebugEngine.cpp @@ -0,0 +1,395 @@ +/** \file DebugEngine.cpp +\brief Define the class for the debug +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include + +#include "Variable.h" +#include "DebugEngine.h" +#include "ExtraSocket.h" +#include "cpp11addition.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__) +#else +# define ULTRACOPIER_DEBUGCONSOLE(a,b) addDebugInformation(a,__func__,b) +#endif + +#ifdef ULTRACOPIER_DEBUG + +/// \brief initiate the ultracopier event dispatcher and check if no other session is running +DebugEngine::DebugEngine() +{ + //fileNameCleaner=std::regex("\\.\\.?[/\\\\]([^/]+[/\\\\])?"); + 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+=""; + debugHtmlContent+="Ultracopier"; + debugHtmlContent+=" "+std::string(ULTRACOPIER_VERSION)+" "+ULTRACOPIER_PLATFORM_NAME.toStdString()+", 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()+FacilityEngine::separator()+"log.html"); + lockFile.setFileName(dir.absolutePath()+FacilityEngine::separator()+"ultracopier.lock"); + fileNameIsLoaded=true; + #else + //Load the ultracopier path + QDir dir(QCoreApplication::applicationDirPath()); + logFile.setFileName(dir.absolutePath()+FacilityEngine::separator()+"log.html"); + lockFile.setFileName(dir.absolutePath()+FacilityEngine::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.data(),static_cast(debugHtmlContent.size())); + } + } + } +} + +/// \brief Destroy the ultracopier event dispatcher +DebugEngine::~DebugEngine() +{ + if(currentBackend==File) + { + removeTheLockFile(); + //Finalize the log file + logFile.write(endOfLogFile.data(),static_cast(endOfLogFile.size())); + logFile.close(); + } +} + +/// \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); +} + +/// \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; +} + +void DebugEngine::addDebugInformationStatic(const Ultracopier::DebugLevel &level,const std::string& function,const std::string& text,const std::string& file,const int& ligne,const std::string& location) +{ + if(DebugEngine::debugEngine==NULL) + { + std::cerr << "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 std::string& text) +{ + if(DebugEngine::debugEngine==NULL) + return; + DebugEngine::debugEngine->addDebugInformation(DebugLevel_custom_UserNote,"",text,"",-1,"Core"); +} + +/// \brief For add message info, this function is thread safe +void DebugEngine::addDebugInformation(const DebugLevel_custom &level,const std::string& function,const std::string& text,std::string file,const int& ligne,const std::string& location) +{ + if(DebugEngine::debugEngine==NULL) + { + std::cerr << "After close: " << function << file << ligne; + return; + } + //Remove the compiler extra patch generated + //file=file.remove(fileNameCleaner);don't clean, too many performance heart + std::string addDebugInformation_lignestring=std::to_string(ligne); + std::string addDebugInformation_fileString=file; + if(ligne!=-1) + addDebugInformation_fileString+=":"+addDebugInformation_lignestring; + //Load the time from start + std::string addDebugInformation_time = std::to_string(startTime.elapsed()); + std::string addDebugInformation_htmlFormat; + bool important=true; + switch(level) + { + case DebugLevel_custom_Information: + addDebugInformation_htmlFormat=""; + break; + case DebugLevel_custom_Critical: + addDebugInformation_htmlFormat=""; + break; + case DebugLevel_custom_Warning: + addDebugInformation_htmlFormat=""; + break; + case DebugLevel_custom_Notice: + { + addDebugInformation_htmlFormat=""; + important=false; + } + break; + case DebugLevel_custom_UserNote: + addDebugInformation_htmlFormat=""; + break; + } + addDebugInformation_htmlFormat+=addDebugInformation_time+""+addDebugInformation_fileString+""+function+"()"+location+""+htmlEntities(text)+"\n"; + //To prevent access of string in multi-thread + { + //Show the text in console + std::string addDebugInformation_textFormat; + if(addDebugInformation_time.size()<8) + addDebugInformation_time=std::string(8-addDebugInformation_time.size(),' ')+addDebugInformation_time; + addDebugInformation_textFormat = "("+addDebugInformation_time+") "; + if(!file.empty() && ligne!=-1) + addDebugInformation_textFormat += file+":"+addDebugInformation_lignestring+":"; + addDebugInformation_textFormat += function+"(), (location: "+location+"): "+text; + QMutexLocker lock_mutex(&mutex); + if(currentBackend==File) + { + if(logFile.size()(addDebugInformation_htmlFormat.size())); + } + } + else + { + if(debugHtmlContent.size()addDebugInformation(startTime.elapsed(),level,function,text,file,static_cast(ligne),location); + } + } +} + +/// \brief Get the html text info for re-show it +std::string DebugEngine::getTheDebugHtml() +{ + if(currentBackend==File) + { + logFile.seek(0); + if(!logFile.isOpen()) + ULTRACOPIER_DEBUGCONSOLE(DebugLevel_custom_Warning,"The log file is not open"); + const QByteArray &data=logFile.readAll(); + return std::string(data.constData(),static_cast(data.size()))+endOfLogFile; + } + else + return debugHtmlContent+endOfLogFile; +} + +/// \brief Get the html end +std::string DebugEngine::getTheDebugEnd() +{ + return endOfLogFile; +} + +/// \brief Drop the html entities +std::string DebugEngine::htmlEntities(const std::string &text) +{ + std::string newText(text); + stringreplaceAll(newText,"&","&"); + /*stringreplaceAll(newText,"\"","""); + stringreplaceAll(newText,"\\","'");*/ + stringreplaceAll(newText,"<","<"); + stringreplaceAll(newText,">",">"); + return newText; +} + +/// \brief return the current backend +DebugEngine::Backend DebugEngine::getCurrentBackend() +{ + return currentBackend; +} + +bool DebugEngine::tryConnect() +{ + QLocalSocket localSocket; + localSocket.connectToServer(QString::fromStdString(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 new file mode 100644 index 0000000..7a75264 --- /dev/null +++ b/DebugEngine.h @@ -0,0 +1,131 @@ +/** \file DebugEngine.h +\brief Define the class for the debug +\author alpha_one_x86 +\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 */ + +#ifndef DEBUG_ENGINE_H +#define DEBUG_ENGINE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Variable.h" +#include "PlatformMacro.h" +#include "StructEnumDefinition.h" +#include "StructEnumDefinition_UltracopierSpecific.h" + +#ifdef ULTRACOPIER_DEBUG + +class DebugModel : public QAbstractTableModel +{ + Q_OBJECT +public: + /// \brief the transfer item displayed + struct DebugItem + { + unsigned int time; + DebugLevel_custom level; + std::string function; + std::string text; + std::string file; + std::string 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 std::string& function, const std::string& text, const std::string &file="", const unsigned int& ligne=0, const std::string& location="Core"); + void setupTheTimer(); + QTimer *updateDisplayTimer; + bool displayed; + bool inWaitOfDisplay; +private: + std::vector 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 +{ + 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 */ + std::string 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 + std::string getTheDebugEnd(); + /** \brief For add message info, this function + \note This function is reentrant */ + static void addDebugInformationStatic(const Ultracopier::DebugLevel &level,const std::string& function,const std::string& text,const std::string& file="",const int& ligne=-1,const std::string& location="Core"); + static void addDebugNote(const std::string& 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 std::string& fonction,const std::string& text,std::string file="",const int& ligne=-1,const std::string& 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 + std::string endOfLogFile; + /// \brief Drop the html entities + std::string htmlEntities(const std::string &text); + /// \brief To store the debug informations + std::string debugHtmlContent; + /// \brief The current backend + Backend currentBackend; + /// try connect to send to the current running instance the arguements + bool tryConnect(); + int addDebugInformationCallNumber; + bool quit; + //std::regex fileNameCleaner;don't clean, too many performance heart +}; + +#endif // ULTRACOPIER_DEBUG + +#endif // DEBUG_ENGINE_H diff --git a/DebugEngineMacro.h b/DebugEngineMacro.h new file mode 100644 index 0000000..c3822cd --- /dev/null +++ b/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_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 +#else // ULTRACOPIER_DEBUG +# 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..5afa3ba --- /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 >= (int)list.size() || 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 QString::fromStdString(item.file); + break; + case 2: + return QString::fromStdString(item.function); + break; + case 3: + return QString::fromStdString(item.location); + break; + case 4: + return QString::fromStdString(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.size() : 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 std::string &function, const std::string &text, const std::string &file, const unsigned int& ligne, const std::string &location) +{ + DebugItem item; + item.time=time; + item.level=level; + item.function=function; + item.text=text; + item.file=file+":"+std::to_string(ligne); + item.location=location; + list.push_back(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 new file mode 100644 index 0000000..d653c5f --- /dev/null +++ b/Environment.h @@ -0,0 +1,21 @@ +/** \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_UltracopierSpecific.h" +#include "PlatformMacro.h" +#include "DebugEngineMacro.h" + +#ifdef ULTRACOPIER_VERSION_PORTABLE + #define ULTRACOPIER_VERSION_PORTABLE_BOOL true +#else + #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 new file mode 100644 index 0000000..b2595fb --- /dev/null +++ b/EventDispatcher.cpp @@ -0,0 +1,699 @@ +/** \file EventDispatcher.cpp +\brief Define the class of the event dispatcher +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include + +#include "EventDispatcher.h" +#include "ExtraSocket.h" +#include "CompilerInfo.h" +#include "ThemesManager.h" +#include "cpp11addition.h" + +#ifdef Q_OS_UNIX + #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() +{ + qRegisterMetaType >("QList"); + qRegisterMetaType >("QList"); + qRegisterMetaType("Ultracopier::EngineActionInProgress"); + qRegisterMetaType >("QList"); + qRegisterMetaType("Ultracopier::ItemOfCopyList"); + qRegisterMetaType("std::string"); + qRegisterMetaType("uint64_t"); + qRegisterMetaType >("std::vector"); + qRegisterMetaType >("std::vector"); + qRegisterMetaType >("std::vector"); + + copyServer=new CopyListener(&optionDialog); + if(!connect(&localListener, &LocalListener::cli, &cliParser, &CliParser::cli,Qt::QueuedConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(ThemesManager::themesManager, &ThemesManager::newThemeOptions, &optionDialog, &OptionDialog::newThemeOptions)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&cliParser, &CliParser::newCopyWithoutDestination, copyServer, &CopyListener::copyWithoutDestination)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&cliParser, &CliParser::newCopy, copyServer, &CopyListener::copy)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&cliParser, &CliParser::newMoveWithoutDestination, copyServer, &CopyListener::moveWithoutDestination)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&cliParser, &CliParser::newMove, copyServer, &CopyListener::move)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyServer, &CopyListener::newClientList, &optionDialog, &OptionDialog::newClientList)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + if(!connect(&cliParser, &CliParser::tryLoadPlugin, PluginsManager::pluginsManager, &PluginsManager::tryLoadPlugin)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + #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,"start"); + //show the ultracopier information + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Windows version: "+GetOSDisplayString()); + #endif + #ifdef __STDC_VERSION__ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__STDC_VERSION__: "+std::to_string(__STDC_VERSION__)); + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,std::string("ULTRACOPIER_VERSION: ")+ULTRACOPIER_VERSION); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,std::string("Qt version: ")+qVersion()+" "+std::to_string(QT_VERSION)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,std::string("ULTRACOPIER_PLATFORM_NAME: ")+ULTRACOPIER_PLATFORM_NAME.toStdString()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Application path: "+QCoreApplication::applicationFilePath().toStdString()+" "+std::to_string(QCoreApplication::applicationPid())); + //ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,COMPILERINFO); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Local socket: "+ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME)); + #if defined(ULTRACOPIER_DEBUG) && defined(ULTRACOPIER_PLUGIN_ALL_IN_ONE) + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Version as all in one"); + QObjectList objectList=QPluginLoader::staticInstances(); + int index=0; + while(indexmetaObject()->className().toStdString()); + index++; + } + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Version as all in one, direct"); + #endif + #endif + + { + const QList mountedVolumesList=QStorageInfo::mountedVolumes(); + int index=0; + while(indexgetOptionValue("Ultracopier","Last_version_used")!="na" && OptionEngine::optionEngine->getOptionValue("Ultracopier","Last_version_used")!=ULTRACOPIER_VERSION) + { + //then ultracopier have been updated + } + OptionEngine::optionEngine->setOptionValue("Ultracopier","Last_version_used",ULTRACOPIER_VERSION); + unsigned int a=stringtouint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","ActionOnManualOpen")); + if(a>2) + OptionEngine::optionEngine->setOptionValue("Ultracopier","ActionOnManualOpen","1"); + a=stringtouint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","GroupWindowWhen")); + if(a>5) + OptionEngine::optionEngine->setOptionValue("Ultracopier","GroupWindowWhen","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,"ultimate key"); + QString key=QString::fromStdString(OptionEngine::optionEngine->getOptionValue("Ultracopier","key")); + 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("Ultracopier","key",key.toStdString()); + break; + } + } + } + } + #endif + + connect(&cliParser, &CliParser::newTransferList,core, &Core::newTransferList); +} + +/// \brief Destroy the ultracopier event dispatcher +EventDispatcher::~EventDispatcher() +{ + 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; +} + +/// \brief Quit ultracopier +void EventDispatcher::quit() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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(Ultracopier::DebugLevel_Critical,"Unable to initialize correctly the software"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Initialize the variable of event loop"); + if(!connect(copyServer, &CopyListener::newCopyWithoutDestination, core, &Core::newCopyWithoutDestination,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyServer, &CopyListener::newCopy, core, &Core::newCopy,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyServer, &CopyListener::newMoveWithoutDestination, core, &Core::newMoveWithoutDestination,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyServer, &CopyListener::newMove, core, &Core::newMove,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(core, &Core::copyFinished, copyServer, &CopyListener::copyFinished,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(core, &Core::copyCanceled, copyServer, &CopyListener::copyCanceled,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + 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); + if(!connect(backgroundIcon, &SystrayIcon::quit,this,&EventDispatcher::quit)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + //show option is for OptionEngine object + if(!connect(backgroundIcon, &SystrayIcon::showOptions, &optionDialog, &OptionDialog::show,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(&cliParser, &CliParser::showOptions, &optionDialog, &OptionDialog::show,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyServer, &CopyListener::listenerReady, backgroundIcon, &SystrayIcon::listenerReady,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyServer, &CopyListener::pluginLoaderReady, backgroundIcon, &SystrayIcon::pluginLoaderReady,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(backgroundIcon, &SystrayIcon::tryCatchCopy, copyServer, &CopyListener::listen,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(backgroundIcon, &SystrayIcon::tryUncatchCopy, copyServer, &CopyListener::close,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(stringtobool(OptionEngine::optionEngine->getOptionValue("CopyListener","CatchCopyAsDefault"))) + copyServer->listen(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"copyServer.oneListenerIsLoaded(): "+std::to_string(copyServer->oneListenerIsLoaded())); + //backgroundIcon->readyToListen(copyServer.oneListenerIsLoaded()); + + #ifdef ULTRACOPIER_DEBUG + if(!connect(backgroundIcon, &SystrayIcon::saveBugReport, DebugEngine::debugEngine, &DebugEngine::saveBugReport,Qt::QueuedConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + #endif + if(!connect(backgroundIcon, &SystrayIcon::addWindowCopyMove, core, &Core::addWindowCopyMove,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(backgroundIcon, &SystrayIcon::addWindowTransfer, core, &Core::addWindowTransfer,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyEngineList, &CopyEngineManager::addCopyEngine, backgroundIcon, &SystrayIcon::addCopyEngine,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + if(!connect(copyEngineList, &CopyEngineManager::removeCopyEngine, backgroundIcon, &SystrayIcon::removeCopyEngine,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + #ifdef ULTRACOPIER_INTERNET_SUPPORT + if(!connect(&internetUpdater,&InternetUpdater::newUpdate, backgroundIcon, &SystrayIcon::newUpdate)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + #endif + copyEngineList->setIsConnected(); + copyServer->resendState(); + + connect(&cliParser, &CliParser::showSystrayMessage, backgroundIcon,&SystrayIcon::showSystrayMessage,Qt::QueuedConnection); + } + //conntect the last chance signal before quit + if(!connect(QCoreApplication::instance(),&QCoreApplication::aboutToQuit,this,&EventDispatcher::quit,Qt::DirectConnection)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + //connect the slot for the help dialog + if(!connect(backgroundIcon,&SystrayIcon::showHelp,&theHelp,&HelpDialog::show)) + { + std::cerr << "connect error at " << __FILE__ << ":" << std::to_string(__LINE__) << std::endl; + abort(); + } + #ifdef ULTRACOPIER_DEBUG + DebugModel::debugModel->setupTheTimer(); + #endif +} + +#ifdef Q_OS_WIN32 +std::string 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 == 0) + return "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.toStdString(); +} +#endif + +#ifdef Q_OS_MAC +std::string 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 "Mac OS X"; + else + { + QDomElement root = domDocument.documentElement(); + if(root.tagName()!=QStringLiteral("plist")) + return "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 "Mac OS X"; + SubChild2 = SubChild2.nextSiblingElement(QStringLiteral("key")); + } + SubChild2=SubChild.firstChildElement(QStringLiteral("string")); + while(!SubChild2.isNull()) + { + if(SubChild2.isElement()) + string << SubChild2.text(); + else + return "Mac OS X"; + SubChild2 = SubChild2.nextSiblingElement(QStringLiteral("string")); + } + } + else + return "Mac OS X"; + SubChild = SubChild.nextSiblingElement(QStringLiteral("property")); + } + } + else + return "Mac OS X"; + } + } + } + if(key.size()!=string.size()) + return "Mac OS X"; + int index=0; + while(index +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "Core.h" +#include "SystrayIcon.h" +#include "OptionEngine.h" +#include "HelpDialog.h" +#ifndef ULTRACOPIER_VERSION_PORTABLE +#include "SessionLoader.h" +#endif +#ifdef ULTRACOPIER_INTERNET_SUPPORT +#include "InternetUpdater.h" +#endif +#include "CopyListener.h" +#include "OptionDialog.h" +#include "CopyEngineManager.h" +#include "LocalListener.h" +#include "CliParser.h" + +/** \brief Define the class of the event dispatcher + +This class provide a core for dispatch the event of signal/slot, it checks too if not other instance is running */ +class EventDispatcher : public QObject +{ + 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 std::string 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; + std::vector 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 new file mode 100644 index 0000000..ef196fa --- /dev/null +++ b/ExtraSocket.cpp @@ -0,0 +1,60 @@ +/** \file ExtraSocket.h +\brief Define the socket of ultracopier +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "ExtraSocket.h" +#include +#include + +std::string ExtraSocket::pathSocket(const std::string &name) +{ +#ifdef Q_OS_UNIX + return name+"-"+std::to_string(getuid()); +#else + QString userName; + + /* bad way for catchcopy compatibility + char uname[1024]; + DWORD len=1023; + if(GetUserNameA(uname, &len)!=FALSE) + userName=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 +#else + #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 std::string pathSocket(const std::string &name); + static char * toHex(const char *str); +}; + +#endif // EXTRASOCKET_H diff --git a/FacilityEngine.cpp b/FacilityEngine.cpp new file mode 100644 index 0000000..8356f05 --- /dev/null +++ b/FacilityEngine.cpp @@ -0,0 +1,251 @@ +/** \file FacilityEngine.cpp +\brief To implement the facility engine, the interface is defined into FacilityInterface() +\see FacilityInterface() +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "FacilityEngine.h" + +#if defined (Q_OS_WIN32) + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif + +FacilityEngine FacilityEngine::facilityEngine; + +FacilityEngine::FacilityEngine() +{ + retranslate(); +} + +/// \brief separator native to the current OS +std::string FacilityEngine::separator() +{ + #ifdef Q_OS_WIN32 + return "\\"; + #else + return "/"; + #endif +} + +/// \brief To force the text re-translation +void FacilityEngine::retranslate() +{ + //undirect translated string + Translation_perSecond="/"+tr("s").toStdString(); + Translation_tooBig=tr("Too big").toStdString(); + Translation_B=tr("B").toStdString(); + Translation_KB=tr("KB").toStdString(); + Translation_MB=tr("MB").toStdString(); + Translation_GB=tr("GB").toStdString(); + Translation_TB=tr("TB").toStdString(); + Translation_PB=tr("PB").toStdString(); + Translation_EB=tr("EB").toStdString(); + Translation_ZB=tr("ZB").toStdString(); + Translation_YB=tr("YB").toStdString(); + Translation_SimplifiedRemaningTime_LessThan10s=tr("Less than %10 seconds").toStdString(); + Translation_SimplifiedRemaningTime_AboutSeconds=tr("About %10 seconds remaining").toStdString(); + Translation_SimplifiedRemaningTime_AboutMinutes=tr("About %1 minutes remaining").toStdString(); + Translation_SimplifiedRemaningTime_AboutHours=tr("About %1 hours remaining").toStdString(); + //load the translations tab + translations["Copy engine"]=tr("Copy engine").toStdString(); + //: a copy + translations["Copy"]=tr("Copy").toStdString(); + //: a transfer + translations["Transfer"]=tr("Transfer").toStdString(); + //: a move + translations["Move"]=tr("Move").toStdString(); + translations["Start"]=tr("Start").toStdString(); + translations["Pause"]=tr("Pause").toStdString(); + translations["Resume"]=tr("Resume").toStdString(); + translations["Skip"]=tr("Skip").toStdString(); + translations["Unlimited"]=tr("Unlimited").toStdString(); + translations["Source"]=tr("Source").toStdString(); + translations["Size"]=tr("Size").toStdString(); + translations["Destination"]=tr("Destination").toStdString(); + translations["Quit"]=tr("Quit").toStdString(); + translations["Target"]=tr("Target").toStdString(); + translations["Time remaining:"]=tr("Time remaining:").toStdString(); + translations["Listing"]=tr("Listing").toStdString(); + translations["Copying"]=tr("Copying").toStdString(); + translations["Listing and copying"]=tr("Listing and copying").toStdString(); + translations["Time remaining:"]=tr("Time remaining:").toStdString(); + //for copy engine + translations["Ask"]=tr("Ask").toStdString(); + translations["Skip"]=tr("Skip").toStdString(); + translations["Overwrite"]=tr("Overwrite").toStdString(); + translations["Overwrite if newer"]=tr("Overwrite if newer").toStdString(); + translations["Overwrite if the last modification dates are different"]=tr("Overwrite if the last modification dates are different").toStdString(); + translations["Rename"]=tr("Rename").toStdString(); + translations["Put to the end of the list"]=tr("Put to the end of the list").toStdString(); + translations["Select source directory"]=tr("Select source directory").toStdString(); + translations["Select destination directory"]=tr("Select destination directory").toStdString(); + translations["Internal error"]=tr("Internal error").toStdString(); + translations["Select one or more files to open"]=tr("Select one or more files to open").toStdString(); + translations["All files"]=tr("All files").toStdString(); + translations["Save transfer list"]=tr("Save transfer list").toStdString(); + translations["Open transfer list"]=tr("Open transfer list").toStdString(); + translations["Transfer list"]=tr("Transfer list").toStdString(); + translations["Error"]=tr("Error").toStdString(); + translations["Not supported on this platform"]=tr("Not supported on this platform").toStdString(); + translations["Completed in %1"]=tr("Completed in %1").toStdString(); +} + +/// \brief convert size in Byte to String +std::string FacilityEngine::sizeToString(const double &size) const +{ + double size_temp=size; + if(size_temp<1024) + return std::to_string((unsigned int)size_temp)+sizeUnitToString(Ultracopier::SizeUnit_byte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_KiloByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_MegaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_GigaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_TeraByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_PetaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_ExaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_ZettaByte); + if((size_temp=size_temp/1024)<1024) + return adaptString(static_cast(size_temp))+sizeUnitToString(Ultracopier::SizeUnit_YottaByte); + return Translation_tooBig; +} + +std::string FacilityEngine::adaptString(const float &size) const +{ + if(size>=100) + return QString::number(static_cast(size),'f',0).toStdString(); + else + return QString::number(static_cast(size),'g',3).toStdString(); +} + + +/// \brief convert size unit to String +std::string FacilityEngine::sizeUnitToString(const Ultracopier::SizeUnit &sizeUnit) const +{ + 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: "+std::to_string(sizeUnit)); + return "???"; + } +} + +/// \brief translate the text +std::string FacilityEngine::translateText(const std::string &text) const +{ + if(translations.find(text)!=translations.cend()) + return translations.at(text); + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"translation not found: "+text); + return text; + } +} + +/// \brief speed to string in byte per seconds +std::string FacilityEngine::speedToString(const double &speed) const +{ + return sizeToString(speed)+Translation_perSecond; +} +/// \brief Decompose the time in second +Ultracopier::TimeDecomposition FacilityEngine::secondsToTimeDecomposition(const uint32_t &seconds) const +{ + quint32 seconds_temp=seconds; + Ultracopier::TimeDecomposition returnValue; + returnValue.second=static_cast(seconds_temp%60); + seconds_temp-=returnValue.second; + seconds_temp/=60; + returnValue.minute=static_cast(seconds_temp%60); + seconds_temp-=returnValue.minute; + seconds_temp/=60; + returnValue.hour=static_cast(seconds_temp); + return returnValue; +} + +/// \brief have the functionality +bool FacilityEngine::haveFunctionality(const std::string &fonctionnality) const +{ + #if defined (Q_OS_WIN32) + if(fonctionnality=="shutdown") + return true; + #endif + Q_UNUSED(fonctionnality); + return false; +} + +/// \brief call the fonctionnality +std::string FacilityEngine::callFunctionality(const std::string &fonctionnality,const std::vector &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 std::string(); +} + +/// \brief Do the simplified time +std::string FacilityEngine::simplifiedRemainingTime(const uint32_t &seconds) const +{ + if(seconds<50) + { + if(seconds<10) + return QString::fromStdString(Translation_SimplifiedRemaningTime_LessThan10s).arg(seconds/10+1).toStdString(); + else + return QString::fromStdString(Translation_SimplifiedRemaningTime_AboutSeconds).arg(seconds/10+1).toStdString(); + } + if(seconds<3600) + return QString::fromStdString(Translation_SimplifiedRemaningTime_AboutMinutes).arg(seconds/60).toStdString(); + return QString::fromStdString(Translation_SimplifiedRemaningTime_AboutHours).arg(seconds/3600).toStdString(); +} + +/// \brief Return ultimate url, empty is not found or already ultimate +std::string FacilityEngine::ultimateUrl() const +{ + #ifdef ULTRACOPIER_VERSION_ULTIMATE + return std::string(); + #else + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + return "http://ultracopier.first-world.info/shop.html"; + #else + return std::string(); + #endif + #endif +} + +/// \brief Return the software name +std::string FacilityEngine::softwareName() const +{ + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + return "Supercopier"; + #else + return "Ultracopier"; + #endif +} diff --git a/FacilityEngine.h b/FacilityEngine.h new file mode 100644 index 0000000..5b6c6a9 --- /dev/null +++ b/FacilityEngine.h @@ -0,0 +1,76 @@ +/** \file FacilityEngine.h +\brief To implement the facility engine, the interface is defined into FacilityInterface() +\see FacilityInterface() +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FACILITYENGINE_H +#define FACILITYENGINE_H + +#include +#include +#include + +#include "interface/FacilityInterface.h" +#include "Environment.h" + +/** \brief Class to group general function for the plugin + +This class is used into some plugin like copy engine plugin, to all into one place all common function, group the traduction, and all what it can grouped across all plugin into Ultracopier core application. +*/ +class FacilityEngine : public FacilityInterface +{ + Q_OBJECT +public: + explicit FacilityEngine(); + /// \brief convert size in Byte to String + std::string sizeToString(const double &size) const; + /// \brief convert size unit to String + std::string sizeUnitToString(const Ultracopier::SizeUnit &sizeUnit) const; + /// \brief translate the text + std::string translateText(const std::string &text) const; + /// \brief speed to string in byte per seconds + std::string speedToString(const double &speed) const; + /// \brief Decompose the time in second + Ultracopier::TimeDecomposition secondsToTimeDecomposition(const uint32_t &seconds) const; + /// \brief have the fonctionnality + bool haveFunctionality(const std::string &fonctionnality) const; + /// \brief call the fonctionnality + std::string callFunctionality(const std::string &fonctionnality,const std::vector &args=std::vector()); + /// \brief Do the simplified time + std::string simplifiedRemainingTime(const uint32_t &seconds) const; + /// \brief Return ultimate url, empty is not found or already ultimate + std::string ultimateUrl() const; + /// \brief Return the software name + std::string softwareName() const; + /// \brief separator native to the current OS + static std::string separator(); + + static FacilityEngine facilityEngine; +private: + //undirect translated string + std::string Translation_perSecond; + std::string Translation_tooBig; + std::string Translation_B; + std::string Translation_KB; + std::string Translation_MB; + std::string Translation_GB; + std::string Translation_TB; + std::string Translation_PB; + std::string Translation_EB; + std::string Translation_ZB; + std::string Translation_YB; + //simplified remaining time + std::string Translation_SimplifiedRemaningTime_LessThan10s; + std::string Translation_SimplifiedRemaningTime_AboutSeconds; + std::string Translation_SimplifiedRemaningTime_AboutMinutes; + std::string Translation_SimplifiedRemaningTime_AboutHours; + //internal fonction + inline std::string adaptString(const float &nb) const; + std::unordered_map translations; +public slots: + /// \brief To force the text re-translation + void retranslate(); +}; + +#endif // FACILITYENGINE_H diff --git a/HelpDialog.cpp b/HelpDialog.cpp new file mode 100644 index 0000000..0e266e4 --- /dev/null +++ b/HelpDialog.cpp @@ -0,0 +1,145 @@ +/** \file HelpDialog.cpp +\brief Define the help dialog +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "HelpDialog.h" + +#include +#include + +/// \brief Construct the object +HelpDialog::HelpDialog() : + ui(new Ui::HelpDialog) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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; +} + +/// \brief To re-translate the ui +void HelpDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + ui->retranslateUi(this); + reloadTextValue(); + break; + default: + break; + } +} + +/// \brief To reload the text value +void HelpDialog::reloadTextValue() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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(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",QString::fromStdString(getWebSite())); + ui->label_site->setText(text); + + text=ui->label_platform->text(); + text=text.replace(QStringLiteral("%1"),ULTRACOPIER_PLATFORM_NAME); + ui->label_platform->setText(text); +} + +std::string HelpDialog::getWebSite() +{ + return tr("http://ultracopier.first-world.info/").toStdString(); +} + + +std::string HelpDialog::getUpdateUrl() +{ + #if defined(ULTRACOPIER_VERSION_ULTIMATE) + return tr("http://ultracopier.first-world.info/shop.html").toStdString(); + #else + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + return tr("http://ultracopier.first-world.info/").toStdString()+"supercopier.html"; + #else + return tr("http://ultracopier.first-world.info/download.html").toStdString(); + #endif + #endif +} + +#ifdef ULTRACOPIER_DEBUG +void HelpDialog::on_lineEditInsertDebug_returnPressed() +{ + DebugEngine::addDebugNote(ui->lineEditInsertDebug->text().toStdString()); + ui->lineEditInsertDebug->clear(); + ui->debugView->scrollToBottom(); +} +#endif // ULTRACOPIER_DEBUG + +void HelpDialog::on_pushButtonAboutQt_clicked() +{ + QApplication::aboutQt(); +} + +void HelpDialog::on_pushButtonCrash_clicked() +{ + int a=0; + int *b=NULL; + *b=3/a; +} diff --git a/HelpDialog.h b/HelpDialog.h new file mode 100644 index 0000000..91e5dbc --- /dev/null +++ b/HelpDialog.h @@ -0,0 +1,48 @@ +/** \file HelpDialog.h +\brief Define the help dialog +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef DIALOG_H +#define DIALOG_H + +#include +#include +#include +#include +#include + +#include "ui_HelpDialog.h" +#include "Environment.h" + +namespace Ui { + class HelpDialog; +} + +/** \brief Help dialog, and some user oriented repport/debug function */ +class HelpDialog : public QDialog { + Q_OBJECT + public: + /// \brief Construct the object + HelpDialog(); + /// \brief Destruct the object + ~HelpDialog(); + static std::string getWebSite(); + static std::string 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 new file mode 100644 index 0000000..5d42f18 --- /dev/null +++ b/HelpDialog.ui @@ -0,0 +1,191 @@ + + + HelpDialog + + + + 0 + 0 + 681 + 389 + + + + + 16777215 + 16777214 + + + + + :/ultracopier-16x16.png:/ultracopier-16x16.png + + + + + + QLayout::SetMinimumSize + + + + + + 128 + 128 + + + + + 128 + 128 + + + + :/ultracopier-128x128.png + + + + + + + + + + 12 + 75 + true + + + + Ultracopier %1 + + + + + + + Based on Qt. Advanced utility to copy files under GPL3 license. +This version is compiled as version: %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> + + + true + + + + + + + Platform: %1 + + + + + + + + + + + Insert debug note to annotate some special action at current time + + + Insert debug note to annotate some special action at current time + + + Insert debug note to annotate some special action at current time + + + + + + + false + + + true + + + + + + + + + About Qt + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Do a crash + + + + + + + Save bug report + + + + + + + Close + + + + + + + + + debugView + lineEditInsertDebug + pushButtonAboutQt + pushButtonSaveBugReport + pushButtonClose + + + + + + + pushButtonClose + clicked() + HelpDialog + hide() + + + 387 + 216 + + + 329 + 212 + + + + + diff --git a/InternetUpdater.cpp b/InternetUpdater.cpp new file mode 100644 index 0000000..a3dbded --- /dev/null +++ b/InternetUpdater.cpp @@ -0,0 +1,110 @@ +#include "InternetUpdater.h" +#include "EventDispatcher.h" +#include "OptionEngine.h" +#include "cpp11addition.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(!stringtobool(OptionEngine::optionEngine->getOptionValue("Ultracopier","checkTheUpdate"))) + return; + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + std::string name="Supercopier"; + #else + std::string name="Ultracopier"; + #endif + std::string ultracopierVersion; + #ifdef ULTRACOPIER_VERSION_ULTIMATE + ultracopierVersion=name+" Ultimate/"+ULTRACOPIER_VERSION; + #else + ultracopierVersion=name+"/"+ULTRACOPIER_VERSION; + #endif + #ifdef ULTRACOPIER_VERSION_PORTABLE + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + ultracopierVersion+=" portable/all-in-one"; + #else + ultracopierVersion+=" portable"; + #endif + #else + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + ultracopierVersion+=" all-in-one"; + #endif + #endif + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + ultracopierVersion+=" (OS: "+EventDispatcher::GetOSDisplayString()+")"; + #endif + ultracopierVersion+=" "+std::string(ULTRACOPIER_PLATFORM_CODE); + QNetworkRequest networkRequest(QStringLiteral(ULTRACOPIER_UPDATER_URL)); + networkRequest.setHeader(QNetworkRequest::UserAgentHeader,QString::fromStdString(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,"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,"get the new update failed: "+reply->errorString().toStdString()); + reply->deleteLater(); + return; + } else if (!redirectionTarget.isNull()) { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"redirection denied to: "+redirectionTarget.toUrl().toString().toStdString()); + reply->deleteLater(); + return; + } + QString newVersion=QString::fromUtf8(reply->readAll()); + if(newVersion.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"version string is empty"); + reply->deleteLater(); + return; + } + newVersion.remove("\n"); + if(!newVersion.contains(QRegularExpression(QLatin1Literal("^[0-9]+(\\.[0-9]+)+$")))) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"version string don't match: "+newVersion.toStdString()); + reply->deleteLater(); + return; + } + if(newVersion==ULTRACOPIER_VERSION) + { + reply->deleteLater(); + return; + } + if(PluginsManager::compareVersion(newVersion.toStdString(),"<=",ULTRACOPIER_VERSION)) + { + reply->deleteLater(); + return; + } + newUpdateTimer.stop(); + emit newUpdate(newVersion.toStdString()); + reply->deleteLater(); +} + +#endif diff --git a/InternetUpdater.h b/InternetUpdater.h new file mode 100644 index 0000000..25b13f4 --- /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 std::string &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 new file mode 100644 index 0000000..a8849c4 --- /dev/null +++ b/LanguagesManager.cpp @@ -0,0 +1,287 @@ +/** \file LanguagesManager.cpp +\brief Define the class to manage and load the languages +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include + +#include "LanguagesManager.h" +#include "FacilityEngine.h" +#include "cpp11addition.h" + +/// \brief Create the manager and load the defaults variables +LanguagesManager::LanguagesManager() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //load the rest + std::vector resourcesPaths=ResourcesManager::resourcesManager->getReadPath(); + unsigned 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); + std::vector list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_Languages); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + //load the GUI option + std::vector > KeysList; + KeysList.push_back(std::pair("Language","en")); + KeysList.push_back(std::pair("Language_force","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() +{ +} + +/// \brief load the language selected, return the main short code like en, fr, .. +std::string LanguagesManager::getTheRightLanguage() const +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(LanguagesAvailableList.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"empty combobox list, failing back to english"); + return "en"; + } + else + { + if(!stringtobool(OptionEngine::optionEngine->getOptionValue("Language","Language_force"))) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"language auto-detection, QLocale::system().name(): "+QLocale::system().name().toStdString()+", QLocale::languageToString(QLocale::system().language()): "+QLocale::languageToString(QLocale::system().language()).toStdString()); + std::string tempLanguage=getMainShortName(QLocale::languageToString(QLocale::system().language()).toStdString()); + if(!tempLanguage.empty()) + return tempLanguage; + else + { + tempLanguage=getMainShortName(QLocale::system().name().toStdString()); + if(!tempLanguage.empty()) + return tempLanguage; + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Autodetection of the language failed, QLocale::languageToString(QLocale::system().language()): "+QLocale::languageToString(QLocale::system().language()).toStdString()+", QLocale::system().name(): "+QLocale::system().name().toStdString()+", failing back to english"); + return OptionEngine::optionEngine->getOptionValue("Language","Language"); + } + } + } + else + return OptionEngine::optionEngine->getOptionValue("Language","Language"); + } +} + +/* \brief To set the current language +\param newLanguage Should be short name code found into informations.xml of language file */ +void LanguagesManager::setCurrentLanguage(const std::string &newLanguage) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+newLanguage); + //protection for re-set the same language + if(currentLanguage==newLanguage) + return; + //store the language + PluginsManager::pluginsManager->setLanguage(newLanguage); + //unload the old language + if(currentLanguage!="en") + { + unsigned int indexTranslator=0; + while(indexTranslator fileToLoad; + //load the language main + if(newLanguage=="en") + fileToLoad.push_back(":/Languages/en/translation.qm"); + else + fileToLoad.push_back(LanguagesAvailableList.at(index).path+"translation.qm"); + //load the language plugin + std::vector listLoadedPlugins=PluginsManager::pluginsManager->getPlugins(); + unsigned int indexPluginIndex=0; + while(indexPluginIndexload(QString::fromStdString(fileToLoad.at(indexTranslationFile))) || temp->isEmpty()) + { + delete temp; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the translation file: "+fileToLoad.at(indexTranslationFile)); + } + else + { + QCoreApplication::installTranslator(temp); + installedTranslator.push_back(temp); + } + indexTranslationFile++; + } + temp=new QTranslator(); + if(temp->load(QString("qt_")+QString::fromStdString(newLanguage), QLibraryInfo::location(QLibraryInfo::TranslationsPath)) && !temp->isEmpty()) + { + QCoreApplication::installTranslator(temp); + installedTranslator.push_back(temp); + } + else + { + if(!temp->load(QString::fromStdString(LanguagesAvailableList.at(index).path)+"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.push_back(temp); + } + } + } + currentLanguage=newLanguage; + FacilityEngine::facilityEngine.retranslate(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"emit newLanguageLoaded()"); + emit newLanguageLoaded(currentLanguage); + return; + } + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to found language: "+newLanguage+", LanguagesAvailableList.size(): "+std::to_string(LanguagesAvailableList.size())); +} + +/// \brief check if short name is found into language +std::string LanguagesManager::getMainShortName(const std::string &shortName) const +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(indexallPluginHaveBeenLoaded()) + setCurrentLanguage(getTheRightLanguage()); +} + +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE +void LanguagesManager::onePluginWillBeRemoved(const PluginsAvailable &plugin) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(index +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "OptionEngine.h" +#include "ResourcesManager.h" +#include "PluginsManager.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 LanguagesManager : public QObject +{ + Q_OBJECT + //public: + // QString getMainShortName(); + public: + const std::string 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 std::string &newLanguage); + /// \brief Structure of language + struct LanguagesAvailable + { + std::string path; + std::string fullName; + std::string mainShortName; + std::unordered_set shortName; + }; + /// \brief To store the language path + std::vector languagePath; + /// \brief To store the language detected + std::vector LanguagesAvailableList; + /// \brief check if short name is found into language + std::string getMainShortName(const std::string &shortName) const; + /// \brief list of installed translator + std::vector installedTranslator; + std::string currentLanguage; + /// \brief load the language selected + std::string 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 std::string &group); + signals: + //send the language is loaded or the new language is loaded + void newLanguageLoaded(const std::string &mainShortName) const; + void previouslyPluginAdded(PluginsAvailable) const; +}; + +#endif // LANGUAGES_MANAGER_H diff --git a/LocalListener.cpp b/LocalListener.cpp new file mode 100644 index 0000000..4a418aa --- /dev/null +++ b/LocalListener.cpp @@ -0,0 +1,348 @@ +/** \file LocalListener.cpp +\brief The have local server, to have unique instance, and send arguments to the current running instance +\author alpha_one_x86 +\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, &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(QString::fromStdString(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME)))) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to remove the listening server"); + } +} + +bool LocalListener::tryConnect() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::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,QDir::currentPath()); + + std::vector ultracopierArgumentsStd; + { + int index=0; + while(indexseek(0); + out << block.size(); + do + { + QByteArray blockToSend; + blockToSend=block.left(32*1024);//32KB + block.remove(0,blockToSend.size()); + #ifdef ULTRACOPIER_DEBUG + int byteWriten = + #endif + 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().toStdString()); + if(blockToSend.size()!=byteWriten) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"blockToSend("+std::to_string(blockToSend.size())+ + ")!=byteWriten("+std::to_string(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: "+blockToSend.toHex().toStdString()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"byteWriten: "+std::to_string(byteWriten)+ + ", size sending: "+std::to_string(blockToSend.size())); + } + while(block.size()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"disconnect the socket"); + localSocket.disconnectFromServer(); + return true; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"connection failed, continue..."); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"ultracopierArguments: "+ultracopierArguments.join(";").toStdString()); + return false; + } +} + +/// the listen server +void LocalListener::listenServer() +{ + if(!QLocalServer::removeServer(QString::fromStdString(ExtraSocket::pathSocket(ULTRACOPIER_SOCKETNAME)))) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to remove the listening server"); + #ifndef Q_OS_MAC + localServer.setSocketOptions(QLocalServer::UserAccessOption); + #endif + if(!localServer.listen(QString::fromStdString(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,"Ultracopier have not able to lock unique instance: "+localServer.errorString().toStdString()+ + ", error code: "+std::to_string((int32_t)localServer.serverError())); + } + else + connect(&localServer, &QLocalServer::newConnection, this, &LocalListener::newConnexion); +} + +//the time is done +void LocalListener::timeoutDectected() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"start"); + if(clientList.size()>0) + { + unsigned int index=0; + bool haveData=false; + while(index(sender()); + if (socket == 0) // If not found + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"bad socket"); + return; + } + + int index=-1; + for (unsigned int i=0;ibytesAvailable() "+std::to_string(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(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(Ultracopier::DebugLevel_Notice,"Need wait to recomposite: "+std::to_string(clientList.at(index).data.size())+ + ", targeted: "+std::to_string(clientList.at(index).size)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"tempComposed.data: "+clientList.at(index).data.toHex().toStdString()); + } + else if(socket->bytesAvailable() == clientList.at(index).size) //if the size match + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"socket->bytesAvailable(): "+std::to_string(socket->bytesAvailable())+ + ", for total of: "+std::to_string(socket->bytesAvailable()+sizeof(uint32_t))); + QStringList ultracopierArguments; + in >> ultracopierArguments; + std::vector ultracopierArgumentsStd; + { + int index=0; + while(indexbytesAvailable(): "+std::to_string(socket->bytesAvailable())+" > clientList.at(index).size!: "+std::to_string(clientList.at(index).size)); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Query recomposed with this size: "+std::to_string(clientList.at(index).data.size())); + clientList[index].data.append(socket->readAll()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Query recomposed with this size: "+std::to_string(clientList.at(index).data.size())); + if(clientList.at(index).data.size()==clientList.at(index).size) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"QByteArray reconstruction finished"); + QDataStream in(clientList.at(index).data); + QStringList ultracopierArguments; + in >> ultracopierArguments; + std::vector ultracopierArgumentsStd; + { + int index=0; + while(index(sender()); + if (socket == 0) // If not found + return; + for (unsigned int i = 0; i < clientList.size(); ++i) { + if(clientList.at(i).socket==socket) + clientList.erase(clientList.cbegin()+i); + } + socket->deleteLater(); +} + +/// LocalListener New connexion +void LocalListener::newConnexion() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"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.push_back(newClient); +} + +#ifdef ULTRACOPIER_DEBUG +/** \brief If error occured at socket +\param theErrorDefine The error define */ +void LocalListener::error(const QLocalSocket::LocalSocketError &theErrorDefine) +{ + if(theErrorDefine!=QLocalSocket::PeerClosedError) + { + QLocalSocket *client=qobject_cast(QObject::sender()); + if(client!=NULL) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Value:"+std::to_string(theErrorDefine)+", Error message: "+client->errorString().toStdString()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Value:"+std::to_string(theErrorDefine)); + } +} +#endif + +/// \can now parse the cli +void LocalListener::allPluginIsloaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::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,QDir::currentPath()); + + std::vector ultracopierArgumentsStd; + { + int index=0; + while(index +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "ExtraSocket.h" + +/** \brief To have unique instance, and pass arguments to the existing instance if needed */ +class LocalListener : public QObject +{ + Q_OBJECT +public: + explicit LocalListener(QObject *parent = 0); + ~LocalListener(); +public slots: + /// try connect to existing server + bool tryConnect(); + /// the listen server + void listenServer(); +private: + QLocalServer localServer; + QTimer TimeOutQLocalSocket;/// \todo by client + typedef struct { + QLocalSocket * socket; + QByteArray data; + int size; + bool haveData; + } ComposedData; + std::vector 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(const QLocalSocket::LocalSocketError &theErrorDefine); + #endif + /// can now parse the cli + void allPluginIsloaded(); +signals: + void cli(const std::vector &ultracopierArguments,const bool &external,const bool &onlyCheck) const; +}; + +#endif // LOCALLISTENER_H diff --git a/LocalPluginOptions.cpp b/LocalPluginOptions.cpp new file mode 100644 index 0000000..f981e0b --- /dev/null +++ b/LocalPluginOptions.cpp @@ -0,0 +1,59 @@ +/** \file LocalPluginOptions.cpp +\brief To bind the options of the plugin, into unique group options +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "LocalPluginOptions.h" + +LocalPluginOptions::LocalPluginOptions(const std::string &group) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start(\""+group+"\",[...])"); + groupOptionAdded=false; + this->group=group; + connect(OptionEngine::optionEngine,&OptionEngine::resetOptions,this,&OptionInterface::resetOptions); +} + +LocalPluginOptions::~LocalPluginOptions() +{ + if(groupOptionAdded) + { + if(OptionEngine::optionEngine!=NULL) + OptionEngine::optionEngine->removeOptionGroup(group); + } +} + +/// \brief To add option group to options +bool LocalPluginOptions::addOptionGroup(const std::vector > &KeysList) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start(\""+group+"\",[...])"); + if(groupOptionAdded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Group already added!"); + return false; + } + else + { + groupOptionAdded=true; + return OptionEngine::optionEngine->addOptionGroup(group,KeysList); + } +} + +/// \brief To get option value +std::string LocalPluginOptions::getOptionValue(const std::string &variableName) const +{ + return OptionEngine::optionEngine->getOptionValue(group,variableName); +} + +/// \brief To set option value +void LocalPluginOptions::setOptionValue(const std::string &variableName,const std::string &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); +}*/ + diff --git a/LocalPluginOptions.h b/LocalPluginOptions.h new file mode 100644 index 0000000..9f30f2f --- /dev/null +++ b/LocalPluginOptions.h @@ -0,0 +1,42 @@ +/** \file LocalPluginOptions.h +\brief To bind the options of the plugin, into unique group options +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef LOCALPLUGINOPTIONS_H +#define LOCALPLUGINOPTIONS_H + +#include + +#include "interface/OptionInterface.h" +#include "OptionEngine.h" + +/** \brief To store the options + + 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. + + \see OptionEngine::OptionEngine() +*/ +class LocalPluginOptions : public OptionInterface +{ + Q_OBJECT +public: + explicit LocalPluginOptions(const std::string &group); + ~LocalPluginOptions(); + /// \brief To add option group to options + bool addOptionGroup(const std::vector > &KeysList); + /*/// \brief To remove option group to options, removed to the load plugin + bool removeOptionGroup();*/ + /// \brief To get option value + std::string getOptionValue(const std::string &variableName) const; + /// \brief To set option value + void setOptionValue(const std::string &variableName,const std::string &value); +protected: + //for the options + std::string group; + bool groupOptionAdded; +/*public slots:-> disabled because the value will not externaly changed, then useless notification + void newOptionValue(QString group,QString variable,QVariant value);*/ +}; + +#endif // LOCALPLUGINOPTIONS_H diff --git a/LogThread.cpp b/LogThread.cpp new file mode 100644 index 0000000..234ccbf --- /dev/null +++ b/LogThread.cpp @@ -0,0 +1,296 @@ +/** \file LogThread.cpp +\brief The thread to do the log but not block the main thread +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "LogThread.h" +#include "ResourcesManager.h" +#include "OptionEngine.h" +#include "cpp11addition.h" + +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif +#include + +std::string LogThread::text_header_copy="[Copy] "; +std::string LogThread::text_header_move="[Move] "; +std::string LogThread::text_header_skip="[Skip] "; +std::string LogThread::text_header_stop="[Stop] "; +std::string LogThread::text_header_error="[Error] "; +std::string LogThread::text_header_MkPath="[MkPath] "; +std::string LogThread::text_header_RmPath="[RmPath] "; + +std::string LogThread::text_var_source="%source%"; +std::string LogThread::text_var_size="%size%"; +std::string LogThread::text_var_destination="%destination%"; +std::string LogThread::text_var_path="%path%"; +std::string LogThread::text_var_error="%error%"; +std::string LogThread::text_var_mtime="%mtime%"; +std::string LogThread::text_var_time="%time%"; +std::string LogThread::text_var_timestring="%dd.MM.yyyy h:m:s%"; +#ifdef Q_OS_WIN32 +std::string LogThread::text_var_computer="%computer%"; +std::string LogThread::text_var_user="%user%"; +#endif +std::string LogThread::text_var_operation="%operation%"; +std::string LogThread::text_var_rmPath="%rmPath%"; +std::string LogThread::text_var_mkPath="%mkPath%"; + +LogThread::LogThread() +{ + 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("Write_log", "transfer", OptionEngine::optionEngine->getOptionValue("Write_log","transfer")); + newOptionValue("Write_log", "error", OptionEngine::optionEngine->getOptionValue("Write_log","error")); + newOptionValue("Write_log", "folder", OptionEngine::optionEngine->getOptionValue("Write_log","folder")); + newOptionValue("Write_log", "sync", OptionEngine::optionEngine->getOptionValue("Write_log","sync")); + newOptionValue("Write_log", "transfer_format", OptionEngine::optionEngine->getOptionValue("Write_log","transfer_format")); + newOptionValue("Write_log", "error_format", OptionEngine::optionEngine->getOptionValue("Write_log","error_format")); + newOptionValue("Write_log", "folder_format", OptionEngine::optionEngine->getOptionValue("Write_log","folder_format")); + newOptionValue("Write_log", "sync", OptionEngine::optionEngine->getOptionValue("Write_log","sync")); + newOptionValue("Write_log", "enabled", OptionEngine::optionEngine->getOptionValue("Write_log","enabled")); + #ifdef Q_OS_WIN32 + DWORD size=0; + WCHAR * computerNameW=new WCHAR[size]; + if(GetComputerNameW(computerNameW,&size)) + computer=QString::fromWCharArray(computerNameW,size-1).toStdString(); + else + computer="Unknown computer"; + delete computerNameW; + + WCHAR * userNameW=new WCHAR[size]; + if(GetUserNameW(userNameW,&size)) + user=QString::fromWCharArray(userNameW,size-1).toStdString(); + else + user="Unknown user"; + delete userNameW; + #endif + + #ifdef Q_OS_WIN32 + lineReturn="\r\n"; + #else + lineReturn="\n"; + #endif +} + +LogThread::~LogThread() +{ + closeLogs(); + quit(); + wait(); +} + +bool LogThread::logTransfer() const +{ + return enabled && log_enable_transfer; +} + +void LogThread::openLogs() +{ + if(stringtobool(OptionEngine::optionEngine->getOptionValue("Write_log","enabled"))==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,"log file already open, error: "+log.errorString().toStdString()); + return; + } + log.setFileName(QString::fromStdString(OptionEngine::optionEngine->getOptionValue("Write_log","file"))); + 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,"Unable to open the log file, error: "+log.errorString().toStdString()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"opened log: "+OptionEngine::optionEngine->getOptionValue("Write_log","file")); + } + 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,"Unable to open the log file, error: "+log.errorString().toStdString()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"opened log: "+OptionEngine::optionEngine->getOptionValue("Write_log","file")); + } +} + +void LogThread::closeLogs() +{ + if(log.isOpen() && data.size()>0) + log.write(data.data(),data.size()); + log.close(); +} + +void LogThread::newTransferStart(const Ultracopier::ItemOfCopyList &item) +{ + if(!logTransfer()) + return; + std::string 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% + stringreplaceAll(text,LogThread::text_var_source,item.sourceFullPath); + stringreplaceAll(text,LogThread::text_var_size,std::to_string(item.size)); + stringreplaceAll(text,LogThread::text_var_destination,item.destinationFullPath); + stringreplaceAll(text,LogThread::text_var_time,QDateTime::currentDateTime().toString(QString::fromStdString(LogThread::text_var_timestring)).toStdString()); + emit newData(text); +} + +/** method called when new transfer is started */ +void LogThread::transferSkip(const Ultracopier::ItemOfCopyList &item) +{ + if(!logTransfer()) + return; + std::string text=LogThread::text_header_skip+transfer_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %source%, %size%, %destination% + stringreplaceAll(text,LogThread::text_var_source,item.sourceFullPath); + stringreplaceAll(text,LogThread::text_var_size,std::to_string(item.size)); + stringreplaceAll(text,LogThread::text_var_destination,item.destinationFullPath); + stringreplaceAll(text,LogThread::text_var_time,QDateTime::currentDateTime().toString(QString::fromStdString(LogThread::text_var_timestring)).toStdString()); + emit newData(text); +} + +void LogThread::newTransferStop(const Ultracopier::ItemOfCopyList &item) +{ + if(!logTransfer()) + return; + std::string text=LogThread::text_header_stop+transfer_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %source%, %size%, %destination% + stringreplaceAll(text,LogThread::text_var_source,item.sourceFullPath); + stringreplaceAll(text,LogThread::text_var_size,std::to_string(item.size)); + stringreplaceAll(text,LogThread::text_var_destination,item.destinationFullPath); + stringreplaceAll(text,LogThread::text_var_time,QDateTime::currentDateTime().toString(QString::fromStdString(LogThread::text_var_timestring)).toStdString()); + emit newData(text); +} + +void LogThread::error(const std::string &path,const uint64_t &size,const uint64_t &mtime,const std::string &error) +{ + if(!log_enable_error) + return; + std::string text=LogThread::text_header_error+error_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %path%, %size%, %mtime%, %error% + stringreplaceAll(text,LogThread::text_var_path,path); + stringreplaceAll(text,LogThread::text_var_size,std::to_string(size)); + stringreplaceAll(text,LogThread::text_var_mtime,QDateTime::fromTime_t(static_cast(mtime)).toString(Qt::ISODate).toStdString()); + stringreplaceAll(text,LogThread::text_var_error,error); + stringreplaceAll(text,LogThread::text_var_time,QDateTime::fromTime_t(static_cast(mtime)).toString(QString::fromStdString(LogThread::text_var_timestring)).toStdString()); + emit newData(text); +} + +void LogThread::run() +{ + exec(); +} + +void LogThread::realDataWrite(const std::string &text) +{ + #ifdef ULTRACOPIER_DEBUG + if(!log.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"transfer log not open"); + return; + } + #endif // ULTRACOPIER_DEBUG + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(log.write(text.data(),text.size())==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to write into transfer log: "+log.errorString().toStdString()); + return; + } + if(sync) + log.flush(); +} + +void LogThread::newOptionValue(const std::string &group,const std::string &name,const std::string &value) +{ + if(group!="Write_log") + return; + + if(name=="transfer_format") + transfer_format=value; + else if(name=="error_format") + error_format=value; + else if(name=="folder_format") + folder_format=value; + else if(name=="sync") + { + sync=stringtobool(value); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sync flag is set on: "+value); + if(sync) + { + if(log.isOpen()) + log.flush(); + } + } + else if(name=="transfer") + log_enable_transfer=stringtobool(OptionEngine::optionEngine->getOptionValue("Write_log","enabled")) && stringtobool(value); + else if(name=="error") + log_enable_error=stringtobool(OptionEngine::optionEngine->getOptionValue("Write_log","enabled")) && stringtobool(value); + else if(name=="folder") + log_enable_folder=stringtobool(OptionEngine::optionEngine->getOptionValue("Write_log","enabled")) && stringtobool(value); + if(name=="enabled") + { + enabled=stringtobool(value); + if(enabled) + openLogs(); + else + closeLogs(); + } +} + +std::string LogThread::replaceBaseVar(std::string text) +{ + stringreplaceAll(text,LogThread::text_var_time,QDateTime::currentDateTime().toString(QString::fromStdString(LogThread::text_var_timestring)).toStdString()); + #ifdef Q_OS_WIN32 + stringreplaceAll(text,LogThread::text_var_computer,computer); + stringreplaceAll(text,LogThread::text_var_user,user); + #endif + return text; +} + +void LogThread::rmPath(const std::string &path) +{ + if(!logTransfer()) + return; + std::string text=LogThread::text_header_RmPath+folder_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %operation% %path% + stringreplaceAll(text,LogThread::text_var_path,path); + stringreplaceAll(text,LogThread::text_var_operation,LogThread::text_var_rmPath); + emit newData(text); +} + +void LogThread::mkPath(const std::string &path) +{ + if(!logTransfer()) + return; + std::string text=LogThread::text_header_MkPath+folder_format+lineReturn; + text=replaceBaseVar(text); + //Variable is %operation% %path% + stringreplaceAll(text,LogThread::text_var_path,path); + stringreplaceAll(text,LogThread::text_var_operation,LogThread::text_var_mkPath); + emit newData(text); +} diff --git a/LogThread.h b/LogThread.h new file mode 100644 index 0000000..40f9154 --- /dev/null +++ b/LogThread.h @@ -0,0 +1,98 @@ +/** \file LogThread.h +\brief The thread to do the log but not block the main thread +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef LOGTHREAD_H +#define LOGTHREAD_H + +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "StructEnumDefinition.h" + +/** \brief Log all the user oriented activity + +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 +{ + Q_OBJECT +public: + explicit LogThread(); + ~LogThread(); + bool logTransfer() const; +public slots: + /** 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 std::string &path,const uint64_t &size,const uint64_t &mtime,const std::string &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 std::string &path); + /** method called when one folder is created */ + void mkPath(const std::string &path); +private slots: + /** write the data into the file */ + void realDataWrite(const std::string &text); + /** update the options value */ + void newOptionValue(const std::string &group,const std::string &name,const std::string &value); +signals: + void newData(const std::string &text) const; +private: + std::string data; + std::string transfer_format; + std::string error_format; + std::string folder_format; + QFile log; + std::string lineReturn; + std::string replaceBaseVar(std::string text); + #ifdef Q_OS_WIN32 + std::string computer; + std::string user; + #endif + bool sync; + bool enabled; + bool log_enable_transfer; + bool log_enable_error; + bool log_enable_folder; + + static std::string text_header_copy; + static std::string text_header_move; + static std::string text_header_skip; + static std::string text_header_stop; + static std::string text_header_error; + static std::string text_header_MkPath; + static std::string text_header_RmPath; + + static std::string text_var_source; + static std::string text_var_size; + static std::string text_var_destination; + static std::string text_var_path; + static std::string text_var_error; + static std::string text_var_mtime; + static std::string text_var_time; + static std::string text_var_timestring; + #ifdef Q_OS_WIN32 + static std::string text_var_computer; + static std::string text_var_user; + #endif + static std::string text_var_operation; + static std::string text_var_rmPath; + static std::string text_var_mkPath; +protected: + void run(); +}; + +#endif // LOGTHREAD_H diff --git a/OSSpecific.cpp b/OSSpecific.cpp new file mode 100644 index 0000000..ada8d68 --- /dev/null +++ b/OSSpecific.cpp @@ -0,0 +1,58 @@ +#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 + 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 new file mode 100644 index 0000000..4c64875 --- /dev/null +++ b/OptionDialog.cpp @@ -0,0 +1,1015 @@ +/** \file OptionDialog.cpp +\brief To have an interface to control the options +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "OptionDialog.h" +#include "ui_OptionDialog.h" +#include "OSSpecific.h" +#include "LanguagesManager.h" +#include "cpp11addition.h" + +#include +#include +#include + +OptionDialog::OptionDialog() : + 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,"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(); + + //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); + std::vector list=PluginsManager::pluginsManager->getPlugins(true); + foreach(PluginsAvailable currentPlugin,list) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+currentPlugin.name+" ("+std::to_string(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 +} + +OptionDialog::~OptionDialog() +{ + if(oSSpecific!=NULL) + delete oSSpecific; + delete ui; +} + +//plugin management +void OptionDialog::onePluginAdded(const PluginsAvailable &plugin) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+plugin.name+" ("+std::to_string(plugin.category)+")"); + pluginStore newItem; + newItem.path=plugin.path; + newItem.item=new QTreeWidgetItem(QStringList() << QString::fromStdString(plugin.name) << QString::fromStdString(plugin.version)); + newItem.isWritable=plugin.isWritable; + pluginLink.push_back(newItem); + switch(plugin.category) + { + case PluginType_CopyEngine: + ui->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: + case PluginType_Unknow: + 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,"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: + case PluginType_Unknow: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"category not found for: "+plugin.path); + } + //remove if have options + unsigned int index=0; + 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; + while(indexUltracopier_current_theme->findData(QString::fromStdString(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,"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) + { + std::vector> listChildAttribute; + listChildAttribute.push_back(std::make_pair("mainCode", "true")); + int index=ui->Language->findData(QString::fromStdString(PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,"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,"language plugin not found!"); + } + } +} +#endif + +void OptionDialog::addLanguage(const PluginsAvailable &plugin) +{ + std::vector > listChildAttribute; + std::pair temp; + temp.first = "mainCode"; + temp.second = "true"; + listChildAttribute.push_back(temp); + ui->Language->addItem(QIcon(QString::fromStdString(plugin.path)+"flag.png"), + QString::fromStdString(PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,"fullName")), + QString::fromStdString(PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,"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) +{ + std::vector > listChildAttribute; + std::pair temp; + temp.first = "mainCode"; + temp.second = "true"; + listChildAttribute.push_back(temp); + int index=ui->Language->findData(QString::fromStdString(PluginsManager::pluginsManager->getDomSpecific(plugin.categorySpecific,"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,"plugin.name: "+plugin.name); + ui->Ultracopier_current_theme->addItem(QString::fromStdString(plugin.name),QString::fromStdString(plugin.name)); +} + +void OptionDialog::removeTheme(const PluginsAvailable &plugin) +{ + int index=ui->Ultracopier_current_theme->findData(QString::fromStdString(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(Ultracopier::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(Ultracopier::DebugLevel_Notice,"the copy engine "+std::to_string(index)+" have not the options"); + 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->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) + OptionEngine::optionEngine->queryResetOptions(); + else + this->close(); +} + +void OptionDialog::loadOption() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + newOptionValue("Themes", "Ultracopier_current_theme", OptionEngine::optionEngine->getOptionValue("Themes","Ultracopier_current_theme")); + newOptionValue("Ultracopier", "ActionOnManualOpen", OptionEngine::optionEngine->getOptionValue("Ultracopier","ActionOnManualOpen")); + newOptionValue("Ultracopier", "GroupWindowWhen", OptionEngine::optionEngine->getOptionValue("Ultracopier","GroupWindowWhen")); + newOptionValue("Ultracopier", "confirmToGroupWindows", OptionEngine::optionEngine->getOptionValue("Ultracopier","confirmToGroupWindows")); + newOptionValue("Ultracopier", "displayOSSpecific", OptionEngine::optionEngine->getOptionValue("Ultracopier","displayOSSpecific")); + newOptionValue("Ultracopier", "checkTheUpdate", OptionEngine::optionEngine->getOptionValue("Ultracopier","checkTheUpdate")); + newOptionValue("Ultracopier", "remainingTimeAlgorithm", OptionEngine::optionEngine->getOptionValue("Ultracopier","remainingTimeAlgorithm")); + newOptionValue("Language", "Language", OptionEngine::optionEngine->getOptionValue("Language","Language")); + newOptionValue("Language", "Language_force", OptionEngine::optionEngine->getOptionValue("Language","Language_force")); + #ifndef ULTRACOPIER_VERSION_PORTABLE + newOptionValue("SessionLoader", "LoadAtSessionStarting", OptionEngine::optionEngine->getOptionValue("SessionLoader","LoadAtSessionStarting")); + #endif + newOptionValue("CopyListener", "CatchCopyAsDefault", OptionEngine::optionEngine->getOptionValue("CopyListener","CatchCopyAsDefault")); + newOptionValue("CopyEngine", "List", OptionEngine::optionEngine->getOptionValue("CopyEngine","List")); + if(ResourcesManager::resourcesManager->getWritablePath().empty()) + ui->checkBox_Log->setEnabled(false); + else + { + newOptionValue("Write_log", "enabled", OptionEngine::optionEngine->getOptionValue("Write_log","enabled")); + newOptionValue("Write_log", "file", OptionEngine::optionEngine->getOptionValue("Write_log","file")); + newOptionValue("Write_log", "transfer", OptionEngine::optionEngine->getOptionValue("Write_log","transfer")); + newOptionValue("Write_log", "error", OptionEngine::optionEngine->getOptionValue("Write_log","error")); + newOptionValue("Write_log", "folder", OptionEngine::optionEngine->getOptionValue("Write_log","folder")); + newOptionValue("Write_log", "transfer_format", OptionEngine::optionEngine->getOptionValue("Write_log","transfer_format")); + newOptionValue("Write_log", "error_format", OptionEngine::optionEngine->getOptionValue("Write_log","error_format")); + newOptionValue("Write_log", "folder_format", OptionEngine::optionEngine->getOptionValue("Write_log","folder_format")); + newOptionValue("Write_log", "sync", OptionEngine::optionEngine->getOptionValue("Write_log","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(stringtobool(OptionEngine::optionEngine->getOptionValue("Ultracopier","displayOSSpecific"))) + { + 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("Ultracopier","displayOSSpecific","false"); + delete oSSpecific; + oSSpecific=NULL; +} + +void OptionDialog::newOptionValue(const std::string &group,const std::string &name,const std::string &value) +{ + if(group=="Themes") + { + if(name=="Ultracopier_current_theme") + { + int index=ui->Ultracopier_current_theme->findData(QString::fromStdString(value)); + if(index!=-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Themes located: "+value); + 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().toStdString()); + OptionEngine::optionEngine->setOptionValue("Themes","Ultracopier_current_theme",ui->Ultracopier_current_theme->itemData(ui->Ultracopier_current_theme->currentIndex()).toString().toStdString()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"No themes: "+value); + } + } + } + else if(group=="Language") + { + if(name=="Language") + { + int index=ui->Language->findData(QString::fromStdString(value)); + if(index!=-1) + ui->Language->setCurrentIndex(index); + else if(ui->Language->count()>0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Language in settings: "+value); + OptionEngine::optionEngine->setOptionValue("Language","Language",ui->Language->itemData(ui->Language->currentIndex()).toString().toStdString()); + } + } + else if(name=="Language_force") + { + ui->Language_force->setChecked(stringtobool(value)); + ui->Language->setEnabled(ui->Language_force->isChecked() && ui->Language->count()); + if(!ui->Language_force->isChecked()) + { + const std::string &lang=LanguagesManager::languagesManager->autodetectedLanguage(); + if(!lang.empty()) + { + int index=ui->Language->findData(QString::fromStdString(lang)); + if(index!=-1) + ui->Language->setCurrentIndex(index); + } + } + } + } + #ifndef ULTRACOPIER_VERSION_PORTABLE + else if(group=="SessionLoader") + { + if(name=="LoadAtSessionStarting") + { + ui->LoadAtSessionStarting->setChecked(stringtobool(value)); + } + } + #endif + else if(group=="CopyListener") + { + if(name=="CatchCopyAsDefault") + { + ui->CatchCopyAsDefault->setChecked(stringtobool(value)); + } + } + else if(group=="CopyEngine") + { + if(name=="List") + { + if(!ignoreCopyEngineListEdition) + { + QStringList copyEngine=QString::fromStdString(value).split(';'); + 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=="Write_log") + { + if(name=="enabled") + ui->checkBox_Log->setChecked(stringtobool(value)); + else if(name=="file") + ui->lineEditLog_File->setText(QString::fromStdString(value)); + else if(name=="transfer") + ui->checkBoxLog_transfer->setChecked(stringtobool(value)); + else if(name=="sync") + ui->checkBoxLog_sync->setChecked(stringtobool(value)); + else if(name=="error") + ui->checkBoxLog_error->setChecked(stringtobool(value)); + else if(name=="folder") + ui->checkBoxLog_folder->setChecked(stringtobool(value)); + else if(name=="transfer_format") + ui->lineEditLog_transfer_format->setText(QString::fromStdString(value)); + else if(name=="error_format") + ui->lineEditLog_error_format->setText(QString::fromStdString(value)); + else if(name=="folder_format") + ui->lineEditLog_folder_format->setText(QString::fromStdString(value)); + } + else if(group=="Ultracopier") + { + if(name=="ActionOnManualOpen") + ui->ActionOnManualOpen->setCurrentIndex(stringtoint32(value)); + else if(name=="GroupWindowWhen") + ui->GroupWindowWhen->setCurrentIndex(stringtoint32(value)); + else if(name=="confirmToGroupWindows") + ui->confirmToGroupWindows->setChecked(stringtobool(value)); + else if(name=="displayOSSpecific") + ui->DisplayOSWarning->setChecked(stringtobool(value)); + else if(name=="checkTheUpdate") + ui->checkTheUpdate->setChecked(stringtobool(value)); + else if(name=="remainingTimeAlgorithm") + { + bool ok; + const uint32_t &valueInt=stringtouint32(value,&ok); + if(ok) + ui->remainingTimeAlgorithm->setCurrentIndex(static_cast(valueInt)); + } + } +} + +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().toStdString()+ + ", string value: "+ui->Ultracopier_current_theme->itemText(index).toStdString()+ + ", index: "+std::to_string(index)); + OptionEngine::optionEngine->setOptionValue("Themes","Ultracopier_current_theme",ui->Ultracopier_current_theme->itemData(index).toString().toStdString()); + unsigned int index_loop=0; + while(index_loopUltracopier_current_theme->itemData(index).toString().toStdString()) + { + 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().toStdString()+ + ", string value: "+ui->Language->itemText(index).toStdString()+", index: "+std::to_string(index)); + OptionEngine::optionEngine->setOptionValue("Language","Language",ui->Language->itemData(index).toString().toStdString()); + } +} + +void OptionDialog::on_Language_force_toggled(const bool &checked) +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Language","Language_force",booltostring(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,"start"); + OptionEngine::optionEngine->setOptionValue("CopyListener","CatchCopyAsDefault",booltostring(checked)); + } +} + +#ifndef ULTRACOPIER_VERSION_PORTABLE +void OptionDialog::on_LoadAtSessionStarting_toggled(const bool &checked) +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("SessionLoader","LoadAtSessionStarting",booltostring(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); + } +} + +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; + OptionEngine::optionEngine->setOptionValue("CopyEngine","List",stringimplode(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; + OptionEngine::optionEngine->setOptionValue("CopyEngine","List",stringimplode(copyEngineStringList(),";")); + ignoreCopyEngineListEdition=false; + } +} + +std::vector OptionDialog::copyEngineStringList() const +{ + std::vector newList; + int index=0; + while(indexCopyEngineList->count()) + { + newList.push_back(ui->CopyEngineList->item(index)->text().toStdString()); + index++; + } + return newList; +} + +void OptionDialog::newThemeOptions(const std::string &name,QWidget* theNewOptionsWidget,bool isLoaded,bool havePlugin) +{ + Q_UNUSED(isLoaded); + Q_UNUSED(havePlugin); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: isLoaded: "+booltostring(isLoaded)+", havePlugin: "+ + booltostring(havePlugin)+", name: "+name); + pluginOptionsWidget tempItem; + tempItem.name=name; + tempItem.item=NULL; + tempItem.options=theNewOptionsWidget; + tempItem.category=PluginType_Themes; + pluginOptionsWidgetList.push_back(tempItem); + if(theNewOptionsWidget!=NULL) + { + ui->stackedWidgetThemesOptions->addWidget(theNewOptionsWidget); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"set the last page"); + } + on_Ultracopier_current_theme_currentIndexChanged(ui->Ultracopier_current_theme->currentIndex()); +} + +void OptionDialog::addPluginOptionWidget(const PluginType &category,const std::string &name,QWidget * options) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+name+", category: "+std::to_string(category)); + //prevent send the empty options + if(options!=NULL) + { + unsigned int index=0; + 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,"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 + unsigned int index=0; + const unsigned int loop_size=static_cast(ui->CopyEngineList->count()); + while(indexCopyEngineList->item(static_cast(index))->text().toStdString()==name) + break; + index++; + } + if(index==loop_size) + ui->CopyEngineList->addItems(QStringList() << QString::fromStdString(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(); + unsigned int index=0; + while(indexpluginRemove->setEnabled(pluginLink.at(index).isWritable); + ui->pluginInformation->setEnabled(true); + return; + } + index++; + } + } +} + +void OptionDialog::on_pluginInformation_clicked() +{ + treeWidgetItem=ui->pluginList->selectedItems().first(); + unsigned int index=0; + while(indexshowInformation(pluginLink.at(index).path); + return; + } + index++; + } +} + +#ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT +void OptionDialog::on_pluginRemove_clicked() +{ + treeWidgetItem=ui->pluginList->selectedItems().first(); + unsigned int index=0; + while(indexremoveThePluginSelected(pluginLink.at(index).path); + return; + } + index++; + } +} + +void OptionDialog::on_pluginAdd_clicked() +{ + PluginsManager::pluginsManager->addPlugin(defaultImportBackend); +} +#endif + +void OptionDialog::on_checkBox_Log_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","enabled",booltostring(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(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","file",ui->lineEditLog_File->text().toStdString()); + } +} + +void OptionDialog::on_lineEditLog_transfer_format_editingFinished() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","transfer_format",ui->lineEditLog_transfer_format->text().toStdString()); + } +} + +void OptionDialog::on_lineEditLog_error_format_editingFinished() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","error_format",ui->lineEditLog_error_format->text().toStdString()); + } +} + +void OptionDialog::on_checkBoxLog_transfer_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","transfer",booltostring(ui->checkBoxLog_transfer->isChecked())); + } +} + +void OptionDialog::on_checkBoxLog_error_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","error",booltostring(ui->checkBoxLog_error->isChecked())); + } +} + +void OptionDialog::on_checkBoxLog_folder_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","folder",booltostring(ui->checkBoxLog_folder->isChecked())); + } +} + +void OptionDialog::on_logBrowse_clicked() +{ + QString file=QFileDialog::getSaveFileName(this,tr("Save logs as: "),QString::fromStdString(ResourcesManager::resourcesManager->getWritablePath())); + if(file!="") + { + ui->lineEditLog_File->setText(file); + on_lineEditLog_File_editingFinished(); + } +} + +void OptionDialog::on_checkBoxLog_sync_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Write_log","sync",booltostring(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().toStdString()+ + ", string value: "+ui->ActionOnManualOpen->itemText(index).toStdString()+", index: "+std::to_string(index)); + OptionEngine::optionEngine->setOptionValue("Ultracopier","ActionOnManualOpen",std::to_string(index)); + } +} + +void OptionDialog::on_GroupWindowWhen_currentIndexChanged(const int &index) +{ + if(index!=-1 && allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"data value: "+ui->GroupWindowWhen->itemData(index).toString().toStdString()+ + ", string value: "+ui->GroupWindowWhen->itemText(index).toStdString()+", index: "+std::to_string(index)); + OptionEngine::optionEngine->setOptionValue("Ultracopier","GroupWindowWhen",std::to_string(index)); + } +} + +void OptionDialog::on_DisplayOSWarning_clicked() +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Ultracopier","displayOSSpecific",booltostring(ui->DisplayOSWarning->isChecked())); + } +} + +void OptionDialog::newClientList(const std::vector &clientsList) +{ + ui->clientConnected->clear(); + unsigned int index=0; + while(indexclientConnected->addItem(QString::fromStdString(clientsList.at(index))); + index++; + } +} + +void OptionDialog::on_checkTheUpdate_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Ultracopier","checkTheUpdate",booltostring(ui->checkTheUpdate->isChecked())); +} + +void OptionDialog::on_confirmToGroupWindows_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Ultracopier","confirmToGroupWindows",booltostring(ui->confirmToGroupWindows->isChecked())); +} + +void OptionDialog::on_remainingTimeAlgorithm_currentIndexChanged(int index) +{ + if(allPluginsIsLoaded) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + OptionEngine::optionEngine->setOptionValue("Ultracopier","remainingTimeAlgorithm",std::to_string(index)); + } +} diff --git a/OptionDialog.h b/OptionDialog.h new file mode 100644 index 0000000..c8e9db3 --- /dev/null +++ b/OptionDialog.h @@ -0,0 +1,122 @@ +/** \file OptionDialog.h +\brief To have an interface to control the options +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "Environment.h" + +#ifndef OPTIONDIALOG_H +#define OPTIONDIALOG_H + +#include +#include +#include + +#include "Environment.h" +#include "OSSpecific.h" +#include "PluginsManager.h" + +namespace Ui { + class OptionDialog; +} + +/** \brief Dialog for the options + + 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 +{ + Q_OBJECT +public: + explicit OptionDialog(); + ~OptionDialog(); + /** \brief add the option widget from copy engine */ + void addPluginOptionWidget(const PluginType &category,const std::string &name,QWidget * options); +protected: + void changeEvent(QEvent *e); + void loadLogVariableLabel(); +private slots: + 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 std::string &group,const std::string &name,const std::string &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); + #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 oSSpecificClosed(); + void on_remainingTimeAlgorithm_currentIndexChanged(int index); + +private: + bool quit; + Ui::OptionDialog *ui; + struct pluginStore + { + QTreeWidgetItem * item; + std::string path; + bool isWritable; + }; + std::vector pluginLink; + struct pluginOptionsWidget + { + std::string name; + QTreeWidgetItem * item; + QWidget *options; + PluginType category; + }; + std::vector 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); + std::vector copyEngineStringList() const; + bool ignoreCopyEngineListEdition; + PluginsManager::ImportBackend defaultImportBackend; + int loadedCopyEnginePlugin; + QTreeWidgetItem * treeWidgetItem; + OSSpecific *oSSpecific; + bool allPluginsIsLoaded; +public slots: + void newThemeOptions(const std::string &name,QWidget* theNewOptionsWidget,bool isLoaded,bool havePlugin); + void newClientList(const std::vector &clientsList); +signals: + void previouslyPluginAdded(const PluginsAvailable &plugin) const; +}; + +#endif // OPTIONDIALOG_H diff --git a/OptionDialog.ui b/OptionDialog.ui new file mode 100644 index 0000000..54d9591 --- /dev/null +++ b/OptionDialog.ui @@ -0,0 +1,988 @@ + + + OptionDialog + + + + 0 + 0 + 779 + 455 + + + + Options + + + + :/options.png:/options.png + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + + + 0 + 0 + + + + + 200 + 16777215 + + + + false + + + true + + + + Options + + + + + General + + + + + Plugins + + + + + Copy engine + + + + + Listener + + + + + Plugin loader + + + ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Session loader + + + ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Themes + + + + + Log + + + + + + + + 0 + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + Force the language + + + + + + + + + + Replace the default copy and move system + + + + + + + + + + + + + + Load at the session loading + + + + + + + + + + + + + + When manual open + + + + + + + + Do nothing + + + + + Ask source as folder + + + + + Ask sources as files + + + + + + + + Group the windows when + + + + + + + + Never + + + + + When source is same + + + + + When destination is same + + + + + When source and destination are same + + + + + When source or destination are same + + + + + Always + + + + + + + + Confirm to group the windows + + + + + + + + + + Display the OS warning + + + + + + + + + + Check for updates + + + + + + + + + + Remaining time algorithm + + + + + + + + Traditional + + + + + Logarithmic + + + + + + + + + + Qt::Vertical + + + + 20 + 309 + + + + + + + + + + + + true + + + false + + + true + + + + Name + + + + + Version + + + + + Copy engine + + + + + Language + + + + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + + + + Plugin + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add + + + QToolButton::MenuButtonPopup + + + + + + + false + + + Remove + + + + + + + false + + + Information + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Copy engine by order of preference: + + + + + + + + + true + + + + + + + 0 + + + + + false + + + + :/moveUp.png:/moveUp.png + + + + + + + false + + + + :/moveDown.png:/moveDown.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + + + + + Client connected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 16777215 + 22 + + + + Themes: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 1 + + + + + + + Qt::Vertical + + + + 20 + 105 + + + + + + + + :/bug-128x128.png + + + Qt::AlignCenter + + + + + + + + 15 + 75 + true + + + + Unable to load the themes plugin + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 104 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 109 + + + + + + + + :/none-128x128.png + + + Qt::AlignCenter + + + + + + + No option for this plugin + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 109 + + + + + + + + + + + + + + + + Write the log file into: + + + + + + + + + false + + + + + + + false + + + Browse + + + + + + + + + false + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + Synchronized log + + + + + + + false + + + Write the transfers + + + + + + + The variables are %time%, %source%, %size%, %destination% + + + [%time%] %source% (%size%) %destination% + + + + + + + false + + + The variables are %time%, %source%, %size%, %destination% + + + + + + + false + + + Write the errors + + + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + + + [%time%] %path%, %error% + + + + + + + false + + + The variables are %time%, %path%, %size%, %mtime%, %error% + + + + + + + false + + + Write the folder operations + + + + + + + false + + + The variables are %path%, %operation% + + + [%time%] %operation% %path% + + + + + + + false + + + The variables are %path%, %operation% + + + + + + + Qt::Vertical + + + + 20 + 255 + + + + + + + + + + + + + + QDialogButtonBox::Close|QDialogButtonBox::RestoreDefaults + + + + + + + + + + + checkBox_Log + toggled(bool) + lineEditLog_File + setEnabled(bool) + + + 313 + 13 + + + 533 + 44 + + + + + checkBox_Log + toggled(bool) + logBrowse + setEnabled(bool) + + + 583 + 20 + + + 584 + 40 + + + + + checkBox_Log + toggled(bool) + checkBoxLog_transfer + setEnabled(bool) + + + 345 + 21 + + + 582 + 105 + + + + + checkBox_Log + toggled(bool) + checkBoxLog_error + setEnabled(bool) + + + 348 + 25 + + + 557 + 156 + + + + + checkBoxLog_transfer + toggled(bool) + lineEditLog_transfer_format + setEnabled(bool) + + + 537 + 105 + + + 533 + 131 + + + + + checkBoxLog_error + toggled(bool) + lineEditLog_error_format + setEnabled(bool) + + + 501 + 156 + + + 501 + 182 + + + + + checkBox_Log + toggled(bool) + checkBoxLog_folder + setEnabled(bool) + + + 269 + 15 + + + 456 + 207 + + + + + checkBox_Log + toggled(bool) + checkBoxLog_sync + setEnabled(bool) + + + 334 + 12 + + + 304 + 69 + + + + + diff --git a/OptionEngine.cpp b/OptionEngine.cpp new file mode 100644 index 0000000..ad2cf7c --- /dev/null +++ b/OptionEngine.cpp @@ -0,0 +1,242 @@ +/** \file OptionEngine.cpp +\brief Define the class of the event dispatcher +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include +#include + +#include "OptionEngine.h" + +/// \todo async the options write + +/// \brief Initiate the option, load from backend +OptionEngine::OptionEngine() +{ + //locate the settings + #ifdef ULTRACOPIER_VERSION_PORTABLE + QString settingsFilePath=QString::fromStdString(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() +{ +} + +/// \brief To add option group to options +bool OptionEngine::addOptionGroup(const std::string &groupName,const std::vector > &KeysList) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start(\""+groupName+"\",[...])"); + //search if previous with the same name exists + if(GroupKeysList.find(groupName)!=GroupKeysList.cend()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"group already used previously"); + return false; + } + //if the backend is file, enter into the group + if(currentBackend==File) + settings->beginGroup(QString::fromStdString(groupName)); + //browse all key, and append it to the key + unsigned int index=0; + //QList KeyListTemp; + while(indexcontains(QString::fromStdString(KeysList.at(index).first)))//if file backend, load the default value from the file + { + theCurrentKey.currentValue=settings->value(QString::fromStdString(KeysList.at(index).first)).toString().toStdString(); + #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,"The current key: "+groupName+", group: "+KeysList.at(index).first+", have value: "+theCurrentKey.currentValue); + } + #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 std::string &groupName) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, groupName: "+groupName); + if(GroupKeysList.erase(groupName)!=1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName); + return false; +} + +/// \brief To get option value +std::string OptionEngine::getOptionValue(const std::string &groupName,const std::string &variableName) const +{ + if(GroupKeysList.find(groupName)!=GroupKeysList.cend()) + { + const std::unordered_map &optionEngineGroupKey=GroupKeysList.at(groupName); + if(optionEngineGroupKey.find(variableName)!=optionEngineGroupKey.cend()) + return optionEngineGroupKey.at(variableName).currentValue; + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2") + .arg(QString::fromStdString(groupName)) + .arg(QString::fromStdString(variableName)) + ); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"value not found, internal bug, groupName: "+groupName+", variableName: "+variableName); + return std::string(); + } + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2").arg(QString::fromStdString(groupName)).arg(QString::fromStdString(variableName))); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QString("The variable was not found: %1 %2") + .arg(QString::fromStdString(groupName)) + .arg(QString::fromStdString(variableName)) + .toStdString() + ); + //return default value + return std::string(); +} + +/// \brief To set option value +void OptionEngine::setOptionValue(const std::string &groupName,const std::string &variableName,const std::string &value) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"groupName: \""+groupName+"\", variableName: \""+variableName+"\", value: \""+value+"\""); + + if(GroupKeysList.find(groupName)!=GroupKeysList.cend()) + { + const std::unordered_map &group=GroupKeysList.at(groupName); + if(group.find(variableName)!=group.cend()) + { + //prevent re-write the same value into the variable + if(group.at(variableName).currentValue==value) + return; + //write ONLY the new value + GroupKeysList[groupName][variableName].currentValue=value; + if(currentBackend==File) + { + settings->beginGroup(QString::fromStdString(groupName)); + settings->setValue(QString::fromStdString(variableName),QString::fromStdString(value)); + settings->endGroup(); + 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; + } + } + emit newOptionValue(groupName,variableName,value); + return; + } + QMessageBox::critical(NULL,"Internal error",tr("The variable was not found: %1 %2").arg(QString::fromStdString(groupName)).arg(QString::fromStdString(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(QString::fromStdString(groupName)).arg(QString::fromStdString(variableName))); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"The variable was not found: "+groupName+" "+variableName); +} + +//the reset of right value of widget need be do into the calling object +void OptionEngine::internal_resetToDefaultValue() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + + for(auto& n:GroupKeysList) + { + const std::string &firstKey=n.first; + for(auto& m:n.second) + { + const std::string &secondKey=m.first; + OptionEngineGroupKey &o=m.second; + if(o.currentValue!=o.defaultValue) + { + o.currentValue=o.defaultValue; + emit newOptionValue(firstKey,secondKey,o.currentValue); + } + } + } +} + +void OptionEngine::queryResetOptions() +{ + emit resetOptions(); +} diff --git a/OptionEngine.h b/OptionEngine.h new file mode 100644 index 0000000..027861f --- /dev/null +++ b/OptionEngine.h @@ -0,0 +1,87 @@ +/** \file OptionEngine.h +\brief Define the class of the option engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef OPTION_ENGINE_H +#define OPTION_ENGINE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "interface/OptionInterface.h" + +#include "Environment.h" +#include "ResourcesManager.h" + +/** \brief To store the options + + 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 +{ + 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 std::string &groupName,const std::vector > &KeysList); + /// \brief To remove option group to options, remove the widget need be do into the calling object + bool removeOptionGroup(const std::string &groupName); + /// \brief To get option value + std::string getOptionValue(const std::string &groupName,const std::string &variableName) const; + /// \brief To set option value + void setOptionValue(const std::string &groupName,const std::string &variableName,const std::string &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 + { + std::string defaultValue; + std::string currentValue; + bool emptyList; + }; + + /// \brief store the option group list + std::unordered_map > GroupKeysList; + std::vector 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 std::string&,const std::string&,const std::string&) const; + void resetOptions() const; + public: + static OptionEngine *optionEngine; +}; + +#endif // OPTION_ENGINE_H diff --git a/PlatformMacro.h b/PlatformMacro.h new file mode 100644 index 0000000..d15329d --- /dev/null +++ b/PlatformMacro.h @@ -0,0 +1,59 @@ +/** \file PlatformMacro.h +\brief Define the macro for the platform +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include + +#ifndef PLATFORM_MACRO_H +#define PLATFORM_MACRO_H + +//windows +#if defined(Q_OS_WIN32) + #if defined(_M_X64) //_WIN64 + //windows 64Bits + #define ULTRACOPIER_PLATFORM_NAME tr("Windows 64Bits") + #define ULTRACOPIER_PLATFORM_CODE "windows-x86_64" + #else + //windows 32Bits + #define ULTRACOPIER_PLATFORM_NAME tr("Windows 32Bits") + #define ULTRACOPIER_PLATFORM_CODE "windows-x86" + #endif +#elif defined(Q_OS_MAC) + //Mac OS X + #define ULTRACOPIER_PLATFORM_NAME tr("Mac OS X") + #define ULTRACOPIER_PLATFORM_CODE "mac-os-x" +#elif defined(Q_OS_LINUX) + #if defined(__i386__) + //linux pc i386 + #define ULTRACOPIER_PLATFORM_NAME tr("Linux pc i386") + #define ULTRACOPIER_PLATFORM_CODE "linux-i386-pc" + #elif defined(__i486__) + //linux pc i486 + #define ULTRACOPIER_PLATFORM_NAME tr("Linux pc i486") + #define ULTRACOPIER_PLATFORM_CODE "linux-i486-pc" + #elif defined(__i586__) + //linux pc i586 + #define ULTRACOPIER_PLATFORM_NAME tr("Linux pc i586") + #define ULTRACOPIER_PLATFORM_CODE "linux-i586-pc" + #elif defined(__i686__) + //linux pc i686 + #define ULTRACOPIER_PLATFORM_NAME tr("Linux pc i686") + #define ULTRACOPIER_PLATFORM_CODE "linux-i686-pc" + #elif defined(__x86_64__) + //linux pc 64Bits + #define ULTRACOPIER_PLATFORM_NAME tr("Linux pc 64Bits") + #define ULTRACOPIER_PLATFORM_CODE "linux-x86_64-pc" + #else + //linux unknow + #define ULTRACOPIER_PLATFORM_NAME tr("Linux unknow platform") + #define ULTRACOPIER_PLATFORM_CODE "linux-unknow-pc" + #endif +#else + //unknow + #define ULTRACOPIER_PLATFORM_NAME tr("Unknow platform") + #define ULTRACOPIER_PLATFORM_CODE "unknow" +#endif + +#endif // PLATFORM_MACRO_H + diff --git a/PluginInformation.cpp b/PluginInformation.cpp new file mode 100644 index 0000000..8c1551c --- /dev/null +++ b/PluginInformation.cpp @@ -0,0 +1,120 @@ +/** \file PluginInformation.cpp +\brief Define the plugin information +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "PluginInformation.h" +#include "ui_PluginInformation.h" +#include "cpp11addition.h" + +PluginInformation::PluginInformation() : + ui(new Ui::PluginInformation) +{ + ui->setupUi(this); + pluginIsLoaded=false; +} + +PluginInformation::~PluginInformation() +{ + delete ui; +} + +void PluginInformation::setPlugin(const PluginsAvailable &plugin) +{ + this->plugin=plugin; + pluginIsLoaded=true; + retranslateInformation(); +} + +void PluginInformation::setLanguage(const std::string &language) +{ + this->language=language; +} + +std::string PluginInformation::categoryToTranslation(const PluginType &category) const +{ + switch(category) + { + case PluginType_CopyEngine: + return tr("Copy engine").toStdString(); + case PluginType_Languages: + return tr("Languages").toStdString(); + case PluginType_Listener: + return tr("Listener").toStdString(); + case PluginType_PluginLoader: + return tr("Plugin loader").toStdString(); + case PluginType_SessionLoader: + return tr("Session loader").toStdString(); + case PluginType_Themes: + return tr("Themes").toStdString(); + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"cat translation not found"); + return tr("Unknown").toStdString(); + } +} + +void PluginInformation::retranslateInformation() +{ + if(!pluginIsLoaded) + return; + ui->retranslateUi(this); + this->setWindowTitle(tr("Information about %1").arg(QString::fromStdString(plugin.name))); + ui->name->setText(QString::fromStdString(plugin.name)); + ui->title->setText(QString::fromStdString(getTranslatedText(plugin,"title",language))); + ui->category->setText(QString::fromStdString(categoryToTranslation(plugin.category))); + ui->author->setText(QString::fromStdString(getInformationText(plugin,"author"))); + QString website=QString::fromStdString(getTranslatedText(plugin,"website",language)); + ui->website->setText(QStringLiteral("")+website+QStringLiteral("")); + bool ok; + int timeStamps=stringtoint32(getInformationText(plugin,"pubDate"),&ok); + QDateTime date; + date.setTime_t(timeStamps); + ui->date->setDateTime(date); + if(!ok || timeStamps<=0) + ui->date->setEnabled(false); + ui->description->setPlainText(QString::fromStdString(getTranslatedText(plugin,"description",language))); + ui->version->setText(QString::fromStdString(getInformationText(plugin,"version"))); +} + +/// \brief get informations text +std::string PluginInformation::getInformationText(const PluginsAvailable &plugin,const std::string &informationName) +{ + unsigned int index=0; + while(index &information=plugin.informations.at(index); + if(information.size()==2 && information.front()==informationName) + return information.back(); + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"information not found: "+informationName+", for: "+plugin.name+", cat: "+categoryToTranslation(plugin.category)); + return std::string(); +} + +/// \brief get translated text +std::string PluginInformation::getTranslatedText(const PluginsAvailable &plugin,const std::string &informationName,const std::string &mainShortName) +{ + unsigned int index=0; + std::string TextFound; + while(index &information=plugin.informations.at(index); + if(information.size()==3) + { + if(information.front()==informationName) + { + if(information.at(1)==mainShortName) + return information.back(); + else if(information.at(1)=="en") + TextFound=information.back(); + + } + } + index++; + } + #ifdef ULTRACOPIER_DEBUG + if(TextFound.empty() || TextFound.empty()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"text is not found or empty for: "+informationName+", with the language: "+mainShortName+", for the plugin: "+plugin.path); + #endif // ULTRACOPIER_DEBUG + return TextFound; +} diff --git a/PluginInformation.h b/PluginInformation.h new file mode 100644 index 0000000..d3c1d5a --- /dev/null +++ b/PluginInformation.h @@ -0,0 +1,42 @@ +/** \file PluginInformation.h +\brief Define the plugin information +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGININFORMATION_H +#define PLUGININFORMATION_H + +#include +#include + +#include "Environment.h" + +namespace Ui { + class PluginInformation; +} + +/** \brief to show the plugin information */ +class PluginInformation : public QDialog +{ + Q_OBJECT + public: + explicit PluginInformation(); + ~PluginInformation(); + /** \brief get translated categorie */ + std::string categoryToTranslation(const PluginType &category) const; + /** \brief to get the new plugin informations */ + void setPlugin(const PluginsAvailable &plugin); + /** \brief to set the language */ + void setLanguage(const std::string &language); + public slots: + void retranslateInformation(); + private: + bool pluginIsLoaded; + PluginsAvailable plugin; + Ui::PluginInformation *ui; + std::string language; + std::string getInformationText(const PluginsAvailable &plugin,const std::string &informationName); + std::string getTranslatedText(const PluginsAvailable &plugin,const std::string &informationName,const std::string &mainShortName); +}; + +#endif // PLUGININFORMATION_H diff --git a/PluginInformation.ui b/PluginInformation.ui new file mode 100644 index 0000000..64a0bd1 --- /dev/null +++ b/PluginInformation.ui @@ -0,0 +1,136 @@ + + + PluginInformation + + + + 0 + 0 + 400 + 300 + + + + About this plugin + + + + QFormLayout::ExpandingFieldsGrow + + + + + Name: + + + + + + + true + + + + + + + Category: + + + + + + + true + + + + + + + Author: + + + + + + + true + + + + + + + Website: + + + + + + + + + + + + + + Date: + + + + + + + true + + + + + + + Description: + + + + + + + true + + + + + + + Version: + + + + + + + true + + + + + + + Title: + + + + + + + true + + + + + + + + diff --git a/PluginLoader.cpp b/PluginLoader.cpp new file mode 100644 index 0000000..36101a4 --- /dev/null +++ b/PluginLoader.cpp @@ -0,0 +1,339 @@ +/** \file PluginLoader.h +\brief Define the plugin loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "PluginLoader.h" +#include "LanguagesManager.h" + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#ifdef Q_OS_WIN32 +#include "plugins/PluginLoader/catchcopy-v0002/pluginLoader.h" +#endif +#endif + +PluginLoader::PluginLoader(OptionDialog *optionDialog) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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); + std::vector 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() +{ + 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() +{ + if(stopIt) + return; + sendState(true); +} + +void PluginLoader::onePluginAdded(const PluginsAvailable &plugin) +{ + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + #ifdef Q_OS_WIN32 + PluginInterface_PluginLoader *factory; + #endif + #endif + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + if(stopIt) + return; + if(plugin.category!=PluginType_PluginLoader) + return; + LocalPlugin newEntry; + std::string pluginPath=plugin.path+PluginsManager::getResolvedPluginName("pluginLoader"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"static listener not found"); + return; + } + newEntry.pluginLoader=NULL; + #else + QPluginLoader *pluginLoader= new QPluginLoader(QString::fromStdString(pluginPath)); + QObject *pluginInstance = pluginLoader->instance(); + if(!pluginInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin: "+pluginLoader->errorString().toStdString()); + return; + } + PluginInterface_PluginLoader *pluginLoaderInstance = qobject_cast(pluginInstance); + if(!pluginLoaderInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to cast the plugin: "+pluginLoader->errorString().toStdString()); + return; + } + newEntry.pluginLoader = pluginLoader; + //check if found + unsigned int index=0; + while(indexunload(); + return; + } + index++; + } + #endif + #ifdef ULTRACOPIER_DEBUG + connect(pluginLoaderInstance,&PluginInterface_PluginLoader::debugInformation,this,&PluginLoader::debugInformation,Qt::DirectConnection); + #endif // ULTRACOPIER_DEBUG + + newEntry.options=new LocalPluginOptions("PluginLoader-"+plugin.name); + newEntry.pluginLoaderInterface = pluginLoaderInstance; + newEntry.path = plugin.path; + newEntry.state = Ultracopier::Uncaught; + newEntry.inWaitOfReply = false; + pluginList.push_back(newEntry); + pluginLoaderInstance->setResources(newEntry.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); + optionDialog->addPluginOptionWidget(PluginType_PluginLoader,plugin.name,newEntry.pluginLoaderInterface->options()); + connect(pluginList.back().pluginLoaderInterface,&PluginInterface_PluginLoader::newState,this,&PluginLoader::newState,Qt::DirectConnection); + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newEntry.pluginLoaderInterface,&PluginInterface_PluginLoader::newLanguageLoaded,Qt::DirectConnection); + if(needEnable) + { + pluginList.back().inWaitOfReply=true; + newEntry.pluginLoaderInterface->setEnabled(needEnable); + } + #else + #ifdef Q_OS_WIN32 + factory=new WindowsExplorerLoader(); + LocalPlugin newEntry; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + newEntry.pluginLoader=NULL; + #endif + + newEntry.options=new LocalPluginOptions("PluginLoader-"+plugin.name); + newEntry.pluginLoaderInterface = new WindowsExplorerLoader(); + newEntry.path = plugin.path; + newEntry.state = Ultracopier::Uncaught; + newEntry.inWaitOfReply = false; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + #ifdef ULTRACOPIER_DEBUG + connect(newEntry.pluginLoaderInterface,&PluginInterface_PluginLoader::debugInformation,this,&PluginLoader::debugInformation,Qt::DirectConnection); + #endif // ULTRACOPIER_DEBUG + #endif + pluginList.push_back(newEntry); + newEntry.pluginLoaderInterface->setResources(newEntry.options,plugin.writablePath,plugin.path,ULTRACOPIER_VERSION_PORTABLE_BOOL); + optionDialog->addPluginOptionWidget(PluginType_PluginLoader,plugin.name,newEntry.pluginLoaderInterface->options()); + connect(pluginList.back().pluginLoaderInterface,&PluginInterface_PluginLoader::newState,this,&PluginLoader::newState,Qt::DirectConnection); + connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newEntry.pluginLoaderInterface,&PluginInterface_PluginLoader::newLanguageLoaded,Qt::DirectConnection); + if(needEnable) + { + pluginList.back().inWaitOfReply=true; + newEntry.pluginLoaderInterface->setEnabled(needEnable); + } + #endif + Q_UNUSED(plugin); + #endif +} + +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE +void PluginLoader::onePluginWillBeRemoved(const PluginsAvailable &plugin) +{ + if(stopIt) + return; + if(plugin.category!=PluginType_PluginLoader) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned 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.erase(pluginList.cbegin()+index); + } + } + sendState(); + return; + } + index++; + } +} +#endif + +void PluginLoader::load() +{ + if(stopIt) + return; + needEnable=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(indexsetEnabled(true); + index++; + } + sendState(true); +} + +void PluginLoader::unload() +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + needEnable=false; + unsigned int index=0; + while(indexsetEnabled(false); + index++; + } + sendState(true); +} + +#ifdef ULTRACOPIER_DEBUG +void PluginLoader::debugInformation(const Ultracopier::DebugLevel &level,const std::string& fonction,const std::string& text,const std::string& file,const unsigned int& ligne) +{ + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Plugin loader plugin"); +} +#endif // ULTRACOPIER_DEBUG + +void PluginLoader::allPluginIsloaded() +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"with value: "+std::to_string(pluginList.size()>0)); + sendState(true); +} + +void PluginLoader::sendState(bool force) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, pluginList.size(): "+std::to_string(pluginList.size())+", force: "+std::to_string(force)); + Ultracopier::CatchState current_state=Ultracopier::Uncaught; + bool found_not_listen=false,found_listen=false,found_inWaitOfReply=false; + unsigned 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,"send pluginLoaderReady("+std::to_string(current_state)+","+std::to_string(have_plugin)+","+std::to_string(found_inWaitOfReply)+")"); + emit pluginLoaderReady(current_state,have_plugin,found_inWaitOfReply); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Skip the signal sending"); + last_state=current_state; + last_have_plugin=have_plugin; + last_inWaitOfReply=found_inWaitOfReply; +} + +void PluginLoader::newState(const Ultracopier::CatchState &state) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, state: "+std::to_string(state)); + PluginInterface_PluginLoader *temp=qobject_cast(QObject::sender()); + if(temp==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"listener not located!"); + return; + } + unsigned 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 "OptionDialog.h" +#include "LocalPluginOptions.h" + +namespace Ui { + class PluginLoaderOptions; +} + +/** \brief Load the plugin + + It use ResourcesManager(), but it provide more higher abstraction. It parse the plugins information, check it, check the dependancies. + + \see ResourcesManager::ResourcesManager() + */ +class PluginLoader : public QObject +{ + 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(); +private slots: + 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 std::string& fonction, const std::string& text, const std::string& file, const unsigned int &ligne); + #endif // ULTRACOPIER_DEBUG + void allPluginIsloaded(); + void newState(const Ultracopier::CatchState &state); +private: + //variable + struct LocalPlugin + { + PluginInterface_PluginLoader * pluginLoaderInterface; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader * pluginLoader; + #endif + Ultracopier::CatchState state; + std::string path; + bool inWaitOfReply; + LocalPluginOptions *options; + }; + std::vector 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(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 new file mode 100644 index 0000000..269e837 --- /dev/null +++ b/PluginsManager.cpp @@ -0,0 +1,932 @@ +/** \file PluginsManager.cpp +\brief Define the class to manage and load the plugins +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include +#include + +#include + +#include "PluginsManager.h" +#include "cpp11addition.h" +#include "FacilityEngine.h" + +/// \brief Create the manager and load the defaults variables +PluginsManager::PluginsManager() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + //load the overall instance + pluginLoaded = false; + language = "en"; + stopIt = false; + pluginInformation = NULL; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + importingPlugin = false; + #endif + editionSemList.release(); + englishPluginType.push_back("CopyEngine");englishPluginType.push_back("Languages");englishPluginType.push_back("Listener");englishPluginType.push_back("PluginLoader");englishPluginType.push_back("SessionLoader");englishPluginType.push_back("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() +{ + stopIt=true; + if(pluginInformation!=NULL) + delete pluginInformation; + if(this->isRunning()) + this->wait(0); +} + +/// \brief set current language +void PluginsManager::setLanguage(const std::string &language) +{ + this->language=language; +} + +void PluginsManager::post_operation() +{ + pluginLoaded=true; + emit pluginListingIsfinish(); +} + +bool PluginsManager::allPluginHaveBeenLoaded() const +{ + return pluginLoaded; +} + +void PluginsManager::lockPluginListEdition() +{ + editionSemList.acquire(); +} + +void PluginsManager::unlockPluginListEdition() +{ + editionSemList.release(); +} + +void PluginsManager::run() +{ + regexp_to_clean_1=std::regex("[\n\r]+"); + regexp_to_clean_2=std::regex("[ \t]+"); + regexp_to_clean_3=std::regex("(&&)+"); + regexp_to_clean_4=std::regex("^&&"); + regexp_to_clean_5=std::regex("&&$"); + regexp_to_dep_1=std::regex("(&&|\\|\\||\\(|\\))"); + regexp_to_dep_2=std::regex("^(<=|<|=|>|>=)[a-zA-Z0-9\\-]+-([0-9]+\\.)*[0-9]+$"); + regexp_to_dep_3=std::regex("(<=|<|=|>|>=)"); + regexp_to_dep_4=std::regex("-([0-9]+\\.)*[0-9]+"); + regexp_to_dep_5=std::regex("[a-zA-Z0-9\\-]+-"); + regexp_to_dep_6=std::regex("[a-zA-Z0-9\\-]+-([0-9]+\\.)*[0-9]+"); + + //load the path and plugins into the path + const std::string &separator=FacilityEngine::separator(); + std::vector readPath; + readPath=ResourcesManager::resourcesManager->getReadPath(); + pluginsList.clear(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"pluginsList.size(): "+std::to_string(pluginsList.size())); + foreach(std::string basePath,readPath) + { + foreach(std::string dirSub,englishPluginType) + { + std::string pluginComposed=basePath+dirSub+separator; + QDir dir(QString::fromStdString(pluginComposed)); + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"search plugin into: "+pluginComposed); + if(dir.exists()) + { + foreach(QString dirName, dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot)) + { + if(stopIt) + return; + loadPluginInformation(pluginComposed+dirName.toStdString()+separator); + } + } + } + } + #ifdef ULTRACOPIER_DEBUG + unsigned int index_debug=0; + while(index_debug list; + unsigned 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; +} + +bool PluginsManager::loadPluginInformation(const std::string &path) +{ + PluginsAvailable tempPlugin; + tempPlugin.isAuth = false; + tempPlugin.path = path; + tempPlugin.category = PluginType_Unknow; + QDir pluginPath(QString::fromStdString(path)); + if(pluginPath.cdUp() && pluginPath.cdUp() && + !ResourcesManager::resourcesManager->getWritablePath().empty() && + pluginPath==QDir(QString::fromStdString(ResourcesManager::resourcesManager->getWritablePath()))) + tempPlugin.isWritable=true; + else + tempPlugin.isWritable=false; + QFile xmlMetaData(QString::fromStdString(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").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"informations.xml is not accessible into the plugin: "+path); + } + } + else + { + tempPlugin.errorString=tr("informations.xml not found for the plugin").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"informations.xml not found for the plugin: "+path); + } + editionSemList.acquire(); + pluginsList.push_back(tempPlugin); + if(tempPlugin.errorString.empty()) + pluginsListIndexed[tempPlugin.category].push_back(tempPlugin); + editionSemList.release(); + if(tempPlugin.errorString.empty()) + return true; + else + { + emit onePluginInErrorAdded(tempPlugin); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error detected, the not loaded: "+tempPlugin.errorString+", 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).toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"informations.xml, Parse error at line "+std::to_string(errorLine)+", column "+std::to_string(errorColumn)+": "+errorStr.toStdString()); + } + else + { + QDomElement root = domDocument.documentElement(); + if (root.tagName() != QStringLiteral("package")) + { + thePlugin->errorString=tr("\"package\" root tag not found for the xml file").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"\"package\" root balise not found for the xml file"); + } + //load the variable + if(thePlugin->errorString.empty()) + loadBalise(root,"title",&(thePlugin->informations),&(thePlugin->errorString),true,true,true); + if(thePlugin->errorString.empty()) + loadBalise(root,"website",&(thePlugin->informations),&(thePlugin->errorString),false,true); + if(thePlugin->errorString.empty()) + loadBalise(root,"description",&(thePlugin->informations),&(thePlugin->errorString),true,true,true); + if(thePlugin->errorString.empty()) + loadBalise(root,"author",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + loadBalise(root,"pubDate",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + { + loadBalise(root,"version",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + thePlugin->version=thePlugin->informations.back().back(); + } + if(thePlugin->errorString.empty()) + { + loadBalise(root,"category",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + { + std::string tempCat=thePlugin->informations.back().back(); + 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: "+std::to_string((int)thePlugin->category); + if(thePlugin->errorString.empty()) + { + if(thePlugin->category!=PluginType_Languages) + { + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + loadBalise(root,"architecture",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + { + if(thePlugin->informations.back().back()!=ULTRACOPIER_PLATFORM_CODE) + thePlugin->errorString="Wrong platform code: "+thePlugin->informations.back().back(); + } + #endif + } + } + } + } + if(thePlugin->errorString.empty()) + { + loadBalise(root,"name",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + { + thePlugin->name=thePlugin->informations.back().back(); + size_t index=0; + while(indexname && + pluginsList.at(index).category==thePlugin->category) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Plugin duplicate found ("+std::to_string((int)thePlugin->category)+"/"+pluginsList.at(index).informations.at(sub_index).back()+"), already loaded, actual version skipped: "+thePlugin->version); + thePlugin->errorString=tr("Duplicated plugin found, already loaded!").toStdString(); + break; + break; + } + sub_index++; + } + index++; + } + } + } + if(thePlugin->errorString.empty()) + loadBalise(root,"dependencies",&(thePlugin->informations),&(thePlugin->errorString),true,false); + if(thePlugin->errorString.empty()) + { + QDomElement child = root.firstChildElement("categorySpecific"); + if(!child.isNull() && child.isElement()) + thePlugin->categorySpecific=child; + } + } +} + +/// \brief to load the multi-language balise +void PluginsManager::loadBalise(const QDomElement &root,const std::string &name,std::vector > *informations,std::string *errorString,bool needHaveOneEntryMinimum,bool multiLanguage,bool englishNeedBeFound) +{ + int foundElement=0; + bool englishTextIsFoundForThisChild=false; + QDomElement child = root.firstChildElement(QString::fromStdString(name)); + while(!child.isNull()) + { + if(child.isElement()) + { + std::vector newInformations; + if(multiLanguage) + { + if(child.hasAttribute(QStringLiteral("xml:lang"))) + { + if(child.attribute(QStringLiteral("xml:lang"))==QStringLiteral("en")) + englishTextIsFoundForThisChild=true; + foundElement++; + newInformations.push_back(child.tagName().toStdString()); + newInformations.push_back(child.attribute(QStringLiteral("xml:lang")).toStdString()); + newInformations.push_back(child.text().toStdString()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Have not the attribute xml:lang: child.tagName(): "+child.tagName().toStdString()+", child.text(): "+child.text().toStdString()); + } + else + { + foundElement++; + newInformations.push_back(child.tagName().toStdString()); + newInformations.push_back(child.text().toStdString()); + } + informations->push_back(newInformations); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Is not Element: child.tagName(): "+child.tagName().toStdString()); + child = child.nextSiblingElement(QString::fromStdString(name)); + } + if(multiLanguage && englishTextIsFoundForThisChild==false && englishNeedBeFound) + { + informations->clear(); + *errorString=tr("English text missing in the informations.xml for the tag: %1").arg(QString::fromStdString(name)).toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"English text missing into the informations.xml for the tag: "+name); + return; + } + if(needHaveOneEntryMinimum && foundElement==0) + { + informations->clear(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Tag not found: "+name); + *errorString=tr("Tag not found: %1").arg(QString::fromStdString(name)).toStdString(); + } +} + +/// \brief to load the get dom specific +std::string PluginsManager::getDomSpecific(const QDomElement &root,const std::string &name,const std::vector > &listChildAttribute) const +{ + QDomElement child = root.firstChildElement(QString::fromStdString(name)); + bool allIsFound; + while(!child.isNull()) + { + if(child.isElement()) + { + allIsFound=true; + size_t index=0; + while(index &entry=listChildAttribute.at(index); + if(child.attribute(QString::fromStdString(entry.first))!=QString::fromStdString(entry.second)) + { + allIsFound=false; + break; + } + index++; + } + if(allIsFound) + return child.text().toStdString(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Is not Element: child.tagName(): "+child.tagName().toStdString()); + child = child.nextSiblingElement(QString::fromStdString(name)); + } + return std::string(); +} + +/// \brief to load the get dom specific +std::string PluginsManager::getDomSpecific(const QDomElement &root,const std::string &name) const +{ + QDomElement child = root.firstChildElement(QString::fromStdString(name)); + while(!child.isNull()) + { + if(child.isElement()) + return child.text().toStdString(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Is not Element: child.tagName(): "+child.tagName().toStdString()); + child = child.nextSiblingElement(QString::fromStdString(name)); + } + return std::string(); +} + +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE +/// \brief check the dependencies +uint32_t PluginsManager::checkDependencies() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + uint32_t errors=0; + unsigned int index=0; + bool depCheck; + while(index versionANumber=stringsplit(versionA,'.'); + std::vector versionBNumber=stringsplit(versionB,'.'); + unsigned int index=0; + unsigned int defaultReturnValue=true; + if(sign=="<") + defaultReturnValue=false; + if(sign==">") + defaultReturnValue=false; + bool ok; + 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; +} + +std::vector PluginsManager::getPluginsByCategory(const PluginType &category) const +{ + if(pluginsListIndexed.find(category)==pluginsListIndexed.cend()) + return std::vector(); + return pluginsListIndexed.at(category); +} + +std::vector PluginsManager::getPlugins(bool withError) const +{ + std::vector list; + unsigned int index=0; + while(indexsetLanguage(mainShortName); + pluginInformation->setPlugin(pluginsList.at(index)); + pluginInformation->show(); + return; + } + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"item not selected"); +} + +void PluginsManager::showInformationDoubleClick() +{ +// showInformation(false); +} + +#ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT +void PluginsManager::removeThePluginSelected(const std::string &path) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(index cppdata; + cppdata.resize(data.size()); + memcpy(cppdata.data(),data.data(),data.size()); + if(!tarFile.decodeData(cppdata)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"tarFile.errorString(): "+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) + { + std::string basePluginArchive=""; + /* block use less for tar? + if(fileList.at(0).contains(QRegularExpression("[\\/]"))) + { + bool folderFoundEveryWhere=true; + basePluginArchive=fileList.at(0); + basePluginArchive=std::regex_replace(basePluginArchive, std::regex("[\\/].*$"), ""); + for (int i = 0; i < list.size(); ++i) + { + if(!stringStartWith(fileList.at(i),basePluginArchive)) + { + folderFoundEveryWhere=false; + break; + } + } + if(folderFoundEveryWhere) + { + for (int i = 0; i < fileList.size(); ++i) + fileList[i].substr(basePluginArchive.size()); + } + else + basePluginArchive=""; + }*/ + PluginsAvailable tempPlugin; + std::string categoryFinal=""; + for (unsigned int i = 0; i < fileList.size(); ++i) + if(fileList.at(i)=="informations.xml") + { + loadPluginXml(&tempPlugin,QByteArray(dataList.at(i).data(),static_cast(dataList.at(i).size()))); + break; + } + if(tempPlugin.errorString=="") + { + categoryFinal=categoryToString(tempPlugin.category); + if(categoryFinal!="") + { + std::string writablePath=ResourcesManager::resourcesManager->getWritablePath(); + if(writablePath!="") + { + QDir dir; + std::string finalPluginPath=writablePath+categoryFinal+FacilityEngine::separator()+tempPlugin.name+FacilityEngine::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(QString::fromStdString(finalPluginPath))) + { + bool errorFound=false; + for (unsigned int i = 0; i < fileList.size(); ++i) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"file "+std::to_string(i)+": "+finalPluginPath+fileList.at(i)); + std::string fileListEntry=fileList[i]; + fileListEntry=std::regex_replace(fileListEntry, std::regex("^(..?[\\/])+"), ""); + QFile currentFile(QString::fromStdString(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().toStdString()); + 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(),static_cast(dataList.at(i).size()))); + currentFile.close(); + } + else + { + ResourcesManager::resourcesManager->disableWritablePath(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Unable to make the file: "+info.absolutePath().toStdString()+", error:"+currentFile.errorString().toStdString()); + 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(QString::fromStdString(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(QString::fromStdString(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().toStdString()); + 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 std::string &path) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(index +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" +#include "OptionEngine.h" +#include "ResourcesManager.h" +#include "PluginInformation.h" +#ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT +#include "QXzDecodeThread.h" +#include "QTarDecode.h" +#endif + +namespace Ui { + class PluginOptions; +} + +/** \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 +{ + Q_OBJECT + public: + /// \brief to get plugins of type specific + std::vector getPluginsByCategory(const PluginType &type) const; + /** \brief to get plugins */ + std::vector 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 std::string getResolvedPluginName(const std::string &name); + static bool isSamePlugin(const PluginsAvailable &pluginA,const PluginsAvailable &pluginB); + void lockPluginListEdition(); + void unlockPluginListEdition(); + bool allPluginHaveBeenLoaded() const; + /// \brief to load the get dom specific + std::string getDomSpecific(const QDomElement &root,const std::string &name,const std::vector > &listChildAttribute) const; + std::string getDomSpecific(const QDomElement &root,const std::string &name) const; + /// \brief set current language + void setLanguage(const std::string &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, \return true is case of error + static bool compareVersion(const std::string &versionA,const std::string &sign,const std::string &versionB); + private: + /// \brief List of plugins + std::vector pluginsList; + std::map > pluginsListIndexed; + /// \brief to load the multi-language balise + void loadBalise(const QDomElement &root,const std::string &name,std::vector > *informations,std::string *errorString,bool needHaveOneEntryMinimum=true,bool multiLanguage=false,bool englishNeedBeFound=false); + /// \brief get the version + std::string getPluginVersion(const std::string &pluginName) const; + /// \brief list of cat plugin type + //QStringList catPlugin; + std::vector englishPluginType; + std::vector catItemList; + /// \brief store the current mainShortName + std::string 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 + uint32_t checkDependencies(); + #endif + void loadPluginXml(PluginsAvailable * thePlugin,const QByteArray &xml); + std::vector readPluginPath; + bool loadPluginInformation(const std::string &path); + QSemaphore editionSemList; + bool stopIt; + bool pluginLoaded; + std::string language; + std::string categoryToString(const PluginType &category) const; + std::string categoryToTranslation(const PluginType &category); + std::regex regexp_to_clean_1,regexp_to_clean_2,regexp_to_clean_3,regexp_to_clean_4,regexp_to_clean_5; + std::regex 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 std::string &path); + #endif + void post_operation(); +/* public slots: + /// \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 std::string &path); + #ifdef ULTRACOPIER_PLUGIN_IMPORT_SUPPORT + void removeThePluginSelected(const std::string &path); + void addPlugin(const ImportBackend &backend); + void tryLoadPlugin(const std::string &file); + #endif +}; + +/// \brief to do structure comparaison +bool operator==(PluginsAvailable pluginA,PluginsAvailable pluginB); + +#endif // PLUGINS_MANAGER_H diff --git a/README b/README new file mode 100644 index 0000000..5b617ab --- /dev/null +++ b/README @@ -0,0 +1,46 @@ +======================================================= +Description =========================================== +======================================================= + +Ultracopier (https://ultracopier.first-world.info/) is free and open +source software licensed under GPLv3 that acts as a replacement for +files copy dialogs. + +Main features include: + - pause/resume transfers + - dynamic speed limitation + - on-error resume, + - error/collision management + +======================================================= +Changelog ============================================= +======================================================= +You can have the changelog at this url (or search on the forum): +https://forum-ultracopier.first-world.info/the-announces/changelog-for-ultracopier-1-0-x-x-supercopier-4-0-x-x-t406.html + +======================================================= +License =============================================== +======================================================= +Ultracopier is licensed under the GNU General Public License version 3. +The text of the GNU General Public License can be viewed at https://www.gnu.org/licenses/gpl.html +See COPYING file. + +======================================================= +Core Developers ======================================= +======================================================= +BRULE Herman or alpha_one_x86 +- Original author, API, kio_slaves, source +See the Development team section of https://ultracopier.first-world.info/contact.html for an updated list of Ultracopier team! + +======================================================= +Building and documentation ============================ +======================================================= +See the wiki for the general documentation and how to for building: https://ultracopier-wiki.first-world.info/ +For the code documentation: https://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.pro to have easy and NO modular software. This is more oriented to GNU/Linux and macOS. + +====================================================== +Warranty ============================================= +====================================================== +Ultracopier in all version is shipped without warranty (0% of warranty). Only the stable version have warranty of be tested in lot of case. But in any case have warranty about data security, or other way of warranty. diff --git a/README.sources b/README.sources new file mode 100644 index 0000000..d569b28 --- /dev/null +++ b/README.sources @@ -0,0 +1,32 @@ +See README to have general informations + +======================================================= +Licence for the source ================================ +======================================================= +All images into resources/ is extracted from the oxygen pack of KDE 4.8. Some are directly remaked from the png version. +*.ts and *.qm into resources/ or plugins/Languages/ is under GPL3. +All images into plugins/Languages/ are extracted from piwik. +All informations.xml into plugins/Languages/ are under GPL3. +All the file *.dox *.h *.cpp *.pro *.ui at the root, interface/ folder of the source are under GPL3. +The files: QTarDecode.cpp, QTarDecode.h, QXzDecode.cpp, +QXzDecode.h, QXzDecodeThread.cpp, QXzDecodeThread.h into: lib/qt-tar-xz/ are under GPL3. +The other file into lib/qt-tar-xz/ is XZ Embedded. +All *.qrc into resources/ are under GPL3. +See after for the patch. + +======================================================= +Licence for the patch ================================= +======================================================= +The patchs under this folder are under GPL3: +patch/opensource/ +The patchs under this folder are under GPL3 but the binary is sell to support ultracopier. It's mainly for commercial/companie usage. +patch/comercial/ + +====================================================== +Licensing of XZ Embedded ============================= +====================================================== + +All the files in this package have been written by Lasse Collin +and/or Igor Pavlov. All these files have been put into the +public domain. You can do whatever you want with these files. +As usual, this software is provided "as is", without any warranty. \ No newline at end of file diff --git a/ResourcesManager.cpp b/ResourcesManager.cpp new file mode 100644 index 0000000..32106a8 --- /dev/null +++ b/ResourcesManager.cpp @@ -0,0 +1,216 @@ +/** \file ResourcesManager.cpp +\brief Define the class to manage and load the resources linked with the themes +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include +#include + +#include "cpp11addition.h" +#include "ResourcesManager.h" +#include "FacilityEngine.h" + +std::regex ResourcesManager::slashEnd; + +/// \brief Create the manager and load the defaults variables +ResourcesManager::ResourcesManager() +{ + slashEnd=std::regex("[/\\\\]$"); + + //load the internal path + searchPath.push_back(":/"); + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE + //load the user path but only if exists and writable + //load the ultracopier path + #ifdef ULTRACOPIER_VERSION_PORTABLE + #ifdef ULTRACOPIER_VERSION_PORTABLEAPPS + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Ultracopier is compiled with the flag: ULTRACOPIER_VERSION_PORTABLEAPPS"); + //load the data folder path + QDir dir(QApplication::applicationDirPath()); + dir.cdUp(); + dir.cdUp(); + dir.cd(QStringLiteral("Data"); + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString())); + writablePath=ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString()); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Ultracopier is compiled with the flag: ULTRACOPIER_VERSION_PORTABLE"); + //load the ultracopier path + QDir dir(QApplication::applicationDirPath()); + dir.cd(QStringLiteral("Data")); + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString())); + writablePath=ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString()); + #endif + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Ultracopier is compiled as user privacy mode"); + #ifdef Q_OS_WIN32 + #define EXTRA_HOME_PATH QStringLiteral("\\ultracopier\\") + #else + #define EXTRA_HOME_PATH QStringLiteral("/.config/Ultracopier/") + #endif + #ifdef Q_OS_LINUX + QDir linuxArchIndepDir(QStringLiteral("/usr/share/ultracopier/")); + if(linuxArchIndepDir.exists()) + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(linuxArchIndepDir.absolutePath().toStdString())); + QDir linuxPluginsDir(QStringLiteral("/usr/lib/ultracopier/")); + if(linuxPluginsDir.exists()) + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(linuxPluginsDir.absolutePath().toStdString())); + #endif + //load the user path but only if exists and writable + QDir dir(QDir::homePath()+EXTRA_HOME_PATH); + if(dir.exists()) + { + writablePath=ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString()); + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString())); + } //if not exists try to create it + else if(dir.mkpath(dir.absolutePath())) + { + //if created, then have write permissions + writablePath=ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString()); + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString())); + } + //load the ultracopier path + searchPath.push_back(ResourcesManager::AddSlashIfNeeded(QApplication::applicationDirPath().toStdString())); + #endif + #else + QDir dir(QApplication::applicationDirPath()); + writablePath=ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString()); + #endif + vectorRemoveDuplicatesForSmallList(searchPath); + #ifdef ULTRACOPIER_DEBUG + unsigned int index=0; + while(index &fileToCheck) const +{ + unsigned int index=0; + while(index &fileToCheck) const +{ + QDir dir(QString::fromStdString(path)); + if(dir.exists()) // if the path have been found, then return the full path + { + bool allFileToCheckIsFound=true; + unsigned int index=0; + std::string partialPath=ResourcesManager::AddSlashIfNeeded(dir.absolutePath().toStdString()); + while(index &ResourcesManager::getReadPath() const +{ + return searchPath; +} + +/// \brief remove folder +bool ResourcesManager::removeFolder(const std::string &dir) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"folder to remove: "+dir); + bool errorFound=false; + QDir currentDir(QString::fromStdString(dir)); + QFileInfoList files = currentDir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot); + int index=0; + const int &loop_size=files.size(); + while(index +#include +#include +#include + +#include "Environment.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 +{ + 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 */ + std::string getFolderReadPath(const std::string &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 */ + std::string getFolderReadPathMultiple(const std::string &path,const std::vector &fileToCheck) const; + bool checkFolderContent(const std::string &path,const std::vector &fileToCheck) const; + /// \brief add / or \ in function of the platform at the end of path if both / and \ are not found + static std::string AddSlashIfNeeded(const std::string &path); + /// \brief get the writable path + const std::string &getWritablePath() const; + /// \brief disable the writable path, if ultracopier is unable to write into + bool disableWritablePath(); + /// \brief get the read path + const std::vector &getReadPath() const; + /// \brief remove folder + static bool removeFolder(const std::string &dir); + private: + /// \brief List of the path to read only access + std::vector searchPath; + /// \brief The writable path, empty if not found + std::string writablePath; + /// \brief match with slash end + static std::regex slashEnd; +}; + +#endif // RESOURCES_MANAGER_H diff --git a/SessionLoader.cpp b/SessionLoader.cpp new file mode 100644 index 0000000..1266e2f --- /dev/null +++ b/SessionLoader.cpp @@ -0,0 +1,171 @@ +/** \file SessionLoader.h +\brief Define the session loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "SessionLoader.h" +#include "LanguagesManager.h" +#include "cpp11addition.h" + +#ifndef ULTRACOPIER_VERSION_PORTABLE +SessionLoader::SessionLoader(OptionDialog *optionDialog) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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 + std::vector list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_SessionLoader); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + shouldEnabled=stringtobool(OptionEngine::optionEngine->getOptionValue("SessionLoader","LoadAtSessionStarting")); +} + +SessionLoader::~SessionLoader() +{ + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + unsigned int index=0; + while(indexisLoaded() || pluginList.at(index).pluginLoader->unload()) + { + delete pluginList.at(index).options; + pluginList.erase(pluginList.begin()+index); + } + } + index++; + } + #endif +} + +void SessionLoader::onePluginAdded(const PluginsAvailable &plugin) +{ + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + if(plugin.category!=PluginType_SessionLoader) + return; + unsigned int index=0; + LocalPlugin newEntry; + std::string pluginPath=plugin.path+PluginsManager::getResolvedPluginName("sessionLoader"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"static session loader not found"); + return; + } + newEntry.pluginLoader=NULL; + #else + QPluginLoader *pluginLoader= new QPluginLoader(QString::fromStdString(pluginPath)); + newEntry.pluginLoader=pluginLoader; + QObject *pluginInstance = pluginLoader->instance(); + if(!pluginInstance) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin: "+pluginLoader->errorString().toStdString()); + return; + } + PluginInterface_SessionLoader *sessionLoader = qobject_cast(pluginInstance); + if(!sessionLoader) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to cast the plugin: "+pluginLoader->errorString().toStdString()); + 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("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.push_back(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(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(indexisLoaded() || pluginList.at(index).pluginLoader->unload()) + { + delete pluginList.at(index).options; + pluginList.erase(pluginList.begin()+index); + } + } + break; + } + index++; + } +} +#endif + +void SessionLoader::newOptionValue(const std::string &groupName,const std::string &variableName,const std::string &value) +{ + if(groupName=="SessionLoader" && variableName=="LoadAtSessionStarting") + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, value: "+value); + shouldEnabled=stringtobool(value); + unsigned int index=0; + while(indexsetEnabled(shouldEnabled); + index++; + } + } +} + +#ifdef ULTRACOPIER_DEBUG +void SessionLoader::debugInformation(const Ultracopier::DebugLevel &level,const std::string& fonction,const std::string& text,const std::string& file,const int& ligne) +{ + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"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 new file mode 100644 index 0000000..7889284 --- /dev/null +++ b/SessionLoader.h @@ -0,0 +1,61 @@ +/** \file SessionLoader.h +\brief Define the class to load the plugin and lunch it +\author alpha_one_x86 +\licence GPL3, see the file COPYING + +This class load ALL plugin compatible to listen and catch the copy/move +*/ + +#ifndef SESSIONLOADER_H +#define SESSIONLOADER_H + +#include +#include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include +#endif +#include +#include + +#include "interface/PluginInterface_SessionLoader.h" +#include "PluginsManager.h" +#include "OptionDialog.h" +#include "LocalPluginOptions.h" + +#ifndef ULTRACOPIER_VERSION_PORTABLE +/** \brief manage all SessionLoader plugin */ +class SessionLoader : public QObject +{ + 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 std::string &groupName,const std::string &variableName,const std::string &value); + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level,const std::string& fonction,const std::string& text,const std::string& file,const int& ligne); + #endif // ULTRACOPIER_DEBUG + private: + //variable + struct LocalPlugin + { + PluginInterface_SessionLoader * sessionLoaderInterface; + #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + QPluginLoader * pluginLoader; + #endif + std::string path; + LocalPluginOptions *options; + }; + std::vector pluginList; + bool shouldEnabled; + OptionDialog *optionDialog; + signals: + void previouslyPluginAdded(PluginsAvailable) const; +}; +#endif + +#endif // SESSIONLOADER_H diff --git a/StructEnumDefinition.h b/StructEnumDefinition.h new file mode 100644 index 0000000..e8f8de2 --- /dev/null +++ b/StructEnumDefinition.h @@ -0,0 +1,153 @@ +/** \file StructEnumDefinition.h +\brief Define the structure and enumeration used in ultracopier or into the plugin +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include + +#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 +}; + +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 +}; + +/// \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 +}; + +/// \brief Define the copy type, if folder, file or both +enum CopyType +{ + 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 +}; + +enum EngineActionInProgress +{ + 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, ... +}; + +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 +}; + +/// \brief structure for decompossed time +struct TimeDecomposition +{ + uint16_t second; + uint16_t minute; + uint16_t 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 +}; + +/// \brief structure for progression item +struct ProgressionItem +{ + uint64_t id; + uint64_t currentRead; + uint64_t currentWrite; + uint64_t total; +}; + +/// \brief item to insert item in the interface +struct ItemOfCopyList +{ + uint64_t id; + // if type == CustomOperation, then is the translated name of the operation + std::string sourceFullPath;///< full path with file name: /foo/foo.txt + std::string sourceFileName;///< full path with file name: foo.txt + std::string destinationFullPath;///< full path with file name: /foo/foo.txt + std::string destinationFileName;///< full path with file name: foo.txt + // if type == CustomOperation, then 0 = without progression, 1 = with progression + uint64_t size; + CopyMode mode; +}; + +/// \brief The definition of no removing action on transfer list +struct ActionOnCopyList +{ + 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 +{ + 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 new file mode 100644 index 0000000..480b7cb --- /dev/null +++ b/StructEnumDefinition_UltracopierSpecific.h @@ -0,0 +1,55 @@ +/** \file StructEnumDefinition_UltracopierSpecific.h +\brief Define the structure and enumeration used in ultracopier only +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include + +#ifndef STRUCTDEF_ULTRACOPIERSPECIFIC_H +#define STRUCTDEF_ULTRACOPIERSPECIFIC_H + +enum PluginType : uint8_t +{ + PluginType_Unknow=0, + PluginType_CopyEngine=1, + PluginType_Languages=2, + PluginType_Listener=3, + PluginType_PluginLoader=4, + PluginType_SessionLoader=5, + PluginType_Themes=6 +}; + +/// \brief structure to store the general plugin related information +struct PluginsAvailable +{ + PluginType category; + std::string path; + std::string name; + std::string writablePath; + QDomElement categorySpecific; + std::string version; + std::vector > informations; + std::string errorString; + bool isWritable; + bool isAuth; +}; + +enum DebugLevel_custom : uint8_t +{ + DebugLevel_custom_Information=0, + DebugLevel_custom_Critical=1, + DebugLevel_custom_Warning=2, + DebugLevel_custom_Notice=3, + DebugLevel_custom_UserNote=4 +}; + +enum ActionOnManualOpen : uint8_t +{ + ActionOnManualOpen_Nothing=0x00, + ActionOnManualOpen_Folder=0x01, + ActionOnManualOpen_Files=0x02 +}; + +#endif // STRUCTDEF_ULTRACOPIERSPECIFIC_H diff --git a/SystrayIcon.cpp b/SystrayIcon.cpp new file mode 100644 index 0000000..ab3c3e0 --- /dev/null +++ b/SystrayIcon.cpp @@ -0,0 +1,559 @@ +/** \file SystrayIcon.cpp +\brief Define the class of the systray icon +\author alpha_one_x86 +\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(QObject * parent) : + QSystemTrayIcon(parent) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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; + #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()) + { + #ifdef ULTRACOPIER_MODE_SUPERCOPIER + setToolTip(QStringLiteral("Supercopier")); + #else + setToolTip(QStringLiteral("Ultracopier")); + #endif + updateSystrayIcon(); + } + else + timerCheckSetTooltip.start(); +} + +void SystrayIcon::listenerReady(const Ultracopier::ListeningState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"state: "+std::to_string((int)state)+", havePlugin: "+std::to_string((int)havePlugin)+", someAreInWaitOfReply: "+std::to_string((int)someAreInWaitOfReply)); + Q_UNUSED(someAreInWaitOfReply); + stateListener=state; + haveListenerInfo=true; + haveListener=havePlugin; + updateSystrayIcon(); + if(!havePlugin) + showTryCatchMessageWithNoListener(); +} + +void SystrayIcon::pluginLoaderReady(const Ultracopier::CatchState &state,const bool &havePlugin,const bool &someAreInWaitOfReply) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"state: "+std::to_string((int)state)+", havePlugin: "+std::to_string((int)havePlugin)+", someAreInWaitOfReply: "+std::to_string((int)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.").toStdString()); +} + +/// \brief To show a message linked to the systray icon +void SystrayIcon::showSystrayMessage(const std::string& text) +{ + showMessage(tr("Information"),QString::fromStdString(text),QSystemTrayIcon::Information,0); +} + +#ifdef ULTRACOPIER_INTERNET_SUPPORT +void SystrayIcon::messageClicked() +{ + QDesktopServices::openUrl(QString::fromStdString(HelpDialog::getUpdateUrl())); +} +#endif + +/// \brief To update the systray icon +void SystrayIcon::updateSystrayIcon() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, haveListenerInfo "+std::to_string((int)haveListenerInfo)+", havePluginLoaderInfo: "+std::to_string((int)havePluginLoaderInfo)); + std::string toolTip="???"; + std::string icon; + if(!haveListenerInfo || !havePluginLoaderInfo) + { + toolTip=tr("Searching information...").toStdString(); + icon="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").toStdString(); + icon="Uncaught"; + } + else if(stateListener==Ultracopier::SemiListening) + { + toolTip=tr("Semi replace the explorer copy/move").toStdString(); + icon="Semiuncaught"; + } + else + { + toolTip=tr("Replace the explorer copy/move").toStdString(); + icon="Caught"; + } + } + else + { + icon="Semiuncaught"; + std::string first_part; + std::string second_part; + if(stateListener==Ultracopier::NotListening) + first_part="No listening"; + else if(stateListener==Ultracopier::SemiListening) + first_part="Semi listening"; + else if(stateListener==Ultracopier::FullListening) + first_part="Full listening"; + else + first_part="Unknow listening"; + if(statePluginLoader==Ultracopier::Uncaught) + second_part="No replace"; + else if(statePluginLoader==Ultracopier::Semiuncaught) + second_part="Semi replace"; + else if(statePluginLoader==Ultracopier::Caught) + second_part="Full replace"; + else + second_part="Unknow replace"; + toolTip=first_part+"/"+second_part; + } + } + QIcon theNewSystrayIcon; + #ifdef Q_OS_WIN32 + theNewSystrayIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/systray_"+icon+"_Windows.png"); + #else + theNewSystrayIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/systray_"+icon+"_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(QString::fromStdString(":/systray_"+icon+"_Windows.png")); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"use the default systray icon: :/systray_"+icon+"_Unix.png"); + theNewSystrayIcon=QIcon(QString::fromStdString(":/systray_"+icon+"_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(QString::fromStdString("Supercopier - "+toolTip)); + #else + setToolTip(QString::fromStdString("Ultracopier - "+toolTip)); + #endif +} + +/* 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 SystrayIcon::dropEvent(QDropEvent *event) +{ + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + //impossible with Qt on systray + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"mimeData->urls().size()"+std::to_string(mimeData->urls().size())); + std::vector urls; + unsigned int index=0; + while(index<(unsigned int)mimeData->urls().size()) + { + urls.push_back(mimeData->urls().at(static_cast(index)).toString().toStdString()); + index++; + } + emit urlDropped(urls); + event->acceptProposedAction(); + } +} + +void SystrayIcon::dragEnterEvent(QDragEnterEvent* event) +{ + // 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(); +} + +void SystrayIcon::dragLeaveEvent(QDragLeaveEvent* event) +{ + event->accept(); +} + + +/// \brief To update the current themes +void SystrayIcon::updateCurrentTheme() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"icon: start"); + //load the systray menu item + QIcon tempIcon; + + tempIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/exit.png"); + if(!tempIcon.isNull()) + IconQuit=QIcon(tempIcon); + else + IconQuit=QIcon(""); + actionMenuQuit->setIcon(IconQuit); + + #ifdef ULTRACOPIER_DEBUG + actionSaveBugReport->setIcon(QIcon(":/warning.png")); + #endif + + tempIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/informations.png"); + if(!tempIcon.isNull()) + IconInfo=QIcon(tempIcon); + else + IconInfo=QIcon(""); + actionMenuAbout->setIcon(IconInfo); + + tempIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/options.png"); + if(!tempIcon.isNull()) + IconOptions=QIcon(tempIcon); + else + IconOptions=QIcon(""); + actionOptions->setIcon(IconOptions); + + tempIcon=ThemesManager::themesManager->loadIcon("SystemTrayIcon/add.png"); + if(!tempIcon.isNull()) + IconAdd=QIcon(tempIcon); + else + IconAdd=QIcon(""); + + //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(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,"The action on the systray icon is unknown: "+std::to_string((int)reason)); + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The action on the systray icon is unknown: "+std::to_string((int)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(Ultracopier::DebugLevel_Notice,"action not found"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+currentAction->data().toString().toStdString()); + emit addWindowCopyMove(Ultracopier::Copy,currentAction->data().toString().toStdString()); +} + +/// \brief To catch move menu action +void SystrayIcon::CatchMoveQuery() +{ + 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().toStdString()); + emit addWindowCopyMove(Ultracopier::Move,currentAction->data().toString().toStdString()); +} + +/// \brief To catch transfer menu action +void SystrayIcon::CatchTransferQuery() +{ + 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().toStdString()); + emit addWindowTransfer(currentAction->data().toString().toStdString()); +} + +/// \brief to retranslate the ui +void SystrayIcon::retranslateTheUI() +{ + 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 std::string &name,const bool &canDoOnlyCopy) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + EngineEntry entry; + entry.name=name; + entry.canDoOnlyCopy=canDoOnlyCopy; + engineEntryList.push_back(entry); + if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + reloadEngineList(); +} + +void SystrayIcon::removeCopyEngine(const std::string &name) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + unsigned int index=0; + while(indexsetData(name); + #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + copyMenu->addAction(copy); + #else + actions.push_back(copy); + systrayMenu->insertAction(actionOptions, copy); + #endif +} + +void SystrayIcon::reloadEngineList() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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 + { + for(unsigned int index=0; indexaddMenu(menu); + #endif + } + setContextMenu(systrayMenu); +} diff --git a/SystrayIcon.h b/SystrayIcon.h new file mode 100644 index 0000000..5db5b4f --- /dev/null +++ b/SystrayIcon.h @@ -0,0 +1,144 @@ +/** \file SystrayIcon.h +\brief Define the class of the systray icon +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef SYSTRAY_ICON_H +#define SYSTRAY_ICON_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Environment.h" + +/** \brief The systray icon + +This class provide a systray icon and its functions */ +class SystrayIcon : public QSystemTrayIcon +{ + 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 std::string& 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 std::string &name,const bool &canDoOnlyCopy); + void removeCopyEngine(const std::string &name); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + void newUpdate(const std::string &version); + #endif + private: + #ifdef ULTRACOPIER_INTERNET_SUPPORT + std::string 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 + std::vector 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; + std::string name; + }; + std::vector engineEntryList; + // To store the current catch state + Ultracopier::ListeningState stateListener; + Ultracopier::CatchState statePluginLoader; + bool haveListenerInfo,havePluginLoaderInfo; + bool haveListener,havePluginLoader; + QTimer timerCheckSetTooltip; + + void addEngineAction(const QString &name, const QIcon &icon, const QString &label, QMenu *menu, void (SystrayIcon::*query)()); + + /** \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(); + #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,std::string name) const; + void addWindowTransfer(std::string name) const; + void urlDropped(std::vector urls) const; + void saveBugReport() const; +}; + +#endif // SYSTRAY_ICON_H diff --git a/ThemesManager.cpp b/ThemesManager.cpp new file mode 100644 index 0000000..ab61e44 --- /dev/null +++ b/ThemesManager.cpp @@ -0,0 +1,291 @@ +/** \file ThemesManager.cpp +\brief Define the class for manage and load the themes +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include +#include +#include + +#include "ThemesManager.h" +#include "PluginsManager.h" +#include "LanguagesManager.h" + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#include "plugins/Themes/Oxygen/ThemesFactory.h" +#endif + +#ifdef ULTRACOPIER_MODE_SUPERCOPIER +#define ULTRACOPIER_DEFAULT_STYLE "Supercopier" +#else +#define ULTRACOPIER_DEFAULT_STYLE "Oxygen" +#endif + +/// \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 + 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); + std::vector list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_Themes); + foreach(PluginsAvailable currentPlugin,list) + emit previouslyPluginAdded(currentPlugin); + PluginsManager::pluginsManager->unlockPluginListEdition(); + + //do the options + std::vector > KeysList; + KeysList.push_back(std::pair("Ultracopier_current_theme",ULTRACOPIER_DEFAULT_STYLE)); + OptionEngine::optionEngine->addOptionGroup("Themes",KeysList); + + //load the default and current themes path + defaultStylePath=std::string(":/Themes/")+ULTRACOPIER_DEFAULT_STYLE+"/"; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Default style: "+defaultStylePath); + currentStylePath=defaultStylePath; + connect(OptionEngine::optionEngine, &OptionEngine::newOptionValue, this, &ThemesManager::newOptionValue,Qt::QueuedConnection); +} + +/// \brief Destroy the themes manager +ThemesManager::~ThemesManager() +{ + stopIt=true; +} + +void ThemesManager::onePluginAdded(const PluginsAvailable &plugin) +{ + 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,"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(QString::fromStdString(newPlugin.plugin.path+FacilityEngine::separator()+PluginsManager::pluginsManager->getResolvedPluginName("interface"))); + QObject *pluginInstance = pluginLoader->instance(); + if(pluginInstance==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin "+newPlugin.plugin.path+FacilityEngine::separator()+PluginsManager::pluginsManager->getResolvedPluginName("interface")+": "+pluginLoader->errorString().toStdString()); + 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,"unable to cast the plugin: "+pluginLoader->errorString().toStdString()); + pluginLoader->unload(); + emit newThemeOptions(newPlugin.plugin.name,NULL,false,true); + emit theThemeIsReloaded(); + return; + } + //check if found + unsigned int indexTemp=0; + while(indexTempgetResolvedPluginName("interface")+", conflit plugin: "+pluginList.at(indexTemp).plugin.path+FacilityEngine::separator()+PluginsManager::pluginsManager->getResolvedPluginName("interface")+", name: "+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,"preload: "+newPlugin.plugin.name+", at the index: "+std::to_string(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("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.push_back(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(stopIt) + return; + if(plugin.category!=PluginType_Themes) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+plugin.name); + unsigned int index=0; + while(indexunload(); + delete pluginList.at(index).pluginLoader; + } + if(currentPluginIndex==static_cast(index)) + currentPluginIndex=-1; + if(static_cast(index)(currentPluginIndex)>=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 std::string &fileName) +{ + if(currentPluginIndex==-1) + return QIcon(); + if(pluginList.at(static_cast(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(static_cast(currentPluginIndex)).factory->getIcon(fileName); +} + +void ThemesManager::allPluginIsLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(pluginList.size()==0) + { + emit theThemeIsReloaded(); + return; + } + std::string name=OptionEngine::optionEngine->getOptionValue("Themes","Ultracopier_current_theme"); + unsigned int index=0; + while(index(index); + emit theThemeIsReloaded(); + return; + } + index++; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"theme not found!"); + currentPluginIndex=-1; + emit theThemeIsReloaded(); +} + +PluginInterface_Themes * ThemesManager::getThemesInstance() +{ + 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(static_cast(currentPluginIndex)).plugin.name); + if(static_cast(currentPluginIndex)>=pluginList.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, internal selection bug"); + return NULL; + } + if(pluginList.at(static_cast(currentPluginIndex)).factory==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"No plugin factory loaded to get an instance"); + return NULL; + } + return pluginList.at(static_cast(currentPluginIndex)).factory->getInstance(); +} + +#ifdef ULTRACOPIER_DEBUG +void ThemesManager::debugInformation(const Ultracopier::DebugLevel &level,const std::string& fonction,const std::string& text,const std::string& file,const int& ligne) +{ + DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Theme plugin"); +} +#endif // ULTRACOPIER_DEBUG + +void ThemesManager::newOptionValue(const std::string &group,const std::string &name,const std::string &value) +{ + if(group=="Themes" && name=="Ultracopier_current_theme") + { + if(!PluginsManager::pluginsManager->allPluginHaveBeenLoaded()) + return; + if(currentPluginIndex!=-1 && value!=pluginList.at(static_cast(currentPluginIndex)).plugin.name) + { + //int tempCurrentPluginIndex=currentPluginIndex; + emit theThemeNeedBeUnloaded(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"unload the themes: "+pluginList.at(static_cast(currentPluginIndex)).plugin.name+" ("+std::to_string(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 new file mode 100644 index 0000000..9e83af8 --- /dev/null +++ b/ThemesManager.h @@ -0,0 +1,87 @@ +/** \file ThemesManager.h +\brief Define the class to manage and load the themes +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef THEMES_MANAGER_H +#define THEMES_MANAGER_H + +#include +#include +#include +#include +#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT +#include +#endif + +#include "Environment.h" +#include "ResourcesManager.h" +#include "OptionEngine.h" +#include "PluginsManager.h" +#include "LanguagesManager.h" +#include "LocalPluginOptions.h" +#include "FacilityEngine.h" + +#include "interface/PluginInterface_Themes.h" + +/** \brief Define the class to manage and load the themes + +This class provide a core load and manage the themes */ +class ThemesManager : public QObject +{ + 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 std::string &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 + std::string defaultStylePath; + /// \brief The current themes path loaded by ultracopier + std::string 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; + }; + std::vector pluginList; + int currentPluginIndex;//can bne -1 + bool stopIt; + signals: + /// \brief send this signal when the themes have changed + void theThemeNeedBeUnloaded() const; + void theThemeIsReloaded() const; + void newThemeOptions(const std::string &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 std::string &group,const std::string &name,const std::string &value); + #ifdef ULTRACOPIER_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level, const std::string& fonction, const std::string& text, const std::string& file, const int& ligne); + #endif // ULTRACOPIER_DEBUG +}; + +#endif // THEMES_MANAGER_H diff --git a/Variable.h b/Variable.h new file mode 100644 index 0000000..c3d01a3 --- /dev/null +++ b/Variable.h @@ -0,0 +1,50 @@ +/** \file Variable.h +\brief Define the environment variable +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef VARIABLE_H +#define VARIABLE_H + +/// \brief Un-comment this next line to put ultracopier in debug mode +#define ULTRACOPIER_DEBUG +#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 "1.4.0.4" +/// \brief the windows version +#define ULTRACOPIER_WINDOWS_VERSION 1,4,0,4 +// 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_PLUGIN_ALL_IN_ONE +//#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" + +/// \brief to have internet support, to communicate with the web site for update and plugins +#define ULTRACOPIER_INTERNET_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/cpp11addition.cpp b/cpp11addition.cpp new file mode 100644 index 0000000..7da2205 --- /dev/null +++ b/cpp11addition.cpp @@ -0,0 +1,531 @@ +#include "cpp11addition.h" +#include +#include +#include +#include +#include +#include +#include + +/// \todo, check number validity by http://en.cppreference.com/w/c/string/byte/strtol +/* to check: bool my_strtol(const std::string &str, long &v) { +char *end = nullptr; +v = strtol(str.c_str(), &end, 10); +return end != nullptr; +}*/ + +static const std::regex ishexa("^([0-9a-fA-F][0-9a-fA-F])+$",std::regex::optimize); +#if defined(_WIN32) || defined(CATCHCHALLENGER_EXTRA_CHECK) +static const std::regex regexseparators("[/\\\\]+",std::regex::optimize); +#endif + +static const std::string base64_chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + +static inline bool is_base64(unsigned char c) { + return (isalnum(c) || (c == '+') || (c == '/')); +} + +static const char* const lut = "0123456789ABCDEF"; + +std::size_t pairhash::operator()(const std::pair &x) const +{ + return (x.first << 8) + x.second; +} + +std::size_t pairhash::operator()(const std::pair &x) const +{ + return (x.first << 16) + x.second; +} + +std::string ltrim(const std::string& str) +{ + return std::regex_replace(str, std::regex("^ +"), ""); +} +std::string rtrim(const std::string& str) +{ + return std::regex_replace(str, std::regex(" +$"), ""); +} +std::string trim(const std::string& str) +{ + return std::regex_replace(str, std::regex("^ +| +$"), ""); +} + +bool stringreplaceOne(std::string& str, const std::string& from, const std::string& to) +{ + const size_t start_pos = str.find(from); + if(start_pos == std::string::npos) + return false; + str.replace(start_pos, from.length(), to); + return true; +} + +uint8_t stringreplaceAll(std::string& str, const std::string& from, const std::string& to) +{ + if(from.empty()) + return 0; + size_t start_pos = 0; + uint8_t count=0; + while((start_pos = str.find(from, start_pos)) != std::string::npos) { + str.replace(start_pos, from.length(), to); + start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx' + count++; + } + return count; +} + +std::vector stringregexsplit(const std::string& input, const std::regex& regex) +{ + // passing -1 as the submatch index parameter performs splitting + std::sregex_token_iterator + first{input.begin(), input.end(), regex, -1}, + last; + return {first, last}; +} + +std::vector stringsplit(const std::string &s, char delim) +{ + std::vector elems; + + std::string::size_type i = 0; + std::string::size_type j = s.find(delim); + + if(j == std::string::npos) + { + if(!s.empty()) + elems.push_back(s); + return elems; + } + else + { + while (j != std::string::npos) { + elems.push_back(s.substr(i, j-i)); + i = ++j; + j = s.find(delim, j); + + if (j == std::string::npos) + elems.push_back(s.substr(i, s.length())); + } + return elems; + } +} + +bool stringEndsWith(std::string const &fullString, std::string const &ending) +{ + if (fullString.length() >= ending.length()) { + return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending)); + } else { + return false; + } +} + +bool stringEndsWith(std::string const &fullString, char const &ending) +{ + if (fullString.length()>0) { + return fullString[fullString.size()-1]==ending; + } else { + return false; + } +} + +bool stringStartWith(std::string const &fullString, std::string const &starting) +{ + if (fullString.length() >= starting.length()) { + return (fullString.substr(0,starting.length())==starting); + } else { + return false; + } +} + +bool stringStartWith(std::string const &fullString, char const &starting) +{ + if (fullString.length()>0) { + return fullString[0]==starting; + } else { + return false; + } +} + +std::string& stringimplode(const std::vector& elems, char delim, std::string& s) +{ + for (std::vector::const_iterator ii = elems.begin(); ii != elems.cend(); ++ii) + { + s += (*ii); + if ( ii + 1 != elems.end() ) { + s += delim; + } + } + + return s; +} + +std::string stringimplode(const std::vector& elems, char delim) +{ + std::string s; + return stringimplode(elems, delim, s); +} + +std::string stringimplode(const std::queue& elems, char delim) +{ + std::string newString; + std::queue copy=elems; + unsigned int count=0; + while(!copy.empty()) + { + if(count>0) + newString+=delim; + newString+=copy.front(); + copy.pop(); + ++count; + } + + return newString; +} + +std::string stringimplode(const std::vector& elems, const std::string &delim) +{ + std::string newString; + for (std::vector::const_iterator ii = elems.begin(); ii != elems.cend(); ++ii) + { + newString += (*ii); + if ( ii + 1 != elems.end() ) { + newString += delim; + } + } + return newString; +} + +std::string binarytoHexa(const std::vector &data, bool *ok) +{ + if(ok!=NULL) + *ok=true; + std::string output; + output.reserve(2*data.size()); + for(size_t i=0;i> 4]); + output.push_back(lut[c & 15]); + } + return output; +} + +std::string binarytoHexa(const unsigned char * const data, const uint32_t &size, bool *ok) +{ + return binarytoHexa(reinterpret_cast(data),size,ok); +} + +std::string binarytoHexa(const char * const data, const uint32_t &size, bool *ok) +{ + if(size==0) + return std::string(); + #ifdef CATCHCHALLENGER_EXTRA_CHECK + if(__builtin_expect((size>100000000),0)) + { + std::cerr << "cpp11addition binarytoHexa() size>100000000, seam be a bug, dropped to empty string" << std::endl; + return std::string(); + } + #endif + if(ok!=NULL) + *ok=true; + std::string output; + output.reserve(2*size); + for(size_t i=0;i> 4]); + output.push_back(lut[c & 15]); + } + return output; +} + +uint8_t hexToDecUnit(const std::string& data, bool *ok) +{ + auto fromHex = [](char c, bool *ok) + { + if(ok!=NULL) + *ok=true; + if (isdigit(c)) return c - '0'; + switch(c) + { + case '0': + return 0; + case '1': + return 1; + case '2': + return 2; + case '3': + return 3; + case '4': + return 4; + case '5': + return 5; + case '6': + return 6; + case '7': + return 7; + case '8': + return 8; + case '9': + return 9; + + case 'a': + case 'A': + return 10; + case 'b': + case 'B': + return 11; + case 'c': + case 'C': + return 12; + case 'd': + case 'D': + return 13; + case 'e': + case 'E': + return 14; + case 'f': + case 'F': + return 15; + } + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + }; + return fromHex(data[0],ok) << 4 | fromHex(data[1],ok); +} + +std::vector hexatoBinary(const std::string &data,bool *ok) +{ + if(data.size()%2!=0) + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return std::vector(); + } + if(Q_LIKELY(std::regex_match(data,ishexa))) + { + bool ok2; + std::vector out; + out.reserve(data.length()/2); + for(size_t i=0;i(); + } + out.push_back(x); + } + if(ok!=NULL) + *ok=true; + return out; + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return std::vector(); + } +} + +void binaryAppend(std::vector &data,const std::vector &add) +{ + if(add.empty()) + return; + if(data.empty()) + { + data=add; + return; + } + const int oldsize=data.size(); + data.resize(oldsize+add.size()); + memcpy(data.data()+oldsize,add.data(),add.size()); +} + +void binaryAppend(std::vector &data,const char * const add,const uint32_t &addSize) +{ + if(addSize==0) + return; + if(data.empty()) + { + data.resize(addSize); + memcpy(data.data(),add,addSize); + return; + } + const int oldsize=data.size(); + data.resize(oldsize+addSize); + memcpy(data.data()+oldsize,add,addSize); +} + +std::vector base64toBinary(const std::string &string) +{ + int index=0; + int sub_index=0; + int encoded_string_remaining=string.size(); + int encoded_string_pos=0; + unsigned char char_array_4[4], char_array_3[3]; + std::vector ret; + + while(encoded_string_remaining-- && (string[encoded_string_pos]!='=') && is_base64(string[encoded_string_pos])) + { + char_array_4[index++]=string[encoded_string_pos]; + encoded_string_pos++; + if(index==4) + { + for(index=0;index<4;index++) + char_array_4[index]=base64_chars.find(char_array_4[index]); + + char_array_3[0]=(char_array_4[0]<<2) + ((char_array_4[1]&0x30)>>4); + char_array_3[1]=((char_array_4[1]&0xf)<<4) + ((char_array_4[2]&0x3c)>>2); + char_array_3[2]=((char_array_4[2]&0x3)<<6) + char_array_4[3]; + + for(index=0;(index<3);index++) + ret.push_back(char_array_3[index]); + + index=0; + } + } + + if(index) + { + for(sub_index=index;sub_index<4;sub_index++) + char_array_4[sub_index]=0; + + for(sub_index=0;sub_index<4;sub_index++) + char_array_4[sub_index]=base64_chars.find(char_array_4[sub_index]); + + char_array_3[0]=(char_array_4[0]<<2) + ((char_array_4[1]&0x30)>>4); + char_array_3[1]=((char_array_4[1]&0xf)<<4) + ((char_array_4[2]&0x3c)>>2); + char_array_3[2]=((char_array_4[2]&0x3)<<6) + char_array_4[3]; + + for (sub_index=0;(sub_index parts=stringregexsplit(newstring,regexseparators); + #else + std::vector parts=stringsplit(newstring,'/'); + #endif + + #ifndef _WIN32 + unsigned int index=1; + #else + unsigned int index=2; + #endif + while(index0 && (index>1 || !parts.at(index-1).empty())) + #else + if(index>1) + #endif + { + parts.erase(parts.begin()+index-1); + index--; + } + } + else + index++; + } + + #ifndef _WIN32 + if(parts.empty() || (parts.size()==1 && parts.at(0).empty())) + return "/"; + #endif + return stringimplode(parts,'/'); +} + +std::string FSabsolutePath(const std::string &string) +{ + const std::string &tempFile=FSabsoluteFilePath(string); + const std::size_t &found=tempFile.find_last_of("/\\"); + if(found!=std::string::npos) + return tempFile.substr(0,found)+'/'; + else + return tempFile; +} + +uint64_t msFrom1970() +{ + return std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); +} + +uint64_t sFrom1970() +{ + return std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()/1000; +} + +std::string booltostring(const bool &value) +{ + if(value) + return "true"; + else + return "false"; +} + +std::vector stringtostringlist(const std::string &string) +{ + if(string.empty()) + return std::vector(); + std::vector returnedVar; + size_t start_pos = 0; + size_t firstChar = 0; + while((start_pos = string.find(',', start_pos)) != std::string::npos) { + if(start_pos==0 || string.at(start_pos-1)!=',') + { + std::string tempString=string.substr(firstChar,start_pos-1); + stringreplaceAll(tempString,",,",","); + returnedVar.push_back(tempString); + start_pos++; + firstChar=start_pos; + } + } + return returnedVar; +} + +std::string stringlisttostring(const std::vector &stringlist) +{ + std::string returnedString; + unsigned int index=0; + while(index +#include +#include +#include +#include +#include + +#if ! defined(Q_LIKELY) + #if defined(__GNUC__) + # define Q_LIKELY(expr) __builtin_expect(!!(expr), true) + # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false) + #else + # define Q_LIKELY(x) (x) + #endif +#endif + +struct pairhash { +public: + std::size_t operator()(const std::pair &x) const; + std::size_t operator()(const std::pair &x) const; +}; + +std::string ltrim(const std::string& str); +std::string rtrim(const std::string& str); +std::string trim(const std::string& str); +bool stringreplaceOne(std::string& str, const std::string& from, const std::string& to); +uint8_t stringreplaceAll(std::string& str, const std::string& from, const std::string& to); +std::vector stringregexsplit(const std::string& input, const std::regex& regex); +std::vector stringsplit(const std::string &s, char delim); +bool stringEndsWith(std::string const &fullString, std::string const &ending); +bool stringEndsWith(std::string const &fullString, char const &ending); +bool stringStartWith(std::string const &fullString, std::string const &starting); +bool stringStartWith(std::string const &fullString, char const &starting); +std::string& stringimplode(const std::vector& elems, char delim, std::string& s); +std::string stringimplode(const std::vector& elems, char delim); +std::string stringimplode(const std::queue& elems, char delim); +std::string stringimplode(const std::vector& elems, const std::string &delim); + +uint8_t stringtouint8(const std::string &string,bool *ok=NULL); +uint16_t stringtouint16(const std::string &string,bool *ok=NULL); +uint32_t stringtouint32(const std::string &string,bool *ok=NULL); +bool stringtobool(const std::string &string,bool *ok=NULL); +uint64_t stringtouint64(const std::string &string,bool *ok=NULL); +int8_t stringtoint8(const std::string &string,bool *ok=NULL); +int16_t stringtoint16(const std::string &string,bool *ok=NULL); +int32_t stringtoint32(const std::string &string,bool *ok=NULL); +int64_t stringtoint64(const std::string &string,bool *ok=NULL); +float stringtofloat(const std::string &string,bool *ok=NULL); +double stringtodouble(const std::string &string,bool *ok=NULL); +std::string booltostring(const bool &value); + +std::vector stringtostringlist(const std::string &string); +std::string stringlisttostring(const std::vector &stringlist); + +std::string binarytoHexa(const std::vector &data,bool *ok=NULL); +std::string binarytoHexa(const char * const data,const uint32_t &size,bool *ok=NULL); +std::string binarytoHexa(const unsigned char * const data,const uint32_t &size,bool *ok=NULL); +uint8_t hexToDecUnit(const std::string& data,bool *ok=NULL); +std::vector hexatoBinary(const std::string &data,bool *ok=NULL); +void binaryAppend(std::vector &data,const std::vector &add); +void binaryAppend(std::vector &data, const char * const add, const uint32_t &addSize); +std::vector base64toBinary(const std::string &string); +std::string FSabsoluteFilePath(const std::string &string); +std::string FSabsolutePath(const std::string &string); +uint64_t msFrom1970(); +uint64_t sFrom1970(); + +template +int vectorindexOf(const std::vector &list,const T &item) +{ + const auto &r=std::find(list.cbegin(),list.cend(),item); + if(r==list.cend()) + return -1; + else + return std::distance(list.cbegin(),r); +} + +template +bool vectorremoveOne(std::vector &list,const T &item) +{ + const auto &r=std::find(list.cbegin(),list.cend(),item); + if(r==list.cend()) + { + return false; + } + else + { + list.erase(r); + return true; + } +} + +template +bool vectorcontainsAtLeastOne(const std::vector &list,const T &item) +{ + const auto &r=std::find(list.cbegin(),list.cend(),item); + if(r==list.cend()) + return false; + else + return true; +} + +template +unsigned int vectorcontainsCount(const std::vector &list,const T &item) +{ + return std::count(list.cbegin(), list.cend(), item); +} + +template +std::vector unordered_map_keys_vector(const std::unordered_map &unordered_map_var) +{ + std::vector keyList; + keyList.reserve(unordered_map_var.size()); + for ( auto it = unordered_map_var.cbegin(); it != unordered_map_var.cend(); ++it ) + keyList.push_back(it->first); + return keyList; +} + +template +unsigned int vectorRemoveEmpty(std::vector &list) +{ + unsigned int removedEntryNumber=0; + for(auto it = list.begin();it != list.cend();) + if((*it).empty()) + { + list.erase(it); + ++removedEntryNumber; + } + else + ++it; + return removedEntryNumber; +} + +template +size_t vectorRemoveDuplicatesForSmallList(std::vector &list) +{ + /*unsigned int removedEntryNumber=0; + for(auto it = list.begin();it < list.cend()-1;) + { + const auto indexOf=std::find(it+1,list.cend(),*it); + if(indexOf!=list.end()) + { + list.erase(indexOf); + ++removedEntryNumber; + } + else + ++it; + } + return removedEntryNumber;*/ + + std::unordered_set s(list.cbegin(),list.cend()); + const size_t removedEntryNumber=list.size()-s.size(); + list=std::vector(s.cbegin(),s.cend()); + return removedEntryNumber; +} + +template +unsigned int vectorRemoveDuplicatesForBigList(std::vector &list) +{ + std::unordered_set s(list.cbegin(),list.cend()); + const unsigned int removedEntryNumber=list.size()-s.size(); + list=std::vector(s.cbegin(),s.cend()); + return removedEntryNumber; +} + +template +unsigned int vectorRemoveAll(std::vector &list,const T &item) +{ + unsigned int removedEntryNumber=0; + unsigned int index=0; + while(index +bool vectorHaveDuplicatesForSmallList(const std::vector &list) +{ + std::unordered_set s; + unsigned int index=0; + while(index +#include + +/// \todo, check number validity by http://en.cppreference.com/w/c/string/byte/strtol +/* to check: bool my_strtol(const std::string &str, long &v) { +char *end = nullptr; +v = strtol(str.c_str(), &end, 10); +return end != nullptr; +}*/ + +static const std::regex isaunsignednumber("^[0-9]+$",std::regex::optimize); +static const std::regex isasignednumber("^-?[0-9]+$",std::regex::optimize); +static const std::regex isadouble("^-?[0-9]+(\\.[0-9]+)?$",std::regex::optimize); + +uint8_t stringtouint8(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + unsigned int tempValue; + try { + tempValue = std::stoul(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(tempValue<=0xFF)) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #else + if(Q_LIKELY(std::regex_match(string,isaunsignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + const unsigned int &tempValue=std::stoul(string); + if(Q_LIKELY(tempValue<=0xFF)) + return tempValue; + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +uint16_t stringtouint16(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + unsigned int tempValue; + try { + tempValue = std::stoul(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(tempValue<=0xFFFF)) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #else + if(Q_LIKELY(std::regex_match(string,isaunsignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + const unsigned int &tempValue=std::stoul(string); + if(Q_LIKELY(tempValue<=0xFFFF)) + return tempValue; + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +uint32_t stringtouint32(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + uint32_t tempValue; + try { + tempValue = std::stoul(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + #else + if(Q_LIKELY(std::regex_match(string,isaunsignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + const unsigned int &tempValue=std::stoull(string); + if(Q_LIKELY(tempValue<=0xFFFFFFFF)) + return tempValue; + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +bool stringtobool(const std::string &string,bool *ok) +{ + if(string=="1") + { + if(ok!=NULL) + *ok=true; + return true; + } + if(string=="0") + { + if(ok!=NULL) + *ok=true; + return false; + } + if(string=="true" || string=="t" /*postgresql*/ || string=="TRUE") + { + if(ok!=NULL) + *ok=true; + return true; + } + if(string=="false" || string=="f" /*postgresql*/ || string=="FALSE") + { + if(ok!=NULL) + *ok=true; + return false; + } + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return false; +} + +uint64_t stringtouint64(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + uint64_t tempValue; + try { + tempValue = std::stoull(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + #else + if(Q_LIKELY(std::regex_match(string,isaunsignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return std::stoull(string); + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +int8_t stringtoint8(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + int tempValue; + try { + tempValue = std::stol(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(tempValue<=0x7F && tempValue>=-0x7F)) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #else + if(Q_LIKELY(std::regex_match(string,isasignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + const unsigned int &tempValue=std::stoi(string); + if(Q_LIKELY(tempValue<=0x7F)) + return tempValue; + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +int16_t stringtoint16(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + int tempValue; + try { + tempValue = std::stol(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(tempValue<=0x7FFF && tempValue>=-0x7FFF)) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #else + if(Q_LIKELY(std::regex_match(string,isasignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + const unsigned int &tempValue=std::stoi(string); + if(Q_LIKELY(tempValue<=0x7FFF)) + return tempValue; + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +int32_t stringtoint32(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + int32_t tempValue; + try { + tempValue = std::stol(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + #else + if(Q_LIKELY(std::regex_match(string,isasignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return std::stoi(string); + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +int64_t stringtoint64(const std::string &string,bool *ok) +{ + #ifdef __EXCEPTIONS + int64_t tempValue; + try { + tempValue = std::stoll(string); + } + catch(...) { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(Q_LIKELY(ok!=NULL)) + *ok=false; + return 0; + } + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return tempValue; + #else + if(Q_LIKELY(std::regex_match(string,isasignednumber))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return std::stoll(string); + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } + #endif +} + +float stringtofloat(const std::string &string,bool *ok) +{ + if(Q_LIKELY(std::regex_match(string,isadouble))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return std::stof(string); + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } +} + +double stringtodouble(const std::string &string,bool *ok) +{ + if(Q_LIKELY(std::regex_match(string,isadouble))) + { + if(Q_LIKELY(ok!=NULL)) + *ok=true; + return std::stod(string); + } + else + { + #ifdef CATCHCHALLENGER_EXTRA_CHECK + std::cerr << "Convertion failed and repported at " << __FILE__ << ":" << __LINE__ << std::endl; + #endif + if(ok!=NULL) + *ok=false; + return 0; + } +} diff --git a/interface/FacilityInterface.h b/interface/FacilityInterface.h new file mode 100644 index 0000000..f9b000d --- /dev/null +++ b/interface/FacilityInterface.h @@ -0,0 +1,44 @@ +/** \file FacilityInterface.h +\brief Define the class of the facility engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FACILITY_INTERFACE_H +#define FACILITY_INTERFACE_H + +#include +#include +#include + +#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 std::string sizeToString(const double &size) const = 0; + /// \brief convert size unit to String + virtual std::string sizeUnitToString(const Ultracopier::SizeUnit &sizeUnit) const = 0; + /// \brief translate the text + virtual std::string translateText(const std::string &text) const = 0; + /// \brief speed to string in byte per seconds + virtual std::string speedToString(const double &speed) const = 0; + /// \brief Decompose the time in second + virtual Ultracopier::TimeDecomposition secondsToTimeDecomposition(const uint32_t &seconds) const = 0; + /// \brief have the fonctionnality + virtual bool haveFunctionality(const std::string &fonctionnality) const = 0; + /// \brief call the fonctionnality + virtual std::string callFunctionality(const std::string &fonctionnality,const std::vector &args=std::vector()) = 0; + /// \brief Do the simplified time + virtual std::string simplifiedRemainingTime(const uint32_t &seconds) const = 0; + /// \brief Do the simplified time + virtual std::string ultimateUrl() const = 0; + /// \brief Return the software name + virtual std::string softwareName() const = 0; +}; + +#endif // FACILITY_INTERFACE_H diff --git a/interface/OptionInterface.h b/interface/OptionInterface.h new file mode 100644 index 0000000..034b49d --- /dev/null +++ b/interface/OptionInterface.h @@ -0,0 +1,36 @@ +/** \file OptionInterface.h +\brief Define the class of the option engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef OPTION_INTERFACE_H +#define OPTION_INTERFACE_H + +#include +#include +#include +#include + +#include "../StructEnumDefinition.h" + +/** \brief to pass the options to the plugin, the instance is created into Ultracopier from the class LocalPluginOptions() + * \see LocalPluginOptions() + * **/ +class OptionInterface : public QObject +{ + Q_OBJECT + public: + /// \brief To add option group to options + virtual bool addOptionGroup(const std::vector > &KeysList) = 0; + /*/// \brief To remove option group to options, removed to the load plugin + virtual bool removeOptionGroup() = 0;*/ + /// \brief To get option value + virtual std::string getOptionValue(const std::string &variableName) const = 0; + /// \brief To set option value + virtual void setOptionValue(const std::string &variableName,const std::string &value) = 0; + signals: + //void newOptionValue(std::string,std::string);-> 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 new file mode 100644 index 0000000..eb5b6bc --- /dev/null +++ b/interface/PluginInterface_CopyEngine.h @@ -0,0 +1,208 @@ +/** \file PluginInterface_CopyEngine.h +\brief Define the interface of the plugin of type: copy engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGININTERFACE_COPYENGINE_H +#define PLUGININTERFACE_COPYENGINE_H + +#include +#include +#include +#include + +#include "OptionInterface.h" +#include "FacilityInterface.h" +#include "../StructEnumDefinition.h" + +/** \brief To define the interface between Ultracopier and the copy engine + * This interface support: + * - Multiple transfer and multiple transfer progression + * - Only the copy mode (source as read only) + * - Only manipulation of folder, file, file + folder + * - Change on live file size + * - Speed is calculated by ultracopier in using the size \see getGeneralProgression() + * - Support speed limitation if the engine provide it, else inform Ultracopier + * - File/Folder can be added interactively or not + * - The collision and error is managed by the plug-in to have useful information (like preview, size, date, ...) + * **/ +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 std::vector &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 std::string &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 std::vector &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 std::vector &sources,const std::string &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 std::vector &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 std::vector &sources,const std::string &destination) = 0; + /** \brief send the new transfer list + * \param file the transfer list */ + virtual void newTransferList(const std::string &file) = 0; + + + /** \brief to get byte read, use by Ultracopier for the speed calculation + * real size transfered to right speed calculation */ + virtual uint64_t 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 uint64_t &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 std::vector &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 std::vector &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 std::vector &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 std::vector &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 std::vector &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 int64_t &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 std::string &path) const; + void isInPause(const bool &isInPause) const; + + void newActionOnList(const std::vector&) const;///very important, need be temporized to group the modification to do and not flood the interface + void doneTime(const std::vector >&) 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 std::vector &progressionList) const; + //get information about the copy + /** \brief to get the general progression + * first = current transfered byte, second = byte to transfer */ + void pushGeneralProgression(const uint64_t &,const uint64_t &) 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 std::string &path,const uint64_t &size,const uint64_t &mtime,const std::string &error) const; + void errorToRetry(const std::string &source,const std::string &destination,const std::string &error) const; + //for the extra logging + void rmPath(const std::string &path) const; + void mkPath(const std::string &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 std::string &writePath,const std::string &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 std::vector supportedProtocolsForTheSource() const = 0; + /// \brief to get the supported protocols for the destination + virtual std::vector 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 std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +}; + +Q_DECLARE_INTERFACE(PluginInterface_CopyEngineFactory,"first-world.info.ultracopier.PluginInterface.CopyEngineFactory/1.2.4.0"); + +#endif // PLUGININTERFACE_COPYENGINE_H diff --git a/interface/PluginInterface_Listener.h b/interface/PluginInterface_Listener.h new file mode 100644 index 0000000..61acb2f --- /dev/null +++ b/interface/PluginInterface_Listener.h @@ -0,0 +1,56 @@ +/** \file PluginInterface_Listener.h +\brief Define the interface of the plugin of type: listener +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGININTERFACE_LISTENER_H +#define PLUGININTERFACE_LISTENER_H + +#include +#include +#include + +#include "OptionInterface.h" + +#include "../StructEnumDefinition.h" + +/** \brief To define the interface between Ultracopier and the listener + * */ +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 std::string errorString() const = 0; + /// \brief set the resources for the plugin + virtual void setResources(OptionInterface * options,const std::string &writePath,const std::string &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 std::vector clientsList() const = 0; + public slots: + /// \brief send when copy is finished + virtual void transferFinished(const uint32_t &orderId,const bool &withError) = 0; + /// \brief send when copy is canceled + virtual void transferCanceled(const uint32_t &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 uint32_t &orderId,const std::vector &sources) const; + void newCopy(const uint32_t &orderId,const std::vector &sources,const std::string &destination) const; + void newMoveWithoutDestination(const uint32_t &orderId,const std::vector &sources) const; + void newMove(const uint32_t &orderId,const std::vector &sources,const std::string &destination) const; + void error(const std::string &error) const; + void newClientList() const; + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +}; + +Q_DECLARE_INTERFACE(PluginInterface_Listener,"first-world.info.ultracopier.PluginInterface.Listener/1.2.4.0"); + +#endif // PLUGININTERFACE_LISTENER_H diff --git a/interface/PluginInterface_PluginLoader.h b/interface/PluginInterface_PluginLoader.h new file mode 100644 index 0000000..c702003 --- /dev/null +++ b/interface/PluginInterface_PluginLoader.h @@ -0,0 +1,39 @@ +/** \file PluginInterface_PluginLoader.h +\brief Define the interface of the plugin of type: plugin loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGININTERFACE_PLUGINLOADER_H +#define PLUGININTERFACE_PLUGINLOADER_H + +#include + +#include "OptionInterface.h" + +#include "../StructEnumDefinition.h" + +/** \brief To define the interface between Ultracopier and the plugin loader + * */ +class PluginInterface_PluginLoader : public QObject +{ + 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 std::string &writePath,const std::string &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 std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +}; + +Q_DECLARE_INTERFACE(PluginInterface_PluginLoader,"first-world.info.ultracopier.PluginInterface.PluginLoader/1.2.4.0"); + +#endif // PLUGININTERFACE_PLUGINLOADER_H diff --git a/interface/PluginInterface_SessionLoader.h b/interface/PluginInterface_SessionLoader.h new file mode 100644 index 0000000..d0cd366 --- /dev/null +++ b/interface/PluginInterface_SessionLoader.h @@ -0,0 +1,39 @@ +/** \file PluginInterface_SessionLoader.h +\brief Define the interface of the plugin of type: session loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGININTERFACE_SESSIONLOADER_H +#define PLUGININTERFACE_SESSIONLOADER_H + +#include + +#include "OptionInterface.h" + +#include "../StructEnumDefinition.h" + +/** \brief To define the interface between Ultracopier and the session loader + * */ +class PluginInterface_SessionLoader : public QObject +{ + 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 std::string &writePath,const std::string &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 std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +}; + +Q_DECLARE_INTERFACE(PluginInterface_SessionLoader,"first-world.info.ultracopier.PluginInterface.SessionLoader/1.2.4.0"); + +#endif // PLUGININTERFACE_SESSIONLOADER_H diff --git a/interface/PluginInterface_Themes.h b/interface/PluginInterface_Themes.h new file mode 100644 index 0000000..7272c79 --- /dev/null +++ b/interface/PluginInterface_Themes.h @@ -0,0 +1,115 @@ +/** \file PluginInterface_Themes.h +\brief Define the interface of the plugin of type: copy engine +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef PLUGININTERFACE_THEMES_H +#define PLUGININTERFACE_THEMES_H + +#include +#include +#include +#include +#include +#include + +#include "OptionInterface.h" +#include "FacilityInterface.h" +#include "../StructEnumDefinition.h" + +/** \brief To define the interface between Ultracopier and the interface + * */ +class PluginInterface_Themes : public QWidget +{ + 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 std::string &path) = 0; + /** \brief show the detected speed + * in byte per seconds */ + virtual void detectedSpeed(const uint64_t &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 std::string &source,const std::string &destination,const std::string &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 std::vector &returnActions) = 0; + /// \brief show the general progression + virtual void setGeneralProgression(const uint64_t ¤t,const uint64_t &total) = 0; + /// \brief show the file progression + virtual void setFileProgression(const std::vector &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 std::vector &ids) const; + void moveItemsOnTop(const std::vector &ids) const; + void moveItemsUp(const std::vector &ids) const; + void moveItemsDown(const std::vector &ids) const; + void moveItemsOnBottom(const std::vector &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 std::vector &urls) const; + //action on the copy + void pause() const; + void resume() const; + void skip(const uint64_t &id) const; + void cancel() const; + //edit the action + void newSpeedLimitation(const uint64_t &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 std::string &writePath,const std::string &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 std::string &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 std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +}; + +Q_DECLARE_INTERFACE(PluginInterface_ThemesFactory,"first-world.info.ultracopier.PluginInterface.ThemesFactory/1.2.4.0"); + +#endif // PLUGININTERFACE_THEMES_H diff --git a/lib/qt-tar-xz/QTarDecode.cpp b/lib/qt-tar-xz/QTarDecode.cpp new file mode 100644 index 0000000..10c38ca --- /dev/null +++ b/lib/qt-tar-xz/QTarDecode.cpp @@ -0,0 +1,174 @@ +/** \file QTarDecode.cpp +\brief To read a tar data block +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "QTarDecode.h" + +#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="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; +} + +void QTarDecode::setErrorString(const std::string &error) +{ + this->error=error; + fileList.clear(); + dataList.clear(); +} + +bool QTarDecode::stringStartWith(std::string const &fullString, std::string const &starting) +{ + if (fullString.length() >= starting.length()) { + return (fullString.substr(0,starting.length())==starting); + } else { + return false; + } +} + +bool QTarDecode::decodeData(const std::vector &data) +{ + 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; +} + +std::vector QTarDecode::getFileList() +{ + return fileList; +} + +std::vector > QTarDecode::getDataList() +{ + return dataList; +} + + diff --git a/lib/qt-tar-xz/QTarDecode.h b/lib/qt-tar-xz/QTarDecode.h new file mode 100644 index 0000000..b37dc0e --- /dev/null +++ b/lib/qt-tar-xz/QTarDecode.h @@ -0,0 +1,36 @@ +/** \file QTarDecode.h +\brief To read a tar data block +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef QTARDECODE_H +#define QTARDECODE_H + +#include +#include +#include + +/// \brief read the raw tar data, and organize it into data structure +class QTarDecode +{ + 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 new file mode 100644 index 0000000..005ce10 --- /dev/null +++ b/lib/qt-tar-xz/QXzDecode.cpp @@ -0,0 +1,146 @@ +/** \file QXzDecode.cpp +\brief To decompress a xz stream +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "QXzDecode.h" +#include +extern "C" { +#include "xz.h" +} + +static uint8_t in[BUFSIZ]; +static uint8_t out[BUFSIZ]; + +QXzDecode::QXzDecode(QByteArray data,quint64 maxSize) +{ + error="Unknow error"; + this->data=data; + this->maxSize=maxSize; + isDecoded=false; +} + +bool QXzDecode::decodeStream(QDataStream *stream_xz_decode_in,QDataStream *stream_xz_decode_out) +{ + isDecoded=false; + struct xz_buf b; + struct xz_dec *s; + enum xz_ret ret; + + xz_crc32_init(); + + /* + * Support up to 64 MiB dictionary. The actually needed memory + * is allocated once the headers have been parsed. + */ + s = xz_dec_init(XZ_DYNALLOC, 1 << 26); + if (s == NULL) { + error=tr("Memory allocation failed"); + xz_dec_end(s); + return isDecoded; + } + + b.in = in; + b.in_pos = 0; + b.in_size = 0; + b.out = out; + b.out_pos = 0; + b.out_size = BUFSIZ; + + while (true) { + //input of data + if (b.in_pos == b.in_size) { + b.in_size = stream_xz_decode_in->readRawData((char *)in,sizeof(in)); + b.in_pos = 0; + } + + ret = xz_dec_run(s, &b); + + //output of data + if (b.out_pos == sizeof(out)) + { + if (static_cast(stream_xz_decode_out->writeRawData((char *)out,static_cast(b.out_pos))) != b.out_pos) + { + error=tr("Write error"); + xz_dec_end(s); + return isDecoded; + } + b.out_pos = 0; + } + + if (ret == XZ_OK) + continue; + +#ifdef XZ_DEC_ANY_CHECK + if (ret == XZ_UNSUPPORTED_CHECK) { + continue; + } +#endif + + if (static_cast(stream_xz_decode_out->writeRawData((char *)out,static_cast(b.out_pos))) != b.out_pos) + { + error=tr("Write error"); + xz_dec_end(s); + return isDecoded; + } + + switch (ret) { + case XZ_STREAM_END: + xz_dec_end(s); + isDecoded=true; + return isDecoded; + case XZ_MEM_ERROR: + error=tr("Memory allocation failed"); + xz_dec_end(s); + return isDecoded; + case XZ_MEMLIMIT_ERROR: + error=tr("Memory usage limit reached"); + xz_dec_end(s); + return isDecoded; + case XZ_FORMAT_ERROR: + error=tr("Not a .xz file"); + xz_dec_end(s); + return isDecoded; + case XZ_OPTIONS_ERROR: + error=tr("Unsupported options in the .xz headers"); + xz_dec_end(s); + return isDecoded; + case XZ_DATA_ERROR: + case XZ_BUF_ERROR: + error=tr("The file is corrupted"); + xz_dec_end(s); + return isDecoded; + default: + error=tr("Bug!"); + xz_dec_end(s); + return isDecoded; + } + } +} + +bool QXzDecode::decode() +{ + if(data.size() < 32) // check the minimal size + error=tr("The input data is too short"); + QByteArray outputData; + QDataStream stream_xz_decode_in(&data,QIODevice::ReadOnly); + QDataStream stream_xz_decode_out(&outputData,QIODevice::WriteOnly); + int returnVal=decodeStream(&stream_xz_decode_in,&stream_xz_decode_out); + data=outputData; + return returnVal; +} + +QByteArray QXzDecode::decodedData() +{ + if(isDecoded) + return data; + else + return QByteArray(); +} + +QString QXzDecode::errorString() +{ + return error; +} + + diff --git a/lib/qt-tar-xz/QXzDecode.h b/lib/qt-tar-xz/QXzDecode.h new file mode 100644 index 0000000..85cb04e --- /dev/null +++ b/lib/qt-tar-xz/QXzDecode.h @@ -0,0 +1,40 @@ +/** \file QXzDecode.h +\brief To decompress a xz stream +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef QXZDECODE_H +#define QXZDECODE_H + +#include +#include +#include + +//comment this to check integrity of compressed file, compressed via: xz --check=crc32 YourFile +//#define XZ_DEC_ANY_CHECK + +/// \brief The decode class for the xz stream +class QXzDecode : public QObject +{ + public: + /** \brief create the object to decode it + * \param data the compressed data + * \param maxSize the max size + * **/ + QXzDecode(QByteArray data,quint64 maxSize=0); + /// \brief lunch the decode + bool decode(); + /// \brief the error string + QString errorString(); + /// \brief the un-compressed data + QByteArray decodedData(); + /// \brief un-compress the data by stream + bool decodeStream(QDataStream *stream_xz_decode_in,QDataStream *stream_xz_decode_out); + private: + QByteArray data; + QString error; + bool isDecoded; + quint64 maxSize; +}; + +#endif // QXZDECODE_H diff --git a/lib/qt-tar-xz/QXzDecodeThread.cpp b/lib/qt-tar-xz/QXzDecodeThread.cpp new file mode 100644 index 0000000..5e7f755 --- /dev/null +++ b/lib/qt-tar-xz/QXzDecodeThread.cpp @@ -0,0 +1,48 @@ +/** \file QXzDecodeThread.cpp +\brief To have thread to decode the data +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#include "QXzDecodeThread.h" + +QXzDecodeThread::QXzDecodeThread() +{ + moveToThread(this); + DataToDecode=NULL; + error=false; +} + +QXzDecodeThread::~QXzDecodeThread() +{ + if(DataToDecode!=NULL) + delete DataToDecode; +} + +void QXzDecodeThread::setData(QByteArray data,quint64 maxSize) +{ + if(DataToDecode!=NULL) + delete DataToDecode; + DataToDecode=new QXzDecode(data,maxSize); +} + +bool QXzDecodeThread::errorFound() +{ + return error; +} + +QString QXzDecodeThread::errorString() +{ + return DataToDecode->errorString(); +} + +QByteArray QXzDecodeThread::decodedData() +{ + return DataToDecode->decodedData(); +} + +void QXzDecodeThread::run() +{ + error=!DataToDecode->decode(); + emit decodedIsFinish(); +} + diff --git a/lib/qt-tar-xz/QXzDecodeThread.h b/lib/qt-tar-xz/QXzDecodeThread.h new file mode 100644 index 0000000..1b69e4a --- /dev/null +++ b/lib/qt-tar-xz/QXzDecodeThread.h @@ -0,0 +1,37 @@ +/** \file QXzDecodeThread.h +\brief To have thread to decode the data +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef QXZDECODETHREAD_H +#define QXZDECODETHREAD_H + +#include +#include "QXzDecode.h" + +/// \brief to decode the xz via a thread +class QXzDecodeThread : public QThread +{ + Q_OBJECT + public: + QXzDecodeThread(); + ~QXzDecodeThread(); + /// \brief to return if the error have been found + bool errorFound(); + /// \brief to return the error string + QString errorString(); + /// \brief to get the decoded data + QByteArray decodedData(); + /// \brief to send the data + void setData(QByteArray data,quint64 maxSize=0); + protected: + void run(); + private: + /// \brief to have temporary storage + QXzDecode *DataToDecode; + bool error; + signals: + void decodedIsFinish(); +}; + +#endif // QXZDECODETHREAD_H diff --git a/lib/qt-tar-xz/xz.h b/lib/qt-tar-xz/xz.h new file mode 100644 index 0000000..470f6df --- /dev/null +++ b/lib/qt-tar-xz/xz.h @@ -0,0 +1,273 @@ +/* + * XZ decompressor + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#define XZ_DEC_ANY_CHECK + +#ifndef XZ_H +#define XZ_H + +#ifdef __KERNEL__ +# include +# include +#else +# include +# include +#endif + +/* In Linux, this is used to make extern functions static when needed. */ +#ifndef XZ_EXTERN +# define XZ_EXTERN extern +#endif + +/* In Linux, this is used to mark the functions with __init when needed. */ +#ifndef XZ_FUNC +# define XZ_FUNC +#endif + +/** + * enum xz_mode - Operation mode + * + * @XZ_SINGLE: Single-call mode. This uses less RAM than + * than multi-call modes, because the LZMA2 + * dictionary doesn't need to be allocated as + * part of the decoder state. All required data + * structures are allocated at initialization, + * so xz_dec_run() cannot return XZ_MEM_ERROR. + * @XZ_PREALLOC: Multi-call mode with preallocated LZMA2 + * dictionary buffer. All data structures are + * allocated at initialization, so xz_dec_run() + * cannot return XZ_MEM_ERROR. + * @XZ_DYNALLOC: Multi-call mode. The LZMA2 dictionary is + * allocated once the required size has been + * parsed from the stream headers. If the + * allocation fails, xz_dec_run() will return + * XZ_MEM_ERROR. + * + * It is possible to enable support only for a subset of the above + * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC, + * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled + * with support for all operation modes, but the preboot code may + * be built with fewer features to minimize code size. + */ +enum xz_mode { + XZ_SINGLE, + XZ_PREALLOC, + XZ_DYNALLOC +}; + +/** + * enum xz_ret - Return codes + * @XZ_OK: Everything is OK so far. More input or more + * output space is required to continue. This + * return code is possible only in multi-call mode + * (XZ_PREALLOC or XZ_DYNALLOC). + * @XZ_STREAM_END: Operation finished successfully. + * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding + * is still possible in multi-call mode by simply + * calling xz_dec_run() again. + * NOTE: This return value is used only if + * XZ_DEC_ANY_CHECK was defined at build time, + * which is not used in the kernel. Unsupported + * check types return XZ_OPTIONS_ERROR if + * XZ_DEC_ANY_CHECK was not defined at build time. + * @XZ_MEM_ERROR: Allocating memory failed. This return code is + * possible only if the decoder was initialized + * with XZ_DYNALLOC. The amount of memory that was + * tried to be allocated was no more than the + * dict_max argument given to xz_dec_init(). + * @XZ_MEMLIMIT_ERROR: A bigger LZMA2 dictionary would be needed than + * allowed by the dict_max argument given to + * xz_dec_init(). This return value is possible + * only in multi-call mode (XZ_PREALLOC or + * XZ_DYNALLOC); the single-call mode (XZ_SINGLE) + * ignores the dict_max argument. + * @XZ_FORMAT_ERROR: File format was not recognized (wrong magic + * bytes). + * @XZ_OPTIONS_ERROR: This implementation doesn't support the requested + * compression options. In the decoder this means + * that the header CRC32 matches, but the header + * itself specifies something that we don't support. + * @XZ_DATA_ERROR: Compressed data is corrupt. + * @XZ_BUF_ERROR: Cannot make any progress. Details are slightly + * different between multi-call and single-call + * mode; more information below. + * + * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls + * to XZ code cannot consume any input and cannot produce any new output. + * This happens when there is no new input available, or the output buffer + * is full while at least one output byte is still pending. Assuming your + * code is not buggy, you can get this error only when decoding a compressed + * stream that is truncated or otherwise corrupt. + * + * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer + * is too small, or the compressed input is corrupt in a way that makes the + * decoder produce more output than the caller expected. When it is + * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR + * is used instead of XZ_BUF_ERROR. + */ +enum xz_ret { + XZ_OK, + XZ_STREAM_END, + XZ_UNSUPPORTED_CHECK, + XZ_MEM_ERROR, + XZ_MEMLIMIT_ERROR, + XZ_FORMAT_ERROR, + XZ_OPTIONS_ERROR, + XZ_DATA_ERROR, + XZ_BUF_ERROR +}; + +/** + * struct xz_buf - Passing input and output buffers to XZ code + * @in: Beginning of the input buffer. This may be NULL if and only + * if in_pos is equal to in_size. + * @in_pos: Current position in the input buffer. This must not exceed + * in_size. + * @in_size: Size of the input buffer + * @out: Beginning of the output buffer. This may be NULL if and only + * if out_pos is equal to out_size. + * @out_pos: Current position in the output buffer. This must not exceed + * out_size. + * @out_size: Size of the output buffer + * + * Only the contents of the output buffer from out[out_pos] onward, and + * the variables in_pos and out_pos are modified by the XZ code. + */ +struct xz_buf { + const uint8_t *in; + size_t in_pos; + size_t in_size; + + uint8_t *out; + size_t out_pos; + size_t out_size; +}; + +/** + * struct xz_dec - Opaque type to hold the XZ decoder state + */ +struct xz_dec; + +/** + * xz_dec_init() - Allocate and initialize a XZ decoder state + * @mode: Operation mode + * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for + * multi-call decoding. This is ignored in single-call mode + * (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes + * or 2^n + 2^(n-1) bytes (the latter sizes are less common + * in practice), so other values for dict_max don't make sense. + * In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB, + * 512 KiB, and 1 MiB are probably the only reasonable values, + * except for kernel and initramfs images where a bigger + * dictionary can be fine and useful. + * + * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at + * once. The caller must provide enough output space or the decoding will + * fail. The output space is used as the dictionary buffer, which is why + * there is no need to allocate the dictionary as part of the decoder's + * internal state. + * + * Because the output buffer is used as the workspace, streams encoded using + * a big dictionary are not a problem in single-call mode. It is enough that + * the output buffer is big enough to hold the actual uncompressed data; it + * can be smaller than the dictionary size stored in the stream headers. + * + * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes + * of memory is preallocated for the LZMA2 dictionary. This way there is no + * risk that xz_dec_run() could run out of memory, since xz_dec_run() will + * never allocate any memory. Instead, if the preallocated dictionary is too + * small for decoding the given input stream, xz_dec_run() will return + * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be + * decoded to avoid allocating excessive amount of memory for the dictionary. + * + * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC): + * dict_max specifies the maximum allowed dictionary size that xz_dec_run() + * may allocate once it has parsed the dictionary size from the stream + * headers. This way excessive allocations can be avoided while still + * limiting the maximum memory usage to a sane value to prevent running the + * system out of memory when decompressing streams from untrusted sources. + * + * On success, xz_dec_init() returns a pointer to struct xz_dec, which is + * ready to be used with xz_dec_run(). If memory allocation fails, + * xz_dec_init() returns NULL. + */ +XZ_EXTERN struct xz_dec * XZ_FUNC xz_dec_init( + enum xz_mode mode, uint32_t dict_max); + +/** + * xz_dec_run() - Run the XZ decoder + * @s: Decoder state allocated using xz_dec_init() + * @b: Input and output buffers + * + * The possible return values depend on build options and operation mode. + * See enum xz_ret for details. + * + * NOTE: If an error occurs in single-call mode (return value is not + * XZ_STREAM_END), b->in_pos and b->out_pos are not modified, and the + * contents of the output buffer from b->out[b->out_pos] onward are + * undefined. This is true even after XZ_BUF_ERROR, because with some filter + * chains, there may be a second pass over the output buffer, and this pass + * cannot be properly done if the output buffer is truncated. Thus, you + * cannot give the single-call decoder a too small buffer and then expect to + * get that amount valid data from the beginning of the stream. You must use + * the multi-call decoder if you don't want to uncompress the whole stream. + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_run(struct xz_dec *s, struct xz_buf *b); + +/** + * xz_dec_reset() - Reset an already allocated decoder state + * @s: Decoder state allocated using xz_dec_init() + * + * This function can be used to reset the multi-call decoder state without + * freeing and reallocating memory with xz_dec_end() and xz_dec_init(). + * + * In single-call mode, xz_dec_reset() is always called in the beginning of + * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in + * multi-call mode. + */ +XZ_EXTERN void XZ_FUNC xz_dec_reset(struct xz_dec *s); + +/** + * xz_dec_end() - Free the memory allocated for the decoder state + * @s: Decoder state allocated using xz_dec_init(). If s is NULL, + * this function does nothing. + */ +XZ_EXTERN void XZ_FUNC xz_dec_end(struct xz_dec *s); + +/* + * Standalone build (userspace build or in-kernel build for boot time use) + * needs a CRC32 implementation. For normal in-kernel use, kernel's own + * CRC32 module is used instead, and users of this module don't need to + * care about the functions below. + */ +#ifndef XZ_INTERNAL_CRC32 +# ifdef __KERNEL__ +# define XZ_INTERNAL_CRC32 0 +# else +# define XZ_INTERNAL_CRC32 1 +# endif +#endif + +#if XZ_INTERNAL_CRC32 +/* + * This must be called before any other xz_* function to initialize + * the CRC32 lookup table. + */ +XZ_EXTERN void XZ_FUNC xz_crc32_init(void); + +/* + * Update CRC32 value using the polynomial from IEEE-802.3. To start a new + * calculation, the third argument must be zero. To continue the calculation, + * the previously returned value is passed as the third argument. + */ +XZ_EXTERN uint32_t XZ_FUNC xz_crc32( + const uint8_t *buf, size_t size, uint32_t crc); +#endif +#endif diff --git a/lib/qt-tar-xz/xz_config.h b/lib/qt-tar-xz/xz_config.h new file mode 100644 index 0000000..9d714f3 --- /dev/null +++ b/lib/qt-tar-xz/xz_config.h @@ -0,0 +1,123 @@ +/* + * Private includes and definitions for userspace use of XZ Embedded + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef XZ_CONFIG_H +#define XZ_CONFIG_H + +/* Uncomment as needed to enable BCJ filter decoders. */ +/* #define XZ_DEC_X86 */ +/* #define XZ_DEC_POWERPC */ +/* #define XZ_DEC_IA64 */ +/* #define XZ_DEC_ARM */ +/* #define XZ_DEC_ARMTHUMB */ +/* #define XZ_DEC_SPARC */ + +#include +#include +#include + +#include "xz.h" + +#define kmalloc(size, flags) malloc(size) +#define kfree(ptr) free(ptr) +#define vmalloc(size) malloc(size) +#define vfree(ptr) free(ptr) + +#define memeq(a, b, size) (memcmp(a, b, size) == 0) +#define memzero(buf, size) memset(buf, 0, size) + +#ifndef min +# define min(x, y) ((x) < (y) ? (x) : (y)) +#endif +#define min_t(type, x, y) min(x, y) + +/* + * Some functions have been marked with __always_inline to keep the + * performance reasonable even when the compiler is optimizing for + * small code size. You may be able to save a few bytes by #defining + * __always_inline to plain inline, but don't complain if the code + * becomes slow. + * + * NOTE: System headers on GNU/Linux may #define this macro already, + * so if you want to change it, you need to #undef it first. + */ +#ifndef __always_inline +# ifdef __GNUC__ +# define __always_inline \ + inline __attribute__((__always_inline__)) +# else +# define __always_inline inline +# endif +#endif + +/* + * Some functions are marked to never be inlined to reduce stack usage. + * If you don't care about stack usage, you may want to modify this so + * that noinline_for_stack is #defined to be empty even when using GCC. + * Doing so may save a few bytes in binary size. + */ +#ifndef noinline_for_stack +# ifdef __GNUC__ +# define noinline_for_stack __attribute__((__noinline__)) +# else +# define noinline_for_stack +# endif +#endif + +/* Inline functions to access unaligned unsigned 32-bit integers */ +#ifndef get_unaligned_le32 +static inline uint32_t XZ_FUNC get_unaligned_le32(const uint8_t *buf) +{ + return (uint32_t)buf[0] + | ((uint32_t)buf[1] << 8) + | ((uint32_t)buf[2] << 16) + | ((uint32_t)buf[3] << 24); +} +#endif + +#ifndef get_unaligned_be32 +static inline uint32_t XZ_FUNC get_unaligned_be32(const uint8_t *buf) +{ + return (uint32_t)(buf[0] << 24) + | ((uint32_t)buf[1] << 16) + | ((uint32_t)buf[2] << 8) + | (uint32_t)buf[3]; +} +#endif + +#ifndef put_unaligned_le32 +static inline void XZ_FUNC put_unaligned_le32(uint32_t val, uint8_t *buf) +{ + buf[0] = (uint8_t)val; + buf[1] = (uint8_t)(val >> 8); + buf[2] = (uint8_t)(val >> 16); + buf[3] = (uint8_t)(val >> 24); +} +#endif + +#ifndef put_unaligned_be32 +static inline void XZ_FUNC put_unaligned_be32(uint32_t val, uint8_t *buf) +{ + buf[0] = (uint8_t)(val >> 24); + buf[1] = (uint8_t)(val >> 16); + buf[2] = (uint8_t)(val >> 8); + buf[3] = (uint8_t)val; +} +#endif + +/* + * Use get_unaligned_le32() also for aligned access for simplicity. On + * little endian systems, #define get_le32(ptr) (*(const uint32_t *)(ptr)) + * could save a few bytes in code size. + */ +#ifndef get_le32 +# define get_le32 get_unaligned_le32 +#endif + +#endif diff --git a/lib/qt-tar-xz/xz_crc32.c b/lib/qt-tar-xz/xz_crc32.c new file mode 100644 index 0000000..eea7b33 --- /dev/null +++ b/lib/qt-tar-xz/xz_crc32.c @@ -0,0 +1,52 @@ +/* + * CRC32 using the polynomial from IEEE-802.3 + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +/* + * This is not the fastest implementation, but it is pretty compact. + * The fastest versions of xz_crc32() on modern CPUs without hardware + * accelerated CRC instruction are 3-5 times as fast as this version, + * but they are bigger and use more memory for the lookup table. + */ + +#include "xz_private.h" + +static uint32_t xz_crc32_table[256]; + +XZ_EXTERN void XZ_FUNC xz_crc32_init(void) +{ + const uint32_t poly = 0xEDB88320; + + uint32_t i; + uint32_t j; + uint32_t r; + + for (i = 0; i < 256; ++i) { + r = i; + for (j = 0; j < 8; ++j) + r = (r >> 1) ^ (poly & ~((r & 1) - 1)); + + xz_crc32_table[i] = r; + } + + return; +} + +XZ_EXTERN uint32_t XZ_FUNC xz_crc32( + const uint8_t *buf, size_t size, uint32_t crc) +{ + crc = ~crc; + + while (size != 0) { + crc = xz_crc32_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); + --size; + } + + return ~crc; +} diff --git a/lib/qt-tar-xz/xz_dec_bcj.c b/lib/qt-tar-xz/xz_dec_bcj.c new file mode 100644 index 0000000..09162b5 --- /dev/null +++ b/lib/qt-tar-xz/xz_dec_bcj.c @@ -0,0 +1,564 @@ +/* + * Branch/Call/Jump (BCJ) filter decoders + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#include "xz_private.h" + +/* + * The rest of the file is inside this ifdef. It makes things a little more + * convenient when building without support for any BCJ filters. + */ +#ifdef XZ_DEC_BCJ + +struct xz_dec_bcj { + /* Type of the BCJ filter being used */ + enum { + BCJ_X86 = 4, /* x86 or x86-64 */ + BCJ_POWERPC = 5, /* Big endian only */ + BCJ_IA64 = 6, /* Big or little endian */ + BCJ_ARM = 7, /* Little endian only */ + BCJ_ARMTHUMB = 8, /* Little endian only */ + BCJ_SPARC = 9 /* Big or little endian */ + } type; + + /* + * Return value of the next filter in the chain. We need to preserve + * this information across calls, because we must not call the next + * filter anymore once it has returned XZ_STREAM_END. + */ + enum xz_ret ret; + + /* True if we are operating in single-call mode. */ + bool single_call; + + /* + * Absolute position relative to the beginning of the uncompressed + * data (in a single .xz Block). We care only about the lowest 32 + * bits so this doesn't need to be uint64_t even with big files. + */ + uint32_t pos; + + /* x86 filter state */ + uint32_t x86_prev_mask; + + /* Temporary space to hold the variables from struct xz_buf */ + uint8_t *out; + size_t out_pos; + size_t out_size; + + struct { + /* Amount of already filtered data in the beginning of buf */ + size_t filtered; + + /* Total amount of data currently stored in buf */ + size_t size; + + /* + * Buffer to hold a mix of filtered and unfiltered data. This + * needs to be big enough to hold Alignment + 2 * Look-ahead: + * + * Type Alignment Look-ahead + * x86 1 4 + * PowerPC 4 0 + * IA-64 16 0 + * ARM 4 0 + * ARM-Thumb 2 2 + * SPARC 4 0 + */ + uint8_t buf[16]; + } temp; +}; + +#ifdef XZ_DEC_X86 +/* + * This is macro used to test the most significant byte of a memory address + * in an x86 instruction. + */ +#define bcj_x86_test_msbyte(b) ((b) == 0x00 || (b) == 0xFF) + +static noinline_for_stack size_t XZ_FUNC bcj_x86( + struct xz_dec_bcj *s, uint8_t *buf, size_t size) +{ + static const bool mask_to_allowed_status[8] + = { true, true, true, false, true, false, false, false }; + + static const uint8_t mask_to_bit_num[8] = { 0, 1, 2, 2, 3, 3, 3, 3 }; + + size_t i; + size_t prev_pos = (size_t)-1; + uint32_t prev_mask = s->x86_prev_mask; + uint32_t src; + uint32_t dest; + uint32_t j; + uint8_t b; + + if (size <= 4) + return 0; + + size -= 4; + for (i = 0; i < size; ++i) { + if ((buf[i] & 0xFE) != 0xE8) + continue; + + prev_pos = i - prev_pos; + if (prev_pos > 3) { + prev_mask = 0; + } else { + prev_mask = (prev_mask << (prev_pos - 1)) & 7; + if (prev_mask != 0) { + b = buf[i + 4 - mask_to_bit_num[prev_mask]]; + if (!mask_to_allowed_status[prev_mask] + || bcj_x86_test_msbyte(b)) { + prev_pos = i; + prev_mask = (prev_mask << 1) | 1; + continue; + } + } + } + + prev_pos = i; + + if (bcj_x86_test_msbyte(buf[i + 4])) { + src = get_unaligned_le32(buf + i + 1); + while (true) { + dest = src - (s->pos + (uint32_t)i + 5); + if (prev_mask == 0) + break; + + j = mask_to_bit_num[prev_mask] * 8; + b = (uint8_t)(dest >> (24 - j)); + if (!bcj_x86_test_msbyte(b)) + break; + + src = dest ^ (((uint32_t)1 << (32 - j)) - 1); + } + + dest &= 0x01FFFFFF; + dest |= (uint32_t)0 - (dest & 0x01000000); + put_unaligned_le32(dest, buf + i + 1); + i += 4; + } else { + prev_mask = (prev_mask << 1) | 1; + } + } + + prev_pos = i - prev_pos; + s->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1); + return i; +} +#endif + +#ifdef XZ_DEC_POWERPC +static noinline_for_stack size_t XZ_FUNC bcj_powerpc( + struct xz_dec_bcj *s, uint8_t *buf, size_t size) +{ + size_t i; + uint32_t instr; + + for (i = 0; i + 4 <= size; i += 4) { + instr = get_unaligned_be32(buf + i); + if ((instr & 0xFC000003) == 0x48000001) { + instr &= 0x03FFFFFC; + instr -= s->pos + (uint32_t)i; + instr &= 0x03FFFFFC; + instr |= 0x48000001; + put_unaligned_be32(instr, buf + i); + } + } + + return i; +} +#endif + +#ifdef XZ_DEC_IA64 +static noinline_for_stack size_t XZ_FUNC bcj_ia64( + struct xz_dec_bcj *s, uint8_t *buf, size_t size) +{ + static const uint8_t branch_table[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 6, 6, 0, 0, 7, 7, + 4, 4, 0, 0, 4, 4, 0, 0 + }; + + /* + * The local variables take a little bit stack space, but it's less + * than what LZMA2 decoder takes, so it doesn't make sense to reduce + * stack usage here without doing that for the LZMA2 decoder too. + */ + + /* Loop counters */ + size_t i; + size_t j; + + /* Instruction slot (0, 1, or 2) in the 128-bit instruction word */ + uint32_t slot; + + /* Bitwise offset of the instruction indicated by slot */ + uint32_t bit_pos; + + /* bit_pos split into byte and bit parts */ + uint32_t byte_pos; + uint32_t bit_res; + + /* Address part of an instruction */ + uint32_t addr; + + /* Mask used to detect which instructions to convert */ + uint32_t mask; + + /* 41-bit instruction stored somewhere in the lowest 48 bits */ + uint64_t instr; + + /* Instruction normalized with bit_res for easier manipulation */ + uint64_t norm; + + for (i = 0; i + 16 <= size; i += 16) { + mask = branch_table[buf[i] & 0x1F]; + for (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) { + if (((mask >> slot) & 1) == 0) + continue; + + byte_pos = bit_pos >> 3; + bit_res = bit_pos & 7; + instr = 0; + for (j = 0; j < 6; ++j) + instr |= (uint64_t)(buf[i + j + byte_pos]) + << (8 * j); + + norm = instr >> bit_res; + + if (((norm >> 37) & 0x0F) == 0x05 + && ((norm >> 9) & 0x07) == 0) { + addr = (norm >> 13) & 0x0FFFFF; + addr |= ((uint32_t)(norm >> 36) & 1) << 20; + addr <<= 4; + addr -= s->pos + (uint32_t)i; + addr >>= 4; + + norm &= ~((uint64_t)0x8FFFFF << 13); + norm |= (uint64_t)(addr & 0x0FFFFF) << 13; + norm |= (uint64_t)(addr & 0x100000) + << (36 - 20); + + instr &= (1 << bit_res) - 1; + instr |= norm << bit_res; + + for (j = 0; j < 6; j++) + buf[i + j + byte_pos] + = (uint8_t)(instr >> (8 * j)); + } + } + } + + return i; +} +#endif + +#ifdef XZ_DEC_ARM +static noinline_for_stack size_t XZ_FUNC bcj_arm( + struct xz_dec_bcj *s, uint8_t *buf, size_t size) +{ + size_t i; + uint32_t addr; + + for (i = 0; i + 4 <= size; i += 4) { + if (buf[i + 3] == 0xEB) { + addr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8) + | ((uint32_t)buf[i + 2] << 16); + addr <<= 2; + addr -= s->pos + (uint32_t)i + 8; + addr >>= 2; + buf[i] = (uint8_t)addr; + buf[i + 1] = (uint8_t)(addr >> 8); + buf[i + 2] = (uint8_t)(addr >> 16); + } + } + + return i; +} +#endif + +#ifdef XZ_DEC_ARMTHUMB +static noinline_for_stack size_t XZ_FUNC bcj_armthumb( + struct xz_dec_bcj *s, uint8_t *buf, size_t size) +{ + size_t i; + uint32_t addr; + + for (i = 0; i + 4 <= size; i += 2) { + if ((buf[i + 1] & 0xF8) == 0xF0 + && (buf[i + 3] & 0xF8) == 0xF8) { + addr = (((uint32_t)buf[i + 1] & 0x07) << 19) + | ((uint32_t)buf[i] << 11) + | (((uint32_t)buf[i + 3] & 0x07) << 8) + | (uint32_t)buf[i + 2]; + addr <<= 1; + addr -= s->pos + (uint32_t)i + 4; + addr >>= 1; + buf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07)); + buf[i] = (uint8_t)(addr >> 11); + buf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07)); + buf[i + 2] = (uint8_t)addr; + i += 2; + } + } + + return i; +} +#endif + +#ifdef XZ_DEC_SPARC +static noinline_for_stack size_t XZ_FUNC bcj_sparc( + struct xz_dec_bcj *s, uint8_t *buf, size_t size) +{ + size_t i; + uint32_t instr; + + for (i = 0; i + 4 <= size; i += 4) { + instr = get_unaligned_be32(buf + i); + if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) { + instr <<= 2; + instr -= s->pos + (uint32_t)i; + instr >>= 2; + instr = ((uint32_t)0x40000000 - (instr & 0x400000)) + | 0x40000000 | (instr & 0x3FFFFF); + put_unaligned_be32(instr, buf + i); + } + } + + return i; +} +#endif + +/* + * Apply the selected BCJ filter. Update *pos and s->pos to match the amount + * of data that got filtered. + * + * NOTE: This is implemented as a switch statement to avoid using function + * pointers, which could be problematic in the kernel boot code, which must + * avoid pointers to static data (at least on x86). + */ +static void XZ_FUNC bcj_apply(struct xz_dec_bcj *s, + uint8_t *buf, size_t *pos, size_t size) +{ + size_t filtered; + + buf += *pos; + size -= *pos; + + switch (s->type) { +#ifdef XZ_DEC_X86 + case BCJ_X86: + filtered = bcj_x86(s, buf, size); + break; +#endif +#ifdef XZ_DEC_POWERPC + case BCJ_POWERPC: + filtered = bcj_powerpc(s, buf, size); + break; +#endif +#ifdef XZ_DEC_IA64 + case BCJ_IA64: + filtered = bcj_ia64(s, buf, size); + break; +#endif +#ifdef XZ_DEC_ARM + case BCJ_ARM: + filtered = bcj_arm(s, buf, size); + break; +#endif +#ifdef XZ_DEC_ARMTHUMB + case BCJ_ARMTHUMB: + filtered = bcj_armthumb(s, buf, size); + break; +#endif +#ifdef XZ_DEC_SPARC + case BCJ_SPARC: + filtered = bcj_sparc(s, buf, size); + break; +#endif + default: + /* Never reached but silence compiler warnings. */ + filtered = 0; + break; + } + + *pos += filtered; + s->pos += filtered; +} + +/* + * Flush pending filtered data from temp to the output buffer. + * Move the remaining mixture of possibly filtered and unfiltered + * data to the beginning of temp. + */ +static void XZ_FUNC bcj_flush(struct xz_dec_bcj *s, struct xz_buf *b) +{ + size_t copy_size; + + copy_size = min_t(size_t, s->temp.filtered, b->out_size - b->out_pos); + memcpy(b->out + b->out_pos, s->temp.buf, copy_size); + b->out_pos += copy_size; + + s->temp.filtered -= copy_size; + s->temp.size -= copy_size; + memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size); +} + +/* + * The BCJ filter functions are primitive in sense that they process the + * data in chunks of 1-16 bytes. To hide this issue, this function does + * some buffering. + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_run(struct xz_dec_bcj *s, + struct xz_dec_lzma2 *lzma2, struct xz_buf *b) +{ + size_t out_start; + + /* + * Flush pending already filtered data to the output buffer. Return + * immediatelly if we couldn't flush everything, or if the next + * filter in the chain had already returned XZ_STREAM_END. + */ + if (s->temp.filtered > 0) { + bcj_flush(s, b); + if (s->temp.filtered > 0) + return XZ_OK; + + if (s->ret == XZ_STREAM_END) + return XZ_STREAM_END; + } + + /* + * If we have more output space than what is currently pending in + * temp, copy the unfiltered data from temp to the output buffer + * and try to fill the output buffer by decoding more data from the + * next filter in the chain. Apply the BCJ filter on the new data + * in the output buffer. If everything cannot be filtered, copy it + * to temp and rewind the output buffer position accordingly. + */ + if (s->temp.size < b->out_size - b->out_pos) { + out_start = b->out_pos; + memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size); + b->out_pos += s->temp.size; + + s->ret = xz_dec_lzma2_run(lzma2, b); + if (s->ret != XZ_STREAM_END + && (s->ret != XZ_OK || s->single_call)) + return s->ret; + + bcj_apply(s, b->out, &out_start, b->out_pos); + + /* + * As an exception, if the next filter returned XZ_STREAM_END, + * we can do that too, since the last few bytes that remain + * unfiltered are meant to remain unfiltered. + */ + if (s->ret == XZ_STREAM_END) + return XZ_STREAM_END; + + s->temp.size = b->out_pos - out_start; + b->out_pos -= s->temp.size; + memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size); + } + + /* + * If we have unfiltered data in temp, try to fill by decoding more + * data from the next filter. Apply the BCJ filter on temp. Then we + * hopefully can fill the actual output buffer by copying filtered + * data from temp. A mix of filtered and unfiltered data may be left + * in temp; it will be taken care on the next call to this function. + */ + if (s->temp.size > 0) { + /* Make b->out{,_pos,_size} temporarily point to s->temp. */ + s->out = b->out; + s->out_pos = b->out_pos; + s->out_size = b->out_size; + b->out = s->temp.buf; + b->out_pos = s->temp.size; + b->out_size = sizeof(s->temp.buf); + + s->ret = xz_dec_lzma2_run(lzma2, b); + + s->temp.size = b->out_pos; + b->out = s->out; + b->out_pos = s->out_pos; + b->out_size = s->out_size; + + if (s->ret != XZ_OK && s->ret != XZ_STREAM_END) + return s->ret; + + bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size); + + /* + * If the next filter returned XZ_STREAM_END, we mark that + * everything is filtered, since the last unfiltered bytes + * of the stream are meant to be left as is. + */ + if (s->ret == XZ_STREAM_END) + s->temp.filtered = s->temp.size; + + bcj_flush(s, b); + if (s->temp.filtered > 0) + return XZ_OK; + } + + return s->ret; +} + +XZ_EXTERN struct xz_dec_bcj * XZ_FUNC xz_dec_bcj_create(bool single_call) +{ + struct xz_dec_bcj *s = kmalloc(sizeof(*s), GFP_KERNEL); + if (s != NULL) + s->single_call = single_call; + + return s; +} + +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_reset( + struct xz_dec_bcj *s, uint8_t id) +{ + switch (id) { +#ifdef XZ_DEC_X86 + case BCJ_X86: +#endif +#ifdef XZ_DEC_POWERPC + case BCJ_POWERPC: +#endif +#ifdef XZ_DEC_IA64 + case BCJ_IA64: +#endif +#ifdef XZ_DEC_ARM + case BCJ_ARM: +#endif +#ifdef XZ_DEC_ARMTHUMB + case BCJ_ARMTHUMB: +#endif +#ifdef XZ_DEC_SPARC + case BCJ_SPARC: +#endif + break; + + default: + /* Unsupported Filter ID */ + return XZ_OPTIONS_ERROR; + } + + s->type = id; + s->ret = XZ_OK; + s->pos = 0; + s->x86_prev_mask = 0; + s->temp.filtered = 0; + s->temp.size = 0; + + return XZ_OK; +} + +#endif diff --git a/lib/qt-tar-xz/xz_dec_lzma2.c b/lib/qt-tar-xz/xz_dec_lzma2.c new file mode 100644 index 0000000..ad36e29 --- /dev/null +++ b/lib/qt-tar-xz/xz_dec_lzma2.c @@ -0,0 +1,1175 @@ +/* + * LZMA2 decoder + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#include "xz_private.h" +#include "xz_lzma2.h" + +/* + * Range decoder initialization eats the first five bytes of each LZMA chunk. + */ +#define RC_INIT_BYTES 5 + +/* + * Minimum number of usable input buffer to safely decode one LZMA symbol. + * The worst case is that we decode 22 bits using probabilities and 26 + * direct bits. This may decode at maximum of 20 bytes of input. However, + * lzma_main() does an extra normalization before returning, thus we + * need to put 21 here. + */ +#define LZMA_IN_REQUIRED 21 + +/* + * Dictionary (history buffer) + * + * These are always true: + * start <= pos <= full <= end + * pos <= limit <= end + * + * In multi-call mode, also these are true: + * end == size + * size <= size_max + * allocated <= size + * + * Most of these variables are size_t to support single-call mode, + * in which the dictionary variables address the actual output + * buffer directly. + */ +struct dictionary { + /* Beginning of the history buffer */ + uint8_t *buf; + + /* Old position in buf (before decoding more data) */ + size_t start; + + /* Position in buf */ + size_t pos; + + /* + * How full dictionary is. This is used to detect corrupt input that + * would read beyond the beginning of the uncompressed stream. + */ + size_t full; + + /* Write limit; we don't write to buf[limit] or later bytes. */ + size_t limit; + + /* + * End of the dictionary buffer. In multi-call mode, this is + * the same as the dictionary size. In single-call mode, this + * indicates the size of the output buffer. + */ + size_t end; + + /* + * Size of the dictionary as specified in Block Header. This is used + * together with "full" to detect corrupt input that would make us + * read beyond the beginning of the uncompressed stream. + */ + uint32_t size; + + /* + * Maximum allowed dictionary size in multi-call mode. + * This is ignored in single-call mode. + */ + uint32_t size_max; + + /* + * Amount of memory currently allocated for the dictionary. + * This is used only with XZ_DYNALLOC. (With XZ_PREALLOC, + * size_max is always the same as the allocated size.) + */ + uint32_t allocated; + + /* Operation mode */ + enum xz_mode mode; +}; + +/* Range decoder */ +struct rc_dec { + uint32_t range; + uint32_t code; + + /* + * Number of initializing bytes remaining to be read + * by rc_read_init(). + */ + uint32_t init_bytes_left; + + /* + * Buffer from which we read our input. It can be either + * temp.buf or the caller-provided input buffer. + */ + const uint8_t *in; + size_t in_pos; + size_t in_limit; +}; + +/* Probabilities for a length decoder. */ +struct lzma_len_dec { + /* Probability of match length being at least 10 */ + uint16_t choice; + + /* Probability of match length being at least 18 */ + uint16_t choice2; + + /* Probabilities for match lengths 2-9 */ + uint16_t low[POS_STATES_MAX][LEN_LOW_SYMBOLS]; + + /* Probabilities for match lengths 10-17 */ + uint16_t mid[POS_STATES_MAX][LEN_MID_SYMBOLS]; + + /* Probabilities for match lengths 18-273 */ + uint16_t high[LEN_HIGH_SYMBOLS]; +}; + +struct lzma_dec { + /* Distances of latest four matches */ + uint32_t rep0; + uint32_t rep1; + uint32_t rep2; + uint32_t rep3; + + /* Types of the most recently seen LZMA symbols */ + enum lzma_state state; + + /* + * Length of a match. This is updated so that dict_repeat can + * be called again to finish repeating the whole match. + */ + uint32_t len; + + /* + * LZMA properties or related bit masks (number of literal + * context bits, a mask dervied from the number of literal + * position bits, and a mask dervied from the number + * position bits) + */ + uint32_t lc; + uint32_t literal_pos_mask; /* (1 << lp) - 1 */ + uint32_t pos_mask; /* (1 << pb) - 1 */ + + /* If 1, it's a match. Otherwise it's a single 8-bit literal. */ + uint16_t is_match[STATES][POS_STATES_MAX]; + + /* If 1, it's a repeated match. The distance is one of rep0 .. rep3. */ + uint16_t is_rep[STATES]; + + /* + * If 0, distance of a repeated match is rep0. + * Otherwise check is_rep1. + */ + uint16_t is_rep0[STATES]; + + /* + * If 0, distance of a repeated match is rep1. + * Otherwise check is_rep2. + */ + uint16_t is_rep1[STATES]; + + /* If 0, distance of a repeated match is rep2. Otherwise it is rep3. */ + uint16_t is_rep2[STATES]; + + /* + * If 1, the repeated match has length of one byte. Otherwise + * the length is decoded from rep_len_decoder. + */ + uint16_t is_rep0_long[STATES][POS_STATES_MAX]; + + /* + * Probability tree for the highest two bits of the match + * distance. There is a separate probability tree for match + * lengths of 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273]. + */ + uint16_t dist_slot[DIST_STATES][DIST_SLOTS]; + + /* + * Probility trees for additional bits for match distance + * when the distance is in the range [4, 127]. + */ + uint16_t dist_special[FULL_DISTANCES - DIST_MODEL_END]; + + /* + * Probability tree for the lowest four bits of a match + * distance that is equal to or greater than 128. + */ + uint16_t dist_align[ALIGN_SIZE]; + + /* Length of a normal match */ + struct lzma_len_dec match_len_dec; + + /* Length of a repeated match */ + struct lzma_len_dec rep_len_dec; + + /* Probabilities of literals */ + uint16_t literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE]; +}; + +struct lzma2_dec { + /* Position in xz_dec_lzma2_run(). */ + enum lzma2_seq { + SEQ_CONTROL, + SEQ_UNCOMPRESSED_1, + SEQ_UNCOMPRESSED_2, + SEQ_COMPRESSED_0, + SEQ_COMPRESSED_1, + SEQ_PROPERTIES, + SEQ_LZMA_PREPARE, + SEQ_LZMA_RUN, + SEQ_COPY + } sequence; + + /* Next position after decoding the compressed size of the chunk. */ + enum lzma2_seq next_sequence; + + /* Uncompressed size of LZMA chunk (2 MiB at maximum) */ + uint32_t uncompressed; + + /* + * Compressed size of LZMA chunk or compressed/uncompressed + * size of uncompressed chunk (64 KiB at maximum) + */ + uint32_t compressed; + + /* + * True if dictionary reset is needed. This is false before + * the first chunk (LZMA or uncompressed). + */ + bool need_dict_reset; + + /* + * True if new LZMA properties are needed. This is false + * before the first LZMA chunk. + */ + bool need_props; +}; + +struct xz_dec_lzma2 { + /* + * The order below is important on x86 to reduce code size and + * it shouldn't hurt on other platforms. Everything up to and + * including lzma.pos_mask are in the first 128 bytes on x86-32, + * which allows using smaller instructions to access those + * variables. On x86-64, fewer variables fit into the first 128 + * bytes, but this is still the best order without sacrificing + * the readability by splitting the structures. + */ + struct rc_dec rc; + struct dictionary dict; + struct lzma2_dec lzma2; + struct lzma_dec lzma; + + /* + * Temporary buffer which holds small number of input bytes between + * decoder calls. See lzma2_lzma() for details. + */ + struct { + uint32_t size; + uint8_t buf[3 * LZMA_IN_REQUIRED]; + } temp; +}; + +/************** + * Dictionary * + **************/ + +/* + * Reset the dictionary state. When in single-call mode, set up the beginning + * of the dictionary to point to the actual output buffer. + */ +static void XZ_FUNC dict_reset(struct dictionary *dict, struct xz_buf *b) +{ + if (DEC_IS_SINGLE(dict->mode)) { + dict->buf = b->out + b->out_pos; + dict->end = b->out_size - b->out_pos; + } + + dict->start = 0; + dict->pos = 0; + dict->limit = 0; + dict->full = 0; +} + +/* Set dictionary write limit */ +static void XZ_FUNC dict_limit(struct dictionary *dict, size_t out_max) +{ + if (dict->end - dict->pos <= out_max) + dict->limit = dict->end; + else + dict->limit = dict->pos + out_max; +} + +/* Return true if at least one byte can be written into the dictionary. */ +static inline bool XZ_FUNC dict_has_space(const struct dictionary *dict) +{ + return dict->pos < dict->limit; +} + +/* + * Get a byte from the dictionary at the given distance. The distance is + * assumed to valid, or as a special case, zero when the dictionary is + * still empty. This special case is needed for single-call decoding to + * avoid writing a '\0' to the end of the destination buffer. + */ +static inline uint32_t XZ_FUNC dict_get( + const struct dictionary *dict, uint32_t dist) +{ + size_t offset = dict->pos - dist - 1; + + if (dist >= dict->pos) + offset += dict->end; + + return dict->full > 0 ? dict->buf[offset] : 0; +} + +/* + * Put one byte into the dictionary. It is assumed that there is space for it. + */ +static inline void XZ_FUNC dict_put(struct dictionary *dict, uint8_t byte) +{ + dict->buf[dict->pos++] = byte; + + if (dict->full < dict->pos) + dict->full = dict->pos; +} + +/* + * Repeat given number of bytes from the given distance. If the distance is + * invalid, false is returned. On success, true is returned and *len is + * updated to indicate how many bytes were left to be repeated. + */ +static bool XZ_FUNC dict_repeat( + struct dictionary *dict, uint32_t *len, uint32_t dist) +{ + size_t back; + uint32_t left; + + if (dist >= dict->full || dist >= dict->size) + return false; + + left = min_t(size_t, dict->limit - dict->pos, *len); + *len -= left; + + back = dict->pos - dist - 1; + if (dist >= dict->pos) + back += dict->end; + + do { + dict->buf[dict->pos++] = dict->buf[back++]; + if (back == dict->end) + back = 0; + } while (--left > 0); + + if (dict->full < dict->pos) + dict->full = dict->pos; + + return true; +} + +/* Copy uncompressed data as is from input to dictionary and output buffers. */ +static void XZ_FUNC dict_uncompressed( + struct dictionary *dict, struct xz_buf *b, uint32_t *left) +{ + size_t copy_size; + + while (*left > 0 && b->in_pos < b->in_size + && b->out_pos < b->out_size) { + copy_size = min(b->in_size - b->in_pos, + b->out_size - b->out_pos); + if (copy_size > dict->end - dict->pos) + copy_size = dict->end - dict->pos; + if (copy_size > *left) + copy_size = *left; + + *left -= copy_size; + + memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size); + dict->pos += copy_size; + + if (dict->full < dict->pos) + dict->full = dict->pos; + + if (DEC_IS_MULTI(dict->mode)) { + if (dict->pos == dict->end) + dict->pos = 0; + + memcpy(b->out + b->out_pos, b->in + b->in_pos, + copy_size); + } + + dict->start = dict->pos; + + b->out_pos += copy_size; + b->in_pos += copy_size; + + } +} + +/* + * Flush pending data from dictionary to b->out. It is assumed that there is + * enough space in b->out. This is guaranteed because caller uses dict_limit() + * before decoding data into the dictionary. + */ +static uint32_t XZ_FUNC dict_flush(struct dictionary *dict, struct xz_buf *b) +{ + size_t copy_size = dict->pos - dict->start; + + if (DEC_IS_MULTI(dict->mode)) { + if (dict->pos == dict->end) + dict->pos = 0; + + memcpy(b->out + b->out_pos, dict->buf + dict->start, + copy_size); + } + + dict->start = dict->pos; + b->out_pos += copy_size; + return copy_size; +} + +/***************** + * Range decoder * + *****************/ + +/* Reset the range decoder. */ +static void XZ_FUNC rc_reset(struct rc_dec *rc) +{ + rc->range = (uint32_t)-1; + rc->code = 0; + rc->init_bytes_left = RC_INIT_BYTES; +} + +/* + * Read the first five initial bytes into rc->code if they haven't been + * read already. (Yes, the first byte gets completely ignored.) + */ +static bool XZ_FUNC rc_read_init(struct rc_dec *rc, struct xz_buf *b) +{ + while (rc->init_bytes_left > 0) { + if (b->in_pos == b->in_size) + return false; + + rc->code = (rc->code << 8) + b->in[b->in_pos++]; + --rc->init_bytes_left; + } + + return true; +} + +/* Return true if there may not be enough input for the next decoding loop. */ +static inline bool XZ_FUNC rc_limit_exceeded(const struct rc_dec *rc) +{ + return rc->in_pos > rc->in_limit; +} + +/* + * Return true if it is possible (from point of view of range decoder) that + * we have reached the end of the LZMA chunk. + */ +static inline bool XZ_FUNC rc_is_finished(const struct rc_dec *rc) +{ + return rc->code == 0; +} + +/* Read the next input byte if needed. */ +static __always_inline void XZ_FUNC rc_normalize(struct rc_dec *rc) +{ + if (rc->range < RC_TOP_VALUE) { + rc->range <<= RC_SHIFT_BITS; + rc->code = (rc->code << RC_SHIFT_BITS) + rc->in[rc->in_pos++]; + } +} + +/* + * Decode one bit. In some versions, this function has been splitted in three + * functions so that the compiler is supposed to be able to more easily avoid + * an extra branch. In this particular version of the LZMA decoder, this + * doesn't seem to be a good idea (tested with GCC 3.3.6, 3.4.6, and 4.3.3 + * on x86). Using a non-splitted version results in nicer looking code too. + * + * NOTE: This must return an int. Do not make it return a bool or the speed + * of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care, + * and it generates 10-20 % faster code than GCC 3.x from this file anyway.) + */ +static __always_inline int XZ_FUNC rc_bit(struct rc_dec *rc, uint16_t *prob) +{ + uint32_t bound; + int bit; + + rc_normalize(rc); + bound = (rc->range >> RC_BIT_MODEL_TOTAL_BITS) * *prob; + if (rc->code < bound) { + rc->range = bound; + *prob += (RC_BIT_MODEL_TOTAL - *prob) >> RC_MOVE_BITS; + bit = 0; + } else { + rc->range -= bound; + rc->code -= bound; + *prob -= *prob >> RC_MOVE_BITS; + bit = 1; + } + + return bit; +} + +/* Decode a bittree starting from the most significant bit. */ +static __always_inline uint32_t XZ_FUNC rc_bittree( + struct rc_dec *rc, uint16_t *probs, uint32_t limit) +{ + uint32_t symbol = 1; + + do { + if (rc_bit(rc, &probs[symbol])) + symbol = (symbol << 1) + 1; + else + symbol <<= 1; + } while (symbol < limit); + + return symbol; +} + +/* Decode a bittree starting from the least significant bit. */ +static __always_inline void XZ_FUNC rc_bittree_reverse(struct rc_dec *rc, + uint16_t *probs, uint32_t *dest, uint32_t limit) +{ + uint32_t symbol = 1; + uint32_t i = 0; + + do { + if (rc_bit(rc, &probs[symbol])) { + symbol = (symbol << 1) + 1; + *dest += 1 << i; + } else { + symbol <<= 1; + } + } while (++i < limit); +} + +/* Decode direct bits (fixed fifty-fifty probability) */ +static inline void XZ_FUNC rc_direct( + struct rc_dec *rc, uint32_t *dest, uint32_t limit) +{ + uint32_t mask; + + do { + rc_normalize(rc); + rc->range >>= 1; + rc->code -= rc->range; + mask = (uint32_t)0 - (rc->code >> 31); + rc->code += rc->range & mask; + *dest = (*dest << 1) + (mask + 1); + } while (--limit > 0); +} + +/******** + * LZMA * + ********/ + +/* Get pointer to literal coder probability array. */ +static uint16_t * XZ_FUNC lzma_literal_probs(struct xz_dec_lzma2 *s) +{ + uint32_t prev_byte = dict_get(&s->dict, 0); + uint32_t low = prev_byte >> (8 - s->lzma.lc); + uint32_t high = (s->dict.pos & s->lzma.literal_pos_mask) << s->lzma.lc; + return s->lzma.literal[low + high]; +} + +/* Decode a literal (one 8-bit byte) */ +static void XZ_FUNC lzma_literal(struct xz_dec_lzma2 *s) +{ + uint16_t *probs; + uint32_t symbol; + uint32_t match_byte; + uint32_t match_bit; + uint32_t offset; + uint32_t i; + + probs = lzma_literal_probs(s); + + if (lzma_state_is_literal(s->lzma.state)) { + symbol = rc_bittree(&s->rc, probs, 0x100); + } else { + symbol = 1; + match_byte = dict_get(&s->dict, s->lzma.rep0) << 1; + offset = 0x100; + + do { + match_bit = match_byte & offset; + match_byte <<= 1; + i = offset + match_bit + symbol; + + if (rc_bit(&s->rc, &probs[i])) { + symbol = (symbol << 1) + 1; + offset &= match_bit; + } else { + symbol <<= 1; + offset &= ~match_bit; + } + } while (symbol < 0x100); + } + + dict_put(&s->dict, (uint8_t)symbol); + lzma_state_literal(&s->lzma.state); +} + +/* Decode the length of the match into s->lzma.len. */ +static void XZ_FUNC lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l, + uint32_t pos_state) +{ + uint16_t *probs; + uint32_t limit; + + if (!rc_bit(&s->rc, &l->choice)) { + probs = l->low[pos_state]; + limit = LEN_LOW_SYMBOLS; + s->lzma.len = MATCH_LEN_MIN; + } else { + if (!rc_bit(&s->rc, &l->choice2)) { + probs = l->mid[pos_state]; + limit = LEN_MID_SYMBOLS; + s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS; + } else { + probs = l->high; + limit = LEN_HIGH_SYMBOLS; + s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS + + LEN_MID_SYMBOLS; + } + } + + s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit; +} + +/* Decode a match. The distance will be stored in s->lzma.rep0. */ +static void XZ_FUNC lzma_match(struct xz_dec_lzma2 *s, uint32_t pos_state) +{ + uint16_t *probs; + uint32_t dist_slot; + uint32_t limit; + + lzma_state_match(&s->lzma.state); + + s->lzma.rep3 = s->lzma.rep2; + s->lzma.rep2 = s->lzma.rep1; + s->lzma.rep1 = s->lzma.rep0; + + lzma_len(s, &s->lzma.match_len_dec, pos_state); + + probs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)]; + dist_slot = rc_bittree(&s->rc, probs, DIST_SLOTS) - DIST_SLOTS; + + if (dist_slot < DIST_MODEL_START) { + s->lzma.rep0 = dist_slot; + } else { + limit = (dist_slot >> 1) - 1; + s->lzma.rep0 = 2 + (dist_slot & 1); + + if (dist_slot < DIST_MODEL_END) { + s->lzma.rep0 <<= limit; + probs = s->lzma.dist_special + s->lzma.rep0 + - dist_slot - 1; + rc_bittree_reverse(&s->rc, probs, + &s->lzma.rep0, limit); + } else { + rc_direct(&s->rc, &s->lzma.rep0, limit - ALIGN_BITS); + s->lzma.rep0 <<= ALIGN_BITS; + rc_bittree_reverse(&s->rc, s->lzma.dist_align, + &s->lzma.rep0, ALIGN_BITS); + } + } +} + +/* + * Decode a repeated match. The distance is one of the four most recently + * seen matches. The distance will be stored in s->lzma.rep0. + */ +static void XZ_FUNC lzma_rep_match(struct xz_dec_lzma2 *s, uint32_t pos_state) +{ + uint32_t tmp; + + if (!rc_bit(&s->rc, &s->lzma.is_rep0[s->lzma.state])) { + if (!rc_bit(&s->rc, &s->lzma.is_rep0_long[ + s->lzma.state][pos_state])) { + lzma_state_short_rep(&s->lzma.state); + s->lzma.len = 1; + return; + } + } else { + if (!rc_bit(&s->rc, &s->lzma.is_rep1[s->lzma.state])) { + tmp = s->lzma.rep1; + } else { + if (!rc_bit(&s->rc, &s->lzma.is_rep2[s->lzma.state])) { + tmp = s->lzma.rep2; + } else { + tmp = s->lzma.rep3; + s->lzma.rep3 = s->lzma.rep2; + } + + s->lzma.rep2 = s->lzma.rep1; + } + + s->lzma.rep1 = s->lzma.rep0; + s->lzma.rep0 = tmp; + } + + lzma_state_long_rep(&s->lzma.state); + lzma_len(s, &s->lzma.rep_len_dec, pos_state); +} + +/* LZMA decoder core */ +static bool XZ_FUNC lzma_main(struct xz_dec_lzma2 *s) +{ + uint32_t pos_state; + + /* + * If the dictionary was reached during the previous call, try to + * finish the possibly pending repeat in the dictionary. + */ + if (dict_has_space(&s->dict) && s->lzma.len > 0) + dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0); + + /* + * Decode more LZMA symbols. One iteration may consume up to + * LZMA_IN_REQUIRED - 1 bytes. + */ + while (dict_has_space(&s->dict) && !rc_limit_exceeded(&s->rc)) { + pos_state = s->dict.pos & s->lzma.pos_mask; + + if (!rc_bit(&s->rc, &s->lzma.is_match[ + s->lzma.state][pos_state])) { + lzma_literal(s); + } else { + if (rc_bit(&s->rc, &s->lzma.is_rep[s->lzma.state])) + lzma_rep_match(s, pos_state); + else + lzma_match(s, pos_state); + + if (!dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0)) + return false; + } + } + + /* + * Having the range decoder always normalized when we are outside + * this function makes it easier to correctly handle end of the chunk. + */ + rc_normalize(&s->rc); + + return true; +} + +/* + * Reset the LZMA decoder and range decoder state. Dictionary is nore reset + * here, because LZMA state may be reset without resetting the dictionary. + */ +static void XZ_FUNC lzma_reset(struct xz_dec_lzma2 *s) +{ + uint16_t *probs; + size_t i; + + s->lzma.state = STATE_LIT_LIT; + s->lzma.rep0 = 0; + s->lzma.rep1 = 0; + s->lzma.rep2 = 0; + s->lzma.rep3 = 0; + + /* + * All probabilities are initialized to the same value. This hack + * makes the code smaller by avoiding a separate loop for each + * probability array. + * + * This could be optimized so that only that part of literal + * probabilities that are actually required. In the common case + * we would write 12 KiB less. + */ + probs = s->lzma.is_match[0]; + for (i = 0; i < PROBS_TOTAL; ++i) + probs[i] = RC_BIT_MODEL_TOTAL / 2; + + rc_reset(&s->rc); +} + +/* + * Decode and validate LZMA properties (lc/lp/pb) and calculate the bit masks + * from the decoded lp and pb values. On success, the LZMA decoder state is + * reset and true is returned. + */ +static bool XZ_FUNC lzma_props(struct xz_dec_lzma2 *s, uint8_t props) +{ + if (props > (4 * 5 + 4) * 9 + 8) + return false; + + s->lzma.pos_mask = 0; + while (props >= 9 * 5) { + props -= 9 * 5; + ++s->lzma.pos_mask; + } + + s->lzma.pos_mask = (1 << s->lzma.pos_mask) - 1; + + s->lzma.literal_pos_mask = 0; + while (props >= 9) { + props -= 9; + ++s->lzma.literal_pos_mask; + } + + s->lzma.lc = props; + + if (s->lzma.lc + s->lzma.literal_pos_mask > 4) + return false; + + s->lzma.literal_pos_mask = (1 << s->lzma.literal_pos_mask) - 1; + + lzma_reset(s); + + return true; +} + +/********* + * LZMA2 * + *********/ + +/* + * The LZMA decoder assumes that if the input limit (s->rc.in_limit) hasn't + * been exceeded, it is safe to read up to LZMA_IN_REQUIRED bytes. This + * wrapper function takes care of making the LZMA decoder's assumption safe. + * + * As long as there is plenty of input left to be decoded in the current LZMA + * chunk, we decode directly from the caller-supplied input buffer until + * there's LZMA_IN_REQUIRED bytes left. Those remaining bytes are copied into + * s->temp.buf, which (hopefully) gets filled on the next call to this + * function. We decode a few bytes from the temporary buffer so that we can + * continue decoding from the caller-supplied input buffer again. + */ +static bool XZ_FUNC lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b) +{ + size_t in_avail; + uint32_t tmp; + + in_avail = b->in_size - b->in_pos; + if (s->temp.size > 0 || s->lzma2.compressed == 0) { + tmp = 2 * LZMA_IN_REQUIRED - s->temp.size; + if (tmp > s->lzma2.compressed - s->temp.size) + tmp = s->lzma2.compressed - s->temp.size; + if (tmp > in_avail) + tmp = in_avail; + + memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp); + + if (s->temp.size + tmp == s->lzma2.compressed) { + memzero(s->temp.buf + s->temp.size + tmp, + sizeof(s->temp.buf) + - s->temp.size - tmp); + s->rc.in_limit = s->temp.size + tmp; + } else if (s->temp.size + tmp < LZMA_IN_REQUIRED) { + s->temp.size += tmp; + b->in_pos += tmp; + return true; + } else { + s->rc.in_limit = s->temp.size + tmp - LZMA_IN_REQUIRED; + } + + s->rc.in = s->temp.buf; + s->rc.in_pos = 0; + + if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp) + return false; + + s->lzma2.compressed -= s->rc.in_pos; + + if (s->rc.in_pos < s->temp.size) { + s->temp.size -= s->rc.in_pos; + memmove(s->temp.buf, s->temp.buf + s->rc.in_pos, + s->temp.size); + return true; + } + + b->in_pos += s->rc.in_pos - s->temp.size; + s->temp.size = 0; + } + + in_avail = b->in_size - b->in_pos; + if (in_avail >= LZMA_IN_REQUIRED) { + s->rc.in = b->in; + s->rc.in_pos = b->in_pos; + + if (in_avail >= s->lzma2.compressed + LZMA_IN_REQUIRED) + s->rc.in_limit = b->in_pos + s->lzma2.compressed; + else + s->rc.in_limit = b->in_size - LZMA_IN_REQUIRED; + + if (!lzma_main(s)) + return false; + + in_avail = s->rc.in_pos - b->in_pos; + if (in_avail > s->lzma2.compressed) + return false; + + s->lzma2.compressed -= in_avail; + b->in_pos = s->rc.in_pos; + } + + in_avail = b->in_size - b->in_pos; + if (in_avail < LZMA_IN_REQUIRED) { + if (in_avail > s->lzma2.compressed) + in_avail = s->lzma2.compressed; + + memcpy(s->temp.buf, b->in + b->in_pos, in_avail); + s->temp.size = in_avail; + b->in_pos += in_avail; + } + + return true; +} + +/* + * Take care of the LZMA2 control layer, and forward the job of actual LZMA + * decoding or copying of uncompressed chunks to other functions. + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_run( + struct xz_dec_lzma2 *s, struct xz_buf *b) +{ + uint32_t tmp; + + while (b->in_pos < b->in_size || s->lzma2.sequence == SEQ_LZMA_RUN) { + switch (s->lzma2.sequence) { + case SEQ_CONTROL: + /* + * LZMA2 control byte + * + * Exact values: + * 0x00 End marker + * 0x01 Dictionary reset followed by + * an uncompressed chunk + * 0x02 Uncompressed chunk (no dictionary reset) + * + * Highest three bits (s->control & 0xE0): + * 0xE0 Dictionary reset, new properties and state + * reset, followed by LZMA compressed chunk + * 0xC0 New properties and state reset, followed + * by LZMA compressed chunk (no dictionary + * reset) + * 0xA0 State reset using old properties, + * followed by LZMA compressed chunk (no + * dictionary reset) + * 0x80 LZMA chunk (no dictionary or state reset) + * + * For LZMA compressed chunks, the lowest five bits + * (s->control & 1F) are the highest bits of the + * uncompressed size (bits 16-20). + * + * A new LZMA2 stream must begin with a dictionary + * reset. The first LZMA chunk must set new + * properties and reset the LZMA state. + * + * Values that don't match anything described above + * are invalid and we return XZ_DATA_ERROR. + */ + tmp = b->in[b->in_pos++]; + + if (tmp >= 0xE0 || tmp == 0x01) { + s->lzma2.need_props = true; + s->lzma2.need_dict_reset = false; + dict_reset(&s->dict, b); + } else if (s->lzma2.need_dict_reset) { + return XZ_DATA_ERROR; + } + + if (tmp >= 0x80) { + s->lzma2.uncompressed = (tmp & 0x1F) << 16; + s->lzma2.sequence = SEQ_UNCOMPRESSED_1; + + if (tmp >= 0xC0) { + /* + * When there are new properties, + * state reset is done at + * SEQ_PROPERTIES. + */ + s->lzma2.need_props = false; + s->lzma2.next_sequence + = SEQ_PROPERTIES; + + } else if (s->lzma2.need_props) { + return XZ_DATA_ERROR; + + } else { + s->lzma2.next_sequence + = SEQ_LZMA_PREPARE; + if (tmp >= 0xA0) + lzma_reset(s); + } + } else { + if (tmp == 0x00) + return XZ_STREAM_END; + + if (tmp > 0x02) + return XZ_DATA_ERROR; + + s->lzma2.sequence = SEQ_COMPRESSED_0; + s->lzma2.next_sequence = SEQ_COPY; + } + + break; + + case SEQ_UNCOMPRESSED_1: + s->lzma2.uncompressed + += (uint32_t)b->in[b->in_pos++] << 8; + s->lzma2.sequence = SEQ_UNCOMPRESSED_2; + break; + + case SEQ_UNCOMPRESSED_2: + s->lzma2.uncompressed + += (uint32_t)b->in[b->in_pos++] + 1; + s->lzma2.sequence = SEQ_COMPRESSED_0; + break; + + case SEQ_COMPRESSED_0: + s->lzma2.compressed + = (uint32_t)b->in[b->in_pos++] << 8; + s->lzma2.sequence = SEQ_COMPRESSED_1; + break; + + case SEQ_COMPRESSED_1: + s->lzma2.compressed + += (uint32_t)b->in[b->in_pos++] + 1; + s->lzma2.sequence = s->lzma2.next_sequence; + break; + + case SEQ_PROPERTIES: + if (!lzma_props(s, b->in[b->in_pos++])) + return XZ_DATA_ERROR; + + s->lzma2.sequence = SEQ_LZMA_PREPARE; + + case SEQ_LZMA_PREPARE: + if (s->lzma2.compressed < RC_INIT_BYTES) + return XZ_DATA_ERROR; + + if (!rc_read_init(&s->rc, b)) + return XZ_OK; + + s->lzma2.compressed -= RC_INIT_BYTES; + s->lzma2.sequence = SEQ_LZMA_RUN; + + case SEQ_LZMA_RUN: + /* + * Set dictionary limit to indicate how much we want + * to be encoded at maximum. Decode new data into the + * dictionary. Flush the new data from dictionary to + * b->out. Check if we finished decoding this chunk. + * In case the dictionary got full but we didn't fill + * the output buffer yet, we may run this loop + * multiple times without changing s->lzma2.sequence. + */ + dict_limit(&s->dict, min_t(size_t, + b->out_size - b->out_pos, + s->lzma2.uncompressed)); + if (!lzma2_lzma(s, b)) + return XZ_DATA_ERROR; + + s->lzma2.uncompressed -= dict_flush(&s->dict, b); + + if (s->lzma2.uncompressed == 0) { + if (s->lzma2.compressed > 0 || s->lzma.len > 0 + || !rc_is_finished(&s->rc)) + return XZ_DATA_ERROR; + + rc_reset(&s->rc); + s->lzma2.sequence = SEQ_CONTROL; + + } else if (b->out_pos == b->out_size + || (b->in_pos == b->in_size + && s->temp.size + < s->lzma2.compressed)) { + return XZ_OK; + } + + break; + + case SEQ_COPY: + dict_uncompressed(&s->dict, b, &s->lzma2.compressed); + if (s->lzma2.compressed > 0) + return XZ_OK; + + s->lzma2.sequence = SEQ_CONTROL; + break; + } + } + + return XZ_OK; +} + +XZ_EXTERN struct xz_dec_lzma2 * XZ_FUNC xz_dec_lzma2_create( + enum xz_mode mode, uint32_t dict_max) +{ + struct xz_dec_lzma2 *s = kmalloc(sizeof(*s), GFP_KERNEL); + if (s == NULL) + return NULL; + + s->dict.mode = mode; + s->dict.size_max = dict_max; + + if (DEC_IS_PREALLOC(mode)) { + s->dict.buf = vmalloc(dict_max); + if (s->dict.buf == NULL) { + kfree(s); + return NULL; + } + } else if (DEC_IS_DYNALLOC(mode)) { + s->dict.buf = NULL; + s->dict.allocated = 0; + } + + return s; +} + +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_reset( + struct xz_dec_lzma2 *s, uint8_t props) +{ + /* This limits dictionary size to 3 GiB to keep parsing simpler. */ + if (props > 39) + return XZ_OPTIONS_ERROR; + + s->dict.size = 2 + (props & 1); + s->dict.size <<= (props >> 1) + 11; + + if (DEC_IS_MULTI(s->dict.mode)) { + if (s->dict.size > s->dict.size_max) + return XZ_MEMLIMIT_ERROR; + + s->dict.end = s->dict.size; + + if (DEC_IS_DYNALLOC(s->dict.mode)) { + if (s->dict.allocated < s->dict.size) { + vfree(s->dict.buf); + s->dict.buf = vmalloc(s->dict.size); + if (s->dict.buf == NULL) { + s->dict.allocated = 0; + return XZ_MEM_ERROR; + } + } + } + } + + s->lzma.len = 0; + + s->lzma2.sequence = SEQ_CONTROL; + s->lzma2.need_dict_reset = true; + + s->temp.size = 0; + + return XZ_OK; +} + +XZ_EXTERN void XZ_FUNC xz_dec_lzma2_end(struct xz_dec_lzma2 *s) +{ + if (DEC_IS_MULTI(s->dict.mode)) + vfree(s->dict.buf); + + kfree(s); +} diff --git a/lib/qt-tar-xz/xz_dec_stream.c b/lib/qt-tar-xz/xz_dec_stream.c new file mode 100644 index 0000000..bdcbf1b --- /dev/null +++ b/lib/qt-tar-xz/xz_dec_stream.c @@ -0,0 +1,822 @@ +/* + * .xz Stream decoder + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#include "xz_private.h" +#include "xz_stream.h" + +/* Hash used to validate the Index field */ +struct xz_dec_hash { + vli_type unpadded; + vli_type uncompressed; + uint32_t crc32; +}; + +struct xz_dec { + /* Position in dec_main() */ + enum { + SEQ_STREAM_HEADER, + SEQ_BLOCK_START, + SEQ_BLOCK_HEADER, + SEQ_BLOCK_UNCOMPRESS, + SEQ_BLOCK_PADDING, + SEQ_BLOCK_CHECK, + SEQ_INDEX, + SEQ_INDEX_PADDING, + SEQ_INDEX_CRC32, + SEQ_STREAM_FOOTER + } sequence; + + /* Position in variable-length integers and Check fields */ + uint32_t pos; + + /* Variable-length integer decoded by dec_vli() */ + vli_type vli; + + /* Saved in_pos and out_pos */ + size_t in_start; + size_t out_start; + + /* CRC32 value in Block or Index */ + uint32_t crc32; + + /* Type of the integrity check calculated from uncompressed data */ + enum xz_check check_type; + + /* Operation mode */ + enum xz_mode mode; + + /* + * True if the next call to xz_dec_run() is allowed to return + * XZ_BUF_ERROR. + */ + bool allow_buf_error; + + /* Information stored in Block Header */ + struct { + /* + * Value stored in the Compressed Size field, or + * VLI_UNKNOWN if Compressed Size is not present. + */ + vli_type compressed; + + /* + * Value stored in the Uncompressed Size field, or + * VLI_UNKNOWN if Uncompressed Size is not present. + */ + vli_type uncompressed; + + /* Size of the Block Header field */ + uint32_t size; + } block_header; + + /* Information collected when decoding Blocks */ + struct { + /* Observed compressed size of the current Block */ + vli_type compressed; + + /* Observed uncompressed size of the current Block */ + vli_type uncompressed; + + /* Number of Blocks decoded so far */ + vli_type count; + + /* + * Hash calculated from the Block sizes. This is used to + * validate the Index field. + */ + struct xz_dec_hash hash; + } block; + + /* Variables needed when verifying the Index field */ + struct { + /* Position in dec_index() */ + enum { + SEQ_INDEX_COUNT, + SEQ_INDEX_UNPADDED, + SEQ_INDEX_UNCOMPRESSED + } sequence; + + /* Size of the Index in bytes */ + vli_type size; + + /* Number of Records (matches block.count in valid files) */ + vli_type count; + + /* + * Hash calculated from the Records (matches block.hash in + * valid files). + */ + struct xz_dec_hash hash; + } index; + + /* + * Temporary buffer needed to hold Stream Header, Block Header, + * and Stream Footer. The Block Header is the biggest (1 KiB) + * so we reserve space according to that. buf[] has to be aligned + * to a multiple of four bytes; the size_t variables before it + * should guarantee this. + */ + struct { + size_t pos; + size_t size; + uint8_t buf[1024]; + } temp; + + struct xz_dec_lzma2 *lzma2; + +#ifdef XZ_DEC_BCJ + struct xz_dec_bcj *bcj; + bool bcj_active; +#endif +}; + +#ifdef XZ_DEC_ANY_CHECK +/* Sizes of the Check field with different Check IDs */ +static const uint8_t check_sizes[16] = { + 0, + 4, 4, 4, + 8, 8, 8, + 16, 16, 16, + 32, 32, 32, + 64, 64, 64 +}; +#endif + +/* + * Fill s->temp by copying data starting from b->in[b->in_pos]. Caller + * must have set s->temp.pos to indicate how much data we are supposed + * to copy into s->temp.buf. Return true once s->temp.pos has reached + * s->temp.size. + */ +static bool XZ_FUNC fill_temp(struct xz_dec *s, struct xz_buf *b) +{ + size_t copy_size = min_t(size_t, + b->in_size - b->in_pos, s->temp.size - s->temp.pos); + + memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size); + b->in_pos += copy_size; + s->temp.pos += copy_size; + + if (s->temp.pos == s->temp.size) { + s->temp.pos = 0; + return true; + } + + return false; +} + +/* Decode a variable-length integer (little-endian base-128 encoding) */ +static enum xz_ret XZ_FUNC dec_vli(struct xz_dec *s, + const uint8_t *in, size_t *in_pos, size_t in_size) +{ + uint8_t byte; + + if (s->pos == 0) + s->vli = 0; + + while (*in_pos < in_size) { + byte = in[*in_pos]; + ++*in_pos; + + s->vli |= (vli_type)(byte & 0x7F) << s->pos; + + if ((byte & 0x80) == 0) { + /* Don't allow non-minimal encodings. */ + if (byte == 0 && s->pos != 0) + return XZ_DATA_ERROR; + + s->pos = 0; + return XZ_STREAM_END; + } + + s->pos += 7; + if (s->pos == 7 * VLI_BYTES_MAX) + return XZ_DATA_ERROR; + } + + return XZ_OK; +} + +/* + * Decode the Compressed Data field from a Block. Update and validate + * the observed compressed and uncompressed sizes of the Block so that + * they don't exceed the values possibly stored in the Block Header + * (validation assumes that no integer overflow occurs, since vli_type + * is normally uint64_t). Update the CRC32 if presence of the CRC32 + * field was indicated in Stream Header. + * + * Once the decoding is finished, validate that the observed sizes match + * the sizes possibly stored in the Block Header. Update the hash and + * Block count, which are later used to validate the Index field. + */ +static enum xz_ret XZ_FUNC dec_block(struct xz_dec *s, struct xz_buf *b) +{ + enum xz_ret ret; + + s->in_start = b->in_pos; + s->out_start = b->out_pos; + +#ifdef XZ_DEC_BCJ + if (s->bcj_active) + ret = xz_dec_bcj_run(s->bcj, s->lzma2, b); + else +#endif + ret = xz_dec_lzma2_run(s->lzma2, b); + + s->block.compressed += b->in_pos - s->in_start; + s->block.uncompressed += b->out_pos - s->out_start; + + /* + * There is no need to separately check for VLI_UNKNOWN, since + * the observed sizes are always smaller than VLI_UNKNOWN. + */ + if (s->block.compressed > s->block_header.compressed + || s->block.uncompressed + > s->block_header.uncompressed) + return XZ_DATA_ERROR; + + if (s->check_type == XZ_CHECK_CRC32) + s->crc32 = xz_crc32(b->out + s->out_start, + b->out_pos - s->out_start, s->crc32); + + if (ret == XZ_STREAM_END) { + if (s->block_header.compressed != VLI_UNKNOWN + && s->block_header.compressed + != s->block.compressed) + return XZ_DATA_ERROR; + + if (s->block_header.uncompressed != VLI_UNKNOWN + && s->block_header.uncompressed + != s->block.uncompressed) + return XZ_DATA_ERROR; + + s->block.hash.unpadded += s->block_header.size + + s->block.compressed; + +#ifdef XZ_DEC_ANY_CHECK + s->block.hash.unpadded += check_sizes[s->check_type]; +#else + if (s->check_type == XZ_CHECK_CRC32) + s->block.hash.unpadded += 4; +#endif + + s->block.hash.uncompressed += s->block.uncompressed; + s->block.hash.crc32 = xz_crc32( + (const uint8_t *)&s->block.hash, + sizeof(s->block.hash), s->block.hash.crc32); + + ++s->block.count; + } + + return ret; +} + +/* Update the Index size and the CRC32 value. */ +static void XZ_FUNC index_update(struct xz_dec *s, const struct xz_buf *b) +{ + size_t in_used = b->in_pos - s->in_start; + s->index.size += in_used; + s->crc32 = xz_crc32(b->in + s->in_start, in_used, s->crc32); +} + +/* + * Decode the Number of Records, Unpadded Size, and Uncompressed Size + * fields from the Index field. That is, Index Padding and CRC32 are not + * decoded by this function. + * + * This can return XZ_OK (more input needed), XZ_STREAM_END (everything + * successfully decoded), or XZ_DATA_ERROR (input is corrupt). + */ +static enum xz_ret XZ_FUNC dec_index(struct xz_dec *s, struct xz_buf *b) +{ + enum xz_ret ret; + + do { + ret = dec_vli(s, b->in, &b->in_pos, b->in_size); + if (ret != XZ_STREAM_END) { + index_update(s, b); + return ret; + } + + switch (s->index.sequence) { + case SEQ_INDEX_COUNT: + s->index.count = s->vli; + + /* + * Validate that the Number of Records field + * indicates the same number of Records as + * there were Blocks in the Stream. + */ + if (s->index.count != s->block.count) + return XZ_DATA_ERROR; + + s->index.sequence = SEQ_INDEX_UNPADDED; + break; + + case SEQ_INDEX_UNPADDED: + s->index.hash.unpadded += s->vli; + s->index.sequence = SEQ_INDEX_UNCOMPRESSED; + break; + + case SEQ_INDEX_UNCOMPRESSED: + s->index.hash.uncompressed += s->vli; + s->index.hash.crc32 = xz_crc32( + (const uint8_t *)&s->index.hash, + sizeof(s->index.hash), + s->index.hash.crc32); + --s->index.count; + s->index.sequence = SEQ_INDEX_UNPADDED; + break; + } + } while (s->index.count > 0); + + return XZ_STREAM_END; +} + +/* + * Validate that the next four input bytes match the value of s->crc32. + * s->pos must be zero when starting to validate the first byte. + */ +static enum xz_ret XZ_FUNC crc32_validate(struct xz_dec *s, struct xz_buf *b) +{ + do { + if (b->in_pos == b->in_size) + return XZ_OK; + + if (((s->crc32 >> s->pos) & 0xFF) != b->in[b->in_pos++]) + return XZ_DATA_ERROR; + + s->pos += 8; + + } while (s->pos < 32); + + s->crc32 = 0; + s->pos = 0; + + return XZ_STREAM_END; +} + +#ifdef XZ_DEC_ANY_CHECK +/* + * Skip over the Check field when the Check ID is not supported. + * Returns true once the whole Check field has been skipped over. + */ +static bool XZ_FUNC check_skip(struct xz_dec *s, struct xz_buf *b) +{ + while (s->pos < check_sizes[s->check_type]) { + if (b->in_pos == b->in_size) + return false; + + ++b->in_pos; + ++s->pos; + } + + s->pos = 0; + + return true; +} +#endif + +/* Decode the Stream Header field (the first 12 bytes of the .xz Stream). */ +static enum xz_ret XZ_FUNC dec_stream_header(struct xz_dec *s) +{ + if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE)) + return XZ_FORMAT_ERROR; + + if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0) + != get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2)) + return XZ_DATA_ERROR; + + if (s->temp.buf[HEADER_MAGIC_SIZE] != 0) + return XZ_OPTIONS_ERROR; + + /* + * Of integrity checks, we support only none (Check ID = 0) and + * CRC32 (Check ID = 1). However, if XZ_DEC_ANY_CHECK is defined, + * we will accept other check types too, but then the check won't + * be verified and a warning (XZ_UNSUPPORTED_CHECK) will be given. + */ + s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1]; + +#ifdef XZ_DEC_ANY_CHECK + if (s->check_type > XZ_CHECK_MAX) + return XZ_OPTIONS_ERROR; + + if (s->check_type > XZ_CHECK_CRC32) + return XZ_UNSUPPORTED_CHECK; +#else + if (s->check_type > XZ_CHECK_CRC32) + return XZ_OPTIONS_ERROR; +#endif + + return XZ_OK; +} + +/* Decode the Stream Footer field (the last 12 bytes of the .xz Stream) */ +static enum xz_ret XZ_FUNC dec_stream_footer(struct xz_dec *s) +{ + if (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE)) + return XZ_DATA_ERROR; + + if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf)) + return XZ_DATA_ERROR; + + /* + * Validate Backward Size. Note that we never added the size of the + * Index CRC32 field to s->index.size, thus we use s->index.size / 4 + * instead of s->index.size / 4 - 1. + */ + if ((s->index.size >> 2) != get_le32(s->temp.buf + 4)) + return XZ_DATA_ERROR; + + if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->check_type) + return XZ_DATA_ERROR; + + /* + * Use XZ_STREAM_END instead of XZ_OK to be more convenient + * for the caller. + */ + return XZ_STREAM_END; +} + +/* Decode the Block Header and initialize the filter chain. */ +static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) +{ + enum xz_ret ret; + + /* + * Validate the CRC32. We know that the temp buffer is at least + * eight bytes so this is safe. + */ + s->temp.size -= 4; + if (xz_crc32(s->temp.buf, s->temp.size, 0) + != get_le32(s->temp.buf + s->temp.size)) + return XZ_DATA_ERROR; + + s->temp.pos = 2; + + /* + * Catch unsupported Block Flags. We support only one or two filters + * in the chain, so we catch that with the same test. + */ +#ifdef XZ_DEC_BCJ + if (s->temp.buf[1] & 0x3E) +#else + if (s->temp.buf[1] & 0x3F) +#endif + return XZ_OPTIONS_ERROR; + + /* Compressed Size */ + if (s->temp.buf[1] & 0x40) { + if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size) + != XZ_STREAM_END) + return XZ_DATA_ERROR; + + s->block_header.compressed = s->vli; + } else { + s->block_header.compressed = VLI_UNKNOWN; + } + + /* Uncompressed Size */ + if (s->temp.buf[1] & 0x80) { + if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size) + != XZ_STREAM_END) + return XZ_DATA_ERROR; + + s->block_header.uncompressed = s->vli; + } else { + s->block_header.uncompressed = VLI_UNKNOWN; + } + +#ifdef XZ_DEC_BCJ + /* If there are two filters, the first one must be a BCJ filter. */ + s->bcj_active = s->temp.buf[1] & 0x01; + if (s->bcj_active) { + if (s->temp.size - s->temp.pos < 2) + return XZ_OPTIONS_ERROR; + + ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]); + if (ret != XZ_OK) + return ret; + + /* + * We don't support custom start offset, + * so Size of Properties must be zero. + */ + if (s->temp.buf[s->temp.pos++] != 0x00) + return XZ_OPTIONS_ERROR; + } +#endif + + /* Valid Filter Flags always take at least two bytes. */ + if (s->temp.size - s->temp.pos < 2) + return XZ_DATA_ERROR; + + /* Filter ID = LZMA2 */ + if (s->temp.buf[s->temp.pos++] != 0x21) + return XZ_OPTIONS_ERROR; + + /* Size of Properties = 1-byte Filter Properties */ + if (s->temp.buf[s->temp.pos++] != 0x01) + return XZ_OPTIONS_ERROR; + + /* Filter Properties contains LZMA2 dictionary size. */ + if (s->temp.size - s->temp.pos < 1) + return XZ_DATA_ERROR; + + ret = xz_dec_lzma2_reset(s->lzma2, s->temp.buf[s->temp.pos++]); + if (ret != XZ_OK) + return ret; + + /* The rest must be Header Padding. */ + while (s->temp.pos < s->temp.size) + if (s->temp.buf[s->temp.pos++] != 0x00) + return XZ_OPTIONS_ERROR; + + s->temp.pos = 0; + s->block.compressed = 0; + s->block.uncompressed = 0; + + return XZ_OK; +} + +static enum xz_ret XZ_FUNC dec_main(struct xz_dec *s, struct xz_buf *b) +{ + enum xz_ret ret; + + /* + * Store the start position for the case when we are in the middle + * of the Index field. + */ + s->in_start = b->in_pos; + + while (true) { + switch (s->sequence) { + case SEQ_STREAM_HEADER: + /* + * Stream Header is copied to s->temp, and then + * decoded from there. This way if the caller + * gives us only little input at a time, we can + * still keep the Stream Header decoding code + * simple. Similar approach is used in many places + * in this file. + */ + if (!fill_temp(s, b)) + return XZ_OK; + + /* + * If dec_stream_header() returns + * XZ_UNSUPPORTED_CHECK, it is still possible + * to continue decoding if working in multi-call + * mode. Thus, update s->sequence before calling + * dec_stream_header(). + */ + s->sequence = SEQ_BLOCK_START; + + ret = dec_stream_header(s); + if (ret != XZ_OK) + return ret; + + case SEQ_BLOCK_START: + /* We need one byte of input to continue. */ + if (b->in_pos == b->in_size) + return XZ_OK; + + /* See if this is the beginning of the Index field. */ + if (b->in[b->in_pos] == 0) { + s->in_start = b->in_pos++; + s->sequence = SEQ_INDEX; + break; + } + + /* + * Calculate the size of the Block Header and + * prepare to decode it. + */ + s->block_header.size + = ((uint32_t)b->in[b->in_pos] + 1) * 4; + + s->temp.size = s->block_header.size; + s->temp.pos = 0; + s->sequence = SEQ_BLOCK_HEADER; + + case SEQ_BLOCK_HEADER: + if (!fill_temp(s, b)) + return XZ_OK; + + ret = dec_block_header(s); + if (ret != XZ_OK) + return ret; + + s->sequence = SEQ_BLOCK_UNCOMPRESS; + + case SEQ_BLOCK_UNCOMPRESS: + ret = dec_block(s, b); + if (ret != XZ_STREAM_END) + return ret; + + s->sequence = SEQ_BLOCK_PADDING; + + case SEQ_BLOCK_PADDING: + /* + * Size of Compressed Data + Block Padding + * must be a multiple of four. We don't need + * s->block.compressed for anything else + * anymore, so we use it here to test the size + * of the Block Padding field. + */ + while (s->block.compressed & 3) { + if (b->in_pos == b->in_size) + return XZ_OK; + + if (b->in[b->in_pos++] != 0) + return XZ_DATA_ERROR; + + ++s->block.compressed; + } + + s->sequence = SEQ_BLOCK_CHECK; + + case SEQ_BLOCK_CHECK: + if (s->check_type == XZ_CHECK_CRC32) { + ret = crc32_validate(s, b); + if (ret != XZ_STREAM_END) + return ret; + } +#ifdef XZ_DEC_ANY_CHECK + else if (!check_skip(s, b)) { + return XZ_OK; + } +#endif + + s->sequence = SEQ_BLOCK_START; + break; + + case SEQ_INDEX: + ret = dec_index(s, b); + if (ret != XZ_STREAM_END) + return ret; + + s->sequence = SEQ_INDEX_PADDING; + + case SEQ_INDEX_PADDING: + while ((s->index.size + (b->in_pos - s->in_start)) + & 3) { + if (b->in_pos == b->in_size) { + index_update(s, b); + return XZ_OK; + } + + if (b->in[b->in_pos++] != 0) + return XZ_DATA_ERROR; + } + + /* Finish the CRC32 value and Index size. */ + index_update(s, b); + + /* Compare the hashes to validate the Index field. */ + if (!memeq(&s->block.hash, &s->index.hash, + sizeof(s->block.hash))) + return XZ_DATA_ERROR; + + s->sequence = SEQ_INDEX_CRC32; + + case SEQ_INDEX_CRC32: + ret = crc32_validate(s, b); + if (ret != XZ_STREAM_END) + return ret; + + s->temp.size = STREAM_HEADER_SIZE; + s->sequence = SEQ_STREAM_FOOTER; + + case SEQ_STREAM_FOOTER: + if (!fill_temp(s, b)) + return XZ_OK; + + return dec_stream_footer(s); + } + } + + /* Never reached */ +} + +/* + * xz_dec_run() is a wrapper for dec_main() to handle some special cases in + * multi-call and single-call decoding. + * + * In multi-call mode, we must return XZ_BUF_ERROR when it seems clear that we + * are not going to make any progress anymore. This is to prevent the caller + * from calling us infinitely when the input file is truncated or otherwise + * corrupt. Since zlib-style API allows that the caller fills the input buffer + * only when the decoder doesn't produce any new output, we have to be careful + * to avoid returning XZ_BUF_ERROR too easily: XZ_BUF_ERROR is returned only + * after the second consecutive call to xz_dec_run() that makes no progress. + * + * In single-call mode, if we couldn't decode everything and no error + * occurred, either the input is truncated or the output buffer is too small. + * Since we know that the last input byte never produces any output, we know + * that if all the input was consumed and decoding wasn't finished, the file + * must be corrupt. Otherwise the output buffer has to be too small or the + * file is corrupt in a way that decoding it produces too big output. + * + * If single-call decoding fails, we reset b->in_pos and b->out_pos back to + * their original values. This is because with some filter chains there won't + * be any valid uncompressed data in the output buffer unless the decoding + * actually succeeds (that's the price to pay of using the output buffer as + * the workspace). + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_run(struct xz_dec *s, struct xz_buf *b) +{ + size_t in_start; + size_t out_start; + enum xz_ret ret; + + if (DEC_IS_SINGLE(s->mode)) + xz_dec_reset(s); + + in_start = b->in_pos; + out_start = b->out_pos; + ret = dec_main(s, b); + + if (DEC_IS_SINGLE(s->mode)) { + if (ret == XZ_OK) + ret = b->in_pos == b->in_size + ? XZ_DATA_ERROR : XZ_BUF_ERROR; + + if (ret != XZ_STREAM_END) { + b->in_pos = in_start; + b->out_pos = out_start; + } + + } else if (ret == XZ_OK && in_start == b->in_pos + && out_start == b->out_pos) { + if (s->allow_buf_error) + ret = XZ_BUF_ERROR; + + s->allow_buf_error = true; + } else { + s->allow_buf_error = false; + } + + return ret; +} + +XZ_EXTERN struct xz_dec * XZ_FUNC xz_dec_init( + enum xz_mode mode, uint32_t dict_max) +{ + struct xz_dec *s = kmalloc(sizeof(*s), GFP_KERNEL); + if (s == NULL) + return NULL; + + s->mode = mode; + +#ifdef XZ_DEC_BCJ + s->bcj = xz_dec_bcj_create(DEC_IS_SINGLE(mode)); + if (s->bcj == NULL) + goto error_bcj; +#endif + + s->lzma2 = xz_dec_lzma2_create(mode, dict_max); + if (s->lzma2 == NULL) + goto error_lzma2; + + xz_dec_reset(s); + return s; + +error_lzma2: +#ifdef XZ_DEC_BCJ + xz_dec_bcj_end(s->bcj); +error_bcj: +#endif + kfree(s); + return NULL; +} + +XZ_EXTERN void XZ_FUNC xz_dec_reset(struct xz_dec *s) +{ + s->sequence = SEQ_STREAM_HEADER; + s->allow_buf_error = false; + s->pos = 0; + s->crc32 = 0; + memzero(&s->block, sizeof(s->block)); + memzero(&s->index, sizeof(s->index)); + s->temp.pos = 0; + s->temp.size = STREAM_HEADER_SIZE; +} + +XZ_EXTERN void XZ_FUNC xz_dec_end(struct xz_dec *s) +{ + if (s != NULL) { + xz_dec_lzma2_end(s->lzma2); +#ifdef XZ_DEC_BCJ + xz_dec_bcj_end(s->bcj); +#endif + kfree(s); + } +} diff --git a/lib/qt-tar-xz/xz_lzma2.h b/lib/qt-tar-xz/xz_lzma2.h new file mode 100644 index 0000000..47f21af --- /dev/null +++ b/lib/qt-tar-xz/xz_lzma2.h @@ -0,0 +1,204 @@ +/* + * LZMA2 definitions + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef XZ_LZMA2_H +#define XZ_LZMA2_H + +/* Range coder constants */ +#define RC_SHIFT_BITS 8 +#define RC_TOP_BITS 24 +#define RC_TOP_VALUE (1 << RC_TOP_BITS) +#define RC_BIT_MODEL_TOTAL_BITS 11 +#define RC_BIT_MODEL_TOTAL (1 << RC_BIT_MODEL_TOTAL_BITS) +#define RC_MOVE_BITS 5 + +/* + * Maximum number of position states. A position state is the lowest pb + * number of bits of the current uncompressed offset. In some places there + * are different sets of probabilities for different position states. + */ +#define POS_STATES_MAX (1 << 4) + +/* + * This enum is used to track which LZMA symbols have occurred most recently + * and in which order. This information is used to predict the next symbol. + * + * Symbols: + * - Literal: One 8-bit byte + * - Match: Repeat a chunk of data at some distance + * - Long repeat: Multi-byte match at a recently seen distance + * - Short repeat: One-byte repeat at a recently seen distance + * + * The symbol names are in from STATE_oldest_older_previous. REP means + * either short or long repeated match, and NONLIT means any non-literal. + */ +enum lzma_state { + STATE_LIT_LIT, + STATE_MATCH_LIT_LIT, + STATE_REP_LIT_LIT, + STATE_SHORTREP_LIT_LIT, + STATE_MATCH_LIT, + STATE_REP_LIT, + STATE_SHORTREP_LIT, + STATE_LIT_MATCH, + STATE_LIT_LONGREP, + STATE_LIT_SHORTREP, + STATE_NONLIT_MATCH, + STATE_NONLIT_REP +}; + +/* Total number of states */ +#define STATES 12 + +/* The lowest 7 states indicate that the previous state was a literal. */ +#define LIT_STATES 7 + +/* Indicate that the latest symbol was a literal. */ +static inline void XZ_FUNC lzma_state_literal(enum lzma_state *state) +{ + if (*state <= STATE_SHORTREP_LIT_LIT) + *state = STATE_LIT_LIT; + else if (*state <= STATE_LIT_SHORTREP) + *state -= 3; + else + *state -= 6; +} + +/* Indicate that the latest symbol was a match. */ +static inline void XZ_FUNC lzma_state_match(enum lzma_state *state) +{ + *state = *state < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH; +} + +/* Indicate that the latest state was a long repeated match. */ +static inline void XZ_FUNC lzma_state_long_rep(enum lzma_state *state) +{ + *state = *state < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP; +} + +/* Indicate that the latest symbol was a short match. */ +static inline void XZ_FUNC lzma_state_short_rep(enum lzma_state *state) +{ + *state = *state < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP; +} + +/* Test if the previous symbol was a literal. */ +static inline bool XZ_FUNC lzma_state_is_literal(enum lzma_state state) +{ + return state < LIT_STATES; +} + +/* Each literal coder is divided in three sections: + * - 0x001-0x0FF: Without match byte + * - 0x101-0x1FF: With match byte; match bit is 0 + * - 0x201-0x2FF: With match byte; match bit is 1 + * + * Match byte is used when the previous LZMA symbol was something else than + * a literal (that is, it was some kind of match). + */ +#define LITERAL_CODER_SIZE 0x300 + +/* Maximum number of literal coders */ +#define LITERAL_CODERS_MAX (1 << 4) + +/* Minimum length of a match is two bytes. */ +#define MATCH_LEN_MIN 2 + +/* Match length is encoded with 4, 5, or 10 bits. + * + * Length Bits + * 2-9 4 = Choice=0 + 3 bits + * 10-17 5 = Choice=1 + Choice2=0 + 3 bits + * 18-273 10 = Choice=1 + Choice2=1 + 8 bits + */ +#define LEN_LOW_BITS 3 +#define LEN_LOW_SYMBOLS (1 << LEN_LOW_BITS) +#define LEN_MID_BITS 3 +#define LEN_MID_SYMBOLS (1 << LEN_MID_BITS) +#define LEN_HIGH_BITS 8 +#define LEN_HIGH_SYMBOLS (1 << LEN_HIGH_BITS) +#define LEN_SYMBOLS (LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS + LEN_HIGH_SYMBOLS) + +/* + * Maximum length of a match is 273 which is a result of the encoding + * described above. + */ +#define MATCH_LEN_MAX (MATCH_LEN_MIN + LEN_SYMBOLS - 1) + +/* + * Different sets of probabilities are used for match distances that have + * very short match length: Lengths of 2, 3, and 4 bytes have a separate + * set of probabilities for each length. The matches with longer length + * use a shared set of probabilities. + */ +#define DIST_STATES 4 + +/* + * Get the index of the appropriate probability array for decoding + * the distance slot. + */ +static inline uint32_t XZ_FUNC lzma_get_dist_state(uint32_t len) +{ + return len < DIST_STATES + MATCH_LEN_MIN + ? len - MATCH_LEN_MIN : DIST_STATES - 1; +} + +/* + * The highest two bits of a 32-bit match distance are encoded using six bits. + * This six-bit value is called a distance slot. This way encoding a 32-bit + * value takes 6-36 bits, larger values taking more bits. + */ +#define DIST_SLOT_BITS 6 +#define DIST_SLOTS (1 << DIST_SLOT_BITS) + +/* Match distances up to 127 are fully encoded using probabilities. Since + * the highest two bits (distance slot) are always encoded using six bits, + * the distances 0-3 don't need any additional bits to encode, since the + * distance slot itself is the same as the actual distance. DIST_MODEL_START + * indicates the first distance slot where at least one additional bit is + * needed. + */ +#define DIST_MODEL_START 4 + +/* + * Match distances greater than 127 are encoded in three pieces: + * - distance slot: the highest two bits + * - direct bits: 2-26 bits below the highest two bits + * - alignment bits: four lowest bits + * + * Direct bits don't use any probabilities. + * + * The distance slot value of 14 is for distances 128-191. + */ +#define DIST_MODEL_END 14 + +/* Distance slots that indicate a distance <= 127. */ +#define FULL_DISTANCES_BITS (DIST_MODEL_END / 2) +#define FULL_DISTANCES (1 << FULL_DISTANCES_BITS) + +/* + * For match distances greater than 127, only the highest two bits and the + * lowest four bits (alignment) is encoded using probabilities. + */ +#define ALIGN_BITS 4 +#define ALIGN_SIZE (1 << ALIGN_BITS) +#define ALIGN_MASK (ALIGN_SIZE - 1) + +/* Total number of all probability variables */ +#define PROBS_TOTAL (1846 + LITERAL_CODERS_MAX * LITERAL_CODER_SIZE) + +/* + * LZMA remembers the four most recent match distances. Reusing these + * distances tends to take less space than re-encoding the actual + * distance value. + */ +#define REPS 4 + +#endif diff --git a/lib/qt-tar-xz/xz_private.h b/lib/qt-tar-xz/xz_private.h new file mode 100644 index 0000000..145649a --- /dev/null +++ b/lib/qt-tar-xz/xz_private.h @@ -0,0 +1,159 @@ +/* + * Private includes and definitions + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef XZ_PRIVATE_H +#define XZ_PRIVATE_H + +#ifdef __KERNEL__ + /* XZ_PREBOOT may be defined only via decompress_unxz.c. */ +# ifndef XZ_PREBOOT +# include +# include +# include +# define memeq(a, b, size) (memcmp(a, b, size) == 0) +# define memzero(buf, size) memset(buf, 0, size) +# endif +# include +# include +# define get_le32(p) le32_to_cpup((const uint32_t *)(p)) + /* XZ_IGNORE_KCONFIG may be defined only via decompress_unxz.c. */ +# ifndef XZ_IGNORE_KCONFIG +# ifdef CONFIG_XZ_DEC_X86 +# define XZ_DEC_X86 +# endif +# ifdef CONFIG_XZ_DEC_POWERPC +# define XZ_DEC_POWERPC +# endif +# ifdef CONFIG_XZ_DEC_IA64 +# define XZ_DEC_IA64 +# endif +# ifdef CONFIG_XZ_DEC_ARM +# define XZ_DEC_ARM +# endif +# ifdef CONFIG_XZ_DEC_ARMTHUMB +# define XZ_DEC_ARMTHUMB +# endif +# ifdef CONFIG_XZ_DEC_SPARC +# define XZ_DEC_SPARC +# endif +# endif +# include +#else + /* + * For userspace builds, use a separate header to define the required + * macros and functions. This makes it easier to adapt the code into + * different environments and avoids clutter in the Linux kernel tree. + */ +# include "xz_config.h" +#endif + +/* If no specific decoding mode is requested, enable support for all modes. */ +#if !defined(XZ_DEC_SINGLE) && !defined(XZ_DEC_PREALLOC) \ + && !defined(XZ_DEC_DYNALLOC) +# define XZ_DEC_SINGLE +# define XZ_DEC_PREALLOC +# define XZ_DEC_DYNALLOC +#endif + +/* + * The DEC_IS_foo(mode) macros are used in "if" statements. If only some + * of the supported modes are enabled, these macros will evaluate to true or + * false at compile time and thus allow the compiler to omit unneeded code. + */ +#ifdef XZ_DEC_SINGLE +# define DEC_IS_SINGLE(mode) ((mode) == XZ_SINGLE) +#else +# define DEC_IS_SINGLE(mode) (false) +#endif + +#ifdef XZ_DEC_PREALLOC +# define DEC_IS_PREALLOC(mode) ((mode) == XZ_PREALLOC) +#else +# define DEC_IS_PREALLOC(mode) (false) +#endif + +#ifdef XZ_DEC_DYNALLOC +# define DEC_IS_DYNALLOC(mode) ((mode) == XZ_DYNALLOC) +#else +# define DEC_IS_DYNALLOC(mode) (false) +#endif + +#if !defined(XZ_DEC_SINGLE) +# define DEC_IS_MULTI(mode) (true) +#elif defined(XZ_DEC_PREALLOC) || defined(XZ_DEC_DYNALLOC) +# define DEC_IS_MULTI(mode) ((mode) != XZ_SINGLE) +#else +# define DEC_IS_MULTI(mode) (false) +#endif + +/* + * If any of the BCJ filter decoders are wanted, define XZ_DEC_BCJ. + * XZ_DEC_BCJ is used to enable generic support for BCJ decoders. + */ +#ifndef XZ_DEC_BCJ +# if defined(XZ_DEC_X86) || defined(XZ_DEC_POWERPC) \ + || defined(XZ_DEC_IA64) || defined(XZ_DEC_ARM) \ + || defined(XZ_DEC_ARM) || defined(XZ_DEC_ARMTHUMB) \ + || defined(XZ_DEC_SPARC) +# define XZ_DEC_BCJ +# endif +#endif + +/* + * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used + * before calling xz_dec_lzma2_run(). + */ +XZ_EXTERN struct xz_dec_lzma2 * XZ_FUNC xz_dec_lzma2_create( + enum xz_mode mode, uint32_t dict_max); + +/* + * Decode the LZMA2 properties (one byte) and reset the decoder. Return + * XZ_OK on success, XZ_MEMLIMIT_ERROR if the preallocated dictionary is not + * big enough, and XZ_OPTIONS_ERROR if props indicates something that this + * decoder doesn't support. + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_reset( + struct xz_dec_lzma2 *s, uint8_t props); + +/* Decode raw LZMA2 stream from b->in to b->out. */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_run( + struct xz_dec_lzma2 *s, struct xz_buf *b); + +/* Free the memory allocated for the LZMA2 decoder. */ +XZ_EXTERN void XZ_FUNC xz_dec_lzma2_end(struct xz_dec_lzma2 *s); + +#ifdef XZ_DEC_BCJ +/* + * Allocate memory for BCJ decoders. xz_dec_bcj_reset() must be used before + * calling xz_dec_bcj_run(). + */ +XZ_EXTERN struct xz_dec_bcj * XZ_FUNC xz_dec_bcj_create(bool single_call); + +/* + * Decode the Filter ID of a BCJ filter. This implementation doesn't + * support custom start offsets, so no decoding of Filter Properties + * is needed. Returns XZ_OK if the given Filter ID is supported. + * Otherwise XZ_OPTIONS_ERROR is returned. + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_reset( + struct xz_dec_bcj *s, uint8_t id); + +/* + * Decode raw BCJ + LZMA2 stream. This must be used only if there actually is + * a BCJ filter in the chain. If the chain has only LZMA2, xz_dec_lzma2_run() + * must be called directly. + */ +XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_run(struct xz_dec_bcj *s, + struct xz_dec_lzma2 *lzma2, struct xz_buf *b); + +/* Free the memory allocated for the BCJ filters. */ +#define xz_dec_bcj_end(s) kfree(s) +#endif + +#endif diff --git a/lib/qt-tar-xz/xz_stream.h b/lib/qt-tar-xz/xz_stream.h new file mode 100644 index 0000000..2ffaa34 --- /dev/null +++ b/lib/qt-tar-xz/xz_stream.h @@ -0,0 +1,57 @@ +/* + * Definitions for handling the .xz file format + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef XZ_STREAM_H +#define XZ_STREAM_H + +#if defined(__KERNEL__) && !XZ_INTERNAL_CRC32 +# include +# undef crc32 +# define xz_crc32(buf, size, crc) \ + (~crc32_le(~(uint32_t)(crc), buf, size)) +#endif + +/* + * See the .xz file format specification at + * http://tukaani.org/xz/xz-file-format.txt + * to understand the container format. + */ + +#define STREAM_HEADER_SIZE 12 + +#define HEADER_MAGIC "\3757zXZ" +#define HEADER_MAGIC_SIZE 6 + +#define FOOTER_MAGIC "YZ" +#define FOOTER_MAGIC_SIZE 2 + +/* + * Variable-length integer can hold a 63-bit unsigned integer, or a special + * value to indicate that the value is unknown. + */ +typedef uint64_t vli_type; + +#define VLI_MAX ((vli_type)-1 / 2) +#define VLI_UNKNOWN ((vli_type)-1) + +/* Maximum encoded size of a VLI */ +#define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7) + +/* Integrity Check types */ +enum xz_check { + XZ_CHECK_NONE = 0, + XZ_CHECK_CRC32 = 1, + XZ_CHECK_CRC64 = 4, + XZ_CHECK_SHA256 = 10 +}; + +/* Maximum possible Check ID */ +#define XZ_CHECK_MAX 15 + +#endif diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..0a702b6 --- /dev/null +++ b/main.cpp @@ -0,0 +1,149 @@ +/** \file main.cpp +\brief Define the main() for the point entry +\author alpha_one_x86 +\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 + std::vector > KeysList; + //add the options hidden, will not show in options pannel + KeysList.clear(); + KeysList.push_back(std::pair("Last_version_used","na")); + #ifdef ULTRACOPIER_VERSION_ULTIMATE + KeysList.push_back(std::pair("key","")); + #endif + KeysList.push_back(std::pair("ActionOnManualOpen","1")); + KeysList.push_back(std::pair("GroupWindowWhen","0")); + KeysList.push_back(std::pair("displayOSSpecific","true")); + KeysList.push_back(std::pair("confirmToGroupWindows","true")); + KeysList.push_back(std::pair("remainingTimeAlgorithm","0")); + #ifdef ULTRACOPIER_INTERNET_SUPPORT + #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) + KeysList.push_back(std::pair("checkTheUpdate","true")); + #else + KeysList.push_back(std::pair("checkTheUpdate","false")); + #endif + #endif + OptionEngine::optionEngine->addOptionGroup("Ultracopier",KeysList); + + KeysList.clear(); + KeysList.push_back(std::pair("List","Ultracopier")); + OptionEngine::optionEngine->addOptionGroup("CopyEngine",KeysList); + + //load the GUI option + std::string defaultLogFile; + if(ResourcesManager::resourcesManager->getWritablePath()!="") + defaultLogFile=ResourcesManager::resourcesManager->getWritablePath()+"ultracopier-files.log"; + KeysList.clear(); + KeysList.push_back(std::pair("enabled","false")); + KeysList.push_back(std::pair("file",defaultLogFile)); + KeysList.push_back(std::pair("transfer","true")); + KeysList.push_back(std::pair("error","true")); + KeysList.push_back(std::pair("folder","true")); + KeysList.push_back(std::pair("sync","true")); + KeysList.push_back(std::pair("transfer_format","[%time%] %source% (%size%) %destination%")); + KeysList.push_back(std::pair("error_format","[%time%] %path%, %error%")); + KeysList.push_back(std::pair("folder_format","[%time%] %operation% %path%")); + OptionEngine::optionEngine->addOptionGroup("Write_log",KeysList); + + KeysList.clear(); + KeysList.push_back(std::pair("CatchCopyAsDefault","true")); + OptionEngine::optionEngine->addOptionGroup("CopyListener",KeysList); + + KeysList.clear(); + KeysList.push_back(std::pair("LoadAtSessionStarting","true")); + OptionEngine::optionEngine->addOptionGroup("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); + 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/other-pro/static.pro b/other-pro/static.pro new file mode 100644 index 0000000..318df94 --- /dev/null +++ b/other-pro/static.pro @@ -0,0 +1,33 @@ +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE + +include(ultracopier-core.pro) + +RESOURCES += $$PWD/../plugins/static-plugins.qrc \ + $$PWD/../plugins/CopyEngine/Ultracopier/copyEngineResources.qrc + +win32:RESOURCES += $$PWD/../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 -= $$PWD/../lib/qt-tar-xz/xz.h \ + $$PWD/../lib/qt-tar-xz/QXzDecodeThread.h \ + $$PWD/../lib/qt-tar-xz/QXzDecode.h \ + $$PWD/../lib/qt-tar-xz/QTarDecode.h \ + $$PWD/../AuthPlugin.h +SOURCES -= $$PWD/../lib/qt-tar-xz/QXzDecodeThread.cpp \ + $$PWD/../lib/qt-tar-xz/QXzDecode.cpp \ + $$PWD/../lib/qt-tar-xz/QTarDecode.cpp \ + $$PWD/../lib/qt-tar-xz/xz_crc32.c \ + $$PWD/../lib/qt-tar-xz/xz_dec_stream.c \ + $$PWD/../lib/qt-tar-xz/xz_dec_lzma2.c \ + $$PWD/../lib/qt-tar-xz/xz_dec_bcj.c \ + $$PWD/../AuthPlugin.cpp +INCLUDEPATH -= $$PWD/../lib/qt-tar-xz/ + +RESOURCES -= $$PWD/../resources/resources-windows-qt-plugin.qrc diff --git a/other-pro/supercopier-core.pro b/other-pro/supercopier-core.pro new file mode 100644 index 0000000..eb6d143 --- /dev/null +++ b/other-pro/supercopier-core.pro @@ -0,0 +1,3 @@ +#DEFINES += ULTRACOPIER_MODE_SUPERCOPIER done via .sh and Variable.h + +include(ultracopier-core.pro) diff --git a/other-pro/ultracopier-core.pro b/other-pro/ultracopier-core.pro new file mode 100644 index 0000000..24931f0 --- /dev/null +++ b/other-pro/ultracopier-core.pro @@ -0,0 +1,131 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" +#QMAKE_CXXFLAGS+="-Wall -Wextra -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-unused-macros -Wno-newline-eof -Wno-exit-time-destructors -Wno-global-constructors -Wno-gnu-zero-variadic-macro-arguments -Wno-documentation -Wno-shadow -Wno-missing-prototypes -Wno-padded -Wno-covered-switch-default -Wno-old-style-cast -Wno-documentation-unknown-command -Wno-switch-enum -Wno-undefined-reinterpret-cast -Wno-unreachable-code-break -Wno-sign-conversion -Wno-float-conversion" + +TEMPLATE = app +QT += network xml widgets +TRANSLATIONS += $$PWD/../plugins/Languages/ar/translation.ts \ + $$PWD/../plugins/Languages/de/translation.ts \ + $$PWD/../plugins/Languages/el/translation.ts \ + $$PWD/../resources/Languages/en/translation.ts \ + $$PWD/../plugins/Languages/es/translation.ts \ + $$PWD/../plugins/Languages/fr/translation.ts \ + $$PWD/../plugins/Languages/hi/translation.ts \ + $$PWD/../plugins/Languages/hu/translation.ts \ + $$PWD/../plugins/Languages/id/translation.ts \ + $$PWD/../plugins/Languages/it/translation.ts \ + $$PWD/../plugins/Languages/ja/translation.ts \ + $$PWD/../plugins/Languages/ko/translation.ts \ + $$PWD/../plugins/Languages/nl/translation.ts \ + $$PWD/../plugins/Languages/no/translation.ts \ + $$PWD/../plugins/Languages/pl/translation.ts \ + $$PWD/../plugins/Languages/pt/translation.ts \ + $$PWD/../plugins/Languages/ru/translation.ts \ + $$PWD/../plugins/Languages/th/translation.ts \ + $$PWD/../plugins/Languages/tr/translation.ts \ + $$PWD/../plugins/Languages/zh/translation.ts \ + $$PWD/../plugins/Languages/zh_TW/translation.ts + +TARGET = ultracopier +macx { + ICON = $$PWD/../resources/ultracopier.icns + #QT += macextras +} +FORMS += $$PWD/../HelpDialog.ui \ + $$PWD/../PluginInformation.ui \ + $$PWD/../OptionDialog.ui \ + $$PWD/../OSSpecific.ui +RESOURCES += \ + $$PWD/../resources/ultracopier-resources.qrc \ + $$PWD/../resources/ultracopier-resources_unix.qrc \ + $$PWD/../resources/ultracopier-resources_windows.qrc +win32 { + RESOURCES += $$PWD/../resources/resources-windows-qt-plugin.qrc + RC_FILE += $$PWD/../resources/resources-windows.rc + #LIBS += -lpdh + LIBS += -ladvapi32 +} + +HEADERS += $$PWD/../ResourcesManager.h \ + $$PWD/../ThemesManager.h \ + $$PWD/../SystrayIcon.h \ + $$PWD/../StructEnumDefinition.h \ + $$PWD/../EventDispatcher.h \ + $$PWD/../Environment.h \ + $$PWD/../DebugEngine.h \ + $$PWD/../Core.h \ + $$PWD/../OptionEngine.h \ + $$PWD/../HelpDialog.h \ + $$PWD/../PluginsManager.h \ + $$PWD/../LanguagesManager.h \ + $$PWD/../DebugEngineMacro.h \ + $$PWD/../PluginInformation.h \ + $$PWD/../lib/qt-tar-xz/xz.h \ + $$PWD/../lib/qt-tar-xz/QXzDecodeThread.h \ + $$PWD/../lib/qt-tar-xz/QXzDecode.h \ + $$PWD/../lib/qt-tar-xz/QTarDecode.h \ + $$PWD/../SessionLoader.h \ + $$PWD/../ExtraSocket.h \ + $$PWD/../CopyListener.h \ + $$PWD/../CopyEngineManager.h \ + $$PWD/../PlatformMacro.h \ + $$PWD/../interface/PluginInterface_Themes.h \ + $$PWD/../interface/PluginInterface_SessionLoader.h \ + $$PWD/../interface/PluginInterface_Listener.h \ + $$PWD/../interface/PluginInterface_CopyEngine.h \ + $$PWD/../interface/OptionInterface.h \ + $$PWD/../Variable.h \ + $$PWD/../PluginLoader.h \ + $$PWD/../interface/PluginInterface_PluginLoader.h \ + $$PWD/../OptionDialog.h \ + $$PWD/../LocalPluginOptions.h \ + $$PWD/../LocalListener.h \ + $$PWD/../CliParser.h \ + $$PWD/../interface/FacilityInterface.h \ + $$PWD/../FacilityEngine.h \ + $$PWD/../LogThread.h \ + $$PWD/../CompilerInfo.h \ + $$PWD/../StructEnumDefinition_UltracopierSpecific.h \ + $$PWD/../OSSpecific.h \ + $$PWD/../cpp11addition.h \ + $$PWD/../InternetUpdater.h +SOURCES += $$PWD/../ThemesManager.cpp \ + $$PWD/../ResourcesManager.cpp \ + $$PWD/../main.cpp \ + $$PWD/../EventDispatcher.cpp \ + $$PWD/../SystrayIcon.cpp \ + $$PWD/../DebugEngine.cpp \ + $$PWD/../OptionEngine.cpp \ + $$PWD/../HelpDialog.cpp \ + $$PWD/../PluginsManager.cpp \ + $$PWD/../LanguagesManager.cpp \ + $$PWD/../PluginInformation.cpp \ + $$PWD/../lib/qt-tar-xz/QXzDecodeThread.cpp \ + $$PWD/../lib/qt-tar-xz/QXzDecode.cpp \ + $$PWD/../lib/qt-tar-xz/QTarDecode.cpp \ + $$PWD/../lib/qt-tar-xz/xz_crc32.c \ + $$PWD/../lib/qt-tar-xz/xz_dec_stream.c \ + $$PWD/../lib/qt-tar-xz/xz_dec_lzma2.c \ + $$PWD/../lib/qt-tar-xz/xz_dec_bcj.c \ + $$PWD/../SessionLoader.cpp \ + $$PWD/../ExtraSocket.cpp \ + $$PWD/../CopyListener.cpp \ + $$PWD/../CopyEngineManager.cpp \ + $$PWD/../Core.cpp \ + $$PWD/../PluginLoader.cpp \ + $$PWD/../OptionDialog.cpp \ + $$PWD/../LocalPluginOptions.cpp \ + $$PWD/../LocalListener.cpp \ + $$PWD/../CliParser.cpp \ + $$PWD/../FacilityEngine.cpp \ + $$PWD/../LogThread.cpp \ + $$PWD/../OSSpecific.cpp \ + $$PWD/../cpp11addition.cpp \ + $$PWD/../DebugModel.cpp \ + $$PWD/../InternetUpdater.cpp \ + $$PWD/../cpp11additionstringtointcpp.cpp +INCLUDEPATH += \ + $$PWD/../lib/qt-tar-xz/ + +OTHER_FILES += $$PWD/../resources/resources-windows.rc diff --git a/other-pro/ultracopier-static.pro b/other-pro/ultracopier-static.pro new file mode 100644 index 0000000..48a5cad --- /dev/null +++ b/other-pro/ultracopier-static.pro @@ -0,0 +1,6 @@ +include(static.pro) + +RESOURCES += $$PWD/../plugins/static-plugins-oxygen.qrc \ + $$PWD/../plugins/Themes/Oxygen/interfaceResources_windows.qrc \ + $$PWD/../plugins/Themes/Oxygen/interfaceResources_unix.qrc \ + $$PWD/../plugins/Themes/Oxygen/interfaceResources.qrc diff --git a/plugins-alternative/Listener/dbus/Catchcopy.cpp b/plugins-alternative/Listener/dbus/Catchcopy.cpp new file mode 100644 index 0000000..6c46af2 --- /dev/null +++ b/plugins-alternative/Listener/dbus/Catchcopy.cpp @@ -0,0 +1,17 @@ +#include "Catchcopy.h" + +#include + +Catchcopy::Catchcopy() +{ +} + +void Catchcopy::copy(const QStringList &sources,const QString &destination) +{ + emit newCopy(0,sources,destination); +} + +void Catchcopy::move(const QStringList &sources,const QString &destination) +{ + emit newMove(0,sources,destination); +} diff --git a/plugins-alternative/Listener/dbus/Catchcopy.h b/plugins-alternative/Listener/dbus/Catchcopy.h new file mode 100644 index 0000000..d28a253 --- /dev/null +++ b/plugins-alternative/Listener/dbus/Catchcopy.h @@ -0,0 +1,20 @@ +#ifndef CATCHCOPY_H +#define CATCHCOPY_H + +#include +#include + +class Catchcopy : public QObject +{ + Q_OBJECT +public: + explicit Catchcopy(); +signals: + 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(const QStringList &sources,const QString &destination); + Q_SCRIPTABLE void move(const QStringList &sources,const QString &destination); +}; + +#endif // CATCHCOPY_H diff --git a/plugins-alternative/Listener/dbus/DebugEngineMacro.h b/plugins-alternative/Listener/dbus/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins-alternative/Listener/dbus/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/Listener/dbus/Environment.h b/plugins-alternative/Listener/dbus/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins-alternative/Listener/dbus/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/Listener/dbus/StructEnumDefinition.h b/plugins-alternative/Listener/dbus/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/Listener/dbus/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/Listener/dbus/Variable.h b/plugins-alternative/Listener/dbus/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins-alternative/Listener/dbus/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/Listener/dbus/documentation.dox b/plugins-alternative/Listener/dbus/documentation.dox new file mode 100644 index 0000000..2eb3c87 --- /dev/null +++ b/plugins-alternative/Listener/dbus/documentation.dox @@ -0,0 +1,36 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage dbus + + \section mainpage_overview Overview + + 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 + + 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 find the link on Ultracopier project page, via git, snapshot sources, ... + + \section mainpage_algorithm Dbus method + + 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-alternative/Listener/dbus/informations.xml b/plugins-alternative/Listener/dbus/informations.xml new file mode 100644 index 0000000..6ecae52 --- /dev/null +++ b/plugins-alternative/Listener/dbus/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Listener for catchcopy in dbus]]> + <![CDATA[Écouteur pour catchcopy en dbus]]> + + Listener + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + dbus + + + \ No newline at end of file diff --git a/plugins-alternative/Listener/dbus/listener.cpp b/plugins-alternative/Listener/dbus/listener.cpp new file mode 100644 index 0000000..50ed196 --- /dev/null +++ b/plugins-alternative/Listener/dbus/listener.cpp @@ -0,0 +1,85 @@ +#include "listener.h" + +Listener::Listener() +{ + connect(&catchcopy,&Catchcopy::newCopy, this,&Listener::newCopy); + connect(&catchcopy,&Catchcopy::newMove, this,&Listener::newMove); +} + +void Listener::listen() +{ + 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 Listener::close() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QDBusConnection::sessionBus().unregisterObject("/"); + QDBusConnection::sessionBus().unregisterService("info.first-world.catchcopy"); + emit newState(Ultracopier::NotListening); +} + +const QString Listener::errorString() const +{ + return "Unknow error"; +} + +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); +} + +/// \brief to get the options widget, NULL if not have +QWidget * Listener::options() +{ + return NULL; +} + +void Listener::transferFinished(const quint32 &orderId,const bool &withError) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+QString::number(orderId)+", withError: "+QString::number(withError)); +} + +void Listener::transferCanceled(const quint32 &orderId) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+QString::number(orderId)); +} + +/// \brief to reload the translation, because the new language have been loaded +void Listener::newLanguageLoaded() +{ +} + +void Listener::error(QString error) +{ + Q_UNUSED(error); +} + +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)); +} diff --git a/plugins-alternative/Listener/dbus/listener.h b/plugins-alternative/Listener/dbus/listener.h new file mode 100644 index 0000000..fcb95cd --- /dev/null +++ b/plugins-alternative/Listener/dbus/listener.h @@ -0,0 +1,49 @@ +/** \file listener.h +\brief Define the server compatible with Ultracopier interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef SERVER_H +#define SERVER_H + +#include +#include +#include + +#include "Catchcopy.h" +#include "Environment.h" +#include "../../../interface/PluginInterface_Listener.h" + +/// \brief Define the server compatible with Ultracopier interface +class Listener : public 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: + 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(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; +private slots: + void error(QString error); + void clientName(quint32 client,QString name); +}; + +#endif // SERVER_H diff --git a/plugins-alternative/Listener/dbus/listener.pro b/plugins-alternative/Listener/dbus/listener.pro new file mode 100644 index 0000000..16cd3d3 --- /dev/null +++ b/plugins-alternative/Listener/dbus/listener.pro @@ -0,0 +1,19 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +TEMPLATE = lib +CONFIG += plugin +QT += network dbus +HEADERS = \ + $$PWD/listener.h \ + $$PWD/Environment.h \ + $$PWD/Variable.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/StructEnumDefinition.h \ + $$PWD/../../../interface/PluginInterface_Listener.h \ + $$PWD/Catchcopy.h +SOURCES = \ + $$PWD/listener.cpp \ + $$PWD/Catchcopy.cpp +TARGET = $$qtLibraryTarget(listener) diff --git a/plugins-alternative/Listener/dbus/plugin.json b/plugins-alternative/Listener/dbus/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/Listener/dbus/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file 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..b9c9d13 --- /dev/null +++ b/plugins-alternative/PluginLoader/keybinding/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 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 find the link on Ultracopier 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..213c7bd --- /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.4.0.4 + + 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/SessionLoader/KDE4/DebugEngineMacro.h b/plugins-alternative/SessionLoader/KDE4/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/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/SessionLoader/KDE4/Environment.h b/plugins-alternative/SessionLoader/KDE4/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/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/SessionLoader/KDE4/StructEnumDefinition.h b/plugins-alternative/SessionLoader/KDE4/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/SessionLoader/KDE4/Variable.h b/plugins-alternative/SessionLoader/KDE4/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/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/SessionLoader/KDE4/documentation.dox b/plugins-alternative/SessionLoader/KDE4/documentation.dox new file mode 100644 index 0000000..cf5f3e4 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/documentation.dox @@ -0,0 +1,32 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage KDE4 + + \section mainpage_overview Overview + + It control if it loaded with the session.\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 find the link on Ultracopier project page, via git, snapshot sources, ... + + \section mainpage_algorithm Method + + It pass by ~/.kde4/Autostart/ultracopier.sh to set/get it. + + \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/SessionLoader/KDE4/informations.xml b/plugins-alternative/SessionLoader/KDE4/informations.xml new file mode 100644 index 0000000..14f8bea --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Session loader for test]]> + <![CDATA[Chargeur de session pour des testes]]> + + SessionLoader + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + KDE4 + + + \ No newline at end of file diff --git a/plugins-alternative/SessionLoader/KDE4/plugin.json b/plugins-alternative/SessionLoader/KDE4/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/SessionLoader/KDE4/sessionLoader.cpp b/plugins-alternative/SessionLoader/KDE4/sessionLoader.cpp new file mode 100644 index 0000000..8024264 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/sessionLoader.cpp @@ -0,0 +1,58 @@ +/** \file session-loader.cpp +\brief Define the session plugin loader test +\author alpha_one_x86 +*/ + +#include +#include +#include + +#include "sessionLoader.h" +void KDESessionLoader::setEnabled(const bool &enabled) +{ + 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 KDESessionLoader::getEnabled() const +{ + //return the value into the variable + return QFile::exists(QDir::homePath()+"/.kde4/Autostart/ultracopier.sh"); +} + +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); +} + +/// \brief to get the options widget, NULL if not have +QWidget * KDESessionLoader::options() +{ + return NULL; +} + +/// \brief to reload the translation, because the new language have been loaded +void KDESessionLoader::newLanguageLoaded() +{ +} diff --git a/plugins-alternative/SessionLoader/KDE4/sessionLoader.h b/plugins-alternative/SessionLoader/KDE4/sessionLoader.h new file mode 100644 index 0000000..b037da7 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/sessionLoader.h @@ -0,0 +1,33 @@ +/** \file sessionLoader.h +\brief Define the session loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef SESSION_LOADER_PLUGIN_H +#define SESSION_LOADER_PLUGIN_H + +#include +#include "Environment.h" +#include "../../../interface/PluginInterface_SessionLoader.h" + +/// \brief Define the session loader +class KDESessionLoader : 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(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(); +}; + +#endif // SESSION_LOADER_PLUGIN_H diff --git a/plugins-alternative/SessionLoader/KDE4/sessionLoader.pro b/plugins-alternative/SessionLoader/KDE4/sessionLoader.pro new file mode 100644 index 0000000..4ac69b4 --- /dev/null +++ b/plugins-alternative/SessionLoader/KDE4/sessionLoader.pro @@ -0,0 +1,15 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +TEMPLATE = lib +CONFIG += plugin +HEADERS = \ + $$PWD/sessionLoader.h \ + $$PWD/StructEnumDefinition.h \ + $$PWD/Variable.h \ + $$PWD/Environment.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/../../../interface/PluginInterface_SessionLoader.h +SOURCES = sessionLoader.cpp +TARGET = $$qtLibraryTarget(sessionLoader) diff --git a/plugins-alternative/Themes/Clean/Languages/ar/translation.ts b/plugins-alternative/Themes/Clean/Languages/ar/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/ar/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/de/translation.ts b/plugins-alternative/Themes/Clean/Languages/de/translation.ts new file mode 100644 index 0000000..0a833ee --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/de/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 Dateien, %3/%4 + + + + interface + + + Action: + Aktion: + + + + Waiting + Warten + + + + 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/Clean/Languages/el/translation.ts b/plugins-alternative/Themes/Clean/Languages/el/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/el/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/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 new file mode 100644 index 0000000..87f57c8 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/es/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 archivos, %3/%4 + + + + interface + + + Action: + Acción: + + + + Waiting + + + + + 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/Clean/Languages/fr/translation.ts b/plugins-alternative/Themes/Clean/Languages/fr/translation.ts new file mode 100644 index 0000000..79f32d5 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/fr/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 fichiers, %3/%4 + + + + interface + + + Action: + Action: + + + + 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 + + + + Waiting + + + + + Add file + Ajout de fichier + + + diff --git a/plugins-alternative/Themes/Clean/Languages/hi/translation.ts b/plugins-alternative/Themes/Clean/Languages/hi/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/hi/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/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 new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/id/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/it/translation.ts b/plugins-alternative/Themes/Clean/Languages/it/translation.ts new file mode 100644 index 0000000..3237bd6 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/it/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 file, %3/%4 + + + + interface + + + Action: + Azione: + + + + Waiting + + + + + 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 cartella + + + diff --git a/plugins-alternative/Themes/Clean/Languages/ja/translation.ts b/plugins-alternative/Themes/Clean/Languages/ja/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/ja/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/ko/translation.ts b/plugins-alternative/Themes/Clean/Languages/ko/translation.ts new file mode 100644 index 0000000..9e05f0f --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/ko/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 파일, %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/nl/translation.ts b/plugins-alternative/Themes/Clean/Languages/nl/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/nl/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/no/translation.ts b/plugins-alternative/Themes/Clean/Languages/no/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/no/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/pl/translation.ts b/plugins-alternative/Themes/Clean/Languages/pl/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/pl/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/ru/translation.ts b/plugins-alternative/Themes/Clean/Languages/ru/translation.ts new file mode 100644 index 0000000..ece0e7b --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/ru/translation.ts @@ -0,0 +1,55 @@ + + + + + InterfacePlugin + + + %1/%2 files, %3/%4 + %1/%2 файлы, %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/th/translation.ts b/plugins-alternative/Themes/Clean/Languages/th/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/th/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/tr/translation.ts b/plugins-alternative/Themes/Clean/Languages/tr/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/tr/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/zh/translation.ts b/plugins-alternative/Themes/Clean/Languages/zh/translation.ts new file mode 100644 index 0000000..54104e3 --- /dev/null +++ b/plugins-alternative/Themes/Clean/Languages/zh/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/StructEnumDefinition.h b/plugins-alternative/Themes/Clean/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/Themes/Clean/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/Themes/Clean/documentation.dox b/plugins-alternative/Themes/Clean/documentation.dox new file mode 100644 index 0000000..589d9c7 --- /dev/null +++ b/plugins-alternative/Themes/Clean/documentation.dox @@ -0,0 +1,28 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage Clean + + \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 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 find the link on Ultracopier 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. + +*/ diff --git a/plugins-alternative/Themes/Clean/factory.cpp b/plugins-alternative/Themes/Clean/factory.cpp new file mode 100644 index 0000000..6acbe3a --- /dev/null +++ b/plugins-alternative/Themes/Clean/factory.cpp @@ -0,0 +1,65 @@ +/** \file factory.cpp +\brief Define the factory core +\author alpha_one_x86 +*/ + +#include "factory.h" + +PluginInterface_Themes * ThemesFactory::getInstance() +{ + InterfacePlugin * newInterface=new InterfacePlugin(facilityEngine); + connect(this,&ThemesFactory::reloadLanguage,newInterface,&InterfacePlugin::newLanguageLoaded); + return newInterface; +} + +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=facilityInterface; + 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/Clean/resources/"+fileName); +} + +void ThemesFactory::resetOptions() +{ +} + +void ThemesFactory::newLanguageLoaded() +{ + emit reloadLanguage(); +} diff --git a/plugins-alternative/Themes/Clean/factory.h b/plugins-alternative/Themes/Clean/factory.h new file mode 100644 index 0000000..f9b1ee2 --- /dev/null +++ b/plugins-alternative/Themes/Clean/factory.h @@ -0,0 +1,39 @@ +/** \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 "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: + /// \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 new file mode 100644 index 0000000..4a2f826 --- /dev/null +++ b/plugins-alternative/Themes/Clean/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Clean style for Ultracopier]]> + <![CDATA[Style Clean pour Ultracopier]]> + + Themes + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + Clean + + + \ No newline at end of file diff --git a/plugins-alternative/Themes/Clean/interface.cpp b/plugins-alternative/Themes/Clean/interface.cpp new file mode 100644 index 0000000..3f2cd2a --- /dev/null +++ b/plugins-alternative/Themes/Clean/interface.cpp @@ -0,0 +1,426 @@ +/** \file interface.cpp +\brief Define the interface core +\author alpha_one_x86 +*/ + +#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; + 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; +} + +void InterfacePlugin::forcedModeAddFile() +{ + emit userAddFile(mode); +} + +void InterfacePlugin::forcedModeAddFolder() +{ + emit userAddFolder(mode); +} + +void InterfacePlugin::forcedModeAddFileToCopy() +{ + emit userAddFile(Ultracopier::Copy); +} + +void InterfacePlugin::forcedModeAddFolderToCopy() +{ + emit userAddFolder(Ultracopier::Copy); +} + +void InterfacePlugin::forcedModeAddFileToMove() +{ + emit userAddFile(Ultracopier::Move); +} + +void InterfacePlugin::forcedModeAddFolderToMove() +{ + emit userAddFolder(Ultracopier::Move); +} + +void InterfacePlugin::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 InterfacePlugin::closeEvent(QCloseEvent *event) +{ + event->ignore(); + this->hide(); + emit cancel(); +} + +void InterfacePlugin::detectedSpeed(const quint64 &speed) +{ + Q_UNUSED(speed) +} + +QWidget * InterfacePlugin::getOptionsEngineWidget() +{ + return NULL; +} + +void InterfacePlugin::getOptionsEngineEnabled(const bool &isEnabled) +{ + Q_UNUSED(isEnabled) +} + +void InterfacePlugin::setCopyType(const Ultracopier::CopyType &type) +{ + this->type=type; + updateModeAndType(); +} + +void InterfacePlugin::forceCopyMode(const Ultracopier::CopyMode &mode) +{ + modeIsForced=true; + this->mode=mode; + updateModeAndType(); +} + +void InterfacePlugin::updateTitle() +{ + 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) +} + +void InterfacePlugin::newFolderListing(const QString &path) +{ + if(action==Ultracopier::Listing) + ui->text->setText(path); +} + +void InterfacePlugin::remainingTime(const int &remainingSeconds) +{ + Q_UNUSED(remainingSeconds) +} + +void InterfacePlugin::newCollisionAction(const QString &action) +{ + Q_UNUSED(action) +} + +void InterfacePlugin::newErrorAction(const QString &action) +{ + Q_UNUSED(action) +} + +void InterfacePlugin::errorDetected() +{ +} + +/// \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) +} + +//speed limitation +bool InterfacePlugin::setSpeedLimitation(const qint64 &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); +} + +void InterfacePlugin::setCollisionAction(const QList > &list) +{ + Q_UNUSED(list) +} + +void InterfacePlugin::setErrorAction(const QList > &list) +{ + Q_UNUSED(list) +} + +//edit the transfer list +void InterfacePlugin::getActionOnList(const QList &returnActions) +{ + Q_UNUSED(returnActions) +} + +void InterfacePlugin::haveExternalOrder() +{ + ui->toolButton->hide(); +} + +void InterfacePlugin::isInPause(const bool &isInPause) +{ + //resume in auto the pause + if(isInPause) + emit resume(); +} + +void InterfacePlugin::newLanguageLoaded() +{ + ui->retranslateUi(this); + updateTitle(); +} + +/* + Return[0]: totalFile + 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_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 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 new file mode 100644 index 0000000..e5b5c36 --- /dev/null +++ b/plugins-alternative/Themes/Clean/interface.h @@ -0,0 +1,141 @@ +/** \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" + +namespace Ui { + class interface; +} + +/// \brief Define the interface +class InterfacePlugin : 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 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; + 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 DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif +public: + //constructor and destructor + InterfacePlugin(FacilityInterface * facilityEngine); + ~InterfacePlugin(); +private: + 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(); +}; + +#endif // INTERFACE_TEST_H diff --git a/plugins-alternative/Themes/Clean/interface.pro b/plugins-alternative/Themes/Clean/interface.pro new file mode 100644 index 0000000..eb124c9 --- /dev/null +++ b/plugins-alternative/Themes/Clean/interface.pro @@ -0,0 +1,46 @@ +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 +SOURCES = interface.cpp \ + factory.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/Clean/interface.ui b/plugins-alternative/Themes/Clean/interface.ui new file mode 100644 index 0000000..f178af7 --- /dev/null +++ b/plugins-alternative/Themes/Clean/interface.ui @@ -0,0 +1,131 @@ + + + interface + + + + 0 + 0 + 139 + 55 + + + + Ultracopier + + + + :/systray_Caught_Unix.png:/systray_Caught_Unix.png + + + + 0 + + + 0 + + + + + + + Action: + + + + + + + + true + + + + Waiting + + + + + + + + + + + 65535 + + + + + + + ... + + + QToolButton::InstantPopup + + + + + + + + + + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png + + + Add file + + + + + + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png + + + Add folder + + + + + + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png + + + Move file(s) + + + + + + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png + + + Move folder + + + + + + :/Themes/Clean/resources/add.png:/Themes/Clean/resources/add.png + + + Copy file(s) + + + + + + :/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 new file mode 100644 index 0000000..40533c4 --- /dev/null +++ b/plugins-alternative/Themes/Clean/resources.qrc @@ -0,0 +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 new file mode 100644 index 0000000..5b7b255 Binary files /dev/null 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 new file mode 100644 index 0000000..6f5d1cf Binary files /dev/null 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 new file mode 100644 index 0000000..5464856 Binary files /dev/null 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 new file mode 100644 index 0000000..3961215 Binary files /dev/null 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 new file mode 100644 index 0000000..45d6315 Binary files /dev/null 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 new file mode 100644 index 0000000..ac4299a Binary files /dev/null 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 new file mode 100644 index 0000000..6e6bae7 Binary files /dev/null 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 new file mode 100644 index 0000000..847cc1c --- /dev/null +++ b/plugins-alternative/Themes/Clean/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/Clean/resources_windows.qrc b/plugins-alternative/Themes/Clean/resources_windows.qrc new file mode 100644 index 0000000..7d8bbe1 --- /dev/null +++ b/plugins-alternative/Themes/Clean/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/Themes/Teracopy/DebugEngineMacro.h b/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/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/Teracopy/Environment.h b/plugins-alternative/Themes/Teracopy/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/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/Teracopy/Languages/ar/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/ar/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/de/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts new file mode 100644 index 0000000..a2da10c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + Total: %1 von %2 + + + + %1 of %2 + %1 von %2 + + + + %1% done + %1% erledigt + + + + interfaceCopy + + + &More + &Mehr + + + + ... + ... + + + + &Pause + &Pause + + + + &Skip + überspringen (&S) + + + + &Cancel + Abbrechen (&C) + + + + <!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;">unterstützen Ultracopier</span></a></p></body></html> + + + + 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 + + + diff --git a/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/el/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/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 new file mode 100644 index 0000000..5081c0f --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + Total: %1 de %2 + + + + %1 of %2 + %1 de %2 + + + + %1% done + %1% hecho + + + + interfaceCopy + + + &More + Más + + + + ... + + + + + &Pause + Pausa + + + + &Skip + Omitir + + + + &Cancel + Cancelar + + + + <!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;">Apoyar Ultracopier</span></a></p></body></html> + + + + 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/Teracopy/Languages/fr/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts new file mode 100644 index 0000000..fd6eaa1 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts @@ -0,0 +1,94 @@ + + + + + Themes + + + Total: %1 of %2 + Total: %1 sur %2 + + + + %1 of %2 + %1 sur %2 + + + + %1% done + Exemple: 90% fait + %1% fait + + + + interfaceCopy + + + &More + &Plus + + + + ... + ... + + + + &Pause + &Pause + + + + &Skip + &Passer + + + + &Cancel + &Anuler + + + + <!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;">Supporter Ultracopier</span></a></p></body></html> + + + + Add file + Ajouter un fichier + + + + Add folder + Ajouter un dossier + + + + Move file(s) + Déplacer des fichier(s) + + + + Move folder + Déplacer un dossier + + + + Copy file(s) + Copier des fichier(s) + + + + Copy folder + Copier un dossier + + + diff --git a/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/hi/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/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 new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/id/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/it/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts new file mode 100644 index 0000000..31d775e --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + Totale: %1 di %2 + + + + %1 of %2 + %1 di %2 + + + + %1% done + %1% fatto + + + + interfaceCopy + + + &More + Alt&o + + + + ... + ... + + + + &Pause + &Pausa + + + + &Skip + &Salta + + + + &Cancel + &Annulla + + + + <!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;">Supporto Ultracopier</span></a></p></body></html> + + + + 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/Teracopy/Languages/ja/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/ja/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/ko/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts new file mode 100644 index 0000000..06946e9 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + 전체: %3 / %2 {1 ?} + + + + %1 of %2 + %1 / %2 + + + + %1% done + %1% 완료 + + + + 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> + <!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;">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/nl/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/nl/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/no/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/no/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/pl/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/pl/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/ru/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts new file mode 100644 index 0000000..db1059e --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + Всего: %1 из %2 + + + + %1 of %2 + %1 из %2 + + + + %1% done + %1% сделанный + + + + 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> + <!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;">поддержка 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/th/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/th/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/tr/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/tr/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/zh/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts new file mode 100644 index 0000000..b76694c --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/zh/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/StructEnumDefinition.h b/plugins-alternative/Themes/Teracopy/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins-alternative/Themes/Teracopy/TransferModel.cpp b/plugins-alternative/Themes/Teracopy/TransferModel.cpp new file mode 100644 index 0000000..24812a0 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/TransferModel.cpp @@ -0,0 +1,528 @@ +#include "TransferModel.h" + +#define COLUMN_COUNT 3 + +// Model + +TransferModel::TransferModel() +{ + 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; +} + +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[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; +} + +quint64 TransferModel::firstId() +{ + 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"); + } + } + + 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; + 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(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; +} + +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_Critical,"progression remaning items"); + #endif +} + +TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() +{ + 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 new file mode 100644 index 0000000..977c986 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/TransferModel.h @@ -0,0 +1,92 @@ +#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 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(QList &progressionList); + + 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; +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; +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/Teracopy/Variable.h b/plugins-alternative/Themes/Teracopy/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/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/Teracopy/documentation.dox b/plugins-alternative/Themes/Teracopy/documentation.dox new file mode 100644 index 0000000..ee76e20 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/documentation.dox @@ -0,0 +1,28 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- **/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage Teracopy + + \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 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 find the link on Ultracopier 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. + +*/ diff --git a/plugins-alternative/Themes/Teracopy/factory.cpp b/plugins-alternative/Themes/Teracopy/factory.cpp new file mode 100644 index 0000000..2b176bf --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/factory.cpp @@ -0,0 +1,70 @@ +/** \file factory.cpp +\brief Define the factory core +\author alpha_one_x86 +*/ + +#include "factory.h" + +PluginInterface_Themes * ThemesFactory::getInstance() +{ + 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 ThemesFactory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &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 * ThemesFactory::options() +{ + return NULL; +} + +void ThemesFactory::resetOptions() +{ +} + +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/Teracopy/resources/"+fileName); +} + +void ThemesFactory::newLanguageLoaded() +{ + emit reloadLanguage(); +} diff --git a/plugins-alternative/Themes/Teracopy/factory.h b/plugins-alternative/Themes/Teracopy/factory.h new file mode 100644 index 0000000..0b3bb3f --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/factory.h @@ -0,0 +1,42 @@ +/** \file factory.h +\brief Define the factory +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef FACTORY_H +#define FACTORY_H + +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_Themes.h" +#include "interface.h" +#include "Environment.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: + /// \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(); +signals: + void reloadLanguage(); +private: + FacilityInterface * facilityEngine; +}; + +#endif // FACTORY_H diff --git a/plugins-alternative/Themes/Teracopy/informations.xml b/plugins-alternative/Themes/Teracopy/informations.xml new file mode 100644 index 0000000..a28e08d --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Teracopy style for Ultracopier]]> + <![CDATA[Style Teracopy pour Ultracopier]]> + + Themes + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + Teracopy + + + \ No newline at end of file diff --git a/plugins-alternative/Themes/Teracopy/interface.cpp b/plugins-alternative/Themes/Teracopy/interface.cpp new file mode 100644 index 0000000..64220d0 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/interface.cpp @@ -0,0 +1,500 @@ +/** \file interface.cpp +\brief Define the interface core +\author alpha_one_x86 +*/ + +#include +#include + +#include "interface.h" +#include "ui_interface.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 + +Themes::Themes(FacilityInterface * facilityEngine) : + ui(new Ui::interfaceCopy()) +{ + 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); + + 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,&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); +} + +Themes::~Themes() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); +} + +QWidget * Themes::getOptionsEngineWidget() +{ + return &optionEngineWidget; +} + +void Themes::getOptionsEngineEnabled(const bool &isEnabled) +{ + Q_UNUSED(isEnabled); +} + +/// \brief set if transfer list is exportable/importable +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() +{ + 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 Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) +{ + 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 Themes::newFolderListing(const QString &path) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(action==Ultracopier::Listing) + ui->from->setText(path); +} + +void Themes::detectedSpeed(const quint64 &speed)//in byte per seconds +{ + speedString=facilityEngine->speedToString(speed); +} + +/** \brief support speed limitation */ +void Themes::setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) +{ + Q_UNUSED(supportSpeedLimitationBool); +} + +void Themes::remainingTime(const int &remainingSeconds) +{ + 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 Themes::newCollisionAction(const QString &action) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(action); +} + +void Themes::newErrorAction(const QString &action) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + 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); +} + +//speed limitation +bool Themes::setSpeedLimitation(const qint64 &speedLimitation) +{ + if(speedLimitation>0) + emit newSpeedLimitation(0); + return true; +} + +//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); +} + +void Themes::setCollisionAction(const QList > &list) +{ + Q_UNUSED(list); +} + +void Themes::setErrorAction(const QList > &list) +{ + Q_UNUSED(list); +} + +void Themes::setCopyType(const Ultracopier::CopyType &type) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->type=type; + updateModeAndType(); +} + +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) +{ + 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 Themes::updateTitle() +{ + 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 Themes::haveExternalOrder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); +// ui->moreButton->toggle(); +} + +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 Themes::on_cancelButton_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->hide(); + emit cancel(); +} + + +void Themes::on_pauseButton_clicked() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"start"); + emit userAddFile(mode); +} + +void Themes::forcedModeAddFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(mode); +} + +void Themes::forcedModeAddFileToCopy() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Copy); +} + +void Themes::forcedModeAddFolderToCopy() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Copy); +} + +void Themes::forcedModeAddFileToMove() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Move); +} + +void Themes::forcedModeAddFolderToMove() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Move); +} + +//set the translate +void Themes::newLanguageLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(modeIsForced) + forceCopyMode(mode); + ui->retranslateUi(this); + if(haveStarted) + updateCurrentFileInformation(); + updateOverallInformation(); +} + +/* + Return[0]: totalFile + Return[1]: totalSize + Return[2]: currentFile + */ +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 new file mode 100644 index 0000000..b2f6a70 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/interface.h @@ -0,0 +1,176 @@ +/** \file interface.h +\brief Define the interface test +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef INTERFACE_H +#define INTERFACE_H + +#include +#include +#include +#include +#include + +#include "../../../interface/PluginInterface_Themes.h" + +#include "ui_interface.h" +#include "Environment.h" +#include "TransferModel.h" + +namespace Ui { + class interfaceCopy; +} + +/// \brief Define the interface +class Themes : public PluginInterface_Themes +{ + Q_OBJECT +private: + 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(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(); +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(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); +}; + +#endif // INTERFACE_H diff --git a/plugins-alternative/Themes/Teracopy/interface.pro b/plugins-alternative/Themes/Teracopy/interface.pro new file mode 100644 index 0000000..5049e19 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/interface.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 = interface.h \ + StructEnumDefinition.h \ + factory.h \ + DebugEngineMacro.h \ + Environment.h \ + Variable.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 + +RESOURCES += resources.qrc + +FORMS += \ + interface.ui + +win32 { + RESOURCES += resources_windows.qrc +} +!win32 { + RESOURCES += resources_unix.qrc +} diff --git a/plugins-alternative/Themes/Teracopy/interface.ui b/plugins-alternative/Themes/Teracopy/interface.ui new file mode 100644 index 0000000..a5274b3 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/interface.ui @@ -0,0 +1,394 @@ + + + interfaceCopy + + + + 0 + 0 + 476 + 364 + + + + + 0 + 0 + + + + + 430 + 0 + + + + 94% done (42BK/s) + + + + :/Themes/Teracopy/resources/main.png:/Themes/Teracopy/resources/main.png + + + + 1 + + + QLayout::SetMinimumSize + + + 2 + + + 2 + + + + + 2 + + + + + - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + 16777215 + 16 + + + + 65535 + + + + + + + + + Total: - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <!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;">&nbsp;</p></body></html> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 16777215 + 16 + + + + 65535 + + + + + + + 4 + + + + + + 0 + 0 + + + + + 80 + 25 + + + + &More + + + true + + + true + + + + + + + ... + + + QToolButton::InstantPopup + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + 80 + 25 + + + + &Pause + + + + + + + false + + + + 0 + 0 + + + + + 80 + 25 + + + + &Skip + + + + + + + + 0 + 0 + + + + + 80 + 25 + + + + &Cancel + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 16777215 + 16 + + + + <!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> + + + + + + + + + QAbstractItemView::NoSelection + + + false + + + + + + + + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png + + + Add file + + + + + + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png + + + Add folder + + + + + + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png + + + Move file(s) + + + + + + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png + + + Move folder + + + + + + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png + + + Copy file(s) + + + + + + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png + + + Copy folder + + + + + + + + + moreButton + toggled(bool) + label_2 + setVisible(bool) + + + 72 + 106 + + + 353 + 144 + + + + + cancelButton + clicked() + interfaceCopy + close() + + + 465 + 114 + + + 475 + 112 + + + + + 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 new file mode 100644 index 0000000..39105a8 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/resources.qrc @@ -0,0 +1,12 @@ + + + resources/SystemTrayIcon/add.png + resources/SystemTrayIcon/exit.png + resources/SystemTrayIcon/informations.png + resources/SystemTrayIcon/options.png + resources/checkbox.png + resources/main.png + resources/player_play.png + resources/player_pause.png + + diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png new file mode 100644 index 0000000..7932127 Binary files /dev/null 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 new file mode 100644 index 0000000..ae3c4e8 Binary files /dev/null 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 new file mode 100644 index 0000000..5b7b255 Binary files /dev/null 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 new file mode 100644 index 0000000..23ec531 Binary files /dev/null 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 new file mode 100644 index 0000000..6f5d1cf Binary files /dev/null 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 new file mode 100644 index 0000000..5464856 Binary files /dev/null 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 new file mode 100644 index 0000000..3961215 Binary files /dev/null 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 new file mode 100644 index 0000000..45d6315 Binary files /dev/null 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 new file mode 100644 index 0000000..ac4299a Binary files /dev/null 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 new file mode 100644 index 0000000..6e6bae7 Binary files /dev/null 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 new file mode 100644 index 0000000..f7f4388 Binary files /dev/null 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 new file mode 100644 index 0000000..5464856 Binary files /dev/null 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 new file mode 100644 index 0000000..68ee21f Binary files /dev/null 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 new file mode 100644 index 0000000..a1c5b83 Binary files /dev/null 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 new file mode 100644 index 0000000..46e3020 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/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/Teracopy/resources_windows.qrc b/plugins-alternative/Themes/Teracopy/resources_windows.qrc new file mode 100644 index 0000000..165123a --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/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/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..6a5ad0e --- /dev/null +++ b/plugins-alternative/Themes/Windows/documentation.dox @@ -0,0 +1,28 @@ +/* -*- 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 find the link on Ultracopier 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..1871990 --- /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.4.0.4 + + 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/CopyEngine/Rsync/Rsync.pro b/plugins/CopyEngine/Rsync/Rsync.pro new file mode 100644 index 0000000..e525f27 --- /dev/null +++ b/plugins/CopyEngine/Rsync/Rsync.pro @@ -0,0 +1,2 @@ +include($$PWD/../Ultracopier/CopyEngine.pro) +DEFINES += ULTRACOPIER_PLUGIN_RSYNC diff --git a/plugins/CopyEngine/Rsync/informations.xml b/plugins/CopyEngine/Rsync/informations.xml new file mode 100644 index 0000000..17c9f26 --- /dev/null +++ b/plugins/CopyEngine/Rsync/informations.xml @@ -0,0 +1,23 @@ + + + <![CDATA[Rsync copy engine]]> + + CopyEngine + + + + + + 1287496800 + + windows-x86 + + + + 1.4.0.4 + + Rsync + + + 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..16c36ae --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp @@ -0,0 +1,568 @@ +/** \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,std::string 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,std::string errorString,ScanFileOrFolder * thread,ErrorType errorType) +{ + errorOnFolder(fileInfo,errorString,thread,errorType); +} + +//mkpath event +void CopyEngine::mkPathErrorOnFolderSlot(QFileInfo folder,std::string 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().toStdString()); + 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.push_back(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: "+std::to_string(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().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()); + 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: "+std::to_string(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()) + .toStdString() + ); + alreadyExistsQueueItem newItem; + newItem.source=source; + newItem.destination=destination; + newItem.isSame=isSame; + newItem.transfer=thread; + newItem.scan=NULL; + alreadyExistsQueue.push_back(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: "+std::to_string(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 std::string &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.push_back(newItem); + showOneNewDialog(); + } +} + +void CopyEngine::missingDiskSpace(std::vector 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: "+std::to_string(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,std::string errorString,TransferThread * thread,const ErrorType &errorType,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath().toStdString()+", 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.push_back(newItem); + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(fileInfo.absoluteFilePath().toStdString(),fileInfo.size(),fileInfo.lastModified().toMSecsSinceEpoch()/1000,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: "+std::to_string(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().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()); + 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.push_back(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: "+std::to_string(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, std::string errorString, ScanFileOrFolder * thread, ErrorType errorType, bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath().toStdString()+", 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.push_back(newItem); + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(fileInfo.absoluteFilePath().toStdString(),fileInfo.size(),fileInfo.lastModified().toMSecsSinceEpoch()/1000,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: "+std::to_string(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,std::string errorString,const ErrorType &errorType,bool isCalledByShowOneNewDialog) +{ + if(stopIt) + return; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"file have error: "+folder.absoluteFilePath().toStdString()+", 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.push_back(newItem); + return; + } + dialogIsOpen=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"show dialog"); + emit error(folder.absoluteFilePath().toStdString(),folder.size(),folder.lastModified().toMSecsSinceEpoch()/1000,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: "+std::to_string(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: "+std::to_string(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(): "+std::to_string(alreadyExistsQueue.size())); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"errorQueue.size(): "+std::to_string(errorQueue.size())); + int loop_size=alreadyExistsQueue.size(); + while(loop_size>0) + { + if(alreadyExistsQueue.front().transfer!=NULL) + { + fileAlreadyExists(alreadyExistsQueue.front().source, + alreadyExistsQueue.front().destination, + alreadyExistsQueue.front().isSame, + alreadyExistsQueue.front().transfer, + true); + } + else if(alreadyExistsQueue.front().scan!=NULL) + folderAlreadyExists(alreadyExistsQueue.front().source, + alreadyExistsQueue.front().destination, + alreadyExistsQueue.front().isSame, + alreadyExistsQueue.front().scan, + true); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"bug, no thread actived"); + alreadyExistsQueue.erase(alreadyExistsQueue.cbegin()); + loop_size--; + } + loop_size=errorQueue.size(); + while(errorQueue.size()>0 && loop_size>0) + { + if(errorQueue.front().transfer!=NULL) + errorOnFile(errorQueue.front().inode,errorQueue.front().errorString,errorQueue.front().transfer,errorQueue.front().errorType,true); + else if(errorQueue.front().scan!=NULL) + errorOnFolder(errorQueue.front().inode,errorQueue.front().errorString,errorQueue.front().scan,errorQueue.front().errorType,true); + else if(errorQueue.front().mkPath) + mkPathErrorOnFolder(errorQueue.front().inode,errorQueue.front().errorString,errorQueue.front().errorType,true); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"bug, no thread actived"); + errorQueue.erase(errorQueue.cbegin()); + loop_size--; + } +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngine.cpp b/plugins/CopyEngine/Ultracopier/CopyEngine.cpp new file mode 100644 index 0000000..f3d6e04 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine.cpp @@ -0,0 +1,1253 @@ +/** \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 std::vector &newList, const std::vector &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: "+std::to_string(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 std::vector &sources) +{ + return listThread->haveSameSource(sources); +} + +bool CopyEngine::haveSameDestination(const std::string &destination) +{ + return listThread->haveSameDestination(destination); +} + +bool CopyEngine::newCopy(const std::vector &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,QString::fromStdString(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"); + std::string destination; + if(!defaultDestinationFolder.empty() && QDir(QString::fromStdString(defaultDestinationFolder)).exists()) + destination = defaultDestinationFolder; + else + destination = askDestination(); + if(destination.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return false; + } + return listThread->newCopy(sources,destination); +} + +bool CopyEngine::newCopy(const std::vector &sources,const std::string &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,QString::fromStdString(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 std::vector &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,QString::fromStdString(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"); + std::string destination; + if(!ui->defaultDestinationFolder->text().isEmpty() && QDir(ui->defaultDestinationFolder->text()).exists()) + destination = ui->defaultDestinationFolder->text().toStdString(); + else + destination = askDestination(); + if(destination.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return false; + } + return listThread->newMove(sources,destination); +} + +bool CopyEngine::newMove(const std::vector &sources,const std::string &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,QString::fromStdString(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::defaultDestinationFolderBrowse() +{ + std::string destination = askDestination(); + if(destination.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"Canceled by the user"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(uiIsInstalled) + ui->defaultDestinationFolder->setText(QString::fromStdString(destination)); +} + +std::string CopyEngine::askDestination() +{ + std::string destination = listThread->getUniqueDestinationFolder(); + if(!destination.empty()) + { + QMessageBox::StandardButton button=QMessageBox::question(interface,tr("Destination"),tr("Use the actual destination \"%1\"?") + .arg(QString::fromStdString(destination)), + QMessageBox::Yes | QMessageBox::No,QMessageBox::Yes); + if(button==QMessageBox::Yes) + return destination; + } + destination=QFileDialog::getExistingDirectory(interface,QString::fromStdString(facilityEngine->translateText("Select destination directory")),QStringLiteral(""),QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks).toStdString(); + return destination; +} + +void CopyEngine::newTransferList(const std::string &file) +{ + emit signal_importTransferList(file); +} + +//because direct access to list thread into the main thread can't be do +uint64_t 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(std::vector includeStrings,std::vector includeOptions,std::vector excludeStrings,std::vector 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(std::string firstRenamingRule,std::string otherRenamingRule) +{ + sendNewRenamingRules(firstRenamingRule,otherRenamingRule); +} + +bool CopyEngine::userAddFolder(const Ultracopier::CopyMode &mode) +{ + std::string source = QFileDialog::getExistingDirectory(interface,QString::fromStdString(facilityEngine->translateText("Select source directory")), + QStringLiteral(""), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks).toStdString(); + if(source.empty() || source=="") + return false; + std::vector sources; + sources.push_back(source); + if(mode==Ultracopier::Copy) + return newCopy(sources); + else + return newMove(sources); +} + +bool CopyEngine::userAddFile(const Ultracopier::CopyMode &mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QStringList sources = QFileDialog::getOpenFileNames( + interface, + QString::fromStdString(facilityEngine->translateText("Select one or more files to open")), + QStringLiteral(""), + QString::fromStdString(facilityEngine->translateText("All files"))+QStringLiteral(" (*)")); + + std::vector sourcesstd; + unsigned int index=0; + while(index<(unsigned int)sources.size()) + { + sourcesstd.push_back(sources.at(index).toStdString()); + index++; + } + + if(sourcesstd.empty()) + return false; + if(mode==Ultracopier::Copy) + return newCopy(sourcesstd); + else + return newMove(sourcesstd); +} + +void CopyEngine::pause() +{ + emit signal_pause(); +} + +void CopyEngine::resume() +{ + emit signal_resume(); +} + +void CopyEngine::skip(const uint64_t &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 std::vector &ids) +{ + emit signal_removeItems(ids); +} + +void CopyEngine::moveItemsOnTop(const std::vector &ids) +{ + emit signal_moveItemsOnTop(ids); +} + +void CopyEngine::moveItemsUp(const std::vector &ids) +{ + emit signal_moveItemsUp(ids); +} + +void CopyEngine::moveItemsDown(const std::vector &ids) +{ + emit signal_moveItemsDown(ids); +} + +void CopyEngine::moveItemsOnBottom(const std::vector &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,"Mode forced previously"); + QMessageBox::critical(NULL,QString::fromStdString(facilityEngine->translateText("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,"Force mode to copy"); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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() +{ + std::string fileName = QFileDialog::getSaveFileName(interface,QString::fromStdString(facilityEngine->translateText("Save transfer list")),QStringLiteral("transfer-list.lst"),QString::fromStdString(facilityEngine->translateText("Transfer list"))+QStringLiteral(" (*.lst)")).toStdString(); + if(fileName.empty()) + return; + emit signal_exportTransferList(fileName); +} + +void CopyEngine::importTransferList() +{ + std::string fileName = QFileDialog::getOpenFileName(interface,QString::fromStdString(facilityEngine->translateText("Open transfer list")),QStringLiteral("transfer-list.lst"),QString::fromStdString(facilityEngine->translateText("Transfer list"))+QStringLiteral(" (*.lst)")).toStdString(); + if(fileName.empty()) + return; + emit signal_importTransferList(fileName); +} + +void CopyEngine::warningTransferList(const std::string &warning) +{ + QMessageBox::warning(interface,QString::fromStdString(facilityEngine->translateText("Error")),QString::fromStdString(warning)); +} + +void CopyEngine::errorTransferList(const std::string &error) +{ + QMessageBox::critical(interface,QString::fromStdString(facilityEngine->translateText("Error")),QString::fromStdString(error)); +} + +bool CopyEngine::setSpeedLimitation(const int64_t &speedLimitation) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"maxSpeed: "+std::to_string(speedLimitation)); + maxSpeed=speedLimitation; + emit send_speedLimitation(speedLimitation); + return true; +} + +void CopyEngine::setFileCollision(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action index: "+std::to_string(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,"action index: "+std::to_string(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,"action index: "+std::to_string(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: "+std::to_string(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(std::string firstRenamingRule,std::string 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. 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 std::string &defaultDestinationFolder) +{ + this->defaultDestinationFolder=defaultDestinationFolder; + if(uiIsInstalled) + ui->defaultDestinationFolder->setText(QString::fromStdString(defaultDestinationFolder)); +} + +void CopyEngine::setCopyListOrder(const bool &order) +{ + listThread->setCopyListOrder(order); +} + +void CopyEngine::exportErrorIntoTransferList() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"exportErrorIntoTransferList"); + std::string fileName = QFileDialog::getSaveFileName(interface,QString::fromStdString(facilityEngine->translateText("Save transfer list")),QStringLiteral("transfer-list.lst"),QString::fromStdString(facilityEngine->translateText("Transfer list"))+QStringLiteral(" (*.lst)")).toStdString(); + if(fileName.empty()) + 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..e5311d8 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine.h @@ -0,0 +1,382 @@ +/** \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 + +#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; + uint32_t 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; + std::string 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; + std::string errorString; + ErrorType errorType; + }; + std::vector 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; + }; + std::vector alreadyExistsQueue; + uint64_t 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; + std::vector includeStrings,includeOptions,excludeStrings,excludeOptions; + std::string firstRenamingRule; + std::string 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 std::vector &newList, const std::vector &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, std::string 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, std::string errorString, ScanFileOrFolder * thread, ErrorType errorType); + //mkpath event + void mkPathErrorOnFolderSlot(QFileInfo, std::string, 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, std::string 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, std::string errorString, ScanFileOrFolder * thread, ErrorType errorType, bool isCalledByShowOneNewDialog=false); + //mkpath event + void mkPathErrorOnFolder(QFileInfo, std::string, 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(std::string firstRenamingRule,std::string otherRenamingRule); + void showRenamingRules(); + void get_realBytesTransfered(quint64 realBytesTransfered); + void newActionInProgess(Ultracopier::EngineActionInProgress); + void updatedBlockSize(); + void updateBufferCheckbox(); + void haveNeedPutAtBottom(bool needPutAtBottom, const QFileInfo &fileInfo, const std::string &errorString, TransferThread *thread, const ErrorType &errorType); + void missingDiskSpace(std::vector 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 std::vector &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 std::string &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 std::vector &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 std::vector &sources,const std::string &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 std::vector &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 std::vector &sources,const std::string &destination); + /** \brief send the new transfer list + * \param file the transfer list */ + void newTransferList(const std::string &file); + + /** \brief to get byte read, use by Ultracopier for the speed calculation + * real size transfered to right speed calculation */ + uint64_t 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(std::vector includeStrings,std::vector includeOptions,std::vector excludeStrings,std::vector excludeOptions); + void setRenamingRules(std::string firstRenamingRule,std::string otherRenamingRule); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + void setRsync(const bool rsync); + #endif + void setCheckDiskSpace(const bool &checkDiskSpace); + void setDefaultDestinationFolder(const std::string &defaultDestinationFolder); + void setCopyListOrder(const bool &order); + void defaultDestinationFolderBrowse(); + std::string 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 uint64_t &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 std::vector &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 std::vector &ids); + /** \brief move up the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsUp(const std::vector &ids); + /** \brief move down the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsDown(const std::vector &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 std::vector &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 int64_t &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 std::string &warning); + void errorTransferList(const std::string &error); +signals: + //action on the copy + void signal_pause() const; + void signal_resume() const; + void signal_skip(const uint64_t &id) const; + + //edit the transfer list + void signal_removeItems(const std::vector &ids) const; + void signal_moveItemsOnTop(const std::vector &ids) const; + void signal_moveItemsUp(const std::vector &ids) const; + void signal_moveItemsDown(const std::vector &ids) const; + void signal_moveItemsOnBottom(const std::vector &ids) const; + + void signal_forceMode(const Ultracopier::CopyMode &mode) const; + void signal_exportTransferList(const std::string &fileName) const; + void signal_importTransferList(const std::string &fileName) const; + void signal_exportErrorIntoTransferList(const std::string &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 std::string &errorString,TransferThread * thread,const ErrorType &errorType) const; + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,std::string fonction,std::string text,std::string file,int ligne) const; + #endif + + //other signals + void queryOneNewDialog() const; + + void send_speedLimitation(const uint64_t &speedLimitation) const; + void send_blockSize(const int &blockSize) const; + void send_osBufferLimit(const unsigned int &osBufferLimit) const; + void send_setFilters(const std::vector &include,const std::vector &exclude) const; + void send_sendNewRenamingRules(std::string firstRenamingRule,std::string 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..112e999 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngine.pro @@ -0,0 +1,106 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets xml +DEFINES += UNICODE _UNICODE +TEMPLATE = lib +CONFIG += plugin +win32 { + LIBS += -ladvapi32 +} + +HEADERS = \ + $$PWD/StructEnumDefinition.h \ + $$PWD/StructEnumDefinition_CopyEngine.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/Variable.h \ + $$PWD/TransferThread.h \ + $$PWD/ReadThread.h \ + $$PWD/WriteThread.h \ + $$PWD/MkPath.h \ + $$PWD/AvancedQFile.h \ + $$PWD/ListThread.h \ + $$PWD/../../../interface/PluginInterface_CopyEngine.h \ + $$PWD/../../../interface/OptionInterface.h \ + $$PWD/../../../interface/FacilityInterface.h \ + $$PWD/../../../cpp11addition.h \ + $$PWD/Filters.h \ + $$PWD/FilterRules.h \ + $$PWD/RenamingRules.h \ + $$PWD/DriveManagement.h \ + $$PWD/CopyEngine.h \ + $$PWD/DebugDialog.h \ + $$PWD/CopyEngineFactory.h \ + $$PWD/FileErrorDialog.h \ + $$PWD/FileExistsDialog.h \ + $$PWD/FileIsSameDialog.h \ + $$PWD/FolderExistsDialog.h \ + $$PWD/ScanFileOrFolder.h \ + $$PWD/DiskSpace.h +SOURCES = \ + $$PWD/TransferThread.cpp \ + $$PWD/ReadThread.cpp \ + $$PWD/WriteThread.cpp \ + $$PWD/MkPath.cpp \ + $$PWD/AvancedQFile.cpp \ + $$PWD/ListThread.cpp \ + $$PWD/../../../cpp11addition.cpp \ + $$PWD/../../../cpp11additionstringtointcpp.cpp \ + $$PWD/Filters.cpp \ + $$PWD/FilterRules.cpp \ + $$PWD/RenamingRules.cpp \ + $$PWD/ListThread_InodeAction.cpp \ + $$PWD/DriveManagement.cpp \ + $$PWD/CopyEngine-collision-and-error.cpp \ + $$PWD/CopyEngine.cpp \ + $$PWD/DebugDialog.cpp \ + $$PWD/CopyEngineFactory.cpp \ + $$PWD/FileErrorDialog.cpp \ + $$PWD/FileExistsDialog.cpp \ + $$PWD/FileIsSameDialog.cpp \ + $$PWD/FolderExistsDialog.cpp \ + $$PWD/ScanFileOrFolder.cpp \ + $$PWD/DiskSpace.cpp +TARGET = $$qtLibraryTarget(copyEngine) +TRANSLATIONS += \ + $$PWD/Languages/ar/translation.ts \ + $$PWD/Languages/de/translation.ts \ + $$PWD/Languages/el/translation.ts \ + $$PWD/Languages/en/translation.ts \ + $$PWD/Languages/es/translation.ts \ + $$PWD/Languages/fr/translation.ts \ + $$PWD/Languages/hi/translation.ts \ + $$PWD/Languages/hu/translation.ts \ + $$PWD/Languages/id/translation.ts \ + $$PWD/Languages/it/translation.ts \ + $$PWD/Languages/ja/translation.ts \ + $$PWD/Languages/ko/translation.ts \ + $$PWD/Languages/nl/translation.ts \ + $$PWD/Languages/no/translation.ts \ + $$PWD/Languages/pl/translation.ts \ + $$PWD/Languages/pt/translation.ts \ + $$PWD/Languages/ru/translation.ts \ + $$PWD/Languages/th/translation.ts \ + $$PWD/Languages/tr/translation.ts \ + $$PWD/Languages/zh/translation.ts + +FORMS += \ + $$PWD/fileErrorDialog.ui \ + $$PWD/fileExistsDialog.ui \ + $$PWD/fileIsSameDialog.ui \ + $$PWD/debugDialog.ui \ + $$PWD/folderExistsDialog.ui \ + $$PWD/Filters.ui \ + $$PWD/FilterRules.ui \ + $$PWD/RenamingRules.ui \ + $$PWD/copyEngineOptions.ui \ + $$PWD/DiskSpace.ui + +OTHER_FILES += \ + $$PWD/informations.xml + +!CONFIG(static) { +RESOURCES += \ + $$PWD/copyEngineResources.qrc +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp new file mode 100644 index 0000000..6507ce2 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp @@ -0,0 +1,700 @@ +/** \file factory.cpp +\brief Define the factory to create new instance +\author alpha_one_x86 */ + +#include +#include +#include +#include +#include + +#include "../../../cpp11addition.h" +#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"); + qRegisterMetaType >("std::vector"); + + 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().toStdString()); + realObject->setCopyListOrder(ui->copyListOrder->isChecked()); + return newTransferEngine; +} + +void CopyEngineFactory::setResources(OptionInterface * options,const std::string &writePath,const std::string &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::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(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,"CHECK LIST TYPE set"); + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"CHECK LIST TYPE not set"); + #endif + if(options!=NULL) + { + //load the options + std::vector > KeysList; + KeysList.push_back(std::pair("doRightTransfer","true")); + #ifndef Q_OS_LINUX + KeysList.push_back(std::pair("keepDate","false")); + #else + KeysList.push_back(std::pair("keepDate","true")); + #endif + KeysList.push_back(std::pair("blockSize",std::to_string(ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE))); + uint32_t sequentialBuffer=ULTRACOPIER_PLUGIN_DEFAULT_BLOCK_SIZE*ULTRACOPIER_PLUGIN_DEFAULT_SEQUENTIAL_NUMBER_OF_BLOCK; + uint32_t 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).toStdString()); + #endif + KeysList.push_back(std::pair("sequentialBuffer",std::to_string(sequentialBuffer))); + KeysList.push_back(std::pair("parallelBuffer",std::to_string(parallelBuffer))); + KeysList.push_back(std::pair("parallelizeIfSmallerThan",std::to_string(128)));//128KB, better for modern hardware: Multiple queue en linux, SSD, ... + KeysList.push_back(std::pair("autoStart","true")); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + KeysList.push_back(std::pair("rsync","true")); + #endif + KeysList.push_back(std::pair("folderError",std::to_string(0))); + KeysList.push_back(std::pair("folderCollision",std::to_string(0))); + KeysList.push_back(std::pair("fileError",std::to_string(2))); + KeysList.push_back(std::pair("fileCollision",std::to_string(0))); + KeysList.push_back(std::pair("transferAlgorithm",std::to_string(0))); + KeysList.push_back(std::pair("checkDestinationFolder","true")); + KeysList.push_back(std::pair("includeStrings","")); + KeysList.push_back(std::pair("includeOptions","")); + KeysList.push_back(std::pair("excludeStrings","")); + KeysList.push_back(std::pair("excludeOptions","")); + KeysList.push_back(std::pair("doChecksum","false")); + KeysList.push_back(std::pair("checksumIgnoreIfImpossible","true")); + KeysList.push_back(std::pair("checksumOnlyOnError","true")); + KeysList.push_back(std::pair("osBuffer","false")); + KeysList.push_back(std::pair("firstRenamingRule","")); + KeysList.push_back(std::pair("otherRenamingRule","")); + KeysList.push_back(std::pair("osBufferLimited","false")); + KeysList.push_back(std::pair("osBufferLimit",std::to_string(512))); + KeysList.push_back(std::pair("deletePartiallyTransferredFiles","true")); + KeysList.push_back(std::pair("moveTheWholeFolder","true")); + KeysList.push_back(std::pair("followTheStrictOrder","false")); + KeysList.push_back(std::pair("renameTheOriginalDestination","false")); + KeysList.push_back(std::pair("checkDiskSpace","true")); + KeysList.push_back(std::pair("defaultDestinationFolder","")); + KeysList.push_back(std::pair("inodeThreads",std::to_string(1))); + KeysList.push_back(std::pair("copyListOrder","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(stringtobool(options->getOptionValue("doRightTransfer"))); + ui->keepDate->setChecked(stringtobool(options->getOptionValue("keepDate"))); + ui->blockSize->setValue(stringtouint32(options->getOptionValue("blockSize")));//keep before sequentialBuffer and parallelBuffer + ui->autoStart->setChecked(stringtobool(options->getOptionValue("autoStart"))); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + ui->rsync->setChecked(stringtobool(options->getOptionValue("rsync"))); + #else + ui->label_rsync->setVisible(false); + ui->rsync->setVisible(false); + #endif + ui->comboBoxFolderError->setCurrentIndex(stringtouint32(options->getOptionValue("folderError"))); + ui->comboBoxFolderCollision->setCurrentIndex(stringtouint32(options->getOptionValue("folderCollision"))); + ui->comboBoxFileError->setCurrentIndex(stringtouint32(options->getOptionValue("fileError"))); + ui->comboBoxFileCollision->setCurrentIndex(stringtouint32(options->getOptionValue("fileCollision"))); + ui->transferAlgorithm->setCurrentIndex(stringtouint32(options->getOptionValue("transferAlgorithm"))); + ui->checkBoxDestinationFolderExists->setChecked(stringtobool(options->getOptionValue("checkDestinationFolder"))); + ui->parallelizeIfSmallerThan->setValue(stringtouint32(options->getOptionValue("parallelizeIfSmallerThan"))); + ui->sequentialBuffer->setValue(stringtouint32(options->getOptionValue("sequentialBuffer"))); + ui->parallelBuffer->setValue(stringtouint32(options->getOptionValue("parallelBuffer"))); + ui->sequentialBuffer->setSingleStep(ui->blockSize->value()); + ui->parallelBuffer->setSingleStep(ui->blockSize->value()); + ui->deletePartiallyTransferredFiles->setChecked(stringtobool(options->getOptionValue("deletePartiallyTransferredFiles"))); + ui->moveTheWholeFolder->setChecked(stringtobool(options->getOptionValue("moveTheWholeFolder"))); + ui->followTheStrictOrder->setChecked(stringtobool(options->getOptionValue("followTheStrictOrder"))); + ui->inodeThreads->setValue(stringtouint32(options->getOptionValue("inodeThreads"))); + ui->renameTheOriginalDestination->setChecked(stringtobool(options->getOptionValue("renameTheOriginalDestination"))); + ui->checkDiskSpace->setChecked(stringtobool(options->getOptionValue("checkDiskSpace"))); + ui->defaultDestinationFolder->setText(QString::fromStdString(options->getOptionValue("defaultDestinationFolder"))); + + ui->doChecksum->setChecked(stringtobool(options->getOptionValue("doChecksum"))); + ui->checksumIgnoreIfImpossible->setChecked(stringtobool(options->getOptionValue("checksumIgnoreIfImpossible"))); + ui->checksumOnlyOnError->setChecked(stringtobool(options->getOptionValue("checksumOnlyOnError"))); + + ui->osBuffer->setChecked(stringtobool(options->getOptionValue("osBuffer"))); + ui->osBufferLimited->setChecked(stringtobool(options->getOptionValue("osBufferLimited"))); + ui->osBufferLimit->setValue(stringtouint32(options->getOptionValue("osBufferLimit"))); + //ui->autoStart->setChecked(options->getOptionValue("autoStart").toBool());//moved from options(), wrong previous place + includeStrings=stringtostringlist(options->getOptionValue("includeStrings")); + includeOptions=stringtostringlist(options->getOptionValue("includeOptions")); + excludeStrings=stringtostringlist(options->getOptionValue("excludeStrings")); + excludeOptions=stringtostringlist(options->getOptionValue("excludeOptions")); + filters->setFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + firstRenamingRule=options->getOptionValue("firstRenamingRule"); + otherRenamingRule=options->getOptionValue("otherRenamingRule"); + renamingRules->setRenamingRules(firstRenamingRule,otherRenamingRule); + + ui->checksumOnlyOnError->setEnabled(ui->doChecksum->isChecked()); + ui->checksumIgnoreIfImpossible->setEnabled(ui->doChecksum->isChecked()); + ui->copyListOrder->setChecked(stringtobool(options->getOptionValue("copyListOrder"))); + + updateBufferCheckbox(); + optionsEngine=options; + + updatedBlockSize(); + } +} + +std::vector CopyEngineFactory::supportedProtocolsForTheSource() const +{ + std::vector l; + l.push_back("file"); + return l; +} + +std::vector CopyEngineFactory::supportedProtocolsForTheDestination() const +{ + std::vector l; + l.push_back("file"); + return l; +} + +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("doRightTransfer",booltostring(doRightTransfer)); +} + +void CopyEngineFactory::setKeepDate(bool keepDate) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("keepDate",booltostring(keepDate)); +} + +void CopyEngineFactory::setBlockSize(int blockSize) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("blockSize",std::to_string(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("parallelBuffer",std::to_string(parallelBuffer)); + } +} + +void CopyEngineFactory::setSequentialBuffer(int sequentialBuffer) +{ + if(optionsEngine!=NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + sequentialBuffer=round((float)sequentialBuffer/(float)ui->blockSize->value())*ui->blockSize->value(); + ui->sequentialBuffer->setValue(sequentialBuffer); + optionsEngine->setOptionValue("sequentialBuffer",std::to_string(sequentialBuffer)); + } +} + +void CopyEngineFactory::setParallelizeIfSmallerThan(int parallelizeIfSmallerThan) +{ + if(optionsEngine!=NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + optionsEngine->setOptionValue("parallelizeIfSmallerThan",std::to_string(parallelizeIfSmallerThan)); + } +} + +void CopyEngineFactory::setAutoStart(bool autoStart) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("autoStart",booltostring(autoStart)); +} + +void CopyEngineFactory::setFolderCollision(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("folderCollision",std::to_string(index)); +} + +void CopyEngineFactory::setFolderError(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("folderError",std::to_string(index)); +} + +void CopyEngineFactory::setTransferAlgorithm(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("transferAlgorithm",std::to_string(index)); +} + +void CopyEngineFactory::setCheckDestinationFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("checkDestinationFolder",booltostring(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("doChecksum",booltostring(doChecksum)); +} + +void CopyEngineFactory::checksumOnlyOnError_toggled(bool checksumOnlyOnError) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("checksumOnlyOnError",booltostring(checksumOnlyOnError)); +} + +void CopyEngineFactory::osBuffer_toggled(bool osBuffer) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("osBuffer",booltostring(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("osBufferLimited",booltostring(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("osBufferLimit",std::to_string(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 std::vector &includeStrings,const std::vector &includeOptions,const std::vector &excludeStrings,const std::vector &excludeOptions) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"new filter"); + this->includeStrings=includeStrings; + this->includeOptions=includeOptions; + this->excludeStrings=excludeStrings; + this->excludeOptions=excludeOptions; + if(optionsEngine!=NULL) + { + optionsEngine->setOptionValue("includeStrings",stringlisttostring(includeStrings)); + optionsEngine->setOptionValue("includeOptions",stringlisttostring(includeOptions)); + optionsEngine->setOptionValue("excludeStrings",stringlisttostring(excludeStrings)); + optionsEngine->setOptionValue("excludeOptions",stringlisttostring(excludeOptions)); + } +} + +void CopyEngineFactory::sendNewRenamingRules(const std::string &firstRenamingRule,const std::string &otherRenamingRule) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"new filter"); + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + if(optionsEngine!=NULL) + { + optionsEngine->setOptionValue("firstRenamingRule",firstRenamingRule); + optionsEngine->setOptionValue("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("checksumIgnoreIfImpossible",booltostring(checksumIgnoreIfImpossible)); +} + +void CopyEngineFactory::setFileCollision(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action index: "+std::to_string(index)); + if(optionsEngine==NULL) + return; + switch(index) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + optionsEngine->setOptionValue("fileCollision",std::to_string(index)); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Error, unknow index, ignored"); + break; + } +} + +void CopyEngineFactory::setFileError(int index) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action index: "+std::to_string(index)); + if(optionsEngine==NULL) + return; + switch(index) + { + case 0: + case 1: + case 2: + optionsEngine->setOptionValue("fileError",std::to_string(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("deletePartiallyTransferredFiles",booltostring(checked)); +} + +void CopyEngineFactory::renameTheOriginalDestination(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("renameTheOriginalDestination",booltostring(checked)); +} + +void CopyEngineFactory::checkDiskSpace(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("checkDiskSpace",booltostring(checked)); +} + +void CopyEngineFactory::defaultDestinationFolderBrowse() +{ + QString destination = QFileDialog::getExistingDirectory(ui->defaultDestinationFolder, + QString::fromStdString(facilityEngine->translateText("Select destination directory")), + "",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("defaultDestinationFolder",destination.toStdString()); +} + +void CopyEngineFactory::defaultDestinationFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("defaultDestinationFolder",ui->defaultDestinationFolder->text().toStdString()); +} + +void CopyEngineFactory::followTheStrictOrder(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("followTheStrictOrder",booltostring(checked)); +} + +void CopyEngineFactory::moveTheWholeFolder(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("moveTheWholeFolder",booltostring(checked)); +} + +void CopyEngineFactory::on_inodeThreads_editingFinished() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the spinbox have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("inodeThreads",std::to_string(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",std::to_string(rsync)); +} +#endif + +void CopyEngineFactory::copyListOrder(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the value have changed"); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("copyListOrder",booltostring(checked)); +} diff --git a/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h new file mode 100644 index 0000000..59c4208 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h @@ -0,0 +1,133 @@ +/** \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 std::string &writePath,const std::string &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 + std::vector supportedProtocolsForTheSource() const; + /// \brief to get the supported protocols for the destination + std::vector 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; + std::vector includeStrings,includeOptions,excludeStrings,excludeOptions; + std::string 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 std::vector &includeStrings,const std::vector &includeOptions, + const std::vector &excludeStrings,const std::vector &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 std::string &firstRenamingRule, const std::string &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..0b3fec4 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DebugDialog.cpp @@ -0,0 +1,54 @@ +/** \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 std::vector &list) +{ + ui->tranferList->clear(); + unsigned int index=0; + while(indextranferList->addItem(QString::fromStdString(list.at(index))); + index++; + } +} + +void DebugDialog::setActiveTransfer(const int &activeTransfer) +{ + ui->spinBoxActiveTransfer->setValue(activeTransfer); +} + +void DebugDialog::setInodeUsage(const int &inodeUsage) +{ + ui->spinBoxNumberOfInode->setValue(inodeUsage); +} + +void DebugDialog::setTransferThreadList(const std::vector &list) +{ + ui->transferThreadList->clear(); + unsigned int index=0; + while(indextransferThreadList->addItem(QString::fromStdString(list.at(index))); + index++; + } +} + +#endif diff --git a/plugins/CopyEngine/Ultracopier/DebugDialog.h b/plugins/CopyEngine/Ultracopier/DebugDialog.h new file mode 100644 index 0000000..c84cfaa --- /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 std::vector &list); + /// \brief show the transfer thread, it show be a thread pool in normal time + void setTransferThreadList(const std::vector &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..e9b996d --- /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,std::vector 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(QString::fromStdString(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..5a923ab --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DiskSpace.h @@ -0,0 +1,29 @@ +#ifndef DISKSPACE_H +#define DISKSPACE_H + +#include +#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,std::vector 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..f25836f --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/DriveManagement.cpp @@ -0,0 +1,105 @@ +#include "DriveManagement.h" + +#include +#include +#include + +#include "../../../cpp11addition.h" + +DriveManagement::DriveManagement() +{ + tryUpdate(); + #ifdef Q_OS_WIN32 + reg1=std::regex("^(\\\\\\\\|//)[^\\\\\\\\/]+(\\\\|/)[^\\\\\\\\/]+"); + reg2=std::regex("^((\\\\\\\\|//)[^\\\\\\\\/]+(\\\\|/)[^\\\\\\\\/]+).*$"); + reg3=std::regex("^[a-zA-Z]:[\\\\/]"); + reg4=std::regex("^([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 +/// \todo do network drive support for windows +std::string DriveManagement::getDrive(const std::string &fileOrFolder) const +{ + const std::string &inode=QDir::toNativeSeparators(QString::fromStdString(fileOrFolder)).toStdString(); + int size=mountSysPoint.size(); + for (int i = 0; i < size; ++i) { + if(stringStartWith(inode,mountSysPoint.at(i))) + return QDir::toNativeSeparators(QString::fromStdString(mountSysPoint.at(i))).toStdString(); + } + #ifdef Q_OS_WIN32 + if(std::regex_match(fileOrFolder,reg1)) + { + std::string returnString=fileOrFolder; + std::regex_replace(returnString,reg2,"$1"); + return returnString; + } + //due to lack of WMI support into mingw, the new drive event is never called, this is a workaround + if(std::regex_match(fileOrFolder,reg3)) + { + std::string returnString=fileOrFolder; + std::regex_replace(returnString,reg4,"$1"); + return QDir::toNativeSeparators(QString::fromStdString(returnString)).toUpper().toStdString(); + } + #endif + //if unable to locate the right mount point + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"unable to locate the right mount point for: "+fileOrFolder+", mount point: "+stringimplode(mountSysPoint,";")); + return std::string(); +} + +QByteArray DriveManagement::getDriveType(const std::string &drive) const +{ + int index=vectorindexOf(mountSysPoint,drive); + if(index!=-1) + return driveType.at(index); + return QByteArray(); +} + +bool DriveManagement::isSameDrive(const std::string &file1,const std::string &file2) const +{ + if(mountSysPoint.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"no mount point found"); + return false; + } + const std::string &drive1=getDrive(file1); + if(drive1.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"drive for the file1 not found: "+file1); + return false; + } + const std::string &drive2=getDrive(file2); + if(drive2.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"drive for the file2 not found: "+file2); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,drive1+" is egal to "+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 std::string &file1, const std::string &file2) const; + /// \brief get drive of an file or folder + std::string getDrive(const std::string &fileOrFolder) const; + QByteArray getDriveType(const std::string &drive) const; + void tryUpdate(); +protected: + std::vector mountSysPoint; + std::vector driveType; + #ifdef Q_OS_WIN32 + std::regex reg1,reg2,reg3,reg4; + #endif +signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const std::string &fonction,const std::string &text,const std::string &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..d88fb90 --- /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, std::string 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(QString::fromStdString(errorString)); + if(fileInfo.exists()) + { + ui->label_content_file_name->setText(QString::fromStdString(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(QString::fromStdString(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..133a8b0 --- /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,std::string 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..91df1f8 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp @@ -0,0 +1,244 @@ +#include "FileExistsDialog.h" +#include "ui_fileExistsDialog.h" +#include "TransferThread.h" + +#ifdef Q_OS_WIN32 +#define CURRENTSEPARATOR "\\" +#else +#define CURRENTSEPARATOR "/" +#endif + +#include +#include +#include + +FileExistsDialog::FileExistsDialog(QWidget *parent, QFileInfo source, QFileInfo destination, std::string firstRenamingRule, std::string 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(QString::fromStdString(oldName)); + ui->lineEditNewName->setPlaceholderText(QString::fromStdString(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(QString::fromStdString(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(QString::fromStdString(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; + } +} + +std::string FileExistsDialog::getNewName() +{ + if(oldName==ui->lineEditNewName->text().toStdString() || ui->checkBoxAlways->isChecked()) + return oldName; + else + return ui->lineEditNewName->text().toStdString(); +} + +void FileExistsDialog::on_SuggestNewName_clicked() +{ + QFileInfo destinationInfo=this->destinationInfo; + QString absolutePath=destinationInfo.absolutePath(); + QString fileName=QString::fromStdString(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.empty()) + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=QString::fromStdString(firstRenamingRule); + newFileName.replace("%name%",fileName); + } + } + else + { + if(otherRenamingRule.empty()) + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=QString::fromStdString(otherRenamingRule); + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + destination=absolutePath+CURRENTSEPARATOR+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().toStdString() && !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..05ff7e0 --- /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,std::string firstRenamingRule,std::string 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 + std::string 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; + std::string oldName; + QFileInfo destinationInfo; + std::string firstRenamingRule; + std::string otherRenamingRule; +}; + +#endif // FILEEXISTSDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp b/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp new file mode 100644 index 0000000..3bee3ae --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp @@ -0,0 +1,194 @@ +#include "FileIsSameDialog.h" +#include "ui_fileIsSameDialog.h" +#include "TransferThread.h" + +#ifdef Q_OS_WIN32 +#define CURRENTSEPARATOR "\\" +#else +#define CURRENTSEPARATOR "/" +#endif + +#include +#include +#include + +FileIsSameDialog::FileIsSameDialog(QWidget *parent, QFileInfo fileInfo, std::string firstRenamingRule, std::string 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(QString::fromStdString(oldName)); + ui->lineEditNewName->setPlaceholderText(QString::fromStdString(oldName)); + ui->label_content_size->setText(QString::number(fileInfo.size())); + ui->label_content_modified->setText(fileInfo.lastModified().toString()); + ui->label_content_file_name->setText(QString::fromStdString(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; + } +} + +std::string FileIsSameDialog::getNewName() +{ + if(oldName==ui->lineEditNewName->text().toStdString() || ui->checkBoxAlways->isChecked()) + return oldName; + else + return ui->lineEditNewName->text().toStdString(); +} + +void FileIsSameDialog::on_SuggestNewName_clicked() +{ + QFileInfo destinationInfo=this->destinationInfo; + QString absolutePath=destinationInfo.absolutePath(); + QString fileName=QString::fromStdString(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.empty()) + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=QString::fromStdString(firstRenamingRule); + newFileName.replace(QStringLiteral("%name%"),fileName); + } + } + else + { + if(otherRenamingRule.empty()) + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=QString::fromStdString(otherRenamingRule); + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + destination=absolutePath+CURRENTSEPARATOR+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().toStdString() && !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..5dc0067 --- /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,std::string firstRenamingRule,std::string 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 + std::string 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; + std::string oldName; + QFileInfo destinationInfo; + std::string firstRenamingRule; + std::string otherRenamingRule; + +}; + +#endif // FILEISSAMEDIALOG_H diff --git a/plugins/CopyEngine/Ultracopier/FilterRules.cpp b/plugins/CopyEngine/Ultracopier/FilterRules.cpp new file mode 100644 index 0000000..0f6bf2c --- /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; +} + +std::string FilterRules::get_search_text() +{ + return ui->search->text().toStdString(); +} + +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(std::string search_text) +{ + ui->search->setText(QString::fromStdString(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 std::string &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 std::string &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..0838792 --- /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(); + std::string get_search_text(); + SearchType get_search_type(); + ApplyOn get_apply_on(); + bool get_need_match_all(); + void set_search_text(std::string 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 std::string &arg1); + void on_isValid_clicked(); + void on_testString_textChanged(const std::string &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..c7b1526 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Filters.cpp @@ -0,0 +1,460 @@ +#include "Filters.h" +#include "ui_Filters.h" +#include "../../../cpp11addition.h" + +#include + +Filters::Filters(QWidget *parent) : + QDialog(parent), + ui(new Ui::Filters) +{ + ui->setupUi(this); +} + +Filters::~Filters() +{ + delete ui; +} + +void Filters::setFilters(std::vector includeStrings,std::vector includeOptions,std::vector excludeStrings,std::vector excludeOptions) +{ + if(includeStrings.size()!=includeOptions.size() || excludeStrings.size()!=excludeOptions.size()) + return; + Filters_rules new_item; + + include.clear(); + unsigned int index=0; + while(index<(unsigned int)includeStrings.size()) + { + new_item.search_text=includeStrings.at(index); + std::vector options=stringsplit(includeOptions.at(index),';'); + new_item.need_match_all=false; + new_item.search_type=SearchType_rawText; + new_item.apply_on=ApplyOn_fileAndFolder; + + if(vectorcontainsAtLeastOne(options,std::string("SearchType_simpleRegex"))) + new_item.search_type=SearchType_simpleRegex; + if(vectorcontainsAtLeastOne(options,std::string("SearchType_perlRegex"))) + new_item.search_type=SearchType_perlRegex; + if(vectorcontainsAtLeastOne(options,std::string("ApplyOn_file"))) + new_item.apply_on=ApplyOn_file; + if(vectorcontainsAtLeastOne(options,std::string("ApplyOn_folder"))) + new_item.apply_on=ApplyOn_folder; + if(vectorcontainsAtLeastOne(options,std::string("need_match_all"))) + new_item.need_match_all=true; + + if(convertToRegex(new_item)) + include.push_back(new_item); + + index++; + } + + exclude.clear(); + index=0; + while(index options=stringsplit(excludeOptions.at(index),';'); + new_item.need_match_all=false; + new_item.search_type=SearchType_rawText; + new_item.apply_on=ApplyOn_fileAndFolder; + + if(vectorcontainsAtLeastOne(options,std::string("SearchType_simpleRegex"))) + new_item.search_type=SearchType_simpleRegex; + if(vectorcontainsAtLeastOne(options,std::string("SearchType_perlRegex"))) + new_item.search_type=SearchType_perlRegex; + if(vectorcontainsAtLeastOne(options,std::string("ApplyOn_file"))) + new_item.apply_on=ApplyOn_file; + if(vectorcontainsAtLeastOne(options,std::string("ApplyOn_folder"))) + new_item.apply_on=ApplyOn_folder; + if(vectorcontainsAtLeastOne(options,std::string("need_match_all"))) + new_item.need_match_all=true; + + if(convertToRegex(new_item)) + exclude.push_back(new_item); + + index++; + } + + reShowAll(); +} + +void Filters::reShowAll() +{ + ui->inclusion->clear(); + unsigned int index=0; + while(index<(unsigned int)include.size()) + { + std::string entryShow=include.at(index).search_text+" ("; + std::vector optionsToShow; + switch(include.at(index).search_type) + { + case SearchType_rawText: + optionsToShow.push_back(tr("Raw text").toStdString()); + break; + case SearchType_simpleRegex: + optionsToShow.push_back(tr("Simplified regex").toStdString()); + break; + case SearchType_perlRegex: + optionsToShow.push_back(tr("Perl's regex").toStdString()); + break; + default: + break; + } + switch(include.at(index).apply_on) + { + case ApplyOn_file: + optionsToShow.push_back(tr("Only on file").toStdString()); + break; + case ApplyOn_folder: + optionsToShow.push_back(tr("Only on folder").toStdString()); + break; + default: + break; + } + if(include.at(index).need_match_all) + optionsToShow.push_back(tr("Full match").toStdString()); + entryShow+=stringimplode(optionsToShow,","); + entryShow+=")"; + ui->inclusion->addItem(new QListWidgetItem(QString::fromStdString(entryShow))); + index++; + } + ui->exclusion->clear(); + index=0; + while(index<(unsigned int)exclude.size()) + { + std::string entryShow=exclude.at(index).search_text+" ("; + std::vector optionsToShow; + switch(exclude.at(index).search_type) + { + case SearchType_rawText: + optionsToShow.push_back(tr("Raw text").toStdString()); + break; + case SearchType_simpleRegex: + optionsToShow.push_back(tr("Simplified regex").toStdString()); + break; + case SearchType_perlRegex: + optionsToShow.push_back(tr("Perl's regex").toStdString()); + break; + default: + break; + } + switch(exclude.at(index).apply_on) + { + case ApplyOn_file: + optionsToShow.push_back(tr("Only on file").toStdString()); + break; + case ApplyOn_folder: + optionsToShow.push_back(tr("Only on folder").toStdString()); + break; + default: + break; + } + if(exclude.at(index).need_match_all) + optionsToShow.push_back(tr("Full match").toStdString()); + entryShow+=stringimplode(optionsToShow,","); + entryShow+=")"; + ui->exclusion->addItem(new QListWidgetItem(QString::fromStdString(entryShow))); + index++; + } +} + +std::vector Filters::getInclude() const +{ + return include; +} + +std::vector Filters::getExclude() const +{ + return exclude; +} + +void Filters::newLanguageLoaded() +{ + ui->retranslateUi(this); + reShowAll(); +} + +void Filters::updateFilters() +{ + std::vector includeStrings,includeOptions,excludeStrings,excludeOptions; + unsigned int index=0; + while(index<(unsigned int)include.size()) + { + includeStrings.push_back(include.at(index).search_text); + std::vector optionsToShow; + + switch(include.at(index).search_type) + { + case SearchType_rawText: + optionsToShow.push_back("SearchType_rawText"); + break; + case SearchType_simpleRegex: + optionsToShow.push_back("SearchType_simpleRegex"); + break; + case SearchType_perlRegex: + optionsToShow.push_back("SearchType_perlRegex"); + break; + default: + break; + } + switch(include.at(index).apply_on) + { + case ApplyOn_file: + optionsToShow.push_back("ApplyOn_file"); + break; + case ApplyOn_fileAndFolder: + optionsToShow.push_back("ApplyOn_fileAndFolder"); + break; + case ApplyOn_folder: + optionsToShow.push_back("ApplyOn_folder"); + break; + default: + break; + } + if(include.at(index).need_match_all) + optionsToShow.push_back(tr("Full match").toStdString()); + includeOptions.push_back(stringimplode(optionsToShow,";")); + index++; + } + index=0; + while(index<(unsigned int)exclude.size()) + { + excludeStrings.push_back(exclude.at(index).search_text); + std::vector optionsToShow; + + switch(exclude.at(index).search_type) + { + case SearchType_rawText: + optionsToShow.push_back("SearchType_rawText"); + break; + case SearchType_simpleRegex: + optionsToShow.push_back("SearchType_simpleRegex"); + break; + case SearchType_perlRegex: + optionsToShow.push_back("SearchType_perlRegex"); + break; + default: + break; + } + switch(exclude.at(index).apply_on) + { + case ApplyOn_file: + optionsToShow.push_back("ApplyOn_file"); + break; + case ApplyOn_fileAndFolder: + optionsToShow.push_back("ApplyOn_fileAndFolder"); + break; + case ApplyOn_folder: + optionsToShow.push_back("ApplyOn_folder"); + break; + default: + break; + } + if(exclude.at(index).need_match_all) + optionsToShow.push_back(tr("Full match").toStdString()); + excludeOptions.push_back(stringimplode(optionsToShow,";")); + index++; + } + emit sendNewFilters(includeStrings,includeOptions,excludeStrings,excludeOptions); + emit haveNewFilters(); +} + +bool Filters::convertToRegex(Filters_rules &item) +{ + bool isValid=!item.search_text.empty(); + if(isValid) + { + std::regex regex; + std::string tempString; + if(item.search_type==SearchType_rawText) + { + tempString=QRegularExpression::escape(QString::fromStdString(item.search_text)).toStdString(); + if(tempString.find('/') != std::string::npos || tempString.find('\\') != std::string::npos) + isValid=false; + } + else if(item.search_type==SearchType_simpleRegex) + { + tempString=QRegularExpression::escape(QString::fromStdString(item.search_text)).toStdString(); + stringreplaceAll(tempString,"\\*","[^\\\\/]*"); + } + else if(item.search_type==SearchType_perlRegex) + { + tempString=item.search_text; + if(stringStartWith(tempString,'^') && stringEndsWith(tempString,'$')) + { + item.need_match_all=true; + if(stringStartWith(tempString,'^')) + tempString=tempString.substr(1,tempString.size()-1); + if(stringEndsWith(tempString,'$')) + tempString=tempString.substr(0,tempString.size()-1); + item.search_text=tempString; + } + } + if(isValid) + { + if(item.need_match_all==true) + tempString="^"+tempString+"$"; + regex=std::regex(tempString); + //isValid=regex.isValid(); + item.regex=regex; + return true; + } + else + return false; + } + return false; +} + +void Filters::on_remove_exclusion_clicked() +{ + bool removedEntry=false; + int index=0; + while(indexexclusion->count()) + { + if(ui->exclusion->item(index)->isSelected()) + { + delete ui->exclusion->item(index); + exclude.erase(exclude.cbegin()+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.erase(include.cbegin()+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.push_back(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.push_back(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.erase(exclude.cbegin()+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.erase(exclude.cbegin()+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..6645afc --- /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(std::vector includeStrings, std::vector includeOptions, std::vector excludeStrings, std::vector excludeOptions); + void reShowAll(); + std::vector getInclude() const; + std::vector getExclude() const; + void newLanguageLoaded(); +private: + Ui::Filters *ui; + std::vector include; + std::vector exclude; + void updateFilters(); + bool convertToRegex(Filters_rules &item); +signals: + void sendNewFilters(const std::vector &includeStrings,const std::vector &includeOptions,const std::vector &excludeStrings,const std::vector &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..d05a715 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp @@ -0,0 +1,205 @@ +#include "FolderExistsDialog.h" +#include "ui_folderExistsDialog.h" +#include "TransferThread.h" + +#ifdef Q_OS_WIN32 +#define CURRENTSEPARATOR "\\" +#else +#define CURRENTSEPARATOR "/" +#endif + +#include +#include +#include + +FolderExistsDialog::FolderExistsDialog(QWidget *parent, QFileInfo source, bool isSame, QFileInfo destination, std::string firstRenamingRule, std::string 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(QString::fromStdString(oldName)); + ui->lineEditNewName->setPlaceholderText(QString::fromStdString(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; + } +} + +std::string FolderExistsDialog::getNewName() +{ + if(oldName==ui->lineEditNewName->text().toStdString() || ui->checkBoxAlways->isChecked()) + return ""; + else + return ui->lineEditNewName->text().toStdString(); +} + +void FolderExistsDialog::on_SuggestNewName_clicked() +{ + QFileInfo destinationInfo=this->destinationInfo; + QString absolutePath=destinationInfo.absolutePath(); + QString fileName=QString::fromStdString(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.empty()) + newFileName=tr("%1 - copy").arg(fileName); + else + { + newFileName=QString::fromStdString(firstRenamingRule); + newFileName.replace(QStringLiteral("%name%"),fileName); + } + } + else + { + if(otherRenamingRule.empty()) + newFileName=tr("%1 - copy (%2)").arg(fileName).arg(num); + else + { + newFileName=QString::fromStdString(otherRenamingRule); + newFileName.replace(QStringLiteral("%name%"),fileName); + newFileName.replace(QStringLiteral("%number%"),QString::number(num)); + } + } + destination=absolutePath+CURRENTSEPARATOR+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 std::string &arg1) +{ + Q_UNUSED(arg1); + updateRenameButton(); +} + +void FolderExistsDialog::updateRenameButton() +{ + ui->Rename->setEnabled(ui->checkBoxAlways->isChecked() || (!ui->lineEditNewName->text().contains(QRegularExpression("[/\\\\\\*]")) && oldName!=ui->lineEditNewName->text().toStdString() && !ui->lineEditNewName->text().isEmpty())); +} diff --git a/plugins/CopyEngine/Ultracopier/FolderExistsDialog.h b/plugins/CopyEngine/Ultracopier/FolderExistsDialog.h new file mode 100644 index 0000000..a3bcf67 --- /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,std::string firstRenamingRule,std::string 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 + std::string 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 std::string &arg1); +private: + Ui::folderExistsDialog *ui; + FolderExistsAction action; + std::string oldName; + std::string firstRenamingRule; + std::string 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..a00b0cd --- /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..cad2890 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/de/translation.ts @@ -0,0 +1,1290 @@ + + + + + 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 + + + + + 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..a00b0cd --- /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..2c9ce27 --- /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..9cb6abe --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/es/translation.ts @@ -0,0 +1,1289 @@ + + + + + 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 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 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 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 + + + + + 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..13ac433 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/fr/translation.ts @@ -0,0 +1,1294 @@ + + + + + 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 + + + + 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 + + + + 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 + + + + 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 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 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 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 + + + + 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 + + + + 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 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..a00b0cd --- /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..eaa968d --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/hu/translation.ts @@ -0,0 +1,1289 @@ + + + + + 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 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 + + + + + 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..a00b0cd --- /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..8a95cd4 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/it/translation.ts @@ -0,0 +1,1299 @@ + + + + + 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 + + + + + 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 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 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 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 + + + + + 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..5c68ad9 --- /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..ea7d584 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/ko/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 + 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..a00b0cd --- /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..a00b0cd --- /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..a00b0cd --- /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..a00b0cd --- /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..abaf3bb --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/Languages/ru/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 - копия + + + + %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 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..a00b0cd --- /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..a00b0cd --- /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..5c68ad9 --- /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..8d47326 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ListThread.cpp @@ -0,0 +1,2399 @@ +#include "ListThread.h" +#include +#include +#include "../../../cpp11addition.h" + +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,"numberOfInodeOperation: "+std::to_string(numberOfInodeOperation)); + #endif + TransferThread *temp_transfer_thread=qobject_cast(QObject::sender()); + if(temp_transfer_thread==NULL) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"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,"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).toStdString()); + 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.push_back(newAction); + /// \todo check if item is at the right thread + actionToDoListTransfer.erase(actionToDoListTransfer.cbegin()+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()).toStdString()); + if(actionToDoListTransfer.empty() && actionToDoListInode.empty() && actionToDoListInode_afterTheTransfer.empty()) + 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,"add oversize of: "+std::to_string(oversize)); + bytesToTransfer+=oversize; + bytesTransfered+=oversize; + } + bytesTransfered+=temp_transfer_thread->transferSize; + + if(temp_transfer_thread->haveStartTime) + { + timeToTransfer.push_back(std::pair(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.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"actionToDoListTransfer==0"); + actionToDoListInode.insert(actionToDoListInode.cbegin(),actionToDoListInode_afterTheTransfer.cbegin(),actionToDoListInode_afterTheTransfer.cend()); + 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).toStdString()); + 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()).toStdString()); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(countLocalParse!=1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"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,"transfer thread not located!"); + return; + } + bool isFound=false; + #ifdef ULTRACOPIER_PLUGIN_DEBUG + int countLocalParse=0; + #endif + unsigned int indexAction=0; + while(indexActiontransferId) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Put at the end: "+std::to_string(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.push_back(newAction); + //do the wait stat + actionToDoListTransfer[indexAction].isRunning=false; + //move at the end + actionToDoListTransfer.push_back(actionToDoListTransfer.at(indexAction)); + actionToDoListTransfer.erase(actionToDoListTransfer.cbegin()+indexAction); + //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).toStdString()); + transfer->transferId=0; + transfer->transferSize=0; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"countLocalParse: "+std::to_string(countLocalParse)); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + if(countLocalParse!=1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"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: "+std::to_string(rsync)); + this->rsync=rsync; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexsetRsync(rsync); + index++; + } + for(unsigned int i=0;isetRsync(rsync); +} +#endif + +//set check destination folder +void ListThread::setCheckDestinationFolderExists(const bool checkDestinationFolderExists) +{ + this->checkDestinationFolderExists=checkDestinationFolderExists; + for(unsigned 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 std::vector &sources) +{ + if(stopIt) + return false; + if(sourceDriveMultiple) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sourceDriveMultiple"); + return false; + } + if(sourceDrive.empty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sourceDrive.isEmpty()"); + return true; + } + unsigned int index=0; + while(index add thread safe, by Qt::BlockingQueuedConnection +bool ListThread::haveSameDestination(const std::string &destination) +{ + if(stopIt) + return false; + if(destinationDriveMultiple) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"destinationDriveMultiple"); + return false; + } + if(destinationDrive.empty()) + { + 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 +std::string ListThread::getUniqueDestinationFolder() const +{ + if(stopIt) + return std::string(); + if(destinationFolderMultiple) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"destinationDriveMultiple"); + return std::string(); + } + return destinationFolder; +} + +ScanFileOrFolder * ListThread::newScanThread(Ultracopier::CopyMode mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start with: "+std::to_string(mode)); + + //create new thread because is auto-detroyed + scanFileOrFolderThreadsPool.push_back(new ScanFileOrFolder(mode)); + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::finishedTheListing, this,&ListThread::scanThreadHaveFinishSlot, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::fileTransfer, this,&ListThread::fileTransfer, Qt::QueuedConnection); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::debugInformation, this,&ListThread::debugInformation, Qt::QueuedConnection); + #endif + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::newFolderListing, this,&ListThread::newFolderListing); + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::addToMovePath, this,&ListThread::addToMovePath, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::addToRealMove, this,&ListThread::addToRealMove, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::addToMkPath, this,&ListThread::addToMkPath, Qt::QueuedConnection); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::addToRmForRsync, this,&ListThread::addToRmForRsync, Qt::QueuedConnection); + #endif + + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::errorOnFolder, this,&ListThread::errorOnFolder, Qt::QueuedConnection); + connect(scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::folderAlreadyExists, this,&ListThread::folderAlreadyExists, Qt::QueuedConnection); + + connect(this,&ListThread::send_updateMount, scanFileOrFolderThreadsPool.back(),&ScanFileOrFolder::set_updateMount, Qt::QueuedConnection); + + scanFileOrFolderThreadsPool.back()->setFilters(include,exclude); + scanFileOrFolderThreadsPool.back()->setCheckDestinationFolderExists(checkDestinationFolderExists && alwaysDoThisActionForFolderExists!=FolderExists_Merge); + scanFileOrFolderThreadsPool.back()->setMoveTheWholeFolder(moveTheWholeFolder); + #ifdef ULTRACOPIER_PLUGIN_RSYNC + scanFileOrFolderThreadsPool.back()->setRsync(rsync); + #endif + if(scanFileOrFolderThreadsPool.size()==1) + updateTheStatus(); + scanFileOrFolderThreadsPool.back()->setRenamingRules(firstRenamingRule,otherRenamingRule); + return scanFileOrFolderThreadsPool.back(); +} + +void ListThread::scanThreadHaveFinishSlot() +{ + scanThreadHaveFinish(); +} + +void ListThread::scanThreadHaveFinish(bool skipFirstRemove) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"listing thread have finish, skipFirstRemove: "+std::to_string(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,"start the next thread, scanFileOrFolderThreadsPool.size(): "+std::to_string(scanFileOrFolderThreadsPool.size())); + delete senderThread; + vectorremoveOne(scanFileOrFolderThreadsPool,senderThread); + if(scanFileOrFolderThreadsPool.empty()) + updateTheStatus(); + } + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start the next thread, scanFileOrFolderThreadsPool.size(): "+std::to_string(scanFileOrFolderThreadsPool.size())); + if(scanFileOrFolderThreadsPool.size()>0) + { + //then start the next listing threads + if(scanFileOrFolderThreadsPool.front()->isFinished()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Start listing thread"); + scanFileOrFolderThreadsPool.front()->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 std::vector &sources,const std::string &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+stringimplode(sources,";")+", 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 std::vector &sources,const std::string &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 std::vector &sources,const std::string &destination) +{ + /* code to detect volume/mount point to group by windows */ + if(!sourceDriveMultiple) + { + unsigned 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; +} + +std::pair 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 uint64_t &id) +{ + skipInternal(id); +} + +bool ListThread::skipInternal(const uint64_t &id) +{ + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indextransferId==id) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"skip one transfer: "+std::to_string(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.erase(transferThreadList.cbegin()+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 int64_t &speedLimitation) +{ + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"maxSpeed in KB/s: "+std::to_string(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) + .toStdString() + ); + + 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,"emit actionInProgess("+std::to_string(updateTheStatus_action_in_progress)+")"); + 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 +uint64_t 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()).toStdString()); + ActionToDoInode temp; + temp.type = ActionType_MkPath; + temp.id = generateIdNumber(); + temp.source = source; + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode.push_back(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).toStdString()); + ActionToDoInode temp; + temp.type = ActionType_MovePath; + temp.id = generateIdNumber(); + temp.size = inodeToRemove; + temp.source = source; + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode.push_back(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()).toStdString()); + ActionToDoInode temp; + temp.type = ActionType_RealMove; + temp.id = generateIdNumber(); + temp.size = 0; + temp.source = source; + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode.push_back(temp); +} + +#ifdef ULTRACOPIER_PLUGIN_RSYNC +//rsync rm +void ListThread::addToRmForRsync(const QFileInfo& destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"inode: "+destination.absoluteFilePath().toStdString()); + ActionToDoInode temp; + temp.type = ActionType_RmSync; + temp.id = generateIdNumber(); + temp.destination= destination; + temp.isRunning = false; + actionToDoListInode.push_back(temp); +} +#endif + +//send action done +void ListThread::sendActionDone() +{ + if(!actionDone.empty()) + { + emit newActionOnList(actionDone); + actionDone.clear(); + } + if(!timeToTransfer.empty()) + { + emit doneTime(timeToTransfer); + timeToTransfer.clear(); + } +} + +//send progression +void ListThread::sendProgression() +{ + if(actionToDoListTransfer.empty()) + 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; + std::pair progression=temp_transfer_thread->progression(); + tempItem.currentRead=progression.first; + tempItem.currentWrite=progression.second; + tempItem.id=temp_transfer_thread->transferId; + tempItem.total=totalSize; + progressionList.push_back(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.push_back(newAction); + } + } + } + } +} + +//add file transfer to do +uint64_t 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 std::string &drive=driveManagement.getDrive(destination.absoluteFilePath().toStdString()); + if(!drive.empty())//can be a network drive + if(mode!=Ultracopier::Move || drive!=driveManagement.getDrive(source.absoluteFilePath().toStdString())) + { + if(requiredSpace.find(drive)!=requiredSpace.cend()) + { + requiredSpace[drive]+=size; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("space needed add: %1, space needed: %2, on: %3").arg(size).arg(requiredSpace.at(drive)).arg(QString::fromStdString(drive)).toStdString()); + } + else + { + requiredSpace[drive]=size; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set space %1 needed, on: %2").arg(size).arg(QString::fromStdString(drive)).toStdString()); + } + } + bytesToTransfer+= size; + ActionToDoTransfer temp; + temp.id = generateIdNumber(); + temp.size = size; + temp.source = source; + temp.destination= destination; + temp.mode = mode; + temp.isRunning = false; + actionToDoListTransfer.push_back(temp); + //push the new transfer to interface + Ultracopier::ReturnActionOnCopyList newAction; + newAction.type = Ultracopier::AddingItem; + newAction.addAction=actionToDoTransferToItemOfCopyList(temp); + actionDone.push_back(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()).toStdString()); + return temp.id; +} + +Ultracopier::ItemOfCopyList ListThread::actionToDoTransferToItemOfCopyList(const ListThread::ActionToDoTransfer &actionToDoTransfer) +{ + Ultracopier::ItemOfCopyList itemOfCopyList; + itemOfCopyList.id = actionToDoTransfer.id; + itemOfCopyList.sourceFullPath = actionToDoTransfer.source.absoluteFilePath().toStdString(); + itemOfCopyList.sourceFileName = actionToDoTransfer.source.fileName().toStdString(); + itemOfCopyList.destinationFullPath = actionToDoTransfer.destination.absoluteFilePath().toStdString(); + itemOfCopyList.destinationFileName = actionToDoTransfer.destination.fileName().toStdString(); + itemOfCopyList.size = actionToDoTransfer.size; + itemOfCopyList.mode = actionToDoTransfer.mode; + return itemOfCopyList; +} + +//generate id number +uint64_t 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 std::vector &ids) +{ + for(unsigned 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; + for (unsigned 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 (unsigned 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(vectorcontainsAtLeastOne(ids,actionToDoListTransfer.at(i).id)) + { + if(haveGoodPosition) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"move item "+std::to_string(i)+" to "+std::to_string(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.push_back(newAction); + ActionToDoTransfer temp1=actionToDoListTransfer.at(i); + ActionToDoTransfer temp2=actionToDoListTransfer.at(lastGoodPositionReal); + actionToDoListTransfer[i]=temp2; + actionToDoListTransfer[lastGoodPositionReal]=temp1; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Try move up false, item "+std::to_string(i)); + } + vectorremoveOne(ids,actionToDoListTransfer.at(i).id); + if(ids.empty()) + { + 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(std::vector 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,"Check action on item "+std::to_string(i)); + if(vectorcontainsAtLeastOne(ids,actionToDoListTransfer.at(i).id)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"move item "+std::to_string(i)+" to "+std::to_string(lastGoodPositionReal)); + vectorremoveOne(ids,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.push_back(newAction); + ActionToDoTransfer temp=actionToDoListTransfer.at(i); + actionToDoListTransfer.erase(actionToDoListTransfer.cbegin()+i); + actionToDoListTransfer.insert(actionToDoListTransfer.cbegin()+lastGoodPositionReal,temp); + lastGoodPositionReal--; + if(ids.empty()) + { + 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,"Force mode to copy"); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Force mode to move"); + this->mode=mode; + forcedMode=true; +} + +void ListThread::exportTransferList(const std::string &fileName) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QFile transferFile(QString::fromStdString(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; + std::regex correctLine; + if(transferListMixedMode) + correctLine=std::regex("^(Copy|Move);[^;]+;[^;]+[\n\r]*$"); + else + correctLine=std::regex("^[^;]+;[^;]+[\n\r]*$"); + std::vector args; + Ultracopier::CopyMode tempMode; + do + { + data=transferFile.readLine(65535*2); + if(data.size()>0) + { + content=std::string(data.constData(),data.size()); + //do the import here + if(std::regex_match(content,correctLine)) + { + stringreplaceAll(content,"\n",""); + args=stringsplit(content,';'); + if(forcedMode) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("New data to import in forced mode: %2,%3") + .arg(QString::fromStdString(args.at(0))) + .arg(QString::fromStdString(args.at(1))) + .toStdString()); + addToTransfer(QFileInfo(QString::fromStdString(args.at(0))),QFileInfo(QString::fromStdString(args.at(1))),mode); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("New data to import: %1,%2,%3") + .arg(QString::fromStdString(args.at(0))) + .arg(QString::fromStdString(args.at(1))) + .arg(QString::fromStdString(args.at(2))) + .toStdString()); + if(args.at(0)=="Copy") + tempMode=Ultracopier::Copy; + else + tempMode=Ultracopier::Move; + addToTransfer(QFileInfo(QString::fromStdString(args.at(1))),QFileInfo(QString::fromStdString(args.at(2))),tempMode); + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Wrong line syntax: "+content); + errorFound=true; + } + } + } + while(data.size()>0); + transferFile.close(); + if(errorFound) + emit warningTransferList(tr("Some errors have been found during the line parsing").toStdString()); + + updateTheStatus();//->sendActionDone(); into this + autoStartAndCheckSpace(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to open the transfer list: %1").arg(transferFile.errorString()).toStdString()); + emit errorTransferList(tr("Unable to open the transfer list: %1").arg(transferFile.errorString()).toStdString()); + 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; + std::vector diskspace_list; + for( auto& spaceDrive : requiredSpace ) { + const QString &drive=QString::fromStdString(spaceDrive.first); + #ifdef Q_OS_WIN32 + if(spaceDrive.first!="A:\\" && spaceDrive.first!="A:/" && spaceDrive.first!="A:" && spaceDrive.first!="A" && spaceDrive.first!="a:\\" && spaceDrive.first!="a:/" && spaceDrive.first!="a:" && spaceDrive.first!="a") + { + #endif + QStorageInfo storageInfo(drive); + 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(spaceDrive.second).arg(drive).arg(bytesFree).toStdString()); + } + else if(spaceDrive.second>(quint64)availableSpace) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("availableSpace: %1, space needed: %2, on: %3, bytesFree: %4").arg(availableSpace).arg(spaceDrive.second).arg(drive).arg(bytesFree).toStdString()); + #ifdef Q_OS_WIN32 + //if(drive.contains(QRegularExpression("^[a-zA-Z]:[\\\\/]"))) + if(drive.contains(QRegularExpression("^[a-zA-Z]:"))) + #endif + { + Diskspace diskspace; + diskspace.drive=spaceDrive.first; + diskspace.freeSpace=availableSpace; + diskspace.requiredSpace=spaceDrive.second; + diskspace_list.push_back(diskspace); + } + #ifdef Q_OS_WIN32 + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"not local drive"); + #endif + } + #ifdef Q_OS_WIN32 + } + #endif + } + if(!diskspace_list.empty()) + emit missingDiskSpace(diskspace_list); + return ! diskspace_list.empty(); +} + +//do new actions +void ListThread::doNewActions_start_transfer() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("actionToDoListTransfer.size(): %1, numberOfTranferRuning: %2").arg(actionToDoListTransfer.size()).arg(getNumberOfTranferRuning()).toStdString()); + 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,"numberOfTranferRuning: "+std::to_string(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,"actionToDoList.size(): "+std::to_string(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! + { + std::string drive=driveManagement.getDrive(actionToDoListTransfer.at(int_for_internal_loop).destination.absoluteFilePath().toStdString()); + if(requiredSpace.find(drive)!=requiredSpace.cend() && (actionToDoListTransfer.at(int_for_internal_loop).mode!=Ultracopier::Move || drive!=driveManagement.getDrive(actionToDoListTransfer.at(int_for_internal_loop).source.absoluteFilePath().toStdString()))) + { + 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.at(drive)).arg(QString::fromStdString(drive)).toStdString()); + } + 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()).toStdString()); + 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()).toStdString()); + + /// \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().toStdString(); + newAction.addAction.sourceFileName = currentActionToDoTransfer.source.fileName().toStdString(); + newAction.addAction.destinationFullPath = currentActionToDoTransfer.destination.absoluteFilePath().toStdString(); + newAction.addAction.destinationFileName = currentActionToDoTransfer.destination.fileName().toStdString(); + newAction.addAction.size = currentActionToDoTransfer.size; + newAction.addAction.mode = currentActionToDoTransfer.mode; + actionDone.push_back(newAction); + int_for_transfer_thread_search++; + numberOfInodeOperation++; + #ifdef ULTRACOPIER_PLUGIN_DEBUG_SCHEDULER + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"numberOfInodeOperation: "+std::to_string(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,"numberOfInodeOperation: "+std::to_string(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).toStdString()); + 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,"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,"TransferStat: "+std::to_string(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.push_back(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 std::vector &include,const std::vector &exclude) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("include.size(): %1, exclude.size(): %2").arg(include.size()).arg(exclude.size()).toStdString()); + this->include=include; + this->exclude=exclude; + unsigned int index=0; + while(indexsetFilters(include,exclude); + index++; + } +} + +void ListThread::set_sendNewRenamingRules(const std::string &firstRenamingRule,const std::string &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_loop newList; + int index=0; + int loop_sub_size_transfer_thread_search=transferThreadList.size(); + while(indexgetStat()) + { + 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.push_back(QStringLiteral("%1) (%3,%4) %2") + .arg(index) + .arg(stat) + .arg(transferThreadList.at(index)->readingLetter()) + .arg(transferThreadList.at(index)->writingLetter()) + .toStdString() + ); + index++; + } + std::vector newList2; + index=0; + const int &loop_size=actionToDoListTransfer.size(); + while(index((inodeThreads+ULTRACOPIER_PLUGIN_MAXPARALLELTRANFER)*2+1)) + { + newList2.push_back("..."); + 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 std::string &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.push_back(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 std::string &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 std::string &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()>=(unsigned int)inodeThreads) + return; + transferThreadList.push_back(new TransferThread()); + TransferThread * last=transferThreadList.back(); + 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,"unable to set the block size: "+std::to_string(blockSizeAfterSpeedLimitation)); + #else + if(!last->setBlockSize(blockSize)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to set the block size: "+std::to_string(blockSize)); + #endif + if(!last->setSequentialBuffer(sequentialBuffer)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to set the sequentialBuffer: "+std::to_string(sequentialBuffer)); + if(!last->setBlockSize(parallelBuffer)) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to set the parallelBuffer: "+std::to_string(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()>=(unsigned int)inodeThreads) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"create the last of the "+std::to_string(inodeThreads)+" 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.erase(transferThreadList.cbegin()+index); + loop_size--; + } + else + index++; + } + if(loop_size==inodeThreads) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"inodeThreads is lowered to the right value: "+std::to_string(inodeThreads)); + } +} + +void ListThread::setTransferAlgorithm(const TransferAlgorithm &transferAlgorithm) +{ + 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 send_setTransferAlgorithm(transferAlgorithm); +} + +void ListThread::setParallelBuffer(int parallelBuffer) +{ + if(parallelBuffer<1 || parallelBuffer>ULTRACOPIER_PLUGIN_MAX_PARALLEL_NUMBER_OF_BLOCK) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"wrong number of block: "+std::to_string(parallelBuffer)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"in number of block: "+std::to_string(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,"wrong number of block: "+std::to_string(sequentialBuffer)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"in number of block: "+std::to_string(sequentialBuffer)); + this->sequentialBuffer=sequentialBuffer; + emit send_sequentialBuffer(sequentialBuffer); +} + +void ListThread::setParallelizeIfSmallerThan(const unsigned int ¶llelizeIfSmallerThan) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"parallelizeIfSmallerThan in Bytes: "+std::to_string(parallelizeIfSmallerThan)); + this->parallelizeIfSmallerThan=parallelizeIfSmallerThan; +} + +void ListThread::setMoveTheWholeFolder(const bool &moveTheWholeFolder) +{ + for(unsigned 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,"inodeThreads is out of ranges: "+std::to_string(inodeThreads)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"inodeThreads: "+std::to_string(inodeThreads)); + this->inodeThreads=inodeThreads; + createTransferThread(); + deleteTransferThread(); +} + +void ListThread::setRenameTheOriginalDestination(const bool &renameTheOriginalDestination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"renameTheOriginalDestination: "+std::to_string(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(unsigned int i=0;isetCopyListOrder(this->copyListOrder); +} + +void ListThread::exportErrorIntoTransferList(const std::string &fileName) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + QFile transferFile(QString::fromStdString(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 + +#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 std::vector &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 std::string &destination); + /// \return empty if multiple or no destination + std::string 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 std::vector &sources,const std::string &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 std::vector &sources,const std::string &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 + { + uint64_t id; + uint64_t 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 + }; + std::vector actionToDoListTransfer; + /// \brief to store one action to do + struct ActionToDoInode + { + ActionType type;///< \see ActionType + uint64_t id; + int64_t 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 + }; + std::vector actionToDoListInode; + std::vector actionToDoListInode_afterTheTransfer; + int numberOfInodeOperation; + struct ErrorLogEntry + { + QFileInfo source; + QFileInfo destination; + std::string error; + Ultracopier::CopyMode mode; + }; + std::vector errorLog; + //dir operation thread queue + MkPath mkPathQueue; + //to get the return value from copyEngine + bool getReturnBoolToCopyEngine() const; + std::pair 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 uint64_t &id); + /** \brief skip as interanl one transfer entry + * \param id id of the file to remove */ + bool skipInternal(const uint64_t &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 std::vector &ids); + /** \brief move on top of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnTop(std::vector ids); + /** \brief move up the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsUp(std::vector ids); + /** \brief move down the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsDown(std::vector ids); + /** \brief move on bottom of the list the selected item + * \param ids ids is the id list of the selected items */ + void moveItemsOnBottom(std::vector 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 std::string &fileName); + /// \brief import the transfer list into a file + void importTransferList(const std::string &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 int64_t &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 std::string &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 std::vector &include,const std::vector &exclude); + void set_sendNewRenamingRules(const std::string &firstRenamingRule,const std::string &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 std::string &fileName); +private: + QSemaphore mkpathTransfer; + std::string sourceDrive; + bool sourceDriveMultiple; + std::string destinationDrive; + std::string destinationFolder; + bool destinationDriveMultiple; + bool destinationFolderMultiple; + DriveManagement driveManagement; + + bool stopIt; + std::vector scanFileOrFolderThreadsPool; + int numberOfTransferIntoToDoList; + std::vector transferThreadList; + ScanFileOrFolder * newScanThread(Ultracopier::CopyMode mode); + uint64_t bytesToTransfer; + uint64_t bytesTransfered; + bool autoStart; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + bool rsync; + #endif + bool putInPause; + std::vector actionDone;///< to action to send to the interface + uint64_t idIncrementNumber;///< to store the last id returned + int64_t 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; + std::unordered_map requiredSpace; + std::vector > timeToTransfer; + unsigned int putAtBottom; + unsigned int osBufferLimit; + std::vector include,exclude; + Ultracopier::CopyMode mode; + bool forcedMode; + std::string firstRenamingRule; + std::string 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 + uint64_t addToTransfer(const QFileInfo& source,const QFileInfo& destination,const Ultracopier::CopyMode& mode); + //generate id number + uint64_t generateIdNumber(); + //warning the first entry is accessible will copy + bool removeSingleItem(const uint64_t &id); + //put on top + bool moveOnTopItem(const uint64_t &id); + //move up + bool moveUpItem(const uint64_t &id); + //move down + bool moveDownItem(const uint64_t &id); + //put on bottom + bool moveOnBottomItem(const uint64_t &id); + //general transfer + void startGeneralTransfer(); + //debug windows if needed + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + QTimer timerUpdateDebugDialog; + #endif + void detectDrivesOfCurrentTransfer(const std::vector &sources,const std::string &destination); + FacilityInterface * facilityInterface; + QSemaphore waitConstructor,waitCancel; + int actionToDoListTransfer_count,actionToDoListInode_count; + bool doTransfer,doInode; + int64_t oversize;//used as temp variable + int64_t currentProgression; + int64_t copiedSize,totalSize,localOverSize; + std::vector 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 + std::vector drives; + FileExistsAction alwaysDoThisActionForFileExists; + //to return value to the copyEngine + bool returnBoolToCopyEngine; + std::pair returnPairQuint64ToCopyEngine; + std::vector 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 std::string &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 std::string &errorString, const ErrorType &errorType); + //to run the thread + void run(); + /// \to create transfer thread + void createTransferThread(); + void deleteTransferThread(); + //mk path to do + uint64_t 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 std::vector &) const;///very important, need be temporized to group the modification to do and not flood the interface + void syncReady() const; + void doneTime(const std::vector >&) 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 std::vector &progressionList) const; + //get information about the copy + /** \brief to get the general progression + * first = current transfered byte, second = byte to transfer */ + void pushGeneralProgression(const uint64_t &,const uint64_t &) const; + + void newFolderListing(const std::string &path) const; + void isInPause(const bool &) const; + + //when can be deleted + void canBeDeleted() const; + void haveNeedPutAtBottom(bool needPutAtBottom,const QFileInfo &fileInfo,const std::string &errorString,TransferThread * thread,const ErrorType &errorType) const; + + //send error occurred + void error(const std::string &path,const uint64_t &size,const uint64_t &mtime,const std::string &error) const; + void errorToRetry(const std::string &source,const std::string &destination,const std::string &error) const; + //for the extra logging + void rmPath(const std::string &path) const; + void mkPath(const std::string &path) const; + /// \brief To debug source + #ifdef ULTRACOPIER_PLUGIN_DEBUG + void debugInformation(const Ultracopier::DebugLevel &level,const std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; + #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG_WINDOW + void updateTheDebugInfo(const std::vector &,const std::vector&,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 std::string &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 std::string &errorString,ScanFileOrFolder * thread, const ErrorType &errorType) const; + //send the progression + void send_syncTransferList() const; + //mkpath error event + void mkPathErrorOnFolder(const QFileInfo &fileInfo,const std::string &errorString,const ErrorType &errorType) const; + //to close + void tryCancel() const; + //to ask new transfer thread + void askNewTransferThread() const; + + void warningTransferList(const std::string &warning) const; + void errorTransferList(const std::string &error) const; + void send_sendNewRenamingRules(const std::string &firstRenamingRule,const std::string &otherRenamingRule) const; + void send_realBytesTransfered(const uint64_t &) 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(std::vector 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..12421f2 --- /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()).toStdString()); + 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()).toStdString()); + 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()).toStdString()); + 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.empty())//don't put afterTheTransfer because actionToDoListInode_afterTheTransfer -> already afterTheTransfer + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("launch rmpath: %1").arg(currentActionToDoInode.source.absoluteFilePath()).toStdString()); + 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.push_back(currentActionToDoInode); + actionToDoListInode.erase(actionToDoListInode.cbegin()+int_for_internal_loop); + int_for_internal_loop--; + actionToDoListInode_count--; + if(numberOfInodeOperation>=inodeThreads) + return; + } + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"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..52d67af --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/MkPath.cpp @@ -0,0 +1,517 @@ +#include "MkPath.h" + +#ifdef Q_OS_WIN32 + #ifndef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include + #endif +#endif + +std::string MkPath::text_slash="/"; + +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=std::regex("^[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()).toStdString()); + 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).toStdString()); + #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().toStdString()+", error: "+removedFile.errorString().toStdString()); + emit errorOnFolder(pathList.first().destination,removedFile.errorString().toStdString()); + 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().toStdString()); + emit errorOnFolder(pathList.first().destination,tr("Unable to remove").toStdString()); + 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().toStdString()); + 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().toStdString()+": "+maxTime.toString("dd.MM.yyyy hh:mm:ss.zzz").toStdString()+">="+pathList.first().source.lastModified().toString("dd.MM.yyyy hh:mm:ss.zzz").toStdString()); + 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().toStdString()); + emit errorOnFolder(pathList.first().destination,tr("Unable to create the folder").toStdString()); + 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().toStdString()); + emit errorOnFolder(pathList.first().destination,tr("The source folder don't exists").toStdString()); + 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().toStdString()); + /*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()+QString::fromStdString(text_slash))) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"move into it self: "+pathList.first().destination.absoluteFilePath().toStdString()); + int random=rand(); + QFileInfo tempFolder=pathList.first().source.absolutePath()+QString::fromStdString(text_slash)+QString::number(random); + while(tempFolder.exists()) + { + random=rand(); + tempFolder=pathList.first().source.absolutePath()+QString::fromStdString(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().toStdString()); + emit errorOnFolder(pathList.first().destination,tr("Unable to temporary rename the folder").toStdString()); + 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().toStdString()); + emit errorOnFolder(pathList.first().destination,tr("Unable to do the final real move the folder").toStdString()); + 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().toStdString()+", soruce exists: "+std::to_string(QDir(pathList.first().source.absoluteFilePath()).exists())+", to: "+pathList.first().destination.absoluteFilePath().toStdString() + +", destination exist: "+std::to_string(QDir(pathList.first().destination.absoluteFilePath()).exists())); + emit errorOnFolder(pathList.first().destination,tr("Unable to move the folder").toStdString()); + 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().toStdString()); + else if(!pathList.first().destination.isDir()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to set destination folder time (not a dir): "+pathList.first().destination.absoluteFilePath().toStdString()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to set destination folder time: "+pathList.first().destination.absoluteFilePath().toStdString()); + /*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().toStdString()); + /*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().toStdString()); + emit errorOnFolder(pathList.first().source,tr("Unable to remove").toStdString()); + 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()).toStdString()); + 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().toStdString()+", due to: "+file.errorString().toStdString()); + allHaveWork=false; + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"found a file: "+fileInfo.fileName().toStdString()); + allHaveWork=false; + } + } + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"found a file: "+fileInfo.fileName().toStdString()); + allHaveWork=false; + } + #else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"found a file: "+fileInfo.fileName().toStdString()); + 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().toStdString()); + return allHaveWork; +} + +//fonction to edit the file date time +bool MkPath::readFileDateTime(const QFileInfo &source) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"readFileDateTime("+source.absoluteFilePath().toStdString()+")"); + /** 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(std::regex_match(source.absoluteFilePath().toStdString(),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).toStdString()+", error: "+std::to_string(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().toStdString()+")"); + /** 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(std::regex_match(destination.absoluteFilePath().toStdString(),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).toStdString()+", error: "+std::to_string(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..2bbebcc --- /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 std::string &,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 std::string &fonction,const std::string &text,const std::string &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 + uint64_t ftCreateL, ftAccessL, ftWriteL; + uint64_t ftCreateH, ftAccessH, ftWriteH; + std::regex regRead; + #endif + #endif + #endif + //fonction to edit the file date time + bool readFileDateTime(const QFileInfo &source); + bool writeFileDateTime(const QFileInfo &destination); + static std::string 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..e843d9b --- /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,"["+std::to_string(id)+"] the thread not running to open destination: "+file.absoluteFilePath().toStdString()); + errorString_internal=tr("Internal error, please report it!").toStdString(); + emit error(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] open source: "+file.absoluteFilePath().toStdString()); + if(this->file.isOpen()) + { + if(file.absoluteFilePath()==this->file.fileName()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] Try reopen already opened same file: "+file.absoluteFilePath().toStdString()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] previous file is already open: "+file.absoluteFilePath().toStdString()); + emit internalStartClose(); + isOpen.acquire(); + isOpen.release(); + } + if(isInReadLoop) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] previous file is already readding: "+file.absoluteFilePath().toStdString()); + return; + } + if(tryStartRead) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] previous file is already try read: "+file.absoluteFilePath().toStdString()); + return; + } + stopIt=false; + fakeMode=false; + lastGoodPosition=0; + this->file.setFileName(file.absoluteFilePath()); + this->mode=mode; + emit internalStartOpen(); +} + +std::string ReadThread::errorString() const +{ + return errorString_internal; +} + +void ReadThread::stop() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] start"); + putInPause=false; + stopIt=false; + } + else + return; + if(!file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] file is not open"); + return; + } + pauseMutex.release(); +} + +bool ReadThread::seek(const int64_t &position) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start with: "+std::to_string(position)); + if(position>file.size()) + return false; + return file.seek(position); +} + +int64_t 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,"["+std::to_string(id)+"] 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").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] 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: ").toStdString()+file.errorString().toStdString()+" ("+std::to_string(file.error())+")"; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("file.error()!=QFile::NoError: %1, error: ").arg(QString::number(file.error())).toStdString()+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").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error())).toStdString()); + emit error(); + isInReadLoop=false; + return; + } + isInReadLoop=false; + if(stopIt) + { + stopIt=false; + return; + } + emit checksumFinish(hash.result()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] stop the read"); +} + +bool ReadThread::internalOpenSlot() +{ + return internalOpen(); +} + +bool ReadThread::internalOpen(bool resetLastGoodPosition) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] internalOpen source: "+file.fileName().toStdString()+", open in write because move: "+std::to_string(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,"["+std::to_string(id)+"] this file is already open: "+file.fileName().toStdString()); + #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().toMSecsSinceEpoch()/1000; + putInPause=false; + if(resetLastGoodPosition) + lastGoodPosition=0; + if(!seek(lastGoodPosition)) + { + file.close(); + errorString_internal=file.errorString().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).toStdString()+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().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to open: %1, error: ").arg(file.fileName()).toStdString()+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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] is not open!"); + isInReadLoop=false; + return; + } + QByteArray blockArray; + #ifdef ULTRACOPIER_PLUGIN_SPEED_SUPPORT + numberOfBlockCopied=0; + #endif + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start the copy"); + emit readIsStarted(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] stopIt == true, then quit"); + isInReadLoop=false; + internalClose(); + return; + } + do + { + //read one block + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"["+std::to_string(id)+"] read put in pause"); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] stopIt == true, then quit"); + isInReadLoop=false; + internalClose(); + return; + } + pauseMutex.acquire(); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] 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: ").toStdString()+file.errorString().toStdString()+" ("+std::to_string(file.error())+")"; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("file.error()!=QFile::NoError: %1, error: ").arg(QString::number(file.error())).toStdString()+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,"["+std::to_string(id)+"] stopped because the write is stopped: "+std::to_string(lastGoodPosition)); + stopIt=true; + } + } + + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] 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").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error())).toStdString()); + 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,"["+std::to_string(id)+"] stop the read"); +} + +void ReadThread::startRead() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + if(tryStartRead) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] already in try start"); + return; + } + if(isInReadLoop) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] 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,"block size out of range: "+std::to_string(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(); +} + +int64_t 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,"["+std::to_string(id)+"] start"); + if(isInReadLoop) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] try reopen where read is not finish"); + return; + } + stopIt=true; + emit internalStartReopen(); +} + +bool ReadThread::internalReopen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + stopIt=false; + if(file.isOpen()) + { + file.close(); + isOpen.release(); + } + if(size_at_open!=file.size() && mtime_at_open!=(uint64_t)QFileInfo(file).lastModified().toMSecsSinceEpoch()/1000) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(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(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + stopIt=true; + seekToZero=true; + emit checkIfIsWait(); +} + +void ReadThread::isInWait() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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..f817e35 --- /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 + std::string 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 + int64_t size() const; + /// \brief get the last good position + int64_t 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,std::string fonction,std::string text,std::string file,int ligne) const; + +private: + std::string errorString_internal; + AvancedQFile file; + volatile bool stopIt; + Ultracopier::CopyMode mode; + int64_t 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; + int64_t size_at_open; + uint64_t mtime_at_open; + bool fakeMode; + //internal function + bool seek(const int64_t &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..4ae23b8 --- /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("",""); +} + +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(std::string firstRenamingRule,std::string otherRenamingRule) +{ + disconnectUI(); + this->firstRenamingRule=firstRenamingRule; + this->otherRenamingRule=otherRenamingRule; + if(!firstRenamingRule.empty()) + ui->firstRenamingRule->setText(QString::fromStdString(firstRenamingRule)); + else + ui->firstRenamingRule->setText(tr("%1 - copy").arg(QStringLiteral("%name%"))); + if(!otherRenamingRule.empty()) + ui->otherRenamingRule->setText(QString::fromStdString(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.toStdString()==firstRenamingRule) + return; + firstRenamingRule=newValue.toStdString(); + 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.toStdString()==otherRenamingRule) + return; + otherRenamingRule=newValue.toStdString(); + 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..b2e9d02 --- /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(std::string firstRenamingRule, std::string otherRenamingRule); + void newLanguageLoaded(); +private: + Ui::RenamingRules *ui; + void connectUI(); + void disconnectUI(); + std::string firstRenamingRule; + std::string otherRenamingRule; +private slots: + void on_buttonBox_clicked(QAbstractButton *button); + void firstRenamingRule_haveChanged(); + void otherRenamingRule_haveChanged(); +signals: + void sendNewRenamingRules(std::string firstRenamingRule,std::string 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..736f589 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp @@ -0,0 +1,688 @@ +#include "ScanFileOrFolder.h" +#include "TransferThread.h" +#include +#include +#include +#include "../../../cpp11addition.h" + +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif + +std::string ScanFileOrFolder::text_slash="/"; +std::string ScanFileOrFolder::text_antislash="\\"; +std::string ScanFileOrFolder::text_dot="."; + +ScanFileOrFolder::ScanFileOrFolder(const Ultracopier::CopyMode &mode) +{ + #ifdef ULTRACOPIER_PLUGIN_RSYNC + rsync = false; + #endif + moveTheWholeFolder = true; + stopped = true; + stopIt = false; + this->mode = mode; + folder_isolation = std::regex("^(.*/)?([^/]+)/$"); + 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.push_back(QFileInfo(QStringLiteral("C:/Users/%1/AppData/Roaming/").arg(userName)).absoluteFilePath().toStdString()); + } + delete userNameW; + #endif +} + +ScanFileOrFolder::~ScanFileOrFolder() +{ + stop(); + quit(); + wait(); +} + +bool ScanFileOrFolder::isFinished() const +{ + return stopped; +} + +void ScanFileOrFolder::addToList(const std::vector& sources,const std::string& destination) +{ + stopIt=false; + this->sources=parseWildcardSources(sources); + this->destination=destination; + QFileInfo destinationInfo(QString::fromStdString(this->destination)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"check symblink: "+destinationInfo.absoluteFilePath().toStdString()); + while(destinationInfo.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"resolv destination to: "+destinationInfo.symLinkTarget().toStdString()); + if(QFileInfo(destinationInfo.symLinkTarget()).isAbsolute()) + this->destination=destinationInfo.symLinkTarget().toStdString(); + else + this->destination=destinationInfo.absolutePath().toStdString()+text_slash+destinationInfo.symLinkTarget().toStdString(); + destinationInfo.setFile(QString::fromStdString(this->destination)); + } + if(sources.size()>1 || QFileInfo(QString::fromStdString(destination)).isDir()) + /* Disabled because the separator transformation product bug + * if(!destination.endsWith(QDir::separator())) + this->destination+=QDir::separator();*/ + if(!stringEndsWith(destination,'/') && !stringEndsWith(destination,'\\')) + this->destination+=text_slash;//put unix separator because it's transformed into that's under windows too + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"addToList("+stringimplode(sources,";")+","+this->destination+")"); +} + + +std::vector ScanFileOrFolder::parseWildcardSources(const std::vector &sources) const +{ + std::regex splitFolder("[/\\\\]"); + std::vector returnList; + unsigned int index=0; + while(index<(unsigned int)sources.size()) + { + if(sources.at(index).find("*") != std::string::npos) + { + std::vector toParse=stringregexsplit(sources.at(index),splitFolder); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"before wildcard parse: "+sources.at(index)+", toParse: "+stringimplode(toParse,", ")); + std::vector > recomposedSource; + { + std::vector t; + t.push_back(""); + recomposedSource.push_back(t); + } + while(toParse.size()>0) + { + if(toParse.front().find("*") != std::string::npos) + { + std::string toParseFirst=toParse.front(); + if(toParseFirst.empty()) + toParseFirst=text_slash; + std::vector > newRecomposedSource; + stringreplaceAll(toParseFirst,"*","[^/\\\\]*"); + std::regex toResolv=std::regex(toParseFirst); + unsigned int index_recomposedSource=0; + while(index_recomposedSource tempList=recomposedSource.at(index_recomposedSource); + tempList.push_back(fileName); + newRecomposedSource.push_back(tempList); + } + index_fileList++; + } + } + index_recomposedSource++; + } + recomposedSource=newRecomposedSource; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"add toParse: "+stringimplode(toParse,text_slash)); + unsigned int index_recomposedSource=0; + while(index_recomposedSource &include, const std::vector &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,"haveFilters: "+std::to_string(haveFilters)+", include_send.size(): "+std::to_string(include_send.size())+", exclude_send.size(): "+std::to_string(exclude_send.size())); +} + +//set action if Folder are same or exists +void ScanFileOrFolder::setFolderExistsAction(const FolderExistsAction &action, const std::string &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: "+std::to_string(mode)); + destination=resolvDestination(QString::fromStdString(destination)).absoluteFilePath().toStdString(); + if(stopIt) + { + stopped=true; + return; + } + if(fileErrorAction==FileError_Skip) + { + stopped=true; + return; + } + unsigned int sourceIndex=0; + while(sourceIndexinclude=this->include_send; + this->exclude=this->exclude_send; + } + std::string fileName=fileInfo.fileName().toStdString(); + if(fileInfo.isDir() && !fileInfo.isSymLink()) + { + bool excluded=false,included=(include.size()==0); + unsigned int filters_index=0; + while(filters_indexcheckDestinationExists=checkDestinationFolderExists; +} + +void ScanFileOrFolder::setRenamingRules(const std::string &firstRenamingRule, const std::string &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: "+std::to_string(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..0c625e9 --- /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 std::string &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 std::string &firstRenamingRule,const std::string &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 std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; + void folderAlreadyExists(const QFileInfo &source,const QFileInfo &destination,const bool &isSame) const; + void errorOnFolder(const QFileInfo &fileInfo,const std::string &errorString,const ErrorType &errorType=ErrorType_FolderWithRety) const; + void finishedTheListing() const; + + void newFolderListing(const std::string &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 std::vector& sources,const std::string& destination); + void setFilters(const std::vector &include,const std::vector &exclude); + void setCopyListOrder(const bool &order); + void set_updateMount(); +protected: + void run(); +private: + DriveManagement driveManagement; + bool moveTheWholeFolder; + std::vector sources; + std::string 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; + std::string newName; + bool copyListOrder; + std::regex folder_isolation; + #ifdef ULTRACOPIER_PLUGIN_RSYNC + bool rsync; + #endif + Ultracopier::CopyMode mode; + std::vector include,exclude; + std::vector include_send,exclude_send; + bool reloadTheNewFilters; + bool haveFilters; + QMutex filtersMutex; + std::string firstRenamingRule; + std::string otherRenamingRule; + std::vector 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 + */ + std::vector parseWildcardSources(const std::vector &sources) const; + + static std::string text_slash; + static std::string text_antislash; + static std::string 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..036803c --- /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 +{ + std::string search_text; + SearchType search_type; + ApplyOn apply_on; + bool need_match_all; + std::regex 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 +{ + std::string drive; + uint64_t requiredSpace; + uint64_t 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..786a8e9 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/TransferThread.cpp @@ -0,0 +1,2091 @@ +//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 + +#ifdef Q_OS_WIN32 +#define CURRENTSEPARATOR "\\" +#else +#define CURRENTSEPARATOR "/" +#endif + +#include "../../../cpp11addition.h" + +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=std::regex("^(.*)(\\.[a-z0-9]+)$"); + #ifdef Q_OS_WIN32 + #ifndef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + regRead=std::regex("^[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,"["+std::to_string(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,"["+std::to_string(id)+("] can't start transfert at idle")); + } + return; + } + if(transfer_stat==TransferStat_PostOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] can't start transfert at PostOperation")); + return; + } + if(transfer_stat==TransferStat_Transfer) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] can't start transfert at Transfer")); + return; + } + if(canStartTransfer) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] canStartTransfer is already set to true")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+("] check how start the transfer")); + canStartTransfer=true; + if(readIsReadyVariable && writeIsReadyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+("] start directly the transfer")); + ifCanStartTransfer(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+("] start the transfer as delayed")); +} + +bool TransferThread::setFiles(const QFileInfo& source, const int64_t &size, const QFileInfo& destination, const Ultracopier::CopyMode &mode) +{ + if(transfer_stat!=TransferStat_Idle) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] already used, source: ")+source.absoluteFilePath().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()); + 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,"["+std::to_string(id)+"] start, source: "+source.absoluteFilePath().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()); + 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,"["+std::to_string(id)+("] already used, source: ")+source.absoluteFilePath().toStdString()+(", destination: ")+destination.absoluteFilePath().toStdString()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+("] action: ")+std::to_string(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 std::string &nameForRename) +{ + if(transfer_stat!=TransferStat_PreOperation) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] already used, source: ")+source.absoluteFilePath().toStdString()+(", destination: ")+destination.absoluteFilePath().toStdString()); + return; + } + if(QString::fromStdString(nameForRename).contains(QRegularExpression(QStringLiteral("[/\\\\\\*]")))) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] can't use this kind of name, internal error")); + emit errorOnFile(destination,tr("Try rename with using special characters").toStdString()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] nameForRename: "+nameForRename); + if(!renameTheOriginalDestination) + destination.setFile(destination.absolutePath()+CURRENTSEPARATOR+QString::fromStdString(nameForRename)); + else + { + QString tempDestination=destination.absoluteFilePath(); + QFile destinationFile(tempDestination); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"["+std::to_string(id)+"] "+QStringLiteral("rename %1: to: %2").arg(destination.absoluteFilePath()).arg(destination.absolutePath()+CURRENTSEPARATOR+QString::fromStdString(nameForRename)).toStdString()); + if(!destinationFile.rename(destination.absolutePath()+CURRENTSEPARATOR+QString::fromStdString(nameForRename))) + { + if(!destinationFile.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("source not exists %1: destination: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString()).toStdString()); + emit errorOnFile(destinationFile,tr("File not found").toStdString()); + return; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("unable to do real move %1: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString()).toStdString()); + emit errorOnFile(destinationFile,destinationFile.errorString().toStdString()); + return; + } + if(source.absoluteFilePath()==destination.absoluteFilePath()) + source.setFile(destination.absolutePath()+CURRENTSEPARATOR+QString::fromStdString(nameForRename)); + destination.setFile(tempDestination); + destination.refresh(); + } + fileExistsAction = FileExists_NotSet; + resetExtraVariable(); + emit internalStartPreOperation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] destination is: "+destination.absoluteFilePath().toStdString()); +} + +void TransferThread::setAlwaysFileExistsAction(const FileExistsAction &action) +{ + //ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(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,"["+std::to_string(id)+("] already used, source: ")+source.absoluteFilePath().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()); + return; + } + haveStartTime=true; + startTransferTime.restart(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start: source: "+source.absoluteFilePath().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()); + needRemove=false; + if(isSame()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] is same "+source.absoluteFilePath().toStdString()+" than "+destination.absoluteFilePath().toStdString()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] after is same"); + /*Why this code? + if(readError) + { + readError=false; + return; + }*/ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] before destination exists"); + if(destinationExists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] destination exists: "+destination.absoluteFilePath().toStdString()); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] after destination exists"); + /*Why this code? + if(readError) + { + readError=false; + return; + }*/ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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")).toStdString()); + doTheDateTransfer=false; + if(keepDate) + { + emit errorOnFile(source,tr("Wrong modification date or unable to get it, you can disable time transfer to do it").toStdString()); + return; + } + } + } + else + { + doTheDateTransfer=readFileDateTime(source); + #ifdef Q_OS_MAC + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] read the source time: "+std::to_string(butime.modtime)); + #endif + if(!doTheDateTransfer) + { + //will have the real error at source open + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] unable to read the source time: "+source.absoluteFilePath().toStdString()); + if(keepDate) + { + emit errorOnFile(source,tr("Wrong modification date or unable to get it, you can disable time transfer to do it").toStdString()); + return; + } + } + } + } + if(canBeMovedDirectly()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] "+QStringLiteral("need moved directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).toStdString()); + canBeMovedDirectlyVariable=true; + readThread.fakeOpen(); + writeThread.fakeOpen(); + return; + } + if(canBeCopiedDirectly()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] "+QStringLiteral("need copied directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).toStdString()); + canBeCopiedDirectlyVariable=true; + readThread.fakeOpen(); + writeThread.fakeOpen(); + return; + } + tryOpen(); +} + +void TransferThread::tryOpen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start source and destination: "+source.absoluteFilePath().toStdString()+" and "+destination.absoluteFilePath().toStdString()); + TransferAlgorithm transferAlgorithm=this->transferAlgorithm; + if(transferAlgorithm==TransferAlgorithm_Automatic) + { + #ifdef Q_OS_LINUX + if(driveManagement.isSameDrive(destination.absoluteFilePath().toStdString(),source.absoluteFilePath().toStdString())) + { + const QByteArray &type=driveManagement.getDriveType(driveManagement.getDrive(source.absoluteFilePath().toStdString())); + 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,"["+std::to_string(id)+"] readIsOpeningVariable is true when try open"); + emit errorOnFile(source,tr("Internal error: Already opening").toStdString()); + readError=true; + return; + } + } + if(!writeIsOpenVariable) + { + if(!writeIsOpeningVariable) + { + if(transferAlgorithm==TransferAlgorithm_Sequential) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] transferAlgorithm==TransferAlgorithm_Sequential"); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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; +} + +std::string 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.toStdString(); +} + +std::string TransferThread::getSourcePath() const +{ + return source.absoluteFilePath().toStdString(); +} + +std::string TransferThread::getDestinationPath() const +{ + return destination.absoluteFilePath().toStdString(); +} + +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; + std::string fileName=resolvedName(newDestination); + std::string suffix; + std::string newFileName; + //resolv the suffix + if(std::regex_match(fileName,renameRegex)) + { + suffix=fileName; + suffix=std::regex_replace(suffix,renameRegex,"$2"); + fileName=std::regex_replace(fileName,renameRegex,"$1"); + } + //resolv the new name + int num=1; + do + { + if(num==1) + { + if(firstRenamingRule.empty()) + newFileName=tr("%1 - copy").arg(QString::fromStdString(fileName)).toStdString(); + else + { + newFileName=firstRenamingRule; + stringreplaceAll(newFileName,"%name%",fileName); + } + } + else + { + if(otherRenamingRule.empty()) + newFileName=tr("%1 - copy (%2)").arg(QString::fromStdString(fileName)).arg(num).toStdString(); + else + { + newFileName=otherRenamingRule; + stringreplaceAll(newFileName,"%name%",fileName); + stringreplaceAll(newFileName,"%number%",std::to_string(num)); + } + } + newDestination.setFile(newDestination.absolutePath()+CURRENTSEPARATOR+QString::fromStdString(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,"["+std::to_string(id)+"] "+QStringLiteral("source not exists %1: destination: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString()).toStdString()); + emit errorOnFile(destinationFile,tr("File not found").toStdString()); + readError=true; + return true; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("unable to do real move %1: %2, error: %3").arg(destinationFile.fileName()).arg(destinationFile.fileName()).arg(destinationFile.errorString()).toStdString()); + readError=true; + emit errorOnFile(destinationFile,destinationFile.errorString().toStdString()); + return true; + } + } + return true; + } + return false; +} + +void TransferThread::tryMoveDirectly() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] "+QStringLiteral("need moved directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).toStdString()); + + 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,"["+std::to_string(id)+"] "+destinationFile.fileName().toStdString()+", source not exists"); + readError=true; + emit errorOnFile(destination,tr("The source file doesn't exist").toStdString()); + return; + } + else if(!destinationFile.remove()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+destinationFile.fileName().toStdString()+", error: "+destinationFile.errorString().toStdString()); + readError=true; + emit errorOnFile(destination,destinationFile.errorString().toStdString()); + 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,"["+std::to_string(id)+"] "+QStringLiteral("source not exists %1: destination: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).toStdString()); + emit errorOnFile(sourceFile,tr("File not found").toStdString()); + return; + } + else if(!dir.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("destination folder not exists %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).toStdString()); + emit errorOnFile(destination.absolutePath(),tr("Unable to do the folder").toStdString()); + return; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("unable to do real move %1: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).toStdString()); + emit errorOnFile(sourceFile,sourceFile.errorString().toStdString()); + return; + } + readThread.fakeReadIsStarted(); + writeThread.fakeWriteIsStarted(); + readThread.fakeReadIsStopped(); + writeThread.fakeWriteIsStopped(); +} + +void TransferThread::tryCopyDirectly() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] "+QStringLiteral("need copied directly: %1 to %2").arg(source.absoluteFilePath()).arg(destination.absoluteFilePath()).toStdString()); + + 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,"["+std::to_string(id)+"] "+destinationFile.fileName().toStdString()+", source not exists"); + readError=true; + emit errorOnFile(destination,tr("The source doesn't exist").toStdString()); + return; + } + else if(!destinationFile.remove()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+destinationFile.fileName().toStdString()+", error: "+destinationFile.errorString().toStdString()); + readError=true; + emit errorOnFile(destination,destinationFile.errorString().toStdString()); + 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,"["+std::to_string(id)+"] "+QStringLiteral("source not exists %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget()).toStdString()); + emit errorOnFile(sourceFile,tr("The source file doesn't exist").toStdString()); + return; + } + else if(destinationFile.exists() || destination.isSymLink()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("destination already exists %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget()).toStdString()); + emit errorOnFile(sourceFile,tr("Another file exists at same place").toStdString()); + return; + } + else if(!dir.exists()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("destination folder not exists %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget()).toStdString()); + emit errorOnFile(sourceFile,tr("Unable to do the folder").toStdString()); + return; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("unable to do sym link copy %1 -> %4: %2, error: %3").arg(sourceFile.fileName()).arg(destinationFile.fileName()).arg(sourceFile.errorString()).arg(sourceFile.symLinkTarget()).toStdString()); + emit errorOnFile(sourceFile,sourceFile.errorString().toStdString()); + return; + } + readThread.fakeReadIsStarted(); + writeThread.fakeWriteIsStarted(); + readThread.fakeReadIsStopped(); + writeThread.fakeWriteIsStopped(); +} + +bool TransferThread::canBeMovedDirectly() const +{ + if(mode!=Ultracopier::Move) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] mode!=Ultracopier::Move"); + return false; + } + return source.isSymLink() || driveManagement.isSameDrive(destination.absoluteFilePath().toStdString(),source.absoluteFilePath().toStdString()); +} + +bool TransferThread::canBeCopiedDirectly() const +{ + return source.isSymLink(); +} + +void TransferThread::readIsReady() +{ + if(readIsReadyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] double event dropped"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + readIsReadyVariable=true; + readIsOpenVariable=true; + readIsClosedVariable=false; + readIsOpeningVariable=false; + ifCanStartTransfer(); +} + +void TransferThread::ifCanStartTransfer() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] readIsReadyVariable: "+std::to_string(readIsReadyVariable)+", writeIsReadyVariable: "+std::to_string(writeIsReadyVariable)); + if(readIsReadyVariable && writeIsReadyVariable) + { + transfer_stat=TransferStat_WaitForTheTransfer; + sended_state_readStopped = false; + sended_state_writeStopped = false; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] stat=WaitForTheTransfer"); + if(!sended_state_preOperationStopped) + { + sended_state_preOperationStopped=true; + emit preOperationStopped(); + } + if(canStartTransfer) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] stat=Transfer, "+QStringLiteral("canBeMovedDirectlyVariable: %1, canBeCopiedDirectlyVariable: %2").arg(canBeMovedDirectlyVariable).arg(canBeCopiedDirectlyVariable).toStdString()); + 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,"["+std::to_string(id)+"] double event dropped"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"transfer_stat==TransferStat_Idle"); + return; + } + if(remainSourceOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"remainSourceOpen()"); + readThread.stop(); + } + if(remainDestinationOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"remainDestinationOpen()"); + writeThread.stop(); + } + if(!remainFileOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"transfer_stat==TransferStat_Idle"); + if(needRemove && source.absoluteFilePath()!=destination.absoluteFilePath()) + { + if(source.exists()) + QFile(destination.absoluteFilePath()).remove(); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] 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).toStdString()); +} + +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,"["+std::to_string(id)+("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] in skip, don't start postOperation"); + } + emit pushStat(transfer_stat,transferId); +} + +void TransferThread::writeIsFinish() +{ + if(writeIsFinishVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] double event dropped"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] the checksum of source is missing"); + return; + } + if(destinationChecksum.size()==0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] the checksum of destination is missing"); + return; + } + if(sourceChecksum==destinationChecksum) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] the checksum match"); + readThread.postOperation(); + writeThread.postOperation(); + transfer_stat=TransferStat_PostTransfer; + emit pushStat(transfer_stat,transferId); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] the checksum not match")); + //emit error here, and wait to resume + emit errorOnFile(destination,tr("The checksums do not match").toStdString()); + } +} + +void TransferThread::readIsClosed() +{ + if(readIsClosedVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] double event dropped")); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + readIsClosedVariable=true; + readIsOpeningVariable=false; + checkIfAllIsClosedAndDoOperations(); +} + +void TransferThread::writeIsClosed() +{ + if(writeIsClosedVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] double event dropped"); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+("] 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,"["+std::to_string(id)+"] resolve error before progress"); + return false; + } + if(!remainFileOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] "+QStringLiteral("wait self close: readIsReadyVariable: %1, readIsClosedVariable: %2, writeIsReadyVariable: %3, writeIsClosedVariable: %4") + .arg(readIsReadyVariable) + .arg(readIsClosedVariable) + .arg(writeIsReadyVariable) + .arg(writeIsClosedVariable) + .toStdString() + ); + 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,"["+std::to_string(id)+"] need be in transfer, source: "+source.absoluteFilePath().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()+", stat:"+std::to_string(transfer_stat)); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + //all except closing + if((readError || writeError) && !needSkip && !stopIt)//normally useless by checkIfAllIsFinish() + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] resume after error"); + return; + } + + if(!needSkip && !stopIt) + { + if(!canBeCopiedDirectlyVariable && !canBeMovedDirectlyVariable) + { + if(writeIsOpenVariable && !writeIsClosedVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] can't pass in post operation if write is not closed")); + emit errorOnFile(destination,tr("Internal error: The destination is not closed").toStdString()); + needSkip=false; + if(deletePartiallyTransferredFiles) + needRemove=true; + writeError=true; + return; + } + if(readThread.getLastGoodPosition()!=writeThread.getLastGoodPosition()) + { + writeThread.flushBuffer(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+QString("] readThread.getLastGoodPosition(%1)!=writeThread.getLastGoodPosition(%2)") + .arg(readThread.getLastGoodPosition()) + .arg(writeThread.getLastGoodPosition()) + .toStdString() + ); + emit errorOnFile(destination,tr("Internal error: The size transfered doesn't match").toStdString()); + needSkip=false; + if(deletePartiallyTransferredFiles) + needRemove=true; + writeError=true; + return; + } + if(!writeThread.bufferIsEmpty()) + { + writeThread.flushBuffer(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] buffer is not empty")); + emit errorOnFile(destination,tr("Internal error: The buffer is not empty").toStdString()); + 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().toStdString()); + return; + } + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+("] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] Unable to change the date: File not found"); + emit errorOnFile(destination,tr("Unable to change the date").toStdString()+": "+tr("File not found").toStdString()); + return false; + } + } + else + { + if(doTheDateTransfer) + { + if(!writeFileDateTime(destination)) + { + if(!destination.isFile()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] Unable to change the date (is not a file)"); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] 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").toStdString()); + return false; + } + #endif + } + else + { + #ifndef Q_OS_WIN32 + destination.refresh(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] read the destination time: "+destination.lastModified().toString().toStdString()); + 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,"["+std::to_string(id)+("] is not in right stat, source: ")+source.absoluteFilePath().toStdString()+", destination: "+destination.absoluteFilePath().toStdString()+", stat: "+std::to_string(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,"["+std::to_string(id)+"] retry the system move"); + tryMoveDirectly(); + return; + } + if(canBeCopiedDirectlyVariable) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] retry the copy directly"); + tryCopyDirectly(); + return; + } + if(transfer_stat==TransferStat_Checksum) + { + if(writeError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start and resume the write error"); + writeThread.reopen(); + } + else if(readError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start and resume the read error"); + readThread.reopen(); + } + else //only checksum difference + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] start and resume the write error: "+std::to_string(readError)); + if(readError) + readThread.reopen(); + else + { + readIsClosedVariable=false; + readThread.seekToZeroAndWait(); + } + writeThread.reopen(); + } + if(readError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start and resume the read error"); + readThread.reopen(); + } + if(!writeError && !readError) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] unknow error resume"); +} + +void TransferThread::writeThreadIsReopened() +{ + if(writeError_destination_reopened) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(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(Ultracopier::DebugLevel_Warning,"["+std::to_string(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(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + readError=false; + writeIsReady(); + readIsReady(); +} + +////////////////////////////////////////////////////////////////// +///////////////////////// Normal event /////////////////////////// +////////////////////////////////////////////////////////////////// + +void TransferThread::readIsStopped() +{ + if(!sended_state_readStopped) + { + sended_state_readStopped=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] emit readIsStopped()"); + emit readStopped(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] drop dual read stopped"); + return; + } + readIsFinish(); +} + +void TransferThread::writeIsStopped() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + if(!sended_state_writeStopped) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] emit writeStopped()"); + sended_state_writeStopped=true; + emit writeStopped(); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] wrong parallelBuffer: "+std::to_string(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,"["+std::to_string(id)+"] wrong sequentialBuffer: "+std::to_string(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,"["+std::to_string(id)+"] transferAlgorithm==TransferAlgorithm_Sequential"); + else if(transferAlgorithm==TransferAlgorithm_Automatic) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] transferAlgorithm==TransferAlgorithm_Automatic"); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] transferAlgorithm==TransferAlgorithm_Parallel"); +} + +//fonction to edit the file date time +bool TransferThread::readFileDateTime(const QFileInfo &source) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] readFileDateTime("+source.absoluteFilePath().toStdString()+")"); + 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,"["+std::to_string(id)+"] writeFileDateTime("+destination.absoluteFilePath().toStdString()+")"); + /** 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(std::regex_match(destination.absoluteFilePath().toStdString(),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,"["+std::to_string(id)+"] open failed to write: "+QString::fromWCharArray(filePath).toStdString()+", error: "+std::to_string(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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] start with stat: "+std::to_string(transfer_stat)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] readIsOpeningVariable: "+std::to_string(readIsOpeningVariable)+", readIsOpenVariable: "+std::to_string(readIsOpenVariable)+", readIsReadyVariable: "+std::to_string(readIsReadyVariable)+", readIsFinishVariable: "+std::to_string(readIsFinishVariable)+", readIsClosedVariable: "+std::to_string(readIsClosedVariable)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] writeIsOpeningVariable: "+std::to_string(writeIsOpeningVariable)+", writeIsOpenVariable: "+std::to_string(writeIsOpenVariable)+", writeIsReadyVariable: "+std::to_string(writeIsReadyVariable)+", writeIsFinishVariable: "+std::to_string(writeIsFinishVariable)+", writeIsClosedVariable: "+std::to_string(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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] Do the direct FS fake close, canBeMovedDirectlyVariable: "+std::to_string(canBeMovedDirectlyVariable)+", canBeCopiedDirectlyVariable: "+std::to_string(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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] can skip in this state: "+std::to_string(transfer_stat)); + return; + } +} + +//return info about the copied size +int64_t 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); +} + +char 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 '?'; + } +} + +char 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, ... +uint64_t 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 +std::pair TransferThread::progression() const +{ + std::pair 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..e1a3b3f --- /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 + char readingLetter() const; + /// \brief get the writing letter + char writingLetter() const; + #endif + /// \brief to have semaphore, and try create just one by one + void setMkpathTransfer(QSemaphore *mkpathTransfer); + /// \brief to store the transfer id + uint64_t transferId; + /// \brief to store the transfer size + uint64_t 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, ... + uint64_t realByteTransfered() const; + std::pair progression() const; + static std::string resolvedName(const QFileInfo &inode); + std::string getSourcePath() const; + std::string 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 std::string &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,std::string fonction,std::string text,std::string 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 uint64_t &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 int64_t &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 std::string &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 + int64_t 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 std::string &firstRenamingRule,const std::string &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; + int64_t 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; + std::string firstRenamingRule; + std::string 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; + std::regex renameRegex; + TransferAlgorithm transferAlgorithm; + #ifdef Q_OS_UNIX + utimbuf butime; + #else + #ifdef Q_OS_WIN32 + #ifdef ULTRACOPIER_PLUGIN_SET_TIME_UNIX_WAY + utimbuf butime; + #else + uint32_t ftCreateL, ftAccessL, ftWriteL; + uint32_t ftCreateH, ftAccessH, ftWriteH; + std::regex 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..9993961 --- /dev/null +++ b/plugins/CopyEngine/Ultracopier/WriteThread.cpp @@ -0,0 +1,968 @@ +#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,"["+std::to_string(id)+"] internalOpen destination: "+file.fileName().toStdString()); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] close because stopIt is at true"); + emit closed(); + return false; + } + if(file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] already open! destination: "+file.fileName().toStdString()); + return false; + } + if(file.fileName().isEmpty()) + { + errorString_internal=tr("Path resolution error (Empty path)").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to open: %1, error: %2").arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + emit error(); + return false; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] Try create the path: "+ + destinationInfo.absolutePath().toStdString()); + 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,"["+std::to_string(id)+"] "+QStringLiteral("Unable create the folder: %1, error: %2") + .arg(destinationInfo.absolutePath()) + .arg(QString::fromStdString(errorString_internal)) + .toStdString()); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + mkpathTransfer->release(); + return false; + } + } + } + mkpathTransfer->release(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] after the mkpath"); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] in waiting because same file is found"); + return false; + } + } + } + bool fileWasExists=file.exists(); + if(file.open(flags)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] after the open"); + { + QMutexLocker lock_mutex(&accessList); + if(!theBlockList.isEmpty()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] General file corruption detected"); + stopIt=true; + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + return false; + } + } + pauseMutex.tryAcquire(pauseMutex.available()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] after the pause mutex"); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to resize to %1 after open: %2, error: %3").arg(startSize).arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] close because stopIt is at true"); + file.close(); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + emit closed(); + return false; + } + isOpen.acquire(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] file created but can't be removed"); + if(stopIt) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] close because stopIt is at true"); + resumeNotStarted(); + file.setFileName(QStringLiteral("")); + emit closed(); + return false; + } + errorString_internal=file.errorString().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to open: %1, error: %2").arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + emit error(); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + stat=Idle; + #endif + return false; + } +} + +void WriteThread::open(const QFileInfo &file,const uint64_t &startSize,const bool &buffer,const int &numberOfBlock,const bool &sequential) +{ + if(!isRunning()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] the thread not running to open destination: "+file.absoluteFilePath().toStdString()+", numberOfBlock: "+std::to_string(numberOfBlock)); + errorString_internal=tr("Internal error, please report it!").toStdString(); + emit error(); + return; + } + if(this->file.isOpen()) + { + if(file.absoluteFilePath()==this->file.fileName()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] Try reopen already opened same file: "+file.absoluteFilePath().toStdString()); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] previous file is already open: "+file.absoluteFilePath().toStdString()); + 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,"["+std::to_string(id)+"] numberOfBlock wrong, set to default"); + this->numberOfBlock=ULTRACOPIER_PLUGIN_DEFAULT_PARALLEL_NUMBER_OF_BLOCK; + } + else + this->numberOfBlock=numberOfBlock; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] "+QStringLiteral("open destination: %1, sequential: %2").arg(file.absoluteFilePath()).arg(sequential).toStdString()); + 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,"["+std::to_string(id)+"] double event dropped"); + return; + } + endDetected=true; + pauseMutex.release(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + emit internalStartEndOfFile(); +} + +std::string WriteThread::errorString() const +{ + return errorString_internal; +} + +void WriteThread::stop() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] start"); + writeFull.release(); + writeFull.acquire(); + pauseMutex.release(); + { + QMutexLocker lock_mutex(&accessList); + theBlockList.clear(); + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] start the write"); + emit internalStartWrite(); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] buffer is not empty!"); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] file: \""+file.fileName().toStdString()+"\" for similar inode is not located into the list of "+std::to_string(writeFileList.size())+" 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,"["+std::to_string(id)+"] try put read thread in pause"); + pauseMutex.tryAcquire(pauseMutex.available()); + putInPause=true; + return; +} + +void WriteThread::resume() +{ + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + putInPause=false; + stopIt=false; + } + else + return; + if(!file.isOpen()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] file is not open"); + return; + } + pauseMutex.release(); +} + +void WriteThread::reemitStartOpen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] start"); + emit internalStartOpen(); +} + +void WriteThread::postOperation() +{ + if(postOperationRequested) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"["+std::to_string(id)+"] double event dropped"); + return; + } + postOperationRequested=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] start"); + emit internalStartClose(); +} + +void WriteThread::internalCloseSlot() +{ + internalClose(); +} + +void WriteThread::internalClose(bool emitSignal) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] close for file: "+file.fileName().toStdString()); + /// \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().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + emit error(); + } + else + needRemoveTheFile=true; + } + } + file.close(); + if(needRemoveTheFile || stopIt) + { + if(deletePartiallyTransferredFiles) + { + if(!file.remove()) + if(emitSignal) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] 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,"["+std::to_string(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; + 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,"block size out of range: "+std::to_string(blockSize)); + return false; + } +} + +/// \brief get the last good position +int64_t WriteThread::getLastGoodPosition() const +{ + return lastGoodPosition; +} + +void WriteThread::flushAndSeekToZero() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"flushAndSeekToZero: "+std::to_string(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().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + emit error(); + return; + } + int sizeReaden=0; + do + { + if(putInPause) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"["+std::to_string(id)+"] 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: ").toStdString()+file.errorString().toStdString()+" ("+std::to_string(file.error())+")"; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("file.error()!=QFile::NoError: %1, error: %2").arg(QString::number(file.error())).arg(QString::fromStdString(errorString_internal)).toStdString()); + 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").toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Source truncated during the read: %1 (%2)").arg(file.errorString()).arg(QString::number(file.error())).toStdString()); + emit error(); + return; + } + if(stopIt) + { +/* if(putInPause) + emit isInPause();*/ + stopIt=false; + return; + } + emit checksumFinish(hash.result()); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"["+std::to_string(id)+"] stop the read"); +} + +void WriteThread::internalFlushAndSeekToZero() +{ + flushBuffer(); + if(!file.seek(0)) + { + errorString_internal=file.errorString().toStdString(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Unable to seek after open: %1, error: %2").arg(file.fileName()).arg(QString::fromStdString(errorString_internal)).toStdString()); + 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,"["+std::to_string(id)+"] 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,"["+std::to_string(id)+"] emit writeIsStarted()"); + emit writeIsStarted(); + } + if(stopIt) + return; + if(file.error()!=QFile::NoError) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error()).toStdString()); + errorString_internal=QStringLiteral("Error in writing: %1 (%2)").arg(file.errorString()).arg(file.error()).toStdString(); + stopIt=true; + emit error(); + return; + } + if(bytesWriten!=blockArray.size()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"["+std::to_string(id)+"] "+QStringLiteral("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size()).toStdString()); + errorString_internal=QStringLiteral("Error in writing, bytesWriten: %1, blockArray.size(): %2").arg(bytesWriten).arg(blockArray.size()).toStdString(); + 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..cadd022 --- /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 uint64_t &startSize,const bool &buffer,const int &numberOfBlock,const bool &sequential); + /// \brief to return the error string + std::string 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 + int64_t 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 std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +private: + std::string 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 + uint64_t lastGoodPosition; + QByteArray blockArray; ///< temp data for block writing, the data + int64_t bytesWriten; ///< temp data for block writing, the bytes writen + int id; + volatile bool endDetected; + uint64_t 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..5a0fbf6 --- /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 find the link on Ultracopier 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..7968ca8 --- /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.4.0.4 + + 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 new file mode 100644 index 0000000..538c4f9 Binary files /dev/null and b/plugins/Languages/ar/flag.png differ diff --git a/plugins/Languages/ar/informations.xml b/plugins/Languages/ar/informations.xml new file mode 100644 index 0000000..fcaf807 --- /dev/null +++ b/plugins/Languages/ar/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to arabic]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + ar + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/ar/translation.ts b/plugins/Languages/ar/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/ar/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/de/flag.png b/plugins/Languages/de/flag.png new file mode 100644 index 0000000..a096a1c Binary files /dev/null and b/plugins/Languages/de/flag.png differ diff --git a/plugins/Languages/de/informations.xml b/plugins/Languages/de/informations.xml new file mode 100644 index 0000000..7818c1c --- /dev/null +++ b/plugins/Languages/de/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to german]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + de + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/de/translation.ts b/plugins/Languages/de/translation.ts new file mode 100644 index 0000000..7e64330 --- /dev/null +++ b/plugins/Languages/de/translation.ts @@ -0,0 +1,1277 @@ + + + + + CliParser + + + + + + + Warning + Warnung + + + + Ultracopier is already running, right click on its system tray icon (near the clock) to use it + Ultracopier wird bereits ausgeführt. Klicken Sie mit der rechten Maustase auf das Icon im Infobereich der Taskleiste + + + + Problem reading file, or file size is 0 + Lesefehler, oder Dateigröße=0 + + + + + The arguments possible are: + Mögliche Werte sind: + + + + + To display the options + Optionen anzeigen + + + + + 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 + Ungültiger Befehl + + + + This file is not supported transfer list + The original english text does not make sense. + Diese Datei wird nicht unterstützt Transferliste + + + + Unable to open the transfer list file + Die Transferlistendatei kann nicht geöffnet werden + + + + + To display this help + Um diese Hilfe anzuzeigen + + + + + To quit the other instances (if running) + Um andere Instanzen zu beenden (falls laufend) + + + + + Open transfer list + Transferliste öffnen + + + + Help + Hilfe + + + + CopyEngineManager + + + + + + Warning + Warnung + + + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + + + Cannot find any compatible engine! + Finde keine kompatible Engine! + + + + Cannot find any engine with this name: %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 + Bekomme keine Instanz der Kopier-Engine + + + + 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 + Konnte Oberfläche nicht laden. Kopiervorgang abgebrochen + + + + Unable to load the copy engine, copy aborted + Konnte Kopier-Engine nicht laden. Kopiervorgang abgebrochen + + + + Transfer mode + Transfermodus + + + + 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 + Kopier-Engine + + + + Copy + a copy + Kopieren + + + + Move + a move + Verschieben + + + + Pause + Pause + + + + Resume + Fortsetzen + + + + + Skip + Ü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 + Ungefähr noch %10 Sekunden + + + + About %1 minutes remaining + Ungefähr noch %1 Minuten + + + + About %1 hours remaining + 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 + Beenden + + + + Target + Ziel + + + + + Time remaining: + Verbleibende Zeit: + + + + Listing + Auflistung + + + + Copying + Kopieren + + + + Listing and copying + not sure... depends on context + Auflistung und Kopiervorgang + + + + Ask + Fragen + + + + Overwrite + Überschreiben + + + + Overwrite if newer + Überschreiben, falls neuer + + + + Overwrite if the last modification dates are different + Überschreiben, falls die letzten Änderungsdaten unterschiedlich sind + + + + Rename + Umbenennen + + + + Put to the end of the list + Ans Ende der Liste verschieben + + + + Completed in %1 + Fertig in %1 + + + + Select source directory + 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 zum Öffnen + + + + All files + Alle Dateien + + + + Save transfer list + Transferliste speichern + + + + Open transfer list + Transferliste öffnen + + + + Transfer list + Transferliste + + + + Error + Fehler + + + + Not supported on this platform + Auf dieser Plattform nicht unterstützt + + + + HelpDialog + + + About Ultracopier + Über 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, ...) + 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 + Clumsy... depends on context + Absturz ausführen + + + + Save bug report + Fehlerbericht speichern + + + + Close + Schließen + + + + For 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/ + 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> + + + + LocalListener + + + Warning + Warnung + + + + Timeout while recomposing data from connected clients + Timeout beim Zusammenfügen der Daten von verbundenen Clients + + + + LogThread + + + + + Error + Fehler + + + + Log file already open, error: %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. + + + + 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. + + + + OptionDialog + + + + Options + Optionen + + + + General + Allgemein + + + + Plugins + Plugins + + + + + + Copy engine + Kopier-Engine + + + + + Themes + Themes + + + + Log + Log + + + + Confirm to group the windows + Gruppieren der Fenster bestätigen + + + + Check for updates + Nach Updates suchen + + + + Name + Name + + + + Version + Version + + + + Language + Sprache + + + + + + Listener + 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: + Kopier-Engine in Reihenfolge ihrer Präferenz: + + + + Client connected + Client verbunden + + + + Themes: + Themes: + + + + Unable to load the themes plugin + Konnte das Themes-Plugin nicht laden + + + + Browse + Durchsuchen + + + + The variables are %time%, %source%, %size%, %destination% + %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 + Die Variablen sind %time%, %path%, %size%, %mtime%, %error% + + + + Write the log file into: + Log in folgende Datei schreiben: + + + + 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) + + + + + Load + Laden + + + + Load the theme? + Theme laden? + + + + Load the language? + Sprache laden? + + + + Do nothing + Nichts tun + + + + Ask source as folder + Nach Quell-Ordner fragen + + + + Ask sources as files + Nach Quell-Datei fragen + + + + Never + Nie + + + + When source is same + Falls Quelle gleich ist + + + + When destination is same + Falls Ziel gleich ist + + + + When source and destination are same + Falls Quelle und Ziel gleich sind + + + + When source or destination are same + Falls Quelle oder Ziel gleich sind + + + + Always + Immer + + + + + + The variables are %1 + Die Variablen sind %1 + + + + 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 + Die Variablen sind %path% %operation% + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + Variablen nicht gefunden: %1 %2 + + + + PluginInformation + + + About this plugin + Über dieses Plugin + + + + Name: + Name: + + + + Category: + Kategorie: + + + + Author: + Autor: + + + + Date: + Datum: + + + + Description: + Beschreibung: + + + + Version: + Version: + + + + Copy engine + Kopier-Engine + + + + Languages + Sprachen + + + + Listener + Listener + + + + Plugin loader + Plugin-Loader + + + + Session loader + Session-Loader + + + + Themes + Themes + + + + Unknown + + + + + Information about %1 + Informationen über %1 + + + + Website: + Webseite: + + + + Title: + Titel: + + + + PluginsManager + + + informations.xml is not accessible + Auf "informations.xml" kann nicht zugegriffen werden + + + + Dependencies part is wrong + clumsy. + Abhängigkeiten-Teil ist falsch + + + + Dependencies %1 are not satisfied, for plugin: %2 + Die Abhängigkeiten "%1" sind nicht erfüllt für Plugin:%2 + + + + Remove %1 + Entferne %1 + + + + Error + Fehler + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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" Root-Tag für die XML-Datei nicht gefunden + + + + Duplicated plugin found, already loaded! + Plugin-Duplikat gefunden. Bereits geladen! + + + + 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 + XML-Tag nicht gefunden: %1 + + + + Are you sure about removing "%1" in version %2? + Sind Sie sicher, dass Sie "%1" in der Version %2 entfernen wollen? + + + + Previous import is in progress... + Vorheriger Import wird durchgeführt... + + + + Open Ultracopier plugin + Ultracopier Plugin öffnen + + + + Ultracopier plugin (*.urc) + Ultracopier plugin (*.urc) + + + + + + + + + + + + + Plugin loader + Plugin-Loader + + + + Unable to open the plugin: %1 + Kann das Plugin nicht öffnen: %1 + + + + + + Unable to load the plugin content, please check it: %1 + Kann Plugin-Inhalte nicht laden. Bitte überprüfen Sie das: %1 + + + + Unable to create a folder to install the plugin: +%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 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 existiert bereits. Überspringen Sie die Plugin-Installation: +%1 + + + + + + Unable to load the plugin content, please check it + Kann Plugin-Inhalte nicht laden. Bitte überprüfen Sie das + + + + QXzDecode + + + + Memory allocation failed + Speicherzuordnung fehlgeschlagen + + + + + Write error + Schreibfehler + + + + Memory usage limit reached + Grenze des Speicherverbrauchs erreicht + + + + Not a .xz file + Keine .xz-Datei + + + + Unsupported options in the .xz headers + 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 + + + + SystrayIcon + + + No copy listener found. Do the copy manually by right click one the system tray icon. + Keine Kopie-Listener gefunden. Führen Sie die Kopie manuell durch Rechtsklick auf das Symbol im Systray aus. + + + + Information + Information + + + + Searching information... + Suche Informationen ... + + + + Do not replace the explorer copy/move + Explorer:-Kopieren/Verschieben nicht ersetzen + + + + Semi replace the explorer copy/move + Explorer: Kopieren/Verschieben teilweise ersetzen + + + + Replace the explorer copy/move + Explorer:-Kopieren/Verschieben ersetzen + + + diff --git a/plugins/Languages/el/flag.png b/plugins/Languages/el/flag.png new file mode 100644 index 0000000..cd96374 Binary files /dev/null and b/plugins/Languages/el/flag.png differ diff --git a/plugins/Languages/el/informations.xml b/plugins/Languages/el/informations.xml new file mode 100644 index 0000000..dc30cef --- /dev/null +++ b/plugins/Languages/el/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to greek]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + el + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/el/translation.ts b/plugins/Languages/el/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/el/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/es/flag.png b/plugins/Languages/es/flag.png new file mode 100644 index 0000000..4cb4c0a Binary files /dev/null and b/plugins/Languages/es/flag.png differ diff --git a/plugins/Languages/es/informations.xml b/plugins/Languages/es/informations.xml new file mode 100644 index 0000000..2113692 --- /dev/null +++ b/plugins/Languages/es/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to spanish]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + es + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/es/translation.ts b/plugins/Languages/es/translation.ts new file mode 100644 index 0000000..c901398 --- /dev/null +++ b/plugins/Languages/es/translation.ts @@ -0,0 +1,1266 @@ + + + + + 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 + + + + 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 + + + + + To display this help + Para mostrar esta ayuda + + + + + To quit the other instances (if running) + Para salir de los otros casos (si está activo) + + + + + Open transfer list + Abrir lista de transferencias + + + + Help + Ayuda + + + + CopyEngineManager + + + + + + Warning + Advertencia + + + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + + + Cannot find any compatible engine! + No se puede encontrar un motor compatible! + + + + 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. + + + + + 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 + + + + 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 + + + + 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 + + + + HelpDialog + + + About Ultracopier + Acerca 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, ...) + 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 + + + + 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/ + 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> + + + + LocalListener + + + Warning + Advertencia + + + + Timeout while recomposing data from connected clients + Tiempo de espera, mientras que la recomposición de datos de los clientes conectados + + + + 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 + + + + 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 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. + + + + OptionDialog + + + + Options + Opciones + + + + General + General + + + + Plugins + Plugins + + + + + + Copy engine + Motor de copia + + + + + Themes + Themas + + + + Log + Log + + + + Confirm to group the windows + Confirmar al grupo de las ventanas + + + + Check for updates + Buscar actualizaciones + + + + Name + Nombre + + + + Version + Version + + + + Language + Lenguaje + + + + + + Listener + Oyente + + + + + + Plugin loader + Plugin cargador + + + + + + Session loader + Sesión cargador + + + + 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 + + + + The variables are %time%, %source%, %size%, %destination% + %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 + Las variables son %time%, %path%, %size%, %mtime%, %error% + + + + Write the log file into: + Escribir el archivo de registro en: + + + + 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) + + + + + Load + Cargar + + + + Load the theme? + Cargue el tema? + + + + Load the language? + Cargue el idioma? + + + + 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 + + + + + + The variables are %1 + Las variables son %1 + + + + Save logs as: + Guardar registros como: + + + + Synchronized log + Registro de sincronizada + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + Las variables son %path%, %operation% + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + La variable no se ha encontrado: %1 %2 + + + + PluginInformation + + + About this plugin + Acerca de este plugin + + + + Name: + Nombre: + + + + Category: + Categoría: + + + + Author: + Autor: + + + + Date: + Fecha: + + + + Description: + Descripción: + + + + Version: + Versión: + + + + Copy engine + Motor de copia + + + + Languages + Idiomas + + + + Listener + Oyente + + + + Plugin loader + Plugin cargador + + + + Session loader + Sesión cargador + + + + Themes + Themas + + + + Unknown + + + + + Information about %1 + Información sobre %1 + + + + Website: + Sitio Web: + + + + Title: + Título: + + + + PluginsManager + + + informations.xml is not accessible + informations.xml no es accesible + + + + 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 + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 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? + + + + 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 + No se puede crear un archivo para instalar el plugin: +%1 +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 + + +SpanishFrenchEnglish + +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 + + + + SystrayIcon + + + Information + Información + + + + Searching information... + Buscar información... + + + + 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 replace the explorer copy/move + Semi reemplazar la copia explorer/mudanza + + + + Replace the explorer copy/move + Vuelva a colocar la copia explorer/mudanza + + + diff --git a/plugins/Languages/fr/flag.png b/plugins/Languages/fr/flag.png new file mode 100644 index 0000000..95c8921 Binary files /dev/null and b/plugins/Languages/fr/flag.png differ diff --git a/plugins/Languages/fr/informations.xml b/plugins/Languages/fr/informations.xml new file mode 100644 index 0000000..437ea90 --- /dev/null +++ b/plugins/Languages/fr/informations.xml @@ -0,0 +1,35 @@ + + + <![CDATA[Translation of Ultracopier to French]]> + <![CDATA[Traduction d'ultracopier en Français]]> + + Languages + + + + + + + 1287496800 + + + + + 1.4.0.4 + + fr + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/fr/translation.ts b/plugins/Languages/fr/translation.ts new file mode 100644 index 0000000..77868c0 --- /dev/null +++ b/plugins/Languages/fr/translation.ts @@ -0,0 +1,1265 @@ + + + + + CliParser + + + + + + + Warning + Avertissement + + + + Ultracopier is already running, right click on its system tray icon (near the clock) to use it + 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 + + + + 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 + + + + + To display this help + Pour afficher cette aide + + + + + To quit the other instances (if running) + Pour quiter l'autre instance en cour + + + + + Open transfer list + Ouvrir la liste de transfert + + + + Help + Aide + + + + CopyEngineManager + + + + + + Warning + 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 compatible engine! + Impossible de trouver un moteur de copie compatible! + + + + Cannot find any engine with this name: %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é. + + + + + 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 + + + + 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 + Écraser si les dates de modification sont différentes + + + + Rename + Renommer + + + + Put to the end of the list + Mettre à la fin + + + + Completed in %1 + Fini en %1 + + + + Select source directory + Sélectionner un dossier source + + + + Select destination directory + Sélectionner un dossier de destination + + + + Internal error + Erreur interne + + + + Select one or more files to open + Sélectionner un ou des fichiers à ouvrir + + + + All files + 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 + + + + HelpDialog + + + About Ultracopier + À propos d'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, ...) + 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 + À propos de Qt + + + + Do a crash + Faire un crash + + + + Save bug report + Sauver le rapport + + + + Close + Fermer + + + + 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/ + 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'informations voir le site <a href="%1"><span style=" text-decoration: underline; color:#0057ae;">%1</span></a></p></body></html> + + + + LocalListener + + + Warning + Avertissement + + + + Timeout while recomposing data from connected clients + Timeout pendant la recompossition des données des clients connectés + + + + 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 + + + + 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 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. + + + + OptionDialog + + + + Options + Options + + + + General + Général + + + + Plugins + Plugins + + + + + + Copy engine + Moteurs de copie + + + + + Themes + Thèmes + + + + Log + Logs + + + + Confirm to group the windows + Confirmer pour grouper les fenêtres + + + + Check for updates + Vérifier les mise à jour + + + + Name + Nom + + + + Version + Version + + + + Language + Langue + + + + + + Listener + Écouteur + + + + + + Plugin loader + Chargeur de plugin + + + + + + Session loader + Chargeur de session + + + + 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 + + + + The variables are %time%, %source%, %size%, %destination% + %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 + Les variables sont %time%, %path%, %size%, %mtime%, %error% + + + + Write the log file into: + Écrire le fichier journal dans: + + + + 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) + + + + + Load + Charger + + + + Load the theme? + Charger le thème? + + + + Load the language? + Charger la langue? + + + + 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 + + + + + + The variables are %1 + Les variables sont %1 + + + + Save logs as: + Sauvegarder les logs sous: + + + + Synchronized log + Log synchronisé + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + Les variables sont %path%, %operation% + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + La variable n'a pas été trouvée: %1 %2 + + + + PluginInformation + + + About this plugin + À propos de ce plugin + + + + Name: + Nom: + + + + Category: + Catégorie: + + + + Author: + Auteur: + + + + Date: + Date: + + + + Description: + Description: + + + + Version: + Version: + + + + Copy engine + Moteur de copie + + + + Languages + Langues + + + + Listener + Écouteur + + + + Plugin loader + Chargeur de plugin + + + + Session loader + Chargeur de session + + + + Themes + Thèmes + + + + Unknown + Inconnu + + + + Information about %1 + Informations à propos de %1 + + + + Website: + Site web: + + + + Title: + Titre: + + + + PluginsManager + + + 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 + Des dépendances %1 ne sont pas satisfaites, pour le plugin: %2 + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + + + + + + + + + + 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 + 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é! + + + + Tag not found: %1 + Balise non trouvée: %1 + + + + Are you sure about removing "%1" in version %2? + Êtes vous sûr de vouloir supprimer "%1" en version %2? + + + + Previous import is in progress... + 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 + Impossible de créer un fichier pour installer le plugin: +%1 +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 + + + + 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 + + + + SystrayIcon + + + No copy listener found. Do the copy manually by right click one the system tray icon. + 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 information... + Recherche d'informations... + + + + Do 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 + + + + Information + Informations + + + diff --git a/plugins/Languages/hi/flag.png b/plugins/Languages/hi/flag.png new file mode 100644 index 0000000..3ac74be Binary files /dev/null and b/plugins/Languages/hi/flag.png differ diff --git a/plugins/Languages/hi/informations.xml b/plugins/Languages/hi/informations.xml new file mode 100644 index 0000000..4c0bc95 --- /dev/null +++ b/plugins/Languages/hi/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to hindi]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + hi + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/hi/translation.ts b/plugins/Languages/hi/translation.ts new file mode 100644 index 0000000..8b70d26 --- /dev/null +++ b/plugins/Languages/hi/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + 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..77ddd43 --- /dev/null +++ b/plugins/Languages/hu/informations.xml @@ -0,0 +1,29 @@ + + + <![CDATA[Hungarian translation of Ultracopier]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + 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..fb5e79a --- /dev/null +++ b/plugins/Languages/hu/translation.ts @@ -0,0 +1,1263 @@ + + + + + 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 compatible engine! + Nem található semmilyen kompatibilis motor! + + + + 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 + + + + 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. + + + + 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% + + + + + Load + Betöltés + + + + Load the theme? + Téma betöltése? + + + + Load the language? + Nyelv betöltése? + + + + 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 + + + + + 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 + + + diff --git a/plugins/Languages/id/flag.png b/plugins/Languages/id/flag.png new file mode 100644 index 0000000..e3c0f12 Binary files /dev/null and b/plugins/Languages/id/flag.png differ diff --git a/plugins/Languages/id/informations.xml b/plugins/Languages/id/informations.xml new file mode 100644 index 0000000..817490b --- /dev/null +++ b/plugins/Languages/id/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to indonesian]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + id + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/id/translation.ts b/plugins/Languages/id/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/id/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/it/flag.png b/plugins/Languages/it/flag.png new file mode 100644 index 0000000..cc9f71f Binary files /dev/null and b/plugins/Languages/it/flag.png differ diff --git a/plugins/Languages/it/informations.xml b/plugins/Languages/it/informations.xml new file mode 100644 index 0000000..bd6609d --- /dev/null +++ b/plugins/Languages/it/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to italian]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + it + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/it/translation.ts b/plugins/Languages/it/translation.ts new file mode 100644 index 0000000..28f5b6b --- /dev/null +++ b/plugins/Languages/it/translation.ts @@ -0,0 +1,1270 @@ + + + + + CliParser + + + + + + + Warning + Avviso + + + + Ultracopier is already running, right click on its system tray icon (near the clock) to use it + 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 + + + + This file is not supported transfer list + Questo file non è supportato dalla lista dei trasferimenti + + + + Unable to open the transfer list file + Impossibile aprire il file della lista dei trasferimenti + + + + + To display this help + Mostra questo aiuto + + + + + To quit the other instances (if running) + Chiudere le altre istanze (se in esecuzione) + + + + + Open transfer list + Apri la lista dei trasferimenti + + + + Help + Aiuto + + + + CopyEngineManager + + + + + + Warning + Avviso + + + + Cannot find any copy engine with move support + + + + + This copy engine does not support move + + + + + Cannot find any compatible engine! + Impossibile trovare un motore per la copia compatibile! + + + + Cannot find any engine with this name: %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 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. + + + + + Unable to load the interface, copy aborted + Impossibile avviare l'interfaccia, copia interrotta + + + + Unable to load the copy engine, copy aborted + Impossibile avviare il motore per la copia, copia interrotta + + + + Transfer mode + Modalità di trasferimento + + + + 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 + Motore per la copia + + + + Copy + a copy + Copia + + + + Move + a move + Sposta + + + + Pause + Pausa + + + + Resume + Riprendi + + + + + Skip + 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 + + + + About %10 seconds remaining + Circa %10 secondi rimanenti + + + + About %1 minutes remaining + Circa %1 minuti rimanenti + + + + About %1 hours remaining + Circa %1 ore rimanenti + + + + Transfer + a transfer + Trasferisci + + + + Start + Uno spostamento + Avvia + + + + Source + Cartella di origine + + + + Size + Dimensione + + + + Destination + Cartella di destinazione + + + + Quit + Esci + + + + Target + Obiettivo + + + + + Time remaining: + Tempo residuo: + + + + Listing + Elenco + + + + Copying + Copiatura + + + + Listing and copying + Elenca e copia + + + + Ask + Chiedi + + + + Overwrite + Sovrascrivi + + + + Overwrite if newer + Sovrascrivi se più recente + + + + Overwrite if the last modification dates are different + Sovrascrivi se sono diverse le date dell'ultima modifica + + + + Rename + Rinomina + + + + Put to the end of the list + Metti in coda alla lista + + + + Completed in %1 + Completato in %1 + + + + Select source directory + Selezionare la cartella di origine + + + + Select destination directory + 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 + Salvare la lista dei trasferimenti + + + + Open transfer list + Aprire lista dei trasferimenti + + + + Transfer list + Lista dei trasferimenti + + + + Error + Errore + + + + Not supported on this platform + Non supportato su questa piattaforma + + + + HelpDialog + + + About Ultracopier + Informazioni su 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, ...) + %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 + Informazioni su Qt + + + + Do a crash + Si è verificato un crash + + + + Save bug report + Salva il bug + + + + Close + Chiudi + + + + For 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/ + 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 + Avviso + + + + Timeout while recomposing data from connected clients + Tempo scaduto durante la ricomposizione dei dati dai client collegati + + + + LogThread + + + + + Error + Errore + + + + Log file already open, error: %1 + File log già aperto, errore: %1 + + + + + Unable to open the log file, error: %1 + Impossibile aprire il file di 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 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. + + + + OptionDialog + + + + Options + Opzioni + + + + General + Generale + + + + Plugins + I plug-in + + + + + + Copy engine + Motore per la copia + + + + + Themes + Temi + + + + Log + Log + + + + Check for updates + Controlla aggiornamenti automaticamente + + + + Name + Nome + + + + Version + Versione + + + + Language + Lingua + + + + + + Listener + Rilevatore + + + + + + Plugin loader + Caricatore di plug-in + + + + + + Session loader + 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 + + + + 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 + Plug-in + + + + Add + Aggiungi + + + + Remove + Elimina + + + + Information + Informazioni + + + + Copy engine by order of preference: + Motore per la copia in ordine di preferenza: + + + + Client connected + Client connessi + + + + Themes: + Temi: + + + + Unable to load the themes plugin + Impossibile caricare il plug-in dei temi + + + + No option for this plugin + Non ci sono opzioni per questo plug-in + + + + Browse + Sfoglia + + + + Write the transfers + Scrivere i trasferimenti + + + + Write the folder operations + Scrivere le operazioni di cartella + + + + The variables are %time%, %source%, %size%, %destination% + %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% non dovranno essere tradotti + Le variabili sono %time%, %path%, %size%, %mtime%, %error% + + + + Write the log file into: + Scrivere il file di log in: + + + + 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) + + + + + Load + Carica + + + + Load the theme? + Caricare i temi? + + + + Load the language? + Caricare questa lingua? + + + + Do nothing + Non fare nulla + + + + Ask source as folder + Chiedere la cartella di origine + + + + Ask sources as files + Chiedere i file di origine + + + + Never + Mai + + + + When source is same + Quando la cartella di origine è uguale + + + + When destination is same + Quando la cartella di destinazione è uguale + + + + When source and destination are same + Quando sia le cartelle di origine che di destinazione sono uguali + + + + When source or destination are same + Quando le cartelle di origine o di destinazione coincidono + + + + Always + Sempre + + + + + + The variables are %1 + Le variabili sono %1 + + + + Save logs as: + Salvare i log come: + + + + Synchronized log + Log sincronizzato + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + %path% e %operation%, non dovranno essere tradotti + Le variabili sono %path%, %operation% + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + Variabile non trovata: %1 %2 + + + + PluginInformation + + + About this plugin + Informazioni su questo plug-in + + + + Name: + Nome: + + + + Category: + Categoria: + + + + Author: + Autore: + + + + Date: + Data: + + + + Description: + Descrizione: + + + + Version: + Versione: + + + + Copy engine + Motore per la copia + + + + Languages + Lingue + + + + Listener + Rilevatore + + + + Plugin loader + Caricatore di plug-in + + + + Session loader + Caricatore di sessione + + + + Themes + Temi + + + + Unknown + Sconosciuto + + + + Information about %1 + Informazioni su %1 + + + + Website: + Sito web: + + + + Title: + Titolo: + + + + PluginsManager + + + informations.xml is not accessible + informations.xml non è accessibile + + + + Dependencies part is wrong + Alcune dipendenze non sono idonee + + + + Dependencies %1 are not satisfied, for plugin: %2 + Le dipendenze %1 per il plug-in: %2, non sono soddisfatte + + + + Remove %1 + Elimina %1 + + + + Error + Errore + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 + Tag root "package" non trovato nel file xml + + + + Duplicated plugin found, already loaded! + Trovato plug-in duplicato, già caricato! + + + + 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? + Si desidera eliminare "%1" nella versione %2? + + + + Previous import is in progress... + Importazione precedente in corso ... + + + + Open Ultracopier plugin + Apri plug-in di Ultracopier + + + + Ultracopier plugin (*.urc) + Plug-in di Ultracopier (*.urc) + + + + + + + + + + + + + Plugin loader + Caricatore di plug-in + + + + Unable to open the plugin: %1 + Impossibile aprire il plug-in: %1 + + + + + + Unable to load the plugin content, please check it: %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 plug-in: +%1 + + + + Unable to create a file to install the plugin: +%1 +since:%2 + Impossibile creare un file per installare il plug-in: +%1 +da: %2 + + + + Folder with same name is present, skip the plugin installation: +%1 + 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 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 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 + + + + SystrayIcon + + + No copy listener found. Do the copy manually by right click one the system tray icon. + Nessuna copia del rilevatore trovata. Fare una copia manualmente cliccando col tasto destro del mouse sull'icona nella barra di sistema. + + + + Information + Informazioni + + + + Searching information... + Ricerca informazioni... + + + + Do not replace the explorer copy/move + Non ripristinare la copia/spostamento di Windows explorer + + + + Semi replace the explorer copy/move + Ripristinare parzialmente la copia/spostamento di Windows explorer + + + + Replace the explorer copy/move + Ripristina la copia/spostamento di Windows explorer + + + diff --git a/plugins/Languages/ja/flag.png b/plugins/Languages/ja/flag.png new file mode 100644 index 0000000..5ac331e Binary files /dev/null and b/plugins/Languages/ja/flag.png differ diff --git a/plugins/Languages/ja/informations.xml b/plugins/Languages/ja/informations.xml new file mode 100644 index 0000000..647c3aa --- /dev/null +++ b/plugins/Languages/ja/informations.xml @@ -0,0 +1,33 @@ + + + <![CDATA[Translation of Ultracopier to japanese]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + jp + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/ja/translation.ts b/plugins/Languages/ja/translation.ts new file mode 100644 index 0000000..ffb9111 --- /dev/null +++ b/plugins/Languages/ja/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + 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 + + + + + Force the language + + + + + Replace the default copy and move system + + + + + Load at the session loading + + + + + When manual open + + + + + Group the windows when + + + + + Confirm to group the windows + + + + + Display the OS warning + + + + + Check for updates + + + + + Give GPU time to fund the development + + + + + Remaining time algorithm + + + + + Traditional + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + + 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: + + + + + Synchronized log + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/ko/flag.png b/plugins/Languages/ko/flag.png new file mode 100644 index 0000000..1dfaf96 Binary files /dev/null and b/plugins/Languages/ko/flag.png differ diff --git a/plugins/Languages/ko/informations.xml b/plugins/Languages/ko/informations.xml new file mode 100644 index 0000000..706afb3 --- /dev/null +++ b/plugins/Languages/ko/informations.xml @@ -0,0 +1,30 @@ + + + <![CDATA[Korean language]]> + + Languages + + + + + + 1287496800 + + + + + 1.4.0.4 + + ko + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/ko/translation.ts b/plugins/Languages/ko/translation.ts new file mode 100644 index 0000000..41d1700 --- /dev/null +++ b/plugins/Languages/ko/translation.ts @@ -0,0 +1,1260 @@ + + + + + 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 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 + + + 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 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, ...) + 플랫폼: %1 + + + + About Qt + Qt에 대해 + + + + Do a crash + 충돌 발생시 + + + + Save bug report + 버그 보고서 저장 + + + + Close + 닫기 + + + + 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/ + 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. + + + + + OptionDialog + + + + Options + 옵션 + + + + General + 일반 + + + + Plugins + 플러그인 + + + + + + Copy engine + 복사 엔진 + + + + + Themes + 테마 + + + + Log + 로그 + + + + Confirm to group the windows + + + + + 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 + + + + + + + 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% 입니다 + + + + 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% 입니다 + + + + Write the log file into: + 로그 파일 작성: + + + + + 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: + 로그 따로 저장: + + + + Synchronized log + 로그 동기화됨 + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + 플러그인 정보 + + + + Name: + 이름: + + + + Category: + 분류: + + + + Author: + 저작자: + + + + Date: + 날짜: + + + + Description: + 설명: + + + + Version: + 버전: + + + + Copy engine + 복사 엔진 + + + + Languages + 언어 + + + + Listener + 리스너 + + + + Plugin loader + 플러그인 로더 + + + + Session loader + 섹션 로더 + + + + Themes + 테마 + + + + Unknown + + + + + Information about %1 + %1 파일 정보 + + + + Website: + 웹사이트: + + + + Title: + 제목: + + + + PluginsManager + + + informations.xml is not accessible + informations.xml 파일에 연결할 수 없습니다 + + + + Dependencies part is wrong + 종속된 부분이 잘못되었습니다 + + + + Dependencies %1 are not satisfied, for plugin: %2 + 플러그인 %2에 대한 %1 종속성이 충족되지 않습니다 + + + + Remove %1 + %1 제거 + + + + Error + 오류 + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + 태그를 찾을 수 없음: %1 + + + + Are you sure about removing "%1" in version %2? + %2 버전에서 %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 + 플러그인을 설치할 파일을 만들 수 없음: +%1 +since:%2 + + + + Folder with same name is present, skip the plugin installation: +%1 + 동일한 이름의 폴더가 존재합니다. 플러그인 설치 건너뛰기: +%1 + + + + + + Unable to load the plugin content, please check it + 플러그인 컨태츠를 불러올 수 없습니다. 확인해주십시오 + + + + 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 + 입력 데이터가 너무 짧습니다 + + + + 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 + + + + diff --git a/plugins/Languages/nl/flag.png b/plugins/Languages/nl/flag.png new file mode 100644 index 0000000..0d00e1a Binary files /dev/null and b/plugins/Languages/nl/flag.png differ diff --git a/plugins/Languages/nl/informations.xml b/plugins/Languages/nl/informations.xml new file mode 100644 index 0000000..b50e36b --- /dev/null +++ b/plugins/Languages/nl/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to dutch]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + nl + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/nl/translation.ts b/plugins/Languages/nl/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/nl/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/no/flag.png b/plugins/Languages/no/flag.png new file mode 100644 index 0000000..16ec28a Binary files /dev/null and b/plugins/Languages/no/flag.png differ diff --git a/plugins/Languages/no/informations.xml b/plugins/Languages/no/informations.xml new file mode 100644 index 0000000..21d465b --- /dev/null +++ b/plugins/Languages/no/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to norwegian]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + no + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/no/translation.ts b/plugins/Languages/no/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/no/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/pl/flag.png b/plugins/Languages/pl/flag.png new file mode 100644 index 0000000..439ee97 Binary files /dev/null and b/plugins/Languages/pl/flag.png differ diff --git a/plugins/Languages/pl/informations.xml b/plugins/Languages/pl/informations.xml new file mode 100644 index 0000000..7617a00 --- /dev/null +++ b/plugins/Languages/pl/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to polish]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + pl + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/pl/translation.ts b/plugins/Languages/pl/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/pl/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/pt/flag.png b/plugins/Languages/pt/flag.png new file mode 100644 index 0000000..3fb1e36 Binary files /dev/null and b/plugins/Languages/pt/flag.png differ diff --git a/plugins/Languages/pt/informations.xml b/plugins/Languages/pt/informations.xml new file mode 100644 index 0000000..9c3d0e3 --- /dev/null +++ b/plugins/Languages/pt/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to portuguese]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + pt + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/pt/translation.ts b/plugins/Languages/pt/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/pt/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/ru/flag.png b/plugins/Languages/ru/flag.png new file mode 100644 index 0000000..583e627 Binary files /dev/null and b/plugins/Languages/ru/flag.png differ diff --git a/plugins/Languages/ru/informations.xml b/plugins/Languages/ru/informations.xml new file mode 100644 index 0000000..49ea3f6 --- /dev/null +++ b/plugins/Languages/ru/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to russian]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + ru + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/ru/translation.ts b/plugins/Languages/ru/translation.ts new file mode 100644 index 0000000..444e5ab --- /dev/null +++ b/plugins/Languages/ru/translation.ts @@ -0,0 +1,1260 @@ + + + + + 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 + Проблема с чтением файла, или размер файла равен 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 + Чтобы копировать исходники в место назначения, разделенными пробелом. 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 + + + + + + To quit the other instances (if running) + + + + + + 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 + Не могу найти любой двигатель с таким именем: %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 + + + 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 + + + + + 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 + Не поддерживается на этой платформе + + + + 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + Платформа: %1 + + + + About Qt + О Qt + + + + Do a crash + У аварии + + + + Save bug report + Сохранить отчет об ошибке + + + + Close + закрывать + + + + 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/ + + + + + 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> + + + + LocalListener + + + Warning + Предупреждение + + + + Timeout while recomposing data from connected clients + Тайм-аут в то время как композицию кадра данных из подключенных клиентов + + + + LogThread + + + + + Error + ошибка + + + + Log file already open, error: %1 + Лог-файл уже открыт, ошибки: %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. + + + + + OptionDialog + + + + Options + опции + + + + General + общий + + + + Plugins + плагины + + + + + + Copy engine + Копировать двигатель + + + + + Themes + Темы + + + + Log + + + + + Confirm to group the windows + + + + + 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 + Переменные 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% + + + + Write the log file into: + Запись в файл журнала: + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + Сохранить журналы, как: + + + + Synchronized log + Синхронное журнала + + + + No option for this plugin + Нет опции для этого плагина + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + Переменные %path%, %operation% + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + Об этом плагине + + + + Name: + Имя: + + + + Category: + Категория: + + + + Author: + Автор: + + + + Date: + Дата: + + + + Description: + Описание: + + + + Version: + Версия: + + + + Copy engine + Копировать двигатель + + + + Languages + Языки + + + + Listener + слушатель + + + + Plugin loader + плагин погрузчика + + + + Session loader + сессия погрузчика + + + + Themes + Темы + + + + Unknown + + + + + Information about %1 + Информация о %1 + + + + Website: + Сайт: + + + + Title: + Название: + + + + PluginsManager + + + informations.xml is not accessible + informations.xml не доступен + + + + Dependencies part is wrong + Зависимости часть неправильно + + + + Dependencies %1 are not satisfied, for plugin: %2 + Зависимости %1 не выполняется, для плагина: %2 + + + + Remove %1 + удаление: %1 + + + + Error + ошибка + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + Тег не найден: %1 + + + + Are you sure about removing "%1" in version %2? + Вы уверены, что об удалении "%1" в версии %2? + + + + 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 + Невозможно создать файл, чтобы установить плагин: +%1 +С: %2 + + + + Folder with same name is present, skip the plugin installation: +%1 + Папка с таким же именем существует, пропустить установки плагина: +%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 + Неподдерживаемые варианты. Заголовки XZ + + + + 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 + + + + diff --git a/plugins/Languages/th/flag.png b/plugins/Languages/th/flag.png new file mode 100644 index 0000000..76d9cc3 Binary files /dev/null and b/plugins/Languages/th/flag.png differ diff --git a/plugins/Languages/th/informations.xml b/plugins/Languages/th/informations.xml new file mode 100644 index 0000000..bc66718 --- /dev/null +++ b/plugins/Languages/th/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to thai]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + th + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/th/translation.ts b/plugins/Languages/th/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/th/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/tr/flag.png b/plugins/Languages/tr/flag.png new file mode 100644 index 0000000..e26b94b Binary files /dev/null and b/plugins/Languages/tr/flag.png differ diff --git a/plugins/Languages/tr/informations.xml b/plugins/Languages/tr/informations.xml new file mode 100644 index 0000000..bc26b50 --- /dev/null +++ b/plugins/Languages/tr/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to turkish]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + tr + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/tr/translation.ts b/plugins/Languages/tr/translation.ts new file mode 100644 index 0000000..d364f81 --- /dev/null +++ b/plugins/Languages/tr/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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, ...) + + + + + Platform: %1 + %1 will be replaced by the platform (windows, mac, linux, ...) + + + + + About Qt + + + + + Do a crash + + + + + Save bug report + + + + + Close + + + + + 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 + + + + + <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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + Copy engine + + + + + + Themes + + + + + Log + + + + + Confirm to group the windows + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + Write directly to the file when it receive a new entry (can produce 50% of lost of performance) + + + + + + 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: + + + + + Synchronized log + + + + + No option for this plugin + + + + + Write the folder operations + + + + + The variables are %path%, %operation% + %path%, %operation% should not be translated + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Languages/zh/flag.png b/plugins/Languages/zh/flag.png new file mode 100644 index 0000000..928b698 Binary files /dev/null and b/plugins/Languages/zh/flag.png differ diff --git a/plugins/Languages/zh/informations.xml b/plugins/Languages/zh/informations.xml new file mode 100644 index 0000000..ca01be8 --- /dev/null +++ b/plugins/Languages/zh/informations.xml @@ -0,0 +1,35 @@ + + + <![CDATA[Translation of Ultracopier to chinese]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + ch + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Languages/zh/translation.ts b/plugins/Languages/zh/translation.ts new file mode 100644 index 0000000..4172800 --- /dev/null +++ b/plugins/Languages/zh/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + 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 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 + + + + + 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. + + + + + OptionDialog + + + + Options + + + + + General + + + + + Plugins + + + + + + + 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 + + + + + Force the language + + + + + Replace the default copy and move system + + + + + Load at the session loading + + + + + When manual open + + + + + Group the windows when + + + + + Confirm to group the windows + + + + + Display the OS warning + + + + + Check for updates + + + + + Give GPU time to fund the development + + + + + Remaining time algorithm + + + + + Traditional + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + + 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: + + + + + Synchronized log + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + + + + + Name: + + + + + Category: + + + + + Author: + + + + + Date: + + + + + Description: + + + + + Version: + + + + + Copy engine + + + + + Languages + + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + + + + + Unknown + + + + + Information about %1 + + + + + Website: + + + + + Title: + + + + + PluginsManager + + + informations.xml is not accessible + + + + + 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 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 + + + + + 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 + + + + diff --git a/plugins/Languages/zh_TW/flag.png b/plugins/Languages/zh_TW/flag.png new file mode 100644 index 0000000..4f00c2d Binary files /dev/null and b/plugins/Languages/zh_TW/flag.png differ diff --git a/plugins/Languages/zh_TW/informations.xml b/plugins/Languages/zh_TW/informations.xml new file mode 100644 index 0000000..214150d --- /dev/null +++ b/plugins/Languages/zh_TW/informations.xml @@ -0,0 +1,32 @@ + + + <![CDATA[Translation of Ultracopier to chinese traditional]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + zh_tw + + + + + + + + + + + + + + diff --git a/plugins/Languages/zh_TW/translation.ts b/plugins/Languages/zh_TW/translation.ts new file mode 100644 index 0000000..cfe9ac3 --- /dev/null +++ b/plugins/Languages/zh_TW/translation.ts @@ -0,0 +1,1256 @@ + + + + + CliParser + + + + + + + Warning + 警告 + + + + Ultracopier is already running, right click on its system tray icon (near the clock) to use it + Ultracopier 正在執行中,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 + + + 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 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 + + + + 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 + 關閉 + + + + 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. + + + + + OptionDialog + + + + Options + 選項 + + + + General + 一般 + + + + Plugins + + + + + + + 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 + + + + + Force the language + + + + + Replace the default copy and move system + + + + + Load at the session loading + + + + + When manual open + + + + + Group the windows when + + + + + Confirm to group the windows + + + + + Display the OS warning + + + + + Check for updates + + + + + Give GPU time to fund the development + + + + + Remaining time algorithm + + + + + Traditional + + + + + 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 + + + + + Write the errors + + + + + The variables are %time%, %path%, %size%, %mtime%, %error% + %time%, %path%, %size%, %mtime%, %error% should not be translated + + + + + Write the log file into: + + + + + + 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: + + + + + Synchronized log + + + + + OptionEngine + + + + + + The variable was not found: %1 %2 + + + + + PluginInformation + + + About this plugin + 關於這的插件 + + + + Name: + 名稱: + + + + Category: + 分類: + + + + Author: + 作者: + + + + Date: + 日期: + + + + Description: + 描述: + + + + Version: + 版本: + + + + Copy engine + + + + + Languages + 語言 + + + + Listener + + + + + Plugin loader + + + + + Session loader + + + + + Themes + 佈景 + + + + Unknown + 未知 + + + + Information about %1 + + + + + Website: + 網站: + + + + Title: + 標題: + + + + PluginsManager + + + informations.xml is not accessible + + + + + Dependencies part is wrong + + + + + Dependencies %1 are not satisfied, for plugin: %2 + + + + + Remove %1 + + + + + Error + 錯誤 + + + + Error while the removing plugin, please check the rights on the folder: +%1 + + + + + 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 in the informations.xml for the tag: %1 + + + + + Tag not found: %1 + + + + + Are you sure about removing "%1" in version %2? + + + + + 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 + + + + diff --git a/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h b/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/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/Listener/catchcopy-v0002/Environment.h b/plugins/Listener/catchcopy-v0002/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/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/Listener/catchcopy-v0002/StructEnumDefinition.h b/plugins/Listener/catchcopy-v0002/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins/Listener/catchcopy-v0002/Variable.h b/plugins/Listener/catchcopy-v0002/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/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/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp new file mode 100644 index 0000000..c466630 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp @@ -0,0 +1,379 @@ +/** \file ClientCatchcopy.cpp +\brief Define the catchcopy client +\author alpha_one_x86 */ + +#include "ClientCatchcopy.h" +#include "VariablesCatchcopy.h" +#include "ExtraSocketCatchcopy.h" + +#include + +ClientCatchcopy::ClientCatchcopy() +{ + disconnectedFromSocket(); + error_string="Unknown error"; + detectTimeOut.setSingleShot(true); + detectTimeOut.setInterval(CATCHCOPY_COMMUNICATION_TIMEOUT); // the max time to without send packet + connect(&socket, SIGNAL(connected()), this, SIGNAL(connected())); + connect(&socket, SIGNAL(disconnected()), this, SIGNAL(disconnected())); + connect(&socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromSocket())); + connect(&socket, SIGNAL(stateChanged(QLocalSocket::LocalSocketState)), this, SIGNAL(stateChanged(QLocalSocket::LocalSocketState))); + connect(&socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SIGNAL(errorSocket(QLocalSocket::LocalSocketError))); + connect(&socket, SIGNAL(readyRead()), this, SLOT(readyRead())); + connect(&detectTimeOut, SIGNAL(timeout()), this, SLOT(checkTimeOut())); + connect(&socket, SIGNAL(connected()), this, SLOT(socketIsConnected())); +} + +void ClientCatchcopy::checkTimeOut() +{ + if(haveData) + { + error_string="The server is too long to send the next part of the reply"; + emit error(error_string); + disconnectFromServer(); + } +} + +const QString ClientCatchcopy::errorString() +{ + return error_string; +} + +void ClientCatchcopy::socketIsConnected() +{ + orderIdFirstSendProtocol=sendProtocol(); +} + +void ClientCatchcopy::connectToServer() +{ + socket.connectToServer(QString::fromStdString(ExtraSocketCatchcopy::pathSocket())); +} + +void ClientCatchcopy::disconnectFromServer() +{ + socket.abort(); + socket.disconnectFromServer(); +} + +const QString ClientCatchcopy::errorStringSocket() +{ + return socket.errorString(); +} + +/// \brief to send stream of string list +quint32 ClientCatchcopy::sendRawOrderList(const QStringList & order) +{ + if(!socket.isValid()) + { + error_string="Socket is not valid, try send: "+order.join(";"); + emit error(error_string); + return -1; + } + if(socket.state()!=QLocalSocket::ConnectedState) + { + error_string="Socket is not connected "+QString::number(socket.state()); + emit error(error_string); + return -1; + } + do + { + idNextOrder++; + if(idNextOrder>2000000000) + idNextOrder=0; + } while(notRepliedQuery.contains(idNextOrder)); + notRepliedQuery << idNextOrder; + 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(); + if(idNextOrder!=1) // drop if internal protocol send + { + emit dataSend(idNextOrder,block); + emit dataSend(idNextOrder,order); + } + 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()) + { + error_string="Socket is not valid"; + emit error(error_string); + return -1; + } + if(socket.errorString()!="Unknown error" && socket.errorString()!="") + { + error_string=socket.errorString(); + emit error(error_string); + return -1; + } + if(blockToSend.size()!=byteWriten) + { + error_string="All the bytes have not be written"; + emit error(error_string); + return -1; + } + } + while(block.size()); + return idNextOrder; +} + +void ClientCatchcopy::readyRead() +{ + while(socket.bytesAvailable()>0) + { + if(!haveData) + { + if(socket.bytesAvailable()<(int)sizeof(int))//int of size cuted + { + /* error_string="Bytes available is not sufficient to do a int"; + emit error(error_string); + disconnectFromServer();*/ + return; + } + QDataStream in(&socket); + in.setVersion(QDataStream::Qt_4_4); + in >> dataSize; + dataSize-=sizeof(int); + if(dataSize>64*1024*1024) // 64MB + { + error_string="Reply size is >64MB, seam corrupted"; + emit error(error_string); + disconnectFromServer(); + return; + } + if(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); + disconnectFromServer(); + return; + } + } + if(dataSize<(data.size()+socket.bytesAvailable())) + data.append(socket.read(dataSize-data.size())); + else + data.append(socket.readAll()); + if(dataSize==data.size()) + { + if(!checkDataIntegrity(data)) + { + data.clear(); + qWarning() << "Data of the reply is wrong"; + return; + } + QStringList returnList; + quint32 orderId; + quint32 returnCode; + QDataStream in(data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> returnCode; + in >> returnList; + data.clear(); + if(orderId!=orderIdFirstSendProtocol) + { + if(!notRepliedQuery.contains(orderId)) + qWarning() << "Unknown query not replied:" << orderId; + else + { + if(!parseReply(orderId,returnCode,returnList)) + emit unknowReply(orderId); + emit newReply(orderId,returnCode,returnList); + } + } + else + { + if(!sendProtocolReplied) + { + sendProtocolReplied=true; + if(returnCode!=1000) + { + error_string="Protocol not supported"; + emit error(error_string); + disconnectFromServer(); + return; + } + } + else + { + 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; + } + } + } + } + if(haveData) + detectTimeOut.start(); + else + detectTimeOut.stop(); +} + +bool ClientCatchcopy::checkDataIntegrity(QByteArray data) +{ + quint32 orderId; + qint32 replyCode; + qint32 listSize; + QDataStream in(data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> replyCode; + 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"); + qWarning() << "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())); + 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); + index++; + } + if(in.device()->size()!=in.device()->pos()) + { + emit error("Remaining data after string list parsing"); + qWarning() << "Remaining data after string list parsing"; + return false; + } + return true; +} + +QLocalSocket::LocalSocketState ClientCatchcopy::state() +{ + return socket.state(); +} + +void ClientCatchcopy::disconnectedFromSocket() +{ + haveData = false; + orderIdFirstSendProtocol= 0; + idNextOrder = 0; + sendProtocolReplied = false; + notRepliedQuery.clear(); +} + +/// \brief to send the protocol version used +quint32 ClientCatchcopy::sendProtocol() +{ + return sendRawOrderList(QStringList() << "protocol" << CATCHCOPY_PROTOCOL_VERSION); +} + +quint32 ClientCatchcopy::askServerName() +{ + return sendRawOrderList(QStringList() << "server" << "name?"); +} + +quint32 ClientCatchcopy::setClientName(const QString & name) +{ + return sendRawOrderList(QStringList() << "client" << name); +} + +quint32 ClientCatchcopy::checkProtocolExtension(const QString & name) +{ + return sendRawOrderList(QStringList() << "protocol extension" << name); +} + +quint32 ClientCatchcopy::checkProtocolExtension(const QString & name,const QString & version) +{ + return sendRawOrderList(QStringList() << "protocol extension" << name << version); +} + +quint32 ClientCatchcopy::addCopyWithDestination(const QStringList & sources,const QString & destination) +{ + return sendRawOrderList(QStringList() << "cp" << sources << destination); +} + +quint32 ClientCatchcopy::addCopyWithoutDestination(const QStringList & sources) +{ + return sendRawOrderList(QStringList() << "cp-?" << sources); +} + +quint32 ClientCatchcopy::addMoveWithDestination(const QStringList & sources,const QString & destination) +{ + return sendRawOrderList(QStringList() << "mv" << sources << destination); +} + +quint32 ClientCatchcopy::addMoveWithoutDestination(const QStringList & sources) +{ + return sendRawOrderList(QStringList() << "mv-?" << sources); +} + +bool ClientCatchcopy::parseReply(quint32 orderId,quint32 returnCode,QStringList returnList) +{ + switch(returnCode) + { + case 1000: + emit protocolSupported(orderId); + break; + case 1001: + case 1002: + if(returnCode==1001) + emit protocolExtensionSupported(orderId,true); + else + emit protocolExtensionSupported(orderId,false); + break; + case 1003: + emit clientRegistered(orderId); + break; + case 1004: + if(returnList.size()!=1) + emit unknowOrder(orderId); + else + emit serverName(orderId,returnList.last()); + break; + case 1005: + case 1006: + if(returnCode==1005) + emit copyFinished(orderId,false); + else + emit copyFinished(orderId,true); + break; + case 1007: + emit copyCanceled(orderId); + break; + case 5000: + emit incorrectArgumentListSize(orderId); + break; + case 5001: + emit incorrectArgument(orderId); + break; + case 5002: + emit unknowOrder(orderId); //the server have not understand the order + break; + case 5003: + emit protocolNotSupported(orderId); + break; + default: + return false; + } + return true; +} + diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h new file mode 100644 index 0000000..4c15890 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h @@ -0,0 +1,113 @@ +/** \file ClientCatchcopy.h +\brief Define the catchcopy client +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef CLIENTCATCHCOPY_H +#define CLIENTCATCHCOPY_H + +#include +#include +#include +#include +#include +#include + +/// \brief Define the catchcopy client +class ClientCatchcopy : public QObject +{ + Q_OBJECT + public: + ClientCatchcopy(); + /// \brief get the socket stat + QLocalSocket::LocalSocketState state(); + /// \brief error string about the socket + const QString errorStringSocket(); + /// \brief general error string + const QString errorString(); + public slots: + void connectToServer(); + void disconnectFromServer(); + //to test and internal use + /// \brief to send order + quint32 sendProtocol(); + /// \brief ask the server name + quint32 askServerName(); + /// \brief set the client name + quint32 setClientName(const QString & name); + /// \brief check protocol extension + quint32 checkProtocolExtension(const QString & name); + /// \brief check protocol extension and version + quint32 checkProtocolExtension(const QString & name,const QString & version); + /// \brief add copy with destination + quint32 addCopyWithDestination(const QStringList & sources,const QString & destination); + /// \brief add copy without destination + quint32 addCopyWithoutDestination(const QStringList & sources); + /// \brief add move with destination + quint32 addMoveWithDestination(const QStringList & sources,const QString & destination); + /// \brief add move without destination + quint32 addMoveWithoutDestination(const QStringList & sources); + /// \brief to send stream of string list + quint32 sendRawOrderList(const QStringList & order); + signals: + /// \brief is connected + void connected(); + /// \brief is disconnected + void disconnected(); + /// \brief the socket state have changed + void stateChanged(QLocalSocket::LocalSocketState socketState); + /// \brief send the error string + void error(QString error); + /// \brief send socket error + void errorSocket(QLocalSocket::LocalSocketError socketError); + /// \brief have new reply + void newReply(quint32 orderId,quint32 returnCode,QStringList returnList); + /// \brief have data send + void dataSend(quint32 orderId,QByteArray data); + /// \brief have data send by string list + void dataSend(quint32 orderId,QStringList data); + /// \brief have unknow reply + void unknowReply(quint32 orderId); + //reply + /// \brief protocol is supported + void protocolSupported(quint32 orderId); + /// \brief incorrect argument list size + void incorrectArgumentListSize(quint32 orderId); + /// \brief incorrect argument + void incorrectArgument(quint32 orderId); + /// \brief protocol not supported + void protocolNotSupported(quint32 orderId); + /// \brief protocol extension supported + void protocolExtensionSupported(quint32 orderId,bool isSupported); + /// \brief client is registred + void clientRegistered(quint32 orderId); + /// \brief have the server name + void serverName(quint32 orderId,QString name); + /// \brief copy finished + void copyFinished(quint32 orderId,bool withError); + /// \brief copy canceled + void copyCanceled(quint32 orderId); + /// \brief have unknow order + void unknowOrder(quint32 orderId); //the server have not understand the order + private: + QLocalSocket socket; + QString error_string; + quint32 idNextOrder; + QByteArray data; + bool haveData; + int dataSize; + quint32 orderIdFirstSendProtocol; + QTimer detectTimeOut; + bool sendProtocolReplied; + QList notRepliedQuery; + bool checkDataIntegrity(QByteArray data); + private slots: + void readyRead(); + void disconnectedFromSocket(); + void socketIsConnected(); + void checkTimeOut(); + protected: + bool parseReply(quint32 orderId,quint32 returnCode,QStringList returnList); +}; + +#endif // CLIENTCATCHCOPY_H diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp new file mode 100644 index 0000000..9cd8373 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp @@ -0,0 +1,38 @@ +/** \file ExtraSocketCatchcopy.cpp +\brief Define the socket of catchcopy +\author alpha_one_x86 */ + +#include "ExtraSocketCatchcopy.h" + +#include + +const std::string ExtraSocketCatchcopy::pathSocket() +{ +#ifdef Q_OS_UNIX + return "advanced-copier-"+std::to_string(getuid()); +#else + QString userName; + char uname[1024]; + DWORD len=1023; + if(GetUserNameA(uname, &len)!=FALSE) + userName=QString::fromLatin1(toHex(uname)); + return "advanced-copier-"+userName.toStdString(); +#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 +#include + +#ifdef Q_OS_UNIX + #include + #include +#else + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#endif + +/// \brief to have extra socket function +class ExtraSocketCatchcopy +{ +public: + /// \brief to get the socket path + static const std::string 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 new file mode 100644 index 0000000..6fd1172 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp @@ -0,0 +1,740 @@ +/** \file ServerCatchcopy.cpp +\brief Define the server of catchcopy +\author alpha_one_x86*/ + +#include "ServerCatchcopy.h" +#include "VariablesCatchcopy.h" +#include "ExtraSocketCatchcopy.h" + +#include +#include +#include +#include +#include + +std::string stringimplode2(const std::vector& elems, const std::string &delim) +{ + std::string newString; + for (std::vector::const_iterator ii = elems.begin(); ii != elems.cend(); ++ii) + { + newString += (*ii); + if ( ii + 1 != elems.end() ) { + newString += delim; + } + } + return newString; +} + +ServerCatchcopy::ServerCatchcopy() +{ + name="Default avanced copier"; + idNextClient=0; + error_string="Unknown error"; + connect(&server, &QLocalServer::newConnection, this, &ServerCatchcopy::newConnection); +} + +ServerCatchcopy::~ServerCatchcopy() +{ + close(); +} + +bool ServerCatchcopy::isListening() const +{ + return server.isListening(); +} + +void ServerCatchcopy::setName(const std::string & name) +{ + this->name=name; +} + +std::string ServerCatchcopy::getName() const +{ + return name; +} + +/// \brief to get a client list +std::vector ServerCatchcopy::clientsList() const +{ + std::vector clients; + int index=0; + int size=clientList.size(); + while(indexdisconnectFromServer(); + index++; + } + server.close(); + if(!server.removeServer(QString::fromStdString(pathSocket))) + { + error_string="Unable to remove the old server"; + emit error(error_string); + } + } +} + +const std::string ServerCatchcopy::errorStringServer() const +{ + return server.errorString().toStdString(); +} + +const std::string ServerCatchcopy::errorString() const +{ + 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); + 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 uint32_t &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::disconnected() +{ + 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 uint32_t &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 communicationError(error_string); + disconnectClient(clientList.at(index).id); + return; + } + if(clientList.at(index).dataSize<(int)(sizeof(int) //orderId + + sizeof(uint32_t) //returnCode + + sizeof(uint32_t) //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==(uint32_t)clientList.at(index).data.size()) + { + if(!checkDataIntegrity(clientList.at(index).data)) + { + emit communicationError("Data integrity wrong: "+QString(clientList.at(index).data.toHex()).toStdString()); + clientList[index].data.clear(); + clientList[index].haveData=false; + qWarning() << "Data integrity wrong"; + return; + } + std::vector returnList; + QStringList returnListQt; + uint32_t orderId; + QDataStream in(clientList.at(index).data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> returnListQt; + { + int index=0; + while(indexstart(); + else + clientList.at(index).detectTimeOut->stop(); + return; + } + index++; + } + emit error("Unallocated client!"); + qWarning() << "Unallocated client!"; +} + +bool ServerCatchcopy::checkDataIntegrity(const QByteArray &data) +{ + uint32_t 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()).toStdString()); + 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 uint32_t &client,const uint32_t &orderId,const std::vector &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: "+std::to_string(returnVal)+", with client: "+std::to_string(client)+", orderId: "+std::to_string(orderId)+", returnList: "+stringimplode2(returnList,", ")); + qWarning() << "Unknown query"; + unknowOrder(client,orderId); + break; + } +} + +ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(const uint32_t &client,const uint32_t &orderId,const std::vector &returnList) +{ + if(returnList.size()==0) + return WrongArgumentListSize; + //if is supported + std::string firstArgument=returnList.front(); + if(firstArgument=="protocol") + { + if(returnList.size()!=2) + return WrongArgumentListSize; + emit askProtocolCompatibility(client,orderId,returnList.back()); + 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(index sourceList=returnList; + sourceList.erase(sourceList.cbegin()); + sourceList.pop_back(); + emitNewCopy(client,orderId,sourceList,returnList.back()); + return Ok; + } + else if(firstArgument=="cp-?") + { + if(returnList.size()<2) + return WrongArgumentListSize; + std::vector sourceList=returnList; + sourceList.erase(sourceList.cbegin()); + emitNewCopyWithoutDestination(client,orderId,sourceList); + return Ok; + } + else if(firstArgument=="mv") + { + if(returnList.size()<3) + return WrongArgumentListSize; + std::vector sourceList=returnList; + sourceList.erase(sourceList.cbegin()); + sourceList.pop_back(); + emitNewMove(client,orderId,sourceList,returnList.back()); + return Ok; + } + else if(firstArgument=="mv-?") + { + if(returnList.size()<2) + return WrongArgumentListSize; + std::vector sourceList=returnList; + sourceList.erase(sourceList.cbegin()); + emitNewMoveWithoutDestination(client,orderId,sourceList); + return Ok; + } + else //if is not supported + return UnknowOrder; +} + +void ServerCatchcopy::emitNewCopyWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector &sources) +{ + LinkGlobalToLocalClient newAssociation; + newAssociation.idClient=client; + newAssociation.orderId=orderId; + newAssociation.globalOrderId=incrementOrderId(); + LinkGlobalToLocalClientList << newAssociation; + emit newCopyWithoutDestination(newAssociation.globalOrderId,sources); +} + +void ServerCatchcopy::emitNewCopy(const uint32_t &client,const uint32_t &orderId,const std::vector &sources,const std::string &destination) +{ + LinkGlobalToLocalClient newAssociation; + newAssociation.idClient=client; + newAssociation.orderId=orderId; + newAssociation.globalOrderId=incrementOrderId(); + LinkGlobalToLocalClientList << newAssociation; + emit newCopy(newAssociation.globalOrderId,sources,destination); +} + +void ServerCatchcopy::emitNewMoveWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector &sources) +{ + LinkGlobalToLocalClient newAssociation; + newAssociation.idClient=client; + newAssociation.orderId=orderId; + newAssociation.globalOrderId=incrementOrderId(); + LinkGlobalToLocalClientList << newAssociation; + emit newMoveWithoutDestination(newAssociation.globalOrderId,sources); +} + +void ServerCatchcopy::emitNewMove(const uint32_t &client,const uint32_t &orderId,const std::vector &sources,const std::string &destination) +{ + LinkGlobalToLocalClient newAssociation; + newAssociation.idClient=client; + newAssociation.orderId=orderId; + newAssociation.globalOrderId=incrementOrderId(); + LinkGlobalToLocalClientList << newAssociation; + emit newMove(newAssociation.globalOrderId,sources,destination); +} + +void ServerCatchcopy::copyFinished(const uint32_t &globalOrderId,const bool &withError) +{ + int index=0; + while(index returnList; + returnList.push_back(returnString); + reply(client,orderId,returnCode,returnList); +} + +void ServerCatchcopy::reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::vector &returnList) +{ + 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; + QStringList returnListQt; + { + unsigned int index=0; + while(indexseek(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().toStdString(); + 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(const uint32_t &client,const uint32_t &orderId,const bool &value) +{ + if(value) + reply(client,orderId,1000,"protocol supported"); + else + reply(client,orderId,5003,"protocol not supported"); +} + +void ServerCatchcopy::incorrectArgumentListSize(const uint32_t &client,const uint32_t &orderId) +{ + reply(client,orderId,5000,"incorrect argument list size"); +} + +void ServerCatchcopy::incorrectArgument(const uint32_t &client,const uint32_t &orderId) +{ + reply(client,orderId,5001,"incorrect argument"); +} + +void ServerCatchcopy::clientRegistered(const uint32_t &client,const uint32_t &orderId) +{ + reply(client,orderId,1003,"client registered"); +} + +void ServerCatchcopy::serverName(const uint32_t &client,const uint32_t &orderId,const std::string &name) +{ + reply(client,orderId,1004,name); +} + +void ServerCatchcopy::copyFinished(const uint32_t &client,const uint32_t &orderId,const bool &withError) +{ + if(!withError) + reply(client,orderId,1005,"finished"); + else + reply(client,orderId,1006,"finished with error(s)"); +} + +void ServerCatchcopy::copyCanceled(const uint32_t &client,const uint32_t &orderId) +{ + reply(client,orderId,1007,"canceled"); +} + +void ServerCatchcopy::unknowOrder(const uint32_t &client,const uint32_t &orderId) +{ + 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: "+QString(clientList.at(index).data.toHex()).toStdString(); + clientList[index].haveData=false; + clientList[index].data.clear(); + clientList.at(index).socket->disconnectFromServer(); + emit error(error_string); + } + return; + } + index++; + } +} + +uint32_t ServerCatchcopy::incrementOrderId() +{ + 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 new file mode 100644 index 0000000..85acff9 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h @@ -0,0 +1,144 @@ +/** \file ServerCatchcopy.h +\brief Define the server of catchcopy +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef SERVERCATCHCOPY_H +#define SERVERCATCHCOPY_H + +#include +#include +#include +#include +#include +#include +#include + +/// \brief Define the server of catchcopy +class ServerCatchcopy : public QObject +{ + 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 std::string errorStringServer() const; + /// \brief get the general error string + const std::string errorString() const; + /// \brief set the name of the server + void setName(const std::string & name); + /// \brief get the name + std::string getName() const; + /// \brief to get a client list + std::vector clientsList() const; + private: + std::string pathSocket; + std::string name; + std::string error_string; + QLocalServer server; + uint32_t idNextClient; + struct Client + { + uint32_t id; + QLocalSocket *socket; + QByteArray data; + bool haveData; + uint32_t dataSize; + bool firstProtocolReplied; + QList queryNoReplied; + QTimer *detectTimeOut; + std::string name; + }; + QList clientList; + struct LinkGlobalToLocalClient + { + uint32_t idClient; + uint32_t orderId; + uint32_t globalOrderId; + }; + QList LinkGlobalToLocalClientList; + enum inputReturnType{Ok,Replied,ExtensionWrong,WrongArgument,WrongArgumentListSize,UnknowOrder}; + inputReturnType parseInputCurrentProtocol(const uint32_t &client,const uint32_t &orderId,const std::vector &returnList); + bool clientIdFound(const uint32_t &id) const; + uint32_t nextOrderId; + QList orderList; + uint32_t incrementOrderId(); + void emitNewCopyWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector &sources); + void emitNewCopy(const uint32_t &client,const uint32_t &orderId,const std::vector &sources,const std::string &destination); + void emitNewMoveWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector &sources); + void emitNewMove(const uint32_t &client,const uint32_t &orderId,const std::vector &sources,const std::string &destination); + bool checkDataIntegrity(const QByteArray &data); + protected: + void parseInput(const uint32_t &client,const uint32_t &orderId,const std::vector &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 uint32_t &id); + /// \brief reply to a client with std::vector + void reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::vector &returnList); + /// \brief reply to a client + void reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::string &returnString); + //reply + /// \brief send if the protocol is supported + void protocolSupported(const uint32_t &client,const uint32_t &orderId,const bool &value); + /// \brief send incorrect arguement list size + void incorrectArgumentListSize(const uint32_t &client,const uint32_t &orderId); + /// \brief send incorrect arguement + void incorrectArgument(const uint32_t &client,const uint32_t &orderId); + /// \brief the client is registred + void clientRegistered(const uint32_t &client,const uint32_t &orderId); + /// \brief send the server name + void serverName(const uint32_t &client,const uint32_t &orderId,const std::string &name); + /// \brief send the copy is finished + void copyFinished(const uint32_t &client,const uint32_t &orderId,const bool &withError); + /// \brief send the copy is canceled + void copyCanceled(const uint32_t &client,const uint32_t &orderId); + /// \brief send the copy is finished by global is order + void copyFinished(const uint32_t &globalOrderId,const bool &withError); + /// \brief send copy cancel by global is order + void copyCanceled(const uint32_t &globalOrderId); + /// \brief send the unknow order + void unknowOrder(const uint32_t &client,const uint32_t &orderId); + signals: + /// \brief send connected client + void connectedClient(const uint32_t &id); + /// \brief send disconnect client + void disconnectedClient(const uint32_t &id); + /// \brief have new query + void newQuery(const uint32_t &client,const uint32_t &orderId,const std::vector &returnList); + /// \brief have new error + void error(const std::string &error); + void communicationError(const std::string &error); + //query + /// \brief ask the protocol compatility + void askProtocolCompatibility(const uint32_t &client,const uint32_t &orderId,const std::string &version); + /// \brief ask protocol extension + void askProtocolExtension(const uint32_t &client,const uint32_t &orderId,const std::string &extension); + /// \brief ask protocol extension with version + void askProtocolExtension(const uint32_t &client,const uint32_t &orderId,const std::string &extension,const std::string &version); + /// \brief send the client name, without query id + void clientName(const uint32_t &client,const std::string &name); + /// \brief send the client have ask the server name + void askServerName(const uint32_t &client,const uint32_t &orderId); + /// \brief copy is send, by globalOrderId, without destination + void newCopyWithoutDestination(const uint32_t &globalOrderId,const std::vector &sources); + /// \brief copy is send, by globalOrderId, with destination + void newCopy(const uint32_t &globalOrderId,const std::vector &sources,const std::string &destination); + /// \brief move is send, by globalOrderId, without destination + void newMoveWithoutDestination(const uint32_t &globalOrderId,const std::vector &sources); + /// \brief move is send, by globalOrderId, with destination + void newMove(const uint32_t &globalOrderId,const std::vector &sources,const std::string &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 new file mode 100644 index 0000000..135c087 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h @@ -0,0 +1,13 @@ +/** \file VariablesCatchcopy.h +\brief Define the variable for catchcopy +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef VARIABLECATCHCOPY_H +#define VARIABLECATCHCOPY_H + +#define CATCHCOPY_PROTOCOL_VERSION "0002" +#define CATCHCOPY_COMMUNICATION_TIMEOUT 200 + +#endif // VARIABLECATCHCOPY_H + diff --git a/plugins/Listener/catchcopy-v0002/documentation.dox b/plugins/Listener/catchcopy-v0002/documentation.dox new file mode 100644 index 0000000..51aa937 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/documentation.dox @@ -0,0 +1,32 @@ +/* -*- 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 default listener to wait a copy/move. It use the catchcopy protocol.\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 find the link on Ultracopier project page, via git, snapshot sources, ... + + \section mainpage_algorithm Protocol + + The protocol in version 0.0.0.2 is used, you can see the documentation on Catchcopy web site + + \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/catchcopy-v0002/informations.xml b/plugins/Listener/catchcopy-v0002/informations.xml new file mode 100644 index 0000000..9efc7ce --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Listener for catchcopy v0002]]> + <![CDATA[Écouteur pour catchcopy v0002]]> + + Listener + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + catchcopy-v0002 + + + \ No newline at end of file diff --git a/plugins/Listener/catchcopy-v0002/listener.cpp b/plugins/Listener/catchcopy-v0002/listener.cpp new file mode 100644 index 0000000..e45a08b --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/listener.cpp @@ -0,0 +1,123 @@ +#include "listener.h" +#include "catchcopy-api-0002/ExtraSocketCatchcopy.h" +#include "../../../cpp11addition.h" + +Listener::Listener() +{ + server.setName(tr("Ultracopier").toStdString()); + 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 Listener::listen() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+ExtraSocketCatchcopy::pathSocket()); + if(server.listen()) + emit newState(Ultracopier::FullListening); + else + emit newState(Ultracopier::NotListening); +} + +void Listener::close() +{ + server.close(); + emit newState(Ultracopier::NotListening); +} + +const std::string Listener::errorString() const +{ + return server.errorString(); +} + +void Listener::setResources(OptionInterface * options, const std::string &writePath, const std::string &pluginPath, const bool &portableVersion) +{ + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); +} + +/// \brief to get the options widget, NULL if not have +QWidget * Listener::options() +{ + return NULL; +} + +/// \brief to get a client list +std::vector Listener::clientsList() const +{ + return server.clientsList(); +} + +void Listener::transferFinished(const uint32_t &orderId, const bool &withError) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+std::to_string(orderId)+", withError: "+std::to_string(withError)); + server.copyFinished(orderId,withError); +} + +void Listener::transferCanceled(const uint32_t &orderId) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, orderId: "+std::to_string(orderId)); + server.copyCanceled(orderId); +} + +/// \brief to reload the translation, because the new language have been loaded +void Listener::newLanguageLoaded() +{ +} + +void Listener::errorInternal(const std::string &string) +{ + Q_UNUSED(string); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"warning emited from Catchcopy lib: "+string); +} + +void Listener::communicationErrorInternal(const std::string &string) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"warning emited from Catchcopy lib: "+string); + emit error(string); +} + +void Listener::clientName(uint32_t client,std::string name) +{ + Q_UNUSED(client); + Q_UNUSED(name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("clientName: %1, for the id: %2").arg(QString::fromStdString(name)).arg(client).toStdString()); +} + +void Listener::copyWithoutDestination(const uint32_t &orderId,const std::vector &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("copyWithoutDestination(%1,%2)") + .arg(orderId) + .arg(QString::fromStdString(stringimplode(sources,";"))) + .toStdString() + ); + emit newCopyWithoutDestination(orderId,sources); +} + +void Listener::copy(const uint32_t &orderId,const std::vector &sources,const std::string &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("copy(%1,%2,%3)").arg(orderId).arg(QString::fromStdString(stringimplode(sources,";")).arg(QString::fromStdString(destination))).toStdString()); + emit newCopy(orderId,sources,destination); +} + +void Listener::moveWithoutDestination(const uint32_t &orderId,const std::vector &sources) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("moveWithoutDestination(%1,%2)").arg(orderId).arg(QString::fromStdString(stringimplode(sources,";"))).toStdString()); + emit newMoveWithoutDestination(orderId,sources); +} + +void Listener::move(const uint32_t &orderId,const std::vector &sources,const std::string &destination) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,QStringLiteral("move(%1,%2,%3)").arg(orderId).arg(QString::fromStdString(stringimplode(sources,";")).arg(QString::fromStdString(destination))).toStdString()); + emit newMove(orderId,sources,destination); +} diff --git a/plugins/Listener/catchcopy-v0002/listener.h b/plugins/Listener/catchcopy-v0002/listener.h new file mode 100644 index 0000000..8cab248 --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/listener.h @@ -0,0 +1,59 @@ +/** \file listener.h +\brief Define the server compatible with Ultracopier interface +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef SERVER_H +#define SERVER_H + +#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 Listener : public 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: + Listener(); + /// \brief try listen the copy/move + void listen(); + /// \brief stop listen to copy/move + void close(); + /// \brief return the error strong + const std::string errorString() const; + /// \brief set resources for this plugins + void setResources(OptionInterface * options,const std::string &writePath,const std::string &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); + /// \brief to get a client list + std::vector clientsList() const; +public slots: + /// \brief say to the client that's the copy/move is finished + void transferFinished(const uint32_t &orderId,const bool &withError); + /// \brief say to the client that's the copy/move is finished + void transferCanceled(const uint32_t &orderId); + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); +private: + ServerCatchcopy server; +private slots: + void errorInternal(const std::string &string); + void communicationErrorInternal(const std::string &string); + void clientName(uint32_t client,std::string name); + void copyWithoutDestination(const uint32_t &orderId,const std::vector &sources); + void copy(const uint32_t &orderId,const std::vector &sources,const std::string &destination); + void moveWithoutDestination(const uint32_t &orderId,const std::vector &sources); + void move(const uint32_t &orderId,const std::vector &sources,const std::string &destination); +}; + +#endif // SERVER_H diff --git a/plugins/Listener/catchcopy-v0002/listener.pro b/plugins/Listener/catchcopy-v0002/listener.pro new file mode 100644 index 0000000..b21289a --- /dev/null +++ b/plugins/Listener/catchcopy-v0002/listener.pro @@ -0,0 +1,26 @@ +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 = \ + $$PWD/listener.h \ + $$PWD/catchcopy-api-0002/VariablesCatchcopy.h \ + $$PWD/catchcopy-api-0002/ServerCatchcopy.h \ + $$PWD/catchcopy-api-0002/ExtraSocketCatchcopy.h \ + $$PWD/Environment.h \ + $$PWD/Variable.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/StructEnumDefinition.h \ + $$PWD/../../../interface/PluginInterface_Listener.h \ + $$PWD/../../../cpp11addition.h +SOURCES = \ + $$PWD/listener.cpp \ + $$PWD/catchcopy-api-0002/ServerCatchcopy.cpp \ + $$PWD/catchcopy-api-0002/ExtraSocketCatchcopy.cpp \ + $$PWD/../../../cpp11addition.cpp \ + $$PWD/../../../cpp11additionstringtointcpp.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/PluginLoader/catchcopy-v0002/DebugEngineMacro.h b/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h new file mode 100644 index 0000000..f9b5349 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/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/PluginLoader/catchcopy-v0002/Environment.h b/plugins/PluginLoader/catchcopy-v0002/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/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/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ar/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/de/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts new file mode 100644 index 0000000..dd3552b --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts @@ -0,0 +1,18 @@ + + + + + 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 + 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 new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/el/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/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 new file mode 100644 index 0000000..577444d --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/es/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 + 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 new file mode 100644 index 0000000..809ffee --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/fr/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. + 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 new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/hi/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/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 new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/id/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/it/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts new file mode 100644 index 0000000..ba6fb10 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/it/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. + 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 new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ja/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/ko/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts new file mode 100644 index 0000000..48aea93 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ko/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/nl/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/nl/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/no/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/no/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/pl/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/pl/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/pt/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/pt/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/ru/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts new file mode 100644 index 0000000..239b785 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ru/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/th/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/th/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/tr/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/tr/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/zh/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts new file mode 100644 index 0000000..a1b2048 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/zh/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/OptionsWidget.cpp b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp new file mode 100644 index 0000000..563e855 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp @@ -0,0 +1,39 @@ +#include "OptionsWidget.h" +#include "ui_OptionsWidget.h" + +OptionsWidget::OptionsWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::OptionsWidget) +{ + ui->setupUi(this); +} + +OptionsWidget::~OptionsWidget() +{ + //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); +} + +void OptionsWidget::setDebug(bool Debug) +{ + ui->Debug->setChecked(Debug); +} + +void OptionsWidget::on_allDllIsImportant_toggled(bool checked) +{ + emit sendAllDllIsImportant(checked); +} + +void OptionsWidget::retranslate() +{ + ui->retranslateUi(this); +} + +void OptionsWidget::on_Debug_toggled(bool checked) +{ + emit sendDebug(checked); +} diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h new file mode 100644 index 0000000..cbbf61c --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h @@ -0,0 +1,30 @@ +#ifndef OptionsWidget_H +#define OptionsWidget_H + +#include + +namespace Ui { +class OptionsWidget; +} + +class OptionsWidget : public QWidget +{ + Q_OBJECT + +public: + explicit OptionsWidget(QWidget *parent = 0); + ~OptionsWidget(); + void setAllDllIsImportant(bool allDllIsImportant); + void setDebug(bool Debug); + void retranslate(); +private: + Ui::OptionsWidget *ui; +signals: + void sendAllDllIsImportant(bool allDllIsImportant); + void sendDebug(bool Debug); +private slots: + void on_allDllIsImportant_toggled(bool checked); + void on_Debug_toggled(bool checked); +}; + +#endif // OptionsWidget_H diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui new file mode 100644 index 0000000..c741676 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui @@ -0,0 +1,48 @@ + + + OptionsWidget + + + + 0 + 0 + 195 + 58 + + + + + + + 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 + + + + + + + Debug + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/plugins/PluginLoader/catchcopy-v0002/PlatformMacro.h b/plugins/PluginLoader/catchcopy-v0002/PlatformMacro.h new file mode 100644 index 0000000..f7586b0 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/PlatformMacro.h @@ -0,0 +1 @@ +#include "../../../PlatformMacro.h" diff --git a/plugins/PluginLoader/catchcopy-v0002/StructEnumDefinition.h b/plugins/PluginLoader/catchcopy-v0002/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins/PluginLoader/catchcopy-v0002/Variable.h b/plugins/PluginLoader/catchcopy-v0002/Variable.h new file mode 100644 index 0000000..90e1557 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/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/PluginLoader/catchcopy-v0002/documentation.dox b/plugins/PluginLoader/catchcopy-v0002/documentation.dox new file mode 100644 index 0000000..b9c9d13 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/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 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 find the link on Ultracopier 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/PluginLoader/catchcopy-v0002/informations.xml b/plugins/PluginLoader/catchcopy-v0002/informations.xml new file mode 100644 index 0000000..95861a6 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Plugin loader for catchcopy v0002]]> + <![CDATA[Chargeur de plugin pour catchcopy v0002]]> + + PluginLoader + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + catchcopy-v0002 + + + \ 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 new file mode 100644 index 0000000..363f372 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp @@ -0,0 +1,450 @@ +/** \file pluginLoader.cpp +\brief Define the session plugin loader test +\author alpha_one_x86 */ + +#include "pluginLoader.h" +#include "PlatformMacro.h" +#include "../../../cpp11addition.h" + +#include +#include +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#include +#endif + +#ifdef ULTRACOPIER_PLUGIN_DEBUG + #define NORMAL_EXT "d.dll" + #define SECOND_EXT ".dll" +#else + #define NORMAL_EXT ".dll" + #define SECOND_EXT "d.dll" +#endif +#define CATCHCOPY_DLL_32 "catchcopy32" +#define CATCHCOPY_DLL_64 "catchcopy64" + +WindowsExplorerLoader::WindowsExplorerLoader() +{ + //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; +#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; + } +#endif +} + +WindowsExplorerLoader::~WindowsExplorerLoader() +{ + //delete optionsWidget;//attached to the main program, then it's the main program responsive the delete + setEnabled(false); +} + +void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred) +{ + 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).toStdString()); + if(needBeRegistred) + emit newState(Ultracopier::Caught); + else + emit newState(Ultracopier::Uncaught); + return; + } + this->needBeRegistred=needBeRegistred; + unsigned int index=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant).toStdString()); + + bool oneHaveFound=false; + index=0; + while(index0 || secondDll.size()>0) + return true; + else + return false; + } + dllChecked=true; + + if(is64Bits) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"64Bits is important"); + importantDll.push_back(CATCHCOPY_DLL_64); + secondDll.push_back(CATCHCOPY_DLL_32); + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"32Bits is important"); + importantDll.push_back(CATCHCOPY_DLL_32); + secondDll.push_back(CATCHCOPY_DLL_64); + } + + unsigned int index=0; + while(index0 || secondDll.size()>0) + return true; + else + return false; +} + +void WindowsExplorerLoader::setResources(OptionInterface * options, const std::string &writePath, const std::string &pluginPath, const bool &portableVersion) +{ + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + this->pluginPath=QCoreApplication::applicationDirPath().toStdString()+"/"; + #else + this->pluginPath=pluginPath; + #endif + this->optionsEngine=options; + if(optionsEngine!=NULL) + { + std::vector > KeysList; + KeysList.push_back(std::pair("allDllIsImportant","false")); + KeysList.push_back(std::pair("Debug","false")); + optionsEngine->addOptionGroup(KeysList); + allDllIsImportant=stringtobool(optionsEngine->getOptionValue("allDllIsImportant")); + Debug=stringtobool(optionsEngine->getOptionValue("Debug")); + optionsWidget->setAllDllIsImportant(allDllIsImportant); + optionsWidget->setDebug(Debug); + } +} + +bool WindowsExplorerLoader::RegisterShellExtDll(const std::string &dllPath, const bool &bRegister, const bool &quiet) +{ + if(Debug) + { + std::string message; + if(bRegister) + message+="Try load the dll: %1, and "+dllPath; + else + message+="Try unload the dll: %1, and "+dllPath; + if(quiet) + message+="don't open the UAC"; + else + message+="open the UAC if needed"; + QMessageBox::information(NULL,"Debug",QString::fromStdString(message)); + } + if(bRegister && correctlyLoaded.find(dllPath)!=correctlyLoaded.cend()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Try dual load: "+dllPath); + return false; + } + ////////////////////////////// First way to load ////////////////////////////// + QStringList arguments; + if(!Debug) + arguments.append("/s"); + if(!bRegister) + arguments.append("/u"); + arguments.append(QString::fromStdString(dllPath)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: regsvr32 "+arguments.join(" ").toStdString()); + 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.toStdString()); + if(!outError.isEmpty()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 error output: "+outError.toStdString()); + } + #else + result=0; + #endif + bool ok=false; + if(result==0) + { + if(bRegister) + correctlyLoaded.insert(dllPath); + ok=true; + } + #if ! defined(_M_X64) + if(result==999 && !changeOfArchDetected)//code of wrong arch for the dll + { + changeOfArchDetected=true; + std::vector temp; + temp = importantDll; + secondDll = importantDll; + importantDll = temp; + return false; + } + #endif + if(result==5) + { + if(!quiet || (!bRegister && correctlyLoaded.find(dllPath)!=correctlyLoaded.cend())) + { + 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 + + #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).toStdString()); + sei.lpParameters = arrayArg; + sei.nShow = SW_SHOW; + ok=ShellExecuteEx(&sei); + #else + ok=true; + #endif + if(ok && bRegister) + correctlyLoaded.insert(dllPath); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"not try because need be quiet: "+dllPath); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 terminated with: "+std::to_string(result)); + if(!bRegister) + correctlyLoaded.erase(dllPath); + return ok; +} + +/// \brief to get the options widget, NULL if not have +QWidget * WindowsExplorerLoader::options() +{ + return optionsWidget; +} + +void WindowsExplorerLoader::newLanguageLoaded() +{ + optionsWidget->retranslate(); +} + +void WindowsExplorerLoader::setAllDllIsImportant(bool allDllIsImportant) +{ + this->allDllIsImportant=allDllIsImportant; + optionsEngine->setOptionValue("allDllIsImportant",std::to_string(allDllIsImportant)); +} + +void WindowsExplorerLoader::setDebug(bool Debug) +{ + this->Debug=Debug; + optionsEngine->setOptionValue("Debug",std::to_string(Debug)); +} diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h new file mode 100644 index 0000000..d18248d --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h @@ -0,0 +1,64 @@ +/** \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 +#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 WindowsExplorerLoader : public PluginInterface_PluginLoader +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.PluginLoader/1.2.4.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_PluginLoader) +public: + 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 std::string &writePath,const std::string &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: + std::string pluginPath; + std::vector importantDll,secondDll; + std::unordered_set correctlyLoaded; + bool RegisterShellExtDll(const std::string &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); +}; + +#endif // PLUGIN_LOADER_TEST_H diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro new file mode 100644 index 0000000..40d5e5e --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro @@ -0,0 +1,53 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets +TEMPLATE = lib +CONFIG += plugin +HEADERS = \ + $$PWD/StructEnumDefinition.h \ + $$PWD/pluginLoader.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/Environment.h \ + $$PWD/Variable.h \ + $$PWD/PlatformMacro.h \ + $$PWD/../../../interface/PluginInterface_PluginLoader.h \ + $$PWD/../../../cpp11addition.h \ + $$PWD/OptionsWidget.h +SOURCES = \ + $$PWD/pluginLoader.cpp \ + $$PWD/OptionsWidget.cpp \ + $$PWD/../../../cpp11addition.cpp \ + $$PWD/../../../cpp11additionstringtointcpp.cpp +TARGET = $$qtLibraryTarget(pluginLoader) +TRANSLATIONS += \ + $$PWD/Languages/ar/translation.ts \ + $$PWD/Languages/de/translation.ts \ + $$PWD/Languages/el/translation.ts \ + $$PWD/Languages/en/translation.ts \ + $$PWD/Languages/es/translation.ts \ + $$PWD/Languages/fr/translation.ts \ + $$PWD/Languages/hi/translation.ts \ + $$PWD/Languages/hu/translation.ts \ + $$PWD/Languages/id/translation.ts \ + $$PWD/Languages/it/translation.ts \ + $$PWD/Languages/ja/translation.ts \ + $$PWD/Languages/ko/translation.ts \ + $$PWD/Languages/nl/translation.ts \ + $$PWD/Languages/no/translation.ts \ + $$PWD/Languages/pl/translation.ts \ + $$PWD/Languages/pt/translation.ts \ + $$PWD/Languages/ru/translation.ts \ + $$PWD/Languages/th/translation.ts \ + $$PWD/Languages/tr/translation.ts \ + $$PWD/Languages/zh/translation.ts + +win32:LIBS += -lole32 -lshell32 + +FORMS += \ + $$PWD/OptionsWidget.ui + +CONFIG(static, static|shared) { +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE +} diff --git a/plugins/SessionLoader/Windows/DebugEngineMacro.h b/plugins/SessionLoader/Windows/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins/SessionLoader/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/SessionLoader/Windows/Environment.h b/plugins/SessionLoader/Windows/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins/SessionLoader/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/SessionLoader/Windows/StructEnumDefinition.h b/plugins/SessionLoader/Windows/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins/SessionLoader/Windows/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins/SessionLoader/Windows/Variable.h b/plugins/SessionLoader/Windows/Variable.h new file mode 100644 index 0000000..963d0c8 --- /dev/null +++ b/plugins/SessionLoader/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/SessionLoader/Windows/documentation.dox b/plugins/SessionLoader/Windows/documentation.dox new file mode 100644 index 0000000..bfe77f3 --- /dev/null +++ b/plugins/SessionLoader/Windows/documentation.dox @@ -0,0 +1,32 @@ +/* -*- 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 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 + + 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 find the link on Ultracopier project page, via git, snapshot sources, ... + + \section mainpage_algorithm Method + + It pass by the registry key to set/get it. + + \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/SessionLoader/Windows/informations.xml b/plugins/SessionLoader/Windows/informations.xml new file mode 100644 index 0000000..4bfbab1 --- /dev/null +++ b/plugins/SessionLoader/Windows/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Session loader for windows]]> + <![CDATA[Chargeur de session pour windows]]> + + SessionLoader + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + Windows + + + \ 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 new file mode 100644 index 0000000..121bae0 --- /dev/null +++ b/plugins/SessionLoader/Windows/sessionLoader.cpp @@ -0,0 +1,80 @@ +/** \file session-loader.cpp +\brief Define the session plugin loader test +\author alpha_one_x86 */ + +#include "sessionLoader.h" + +#include + +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#else + #error "This plugin will only work under Windows" +#endif + +void WindowsSessionLoader::setEnabled(const bool &newValue) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, newValue: "+std::to_string(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) + { + if(RegSetValueEx(ultracopier_regkey, TEXT("ultracopier"), 0, REG_SZ, (BYTE*)windowsString, runStringApp.length()*2)!=ERROR_SUCCESS) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"newValue: "+std::to_string(newValue)+" failed"); + } + else + { + if(RegDeleteValue(ultracopier_regkey, TEXT("ultracopier"))!=ERROR_SUCCESS) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"newValue: "+std::to_string(newValue)+" failed"); + } + RegCloseKey(ultracopier_regkey); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"RegCreateKeyEx: Software\\Microsoft\\Windows\\CurrentVersion\\Run failed"); +} + +bool WindowsSessionLoader::getEnabled() const +{ + //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 WindowsSessionLoader::setResources(OptionInterface * options,const std::string &writePath,const std::string &pluginPath,const bool &portableVersion) +{ + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); +} + +/// \brief to get the options widget, NULL if not have +QWidget * WindowsSessionLoader::options() +{ + return NULL; +} + +/// \brief to reload the translation, because the new language have been loaded +void WindowsSessionLoader::newLanguageLoaded() +{ +} diff --git a/plugins/SessionLoader/Windows/sessionLoader.h b/plugins/SessionLoader/Windows/sessionLoader.h new file mode 100644 index 0000000..b064e50 --- /dev/null +++ b/plugins/SessionLoader/Windows/sessionLoader.h @@ -0,0 +1,33 @@ +/** \file sessionLoader.h +\brief Define the session loader +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef SESSION_LOADER_H +#define SESSION_LOADER_H + +#include +#include "Environment.h" +#include "../../../interface/PluginInterface_SessionLoader.h" + +/// \brief Define the session loader +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(const bool &newValue); + /// \brief to get if is enabled + bool getEnabled() const; + /// \brief set the resources for the plugins + void setResources(OptionInterface * options,const std::string &writePath,const std::string &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(); +}; + +#endif // SESSION_LOADER_H diff --git a/plugins/SessionLoader/Windows/sessionLoader.pro b/plugins/SessionLoader/Windows/sessionLoader.pro new file mode 100644 index 0000000..1059692 --- /dev/null +++ b/plugins/SessionLoader/Windows/sessionLoader.pro @@ -0,0 +1,16 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +TEMPLATE = lib +CONFIG += plugin +LIBS += -ladvapi32 +HEADERS = \ + $$PWD/sessionLoader.h \ + $$PWD/StructEnumDefinition.h \ + $$PWD/Variable.h \ + $$PWD/Environment.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/../../../interface/PluginInterface_SessionLoader.h +SOURCES = sessionLoader.cpp +TARGET = $$qtLibraryTarget(sessionLoader) diff --git a/plugins/Themes/Oxygen/DebugEngineMacro.h b/plugins/Themes/Oxygen/DebugEngineMacro.h new file mode 100644 index 0000000..4582010 --- /dev/null +++ b/plugins/Themes/Oxygen/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/Themes/Oxygen/Environment.h b/plugins/Themes/Oxygen/Environment.h new file mode 100644 index 0000000..265a5a6 --- /dev/null +++ b/plugins/Themes/Oxygen/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/Themes/Oxygen/Languages/ar/translation.ts b/plugins/Themes/Oxygen/Languages/ar/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/ar/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/de/translation.ts b/plugins/Themes/Oxygen/Languages/de/translation.ts new file mode 100644 index 0000000..8f51f95 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/de/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + Buy the Ultimate version to fund development + Kaufe die Ultimate Version um die Entwicklung zu finanzieren + + + + 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 + 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 + + + From: + Von: + + + + To: + Nach: + + + + &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 + + + + Close on transfer completion + Am Ende des Transfers schließen + + + + 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 + Fehlgeschlagene Dateien 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 + 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 + + + + 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/Themes/Oxygen/Languages/el/translation.ts b/plugins/Themes/Oxygen/Languages/el/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/el/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/en/translation.ts b/plugins/Themes/Oxygen/Languages/en/translation.ts new file mode 100644 index 0000000..73e399d --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/en/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 new file mode 100644 index 0000000..fff5a9c --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/es/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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: + + + + &More + &Más + + + + &Pause + &Pausa + + + + &Skip + &Omitir + + + + &Cancel + &Cancelar + + + + 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 + + + + Start minimized + + + + + Click to edit the color + Haga clic para editar el color + + + + 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/Themes/Oxygen/Languages/fr/translation.ts b/plugins/Themes/Oxygen/Languages/fr/translation.ts new file mode 100644 index 0000000..c3aa909 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/fr/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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: + + + + &More + Pl&us + + + + &Pause + &Pause + + + + &Skip + &Passer + + + + &Cancel + &Annuler + + + + 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 à + + + + Start minimized + + + + + Click to edit the color + Cliquer pour éditer la couleur + + + + 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/Themes/Oxygen/Languages/hi/translation.ts b/plugins/Themes/Oxygen/Languages/hi/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/hi/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/hu/translation.ts b/plugins/Themes/Oxygen/Languages/hu/translation.ts new file mode 100644 index 0000000..409e6ea --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/hu/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/id/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/it/translation.ts b/plugins/Themes/Oxygen/Languages/it/translation.ts new file mode 100644 index 0000000..c813017 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/it/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + From: + Da: + + + + To: + a: + + + + &More + Altr&o + + + + &Pause + &Pausa + + + + &Skip + &Salta + + + + &Cancel + &Annulla + + + + Close on transfer completion + Arresta il sistema a trasferimento comletato + + + + Limit copy speed to: + Limitare la velocità di copia a: + + + + 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 + Errore + + + + Export the errors into transfer list + Esporta gli errori nella lista dei trasferimenti + + + + Source + Cartella di origine + + + + Destination + Cartella di destinazione + + + + 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 + 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 + + + + KB/s + KB/s + + + + Informations + Informazioni + + + + Display + Visualizza + + + + 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/Themes/Oxygen/Languages/ja/translation.ts b/plugins/Themes/Oxygen/Languages/ja/translation.ts new file mode 100644 index 0000000..2099b73 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/ja/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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/ko/translation.ts b/plugins/Themes/Oxygen/Languages/ko/translation.ts new file mode 100644 index 0000000..c446d72 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/ko/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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: + 대상: + + + + &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 + + + + + Start minimized + + + + + Click to edit the color + + + + + 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 new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/nl/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/no/translation.ts b/plugins/Themes/Oxygen/Languages/no/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/no/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/pl/translation.ts b/plugins/Themes/Oxygen/Languages/pl/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/pl/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/pt/translation.ts b/plugins/Themes/Oxygen/Languages/pt/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/pt/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/ru/translation.ts b/plugins/Themes/Oxygen/Languages/ru/translation.ts new file mode 100644 index 0000000..1ef7093 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/ru/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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: + к: + + + + &More + больше + + + + &Pause + пауза + + + + &Skip + пропускать + + + + &Cancel + отменить + + + + Close on transfer completion + + + + + 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 + + + + + Start minimized + + + + + Click to edit the color + + + + + KB/s + Кб/с + + + + Informations + + + + + Display + + + + + Speed with progress bar + + + + + Progression color + + + + + Show progression in the title + + + + + Always on top + + + + diff --git a/plugins/Themes/Oxygen/Languages/th/translation.ts b/plugins/Themes/Oxygen/Languages/th/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/th/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/tr/translation.ts b/plugins/Themes/Oxygen/Languages/tr/translation.ts new file mode 100644 index 0000000..c7b2fdd --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/tr/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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 + + + + + Close on transfer completion + + + + + 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 + + + + + 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/zh/translation.ts b/plugins/Themes/Oxygen/Languages/zh/translation.ts new file mode 100644 index 0000000..2099b73 --- /dev/null +++ b/plugins/Themes/Oxygen/Languages/zh/translation.ts @@ -0,0 +1,341 @@ + + + + + Themes + + + + %1 is deprecated, Use %2 + + + + + + This will be the last version for Mac, but you can compile from source + + + + + 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/StructEnumDefinition.h b/plugins/Themes/Oxygen/StructEnumDefinition.h new file mode 100644 index 0000000..c1758f4 --- /dev/null +++ b/plugins/Themes/Oxygen/StructEnumDefinition.h @@ -0,0 +1 @@ +#include "../../../StructEnumDefinition.h" diff --git a/plugins/Themes/Oxygen/ThemesFactory.cpp b/plugins/Themes/Oxygen/ThemesFactory.cpp new file mode 100644 index 0000000..28961f0 --- /dev/null +++ b/plugins/Themes/Oxygen/ThemesFactory.cpp @@ -0,0 +1,481 @@ +/** \file factory.cpp +\brief Define the factory core +\author alpha_one_x86 */ + +#include + +#include "ThemesFactory.h" +#include "../../../cpp11addition.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,"start, currentSpeed: "+std::to_string(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 std::string & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + writePath + #endif + ,const std::string & + #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 + std::vector > KeysList; + KeysList.push_back(std::pair("checkBoxShowSpeed","false")); + KeysList.push_back(std::pair("moreButtonPushed","false")); + KeysList.push_back(std::pair("speedWithProgressBar","true")); + KeysList.push_back(std::pair("currentSpeed","0")); + KeysList.push_back(std::pair("comboBox_copyEnd","0")); + KeysList.push_back(std::pair("showDualProgression","false")); + KeysList.push_back(std::pair("showProgressionInTheTitle","true")); + KeysList.push_back(std::pair("progressColorWrite",QApplication::palette().color(QPalette::Highlight).name().toStdString())); + KeysList.push_back(std::pair("progressColorRead",QApplication::palette().color(QPalette::AlternateBase).name().toStdString())); + KeysList.push_back(std::pair("progressColorRemaining",QApplication::palette().color(QPalette::Base).name().toStdString())); + KeysList.push_back(std::pair("alwaysOnTop","false")); + KeysList.push_back(std::pair("minimizeToSystray","false")); + KeysList.push_back(std::pair("startMinimized","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=stringtouint32(optionsEngine->getOptionValue("currentSpeed"),&ok); + if(!ok) + currentSpeed=0; + ui->comboBox_copyEnd->setCurrentIndex(stringtouint32(optionsEngine->getOptionValue("comboBox_copyEnd"))); + ui->speedWithProgressBar->setChecked(stringtobool(optionsEngine->getOptionValue("speedWithProgressBar"))); + ui->checkBoxShowSpeed->setChecked(stringtobool(optionsEngine->getOptionValue("checkBoxShowSpeed"))); + ui->checkBoxStartWithMoreButtonPushed->setChecked(stringtobool(optionsEngine->getOptionValue("moreButtonPushed"))); + ui->showDualProgression->setChecked(stringtobool(optionsEngine->getOptionValue("showDualProgression"))); + ui->showProgressionInTheTitle->setChecked(stringtobool(optionsEngine->getOptionValue("showProgressionInTheTitle"))); + ui->alwaysOnTop->setChecked(stringtobool(optionsEngine->getOptionValue("alwaysOnTop"))); + ui->minimizeToSystray->setChecked(stringtobool(optionsEngine->getOptionValue("minimizeToSystray"))); + ui->startMinimized->setChecked(stringtobool(optionsEngine->getOptionValue("startMinimized"))); + + progressColorWrite=QVariant(QString::fromStdString(optionsEngine->getOptionValue("progressColorWrite"))).value(); + progressColorRead=QVariant(QString::fromStdString(optionsEngine->getOptionValue("progressColorRead"))).value(); + progressColorRemaining=QVariant(QString::fromStdString(optionsEngine->getOptionValue("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 std::string &fileName) const +{ + if(fileName=="SystemTrayIcon/exit.png") + { + QIcon tempIcon=QIcon::fromTheme("application-exit"); + if(!tempIcon.isNull()) + return tempIcon; + } + else if(fileName=="SystemTrayIcon/add.png") + { + QIcon tempIcon=QIcon::fromTheme("list-add"); + if(!tempIcon.isNull()) + return tempIcon; + } + else if(fileName=="SystemTrayIcon/informations.png") + { + QIcon tempIcon=QIcon::fromTheme("help-about"); + if(!tempIcon.isNull()) + return tempIcon; + } + else if(fileName=="SystemTrayIcon/options.png") + { + QIcon tempIcon=QIcon::fromTheme("applications-system"); + if(!tempIcon.isNull()) + return tempIcon; + } + #ifdef SUPERCOPIER + return QIcon(":/Themes/Supercopier/resources/"+QString::fromStdString(fileName)); + #else + return QIcon(":/Themes/Oxygen/resources/"+QString::fromStdString(fileName)); + #endif +} + +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("checkBoxShowSpeed",std::to_string(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("moreButtonPushed",std::to_string(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("comboBox_copyEnd",std::to_string(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("speedWithProgressBar",std::to_string(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("minimizeToSystray",std::to_string(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("alwaysOnTop",std::to_string(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("showDualProgression",std::to_string(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("startMinimized",std::to_string(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,"value: "+std::to_string(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("currentSpeed",std::to_string(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,"emit newSpeedLimitation: "+std::to_string(currentSpeed)); + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("currentSpeed",std::to_string(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,"checked, currentSpeed: "+std::to_string(currentSpeed)); + ui->limitSpeed->setEnabled(false); + if(currentSpeed==0) + { + ui->SliderSpeed->setValue(0); + ui->label_SpeedMaxValue->setText(QString::fromStdString(facilityEngine->translateText("Unlimited"))); + } + else if(currentSpeed<=1024) + { + if(currentSpeed!=1024) + { + currentSpeed=1024; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("currentSpeed",std::to_string(currentSpeed)); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(1); + ui->label_SpeedMaxValue->setText(QString::fromStdString(facilityEngine->speedToString((double)(1024*1024)*1))); + } + else if(currentSpeed<=1024*4) + { + if(currentSpeed!=1024*4) + { + currentSpeed=1024*4; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("currentSpeed",std::to_string(currentSpeed)); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(2); + ui->label_SpeedMaxValue->setText(QString::fromStdString(facilityEngine->speedToString((double)(1024*1024)*4))); + } + else if(currentSpeed<=1024*16) + { + if(currentSpeed!=1024*16) + { + currentSpeed=1024*16; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("currentSpeed",std::to_string(currentSpeed)); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(3); + ui->label_SpeedMaxValue->setText(QString::fromStdString(facilityEngine->speedToString((double)(1024*1024)*16))); + } + else if(currentSpeed<=1024*64) + { + if(currentSpeed!=1024*64) + { + currentSpeed=1024*64; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("currentSpeed",std::to_string(currentSpeed)); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(4); + ui->label_SpeedMaxValue->setText(QString::fromStdString(facilityEngine->speedToString((double)(1024*1024)*64))); + } + else + { + if(currentSpeed!=1024*128) + { + currentSpeed=1024*128; + if(optionsEngine!=NULL) + optionsEngine->setOptionValue("currentSpeed",std::to_string(currentSpeed)); + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); + } + ui->SliderSpeed->setValue(5); + ui->label_SpeedMaxValue->setText(QString::fromStdString(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("progressColorWrite",progressColorWrite.name().toStdString()); + 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("progressColorRead",progressColorRead.name().toStdString()); + 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("progressColorRemaining",progressColorRemaining.name().toStdString()); + 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("showProgressionInTheTitle",std::to_string(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..f5e304f --- /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 std::string & + #ifdef ULTRACOPIER_PLUGIN_DEBUG + writePath + #endif + ,const std::string & + #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 std::string &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; + int32_t 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 new file mode 100644 index 0000000..2959598 --- /dev/null +++ b/plugins/Themes/Oxygen/TransferModel.cpp @@ -0,0 +1,588 @@ +#include "TransferModel.h" +#include "../../../cpp11addition.h" + +#define COLUMN_COUNT 3 + +// Model + +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; + 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; +} + +QVariant TransferModel::data( const QModelIndex& index, int role ) const +{ + int row,column; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || (unsigned int)row >= transfertItemList.size() || column < 0 || column >= COLUMN_COUNT) + return QVariant(); + + const TransfertItem& item = transfertItemList.at(row); + if(role==Qt::UserRole) + return (quint64)item.id; + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + return QString::fromStdString(item.source); + break; + case 1: + return QString::fromStdString(item.size); + break; + case 2: + return QString::fromStdString(item.destination); + break; + default: + return QVariant(); + } + } + else if(role==Qt::DecorationRole) + { + switch(column) + { + case 0: + if(stopId.find(item.id)!=stopId.cend()) + return *stop; + else if(startId.find(item.id)!=startId.cend()) + return *start; + else + return QVariant(); + break; + default: + return QVariant(); + } + } + else if(role==Qt::BackgroundRole) + { + if(!search_text.empty() && (item.source.find(search_text)!=std::string::npos || + item.destination.find(search_text)!=std::string::npos)) + { + 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.size() : 0; +} + +uint64_t TransferModel::firstId() const +{ + if(transfertItemList.size()>0) + return transfertItemList.front().id; + else + return 0; +} + +QVariant TransferModel::headerData( int section, Qt::Orientation orientation, int role ) const +{ + if(facilityEngine==NULL) + abort(); + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return QString::fromStdString(facilityEngine->translateText("Source")); + case 1: + return QString::fromStdString(facilityEngine->translateText("Size")); + case 2: + return QString::fromStdString(facilityEngine->translateText("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 || (unsigned int)row >= transfertItemList.size() || 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().toStdString(); + emit dataChanged(index,index); + return true; + break; + case 1: + item.size=value.toString().toStdString(); + emit dataChanged(index,index); + return true; + break; + case 2: + item.destination=value.toString().toStdString(); + emit dataChanged(index,index); + return true; + break; + default: + return false; + } + } + return false; +} + +/* + Return[0]: totalFile + Return[1]: totalSize + Return[2]: currentFile + */ +std::vector TransferModel::synchronizeItems(const std::vector& returnActions) +{ + 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.push_back(newItem); + totalFile++; + totalSize+=action.addAction.size; + } + break; + case Ultracopier::MoveItem: + { + //bool current_entry= + if(action.userAction.position<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position).toStdString()); + break; + } + if((unsigned int)action.userAction.position>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("id: %1, position is wrong: %2").arg(action.addAction.id).arg(action.userAction.position).toStdString()); + 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).toStdString()); + break; + } + if((unsigned int)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).toStdString()); + 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).toStdString()); + break; + } + const TransfertItem transfertItem=transfertItemList.at(action.userAction.position); + transfertItemList.erase(transfertItemList.cbegin()+action.userAction.position); + transfertItemList.insert(transfertItemList.cbegin()+action.userAction.moveAt,transfertItem); + //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).toStdString()); + break; + } + if((unsigned int)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).toStdString()); + break; + } + transfertItemList.erase(transfertItemList.cbegin()+action.userAction.position); + currentFile++; + startId.erase(action.addAction.id); + stopId.erase(action.addAction.id); + internalRunningOperation.erase(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.find(action.addAction.id)==startId.cend()) + startId.insert(action.addAction.id); + stopId.erase(action.addAction.id); + if(internalRunningOperation.find(action.addAction.id)!=internalRunningOperation.cend()) + 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).toStdString()); + } + break; + case Ultracopier::PostOperation: + { + if(stopId.find(action.addAction.id)==stopId.cend()) + stopId.insert(action.addAction.id); + startId.erase(action.addAction.id); + } + break; + case Ultracopier::CustomOperation: + { + bool custom_with_progression=(action.addAction.size==1); + //without progression + if(custom_with_progression) + { + if(startId.find(action.addAction.id)!=startId.cend()) + { + startId.erase(action.addAction.id); + if(stopId.find(action.addAction.id)==stopId.cend()) + stopId.insert(action.addAction.id); + } + } + //with progression + else + { + stopId.erase(action.addAction.id); + if(startId.find(action.addAction.id)==startId.cend()) + startId.insert(action.addAction.id); + } + if(internalRunningOperation.find(action.addAction.id)!=internalRunningOperation.cend()) + { + 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 ( unsigned int i = 0; i < transfertItemList.size(); 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(); + { + std::vector newList; + newList.resize(3); + newList[0]=totalFile; + newList[1]=totalSize; + newList[2]=currentFile; + return newList; + } +} + +void TransferModel::setFacilityEngine(FacilityInterface * facilityEngine) +{ + this->facilityEngine=facilityEngine; +} + +int TransferModel::search(const std::string &text, bool searchNext) +{ + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.empty()) + 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 std::string &text) +{ + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.empty()) + 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,"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.find(*startId.cbegin())==internalRunningOperation.cend()) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation.at(*startId.cbegin()); + 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).toStdString()); + 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).toStdString()); + 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).toStdString()); + break; + } + } + else + { + returnItem.haveItem=stopId.size()>0; + if(returnItem.haveItem) + { + if(internalRunningOperation.find(*stopId.cbegin())==internalRunningOperation.cend()) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation.at(*stopId.cbegin()); + 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).toStdString()); + 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).toStdString()); + 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).toStdString()); + 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 new file mode 100644 index 0000000..e572f9e --- /dev/null +++ b/plugins/Themes/Oxygen/TransferModel.h @@ -0,0 +1,96 @@ +#ifndef TRANSFERMODEL_H +#define TRANSFERMODEL_H + +#include +#include +#include +#include +#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 + { + uint64_t id; + std::string source; + std::string size; + std::string destination; + }; + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + uint64_t currentReadProgression,currentWriteProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + uint64_t id; + bool haveItem; + std::string from; + std::string to; + std::string 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); + + std::vector synchronizeItems(const std::vector& returnActions); + void setFacilityEngine(FacilityInterface * facilityEngine); + + int search(const std::string &text,bool searchNext); + int searchPrev(const std::string &text); + + void setFileProgression(std::vector &progressionList); + + currentTransfertItem getCurrentTransfertItem() const; + + uint64_t firstId() const; +protected: + std::vector transfertItemList;///< To have a transfer list for the user + std::set startId,stopId;///< To show what is started, what is stopped + std::unordered_map 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; + std::string search_text; + /// \brief index from start the search, decresed by remove before it + int currentIndexSearch; + bool haveSearchItem; + uint64_t searchId; + static QIcon *start; + static QIcon *stop; +signals: + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,std::string fonction,std::string text,std::string file,int ligne) const; + #endif +}; + +#endif // TRANSFERMODEL_H diff --git a/plugins/Themes/Oxygen/Variable.h b/plugins/Themes/Oxygen/Variable.h new file mode 100644 index 0000000..8b6119b --- /dev/null +++ b/plugins/Themes/Oxygen/Variable.h @@ -0,0 +1,18 @@ +/** \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_VERSION_ULTIMATE + +#endif // VARIABLE_H + + + diff --git a/plugins/Themes/Oxygen/documentation.dox b/plugins/Themes/Oxygen/documentation.dox new file mode 100644 index 0000000..d94ce0b --- /dev/null +++ b/plugins/Themes/Oxygen/documentation.dox @@ -0,0 +1,31 @@ +/* -*- 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 the default interface for Ultracopier.\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 find the link on Ultracopier 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 + 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/Themes/Oxygen/informations.xml b/plugins/Themes/Oxygen/informations.xml new file mode 100644 index 0000000..f03f832 --- /dev/null +++ b/plugins/Themes/Oxygen/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Oxygen style for Ultracopier]]> + <![CDATA[Style oxygen pour Ultracopier]]> + + Themes + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + Oxygen + + + \ No newline at end of file diff --git a/plugins/Themes/Oxygen/interface.cpp b/plugins/Themes/Oxygen/interface.cpp new file mode 100644 index 0000000..84b4dd6 --- /dev/null +++ b/plugins/Themes/Oxygen/interface.cpp @@ -0,0 +1,1497 @@ +/** \file interface.cpp +\brief Define the interface core +\author alpha_one_x86 */ + +#include +#include +#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" +#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 ); +} +#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()) +{ + 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); + + #ifdef SUPERCOPIER + const QString themePath=":/Themes/Supercopier/"; + #else + const QString themePath=":/Themes/Oxygen/"; + #endif + + // 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(themePath+QStringLiteral("resources/player_pause.png")); + player_play=QIcon::fromTheme(QStringLiteral("media-playback-play")); + if(player_play.isNull()) + player_play=QIcon(themePath+QStringLiteral("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(themePath+QStringLiteral("resources/SystemTrayIcon/systray_Uncaught_Windows.png")); + pixmapBottom=QPixmap(themePath+QStringLiteral("resources/SystemTrayIcon/systray_Caught_Windows.png")); + #else + pixmapTop=QPixmap(themePath+QStringLiteral("resources/SystemTrayIcon/systray_Uncaught_Unix.png")); + pixmapBottom=QPixmap(themePath+QStringLiteral("resources/SystemTrayIcon/systray_Caught_Unix.png")); + #endif + + #ifdef SUPERCOPIER + /*QIcon icon; + icon.addFile(themePath+QStringLiteral("resources/main.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->interfaceCopy->setWindowIcon(icon);*/ + QIcon icon1; + icon1.addFile(themePath+QStringLiteral("resources/add.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->actionAddFile->setIcon(icon1); + QIcon icon2; + icon2.addFile(themePath+QStringLiteral("resources/SystemTrayIcon/exit.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->shutdown->setIcon(icon2); + QIcon icon3; + icon3.addFile(themePath+QStringLiteral("resources/moveDown.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->moreButton->setIcon(icon3); + ui->pushDown->setIcon(icon3); + if(!QFile::exists(themePath+QStringLiteral("resources/moveDown.png"))) + { + qDebug() << "File not found, can't continue: " << themePath+QStringLiteral("resources/moveDown.png"); + abort(); + } + QIcon icon4; + icon4.addFile(themePath+QStringLiteral("resources/player_pause.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->pauseButton->setIcon(icon4); + QIcon icon5; + icon5.addFile(themePath+QStringLiteral("resources/player_end.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->skipButton->setIcon(icon5); + QIcon icon6; + icon6.addFile(themePath+QStringLiteral("resources/cancel.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->cancelButton->setIcon(icon6); + QIcon icon7; + icon7.addFile(themePath+QStringLiteral("resources/putOnTop.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->putOnTop->setIcon(icon7); + QIcon icon8; + icon8.addFile(themePath+QStringLiteral("resources/moveUp.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->pushUp->setIcon(icon8); + QIcon icon9; + icon9.addFile(themePath+QStringLiteral("resources/putOnBottom.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->putOnBottom->setIcon(icon9); + QIcon icon10; + icon10.addFile(themePath+QStringLiteral("resources/remove.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->del->setIcon(icon10); + QIcon icon11; + icon11.addFile(themePath+QStringLiteral("resources/search.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->searchButton->setIcon(icon11); + QIcon icon12; + icon12.addFile(themePath+QStringLiteral("resources/export-transfer-list.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->exportTransferList->setIcon(icon12); + QIcon icon13; + icon13.addFile(themePath+QStringLiteral("resources/import-transfer-list.png"), QSize(), QIcon::Normal, QIcon::Off); + ui->importTransferList->setIcon(icon13); + QIcon icon14; + icon14.addFile(themePath+QStringLiteral("resources/main.png"), QSize(), QIcon::Normal, QIcon::Off); + this->setWindowIcon(icon14); + #endif + + shutdown=facilityEngine->haveFunctionality("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 + #ifdef SUPERCOPIER + ui->ad_ultimate->setText(tr("%1 is deprecated, Use %2").arg("SuperCopier").arg("Ultracopier")); + #else + #ifdef Q_OS_MACOS + ui->ad_ultimate->setText(tr("This will be the last version for Mac, but you can compile from source")); + #else + ui->ad_ultimate->hide(); + #endif + #endif + #else + QString ultimateUrl=QString::fromStdString(facilityEngine->ultimateUrl()); + if(ultimateUrl.isEmpty()) + ui->ad_ultimate->hide(); + else + ui->ad_ultimate->setText( + #ifdef SUPERCOPIER + tr("%1 is deprecated, Use %2").arg("Supercopier").arg("Ultracopier
")+ + #endif + #ifdef Q_OS_MACOS + tr("This will be the last version for Mac, but you can compile from source")+ + #endif + QStringLiteral("%2").arg(ultimateUrl).arg(tr("Buy the Ultimate version to fund development"))); + #endif + + #ifdef SUPERCOPIER + 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);}")); + this->setWindowTitle("Supercopier"); + #endif + + show(); + + sysTrayIcon = new QSystemTrayIcon(this); + connect(sysTrayIcon,&QSystemTrayIcon::activated,this,&Themes::catchAction); +} + +Themes::~Themes() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,QString::fromStdString(facilityEngine->translateText("Copy engine"))); + } +} + +void Themes::closeEvent(QCloseEvent *event) +{ + event->ignore(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->hide(); + if(uiOptions->minimizeToSystray->isChecked()) + { + updateSysTrayIcon(); + sysTrayIcon->show(); + } + else + emit cancel(); +} + +void Themes::updateSysTrayIcon() +{ + if(totalSize==0) + { + sysTrayIcon->setIcon(dynaIcon(0,"-")); + 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(QString::fromStdString(facilityEngine->sizeToString(currentSize))) + .arg(QString::fromStdString(facilityEngine->sizeToString(totalSize))) + ); +} + +void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start: "+std::to_string(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("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( + (std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()- + duration) + /1000); + ui->labelTimeRemaining->setText(QStringLiteral("")+ + QString::fromStdString(facilityEngine->translateText("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=std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + durationStarted=true; + } + haveStarted=true; + ui->cancelButton->setText(QString::fromStdString(facilityEngine->translateText("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 std::string &path) +{ + QString newPath=QString::fromStdString(path); + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(action==Ultracopier::Listing) + ui->from->setText(newPath); +} + +void Themes::detectedSpeed(const uint64_t &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,"set max speed to: "+std::to_string(tempSpeed)); + ui->progressBarCurrentSpeed->setMaximum(tempSpeed); + } + ui->progressBarCurrentSpeed->setValue(tempSpeed); + ui->progressBarCurrentSpeed->setFormat(QString::fromStdString(facilityEngine->speedToString(speed))); + } + else + ui->currentSpeed->setText(QString::fromStdString(facilityEngine->speedToString(speed))); +} + +void Themes::remainingTime(const int &remainingSeconds) +{ + QString labelTimeRemaining(QStringLiteral( + "")+ + QString::fromStdString(facilityEngine->translateText("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 std::string &source,const std::string &destination,const std::string &error) +{ + ui->errorList->addTopLevelItem(new QTreeWidgetItem(QStringList() + << QString::fromStdString(source) + << QString::fromStdString(destination) + << QString::fromStdString(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 uint64_t ¤t,const uint64_t &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 std::vector &progressionList) +{ + std::vector progressionListBis=progressionList; + transferModel.setFileProgression(progressionListBis); + updateCurrentFileInformation(); +} + +//edit the transfer list +/// \todo check and re-enable to selection +void Themes::getActionOnList(const std::vector &returnActions) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, returnActions.size(): "+std::to_string(returnActions.size())); + std::vector returnValue=transferModel.synchronizeItems(returnActions); + totalFile+=returnValue.front(); + totalSize+=returnValue.at(1); + currentFile+=returnValue.back(); + 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,"transferModel.rowCount(): "+std::to_string(transferModel.rowCount())); +} + +void Themes::setCopyType(const Ultracopier::CopyType &type) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->type=type; + updateModeAndType(); +} + +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"start"); +// ui->moreButton->toggle(); +} + +void Themes::isInPause(const bool &isInPause) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"isInPause: "+std::to_string(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(QString::fromStdString(facilityEngine->translateText("Resume"))); + else + ui->pauseButton->setText(QString::fromStdString(facilityEngine->translateText("Start"))); + } + else + { + ui->pauseButton->setIcon(player_pause); + ui->pauseButton->setText(QString::fromStdString(facilityEngine->translateText("Pause"))); + } +} + +void Themes::updateCurrentFileInformation() +{ + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + QString newPath=QString::fromStdString(transfertItem.from); + if(newPath.size()>(64+3)) + newPath=newPath.mid(0,32)+QStringLiteral("...")+newPath.mid(newPath.size()-32,32); + ui->from->setText(newPath); + newPath=QString::fromStdString(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(QString::fromStdString(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,"start"); + selectedItems=selectionModel->selectedRows(); + std::vector 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,"start"); + selectedItems=selectionModel->selectedRows(); + std::vector 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,"start"); + selectedItems=selectionModel->selectedRows(); + std::vector 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,"start"); + selectedItems=selectionModel->selectedRows(); + std::vector 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,"start"); + selectedItems=selectionModel->selectedRows(); + std::vector 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,"start"); + this->hide(); + emit cancel(); +} + + +void Themes::speedWithProgressBar_toggled(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + ui->progressBarCurrentSpeed->setVisible(checked); + ui->currentSpeed->setVisible(!checked); +} + +void Themes::showDualProgression_toggled(bool checked) +{ + Q_UNUSED(checked); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + updateProgressionColorBar(); +} + +void Themes::checkBoxShowSpeed_toggled(bool checked) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"value: "+std::to_string(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,"emit newSpeedLimitation"+std::to_string(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,"checked, currentSpeed: "+std::to_string(currentSpeed)); + uiOptions->limitSpeed->setEnabled(false); + if(currentSpeed==0) + { + ui->SliderSpeed->setValue(0); + ui->label_SpeedMaxValue->setText(QString::fromStdString(facilityEngine->translateText("Unlimited"))); + } + else if(currentSpeed<=1024) + { + if(currentSpeed!=1024) + { + currentSpeed=1024; + emit newSpeedLimitation(currentSpeed); + } + ui->SliderSpeed->setValue(1); + ui->label_SpeedMaxValue->setText(QString::fromStdString(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(QString::fromStdString(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(QString::fromStdString(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(QString::fromStdString(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(QString::fromStdString(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,"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,"skip at running: "+std::to_string(transfertItem.id)); + emit skip(transfertItem.id); + } + else + { + if(transferModel.rowCount()>1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"skip at idle: "+std::to_string(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,"start"); + emit userAddFile(mode); +} + +void Themes::forcedModeAddFolder() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(mode); +} + +void Themes::forcedModeAddFileToCopy() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Copy); +} + +void Themes::forcedModeAddFolderToCopy() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Copy); +} + +void Themes::forcedModeAddFileToMove() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Move); +} + +void Themes::forcedModeAddFolderToMove() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Move); +} + +void Themes::newLanguageLoaded() +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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, + QString::fromStdString(facilityEngine->translateText("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().toStdString(),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().toStdString()); + 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,"start"); + const QMimeData* mimeData = event->mimeData(); + if(mimeData->hasUrls()) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"hasUrls"); + std::vector urls; + foreach (QUrl url, mimeData->urls()) + urls.push_back(url.toString().toStdString()); + emit urlDropped(urls); + event->acceptProposedAction(); + } +} + +void Themes::dragEnterEvent(QDragEnterEvent* event) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"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,"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,"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(): "+std::to_string(uiOptions->alwaysOnTop->isChecked())+", flags: "+std::to_string(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(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(QString::fromStdString(facilityEngine->translateText("Transfer"))).arg((currentSize*100)/totalSize).arg(QString::fromStdString(facilityEngine->sizeToString(totalSize)))+QStringLiteral(" - ")+QString::fromStdString(facilityEngine->softwareName())); + else + { + if(mode==Ultracopier::Copy) + this->setWindowTitle(tr("%1 %2% of %3").arg(QString::fromStdString(facilityEngine->translateText("Copy"))).arg((currentSize*100)/totalSize).arg(QString::fromStdString(facilityEngine->sizeToString(totalSize)))+QStringLiteral(" - ")+QString::fromStdString(facilityEngine->softwareName())); + else + this->setWindowTitle(tr("%1 %2% of %3").arg(QString::fromStdString(facilityEngine->translateText("Move"))).arg((currentSize*100)/totalSize).arg(QString::fromStdString(facilityEngine->sizeToString(totalSize)))+QStringLiteral(" - ")+QString::fromStdString(facilityEngine->softwareName())); + } + } + else + { + if(!modeIsForced) + this->setWindowTitle(QStringLiteral("%1").arg(QString::fromStdString(facilityEngine->translateText("Transfer")))+QStringLiteral(" - ")+QString::fromStdString(facilityEngine->softwareName())); + else + { + if(mode==Ultracopier::Copy) + this->setWindowTitle(QStringLiteral("%1").arg(QString::fromStdString(facilityEngine->translateText("Copy")))+QStringLiteral(" - ")+QString::fromStdString(facilityEngine->softwareName())); + else + this->setWindowTitle(QStringLiteral("%1").arg(QString::fromStdString(facilityEngine->translateText("Move")))+QStringLiteral(" - ")+QString::fromStdString(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,std::string 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.empty()) + { + if(percent!=100) + text=std::to_string(percent); + else + { + text=":)"; + #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,QString::fromStdString(text)); + painter.setPen(QPen(Qt::white)); + painter.drawText(2+textxOffset,12+textyOffset,QString::fromStdString(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,"reason: "+std::to_string(reason)); +} + +void Themes::on_exportErrorToTransferList_clicked() +{ + emit exportErrorIntoTransferList(); +} diff --git a/plugins/Themes/Oxygen/interface.h b/plugins/Themes/Oxygen/interface.h new file mode 100644 index 0000000..acca141 --- /dev/null +++ b/plugins/Themes/Oxygen/interface.h @@ -0,0 +1,222 @@ +/** \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, + 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 std::string &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const uint64_t &speed); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const std::string &action); + /// \brief set the current error action + void newErrorAction(const std::string &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const std::string &source,const std::string &destination,const std::string &error); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const uint64_t ¤t,const uint64_t &total); + /// \brief show the file progression + void setFileProgression(const std::vector &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 std::vector &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: + uint64_t duration; + bool durationStarted; + QPixmap pixmapTop,pixmapBottom; + QColor progressColorWrite,progressColorRead,progressColorRemaining; + Ui::interfaceCopy *ui; + Ui::themesOptions *uiOptions; + uint64_t currentFile; + uint64_t totalFile; + uint64_t currentSize; + uint64_t totalSize; + uint8_t getOldProgression; + QSystemTrayIcon *sysTrayIcon; + void updateOverallInformation(); + void updateCurrentFileInformation(); + QMenu *menu; + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + int32_t 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,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,std::string text="") const; + void updateSysTrayIcon(); +signals: + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const; +}; + +#endif // INTERFACE_H diff --git a/plugins/Themes/Oxygen/interface.pro b/plugins/Themes/Oxygen/interface.pro new file mode 100644 index 0000000..9b4923d --- /dev/null +++ b/plugins/Themes/Oxygen/interface.pro @@ -0,0 +1,8 @@ +include($$PWD/../Oxygen/interfaceInclude.pri) + +!CONFIG(static) { +RESOURCES += \ + $$PWD/../Oxygen/interfaceResources.qrc \ + $$PWD/../Oxygen/interfaceResources_unix.qrc \ + $$PWD/../Oxygen/interfaceResources_windows.qrc +} diff --git a/plugins/Themes/Oxygen/interface.ui b/plugins/Themes/Oxygen/interface.ui new file mode 100644 index 0000000..ef07b17 --- /dev/null +++ b/plugins/Themes/Oxygen/interface.ui @@ -0,0 +1,848 @@ + + + interfaceCopy + + + + 0 + 0 + 508 + 448 + + + + Ultracopier + + + + :/Themes/Oxygen/resources/main.png:/Themes/Oxygen/resources/main.png + + + + 2 + + + 1 + + + + + 2 + + + + + From: + + + + + + + + 0 + 0 + + + + + + + Qt::PlainText + + + + + + + + + 5 + + + + + To: + + + + + + + + 0 + 0 + + + + + + + Qt::PlainText + + + + + + + + + + + File 0/0, Total: 0KB + + + Qt::PlainText + + + + + + + Qt::RichText + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 20 + 20 + + + + Close on transfer completion + + + + :/Themes/Oxygen/resources/SystemTrayIcon/exit.png:/Themes/Oxygen/resources/SystemTrayIcon/exit.png + + + true + + + true + + + + + + + + + + 16777215 + 16 + + + + 65535 + + + + + + + File Name, 0KB + + + Qt::PlainText + + + + + + + + 16777215 + 16 + + + + 65535 + + + + + + + Qt::RichText + + + true + + + + + + + 4 + + + + + + 0 + 0 + + + + + 60 + 0 + + + + 0KB/sec + + + + + + + + 16777215 + 16 + + + + 1 + + + 0 + + + 0KB/sec + + + + + + + &More + + + + :/Themes/Oxygen/resources/moveDown.png:/Themes/Oxygen/resources/moveDown.png + + + true + + + true + + + + + + + false + + + &Pause + + + + :/Themes/Oxygen/resources/player_pause.png:/Themes/Oxygen/resources/player_pause.png + + + + + + + false + + + &Skip + + + + :/Themes/Oxygen/resources/player_end.png:/Themes/Oxygen/resources/player_end.png + + + + + + + &Cancel + + + + :/Themes/Oxygen/resources/cancel.png:/Themes/Oxygen/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/Oxygen/resources/putOnTop.png:/Themes/Oxygen/resources/putOnTop.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move up the selected items + + + + :/Themes/Oxygen/resources/moveUp.png:/Themes/Oxygen/resources/moveUp.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move down the selected items + + + + :/Themes/Oxygen/resources/moveDown.png:/Themes/Oxygen/resources/moveDown.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Move the selected items to the bottom + + + + :/Themes/Oxygen/resources/putOnBottom.png:/Themes/Oxygen/resources/putOnBottom.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Add file/folder + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + QToolButton::InstantPopup + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Delete the selected items + + + + :/Themes/Oxygen/resources/remove.png:/Themes/Oxygen/resources/remove.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Search + + + + :/Themes/Oxygen/resources/search.png:/Themes/Oxygen/resources/search.png + + + true + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Export the transfer list + + + + :/Themes/Oxygen/resources/export-transfer-list.png:/Themes/Oxygen/resources/export-transfer-list.png + + + true + + + + + + + + 22 + 22 + + + + + 22 + 22 + + + + Import the transfer list + + + + :/Themes/Oxygen/resources/import-transfer-list.png:/Themes/Oxygen/resources/import-transfer-list.png + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 0 + + + + + QAbstractItemView::ExtendedSelection + + + false + + + true + + + + + + + 0 + + + + + + + + Previous + + + + + + + Next + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + :/Themes/Oxygen/resources/remove.png:/Themes/Oxygen/resources/remove.png + + + true + + + + + + + + + + + + Error + + + + + + + + + 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 + + + + + + + + + + QAbstractItemView::NoSelection + + + false + + + true + + + + Source + + + + + Destination + + + + + Error + + + + + + + + + Interface + + + + 0 + + + 0 + + + + + true + + + + + 0 + 0 + 492 + 227 + + + + + + + + + + + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + Add file + + + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + Add folder + + + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + Move file(s) + + + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + Move folder + + + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + Copy file(s) + + + + + + :/Themes/Oxygen/resources/add.png:/Themes/Oxygen/resources/add.png + + + Copy folder + + + + + + + + + moreButton + toggled(bool) + tabWidget + setVisible(bool) + + + 218 + 144 + + + 149 + 305 + + + + + diff --git a/plugins/Themes/Oxygen/interfaceInclude.pri b/plugins/Themes/Oxygen/interfaceInclude.pri new file mode 100644 index 0000000..5f7317b --- /dev/null +++ b/plugins/Themes/Oxygen/interfaceInclude.pri @@ -0,0 +1,51 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets +TEMPLATE = lib +CONFIG += plugin +HEADERS = \ + $$PWD/ThemesFactory.h \ + $$PWD/StructEnumDefinition.h \ + $$PWD/DebugEngineMacro.h \ + $$PWD/Environment.h \ + $$PWD/Variable.h \ + $$PWD/../../../interface/PluginInterface_Themes.h \ + $$PWD/../../../interface/FacilityInterface.h \ + $$PWD/../../../interface/OptionInterface.h \ + $$PWD/../../../cpp11addition.h \ + $$PWD/TransferModel.h \ + $$PWD/interface.h +SOURCES = \ + $$PWD/ThemesFactory.cpp \ + $$PWD/TransferModel.cpp \ + $$PWD/interface.cpp \ + $$PWD/../../../cpp11addition.cpp \ + $$PWD/../../../cpp11additionstringtointcpp.cpp +TARGET = $$qtLibraryTarget(interface) +TRANSLATIONS += \ + $$PWD/Languages/ar/translation.ts \ + $$PWD/Languages/de/translation.ts \ + $$PWD/Languages/el/translation.ts \ + $$PWD/Languages/en/translation.ts \ + $$PWD/Languages/es/translation.ts \ + $$PWD/Languages/fr/translation.ts \ + $$PWD/Languages/hi/translation.ts \ + $$PWD/Languages/hu/translation.ts \ + $$PWD/Languages/id/translation.ts \ + $$PWD/Languages/it/translation.ts \ + $$PWD/Languages/ja/translation.ts \ + $$PWD/Languages/ko/translation.ts \ + $$PWD/Languages/nl/translation.ts \ + $$PWD/Languages/no/translation.ts \ + $$PWD/Languages/pl/translation.ts \ + $$PWD/Languages/pt/translation.ts \ + $$PWD/Languages/ru/translation.ts \ + $$PWD/Languages/th/translation.ts \ + $$PWD/Languages/tr/translation.ts \ + $$PWD/Languages/zh/translation.ts + +FORMS += \ + $$PWD/interface.ui \ + $$PWD/themesOptions.ui 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 new file mode 100644 index 0000000..96e4efa --- /dev/null +++ b/plugins/Themes/Oxygen/options.ui @@ -0,0 +1,290 @@ + + + options + + + + 0 + 0 + 515 + 251 + + + + + + + + 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 + + + + + + + + + + + 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 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/SystemTrayIcon/add.png b/plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png new file mode 100644 index 0000000..7932127 Binary files /dev/null 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 new file mode 100644 index 0000000..ae3c4e8 Binary files /dev/null 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 new file mode 100644 index 0000000..5b7b255 Binary files /dev/null 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 new file mode 100644 index 0000000..23ec531 Binary files /dev/null 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 new file mode 100644 index 0000000..6f5d1cf Binary files /dev/null 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 new file mode 100644 index 0000000..5464856 Binary files /dev/null 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 new file mode 100644 index 0000000..b2bb2e3 Binary files /dev/null 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 new file mode 100644 index 0000000..0abeb5f Binary files /dev/null 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 new file mode 100644 index 0000000..5e313b9 Binary files /dev/null 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 new file mode 100644 index 0000000..828e7e6 Binary files /dev/null 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 new file mode 100644 index 0000000..7932127 Binary files /dev/null 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 new file mode 100644 index 0000000..ae3c4e8 Binary files /dev/null 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 new file mode 100644 index 0000000..3a0aac6 Binary files /dev/null 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 new file mode 100644 index 0000000..ee47f0d Binary files /dev/null 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 new file mode 100644 index 0000000..5464856 Binary files /dev/null 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 new file mode 100644 index 0000000..82a312c Binary files /dev/null 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 new file mode 100644 index 0000000..7f7ba72 Binary files /dev/null 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 new file mode 100644 index 0000000..18982db Binary files /dev/null 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 new file mode 100644 index 0000000..68ee21f Binary files /dev/null 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 new file mode 100644 index 0000000..a1c5b83 Binary files /dev/null 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 new file mode 100644 index 0000000..512286e Binary files /dev/null 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 new file mode 100644 index 0000000..30fe96b Binary files /dev/null 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 new file mode 100644 index 0000000..b711740 Binary files /dev/null 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 new file mode 100644 index 0000000..cef1836 Binary files /dev/null and b/plugins/Themes/Oxygen/resources/search.png differ 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/Themes/Supercopier/informations.xml b/plugins/Themes/Supercopier/informations.xml new file mode 100644 index 0000000..d5cb35e --- /dev/null +++ b/plugins/Themes/Supercopier/informations.xml @@ -0,0 +1,26 @@ + + + <![CDATA[Supercopier style for Ultracopier]]> + <![CDATA[Style supercopier pour Ultracopier]]> + + Themes + + + + + + + 1287496800 + + windows-x86 + + + + + 1.4.0.4 + + Supercopier + + + diff --git a/plugins/Themes/Supercopier/interface.pro b/plugins/Themes/Supercopier/interface.pro new file mode 100644 index 0000000..1b0ef2e --- /dev/null +++ b/plugins/Themes/Supercopier/interface.pro @@ -0,0 +1,10 @@ +DEFINES+=SUPERCOPIER + +include($$PWD/../Oxygen/interfaceInclude.pri) + +!CONFIG(static) { +RESOURCES += \ + $$PWD/../Supercopier/interfaceResources.qrc \ + $$PWD/../Supercopier/interfaceResources_unix.qrc \ + $$PWD/../Supercopier/interfaceResources_windows.qrc +} diff --git a/plugins/Themes/Supercopier/interfaceResources.qrc b/plugins/Themes/Supercopier/interfaceResources.qrc new file mode 100644 index 0000000..d8990aa --- /dev/null +++ b/plugins/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/Themes/Supercopier/interfaceResources_unix.qrc b/plugins/Themes/Supercopier/interfaceResources_unix.qrc new file mode 100644 index 0000000..2cf979f --- /dev/null +++ b/plugins/Themes/Supercopier/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/Supercopier/interfaceResources_windows.qrc b/plugins/Themes/Supercopier/interfaceResources_windows.qrc new file mode 100644 index 0000000..abbedba --- /dev/null +++ b/plugins/Themes/Supercopier/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/Supercopier/resources/SystemTrayIcon/add.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/add.png new file mode 100644 index 0000000..d41fce6 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/add.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/exit.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/exit.png new file mode 100644 index 0000000..9599bba Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/exit.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/informations.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/informations.png new file mode 100644 index 0000000..86c9ba6 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/informations.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/options.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/options.png new file mode 100644 index 0000000..cf699d5 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/options.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png new file mode 100644 index 0000000..be2ba20 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png new file mode 100644 index 0000000..9c597af Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png new file mode 100644 index 0000000..be2ba20 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png new file mode 100644 index 0000000..9c597af Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png new file mode 100644 index 0000000..4da8cc0 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png new file mode 100644 index 0000000..8bfbcf9 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins/Themes/Supercopier/resources/add.png b/plugins/Themes/Supercopier/resources/add.png new file mode 100644 index 0000000..af8a401 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/add.png differ diff --git a/plugins/Themes/Supercopier/resources/cancel.png b/plugins/Themes/Supercopier/resources/cancel.png new file mode 100644 index 0000000..1e7579c Binary files /dev/null and b/plugins/Themes/Supercopier/resources/cancel.png differ diff --git a/plugins/Themes/Supercopier/resources/export-transfer-list.png b/plugins/Themes/Supercopier/resources/export-transfer-list.png new file mode 100644 index 0000000..2bcc455 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/export-transfer-list.png differ diff --git a/plugins/Themes/Supercopier/resources/import-transfer-list.png b/plugins/Themes/Supercopier/resources/import-transfer-list.png new file mode 100644 index 0000000..d208342 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/import-transfer-list.png differ diff --git a/plugins/Themes/Supercopier/resources/main.png b/plugins/Themes/Supercopier/resources/main.png new file mode 100644 index 0000000..9bec399 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/main.png differ diff --git a/plugins/Themes/Supercopier/resources/moveDown.png b/plugins/Themes/Supercopier/resources/moveDown.png new file mode 100644 index 0000000..7f4ff27 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/moveDown.png differ diff --git a/plugins/Themes/Supercopier/resources/moveUp.png b/plugins/Themes/Supercopier/resources/moveUp.png new file mode 100644 index 0000000..9397b76 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/moveUp.png differ diff --git a/plugins/Themes/Supercopier/resources/player_end.png b/plugins/Themes/Supercopier/resources/player_end.png new file mode 100644 index 0000000..9730302 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/player_end.png differ diff --git a/plugins/Themes/Supercopier/resources/player_pause.png b/plugins/Themes/Supercopier/resources/player_pause.png new file mode 100644 index 0000000..429ae43 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/player_pause.png differ diff --git a/plugins/Themes/Supercopier/resources/player_play.png b/plugins/Themes/Supercopier/resources/player_play.png new file mode 100644 index 0000000..a28ac73 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/player_play.png differ diff --git a/plugins/Themes/Supercopier/resources/progressbarleft.png b/plugins/Themes/Supercopier/resources/progressbarleft.png new file mode 100644 index 0000000..bbee9c8 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/progressbarleft.png differ diff --git a/plugins/Themes/Supercopier/resources/progressbarright.png b/plugins/Themes/Supercopier/resources/progressbarright.png new file mode 100644 index 0000000..93e5781 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/progressbarright.png differ diff --git a/plugins/Themes/Supercopier/resources/putOnBottom.png b/plugins/Themes/Supercopier/resources/putOnBottom.png new file mode 100644 index 0000000..9ac517c Binary files /dev/null and b/plugins/Themes/Supercopier/resources/putOnBottom.png differ diff --git a/plugins/Themes/Supercopier/resources/putOnTop.png b/plugins/Themes/Supercopier/resources/putOnTop.png new file mode 100644 index 0000000..5682829 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/putOnTop.png differ diff --git a/plugins/Themes/Supercopier/resources/remove.png b/plugins/Themes/Supercopier/resources/remove.png new file mode 100644 index 0000000..3a2a9f1 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/remove.png differ diff --git a/plugins/Themes/Supercopier/resources/search.png b/plugins/Themes/Supercopier/resources/search.png new file mode 100644 index 0000000..567f498 Binary files /dev/null and b/plugins/Themes/Supercopier/resources/search.png differ 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 new file mode 100644 index 0000000..b662ab4 Binary files /dev/null and b/resources/Languages/en/flag.png differ diff --git a/resources/Languages/en/informations.xml b/resources/Languages/en/informations.xml new file mode 100644 index 0000000..8b998f0 --- /dev/null +++ b/resources/Languages/en/informations.xml @@ -0,0 +1,29 @@ + + + <![CDATA[English language]]> + + Languages + + + + + + 1287496800 + + + + 1.4.0.4 + + en + + + + + + + + + + + \ No newline at end of file diff --git a/resources/Languages/en/translation.ts b/resources/Languages/en/translation.ts new file mode 100644 index 0000000..604c4dd --- /dev/null +++ b/resources/Languages/en/translation.ts @@ -0,0 +1,1256 @@ + + + + + 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 + + + + + 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. + + + + + 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 + + + + + + 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 + + + + diff --git a/resources/bug-128x128.png b/resources/bug-128x128.png new file mode 100644 index 0000000..1329a1c Binary files /dev/null and b/resources/bug-128x128.png differ diff --git a/resources/img-src/application-exit.svgz b/resources/img-src/application-exit.svgz new file mode 100644 index 0000000..0ffd56b Binary files /dev/null and b/resources/img-src/application-exit.svgz differ diff --git a/resources/img-src/applications-development.svgz b/resources/img-src/applications-development.svgz new file mode 100644 index 0000000..89ab237 Binary files /dev/null and b/resources/img-src/applications-development.svgz differ diff --git a/resources/img-src/arrow-down-double.svgz b/resources/img-src/arrow-down-double.svgz new file mode 100644 index 0000000..e6fa6ff Binary files /dev/null and b/resources/img-src/arrow-down-double.svgz differ diff --git a/resources/img-src/arrow-down.svgz b/resources/img-src/arrow-down.svgz new file mode 100644 index 0000000..1ea40d8 Binary files /dev/null and b/resources/img-src/arrow-down.svgz differ diff --git a/resources/img-src/arrow-up-double.svgz b/resources/img-src/arrow-up-double.svgz new file mode 100644 index 0000000..e2c774f Binary files /dev/null and b/resources/img-src/arrow-up-double.svgz differ diff --git a/resources/img-src/arrow-up.svgz b/resources/img-src/arrow-up.svgz new file mode 100644 index 0000000..9cf1426 Binary files /dev/null and b/resources/img-src/arrow-up.svgz differ diff --git a/resources/img-src/checkbox.svgz b/resources/img-src/checkbox.svgz new file mode 100644 index 0000000..688081a Binary files /dev/null and b/resources/img-src/checkbox.svgz differ diff --git a/resources/img-src/document-encrypt.svgz b/resources/img-src/document-encrypt.svgz new file mode 100644 index 0000000..55af667 Binary files /dev/null and b/resources/img-src/document-encrypt.svgz differ diff --git a/resources/img-src/document-preview.svgz b/resources/img-src/document-preview.svgz new file mode 100644 index 0000000..07fbe1c Binary files /dev/null and b/resources/img-src/document-preview.svgz differ diff --git a/resources/img-src/document-save_16.svgz b/resources/img-src/document-save_16.svgz new file mode 100644 index 0000000..bab828f Binary files /dev/null and b/resources/img-src/document-save_16.svgz differ diff --git a/resources/img-src/document-save_22.svgz b/resources/img-src/document-save_22.svgz new file mode 100644 index 0000000..e21b700 Binary files /dev/null and b/resources/img-src/document-save_22.svgz differ diff --git a/resources/img-src/drive-removable-media-usb.svgz b/resources/img-src/drive-removable-media-usb.svgz new file mode 100644 index 0000000..1a8ae23 Binary files /dev/null and b/resources/img-src/drive-removable-media-usb.svgz differ diff --git a/resources/img-src/help-about.svgz b/resources/img-src/help-about.svgz new file mode 100644 index 0000000..c00347b Binary files /dev/null and b/resources/img-src/help-about.svgz differ diff --git a/resources/img-src/kbugbuster.svgz b/resources/img-src/kbugbuster.svgz new file mode 100644 index 0000000..29ca525 Binary files /dev/null and b/resources/img-src/kbugbuster.svgz differ diff --git a/resources/img-src/list-add.svgz b/resources/img-src/list-add.svgz new file mode 100644 index 0000000..3a85a24 Binary files /dev/null and b/resources/img-src/list-add.svgz differ diff --git a/resources/img-src/media-playback-pause.svgz b/resources/img-src/media-playback-pause.svgz new file mode 100644 index 0000000..58b9113 Binary files /dev/null and b/resources/img-src/media-playback-pause.svgz differ diff --git a/resources/img-src/media-playback-start.svgz b/resources/img-src/media-playback-start.svgz new file mode 100644 index 0000000..74fb624 Binary files /dev/null and b/resources/img-src/media-playback-start.svgz differ diff --git a/resources/img-src/media-skip-forward.svgz b/resources/img-src/media-skip-forward.svgz new file mode 100644 index 0000000..1558a93 Binary files /dev/null and b/resources/img-src/media-skip-forward.svgz differ diff --git a/resources/img-src/process-stop.svgz b/resources/img-src/process-stop.svgz new file mode 100644 index 0000000..62d5706 Binary files /dev/null and b/resources/img-src/process-stop.svgz differ diff --git a/resources/img-src/system-shutdown.svgz b/resources/img-src/system-shutdown.svgz new file mode 100644 index 0000000..b4abcc2 Binary files /dev/null and b/resources/img-src/system-shutdown.svgz differ diff --git a/resources/img-src/text-formatting.svg b/resources/img-src/text-formatting.svg new file mode 100644 index 0000000..f471aa4 --- /dev/null +++ b/resources/img-src/text-formatting.svg @@ -0,0 +1,11924 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + 3 + 1 + 2 + 2 + 3 + 3 + 1 + 1 + 1 + 2 + 2 + 3 + 3 + 1 + 1 + 2 + 2 + 3 + 3 + 2 + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + s + s + s + s + s + s + s + s + + + + + + + + + + + + + + + + + + s + s + s + s + s + s + s + s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + REDO: Italic & Underlineformat-text-strikethrough.png + + diff --git a/resources/moveDown.png b/resources/moveDown.png new file mode 100644 index 0000000..82a312c Binary files /dev/null and b/resources/moveDown.png differ diff --git a/resources/moveUp.png b/resources/moveUp.png new file mode 100644 index 0000000..7f7ba72 Binary files /dev/null and b/resources/moveUp.png differ diff --git a/resources/none-128x128.png b/resources/none-128x128.png new file mode 100644 index 0000000..c2b4551 Binary files /dev/null and b/resources/none-128x128.png differ diff --git a/resources/options.png b/resources/options.png new file mode 100644 index 0000000..23ec531 Binary files /dev/null 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 new file mode 100644 index 0000000..2a471d0 --- /dev/null +++ b/resources/resources-windows.rc @@ -0,0 +1,36 @@ +#include +#include "../Variable.h" + +1 VERSIONINFO +FILEVERSION ULTRACOPIER_WINDOWS_VERSION +PRODUCTVERSION ULTRACOPIER_WINDOWS_VERSION +FILEFLAGSMASK 0x3fL +FILETYPE VFT_APP +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "ultracopier.first-world.info" + VALUE "FileVersion", ULTRACOPIER_VERSION + VALUE "FileDescription", "Ultracopier under GPL3" + VALUE "InternalName", "ultracopier.exe" + VALUE "LegalCopyright", "GPL3" + VALUE "LegalTrademarks", "Ultracopier under GPL3" + VALUE "OriginalFilename", "ultracopier.exe" + VALUE "ProductName", "Ultracopier" + VALUE "ProductVersion", ULTRACOPIER_VERSION + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409, 1252 + } +} + +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +IDI_ICON1 ICON DISCARDABLE "ultracopier-all-in-one.ico" +#else +IDI_ICON1 ICON DISCARDABLE "ultracopier.ico" +#endif + 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 new file mode 100644 index 0000000..6f5d1cf Binary files /dev/null and b/resources/systray_Caught_Unix.png differ diff --git a/resources/systray_Caught_Windows.png b/resources/systray_Caught_Windows.png new file mode 100644 index 0000000..5464856 Binary files /dev/null and b/resources/systray_Caught_Windows.png differ diff --git a/resources/systray_Semiuncaught_Unix.png b/resources/systray_Semiuncaught_Unix.png new file mode 100644 index 0000000..3961215 Binary files /dev/null and b/resources/systray_Semiuncaught_Unix.png differ diff --git a/resources/systray_Semiuncaught_Windows.png b/resources/systray_Semiuncaught_Windows.png new file mode 100644 index 0000000..45d6315 Binary files /dev/null and b/resources/systray_Semiuncaught_Windows.png differ diff --git a/resources/systray_Uncaught_Unix.png b/resources/systray_Uncaught_Unix.png new file mode 100644 index 0000000..ac4299a Binary files /dev/null and b/resources/systray_Uncaught_Unix.png differ diff --git a/resources/systray_Uncaught_Windows.png b/resources/systray_Uncaught_Windows.png new file mode 100644 index 0000000..6e6bae7 Binary files /dev/null and b/resources/systray_Uncaught_Windows.png differ diff --git a/resources/ultracopier-128x128.png b/resources/ultracopier-128x128.png new file mode 100644 index 0000000..c4547d2 Binary files /dev/null and b/resources/ultracopier-128x128.png differ diff --git a/resources/ultracopier-16x16.png b/resources/ultracopier-16x16.png new file mode 100644 index 0000000..326362b Binary files /dev/null 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.desktop b/resources/ultracopier.desktop new file mode 100644 index 0000000..bc68cb4 --- /dev/null +++ b/resources/ultracopier.desktop @@ -0,0 +1,20 @@ +[Desktop Entry] +Categories=Qt;Utility; +Comment[en_US]=Copy/Move files with lot of options +Comment=Copy/Move files with lot of options +Exec=ultracopier %u +GenericName[en_US]=Advanced copier +GenericName=Advanced copier +Icon=ultracopier.png +MimeType= +Name[en_US]=Ultracopier +Name=Ultracopier +Path= +StartupNotify=true +Terminal=false +TerminalOptions= +Type=Application +X-DBUS-ServiceName= +X-DBUS-StartupType= +X-KDE-SubstituteUID=false +X-KDE-Username= diff --git a/resources/ultracopier.icns b/resources/ultracopier.icns new file mode 100644 index 0000000..9ccd011 Binary files /dev/null and b/resources/ultracopier.icns differ diff --git a/resources/ultracopier.ico b/resources/ultracopier.ico new file mode 100644 index 0000000..1a6972a Binary files /dev/null and b/resources/ultracopier.ico differ 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/tools/doc/Doxyfile b/tools/doc/Doxyfile new file mode 100644 index 0000000..a7b5793 --- /dev/null +++ b/tools/doc/Doxyfile @@ -0,0 +1,1790 @@ +# Doxyfile 1.7.5.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = Utracopier + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = _PROJECT_NUMBER_ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Tools to do advanced file copy" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = /root/ultracopier/doc/ultracopier-logo.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = TEMP_PATH/doc/tmp + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ULTRACOPIERSOURCESPATH \ +ULTRACOPIERSOURCESPATH + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to directory from which doxygen is run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = xz_* xz.h + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/tools/doc/Doxyfile-plugin-template b/tools/doc/Doxyfile-plugin-template new file mode 100644 index 0000000..99fcccd --- /dev/null +++ b/tools/doc/Doxyfile-plugin-template @@ -0,0 +1,1789 @@ +# Doxyfile 1.7.5.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = "_ULTRACOPIER_PLUGIN_NAME_" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = _PROJECT_NUMBER_ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "_PROJECT_BRIEF_" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = /root/ultracopier/doc/ultracopier-logo.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = TEMP_PATH/doc/tmp + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ./ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to directory from which doxygen is run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = interface/* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/tools/doc/footer.html b/tools/doc/footer.html new file mode 100644 index 0000000..88105a5 --- /dev/null +++ b/tools/doc/footer.html @@ -0,0 +1,2 @@ + + diff --git a/tools/doc/ultracopier-logo.png b/tools/doc/ultracopier-logo.png new file mode 100644 index 0000000..31dcdea Binary files /dev/null and b/tools/doc/ultracopier-logo.png differ diff --git a/tools/scripts/UltraCP b/tools/scripts/UltraCP new file mode 100644 index 0000000..7dc6885 --- /dev/null +++ b/tools/scripts/UltraCP @@ -0,0 +1,28 @@ +#!/bin/bash +""" +Type: Nautilus Script +Title: UltraCP +Version: 1.0 +Info: copie des fichiers ou répertoires sélectionnés avec UltraCopier. + copy selected files and directories with UltraCopier. +Author: © Copyright (C) 2013, Airelle - http://rlwpx.free.fr/WPFF/nautilus.htm +License: GNU General Public License, version 3 or later - http://www.gnu.org/licenses/gpl.html +Usage : copier ce fichier dans le répertoire des scripts Nautilus de votre dossier personnel + (~/.gnome2/nautilus-scripts/) et vérifier que le script est exécutable (x). + Ultracopier doit être installé (http://ultracopier.first-world.info/) + copy this file to the directory of Nautilus-scripts of your home + (~/.gnome2/nautilus-scripts/) and be sure that the script is executable (x). + Ultracopier must be installed (http://ultracopier.first-world.info/) +""" + +IFS=' +' + +vers=`zenity --file-selection --directory --title="Vers..." --filename="/home/media/" --text="Choisir le dossier de destination"` + +for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS ; +do + ultracopier cp "${file}" ${vers} +done + +# EOF diff --git a/tools/scripts/UltraMV b/tools/scripts/UltraMV new file mode 100644 index 0000000..37ced70 --- /dev/null +++ b/tools/scripts/UltraMV @@ -0,0 +1,28 @@ +#!/bin/bash +""" +Type: Nautilus Script +Title: UltraMV +Version: 1.0 +Info: déplace des fichiers ou répertoires sélectionnés avec UltraCopier. + move selected files and directories with UltraCopier. +Author: © Copyright (C) 2013, Airelle - http://rlwpx.free.fr/WPFF/nautilus.htm +License: GNU General Public License, version 3 or later - http://www.gnu.org/licenses/gpl.html +Usage : copier ce fichier dans le répertoire des scripts Nautilus de votre dossier personnel + (~/.gnome2/nautilus-scripts/) et vérifier que le script est exécutable (x). + Ultracopier doit être installé (http://ultracopier.first-world.info/) + copy this file to the directory of Nautilus-scripts of your home + (~/.gnome2/nautilus-scripts/) and be sure that the script is executable (x). + Ultracopier must be installed (http://ultracopier.first-world.info/) +""" + +IFS=' +' + +vers=`zenity --file-selection --directory --title="Vers..." --filename="/home/media/" --text="Choisir le dossier de destination"` + +for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS ; +do + ultracopier mv "${file}" ${vers} +done + +# EOF diff --git a/tools/to-pack/1-pre-send.sh b/tools/to-pack/1-pre-send.sh new file mode 100755 index 0000000..960edf2 --- /dev/null +++ b/tools/to-pack/1-pre-send.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +rm -Rf ${TEMP_PATH} > /dev/null 2>&1 +rm -Rf ${ULTRACOPIERSOURCESPATH}/plugins-alternative/CopyEngine/Ultracopier/ > /dev/null 2>&1 +mkdir -p ${TEMP_PATH} +cd ../ +find ./ -name "Thumbs.db" -exec rm {} \; >> /dev/null 2>&1 +find ./ -name ".directory" -exec rm {} \; >> /dev/null 2>&1 + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Update the translation..." +source sub-script/translation.sh +cd ${BASE_PWD} +echo "Update the translation... done" + +echo "Assemble source version..." +source sub-script/assemble-source-version.sh +cd ${BASE_PWD} +echo "Assemble source version... done" + +#echo "Assemble doc version..." +#source sub-script/doc.sh +#cd ${BASE_PWD} +#echo "Assemble doc version... done" + + + diff --git a/tools/to-pack/1-update-translation.sh b/tools/to-pack/1-update-translation.sh new file mode 100755 index 0000000..daf8263 --- /dev/null +++ b/tools/to-pack/1-update-translation.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +export TEMP_PATH="/mnt/world/ultracopier-temp/" +export ULTRACOPIER_SOURCE="/home/user/Desktop/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIER_SOURCE}/Variable.h | grep -F "1.2" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Update translation..." +source sub-script/translation-local.sh +cd ${BASE_PWD} +echo "Update translation... done" + + + diff --git a/tools/to-pack/2-compil-wine32.sh b/tools/to-pack/2-compil-wine32.sh new file mode 100755 index 0000000..dad795b --- /dev/null +++ b/tools/to-pack/2-compil-wine32.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export PATH=/home/mxe/usr/bin:$PATH +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1." | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Compil windows version..." +source sub-script/compil-windows32.sh +cd ${BASE_PWD} +echo "Compil windows version... done" + + + diff --git a/tools/to-pack/2-compil-wine64.sh b/tools/to-pack/2-compil-wine64.sh new file mode 100755 index 0000000..536f343 --- /dev/null +++ b/tools/to-pack/2-compil-wine64.sh @@ -0,0 +1,38 @@ + +#!/bin/bash +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Compil windows version..." +source sub-script/compil-windows64.sh +cd ${BASE_PWD} +echo "Compil windows version... done" + + + diff --git a/tools/to-pack/2-send-sources.sh b/tools/to-pack/2-send-sources.sh new file mode 100755 index 0000000..1daced1 --- /dev/null +++ b/tools/to-pack/2-send-sources.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +cd ../../ +find ./ -name "Thumbs.db" -exec rm {} \; >> /dev/null 2>&1 +find ./ -name ".directory" -exec rm {} \; >> /dev/null 2>&1 + +echo "Send sources..." +/usr/bin/rsync -avrtz --compress-level=9 --rsh='ssh -p54973' --delete --partial --progress /home/user/Desktop/ultracopier/sources/ root@ssh.first-world.info:/root/ultracopier/sources/ --exclude='*build*' --exclude='*Qt_5*' --exclude='*qt5*' --exclude='*.pro.user' --exclude='*.qm' +echo "Send sources... done" + + + diff --git a/tools/to-pack/3-compil-mac.sh b/tools/to-pack/3-compil-mac.sh new file mode 100755 index 0000000..21fa8bf --- /dev/null +++ b/tools/to-pack/3-compil-mac.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +export TEMP_PATH="/mnt/world/ultracopier-temp/" +export ULTRACOPIER_SOURCE="/home/user/Desktop/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIER_SOURCE}/Variable.h | grep -F "1.2" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Assemble mac version..." +source sub-script/mac.sh +cd ${BASE_PWD} +echo "Assemble mac version... done" + + + diff --git a/tools/to-pack/4-clean-all.sh b/tools/to-pack/4-clean-all.sh new file mode 100755 index 0000000..40770b6 --- /dev/null +++ b/tools/to-pack/4-clean-all.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Clean the temp folder..." +source sub-script/clean-all.sh +cd ${BASE_PWD} +echo "Clean the temp folder... done" + + diff --git a/tools/to-pack/4-upload.sh b/tools/to-pack/4-upload.sh new file mode 100755 index 0000000..d908ddd --- /dev/null +++ b/tools/to-pack/4-upload.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +export TEMP_PATH="/mnt/world/ultracopier-temp/" +export ULTRACOPIER_SOURCE="/home/user/Desktop/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIER_SOURCE}/Variable.h | grep -F "1.2" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Upload version..." +source sub-script/upload-local.sh +cd ${BASE_PWD} +echo "Upload version... done" + + + + diff --git a/tools/to-pack/5-upload.sh b/tools/to-pack/5-upload.sh new file mode 100755 index 0000000..0cf5021 --- /dev/null +++ b/tools/to-pack/5-upload.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "upload..." +source sub-script/upload.sh +cd ${BASE_PWD} +echo "upload... done" + + diff --git a/tools/to-pack/6-sendmail.sh b/tools/to-pack/6-sendmail.sh new file mode 100755 index 0000000..0dc32c8 --- /dev/null +++ b/tools/to-pack/6-sendmail.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "upload..." +source sub-script/sendmail.sh +cd ${BASE_PWD} +echo "upload... done" + + diff --git a/tools/to-pack/data/windows/install-static.nsi b/tools/to-pack/data/windows/install-static.nsi new file mode 100755 index 0000000..0bfc57d --- /dev/null +++ b/tools/to-pack/data/windows/install-static.nsi @@ -0,0 +1,162 @@ +!include Library.nsh +!define LIBRARY_X64 +!define LIBRARY_SHELL_EXTENSION +!define LIBRARY_COM + +; HM NIS Edit Wizard helper defines +!define PRODUCT_NAME "Ultracopier" +!define PRODUCT_VERSION "X.X.X.X" +!define PRODUCT_PUBLISHER "Ultracopier" +!define PRODUCT_WEB_SITE "http://ultracopier.first-world.info/" +!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\ultracopier.exe" +!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" +!define PRODUCT_UNINST_ROOT_KEY "HKLM" + +RequestExecutionLevel admin + +SetCompressor /FINAL /SOLID lzma + +; MUI 1.67 compatible ------ +!include "MUI.nsh" + +; MUI Settings +!define MUI_ABORTWARNING +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" + +; Welcome page +!insertmacro MUI_PAGE_WELCOME +; License page +; !insertmacro MUI_PAGE_LICENSE "COPYING.txt" +; Directory page +!insertmacro MUI_PAGE_DIRECTORY +; Instfiles page +!insertmacro MUI_PAGE_INSTFILES +; Finish page +!define MUI_FINISHPAGE_RUN "$INSTDIR\ultracopier.exe" +!insertmacro MUI_PAGE_FINISH + +; Uninstaller pages +!insertmacro MUI_UNPAGE_INSTFILES + +; Language files +!insertmacro MUI_LANGUAGE "English" + +; Reserve files +!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + +; MUI end ------ + +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" +OutFile "setup.exe" +InstallDir "$PROGRAMFILES\Ultracopier" +InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" +ShowInstDetails show +ShowUnInstDetails show + +Section "SectionPrincipale" SEC01 + SetOutPath "$INSTDIR" + SetOverwrite on + File "ultracopier.exe" + CreateDirectory "$SMPROGRAMS\Ultracopier" + CreateShortCut "$SMPROGRAMS\Ultracopier\Ultracopier.lnk" "$INSTDIR\ultracopier.exe" + File /r /x *.nsi /x setup.exe * + !insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_PROTECTED catchcopy32.dll $INSTDIR\catchcopy32.dll $INSTDIR + !insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_PROTECTED catchcopy64.dll $INSTDIR\catchcopy64.dll $INSTDIR +SectionEnd + +Section -AdditionalIcons + CreateShortCut "$SMPROGRAMS\Ultracopier\Uninstall.lnk" "$INSTDIR\uninst.exe" +SectionEnd + +Section -Post + WriteUninstaller "$INSTDIR\uninst.exe" + WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\ultracopier.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\ultracopier.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" +SectionEnd + + +Function un.onUninstFailed + HideWindow + MessageBox MB_ICONINFORMATION|MB_OK "To remove $(^Name) from the computer, close the application and remove manualy the folder" +FunctionEnd + +Function un.onUninstSuccess + HideWindow + MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) have been uninstall from the computer." +FunctionEnd + +Function un.onInit + MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely uninstall $(^Name) and all of its components?" IDYES +2 + Abort +FunctionEnd + +Function .onInit + + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ + "UninstallString" + StrCmp $R0 "" done + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PRODUCT_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this upgrade." \ + IDOK uninst + Abort + +;Run the uninstaller +uninst: + ClearErrors + ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + + IfErrors no_remove_uninstaller done + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + no_remove_uninstaller: + +done: + +FunctionEnd + +Section Uninstall + IfFileExists "$INSTDIR\ultracopier.exe" CloseProgram + Abort "The original application $INSTDIR\ultracopier.exe is not found" + Goto NotLaunched + CloseProgram: + ExecWait '"$INSTDIR\ultracopier.exe" quit' $0 + IntCmp $0 0 NotLaunched + DetailPrint "Waiting Close..." + CloseLoop: + Sleep 200 + ExecWait '"$INSTDIR\ultracopier.exe" quit' $0 + IntCmp $0 0 NotLaunched + Goto CloseLoop + + NotLaunched: + + ExecWait 'regsvr32 /s /u "$INSTDIR\catchcopy32.dll"' + ExecWait 'regsvr32 /s /u "$INSTDIR\catchcopy64.dll"' + +; DeleteRegKey HKCU "Software\Ultracopier" +; DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "ultracopier" + Delete "$SMPROGRAMS\Ultracopier\Uninstall.lnk" + Delete "$SMPROGRAMS\Ultracopier\Ultracopier.lnk" + + Delete /REBOOTOK $SMPROGRAMS\catchcopy32.dll + Delete /REBOOTOK $SMPROGRAMS\catchcopy64.dll + Delete /REBOOTOK $INSTDIR\catchcopy32.dll + Delete /REBOOTOK $INSTDIR\catchcopy64.dll + RMDir /REBOOTOK /r "$SMPROGRAMS\Ultracopier" + RMDir /REBOOTOK /r "$INSTDIR" + + DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" + DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" + SetAutoClose true +SectionEnd diff --git a/tools/to-pack/data/windows/install.nsi b/tools/to-pack/data/windows/install.nsi new file mode 100755 index 0000000..376f762 --- /dev/null +++ b/tools/to-pack/data/windows/install.nsi @@ -0,0 +1,162 @@ +!include Library.nsh +!define LIBRARY_X64 +!define LIBRARY_SHELL_EXTENSION +!define LIBRARY_COM + +; HM NIS Edit Wizard helper defines +!define PRODUCT_NAME "Ultracopier" +!define PRODUCT_VERSION "X.X.X.X" +!define PRODUCT_PUBLISHER "Ultracopier" +!define PRODUCT_WEB_SITE "http://ultracopier.first-world.info/" +!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\ultracopier.exe" +!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" +!define PRODUCT_UNINST_ROOT_KEY "HKLM" + +RequestExecutionLevel admin + +SetCompressor /FINAL /SOLID lzma + +; MUI 1.67 compatible ------ +!include "MUI.nsh" + +; MUI Settings +!define MUI_ABORTWARNING +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" + +; Welcome page +!insertmacro MUI_PAGE_WELCOME +; License page +; !insertmacro MUI_PAGE_LICENSE "COPYING.txt" +; Directory page +!insertmacro MUI_PAGE_DIRECTORY +; Instfiles page +!insertmacro MUI_PAGE_INSTFILES +; Finish page +!define MUI_FINISHPAGE_RUN "$INSTDIR\ultracopier.exe" +!insertmacro MUI_PAGE_FINISH + +; Uninstaller pages +!insertmacro MUI_UNPAGE_INSTFILES + +; Language files +!insertmacro MUI_LANGUAGE "English" + +; Reserve files +!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + +; MUI end ------ + +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" +OutFile "setup.exe" +InstallDir "$PROGRAMFILES\Ultracopier" +InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" +ShowInstDetails show +ShowUnInstDetails show + +Section "SectionPrincipale" SEC01 + SetOutPath "$INSTDIR" + SetOverwrite on + File "ultracopier.exe" + CreateDirectory "$SMPROGRAMS\Ultracopier" + CreateShortCut "$SMPROGRAMS\Ultracopier\Ultracopier.lnk" "$INSTDIR\ultracopier.exe" + File /r /x *.nsi /x setup.exe * + !insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_PROTECTED PluginLoader\catchcopy-v0002\catchcopy32.dll $INSTDIR\PluginLoader\catchcopy-v0002\catchcopy32.dll $INSTDIR + !insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_PROTECTED PluginLoader\catchcopy-v0002\catchcopy64.dll $INSTDIR\PluginLoader\catchcopy-v0002\catchcopy64.dll $INSTDIR +SectionEnd + +Section -AdditionalIcons + CreateShortCut "$SMPROGRAMS\Ultracopier\Uninstall.lnk" "$INSTDIR\uninst.exe" +SectionEnd + +Section -Post + WriteUninstaller "$INSTDIR\uninst.exe" + WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\ultracopier.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\ultracopier.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" +SectionEnd + + +Function un.onUninstFailed + HideWindow + MessageBox MB_ICONINFORMATION|MB_OK "To remove $(^Name) from the computer, close the application and remove manualy the folder" +FunctionEnd + +Function un.onUninstSuccess + HideWindow + MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) have been uninstall from the computer." +FunctionEnd + +Function un.onInit + MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely uninstall $(^Name) and all of its components?" IDYES +2 + Abort +FunctionEnd + +Function .onInit + + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ + "UninstallString" + StrCmp $R0 "" done + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PRODUCT_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this upgrade." \ + IDOK uninst + Abort + +;Run the uninstaller +uninst: + ClearErrors + ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + + IfErrors no_remove_uninstaller done + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + no_remove_uninstaller: + +done: + +FunctionEnd + +Section Uninstall + IfFileExists "$INSTDIR\ultracopier.exe" CloseProgram + Abort "The original application $INSTDIR\ultracopier.exe is not found" + Goto NotLaunched + CloseProgram: + ExecWait '"$INSTDIR\ultracopier.exe" quit' $0 + IntCmp $0 0 NotLaunched + DetailPrint "Waiting Close..." + CloseLoop: + Sleep 200 + ExecWait '"$INSTDIR\ultracopier.exe" quit' $0 + IntCmp $0 0 NotLaunched + Goto CloseLoop + + NotLaunched: + + ExecWait 'regsvr32 /s /u "$INSTDIR\PluginLoader\catchcopy-v0002\catchcopy32.dll"' + ExecWait 'regsvr32 /s /u "$INSTDIR\PluginLoader\catchcopy-v0002\catchcopy64.dll"' + +; DeleteRegKey HKCU "Software\Ultracopier" + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "ultracopier" + Delete "$SMPROGRAMS\Ultracopier\Uninstall.lnk" + Delete "$SMPROGRAMS\Ultracopier\Ultracopier.lnk" + + Delete /REBOOTOK $SMPROGRAMS\PluginLoader\catchcopy-v0002\catchcopy32.dll + Delete /REBOOTOK $SMPROGRAMS\PluginLoader\catchcopy-v0002\catchcopy64.dll + Delete /REBOOTOK $INSTDIR\PluginLoader\catchcopy-v0002\catchcopy32.dll + Delete /REBOOTOK $INSTDIR\PluginLoader\catchcopy-v0002\catchcopy64.dll + RMDir /REBOOTOK /r "$SMPROGRAMS\Ultracopier" + RMDir /REBOOTOK /r "$INSTDIR" + + DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" + DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" + SetAutoClose true +SectionEnd diff --git a/tools/to-pack/data/windows/resources-windows-ultracopier-plugins.rc b/tools/to-pack/data/windows/resources-windows-ultracopier-plugins.rc new file mode 100644 index 0000000..6a9c2fa --- /dev/null +++ b/tools/to-pack/data/windows/resources-windows-ultracopier-plugins.rc @@ -0,0 +1,27 @@ +#include + +1 VERSIONINFO +FILEVERSION ULTRACOPIER_PLUGIN_WINDOWS_VERSION +PRODUCTVERSION ULTRACOPIER_PLUGIN_WINDOWS_VERSION +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "ultracopier.first-world.info" + VALUE "FileVersion", "ULTRACOPIER_PLUGIN_VERSION" + VALUE "FileDescription", "ULTRACOPIER_PLUGIN_NAME for Ultracopier under GPL3" + VALUE "InternalName", "ULTRACOPIER_PLUGIN_FILENAME" + VALUE "LegalCopyright", "GPL3" + VALUE "LegalTrademarks", "ULTRACOPIER_PLUGIN_NAME for Ultracopier under GPL3" + VALUE "OriginalFilename", "ULTRACOPIER_PLUGIN_FILENAME" + VALUE "ProductName", "ULTRACOPIER_PLUGIN_NAME for Ultracopier" + VALUE "ProductVersion", "ULTRACOPIER_PLUGIN_VERSION" + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409, 1252 + } +} + diff --git a/tools/to-pack/data/windows/ultracopier.ico b/tools/to-pack/data/windows/ultracopier.ico new file mode 100755 index 0000000..1a6972a Binary files /dev/null and b/tools/to-pack/data/windows/ultracopier.ico differ diff --git a/tools/to-pack/grouped.sh b/tools/to-pack/grouped.sh new file mode 100755 index 0000000..36936d9 --- /dev/null +++ b/tools/to-pack/grouped.sh @@ -0,0 +1,12 @@ +#!/bin/bash +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + +./1-pre-send.sh +./2-compil-wine32.sh +#./2-compil-wine64.sh +./4-clean-all.sh +#mv /home/ultracopier-temp/ultracopier-*.* /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +#mv /home/ultracopier-temp/supercopier-*.* /home/first-world.info/files-rw/supercopier/${ULTRACOPIER_VERSION}/ +#rsync -avrt /home/ultracopier-temp/plugins/ /home/first-world.info/files-rw/ultracopier/plugins/ +#rm -Rf /home/ultracopier-temp/plugins/ diff --git a/tools/to-pack/old-3-compil-linux.sh b/tools/to-pack/old-3-compil-linux.sh new file mode 100755 index 0000000..8796fc4 --- /dev/null +++ b/tools/to-pack/old-3-compil-linux.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +export TEMP_PATH="/mnt/world/ultracopier-temp/" +export ULTRACOPIER_SOURCE="/home/user/Desktop/ultracopier/sources/" +export BASE_PWD=`pwd` + +cd ${BASE_PWD} + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIER_SOURCE}/Variable.h | grep -F "1.2" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +echo "Assemble linux version..." +source sub-script/linux.sh +cd ${BASE_PWD} +echo "Assemble linux version... done" + + + diff --git a/tools/to-pack/sub-script/assemble-source-version.sh b/tools/to-pack/sub-script/assemble-source-version.sh new file mode 100755 index 0000000..f00516e --- /dev/null +++ b/tools/to-pack/sub-script/assemble-source-version.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +cd ${TEMP_PATH}/ + +FINAL_ARCHIVE="ultracopier-src-${ULTRACOPIER_VERSION}.tar.xz" +if [ ! -e ${FINAL_ARCHIVE} ]; then + rm -Rf ${TEMP_PATH}/ultracopier-src/ + cp -aRf ${ULTRACOPIERSOURCESPATH}/ ${TEMP_PATH}/ultracopier-src/ + find ${TEMP_PATH}/ultracopier-src/ -name "*.pro.user" -exec rm {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "*-build-desktop" -type d -exec rm -Rf {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "*-build-desktop*" -type d -exec rm -Rf {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "*Qt_in_*" -type d -exec rm -Rf {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "informations.xml" -exec sed -i "s/linux-x86_64-pc/windows-x86/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_DEBUG/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLE/\/\/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -iname "*.qm" -exec rm {} \; > /dev/null 2>&1 + + tar cJf ${FINAL_ARCHIVE} ultracopier-src/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar + if [ ! -e ${FINAL_ARCHIVE} ]; then + echo "${FINAL_ARCHIVE} not exists!"; + exit; + fi +fi + +if [ -d ${TEMP_PATH}/ultracopier-src/plugins/ ] +then + cd ${TEMP_PATH}/ultracopier-src/plugins/ + find ${TEMP_PATH}/ultracopier-src/plugins/ -iname "*.qm" -exec rm {} \; + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] && [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + echo "do source package for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + find ${TEMP_PATH}/ultracopier-src/ -iname "*.h" -exec sed -i "s/..\/..\/..\/interface\//interface\//g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -iname "*.pro" -exec sed -i "s/..\/..\/..\/interface\//interface\//g" {} \; > /dev/null 2>&1 + rsync -art ${TEMP_PATH}/ultracopier-src/interface/ ${plugins_name}/interface/ > /dev/null 2>&1 + FILE="StructEnumDefinition.h" + if [ -e ${plugins_name}/${FILE} ] + then + rm -f ${plugins_name}/${FILE} + cp ${TEMP_PATH}/ultracopier-src/${FILE} ${plugins_name}/${FILE} + fi + FILE="CompilerInfo.h" + if [ -e ${plugins_name}/${FILE} ] + then + rm -f ${plugins_name}/${FILE} + cp ${TEMP_PATH}/ultracopier-src/${FILE} ${plugins_name}/${FILE} + fi + FILE="PlatformMacro.h" + if [ -e ${plugins_name}/${FILE} ] + then + rm -f ${plugins_name}/${FILE} + cp ${TEMP_PATH}/ultracopier-src/${FILE} ${plugins_name}/${FILE} + fi + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-src.tar.xz + fi + done + cd ${TEMP_PATH}/ultracopier-src/plugins/ + fi + done + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/ + find ${TEMP_PATH}/ultracopier-src/plugins-alternative/ -iname "*.qm" -exec rm {} \; + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] && [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + echo "do source package for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + find ${TEMP_PATH}/ultracopier-src/ -iname "*.h" -exec sed -i "s/..\/..\/..\/interface\//interface\//g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/ultracopier-src/ -iname "*.pro" -exec sed -i "s/..\/..\/..\/interface\//interface\//g" {} \; > /dev/null 2>&1 + rsync -art ${TEMP_PATH}/ultracopier-src/interface/ ${plugins_name}/interface/ > /dev/null 2>&1 + FILE="StructEnumDefinition.h" + if [ -e ${plugins_name}/${FILE} ] + then + rm -f ${plugins_name}/${FILE} + cp ${TEMP_PATH}/ultracopier-src/${FILE} ${plugins_name}/${FILE} + fi + FILE="CompilerInfo.h" + if [ -e ${plugins_name}/${FILE} ] + then + rm -f ${plugins_name}/${FILE} + cp ${TEMP_PATH}/ultracopier-src/${FILE} ${plugins_name}/${FILE} + fi + FILE="PlatformMacro.h" + if [ -e ${plugins_name}/${FILE} ] + then + rm -f ${plugins_name}/${FILE} + cp ${TEMP_PATH}/ultracopier-src/${FILE} ${plugins_name}/${FILE} + fi + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-src.tar.xz + fi + done + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/ + fi + done + cd ${TEMP_PATH}/ultracopier-src/plugins/Languages/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] + then + mkdir -p ${TEMP_PATH}/plugins/Languages/${plugins_name}/ + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 > ${TEMP_PATH}/plugins/Languages/${plugins_name}/Languages-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-src.tar.xz + fi + done +fi diff --git a/tools/to-pack/sub-script/assemble-windows-version-32.sh b/tools/to-pack/sub-script/assemble-windows-version-32.sh new file mode 100644 index 0000000..20f8899 --- /dev/null +++ b/tools/to-pack/sub-script/assemble-windows-version-32.sh @@ -0,0 +1,153 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +cd ${TEMP_PATH}/ + +ARCHITECTURE="x86" + +COMPIL_DEBUGREAL=1 +COMPIL_NORMAL=1 +COMPIL_PLUGIN=1 +COMPIL_ULTIMATE=1 + +source ${BASE_PWD}/sub-script/assemble.sh + +if [ ${COMPIL_DEBUGREAL} -eq 1 ] +then + assemble "ultracopier-debug-real" "${ARCHITECTURE}" 1 1 0 0 0 +fi + +if [ ${COMPIL_NORMAL} -eq 1 ] +then + assemble "ultracopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 + assemble "ultracopier-debug-portable" "${ARCHITECTURE}" 1 0 1 0 0 + assemble "ultracopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 + assemble "ultracopier-portableapps" "${ARCHITECTURE}" 0 0 1 0 0 + assemble "ultracopier" "${ARCHITECTURE}" 0 0 0 0 0 + + assemble "ultracopier-debug-static" "${ARCHITECTURE}" 1 0 0 0 1 + assemble "ultracopier-debug-portable-static" "${ARCHITECTURE}" 1 0 1 0 1 + assemble "ultracopier-portable-static" "${ARCHITECTURE}" 0 0 1 0 1 + assemble "ultracopier-static" "${ARCHITECTURE}" 0 0 0 0 1 +fi + +if [ ${COMPIL_ULTIMATE} -eq 1 ] +then + assemble "ultracopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-sse2" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-sse3" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-pentium3" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-pentium4" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-core2" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-core-i" "${ARCHITECTURE}" 0 0 0 1 0 + + assemble "ultracopier-ultimate-k8" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-barcelona" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-bobcat" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-llano" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-bulldozer" "${ARCHITECTURE}" 0 0 0 1 0 +fi + +if [ ${COMPIL_PLUGIN} -eq 1 ] +then + +TARGET="ultracopier" +find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86<\/architecture>/g" {} \; > /dev/null 2>&1 +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +done +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +done + + +TARGET="ultracopier-debug" +find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86<\/architecture>/g" {} \; > /dev/null 2>&1 +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +done +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +done + +fi diff --git a/tools/to-pack/sub-script/assemble-windows-version-64.sh b/tools/to-pack/sub-script/assemble-windows-version-64.sh new file mode 100644 index 0000000..a158b83 --- /dev/null +++ b/tools/to-pack/sub-script/assemble-windows-version-64.sh @@ -0,0 +1,149 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +cd ${TEMP_PATH}/ + +COMPIL_DEBUGREAL=1 +COMPIL_NORMAL=1 +COMPIL_PLUGIN=1 +COMPIL_ULTIMATE=1 + +ARCHITECTURE="x86_64" + +source ${BASE_PWD}/sub-script/assemble.sh + +if [ ${COMPIL_DEBUGREAL} -eq 1 ] +then + assemble "ultracopier-debug-real" "${ARCHITECTURE}" 1 1 0 0 0 +fi +if [ ${COMPIL_NORMAL} -eq 1 ] +then + assemble "ultracopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 + assemble "ultracopier-debug-portable" "${ARCHITECTURE}" 1 0 1 0 0 + assemble "ultracopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 + assemble "ultracopier" "${ARCHITECTURE}" 0 0 0 0 0 + + assemble "ultracopier-debug-static" "${ARCHITECTURE}" 1 0 0 0 1 + assemble "ultracopier-debug-portable-static" "${ARCHITECTURE}" 1 0 1 0 1 + assemble "ultracopier-portable-static" "${ARCHITECTURE}" 0 0 1 0 1 + assemble "ultracopier-static" "${ARCHITECTURE}" 0 0 0 0 1 +fi + +if [ ${COMPIL_ULTIMATE} -eq 1 ] +then + assemble "ultracopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-sse2" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-sse3" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-core2" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-core-i" "${ARCHITECTURE}" 0 0 0 1 0 + + assemble "ultracopier-ultimate-k8" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-barcelona" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-bobcat" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-llano" "${ARCHITECTURE}" 0 0 0 1 0 + assemble "ultracopier-ultimate-bulldozer" "${ARCHITECTURE}" 0 0 0 1 0 +fi + +if [ ${COMPIL_PLUGIN} -eq 1 ] +then + +TARGET="ultracopier" +find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86_64<\/architecture>/g" {} \; > /dev/null 2>&1 +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +done +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +done + + +TARGET="ultracopier-debug" +find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86_64<\/architecture>/g" {} \; > /dev/null 2>&1 +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ +done +cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +for plugins_cat in `ls -1` +do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ +done + +fi diff --git a/tools/to-pack/sub-script/assemble.sh b/tools/to-pack/sub-script/assemble.sh new file mode 100644 index 0000000..8b344e9 --- /dev/null +++ b/tools/to-pack/sub-script/assemble.sh @@ -0,0 +1,219 @@ +#!/bin/bash + +function assemble { + TARGET=$1 + ARCHITECTURE=$2 + DEBUG=$3 + DEBUG_REAL=$4 + PORTABLE=$5 + ULTIMATE=$6 + STATIC=${7} + CGMINER=${8} + SUPERCOPIER=${9} + ULTRACOPIER_VERSION_FINAL=${ULTRACOPIER_VERSION} + DEBUGANDSETUP=0 + cd ${TEMP_PATH}/ + if [ ${DEBUG_REAL} -eq 1 ] + then + FINAL_ARCHIVE="${TARGET}-windows-${ARCHITECTURE}-${ULTRACOPIER_VERSION_FINAL}.7z" + else + FINAL_ARCHIVE="${TARGET}-windows-${ARCHITECTURE}-${ULTRACOPIER_VERSION_FINAL}.zip" + fi + if [ ! -d ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ ] + then + echo "no previous compilation folder found into ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/..." + exit + fi + if [ ! -e ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/*.exe ] + then + echo "no application found into ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/..." + exit + fi + if [ ! -e ${FINAL_ARCHIVE} ]; then + echo "creating the archive ${TARGET}..." + if [ ${STATIC} -ne 1 ] + then + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/CopyEngine/Ultracopier/ + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Listener/catchcopy-v0002/ + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/PluginLoader/catchcopy-v0002/ + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/SessionLoader/Windows/ + if [ $SUPERCOPIER -eq 1 ] + then + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Themes/Supercopier/ + else + mkdir -p ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Themes/Oxygen/ + fi + + if [ -e ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/ ] + then + if [ ${ULTIMATE} -eq 1 ] + then + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins-alternative/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + else + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + fi + fi + + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/Languages/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ + rsync -aqrt ${ULTRACOPIERSOURCESPATH}/plugins/Languages/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ --exclude=*.xml --exclude=*.qm + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/CopyEngine/Ultracopier/Languages/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/CopyEngine/Ultracopier/Languages/ + if [ $SUPERCOPIER -eq 1 ] + then + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins-alternative/Themes/Supercopier/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Themes/Supercopier/ + else + rsync -aqrt ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/Themes/Oxygen/Languages/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Themes/Oxygen/Languages/ + fi + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -iname "*.a" -exec rm {} \; > /dev/null 2>&1 + rm -Rf ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/plugins-alternative/ + else + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -mindepth 1 -type d -exec rm -Rf {} \; + fi + if [ ${CGMINER} -eq 1 ] + then + if [ "${ARCHITECTURE}" != "x86" ] + then + rsync -aqrt ${BASE_PWD}/data/windows/miner-win64/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/addon/ + else + rsync -aqrt ${BASE_PWD}/data/windows/miner-win32/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/addon/ + fi + fi + cp -Rf ${ULTRACOPIERSOURCESPATH}/README ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/README.txt + cp -Rf ${ULTRACOPIERSOURCESPATH}/COPYING ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/COPYING.txt + if [ $SUPERCOPIER -eq 1 ] + then + sed -i "s/Ultracopier /Supercopier /g" ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/README.txt + fi + if [ 1 == 2 ] + then + if [ "${ARCHITECTURE}" == "x86" ] && [ ${DEBUG_REAL} -ne 1 ] + then + if [ $SUPERCOPIER -eq 1 ] + then + upx --lzma -9 ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/supercopier.exe > /dev/null 2>&1 + else + upx --lzma -9 ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ultracopier.exe > /dev/null 2>&1 + fi + fi + fi + cp -Rf ${BASE_PWD}/data/windows-${ARCHITECTURE}/dll-qt-debug/lib* ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + if [ ${STATIC} -ne 1 ] + then + if [ ${DEBUG_REAL} -eq 1 ] + then + cp -Rf ${BASE_PWD}/data/windows-${ARCHITECTURE}/dll-qt-debug/* ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + else + cp -Rf ${BASE_PWD}/data/windows-${ARCHITECTURE}/dll-qt/* ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + fi + fi + if [ ${DEBUG} -eq 1 ] + then + CATCHCOPY_SUFIX="d" + else + CATCHCOPY_SUFIX="" + fi + if [ ${STATIC} -eq 1 ] + then + cp -Rf ${BASE_PWD}/data/windows/catchcopy32${CATCHCOPY_SUFIX}.dll ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/catchcopy32${CATCHCOPY_SUFIX}.dll + cp -Rf ${BASE_PWD}/data/windows/catchcopy64${CATCHCOPY_SUFIX}.dll ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/catchcopy64${CATCHCOPY_SUFIX}.dll + else + cp -Rf ${BASE_PWD}/data/windows/catchcopy32${CATCHCOPY_SUFIX}.dll ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/PluginLoader/catchcopy-v0002/catchcopy32${CATCHCOPY_SUFIX}.dll + cp -Rf ${BASE_PWD}/data/windows/catchcopy64${CATCHCOPY_SUFIX}.dll ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/PluginLoader/catchcopy-v0002/catchcopy64${CATCHCOPY_SUFIX}.dll + fi + if [ ${STATIC} -ne 1 ] + then + cp -f ${BASE_PWD}/data/qm-translation/fr.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/fr/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/ar.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ar/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/es.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/es/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/ja.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ja/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/ko.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ko/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/pl.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/pl/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/pt.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/pt/qt.qm + cp -f ${BASE_PWD}/data/qm-translation/ru.qm ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Languages/ru/qt.qm + fi + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -iname "*.ts" -exec rm {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-${ARCHITECTURE}<\/architecture>/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION_FINAL}<\/version>/g" {} \; > /dev/null 2>&1 + + rm -Rf ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/SessionLoader/KDE4/ + rm -Rf ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/Listener/dbus/ + if [ ${PORTABLE} -eq 1 ] + then + rm -Rf ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/SessionLoader/ + fi + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -type d -empty -delete > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -type d -empty -delete > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ -type d -empty -delete > /dev/null 2>&1 + + if [ ${DEBUG_REAL} -eq 1 ] + then + mkdir ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ultracopier/ + mv ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/* ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ultracopier/ + mv ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ultracopier/ultracopier-debug.bat ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ + cp -Rf /home/wine/qt-5.0-32Bits-for-ultracopier/drive_c/mingw32/ ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/mingw32/ + fi + + find ${TARGET}-windows-${ARCHITECTURE}/ -type d -exec chmod 700 "{}" \; + find ${TARGET}-windows-${ARCHITECTURE}/ -type f -exec chmod 600 "{}" \; + chown -Rf root.root ${TARGET}-windows-${ARCHITECTURE}/ + find ${TARGET}-windows-${ARCHITECTURE}/ -type f -exec touch -t 201601020000.00 "{}" \; + find ${TARGET}-windows-${ARCHITECTURE}/ -type d -exec touch -t 201601020000.00 "{}" \; + if [ ${DEBUG_REAL} -eq 1 ] + then + 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on ${FINAL_ARCHIVE} ${TARGET}-windows-${ARCHITECTURE}/ + else + zip -r -q -9 ${FINAL_ARCHIVE} ${TARGET}-windows-${ARCHITECTURE}/ + fi + #7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on ${FINAL_ARCHIVE} ${TARGET}-windows-${ARCHITECTURE}/ + #nice -n 15 ionice -c 3 tar cf - ${TARGET}-windows-${ARCHITECTURE}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | nice -n 15 ionice -c 3 xz -z -9 -e > ${FINAL_ARCHIVE} + if [ ! -e ${FINAL_ARCHIVE} ]; then + echo "${FINAL_ARCHIVE} not exists!"; + exit; + fi + echo "creating the archive ${TARGET}... done" + fi + FINAL_ARCHIVE="${TARGET}-windows-${ARCHITECTURE}-${ULTRACOPIER_VERSION_FINAL}-setup.exe" + if ( [ ${DEBUG} -eq 0 ] || [ ${DEBUGANDSETUP} -eq 1 ] ) && [ ${PORTABLE} -eq 0 ] && [ ! -e ${FINAL_ARCHIVE} ]; then + echo "creating the installer ${TARGET}..." + cd ${TEMP_PATH}/ + rm -Rf ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + mkdir -p ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + cd ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + if [ ${STATIC} -eq 1 ] + then + cp -aRf ${BASE_PWD}/data/windows/install-static.nsi ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + else + cp -aRf ${BASE_PWD}/data/windows/install.nsi ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + fi + #cp -aRf ${BASE_PWD}/data/windows/ultracopier.ico ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + rsync -art ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + cd ${TEMP_PATH}/Ultracopier-installer-windows-${ARCHITECTURE}/ + sed -i -r "s/X.X.X.X/${ULTRACOPIER_VERSION_FINAL}/g" *.nsi > /dev/null 2>&1 + if [ "${ARCHITECTURE}" != "x86" ] + then + sed -i -r "s/PROGRAMFILES/PROGRAMFILES64/g" *.nsi > /dev/null 2>&1 + fi + if [ $SUPERCOPIER -eq 1 ] + then + sed -i -r "s/Ultracopier/Supercopier/g" *.nsi > /dev/null 2>&1 + sed -i -r "s/ultracopier/supercopier/g" *.nsi > /dev/null 2>&1 + fi + if [ ${DEBUG} -eq 1 ] + then + sed -i -r "s/catchcopy32.dll/catchcopy32d.dll/g" *.nsi > /dev/null 2>&1 + sed -i -r "s/catchcopy64.dll/catchcopy64d.dll/g" *.nsi > /dev/null 2>&1 + fi + DISPLAY="na" WINEPREFIX="${WINEBASEPATH}/ultracopier-general/" /usr/bin/nice -n 15 /usr/bin/ionice -c 3 wine "${WINEBASEPATH}/ultracopier-general/drive_c/Program Files (x86)/NSIS/makensis.exe" *.nsi > /dev/null 2>&1 + if [ ! -e *setup.exe ]; then + echo "${TEMP_PATH}/${FINAL_ARCHIVE} not exists!"; + pwd + exit; + fi + mv *setup.exe ${TEMP_PATH}/${FINAL_ARCHIVE} + cd ${TEMP_PATH}/ + echo "creating the installer ${TARGET}... done" + fi + rm -Rf ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}/ +} + diff --git a/tools/to-pack/sub-script/clean-all.sh b/tools/to-pack/sub-script/clean-all.sh new file mode 100755 index 0000000..83e8333 --- /dev/null +++ b/tools/to-pack/sub-script/clean-all.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +cd ${TEMP_PATH}/ +for folder in `ls -1` +do + if [ -d "${folder}" ] && [ "${folder}" != "plugins" ] && [ "${folder}" != "doc" ] + then + rm -Rf ${folder}/ + fi +done + diff --git a/tools/to-pack/sub-script/compil-windows32.sh b/tools/to-pack/sub-script/compil-windows32.sh new file mode 100644 index 0000000..ce1ce01 --- /dev/null +++ b/tools/to-pack/sub-script/compil-windows32.sh @@ -0,0 +1,211 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +ARCHITECTURE="x86" + +COMPIL_DEBUGREAL=0 +COMPIL_NORMAL=1 +COMPIL_PLUGIN=0 +COMPIL_ULTIMATE=1 + +cd ${TEMP_PATH}/ + +source ${BASE_PWD}/sub-script/compil.sh +source ${BASE_PWD}/sub-script/assemble.sh + +if [ ${COMPIL_DEBUGREAL} -eq 1 ] +then + compil "ultracopier-debug-real-windows-x86" 1 1 0 0 32 "-g -mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier-debug-real" "${ARCHITECTURE}" 1 1 0 0 0 0 0 +fi + +if [ ${COMPIL_NORMAL} -eq 1 ] +then + #compil "supercopier-debug-windows-x86" 1 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 1 0 + #assemble "supercopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 0 1 + compil "supercopier-portable-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 0 0 0 0 1 0 + assemble "supercopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 0 1 + compil "supercopier-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 1 0 + assemble "supercopier" "${ARCHITECTURE}" 0 0 0 0 0 0 1 + + compil "ultracopier-debug-windows-x86" 1 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 0 0 + #compil "ultracopier-debug-portable-windows-x86" 1 0 1 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + #assemble "ultracopier-debug-portable" "${ARCHITECTURE}" 1 0 1 0 0 0 0 + compil "ultracopier-portable-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 0 0 + #compil "ultracopier-portableapps-windows-x86" 0 0 1 1 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + #assemble "ultracopier-portableapps" "${ARCHITECTURE}" 0 0 1 0 0 0 0 + compil "ultracopier-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier" "${ARCHITECTURE}" 0 0 0 0 0 0 0 + #compil "ultracopier-debug-static-windows-x86" 1 0 0 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-debug-static" "${ARCHITECTURE}" 1 0 0 0 1 0 0 + #compil "ultracopier-debug-portable-static-windows-x86" 1 0 1 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-debug-portable-static" "${ARCHITECTURE}" 1 0 1 0 1 0 0 + #compil "ultracopier-portable-static-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-portable-static" "${ARCHITECTURE}" 0 0 1 0 1 0 0 + #compil "ultracopier-static-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-static" "${ARCHITECTURE}" 0 0 0 0 1 0 0 +fi + +if [ ${COMPIL_ULTIMATE} -eq 1 ] +then + compil "supercopier-ultimate-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 0 1 0 + assemble "supercopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-cgminer-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 1 1 0 + assemble "supercopier-ultimate-cgminer" "${ARCHITECTURE}" 0 0 0 1 0 1 1 + #compil "supercopier-ultimate-cgminer-static-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 1 1 1 0 + #assemble "supercopier-ultimate-cgminer-static" "${ARCHITECTURE}" 0 0 0 1 1 1 1 + + compil "supercopier-ultimate-portable-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 1 0 0 0 1 0 + assemble "supercopier-ultimate-portable" "${ARCHITECTURE}" 0 0 1 1 0 0 1 + compil "ultracopier-ultimate-portable-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-portable" "${ARCHITECTURE}" 0 0 1 1 0 0 0 + + compil "ultracopier-ultimate-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 0 0 0 + assemble "ultracopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + compil "ultracopier-ultimate-cgminer-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 1 0 0 + assemble "ultracopier-ultimate-cgminer" "${ARCHITECTURE}" 0 0 0 1 0 1 0 + #compil "ultracopier-debug-ultimate-cgminer-windows-x86" 1 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 1 0 0 + #assemble "ultracopier-debug-ultimate-cgminer" "${ARCHITECTURE}" 1 0 0 1 0 1 0 + #compil "ultracopier-ultimate-sse2-windows-x86" 0 0 0 0 32 "-msse -msse2" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-sse2" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-sse3-windows-x86" 0 0 0 0 32 "-msse -msse2 -msse3" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-sse3" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-pentium3-windows-x86" 0 0 0 0 32 "-msse -march=pentium3" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-pentium3" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-pentium4-windows-x86" 0 0 0 0 32 "-msse -march=pentium4" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-pentium4" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + + compil "ultracopier-ultimate-core2-windows-x86" 0 0 0 0 32 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-core2" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + compil "ultracopier-ultimate-core-i-windows-x86" 0 0 0 0 32 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-core-i" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + compil "ultracopier-ultimate-k8-windows-x86" 0 0 0 0 32 "-msse -msse2 -march=k8" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-k8" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + + compil "supercopier-ultimate-core2-windows-x86" 0 0 0 0 32 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 1 0 + assemble "supercopier-ultimate-core2" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-core-i-windows-x86" 0 0 0 0 32 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 1 0 + assemble "supercopier-ultimate-core-i" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-k8-windows-x86" 0 0 0 0 32 "-msse -msse2 -march=k8" 1 0 0 0 1 0 + assemble "supercopier-ultimate-k8" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + + #compil "ultracopier-ultimate-barcelona-windows-x86" 0 0 0 0 32 "-msse -msse2 -march=k8" 1 0 0 0 0 + #assemble "ultracopier-ultimate-barcelona" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-bobcat-windows-x86" 0 0 0 0 32 "-march=amdfam10 -mno-3dnow -mcx16 -mpopcnt -mssse3 -mmmx" 1 0 0 0 0 + #assemble "ultracopier-ultimate-bobcat" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-llano-windows-x86" 0 0 0 0 32 "-march=amdfam10 -mcx16 -mpopcnt" 1 0 0 0 0 + #assemble "ultracopier-ultimate-llano" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-bulldozer-windows-x86" 0 0 0 0 32 "-march=amdfam10 -mcx16 -msahf -maes -mpclmul -mpopcnt -mabm" 1 0 0 0 0 + #assemble "ultracopier-ultimate-bulldozer" "${ARCHITECTURE}" 0 0 0 1 0 0 0 +fi + +if [ ${COMPIL_PLUGIN} -eq 1 ] +then + compil "ultracopier-windows-x86-for-plugins" 0 0 0 0 32 "-mtune=generic -march=i686" 0 1 0 0 0 + #compil "ultracopier-debug-windows-x86-for-plugins" 1 0 0 0 32 "-mtune=generic -march=i686" 0 1 0 0 0 + TARGET="ultracopier" + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86<\/architecture>/g" {} \; > /dev/null 2>&1 + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + done + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + done + + + TARGET="ultracopier-debug" + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86<\/architecture>/g" {} \; > /dev/null 2>&1 + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + done + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + done + +fi diff --git a/tools/to-pack/sub-script/compil-windows64.sh b/tools/to-pack/sub-script/compil-windows64.sh new file mode 100644 index 0000000..ec5e60e --- /dev/null +++ b/tools/to-pack/sub-script/compil-windows64.sh @@ -0,0 +1,200 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +COMPIL_DEBUGREAL=0 +COMPIL_NORMAL=1 +COMPIL_PLUGIN=1 +COMPIL_ULTIMATE=1 + +ARCHITECTURE="x86_64" + +cd ${TEMP_PATH}/ + +source ${BASE_PWD}/sub-script/compil.sh +source ${BASE_PWD}/sub-script/assemble.sh + + +if [ ${COMPIL_DEBUGREAL} -eq 1 ] +then + compil "ultracopier-debug-real-windows-x86_64" 1 1 0 0 64 "-mtune=generic -march=nocona" 0 0 0 0 0 0 + assemble "ultracopier-debug-real" "${ARCHITECTURE}" 1 1 0 0 0 0 0 +fi +if [ ${COMPIL_NORMAL} -eq 1 ] +then + #compil "supercopier-debug-windows-x86_64" 1 0 0 0 64 "-mtune=generic -march=nocona" 0 0 0 0 1 0 + #assemble "supercopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 0 1 + #compil "supercopier-portable-windows-x86_64" 0 0 1 0 64 "-mtune=generic -march=nocona" 0 0 0 0 1 0 + #assemble "supercopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 0 1 + compil "supercopier-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 0 0 0 0 1 0 + assemble "supercopier" "${ARCHITECTURE}" 0 0 0 0 0 0 1 + + #compil "ultracopier-debug-windows-x86_64" 1 0 0 0 64 "-mtune=generic -march=nocona" 0 0 0 0 0 0 + #assemble "ultracopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 0 0 + #compil "ultracopier-debug-portable-windows-x86_64" 1 0 1 0 64 "-mtune=generic -march=nocona" 0 0 0 0 0 0 + #assemble "ultracopier-debug-portable" "${ARCHITECTURE}" 1 0 1 0 0 0 0 + #compil "ultracopier-portable-windows-x86_64" 0 0 1 0 64 "-mtune=generic -march=nocona" 0 0 0 0 0 0 + #assemble "ultracopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 0 0 + compil "ultracopier-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 0 0 0 0 0 0 + assemble "ultracopier" "${ARCHITECTURE}" 0 0 0 0 0 0 0 + #compil "ultracopier-debug-static-windows-x86_64" 1 0 0 0 64 "-mtune=generic -march=nocona" 0 0 1 0 0 0 + #assemble "ultracopier-debug-static" "${ARCHITECTURE}" 1 0 0 0 1 0 0 + #compil "ultracopier-debug-portable-static-windows-x86_64" 1 0 1 0 64 "-mtune=generic -march=nocona" 0 0 1 0 0 0 + #assemble "ultracopier-debug-portable-static" "${ARCHITECTURE}" 1 0 1 0 1 0 0 + #compil "ultracopier-portable-static-windows-x86_64" 0 0 1 0 64 "-mtune=generic -march=nocona" 0 0 1 0 0 0 + #assemble "ultracopier-portable-static" "${ARCHITECTURE}" 0 0 1 0 1 0 0 + #compil "ultracopier-static-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 0 0 1 0 0 0 + #assemble "ultracopier-static" "${ARCHITECTURE}" 0 0 0 0 1 0 0 +fi + +if [ ${COMPIL_ULTIMATE} -eq 1 ] +then + compil "supercopier-ultimate-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 1 0 0 0 1 0 + assemble "supercopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-cgminer-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 1 0 0 1 1 0 + assemble "supercopier-ultimate-cgminer" "${ARCHITECTURE}" 0 0 0 1 0 1 1 + #compil "supercopier-ultimate-cgminer-static-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 1 0 1 1 1 0 + #assemble "supercopier-ultimate-cgminer-static" "${ARCHITECTURE}" 0 0 0 1 1 1 1 + + compil "ultracopier-ultimate-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 1 0 0 0 0 0 + assemble "ultracopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + compil "ultracopier-ultimate-cgminer-windows-x86_64" 0 0 0 0 64 "-mtune=generic -march=nocona" 1 0 0 1 0 0 + assemble "ultracopier-ultimate-cgminer" "${ARCHITECTURE}" 0 0 0 1 0 1 0 + #compil "ultracopier-debug-ultimate-cgminer-windows-x86_64" 1 0 0 0 64 "-mtune=generic -march=nocona" 1 0 0 1 0 0 + #assemble "ultracopier-debug-ultimate-cgminer" "${ARCHITECTURE}" 1 0 0 1 0 1 0 + #compil "ultracopier-ultimate-sse2-windows-x86_64" 0 0 0 0 64 "-msse -msse2" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-sse2" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-sse3-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -msse3" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-sse3" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + + compil "ultracopier-ultimate-core2-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-core2" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + compil "ultracopier-ultimate-core-i-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-core-i" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + compil "ultracopier-ultimate-k8-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -march=k8" 1 0 0 0 0 0 + assemble "ultracopier-ultimate-k8" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + + compil "supercopier-ultimate-core2-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 1 0 + assemble "supercopier-ultimate-core2" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-core-i-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -msse3 -march=core2" 1 0 0 0 1 0 + assemble "supercopier-ultimate-core-i" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-k8-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -march=k8" 1 0 0 0 1 0 + assemble "supercopier-ultimate-k8" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + + #compil "ultracopier-ultimate-barcelona-windows-x86_64" 0 0 0 0 64 "-msse -msse2 -march=k8" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-barcelona" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-bobcat-windows-x86_64" 0 0 0 0 64 "-march=amdfam10 -mno-3dnow -mcx16 -mpopcnt -mssse3 -mmmx" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-bobcat" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-llano-windows-x86_64" 0 0 0 0 64 "-march=amdfam10 -mcx16 -mpopcnt" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-llano" "${ARCHITECTURE}" 0 0 0 1 0 0 0 + #compil "ultracopier-ultimate-bulldozer-windows-x86_64" 0 0 0 0 64 "-march=amdfam10 -mcx16 -msahf -maes -mpclmul -mpopcnt -mabm" 1 0 0 0 0 0 + #assemble "ultracopier-ultimate-bulldozer" "${ARCHITECTURE}" 0 0 0 1 0 0 0 +fi + +if [ ${COMPIL_PLUGIN} -eq 1 ] +then + compil "ultracopier-windows-x86_64-for-plugins" 0 0 0 0 64 "-mtune=generic -march=nocona" 0 1 0 0 0 + #compil "ultracopier-debug-windows-x86_64-for-plugins" 1 0 0 0 64 "-mtune=generic -march=nocona" 0 1 0 0 0 + + TARGET="ultracopier" + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86_64<\/architecture>/g" {} \; > /dev/null 2>&1 + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + done + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + done + + + TARGET="ultracopier-debug" + find ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86_64<\/architecture>/g" {} \; > /dev/null 2>&1 + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar --c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins/ + done + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc ] && [ -f ${plugins_name}/*.dll ] + then + echo "pack the ${ARCHITECTURE} debug windows for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + tar -c -f - ${plugins_name}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-windows-${ARCHITECTURE}-debug.urc + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-windows-${ARCHITECTURE}-for-plugins/plugins-alternative/ + done +fi diff --git a/tools/to-pack/sub-script/compil.sh b/tools/to-pack/sub-script/compil.sh new file mode 100644 index 0000000..93efdbd --- /dev/null +++ b/tools/to-pack/sub-script/compil.sh @@ -0,0 +1,429 @@ +#!/bin/bash + +function compil { + TARGET=$1 + DEBUG=$2 + DEBUG_REAL=$3 + PORTABLE=$4 + PORTABLEAPPS=$5 + BITS=$6 + CFLAGSCUSTOM="$7" + ULTIMATE=$8 + FORPLUGIN=$9 + STATIC=${10} + CGMINER=${11} + SUPERCOPIER=${12} + ILLEGAL=${13} + ULTRACOPIER_VERSION_FINAL=${ULTRACOPIER_VERSION} + cd ${BASE_PWD} + rsync -artq --delete ${ULTRACOPIERSOURCESPATH}/ ${TEMP_PATH}/${TARGET}/ + if [ $? -ne 0 ] + then + echo rsync -avrt ${ULTRACOPIERSOURCESPATH}/ ${TEMP_PATH}/${TARGET}/ fail into `pwd` $LINENO + exit 1 + fi + echo "${TARGET} rsync..." + for project in `find ${TEMP_PATH}/${TARGET}/plugins/Languages/ -mindepth 1 -type d` + do + cd ${project}/ + if [ -f *.ts ] + then + lrelease -nounfinished -compress -removeidentical *.ts > /dev/null 2>&1 + fi + cd ${TEMP_PATH}/${TARGET}/ + done + if [ $SUPERCOPIER -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i "s/=ultracopier/=supercopier/g" {} \; + find ${TEMP_PATH}/${TARGET}/ -name "resources-windows.rc" -exec sed -i "s/Ultracopier/Supercopier/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "resources-windows.rc" -exec sed -i "s/ultracopier.exe/supercopier.exe/g" {} \; > /dev/null 2>&1 + mv ${TEMP_PATH}/${TARGET}/resources/supercopier-16x16.png ${TEMP_PATH}/${TARGET}/resources/ultracopier-16x16.png + mv ${TEMP_PATH}/${TARGET}/resources/supercopier-128x128.png ${TEMP_PATH}/${TARGET}/resources/ultracopier-128x128.png + mv ${TEMP_PATH}/${TARGET}/resources/supercopier-all-in-one.ico ${TEMP_PATH}/${TARGET}/resources/ultracopier-all-in-one.ico + mv ${TEMP_PATH}/${TARGET}/resources/supercopier.ico ${TEMP_PATH}/${TARGET}/resources/ultracopier.ico + mv ${TEMP_PATH}/${TARGET}/resources/supercopier.icns ${TEMP_PATH}/${TARGET}/resources/ultracopier.icns + # rm -Rf ${TEMP_PATH}/${TARGET}/plugins/Themes/Oxygen/ + fi + find ${TEMP_PATH}/${TARGET}/ -name "*.pro.user" -exec rm {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "*-build-desktop" -type d -exec rm -Rf {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION_FINAL}<\/version>/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i -r "s/.*<\pubDate>/`date +%s`<\pubDate>/g" {} \; > /dev/null 2>&1 + if [ $DEBUG -eq 1 ] + then + echo 'CONFIG += console' >> ${TEMP_PATH}/${TARGET}/other-pro/ultracopier-core.pro + echo '' >> ${TEMP_PATH}/${TARGET}/other-pro/ultracopier-core.pro + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_DEBUG/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_DEBUG/\/\/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + fi + if [ $SUPERCOPIER -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_MODE_SUPERCOPIER/#define ULTRACOPIER_MODE_SUPERCOPIER/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_MODE_SUPERCOPIER/\/\/#define ULTRACOPIER_MODE_SUPERCOPIER/g" {} \; > /dev/null 2>&1 + fi + if [ $STATIC -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/\/\/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/g" {} \; > /dev/null 2>&1 + fi + if [ $ULTIMATE -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_VERSION_ULTIMATE/#define ULTRACOPIER_VERSION_ULTIMATE/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_ULTIMATE/\/\/#define ULTRACOPIER_VERSION_ULTIMATE/g" {} \; > /dev/null 2>&1 + fi + if [ $PORTABLE -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_VERSION_PORTABLE/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLE/\/\/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null 2>&1 + fi + if [ $PORTABLEAPPS -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_VERSION_PORTABLEAPPS/#define ULTRACOPIER_VERSION_PORTABLEAPPS/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLEAPPS/\/\/#define ULTRACOPIER_VERSION_PORTABLEAPPS/g" {} \; > /dev/null 2>&1 + fi + if [ ${BITS} -eq 32 ] + then + MXEPATH='/home/mxe-i686-w64-mingw32-shared-qt5/' + MXEPATHQMAKE='/home/mxe-i686-w64-mingw32-shared-qt5/usr/bin/i686-w64-mingw32.shared-qmake-qt5' + export PATH=/home/mxe-i686-w64-mingw32-shared-qt5/usr/bin:$PATH + fi + if [ ${BITS} -eq 64 ] + then + MXEPATH='/home/mxe-x86_64-w64-mingw32-shared-qt5/' + MXEPATHQMAKE='/home/mxe-x86_64-w64-mingw32-shared-qt5/usr/bin/x86_64-w64-mingw32.shared-qmake-qt5' + export PATH=/home/mxe-x86_64-w64-mingw32-shared-qt5/usr/bin:$PATH + fi + if [ ${STATIC} -eq 1 ] + then + if [ ${BITS} -eq 32 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86<\/architecture>/g" {} \; > /dev/null 2>&1 + # REAL_WINEPREFIX="${WINEBASEPATH}/qt-5.0-32Bits-static-for-ultracopier/" + fi + if [ ${BITS} -eq 64 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86_64<\/architecture>/g" {} \; > /dev/null 2>&1 + # REAL_WINEPREFIX="${WINEBASEPATH}/qt-5.0-64Bits-static-for-ultracopier/" + fi + else + if [ ${BITS} -eq 32 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86<\/architecture>/g" {} \; > /dev/null 2>&1 + # REAL_WINEPREFIX="${WINEBASEPATH}/qt-5.0-32Bits-for-ultracopier/" + fi + if [ ${BITS} -eq 64 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/windows-x86_64<\/architecture>/g" {} \; > /dev/null 2>&1 + # REAL_WINEPREFIX="${WINEBASEPATH}/qt-5.0-64Bits-for-ultracopier/" + fi + fi + REAL_WINEPREFIX="${MXEPATH}" + mkdir -p ${REAL_WINEPREFIX}/drive_c/temp/ + if [ ${DEBUG_REAL} -eq 1 ] + then + COMPIL_SUFFIX="debug" + COMPIL_FOLDER="debug" + else + COMPIL_SUFFIX="release" + COMPIL_FOLDER="release" + fi + rsync -art --delete ${TEMP_PATH}/${TARGET}/ ${REAL_WINEPREFIX}/drive_c/temp/ + if [ $? -ne 0 ] + then + echo line: $LINENO + echo rsync -art --delete ${TEMP_PATH}/${TARGET}/ ${REAL_WINEPREFIX}/drive_c/temp/ + exit 1 + fi + cd ${REAL_WINEPREFIX}/drive_c/temp/ + PLUGIN_FOLDER="${REAL_WINEPREFIX}/drive_c/temp/plugins/" + cd ${PLUGIN_FOLDER} + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${PLUGIN_FOLDER}/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] && [ -f ${plugins_name}/informations.xml ] && [ ! -f ${plugins_name}/*.dll ] && [ ! -f ${plugins_name}/*.a ] && [ "${plugins_name}" != "KDE4" ] && [ "${plugins_name}" != "dbus" ] && [ "${plugins_name}" != "keybinding" ] && [ "${plugins_name}" != "ultracopier-keybinding" ] + then + # echo "${TARGET} compilation of the plugin: ${plugins_cat}/${plugins_name}..." + cd ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + + if [ ${STATIC} -ne 1 ] && [[ (${FORPLUGIN} -eq 1 || "${plugins_name}" != "Rsync") ]] + then + if [[ ( $SUPERCOPIER -eq 1 && "${plugins_name}" = "Supercopier" ) || ( $SUPERCOPIER -eq 0 && "${plugins_name}" = "Oxygen" ) ]] + then + echo "${TARGET} compilation of the plugin: ${plugins_cat}/${plugins_name}..." + + cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + if [ $? -ne 0 ] + then + echo error at cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ $LINENO + exit + fi + if [ ${STATIC} -ne 1 ] && [[ "${plugins_name}" != "Supercopier" ]] + then + cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ${PLUGIN_FOLDER}/${plugins_cat}/Oxygen/ + if [ $? -ne 0 ] + then + echo error at cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ${PLUGIN_FOLDER}/${plugins_cat}/Oxygen/ $LINENO + exit + fi + fi + echo '' >> *.pro + echo 'win32:RC_FILE += resources-windows-ultracopier-plugins.rc' >> *.pro + cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ./ + if [ $? -ne 0 ] + then + echo error at cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ./ $LINENO + exit + fi + # replace ULTRACOPIER_PLUGIN_VERSION + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + sed -i "s/ULTRACOPIER_PLUGIN_VERSION/${ULTRACOPIER_PLUGIN_VERSION}/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + # replace ULTRACOPIER_PLUGIN_WINDOWS_VERSION + ULTRACOPIER_PLUGIN_WINDOWS_VERSION=`echo ${ULTRACOPIER_PLUGIN_VERSION} | sed "s/\./,/g"` + sed -i "s/ULTRACOPIER_PLUGIN_WINDOWS_VERSION/${ULTRACOPIER_PLUGIN_WINDOWS_VERSION}/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + # replace ULTRACOPIER_PLUGIN_NAME + sed -i "s/ULTRACOPIER_PLUGIN_NAME/${plugins_name}/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + # replace ULTRACOPIER_PLUGIN_FILENAME + ULTRACOPIER_PLUGIN_FILENAME=`grep -F "qtLibraryTarget" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/*.pro | sed -r "s/^.*\((.*)\).*$/\1/g"` + sed -i "s/ULTRACOPIER_PLUGIN_FILENAME/${ULTRACOPIER_PLUGIN_FILENAME}.dll/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CFLAGS="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" *.pro + if [ $? -ne 0 ] + then + echo ${MXEPATHQMAKE} fail into `pwd` $LINENO + exit 1 + fi + if [ ! -f Makefile ] + then + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CFLAGS="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" *.pro + pwd + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CFLAGS="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" *.pro + echo "plugins not created (makefile not found)" + exit + fi + make -j4 ${COMPIL_SUFFIX} > /dev/null 2>&1 + + if [ ! -f ${COMPIL_FOLDER}/*.dll ] && [ ! -f ${COMPIL_FOLDER}/*.a ] + then + make -j4 ${COMPIL_SUFFIX} + pwd + echo make -j4 ${COMPIL_SUFFIX} + echo "plugins not created (1)" + rm -f informations.xml + # rm -Rf ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + exit + fi + if [ ${STATIC} -eq 1 ] + then + if [ "${COMPIL_FOLDER}" != "./" ] + then + cp ${COMPIL_FOLDER}/*.a ./ + fi + else + if [ "${COMPIL_FOLDER}" != "./" ] + then + mv ${COMPIL_FOLDER}/*.dll ./ + fi + fi + # if [ $STATIC -ne 1 ] + # then + # /usr/bin/find ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ -type f -name "*.png" -exec rm -f {} \; + # fi + fi + fi + else + rm -Rf ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + fi + cd ${PLUGIN_FOLDER}/${plugins_cat}/ + done + cd ${PLUGIN_FOLDER}/ + fi + done + + + if [ $ULTIMATE -eq 1 ] || [ $FORPLUGIN -eq 1 ] || [ $SUPERCOPIER -eq 1 ] + then + if [ 2 -gt 3 ] + then + PLUGIN_FOLDER="${REAL_WINEPREFIX}/drive_c/temp/plugins-alternative/" + cd ${PLUGIN_FOLDER}/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${PLUGIN_FOLDER}/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] && [ -f ${plugins_name}/informations.xml ] && [ ! -f ${plugins_name}/*.dll ] && [ ! -f ${plugins_name}/*.a ] && [ -f ${plugins_name}/informations.xml ] && [ "${plugins_name}" != "KDE4" ] && [ "${plugins_name}" != "dbus" ] && [ "${plugins_name}" != "keybinding" ] && [ "${plugins_name}" != "ultracopier-keybinding" ] + then + echo "${TARGET} compilation of the plugin: ${plugins_cat}/${plugins_name}..." + cd ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + + if [ ${STATIC} -ne 1 ] + then + cp ${BASE_PWD}/data/windows/resources-windows-ultracopier-plugins.rc ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + echo '' >> *.pro + echo 'win32:RC_FILE += resources-windows-ultracopier-plugins.rc' >> *.pro + # replace ULTRACOPIER_PLUGIN_VERSION + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + sed -i "s/ULTRACOPIER_PLUGIN_VERSION/${ULTRACOPIER_PLUGIN_VERSION}/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + # replace ULTRACOPIER_PLUGIN_WINDOWS_VERSION + ULTRACOPIER_PLUGIN_WINDOWS_VERSION=`echo ${ULTRACOPIER_PLUGIN_VERSION} | sed "s/\./,/g"` + sed -i "s/ULTRACOPIER_PLUGIN_WINDOWS_VERSION/${ULTRACOPIER_PLUGIN_WINDOWS_VERSION}/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + # replace ULTRACOPIER_PLUGIN_NAME + sed -i "s/ULTRACOPIER_PLUGIN_NAME/${plugins_name}/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + # replace ULTRACOPIER_PLUGIN_FILENAME + ULTRACOPIER_PLUGIN_FILENAME=`grep -F "qtLibraryTarget" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/*.pro | sed -r "s/^.*\((.*)\).*$/\1/g"` + sed -i "s/ULTRACOPIER_PLUGIN_FILENAME/${ULTRACOPIER_PLUGIN_FILENAME}.dll/g" ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/resources-windows-ultracopier-plugins.rc + fi + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CFLAGS="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" *.pro + if [ $? -ne 0 ] + then + echo ${MXEPATHQMAKE} fail into `pwd` $LINENO + exit 1 + fi + make -j4 ${COMPIL_SUFFIX} > /dev/null 2>&1 + if [ ! -f ${COMPIL_FOLDER}/*.dll ] && [ ! -f ${COMPIL_FOLDER}/*.a ] + then + make -j4 ${COMPIL_SUFFIX} + echo "plugins not created: ${plugins_cat}/${plugins_name}" + rm -f informations.xml + rm -Rf ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + else + if [ ${STATIC} -eq 1 ] + then + if [ "${COMPIL_FOLDER}" != "./" ] + then + cp ${COMPIL_FOLDER}/*.a ./ + fi + else + if [ "${COMPIL_FOLDER}" != "./" ] + then + mv ${COMPIL_FOLDER}/*.dll ./ + fi + fi + fi + if [ $STATIC -ne 1 ] + then + /usr/bin/find ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ -type f -name "*.png" -exec rm -f {} \; + fi + else + rm -Rf ${PLUGIN_FOLDER}/${plugins_cat}/${plugins_name}/ + fi + cd ${PLUGIN_FOLDER}/${plugins_cat}/ + done + cd ${PLUGIN_FOLDER}/ + fi + done + fi + fi + + + + if [ ${STATIC} -eq 1 ] + then + cp ${TEMP_PATH}/${TARGET}/plugins/*/*/*/*.a ${TEMP_PATH}/${TARGET}/plugins/ > /dev/null 2>&1 + cp ${TEMP_PATH}/${TARGET}/plugins-alternative/Themes/Supercopier/*/*.a ${TEMP_PATH}/${TARGET}/plugins/ > /dev/null 2>&1 + fi + cd ${REAL_WINEPREFIX}/drive_c/temp/ + if [ ${STATIC} -eq 1 ] + then + if [ ${SUPERCOPIER} -eq 1 ] + then + echo "${TARGET} supercopier static application..." + cd other-pro/ + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE+="${CFLAGSCUSTOM}" QMAKE_CFLAGS+="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" supercopier-static.pro + else + echo "${TARGET} ultracopier static application..." + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE+="${CFLAGSCUSTOM}" QMAKE_CFLAGS+="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" ultracopier-static.pro + fi + else + cd other-pro/ + echo "${TARGET} application..." + if [ ${SUPERCOPIER} -eq 1 ] + then + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE+="${CFLAGSCUSTOM}" QMAKE_CFLAGS+="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" supercopier-core.pro + else + ${MXEPATHQMAKE} QMAKE_CFLAGS_RELEASE+="${CFLAGSCUSTOM}" QMAKE_CFLAGS+="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS_RELEASE="${CFLAGSCUSTOM}" QMAKE_CXXFLAGS="${CFLAGSCUSTOM}" ultracopier-core.pro + fi + fi + if [ $? -ne 0 ] + then + echo ${MXEPATHQMAKE} fail into `pwd` $LINENO + exit 1 + fi + make -j4 ${COMPIL_SUFFIX} > /dev/null 2>&1 + if [ ! -f ${COMPIL_FOLDER}/ultracopier.exe ] + then + make -j4 ${COMPIL_SUFFIX} > /tmp/bug.log 2>&1 + if [ ! -f ${COMPIL_FOLDER}/ultracopier.exe ] + then + cat /tmp/bug.log + echo "application not created" + exit + fi + fi + cd ${REAL_WINEPREFIX}/drive_c/temp/ + if [ $SUPERCOPIER -eq 1 ] + then + rm -Rf ${TEMP_PATH}/${TARGET}/plugins/Themes/Oxygen/ + fi + rsync -art --delete ${REAL_WINEPREFIX}/drive_c/temp/ ${TEMP_PATH}/${TARGET}/ + if [ $? -ne 0 ] + then + echo line: $LINENO + echo rsync -art --delete ${REAL_WINEPREFIX}/drive_c/temp/ ${TEMP_PATH}/${TARGET}/ + exit 1 + fi + rm -Rf ${REAL_WINEPREFIX}/drive_c/temp/ + cd ${TEMP_PATH}/${TARGET}/ + if [ "${COMPIL_FOLDER}" != "./" ] + then + if [ ! -e other-pro/${COMPIL_FOLDER}/ultracopier.exe ] + then + echo ${COMPIL_FOLDER}/ultracopier.exe not found into `pwd` + exit + fi + mv other-pro/${COMPIL_FOLDER}/ultracopier.exe ./ + fi + if [ 1 == 2 ] + then + if [ ${BITS} -eq 32 ] && [ ${DEBUG_REAL} -ne 1 ] + then + upx --lzma -9 ultracopier.exe > /dev/null 2>&1 + fi + fi + if [ $SUPERCOPIER -eq 1 ] + then + if [ ! -e ultracopier.exe ] + then + echo ultracopier.exe not found into `pwd` + exit + fi + mv ultracopier.exe supercopier.exe + fi + if [ $ULTIMATE -ne 1 ] && [ $FORPLUGIN -ne 1 ] && [ $SUPERCOPIER -ne 1 ] + then + rm -Rf ${TEMP_PATH}/${TARGET}/plugins-alternative/ + fi + /usr/bin/find ${TEMP_PATH}/${TARGET}/ -type f -not \( -name "*.xml" -or -name "*.dll" -or -name "*.a" -or -name "*.exe" -or -name "*.txt" -or -name "*.qm" \) -exec rm -f {} \; + rm -Rf ${TEMP_PATH}/${TARGET}/resources/ ${PLUGIN_FOLDER}/SessionLoader/KDE4/ + rm -Rf ${TEMP_PATH}/${TARGET}/resources/ ${PLUGIN_FOLDER}/Listener/dbus/ + find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 + echo "${TARGET} compilation... done" +} diff --git a/tools/to-pack/sub-script/doc.sh b/tools/to-pack/sub-script/doc.sh new file mode 100644 index 0000000..965e55c --- /dev/null +++ b/tools/to-pack/sub-script/doc.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +cd ${TEMP_PATH}/ + +if [ ! -d ${TEMP_PATH}/doc/Ultracopier ] +then + echo "Making Ultracopier doc..." + cd ${BASE_PWD}/../doc/ + rm -Rf ${TEMP_PATH}/doc/tmp/ + mkdir -p ${TEMP_PATH}/doc/Ultracopier + mkdir -p ${TEMP_PATH}/doc/tmp + cp Doxyfile Doxyfile-tmp + sed -i "s/_PROJECT_NUMBER_/${ULTRACOPIER_VERSION}/g" Doxyfile-tmp + TEMP_PATH_DOXYGEN=`echo ${TEMP_PATH} | sed "s/\\//\\\\\\\\\\//g"` + ULTRACOPIERSOURCESPATH_DOXYGEN=`echo ${ULTRACOPIERSOURCESPATH_DOXYGEN} | sed "s/\\//\\\\\\\\\\//g"` + sed -i "s/TEMP_PATH/${TEMP_PATH_DOXYGEN}/g" Doxyfile-tmp + sed -i "s/ULTRACOPIERSOURCESPATH/${ULTRACOPIERSOURCESPATH_DOXYGEN}/g" Doxyfile-tmp + doxygen Doxyfile-tmp > /dev/null 2>&1 + rm Doxyfile-tmp + rsync -art --delete ${TEMP_PATH}/doc/tmp/ ${TEMP_PATH}/doc/Ultracopier/${ULTRACOPIER_VERSION}/ + rm -Rf ${TEMP_PATH}/doc/tmp/ + echo "Making Ultracopier doc... done" +fi + +if [ -d ${TEMP_PATH}/ultracopier-src/plugins/ ] +then + echo "Making Ultracopier plugins doc..." + cd ${TEMP_PATH}/ultracopier-src/plugins/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] && [ -f ${plugins_name}/informations.xml ] + then + cd ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/${plugins_name}/ + rm -Rf ${TEMP_PATH}/doc/${plugins_cat}/${plugins_name}/ + mkdir -p ${TEMP_PATH}/doc/${plugins_cat}/${plugins_name}/ + echo "Making Ultracopier plugins doc... for ${plugins_cat}/${plugins_name}" + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + + cp ${BASE_PWD}/../doc/Doxyfile-plugin-template ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/${plugins_name}/Doxyfile + cp ${BASE_PWD}/../doc/footer.html ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/${plugins_name}/footer.html + + ULTRACOPIER_PLUGIN_TITLE=`grep -F ".*$//g"` + + sed -i "s/_PROJECT_BRIEF_/${ULTRACOPIER_PLUGIN_TITLE}/g" Doxyfile + sed -i "s/_PROJECT_NUMBER_/${ULTRACOPIER_PLUGIN_VERSION}/g" Doxyfile + sed -i "s/_ULTRACOPIER_PLUGIN_NAME_/${plugins_cat} - ${plugins_name}/g" Doxyfile + TEMP_PATH_DOXYGEN=`echo ${TEMP_PATH} | sed "s/\\//\\\\\\\\\\//g"` + ULTRACOPIERSOURCESPATH_DOXYGEN=`echo ${ULTRACOPIERSOURCESPATH_DOXYGEN} | sed "s/\\//\\\\\\\\\\//g"` + sed -i "s/TEMP_PATH/${TEMP_PATH_DOXYGEN}/g" Doxyfile + sed -i "s/ULTRACOPIERSOURCESPATH/${ULTRACOPIERSOURCESPATH_DOXYGEN}/g" Doxyfile + + doxygen Doxyfile > /dev/null 2>&1 + rm -f Doxyfile footer.html + rsync -art ${TEMP_PATH}/doc/tmp/html/ ${TEMP_PATH}/doc/${plugins_cat}/${plugins_name}/${ULTRACOPIER_PLUGIN_VERSION}/ + cd ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/ + fi + cd ${TEMP_PATH}/ultracopier-src/plugins/${plugins_cat}/ + done + cd ${TEMP_PATH}/ultracopier-src/plugins/ + fi + done + echo "Making Ultracopier plugins doc... done" +fi + +if [ -d ${TEMP_PATH}/ultracopier-src/plugins/ ] +then + echo "Making Ultracopier plugins alternative doc..." + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -d ${plugins_name} ] && [ -f ${plugins_name}/informations.xml ] + then + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/${plugins_cat}/${plugins_name}/ + rm -Rf ${TEMP_PATH}/doc/${plugins_cat}/${plugins_name}/ + mkdir -p ${TEMP_PATH}/doc/${plugins_cat}/${plugins_name}/ + echo "Making Ultracopier plugins doc... for ${plugins_cat}/${plugins_name}" + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + + cp ${BASE_PWD}/../doc/Doxyfile-plugin-template ${TEMP_PATH}/ultracopier-src/plugins-alternative/${plugins_cat}/${plugins_name}/Doxyfile + cp ${BASE_PWD}/../doc/footer.html ${TEMP_PATH}/ultracopier-src/plugins-alternative/${plugins_cat}/${plugins_name}/footer.html + + ULTRACOPIER_PLUGIN_TITLE=`grep -F ".*$//g"` + + sed -i "s/_PROJECT_BRIEF_/${ULTRACOPIER_PLUGIN_TITLE}/g" Doxyfile + sed -i "s/_PROJECT_NUMBER_/${ULTRACOPIER_PLUGIN_VERSION}/g" Doxyfile + sed -i "s/_ULTRACOPIER_PLUGIN_NAME_/${plugins_cat} - ${plugins_name}/g" Doxyfile + TEMP_PATH_DOXYGEN=`echo ${TEMP_PATH} | sed "s/\\//\\\\\\\\\\//g"` + ULTRACOPIERSOURCESPATH_DOXYGEN=`echo ${ULTRACOPIERSOURCESPATH_DOXYGEN} | sed "s/\\//\\\\\\\\\\//g"` + sed -i "s/TEMP_PATH/${TEMP_PATH_DOXYGEN}/g" Doxyfile + sed -i "s/ULTRACOPIERSOURCESPATH/${ULTRACOPIERSOURCESPATH_DOXYGEN}/g" Doxyfile + + doxygen Doxyfile > /dev/null 2>&1 + rm -f Doxyfile footer.html + rsync -art ${TEMP_PATH}/doc/tmp/html/ ${TEMP_PATH}/doc/${plugins_cat}/${plugins_name}/${ULTRACOPIER_PLUGIN_VERSION}/ + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/${plugins_cat}/ + fi + done + cd ${TEMP_PATH}/ultracopier-src/plugins-alternative/ + fi + done + echo "Making Ultracopier plugins alternative doc... done" +fi + +rm -Rf ${TEMP_PATH}/doc/tmp/ diff --git a/tools/to-pack/sub-script/linux.sh b/tools/to-pack/sub-script/linux.sh new file mode 100644 index 0000000..552dace --- /dev/null +++ b/tools/to-pack/sub-script/linux.sh @@ -0,0 +1,275 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +QMAKE="/usr/local/Qt-5.2.0/bin/qmake" + +mkdir -p ${TEMP_PATH} +cd ${TEMP_PATH}/ + +function compil { + DEBUG=$2 + ULTIMATE=$3 + cd ${TEMP_PATH}/ + TARGET=$1 + STATIC=$4 + FINAL_ARCHIVE="${TARGET}-linux-x86_64-pc-${ULTRACOPIER_VERSION}" + if [ ! -e ${FINAL_ARCHIVE}.tar.xz ] + then + echo "Making linux tar.xz: ${FINAL_ARCHIVE} ..." + + rm -Rf ${TEMP_PATH}/${FINAL_ARCHIVE}/ + /usr/bin/rsync -art --delete ${ULTRACOPIER_SOURCE}/ ${TEMP_PATH}/${FINAL_ARCHIVE}/ --exclude='*build*' --exclude='*Qt_5*' --exclude='*qt5*' --exclude='*.pro.user' + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "*.pro.user" -exec rm {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "*-build-desktop" -type d -exec rm -Rf {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/linux-x86_64-pc<\/architecture>/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "informations.xml" -exec sed -i -r "s/.*<\pubDate>/`date +%s`<\pubDate>/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLE/\/\/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLEAPPS/\/\/#define ULTRACOPIER_VERSION_PORTABLEAPPS/g" {} \; > /dev/null + if [ ${DEBUG} -eq 1 ] + then + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_DEBUG/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null + else + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_DEBUG/\/\/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null + find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null + fi + if [ $STATIC -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/g" {} \; > /dev/null + else + + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/\/\/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/g" {} \; > /dev/null + fi + if [ $ULTIMATE -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_VERSION_ULTIMATE/#define ULTRACOPIER_VERSION_ULTIMATE/g" {} \; > /dev/null + else + find ${TEMP_PATH}/${TARGET}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_ULTIMATE/\/\/#define ULTRACOPIER_VERSION_ULTIMATE/g" {} \; > /dev/null + fi + + if [ ${DEBUG} -eq 1 ] + then + QTMODEDEBUGRELEASE="debug" + else + QTMODEDEBUGRELEASE="release" + fi + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/CopyEngine/Ultracopier/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} + make -j 4 > /dev/null + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/Listener/catchcopy-v0002/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} + make -j 4 > /dev/null + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/Themes/Oxygen/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} + make -j 4 > /dev/null + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + if [ ${ULTIMATE} -eq 1 ] && [ $STATIC -ne 1 ] + then + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/Themes/Clean/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} + make -j 4 > /dev/null + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + mv ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/Themes/Clean/ ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/Themes/Clean/ + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/Themes/Windows/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} + make -j 4 > /dev/null + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + mv ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/Themes/Windows/ ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/Themes/Windows/ + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/Themes/Teracopy/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} + make -j 4 > /dev/null + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + mv ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/Themes/Teracopy/ ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/Themes/Teracopy/ + fi + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/ + if [ $STATIC -eq 1 ] + then + cp -aRf ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/*/*/*.a ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} ultracopier-static.pro + else + ${QMAKE} -config ${QTMODEDEBUGRELEASE} ultracopier-core.pro + fi + make -j 4 > /dev/null + if [ $STATIC -eq 1 ] + then + upx --lzma -9 ultracopier > /dev/null + fi + RETURN_CODE=$? + if [ $? -ne 0 ] || [ ! -e ultracopier ] + then + echo "make failed on the linux: ${RETURN_CODE}" + exit + fi + cd ${TEMP_PATH}/${FINAL_ARCHIVE} + for SUBFOLDER in `ls -1` + do + if [ -d ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/ ] + then + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/ + for plugins_cat in `ls -1` + do + if [ -d ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ ! -f ${plugins_name}/lib*.so ] && [ -d ${plugins_name}/ ] + then + rm -Rf ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/${plugins_cat}/${plugins_name}/ + fi + done + fi + done + fi + done + cd ${TEMP_PATH}/ + rm -Rf ${TEMP_PATH}/${FINAL_ARCHIVE}/resources/ + if [ $STATIC -eq 1 ] + then + rm -Rf ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins/ + fi + if [ ${ULTIMATE} -ne 1 ] || [ $STATIC -eq 1 ] + then + rm -Rf ${TEMP_PATH}/${FINAL_ARCHIVE}/plugins-alternative/ + fi + /usr/bin/find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -type f -not \( -name "*.xml" -or -name "lib*.so" -or -name "ultracopier" -or -name "*.txt" -or -name "*.qm" \) -exec rm -f {} \; + /usr/bin/find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -type d \( -name "*build*" -or -name "Desktop" -or -name "Qt_5" -or -name "qt5" \) -exec rm -Rf {} \; + /usr/bin/find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -type d -empty -delete > /dev/null + /usr/bin/find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -type d -empty -delete > /dev/null + /usr/bin/find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -type d -empty -delete > /dev/null + /usr/bin/find ${TEMP_PATH}/${FINAL_ARCHIVE}/ -type d -empty -delete > /dev/null + cd ${TEMP_PATH}/ + if [ ! -e ${FINAL_ARCHIVE} ]; then + echo "${FINAL_ARCHIVE} not exists!"; + exit; + fi + nice -n 19 ionice -c 3 tar cpf - ${FINAL_ARCHIVE}/ | nice -n 19 ionice -c 3 xz -z -9 -e > ${FINAL_ARCHIVE}.tar.xz + if [ ! -e ${FINAL_ARCHIVE}.tar.xz ]; then + echo "${FINAL_ARCHIVE}.tar.xz not exists!"; + exit; + fi + echo "Making binary debug linux tar.xz... done" + else + echo "Archive already exists: ${FINAL_ARCHIVE}.tar.xz" + fi +} + +function compil_plugin { + DEBUG=$2 + cd ${TEMP_PATH}/ + TARGET=$1 + SUBFOLDER=$3 + FINAL_ARCHIVE="${TARGET}-linux-x86_64-pc-for-plugins" + + cp -aRf ${ULTRACOPIER_SOURCE}/ ${TEMP_PATH}/${FINAL_ARCHIVE}/ + + if [ ${DEBUG} -eq 1 ] + then + QTMODEDEBUGRELEASE="debug" + else + QTMODEDEBUGRELEASE="release" + fi + + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/1\.0\.0\.0/${ULTRACOPIER_VERSION}/g" {} \; > /dev/null + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + if [ -d ${plugins_name} ] && [ ! -f ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-linux-x86_64-pc.urc ] + then + echo "pack the ${ARCHITECTURE} linux for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + + find ${plugins_name}/ -name "*.pro.user" -exec rm {} \; > /dev/null + find ${plugins_name}/ -name "*-build-desktop" -type d -exec rm -Rf {} \; > /dev/null + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/linux-x86_64-pc<\/architecture>/g" {} \; > /dev/null + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLE/\/\/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLEAPPS/\/\/#define ULTRACOPIER_VERSION_PORTABLEAPPS/g" {} \; > /dev/null + if [ ${DEBUG} -eq 1 ] + then + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_DEBUG/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null + else + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_DEBUG/\/\/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null + fi + cd ${plugins_name}/ + ${QMAKE} -config ${QTMODEDEBUGRELEASE} *.pro + make -j 4 > /dev/null + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/${plugins_cat}/ + if [ ! -e ${plugins_name}/lib*.so ]; then + echo "no lib*.so file!"; + make -j 4 + else + find ${plugins_name}/ -iname "*.ts" -exec rm {} \; + find ${plugins_name}/ -maxdepth 1 -mindepth 1 -type f ! -iname "lib*.so" ! -iname "informations.xml" -exec rm {} \; + find ${plugins_name}/ -maxdepth 1 -mindepth 1 -type d ! -iname "Languages" -exec rm -Rf {} \; + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null + + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-linux-x86_64-pc.urc + fi + fi + fi + done + fi + cd ${TEMP_PATH}/${FINAL_ARCHIVE}/${SUBFOLDER}/ + done +} + +compil "ultracopier" 0 0 0 0 +compil "ultracopier-ultimate" 0 1 0 0 +compil "ultracopier-debug" 1 0 0 0 + +#compil_plugin "ultracopier" 0 "plugins-alternative" +#compil_plugin "ultracopier" 0 "plugins" diff --git a/tools/to-pack/sub-script/mac.sh b/tools/to-pack/sub-script/mac.sh new file mode 100644 index 0000000..79665f1 --- /dev/null +++ b/tools/to-pack/sub-script/mac.sh @@ -0,0 +1,275 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +mkdir -p ${TEMP_PATH} +cd ${TEMP_PATH}/ + +IPMAC="192.168.158.34" +SSHUSER="user" +QTVERSION="5.4.0" +QTVERSIONMAJ="5.4" + +ssh root@${IPMAC} "cd /usr/bin/;ln -s /Applications/Xcode.app/Contents/Developer//Toolchains/XcodeDefault.xctoolchain/usr/bin/otool" +ssh root@${IPMAC} "mkdir /opt/;mkdir /opt/local/;mkdir /opt/local/lib/;cd /opt/local/lib/;ln -s /usr/lib/libz.1.dylib" + +#compil "ultracopier" 1 0 +function compil { + DEBUG=$2 + ULTIMATE=$3 + cd ${TEMP_PATH}/ + TARGET=$1 + STATIC=$4 + DEBUGREAL=${5} + if [ $DEBUGREAL -eq 1 ] + then + LIBEXT="_debug.dylib" + CONFIGARG="debug" + else + LIBEXT=".dylib" + CONFIGARG="release" + fi + FINAL_ARCHIVE="${TARGET}-mac-os-x-${ULTRACOPIER_VERSION}.dmg" + if [ ! -e ${FINAL_ARCHIVE} ] + then + echo "Making Mac dmg: ${FINAL_ARCHIVE} ..." + + rm -Rf ${TEMP_PATH}/${TARGET}-mac-os-x/ + cp -aRf ${ULTRACOPIER_SOURCE}/ ${TEMP_PATH}/${TARGET}-mac-os-x/ + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "*.pro.user" -exec rm {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "*-build-desktop" -type d -exec rm -Rf {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/mac-os-x<\/architecture>/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "informations.xml" -exec sed -i -r "s/.*<\/version>/${ULTRACOPIER_VERSION}<\/version>/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "informations.xml" -exec sed -i -r "s/.*<\pubDate>/`date +%s`<\pubDate>/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLE/\/\/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLEAPPS/\/\/#define ULTRACOPIER_VERSION_PORTABLEAPPS/g" {} \; > /dev/null 2>&1 + if [ ${DEBUG} -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_DEBUG/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_DEBUG/\/\/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null 2>&1 + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + fi + if [ $STATIC -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/g" {} \; > /dev/null 2>&1 + else + + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/\/\/#define ULTRACOPIER_PLUGIN_ALL_IN_ONE/g" {} \; > /dev/null 2>&1 + fi + if [ $ULTIMATE -eq 1 ] + then + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_VERSION_ULTIMATE/#define ULTRACOPIER_VERSION_ULTIMATE/g" {} \; > /dev/null 2>&1 + else + find ${TEMP_PATH}/${TARGET}-mac-os-x/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_ULTIMATE/\/\/#define ULTRACOPIER_VERSION_ULTIMATE/g" {} \; > /dev/null 2>&1 + fi + + echo "try connect" + ssh ${SSHUSER}@${IPMAC} "rm -fR /Users/${SSHUSER}/Desktop/ultracopier/" + echo "try rsync" + rsync -art ${TEMP_PATH}/${TARGET}-mac-os-x/ ${SSHUSER}@${IPMAC}:/Users/${SSHUSER}/Desktop/ultracopier/ + + echo "try qmake" + BASEAPPNAME="ultracopier.app" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/ultracopier-core.pro -spec macx-g++ -config ${CONFIGARG}" + echo "try make" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + echo "try make plugins" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins/CopyEngine/Ultracopier/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/plugins/CopyEngine/Ultracopier/*.pro -spec macx-g++ -config ${CONFIGARG}" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins/CopyEngine/Ultracopier/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins/Listener/catchcopy-v0002/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/plugins/Listener/catchcopy-v0002/*.pro -spec macx-g++ -config ${CONFIGARG}" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins/Listener/catchcopy-v0002/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins/Themes/Oxygen/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/plugins/Themes/Oxygen/*.pro -spec macx-g++ -config ${CONFIGARG}" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins/Themes/Oxygen/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + if [ ${ULTIMATE} -eq 1 ] + then + echo "do the ultimate plugin" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Windows/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Windows/*.pro -spec macx-g++ -config ${CONFIGARG}" > /dev/null 2>&1 + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Windows/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Teracopy/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Teracopy/*.pro -spec macx-g++ -config ${CONFIGARG}" > /dev/null 2>&1 + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Teracopy/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + ssh ${SSHUSER}@${IPMAC} "mkdir -p /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/" + ssh ${SSHUSER}@${IPMAC} "mkdir -p /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Windows/informations.xml /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/informations.xml" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Teracopy/informations.xml /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/informations.xml" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Windows/libinterface${LIBEXT} /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Teracopy/libinterface${LIBEXT} /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "rsync -aqrt /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Windows/Languages/ /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/Languages/" + ssh ${SSHUSER}@${IPMAC} "rsync -aqrt /Users/${SSHUSER}/Desktop/ultracopier/plugins-alternative/Themes/Teracopy/Languages/ /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/Languages/" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Windows/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Teracopy/libinterface${LIBEXT}" + fi + echo "make the folder" + ssh ${SSHUSER}@${IPMAC} "mkdir /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/Frameworks" + + ssh ${SSHUSER}@${IPMAC} "mkdir -p /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/" + ssh ${SSHUSER}@${IPMAC} "mkdir -p /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Languages/" + ssh ${SSHUSER}@${IPMAC} "mkdir -p /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Listener/catchcopy-v0002/" + + echo "put the informations.xml" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins/CopyEngine/Ultracopier/informations.xml /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/informations.xml" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins/Listener/catchcopy-v0002/informations.xml /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Listener/catchcopy-v0002/informations.xml" + + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins/CopyEngine/Ultracopier/libcopyEngine${LIBEXT} /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/libcopyEngine${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins/Listener/catchcopy-v0002/liblistener${LIBEXT} /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Listener/catchcopy-v0002/liblistener${LIBEXT}" + + ssh ${SSHUSER}@${IPMAC} "rsync -aqrt /Users/${SSHUSER}/Desktop/ultracopier/plugins/Languages/ /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Languages/" + ssh ${SSHUSER}@${IPMAC} "rsync -aqrt /Users/${SSHUSER}/Desktop/ultracopier/plugins/CopyEngine/Ultracopier/Languages/ /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/Languages/" + ssh ${SSHUSER}@${IPMAC} "find /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/ -iname \"*.ts\" -exec rm {} \; > /dev/null 2>&1" + + echo "finish the link" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/libcopyEngine${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/libcopyEngine${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/CopyEngine/Ultracopier/libcopyEngine${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Listener/catchcopy-v0002/liblistener${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Listener/catchcopy-v0002/liblistener${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Listener/catchcopy-v0002/liblistener${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "mkdir -p /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins/Themes/Oxygen/informations.xml /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/informations.xml" + ssh ${SSHUSER}@${IPMAC} "cp /Users/${SSHUSER}/Desktop/ultracopier/plugins/Themes/Oxygen/libinterface${LIBEXT} /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "rsync -aqrt /Users/${SSHUSER}/Desktop/ultracopier/plugins/Themes/Oxygen/Languages/ /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/Languages/" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /Users/${SSHUSER}/Desktop/ultracopier/${BASEAPPNAME}/Contents/MacOS/Themes/Oxygen/libinterface${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/macdeployqt ${BASEAPPNAME}/ -dmg" + rsync -art ${SSHUSER}@${IPMAC}:/Users/${SSHUSER}/Desktop/ultracopier/ultracopier.dmg ${TEMP_PATH}/${FINAL_ARCHIVE} + if [ ! -e ${FINAL_ARCHIVE} ]; then + echo "${FINAL_ARCHIVE} not exists!"; + exit; + fi + ssh ${SSHUSER}@${IPMAC} "rm -fR /Users/${SSHUSER}/Desktop/ultracopier/" + echo "Making binary debug Mac dmg... done" + else + echo "Archive already exists: ${FINAL_ARCHIVE}" + fi +} + +function compil_plugin { + DEBUG=$2 + cd ${TEMP_PATH}/ + TARGET=$1 + SUBFOLDER=$3 + + rsync -art --delete ${ULTRACOPIER_SOURCE}/ ${TEMP_PATH}/${TARGET}-mac-os-x/ + + cd ${TEMP_PATH}/${TARGET}-mac-os-x/${SUBFOLDER}/ + for plugins_cat in `ls -1` + do + if [ -d ${plugins_cat} ] && [ "${plugins_cat}" != "Languages" ] + then + cd ${TEMP_PATH}/${TARGET}-mac-os-x/${SUBFOLDER}/${plugins_cat}/ + for plugins_name in `ls -1` + do + if [ -f ${plugins_name}/informations.xml ] + then + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/1\.0\.0\.0/${ULTRACOPIER_VERSION}/g" {} \; > /dev/null 2>&1 + ULTRACOPIER_PLUGIN_VERSION=`grep -F "" ${plugins_name}/informations.xml | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` + # && [ ${plugins_name} != "Windows" ] -> for the plugins interface + if [ -d ${plugins_name} ] && [ ! -f "${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-mac-os-x.urc" ] && [ ${plugins_name} != "dbus" ] && [ ${plugins_cat} != "SessionLoader" ] + then + echo "pack the mac for the alternative plugin: ${plugins_cat}/${plugins_name}" + mkdir -p ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/ + + find ${plugins_name}/ -name "*.pro.user" -exec rm {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "*-build-desktop" -type d -exec rm -Rf {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "informations.xml" -exec sed -i -r "s/.*<\/architecture>/mac-os-x<\/architecture>/g" {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLE/\/\/#define ULTRACOPIER_VERSION_PORTABLE/g" {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_VERSION_PORTABLEAPPS/\/\/#define ULTRACOPIER_VERSION_PORTABLEAPPS/g" {} \; > /dev/null 2>&1 + if [ ${DEBUG} -eq 1 ] + then + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_DEBUG/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + else + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_DEBUG/\/\/#define ULTRACOPIER_DEBUG/g" {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG/\/\/#define ULTRACOPIER_PLUGIN_DEBUG/g" {} \; > /dev/null 2>&1 + find ${plugins_name}/ -name "Variable.h" -exec sed -i "s/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/\/\/#define ULTRACOPIER_PLUGIN_DEBUG_WINDOW/g" {} \; > /dev/null 2>&1 + fi + + ssh ${SSHUSER}@${IPMAC} "rm -fR /Users/${SSHUSER}/Desktop/ultracopier/" + rsync -art ${TEMP_PATH}/${TARGET}-mac-os-x/ ${SSHUSER}@${IPMAC}:/Users/${SSHUSER}/Desktop/ultracopier/ + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/;/Users/user/Qt${QTVERSION}/${QTVERSIONMAJ}/clang_64/bin/qmake /Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/*.pro -spec macx-g++ -config ${CONFIGARG}" + ssh ${SSHUSER}@${IPMAC} "cd /Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/;/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake -j 3 > /dev/null" + RETURN_CODE=$? + if [ $? -ne 0 ] + then + echo "make failed on the mac: ${RETURN_CODE}" + exit + fi + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/*${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/*${LIBEXT}" + ssh ${SSHUSER}@${IPMAC} "/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -change QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/*${LIBEXT}" + rsync -art "${SSHUSER}@${IPMAC}:/Users/${SSHUSER}/Desktop/ultracopier/${SUBFOLDER}/${plugins_cat}/${plugins_name}/*${LIBEXT}" ${plugins_name}/ + if [ ! -e ${plugins_name}/*.dylib ]; then + echo "no .dylib file!"; + else + find ${plugins_name}/ -iname "*.ts" -exec rm {} \; + find ${plugins_name}/ -maxdepth 1 -mindepth 1 -type f ! -iname "*.dylib" ! -iname "informations.xml" -exec rm {} \; + find ${plugins_name}/ -maxdepth 1 -mindepth 1 -type d ! -iname "Languages" -exec rm -Rf {} \; + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null 2>&1 + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null 2>&1 + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null 2>&1 + /usr/bin/find ${plugins_name}/ -type d -empty -delete > /dev/null 2>&1 + + tar --posix -c -f - ${plugins_name}/ | xz -9 --check=crc32 > ${TEMP_PATH}/plugins/${plugins_cat}/${plugins_name}/${plugins_cat}-${plugins_name}-${ULTRACOPIER_PLUGIN_VERSION}-mac-os-x.urc + fi + fi + fi + done + fi + cd ${TEMP_PATH}/${TARGET}-mac-os-x/${SUBFOLDER}/ + done +} + +compil "ultracopier" 0 0 0 0 0 +compil "ultracopier-ultimate" 0 1 0 0 0 +compil "ultracopier-debug" 1 0 0 0 0 + +compil_plugin "ultracopier" 0 "plugins-alternative" +compil_plugin "ultracopier" 0 "plugins" diff --git a/tools/to-pack/sub-script/sendmail.sh b/tools/to-pack/sub-script/sendmail.sh new file mode 100644 index 0000000..909972c --- /dev/null +++ b/tools/to-pack/sub-script/sendmail.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi +if [ "${ULTRACOPIER_VERSION}" = "" ] +then + exit; +fi +SUPERCOPIER_VERSION=`echo "${ULTRACOPIER_VERSION}"` + +cd ${TEMP_PATH}/ + +echo "Send mail..." +/usr/bin/php /home/first-world.info/shop/sendmail_ultracopier_version.php ${ULTRACOPIER_VERSION} +echo "Send mail... done" diff --git a/tools/to-pack/sub-script/test.sh b/tools/to-pack/sub-script/test.sh new file mode 100644 index 0000000..782d462 --- /dev/null +++ b/tools/to-pack/sub-script/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +cd ${TEMP_PATH}/ + +source ${BASE_PWD}/sub-script/compil.sh +source ${BASE_PWD}/sub-script/assemble.sh + +ARCHITECTURE="x86" +#compil "supercopier-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 1 0 +#assemble "supercopier" "${ARCHITECTURE}" 0 0 0 0 0 0 1 + + compil "ultracopier-debug-windows-x86" 1 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier-debug" "${ARCHITECTURE}" 1 0 0 0 0 0 0 + #compil "ultracopier-debug-portable-windows-x86" 1 0 1 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + #assemble "ultracopier-debug-portable" "${ARCHITECTURE}" 1 0 1 0 0 0 0 + compil "ultracopier-portable-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier-portable" "${ARCHITECTURE}" 0 0 1 0 0 0 0 + #compil "ultracopier-portableapps-windows-x86" 0 0 1 1 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + #assemble "ultracopier-portableapps" "${ARCHITECTURE}" 0 0 1 0 0 0 0 + compil "ultracopier-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 0 0 0 0 0 0 + assemble "ultracopier" "${ARCHITECTURE}" 0 0 0 0 0 0 0 + #compil "ultracopier-debug-static-windows-x86" 1 0 0 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-debug-static" "${ARCHITECTURE}" 1 0 0 0 1 0 0 + #compil "ultracopier-debug-portable-static-windows-x86" 1 0 1 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-debug-portable-static" "${ARCHITECTURE}" 1 0 1 0 1 0 0 + #compil "ultracopier-portable-static-windows-x86" 0 0 1 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-portable-static" "${ARCHITECTURE}" 0 0 1 0 1 0 0 + #compil "ultracopier-static-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 0 0 1 0 0 0 + #assemble "ultracopier-static" "${ARCHITECTURE}" 0 0 0 0 1 0 0 + compil "supercopier-ultimate-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 0 1 0 + assemble "supercopier-ultimate" "${ARCHITECTURE}" 0 0 0 1 0 0 1 + compil "supercopier-ultimate-cgminer-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 0 1 1 0 + assemble "supercopier-ultimate-cgminer" "${ARCHITECTURE}" 0 0 0 1 0 1 1 + #compil "supercopier-ultimate-cgminer-static-windows-x86" 0 0 0 0 32 "-mtune=generic -march=i686" 1 0 1 1 1 0 + #assemble "supercopier-ultimate-cgminer-static" "${ARCHITECTURE}" 0 0 0 1 1 1 1 diff --git a/tools/to-pack/sub-script/translation-local.sh b/tools/to-pack/sub-script/translation-local.sh new file mode 100644 index 0000000..2e56f15 --- /dev/null +++ b/tools/to-pack/sub-script/translation-local.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +rm -Rf ${TEMP_PATH} + +cd ${ULTRACOPIER_SOURCE} +lupdate ultracopier-core.pro > /dev/null 2>&1 +lrelease -nounfinished -compress -removeidentical ultracopier-core.pro > /dev/null 2>&1 +PWD_BASE2=`pwd` +echo "update the .ts file" +for project in `find plugins/ plugins-alternative/ -maxdepth 2 -type d` +do + cd ${project}/ + for projectfile in `find ./ -name '*.pro' -type f` + do + if [ -f ${projectfile} ] + then + lupdate ${projectfile} > /dev/null 2>&1 + lrelease -nounfinished -compress -removeidentical ${projectfile} > /dev/null 2>&1 + fi + done + cd ${PWD_BASE2} +done + + + diff --git a/tools/to-pack/sub-script/translation.sh b/tools/to-pack/sub-script/translation.sh new file mode 100755 index 0000000..109e9b9 --- /dev/null +++ b/tools/to-pack/sub-script/translation.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +TARGET="ultracopier-translation-${ULTRACOPIER_VERSION}" +rm -Rf ${TEMP_PATH}/${TARGET}/ +mkdir -p ${TEMP_PATH}/${TARGET}/ +cd ${ULTRACOPIERSOURCESPATH} +lupdate -no-obsolete ultracopier-core.pro > /dev/null 2>&1 +lrelease -nounfinished -compress -removeidentical ultracopier-core.pro > /dev/null 2>&1 +PWD_BASE2=`pwd` +echo "update the .ts file" +for project in `find plugins/ plugins-alternative/ -maxdepth 2 -type d` +do + cd ${project}/ + for projectfile in `find ./ -name '*.pro' -type f` + do + if [ -f ${projectfile} ] + then + lupdate ${projectfile} > /dev/null 2>&1 + lrelease -nounfinished -compress -removeidentical ${projectfile} > /dev/null 2>&1 + fi + done + cd ${PWD_BASE2} +done +echo "copy the .ts file" +for languages in `find ./ -name Languages -type d` +do + mkdir -p ${TEMP_PATH}/${TARGET}/${languages} + cp -aRf ${languages} ${TEMP_PATH}/${TARGET}/${languages}/../ +done +cd ../to-pack/ + +rm -Rf ${TEMP_PATH}/${TARGET}/*/*/Rsync > /dev/null 2>&1 +rm -Rf ${TEMP_PATH}/${TARGET}/plugins-alternative/CopyEngine > /dev/null 2>&1 +find ${TEMP_PATH}/${TARGET}/ -name "*.qm" -exec rm {} \; > /dev/null 2>&1 +find ${TEMP_PATH}/${TARGET}/ -name "Test" -type d -exec rm -Rf {} \; > /dev/null 2>&1 +mv ${TEMP_PATH}/${TARGET}/resources/Languages/en/ ${TEMP_PATH}/${TARGET}/plugins/Languages/en/ +find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 +find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 +find ${TEMP_PATH}/${TARGET}/ -type d -empty -delete > /dev/null 2>&1 +rm -Rf ${TEMP_PATH}/${TARGET}/resources/ + +cd ${TEMP_PATH}/ +tar cjf ${TARGET}.tar.bz2 ${TARGET}/ --owner=0 --group=0 --mtime='2010-01-01' -H ustar +if [ ! -e ${TARGET}.tar.bz2 ]; then + echo "${TARGET}.tar.bz2 not exists!"; + exit; +fi +rm -Rf ${TARGET}/ diff --git a/tools/to-pack/sub-script/upload-local.sh b/tools/to-pack/sub-script/upload-local.sh new file mode 100644 index 0000000..c42e055 --- /dev/null +++ b/tools/to-pack/sub-script/upload-local.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi + +mkdir -p ${TEMP_PATH} +cd ${TEMP_PATH}/ + +rsync -avrtz --compress-level=9 --rsh='ssh -p54973' --partial --progress /mnt/world/ultracopier-temp/ultracopier-*.dmg root@ssh.first-world.info:/home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ --timeout=120 +RETURNA=$? +while [ ${RETURNA} -ne 0 ] && [ ${RETURNA} -ne 20 ] && [ ${RETURNA} -ne 255 ] +do + rsync -avrtz --compress-level=9 --rsh='ssh -p54973' --partial --progress /mnt/world/ultracopier-temp/ultracopier-*.dmg root@ssh.first-world.info:/home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ --timeout=120 + RETURNA=$? + echo ${RETURNA} +done + + +rsync -avrtzu --compress-level=9 --rsh='ssh -p54973' --partial --progress /mnt/world/ultracopier-temp/plugins/ root@ssh.first-world.info:/home/first-world.info/files-rw/ultracopier/plugins/ --timeout=120 +RETURNB=$? +while [ ${RETURNB} -ne 0 ] && [ ${RETURNB} -ne 20 ] && [ ${RETURNB} -ne 255 ] +do + rsync -avrtzu --compress-level=9 --rsh='ssh -p54973' --partial --progress /mnt/world/ultracopier-temp/plugins/ root@ssh.first-world.info:/home/first-world.info/files-rw/ultracopier/plugins/ --timeout=120 + RETURNB=$? + echo ${RETURNB} +done + +#if [ "${RETURNA}" -eq 0 ] && [ "${RETURNB}" -eq 0 ] +#then +# rm -Rf /mnt/world/ultracopier-temp/*.dmg /mnt/world/ultracopier-temp/*.tar.xz /mnt/world/ultracopier-temp/plugins/ +#fi diff --git a/tools/to-pack/sub-script/upload.sh b/tools/to-pack/sub-script/upload.sh new file mode 100644 index 0000000..f7c50df --- /dev/null +++ b/tools/to-pack/sub-script/upload.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +if [ "${TEMP_PATH}" = "" ] +then + exit; +fi +if [ "${ULTRACOPIER_VERSION}" = "" ] +then + exit; +fi +SUPERCOPIER_VERSION=`echo "${ULTRACOPIER_VERSION}"` + +cd ${TEMP_PATH}/ + +echo "Move some elements..." +if [ -d ${TEMP_PATH}/doc/ ] +then + rsync -artu ${TEMP_PATH}/doc/ /home/first-world.info/doc-ultracopier/ + if [ $? -ne 0 ] + then + echo 'rsync failed' + exit; + fi + rm -Rf ${TEMP_PATH}/doc/ +fi +if [ -d ${TEMP_PATH}/plugins/ ] +then + rsync -artu ${TEMP_PATH}/plugins/ /home/first-world.info/files-rw/ultracopier/plugins/ + if [ $? -ne 0 ] + then + echo 'rsync failed' + exit; + fi + rm -Rf ${TEMP_PATH}/plugins/ +fi + +mkdir -p /home/first-world.info/files-rw/supercopier/${SUPERCOPIER_VERSION}/ +mv ${TEMP_PATH}/supercopier-*.zip /home/first-world.info/files-rw/supercopier/${SUPERCOPIER_VERSION}/ +mv ${TEMP_PATH}/supercopier-*-setup.exe /home/first-world.info/files-rw/supercopier/${SUPERCOPIER_VERSION}/ + +mkdir -p /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +mv ${TEMP_PATH}/ultracopier-*.tar.xz /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +mv ${TEMP_PATH}/ultracopier-*.zip /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +mv ${TEMP_PATH}/ultracopier-*-setup.exe /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +mv ${TEMP_PATH}/ultracopier-*.tar.bz2 /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +cp ${BASE_PWD}/data/gentoo/ultracopier.ebuild /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ultracopier-${ULTRACOPIER_VERSION}.ebuild +echo "Move some elements... done" + +echo "Finalise some elements..." +chown lighttpd.lighttpd -Rf /home/first-world.info/doc-ultracopier/*/*/${ULTRACOPIER_VERSION}/ +chown lighttpd.lighttpd -Rf /home/first-world.info/files-rw/ultracopier/plugins/ +echo "Finalise some elements... done" + +echo "Upload to the shop..." +#cd /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ && rm -f /home/first-world.info/shop/download/09616e4ee15b7445c80704b934559f3af483abaa && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/09616e4ee15b7445c80704b934559f3af483abaa ultracopier-ultimate-*-x86-${ULTRACOPIER_VERSION}-setup.exe -x ultracopier-ultimate-cgminer-*-x86-${ULTRACOPIER_VERSION}-setup.exe && mv /home/first-world.info/shop/download/09616e4ee15b7445c80704b934559f3af483abaa.zip /home/first-world.info/shop/download/09616e4ee15b7445c80704b934559f3af483abaa +#cd /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ && rm -f /home/first-world.info/shop/download/e4039d2bc194fb68f3ac6319c63381eed1573632 && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/e4039d2bc194fb68f3ac6319c63381eed1573632 ultracopier-ultimate-*-x86_64-${ULTRACOPIER_VERSION}-setup.exe -x ultracopier-ultimate-cgminer-*-x86_64-${ULTRACOPIER_VERSION}-setup.exe && mv /home/first-world.info/shop/download/e4039d2bc194fb68f3ac6319c63381eed1573632.zip /home/first-world.info/shop/download/e4039d2bc194fb68f3ac6319c63381eed1573632 +#cp /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ultracopier-ultimate-mac-os-x-${ULTRACOPIER_VERSION}.dmg /home/first-world.info/shop/download/d6382b673f31a42c71101ed642fe69d3b39dba8a +#cd /home/first-world.info/files-rw/supercopier/${SUPERCOPIER_VERSION}/ && rm -f /home/first-world.info/shop/download/b5f718420c697ddb34d3dfae6cb2adfdfc860153 && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/b5f718420c697ddb34d3dfae6cb2adfdfc860153 supercopier-ultimate-*${SUPERCOPIER_VERSION}* -x supercopier-ultimate-cgminer-*${SUPERCOPIER_VERSION}* && mv /home/first-world.info/shop/download/b5f718420c697ddb34d3dfae6cb2adfdfc860153.zip /home/first-world.info/shop/download/b5f718420c697ddb34d3dfae6cb2adfdfc860153 + +#cd /home/first-world.info/files-rw/ultracopier/plugins/Themes/Teracopy/ && rm -f /home/first-world.info/shop/download/161e15b3dfd41a1c4fc265d8d2d856a07e8df559 && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/161e15b3dfd41a1c4fc265d8d2d856a07e8df559 *${ULTRACOPIER_VERSION}*-x86_64.urc *${ULTRACOPIER_VERSION}*-x86.urc *${ULTRACOPIER_VERSION}*-mac-os-x.urc && mv /home/first-world.info/shop/download/161e15b3dfd41a1c4fc265d8d2d856a07e8df559.zip /home/first-world.info/shop/download/161e15b3dfd41a1c4fc265d8d2d856a07e8df559 +#cd /home/first-world.info/files-rw/ultracopier/plugins/CopyEngine/Rsync/ && rm -f /home/first-world.info/shop/download/7fee8026fb4f7d9bfcb9790dfa0db25a514f79da && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/7fee8026fb4f7d9bfcb9790dfa0db25a514f79da *${ULTRACOPIER_VERSION}*-x86_64.urc *${ULTRACOPIER_VERSION}*-x86.urc *${ULTRACOPIER_VERSION}*-mac-os-x.urc && mv /home/first-world.info/shop/download/7fee8026fb4f7d9bfcb9790dfa0db25a514f79da.zip /home/first-world.info/shop/download/7fee8026fb4f7d9bfcb9790dfa0db25a514f79da +#cd /home/first-world.info/files-rw/ultracopier/plugins/Themes/Windows/ && rm -f /home/first-world.info/shop/download/59c9fb956fedf4d7a6ef6fe84371882bc5591256 && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/59c9fb956fedf4d7a6ef6fe84371882bc5591256 *${ULTRACOPIER_VERSION}*-x86_64.urc *${ULTRACOPIER_VERSION}*-x86.urc *${ULTRACOPIER_VERSION}*-mac-os-x.urc && mv /home/first-world.info/shop/download/59c9fb956fedf4d7a6ef6fe84371882bc5591256.zip /home/first-world.info/shop/download/59c9fb956fedf4d7a6ef6fe84371882bc5591256 +#cd /home/first-world.info/files-rw/ultracopier/plugins/Themes/Supercopier/ && rm -f /home/first-world.info/shop/download/c3386f6d227585eb9672fff25b5865208a451cc3 && nice -n 19 ionice -c 3 zip -9 -q /home/first-world.info/shop/download/c3386f6d227585eb9672fff25b5865208a451cc3 *${ULTRACOPIER_VERSION}*-x86_64.urc *${ULTRACOPIER_VERSION}*-x86.urc *${ULTRACOPIER_VERSION}*-mac-os-x.urc && mv /home/first-world.info/shop/download/c3386f6d227585eb9672fff25b5865208a451cc3.zip /home/first-world.info/shop/download/c3386f6d227585eb9672fff25b5865208a451cc3 + +/usr/bin/php /home/first-world.info/shop/update_ultracopier_version.php ${ULTRACOPIER_VERSION} +echo "Upload to the shop... done" + +echo "Clean the ultimate version..." +#mv /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ultracopier-ultimate-* ${TEMP_PATH}/ +#mv ${TEMP_PATH}/ultracopier-ultimate-cgminer-windows-x86* /home/first-world.info/files-rw/ultracopier/${ULTRACOPIER_VERSION}/ +#mv /home/first-world.info/files-rw/supercopier/${SUPERCOPIER_VERSION}/supercopier-ultimate-* ${TEMP_PATH}/ +#mv ${TEMP_PATH}/supercopier-ultimate-cgminer-windows-x86* /home/first-world.info/files-rw/supercopier/${SUPERCOPIER_VERSION}/ +rm -Rf ${TEMP_PATH}/* +echo "Clean the ultimate version... done" + +echo "Change the static files..." +echo ${ULTRACOPIER_VERSION} > /home/first-world.info/ultracopier/updater.txt +echo ${ULTRACOPIER_VERSION} > /home/first-world.info/ultracopier-update/updater.txt +/etc/init.d/lighttpd restart +echo "Change the static files... done" diff --git a/tools/to-pack/test.sh b/tools/to-pack/test.sh new file mode 100755 index 0000000..14245a4 --- /dev/null +++ b/tools/to-pack/test.sh @@ -0,0 +1,55 @@ +#!/bin/bash +export TEMP_PATH="/home/ultracopier-temp/" +export WINEBASEPATH="/home/wine/" +export ULTRACOPIERSOURCESPATH="/root/ultracopier/sources/" +export BASE_PWD=`pwd` + +export ULTRACOPIER_VERSION=`grep -F "ULTRACOPIER_VERSION" ${ULTRACOPIERSOURCESPATH}/Variable.h | grep -F "1.4" | sed -r "s/^.*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*$/\1/g"` +function valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} +if ! valid_ip ${ULTRACOPIER_VERSION}; then + echo Wrong version: ${ULTRACOPIER_VERSION} + exit +fi +echo Version: ${ULTRACOPIER_VERSION} + +rm -Rf ${TEMP_PATH} > /dev/null 2>&1 +rm -Rf ${ULTRACOPIERSOURCESPATH}/plugins-alternative/CopyEngine/Ultracopier/ > /dev/null 2>&1 +mkdir -p ${TEMP_PATH} +find ../ -name "Thumbs.db" -exec rm {} \; >> /dev/null 2>&1 +find ../ -name ".directory" -exec rm {} \; >> /dev/null 2>&1 + +echo "Do the test folder..." +source sub-script/test.sh +cd ${BASE_PWD} +echo "Do the test folder... done" + +./4-clean-all.sh +rm /home/first-world.info/ultracopier/temp/* + + +if [ -f ${TEMP_PATH}/*.7z ] +then + cp /home/ultracopier-temp/*.7z /home/first-world.info/ultracopier/temp/ +fi +if [ -f ${TEMP_PATH}/*.zip ] +then + cp /home/ultracopier-temp/*.zip /home/first-world.info/ultracopier/temp/ +fi +if [ -f ${TEMP_PATH}/*-setup.exe ] +then + cp /home/ultracopier-temp/*-setup.exe /home/first-world.info/ultracopier/temp/ +fi 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.dox b/ultracopier.dox new file mode 100644 index 0000000..47b83b3 --- /dev/null +++ b/ultracopier.dox @@ -0,0 +1,39 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Ultracopier + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GPLv3 + *****************************************************************************/ + +/* + This file contains NO source code, just some documentation for doxygen to + parse. +*/ + +/*! + \mainpage Ultracopier + + \section mainpage_overview Overview + + Ultracopier provide an advanced copier with play/pause/resume, with advanced management like playlist. + This documentation is FOR DEVELOPMENT, use the wiki of ultracopier for end user documentation, general documentation, algorithm documentation. + + \section mainpage_platforms Platforms + + 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 + + Stable releases are available at the Ultracopier + project page. + + \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 \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 new file mode 100644 index 0000000..68c8886 --- /dev/null +++ b/ultracopier.pro @@ -0,0 +1,137 @@ +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE + +include(other-pro/ultracopier-core.pro) + +RESOURCES += $$PWD/plugins/static-plugins.qrc \ + $$PWD/plugins/CopyEngine/Ultracopier/copyEngineResources.qrc \ + $$PWD/plugins/Themes/Oxygen/interfaceResources_unix.qrc \ + $$PWD/plugins/Themes/Oxygen/interfaceResources_windows.qrc \ + $$PWD/plugins/Themes/Oxygen/interfaceResources.qrc + +win32:RESOURCES += $$PWD/plugins/static-plugins-windows.qrc + +HEADERS -= $$PWD/lib/qt-tar-xz/xz.h \ + $$PWD/lib/qt-tar-xz/QXzDecodeThread.h \ + $$PWD/lib/qt-tar-xz/QXzDecode.h \ + $$PWD/lib/qt-tar-xz/QTarDecode.h \ + $$PWD/AuthPlugin.h +SOURCES -= $$PWD/lib/qt-tar-xz/QXzDecodeThread.cpp \ + $$PWD/lib/qt-tar-xz/QXzDecode.cpp \ + $$PWD/lib/qt-tar-xz/QTarDecode.cpp \ + $$PWD/lib/qt-tar-xz/xz_crc32.c \ + $$PWD/lib/qt-tar-xz/xz_dec_stream.c \ + $$PWD/lib/qt-tar-xz/xz_dec_lzma2.c \ + $$PWD/lib/qt-tar-xz/xz_dec_bcj.c \ + $$PWD/AuthPlugin.cpp +INCLUDEPATH -= $$PWD/lib/qt-tar-xz/ + +RESOURCES -= $$PWD/resources/resources-windows-qt-plugin.qrc + +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE +DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT + +FORMS += \ + $$PWD/plugins/CopyEngine/Ultracopier/copyEngineOptions.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/debugDialog.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/DiskSpace.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/fileErrorDialog.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/fileExistsDialog.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/fileIsSameDialog.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/FilterRules.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/Filters.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/folderExistsDialog.ui \ + $$PWD/plugins/CopyEngine/Ultracopier/RenamingRules.ui \ + $$PWD/plugins/Themes/Oxygen/themesOptions.ui \ + $$PWD/plugins/Themes/Oxygen/options.ui \ + $$PWD/plugins/Themes/Oxygen/interface.ui + +HEADERS += \ + $$PWD/plugins/CopyEngine/Ultracopier/AvancedQFile.h \ + $$PWD/plugins/CopyEngine/Ultracopier/CompilerInfo.h \ + $$PWD/plugins/CopyEngine/Ultracopier/CopyEngine.h \ + $$PWD/plugins/CopyEngine/Ultracopier/DebugDialog.h \ + $$PWD/plugins/CopyEngine/Ultracopier/DebugEngineMacro.h \ + $$PWD/plugins/CopyEngine/Ultracopier/DiskSpace.h \ + $$PWD/plugins/CopyEngine/Ultracopier/DriveManagement.h \ + $$PWD/plugins/CopyEngine/Ultracopier/Environment.h \ + $$PWD/plugins/CopyEngine/Ultracopier/CopyEngineFactory.h \ + $$PWD/plugins/CopyEngine/Ultracopier/FileErrorDialog.h \ + $$PWD/plugins/CopyEngine/Ultracopier/FileExistsDialog.h \ + $$PWD/plugins/CopyEngine/Ultracopier/FileIsSameDialog.h \ + $$PWD/plugins/CopyEngine/Ultracopier/FilterRules.h \ + $$PWD/plugins/CopyEngine/Ultracopier/Filters.h \ + $$PWD/plugins/CopyEngine/Ultracopier/FolderExistsDialog.h \ + $$PWD/plugins/CopyEngine/Ultracopier/MkPath.h \ + $$PWD/plugins/CopyEngine/Ultracopier/ListThread.h \ + $$PWD/plugins/CopyEngine/Ultracopier/ReadThread.h \ + $$PWD/plugins/CopyEngine/Ultracopier/RenamingRules.h \ + $$PWD/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.h \ + $$PWD/plugins/CopyEngine/Ultracopier/StructEnumDefinition_CopyEngine.h \ + $$PWD/plugins/CopyEngine/Ultracopier/StructEnumDefinition.h \ + $$PWD/plugins/CopyEngine/Ultracopier/TransferThread.h \ + $$PWD/plugins/CopyEngine/Ultracopier/Variable.h \ + $$PWD/plugins/CopyEngine/Ultracopier/WriteThread.h \ + $$PWD/plugins/Listener/catchcopy-v0002/Variable.h \ + $$PWD/plugins/Listener/catchcopy-v0002/StructEnumDefinition.h \ + $$PWD/plugins/Listener/catchcopy-v0002/listener.h \ + $$PWD/plugins/Listener/catchcopy-v0002/Environment.h \ + $$PWD/plugins/Listener/catchcopy-v0002/DebugEngineMacro.h \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.h \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/VariablesCatchcopy.h \ + $$PWD/plugins/Themes/Oxygen/DebugEngineMacro.h \ + $$PWD/plugins/Themes/Oxygen/Environment.h \ + $$PWD/plugins/Themes/Oxygen/ThemesFactory.h \ + $$PWD/plugins/Themes/Oxygen/interface.h \ + $$PWD/plugins/Themes/Oxygen/Variable.h \ + $$PWD/plugins/Themes/Oxygen/TransferModel.h \ + $$PWD/plugins/Themes/Oxygen/StructEnumDefinition.h + +SOURCES += \ + $$PWD/plugins/CopyEngine/Ultracopier/AvancedQFile.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/CopyEngine-collision-and-error.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/CopyEngine.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/DebugDialog.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/DiskSpace.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/DriveManagement.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/CopyEngineFactory.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/FileErrorDialog.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/FileExistsDialog.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/FileIsSameDialog.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/FilterRules.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/Filters.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/FolderExistsDialog.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/ListThread_InodeAction.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/MkPath.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/ReadThread.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/RenamingRules.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/ScanFileOrFolder.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/TransferThread.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/WriteThread.cpp \ + $$PWD/plugins/CopyEngine/Ultracopier/ListThread.cpp \ + $$PWD/plugins/Listener/catchcopy-v0002/listener.cpp \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp \ + $$PWD/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp \ + $$PWD/plugins/Themes/Oxygen/ThemesFactory.cpp \ + $$PWD/plugins/Themes/Oxygen/interface.cpp \ + $$PWD/plugins/Themes/Oxygen/TransferModel.cpp + +win32 { + RESOURCES -= $$PWD/resources/resources-windows-qt-plugin.qrc + + HEADERS += \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/StructEnumDefinition.h \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/Environment.h \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/Variable.h \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/PlatformMacro.h \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h + SOURCES += \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp \ + $$PWD/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp + FORMS += $$PWD/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui + LIBS += -lole32 -lshell32 +} -- cgit v1.2.3