Skip to content

Commit 5988f9e

Browse files
First start of the menu when no content is available now popsup the download form. Previously the Options form with the Content tab open popped up.
1 parent f47fa0a commit 5988f9e

File tree

3 files changed

+19
-44
lines changed

3 files changed

+19
-44
lines changed

Source/Menu/DownloadContentForm.cs

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -476,49 +476,24 @@ private bool insertRowInOptions(string installPathRoute)
476476
}
477477
}
478478

479-
bool updated = false;
479+
string routeName = RouteName;
480480
int index = 0;
481-
while (!updated)
481+
var sortedFolders = Settings.Folders.Folders.OrderBy(pair => pair.Key).ToDictionary(pair => pair.Key, pair => pair.Value);
482+
foreach (KeyValuePair<string, string> folderSetting in sortedFolders)
482483
{
483-
string routeName = "";
484-
bool routeNameFound = false;
485-
foreach (KeyValuePair<string, string> folderSetting in Settings.Folders.Folders)
484+
if (folderSetting.Key == routeName)
486485
{
487-
if (index == 0)
488-
{
489-
routeName = RouteName;
490-
}
491-
else
492-
{
493-
routeName = string.Format("{0} ({1})", RouteName, index);
494-
}
495-
if (folderSetting.Key == routeName)
496-
{
497-
if (folderSetting.Value.Equals(installPathRouteReal, StringComparison.OrdinalIgnoreCase))
498-
{
499-
updated = true;
500-
}
501-
else
502-
{
503-
routeNameFound = true;
504-
}
505-
}
506-
}
507-
if (!updated)
508-
{
509-
if (routeNameFound)
486+
if (!folderSetting.Value.Equals(installPathRouteReal, StringComparison.OrdinalIgnoreCase))
510487
{
511488
index++;
512-
}
513-
else
514-
{
515-
Settings.Folders.Folders[routeName] = installPathRouteReal;
516-
Routes[RouteName].ContentName = routeName;
517-
Routes[RouteName].ContentDirectory = installPathRouteReal;
518-
updated = true;
489+
routeName = string.Format("{0} ({1})", RouteName, index);
519490
}
520491
}
521492
}
493+
Settings.Folders.Folders[routeName] = installPathRouteReal;
494+
Routes[RouteName].ContentName = routeName;
495+
Routes[RouteName].ContentDirectory = installPathRouteReal;
496+
522497
return true;
523498
}
524499

Source/Menu/MainForm.Designer.cs

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/MainForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ public void LoadFolderList()
759759

760760
if (!initialized && Folders.Count == 0)
761761
{
762-
using (var form = new OptionsForm(Settings, UpdateManager, true))
762+
using (var form = new DownloadContentForm(Settings))
763763
{
764764
switch (form.ShowDialog(this))
765765
{

0 commit comments

Comments
 (0)