Jelajahi Sumber

Reverted to button, and fixed login message window problem.s

Kenric Nugteren 6 bulan lalu
induk
melakukan
fafcf7b8c0
2 mengubah file dengan 36 tambahan dan 28 penghapusan
  1. 10 11
      prs.desktop/MainWindow.xaml
  2. 26 17
      prs.desktop/MainWindow.xaml.cs

+ 10 - 11
prs.desktop/MainWindow.xaml

@@ -132,15 +132,6 @@
                             Size="Middle"
                             HorizontalAlignment="Stretch"
                             Foreground="{Binding Path=(themes:ThemeManager.BackstageForegroundBrush)}" />
-                        
-                        <fluent:Button
-                            x:Name="IssuesButton"
-                            Header="Support Tickets"
-                            Click="Issues_Click"
-                            Size="Middle"
-                            HorizontalAlignment="Stretch"
-                            ToolTip="Raise an issue with the PRS team"
-                            Foreground="{Binding Path=(themes:ThemeManager.BackstageForegroundBrush)}"/>
 
                         <fluent:SeparatorTabItem x:Name="BackstageSeparator2" Height="20" />
 
@@ -799,6 +790,7 @@
                 <ColumnDefinition Width="*" />
                 <ColumnDefinition Width="*" />
                 <ColumnDefinition Width="*" />
+                <ColumnDefinition Width="*" />
             </Grid.ColumnDefinitions>
 
             <Grid.RowDefinitions>
@@ -814,7 +806,7 @@
                 Margin="0,0,5,0"
                 Background="WhiteSmoke"
                 Grid.Row="0"
-                Grid.Column="2"
+                Grid.Column="3"
                 Size="Middle"
                 Icon="Resources/team.png"
                 HorizontalAlignment="Stretch"
@@ -832,8 +824,15 @@
                            LargeIcon="Resources/contract.png"
                            Click="Forms_Click"
                            Margin="0,0,5,20"/>
+            
+            <fluent:Button Grid.Row="1" Grid.Column="2"
+                           Header="Issues"
+                           LargeIcon="Resources/appicon.png"
+                           Click="Issues_Click"
+                           ToolTip="Raise an issue with the PRS team"
+                           Margin="0,0,5,20"/>
 
-            <Border Grid.Row="1" Grid.Column="2" 
+            <Border Grid.Row="1" Grid.Column="3" 
                     BorderBrush="Silver" BorderThickness="0,0.75,0.75,0.75" Padding="0,0,5,20">
                 <StackPanel Orientation="Horizontal">
                     

+ 26 - 17
prs.desktop/MainWindow.xaml.cs

@@ -336,29 +336,31 @@ public partial class MainWindow : IPanelHostControl
                     );
                 }
             }
+        });
 
-            if (startupException is null && App.DatabaseSettings.Autologin)
+        if (startupException is null && App.DatabaseSettings.Autologin)
+        {
+            try
             {
-                try
+                Logger.Send(LogType.Information, "", "Logging in");
+                Dispatcher.Invoke(() =>
                 {
-                    Logger.Send(LogType.Information, "", "Logging in");
-                    progress.Report("Logging in");
-                    Dispatcher.Invoke(() =>
-                    {
-                        loginStatus = TryAutoLogin();
-                    });
-                    if(loginStatus == ValidationStatus.VALID)
+                    loginStatus = TryAutoLogin();
+                });
+                if(loginStatus == ValidationStatus.VALID)
+                {
+                    // Do the AfterLogin() here so that we aren't opening and closing progress windows again and again.
+                    Progress.ShowModal("Loading PRS", progress =>
                     {
-                        // Do the AfterLogin() here so that we aren't opening and closing progress windows again and again.
                         AfterLogin(progress);
-                    }
-                }
-                catch(Exception e)
-                {
-                    startupException = e;
+                    });
                 }
             }
-        });
+            catch(Exception e)
+            {
+                startupException = e;
+            }
+        }
 
         if (startupException != null)
         {
@@ -373,6 +375,14 @@ public partial class MainWindow : IPanelHostControl
             {
                 AfterLogin(null);
             }
+            else
+            {
+                ConfigureMainScreen(null);
+            }
+        }
+        else
+        {
+            ConfigureMainScreen(null);
         }
 
         ProfileName.Content = App.Profile;
@@ -743,7 +753,6 @@ public partial class MainWindow : IPanelHostControl
 
         BackstageSeparator1a.Visibility = Visibility.Visible;
         SystemLogsButton.Visibility = Visibility.Visible;
-        IssuesButton.Visibility = Visibility.Visible;
 
         SetVisibility(DocumentTypeList, ClientFactory.IsSupported<DocumentType>() && Security.IsAllowed<CanViewDocumentTypes>());
         SetVisibleIfAny(BackstageSeparator2, DocumentTypeList);