diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts
index 435fe940..2dc2f6f4 100644
--- a/etc/Translation/LameXP_DE.ts
+++ b/etc/Translation/LameXP_DE.ts
@@ -1714,7 +1714,7 @@
- Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es dann noch einmal.
+ Bitte prüfen Sie Ihre Internetverbindung und versuchen Sie es dann noch einmal.
@@ -1742,7 +1742,7 @@
- Zu diesem Zeitpunkt sind keine Updates verfügabr.
+ Zu diesem Zeitpunkt sind keine Updates verfügbar.
diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts
index 644a991b..d00514e0 100644
--- a/etc/Translation/LameXP_RU.ts
+++ b/etc/Translation/LameXP_RU.ts
@@ -2159,108 +2159,108 @@
пожалуйста, подождите...
-
+
Последняя доступная версия:
-
+
Установленная верися:
-
+
Повторить
-
+
Показать Лог
-
+
Скачать и Установить
-
+
Закрыть
-
-
+
+
Сборка
-
+
Неизвестно
-
+
Проверяю соединение с сетью, пожалуйста, подождите...
-
+
Нет соединения с сетью!
-
+
Проверьте доступность интернет соединения и попробуйте снова.
-
+
Проверяю обновлений, пожалйста, подождите...
-
+
Немогу получить информацию об обновлениях с сервера!
-
+
Извините, сервер обновлений сейчас недоступен. Пожалуйста попробуйте позднее.
-
+
Больше информации доступно здесь:
-
+
Новя версия LameXP доступна!
-
+
Мы очень рекомендуем установить это обновлений как можо скорее.
-
+
Нет обновлений.
-
+
Вы используете самую новую версию LameXP. Проверяйте обновления регулярно!
-
+
Установленная версия новее чем последний релиз.
-
+
Это обычно показывает, что вы используете бета версию LameXP.
diff --git a/gui/UpdateDialog.ui b/gui/UpdateDialog.ui
index a44681dd..75f1bc53 100644
--- a/gui/UpdateDialog.ui
+++ b/gui/UpdateDialog.ui
@@ -188,6 +188,113 @@
+ -
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
-
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+
+
+ :/icons/transmit.png
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 6
+ 20
+
+
+
+
+ -
+
+
+
+
+
+ :/images/Loading3.gif
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 6
+ 20
+
+
+
+
+ -
+
+
+
+
+
+ :/icons/computer.png
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
-
@@ -587,6 +694,12 @@
+
+
+
+
+
+
diff --git a/res/Icons.qrc b/res/Icons.qrc
index 762d87ef..1d301d90 100644
--- a/res/Icons.qrc
+++ b/res/Icons.qrc
@@ -77,6 +77,7 @@
icons/table_edit.png
icons/tick.png
icons/timeline_marker.png
+ icons/transmit.png
icons/transmit_blue.png
icons/user.png
icons/user_suit.png
diff --git a/res/Images.qrc b/res/Images.qrc
index 6b88d80a..191af4be 100644
--- a/res/Images.qrc
+++ b/res/Images.qrc
@@ -8,6 +8,8 @@
images/HeaderIcon_MetaInfo.png
images/Label.png
images/Loading.gif
+ images/Loading2.gif
+ images/Loading3.gif
images/Logo.png
images/Logo_Contributors.png
images/Logo_Software.png
diff --git a/res/images/Loading3.gif b/res/images/Loading3.gif
new file mode 100644
index 00000000..7c2ef2b6
Binary files /dev/null and b/res/images/Loading3.gif differ
diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm
index bb6a2259..ea3baa00 100644
Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ
diff --git a/src/Config.h b/src/Config.h
index 35d0e5fa..b0c5ebee 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 1
-#define VER_LAMEXP_BUILD 400
+#define VER_LAMEXP_BUILD 402
#define VER_LAMEXP_SUFFIX Beta-13
/*
diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp
index 6cf4c50a..9b5af370 100644
--- a/src/Dialog_Update.cpp
+++ b/src/Dialog_Update.cpp
@@ -36,8 +36,10 @@
#include
#include
#include
+#include
#include
+#include
///////////////////////////////////////////////////////////////////////////////
@@ -58,6 +60,7 @@ static const char *update_mirrors[] =
"http://free.pages.at/borschdfresser/",
"http://mplayer.savedonthe.net/",
"http://www.tricksoft.de/",
+ "http://mplayer.somestuff.org/",
NULL
};
@@ -69,10 +72,14 @@ static const char *known_hosts[] =
"http://www.msn.com/",
"http://www.yahoo.com/",
"http://sourceforge.net/",
+ "http://www.gitorious.org/",
+ "http://www.youtube.com/",
+ "http://www.ebay.com/",
+ "http://www.amazon.com/",
NULL
};
-static const int MIN_CONNSCORE = 2;
+static const int MIN_CONNSCORE = 3;
static char *USER_AGENT_STR = "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101101 IceCat/3.6.12 (like Firefox/3.6.12)";
///////////////////////////////////////////////////////////////////////////////
@@ -128,6 +135,11 @@ UpdateDialog::UpdateDialog(SettingsModel *settings, QWidget *parent)
HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE);
EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
+ //Init animation
+ m_animator = new QMovie(":/images/Loading3.gif");
+ labelAnimationCenter->setMovie(m_animator);
+ m_animator->start();
+
//Enable button
connect(retryButton, SIGNAL(clicked()), this, SLOT(checkForUpdates()));
connect(installButton, SIGNAL(clicked()), this, SLOT(applyUpdate()));
@@ -140,8 +152,11 @@ UpdateDialog::UpdateDialog(SettingsModel *settings, QWidget *parent)
UpdateDialog::~UpdateDialog(void)
{
+ if(m_animator) m_animator->stop();
+
LAMEXP_DELETE(m_updateInfo);
LAMEXP_DELETE(m_logFile);
+ LAMEXP_DELETE(m_animator);
WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarNoState);
WinSevenTaskbar::setOverlayIcon(this->parentWidget(), NULL);
@@ -164,6 +179,7 @@ void UpdateDialog::showEvent(QShowEvent *event)
infoLabel->hide();
hintLabel->hide();
hintIcon->hide();
+ frameAnimation->hide();
int counter = 2;
for(int i = 0; known_hosts[i]; i++) counter++;
@@ -223,6 +239,7 @@ void UpdateDialog::checkForUpdates(void)
if(infoLabel->isVisible()) infoLabel->hide();
if(hintLabel->isVisible()) hintLabel->hide();
if(hintIcon->isVisible()) hintIcon->hide();
+ frameAnimation->show();
QApplication::processEvents();
QApplication::setOverrideCursor(Qt::WaitCursor);
@@ -232,14 +249,22 @@ void UpdateDialog::checkForUpdates(void)
m_logFile->clear();
m_logFile->append("Checking internet connection...");
+ QStringList hostList;
for(int i = 0; known_hosts[i]; i++)
+ {
+ hostList << QString::fromLatin1(known_hosts[i]);
+ }
+
+ qsrand(time(NULL));
+ while(!hostList.isEmpty())
{
progressBar->setValue(progressBar->value() + 1);
+ QString currentHost = hostList.takeAt(qrand() % hostList.count());
if(connectionScore < MIN_CONNSCORE)
{
- m_logFile->append(QStringList() << "" << "Testing host:" << known_hosts[i] << "");
+ m_logFile->append(QStringList() << "" << "Testing host:" << currentHost << "");
QString outFile = QString("%1/%2.htm").arg(lamexp_temp_folder2(), lamexp_rand_str());
- if(getFile(known_hosts[i], outFile))
+ if(getFile(currentHost, outFile))
{
connectionScore++;
}
@@ -254,6 +279,7 @@ void UpdateDialog::checkForUpdates(void)
closeButton->setEnabled(true);
retryButton->setEnabled(true);
logButton->setEnabled(true);
+ if(frameAnimation->isVisible()) frameAnimation->hide();
statusLabel->setText(tr("Network connectivity test has failed!"));
progressBar->setValue(progressBar->maximum());
hintIcon->setPixmap(QIcon(":/icons/error.png").pixmap(16,16));
@@ -272,12 +298,25 @@ void UpdateDialog::checkForUpdates(void)
statusLabel->setText(tr("Checking for new updates online, please wait..."));
m_logFile->append("Checking for updates online...");
+ QStringList mirrorList;
for(int i = 0; update_mirrors[i]; i++)
{
+ mirrorList << QString::fromLatin1(update_mirrors[i]);
+ }
+
+ qsrand(time(NULL));
+ for(int i = 0; i < 16; i++)
+ {
+ mirrorList.swap(i % 4, qrand() % 4);
+ }
+
+ while(!mirrorList.isEmpty())
+ {
+ QString currentMirror = mirrorList.takeFirst();
progressBar->setValue(progressBar->value() + 1);
if(!success)
{
- if(tryUpdateMirror(m_updateInfo, update_mirrors[i]))
+ if(tryUpdateMirror(m_updateInfo, currentMirror))
{
success = true;
}
@@ -294,6 +333,7 @@ void UpdateDialog::checkForUpdates(void)
closeButton->setEnabled(true);
retryButton->setEnabled(true);
logButton->setEnabled(true);
+ if(frameAnimation->isVisible()) frameAnimation->hide();
statusLabel->setText(tr("Failed to fetch update information from server!"));
progressBar->setValue(progressBar->maximum());
WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarErrorState);
@@ -318,6 +358,7 @@ void UpdateDialog::checkForUpdates(void)
statusLabel->setText(tr("A new version of LameXP is available!"));
hintIcon->setPixmap(QIcon(":/icons/shield_exclamation.png").pixmap(16,16));
hintLabel->setText(tr("We highly recommend all users to install this update as soon as possible."));
+ if(frameAnimation->isVisible()) frameAnimation->hide();
hintIcon->show();
hintLabel->show();
WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/shield_exclamation.png"));
@@ -328,6 +369,7 @@ void UpdateDialog::checkForUpdates(void)
statusLabel->setText(tr("No new updates available at this time."));
hintIcon->setPixmap(QIcon(":/icons/shield_green.png").pixmap(16,16));
hintLabel->setText(tr("Your version of LameXP is still up-to-date. Please check for updates regularly!"));
+ if(frameAnimation->isVisible()) frameAnimation->hide();
hintIcon->show();
hintLabel->show();
WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/shield_green.png"));
@@ -338,6 +380,7 @@ void UpdateDialog::checkForUpdates(void)
statusLabel->setText(tr("Your version appears to be newer than the latest release."));
hintIcon->setPixmap(QIcon(":/icons/bug.png").pixmap(16,16));
hintLabel->setText(tr("This usually indicates your are currently using a pre-release version of LameXP."));
+ if(frameAnimation->isVisible()) frameAnimation->hide();
hintIcon->show();
hintLabel->show();
WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/bug.png"));
@@ -347,6 +390,7 @@ void UpdateDialog::checkForUpdates(void)
closeButton->setEnabled(true);
if(retryButton->isVisible()) retryButton->hide();
if(logButton->isVisible()) logButton->hide();
+ if(frameAnimation->isVisible()) frameAnimation->hide();
m_success = true;
}
@@ -414,6 +458,11 @@ bool UpdateDialog::getFile(const QString &url, const QString &outFile)
connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), &loop, SLOT(quit()));
connect(&process, SIGNAL(readyRead()), &loop, SLOT(quit()));
+ QTimer timer;
+ timer.setSingleShot(true);
+ timer.setInterval(15000);
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+
process.start(m_binaryWGet, QStringList() << "-U" << USER_AGENT_STR << "-O" << output.fileName() << url);
if(!process.waitForStarted())
@@ -421,15 +470,28 @@ bool UpdateDialog::getFile(const QString &url, const QString &outFile)
return false;
}
+ timer.start();
+
while(process.state() == QProcess::Running)
{
loop.exec();
+ if(!timer.isActive())
+ {
+ qWarning("WGet process timed out <-- killing!");
+ process.kill();
+ process.waitForFinished();
+ m_logFile->append("TIMEOUT !!!");
+ return false;
+ }
while(process.canReadLine())
{
m_logFile->append(QString::fromLatin1(process.readLine()).simplified());
}
}
+ timer.stop();
+ timer.disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+
m_logFile->append(QString().sprintf("Exited with code %d", process.exitCode()));
return (process.exitCode() == 0) && output.exists() && output.isFile();
}
diff --git a/src/Dialog_Update.h b/src/Dialog_Update.h
index a5f37ac9..8c280c5e 100644
--- a/src/Dialog_Update.h
+++ b/src/Dialog_Update.h
@@ -27,6 +27,7 @@
class UpdateInfo;
class SettingsModel;
+class QMovie;
class UpdateDialog : public QDialog, private Ui::UpdateDialog
{
@@ -61,6 +62,7 @@ private:
UpdateInfo *m_updateInfo;
QStringList *m_logFile;
SettingsModel *m_settings;
+ QMovie *m_animator;
const QString m_binaryWGet;
const QString m_binaryGnuPG;