mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-16 12:53:39 +00:00
Move More Dialog Configs to their own file
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using Acr.UserDialogs;
|
||||
using qController.Communication;
|
||||
|
||||
namespace qController.Dialogs
|
||||
{
|
||||
public class AddInstancePrompt : PromptConfig
|
||||
{
|
||||
public AddInstancePrompt()
|
||||
{
|
||||
|
||||
Title = "Enter IP of QLab Computer";
|
||||
Message = "Enter an IP Address to save";
|
||||
OkText = "Next";
|
||||
OnTextChanged = args =>
|
||||
{
|
||||
//IPAddress ugh
|
||||
args.IsValid = IPHelper.IsValidAddress(args.Value);
|
||||
};
|
||||
OnAction = (qAddress) =>
|
||||
{
|
||||
if (!qAddress.Ok)
|
||||
return;
|
||||
|
||||
UserDialogs.Instance.Prompt(new PromptConfig
|
||||
{
|
||||
Title = "Enter Name",
|
||||
Message = "Enter a Name for " + qAddress.Text,
|
||||
OkText = "Save",
|
||||
OnAction = (qName) => {
|
||||
if (!qName.Ok)
|
||||
return;
|
||||
QStorage.AddInstance(qName.Text, qAddress.Text);
|
||||
App.showToast("Manual Workspace Added!");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using Acr.UserDialogs;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace qController.Dialogs
|
||||
{
|
||||
public class DonatePrompt : ConfirmConfig
|
||||
{
|
||||
public DonatePrompt()
|
||||
{
|
||||
|
||||
Title = "Support the Project";
|
||||
Message = "This application will never be a paid app or contain any sort of ads, but if you choose to show your support you may do so by clicking the Donate button below. Thank you!";
|
||||
OkText = "Donate";
|
||||
OnAction = (response) =>
|
||||
{
|
||||
if (response)
|
||||
Launcher.OpenAsync(new Uri("https://linktr.ee/JoelWetzell"));
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,11 @@ namespace qController.Dialogs
|
||||
{
|
||||
public class NoWorkspacesConfig : ConfirmConfig
|
||||
{
|
||||
public NoWorkspacesConfig()
|
||||
public NoWorkspacesConfig(Action<bool> action)
|
||||
{
|
||||
Message = "QLab doesn't have any workspaces open?";
|
||||
OkText = "Disconnect";
|
||||
OnAction = action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user