* IconConstants.cs: Relocate

* QWorkspaceInfo.cs:
* QParser.cs:
* WorkspacePrompt.cs:
* QEventArgs.cs: Remove redundant QWorkspaceInfo class

* QRecentWorkspaceInfo.cs: Add bundle info class for recent workspace
  info

* ControlPage.xaml.cs:
* QBrowserPage.xaml.cs:
* QButton.cs:
* qConnectionPage.xaml.cs:
* QLevelsCell.cs:
* QCueListCell.cs:
* QInstanceCell.cs:
* QControlsBlock.cs:
* ShadowButton.cs:
* QLevelsButton.cs:
* QSelectedCueCell.cs: Move Cells classess under UI

* AppDelegate.cs:
* packages.config:
* MainActivity.cs:
* packages.config:
* qController.iOS.csproj:
* qController.Droid.csproj:
* qController.csproj: Update dependencies

* App.xaml.cs: Add AppAction code for recent workspace

* QStorage.cs: Add recent workspace to persistent storage

* QCueGrid.cs: Start on interactivity with cue list grid

* QCueViewModel.cs: debug for children updated start on reactive
  QCueGrid

* WorkspacePage.xaml.cs: Start handling a "no selected cue" state and
  recent workspace

* QInstance.cs:
* IPHelper.cs: move reachable check to IPHelper - TODO: implement
This commit is contained in:
2020-11-29 14:22:01 -06:00
parent cb19056088
commit 31a10d9b16
26 changed files with 5670 additions and 120 deletions
+49
View File
@@ -4,6 +4,8 @@ using Xamarin.Essentials;
using qController.Communication;
using qController.Pages;
using System;
using QControlKit;
using Serilog;
namespace qController
{
@@ -34,6 +36,8 @@ namespace qController
public App()
{
InitializeComponent();
AppActions.OnAppAction += AppActions_OnAppAction;
/*MainPage = new NavigationPage(new QConnectionPage());
iNav = MainPage.Navigation;*/
@@ -65,9 +69,32 @@ namespace qController
rootPage.Master = menuPage;
rootPage.Detail = NavigationPage;
MainPage = rootPage;
Log.Debug("Finished rootPage Setup in App Constructor");
rootPage.Init();
}
private void AppActions_OnAppAction(object sender, AppActionEventArgs e)
{
// Don't handle events fired for old application instances
// and cleanup the old instance's event handler
if (Current != this && Current is App app)
{
AppActions.OnAppAction -= app.AppActions_OnAppAction;
return;
}
Device.BeginInvokeOnMainThread(async () =>
{
QRecentWorkspaceInfo packagedInfo = QStorage.recentWorkspaceInfo;
if (packagedInfo != null && e.AppAction.Id.Equals("recent_workspace"))
{
await NavigationPage.PopToRootAsync();
QWorkspace recentWorkspace = new QWorkspace(packagedInfo.workspaceInfo, new QServer(packagedInfo.serverInfo.host, packagedInfo.serverInfo.port));
await NavigationPage.PushAsync(new WorkspacePage(recentWorkspace));
Log.Debug("Pushed WorkspacePage from App Action");
}
});
}
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e)
{
SetAppResources();
@@ -139,6 +166,28 @@ namespace qController
}
public static void SetRecentWorkspace(QWorkspace workspace)
{
try
{
QRecentWorkspaceInfo recentWorkspaceInfo = new QRecentWorkspaceInfo {
workspaceInfo = workspace.getWorkspaceInfo(),
serverInfo = workspace.GetServerInfo()
};
QStorage.UpdateRecentWorkspace(recentWorkspaceInfo);
Device.BeginInvokeOnMainThread(async () =>
{
await AppActions.SetAsync(new AppAction("recent_workspace", workspace.name, workspace.version));
});
}
catch (Exception ex)
{
Log.Debug(ex.ToString());
}
}
public static void showToast(string message)
{
var toastConfig = new ToastConfig(message);