about-dialog.cpp (seafile-client-9.0.1) | : | about-dialog.cpp (seafile-client-9.0.2) | ||
---|---|---|---|---|
#include <QtWidgets> | #include <QtWidgets> | |||
#include "seafile-applet.h" | #include "seafile-applet.h" | |||
#include "utils/utils.h" | #include "utils/utils.h" | |||
#include "about-dialog.h" | #include "about-dialog.h" | |||
#ifdef HAVE_SPARKLE_SUPPORT | ||||
#include "auto-update-service.h" | ||||
#endif | ||||
namespace { | ||||
} // namespace | ||||
AboutDialog::AboutDialog(QWidget *parent) | AboutDialog::AboutDialog(QWidget *parent) | |||
: QDialog(parent) | : QDialog(parent) | |||
{ | { | |||
setupUi(this); | setupUi(this); | |||
setWindowTitle(tr("About %1").arg(getBrand())); | setWindowTitle(tr("About %1").arg(getBrand())); | |||
setWindowIcon(QIcon(":/images/seafile.png")); | setWindowIcon(QIcon(":/images/seafile.png")); | |||
setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | | setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | | |||
Qt::WindowStaysOnTopHint); | Qt::WindowStaysOnTopHint); | |||
version_text_ = tr("<h2>%1 Client %2</h2>") | version_text_ = tr("<h2>%1 Client %2</h2>") | |||
.arg(getBrand()) | .arg(getBrand()) | |||
.arg(STRINGIZE(SEAFILE_CLIENT_VERSION)) | .arg(STRINGIZE(SEAFILE_CLIENT_VERSION)) | |||
#ifdef SEAFILE_CLIENT_REVISION | #ifdef SEAFILE_CLIENT_REVISION | |||
.append(tr("<h5> REV %1 </h5>")) | .append(tr("<h5> REV %1 </h5>")) | |||
.arg(STRINGIZE(SEAFILE_CLIENT_REVISION)) | .arg(STRINGIZE(SEAFILE_CLIENT_REVISION)) | |||
#endif | #endif | |||
; | ; | |||
mVersionText->setText(version_text_); | mVersionText->setText(version_text_); | |||
connect(mOKBtn, SIGNAL(clicked()), this, SLOT(close())); | connect(mOKBtn, SIGNAL(clicked()), this, SLOT(close())); | |||
mCheckUpdateBtn->setVisible(false); | ||||
#ifdef HAVE_SPARKLE_SUPPORT | ||||
if (AutoUpdateService::instance()->shouldSupportAutoUpdate()) { | ||||
mCheckUpdateBtn->setVisible(true); | ||||
connect(mCheckUpdateBtn, SIGNAL(clicked()), this, SLOT(checkUpdate())); | ||||
} | ||||
#endif | ||||
} | } | |||
#ifdef HAVE_SPARKLE_SUPPORT | ||||
void AboutDialog::checkUpdate() | ||||
{ | ||||
AutoUpdateService::instance()->checkUpdate(); | ||||
close(); | ||||
} | ||||
#endif | ||||
End of changes. 3 change blocks. | ||||
16 lines changed or deleted | 0 lines changed or added |