mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Changed Linux GUI viewmodel init.
This commit is contained in:
parent
7fe7659579
commit
bf5ae5d205
@ -5,7 +5,7 @@
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Remotely.Desktop.Linux.Controls.HostNamePrompt"
|
||||
xmlns:ViewModels="clr-namespace:Remotely.Desktop.Linux.ViewModels;assembly=Remotely_Desktop"
|
||||
Title="Remotely Host Name" Height="150" Width="350" WindowStartupLocation="CenterOwner">
|
||||
Title="Remotely Host Name" Height="150" Width="350" WindowStartupLocation="CenterScreen">
|
||||
<Window.DataContext>
|
||||
<ViewModels:HostNamePromptViewModel/>
|
||||
</Window.DataContext>
|
||||
|
||||
@ -139,18 +139,20 @@ namespace Remotely.Desktop.Linux.ViewModels
|
||||
|
||||
public async Task Init()
|
||||
{
|
||||
SessionID = "Retrieving...";
|
||||
Host = Config.GetConfig().Host;
|
||||
while (string.IsNullOrWhiteSpace(Host))
|
||||
{
|
||||
Host = "https://";
|
||||
await PromptForHostName();
|
||||
}
|
||||
Host = Host;
|
||||
Conductor.ProcessArgs(new string[] { "-mode", "Normal", "-host", Host });
|
||||
try
|
||||
{
|
||||
SessionID = "Retrieving...";
|
||||
Host = Config.GetConfig().Host;
|
||||
while (string.IsNullOrWhiteSpace(Host))
|
||||
{
|
||||
Host = "https://";
|
||||
await PromptForHostName();
|
||||
}
|
||||
Conductor.ProcessArgs(new string[] { "-mode", "Normal", "-host", Host });
|
||||
await Conductor.Connect();
|
||||
|
||||
await Conductor.CasterSocket.SendDeviceInfo(Conductor.ServiceID, Environment.MachineName, Conductor.DeviceID);
|
||||
await Conductor.CasterSocket.GetSessionID();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -158,9 +160,6 @@ namespace Remotely.Desktop.Linux.ViewModels
|
||||
await MessageBox.Show("Failed to connect to server.", "Connection Failed", MessageBoxType.OK);
|
||||
return;
|
||||
}
|
||||
|
||||
await Conductor.CasterSocket.SendDeviceInfo(Conductor.ServiceID, Environment.MachineName, Conductor.DeviceID);
|
||||
await Conductor.CasterSocket.GetSessionID();
|
||||
}
|
||||
|
||||
public async Task PromptForHostName()
|
||||
|
||||
@ -33,7 +33,12 @@ namespace Remotely.Desktop.Linux.Views
|
||||
|
||||
this.FindControl<Border>("TitleBanner").PointerPressed += TitleBanner_PointerPressed;
|
||||
|
||||
_ = (this.DataContext as MainWindowViewModel).Init();
|
||||
this.Opened += MainWindow_Opened;
|
||||
}
|
||||
|
||||
private async void MainWindow_Opened(object sender, System.EventArgs e)
|
||||
{
|
||||
await (this.DataContext as MainWindowViewModel).Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user