mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:25:56 +00:00
UI: MyFort: About: Improve "Check Update" button's tooltip
This commit is contained in:
parent
07c2a129fa
commit
afab861b24
@ -12,6 +12,22 @@
|
||||
#include <util/dateutil.h>
|
||||
#include <util/iconcache.h>
|
||||
|
||||
namespace {
|
||||
|
||||
QString checkUpdateToolTip(TaskInfoUpdateChecker *updateChecker)
|
||||
{
|
||||
const QDateTime lastRun = updateChecker->lastRun();
|
||||
const QDateTime lastSuccess = updateChecker->lastSuccess();
|
||||
|
||||
QString text = DateUtil::localeDateTime(lastRun);
|
||||
if (lastRun != lastSuccess) {
|
||||
text += " / " + DateUtil::localeDateTime(lastSuccess);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AboutPage::AboutPage(HomeController *ctrl, QWidget *parent) : HomeBasePage(ctrl, parent)
|
||||
{
|
||||
setupUi();
|
||||
@ -104,9 +120,7 @@ void AboutPage::setupNewVersionUpdate()
|
||||
m_btDownload->setWindowFilePath(updateChecker->downloadUrl());
|
||||
m_btDownload->setToolTip(updateChecker->downloadUrl());
|
||||
|
||||
m_btCheckUpdate->setToolTip(
|
||||
QString("%1 (%2)").arg(DateUtil::localeDateTime(updateChecker->lastRun()),
|
||||
DateUtil::localeDateTime(updateChecker->lastSuccess())));
|
||||
m_btCheckUpdate->setToolTip(checkUpdateToolTip(updateChecker));
|
||||
|
||||
retranslateNewVersionBox();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user