diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 5cb139c4..f93cc9d9 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -3476,12 +3476,12 @@ - + Update ready to install. Applicaion will quit... - + Update failed. Please try again or download manually! diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index 91e0da15..2c10e3e8 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -3513,12 +3513,12 @@ Pobieranie aktualizacji w toku, prosze czekać... - + Update ready to install. Applicaion will quit... Aktualizacja gotowa do instalacji. Teraz program zostanie zamknięty... - + Update failed. Please try again or download manually! Aktualizacja zakończona niepowodzeniem. Prosze spróbować ponownie lub zainstalować ręcznie! diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index bf3ff7db..c67a4e3b 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -3496,12 +3496,12 @@ Uppdatering laddas ner, vänta... - + Update ready to install. Applicaion will quit... Uppdatering klar att installeras. Programmet kommer att avslutas... - + Update failed. Please try again or download manually! Uppdateringen misslyckades. Försök igen, eller ladda ner manuellt! diff --git a/res/images/Loading3.gif b/res/images/Loading3.gif index 7c2ef2b6..fc1992d2 100644 Binary files a/res/images/Loading3.gif and b/res/images/Loading3.gif differ diff --git a/src/Config.h b/src/Config.h index d64ae536..c4753763 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 8 -#define VER_LAMEXP_BUILD 1473 +#define VER_LAMEXP_BUILD 1475 #define VER_LAMEXP_CONFG 1348 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_WorkingBanner.cpp b/src/Dialog_WorkingBanner.cpp index 480c3a9e..849ea90b 100644 --- a/src/Dialog_WorkingBanner.cpp +++ b/src/Dialog_WorkingBanner.cpp @@ -21,6 +21,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "Dialog_WorkingBanner.h" +#include "../tmp/UIC_WorkingBanner.h" #include "Global.h" #include "WinSevenTaskbar.h" @@ -75,16 +76,16 @@ static inline void UPDATE_MARGINS(QWidget *control, int l = 0, int r = 0, int t WorkingBanner::WorkingBanner(QWidget *parent) : QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint), - m_metrics(NULL), m_working(NULL) + ui(new Ui::WorkingBanner()), m_metrics(NULL), m_working(NULL) { //Init the dialog, from the .ui file - setupUi(this); + ui->setupUi(this); setModal(true); //Enable the "sheet of glass" effect if(lamexp_sheet_of_glass(this)) { - SET_TEXT_COLOR(labelStatus, lamexp_system_color(lamexp_syscolor_caption)); + SET_TEXT_COLOR(ui->labelStatus, lamexp_system_color(lamexp_syscolor_caption)); } else { @@ -92,7 +93,7 @@ WorkingBanner::WorkingBanner(QWidget *parent) m_working = new QMovie(":/images/Busy.gif"); m_working->setSpeed(75); m_working->setCacheMode(QMovie::CacheAll); - labelWorking->setMovie(m_working); + ui->labelWorking->setMovie(m_working); m_working->start(); } @@ -103,7 +104,7 @@ WorkingBanner::WorkingBanner(QWidget *parent) setCursor(Qt::WaitCursor); //Clear label - labelStatus->clear(); + ui->labelStatus->clear(); } //////////////////////////////////////////////////////////// @@ -119,6 +120,7 @@ WorkingBanner::~WorkingBanner(void) } LAMEXP_DELETE(m_metrics); + delete ui; } //////////////////////////////////////////////////////////// @@ -134,8 +136,9 @@ void WorkingBanner::show(const QString &text) setText(text); //Reset progress - progressBar->setMaximum(0); - progressBar->setValue(-1); + ui->progressBar->setMinimum(0); + ui->progressBar->setMaximum(0); + ui->progressBar->setValue(-1); } void WorkingBanner::show(const QString &text, QThread *thread) @@ -249,34 +252,47 @@ void WorkingBanner::setText(const QString &text) { if(!m_metrics) { - m_metrics = new QFontMetrics(labelStatus->font()); + m_metrics = new QFontMetrics(ui->labelStatus->font()); } - if(m_metrics->width(text) <= labelStatus->width() - 8) + if(m_metrics->width(text) <= ui->labelStatus->width() - 8) { - labelStatus->setText(text); + ui->labelStatus->setText(text); } else { QString choppedText = text.simplified().append("..."); - while((m_metrics->width(choppedText) > labelStatus->width() - 8) && (choppedText.length() > 8)) + while((m_metrics->width(choppedText) > ui->labelStatus->width() - 8) && (choppedText.length() > 8)) { choppedText.chop(4); choppedText = choppedText.trimmed(); choppedText.append("..."); } - labelStatus->setText(choppedText); + ui->labelStatus->setText(choppedText); } } void WorkingBanner::setProgressMax(unsigned int max) { - progressBar->setMaximum(max); + ui->progressBar->setMaximum(max); + if(ui->progressBar->maximum() > ui->progressBar->minimum()) + { + WinSevenTaskbar::setTaskbarState(dynamic_cast(this->parent()), WinSevenTaskbar::WinSevenTaskbarNoState); + WinSevenTaskbar::setTaskbarProgress(dynamic_cast(this->parent()), ui->progressBar->value(), ui->progressBar->maximum()); + } + else + { + WinSevenTaskbar::setTaskbarState(dynamic_cast(this->parent()), WinSevenTaskbar::WinSevenTaskbarIndeterminateState); + } } void WorkingBanner::setProgressVal(unsigned int val) { - progressBar->setValue(val); + ui->progressBar->setValue(val); + if(ui->progressBar->maximum() > ui->progressBar->minimum()) + { + WinSevenTaskbar::setTaskbarProgress(dynamic_cast(this->parent()), ui->progressBar->value(), ui->progressBar->maximum()); + } } //////////////////////////////////////////////////////////// diff --git a/src/Dialog_WorkingBanner.h b/src/Dialog_WorkingBanner.h index f030a56c..de0100c4 100644 --- a/src/Dialog_WorkingBanner.h +++ b/src/Dialog_WorkingBanner.h @@ -22,13 +22,20 @@ #pragma once -#include "../tmp/UIC_WorkingBanner.h" +#include + +namespace Ui +{ + class WorkingBanner; +} + +class QEventLoop; //////////////////////////////////////////////////////////// // Splash Frame //////////////////////////////////////////////////////////// -class WorkingBanner: public QDialog, private Ui::WorkingBanner +class WorkingBanner: public QDialog { Q_OBJECT @@ -41,6 +48,8 @@ public: void show(const QString &text, QEventLoop *loop); private: + Ui::WorkingBanner *const ui; + QMovie *m_working; bool m_canClose;