UI: TrayIcon: Reorganize menu items.

This commit is contained in:
Nodir Temirkhodjaev 2021-05-17 17:31:45 +03:00
parent f271eb4de1
commit 774aae6cdc
3 changed files with 15 additions and 16 deletions

View File

@ -135,7 +135,7 @@ void StatisticsWindow::retranslateUi()
m_appInfoRow->retranslateUi(); m_appInfoRow->retranslateUi();
this->setWindowTitle(tr("Connections")); this->setWindowTitle(tr("Statistics"));
} }
void StatisticsWindow::setupUi() void StatisticsWindow::setupUi()
@ -165,7 +165,7 @@ void StatisticsWindow::setupUi()
this->setFont(QFont("Tahoma", 9)); this->setFont(QFont("Tahoma", 9));
// Icon // Icon
this->setWindowIcon(GuiUtil::overlayIcon(":/icons/sheild-96.png", ":/icons/connect.png")); this->setWindowIcon(GuiUtil::overlayIcon(":/icons/sheild-96.png", ":/icons/line-bar.png"));
// Size // Size
this->setMinimumSize(500, 400); this->setMinimumSize(500, 400);

View File

@ -125,8 +125,7 @@ void TrayIcon::updateTrayMenu(bool onlyFlags)
void TrayIcon::setupController() void TrayIcon::setupController()
{ {
connect(fortManager(), &FortManager::optWindowChanged, this, &TrayIcon::updateTrayMenuFlags); connect(fortManager(), &FortManager::optWindowChanged, this, &TrayIcon::updateTrayMenuFlags);
connect(fortManager(), &FortManager::graphWindowChanged, m_graphWindowAction, connect(fortManager(), &FortManager::graphWindowChanged, m_graphAction, &QAction::setChecked);
&QAction::setChecked);
connect(settings(), &FortSettings::passwordCheckedChanged, this, connect(settings(), &FortSettings::passwordCheckedChanged, this,
&TrayIcon::updateTrayMenuFlags); &TrayIcon::updateTrayMenuFlags);
@ -140,9 +139,9 @@ void TrayIcon::retranslateUi()
{ {
m_programsAction->setText(tr("Programs")); m_programsAction->setText(tr("Programs"));
m_optionsAction->setText(tr("Options")); m_optionsAction->setText(tr("Options"));
m_statisticsAction->setText(tr("Statistics"));
m_zonesAction->setText(tr("Zones")); m_zonesAction->setText(tr("Zones"));
m_graphWindowAction->setText(tr("Traffic Graph")); m_graphAction->setText(tr("Traffic Graph"));
m_connectionsAction->setText(tr("Connections"));
m_filterEnabledAction->setText(tr("Filter Enabled")); m_filterEnabledAction->setText(tr("Filter Enabled"));
m_stopTrafficAction->setText(tr("Stop Traffic")); m_stopTrafficAction->setText(tr("Stop Traffic"));
@ -174,18 +173,18 @@ void TrayIcon::setupTrayMenu()
SLOT(showOptionsWindow())); SLOT(showOptionsWindow()));
addHotKey(m_optionsAction, iniUser()->hotKeyOptions()); addHotKey(m_optionsAction, iniUser()->hotKeyOptions());
m_statisticsAction = addAction(menu, IconCache::icon(":/icons/line-bar.png"), QString(),
fortManager(), SLOT(showStatisticsWindow()));
addHotKey(m_statisticsAction, iniUser()->hotKeyStatistics());
m_graphAction = addAction(menu, IconCache::icon(":/icons/line-graph.png"), QString(),
fortManager(), SLOT(switchGraphWindow()), true, !!fortManager()->graphWindow());
addHotKey(m_graphAction, iniUser()->hotKeyGraph());
m_zonesAction = addAction(menu, IconCache::icon(":/icons/map-map-marker.png"), QString(), m_zonesAction = addAction(menu, IconCache::icon(":/icons/map-map-marker.png"), QString(),
fortManager(), SLOT(showZonesWindow())); fortManager(), SLOT(showZonesWindow()));
addHotKey(m_zonesAction, iniUser()->hotKeyZones()); addHotKey(m_zonesAction, iniUser()->hotKeyZones());
m_graphWindowAction = addAction(menu, IconCache::icon(":/icons/line-graph.png"), QString(),
fortManager(), SLOT(switchGraphWindow()), true, !!fortManager()->graphWindow());
addHotKey(m_graphWindowAction, iniUser()->hotKeyGraph());
m_connectionsAction = addAction(menu, IconCache::icon(":/icons/connect.png"), QString(),
fortManager(), SLOT(showConnectionsWindow()));
addHotKey(m_connectionsAction, iniUser()->hotKeyConnections());
menu->addSeparator(); menu->addSeparator();
m_filterEnabledAction = addAction(menu, QIcon(), QString(), this, SLOT(saveTrayFlags()), true); m_filterEnabledAction = addAction(menu, QIcon(), QString(), this, SLOT(saveTrayFlags()), true);

View File

@ -58,9 +58,9 @@ private:
private: private:
QAction *m_programsAction = nullptr; QAction *m_programsAction = nullptr;
QAction *m_optionsAction = nullptr; QAction *m_optionsAction = nullptr;
QAction *m_statisticsAction = nullptr;
QAction *m_graphAction = nullptr;
QAction *m_zonesAction = nullptr; QAction *m_zonesAction = nullptr;
QAction *m_graphWindowAction = nullptr;
QAction *m_connectionsAction = nullptr;
QAction *m_filterEnabledAction = nullptr; QAction *m_filterEnabledAction = nullptr;
QAction *m_stopTrafficAction = nullptr; QAction *m_stopTrafficAction = nullptr;
QAction *m_stopInetTrafficAction = nullptr; QAction *m_stopInetTrafficAction = nullptr;