diff --git a/doomsday/engine/portable/src/updater.cpp b/doomsday/engine/portable/src/updater.cpp index 575e28110c..68ef5aa188 100644 --- a/doomsday/engine/portable/src/updater.cpp +++ b/doomsday/engine/portable/src/updater.cpp @@ -242,11 +242,6 @@ struct Updater::Instance { UpdaterSettings().setLastCheckTime(de::Time()); alwaysShowNotification = notifyAlways; - doCheckRequest(); - } - - void doCheckRequest() - { network->get(QNetworkRequest(composeCheckUri())); } @@ -473,7 +468,7 @@ void Updater::settingsDialogClosed(int /*result*/) void Updater::recheck() { - d->doCheckRequest(); + d->queryLatestVersion(d->alwaysShowNotification); } void Updater::showSettings() @@ -494,7 +489,7 @@ void Updater::checkNowShowingProgress() // Not if there is an ongoing download. if(d->download) return; - d->availableDlg = new UpdateAvailableDialog; + d->availableDlg = new UpdateAvailableDialog(Window_Widget(Window_Main())); connect(d->availableDlg, SIGNAL(checkAgain()), this, SLOT(recheck())); d->queryLatestVersion(true); d->availableDlg->exec(); diff --git a/doomsday/engine/portable/src/updater/updateavailabledialog.cpp b/doomsday/engine/portable/src/updater/updateavailabledialog.cpp index 72fbe19e14..55a923e77b 100644 --- a/doomsday/engine/portable/src/updater/updateavailabledialog.cpp +++ b/doomsday/engine/portable/src/updater/updateavailabledialog.cpp @@ -2,6 +2,7 @@ #include "updatersettings.h" #include "updatersettingsdialog.h" #include "versioninfo.h" +#include "window.h" #include #include #include @@ -39,6 +40,7 @@ struct UpdateAvailableDialog::Instance void initForChecking(void) { init(); + createResultPage(VersionInfo()); stack->setCurrentWidget(checkPage); } diff --git a/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp b/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp index 2f4d57b85e..c417c88dd7 100644 --- a/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp +++ b/doomsday/engine/portable/src/updater/updatersettingsdialog.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,7 @@ struct UpdaterSettingsDialog::Instance UpdaterSettingsDialog* self; QCheckBox* neverCheck; QComboBox* freqList; + QLabel* lastChecked; QComboBox* channelList; QComboBox* pathList; QCheckBox* deleteAfter; @@ -52,6 +54,9 @@ struct UpdaterSettingsDialog::Instance freqList->addItem(tr("Monthly"), UpdaterSettings::Monthly); form->addRow(tr("&Check for updates:"), freqList); + lastChecked = new QLabel; + form->addRow(new QWidget, lastChecked); + channelList = new QComboBox; channelList->addItem(tr("Stable"), UpdaterSettings::Stable); channelList->addItem(tr("Unstable/Candidate"), UpdaterSettings::Unstable); @@ -84,12 +89,17 @@ struct UpdaterSettingsDialog::Instance void fetch() { - neverCheck->setChecked(UpdaterSettings().onlyCheckManually()); - freqList->setEnabled(!UpdaterSettings().onlyCheckManually()); - freqList->setCurrentIndex(freqList->findData(UpdaterSettings().frequency())); - channelList->setCurrentIndex(channelList->findData(UpdaterSettings().channel())); - setDownloadPath(UpdaterSettings().downloadPath()); - deleteAfter->setChecked(UpdaterSettings().deleteAfterUpdate()); + UpdaterSettings st; + + lastChecked->setText(tr("Last checked on %1.") + .arg(st.lastCheckTime().asText(de::Time::FriendlyFormat))); + + neverCheck->setChecked(st.onlyCheckManually()); + freqList->setEnabled(!st.onlyCheckManually()); + freqList->setCurrentIndex(freqList->findData(st.frequency())); + channelList->setCurrentIndex(channelList->findData(st.channel())); + setDownloadPath(st.downloadPath()); + deleteAfter->setChecked(st.deleteAfterUpdate()); } void apply() diff --git a/doomsday/libdeng2/include/de/data/time.h b/doomsday/libdeng2/include/de/data/time.h index e06cfc126c..02610f32ad 100644 --- a/doomsday/libdeng2/include/de/data/time.h +++ b/doomsday/libdeng2/include/de/data/time.h @@ -99,7 +99,8 @@ class DENG2_PUBLIC Time : public ISerializable enum Format { ISOFormat, - BuildNumberAndTime + BuildNumberAndTime, + FriendlyFormat }; public: diff --git a/doomsday/libdeng2/src/data/time.cpp b/doomsday/libdeng2/src/data/time.cpp index 6b72864df6..ce61cfa325 100644 --- a/doomsday/libdeng2/src/data/time.cpp +++ b/doomsday/libdeng2/src/data/time.cpp @@ -130,6 +130,10 @@ String Time::asText(Format format) const { return _time.toString("yyyy-MM-dd hh:mm:ss.zzz"); } + else if(format == FriendlyFormat) + { + return _time.toString(Qt::TextDate); + } else { return QString("#%1 ").arg(asBuildNumber(), -4) +