Skip to content

Commit

Permalink
redo interface a little
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Sep 4, 2017
1 parent 714b3a1 commit a7d1192
Show file tree
Hide file tree
Showing 7 changed files with 600 additions and 113 deletions.
320 changes: 235 additions & 85 deletions windows/QMK Toolbox/Form1.Designer.cs

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion windows/QMK Toolbox/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public partial class Form1 : Form {
private const int DBT_DEVNODES_CHANGED = 0x0007; //device changed
private const int deviceIDOffset = 70;

string filePassedIn = string.Empty;

Flashing f;

[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
Expand Down Expand Up @@ -69,9 +71,19 @@ public string getHexFile() {
return hexFileBox.Text;
}

public Form1() {
public Form1(string path) {
InitializeComponent();

if (path != string.Empty) {
if ((Path.GetExtension(path).ToLower() == ".qmk" ||
(Path.GetExtension(path).ToLower() == ".hex") ||
(Path.GetExtension(path).ToLower() == ".bin"))) {
filePassedIn = path;
} else {
MessageBox.Show("QMK Toolbox doesn't support this kind of file", "File Type Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}

f = new Flashing(this);

richTextBox1.Cursor = Cursors.Arrow; // mouse cursor like in other controls
Expand Down Expand Up @@ -129,6 +141,9 @@ private void Form1_Load(object sender, EventArgs e) {

UpdateHIDDevices();

if (filePassedIn != string.Empty)
ChangeFile(filePassedIn);

}

private void UpdateHIDDevices() {
Expand Down
337 changes: 318 additions & 19 deletions windows/QMK Toolbox/Form1.resx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions windows/QMK Toolbox/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ static class Program {
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(args.Length == 0 ? new Form1(string.Empty) : new Form1(args[0]));
}
}
}
30 changes: 25 additions & 5 deletions windows/QMK Toolbox/QMK Toolbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -24,12 +26,10 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<ApplicationVersion>0.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -51,7 +51,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>favicon.ico</ApplicationIcon>
<ApplicationIcon>output.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>07603AD77617C425E84BA2FC0DD2DB546C3DD0DD</ManifestCertificateThumbprint>
Expand Down Expand Up @@ -84,6 +84,18 @@
<HintPath>..\packages\IntelHexFormatReader.2.2.2\lib\net452\IntelHexFormatReader.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MetroFramework, Version=1.2.0.3, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework.RunTime.1.2.0.3\lib\net40-Client\MetroFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MetroFramework.Design, Version=1.2.0.3, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework.Design.1.2.0.3\lib\net40\MetroFramework.Design.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MetroFramework.Fonts, Version=1.2.0.3, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework.Fonts.1.2.0.3\lib\net40\MetroFramework.Fonts.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -173,11 +185,11 @@
<EmbeddedResource Include="mcu-list.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="output.ico" />
<EmbeddedResource Include="libusb-1.0.dll" />
<EmbeddedResource Include="teensy_loader_cli.exe" />
<EmbeddedResource Include="avrdude.exe" />
<EmbeddedResource Include="dfu-util.exe" />
<Content Include="favicon.ico" />
<None Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
Expand All @@ -192,6 +204,14 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<FileAssociation Include=".qmk">
<Visible>False</Visible>
<Description>QMK Firmware File</Description>
<Progid>qmk_toolbox</Progid>
<DefaultIcon>output.ico</DefaultIcon>
</FileAssociation>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.2.0.0\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.2.0.0\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
3 changes: 3 additions & 0 deletions windows/QMK Toolbox/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<package id="Fody" version="2.0.0" targetFramework="net452" developmentDependency="true" />
<package id="hidlibrary" version="3.2.46.0" targetFramework="net452" />
<package id="IntelHexFormatReader" version="2.2.2" targetFramework="net452" />
<package id="MetroFramework.Design" version="1.2.0.3" targetFramework="net452" />
<package id="MetroFramework.Fonts" version="1.2.0.3" targetFramework="net452" />
<package id="MetroFramework.RunTime" version="1.2.0.3" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
<package id="NLog" version="4.0.0" targetFramework="net452" />
<package id="SerialPortStream" version="2.1.2" targetFramework="net452" />
Expand Down
2 changes: 1 addition & 1 deletion windows/install_compiler.iss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=
OutputDir=.
OutputBaseFilename=install
SetupIconFile=QMK Toolbox\output.ico
Compression=lzma
Expand Down

0 comments on commit a7d1192

Please sign in to comment.