Skip to content

Commit

Permalink
moz-checksum-generator: add context menus to checksum text boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Nov 9, 2024
1 parent e7a2a90 commit 3dbcca4
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 2 deletions.
59 changes: 59 additions & 0 deletions moz-checksum-generator/MainForm.Designer.cs

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

32 changes: 32 additions & 0 deletions moz-checksum-generator/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ private void rbFirefoxRelease_CheckedChanged(object sender, EventArgs e)
private void clearExistingData()
{
rtbBit32.Clear();
rtbBit32.ContextMenuStrip = null;
rtbBit64.Clear();
rtbBit64.ContextMenuStrip = null;
lblVersion.Text = "";
lblNewLangCodes.Text = "unknown";
}
Expand Down Expand Up @@ -139,6 +141,7 @@ void getFxChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit32.Text = getChecksumCode(data);
rtbBit32.ContextMenuStrip = contextMenuStripChecksums32Bit;

string new_langs = getNewLangCodes(updater.software.Firefox.validLanguageCodes(), data.Keys);
lblNewLangCodes.Text = new_langs;
Expand All @@ -153,6 +156,7 @@ void getFxChecksums()
data.Add(language, matches[i].Value[..128]);
} //for
rtbBit64.Text = getChecksumCode(data);
rtbBit64.ContextMenuStrip = contextMenuStripChecksums64Bit;
}


Expand Down Expand Up @@ -205,6 +209,7 @@ void getFxAuroraChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit32.Text = getChecksumCode(data);
rtbBit32.ContextMenuStrip = contextMenuStripChecksums32Bit;

string new_langs = getNewLangCodes(updater.software.FirefoxAurora.validLanguageCodes(), data.Keys);
lblNewLangCodes.Text = new_langs;
Expand All @@ -219,6 +224,7 @@ void getFxAuroraChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit64.Text = getChecksumCode(data);
rtbBit64.ContextMenuStrip = contextMenuStripChecksums64Bit;
}


Expand Down Expand Up @@ -272,6 +278,7 @@ void getFxEsrChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit32.Text = getChecksumCode(data);
rtbBit32.ContextMenuStrip = contextMenuStripChecksums32Bit;

string new_langs = getNewLangCodes(updater.software.FirefoxESR.validLanguageCodes(), data.Keys);
lblNewLangCodes.Text = new_langs;
Expand All @@ -286,6 +293,7 @@ void getFxEsrChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit64.Text = getChecksumCode(data);
rtbBit64.ContextMenuStrip = contextMenuStripChecksums64Bit;
}


Expand Down Expand Up @@ -342,6 +350,7 @@ void getSmChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit32.Text = getChecksumCode(data);
rtbBit32.ContextMenuStrip = contextMenuStripChecksums32Bit;

string new_langs = getNewLangCodes(updater.software.SeaMonkey.validLanguageCodes(), data.Keys);
lblNewLangCodes.Text = new_langs;
Expand All @@ -357,6 +366,7 @@ void getSmChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit64.Text = getChecksumCode(data);
rtbBit64.ContextMenuStrip = contextMenuStripChecksums64Bit;
}


Expand Down Expand Up @@ -410,6 +420,7 @@ void getTbChecksums()
data.Add(language, matches[i].Value[..128]);
}
rtbBit32.Text = getChecksumCode(data);
rtbBit32.ContextMenuStrip = contextMenuStripChecksums32Bit;

string new_langs = getNewLangCodes(updater.software.Thunderbird.validLanguageCodes(), data.Keys);
lblNewLangCodes.Text = new_langs;
Expand All @@ -424,6 +435,7 @@ void getTbChecksums()
data.Add(language, matches[i].Value[..128]);
} //for
rtbBit64.Text = getChecksumCode(data);
rtbBit64.ContextMenuStrip = contextMenuStripChecksums64Bit;
}

private static string getNewLangCodes(IEnumerable<string> oldLangCodes, IEnumerable<string> newLangCodes)
Expand All @@ -447,5 +459,25 @@ private static string getNewLangCodes(IEnumerable<string> oldLangCodes, IEnumera
}
return newCodes.Remove(0, 2);
}

private void tsmiSelectAll32_Click(object sender, EventArgs e)
{
rtbBit32.SelectAll();
}

private void tsmiCopy32ToClipboard_Click(object sender, EventArgs e)
{
rtbBit32.Copy();
}

private void tsmiSelectAll64_Click(object sender, EventArgs e)
{
rtbBit64.SelectAll();
}

private void tsmiCopy64ToClipboard_Click(object sender, EventArgs e)
{
rtbBit64.Copy();
}
} // class
} // namespace
6 changes: 6 additions & 0 deletions moz-checksum-generator/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStripChecksums32Bit.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStripChecksums64Bit.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>253, 17</value>
</metadata>
</root>
4 changes: 2 additions & 2 deletions moz-checksum-generator/moz-checksum-generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ImplicitUsings>disable</ImplicitUsings>
<Description>Utility to generates checksums for Mozilla Firefox / SeaMonkey / Thunderbird setups.</Description>
<Copyright>Copyright © 2017-2024 Dirk Stolle</Copyright>
<FileVersion>1.3.0.0</FileVersion>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
</PropertyGroup>

Expand Down

0 comments on commit 3dbcca4

Please sign in to comment.