diff --git a/Source/Gui/SettingsWindow.cpp b/Source/Gui/SettingsWindow.cpp index 8750fe4..0709119 100644 --- a/Source/Gui/SettingsWindow.cpp +++ b/Source/Gui/SettingsWindow.cpp @@ -211,6 +211,11 @@ int SettingsWindow::GetTabCurrentIndex() const return _ui.tabWidget->currentIndex(); } +int SettingsWindow::GetTabLastVisibleIndex() const +{ + return GetTabCount() - 2 /* Skip the Debug tab */; +} + void SettingsWindow::SetTabIndex(int index) { _ui.tabWidget->setCurrentIndex(index); diff --git a/Source/Gui/SettingsWindow.h b/Source/Gui/SettingsWindow.h index a7f0a91..da733b8 100644 --- a/Source/Gui/SettingsWindow.h +++ b/Source/Gui/SettingsWindow.h @@ -41,6 +41,7 @@ class SettingsWindow : public QDialog int GetTabCount() const; int GetTabCurrentIndex() const; + int GetTabLastVisibleIndex() const; void SetTabIndex(int index); private: diff --git a/Source/Gui/TrayIcon.cpp b/Source/Gui/TrayIcon.cpp index 2e7f4e7..db00a64 100644 --- a/Source/Gui/TrayIcon.cpp +++ b/Source/Gui/TrayIcon.cpp @@ -320,7 +320,7 @@ void TrayIcon::OnNewVersionClicked() void TrayIcon::OnSettingsClicked() { if (!_settingsWindow.isVisible() || - _settingsWindow.GetTabCurrentIndex() == _settingsWindow.GetTabCount() - 1) + _settingsWindow.GetTabCurrentIndex() == _settingsWindow.GetTabLastVisibleIndex()) { _settingsWindow.SetTabIndex(0); } @@ -331,7 +331,7 @@ void TrayIcon::OnSettingsClicked() void TrayIcon::OnAboutClicked() { - _settingsWindow.SetTabIndex(_settingsWindow.GetTabCount() - 1); + _settingsWindow.SetTabIndex(_settingsWindow.GetTabLastVisibleIndex()); _settingsWindow.show(); _settingsWindow.raise(); }