X-Plane menu improvements

* Remove start items with DBus details and replace them with a single start
* Add an item to toggle the message box
This commit is contained in:
Roland Winklmeier
2018-02-17 11:55:28 +01:00
committed by Klaus Basan
parent ff37704a59
commit 7f6dd61bb3
4 changed files with 15 additions and 6 deletions

View File

@@ -29,14 +29,16 @@ namespace XSwiftBus
CPlugin::CPlugin()
: m_menu(CMenu::mainMenu().subMenu("XSwiftBus"))
{
m_startServerMenuItems.push_back(m_menu.item("Start server on session bus", [this]{ startServer(BlackMisc::CDBusServer::sessionBusAddress()); }));
m_startServerMenuItems.push_back(m_menu.item("Start server on system bus", [this]{ startServer(BlackMisc::CDBusServer::systemBusAddress()); }));
m_startServerMenuItems.push_back(m_menu.item("Start server on localhost P2P", [this]{ startServer(BlackMisc::CDBusServer::p2pAddress("localhost")); }));
m_startServerMenuItem = m_menu.item("Start XSwiftBus", [this]{ startServer(BlackMisc::CDBusServer::sessionBusAddress()); });
m_toggleMessageWindowMenuItem = m_menu.item("Toggle Message Window", [this] { if(m_service) { m_service->toggleMessageBoxVisibility(); } });
// m_startServerMenuItems.push_back(m_menu.item("Start server on system bus", [this]{ startServer(BlackMisc::CDBusServer::systemBusAddress()); }));
// m_startServerMenuItems.push_back(m_menu.item("Start server on localhost P2P", [this]{ startServer(BlackMisc::CDBusServer::p2pAddress("localhost")); }));
}
void CPlugin::startServer(const QString &address)
{
for (auto &item : m_startServerMenuItems) { item.setEnabled(false); }
// for (auto &item : m_startServerMenuItems) { item.setEnabled(false); }
m_startServerMenuItem.setEnabled(false);
m_service = new CService(this);
m_traffic = new CTraffic(this);