summaryrefslogtreecommitdiff
path: root/HelpDialog.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2019-02-03 00:10:52 +0000
committerThomas Preud'homme <robotux@celest.fr>2019-02-03 00:10:52 +0000
commit9b10c21f5cad0e2ec27d23c59e65af7141a226f3 (patch)
treebf81d75a9ed990bb76488c502767600fcf7550b7 /HelpDialog.cpp
parent594fcba67600704bee9115c86e18927b2237b304 (diff)
New upstream version 1.6.1.3
Diffstat (limited to 'HelpDialog.cpp')
-rw-r--r--HelpDialog.cpp42
1 files changed, 28 insertions, 14 deletions
diff --git a/HelpDialog.cpp b/HelpDialog.cpp
index 0e266e4..b52e402 100644
--- a/HelpDialog.cpp
+++ b/HelpDialog.cpp
@@ -4,6 +4,7 @@
\licence GPL3, see the file COPYING */
#include "HelpDialog.h"
+#include "ProductKey.h"
#include <QTreeWidgetItem>
#include <QApplication>
@@ -36,6 +37,9 @@ HelpDialog::HelpDialog() :
#else
setWindowTitle(tr("About Ultracopier"));
#endif
+ #ifndef ULTRACOPIER_INTERNET_SUPPORT
+ ui->checkUpdate->hide();
+ #endif
}
/// \brief Destruct the object
@@ -64,11 +68,10 @@ void HelpDialog::reloadTextValue()
{
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start");
QString text=ui->label_ultracopier->text();
- #ifdef ULTRACOPIER_VERSION_ULTIMATE
- text=text.replace(QStringLiteral("%1"),QStringLiteral("Ultimate %1").arg(ULTRACOPIER_VERSION));
- #else
- text=text.replace(QStringLiteral("%1"),ULTRACOPIER_VERSION);
- #endif
+ if(ProductKey::productKey->isUltimate())
+ text=text.replace(QStringLiteral("%1"),QStringLiteral("Ultimate %1").arg(ULTRACOPIER_VERSION));
+ else
+ text=text.replace(QStringLiteral("%1"),ULTRACOPIER_VERSION);
#ifdef ULTRACOPIER_MODE_SUPERCOPIER
text=text.replace(QStringLiteral("Ultracopier"),QStringLiteral("Supercopier"),Qt::CaseInsensitive);
#endif
@@ -112,15 +115,7 @@ std::string HelpDialog::getWebSite()
std::string HelpDialog::getUpdateUrl()
{
- #if defined(ULTRACOPIER_VERSION_ULTIMATE)
- return tr("http://ultracopier.first-world.info/shop.html").toStdString();
- #else
- #ifdef ULTRACOPIER_MODE_SUPERCOPIER
- return tr("http://ultracopier.first-world.info/").toStdString()+"supercopier.html";
- #else
- return tr("http://ultracopier.first-world.info/download.html").toStdString();
- #endif
- #endif
+ return tr("http://ultracopier.first-world.info/download.html").toStdString();
}
#ifdef ULTRACOPIER_DEBUG
@@ -143,3 +138,22 @@ void HelpDialog::on_pushButtonCrash_clicked()
int *b=NULL;
*b=3/a;
}
+
+#ifdef ULTRACOPIER_INTERNET_SUPPORT
+void HelpDialog::on_checkUpdate_clicked()
+{
+ ui->status->setText(tr("Update checking..."));
+ emit checkUpdate();
+}
+
+void HelpDialog::newUpdate(const std::string &version) const
+{
+ ui->status->setText(tr("Update: %1").arg(QString::fromStdString(version)));
+}
+
+void HelpDialog::noNewUpdate() const
+{
+ if(!ui->status->text().isEmpty())
+ ui->status->setText(tr("No update"));
+}
+#endif