From 81bf8edc52f1c8df557bbf4102182bcae93e0a4d Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 29 Oct 2015 11:47:41 -0700 Subject: [PATCH] Update the taskbar icon when we start a capture. Call both QMainWindow::setWindowIcon and QGuiApplication::setWindowIcon when we switch between normal and capture icons. The former sets the window title bar icon and the latter (depending on your OS and Qt version) sets the taskbar or dock icon. Change-Id: Ida523d423bef4df44696f6cd75208986c8787d0f Reviewed-on: https://code.wireshark.org/review/11414 Petri-Dish: Gerald Combs Reviewed-by: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- ui/qt/main_window.cpp | 5 +++++ ui/qt/main_window.h | 1 + 2 files changed, 6 insertions(+) diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 2b47f866c0..a923a533d9 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -1979,6 +1979,11 @@ void MainWindow::setMenusForFileSet(bool enable_list_files) { main_ui_->actionFileSetPreviousFile->setEnabled(enable_prev); } +void MainWindow::setWindowIcon(const QIcon &icon) { + wsApp->setWindowIcon(icon); + QMainWindow::setWindowIcon(icon); +} + void MainWindow::updateForUnsavedChanges() { setTitlebarForCaptureFile(); setMenusForCaptureFile(); diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 40c52e7b9a..2fbf527c73 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -185,6 +185,7 @@ private: void setMenusForCaptureStopping(); void setForCapturedPackets(bool have_captured_packets); void setMenusForFileSet(bool enable_list_files); + void setWindowIcon(const QIcon &icon); void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth);