mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:36:28 +00:00
UI: TrayIcon: Simplify clickActionByType()
This commit is contained in:
parent
da7c7e64b3
commit
c3220c557b
@ -605,28 +605,23 @@ QAction *TrayIcon::clickActionFromIni(ClickType clickType) const
|
|||||||
|
|
||||||
QAction *TrayIcon::clickActionByType(ActionType actionType) const
|
QAction *TrayIcon::clickActionByType(ActionType actionType) const
|
||||||
{
|
{
|
||||||
switch (actionType) {
|
QAction *actions[] = {
|
||||||
case TrayIcon::ActionShowPrograms:
|
m_programsAction,
|
||||||
return m_programsAction;
|
m_optionsAction,
|
||||||
case TrayIcon::ActionShowOptions:
|
m_statisticsAction,
|
||||||
return m_optionsAction;
|
m_graphAction,
|
||||||
case TrayIcon::ActionShowStatistics:
|
m_filterEnabledAction,
|
||||||
return m_statisticsAction;
|
m_stopTrafficAction,
|
||||||
case TrayIcon::ActionShowTrafficGraph:
|
m_stopInetTrafficAction,
|
||||||
return m_graphAction;
|
m_autoAllowProgsAction,
|
||||||
case TrayIcon::ActionSwitchFilterEnabled:
|
m_trayMenuAction,
|
||||||
return m_filterEnabledAction;
|
};
|
||||||
case TrayIcon::ActionSwitchStopTraffic:
|
|
||||||
return m_stopTrafficAction;
|
if (actionType > TrayIcon::ActionNone && actionType < TrayIcon::ActionIgnore) {
|
||||||
case TrayIcon::ActionSwitchStopInetTraffic:
|
return actions[actionType];
|
||||||
return m_stopInetTrafficAction;
|
|
||||||
case TrayIcon::ActionSwitchAutoAllowPrograms:
|
|
||||||
return m_autoAllowProgsAction;
|
|
||||||
case TrayIcon::ActionShowTrayMenu:
|
|
||||||
return m_trayMenuAction;
|
|
||||||
default:
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIcon::onMouseClicked(TrayIcon::ClickType clickType)
|
void TrayIcon::onMouseClicked(TrayIcon::ClickType clickType)
|
||||||
|
Loading…
Reference in New Issue
Block a user