aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/MainWindow.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-04 15:49:00 +0000
committerSaturneric <[email protected]>2022-01-04 15:49:00 +0000
commit952d0424ab1a130d4365bd9995b03a9fc1ddd81b (patch)
tree4c5e5d3b7b41a3e3ac1da007c47a0189e0e1df0f /src/ui/MainWindow.cpp
parent<feature, fix, refactor>(core, ui): fixed known bugs for v2.0.4-beta.1 and ad... (diff)
downloadGpgFrontend-952d0424ab1a130d4365bd9995b03a9fc1ddd81b.tar.gz
GpgFrontend-952d0424ab1a130d4365bd9995b03a9fc1ddd81b.zip
<fix, refactor>(core, ui): fixed known bugs for v2.0.4-beta.1.
1. fixed proxy settings ui. 2. fixed send mail settings ui. 3. fixed uncaught exception handling.
Diffstat (limited to 'src/ui/MainWindow.cpp')
-rw-r--r--src/ui/MainWindow.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/ui/MainWindow.cpp b/src/ui/MainWindow.cpp
index 44d8103d..2af6da78 100644
--- a/src/ui/MainWindow.cpp
+++ b/src/ui/MainWindow.cpp
@@ -116,16 +116,20 @@ void MainWindow::init() noexcept {
emit loaded();
+ // if not prohibit update checking
+ if (!prohibit_update_checking_) {
#ifdef RELEASE
- auto version_thread = new VersionCheckThread();
+ auto version_thread = new VersionCheckThread();
- connect(version_thread, SIGNAL(finished()), version_thread,
- SLOT(deleteLater()));
- connect(version_thread, &VersionCheckThread::upgradeVersion, this,
- &MainWindow::slotVersionUpgrade);
+ connect(version_thread, SIGNAL(finished()), version_thread,
+ SLOT(deleteLater()));
+ connect(version_thread, &VersionCheckThread::upgradeVersion, this,
+ &MainWindow::slotVersionUpgrade);
- version_thread->start();
+ version_thread->start();
#endif
+ }
+
} catch (...) {
LOG(FATAL) << _("Critical error occur while loading GpgFrontend.");
QMessageBox::critical(nullptr, _("Loading Failed"),
@@ -301,6 +305,15 @@ void MainWindow::restoreSettings() {
smtp.add("enable", libconfig::Setting::TypeBoolean) = true;
}
+ prohibit_update_checking_ = false;
+ try {
+ prohibit_update_checking_ =
+ settings.lookup("network.prohibit_update_checking");
+ } catch (...) {
+ LOG(ERROR) << _("Setting Operation Error")
+ << _("prohibit_update_checking");
+ }
+
} catch (...) {
LOG(ERROR) << "cannot resolve settings";
}