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();
this->setWindowTitle(tr("Connections"));
this->setWindowTitle(tr("Statistics"));
}
void StatisticsWindow::setupUi()
@ -165,7 +165,7 @@ void StatisticsWindow::setupUi()
this->setFont(QFont("Tahoma", 9));
// 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
this->setMinimumSize(500, 400);

View File

@ -125,8 +125,7 @@ void TrayIcon::updateTrayMenu(bool onlyFlags)
void TrayIcon::setupController()
{
connect(fortManager(), &FortManager::optWindowChanged, this, &TrayIcon::updateTrayMenuFlags);
connect(fortManager(), &FortManager::graphWindowChanged, m_graphWindowAction,
&QAction::setChecked);
connect(fortManager(), &FortManager::graphWindowChanged, m_graphAction, &QAction::setChecked);
connect(settings(), &FortSettings::passwordCheckedChanged, this,
&TrayIcon::updateTrayMenuFlags);
@ -140,9 +139,9 @@ void TrayIcon::retranslateUi()
{
m_programsAction->setText(tr("Programs"));
m_optionsAction->setText(tr("Options"));
m_statisticsAction->setText(tr("Statistics"));
m_zonesAction->setText(tr("Zones"));
m_graphWindowAction->setText(tr("Traffic Graph"));
m_connectionsAction->setText(tr("Connections"));
m_graphAction->setText(tr("Traffic Graph"));
m_filterEnabledAction->setText(tr("Filter Enabled"));
m_stopTrafficAction->setText(tr("Stop Traffic"));
@ -174,18 +173,18 @@ void TrayIcon::setupTrayMenu()
SLOT(showOptionsWindow()));
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(),
fortManager(), SLOT(showZonesWindow()));
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();
m_filterEnabledAction = addAction(menu, QIcon(), QString(), this, SLOT(saveTrayFlags()), true);

View File

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