Skip to content

Commit 2cc1b72

Browse files
committed
[Improvement] Start progress bar integration
[Fix] Fix for windows
1 parent 5839703 commit 2cc1b72

File tree

259 files changed

+261
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+261
-159
lines changed

COPYING

100644100755
File mode changed.

CliParser.cpp

100644100755
File mode changed.

CliParser.h

100644100755
File mode changed.

CompilerInfo.h

100644100755
File mode changed.

CopyEngineManager.cpp

100644100755
File mode changed.

CopyEngineManager.h

100644100755
File mode changed.

CopyListener.cpp

100644100755
File mode changed.

CopyListener.h

100644100755
File mode changed.

Core.cpp

100644100755
File mode changed.

Core.h

100644100755
File mode changed.

DebugEngine.cpp

100644100755
File mode changed.

DebugEngine.h

100644100755
File mode changed.

DebugEngineMacro.h

100644100755
File mode changed.

DebugModel.cpp

100644100755
File mode changed.

Environment.h

100644100755
File mode changed.

EventDispatcher.cpp

100644100755
File mode changed.

EventDispatcher.h

100644100755
File mode changed.

ExtraSocket.cpp

100644100755
File mode changed.

ExtraSocket.h

100644100755
File mode changed.

FacilityEngine.cpp

100644100755
File mode changed.

FacilityEngine.h

100644100755
File mode changed.

HelpDialog.cpp

100644100755
File mode changed.

HelpDialog.h

100644100755
File mode changed.

HelpDialog.ui

100644100755
File mode changed.

InternetUpdater.cpp

100644100755
File mode changed.

InternetUpdater.h

100644100755
File mode changed.

LanguagesManager.cpp

100644100755
File mode changed.

LanguagesManager.h

100644100755
File mode changed.

LocalListener.cpp

100644100755
File mode changed.

LocalListener.h

100644100755
File mode changed.

LocalPluginOptions.cpp

100644100755
File mode changed.

LocalPluginOptions.h

100644100755
File mode changed.

LogThread.cpp

100644100755
File mode changed.

LogThread.h

100644100755
File mode changed.

OSSpecific.cpp

100644100755
File mode changed.

OSSpecific.h

100644100755
File mode changed.

OSSpecific.ui

100644100755
File mode changed.

OptionDialog.cpp

100644100755
File mode changed.

OptionDialog.h

100644100755
File mode changed.

OptionDialog.ui

100644100755
File mode changed.

OptionEngine.cpp

100644100755
File mode changed.

OptionEngine.h

100644100755
File mode changed.

PlatformMacro.h

100644100755
File mode changed.

PluginInformation.cpp

100644100755
File mode changed.

PluginInformation.h

100644100755
File mode changed.

PluginInformation.ui

100644100755
File mode changed.

PluginLoaderCore.cpp

100644100755
File mode changed.

PluginLoaderCore.h

100644100755
File mode changed.

PluginsManager.cpp

100644100755
File mode changed.

PluginsManager.h

100644100755
File mode changed.

ProductKey.cpp

100644100755
File mode changed.

ProductKey.h

100644100755
File mode changed.

ProductKey.ui

100644100755
File mode changed.

README.md

100644100755
File mode changed.

README.sources

100644100755
File mode changed.

ResourcesManager.cpp

100644100755
File mode changed.

ResourcesManager.h

100644100755
File mode changed.

SessionLoader.cpp

100644100755
File mode changed.

SessionLoader.h

100644100755
File mode changed.

StructEnumDefinition.h

100644100755
File mode changed.

StructEnumDefinition_UltracopierSpecific.h

100644100755
File mode changed.

SystrayIcon.cpp

100644100755
File mode changed.

SystrayIcon.h

100644100755
File mode changed.

ThemesManager.cpp

100644100755
File mode changed.

ThemesManager.h

100644100755
File mode changed.

Variable.h

100644100755
File mode changed.

cpp11addition.cpp

100644100755
File mode changed.

cpp11addition.h

100644100755
File mode changed.

cpp11additionstringtointcpp.cpp

100644100755
File mode changed.

main.cpp

100644100755
File mode changed.

other-pro/static.pro

100644100755
File mode changed.

other-pro/supercopier-core.pro

100644100755
File mode changed.

other-pro/ultracopier-core.pro

100644100755
+4
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,7 @@ INCLUDEPATH += \
133133
$$PWD/../lib/qt-tar-xz/
134134

135135
OTHER_FILES += $$PWD/../resources/resources-windows.rc
136+
137+
win32: {
138+
QT += winextras
139+
}

other-pro/ultracopier-little.pro

100644100755
File mode changed.

other-pro/ultracopier-static.pro

100644100755
File mode changed.

plugins/CopyEngine/Ultracopier-Spec/FileExistsDialog.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,19 @@ void FileExistsDialog::on_SuggestNewName_clicked()
150150
if(num==1)
151151
{
152152
if(firstRenamingRule.empty())
153-
newFileName=tr("%name% - copy%suffix%");
153+
newFileName=tr("%name% - copy");
154154
else
155155
newFileName=QString::fromStdString(firstRenamingRule);
156156
}
157157
else
158158
{
159159
if(otherRenamingRule.empty())
160-
newFileName=tr("%name% - copy (%number%)%suffix%");
160+
newFileName=tr("%name% - copy (%number%)");
161161
else
162162
newFileName=QString::fromStdString(otherRenamingRule);
163163
newFileName.replace(QStringLiteral("%number%"),QString::number(num));
164164
}
165165
newFileName.replace(QStringLiteral("%name%"),fileName);
166-
newFileName.replace(QStringLiteral("%suffix%"),suffix);
167166
destination=absolutePath+CURRENTSEPARATOR+newFileName;
168167
destinationInfo=destination.toStdString();
169168
num++;

plugins/CopyEngine/Ultracopier-Spec/TransferThread.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ TransferThread::TransferThread() :
4545
PSecurityD=NULL;
4646
dacl=NULL;
4747
#endif
48+
#ifdef Q_OS_Win32
49+
stopItWin=0;
50+
#endif
4851
//if not QThread
4952
run();
5053
}
5154

5255
TransferThread::~TransferThread()
5356
{
57+
#ifdef Q_OS_WIN32
58+
stopItWin=1;
59+
#endif
5460
stopIt=true;
5561
//else cash without this disconnect
5662
//disconnect(&readThread);
@@ -104,6 +110,9 @@ bool TransferThread::setFiles(const std::string& source, const int64_t &size, co
104110
this->mode = mode;
105111
this->size = size;
106112
stopIt = false;
113+
#ifdef Q_OS_WIN32
114+
stopItWin=0;
115+
#endif
107116
fileExistsAction = FileExists_NotSet;
108117
canStartTransfer = false;
109118
sended_state_preOperationStopped= false;

plugins/CopyEngine/Ultracopier-Spec/TransferThread.h

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ public slots:
176176
bool keepDate;
177177
bool mkFullPath;
178178
volatile bool stopIt;
179+
#ifdef Q_OS_WIN32
180+
int stopItWin;
181+
#endif
179182
DriveManagement driveManagement;
180183
volatile bool canStartTransfer;
181184
bool retry;

plugins/CopyEngine/Ultracopier-Spec/async/TransferThreadAsync.cpp

+18-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ TransferThreadAsync::TransferThreadAsync() :
3838

3939
TransferThreadAsync::~TransferThreadAsync()
4040
{
41+
#ifdef Q_OS_WIN32
42+
stopItWin=1;
43+
#endif
4144
stopIt=true;
4245
exit(0);
4346
wait();
@@ -199,7 +202,7 @@ void TransferThreadAsync::postOperation()
199202
}
200203

201204
#ifdef Q_OS_WIN32
202-
DWORD TransferThreadAsync::LpprogressRoutine(
205+
DWORD progressRoutine(
203206
LARGE_INTEGER TotalFileSize,
204207
LARGE_INTEGER TotalBytesTransferred,
205208
LARGE_INTEGER StreamSize,
@@ -211,9 +214,15 @@ DWORD TransferThreadAsync::LpprogressRoutine(
211214
LPVOID lpData
212215
)
213216
{
214-
transferProgression=TotalBytesTransferred.QuadPart;
217+
static_cast<TransferThreadAsync *>(lpData)->setProgression(TotalBytesTransferred.QuadPart);
215218
return PROGRESS_CONTINUE;
216219
}
220+
221+
void TransferThreadAsync::setProgression(const uint64_t &pos)
222+
{
223+
if(transfer_stat==TransferStat_Transfer)
224+
transferProgression=pos;
225+
}
217226
#endif
218227

219228
void TransferThreadAsync::ifCanStartTransfer()
@@ -223,7 +232,7 @@ void TransferThreadAsync::ifCanStartTransfer()
223232
transfer_stat=TransferStat_Transfer;
224233
emit pushStat(transfer_stat,transferId);
225234
#ifdef Q_OS_WIN32
226-
if(CopyFileExA(source.c_str(),destination.c_str(),&TransferThreadAsync::LpprogressRoutine,NULL,stopIt,
235+
if(CopyFileExA(source.c_str(),destination.c_str(),(LPPROGRESS_ROUTINE)progressRoutine,this,&stopItWin,
227236
COPY_FILE_ALLOW_DECRYPTED_DESTINATION | 0x00000800/*COPY_FILE_COPY_SYMLINK*/ | 0x00001000/*COPY_FILE_NO_BUFFERING*/
228237
)!=0)
229238
#else
@@ -266,6 +275,9 @@ void TransferThreadAsync::ifCanStartTransfer()
266275
//stop the current copy
267276
void TransferThreadAsync::stop()
268277
{
278+
#ifdef Q_OS_WIN32
279+
stopItWin=1;
280+
#endif
269281
stopIt=true;
270282
if(transfer_stat==TransferStat_Idle)
271283
{
@@ -324,6 +336,9 @@ void TransferThreadAsync::retryAfterError()
324336
//skip the copy
325337
void TransferThreadAsync::skip()
326338
{
339+
#ifdef Q_OS_WIN32
340+
stopItWin=1;
341+
#endif
327342
stopIt=true;
328343
exit();
329344
wait();

plugins/CopyEngine/Ultracopier-Spec/async/TransferThreadAsync.h

+3-11
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public slots:
9393
//fake copy for no win32
9494
int copy(const char *from,const char *to);
9595
#endif
96+
#ifdef Q_OS_WIN32
97+
void setProgression(const uint64_t &pos);
98+
#endif
9699
private:
97100
//ready = open + ready to operation (no error to resolv)
98101
bool transferIsReadyVariable;
@@ -101,17 +104,6 @@ public slots:
101104
bool remainSourceOpen() const;
102105
bool remainDestinationOpen() const;
103106
void resetExtraVariable();
104-
#ifdef Q_OS_WIN32
105-
DWORD LpprogressRoutine( LARGE_INTEGER TotalFileSize,
106-
LARGE_INTEGER TotalBytesTransferred,
107-
LARGE_INTEGER StreamSize,
108-
LARGE_INTEGER StreamBytesTransferred,
109-
DWORD dwStreamNumber,
110-
DWORD dwCallbackReason,
111-
HANDLE hSourceFile,
112-
HANDLE hDestinationFile,
113-
LPVOID lpData);
114-
#endif
115107
void ifCanStartTransfer();
116108
};
117109

plugins/Themes/Oxygen/DebugEngineMacro.h

100644100755
File mode changed.

plugins/Themes/Oxygen/Environment.h

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/ar/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/de/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/el/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/en/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/es/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/fr/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/hi/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/hu/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/id/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/it/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/ja/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/ko/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/nl/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/no/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/pl/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/pt/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/ru/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/th/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/tr/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/Languages/zh/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen/README.md

100644100755
File mode changed.

plugins/Themes/Oxygen/StructEnumDefinition.h

100644100755
File mode changed.

plugins/Themes/Oxygen/ThemesFactory.cpp

100644100755
File mode changed.

plugins/Themes/Oxygen/ThemesFactory.h

100644100755
File mode changed.

plugins/Themes/Oxygen/TransferModel.cpp

100644100755
File mode changed.

plugins/Themes/Oxygen/TransferModel.h

100644100755
File mode changed.

plugins/Themes/Oxygen/Variable.h

100644100755
File mode changed.

plugins/Themes/Oxygen/documentation.dox

100644100755
File mode changed.

plugins/Themes/Oxygen/informations.xml

100644100755
File mode changed.

plugins/Themes/Oxygen/interface.cpp

100644100755
File mode changed.

plugins/Themes/Oxygen/interface.h

100644100755
File mode changed.

plugins/Themes/Oxygen/interface.pro

100644100755
File mode changed.

plugins/Themes/Oxygen/interface.ui

100644100755
File mode changed.

plugins/Themes/Oxygen/interfaceInclude.pri

100644100755
File mode changed.

plugins/Themes/Oxygen/interfaceResources.qrc

100644100755
File mode changed.

plugins/Themes/Oxygen/interfaceResources_unix.qrc

100644100755
File mode changed.

plugins/Themes/Oxygen/interfaceResources_windows.qrc

100644100755
File mode changed.

plugins/Themes/Oxygen/options.ui

100644100755
File mode changed.

plugins/Themes/Oxygen/plugin.json

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/add.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/exit.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/informations.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/options.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Unix.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Caught_Windows.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Unix.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Semiuncaught_Windows.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Unix.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/SystemTrayIcon/systray_Uncaught_Windows.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/add.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/cancel.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/export-transfer-list.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/import-transfer-list.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/main.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/moveDown.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/moveUp.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/player_end.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/player_pause.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/player_play.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/putOnBottom.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/putOnTop.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/remove.png

100644100755
File mode changed.

plugins/Themes/Oxygen/resources/search.png

100644100755
File mode changed.

plugins/Themes/Oxygen/themesOptions.ui

100644100755
File mode changed.

plugins/Themes/Oxygen2/DebugEngineMacro.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/Environment.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/ar/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/de/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/el/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/en/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/es/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/fr/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/hi/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/hu/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/id/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/it/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/ja/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/ko/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/nl/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/no/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/pl/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/pt/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/ru/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/th/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/tr/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/Languages/zh/translation.ts

100644100755
File mode changed.

plugins/Themes/Oxygen2/README.md

100644100755
File mode changed.

plugins/Themes/Oxygen2/StructEnumDefinition.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/ThemesFactory.cpp

100644100755
File mode changed.

plugins/Themes/Oxygen2/ThemesFactory.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/TransferModel.cpp

100644100755
File mode changed.

plugins/Themes/Oxygen2/TransferModel.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/Variable.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/chartarea.cpp

100644100755
+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void ChartArea::Widget::paintEvent(QPaintEvent*)
3838
{
3939
QPainter painter;
4040
painter.begin(this);
41+
painter.setBrush(QColor(160,160,160,30));
4142
painter.drawRect(0,0,width()-1,height()-1);
4243
painter.setRenderHint(QPainter::Antialiasing,true);
4344
painter.setRenderHint(QPainter::SmoothPixmapTransform,true);

plugins/Themes/Oxygen2/chartarea.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/documentation.dox

100644100755
File mode changed.

plugins/Themes/Oxygen2/fileTree.cpp

100644100755
File mode changed.

plugins/Themes/Oxygen2/fileTree.h

100644100755
File mode changed.

plugins/Themes/Oxygen2/informations.xml

100644100755
File mode changed.

plugins/Themes/Oxygen2/interface.cpp

100644100755
+79-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
#include <cmath>
1313
#include <chrono>
1414
#include <ctime>
15-
15+
#ifdef Q_OS_WIN32
16+
#include <windows.h>
17+
#endif
1618

1719
#include "interface.h"
1820
#include "ui_interface.h"
@@ -29,13 +31,6 @@ QIcon Themes::documentSave;
2931
QIcon Themes::listAdd;
3032
bool Themes::iconLoaded=false;
3133

32-
// The cmath header from MSVC does not contain round()
33-
#if (defined(_WIN64) || defined(_WIN32)) && defined(_MSC_VER)
34-
inline double round(double d) {
35-
return floor( d + 0.5 );
36-
}
37-
#endif
38-
3934
Themes::Themes(const bool &alwaysOnTop,
4035
const bool &showProgressionInTheTitle,
4136
const QColor &progressColorWrite,
@@ -70,7 +65,11 @@ Themes::Themes(const bool &alwaysOnTop,
7065
mode(Ultracopier::CopyMode::Copy),
7166
haveStarted(false),
7267
haveError(false)
68+
#ifdef Q_OS_WIN32
69+
,winTaskbarProgress(this)
70+
#endif
7371
{
72+
darkUi=true;
7473
this->facilityEngine=facilityEngine;
7574
File::facilityEngine=facilityEngine;
7675
ui->setupUi(this);
@@ -371,6 +370,33 @@ Themes::Themes(const bool &alwaysOnTop,
371370

372371
sysTrayIcon = new QSystemTrayIcon(this);
373372
connect(sysTrayIcon,&QSystemTrayIcon::activated,this,&Themes::catchAction);
373+
#ifdef Q_OS_WIN32
374+
winTaskbarProgress.show();
375+
#endif
376+
377+
if(darkUi)
378+
{
379+
ui->frame->setStyleSheet("#frame{background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 rgb(70, 70, 70), stop:1 rgb(40, 40, 40));}");
380+
ui->labelTimeRemaining->setStyleSheet("color:#fff;");
381+
ui->labelSPStart->setStyleSheet("color:#aaa;");
382+
ui->labelSPStop->setStyleSheet("color:#aaa;");
383+
ui->from_label->setStyleSheet("color:#aaa;");
384+
ui->current_file->setStyleSheet("color:#fff;");
385+
ui->from->setStyleSheet("color:#fff;");
386+
387+
ui->ad_ultimate->setStyleSheet("color:#fff;background-color:rgb(50, 50, 50);");
388+
389+
QString labelTimeRemaining;
390+
labelTimeRemaining+="<html><body style=\"white-space:nowrap;\"><small style=\"color:#aaa\">";
391+
labelTimeRemaining+=QString::fromStdString(facilityEngine->translateText("Remaining:"));
392+
labelTimeRemaining+="</small>";
393+
labelTimeRemaining+=QStringLiteral(" <b>");
394+
labelTimeRemaining+=QStringLiteral("&#8734;");
395+
labelTimeRemaining+=QStringLiteral("</b></body></html>");
396+
ui->labelTimeRemaining->setText(labelTimeRemaining);
397+
398+
ui->frameS->setStyleSheet("#frameS{border: 1px solid #b0c0f0;} QProgressBar{background-color: rgba(160,180,240,100);border: 0 solid grey; } QProgressBar::chunk {background-color: rgba(160,180,240,200);}");
399+
}
374400
}
375401

376402
Themes::~Themes()
@@ -453,12 +479,24 @@ void Themes::actionInProgess(const Ultracopier::EngineActionInProgress &action)
453479
case Ultracopier::CopyingAndListing:
454480
ui->progressBar_all->setMaximum(65535);
455481
ui->progressBar_all->setMinimum(0);
482+
#ifdef Q_OS_WIN32
483+
winTaskbarProgress.setMaximum(65535);
484+
winTaskbarProgress.setMinimum(0);
485+
#endif
456486
break;
457487
case Ultracopier::Listing:
458488
ui->progressBar_all->setMaximum(0);
459489
ui->progressBar_all->setMinimum(0);
490+
#ifdef Q_OS_WIN32
491+
winTaskbarProgress.setMaximum(0);
492+
winTaskbarProgress.setMinimum(0);
493+
#endif
460494
break;
461495
case Ultracopier::Idle:
496+
#ifdef Q_OS_WIN32
497+
winTaskbarProgress.setMaximum(65535);
498+
winTaskbarProgress.setMinimum(0);
499+
#endif
462500
ui->progressBar_all->setMaximum(65535);
463501
ui->progressBar_all->setMinimum(0);
464502
if(haveStarted && transferModel.rowCount()<=0)
@@ -561,19 +599,23 @@ void Themes::detectedSpeed(const uint64_t &speed)//in byte per seconds
561599

562600
void Themes::remainingTime(const int &remainingSeconds)
563601
{
564-
QString labelTimeRemaining(QStringLiteral(
565-
"<html><body style=\"white-space:nowrap;\">")+
566-
QString::fromStdString(facilityEngine->translateText("Time remaining:"))+
567-
QStringLiteral(" ")
568-
);
602+
QString labelTimeRemaining;
603+
if(darkUi)
604+
labelTimeRemaining+="<html><body style=\"white-space:nowrap;\"><small style=\"color:#aaa\">";
605+
else
606+
labelTimeRemaining+="<html><body style=\"white-space:nowrap;\">";
607+
labelTimeRemaining+=QString::fromStdString(facilityEngine->translateText("Remaining:"));
608+
if(darkUi)
609+
labelTimeRemaining+="</small>";
610+
labelTimeRemaining+=QStringLiteral(" <b>");
569611
if(remainingSeconds==-1)
570612
labelTimeRemaining+=QStringLiteral("&#8734;");
571613
else
572614
{
573615
Ultracopier::TimeDecomposition time=facilityEngine->secondsToTimeDecomposition(remainingSeconds);
574616
labelTimeRemaining+=QString::number(time.hour)+QStringLiteral(":")+QString::number(time.minute).rightJustified(2,'0')+QStringLiteral(":")+QString::number(time.second).rightJustified(2,'0');
575617
}
576-
labelTimeRemaining+=QStringLiteral("</body></html>");
618+
labelTimeRemaining+=QStringLiteral("</b></body></html>");
577619
ui->labelTimeRemaining->setText(labelTimeRemaining);
578620
}
579621

@@ -616,9 +658,17 @@ void Themes::setGeneralProgression(const uint64_t &current,const uint64_t &total
616658
{
617659
int newIndicator=((double)current/total)*65535;
618660
ui->progressBar_all->setValue(newIndicator);
661+
#ifdef Q_OS_WIN32
662+
winTaskbarProgress.setValue(newIndicator);
663+
#endif
619664
}
620665
else
666+
{
621667
ui->progressBar_all->setValue(0);
668+
#ifdef Q_OS_WIN32
669+
winTaskbarProgress.setValue(0);
670+
#endif
671+
}
622672
if(current>0)
623673
stat = status_started;
624674
updateOverallInformation();
@@ -649,6 +699,9 @@ void Themes::getActionOnList(const std::vector<Ultracopier::ReturnActionOnCopyLi
649699
ui->skipButton->setEnabled(false);
650700
ui->progressBar_all->setValue(65535);
651701
ui->progressBar_file->setValue(65535);
702+
#ifdef Q_OS_WIN32
703+
winTaskbarProgress.setValue(65535);
704+
#endif
652705
currentSize=totalSize;
653706
if(isHidden())
654707
updateSysTrayIcon();
@@ -864,6 +917,7 @@ void Themes::on_cancelButton_clicked()
864917

865918
void Themes::speedWithProgressBar_toggled(bool checked)
866919
{
920+
(void)checked;
867921
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start");
868922
/*ui->progressBarCurrentSpeed->setVisible(checked);
869923
ui->currentSpeed->setVisible(!checked);*/
@@ -1549,6 +1603,17 @@ void Themes::resizeEvent(QResizeEvent*)
15491603
ui->horizontalLayout_3->setDirection(QBoxLayout::TopToBottom);
15501604
else
15511605
ui->horizontalLayout_3->setDirection(QBoxLayout::LeftToRight);
1606+
if(ui->frameS->width()>300)
1607+
{
1608+
int space=ui->frameS->width()/20;
1609+
ui->horizontalLayoutS->setContentsMargins(space,space/2,space,space/2);
1610+
ui->horizontalLayoutS->setSpacing(space);
1611+
}
1612+
else
1613+
{
1614+
ui->horizontalLayoutS->setMargin(6);
1615+
ui->horizontalLayoutS->setSpacing(6);
1616+
}
15521617
}
15531618

15541619
void Themes::doneTime(const std::vector<std::pair<uint64_t,uint32_t> > &timeList)

plugins/Themes/Oxygen2/interface.h

100644100755
+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#include <QTime>
1717
#include <QSystemTrayIcon>
1818
#include <QPixmap>
19+
#ifdef Q_OS_WIN32
20+
#include <QWinTaskbarProgress>
21+
#endif
1922

2023
#include "../../../interface/PluginInterface_Themes.h"
2124
#include "radialMap/widget.h"
@@ -194,6 +197,7 @@ private slots:
194197
TransferModel transferModel;
195198
RadialMap::Widget *radial;
196199
ChartArea::Widget *chartarea;
200+
bool darkUi;
197201

198202
static QIcon player_play,player_pause,tempExitIcon,editDelete,skinIcon,editFind,documentOpen,documentSave,listAdd;
199203
static bool iconLoaded;
@@ -230,6 +234,10 @@ private slots:
230234
void updateSysTrayIcon();
231235
void resizeEvent(QResizeEvent*) override;
232236
uint8_t fileCatNumber(uint64_t size);
237+
238+
#ifdef Q_OS_WIN32
239+
QWinTaskbarProgress winTaskbarProgress;
240+
#endif
233241
signals:
234242
/// \brief To debug source
235243
void debugInformation(const Ultracopier::DebugLevel &level,const std::string &fonction,const std::string &text,const std::string &file,const int &ligne) const;

plugins/Themes/Oxygen2/interface.pro

100644100755
File mode changed.

0 commit comments

Comments
 (0)