From c1e2ca84a46586af73b82ed1248afe9eb0b35a5e Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:12:49 +1000 Subject: [PATCH 1/6] feat(windows): Fix update table with css grid --- windows/src/desktop/kmshell/xml/config.css | 41 ++++++++++ .../src/desktop/kmshell/xml/keyman_update.xsl | 77 ++++++++---------- .../desktop/kmshell/xml/menuframe_update.png | Bin 0 -> 1573 bytes 3 files changed, 77 insertions(+), 41 deletions(-) create mode 100644 windows/src/desktop/kmshell/xml/menuframe_update.png diff --git a/windows/src/desktop/kmshell/xml/config.css b/windows/src/desktop/kmshell/xml/config.css index 4a433082a1..c07087dbb1 100644 --- a/windows/src/desktop/kmshell/xml/config.css +++ b/windows/src/desktop/kmshell/xml/config.css @@ -499,6 +499,14 @@ table tr padding: 1px 0 1px 10px; } +.grid_container_update { + display: grid; + position: relative; + grid-template-columns: 50px 1fr 1fr 1fr; + padding: 10px 50px 10px 64px; + border: grey 1px; +} + .grid_container.grid_disabled { opacity: 0.5; @@ -1093,9 +1101,42 @@ th height: 16px; } +.update_title +{ + background: url('keyman-title.png') 96px 13px no-repeat; + height: 60px; +} + +.update_title img +{ + margin: 13px 0 0 10px; +} + +.update_edition +{ + float: left; + font-size: 16px; + margin-left: 64px; +} + +#update_status +{ + font-size: 13px; + margin-left: 64px; + margin-top: 30px; +} + #update_content { height: 100%; overflow: hidden; + display: flex; + flex-direction: column; + padding: 5px 10px 5px 10px; +} + +.update_controls +{ + margin-left: 64px; } /* QRCodes */ diff --git a/windows/src/desktop/kmshell/xml/keyman_update.xsl b/windows/src/desktop/kmshell/xml/keyman_update.xsl index 074e78d4ed..ad84e8e6ad 100644 --- a/windows/src/desktop/kmshell/xml/keyman_update.xsl +++ b/windows/src/desktop/kmshell/xml/keyman_update.xsl @@ -16,26 +16,22 @@
-  
+  
-
Updates are available which will be applied when Windows is next restarted:
+
Updates are available which will be applied when Windows is next restarted:
-
+
+
Select
+
+
+
- - - - - - - -
-
+
keyman:update_applynow @@ -56,49 +52,49 @@ - - - - javascript:updateTick(""); - Update_ - checked - Update_ - - - Update__RequiresAdmin - - + +
+ + javascript:updateTick(""); + Update_ + checked + Update_ + + + Update__RequiresAdmin + +
- +
- - +
+
- - +
+
- +
- +
- - +
+
- - +
+
- +
- +
@@ -107,13 +103,12 @@
- - +
+
- +
- diff --git a/windows/src/desktop/kmshell/xml/menuframe_update.png b/windows/src/desktop/kmshell/xml/menuframe_update.png new file mode 100644 index 0000000000000000000000000000000000000000..5a7bc9d47bcca69d98ce3c2c0c4dd87179db3490 GIT binary patch literal 1573 zcmV+=2HN?FP)EX>4Tx04R~2kiAO8Koo_)tl}Rlh>C?+q_Ex6tt|Y*V6m`fBN(l+NfsBA7?LcD zZ{VBg!)zf4K7+M_wP&J*g=rkPoR7=B=gbVW>?BOf`2$F^s&L#x|I)v*7vE^J4y>^p zgk|0voO(2#&sQv?FCF96Joo2Wh~hGo&Qw{L7Zq6h;_kG{4XfC^_1t6egV>JJED}G7 zccU~iY`ktfn^8uGU5yuMO~@)*m@B;1k8)8t|P_j~Q*yxz37W_eHqb!$%58jaxn z5mtTJc!rhhhODLEZ)=$8)-(Tn;}_T|P+W=`(Yycv00Lr5M??VshmXv^00009a7bBm z000XU000XU0RWnu7ytkO2XskIMF;2%5&$4BKyhd{0000PbVXQnLvL+uWo~o;Lvm$d zbY)~9cWHEJAV*0}P*;Ht7XSbRV@X6oR9M5+*;|htM->I&udDlXpL0B8I}Y)H?ZG4& z6M_j=2-hf59uQHG$S>eG!V?lA+(eY{fB_MKh2ubC8?4x7Jf7RR^`$Bg)3L;R`r%Z+ zlv?W2UbWZWt7>)Tb01AAB$-Yo=;S&<610MV#t5CfpGQFyB$+Jx{39xcSh7|0K<1`e z1$N!DXK7}tbirjCSQ=ZHpi$`rLyQ6TEv2M2QY(?vZunRy$>oyh*vQYflcUk{L73QzL#u7yglGO}Y!B}nG} z=C-A%R{Fk|dUDswL27c4OrBKX%wOypYvejxzUo}xhH}v(KkFOM*fp=5d^u3#83ZI9 z-gD10GL`dcxs@G_g^AO0?3wwMnPlWAE{e*5=voZX&7#~t?K&-U=!$J)nP2#?M>@fm zy{2%^k(o*-dfQJ;MRAbs8irYP=7y=xO5vV~2HXB8q3%_a8*)j~TKUaT!3>khgqxx$ zs6|gpN(Z`LP;wu7;Eb~lB`bx5hd!}246%mUyvBz{A{t30)41i9S}oT)vhP`&zUwKa zDCivcU?8#%1ajZfNMng;j>0*+f{~@hMUP$bqUX%bbPAo!?IF70P#}}LDxF4+r2`9@ z3pRC*6*9YCP-086@XQXiZS~m)}|_%mulXk+FT#^`UELYNqkn*j%A9 zQ~B6!W54!ezw;kQqSDHyg zkd&qaiO3*2dD*c{rID=UmVJ$8YJYVk${lD;<-HL?Wy55BKt@|Ogs-eaphk@ut zUzBTAc9br-=8ms>&VAo@(RP2Xy`-}zN-E!Ub}$JU=&Duvj!ZC9Dpihr!*x+6dO_`3 zodZi#l}u*St0%s|`hbks_KFtod&!^O_l}u;&wJ0V-&=U3bzf-{Q*X*OgVA*$x2{u& zuDkBoNFi8C#-iH9zOxo`Ia*V1*y)9&HChk*Bgqt^;AMq(WjY7W3XV;T9NXwElBjdu z4_%@+mh<(=x#$O;5yU5SN(k!#a+xa0u~ug8v88=`_B=3GXeFnVzT~_!a!=V*7|TrL1J&e! z=5nVKG%^Rhm6dEd7ELt@69F57m2rPX%h!djO)9Wb@x(FL|Jyow``MxV|7U$b14Q&G Xyh7$Uo4Mqu00000NkvXXu0mjfFxv2e literal 0 HcmV?d00001 From 89b17273f71c5747d990ccab8eab5a9ac0684687 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:48:14 +1000 Subject: [PATCH 2/6] feat(windows): delete old update icon --- .../src/desktop/kmshell/xml/menuframe_update.jpg | Bin 1404 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 windows/src/desktop/kmshell/xml/menuframe_update.jpg diff --git a/windows/src/desktop/kmshell/xml/menuframe_update.jpg b/windows/src/desktop/kmshell/xml/menuframe_update.jpg deleted file mode 100644 index 6eeb76bfd6f64f987667906903678cbd227dc21b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1404 zcmbVKX;4#F6g~;rNJ1nK5GY98NOfS^h%7}xFbV{rVAuqlfsjQhB!MIdIA9Gb&=$LZ zwjctfRG~~Og#v|EWDx-!s-8V=2B;X z26jM!9k4?z(If|j`i8-(u{Z!o383Ez*IJeK{{@OvrjejhADT)@vRVs3*om-fnl>57 zXaXlOOe8=!4`HrUp_C$AjqoO^LW*PjTah9u71zN7-wjiy3=c(Fgr+U{fe?Zq1h^0n zsgM9kpamzCm1t!TxPlAHexL?1WPk=FC?|mot)(H377in%K}vqG8=)|S&~8@ovsv*A zK`!w~BLQjQ4k}O}P23Og^F|K#y6) zi-y?$^|lJfb%pbWJ!1D!r$$5~K2VU*Ak)ZX5{XQwQYkbhoyla-84MGanW+hj&0;W2 zElt_x919Bz=9;xumK-ZHjs*v62L=tDf<1x22CNJ0(GMb{ONrmhe}h0o!W1gan9e|i zMpGaXjEsmRBistHvrrvKY_i#Uz7NHGznHoqg|kifMFnl+?z#>O(QU&f=XiCtG2L>l zm9@=g2j1ITwr+QEb#s5uL$GJBub;m#AT%sIA`+dvL@JXXI-Kxy9-#(4LPLAObQ0N$bEAgx-rlPXJ?x5avgGJN4=X=ayx;aySMQ| z=kfckK&^7o>2I+{(s|>;rn&Ix&e`XYiLXj7y4;qX@;O*=d{XydorfwUqZ$LLiXEhy zRP6H~4f@_XnvrzoW5T%KX$Knn)U z881h}$Y^;@LR!jjA1UqgZaLRWU;TBhppY9n^VWHybGcq+l3o?vT!z8HHaE9~wM7^t z7LV@rt{JqZ>Mk=`xn5@Zizk9)fe9|~f(q!*6Ic6siIXny@${hh{`42#Ma!KJp!nfC*J z-1dxDR^`y}(%8W0_9&~a)w?$;w)UD|7Hn5J>OMVisIT)Ok5_&nD|Vuk)pOOu=~D5< Yp{(p1BS(7H*d8rVtA$gA18vyQKR^b-kN^Mx From 477bc9fd5a633295e51d831e41728323066c7e81 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:43:31 +1000 Subject: [PATCH 3/6] feat(windows): WIP apply now button needs more checking --- .../desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas | 4 ---- windows/src/desktop/kmshell/main/UfrmMain.pas | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas b/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas index 07bda0aa7f..9f8ad62906 100644 --- a/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas +++ b/windows/src/desktop/kmshell/main/Keyman.System.UpdateStateMachine.pas @@ -656,7 +656,6 @@ end; procedure IdleState.HandleInstallNow; begin bucStateContext.CurrentState.HandleCheck; - // TODO: How do we notify the command line no update available end; { UpdateAvailableState } @@ -778,9 +777,6 @@ begin // Failed three times in this process return to the // IdleState to wait 7 days before trying again ChangeState(IdleState); - // TODO: Future could go to a RetryState which serialized the a retry count - // to disk. Then it could try launch the download again on the next - // kmshell start event. end else begin diff --git a/windows/src/desktop/kmshell/main/UfrmMain.pas b/windows/src/desktop/kmshell/main/UfrmMain.pas index cb206e0291..bd341e70dc 100644 --- a/windows/src/desktop/kmshell/main/UfrmMain.pas +++ b/windows/src/desktop/kmshell/main/UfrmMain.pas @@ -825,6 +825,9 @@ begin end; procedure TfrmMain.Update_CheckNow; +// TODO: epic-windows-update +// Get an instance to the state machine and call handle check so the state can change to update +// available. var UpdateCheck : TRemoteUpdateCheck; begin UpdateCheck := TRemoteUpdateCheck.Create(True); From 6b938e1beffcd1e3f2f8fcfdf5fca0911032fbae Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:47:22 +1000 Subject: [PATCH 4/6] feat(windows): disable apply updated now if no updates Disable the apply update now if no updates are available. Fixes: #12840 --- .../src/desktop/kmshell/xml/keyman_update.xsl | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/windows/src/desktop/kmshell/xml/keyman_update.xsl b/windows/src/desktop/kmshell/xml/keyman_update.xsl index ad84e8e6ad..0daa6ace3b 100644 --- a/windows/src/desktop/kmshell/xml/keyman_update.xsl +++ b/windows/src/desktop/kmshell/xml/keyman_update.xsl @@ -2,6 +2,8 @@ + +
@@ -19,7 +21,14 @@  
-
Updates are available which will be applied when Windows is next restarted:
+
+ + Updates are available which will be applied when Windows is next restarted: + + + No updates are available. + +
Select
@@ -32,11 +41,24 @@
- - - keyman:update_applynow - 220px - + + + + + + keyman:update_applynow + 220px + + + + + + + 220px + 1 + + + From 20f1ea0d7d6f5cc7e0b18ef060e2e9b687a483aa Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:00:53 +1000 Subject: [PATCH 5/6] feat(windows): add internal borders version grid --- windows/src/desktop/kmshell/xml/config.css | 37 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/windows/src/desktop/kmshell/xml/config.css b/windows/src/desktop/kmshell/xml/config.css index c07087dbb1..8a8ebf7ed2 100644 --- a/windows/src/desktop/kmshell/xml/config.css +++ b/windows/src/desktop/kmshell/xml/config.css @@ -503,8 +503,14 @@ table tr display: grid; position: relative; grid-template-columns: 50px 1fr 1fr 1fr; - padding: 10px 50px 10px 64px; - border: grey 1px; + margin: 10px 50px 10px 64px; + /* From https://geary.co/internal-borders-css-grid/ */ + overflow: hidden; + gap: var(--gap); + --gap: 2em; + --line-offset: calc(var(--gap) / 2); + --line-thickness: 1px; + --line-color: black; } .grid_container.grid_disabled @@ -516,11 +522,36 @@ table tr { position: relative; font-size: 12px; - margin: 0px; padding: 1px; margin: 0 0 0 5px; } +.grid_item::before, +.grid_item::after +{ + content: ''; + position: absolute; + background-color: var(--line-color); + z-index: 1; +} + +/* row borders */ +.grid_item::after +{ + inline-size: 100vw; + block-size: var(--line-thickness); + inset-inline-start: 0; + inset-block-start: calc(var(--line-offset) * -1); +} + +/* column borders */ +.grid_item::before +{ + inline-size: var(--line-thickness); + block-size: 100vh; + inset-inline-start: calc(var(--line-offset) * -1); +} + .grid_item_title{ font-weight: bold; } From dbaa7198a6cf981308a18fb88c9bad02f3ab3629 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:59:04 +1000 Subject: [PATCH 6/6] feat(windows): check correct member of data structure This change check the correct member of the data structure for the keyman bundle install file. It also uses a more simple string match for the file extension. --- .../main/Keyman.System.UpdateCheckStorage.pas | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/windows/src/desktop/kmshell/main/Keyman.System.UpdateCheckStorage.pas b/windows/src/desktop/kmshell/main/Keyman.System.UpdateCheckStorage.pas index 376721c6bb..a7a822df7c 100644 --- a/windows/src/desktop/kmshell/main/Keyman.System.UpdateCheckStorage.pas +++ b/windows/src/desktop/kmshell/main/Keyman.System.UpdateCheckStorage.pas @@ -70,18 +70,13 @@ end; class function TUpdateCheckStorage.HasKeymanInstallFile(const data: TUpdateCheckResponse): Boolean; var - i : Integer; - fileName : string; - f: TSearchRec; + fileExtension: string; begin - Result := False; - for i := 0 to High(data.Packages) do - begin - fileName := data.Packages[i].FileName; - if FindFirst(fileName + '*.exe', 0, f) = 0 then - Result := True; - System.SysUtils.FindClose(f); - end; + fileExtension := LowerCase(ExtractFileExt(data.FileName)); + if fileExtension = '.exe' then + Result := True + else + Result := False end; end.