update modal titles and descriptions to make more sense

This commit is contained in:
dovholuknf
2020-11-20 20:32:58 -05:00
parent e53ae633c1
commit f7dce2d29f
2 changed files with 42 additions and 35 deletions
+2 -2
View File
@@ -143,7 +143,7 @@
<Label Content="IDENTITY" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" Foreground="White" Height="25" Margin="0,-14,0,0" FontSize="10" HorizontalAlignment="Right"></Label>
</StackPanel>
</Grid>
<Canvas Name="ConnectButton" Width="400" Height="160" MouseUp="Connect" Visibility="Visible">
<Canvas Name="ConnectButton" Width="400" Height="160" MouseUp="ConnectButtonClick" Visibility="Visible">
<Grid Width="{Binding ActualWidth, ElementName=ConnectButton}" Height="140">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="221*"/>
@@ -267,7 +267,7 @@
<RowDefinition Height="10"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Label Name="LoadingTitle" Foreground="White" Content="Loading" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans"/>
<Label x:Name="LoadingTitle" Foreground="White" Content="Loading" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans"/>
<TextBlock x:Name="LoadingDetails" TextWrapping="WrapWithOverflow" Foreground="LightGray" Padding="10" Text="${x:DefaultLoadText}" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" FontSize="14" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans"/>
<ProgressBar x:Name="LoadProgress" Width="100" Grid.Row="3" IsEnabled="True" />
</Grid>
+40 -33
View File
@@ -40,7 +40,6 @@ namespace ZitiDesktopEdge {
private int _top = 30;
private double _maxHeight = 800d;
private string[] suffixes = { "Bps", "kBps", "mBps", "gBps", "tBps", "pBps" };
private string DefaultLoadText = "Operation pending, please wait...";
private static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1);
@@ -131,8 +130,8 @@ namespace ZitiDesktopEdge {
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
notifyIcon.Visible = false;
notifyIcon.Icon.Dispose();
notifyIcon.Dispose();
//notifyIcon.Icon.Dispose();
//notifyIcon.Dispose();
}
private void SetCantDisplay(string title, string detailMessage, Visibility closeButtonVisibility) {
@@ -153,6 +152,11 @@ namespace ZitiDesktopEdge {
private void TargetNotifyIcon_Click(object sender, EventArgs e) {
this.Show();
System.Windows.Forms.MouseEventArgs mea = (System.Windows.Forms.MouseEventArgs)e;
/*if (mea.cli mea.RightButton) {
} else {
}*/
this.Activate();
}
@@ -287,7 +291,7 @@ namespace ZitiDesktopEdge {
async private void StartZitiService(object sender, RoutedEventArgs e) {
try {
ShowLoad("Staring the data service");
ShowLoad("Starting", "Staring the data service");
Logger.Info("StartZitiService");
var r = await monitorClient.StartServiceAsync();
if (r.Code != 0) {
@@ -443,6 +447,7 @@ namespace ZitiDesktopEdge {
private void ServiceClient_OnTunnelStatusEvent(object sender, TunnelStatusEvent e) {
if (e == null) return; //just skip it for now...
Debug.WriteLine($"==== TunnelStatusEvent: ");
Application.Current.Properties.Remove("CurrentTunnelStatus");
Application.Current.Properties.Add("CurrentTunnelStatus", e.Status);
e.Status.Dump(Console.Out);
this.Dispatcher.Invoke(() => {
@@ -671,7 +676,7 @@ namespace ZitiDesktopEdge {
jwtDialog.DefaultExt = ".jwt";
jwtDialog.Filter = "Ziti Identities (*.jwt)|*.jwt";
if (jwtDialog.ShowDialog() == true) {
ShowLoad("Adding Identity");
ShowLoad("Adding Identity", "Please wait while the identity is added");
string fileContent = File.ReadAllText(jwtDialog.FileName);
try {
@@ -712,9 +717,9 @@ namespace ZitiDesktopEdge {
_tunnelUptimeTimer.Enabled = true;
_tunnelUptimeTimer.Start();
}
private void Connect(object sender, RoutedEventArgs e) {
private void ConnectButtonClick(object sender, RoutedEventArgs e) {
if (!_isServiceInError) {
ShowLoad("Connecting...");
ShowLoad("Starting Service", "Please wait while the service is started...");
this.Dispatcher.Invoke(async () => {
//Dispatcher.Invoke(new Action(() => { }), System.Windows.Threading.DispatcherPriority.ContextIdle);
await DoConnectAsync();
@@ -746,43 +751,45 @@ namespace ZitiDesktopEdge {
}
async private void Disconnect(object sender, RoutedEventArgs e) {
ShowLoad("Disabling service...");
ShowLoad("Disabling Service", "Please wait for the service to stop.");
var r = await monitorClient.StopServiceAsync();
if (r.Error != null && int.Parse(r.Error) != 0) {
Logger.Debug("ERROR: {0}", r.Message);
} else {
Logger.Info("Service stopped!");
}
/*
if (!_isServiceInError) {
ShowLoad();
try {
ConnectedTime.Content = "00:00:00";
_tunnelUptimeTimer.Stop();
serviceClient.SetTunnelState(false);
SetNotifyIcon("white");
ConnectButton.Visibility = Visibility.Visible;
DisconnectButton.Visibility = Visibility.Collapsed;
for (int i = 0; i < identities.Count; i++) {
await serviceClient.IdentityOnOffAsync(identities[i].Fingerprint, false);
}
for (int i = 0; i < IdList.Children.Count; i++) {
IdentityItem item = IdList.Children[i] as IdentityItem;
item._identity.IsEnabled = false;
item.RefreshUI();
}
} catch (ServiceException se) {
ShowError(se.AdditionalInfo, se.Message);
} catch (Exception ex) {
ShowError("Unexpected Error", "Code 4:" + ex.Message);
}
HideLoad();
}*/
if (!_isServiceInError) {
try {
ShowLoad();
ConnectedTime.Content = "00:00:00";
_tunnelUptimeTimer.Stop();
serviceClient.SetTunnelState(false);
SetNotifyIcon("white");
ConnectButton.Visibility = Visibility.Visible;
DisconnectButton.Visibility = Visibility.Collapsed;
for (int i = 0; i < identities.Count; i++) {
await serviceClient.IdentityOnOffAsync(identities[i].Fingerprint, false);
}
for (int i = 0; i < IdList.Children.Count; i++) {
IdentityItem item = IdList.Children[i] as IdentityItem;
item._identity.IsEnabled = false;
item.RefreshUI();
}
} catch (ServiceException se) {
ShowError(se.AdditionalInfo, se.Message);
} catch (Exception ex) {
ShowError("Unexpected Error", "Code 4:" + ex.Message);
}
HideLoad();
}*/
HideLoad();
}
private void ShowLoad(string msg) {
private void ShowLoad(string title, string msg) {
LoadingDetails.Text = msg;
LoadingTitle.Content = title;
LoadProgress.IsIndeterminate = true;
LoadingScreen.Visibility = Visibility.Visible;
((MainWindow)System.Windows.Application.Current.MainWindow).UpdateLayout();