Skip to content

Commit

Permalink
Merge #4277 Fix broken version label in About dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Dec 13, 2024
2 parents 3e61fbe + 22e3edc commit 4a232bd
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
unsigned-artifact-id: ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: ./.github/workflows/build.yml
test-build:
needs: build-debug
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install runtime dependencies
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ All notable changes to this project will be documented in this file.
- [Core] Exclude dependencies in the changeset from supported by list (#4261 by: HebaruSan)
- [GUI] Optimize label searches and handle spaces in names (#4270 by: HebaruSan)
- [Core] Small performance tweaks for DLL scanning (#4275 by: HebaruSan)
- [GUI] Fix broken version label in About dialog (#4277 by: HebaruSan)

### Internal

Expand Down
6 changes: 3 additions & 3 deletions GUI/Controls/ModInfoTabs/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ private void LinkLabel_KeyDown(object? sender, KeyEventArgs? e)
{
if (sender is LinkLabel lbl)
{
switch (e?.KeyCode)
switch (e)
{
case Keys.Apps:
Util.LinkContextMenu(lbl.Text);
case {KeyCode: Keys.Apps}:
Util.LinkContextMenu(lbl.Text, lbl);
e.Handled = true;
break;
}
Expand Down
22 changes: 19 additions & 3 deletions GUI/Dialogs/AboutDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions GUI/Dialogs/AboutDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public AboutDialog()
{
InitializeComponent();
ApplyFormCompatibilityFixes();
StartPosition = FormStartPosition.CenterScreen;
versionLabel.Text = string.Format(Properties.Resources.AboutDialogLabel2Text, Meta.GetVersion());
}

Expand All @@ -30,10 +29,10 @@ private void linkLabel_KeyDown(object? sender, KeyEventArgs? e)
{
if (sender is LinkLabel l)
{
switch (e?.KeyCode)
switch (e)
{
case Keys.Apps:
Util.LinkContextMenu(l.Text);
case {KeyCode: Keys.Apps}:
Util.LinkContextMenu(l.Text, l);
e.Handled = true;
break;
}
Expand Down
14 changes: 7 additions & 7 deletions GUI/Main/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public Main(string[] cmdlineArgs,
OnCacheChanged(null);

tabController = new TabController(MainTabControl);
tabController.ShowTab("ManageModsTabPage");
tabController.ShowTab(ManageModsTabPage.Name);

// Disable the modinfo controls until a mod has been choosen. This has an effect if the modlist is empty.
ActiveModInfo = null;
Expand Down Expand Up @@ -235,7 +235,7 @@ protected override void OnShown(EventArgs e)
{
actuallyVisible = true;

tabController.RenameTab("WaitTabPage", Properties.Resources.MainLoadingGameInstance);
tabController.RenameTab(WaitTabPage.Name, Properties.Resources.MainLoadingGameInstance);
ShowWaitDialog();
DisableMainWindow();
Wait.StartWaiting(
Expand Down Expand Up @@ -898,7 +898,7 @@ private void InstallFromCkanFiles(string[] files)
UpdateChangesDialog(toInstall.Select(m => new ModChange(m, GUIModChangeType.Install))
.ToList(),
null);
tabController.ShowTab("ChangesetTabPage", 1);
tabController.ShowTab(ChangesetTabPage.Name, 1);
}
}

Expand Down Expand Up @@ -992,7 +992,7 @@ private void ManageMods_OnChangeSetChanged(List<ModChange> changeset, Dictionary
{
if (changeset != null && changeset.Count != 0)
{
tabController.ShowTab("ChangesetTabPage", 1, false);
tabController.ShowTab(ChangesetTabPage.Name, 1, false);
UpdateChangesDialog(
changeset,
conflicts.ToDictionary(item => item.Key.ToCkanModule(),
Expand All @@ -1001,7 +1001,7 @@ private void ManageMods_OnChangeSetChanged(List<ModChange> changeset, Dictionary
}
else
{
tabController.HideTab("ChangesetTabPage");
tabController.HideTab(ChangesetTabPage.Name);
auditRecommendationsMenuItem.Enabled = true;
}
}
Expand Down Expand Up @@ -1153,12 +1153,12 @@ private void ManageMods_StartChangeSet(List<ModChange> changeset, Dictionary<GUI
UpdateChangesDialog(changeset,
conflicts?.ToDictionary(item => item.Key.ToCkanModule(),
item => item.Value));
tabController.ShowTab("ChangesetTabPage", 1);
tabController.ShowTab(ChangesetTabPage.Name, 1);
}

private void RefreshModList(bool allowAutoUpdate, Dictionary<string, bool>? oldModules = null)
{
tabController.RenameTab("WaitTabPage", Properties.Resources.MainModListWaitTitle);
tabController.RenameTab(WaitTabPage.Name, Properties.Resources.MainModListWaitTitle);
ShowWaitDialog();
DisableMainWindow();
ActiveModInfo = null;
Expand Down
2 changes: 1 addition & 1 deletion GUI/Main/MainAutoUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void UpdateCKAN()
{
ShowWaitDialog();
DisableMainWindow();
tabController.RenameTab("WaitTabPage", Properties.Resources.MainUpgradingWaitTitle);
tabController.RenameTab(WaitTabPage.Name, Properties.Resources.MainUpgradingWaitTitle);
var mainConfig = ServiceLocator.Container.Resolve<IConfiguration>();
var update = updater.GetUpdate(mainConfig.DevBuilds ?? false, userAgent);
Wait.SetDescription(string.Format(Properties.Resources.MainUpgradingTo,
Expand Down
2 changes: 1 addition & 1 deletion GUI/Main/MainChangeset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void Changeset_OnCancelChanges(bool reset)
{
ManageMods.ClearChangeSet();
}
tabController.ShowTab("ManageModsTabPage");
tabController.ShowTab(ManageModsTabPage.Name);
}

private void Changeset_OnConfirmChanges(List<ModChange> changeset)
Expand Down
6 changes: 3 additions & 3 deletions GUI/Main/MainExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ private void exportModPackToolStripMenuItem_Click(object? sender, EventArgs? e)
Task.Factory.StartNew(() =>
{
currentUser.RaiseMessage("");
tabController.ShowTab("EditModpackTabPage", 2);
tabController.ShowTab(EditModpackTabPage.Name, 2);
DisableMainWindow();
var mgr = RegistryManager.Instance(CurrentInstance, repoData);
EditModpack.LoadModule(mgr.GenerateModpack(false, true), mgr.registry);
// This will block till the user is done
EditModpack.Wait(currentUser);
tabController.ShowTab("ManageModsTabPage");
tabController.HideTab("EditModpackTabPage");
tabController.ShowTab(ManageModsTabPage.Name);
tabController.HideTab(EditModpackTabPage.Name);
EnableMainWindow();
});
}
Expand Down
8 changes: 4 additions & 4 deletions GUI/Main/MainHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private void installationHistoryStripMenuItem_Click(object? sender, EventArgs? e
if (CurrentInstance != null && configuration != null)
{
InstallationHistory.LoadHistory(CurrentInstance, configuration, repoData);
tabController.ShowTab("InstallationHistoryTabPage", 2);
tabController.ShowTab(InstallationHistoryTabPage.Name, 2);
}
}

Expand All @@ -30,15 +30,15 @@ private void InstallationHistory_Install(CkanModule[] modules)
CurrentInstance.StabilityToleranceConfig,
CurrentInstance.VersionCriteria());
UpdateChangesDialog(tuple.Item1.ToList(), tuple.Item2);
tabController.ShowTab("ChangesetTabPage", 1);
tabController.ShowTab(ChangesetTabPage.Name, 1);
}
}

private void InstallationHistory_Done()
{
UpdateStatusBar();
tabController.ShowTab("ManageModsTabPage");
tabController.HideTab("InstallationHistoryTabPage");
tabController.ShowTab(ManageModsTabPage.Name);
tabController.HideTab(InstallationHistoryTabPage.Name);
}

private void InstallationHistory_OnSelectedModuleChanged(CkanModule m)
Expand Down
2 changes: 1 addition & 1 deletion GUI/Main/MainImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void ImportModules()
&& dlg.FileNames.Length > 0)
{
// Show WaitTabPage (status page) and lock it.
tabController.RenameTab("WaitTabPage", Properties.Resources.MainImportWaitTitle);
tabController.RenameTab(WaitTabPage.Name, Properties.Resources.MainImportWaitTitle);
ShowWaitDialog();
DisableMainWindow();
Wait.StartWaiting(
Expand Down
Loading

0 comments on commit 4a232bd

Please sign in to comment.