More update manager UI improvements.

This commit is contained in:
LoRd_MuldeR 2010-12-08 20:52:18 +01:00
parent 6276e54932
commit 6a12462e50
5 changed files with 104 additions and 16 deletions

View File

@ -147,17 +147,8 @@
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>32</number>
</property>
<property name="topMargin">
<number>42</number>
</property>
<property name="rightMargin">
<number>32</number>
</property>
<property name="bottomMargin">
<number>32</number>
<property name="margin">
<number>28</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -184,6 +175,49 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>5</number>
</property>
<item>
<widget class="QLabel" name="hintIcon">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/information.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="hintLabel">
<property name="text">
<string>$(HINT_TEXT)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -199,6 +233,9 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -507,6 +544,17 @@
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
</resources>
<connections>
<connection>

View File

@ -10,8 +10,10 @@
<file>icons/arrow_down.png</file>
<file>icons/arrow_up.png</file>
<file>icons/arrow_refresh.png</file>
<file>icons/bell.png</file>
<file>icons/bin.png</file>
<file>icons/bomb.png</file>
<file>icons/bug.png</file>
<file>icons/calendar.png</file>
<file>icons/cancel.png</file>
<file>icons/cd.png</file>
@ -53,6 +55,7 @@
<file>icons/play.png</file>
<file>icons/resultset_next.png</file>
<file>icons/script_edit.png</file>
<file>icons/server_error.png</file>
<file>icons/sound.png</file>
<file>icons/star.png</file>
<file>icons/table_edit.png</file>

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 0
#define VER_LAMEXP_BUILD 134
#define VER_LAMEXP_BUILD 136
#define VER_LAMEXP_SUFFIX TechPreview
/*

View File

@ -146,6 +146,8 @@ void UpdateDialog::showEvent(QShowEvent *event)
retryButton->hide();
logButton->hide();
infoLabel->hide();
hintLabel->hide();
hintIcon->hide();
int counter = 2;
for(int i = 0; known_hosts[i]; i++) counter++;
@ -160,6 +162,18 @@ void UpdateDialog::closeEvent(QCloseEvent *event)
if(!closeButton->isEnabled()) event->ignore();
}
void UpdateDialog::keyPressEvent(QKeyEvent *e)
{
if(e->key() == Qt::Key_F11)
{
if(closeButton->isEnabled()) logButtonClicked();
}
else
{
QDialog::keyPressEvent(e);
}
}
void UpdateDialog::updateInit(void)
{
setMinimumSize(size());
@ -181,6 +195,8 @@ void UpdateDialog::checkForUpdates(void)
retryButton->setEnabled(false);
logButton->setEnabled(false);
if(infoLabel->isVisible()) infoLabel->hide();
if(hintLabel->isVisible()) hintLabel->hide();
if(hintIcon->isVisible()) hintIcon->hide();
QApplication::processEvents();
QApplication::setOverrideCursor(Qt::WaitCursor);
@ -212,8 +228,12 @@ void UpdateDialog::checkForUpdates(void)
closeButton->setEnabled(true);
retryButton->setEnabled(true);
logButton->setEnabled(true);
statusLabel->setText("Connectivity test faild. Please check your internet connection!");
statusLabel->setText("Network connectivity test has faild!");
progressBar->setValue(progressBar->maximum());
hintIcon->setPixmap(QIcon(":/icons/error.png").pixmap(16,16));
hintLabel->setText("Please make sure your internet connection is working properly and try again.");
hintIcon->show();
hintLabel->show();
LAMEXP_DELETE(m_updateInfo);
if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
QApplication::restoreOverrideCursor();
@ -246,8 +266,12 @@ void UpdateDialog::checkForUpdates(void)
closeButton->setEnabled(true);
retryButton->setEnabled(true);
logButton->setEnabled(true);
statusLabel->setText("Failed to fetch update information from server. Try again later!");
statusLabel->setText("Failed to fetch update information from server!");
progressBar->setValue(progressBar->maximum());
hintIcon->setPixmap(QIcon(":/icons/server_error.png").pixmap(16,16));
hintLabel->setText("Sorry, the update server might be busy at this time. Plase try again later.");
hintIcon->show();
hintLabel->show();
LAMEXP_DELETE(m_updateInfo);
if(m_settings->soundsEnabled()) PlaySound(MAKEINTRESOURCE(IDR_WAVE_ERROR), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
return;
@ -261,17 +285,29 @@ void UpdateDialog::checkForUpdates(void)
if(m_updateInfo->m_buildNo > lamexp_version_build())
{
installButton->setEnabled(true);
statusLabel->setText("A new version of LameXP is available. Update highly recommended!");
statusLabel->setText("A new version of LameXP is available!");
hintIcon->setPixmap(QIcon(":/icons/bell.png").pixmap(16,16));
hintLabel->setText("We highly recommend all users to install this update as soon as possible.");
hintIcon->show();
hintLabel->show();
MessageBeep(MB_ICONINFORMATION);
}
else if(m_updateInfo->m_buildNo == lamexp_version_build())
{
statusLabel->setText("No new updates avialbale. Your version of LameXP is up-to-date.");
statusLabel->setText("No new updates avialbale at this time.");
hintIcon->setPixmap(QIcon(":/icons/information.png").pixmap(16,16));
hintLabel->setText("Your version of LameXP is still up-to-date. Please check for updates regularly!");
hintIcon->show();
hintLabel->show();
MessageBeep(MB_ICONINFORMATION);
}
else
{
statusLabel->setText("Your version appears to be newer than the latest release.");
hintIcon->setPixmap(QIcon(":/icons/bug.png").pixmap(16,16));
hintLabel->setText("This usually indicates your are currently using a pre-release version of LameXP.");
hintIcon->show();
hintLabel->show();
MessageBeep(MB_ICONEXCLAMATION);
}

View File

@ -48,6 +48,7 @@ private slots:
protected:
void showEvent(QShowEvent *event);
void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent *e);
private:
bool tryUpdateMirror(UpdateInfo *updateInfo, const QString &url);