logic: Added update checker connecting to online API
* connects to https://www.sourcetrail.com/api/v1/versions/latest * sends information about OS, platform, license type, current version and a unique user token * Automatic update check is enabled via Startscreen and performed once every 24 hours on window focus * Update check can be forced by clicking on "check for new version" on start screen * renamed TimePoint to TimeStamp fortune cookie message = In Träumen und im Leben ist nichts unmöglich.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "component/view/View.h"
|
||||
#include "data/bookmark/Bookmark.h"
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/network/QtUpdateChecker.h"
|
||||
#include "qt/utility/QtContextMenu.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/QtViewWidgetWrapper.h"
|
||||
@@ -51,6 +52,7 @@
|
||||
#include "utility/UserPaths.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
|
||||
QtViewToggle::QtViewToggle(View* view, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_view(view)
|
||||
@@ -104,7 +106,7 @@ QtMainWindow::QtMainWindow()
|
||||
, m_showDockWidgetTitleBars(true)
|
||||
, m_windowStack(this)
|
||||
{
|
||||
setObjectName("QtMainWindow");
|
||||
setObjectName("QtMainWindow");
|
||||
setCentralWidget(nullptr);
|
||||
setDockNestingEnabled(true);
|
||||
|
||||
@@ -112,13 +114,13 @@ QtMainWindow::QtMainWindow()
|
||||
setWindowFlags(Qt::Widget);
|
||||
|
||||
#ifdef __linux__
|
||||
if (std::getenv("SOURCETRAIL_VIA_SCRIPT") == nullptr)
|
||||
{
|
||||
QMessageBox::warning(this, "Run Sourcetrail via Script", "Please run Sourcetrail via Sourcetrail.sh");
|
||||
}
|
||||
if (std::getenv("SOURCETRAIL_VIA_SCRIPT") == nullptr)
|
||||
{
|
||||
QMessageBox::warning(this, "Run Sourcetrail via Script", "Please run Sourcetrail via Sourcetrail.sh");
|
||||
}
|
||||
#endif
|
||||
|
||||
QApplication* app = dynamic_cast<QApplication*>(QCoreApplication::instance());
|
||||
QApplication* app = dynamic_cast<QApplication*>(QCoreApplication::instance());
|
||||
app->installEventFilter(new MouseReleaseFilter(this));
|
||||
|
||||
app->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("main.css"))).c_str());
|
||||
@@ -358,6 +360,7 @@ void QtMainWindow::keyPressEvent(QKeyEvent* event)
|
||||
break;
|
||||
|
||||
case Qt::Key_Space:
|
||||
QtUpdateChecker::check();
|
||||
PRINT_TRACES();
|
||||
break;
|
||||
}
|
||||
@@ -376,13 +379,13 @@ void QtMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
log->setEnabled(false);
|
||||
}
|
||||
MessageWindowClosed().dispatch();
|
||||
MessageWindowClosed().dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
m_windowStack.centerSubWindows();
|
||||
QMainWindow::resizeEvent(event);
|
||||
m_windowStack.centerSubWindows();
|
||||
QMainWindow::resizeEvent(event);
|
||||
}
|
||||
|
||||
void QtMainWindow::about()
|
||||
|
||||
Reference in New Issue
Block a user