Skip to content

Commit

Permalink
chore(windows): address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdurdin committed Oct 30, 2024
1 parent 8ebe621 commit b062a8b
Show file tree
Hide file tree
Showing 17 changed files with 835 additions and 565 deletions.
19 changes: 0 additions & 19 deletions windows/src/support/kmdevlink/Makefile

This file was deleted.

5 changes: 5 additions & 0 deletions windows/src/support/kmdevlink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Keyman Devlink

This small tool is intended for core developers of Keyman who work on Windows
platform, and just provides quick access to issues, pull requests, and
utilities.
2 changes: 2 additions & 0 deletions windows/src/support/kmdevlink/UfrmCharacterIdentifier.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ object frmCharacterIdentifier: TfrmCharacterIdentifier
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
Expand Down Expand Up @@ -40,6 +41,7 @@ object frmCharacterIdentifier: TfrmCharacterIdentifier
Height = 105
Align = alClient
ColCount = 1
DefaultDrawing = False
FixedCols = 0
RowCount = 2
FixedRows = 0
Expand Down
56 changes: 26 additions & 30 deletions windows/src/support/kmdevlink/UfrmCharacterIdentifier.pas
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
(*
Name: UfrmCharacterIdentifier
Copyright: Copyright (C) 2005 Tavultesoft Pty Ltd.
Documentation:
Description:
Create Date: 16 Jan 2009
Modified Date: 18 May 2012
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 16 Jan 2009 - mcdurdin - Initial version
30 Nov 2009 - mcdurdin - Add font lookup
18 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls + Win9x support
18 May 2012 - mcdurdin - I3323 - V9.0 - Change from PlusMemoU to PlusMemo
*)
* Keyman is copyright (C) SIL Global. MIT License.
*)
unit UfrmCharacterIdentifier; // I3323 // I3306

interface
Expand All @@ -43,10 +26,12 @@ TfrmCharacterIdentifier = class(TForm)
State: TGridDrawState);
procedure FormCreate(Sender: TObject);
procedure gridFontsClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
FFont: TFont;
FNewChars: WideString;
FCheckFontsThread: TCheckFontsThread;
LastText: string;
procedure FillGrid;
procedure UpdateFont;
procedure FillFontList(Chars: WideString);
Expand Down Expand Up @@ -104,27 +89,32 @@ procedure TfrmCharacterIdentifier.cmdFontClick(Sender: TObject);
procedure TfrmCharacterIdentifier.UpdateFont;
begin
pmChars.Font := dlgFont.Font;
pmChars.Font.Style := [];
sgChars.Font := dlgFont.Font;
with sgChars.Canvas do
begin
Font := sgChars.Font;
sgChars.RowHeights[0] := TextHeight('A') + 4;
Font := FFont;
sgChars.RowHeights[1] := TextHeight('A') + 4;
end;
sgChars.Font.Style := [];
sgChars.Canvas.Font := sgChars.Font;
sgChars.RowHeights[0] := sgChars.Canvas.TextHeight('A') + 4;
sgChars.Canvas.Font := FFont;
sgChars.RowHeights[1] := sgChars.Canvas.TextHeight('A') + 4;
end;

procedure TfrmCharacterIdentifier.pmCharsChange(Sender: TObject);
begin
FillGrid;
FillFontList(pmChars.Text);
if pmChars.Text <> LastText then
begin
FillGrid;
FillFontList(pmChars.Text);
LastText := pmChars.Text;
end;
end;

procedure TfrmCharacterIdentifier.sgCharsDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if ARow = 1 then
sgChars.Canvas.Font := FFont;
sgChars.Canvas.Font := FFont
else
sgChars.Canvas.Font := sgChars.Font;
sgChars.Canvas.TextRect(Rect,
(Rect.Right + Rect.Left - sgChars.Canvas.TextWidth(sgChars.Cells[ACol, ARow])) div 2,
(Rect.Top + Rect.Bottom - sgChars.Canvas.TextHeight(sgChars.Cells[ACol, ARow])) div 2,
Expand Down Expand Up @@ -171,14 +161,20 @@ procedure TfrmCharacterIdentifier.FillGrid;
sgChars.Cells[0,0] := '';
sgChars.Cells[0,1] := '';
end;

for I := 1 to Length(s) do
begin
sgChars.Cells[I-1, 0] := s[I];
sgChars.Cells[I-1, 1] := 'U+'+IntToHex(Ord(s[i]), 4);
end;
end;

procedure TfrmCharacterIdentifier.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caHide;
end;

procedure TfrmCharacterIdentifier.FormCreate(Sender: TObject);
begin
FFont := TFont.Create;
Expand Down
61 changes: 9 additions & 52 deletions windows/src/support/kmdevlink/UfrmMain.pas
Original file line number Diff line number Diff line change
@@ -1,53 +1,18 @@
(*
Name: UfrmMain
Copyright: Copyright (C) 2005 Tavultesoft Pty Ltd.
Documentation:
Description: Office tool for checking status of CRM
Create Date: 14 Oct 2005
Modified Date: 8 Jun 2012
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 14 Oct 2005 - mcdurdin - Initial Header
17 Mar 2006 - mcdurdin - Refresh avoid loading from cache
21 Jun 2006 - mcdurdin - URLs now open in new window instead of just loading main page
15 Jan 2007 - mcdurdin - Moved to D2006, added hotkeys, shutdown with windows
19 Mar 2007 - mcdurdin - Add Open Issue hotkey and menu
16 May 2007 - mcdurdin - Add "Add Issue" dialog, hotkey amd menu
13 Jul 2007 - mcdurdin - Hide password from edit control
13 Jul 2007 - mcdurdin - Add Manual Activation function
13 Jul 2007 - mcdurdin - Start Work Log function
23 Aug 2007 - mcdurdin - Add Open Invoice menu
27 Mar 2008 - mcdurdin - Add Open Invoice
16 Jan 2009 - mcdurdin - Add link to character identifier
16 Jan 2009 - mcdurdin - Rework Open ... functions
16 Jan 2009 - mcdurdin - Add debug and support tools
03 May 2011 - mcdurdin - I2890 - Record diagnostic data when encountering registry errors
18 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls + Win9x support
18 May 2012 - mcdurdin - I3321 - V9.0 - Fixup paths in Delphi source for v9.0
18 May 2012 - mcdurdin - I3310 - V9.0 - Unicode in Delphi fixes
08 Jun 2012 - mcdurdin - I3349 - V9.0 - Consolidate all process creation into TUtilExecute
02 Feb 2012 - mcdurdin - I2975 - VistaAltFixUnit causes exception on shutdown
*)
* Keyman is copyright (C) SIL Global. MIT License.
*)
unit UfrmMain; // I3306

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ImgList, ExtCtrls, StdCtrls, ComCtrls, Grids, OleCtrls, SHDocVw,
Menus, XPMan, KeymanTrayIcon, System.ImageList;
ImgList, ExtCtrls, StdCtrls, ComCtrls, Grids, Menus,
KeymanTrayIcon, System.ImageList, Vcl.XPMan;

const
SStatusSiteURL = 'https://status.keyman.com';
SSearchURL = 'https://github.com/keymanapp/%s/issues/%s';// + SHost + '/corp/searchcustomer.php';

SSearchURL = 'https://github.com/keymanapp/%s/issues/%s';
SAddIssueURL = 'https://github.com/keymanapp/keyman/issues/new';

type
Expand Down Expand Up @@ -95,7 +60,6 @@ TfrmMain = class(TForm)
procedure hkFieldEnter(Sender: TObject);
procedure hkFieldExit(Sender: TObject);
procedure mnuAddIssueClick(Sender: TObject);
procedure cmdWorkLogClick(Sender: TObject);
procedure mnuOpenCharIdentClick(Sender: TObject);
private
CustomerText: string;
Expand Down Expand Up @@ -221,19 +185,10 @@ procedure TfrmMain.cmdSaveClick(Sender: TObject);
end;
end;

procedure TfrmMain.cmdWorkLogClick(Sender: TObject);
begin
{with TfrmWorkLog.Create(Self) do
try
ShowModal;
finally
Free;
end;}
end;

procedure TfrmMain.FormDestroy(Sender: TObject);
begin
FreeAndNil(FIcon);
FreeAndNil(tiCRM);
DisableHotkeys;
end;

Expand Down Expand Up @@ -310,7 +265,9 @@ procedure TfrmMain.mnuAddIssueClick(Sender: TObject);

procedure TfrmMain.mnuOpenCharIdentClick(Sender: TObject);
begin
with TfrmCharacterIdentifier.Create(nil) do Show;
if not Assigned(frmCharacterIdentifier) then
frmCharacterIdentifier := TfrmCharacterIdentifier.Create(nil);
frmCharacterIdentifier.Show;
end;

procedure TfrmMain.hkFieldEnter(Sender: TObject);
Expand Down
21 changes: 3 additions & 18 deletions windows/src/support/kmdevlink/UfrmOpenCRMRecord.pas
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
(*
Name: UfrmOpenCRMRecord
Copyright: Copyright (C) 2005 Tavultesoft Pty Ltd.
Documentation:
Description:
Create Date: 16 Jan 2009
Modified Date: 18 May 2012
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 16 Jan 2009 - mcdurdin - Initial version
18 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls + Win9x support
*)
* Keyman is copyright (C) SIL Global. MIT License.
*)
unit UfrmOpenCRMRecord; // I3306

interface
Expand Down Expand Up @@ -125,7 +110,7 @@ procedure TfrmOpenCRMRecord.FormCreate(Sender: TObject);

function TfrmOpenCRMRecord.GetSearchText: WideString;
begin
Result := editSearchFor.Text;
Result := editSearchFor.Text;
end;

procedure TfrmOpenCRMRecord.cbRepositoryClick(Sender: TObject);
Expand Down
2 changes: 1 addition & 1 deletion windows/src/support/kmdevlink/grayicon.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
grayicon icon tscrmlink_inactive.ico
grayicon icon kmdevlink_inactive.ico

Loading

0 comments on commit b062a8b

Please sign in to comment.