mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
parent
8845a23d5d
commit
34e951298f
7 changed files with 49 additions and 46 deletions
|
|
@ -45,7 +45,7 @@ DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent)
|
|||
connect(stopDownload, SIGNAL(clicked()), this, SLOT(cancelDownload()));
|
||||
connect(ok, SIGNAL(clicked()), this, SLOT(closeDialog()));
|
||||
|
||||
QVBoxLayout *parentLayout = new QVBoxLayout(this);
|
||||
auto *parentLayout = new QVBoxLayout(this);
|
||||
parentLayout->addWidget(descriptionLabel);
|
||||
parentLayout->addWidget(statusLabel);
|
||||
parentLayout->addWidget(progress);
|
||||
|
|
@ -54,8 +54,8 @@ DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent)
|
|||
setLayout(parentLayout);
|
||||
setWindowTitle(tr("Check for Client Updates"));
|
||||
|
||||
setFixedHeight(sizeHint().height());
|
||||
setFixedWidth(sizeHint().width());
|
||||
setFixedHeight(this->sizeHint().height());
|
||||
setFixedWidth(this->sizeHint().width());
|
||||
|
||||
// Check for SSL (this probably isn't necessary)
|
||||
if (!QSslSocket::supportsSsl()) {
|
||||
|
|
@ -144,7 +144,7 @@ void DlgUpdate::finishedUpdateCheck(bool needToUpdate, bool isCompatible, Releas
|
|||
return;
|
||||
}
|
||||
|
||||
publishDate = release->getPublishDate().toString(Qt::DefaultLocaleLongDate);
|
||||
publishDate = release->getPublishDate().toString(QLocale().dateFormat(QLocale::LongFormat));
|
||||
if (isCompatible) {
|
||||
int reply;
|
||||
reply = QMessageBox::question(
|
||||
|
|
@ -194,19 +194,19 @@ void DlgUpdate::enableOkButton(bool enable)
|
|||
ok->setEnabled(enable);
|
||||
}
|
||||
|
||||
void DlgUpdate::setLabel(QString newText)
|
||||
void DlgUpdate::setLabel(const QString &newText)
|
||||
{
|
||||
statusLabel->setText(newText);
|
||||
}
|
||||
|
||||
void DlgUpdate::updateCheckError(QString errorString)
|
||||
void DlgUpdate::updateCheckError(const QString &errorString)
|
||||
{
|
||||
setLabel(tr("Error"));
|
||||
QMessageBox::critical(this, tr("Update Error"),
|
||||
tr("An error occurred while checking for updates:") + QString(" ") + errorString);
|
||||
}
|
||||
|
||||
void DlgUpdate::downloadError(QString errorString)
|
||||
void DlgUpdate::downloadError(const QString &errorString)
|
||||
{
|
||||
setLabel(tr("Error"));
|
||||
enableUpdateButton(true);
|
||||
|
|
@ -214,7 +214,7 @@ void DlgUpdate::downloadError(QString errorString)
|
|||
tr("An error occurred while downloading an update:") + QString(" ") + errorString);
|
||||
}
|
||||
|
||||
void DlgUpdate::downloadSuccessful(QUrl filepath)
|
||||
void DlgUpdate::downloadSuccessful(const QUrl &filepath)
|
||||
{
|
||||
setLabel(tr("Installing..."));
|
||||
// Try to open the installer. If it opens, quit Cockatrice
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue