aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-02-19 15:18:44 -0800
committerGerald Combs <gerald@wireshark.org>2015-02-20 00:16:39 +0000
commitec6ec4994152f7d06d09544d61900f3ce1d55ced (patch)
tree1d9be6cda30cc9ee4af0aad19a0710e2ea3b487c
parent0d3b51a28a0cb0532186f09af3328d5c8539eae5 (diff)
Qt: Fix automatic update status in welcome screen.
Wait until the application has been initialized before checking prefs.gui_update_enabled. Change-Id: I6e52ba26064b6c5b882992c30c76b65d4a618848 Reviewed-on: https://code.wireshark.org/review/7268 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--ui/qt/main_welcome.cpp39
-rw-r--r--ui/qt/main_welcome.h2
2 files changed, 21 insertions, 20 deletions
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp
index c7a245f754..6d71e6c365 100644
--- a/ui/qt/main_welcome.cpp
+++ b/ui/qt/main_welcome.cpp
@@ -123,23 +123,6 @@ MainWelcome::MainWelcome(QWidget *parent) :
welcome_ui_->recentLabel->setStyleSheet(title_ss);
welcome_ui_->helpLabel->setStyleSheet(title_ss);
- // XXX Add a "check for updates" link?
- QString full_release = tr("You are running Wireshark ");
- full_release += get_ws_vcs_version_info();
- full_release += ".";
-#ifdef HAVE_SOFTWARE_UPDATE
- if (prefs.gui_update_enabled) {
- full_release += tr(" You receive automatic updates.");
- } else {
- full_release += tr(" You have disabled automatic updates.");
- }
-#else
- // XXX Is there a way to tell if the user installed Wireshark via an
- // external package manager? If so we could say so here. We could
- // also add a link to the download page.
-#endif
- welcome_ui_->fullReleaseLabel->setText(full_release);
-
#ifdef Q_OS_MAC
recent_files_->setAttribute(Qt::WA_MacShowFocusRect, false);
welcome_ui_->interfaceTree->setAttribute(Qt::WA_MacShowFocusRect, false);
@@ -161,7 +144,7 @@ MainWelcome::MainWelcome(QWidget *parent) :
recent_files_->setTextElideMode(Qt::ElideLeft);
connect(wsApp, SIGNAL(updateRecentItemStatus(const QString &, qint64, bool)), this, SLOT(updateRecentFiles()));
- connect(wsApp, SIGNAL(appInitialized()), this, SLOT(destroySplashOverlay()));
+ connect(wsApp, SIGNAL(appInitialized()), this, SLOT(appInitialized()));
connect(welcome_ui_->interfaceTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
this, SLOT(interfaceDoubleClicked(QTreeWidgetItem*,int)));
connect(welcome_ui_->interfaceTree, SIGNAL(interfaceUpdated(const char*,bool)),
@@ -192,11 +175,29 @@ InterfaceTree *MainWelcome::getInterfaceTree()
return welcome_ui_->interfaceTree;
}
-void MainWelcome::destroySplashOverlay()
+void MainWelcome::appInitialized()
{
+ // XXX Add a "check for updates" link?
+ QString full_release = tr("You are running Wireshark ");
+ full_release += get_ws_vcs_version_info();
+ full_release += ".";
+#ifdef HAVE_SOFTWARE_UPDATE
+ if (prefs.gui_update_enabled) {
+ full_release += tr(" You receive automatic updates.");
+ } else {
+ full_release += tr(" You have disabled automatic updates.");
+ }
+#else
+ // XXX Is there a way to tell if the user installed Wireshark via an
+ // external package manager? If so we could say so here. We could
+ // also add a link to the download page.
+#endif
+ welcome_ui_->fullReleaseLabel->setText(full_release);
+
#if !defined(Q_OS_MAC) || QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
welcome_ui_->childContainer->setGraphicsEffect(NULL);
#endif
+
delete splash_overlay_;
splash_overlay_ = NULL;
}
diff --git a/ui/qt/main_welcome.h b/ui/qt/main_welcome.h
index b195e2de72..4af0170b0b 100644
--- a/ui/qt/main_welcome.h
+++ b/ui/qt/main_welcome.h
@@ -63,7 +63,7 @@ signals:
void captureFilterSyntaxChanged(bool valid);
private slots:
- void destroySplashOverlay();
+ void appInitialized();
void interfaceDoubleClicked(QTreeWidgetItem *item, int column);
void updateRecentFiles();
void openRecentItem(QListWidgetItem *item);