From b3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 24 Nov 2017 23:24:09 +0000 Subject: New upstream version 1.2.3.6 --- .../Themes/Teracopy/DebugEngineMacro.h | 7 +- plugins-alternative/Themes/Teracopy/Environment.h | 3 +- .../Themes/Teracopy/Languages/ar/translation.ts | 8 +- .../Themes/Teracopy/Languages/de/translation.ts | 26 +- .../Themes/Teracopy/Languages/el/translation.ts | 8 +- .../Themes/Teracopy/Languages/en/translation.ts | 89 +++ .../Themes/Teracopy/Languages/es/translation.ts | 14 +- .../Themes/Teracopy/Languages/fr/translation.ts | 9 +- .../Themes/Teracopy/Languages/hi/translation.ts | 8 +- .../Themes/Teracopy/Languages/hu/translation.ts | 93 +++ .../Themes/Teracopy/Languages/id/translation.ts | 8 +- .../Themes/Teracopy/Languages/it/translation.ts | 26 +- .../Themes/Teracopy/Languages/ja/translation.ts | 8 +- .../Themes/Teracopy/Languages/ko/translation.ts | 6 +- .../Themes/Teracopy/Languages/nl/translation.ts | 8 +- .../Themes/Teracopy/Languages/no/translation.ts | 8 +- .../Themes/Teracopy/Languages/pl/translation.ts | 8 +- .../Themes/Teracopy/Languages/ru/translation.ts | 14 +- .../Themes/Teracopy/Languages/th/translation.ts | 8 +- .../Themes/Teracopy/Languages/tr/translation.ts | 8 +- .../Themes/Teracopy/Languages/zh/translation.ts | 8 +- .../Themes/Teracopy/TransferModel.cpp | 841 ++++++++++++--------- .../Themes/Teracopy/TransferModel.h | 120 +-- plugins-alternative/Themes/Teracopy/Variable.h | 3 +- .../Themes/Teracopy/documentation.dox | 6 +- plugins-alternative/Themes/Teracopy/factory.cpp | 107 ++- plugins-alternative/Themes/Teracopy/factory.h | 38 +- .../Themes/Teracopy/informations.xml | 3 +- plugins-alternative/Themes/Teracopy/interface.cpp | 695 +++++++++-------- plugins-alternative/Themes/Teracopy/interface.h | 289 +++---- plugins-alternative/Themes/Teracopy/interface.pro | 31 +- plugins-alternative/Themes/Teracopy/interface.ui | 14 +- plugins-alternative/Themes/Teracopy/plugin.json | 1 + plugins-alternative/Themes/Teracopy/resources.qrc | 2 +- .../Teracopy/resources/SystemTrayIcon/add.png | Bin 564 -> 552 bytes .../Teracopy/resources/SystemTrayIcon/exit.png | Bin 775 -> 874 bytes .../resources/SystemTrayIcon/informations.png | Bin 734 -> 841 bytes .../Teracopy/resources/SystemTrayIcon/options.png | Bin 660 -> 624 bytes .../SystemTrayIcon/systray_Caught_Unix.png | Bin 798 -> 1093 bytes .../SystemTrayIcon/systray_Caught_Windows.png | Bin 563 -> 623 bytes .../SystemTrayIcon/systray_Semiuncaught_Unix.png | Bin 1007 -> 1296 bytes .../systray_Semiuncaught_Windows.png | Bin 664 -> 841 bytes .../SystemTrayIcon/systray_Uncaught_Unix.png | Bin 789 -> 754 bytes .../SystemTrayIcon/systray_Uncaught_Windows.png | Bin 551 -> 485 bytes .../Themes/Teracopy/resources/checkbox.png | Bin 654 -> 619 bytes .../Themes/Teracopy/resources/main.png | Bin 563 -> 623 bytes .../Themes/Teracopy/resources/player_pause.png | Bin 484 -> 640 bytes .../Themes/Teracopy/resources/player_play.png | Bin 501 -> 673 bytes .../Themes/Teracopy/resources_unix.qrc | 4 +- .../Themes/Teracopy/resources_windows.qrc | 2 +- 50 files changed, 1426 insertions(+), 1105 deletions(-) create mode 100644 plugins-alternative/Themes/Teracopy/Languages/en/translation.ts create mode 100644 plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts mode change 100755 => 100644 plugins-alternative/Themes/Teracopy/documentation.dox create mode 100644 plugins-alternative/Themes/Teracopy/plugin.json (limited to 'plugins-alternative/Themes/Teracopy') diff --git a/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h b/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h index a3dd648..4582010 100644 --- a/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h +++ b/plugins-alternative/Themes/Teracopy/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins-alternative/Themes/Teracopy/Environment.h b/plugins-alternative/Themes/Teracopy/Environment.h index 94fd104..265a5a6 100644 --- a/plugins-alternative/Themes/Teracopy/Environment.h +++ b/plugins-alternative/Themes/Teracopy/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h \brief Define the environment variable and global function \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #include "Variable.h" /// \brief The global include diff --git a/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ar/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts index 237dc4f..a2da10c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/de/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 Total: %1 von %2 - + %1 of %2 %1 von %2 - + %1% done %1% erledigt @@ -24,27 +24,27 @@ &More - Mehr + &Mehr ... - + ... &Pause - + &Pause &Skip - überspringen + überspringen (&S) &Cancel - Stornieren + Abbrechen (&C) @@ -72,22 +72,22 @@ p, li { white-space: pre-wrap; } Move file(s) - Bewegen Sie Datei (en) + Datei (en) verschieben Move folder - bewegen Sie Ordner + Ordner verschieben Copy file(s) - Kopieren Sie die Datei (en) + Datei (en) kopieren Copy folder - kopieren Sie das Verzeichnis + Verzeichnis kopieren diff --git a/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/el/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/en/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/en/translation.ts new file mode 100644 index 0000000..d9fb1d6 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/en/translation.ts @@ -0,0 +1,89 @@ + + + + + Themes + + + Total: %1 of %2 + + + + + %1 of %2 + + + + + %1% done + + + + + interfaceCopy + + + &More + + + + + ... + + + + + &Pause + + + + + &Skip + + + + + &Cancel + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Support Ultracopier</span></a></p></body></html> + + + + + Add file + + + + + Add folder + + + + + Move file(s) + + + + + Move folder + + + + + Copy file(s) + + + + + Copy folder + + + + diff --git a/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts index fe526da..5081c0f 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/es/translation.ts @@ -2,21 +2,21 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - Total: %1 de %2 + Total: %1 de %2 - + %1 of %2 - %1 de %2 + %1 de %2 - + %1% done - %1% hecho + %1% hecho diff --git a/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts index 42ac61d..fd6eaa1 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/fr/translation.ts @@ -2,20 +2,21 @@ - InterfacePlugin + Themes - + Total: %1 of %2 Total: %1 sur %2 - + %1 of %2 %1 sur %2 - + %1% done + Exemple: 90% fait %1% fait diff --git a/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/hi/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts new file mode 100644 index 0000000..3d940b4 --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/Languages/hu/translation.ts @@ -0,0 +1,93 @@ + + + + + Themes + + + Total: %1 of %2 + Összesen: %1 / %2 + + + + %1 of %2 + %1 / %2 + + + + %1% done + %1% kész + + + + interfaceCopy + + + &More + &Több + + + + ... + ... + + + + &Pause + &Szünet + + + + &Skip + &Kihagy + + + + &Cancel + &Mégse + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Support Ultracopier</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Támogasd az Ultracopier-t</span></a></p></body></html> + + + + Add file + Fájl hozzáadása + + + + Add folder + Mappa hozzáadása + + + + Move file(s) + Fájl(ok) mozgatása + + + + Move folder + Mappa mozgatása + + + + Copy file(s) + Fájl(ok) másolása + + + + Copy folder + Mappa másolása + + + diff --git a/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/id/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts index 746b8a6..31d775e 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/it/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 Totale: %1 di %2 - + %1 of %2 %1 di %2 - + %1% done %1% fatto @@ -24,27 +24,27 @@ &More - Di più + Alt&o ... - + ... &Pause - Pausa + &Pausa &Skip - Saltare + &Salta &Cancel - Annullare + &Annulla @@ -57,7 +57,7 @@ p, li { white-space: pre-wrap; } <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Sostenere Ultracopier</span></a></p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://ultracopier.first-world.info/"><span style=" font-size:8pt; text-decoration: underline; color:#0057ae;">Supporto Ultracopier</span></a></p></body></html> @@ -72,17 +72,17 @@ p, li { white-space: pre-wrap; } Move file(s) - Spostare file(s) + Sposta file Move folder - Spostare la cartella + Sposta la cartella Copy file(s) - Copiare il file(s) + Copia file diff --git a/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ja/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts index 6c66c5a..06946e9 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ko/translation.ts @@ -2,9 +2,9 @@ - InterfacePlugin + Themes - + Total: %1 of %2 전체: %3 / %2 {1 ?} @@ -14,7 +14,7 @@ %1 / %2 - + %1% done %1% 완료 diff --git a/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/nl/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/no/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/pl/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts index 1219c56..db1059e 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/ru/translation.ts @@ -2,21 +2,21 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - Всего: %1 из %2 + Всего: %1 из %2 - + %1 of %2 - %1 из %2 + %1 из %2 - + %1% done - %1% сделанный + %1% сделанный diff --git a/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/th/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/tr/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts b/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts index 33cd084..b76694c 100644 --- a/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts +++ b/plugins-alternative/Themes/Teracopy/Languages/zh/translation.ts @@ -2,19 +2,19 @@ - InterfacePlugin + Themes - + Total: %1 of %2 - + %1 of %2 - + %1% done diff --git a/plugins-alternative/Themes/Teracopy/TransferModel.cpp b/plugins-alternative/Themes/Teracopy/TransferModel.cpp index 569d31c..24812a0 100644 --- a/plugins-alternative/Themes/Teracopy/TransferModel.cpp +++ b/plugins-alternative/Themes/Teracopy/TransferModel.cpp @@ -6,145 +6,146 @@ TransferModel::TransferModel() { - iconStart=QIcon(":/resources/player_play.png"); - iconPause=QIcon(":/resources/player_pause.png"); - iconStop=QIcon(":/resources/checkbox.png"); - currentIndexSearch=0; - haveSearchItem=false; + iconStart=QIcon(":/Themes/Teracopy/resources/player_play.png"); + iconPause=QIcon(":/Themes/Teracopy/resources/player_pause.png"); + iconStop=QIcon(":/Themes/Teracopy/resources/checkbox.png"); + currentIndexSearch=0; + haveSearchItem=false; + facilityEngine=NULL; } int TransferModel::columnCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? COLUMN_COUNT : 0; + return parent == QModelIndex() ? COLUMN_COUNT : 0; } QVariant TransferModel::data( const QModelIndex& index, int role ) const { - int row,column; - row=index.row(); - column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) - return QVariant(); + int row,column; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return QVariant(); - const transfertItem& item = transfertItemList[row]; - if(role==Qt::UserRole) - return item.id; - else if(role==Qt::DisplayRole) - { - switch(column) - { - case 0: - return item.source; - break; - case 1: - return item.size; - break; - case 2: - return item.destination; - break; - default: - return QVariant(); - } - } - else if(role==Qt::DecorationRole) - { - switch(column) - { - case 0: - /*if(item.done) - return iconStop; - else */if(stopId.contains(item.id)) - return iconPause; - else if(startId.contains(item.id)) - return iconStart; - else - return QVariant(); - break; - default: - return QVariant(); - } - } - else if(role==Qt::BackgroundRole) - { - if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) - { - if(haveSearchItem && searchId==item.id) - return QColor(255,150,150,100); - else - return QColor(255,255,0,100); - } - else - return QVariant(); - } - return QVariant(); + const transfertItem& item = transfertItemList[row]; + if(role==Qt::UserRole) + return item.id; + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + return item.source; + break; + case 1: + return item.size; + break; + case 2: + return item.destination; + break; + default: + return QVariant(); + } + } + else if(role==Qt::DecorationRole) + { + switch(column) + { + case 0: + /*if(item.done) + return iconStop; + else */if(stopId.contains(item.id)) + return iconPause; + else if(startId.contains(item.id)) + return iconStart; + else + return QVariant(); + break; + default: + return QVariant(); + } + } + else if(role==Qt::BackgroundRole) + { + if(!search_text.isEmpty() && (item.source.indexOf(search_text,0,Qt::CaseInsensitive)!=-1 || item.destination.indexOf(search_text,0,Qt::CaseInsensitive)!=-1)) + { + if(haveSearchItem && searchId==item.id) + return QColor(255,150,150,100); + else + return QColor(255,255,0,100); + } + else + return QVariant(); + } + return QVariant(); } int TransferModel::rowCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? transfertItemList.count() : 0; + return parent == QModelIndex() ? transfertItemList.count() : 0; } quint64 TransferModel::firstId() { - if(transfertItemList.count()>0) - return transfertItemList[0].id; - else - return 0; + if(transfertItemList.count()>0) + return transfertItemList[0].id; + else + return 0; } QVariant TransferModel::headerData( int section, Qt::Orientation orientation, int role ) const { - if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { - switch ( section ) { - case 0: - return facilityEngine->translateText("Source"); - case 1: - return facilityEngine->translateText("Size"); - case 2: - return facilityEngine->translateText("Destination"); - } - } + if ( role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < COLUMN_COUNT ) { + switch ( section ) { + case 0: + return facilityEngine->translateText("Source"); + case 1: + return facilityEngine->translateText("Size"); + case 2: + return facilityEngine->translateText("Destination"); + } + } - return QAbstractTableModel::headerData( section, orientation, role ); + return QAbstractTableModel::headerData( section, orientation, role ); } bool TransferModel::setData( const QModelIndex& index, const QVariant& value, int role ) { - row=index.row(); - column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) - return false; + row=index.row(); + column=index.column(); + if(index.parent()!=QModelIndex() || row < 0 || row >= transfertItemList.count() || column < 0 || column >= COLUMN_COUNT) + return false; - transfertItem& item = transfertItemList[row]; - if(role==Qt::UserRole) - { - item.id=value.toULongLong(); - return true; - } - else if(role==Qt::DisplayRole) - { - switch(column) - { - case 0: - item.source=value.toString(); - emit dataChanged(index,index); - return true; - break; - case 1: - item.size=value.toString(); - emit dataChanged(index,index); - return true; - break; - case 2: - item.destination=value.toString(); - emit dataChanged(index,index); - return true; - break; - default: - return false; - } - } - return false; + transfertItem& item = transfertItemList[row]; + if(role==Qt::UserRole) + { + item.id=value.toULongLong(); + return true; + } + else if(role==Qt::DisplayRole) + { + switch(column) + { + case 0: + item.source=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 1: + item.size=value.toString(); + emit dataChanged(index,index); + return true; + break; + case 2: + item.destination=value.toString(); + emit dataChanged(index,index); + return true; + break; + default: + return false; + } + } + return false; } /* @@ -152,290 +153,376 @@ bool TransferModel::setData( const QModelIndex& index, const QVariant& value, in Return[1]: totalSize Return[2]: currentFile */ -QList TransferModel::synchronizeItems(const QList& returnActions) +QList TransferModel::synchronizeItems(const QList& returnActions) { - loop_size=returnActions.size(); - index_for_loop=0; - totalFile=0; - totalSize=0; - currentFile=0; - emit layoutAboutToBeChanged(); - while(index_for_loopsizeToString(action.addAction.size); - newItem.destination=action.addAction.destinationFullPath; + loop_size=returnActions.size(); + index_for_loop=0; + totalFile=0; + totalSize=0; + currentFile=0; + emit layoutAboutToBeChanged(); + while(index_for_loopsizeToString(action.addAction.size); + newItem.destination=action.addAction.destinationFullPath; // newItem.done=false; - transfertItemList<(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.moveAt<0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.moveAt>(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - transfertItemList.move(action.userAction.position,action.userAction.moveAt); - } - break; - case RemoveItem: - { - if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) - currentIndexSearch--; - if(action.userAction.position<0) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - if(action.userAction.position>(transfertItemList.size()-1)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); - break; - } - transfertItemList.removeAt(action.userAction.position); - currentFile++; - startId.remove(action.addAction.id); - stopId.remove(action.addAction.id); - } - break; - case PreOperation: - { - ItemOfCopyListWithMoreInformations tempItem; - tempItem.currentProgression=0; - tempItem.generalData=action.addAction; - tempItem.actionType=action.type; - internalRunningOperation[action.addAction.id]=tempItem; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("set for file %1: actionType: PreOperation").arg(action.addAction.id)); - } - break; - case Transfer: - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("found entry for file %1: actionType: Transfer").arg(action.addAction.id)); - if(!startId.contains(action.addAction.id)) - startId << action.addAction.id; - stopId.remove(action.addAction.id); - if(internalRunningOperation.contains(action.addAction.id)) - internalRunningOperation[action.addAction.id].actionType=action.type; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); - } - break; - case PostOperation: - { - if(!stopId.contains(action.addAction.id)) - stopId << action.addAction.id; - startId.remove(action.addAction.id); - internalRunningOperation.remove(action.addAction.id); - } - break; - case CustomOperation: - { - bool custom_with_progression=(action.addAction.size==1); - //without progression - if(custom_with_progression) - { - if(startId.remove(action.addAction.id)) - if(!stopId.contains(action.addAction.id)) - stopId << action.addAction.id; - } - //with progression - else - { - stopId.remove(action.addAction.id); - if(!startId.contains(action.addAction.id)) - startId << action.addAction.id; - } - if(internalRunningOperation.contains(action.addAction.id)) - { - ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; - item.actionType=action.type; - item.custom_with_progression=custom_with_progression; - item.currentProgression=0; - } - } - break; - default: - //unknow code, ignore it - break; - } - index_for_loop++; - } - emit layoutChanged(); - return QList() << totalFile << totalSize << currentFile; + transfertItemList<(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.moveAt>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.move(action.userAction.position,action.userAction.moveAt); + } + break; + case Ultracopier::RemoveItem: + { + if(currentIndexSearch>0 && action.userAction.position<=currentIndexSearch) + currentIndexSearch--; + if(action.userAction.position<0) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + if(action.userAction.position>(transfertItemList.size()-1)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("id: %1, position is wrong: %3").arg(action.addAction.id).arg(action.userAction.position)); + break; + } + transfertItemList.removeAt(action.userAction.position); + currentFile++; + startId.remove(action.addAction.id); + stopId.remove(action.addAction.id); + internalRunningOperation.remove(action.addAction.id); + } + break; + case Ultracopier::PreOperation: + { + ItemOfCopyListWithMoreInformations tempItem; + tempItem.currentReadProgression=0; + tempItem.currentWriteProgression=0; + tempItem.generalData=action.addAction; + tempItem.actionType=action.type; + internalRunningOperation[action.addAction.id]=tempItem; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("set for file %1: actionType: PreOperation").arg(action.addAction.id)); + } + break; + case Ultracopier::Transfer: + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + stopId.remove(action.addAction.id); + if(internalRunningOperation.contains(action.addAction.id)) + internalRunningOperation[action.addAction.id].actionType=action.type; + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to found entry for file %1: actionType: Transfer").arg(action.addAction.id)); + } + break; + case Ultracopier::PostOperation: + { + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + startId.remove(action.addAction.id); + } + break; + case Ultracopier::CustomOperation: + { + bool custom_with_progression=(action.addAction.size==1); + //without progression + if(custom_with_progression) + { + if(startId.remove(action.addAction.id)) + if(!stopId.contains(action.addAction.id)) + stopId << action.addAction.id; + } + //with progression + else + { + stopId.remove(action.addAction.id); + if(!startId.contains(action.addAction.id)) + startId << action.addAction.id; + } + if(internalRunningOperation.contains(action.addAction.id)) + { + ItemOfCopyListWithMoreInformations &item=internalRunningOperation[action.addAction.id]; + item.actionType=action.type; + item.custom_with_progression=custom_with_progression; + item.currentReadProgression=0; + item.currentWriteProgression=0; + } + } + break; + default: + //unknow code, ignore it + break; + } + index_for_loop++; + } + emit layoutChanged(); + return QList() << totalFile << totalSize << currentFile; } void TransferModel::setFacilityEngine(FacilityInterface * facilityEngine) { - this->facilityEngine=facilityEngine; + this->facilityEngine=facilityEngine; } int TransferModel::search(const QString &text,bool searchNext) { - emit layoutAboutToBeChanged(); - search_text=text; - emit layoutChanged(); - if(transfertItemList.size()==0) - return -1; - if(text.isEmpty()) - return -1; - if(searchNext) - { - currentIndexSearch++; - if(currentIndexSearch>=loop_size) - currentIndexSearch=0; - } - index_for_loop=0; - loop_size=transfertItemList.size(); - while(index_for_loop=loop_size) - currentIndexSearch=0; - index_for_loop++; - } - haveSearchItem=false; - return -1; + emit layoutAboutToBeChanged(); + search_text=text; + emit layoutChanged(); + if(transfertItemList.size()==0) + return -1; + if(text.isEmpty()) + return -1; + if(searchNext) + { + currentIndexSearch++; + if(currentIndexSearch>=loop_size) + currentIndexSearch=0; + } + index_for_loop=0; + loop_size=transfertItemList.size(); + while(index_for_loop=loop_size) + currentIndexSearch=0; + index_for_loop++; + } + haveSearchItem=false; + return -1; } int TransferModel::searchPrev(const QString &text) { - emit layoutAboutToBeChanged(); - search_text=text; - emit layoutChanged(); - if(transfertItemList.size()==0) - return -1; - if(text.isEmpty()) - return -1; - if(currentIndexSearch==0) - currentIndexSearch=loop_size-1; - else - currentIndexSearch--; - index_for_loop=0; - loop_size=transfertItemList.size(); - while(index_for_loop &progressionList) +void TransferModel::setFileProgression(QList &progressionList) { - loop_size=progressionList.size(); - index_for_loop=0; - while(index_for_loop0) - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"progression remaning items"); - #endif + loop_size=progressionList.size(); + index_for_loop=0; + while(index_for_loop0) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"progression remaning items"); + #endif } TransferModel::currentTransfertItem TransferModel::getCurrentTransfertItem() { - currentTransfertItem returnItem; - returnItem.haveItem=startId.size()>0; - if(returnItem.haveItem) - { - if(!internalRunningOperation.contains(*startId.constBegin())) - { - returnItem.haveItem=false; - return returnItem; - } - const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*startId.constBegin()]; - returnItem.from=itemTransfer.generalData.sourceFullPath; - returnItem.to=itemTransfer.generalData.destinationFullPath; - returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); - switch(itemTransfer.actionType) - { - case CustomOperation: - if(!itemTransfer.custom_with_progression) - returnItem.progressBar_file=-1; - else - { - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=-1; - } - break; - case Transfer: - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - break; - //should never pass here - case PostOperation: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - returnItem.progressBar_file=65535; - break; - //should never pass here - case PreOperation: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - returnItem.progressBar_file=0; - break; - default: - returnItem.progressBar_file=0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); - break; - } - } -/* else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("No have running item"));*/ - return returnItem; + currentTransfertItem returnItem; + returnItem.progressBar_read=-1; + returnItem.progressBar_write=0; + returnItem.haveItem=startId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*startId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*startId.constBegin()]; + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + //should never pass here + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + else + { + returnItem.haveItem=stopId.size()>0; + if(returnItem.haveItem) + { + if(!internalRunningOperation.contains(*stopId.constBegin())) + { + returnItem.haveItem=false; + return returnItem; + } + const ItemOfCopyListWithMoreInformations &itemTransfer=internalRunningOperation[*stopId.constBegin()]; + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + returnItem.id=itemTransfer.generalData.id; + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_read=-1; + else + { + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + returnItem.progressBar_read=-1; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + { + returnItem.progressBar_read=((double)itemTransfer.currentReadProgression/itemTransfer.generalData.size)*65535; + returnItem.progressBar_write=((double)itemTransfer.currentWriteProgression/itemTransfer.generalData.size)*65535; + } + else + { + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + } + break; + case Ultracopier::PostOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + break; + //should never pass here + case Ultracopier::PreOperation: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("wrong action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + returnItem.progressBar_read=0; + returnItem.progressBar_write=0; + break; + default: + returnItem.progressBar_read=65535; + returnItem.progressBar_write=65535; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unknow action type for file %1: actionType: %2").arg(itemTransfer.generalData.id).arg(itemTransfer.actionType)); + break; + } + } + } + if(returnItem.haveItem && returnItem.progressBar_read!=-1 && returnItem.progressBar_write>returnItem.progressBar_read) + { + int tempVar=returnItem.progressBar_write; + returnItem.progressBar_write=returnItem.progressBar_read; + returnItem.progressBar_read=tempVar; + } + return returnItem; } diff --git a/plugins-alternative/Themes/Teracopy/TransferModel.h b/plugins-alternative/Themes/Teracopy/TransferModel.h index 486532e..977c986 100644 --- a/plugins-alternative/Themes/Teracopy/TransferModel.h +++ b/plugins-alternative/Themes/Teracopy/TransferModel.h @@ -17,76 +17,76 @@ /// \brief model to store the transfer list class TransferModel : public QAbstractTableModel { - Q_OBJECT + Q_OBJECT public: - /// \brief the transfer item displayed - struct transfertItem - { - quint64 id; - QString source; - QString size; - QString destination; - }; - /// \brief the transfer item with progression - struct ItemOfCopyListWithMoreInformations - { - quint64 currentProgression; - ItemOfCopyList generalData; - ActionTypeCopyList actionType; - bool custom_with_progression; - }; - /// \brief returned first transfer item - struct currentTransfertItem - { - quint64 id; - bool haveItem; - QString from; - QString to; - QString current_file; - int progressBar_file; - }; + /// \brief the transfer item displayed + struct transfertItem + { + quint64 id; + QString source; + QString size; + QString destination; + }; + /// \brief the transfer item with progression + struct ItemOfCopyListWithMoreInformations + { + quint64 currentReadProgression,currentWriteProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + /// \brief returned first transfer item + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_read,progressBar_write; + }; - TransferModel(); + TransferModel(); - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - - QList synchronizeItems(const QList& returnActions); - void setFacilityEngine(FacilityInterface * facilityEngine); + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - int search(const QString &text,bool searchNext); - int searchPrev(const QString &text); + QList synchronizeItems(const QList& returnActions); + void setFacilityEngine(FacilityInterface * facilityEngine); - void setFileProgression(QList &progressionList); + int search(const QString &text,bool searchNext); + int searchPrev(const QString &text); - currentTransfertItem getCurrentTransfertItem(); + void setFileProgression(QList &progressionList); - quint64 firstId(); + currentTransfertItem getCurrentTransfertItem(); + + quint64 firstId(); protected: - QList transfertItemList;///< To have a transfer list for the user - QList transfertItemListDone;///< To have a transfer list for the user - QSet startId,stopId;///< To show what is started, what is stopped - QHash internalRunningOperation;///< to have progression and stat - QIcon iconStart,iconPause,iconStop; + QList transfertItemList;///< To have a transfer list for the user + QList transfertItemListDone;///< To have a transfer list for the user + QSet startId,stopId;///< To show what is started, what is stopped + QHash internalRunningOperation;///< to have progression and stat + QIcon iconStart,iconPause,iconStop; private: - int loop_size,index_for_loop; - int sub_loop_size,sub_index_for_loop; - int row,column; - quint64 totalFile,totalSize,currentFile; - FacilityInterface * facilityEngine; - QString search_text; - /// \brief index from start the search, decresed by remove before it - int currentIndexSearch; - bool haveSearchItem; - quint64 searchId; + int loop_size,index_for_loop; + int sub_loop_size,sub_index_for_loop; + int row,column; + quint64 totalFile,totalSize,currentFile; + FacilityInterface * facilityEngine; + QString search_text; + /// \brief index from start the search, decresed by remove before it + int currentIndexSearch; + bool haveSearchItem; + quint64 searchId; signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif }; #endif // TRANSFERMODEL_H diff --git a/plugins-alternative/Themes/Teracopy/Variable.h b/plugins-alternative/Themes/Teracopy/Variable.h index 8179c93..963d0c8 100644 --- a/plugins-alternative/Themes/Teracopy/Variable.h +++ b/plugins-alternative/Themes/Teracopy/Variable.h @@ -1,8 +1,7 @@ /** \file Variable.h \brief Define the environment variable \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef VARIABLE_H #define VARIABLE_H diff --git a/plugins-alternative/Themes/Teracopy/documentation.dox b/plugins-alternative/Themes/Teracopy/documentation.dox old mode 100755 new mode 100644 index a61692b..c1720d2 --- a/plugins-alternative/Themes/Teracopy/documentation.dox +++ b/plugins-alternative/Themes/Teracopy/documentation.dox @@ -11,12 +11,12 @@ \section mainpage_overview Overview It's Teracopy interface, to come from Teracopy to Ultracopier.\n - More informations on the wiki of ultracopier. Is part of Ultracopier 0.3 project as alternative plugin. + More informations on the wiki of ultracopier. Is part of Ultracopier project as alternative plugin. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads diff --git a/plugins-alternative/Themes/Teracopy/factory.cpp b/plugins-alternative/Themes/Teracopy/factory.cpp index 89c3787..2b176bf 100644 --- a/plugins-alternative/Themes/Teracopy/factory.cpp +++ b/plugins-alternative/Themes/Teracopy/factory.cpp @@ -1,83 +1,70 @@ /** \file factory.cpp \brief Define the factory core \author alpha_one_x86 -\version 0.3 -\date 2010 */ - -#include +*/ #include "factory.h" -PluginInterface_Themes * Factory::getInstance() +PluginInterface_Themes * ThemesFactory::getInstance() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - PluginInterface_Themes * newInterface=new InterfacePlugin(facilityEngine); - connect(newInterface,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - connect(this,SIGNAL(reloadLanguage()),newInterface,SLOT(newLanguageLoaded())); - return newInterface; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Themes * newInterface=new Themes(facilityEngine); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(newInterface,&Themes::debugInformation,this,&PluginInterface_ThemesFactory::debugInformation); + #endif + connect(this,&ThemesFactory::reloadLanguage,newInterface,&Themes::newLanguageLoaded); + return newInterface; } -void Factory::setResources(OptionInterface *,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion) +void ThemesFactory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion) { - this->facilityEngine=facilityEngine; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); - Q_UNUSED(portableVersion); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + this->facilityEngine=facilityInterface; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); + Q_UNUSED(portableVersion); + Q_UNUSED(options); } -QWidget * Factory::options() +QWidget * ThemesFactory::options() { - return NULL; + return NULL; } -void Factory::resetOptions() +void ThemesFactory::resetOptions() { } -QIcon Factory::getIcon(const QString &fileName) +QIcon ThemesFactory::getIcon(const QString &fileName) const { - if(fileName=="SystemTrayIcon/exit.png") - { - QIcon tempIcon=QIcon::fromTheme("application-exit"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/add.png") - { - QIcon tempIcon=QIcon::fromTheme("list-add"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/informations.png") - { - QIcon tempIcon=QIcon::fromTheme("help-about"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - if(fileName=="SystemTrayIcon/options.png") - { - QIcon tempIcon=QIcon::fromTheme("applications-system"); - if(!tempIcon.isNull()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("use substitution ionc for: %1").arg(fileName)); - return tempIcon; - } - } - return QIcon(":/resources/"+fileName); + if(fileName=="SystemTrayIcon/exit.png") + { + QIcon tempIcon=QIcon::fromTheme("application-exit"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/add.png") + { + QIcon tempIcon=QIcon::fromTheme("list-add"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/informations.png") + { + QIcon tempIcon=QIcon::fromTheme("help-about"); + if(!tempIcon.isNull()) + return tempIcon; + } + if(fileName=="SystemTrayIcon/options.png") + { + QIcon tempIcon=QIcon::fromTheme("applications-system"); + if(!tempIcon.isNull()) + return tempIcon; + } + return QIcon(":/Themes/Teracopy/resources/"+fileName); } -void Factory::newLanguageLoaded() +void ThemesFactory::newLanguageLoaded() { - emit reloadLanguage(); + emit reloadLanguage(); } - -Q_EXPORT_PLUGIN2(interface, Factory); - diff --git a/plugins-alternative/Themes/Teracopy/factory.h b/plugins-alternative/Themes/Teracopy/factory.h index babac47..0b3bb3f 100644 --- a/plugins-alternative/Themes/Teracopy/factory.h +++ b/plugins-alternative/Themes/Teracopy/factory.h @@ -1,8 +1,7 @@ /** \file factory.h \brief Define the factory \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef FACTORY_H #define FACTORY_H @@ -17,30 +16,27 @@ #include "Environment.h" /// \brief Define the factory, to create instance of the interface -class Factory : public PluginInterface_ThemesFactory +class ThemesFactory : public PluginInterface_ThemesFactory { - Q_OBJECT - Q_INTERFACES(PluginInterface_ThemesFactory) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_ThemesFactory) public: - /// \brief to return the instance of the copy engine - PluginInterface_Themes * getInstance(); - /// \brief set the resources, to store options, to have facilityInterface - void setResources(OptionInterface * optionsEngine,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,bool portableVersion); - /// \brief to get the default options widget - QWidget * options(); - /// \brief to get a resource icon - QIcon getIcon(const QString &fileName); + /// \brief to return the instance of the copy engine + PluginInterface_Themes * getInstance(); + /// \brief set the resources, to store options, to have facilityInterface + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion); + /// \brief to get the default options widget + QWidget * options(); + /// \brief to get a resource icon + QIcon getIcon(const QString &fileName) const; public slots: - void resetOptions(); - void newLanguageLoaded(); + void resetOptions(); + void newLanguageLoaded(); signals: - void reloadLanguage(); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + void reloadLanguage(); private: - FacilityInterface * facilityEngine; + FacilityInterface * facilityEngine; }; #endif // FACTORY_H diff --git a/plugins-alternative/Themes/Teracopy/informations.xml b/plugins-alternative/Themes/Teracopy/informations.xml index 5fd194d..534db9a 100644 --- a/plugins-alternative/Themes/Teracopy/informations.xml +++ b/plugins-alternative/Themes/Teracopy/informations.xml @@ -17,11 +17,10 @@ - 0.3.1.0 + 1.2.3.6 Teracopy =ultracopier-0.3.1.0 ]]> \ No newline at end of file diff --git a/plugins-alternative/Themes/Teracopy/interface.cpp b/plugins-alternative/Themes/Teracopy/interface.cpp index a7014dd..64220d0 100644 --- a/plugins-alternative/Themes/Teracopy/interface.cpp +++ b/plugins-alternative/Themes/Teracopy/interface.cpp @@ -1,376 +1,431 @@ /** \file interface.cpp \brief Define the interface core \author alpha_one_x86 -\version 0.3 -\date 2010 */ +*/ -#include #include +#include #include "interface.h" #include "ui_interface.h" -InterfacePlugin::InterfacePlugin(FacilityInterface * facilityEngine) : - ui(new Ui::interfaceCopy()) +// The cmath header from MSVC does not contain round() +#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER) +inline double round(double d) { + return floor( d + 0.5 ); +} +#endif + +Themes::Themes(FacilityInterface * facilityEngine) : + ui(new Ui::interfaceCopy()) { - this->facilityEngine=facilityEngine; - ui->setupUi(this); - ui->TransferList->setModel(&transferModel); - transferModel.setFacilityEngine(facilityEngine); + this->facilityEngine=facilityEngine; + ui->setupUi(this); + transferModel.setFacilityEngine(facilityEngine); + ui->TransferList->setModel(&transferModel); + + currentFile = 0; + totalFile = 0; + currentSize = 0; + totalSize = 0; + storeIsInPause = false; + modeIsForced = false; + haveStarted = false; + speedString = facilityEngine->speedToString(0); + ui->toolButtonMenu->setMenu(&menu); - currentFile = 0; - totalFile = 0; - currentSize = 0; - totalSize = 0; - this->show(); - storeIsInPause = false; - isInPause(false); - modeIsForced = false; - haveStarted = false; - speedString = facilityEngine->speedToString(0); - ui->toolButtonMenu->setMenu(&menu); - - connect(ui->actionAddFile,SIGNAL(triggered()),this,SLOT(forcedModeAddFile())); - connect(ui->actionAddFileToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToCopy())); - connect(ui->actionAddFileToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToMove())); - connect(ui->actionAddFolderToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToCopy())); - connect(ui->actionAddFolderToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToMove())); - connect(ui->actionAddFolder,SIGNAL(triggered()),this,SLOT(forcedModeAddFolder())); + connect(ui->actionAddFile,&QAction::triggered,this,&Themes::forcedModeAddFile); + connect(ui->actionAddFileToCopy,&QAction::triggered,this,&Themes::forcedModeAddFileToCopy); + connect(ui->actionAddFileToMove,&QAction::triggered,this,&Themes::forcedModeAddFileToMove); + connect(ui->actionAddFolderToCopy,&QAction::triggered,this,&Themes::forcedModeAddFolderToCopy); + connect(ui->actionAddFolderToMove,&QAction::triggered,this,&Themes::forcedModeAddFolderToMove); + connect(ui->actionAddFolder,&QAction::triggered,this,&Themes::forcedModeAddFolder); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - connect(&transferModel,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int))); - #endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG + connect(&transferModel,&TransferModel::debugInformation,this,&Themes::debugInformation); + #endif + + progressColorWrite=QApplication::palette().color(QPalette::Highlight); + progressColorRead=QApplication::palette().color(QPalette::AlternateBase); + progressColorRemaining=QApplication::palette().color(QPalette::Base); + + ui->progressBar_all->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + show(); + isInPause(false); } -InterfacePlugin::~InterfacePlugin() +Themes::~Themes() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); } -QWidget * InterfacePlugin::getOptionsEngineWidget() +QWidget * Themes::getOptionsEngineWidget() { - return &optionEngineWidget; + return &optionEngineWidget; } -void InterfacePlugin::getOptionsEngineEnabled(bool isEnabled) +void Themes::getOptionsEngineEnabled(const bool &isEnabled) { - Q_UNUSED(isEnabled); + Q_UNUSED(isEnabled); } /// \brief set if transfer list is exportable/importable -void InterfacePlugin::setTransferListOperation(TransferListOperation transferListOperation) +void Themes::setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation) +{ + Q_UNUSED(transferListOperation); +} + +void Themes::closeEvent(QCloseEvent *event) +{ + event->ignore(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->hide(); + emit cancel(); +} + +void Themes::updateOverallInformation() { - Q_UNUSED(transferListOperation); + ui->overall->setText(tr("Total: %1 of %2").arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); + ui->labelNumberFile->setText(tr("%1 of %2").arg(currentFile).arg(totalFile)); } -void InterfacePlugin::closeEvent(QCloseEvent *event) +void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action) { - event->ignore(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->hide(); - emit cancel(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start: "+QString::number(action)); + this->action=action; + ui->pauseButton->setEnabled(action!=Ultracopier::Idle); + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + ui->progressBar_all->setMaximum(65535); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Listing: + ui->progressBar_all->setMaximum(0); + ui->progressBar_all->setMinimum(0); + break; + case Ultracopier::Idle: + if(haveStarted) + emit cancel(); + break; + default: + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Very wrong switch case!"); + break; + } + switch(action) + { + case Ultracopier::Copying: + case Ultracopier::CopyingAndListing: + haveStarted=true; + ui->cancelButton->setText(facilityEngine->translateText("Quit")); + if(storeIsInPause) + ui->pauseButton->setText(facilityEngine->translateText("Start")); + else + ui->pauseButton->setText(facilityEngine->translateText("Pause")); + break; + case Ultracopier::Idle: + ui->cancelButton->setText(facilityEngine->translateText("Quit")); + break; + default: + break; + } } -void InterfacePlugin::updateOverallInformation() +void Themes::newFolderListing(const QString &path) { - ui->overall->setText(tr("Total: %1 of %2").arg(facilityEngine->sizeToString(currentSize)).arg(facilityEngine->sizeToString(totalSize))); - ui->labelNumberFile->setText(tr("%1 of %2").arg(currentFile).arg(totalFile)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(action==Ultracopier::Listing) + ui->from->setText(path); } -void InterfacePlugin::actionInProgess(EngineActionInProgress action) +void Themes::detectedSpeed(const quint64 &speed)//in byte per seconds { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"start: "+QString::number(action)); - this->action=action; - ui->pauseButton->setEnabled(action!=Idle); - switch(action) - { - case Copying: - case CopyingAndListing: - ui->progressBar_all->setMaximum(65535); - ui->progressBar_all->setMinimum(0); - break; - case Listing: - ui->progressBar_all->setMaximum(0); - ui->progressBar_all->setMinimum(0); - break; - case Idle: - if(haveStarted) - emit cancel(); - break; - default: - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"Very wrong switch case!"); - break; - } - switch(action) - { - case Copying: - case CopyingAndListing: - haveStarted=true; - break; - case Idle: - ui->cancelButton->setText(facilityEngine->translateText("Quit")); - break; - default: - break; - } + speedString=facilityEngine->speedToString(speed); } -void InterfacePlugin::newFolderListing(const QString &path) +/** \brief support speed limitation */ +void Themes::setSupportSpeedLimitation(const bool &supportSpeedLimitationBool) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(action==Listing) - ui->from->setText(path); + Q_UNUSED(supportSpeedLimitationBool); } -void InterfacePlugin::detectedSpeed(const quint64 &speed)//in byte per seconds +void Themes::remainingTime(const int &remainingSeconds) { - speedString=facilityEngine->speedToString(speed); + if(remainingSeconds==-1) + ui->labelTimeRemaining->setText("∞"); + else + { + Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); + ui->labelTimeRemaining->setText(QString::number(time.hour)+":"+QString::number(time.minute)+":"+QString::number(time.second)); + } } -void InterfacePlugin::remainingTime(const int &remainingSeconds) +void Themes::newCollisionAction(const QString &action) { - if(remainingSeconds==-1) - ui->labelTimeRemaining->setText("∞"); - else - { - TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds); - ui->labelTimeRemaining->setText(QString::number(time.hour)+":"+QString::number(time.minute)+":"+QString::number(time.second)); - } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(action); } -void InterfacePlugin::newCollisionAction(const QString &action) +void Themes::newErrorAction(const QString &action) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - Q_UNUSED(action); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + Q_UNUSED(action); } -void InterfacePlugin::newErrorAction(const QString &action) +void Themes::errorDetected() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - Q_UNUSED(action); } -void InterfacePlugin::errorDetected() +/// \brief new error +void Themes::errorToRetry(const QString &source,const QString &destination,const QString &error) { + Q_UNUSED(source); + Q_UNUSED(destination); + Q_UNUSED(error); } //speed limitation -bool InterfacePlugin::setSpeedLimitation(const qint64 &speedLimitation) +bool Themes::setSpeedLimitation(const qint64 &speedLimitation) { - if(speedLimitation>0) - emit newSpeedLimitation(0); - return true; + if(speedLimitation>0) + emit newSpeedLimitation(0); + return true; } //get information about the copy -void InterfacePlugin::setGeneralProgression(const quint64 ¤t,const quint64 &total) +void Themes::setGeneralProgression(const quint64 ¤t,const quint64 &total) { - currentSize=current; - totalSize=total; - if(total>0) - { - int newIndicator=((double)current/total)*65535; - ui->progressBar_all->setValue(newIndicator); - } - else - ui->progressBar_all->setValue(0); + currentSize=current; + totalSize=total; + if(total>0) + { + int newIndicator=((double)current/total)*65535; + ui->progressBar_all->setValue(newIndicator); + } + else + ui->progressBar_all->setValue(0); } -void InterfacePlugin::setCollisionAction(const QList > &list) +void Themes::setCollisionAction(const QList > &list) { - Q_UNUSED(list); + Q_UNUSED(list); } -void InterfacePlugin::setErrorAction(const QList > &list) +void Themes::setErrorAction(const QList > &list) { - Q_UNUSED(list); + Q_UNUSED(list); } -void InterfacePlugin::setCopyType(CopyType type) +void Themes::setCopyType(const Ultracopier::CopyType &type) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->type=type; - updateModeAndType(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->type=type; + updateModeAndType(); } -void InterfacePlugin::forceCopyMode(CopyMode mode) +void Themes::forceCopyMode(const Ultracopier::CopyMode &mode) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - modeIsForced=true; - this->mode=mode; - if(mode==Copy) - this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Copy")); - else - this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Move")); - updateModeAndType(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + modeIsForced=true; + this->mode=mode; + if(mode==Ultracopier::Copy) + this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Copy")); + else + this->setWindowTitle("Ultracopier - "+facilityEngine->translateText("Move")); + updateModeAndType(); } -void InterfacePlugin::updateTitle() +void Themes::updateTitle() { - QString startString; - if(action==Copying || action==CopyingAndListing) - startString=tr("%1% done").arg(((double)currentSize/totalSize)*100); - else - startString="Ultracopier"; - startString+=" - "; - if(mode==Copy) - this->setWindowTitle(startString+facilityEngine->translateText("Copy")+" ("+speedString+")"); - else - this->setWindowTitle(startString+facilityEngine->translateText("Move")+" ("+speedString+")"); + QString startString; + if(action==Ultracopier::Copying || action==Ultracopier::CopyingAndListing) + startString=tr("%1% done").arg(((double)currentSize/totalSize)*100); + else + startString="Ultracopier"; + startString+=" - "; + if(mode==Ultracopier::Copy) + this->setWindowTitle(startString+facilityEngine->translateText("Copy")+" ("+speedString+")"); + else + this->setWindowTitle(startString+facilityEngine->translateText("Move")+" ("+speedString+")"); } -void InterfacePlugin::haveExternalOrder() +void Themes::haveExternalOrder() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); // ui->moreButton->toggle(); } -void InterfacePlugin::isInPause(bool isInPause) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"isInPause: "+QString::number(isInPause)); - //resume in auto the pause - storeIsInPause=isInPause; - if(isInPause) - ui->pauseButton->setText(facilityEngine->translateText("Resume")); - else - ui->pauseButton->setText(facilityEngine->translateText("Pause")); -} - -void InterfacePlugin::updateCurrentFileInformation() -{ - TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); - if(transfertItem.haveItem) - { - ui->from->setText(transfertItem.from); - //commented because not displayed on this interface - //ui->to->setText(transfertItem.to); - //ui->current_file->setText(transfertItem.current_file); - if(transfertItem.progressBar_file!=-1) - { - ui->progressBar_file->setRange(0,65535); - ui->progressBar_file->setValue(transfertItem.progressBar_file); - } - else - ui->progressBar_file->setRange(0,0); - } - else - { - ui->from->setText(""); - //commented because not displayed on this interface - //ui->to->setText(""); - //ui->current_file->setText("-"); - if(haveStarted && transferModel.rowCount()==0) - ui->progressBar_file->setValue(65535); - else if(!haveStarted) - ui->progressBar_file->setValue(0); - } +void Themes::isInPause(const bool &isInPause) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"isInPause: "+QString::number(isInPause)); + //resume in auto the pause + storeIsInPause=isInPause; + if(isInPause) + ui->pauseButton->setText(facilityEngine->translateText("Resume")); + else + ui->pauseButton->setText(facilityEngine->translateText("Pause")); +} + +void Themes::updateCurrentFileInformation() +{ + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + ui->from->setText(transfertItem.from); + //commented because not displayed on this interface + //ui->to->setText(transfertItem.to); + //ui->current_file->setText(transfertItem.current_file); + if(transfertItem.progressBar_read!=-1) + { + ui->progressBar_file->setRange(0,65535); + if(transfertItem.progressBar_read!=transfertItem.progressBar_write) + { + float permilleread=round((float)transfertItem.progressBar_read/65535*1000)/1000; + float permillewrite=permilleread-0.001; + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border: 1px solid grey;text-align: center;background-color: qlineargradient(spread:pad, x1:%1, y1:0, x2:%2, y2:0, stop:0 %3, stop:1 %4);}QProgressBar::chunk{background-color:%5;}") + .arg(permilleread) + .arg(permillewrite) + .arg(progressColorRemaining.name()) + .arg(progressColorRead.name()) + .arg(progressColorWrite.name()) + ); + } + else + ui->progressBar_file->setStyleSheet(QStringLiteral("QProgressBar{border:1px solid grey;text-align:center;background-color:%1;}QProgressBar::chunk{background-color:%2;}") + .arg(progressColorRemaining.name()) + .arg(progressColorWrite.name()) + ); + ui->progressBar_file->setValue(transfertItem.progressBar_write); + } + else + ui->progressBar_file->setRange(0,0); + } + else + { + ui->from->setText(""); + //commented because not displayed on this interface + //ui->to->setText(""); + //ui->current_file->setText("-"); + if(haveStarted && transferModel.rowCount()==0) + ui->progressBar_file->setValue(65535); + else if(!haveStarted) + ui->progressBar_file->setValue(0); + } } -void InterfacePlugin::on_cancelButton_clicked() +void Themes::on_cancelButton_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - this->hide(); - emit cancel(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + this->hide(); + emit cancel(); } -void InterfacePlugin::on_pauseButton_clicked() +void Themes::on_pauseButton_clicked() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(storeIsInPause) - emit resume(); - else - emit pause(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(storeIsInPause) + emit resume(); + else + emit pause(); } -void InterfacePlugin::on_skipButton_clicked() +void Themes::on_skipButton_clicked() { - TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); - if(transfertItem.haveItem) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip at running: %1").arg(transfertItem.id)); - emit skip(transfertItem.id); - } - else - { - if(transferModel.rowCount()>1) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("skip at idle: %1").arg(transferModel.firstId())); - emit skip(transferModel.firstId()); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); - } + TransferModel::currentTransfertItem transfertItem=transferModel.getCurrentTransfertItem(); + if(transfertItem.haveItem) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at running: %1").arg(transfertItem.id)); + emit skip(transfertItem.id); + } + else + { + if(transferModel.rowCount()>1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("skip at idle: %1").arg(transferModel.firstId())); + emit skip(transferModel.firstId()); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"unable to skip the transfer, because no transfer running"); + } } -void InterfacePlugin::updateModeAndType() +void Themes::updateModeAndType() { - menu.clear(); - if(modeIsForced) - { - menu.addAction(ui->actionAddFile); - if(type==FileAndFolder) - menu.addAction(ui->actionAddFolder); - } - else - { - menu.addAction(ui->actionAddFileToCopy); - menu.addAction(ui->actionAddFileToMove); - if(type==FileAndFolder) - { - menu.addAction(ui->actionAddFolderToCopy); - menu.addAction(ui->actionAddFolderToMove); - } - } + menu.clear(); + if(modeIsForced) + { + menu.addAction(ui->actionAddFile); + if(type==Ultracopier::FileAndFolder) + menu.addAction(ui->actionAddFolder); + } + else + { + menu.addAction(ui->actionAddFileToCopy); + menu.addAction(ui->actionAddFileToMove); + if(type==Ultracopier::FileAndFolder) + { + menu.addAction(ui->actionAddFolderToCopy); + menu.addAction(ui->actionAddFolderToMove); + } + } } -void InterfacePlugin::forcedModeAddFile() +void Themes::forcedModeAddFile() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(mode); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(mode); } -void InterfacePlugin::forcedModeAddFolder() +void Themes::forcedModeAddFolder() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(mode); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(mode); } -void InterfacePlugin::forcedModeAddFileToCopy() +void Themes::forcedModeAddFileToCopy() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(Copy); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Copy); } -void InterfacePlugin::forcedModeAddFolderToCopy() +void Themes::forcedModeAddFolderToCopy() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(Copy); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Copy); } -void InterfacePlugin::forcedModeAddFileToMove() +void Themes::forcedModeAddFileToMove() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFile(Move); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFile(Ultracopier::Move); } -void InterfacePlugin::forcedModeAddFolderToMove() +void Themes::forcedModeAddFolderToMove() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - emit userAddFolder(Move); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + emit userAddFolder(Ultracopier::Move); } //set the translate -void InterfacePlugin::newLanguageLoaded() +void Themes::newLanguageLoaded() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); - if(modeIsForced) - forceCopyMode(mode); - ui->retranslateUi(this); - if(haveStarted) - updateCurrentFileInformation(); - updateOverallInformation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + if(modeIsForced) + forceCopyMode(mode); + ui->retranslateUi(this); + if(haveStarted) + updateCurrentFileInformation(); + updateOverallInformation(); } /* @@ -378,68 +433,68 @@ void InterfacePlugin::newLanguageLoaded() Return[1]: totalSize Return[2]: currentFile */ -void InterfacePlugin::getActionOnList(const QList& returnActions) -{ - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start, returnActions.size(): "+QString::number(returnActions.size())); - QList returnValue=transferModel.synchronizeItems(returnActions); - totalFile+=returnValue[0]; - totalSize+=returnValue[1]; - currentFile+=returnValue[2]; - if(transferModel.rowCount()==0) - { - ui->skipButton->setEnabled(false); - ui->progressBar_all->setValue(65535); - ui->progressBar_file->setValue(65535); - currentSize=totalSize; - } - else - ui->skipButton->setEnabled(true); - updateOverallInformation(); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"transferModel.rowCount(): "+QString::number(transferModel.rowCount())); -} - -void InterfacePlugin::setFileProgression(const QList &progressionList) -{ - QList progressionListBis=progressionList; - transferModel.setFileProgression(progressionListBis); - updateCurrentFileInformation(); -} - -InterfacePlugin::currentTransfertItem InterfacePlugin::getCurrentTransfertItem() -{ - currentTransfertItem returnItem; - returnItem.haveItem=InternalRunningOperation.size()>0; - if(returnItem.haveItem) - { - const ItemOfCopyListWithMoreInformations &itemTransfer=InternalRunningOperation.first(); - returnItem.from=itemTransfer.generalData.sourceFullPath; - returnItem.to=itemTransfer.generalData.destinationFullPath; - returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); - switch(itemTransfer.actionType) - { - case CustomOperation: - if(!itemTransfer.custom_with_progression) - returnItem.progressBar_file=0; - else - { - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - } - break; - case Transfer: - if(itemTransfer.generalData.size>0) - returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; - else - returnItem.progressBar_file=0; - break; - case PostOperation: - returnItem.progressBar_file=65535; - break; - default: - returnItem.progressBar_file=0; - } - } - return returnItem; +void Themes::getActionOnList(const QList& returnActions) +{ + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, returnActions.size(): "+QString::number(returnActions.size())); + QList returnValue=transferModel.synchronizeItems(returnActions); + totalFile+=returnValue[0]; + totalSize+=returnValue[1]; + currentFile+=returnValue[2]; + if(transferModel.rowCount()==0) + { + ui->skipButton->setEnabled(false); + ui->progressBar_all->setValue(65535); + ui->progressBar_file->setValue(65535); + currentSize=totalSize; + } + else + ui->skipButton->setEnabled(true); + updateOverallInformation(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"transferModel.rowCount(): "+QString::number(transferModel.rowCount())); +} + +void Themes::setFileProgression(const QList &progressionList) +{ + QList progressionListBis=progressionList; + transferModel.setFileProgression(progressionListBis); + updateCurrentFileInformation(); +} + +Themes::currentTransfertItem Themes::getCurrentTransfertItem() +{ + currentTransfertItem returnItem; + returnItem.haveItem=InternalRunningOperation.size()>0; + if(returnItem.haveItem) + { + const ItemOfCopyListWithMoreInformations &itemTransfer=InternalRunningOperation.first(); + returnItem.from=itemTransfer.generalData.sourceFullPath; + returnItem.to=itemTransfer.generalData.destinationFullPath; + returnItem.current_file=itemTransfer.generalData.destinationFileName+", "+facilityEngine->sizeToString(itemTransfer.generalData.size); + switch(itemTransfer.actionType) + { + case Ultracopier::CustomOperation: + if(!itemTransfer.custom_with_progression) + returnItem.progressBar_file=0; + else + { + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + } + break; + case Ultracopier::Transfer: + if(itemTransfer.generalData.size>0) + returnItem.progressBar_file=((double)itemTransfer.currentProgression/itemTransfer.generalData.size)*65535; + else + returnItem.progressBar_file=0; + break; + case Ultracopier::PostOperation: + returnItem.progressBar_file=65535; + break; + default: + returnItem.progressBar_file=0; + } + } + return returnItem; } diff --git a/plugins-alternative/Themes/Teracopy/interface.h b/plugins-alternative/Themes/Teracopy/interface.h index 899a03b..b2f6a70 100644 --- a/plugins-alternative/Themes/Teracopy/interface.h +++ b/plugins-alternative/Themes/Teracopy/interface.h @@ -1,16 +1,16 @@ /** \file interface.h \brief Define the interface test \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ -#ifndef INTERFACE_TEST_H -#define INTERFACE_TEST_H +#ifndef INTERFACE_H +#define INTERFACE_H #include #include #include #include +#include #include "../../../interface/PluginInterface_Themes.h" @@ -19,151 +19,158 @@ #include "TransferModel.h" namespace Ui { - class interfaceCopy; + class interfaceCopy; } /// \brief Define the interface -class InterfacePlugin : public PluginInterface_Themes +class Themes : public PluginInterface_Themes { - Q_OBJECT + Q_OBJECT private: - struct ItemOfCopyListWithMoreInformations - { - quint64 currentProgression; - ItemOfCopyList generalData; - ActionTypeCopyList actionType; - bool custom_with_progression; - }; - struct currentTransfertItem - { - quint64 id; - bool haveItem; - QString from; - QString to; - QString current_file; - int progressBar_file; - }; - Ui::interfaceCopy *ui; - quint64 currentFile; - quint64 totalFile; - quint64 currentSize; - quint64 totalSize; - void updateOverallInformation(); - void updateCurrentFileInformation(); - EngineActionInProgress action; - void closeEvent(QCloseEvent *event); - QList currentProgressList; - QString speedString; - bool storeIsInPause; - bool modeIsForced; - CopyType type; - CopyMode mode; - void updateModeAndType(); - bool haveStarted; - QWidget optionEngineWidget; - void updateTitle(); - QMenu menu; - FacilityInterface * facilityEngine; - int loop_size,loop_sub_size,indexAction,index; - int index_for_loop,sub_loop_size,sub_index_for_loop; - currentTransfertItem getCurrentTransfertItem(); - QList startId,stopId;///< To show what is started, what is stopped - QList InternalRunningOperation;///< to have progression and stat - /// \brief the custom transfer model - TransferModel transferModel; + struct ItemOfCopyListWithMoreInformations + { + quint64 currentProgression; + Ultracopier::ItemOfCopyList generalData; + Ultracopier::ActionTypeCopyList actionType; + bool custom_with_progression; + }; + struct currentTransfertItem + { + quint64 id; + bool haveItem; + QString from; + QString to; + QString current_file; + int progressBar_file; + }; + Ui::interfaceCopy *ui; + quint64 currentFile; + quint64 totalFile; + quint64 currentSize; + quint64 totalSize; + void updateOverallInformation(); + void updateCurrentFileInformation(); + Ultracopier::EngineActionInProgress action; + void closeEvent(QCloseEvent *event); + QList currentProgressList; + QString speedString; + bool storeIsInPause; + bool modeIsForced; + Ultracopier::CopyType type; + Ultracopier::CopyMode mode; + void updateModeAndType(); + bool haveStarted; + QWidget optionEngineWidget; + void updateTitle(); + QMenu menu; + FacilityInterface * facilityEngine; + int loop_size,loop_sub_size,indexAction,index; + int index_for_loop,sub_loop_size,sub_index_for_loop; + currentTransfertItem getCurrentTransfertItem(); + QList startId,stopId;///< To show what is started, what is stopped + QList InternalRunningOperation;///< to have progression and stat + /// \brief the custom transfer model + TransferModel transferModel; + QColor progressColorWrite; + QColor progressColorRead; + QColor progressColorRemaining; public: - //send information about the copy - /// \brief to set the action in progress - void actionInProgess(EngineActionInProgress); - /// \brief new transfer have started - void newTransferStart(const ItemOfCopyList &item); - /** \brief one transfer have been stopped - * is stopped, example: because error have occurred, and try later, don't remove the item! */ - void newTransferStop(const quint64 &id); - /// \brief the new folder is listing - void newFolderListing(const QString &path); - /** \brief show the detected speed - * in byte per seconds */ - void detectedSpeed(const quint64 &speed); - /** \brief show the remaining time - * time in seconds */ - void remainingTime(const int &remainingSeconds); - /// \brief set the current collision action - void newCollisionAction(const QString &action); - /// \brief set the current error action - void newErrorAction(const QString &action); - /// \brief set one error is detected - void errorDetected(); - //speed limitation - /** \brief the max speed used - * in byte per seconds, -1 if not able, 0 if disabled */ - bool setSpeedLimitation(const qint64 &speedLimitation); - InterfacePlugin(FacilityInterface * facilityEngine); - ~InterfacePlugin(); - //get information about the copy - /// \brief show the general progression - void setGeneralProgression(const quint64 ¤t,const quint64 &total); - /// \brief show the file progression - void setFileProgression(const QList &progressionList); - /// \brief set collision action - void setCollisionAction(const QList > &); - /// \brief set error action - void setErrorAction(const QList > &); - /// \brief set the copyType -> file or folder - void setCopyType(CopyType); - /// \brief set the copyMove -> copy or move, to force in copy or move, else support both - void forceCopyMode(CopyMode); - /// \brief set if transfer list is exportable/importable - void setTransferListOperation(TransferListOperation transferListOperation); - /** \brief set if the order is external (like file manager copy) - * to notify the interface, which can hide add folder/filer button */ - void haveExternalOrder(); - /// \brief set if is in pause - void isInPause(bool); - /// \brief get the widget for the copy engine - QWidget * getOptionsEngineWidget(); - /// \brief to set if the copy engine is found - void getOptionsEngineEnabled(bool isEnabled); + //send information about the copy + /// \brief to set the action in progress + void actionInProgess(const Ultracopier::EngineActionInProgress &); + /// \brief new transfer have started + void newTransferStart(const Ultracopier::ItemOfCopyList &item); + /** \brief one transfer have been stopped + * is stopped, example: because error have occurred, and try later, don't remove the item! */ + void newTransferStop(const quint64 &id); + /// \brief the new folder is listing + void newFolderListing(const QString &path); + /** \brief show the detected speed + * in byte per seconds */ + void detectedSpeed(const quint64 &speed); + /** \brief support speed limitation */ + void setSupportSpeedLimitation(const bool &supportSpeedLimitationBool); + /** \brief show the remaining time + * time in seconds */ + void remainingTime(const int &remainingSeconds); + /// \brief set the current collision action + void newCollisionAction(const QString &action); + /// \brief set the current error action + void newErrorAction(const QString &action); + /// \brief set one error is detected + void errorDetected(); + /// \brief new error + void errorToRetry(const QString &source,const QString &destination,const QString &error); + //speed limitation + /** \brief the max speed used + * in byte per seconds, -1 if not able, 0 if disabled */ + bool setSpeedLimitation(const qint64 &speedLimitation); + Themes(FacilityInterface * facilityEngine); + ~Themes(); + //get information about the copy + /// \brief show the general progression + void setGeneralProgression(const quint64 ¤t,const quint64 &total); + /// \brief show the file progression + void setFileProgression(const QList &progressionList); + /// \brief set collision action + void setCollisionAction(const QList > &); + /// \brief set error action + void setErrorAction(const QList > &); + /// \brief set the copyType -> file or folder + void setCopyType(const Ultracopier::CopyType &); + /// \brief set the copyMove -> copy or move, to force in copy or move, else support both + void forceCopyMode(const Ultracopier::CopyMode &); + /// \brief set if transfer list is exportable/importable + void setTransferListOperation(const Ultracopier::TransferListOperation &transferListOperation); + /** \brief set if the order is external (like file manager copy) + * to notify the interface, which can hide add folder/filer button */ + void haveExternalOrder(); + /// \brief set if is in pause + void isInPause(const bool &); + /// \brief get the widget for the copy engine + QWidget * getOptionsEngineWidget(); + /// \brief to set if the copy engine is found + void getOptionsEngineEnabled(const bool &isEnabled); private slots: - void on_cancelButton_clicked(); - void on_pauseButton_clicked(); - void on_skipButton_clicked(); - void forcedModeAddFile(); - void forcedModeAddFolder(); - void forcedModeAddFileToCopy(); - void forcedModeAddFolderToCopy(); - void forcedModeAddFileToMove(); - void forcedModeAddFolderToMove(); + void on_cancelButton_clicked(); + void on_pauseButton_clicked(); + void on_skipButton_clicked(); + void forcedModeAddFile(); + void forcedModeAddFolder(); + void forcedModeAddFileToCopy(); + void forcedModeAddFolderToCopy(); + void forcedModeAddFileToMove(); + void forcedModeAddFolderToMove(); signals: - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif - //set the transfer list - void removeItems(QList ids); - void moveItemsOnTop(QList ids); - void moveItemsUp(QList ids); - void moveItemsDown(QList ids); - void moveItemsOnBottom(QList ids); - void exportTransferList(); - void importTransferList(); - //user ask ask to add folder (add it with interface ask source/destination) - void userAddFolder(CopyMode); - void userAddFile(CopyMode); - void urlDropped(QList urls); - //action on the copy - void pause(); - void resume(); - void skip(quint64 id); - void cancel(); - //edit the action - void sendCollisionAction(QString action); - void sendErrorAction(QString action); - void newSpeedLimitation(qint64); + #ifdef ULTRACOPIER_PLUGIN_DEBUG + /// \brief To debug source + void debugInformation(const Ultracopier::DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne); + #endif + //set the transfer list + /*void removeItems(QList ids); + void moveItemsOnTop(QList ids); + void moveItemsUp(QList ids); + void moveItemsDown(QList ids); + void moveItemsOnBottom(QList ids); + void exportTransferList(); + void importTransferList(); + //user ask ask to add folder (add it with interface ask source/destination) + void userAddFolder(Ultracopier::CopyMode); + void userAddFile(Ultracopier::CopyMode); + void urlDropped(QList urls); + //action on the copy + void pause(); + void resume(); + void skip(quint64 id); + void cancel(); + //edit the action + void sendCollisionAction(QString action); + void sendErrorAction(QString action); + void newSpeedLimitation(qint64);*/ public slots: - //set the translate - void newLanguageLoaded(); - void getActionOnList(const QList& returnActions); + //set the translate + void newLanguageLoaded(); + void getActionOnList(const QList& returnActions); }; -#endif // INTERFACE_TEST_H +#endif // INTERFACE_H diff --git a/plugins-alternative/Themes/Teracopy/interface.pro b/plugins-alternative/Themes/Teracopy/interface.pro index 4cecacb..5049e19 100644 --- a/plugins-alternative/Themes/Teracopy/interface.pro +++ b/plugins-alternative/Themes/Teracopy/interface.pro @@ -1,8 +1,12 @@ +CONFIG += c++11 +QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra" +mac:QMAKE_CXXFLAGS+="-stdlib=libc++" + +QT += widgets TEMPLATE = lib CONFIG += plugin HEADERS = interface.h \ - interface/PluginInterface_Themes.h \ - StructEnumDefinition.h \ + StructEnumDefinition.h \ factory.h \ DebugEngineMacro.h \ Environment.h \ @@ -13,24 +17,25 @@ SOURCES = interface.cpp \ factory.cpp \ TransferModel.cpp TARGET = $$qtLibraryTarget(interface) -TRANSLATIONS += Languages/fr/translation.ts \ - Languages/ar/translation.ts \ - Languages/zh/translation.ts \ - Languages/es/translation.ts \ +TRANSLATIONS += Languages/ar/translation.ts \ Languages/de/translation.ts \ Languages/el/translation.ts \ + Languages/en/translation.ts \ + Languages/es/translation.ts \ + Languages/fr/translation.ts \ + Languages/hi/translation.ts \ + Languages/hu/translation.ts \ + Languages/id/translation.ts \ Languages/it/translation.ts \ Languages/ja/translation.ts \ - Languages/id/translation.ts \ + Languages/ko/translation.ts \ + Languages/nl/translation.ts \ + Languages/no/translation.ts \ Languages/pl/translation.ts \ Languages/ru/translation.ts \ - Languages/tr/translation.ts \ Languages/th/translation.ts \ - Languages/hi/translation.ts \ - Languages/nl/translation.ts \ - Languages/no/translation.ts \ - Languages/pt/translation.ts \ - Languages/ko/translation.ts + Languages/tr/translation.ts \ + Languages/zh/translation.ts RESOURCES += resources.qrc diff --git a/plugins-alternative/Themes/Teracopy/interface.ui b/plugins-alternative/Themes/Teracopy/interface.ui index 1bccf44..a5274b3 100644 --- a/plugins-alternative/Themes/Teracopy/interface.ui +++ b/plugins-alternative/Themes/Teracopy/interface.ui @@ -27,7 +27,7 @@ - :/resources/main.png:/resources/main.png + :/Themes/Teracopy/resources/main.png:/Themes/Teracopy/resources/main.png @@ -302,7 +302,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Add file @@ -311,7 +311,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Add folder @@ -320,7 +320,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Move file(s) @@ -329,7 +329,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Move folder @@ -338,7 +338,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Copy file(s) @@ -347,7 +347,7 @@ p, li { white-space: pre-wrap; } - :/resources/add.png:/resources/add.png + :/Themes/Teracopy/resources/add.png:/Themes/Teracopy/resources/add.png Copy folder diff --git a/plugins-alternative/Themes/Teracopy/plugin.json b/plugins-alternative/Themes/Teracopy/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins-alternative/Themes/Teracopy/plugin.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins-alternative/Themes/Teracopy/resources.qrc b/plugins-alternative/Themes/Teracopy/resources.qrc index 7f9a82c..39105a8 100644 --- a/plugins-alternative/Themes/Teracopy/resources.qrc +++ b/plugins-alternative/Themes/Teracopy/resources.qrc @@ -1,5 +1,5 @@ - + resources/SystemTrayIcon/add.png resources/SystemTrayIcon/exit.png resources/SystemTrayIcon/informations.png diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png index 1e03be9..7932127 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/add.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png index 201353e..ae3c4e8 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/exit.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png index e1eb797..5b7b255 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/informations.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png index d35365c..23ec531 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/options.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png index a81e70d..6f5d1cf 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Unix.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png index 8072aea..5464856 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Caught_Windows.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png index f40ea82..3961215 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png index 8d673e4..45d6315 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png index 9ce4779..ac4299a 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Unix.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png index d0fca1b..6e6bae7 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png and b/plugins-alternative/Themes/Teracopy/resources/SystemTrayIcon/systray_Uncaught_Windows.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/checkbox.png b/plugins-alternative/Themes/Teracopy/resources/checkbox.png index 1c311e2..f7f4388 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/checkbox.png and b/plugins-alternative/Themes/Teracopy/resources/checkbox.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/main.png b/plugins-alternative/Themes/Teracopy/resources/main.png index 8072aea..5464856 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/main.png and b/plugins-alternative/Themes/Teracopy/resources/main.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/player_pause.png b/plugins-alternative/Themes/Teracopy/resources/player_pause.png index a9b3113..68ee21f 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/player_pause.png and b/plugins-alternative/Themes/Teracopy/resources/player_pause.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources/player_play.png b/plugins-alternative/Themes/Teracopy/resources/player_play.png index 80ff3a1..a1c5b83 100644 Binary files a/plugins-alternative/Themes/Teracopy/resources/player_play.png and b/plugins-alternative/Themes/Teracopy/resources/player_play.png differ diff --git a/plugins-alternative/Themes/Teracopy/resources_unix.qrc b/plugins-alternative/Themes/Teracopy/resources_unix.qrc index ae3894b..46e3020 100644 --- a/plugins-alternative/Themes/Teracopy/resources_unix.qrc +++ b/plugins-alternative/Themes/Teracopy/resources_unix.qrc @@ -1,6 +1,6 @@ - - resources/SystemTrayIcon/systray_Caught_Unix.png + + resources/SystemTrayIcon/systray_Caught_Unix.png resources/SystemTrayIcon/systray_Semiuncaught_Unix.png resources/SystemTrayIcon/systray_Uncaught_Unix.png diff --git a/plugins-alternative/Themes/Teracopy/resources_windows.qrc b/plugins-alternative/Themes/Teracopy/resources_windows.qrc index 99829b3..165123a 100644 --- a/plugins-alternative/Themes/Teracopy/resources_windows.qrc +++ b/plugins-alternative/Themes/Teracopy/resources_windows.qrc @@ -1,5 +1,5 @@ - + resources/SystemTrayIcon/systray_Caught_Windows.png resources/SystemTrayIcon/systray_Semiuncaught_Windows.png resources/SystemTrayIcon/systray_Uncaught_Windows.png -- cgit v1.2.3