Skip to content

Commit 7a6d1f9

Browse files
committed
Removed protocoll string from server profile + fixed CLI install location choice, when called with hidden window
1 parent 9cd9042 commit 7a6d1f9

5 files changed

Lines changed: 31 additions & 72 deletions

File tree

gamevault/UserControls/SettingsComponents/InstallLocationUserControl.xaml.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ private void UserControl_Loaded(object sender, RoutedEventArgs e)
3737
if (loaded) return;
3838
loaded = true;
3939
string lastSelectedRootDirectory = Preferences.Get(AppConfigKey.LastSelectedRootDirectory, LoginManager.Instance.GetUserProfile().UserConfigFile);
40+
if (AutoConfirmIfWindowIsHidden(lastSelectedRootDirectory))//possible if called by CLI
41+
return;
42+
4043
if (Directory.Exists(lastSelectedRootDirectory))
4144
{
4245
int index = RootDirectories.ToList().FindIndex(x => x.Key.Uri == lastSelectedRootDirectory);
@@ -103,7 +106,24 @@ private void Install_Click(object sender, RoutedEventArgs e)
103106
}
104107
catch (Exception ex) { }
105108
}
106-
109+
private bool AutoConfirmIfWindowIsHidden(string lastSelectedRootDirectory)
110+
{
111+
if (App.Instance.MainWindow.IsVisible == false)
112+
{
113+
if (Directory.Exists(lastSelectedRootDirectory))
114+
{
115+
MainWindowViewModel.Instance.ClosePopup();
116+
ResultTaskSource.TrySetResult(lastSelectedRootDirectory);
117+
}
118+
else
119+
{
120+
MainWindowViewModel.Instance.ClosePopup();
121+
ResultTaskSource.TrySetResult(RootDirectories.ElementAt(0).Value);
122+
}
123+
return true;
124+
}
125+
return false;
126+
}
107127
private void DirectorySettings_Click(object sender, RoutedEventArgs e)
108128
{
109129
MainWindowViewModel.Instance.ClosePopup();

gamevault/UserControls/SettingsComponents/ServerUrlUserControl.xaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

gamevault/UserControls/SettingsComponents/ServerUrlUserControl.xaml.cs

Lines changed: 0 additions & 51 deletions
This file was deleted.

gamevault/UserControls/SettingsUserControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
<TextBlock Text="File System" FontSize="20" FontWeight="Bold"/>
204204
<!--<settingsComponents:RootPathUserControl Margin="10,10,0,0"/>-->
205205
<StackPanel Margin="10,10,0,0">
206-
<TextBlock Text="Root Directories" Margin="0,2,0,2" FontSize="15"/>
206+
<TextBlock Text="Root Directories (A 'GameVault' subfolder will be created)" Margin="0,2,0,2" FontSize="15"/>
207207
<ScrollViewer MaxHeight="100" VerticalScrollBarVisibility="Auto" Width="550" HorizontalAlignment="Left">
208208
<ItemsControl ItemsSource="{Binding RootDirectories}">
209209
<ItemsControl.ItemsPanel>

gamevault/Windows/LoginWindow.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@ private void ValidateSignUpData()
295295
}
296296
private string RemoveSpecialCharacters(string str)
297297
{
298+
if (str.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
299+
{
300+
str = str.Substring(7);
301+
}
302+
else if (str.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
303+
{
304+
str = str.Substring(8);
305+
}
306+
298307
StringBuilder sb = new StringBuilder();
299308
foreach (char c in str)
300309
{

0 commit comments

Comments
 (0)