From c2fcad0f3fdaba6690258ad8d059f36c9eba95cb Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 20 Oct 2018 14:46:45 +0200 Subject: added about box --- src/tikzit.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/tikzit.cpp') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 585e906..fc81739 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -106,7 +106,19 @@ void Tikzit::init() QString styleFile = settings.value("previous-tikzstyles-file").toString(); if (!styleFile.isEmpty()) loadStyles(styleFile); - //connect(app, &QApplication::focusChanged, this, &focusChanged); + QVariant check = settings.value("check-for-updates"); + if (check.isNull()) { + int resp = QMessageBox::question(0, + tr("Check for updates"), + tr("Would you like TikZiT to check for updates automatically?" + " (You can always change this later in the Help menu.)"), + QMessageBox::Yes | QMessageBox::Default, + QMessageBox::No, + QMessageBox::NoButton); + check.setValue(resp == QMessageBox::Yes); + } + + setCheckForUpdates(check.toBool()); } //QMenuBar *Tikzit::mainMenu() const @@ -327,6 +339,27 @@ QString Tikzit::styleFilePath() const return _styleFilePath; } +void Tikzit::setCheckForUpdates(bool check) +{ + QSettings settings("tikzit", "tikzit"); + settings.setValue("check-for-updates", check); + foreach (MainWindow *w, _windows) { + w->menu()->updatesAction()->blockSignals(true); + w->menu()->updatesAction()->setChecked(check); + w->menu()->updatesAction()->blockSignals(false); + } +} + +void Tikzit::checkForUpdates() +{ + +} + +void Tikzit::updateReply(QNetworkReply *reply) +{ + +} + //StylePalette *Tikzit::stylePalette() const //{ // return _stylePalette; -- cgit v1.2.3