mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:57:22 +01:00
add permission popup ui
This commit is contained in:
parent
2fbee855ae
commit
33535310aa
7 changed files with 230 additions and 18 deletions
|
|
@ -73,6 +73,7 @@ public record RefreshUiMessage : MessageBase;
|
|||
public record OpenReportPopupMessage(Pair PairToReport) : MessageBase;
|
||||
public record OpenBanUserPopupMessage(Pair PairToBan, GroupFullInfoDto GroupFullInfoDto) : MessageBase;
|
||||
public record OpenSyncshellAdminPanel(GroupFullInfoDto GroupInfo) : MessageBase;
|
||||
public record OpenPermissionWindow(Pair Pair) : MessageBase;
|
||||
|
||||
#pragma warning restore S2094
|
||||
#pragma warning restore MA0048 // File name must match type name
|
||||
|
|
@ -43,4 +43,10 @@ public class UiFactory
|
|||
return new StandaloneProfileUi(_loggerFactory.CreateLogger<StandaloneProfileUi>(), _mareMediator,
|
||||
_uiSharedService, _serverConfigManager, _mareProfileManager, _pairManager, pair);
|
||||
}
|
||||
|
||||
public PermissionWindowUI CreatePermissionPopupUi(Pair pair)
|
||||
{
|
||||
return new PermissionWindowUI(_loggerFactory.CreateLogger<PermissionWindowUI>(), pair,
|
||||
_mareMediator, _uiSharedService, _apiController);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,17 @@ public sealed class UiService : DisposableMediatorSubscriberBase
|
|||
}
|
||||
});
|
||||
|
||||
Mediator.Subscribe<OpenPermissionWindow>(this, (msg) =>
|
||||
{
|
||||
if (!_createdWindows.Exists(p => p is PermissionWindowUI ui
|
||||
&& msg.Pair == ui.Pair))
|
||||
{
|
||||
var window = _uiFactory.CreatePermissionPopupUi(msg.Pair);
|
||||
_createdWindows.Add(window);
|
||||
_windowSystem.AddWindow(window);
|
||||
}
|
||||
});
|
||||
|
||||
Mediator.Subscribe<RemoveWindowMessage>(this, (msg) =>
|
||||
{
|
||||
_windowSystem.RemoveWindow(msg.Window);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue