You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 6272a74d2f6d177be3c6fdda #rb Matt.Kuhlenschmidt #ROBOMERGE-OWNER: Lauren.Barnes #ROBOMERGE-AUTHOR: lauren.barnes #ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690) #ROBOMERGE-CONFLICT from-shelf [CL 20105363 by Lauren Barnes in ue5-main branch]
96 lines
2.4 KiB
C++
96 lines
2.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreTypes.h"
|
|
#include "Styling/AppStyle.h"
|
|
#include "Framework/MultiBox/MultiBoxBuilder.h"
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
#include "Widgets/SCompoundWidget.h"
|
|
#include "Widgets/SWidget.h"
|
|
#include "Widgets/Layout/SBorder.h"
|
|
|
|
#include "Models/DeviceDetailsCommands.h"
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "SDeviceBrowserContextMenu"
|
|
|
|
|
|
/**
|
|
* Implements a context menu for the device browser list view.
|
|
*/
|
|
class SDeviceBrowserContextMenu
|
|
: public SCompoundWidget
|
|
{
|
|
public:
|
|
|
|
SLATE_BEGIN_ARGS(SDeviceBrowserContextMenu) { }
|
|
SLATE_END_ARGS()
|
|
|
|
public:
|
|
|
|
/**
|
|
* Construct this widget.
|
|
*
|
|
* @param InArgs The declaration data for this widget.
|
|
* @param InUICommandList The UI command list to use.
|
|
*/
|
|
void Construct(const FArguments& InArgs, const TSharedPtr<FUICommandList>& InUICommandList)
|
|
{
|
|
ChildSlot
|
|
[
|
|
SNew(SBorder)
|
|
.BorderImage(FAppStyle::GetBrush("ToolPanel.GroupBorder"))
|
|
.Content()
|
|
[
|
|
MakeContextMenu(InUICommandList)
|
|
]
|
|
];
|
|
}
|
|
|
|
protected:
|
|
|
|
/**
|
|
* Build the context menu widget.
|
|
*
|
|
* @return The context menu.
|
|
*/
|
|
TSharedRef<SWidget> MakeContextMenu(const TSharedPtr<FUICommandList>& CommandList)
|
|
{
|
|
FMenuBuilder MenuBuilder(true, CommandList);
|
|
|
|
// ownership actions
|
|
MenuBuilder.BeginSection("Ownership", LOCTEXT("OwnershipMenuHeading", "Ownership"));
|
|
{
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Claim);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Release);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Share);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Remove);
|
|
}
|
|
MenuBuilder.EndSection();
|
|
|
|
// connectivity actions
|
|
MenuBuilder.BeginSection("Connectivity", LOCTEXT("ConnectivityMenuHeading", "Connectivity"));
|
|
{
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Connect);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Disconnect);
|
|
}
|
|
MenuBuilder.EndSection();
|
|
|
|
// remote control actions
|
|
MenuBuilder.BeginSection("RemoteControl", LOCTEXT("RemoteControlMenuHeading", "Remote Control"));
|
|
{
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().PowerOn);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().PowerOff);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().PowerOffForce);
|
|
MenuBuilder.AddMenuEntry(FDeviceDetailsCommands::Get().Reboot);
|
|
}
|
|
MenuBuilder.EndSection();
|
|
|
|
return MenuBuilder.MakeWidget();
|
|
}
|
|
};
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|