Skip to content

Commit

Permalink
Add first files
Browse files Browse the repository at this point in the history
  • Loading branch information
emeric-martineau committed Jun 29, 2021
1 parent 06cdcb6 commit 09ad893
Show file tree
Hide file tree
Showing 32 changed files with 7,218 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
backup
lib
*.exe
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2021 WSL GUI Tool team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# WSL GUI tool

Windows Subsystem for Linux 2 is amazing feature of Windows that allow you run native Linux application. For more details, please read [WSL Official documentation](https://docs.microsoft.com/windows/wsl/about).

WSL GUI Tool allow you to manage WSL features with GUI and not by command line.

You can:
* start/stop a distribution
* rename distribution
* change flag of distribution
* edit default environment variables

## Installation

Just download executable file in release github section.

## Screenshot

![Main window](images/screenshot/mainwindow.png)

![Distribution properties window](images/screenshot/distributionproperties.png)

## How to build?

You need install [Lazarus 2.0.12](https://www.lazarus-ide.org/) (fpc-3.2.0-win64) and Windows 10 64 bits.
23 changes: 23 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Global config

Change default WSL version
Set distribution as default
Minimize on systray
Set default folder to run distribution
Set default shell (powershell, cmd,...) to run distribution
Parameter to timer to refresh screen

# One distribution

Set WSL version for one distribution
Add run WSL with command and a specific user
Export distribution
Import distribution
Unregister distribution

# Misc

Add timer to auto-reload WSL distribution when main window is displayed
Add sort TListView
Edit <USER>\.wslconfig file (https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wsl-2-settings)
Save save & position of main window
471 changes: 471 additions & 0 deletions aboutwindow.lfm

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions aboutwindow.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
unit aboutwindow;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
ApplicationInfo;

type

{ TFormAbout }

TFormAbout = class(TForm)
ImageLogo: TImage;
LabelLogo: TLabel;
LabelIcons: TLabel;
LabelVersion: TLabel;
LabelTitle: TLabel;
LabelCopyright: TLabel;
procedure FormShow(Sender: TObject);
private

public

end;

var
FormAbout: TFormAbout;

implementation

{$R *.lfm}

{ TFormAbout }

procedure TFormAbout.FormShow(Sender: TObject);
var
f: TForm;
begin
f := TForm(Sender);

ImageLogo.Left := (f.Width - ImageLogo.Width) div 2;
LabelTitle.Left := (f.Width - LabelTitle.Width) div 2;
LabelVersion.Left := (f.Width - LabelVersion.Width) div 2;
LabelLogo.Left := (f.Width - LabelLogo.Width) div 2;
LabelIcons.Left := (f.Width - LabelIcons.Width) div 2;

LabelCopyright.Left := (f.Width - LabelCopyright.Width) div 2;

LabelVersion.Caption := 'Version ' + GetAppVersionStr;
end;

end.

49 changes: 49 additions & 0 deletions applicationinfo.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
unit applicationinfo;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, Windows;


function GetAppVersionStr: string;

implementation

function GetAppVersionStr: string;
var
Exe: string;
Size: DWord;
Buffer: PChar;
FixedFileInfo: PVSFixedFileInfo;
begin
Result := '?.?.?.?';
Exe := ParamStr(0);
Size := 0;

Size := GetFileVersionInfoSize(PChar(Exe), Size);

if Size > 0 then
try
Buffer := AllocMem(Size);

GetFileVersionInfo(PChar(Exe),0, Size, Buffer);

if VerQueryValue(Buffer, '\', FixedFileInfo, Size)
then begin
Result := Format('%d.%d.%d.%d',
[LongRec(FixedFileInfo^.dwFileVersionMS).Hi, //major
LongRec(FixedFileInfo^.dwFileVersionMS).Lo, //minor
LongRec(FixedFileInfo^.dwFileVersionLS).Hi, //release
LongRec(FixedFileInfo^.dwFileVersionLS).Lo]) //build
end;
finally
FreeMem(Buffer, Size);
end;

end;

end.

Loading

0 comments on commit 09ad893

Please sign in to comment.