mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #855, use Qt5 isSignalConnected feature to hide menus not used
This commit is contained in:
committed by
Mathew Sutcliffe
parent
5f7c3f0e9c
commit
0a611890e8
@@ -83,6 +83,7 @@
|
|||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QMetaMethod>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
using namespace BlackConfig;
|
||||||
@@ -238,8 +239,18 @@ namespace BlackGui
|
|||||||
CMenuActions ma;
|
CMenuActions ma;
|
||||||
switch (menu)
|
switch (menu)
|
||||||
{
|
{
|
||||||
case MenuRefresh: { ma.addAction(BlackMisc::CIcons::refresh16(), "Update", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReload }); break; }
|
case MenuRefresh:
|
||||||
case MenuBackend: { ma.addAction(BlackMisc::CIcons::refresh16(), "Reload from backend", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReloadFromBackend }); break; }
|
{
|
||||||
|
static const QMetaMethod requestSignal = QMetaMethod::fromSignal(&CViewBaseNonTemplate::requestUpdate);
|
||||||
|
if (!this->isSignalConnected(requestSignal)) break;
|
||||||
|
ma.addAction(BlackMisc::CIcons::refresh16(), "Update", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReload }); break;
|
||||||
|
}
|
||||||
|
case MenuBackend:
|
||||||
|
{
|
||||||
|
static const QMetaMethod requestSignal = QMetaMethod::fromSignal(&CViewBaseNonTemplate::requestNewBackendData);
|
||||||
|
if (!this->isSignalConnected(requestSignal)) break;
|
||||||
|
ma.addAction(BlackMisc::CIcons::refresh16(), "Reload from backend", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReloadFromBackend }); break;
|
||||||
|
}
|
||||||
case MenuDisplayAutomatically:
|
case MenuDisplayAutomatically:
|
||||||
{
|
{
|
||||||
QAction *a = ma.addAction(CIcons::appMappings16(), "Automatically display (when loaded)", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_toggleAutoDisplay });
|
QAction *a = ma.addAction(CIcons::appMappings16(), "Automatically display (when loaded)", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_toggleAutoDisplay });
|
||||||
|
|||||||
Reference in New Issue
Block a user