mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 10:16:00 +03:00
Merge pull request #14428 from mkopec/menuicons
Add an option to disable icons in menus
This commit is contained in:
commit
da87eb7b4c
5 changed files with 30 additions and 0 deletions
|
@ -251,6 +251,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
// On OS X the standard is to not show icons in the menus
|
||||
app->setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#else
|
||||
if (!Preferences::instance()->iconsInMenusEnabled())
|
||||
app->setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#endif
|
||||
|
||||
if (!firstTimeUser)
|
||||
|
|
|
@ -234,6 +234,16 @@ void Preferences::setCloseToTrayNotified(const bool b)
|
|||
{
|
||||
setValue("Preferences/General/CloseToTrayNotified", b);
|
||||
}
|
||||
|
||||
bool Preferences::iconsInMenusEnabled() const
|
||||
{
|
||||
return value("Preferences/Advanced/EnableIconsInMenus", true).toBool();
|
||||
}
|
||||
|
||||
void Preferences::setIconsInMenusEnabled(const bool enable)
|
||||
{
|
||||
setValue("Preferences/Advanced/EnableIconsInMenus", enable);
|
||||
}
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
bool Preferences::isToolbarDisplayed() const
|
||||
|
|
|
@ -313,6 +313,8 @@ public:
|
|||
void setCloseToTrayNotified(bool b);
|
||||
TrayIcon::Style trayIconStyle() const;
|
||||
void setTrayIconStyle(TrayIcon::Style style);
|
||||
bool iconsInMenusEnabled() const;
|
||||
void setIconsInMenusEnabled(bool enable);
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
// Stuff that don't appear in the Options GUI but are saved
|
||||
|
|
|
@ -82,6 +82,9 @@ namespace
|
|||
DOWNLOAD_TRACKER_FAVICON,
|
||||
SAVE_PATH_HISTORY_LENGTH,
|
||||
ENABLE_SPEED_WIDGET,
|
||||
#ifndef Q_OS_MACOS
|
||||
ENABLE_ICONS_IN_MENUS,
|
||||
#endif
|
||||
// embedded tracker
|
||||
TRACKER_STATUS,
|
||||
TRACKER_PORT,
|
||||
|
@ -279,6 +282,9 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||
mainWindow->setDownloadTrackerFavicon(m_checkBoxTrackerFavicon.isChecked());
|
||||
AddNewTorrentDialog::setSavePathHistoryLength(m_spinBoxSavePathHistoryLength.value());
|
||||
pref->setSpeedWidgetEnabled(m_checkBoxSpeedWidgetEnabled.isChecked());
|
||||
#ifndef Q_OS_MACOS
|
||||
pref->setIconsInMenusEnabled(m_checkBoxIconsInMenusEnabled.isChecked());
|
||||
#endif
|
||||
|
||||
// Tracker
|
||||
pref->setTrackerPort(m_spinBoxTrackerPort.value());
|
||||
|
@ -647,6 +653,11 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||
// Enable speed graphs
|
||||
m_checkBoxSpeedWidgetEnabled.setChecked(pref->isSpeedWidgetEnabled());
|
||||
addRow(ENABLE_SPEED_WIDGET, tr("Enable speed graphs"), &m_checkBoxSpeedWidgetEnabled);
|
||||
#ifndef Q_OS_MACOS
|
||||
// Enable icons in menus
|
||||
m_checkBoxIconsInMenusEnabled.setChecked(pref->iconsInMenusEnabled());
|
||||
addRow(ENABLE_ICONS_IN_MENUS, tr("Enable icons in menus"), &m_checkBoxIconsInMenusEnabled);
|
||||
#endif
|
||||
// Tracker State
|
||||
m_checkBoxTrackerStatus.setChecked(session->isTrackerEnabled());
|
||||
addRow(TRACKER_STATUS, tr("Enable embedded tracker"), &m_checkBoxTrackerStatus);
|
||||
|
|
|
@ -84,4 +84,8 @@ private:
|
|||
#if defined(Q_OS_WIN)
|
||||
QComboBox m_comboBoxOSMemoryPriority;
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
QCheckBox m_checkBoxIconsInMenusEnabled;
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue