From 664aad1111df3652d197cb7a8c4e8e1de62a8a12 Mon Sep 17 00:00:00 2001 From: Juliano de Souza Camargo Date: Thu, 4 Jan 2024 13:00:14 -0300 Subject: [PATCH 01/25] Update Brazilian Portuguese translation --- locale/pt_BR/LC_MESSAGES/BingWallpaper.mo | Bin 5809 -> 7709 bytes locale/pt_BR/LC_MESSAGES/BingWallpaper.po | 435 +++++++++++++++------- 2 files changed, 299 insertions(+), 136 deletions(-) diff --git a/locale/pt_BR/LC_MESSAGES/BingWallpaper.mo b/locale/pt_BR/LC_MESSAGES/BingWallpaper.mo index 23eded600ae27369ba12e206d012d416e8984164..618d39716bf8241d29da7b3f5632f599fbcde759 100644 GIT binary patch literal 7709 zcmb`LYm8*aRmaPZ1Uw-SJ2no4KxHAYYqoo4cWq}qo}IYovEwoG^33cyj)bD>zSZ4# z_x7!u`FZ`a$s1 z;QipAgD-=B1Im(5e6LaugTDpJx<3YG{LA25!M_E62>dtjA@HvI!up57C+W|E?*MOt zKMH;rd=vO7Q22Qf{0Z={!5;?y3w%3x|4g9M0N+f1wZ=X0jr0xp17II)fVV)Q{|BJZ zeYx)c3#jSe#i2s?3@G~-!Jh zDC>W&#t(ra|Br(r_fLbOpFaaN_*GEoeG?SD-oxP!f)9a0?-5Y$vkUU0-p4PIXAH`| zAt?Jk2tq>rI>?XueSQg@7eP7qFG1P&3Mg{>2KW~6zdJ z{5w$W!6&|2F31ffx`FCgTm)8gUi_TuY#KXR}rT0{Y~&I;C%>5 z_I(W$JADNdJ9rHgIuCIf>AwTi;1eJ$srP}RzZ>9tzz>45?qyK){m&p*RQJN%yTG@C zkAP2rV$TtH0sL@1{->bm`Cmb~|7)Pw$^9rz_!9rWMm>KwOp9N50K5WT05?Gg;&Rj%L9yq* z0EM3~gTnv6gJO^00!0sRfQX#;X7DahbpGu=v5R%u^YwxjD0h*dq;aV^*X)-A z&RW~Lrq^t0bCc+us?93B5muhp2R1Kam+DK}-JwqHq4q*3R4dDpp=uqPxRj-}xSGwTS~8uR zz1&r4q}xfA>o_f8J}!sHX7ae#FH>6-)1yT>OssZU3FnL#Hqu;StF_nCt)1-^y|%Tz zxvGo4O%fROWSMUd^=c9u-O775En}O<%Cr9*3du}nbM3lb#w%th0ysIF#htQ3*~}%8 zt)~;$F^N@6a)S;^jt409z;aO&nRcAWeU_)jJ1#AAQ~+<~qqx7Z@WJT?Ex2ytS3hOOWf_#L{zXQ?;6!HcDW%?phNB!@B3pFfnN~ zo{nsBvviqGT^Vzh)5gpuJgMH3u$_5pyuc$aYPYly&caou~B zqF;5p$bH}CX(r5!pCJ}JFq-d>tpV9jN#MmI<+CDUHbvGA@&#iWv{;ah8WpiFtSa9SD(>Bq|2K^_A+B9j!rlB^`jY^1OcrYT4BtO8{oh>YaNd@lxk?k%&jqQ9O{b+9!BZC>_L_GCDcR9N@Qhaftc8|+T?bfku%N?qqfGKin&yyQFi_k+ao*^bn{}gJ6J{g>H8BzSSH#x9;jQjW$7*~YxSICt^U#@vO*+@t!! z#remcXv|%jo0}0Q(b(r+1PwkxS3D$l7L}ZStj&Tzj^ExZvzqC8E zxxTqNx%-9Y+{`k8oHU}bKg_sA$<1f81XuN>#Fm^lcIDds)yCz?I=M{O=8e^~<06DN zuP?Xba%KmwVv@#HoIx?K)692^D;J;C;m<2)Q@yA!oSS)XV>x$+>}=HP_>MX_wWG1V zGOr(f?84=DKR!inEHAlhgS$?)U5yj&CZ6#qDl{`!o><|jUSu%jm|k6Lh_col2R1Lw zkSyD@Ukwa~h|`W=Fr!b7e$Q$2gn35hyG)x`$pgk|v(c$gh~gp}y=28Qp1s!Ec=p=r zu3l?N+PvOs&Rn-QIP&zX|9?oE<#5vGN@otP^4NvcIWxJ@14DW*33NgdHBO-STsyb8 zN>W5yhfzb?5V;~mpL%8hITobuz!bqBk}|b2(sq-p7N(s?;<%3sQZnlGkU>KcX~50)BF9BgOc*`-lcXg6_`I9zN^TuTwQVGYRq0FV7j*l*@bbrGt`?D?Q{F;_J~= zUE)gBfd4USyF-cLZ7P%v5oN=sLyUIN=HVp-rrM0v>Ud;q*9AdP%!e{7)DM9<>WQhf zNF~KwynUybO{j6qxR5~XpRilsa&b`B% zTv`eZlI!q%M!y-J^|8Q1QJ!OS5*sKyM0%o!@Nm_B?JLHQMkzfBbqZeXMi zG1%w02Jr>~eMw?s%eAajB|Y)RQkG1+_&b>n50v1*PZT5e+D(#a0c9)*k#*r%R?#9Nn+K6_vj{w0)C2WO+( z{FfmJa7yqKfrju_FBa!N-gqJq)Wf&{QpAuYV8RnRYOiV&r^<>$jjwNxUeL77`f6x& zn{tR)BhjZDr!gz>^?2yC8~1{172ltaZf9r~3&sMaYCNqmoK)b2Lwm#>>LjVJkB$}> zi;yX{#DyXbf5UYt)CQpllkvz9#e|XZ6O?O(SbK8(4t{dHgd&5$FZSf!&B^QFq6mll zCyL0&JDL{VX2>cETWOOyJQdzl1SNj`bb9n1%Bbq}j@K!pb_~(2gN4A6gj*b&FRVg6 zb>xWlAvBJ)sY&zG}nGmAqLcFPIxsRZ**qeuvy8HjUKDKZe2- Wj_3HWq&9UK<_d+8$bg(BsQwRt?X;Ev literal 5809 zcmb`KTZ|-C8OIL@iX$kXf)~`Yi{hf&Jva8^?CwC%&g?L8ZcNXxiwVKgU8lQ?sjk!1 zshZi@7=jN5Uo=W2!N&~=W{JcELQG72YKRXeDi0c8G|>k&CL|;xG0_KqUsd(=%+5wk zv@q)|-?%1fB#x1bzh+KOP5f1)m0Q0iOe9{};g9!PmhLg1-gD zo~6e#vR1BxG)!HAr{>tYR*94cuMPec!=@mz~B-i4<=DPYb&4cT?KC|bA zG!W1u>{>~vyViS-@r zn;jcukqxHRY2P!k_TeRa=CJRYC^|g7-U+?#C9a*Au5P-n^?Ex@JGwSgUs>E(pIdxH zFR$qHwY9a{^7q+er9huZ7r$^1SZgCgb)P#|* zo*otRr&UeIHr;l~rnX7Kd)I7ci49b(;j&cKwoRCZaeLr@wOUm(rn%WpTownq5oL)E z;}rYCbZ6h2By4xm*m}=XZv%}r%e8t<*H%|%^?XchwC~s`()MCLo%f9$Jr{*W*OIo4 z)6gcNnvuQF6WgBYS&VDt;hHr&;>*=HBDsIj9A(vUtyR0Y*`#K zfoX&hcFVGnYlpFr1**)W$E>08U(}ROLCT_Et596jK$P6jNuFkq{*TvC}&cyQ` zCfU^Uw70|drfv1c+M-UKZbo6R;YUsq5+3rC}>Ej-)X#sS*AZYXybD>e^Ho z5Li7J21SX4aUe^Q^@YJV9g-Zi=$f0l-b}2G)slgXTo@0TmcnMo*hrr>FguEPn{3)t z%+qFzBFK#<>pKo^B({yYYDuCR#w{n_3;U{+F;B^EVyQzSEE!bGc6%7J;+fYLvv&d^ zCp^k$Gw!0y%$tXzk4VKF)jpEy&_URhXIKf7gn|TA%1Y`ql~$6FGO9-gmEaX3rB+$D zraPrqSv_kL6?;_AB<2#G+r+zrrgSfTY-Vj_X<=z@X!3Yw|9PiLLL6{f zUQ_bS`TR`DC6CdujECC2{;P5x=!Z6Hiw|wgt?BuiNS=jSb>w0DI2#-+vHyeQkWY3U;wS1@KM+4FO~?6`>8zWpAF&wiV^!TX602(PFA1c*?GK0? zVhe@nAuRZb%htCXH7hH$XyH!HBw^Iyg&W+{#|?L}DHV?xdu>J3vynNVgjNwibPdjL zBPQmXqLsuqwMy|Ad6#$07(ZRkg`sj%3qeRTAG|;dl=k)<)4CQ@6O)jZh+|MxQQ?@O zV6cTDxjs^>`$ltemEs6f>6%M6 zW*$1TeUeK)PK<qT?{YOWZ4jRhMf zyqJ%am4&3a$C470>rosRmWTwBP4Zfl#O1nanCpRfQxBHYl3n3dMw3PQUoWFXYi&S% zc$s-*Fw2o)=Y`6vr8mX;((h$kj3~|px!Ehy)JhYfNvIsoizW-uWc_bJg`AYbXX_<( z8j(~+=+IxNde-HjIH=8RA}b9Wh>QC#ZNYe)@R^}3+aZ>S!jn@Gh14C8D=x^M3$+Ci zXWgRM3%w@dX^TAPgpksZ3ff;vsgu0%7YHHB+JT$>S1vMZf9<1Dx-lvId0ipI*MovGD`rUk^7>gdfm%$y5WAtAB=79Oq zZp&!#t1StI#4Nb?yKGwqpy+L)r63rh&xUDX)*wwXHm`aSh^n47d>W?kp7Is(R~!k9 zDMVp$n@h$1WwavAXn#$sg(4;V2s3H_m4p(lm8T0!wh5J5%jM, 2024. +# msgid "" msgstr "" "Project-Id-Version: bing-wallpaper-gnome-extension\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-05-09 18:12+1000\n" -"PO-Revision-Date: 2021-06-24 17:30-0300\n" -"Last-Translator: \n" -"Language-Team: Portuguese, Brazilian\n" +"PO-Revision-Date: 2024-01-04 12:59-0300\n" +"Last-Translator: Juliano de Souza Camargo \n" +"Language-Team: Brazilian Portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n > 1)\n" "X-Crowdin-Project: bing-wallpaper-gnome-extension\n" "X-Crowdin-Project-ID: 451876\n" "X-Crowdin-Language: pt-BR\n" "X-Crowdin-File: BingWallpaper.pot\n" "X-Crowdin-File-ID: 2\n" -"X-Generator: Poedit 3.0\n" +"X-Generator: Gtranslator 45.3\n" -#: Settings.ui.h:1 Settings4.ui.h:2 +#: ui/Settings4.ui.h:1 +msgid "Bing Wallpaper pictures folder" +msgstr "Pasta de imagens do Bing Wallpaper" + +#: ui/Settings4.ui.h:2 msgid "Hide the indicator" msgstr "Ocultar o indicador" -#: Settings.ui.h:2 Settings4.ui.h:3 +#: ui/Settings4.ui.h:3 msgid "Indicator icon" msgstr "Ícone do indicador" -#: Settings.ui.h:3 Settings4.ui.h:4 +#: ui/Settings4.ui.h:4 extension.js:156 msgid "Enable desktop notifications" msgstr "Habilitar notificações na Área de Trabalho" -#: Settings.ui.h:4 Settings4.ui.h:5 extension.js:129 +#: ui/Settings4.ui.h:5 extension.js:136 extension.js:152 msgid "Set background image" msgstr "Definir imagem de fundo" -#: Settings.ui.h:5 Settings4.ui.h:6 extension.js:130 -msgid "Set lock screen image" -msgstr "Definir imagem da tela de bloqueio" +#: ui/Settings4.ui.h:6 +msgid "Background style option" +msgstr "Opção de estilo de fundo" -#: Settings.ui.h:6 Settings4.ui.h:7 +#: ui/Settings4.ui.h:7 msgid "Download folder" msgstr "Pasta de download" -#: Settings.ui.h:7 Settings4.ui.h:1 -msgid "Bing Wallpaper pictures folder" -msgstr "Pasta de imagens do Bing Wallpaper" +#: ui/Settings4.ui.h:8 +msgid "Open folder" +msgstr "Abrir pasta" + +#: ui/Settings4.ui.h:9 +msgid "Selected image" +msgstr "Imagem selecionada" -#: Settings.ui.h:8 Settings4.ui.h:9 -msgid "Delete previously downloaded wallpapers" -msgstr "Excluir papéis de parede baixados anteriormente" +#: ui/Settings4.ui.h:10 +msgid "Shuffle enabled" +msgstr "Embaralhar ativado" -#: Settings.ui.h:9 Settings4.ui.h:10 -msgid "Days to store wallpapers before deleting" -msgstr "Dias para armazenar papéis de parede antes de excluir" +#: ui/Settings4.ui.h:11 +msgid "Shuffle mode" +msgstr "Modo embaralhar" -#: Settings.ui.h:10 Settings4.ui.h:11 +#: ui/Settings4.ui.h:12 msgid "Bing locale" msgstr "Idioma do Bing" -#: Settings.ui.h:11 Settings4.ui.h:12 -msgid "Default is English - United States" -msgstr "O padrão é inglês - Estados Unidos" - -#: Settings.ui.h:12 Settings4.ui.h:14 -msgid "Screen resolution" -msgstr "Resolução de tela" - -#: Settings.ui.h:13 Settings4.ui.h:15 -msgid "Override automatic resolution selection" -msgstr "Substituir a seleção de resolução automática" - -#: Settings.ui.h:14 Settings4.ui.h:13 -msgid "Selected image" -msgstr "Imagem selecionada" - -#: Settings.ui.h:15 Settings4.ui.h:16 extension.js:132 +#: ui/Settings4.ui.h:13 extension.js:139 msgid "Settings" msgstr "Configurações" -#: Settings.ui.h:16 Settings4.ui.h:17 -msgid "Use custom blur and brightness" -msgstr "Usar desfoque e brilho personalizados" +#: ui/Settings4.ui.h:14 +msgid "Dynamically switches blur on GDM3 lock screen" +msgstr "Altera dinamicamente o desfoque na tela de bloqueio GDM3" -#: Settings.ui.h:17 Settings4.ui.h:18 -msgid "Override GDM3 lockscreen effects" -msgstr "Sobrescrever efeitos de bloqueio de tela GDM3" +#: ui/Settings4.ui.h:15 +msgid "Enable dynamic lockscreen blur" +msgstr "Ativar o desfoque dinâmico da tela de bloqueio" -#: Settings.ui.h:18 Settings4.ui.h:19 -msgid "Blur can improve readability of login prompt" -msgstr "Desfoque pode melhorar a legibilidade da tela de login" +#: ui/Settings4.ui.h:16 +msgid "Blur can improve readability" +msgstr "Desfoque pode melhorar a legibilidade" -#: Settings.ui.h:19 Settings4.ui.h:20 +#: ui/Settings4.ui.h:17 msgid "Background blur intensity" msgstr "Intensidade do desfoque de fundo" -#: Settings.ui.h:20 Settings4.ui.h:21 +#: ui/Settings4.ui.h:18 msgid "Can improve contrast of login prompt" msgstr "Pode melhorar o contraste da tela de login" -#: Settings.ui.h:21 Settings4.ui.h:22 +#: ui/Settings4.ui.h:19 msgid "Background brightness" msgstr "Brilho do fundo" -#: Settings.ui.h:22 Settings4.ui.h:23 +#: ui/Settings4.ui.h:20 msgid "Presets" msgstr "Predefinições" -#: Settings.ui.h:23 Settings4.ui.h:24 -msgid "Commonly used presets" -msgstr "Predefinições comumente usadas" - -#: Settings.ui.h:24 Settings4.ui.h:25 +#: ui/Settings4.ui.h:21 msgid "No blur, slight dim" msgstr "Sem desfoque, um pouco escuro" -#: Settings.ui.h:25 Settings4.ui.h:26 +#: ui/Settings4.ui.h:22 msgid "GNOME default" msgstr "Padrão GNOME" -#: Settings.ui.h:26 Settings4.ui.h:27 +#: ui/Settings4.ui.h:23 msgid "Slight blur, slight dim" msgstr "Desfoque leve, um pouco escuro" -#: Settings.ui.h:27 Settings4.ui.h:28 +#: ui/Settings4.ui.h:24 msgid "Lock Screen" msgstr "Tela de bloqueio" -#: Settings.ui.h:28 Settings4.ui.h:29 +#: ui/Settings4.ui.h:25 +msgid "Enable logging to system journal" +msgstr "Ativar o registro no journal do sistema" + +#: ui/Settings4.ui.h:26 +msgid "Debug logging" +msgstr "Depurar o registro" + +#: ui/Settings4.ui.h:27 +msgid "Switch to new images when available (unless on random mode)" +msgstr "" +"Trocar para novas imagens quando disponíveis (a não ser em modo aleatório)" + +#: ui/Settings4.ui.h:28 extension.js:153 +msgid "Always show new images" +msgstr "Sempre mostre novas imagens" + +#: ui/Settings4.ui.h:29 +msgid "Some newer features may be unstable on Wayland" +msgstr "Algumas funcionalidades novas podem ser instáveis no Wayland" + +#: ui/Settings4.ui.h:30 +msgid "Enable all features on Wayland" +msgstr "Ativar todas as funcionalidades no Wayland" + +#: ui/Settings4.ui.h:31 +msgid "Screen resolution" +msgstr "Resolução de tela" + +#: ui/Settings4.ui.h:32 +msgid "Override automatic resolution selection" +msgstr "Substituir a seleção de resolução automática" + +#: ui/Settings4.ui.h:33 +msgid "Manually adjust random interval (seconds)" +msgstr "Manualmente ajusta o intervalo de aleatoriedade (segundos)" + +#: ui/Settings4.ui.h:34 +msgid "Random interval" +msgstr "Intervalo de aleatoriedade" + +#: ui/Settings4.ui.h:35 +msgid "Import Bing Wallpaper data" +msgstr "Importar dados de papel de parede Bing" + +#: ui/Settings4.ui.h:36 +msgid "Import previously exported JSON data from wallpaper directory" +msgstr "" +"Importar previamente exportado dados JSON do diretório de papel de parede" + +#: ui/Settings4.ui.h:37 +msgid "Import" +msgstr "Importar" + +#: ui/Settings4.ui.h:38 +msgid "Export Bing Wallpaper data" +msgstr "Exportar dados de papel de parede Bing" + +#: ui/Settings4.ui.h:39 +msgid "Export JSON data to wallpaper dir for backup or data migration" +msgstr "" +"Exportar dados JSON para diretório de papel de parede para salvaguardar ou " +"migração de dados" + +#: ui/Settings4.ui.h:40 +msgid "Export" +msgstr "Exportar" + +#: ui/Settings4.ui.h:41 +msgid "Always export Bing data" +msgstr "Sempre exporta dados Bing" + +#: ui/Settings4.ui.h:42 +msgid "Export Bing JSON whenever data changes" +msgstr "Exportar JSON Bing sempre que alterar dados" + +#: ui/Settings4.ui.h:43 +msgid "Debug options" +msgstr "Opções de depuração" + +#: ui/Settings4.ui.h:44 +msgid "Gallery" +msgstr "Galeria" + +#: ui/Settings4.ui.h:45 msgid "New wallpaper images everyday from Bing" msgstr "Novas imagens de papel de parede todos os dias do Bing" -#: Settings.ui.h:29 Settings4.ui.h:30 -msgid "Gnome shell extension version " -msgstr "Versão da extensão Gnome shell " +#: ui/Settings4.ui.h:46 +msgid "GNOME shell extension version " +msgstr "Versão da extensão GNOME shell " -#: Settings.ui.h:30 Settings4.ui.h:31 -msgid "https://github.com/neffo/bing-wallpaper-gnome-extension" -msgstr "https://github.com/neffo/bing-wallpaper-gnome-extension" - -#: Settings.ui.h:31 Settings4.ui.h:32 +#: ui/Settings4.ui.h:47 msgid "Maintained by Michael Carroll" msgstr "Mantida por Michael Carroll" -#: Settings.ui.h:32 Settings4.ui.h:33 +#: ui/Settings4.ui.h:48 msgid "" -"Show your support to the author on Flattr or Github " +"Show your support to the author on Flattr or Github " "Sponsors." msgstr "" "Mostre seu apoio ao autor no Flattr ou Patrocinadores do " "Github." -#: Settings.ui.h:33 Settings4.ui.h:34 +#: ui/Settings4.ui.h:49 msgid "Changes since last version" msgstr "Alterações desde a última versão" -#: Settings.ui.h:34 Settings4.ui.h:35 -msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" -msgstr "Baseado na extensão NASA APOD Gnome shell pela Elia Argentieri" +#: ui/Settings4.ui.h:50 +msgid "Based on NASA APOD GNOME shell extension by Elia Argentieri" +msgstr "Baseado na extensão NASA APOD GNOME shell pela Elia Argentieri" -#: Settings.ui.h:35 Settings4.ui.h:36 +#: ui/Settings4.ui.h:51 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General " @@ -170,106 +241,198 @@ msgstr "" "Veja a GNU General " "Public License, versão 3 ou posterior para mais detalhes" -#: Settings.ui.h:37 Settings4.ui.h:38 +#: ui/Settings4.ui.h:53 msgid "About" msgstr "Sobre" -#: Settings4.ui.h:8 -msgid "Open folder" -msgstr "Abrir pasta" +#: ui/carousel4.ui.h:1 +msgid "Favorite" +msgstr "Favorito" + +#: ui/carousel4.ui.h:2 +msgid "Apply" +msgstr "Aplicar" + +#: ui/carousel4.ui.h:3 +msgid "View" +msgstr "Visualizar" + +#: ui/carousel4.ui.h:4 +msgid "Info" +msgstr "Informação" + +#: ui/carousel4.ui.h:5 +msgid "Delete" +msgstr "Apagar" + +#: ui/carousel4.ui.h:6 +msgid "" +msgstr "" + +#: ui/carousel4.ui.h:7 +msgid "Set random mode" +msgstr "Definir modo aleatório" + +#: ui/carousel4.ui.h:8 +msgid "Load image gallery" +msgstr "Carrega a galeria de imagem" + +#: ui/intervals.utils.js.h:2 +msgid "on the hour" +msgstr "de hora em hora" + +#: ui/intervals.utils.js.h:5 +msgid "every day at midnight" +msgstr "todo dia à meia-noite" + +#: ui/intervals.utils.js.h:8 +msgid "every Sunday at midnight" +msgstr "todo domingo à meia-noite" -#: extension.js:117 +#: extension.js:130 msgid "" msgstr "" -#: extension.js:119 extension.js:121 extension.js:123 +#: extension.js:131 extension.js:132 extension.js:142 extension.js:144 msgid "Awaiting refresh..." msgstr "Aguardando atualização..." -#: extension.js:126 +#: extension.js:133 msgid "Copy image to clipboard" msgstr "Copiar imagem para área de transferência" -#: extension.js:127 +#: extension.js:134 msgid "Copy image URL to clipboard" msgstr "Copiar URL da imagem para área de transferência" -#: extension.js:128 +#: extension.js:135 msgid "Open image folder" msgstr "Abrir pasta de imagens" -#: extension.js:131 +#: extension.js:137 +msgid "Set lock screen image" +msgstr "Definir imagem da tela de bloqueio" + +#: extension.js:138 msgid "Refresh Now" msgstr "Atualizar agora" -#: extension.js:137 -msgid "Thumbnail disabled on Wayland" -msgstr "Miniaturas desativadas no Wayland" +#: extension.js:140 +msgid "Open in image viewer" +msgstr "Abrir no visualizador de imagem" -#: extension.js:203 -msgid "Next refresh" -msgstr "Próxima atualização" +#: extension.js:141 +msgid "Open Bing image information page" +msgstr "Abrir página de informação de imagem Bing" -#: extension.js:490 extension.js:527 -msgid "Bing Wallpaper of the Day for" -msgstr "Papel de parede do dia para" +#: extension.js:150 +msgid "Quick settings" +msgstr "Configurações rápidas" -#: extension.js:495 -msgid "Set as wallpaper" -msgstr "Definir como papel de parede" +#: extension.js:154 +msgid "Image shuffle mode" +msgstr "Modo embaralhar imagem" -#: extension.js:498 -msgid "More info on Bing.com" -msgstr "Mais informações no Bing.com" +#: extension.js:155 +msgid "Image shuffle only favourites" +msgstr "Embaralha apenas imagens favoritas" -#: extension.js:553 -msgid "No wallpaper available" -msgstr "Nenhum papel de parede disponível" +#: extension.js:157 +msgid "Show image count" +msgstr "Exibir contador de imagem" -#: extension.js:554 -msgid "No picture for today." -msgstr "Nenhuma imagem para hoje." +#: extension.js:158 +msgid "Image shuffle only UHD resolutions" +msgstr "Embaralha imagem somente em resolução UHD" -#: prefs.js:173 -msgid "Most recent image" -msgstr "Imagem mais recente" +#: extension.js:321 +msgid "Next refresh" +msgstr "Próxima atualização" -#: prefs.js:174 -msgid "Random image" -msgstr "Imagem aleatória" +#: extension.js:323 +msgid "Last refresh" +msgstr "Última atualização" -#: prefs.js:190 prefs.js:206 -msgid "Disabled on current GNOME version" -msgstr "Desabilitada na versão atual do GNOME" +#: extension.js:326 +msgid "Next shuffle" +msgstr "Próximo embaralhamento" -#: utils.js:139 -msgid "Fetching data..." -msgstr "Buscando dados..." +#: extension.js:801 extension.js:875 +msgid "Bing Wallpaper of the Day for" +msgstr "Papel de parede do dia para" -#: utils.js:150 -msgid "Market not available in your region" -msgstr "Mercado não disponível na sua região" +#: extension.js:913 +msgid "No wallpaper available" +msgstr "Nenhum papel de parede disponível" -#: utils.js:154 -msgid "A network error occured" -msgstr "Ocorreu um erro de rede" +#: extension.js:914 +msgid "No picture for today." +msgstr "Nenhuma imagem para hoje." -#: utils.js:159 -msgid "Too many requests in 5 seconds" -msgstr "Muitas requisições realizadas em 5 segundos" +#: prefs.js:156 +msgid "Select folder" +msgstr "Selecionar pasta" -#: utils.js:186 -msgid "No change log found for this release" -msgstr "Não foram encontrados registros de alterações para esta versão" +#: utils.js:127 +msgid "Error fetching change log: " +msgstr "Erro ao obter o registro de alterações" -#: utils.js:366 utils.js:369 +#: utils.js:405 utils.js:408 msgid "minutes" msgstr "minutos" -#: utils.js:372 +#: utils.js:411 msgid "days" msgstr "dias" -#: utils.js:375 +#: utils.js:414 msgid "hours" msgstr "horas" + +#~ msgid "Delete previously downloaded wallpapers" +#~ msgstr "Excluir papéis de parede baixados anteriormente" + +#~ msgid "Days to store wallpapers before deleting" +#~ msgstr "Dias para armazenar papéis de parede antes de excluir" + +#~ msgid "Default is English - United States" +#~ msgstr "O padrão é inglês - Estados Unidos" + +#~ msgid "Use custom blur and brightness" +#~ msgstr "Usar desfoque e brilho personalizados" + +#~ msgid "Override GDM3 lockscreen effects" +#~ msgstr "Sobrescrever efeitos de bloqueio de tela GDM3" + +#~ msgid "Commonly used presets" +#~ msgstr "Predefinições comumente usadas" + +#~ msgid "https://github.com/neffo/bing-wallpaper-gnome-extension" +#~ msgstr "https://github.com/neffo/bing-wallpaper-gnome-extension" + +#~ msgid "Set as wallpaper" +#~ msgstr "Definir como papel de parede" + +#~ msgid "More info on Bing.com" +#~ msgstr "Mais informações no Bing.com" + +#~ msgid "Most recent image" +#~ msgstr "Imagem mais recente" + +#~ msgid "Disabled on current GNOME version" +#~ msgstr "Desabilitada na versão atual do GNOME" + +#~ msgid "Fetching data..." +#~ msgstr "Buscando dados..." + +#~ msgid "Market not available in your region" +#~ msgstr "Mercado não disponível na sua região" + +#~ msgid "A network error occured" +#~ msgstr "Ocorreu um erro de rede" + +#~ msgid "Too many requests in 5 seconds" +#~ msgstr "Muitas requisições realizadas em 5 segundos" + +#~ msgid "No change log found for this release" +#~ msgstr "Não foram encontrados registros de alterações para esta versão" From 4b02f9cd7e8ca411cd053264e173a03e965fb647 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Sun, 10 Mar 2024 21:42:19 +1000 Subject: [PATCH 02/25] add support for gnome-46 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index e35c0675..032cb3ff 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "uuid": "BingWallpaper@ineffable-gmail.com", - "shell-version": ["45"], + "shell-version": ["45", "46"], "name": "Bing Wallpaper", "settings-schema": "org.gnome.shell.extensions.bingwallpaper", "description": "Sync your wallpaper to today's Microsoft Bing image of the day (the image you see when you visit Bing.com).\n\n *Disclaimer*: this extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nFeatures:\n* UHD resolution wallpapers\n* Automatically fetches current Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (user selectable on GNOME versions that support it)\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n * random mode (from previously downloaded wallpapers)\n *NEW: select/cycle wallpaper through previously downloaded images\n* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr), Portuguese (pt), Ukrainian (uk), Russian (ru_RU), Spanish (es), Korean (ko), Indonesian (id), Catalan (ca), Norwegian Bokmål (nb) & Nynorsk (ni), Swedish (sv), Arabic (ar), Hungarian (hu) and Japanese (ja) - a HUGE thanks to the translators\n\nThis extension was forked from the NASA APOD extension by Elinvention (https://github.com/Elinvention) and inspired by Bing Desktop Wallpaper Changer by Utkarsh Gupta (https://github.com/UtkarshGpta).\n\nAlways restart GNOME after manually updating extensions. Please report bugs to the GitHub page below:", From 56dbd34edb83fda570b5de38be36c248cbc57ea3 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 11 Mar 2024 01:54:55 +1000 Subject: [PATCH 03/25] initial tests of adwaita prefs --- prefs.js | 155 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 131 insertions(+), 24 deletions(-) diff --git a/prefs.js b/prefs.js index 4986c7aa..913f9e67 100644 --- a/prefs.js +++ b/prefs.js @@ -30,10 +30,13 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen let settings = this.getSettings(Utils.BING_SCHEMA); let desktop_settings = this.getSettings(Utils.DESKTOP_SCHEMA); - window.set_default_size(PREFS_DEFAULT_WIDTH, PREFS_DEFAULT_HEIGHT); - let icon_image = null; let provider = new Gtk.CssProvider(); + provider.load_from_path(this.dir.get_path() + '/ui/prefs.css'); + Gtk.StyleContext.add_provider_for_display( + Gdk.Display.get_default(), + provider, + Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); let carousel = null; let httpSession = null; @@ -43,16 +46,116 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal } + const settings_page = new Adw.PreferencesPage({ + title: _('Settings'), + icon_name: 'dialog-information-symbolic', + }); + window.add(settings_page); + const ui_group = new Adw.PreferencesGroup({ + title: _('Indicator'), + /*description: _('Configure the indicator of the extension'),*/ + }); + settings_page.add(ui_group); + const hideSwitch = new Adw.SwitchRow({ + title: _('Hide Indicator'), + subtitle: _('Whether to hide the panel indicator'), + }); + const notifySwitch = new Adw.SwitchRow({ + title: _('Desktop notifications'), + subtitle: _('Whether to enable notifications on new images'), + }); + ui_group.add(hideSwitch); + ui_group.add(notifySwitch); + /*const list = new Gtk.StringList(); + Utils.icon_list.forEach((iconname, index) => { + list.append(iconname, iconname); + });*/ + const iconEntry = new Adw.ComboRow({ + title: _('Desktop notifications'), + subtitle: _('Whether to enable notifications on new images'), + model: Gtk.StringList.new(Utils.icon_list), + selected: Utils.icon_list.indexOf(settings.get_string('icon-name')), + }); + ui_group.add(iconEntry); + + + const wp_group = new Adw.PreferencesGroup({ + title: _('Wallpaper'), + /*description: _('Configure downloads'),*/ + }); + settings_page.add(wp_group); + const shuffleIntervals = new Gtk.StringList; + Utils.randomIntervals.forEach((x) => { + shuffleIntervals.append(_(x.title)); + }); + const shuffleSwitch = new Adw.SwitchRow({ + title: _('Enabled shuffle'), + subtitle: _('Whether to select random wallpapers'), + }); + const shuffleInterval = new Adw.ComboRow({ + title: _('Enabled shuffle'), + subtitle: _('Whether to select random wallpapers'), + model: shuffleIntervals, + selected: Utils.icon_list.indexOf(settings.get_string('random-interval')), + }); + wp_group.add(shuffleSwitch); + wp_group.add(shuffleInterval); + + const dl_group = new Adw.PreferencesGroup({ + title: _('Downloads'), + /*description: _('Configure downloads'),*/ + }); + settings_page.add(dl_group); + const bgSwitch = new Adw.SwitchRow({ + title: _('Set wallpaper'), + subtitle: _('Whether to set wallpaper automatically'), + }); + dl_group.add(bgSwitch); + const folderOpen = new Adw.ActionRow({ + title: _('Download folder'), + subtitle: _('Open or change wallpaper downloads folder'), + }); + dl_group.add(folderOpen); + const folderSplit = new Adw.SplitButton({ + label: _('Open folder'), + }); + const openBtn = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'folder-pictures-symbolic', + label: _('Open folder'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, + }); + const changeBtn = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'folder-download-symbolic', + label: _('Change folder'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, + }); + /*folderSplit.set_child(openBtn); + folderSplit.set_child(changeBtn);*/ + folderOpen.add_suffix(openBtn); + folderOpen.add_suffix(changeBtn); + + /* not sure how to make this work right just yet */ + const folderDialog = new Gtk.FileDialog({ + accept_label: _('Select'), + modal: true, + title: _('Select new wallpaper download folder'), + }); + + /* // Prepare labels and controls let buildable = new Gtk.Builder(); // GTK4 removes some properties, and builder breaks when it sees them buildable.add_from_file( this.dir.get_path() + '/ui/Settings4.ui' ); - provider.load_from_path(this.dir.get_path() + '/ui/prefs.css'); - Gtk.StyleContext.add_provider_for_display( - Gdk.Display.get_default(), - provider, - Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); + */ + + /* let box = buildable.get_object('prefs_widget'); // fix size of prefs window in GNOME shell 40+ (but super racy, so is unreliable) @@ -90,6 +193,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen let switchEnableShuffle = buildable.get_object('shuffle_enabled_switch'); let entryShuffleMode = buildable.get_object('shuffle_mode_combo'); let carouselFlowBox = (Gtk.get_major_version() == 4) ? buildable.get_object('carouselFlowBox'): null; + */ try { httpSession = new Soup.Session(); @@ -98,7 +202,9 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen catch (e) { log("Error creating httpSession: " + e); } - + + + // check that these are valid (can be edited through dconf-editor) Utils.validate_resolution(settings); Utils.validate_icon(settings, this.path, icon_image); @@ -106,12 +212,11 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // Indicator & notifications settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT); - + /* // add markets to dropdown list (aka a GtkComboText) Utils.icon_list.forEach((iconname, index) => { iconEntry.append(iconname, iconname); }); - // user selectable indicator icons settings.bind('icon-name', iconEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::icon-name', () => { @@ -119,19 +224,22 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen }); iconEntry.set_active_id(settings.get_string('icon-name')); + */ // connect switches to settings changes settings.bind('set-background', bgSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); + /* settings.bind('debug-logging', debugSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('revert-to-current-image', revertSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('override-unsafe-wayland', unsafeSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('random-interval', randomIntervalEntry, 'value', Gio.SettingsBindFlags.DEFAULT); settings.bind('always-export-bing-json', switchAlwaysExport, 'active', Gio.SettingsBindFlags.DEFAULT); + */ // button opens Nautilus at our image folder - folderOpenBtn.connect('clicked', (widget) => { + openBtn.connect('clicked', (widget) => { Utils.openImageFolder(settings); }); - + /* // we populate the tab (gtk4+, gnome 40+), this was previously a button to open a new window in gtk3 carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel @@ -146,7 +254,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen //download folder fileChooserBtn.set_label(Utils.getWallpaperDir(settings)); - + fileChooserBtn.connect('clicked', (widget) => { let parent = widget.get_root(); let curWallpaperDir = Gio.File.new_for_path(Utils.getWallpaperDir(settings)); @@ -166,7 +274,6 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen Utils.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), fileURI); Utils.setWallpaperDir(settings, fileURI); }); - // in Gtk 4 instead we use a DropDown, but we need to treat it a bit special let market_grid = buildable.get_object('market_grid'); marketEntry = Gtk.DropDown.new_from_strings(Utils.marketName); @@ -196,14 +303,13 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen settings.connect('changed::resolution', () => { Utils.validate_resolution(settings); }); + */ // shuffle modes - settings.bind('random-mode-enabled', switchEnableShuffle, 'active', Gio.SettingsBindFlags.DEFAULT); - Utils.randomIntervals.forEach((x) => { - entryShuffleMode.append(x.value, _(x.title)); - }); - settings.bind('random-interval-mode', entryShuffleMode, 'active_id', Gio.SettingsBindFlags.DEFAULT); + settings.bind('random-mode-enabled', shuffleSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); + /*settings.bind('random-interval-mode', entryShuffleMode, 'active_id', Gio.SettingsBindFlags.DEFAULT);*/ + /* // selected image can no longer be changed through a dropdown (didn't scale) settings.bind('selected-image', historyEntry, 'label', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::selected-image', () => { @@ -232,16 +338,17 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen Utils.set_blur_preset(settings, Utils.PRESET_SLIGHT_BLUR); }); + */ + // fetch + /* if (httpSession) Utils.fetch_change_log(this.metadata.version.toString(), change_log, httpSession); + */ - const page = new Adw.PreferencesPage(); - const group = new Adw.PreferencesGroup(); - - group.add(box); + /*group.add(box); page.add(group); - window.add(page); + window.add(page);*/ } } From e168a1836b367d8ecf0c126865e06cf1f1480739 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 11 Mar 2024 17:01:01 +1000 Subject: [PATCH 04/25] fix nonfunctional trash button, too rapid shuffles --- extension.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extension.js b/extension.js index e286d0f9..e4ae6ab6 100644 --- a/extension.js +++ b/extension.js @@ -589,7 +589,7 @@ class BingWallpaperIndicator extends Button { log('trash image '+this.imageURL+' status was '+this.hidden_status); this.hidden_status = !this.hidden_status; Utils.setImageHiddenStatus(this._settings, [this.imageURL], this.hidden_status); - this._setTrashIcon(this.hidden_status?ICON_UNTRASH_BUTTON:ICON_TRASH_BUTTON); + this._setTrashIcon(this.hidden_status?this.ICON_UNTRASH_BUTTON:this.ICON_TRASH_BUTTON); } _setFavouriteIcon(icon_name) { @@ -715,7 +715,7 @@ class BingWallpaperIndicator extends Button { if (seconds == null) { let diff = -Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000); log('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff); - if (diff > 0) { + if (diff > 30) { // on occasions the above will be 1 second seconds = diff; // if not specified, we should maintain the existing shuffle timeout (i.e. we just restored from saved state) } else if (this._settings.get_string('random-interval-mode') != 'custom') { @@ -842,6 +842,7 @@ class BingWallpaperIndicator extends Button { // special values, 'current' is most recent (default mode), 'random' picks one at random, anything else should be filename if (force_shuffle) { + log('forcing shuffle of image') image = this._shuffleImage(); if (this._settings.get_boolean('random-mode-enabled')) this._restartShuffleTimeout(); From 5802c7bc9db2a8b8a42885513ca9bb3ae7dc925b Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 11 Mar 2024 21:53:24 +1000 Subject: [PATCH 05/25] start migration of prefs to .ui file --- extension.js | 1 + prefs.js | 248 ++++++++++++++++++++++++++++++------------------- ui/prefsadw.ui | 110 ++++++++++++++++++++++ utils.js | 15 ++- 4 files changed, 276 insertions(+), 98 deletions(-) create mode 100644 ui/prefsadw.ui diff --git a/extension.js b/extension.js index e4ae6ab6..81e67dd3 100644 --- a/extension.js +++ b/extension.js @@ -561,6 +561,7 @@ class BingWallpaperIndicator extends Button { _randomModeChanged() { let randomEnabled = this._settings.get_boolean('random-mode-enabled'); + Utils.validate_interval(this._settings); [this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUHD /*, this.toggleShuffleOnlyUnhidden*/] .forEach( x => { x.setSensitive(randomEnabled); diff --git a/prefs.js b/prefs.js index 913f9e67..98b94c04 100644 --- a/prefs.js +++ b/prefs.js @@ -21,14 +21,16 @@ const BingImageURL = Utils.BingImageURL; var DESKTOP_SCHEMA = 'org.gnome.desktop.background'; -var PREFS_DEFAULT_WIDTH = 950; -var PREFS_DEFAULT_HEIGHT = 950; +var PREFS_DEFAULT_WIDTH = 700; +var PREFS_DEFAULT_HEIGHT = 750; export default class BingWallpaperExtensionPreferences extends ExtensionPreferences { fillPreferencesWindow(window) { // formally globals let settings = this.getSettings(Utils.BING_SCHEMA); - let desktop_settings = this.getSettings(Utils.DESKTOP_SCHEMA); + //let desktop_settings = this.getSettings(Utils.DESKTOP_SCHEMA); + + window.set_default_size(PREFS_DEFAULT_WIDTH, PREFS_DEFAULT_HEIGHT); let icon_image = null; let provider = new Gtk.CssProvider(); @@ -45,80 +47,48 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen if (settings.get_boolean('debug-logging')) console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal } + + let buildable = new Gtk.Builder(); + // GTK4 removes some properties, and builder breaks when it sees them + buildable.add_from_file( this.dir.get_path() + '/ui/prefsadw.ui' ); - const settings_page = new Adw.PreferencesPage({ - title: _('Settings'), - icon_name: 'dialog-information-symbolic', - }); + const settings_page = buildable.get_object('settings_page'); + window.add(settings_page); - const ui_group = new Adw.PreferencesGroup({ - title: _('Indicator'), - /*description: _('Configure the indicator of the extension'),*/ - }); - settings_page.add(ui_group); - const hideSwitch = new Adw.SwitchRow({ - title: _('Hide Indicator'), - subtitle: _('Whether to hide the panel indicator'), - }); - const notifySwitch = new Adw.SwitchRow({ - title: _('Desktop notifications'), - subtitle: _('Whether to enable notifications on new images'), - }); - ui_group.add(hideSwitch); - ui_group.add(notifySwitch); - /*const list = new Gtk.StringList(); + + const ui_group = buildable.get_object('ui_group'); + const hideSwitch = buildable.get_object('hideSwitch'); + const notifySwitch = buildable.get_object('notifySwitch'); + const iconEntry = buildable.get_object('iconEntry'); + + const list = new Gtk.StringList(); Utils.icon_list.forEach((iconname, index) => { list.append(iconname, iconname); - });*/ - const iconEntry = new Adw.ComboRow({ - title: _('Desktop notifications'), - subtitle: _('Whether to enable notifications on new images'), - model: Gtk.StringList.new(Utils.icon_list), - selected: Utils.icon_list.indexOf(settings.get_string('icon-name')), }); - ui_group.add(iconEntry); + + iconEntry.set_model(list); + iconEntry.set_selected(Utils.icon_list.indexOf(settings.get_string('icon-name'))); + + const wp_group = buildable.get_object('wp_group'); + //settings_page.add(wp_group); - const wp_group = new Adw.PreferencesGroup({ - title: _('Wallpaper'), - /*description: _('Configure downloads'),*/ - }); - settings_page.add(wp_group); const shuffleIntervals = new Gtk.StringList; Utils.randomIntervals.forEach((x) => { shuffleIntervals.append(_(x.title)); }); - const shuffleSwitch = new Adw.SwitchRow({ - title: _('Enabled shuffle'), - subtitle: _('Whether to select random wallpapers'), - }); - const shuffleInterval = new Adw.ComboRow({ - title: _('Enabled shuffle'), - subtitle: _('Whether to select random wallpapers'), - model: shuffleIntervals, - selected: Utils.icon_list.indexOf(settings.get_string('random-interval')), - }); - wp_group.add(shuffleSwitch); - wp_group.add(shuffleInterval); - const dl_group = new Adw.PreferencesGroup({ - title: _('Downloads'), - /*description: _('Configure downloads'),*/ - }); - settings_page.add(dl_group); - const bgSwitch = new Adw.SwitchRow({ - title: _('Set wallpaper'), - subtitle: _('Whether to set wallpaper automatically'), - }); - dl_group.add(bgSwitch); - const folderOpen = new Adw.ActionRow({ - title: _('Download folder'), - subtitle: _('Open or change wallpaper downloads folder'), - }); - dl_group.add(folderOpen); - const folderSplit = new Adw.SplitButton({ - label: _('Open folder'), - }); + const bgSwitch = buildable.get_object('bgSwitch'); + const shuffleSwitch = buildable.get_object('shuffleSwitch'); + const shuffleInterval = buildable.get_object('shuffleInterval'); + shuffleInterval.set_model(shuffleIntervals); + shuffleInterval.set_selected(Utils.randomIntervals.map( e => e.value).indexOf(settings.get_string('random-interval-mode'))); + + const dl_group = buildable.get_object('dl_group'); + //settings_page.add(dl_group); + + const folderRow = buildable.get_object('folderRow'); + const openBtn = new Gtk.Button( { child: new Adw.ButtonContent({ icon_name: 'folder-pictures-symbolic', @@ -135,17 +105,108 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen valign: Gtk.Align.CENTER, halign: Gtk.Align.CENTER, }); - /*folderSplit.set_child(openBtn); - folderSplit.set_child(changeBtn);*/ - folderOpen.add_suffix(openBtn); - folderOpen.add_suffix(changeBtn); + + folderRow.add_suffix(openBtn); + folderRow.add_suffix(changeBtn); /* not sure how to make this work right just yet */ - const folderDialog = new Gtk.FileDialog({ - accept_label: _('Select'), - modal: true, - title: _('Select new wallpaper download folder'), + const folderDialog = buildable.get_object('folderDialog'); + + const lockscreen_page = new Adw.PreferencesPage({ + title: _('Lock screen'), + icon_name: 'applications-system-symbolic', + }); + window.add(lockscreen_page); + const ls_group = new Adw.PreferencesGroup({ + title: _('Lockscreen blur'), + /*description: _('Configure the indicator of the extension'),*/ + }); + lockscreen_page.add(ls_group); + const overrideSwitch = new Adw.SwitchRow({ + title: _('Dynamic lockscreen blur'), + subtitle: _('Whether to enable dynamic blur mode on lock screen'), + }); + const strengthEntry = new Adw.SpinRow({ + title: _('Blur strength'), + subtitle: _('Blur strength when login prompt is not visible'), + adjustment: new Gtk.Adjustment({ + lower: 0, + upper: 50, + value: settings.get_int('lockscreen-blur-strength'), + page_increment: 10, + step_increment: 1, + }), + }); + const brightnessEntry = new Adw.SpinRow({ + title: _('Wallpaper brightness'), + subtitle: _('Dim wallpaper when login prompt is not visible'), + adjustment: new Gtk.Adjustment({ + lower: 0, + upper: 50, + value: settings.get_int('lockscreen-blur-brightness'), + page_increment: 10, + step_increment: 1, + }), + }); + + const blurPresets = new Adw.ActionRow({ + title: _('Presets'), + /*subtitle: _('Open or change wallpaper downloads folder'),*/ + }); + + const defaultBtn = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'emblem-default-symbolic', + label: _('Default'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, }); + const noBlurBtn = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'emblem-default-symbolic', + label: _('No blur, slight dim'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, + }); + const slightBlurBtn = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'emblem-default-symbolic', + label: _('Slight blur & dim'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, + }); + + blurPresets.add_suffix(defaultBtn); + blurPresets.add_suffix(noBlurBtn); + blurPresets.add_suffix(slightBlurBtn); + + ls_group.add(overrideSwitch); + ls_group.add(strengthEntry); + ls_group.add(brightnessEntry); + ls_group.add(blurPresets); + + const gallery_page = new Adw.PreferencesPage({ + title: _('Gallery'), + icon_name: 'document-open-recent-symbolic', + }); + window.add(gallery_page); + + const debug_page = new Adw.PreferencesPage({ + title: _('Debug'), + icon_name: 'preferences-other-symbolic', + }); + window.add(debug_page); + + const about_page = new Adw.PreferencesPage({ + title: _('About'), + icon_name: 'user-info-symbolic', + }); + window.add(about_page); + + /* // Prepare labels and controls @@ -208,6 +269,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // check that these are valid (can be edited through dconf-editor) Utils.validate_resolution(settings); Utils.validate_icon(settings, this.path, icon_image); + Utils.validate_interval(settings); // Indicator & notifications settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); @@ -217,14 +279,21 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen Utils.icon_list.forEach((iconname, index) => { iconEntry.append(iconname, iconname); }); + */ // user selectable indicator icons - settings.bind('icon-name', iconEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); + // settings.bind('icon-name', iconEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::icon-name', () => { Utils.validate_icon(settings, this.path, icon_image); + /*iconEntry.set_selected(Utils.indexOf(settings.get_string('icon-name')));*/ }); - iconEntry.set_active_id(settings.get_string('icon-name')); + + /* + iconEntry.connect('changed', (widget) => { + settings.set_string('icon-name', Utils.icon_list[iconEntry.active_id]); + });*/ + + //iconEntry.set_active_id(settings.get_string('icon-name')); - */ // connect switches to settings changes settings.bind('set-background', bgSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); /* @@ -309,37 +378,28 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen settings.bind('random-mode-enabled', shuffleSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); /*settings.bind('random-interval-mode', entryShuffleMode, 'active_id', Gio.SettingsBindFlags.DEFAULT);*/ - /* - // selected image can no longer be changed through a dropdown (didn't scale) - settings.bind('selected-image', historyEntry, 'label', Gio.SettingsBindFlags.DEFAULT); - settings.connect('changed::selected-image', () => { - Utils.validate_imagename(settings); + settings.connect('changed::random-interval-mode', () => { + shuffleInterval.set_selected(Utils.randomIntervals.map( e => e.value).indexOf(settings.get_string('random-interval-mode'))); }); - - // background styles (e.g. zoom or span) - Utils.backgroundStyle.forEach((style) => { - styleEntry.append(style, style); - }); - desktop_settings.bind('picture-options', styleEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); - + + // GDM3 lockscreen blur override settings.bind('override-lockscreen-blur', overrideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('lockscreen-blur-strength', strengthEntry, 'value', Gio.SettingsBindFlags.DEFAULT); settings.bind('lockscreen-blur-brightness', brightnessEntry, 'value', Gio.SettingsBindFlags.DEFAULT); + // add a couple of preset buttons - buttonGDMdefault.connect('clicked', (widget) => { + defaultBtn.connect('clicked', (widget) => { Utils.set_blur_preset(settings, Utils.PRESET_GNOME_DEFAULT); }); - buttonnoblur.connect('clicked', (widget) => { + noBlurBtn.connect('clicked', (widget) => { Utils.set_blur_preset(settings, Utils.PRESET_NO_BLUR); }); - buttonslightblur.connect('clicked', (widget) => { + slightBlurBtn.connect('clicked', (widget) => { Utils.set_blur_preset(settings, Utils.PRESET_SLIGHT_BLUR); }); - - */ - + // fetch /* if (httpSession) diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui new file mode 100644 index 00000000..970e61a4 --- /dev/null +++ b/ui/prefsadw.ui @@ -0,0 +1,110 @@ + + + + + + + emblem-photos-symbolic + Members + + + Indicator + + + Hide Indicator + Whether to hide the panel indicator + + + + + Desktop notifications + Enable notifications on new images + + + + + Indicator icon + Select from alternate tray icons + + + + + + + Wallpaper + + + Set wallpaper + Whether to set wallpaper automatically + + + + + Enabled shuffle + Randomly select wallpaper from collection + + + + + Shuffle interval + How frequently to shuffle wallpapers + + + + + + + Downloads + + + Download folder + Open or change wallpaper downloads folder + + + + + + + Change folder + true + Select new wallpaper download folder + + + + + + + + + Change folder + folder-download-symbolic + + + + --> + \ No newline at end of file diff --git a/utils.js b/utils.js index 6f2ff22c..ac0ac2ed 100644 --- a/utils.js +++ b/utils.js @@ -12,9 +12,9 @@ import GLib from 'gi://GLib'; import Soup from 'gi://Soup'; import GdkPixbuf from 'gi://GdkPixbuf'; -export var PRESET_GNOME_DEFAULT = { blur: 60, dim: 55 }; // as at GNOME 40 -export var PRESET_NO_BLUR = { blur: 0, dim: 60 }; -export var PRESET_SLIGHT_BLUR = { blur: 2, dim: 60 }; +export var PRESET_GNOME_DEFAULT = { blur: 45, dim: 65 }; // as at GNOME 40 +export var PRESET_NO_BLUR = { blur: 0, dim: 65 }; +export var PRESET_SLIGHT_BLUR = { blur: 2, dim: 30 }; export var BING_SCHEMA = 'org.gnome.shell.extensions.bingwallpaper'; export var DESKTOP_SCHEMA = 'org.gnome.desktop.background'; @@ -52,7 +52,8 @@ export var backgroundStyle = ['none', 'wallpaper', 'centered', 'scaled', 'stretc export var randomIntervals = [ {value: 'hourly', title: ('on the hour')}, {value: 'daily', title: ('every day at midnight')}, - {value: 'weekly', title: ('every Sunday at midnight')} ]; + {value: 'weekly', title: ('Sunday at midnight')}, + { value: 'custom', title: ('User defined interval')} ]; export var BingImageURL = 'https://www.bing.com/HPImageArchive.aspx'; export var BingParams = { format: 'js', idx: '0' , n: '8' , mbl: '1' , mkt: '' } ; @@ -78,6 +79,12 @@ export function validate_resolution(settings) { settings.reset('resolution'); } +export function validate_interval(settings) { + let index = randomIntervals.map( e => e.value).indexOf(settings.get_string('random-interval-mode')); + if (index == -1) // if not a valid interval + settings.reset('random-interval-mode'); +} + // FIXME: needs work export function validate_imagename(settings) { let filename = settings.get_string('selected-image'); From e5bf2094ab1515e656cd9597a1e8baf7a5c2d0a7 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Sun, 17 Mar 2024 03:44:38 +1000 Subject: [PATCH 06/25] mostly complete adw prefs --- prefs.js | 151 ++++++++++++----------- ui/prefsadw.ui | 324 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 391 insertions(+), 84 deletions(-) diff --git a/prefs.js b/prefs.js index 98b94c04..ba57221a 100644 --- a/prefs.js +++ b/prefs.js @@ -111,16 +111,20 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen /* not sure how to make this work right just yet */ const folderDialog = buildable.get_object('folderDialog'); + const lockscreen_page = buildable.get_object('lockscreen_page'); - const lockscreen_page = new Adw.PreferencesPage({ + /*const lockscreen_page = new Adw.PreferencesPage({ title: _('Lock screen'), icon_name: 'applications-system-symbolic', - }); + });*/ window.add(lockscreen_page); + const ls_group = buildable.get_object('ls_group'); + /* const ls_group = new Adw.PreferencesGroup({ title: _('Lockscreen blur'), - /*description: _('Configure the indicator of the extension'),*/ }); + */ + /* lockscreen_page.add(ls_group); const overrideSwitch = new Adw.SwitchRow({ title: _('Dynamic lockscreen blur'), @@ -148,11 +152,20 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen step_increment: 1, }), }); - - const blurPresets = new Adw.ActionRow({ + */ + /*const blurPresets = new Adw.ActionRow({ title: _('Presets'), - /*subtitle: _('Open or change wallpaper downloads folder'),*/ - }); + });*/ + + const overrideSwitch = buildable.get_object('overrideSwitch'); + const blurPresets = buildable.get_object('blurPresets'); + const strengthEntry = buildable.get_object('strengthEntry'); + const brightnessEntry = buildable.get_object('brightnessEntry'); + const blurAdjustment = buildable.get_object('blurAdjustment'); + const brightnessAdjustment = buildable.get_object('brightnessAdjustment'); + + blurAdjustment.set_value(settings.get_int('lockscreen-blur-strength')); + brightnessAdjustment.set_value(settings.get_int('lockscreen-blur-brightness')); const defaultBtn = new Gtk.Button( { child: new Adw.ButtonContent({ @@ -188,24 +201,48 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen ls_group.add(brightnessEntry); ls_group.add(blurPresets); - const gallery_page = new Adw.PreferencesPage({ - title: _('Gallery'), - icon_name: 'document-open-recent-symbolic', - }); + const gallery_page = buildable.get_object('gallery_page'); window.add(gallery_page); - const debug_page = new Adw.PreferencesPage({ - title: _('Debug'), - icon_name: 'preferences-other-symbolic', - }); + const carouselFlowBox = buildable.get_object('carouselFlowBox'); + + const debug_page = buildable.get_object('debug_page'); window.add(debug_page); - const about_page = new Adw.PreferencesPage({ - title: _('About'), - icon_name: 'user-info-symbolic', + const randomIntervalEntry = buildable.get_object('entry_random_interval'); + randomIntervalEntry.set_value(settings.get_int('random-interval')); + const resolutionEntry = buildable.get_object('resolutionEntry'); + const debugSwitch = buildable.get_object('debug_switch'); + const revertSwitch = buildable.get_object('revert_switch'); + const always_export_switch = buildable.get_object('always_export_switch'); + + const buttonImportData = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'document-send-symbolic', + label: _('Import'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, + }); + const buttonExportData = new Gtk.Button( { + child: new Adw.ButtonContent({ + icon_name: 'document-save-symbolic', + label: _('Export'), + },), + valign: Gtk.Align.CENTER, + halign: Gtk.Align.CENTER, }); + const json_actionrow = buildable.get_object('json_actionrow'); + json_actionrow.add_suffix(buttonImportData); + json_actionrow.add_suffix(buttonExportData); + + const about_page = buildable.get_object('about_page'); + const version_button = buildable.get_object('version_button'); window.add(about_page); + version_button.set_label(this.metadata.version.toString()); + + const change_log = buildable.get_object('change_log'); /* @@ -239,9 +276,10 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen icon_image = buildable.get_object('icon_image'); let overrideSwitch = buildable.get_object('lockscreen_override'); let strengthEntry = buildable.get_object('entry_strength'); - let brightnessEntry = buildable.get_object('entry_brightness'); - let debugSwitch = buildable.get_object('debug_switch'); - let revertSwitch = buildable.get_object('revert_switch'); + let brightnessEntry = buildable.get_object('entry_brightness');*/ + + + /* let unsafeSwitch = buildable.get_object('unsafe_switch'); let randomIntervalEntry = buildable.get_object('entry_random_interval'); let change_log = buildable.get_object('change_log'); @@ -296,22 +334,22 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // connect switches to settings changes settings.bind('set-background', bgSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); - /* + settings.bind('debug-logging', debugSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('revert-to-current-image', revertSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); - settings.bind('override-unsafe-wayland', unsafeSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); + //settings.bind('override-unsafe-wayland', unsafeSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('random-interval', randomIntervalEntry, 'value', Gio.SettingsBindFlags.DEFAULT); - settings.bind('always-export-bing-json', switchAlwaysExport, 'active', Gio.SettingsBindFlags.DEFAULT); + settings.bind('always-export-bing-json', always_export_switch, 'active', Gio.SettingsBindFlags.DEFAULT); - */ // button opens Nautilus at our image folder openBtn.connect('clicked', (widget) => { Utils.openImageFolder(settings); }); - /* + // we populate the tab (gtk4+, gnome 40+), this was previously a button to open a new window in gtk3 - carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel - + // disabled at the moment, needs testing + //carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel + // this is intended for migrating image folders between computers (or even sharing) or backups // we export the Bing JSON data to the image directory, so this folder becomes portable buttonImportData.connect('clicked', () => { @@ -321,58 +359,36 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen Utils.exportBingJSON(settings); }); - //download folder - fileChooserBtn.set_label(Utils.getWallpaperDir(settings)); - - fileChooserBtn.connect('clicked', (widget) => { - let parent = widget.get_root(); - let curWallpaperDir = Gio.File.new_for_path(Utils.getWallpaperDir(settings)); - fileChooser.set_current_folder(curWallpaperDir.get_parent()); - fileChooser.set_action(Gtk.FileChooserAction.SELECT_FOLDER); - fileChooser.set_transient_for(parent); - fileChooser.set_accept_label(_('Select folder')); - fileChooser.show(); - }); - - fileChooser.connect('response', (widget, response) => { - if (response !== Gtk.ResponseType.ACCEPT) { - return; - } - let fileURI = fileChooser.get_file().get_path().replace('file://', ''); - fileChooserBtn.set_label(fileURI); - Utils.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), fileURI); - Utils.setWallpaperDir(settings, fileURI); - }); - // in Gtk 4 instead we use a DropDown, but we need to treat it a bit special - let market_grid = buildable.get_object('market_grid'); - marketEntry = Gtk.DropDown.new_from_strings(Utils.marketName); - marketEntry.set_selected(Utils.markets.indexOf(settings.get_string('market'))); - market_grid.attach(marketEntry, 1, 0, 1, 2); - marketEntry.connect('notify::selected-item', () => { - let id = marketEntry.get_selected(); - settings.set_string('market', Utils.markets[id]); + const dirChooser = new Gtk.FileDialog( { + accept_label: "Select", + modal: true, + title: _("Select wallpaper download folder"), }); - settings.connect('changed::market', () => { - marketEntry.set_selected(Utils.markets.indexOf(settings.get_string('market'))); - }); + changeBtn.connect('clicked', (widget) => { + dirChooser.set_initial_folder(Gio.File.new_for_path(Utils.getWallpaperDir(settings))); + dirChooser.select_folder(window, null, (self, res) => { + let new_path = self.select_folder_finish(res).get_uri().replace('file://', ''); + log(new_path); + Utils.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), new_path); + Utils.setWallpaperDir(settings, new_path); + }); - settings.connect('changed::download-folder', () => { - fileChooserBtn.set_label(Utils.getWallpaperDir(settings)); }); - // Resolution + const resolutionModel = new Gtk.StringList(); Utils.resolutions.forEach((res) => { // add res to dropdown list (aka a GtkComboText) - resolutionEntry.append(res, res); + resolutionModel.append(res, res); }); + resolutionEntry.set_model(resolutionModel); settings.bind('resolution', resolutionEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::resolution', () => { Utils.validate_resolution(settings); }); - */ + // shuffle modes settings.bind('random-mode-enabled', shuffleSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); @@ -401,10 +417,9 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen }); // fetch - /* + if (httpSession) Utils.fetch_change_log(this.metadata.version.toString(), change_log, httpSession); - */ /*group.add(box); page.add(group); diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui index 970e61a4..8865c003 100644 --- a/ui/prefsadw.ui +++ b/ui/prefsadw.ui @@ -83,28 +83,320 @@ Bing Wallpaper GNOME extension by: Michael Carroll - - Change folder - true - Select new wallpaper download folder + + applications-system-symbolic + Lock screen + + + Lockscreen blur + + + Dynamic lockscreen blur + Whether to enable dynamic blur mode on lock screen + + + + + Blur strength + Blur strength when login prompt is not visible + + + 0 + 50 + 10 + 1 + + + + + + + Wallpaper brightness + Dim wallpaper when login prompt is not visible + + + 0 + 100 + 10 + 1 + + + + + + + + + + + + Presets + + + + + + + document-open-recent-symbolic + Gallery + + + 0 + 500 + 0 + 0 + + + 0 + center + 1 + 2 + 2 + 2 + 2 + + + + - + + + + + Always export Bing data + Export Bing JSON when image data changes + + + + + Bing JSON data + Custom shuffle interval when enabled + + - + + user-info-symbolic + About + + + + + + 128 + presentation + + + + + + True + center + Bing Wallpaper + + + + + + 0 + New wallpaper images everyday from Bing + center + 1 + + + + + + True + center + Maintained by Michael Carroll + + + + - - Change folder - folder-download-symbolic + + + + Version + + + center + True + + + + + + + + Release notes + + + True + left + + + + + + + + + + vertical + + + + + + GNOME extensions page + True + True + extension_page_linkbutton + + + https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/ + + + + + adw-external-link-symbolic + presentation + + + + + + + Source code + True + True + source_code_linkbutton + + + https://github.com/neffo/ + + + + + adw-external-link-symbolic + presentation + + + + + + + Report an issue + True + True + bug_report_linkbutton + + + https://github.com/neffo/bing-wallpaper-gnome-extension/issues + + + + + adw-external-link-symbolic + presentation + + + + + + + Contributors + True + True + contributors_linkbutton + + + https://github.com/neffo/bing-wallpaper-gnome-extension/graphs/contributors + + + + + adw-external-link-symbolic + presentation + + + + + + + License + + + True + left + This extension is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + + + + + + + + - --> - \ No newline at end of file + + Change folder + true + Select new wallpaper download folder + + + + \ No newline at end of file From 5d7c03adbec486e20073b5dc79bb45f1e7f0a21e Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 18 Mar 2024 18:11:38 +1000 Subject: [PATCH 07/25] fix gallery --- prefs.js | 121 +++---------------------------------------------- ui/prefsadw.ui | 24 ++++++---- 2 files changed, 21 insertions(+), 124 deletions(-) diff --git a/prefs.js b/prefs.js index ba57221a..d540e95a 100644 --- a/prefs.js +++ b/prefs.js @@ -21,7 +21,7 @@ const BingImageURL = Utils.BingImageURL; var DESKTOP_SCHEMA = 'org.gnome.desktop.background'; -var PREFS_DEFAULT_WIDTH = 700; +var PREFS_DEFAULT_WIDTH = 750; var PREFS_DEFAULT_HEIGHT = 750; export default class BingWallpaperExtensionPreferences extends ExtensionPreferences { @@ -113,50 +113,8 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen const folderDialog = buildable.get_object('folderDialog'); const lockscreen_page = buildable.get_object('lockscreen_page'); - /*const lockscreen_page = new Adw.PreferencesPage({ - title: _('Lock screen'), - icon_name: 'applications-system-symbolic', - });*/ window.add(lockscreen_page); const ls_group = buildable.get_object('ls_group'); - /* - const ls_group = new Adw.PreferencesGroup({ - title: _('Lockscreen blur'), - }); - */ - /* - lockscreen_page.add(ls_group); - const overrideSwitch = new Adw.SwitchRow({ - title: _('Dynamic lockscreen blur'), - subtitle: _('Whether to enable dynamic blur mode on lock screen'), - }); - const strengthEntry = new Adw.SpinRow({ - title: _('Blur strength'), - subtitle: _('Blur strength when login prompt is not visible'), - adjustment: new Gtk.Adjustment({ - lower: 0, - upper: 50, - value: settings.get_int('lockscreen-blur-strength'), - page_increment: 10, - step_increment: 1, - }), - }); - const brightnessEntry = new Adw.SpinRow({ - title: _('Wallpaper brightness'), - subtitle: _('Dim wallpaper when login prompt is not visible'), - adjustment: new Gtk.Adjustment({ - lower: 0, - upper: 50, - value: settings.get_int('lockscreen-blur-brightness'), - page_increment: 10, - step_increment: 1, - }), - }); - */ - /*const blurPresets = new Adw.ActionRow({ - title: _('Presets'), - });*/ - const overrideSwitch = buildable.get_object('overrideSwitch'); const blurPresets = buildable.get_object('blurPresets'); const strengthEntry = buildable.get_object('strengthEntry'); @@ -204,8 +162,11 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen const gallery_page = buildable.get_object('gallery_page'); window.add(gallery_page); + const carouselViewPort = buildable.get_object('carouselViewPort'); const carouselFlowBox = buildable.get_object('carouselFlowBox'); + //carouselViewPort.set_size(500,500); + const debug_page = buildable.get_object('debug_page'); window.add(debug_page); @@ -243,57 +204,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen version_button.set_label(this.metadata.version.toString()); const change_log = buildable.get_object('change_log'); - - - /* - // Prepare labels and controls - let buildable = new Gtk.Builder(); - // GTK4 removes some properties, and builder breaks when it sees them - buildable.add_from_file( this.dir.get_path() + '/ui/Settings4.ui' ); - */ - - - /* - let box = buildable.get_object('prefs_widget'); - - // fix size of prefs window in GNOME shell 40+ (but super racy, so is unreliable) - - buildable.get_object('extension_version').set_text(this.metadata.version.toString()); - buildable.get_object('extension_name').set_text(this.metadata.name.toString()); - - // assign variables to UI objects we've loaded - let hideSwitch = buildable.get_object('hide'); - let iconEntry = buildable.get_object('icon'); - let notifySwitch = buildable.get_object('notify'); - let bgSwitch = buildable.get_object('background'); - let styleEntry = buildable.get_object('background_style'); - let fileChooserBtn = buildable.get_object('download_folder'); - let fileChooser = buildable.get_object('file_chooser'); // this should only exist on Gtk4 - let folderOpenBtn = buildable.get_object('button_open_download_folder'); - let marketEntry = buildable.get_object('market'); - let resolutionEntry = buildable.get_object('resolution'); - let historyEntry = buildable.get_object('history'); - icon_image = buildable.get_object('icon_image'); - let overrideSwitch = buildable.get_object('lockscreen_override'); - let strengthEntry = buildable.get_object('entry_strength'); - let brightnessEntry = buildable.get_object('entry_brightness');*/ - - - /* - let unsafeSwitch = buildable.get_object('unsafe_switch'); - let randomIntervalEntry = buildable.get_object('entry_random_interval'); - let change_log = buildable.get_object('change_log'); - let buttonGDMdefault = buildable.get_object('button_default_gnome'); - let buttonnoblur = buildable.get_object('button_no_blur'); - let buttonslightblur = buildable.get_object('button_slight_blur'); - let buttonImportData = buildable.get_object('button_json_import'); - let buttonExportData = buildable.get_object('button_json_export'); - let switchAlwaysExport = buildable.get_object('always_export_switch'); - let switchEnableShuffle = buildable.get_object('shuffle_enabled_switch'); - let entryShuffleMode = buildable.get_object('shuffle_mode_combo'); - let carouselFlowBox = (Gtk.get_major_version() == 4) ? buildable.get_object('carouselFlowBox'): null; - */ - + try { httpSession = new Soup.Session(); httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + Config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + this.metadata.version; @@ -312,24 +223,11 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // Indicator & notifications settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT); - /* - // add markets to dropdown list (aka a GtkComboText) - Utils.icon_list.forEach((iconname, index) => { - iconEntry.append(iconname, iconname); - }); - */ - // user selectable indicator icons - // settings.bind('icon-name', iconEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::icon-name', () => { Utils.validate_icon(settings, this.path, icon_image); /*iconEntry.set_selected(Utils.indexOf(settings.get_string('icon-name')));*/ }); - - /* - iconEntry.connect('changed', (widget) => { - settings.set_string('icon-name', Utils.icon_list[iconEntry.active_id]); - });*/ - + //iconEntry.set_active_id(settings.get_string('icon-name')); // connect switches to settings changes @@ -348,7 +246,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // we populate the tab (gtk4+, gnome 40+), this was previously a button to open a new window in gtk3 // disabled at the moment, needs testing - //carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel + carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel // this is intended for migrating image folders between computers (or even sharing) or backups // we export the Bing JSON data to the image directory, so this folder becomes portable @@ -420,10 +318,5 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen if (httpSession) Utils.fetch_change_log(this.metadata.version.toString(), change_log, httpSession); - - /*group.add(box); - page.add(group); - - window.add(page);*/ } } diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui index 8865c003..647b6580 100644 --- a/ui/prefsadw.ui +++ b/ui/prefsadw.ui @@ -140,21 +140,25 @@ Bing Wallpaper GNOME extension by: Michael Carroll document-open-recent-symbolic Gallery - + 0 500 0 0 - - 0 - center - 1 - 2 - 2 - 2 - 2 - + + + + 0 + center + 1 + 2 + 2 + 2 + 2 + + + From e2ee87b6a1510eb5b64195b2dbd28dd199a94e4a Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 18 Mar 2024 23:56:19 +1000 Subject: [PATCH 08/25] purge images by default on delete --- carousel.js | 3 +- locale/BingWallpaper.pot | 38 ++++++++++++------ prefs.js | 2 + schemas/gschemas.compiled | Bin 2432 -> 2432 bytes ...shell.extensions.bingwallpaper.gschema.xml | 2 +- ui/carousel4.ui | 2 +- ui/prefsadw.ui | 6 +++ utils.js | 2 + 8 files changed, 39 insertions(+), 16 deletions(-) diff --git a/carousel.js b/carousel.js index c673b142..3acb484c 100644 --- a/carousel.js +++ b/carousel.js @@ -107,7 +107,7 @@ export default class Carousel { deleteButton.connect('clicked', (widget) => { this.log('Delete requested for '+filename); Utils.deleteImage(filename); - //Utils.cleanupImageList(this.settings); // hide image instead + Utils.cleanupImageList(this.settings); // hide image instead Utils.hideImage(this.settings, [image]); widget.get_parent().get_parent().set_visible(false); // bit of a hack if (this.callbackfunc) @@ -169,6 +169,7 @@ export default class Carousel { this.flowBox.remove(widget.get_parent()); this.flowBox.set_max_children_per_line(2); this._create_gallery(); + }); let item = buildable.get_object('flowBoxPlaceholder'); diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index f356658d..a051e6e0 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -26,7 +26,7 @@ msgstr "" msgid "Download folder" msgstr "" -#: ui/Settings4.ui.h:8 +#: ui/Settings4.ui.h:8 prefs.js:95 msgid "Open folder" msgstr "" @@ -78,7 +78,7 @@ msgstr "" msgid "Presets" msgstr "" -#: ui/Settings4.ui.h:21 +#: ui/Settings4.ui.h:21 prefs.js:139 msgid "No blur, slight dim" msgstr "" @@ -142,7 +142,7 @@ msgstr "" msgid "Import previously exported JSON data from wallpaper directory" msgstr "" -#: ui/Settings4.ui.h:37 +#: ui/Settings4.ui.h:37 prefs.js:184 msgid "Import" msgstr "" @@ -154,7 +154,7 @@ msgstr "" msgid "Export JSON data to wallpaper dir for backup or data migration" msgstr "" -#: ui/Settings4.ui.h:40 +#: ui/Settings4.ui.h:40 prefs.js:192 msgid "Export" msgstr "" @@ -324,34 +324,46 @@ msgstr "" msgid "Next shuffle" msgstr "" -#: extension.js:801 extension.js:875 +#: extension.js:802 extension.js:877 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:913 +#: extension.js:915 msgid "No wallpaper available" msgstr "" -#: extension.js:914 +#: extension.js:916 msgid "No picture for today." msgstr "" -#: prefs.js:156 -msgid "Select folder" +#: prefs.js:103 +msgid "Change folder" msgstr "" -#: utils.js:127 +#: prefs.js:131 +msgid "Default" +msgstr "" + +#: prefs.js:147 +msgid "Slight blur & dim" +msgstr "" + +#: prefs.js:265 +msgid "Select wallpaper download folder" +msgstr "" + +#: utils.js:134 msgid "Error fetching change log: " msgstr "" -#: utils.js:405 utils.js:408 +#: utils.js:414 utils.js:417 msgid "minutes" msgstr "" -#: utils.js:411 +#: utils.js:420 msgid "days" msgstr "" -#: utils.js:414 +#: utils.js:423 msgid "hours" msgstr "" diff --git a/prefs.js b/prefs.js index d540e95a..2d5fdee4 100644 --- a/prefs.js +++ b/prefs.js @@ -175,6 +175,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen const resolutionEntry = buildable.get_object('resolutionEntry'); const debugSwitch = buildable.get_object('debug_switch'); const revertSwitch = buildable.get_object('revert_switch'); + const trash_purge_switch = buildable.get_object('trash_purge_switch'); const always_export_switch = buildable.get_object('always_export_switch'); const buttonImportData = new Gtk.Button( { @@ -237,6 +238,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen settings.bind('revert-to-current-image', revertSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); //settings.bind('override-unsafe-wayland', unsafeSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('random-interval', randomIntervalEntry, 'value', Gio.SettingsBindFlags.DEFAULT); + settings.bind('trash-deletes-images', trash_purge_switch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('always-export-bing-json', always_export_switch, 'active', Gio.SettingsBindFlags.DEFAULT); // button opens Nautilus at our image folder diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index 77f335cdc4d35f582d719ad2abaf7a9ab30ff7d5..bdd63d2234bd5eb535e55dd7d2fa231a16092d50 100644 GIT binary patch delta 14 VcmZn=ZV=w^frXKA^GB9`762y11qc8D delta 14 VcmZn=ZV=w^frXJ_^GB9`762x`1qT2C diff --git a/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml b/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml index c457c1d0..b01c105c 100644 --- a/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml +++ b/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml @@ -211,7 +211,7 @@ - false + true Trash deletes images or just marks as bad diff --git a/ui/carousel4.ui b/ui/carousel4.ui index 4be8a98d..7fe0fc69 100644 --- a/ui/carousel4.ui +++ b/ui/carousel4.ui @@ -56,7 +56,7 @@ Author: Michael Carroll 320 - 180 + 120 0 1 1 diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui index 647b6580..29cfe6e2 100644 --- a/ui/prefsadw.ui +++ b/ui/prefsadw.ui @@ -181,6 +181,12 @@ Bing Wallpaper GNOME extension by: Michael Carroll Switch to new images when available (unless on random mode) + + + Purge on trash + Trashing an image will remove it from database + + Screen resolution diff --git a/utils.js b/utils.js index ac0ac2ed..21bc5ed2 100644 --- a/utils.js +++ b/utils.js @@ -301,6 +301,8 @@ export function getImageByIndex(imageList, index) { } export function cleanupImageList(settings) { + if (settings.get_boolean('trash-deletes-images')) + return; let curList = imageListSortByDate(getImageList(settings)); let cutOff = GLib.DateTime.new_now_utc().add_days(-8); // 8 days ago let newList = []; From eaf143db04e1678d251b51e5dda3513869a7b805 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 00:06:32 +1000 Subject: [PATCH 09/25] fix incorrect bool check --- extension.js | 6 ++++++ utils.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/extension.js b/extension.js index 81e67dd3..cc709191 100644 --- a/extension.js +++ b/extension.js @@ -591,6 +591,12 @@ class BingWallpaperIndicator extends Button { this.hidden_status = !this.hidden_status; Utils.setImageHiddenStatus(this._settings, [this.imageURL], this.hidden_status); this._setTrashIcon(this.hidden_status?this.ICON_UNTRASH_BUTTON:this.ICON_TRASH_BUTTON); + if (this.settings.get_boolean('trash-deletes-images')) { + log('image to be deleted: '+this.filename); + Utils.deleteImage(this.filename); + Utils.validate_imagename(this.settings); + } + } _setFavouriteIcon(icon_name) { diff --git a/utils.js b/utils.js index 21bc5ed2..1a29acd8 100644 --- a/utils.js +++ b/utils.js @@ -301,7 +301,7 @@ export function getImageByIndex(imageList, index) { } export function cleanupImageList(settings) { - if (settings.get_boolean('trash-deletes-images')) + if (settings.get_boolean('trash-deletes-images') == false) return; let curList = imageListSortByDate(getImageList(settings)); let cutOff = GLib.DateTime.new_now_utc().add_days(-8); // 8 days ago From 8a0d2b2aea486502f844442801dcd7a4d76dda85 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 00:13:35 +1000 Subject: [PATCH 10/25] fix build and link to source --- buildzip.sh | 4 +- ui/Settings4.ui | 1451 ----------------------------------------------- ui/prefsadw.ui | 2 +- 3 files changed, 3 insertions(+), 1454 deletions(-) delete mode 100644 ui/Settings4.ui diff --git a/buildzip.sh b/buildzip.sh index f5e88b60..a3903fca 100755 --- a/buildzip.sh +++ b/buildzip.sh @@ -5,9 +5,9 @@ # the tools, but test builds in VMs it (generally) should be ok glib-compile-schemas schemas/ -intltool-extract --type=gettext/glade ui/Settings4.ui +intltool-extract --type=gettext/glade ui/prefsadw.ui intltool-extract --type=gettext/glade ui/carousel4.ui -xgettext -k -k_ -kN_ --omit-header -o locale/BingWallpaper.pot ui/Settings4.ui.h ui/carousel4.ui.h ui/intervals.utils.js.h extension.js prefs.js blur.js utils.js --from-code=UTF-8 +xgettext -k -k_ -kN_ --omit-header -o locale/BingWallpaper.pot ui/prefsadw.ui.h ui/carousel4.ui.h ui/intervals.utils.js.h extension.js prefs.js blur.js utils.js --from-code=UTF-8 DATE=`date +"%F"` echo "# Translation status of statements as at $DATE:" > translations.txt diff --git a/ui/Settings4.ui b/ui/Settings4.ui deleted file mode 100644 index 073a3bff..00000000 --- a/ui/Settings4.ui +++ /dev/null @@ -1,1451 +0,0 @@ - - - - - - 50 - 1 - 10 - - - 100 - 5 - 10 - - - 7 - 1 - 2 - - - 300 - 604800 - 300 - 3600 - - - Bing Wallpaper pictures folder - 0 - select-folder - 1 - - - - 120 - - - 0 - 0 - 0 - 500 - - - - - 0 - 12 - 12 - 12 - 12 - vertical - 12 - 0 - - - 0 - - - 0 - none - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - Hide the indicator - 1 - - 0 - 0 - - - - - - end - 1 - - 1 - 0 - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - Indicator icon - 1 - - 0 - 0 - 2 - - - - - - 0 - end - - 1 - 1 - 1 - - - - - - 32 - 32 - 0 - end - 1 - ../icons/bing-symbolic.svg - icon_image_black_bg - - 1 - 0 - 1 - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - Enable desktop notifications - 1 - - 0 - 0 - - - - - - end - 1 - - 1 - 0 - - - - - - - - - - - - - - - - - 0 - - - 0 - none - - - - - 0 - 12 - 12 - 12 - 12 - - - 0 - Set background image - - 0 - 0 - - - - - - end - 1 - - 1 - 0 - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Background style option - - 0 - 0 - - - - - - - 1 - 0 - 1 - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - Download folder - - 0 - 0 - - - - - - True - False - end - false - Bing Wallpaper pictures folder - - 1 - 0 - - - - - - Open folder - True - True - - 2 - 0 - - - - - - - - - - - - - - - - - 0 - - - 0 - none - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Selected image - - 0 - 0 - - - - - - - 1 - 0 - 1 - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Shuffle enabled - - 0 - 0 - - - - - - end - 1 - - 1 - 0 - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Shuffle mode - - 0 - 0 - - - - - - - 1 - 0 - 1 - - - - - - - - - - - - - - - - - 0 - - - 0 - none - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Bing locale - 1 - - 0 - 0 - - - - - - 0 - start - 0 - - - - 0 - 1 - - - - - - - - - - - - - - - - - - - 0 - Settings - - - - - - - 1 - - - 0 - 12 - 12 - 12 - 12 - vertical - 12 - - - 0 - 0 - - - 0 - none - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - end - - 1 - 0 - - - - - - 0 - start - 1 - Dynamically switches blur on GDM3 lock screen - - - 0 - 1 - - - - - - 0 - start - 1 - Enable dynamic lockscreen blur - 1 - - 0 - 0 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Blur can improve readability - - - 0 - 1 - - - - - - 0 - start - 1 - Background blur intensity - - 0 - 0 - - - - - - adjustment_blur - 1 - - 1 - 0 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Can improve contrast of login prompt - - - 0 - 1 - - - - - - 0 - start - 1 - Background brightness - - 0 - 0 - - - - - - adjustment_brightness - 1 - - 1 - 0 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Presets - 1 - - 0 - 0 - - - - - - No blur, slight dim - 1 - - 1 - 3 - - - - - - GNOME default - 1 - - 1 - 2 - - - - - - Slight blur, slight dim - 1 - - 1 - 4 - - - - - - - - - - - - - - - - - - - - - - 0 - Lock Screen - - - - - - - 2 - - - 0 - 12 - 12 - 12 - 12 - vertical - 12 - - - 0 - 0 - - - 0 - none - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - end - - 1 - 0 - - - - - - 0 - start - 1 - Enable logging to system journal - - - 0 - 1 - - - - - - 0 - start - 1 - Debug logging - 1 - - 0 - 0 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Switch to new images when available (unless on random mode) - - - 0 - 1 - - - - - - 0 - start - 1 - Always show new images - 1 - - 0 - 0 - - - - - - end - - 1 - 0 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Some newer features may be unstable on Wayland - - - 0 - 1 - - - - - - 0 - start - 1 - Enable all features on Wayland - 1 - - 0 - 0 - - - - - - end - - 1 - 0 - - - - - - - - - - - - - 0 - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Screen resolution - 1 - - 0 - 0 - - - - - - 0 - start - Override automatic resolution selection - - - 0 - 1 - - - - - - - 1 - 0 - 2 - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Manually adjust random interval (seconds) - - - 0 - 1 - - - - - - 0 - start - 1 - Random interval - - 0 - 0 - - - - - - adjustment_random_interval - 1 - - 1 - 0 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Import Bing Wallpaper data - 1 - - 0 - 0 - - - - - - 0 - start - 1 - Import previously exported JSON data from wallpaper directory - - - 0 - 1 - - - - - - Import - 1 - - 1 - 1 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Export Bing Wallpaper data - 1 - - 0 - 0 - - - - - - 0 - start - 1 - Export JSON data to wallpaper dir for backup or data migration - - - 0 - 1 - - - - - - Export - 1 - - 1 - 1 - - - - - - - - - - - - - - - 0 - 12 - 12 - 12 - 12 - 32 - - - 0 - start - 1 - Always export Bing data - 1 - - 0 - 0 - - - - - - 0 - start - 1 - Export Bing JSON whenever data changes - - - - 0 - 1 - - - - - - end - - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - 0 - Debug options - - - - - - - 3 - - - 0 - vertical - - - - 0 - 500 - 0 - 0 - - - 0 - center - 1 - 2 - 2 - 2 - 2 - - - - - - - - - 0 - Gallery - - - - - - - 4 - - - 0 - - - 1 - 0 - vertical - 5 - - - - 0 - Bing Wallpaper - - - - - - - - 0 - New wallpaper images everyday from Bing - center - 1 - - - - - 0 - center - - - - 0 - end - GNOME shell extension version - - - - - 0 - start - ... - - - - - - - https://github.com/neffo/bing-wallpaper-gnome-extension - 0 - 1 - center - https://github.com/neffo/bing-wallpaper-gnome-extension - - - - - 0 - center - vertical - 5 - - - 0 - Maintained by Michael Carroll - - - - - 0 - ineffable@gmail.com - 1 - - - - - 0 - 36 - Show your support to the author on <a href="https://flattr.com/@neffo">Flattr</a> or <a href="https://github.com/sponsors/neffo">Github Sponsors</a>. - 1 - - - - - 0 - 36 - - 1 - - Changes since last version - 1 - - - - - 0 - 36 - Based on NASA APOD GNOME shell extension by Elia Argentieri - center - 1 - - - - - - - - - - 0 - 0 - <span size="small">This program comes with ABSOLUTELY NO WARRANTY. -See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3 or later</a> for details.</span> - 1 - center - 1 - - - - - - - 0 - About - - - - - - diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui index 29cfe6e2..c5369bfd 100644 --- a/ui/prefsadw.ui +++ b/ui/prefsadw.ui @@ -334,7 +334,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll source_code_linkbutton - https://github.com/neffo/ + https://github.com/neffo/bing-wallpaper-gnome-extension From 12d1384403effe7a6f1bb481a1cec089dd800ffc Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 22:02:20 +1000 Subject: [PATCH 11/25] fix carousel image delete --- .gitignore | 1 + carousel.js | 3 +- locale/BingWallpaper.pot | 260 ++++++++++++++++++++++----------------- 3 files changed, 150 insertions(+), 114 deletions(-) diff --git a/.gitignore b/.gitignore index 2030b189..e14429bf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ Settings.ui.h Settings4.ui.h carousel.ui.h carousel4.ui.h +prefsadw.ui.h test.js diff --git a/carousel.js b/carousel.js index 3acb484c..ed982a55 100644 --- a/carousel.js +++ b/carousel.js @@ -107,8 +107,9 @@ export default class Carousel { deleteButton.connect('clicked', (widget) => { this.log('Delete requested for '+filename); Utils.deleteImage(filename); - Utils.cleanupImageList(this.settings); // hide image instead Utils.hideImage(this.settings, [image]); + Utils.setImageHiddenStatus(this.settings, [image], true); + Utils.cleanupImageList(this.settings); // hide image instead widget.get_parent().get_parent().set_visible(false); // bit of a hack if (this.callbackfunc) this.callbackfunc(); diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index a051e6e0..76f9fa8b 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -1,215 +1,225 @@ -#: ui/Settings4.ui.h:1 -msgid "Bing Wallpaper pictures folder" +#: ui/prefsadw.ui.h:1 +msgid "Members" msgstr "" -#: ui/Settings4.ui.h:2 -msgid "Hide the indicator" +#: ui/prefsadw.ui.h:2 +msgid "Indicator" msgstr "" -#: ui/Settings4.ui.h:3 -msgid "Indicator icon" +#: ui/prefsadw.ui.h:3 +msgid "Hide Indicator" msgstr "" -#: ui/Settings4.ui.h:4 extension.js:156 -msgid "Enable desktop notifications" +#: ui/prefsadw.ui.h:4 +msgid "Whether to hide the panel indicator" msgstr "" -#: ui/Settings4.ui.h:5 extension.js:136 extension.js:152 -msgid "Set background image" +#: ui/prefsadw.ui.h:5 +msgid "Desktop notifications" msgstr "" -#: ui/Settings4.ui.h:6 -msgid "Background style option" +#: ui/prefsadw.ui.h:6 +msgid "Enable notifications on new images" msgstr "" -#: ui/Settings4.ui.h:7 -msgid "Download folder" +#: ui/prefsadw.ui.h:7 +msgid "Indicator icon" msgstr "" -#: ui/Settings4.ui.h:8 prefs.js:95 -msgid "Open folder" +#: ui/prefsadw.ui.h:8 +msgid "Select from alternate tray icons" msgstr "" -#: ui/Settings4.ui.h:9 -msgid "Selected image" +#: ui/prefsadw.ui.h:9 +msgid "Wallpaper" msgstr "" -#: ui/Settings4.ui.h:10 -msgid "Shuffle enabled" +#: ui/prefsadw.ui.h:10 +msgid "Set wallpaper" msgstr "" -#: ui/Settings4.ui.h:11 -msgid "Shuffle mode" +#: ui/prefsadw.ui.h:11 +msgid "Whether to set wallpaper automatically" msgstr "" -#: ui/Settings4.ui.h:12 -msgid "Bing locale" +#: ui/prefsadw.ui.h:12 +msgid "Enabled shuffle" msgstr "" -#: ui/Settings4.ui.h:13 extension.js:139 -msgid "Settings" +#: ui/prefsadw.ui.h:13 +msgid "Randomly select wallpaper from collection" msgstr "" -#: ui/Settings4.ui.h:14 -msgid "Dynamically switches blur on GDM3 lock screen" +#: ui/prefsadw.ui.h:14 +msgid "Shuffle interval" msgstr "" -#: ui/Settings4.ui.h:15 -msgid "Enable dynamic lockscreen blur" +#: ui/prefsadw.ui.h:15 +msgid "How frequently to shuffle wallpapers" msgstr "" -#: ui/Settings4.ui.h:16 -msgid "Blur can improve readability" +#: ui/prefsadw.ui.h:16 +msgid "Downloads" msgstr "" -#: ui/Settings4.ui.h:17 -msgid "Background blur intensity" +#: ui/prefsadw.ui.h:17 +msgid "Download folder" msgstr "" -#: ui/Settings4.ui.h:18 -msgid "Can improve contrast of login prompt" +#: ui/prefsadw.ui.h:18 +msgid "Open or change wallpaper downloads folder" msgstr "" -#: ui/Settings4.ui.h:19 -msgid "Background brightness" +#: ui/prefsadw.ui.h:19 +msgid "Lock screen" msgstr "" -#: ui/Settings4.ui.h:20 -msgid "Presets" +#: ui/prefsadw.ui.h:20 +msgid "Lockscreen blur" msgstr "" -#: ui/Settings4.ui.h:21 prefs.js:139 -msgid "No blur, slight dim" +#: ui/prefsadw.ui.h:21 +msgid "Dynamic lockscreen blur" msgstr "" -#: ui/Settings4.ui.h:22 -msgid "GNOME default" +#: ui/prefsadw.ui.h:22 +msgid "Whether to enable dynamic blur mode on lock screen" msgstr "" -#: ui/Settings4.ui.h:23 -msgid "Slight blur, slight dim" +#: ui/prefsadw.ui.h:23 +msgid "Blur strength" msgstr "" -#: ui/Settings4.ui.h:24 -msgid "Lock Screen" +#: ui/prefsadw.ui.h:24 +msgid "Blur strength when login prompt is not visible" msgstr "" -#: ui/Settings4.ui.h:25 -msgid "Enable logging to system journal" +#: ui/prefsadw.ui.h:25 +msgid "Wallpaper brightness" msgstr "" -#: ui/Settings4.ui.h:26 -msgid "Debug logging" +#: ui/prefsadw.ui.h:26 +msgid "Dim wallpaper when login prompt is not visible" msgstr "" -#: ui/Settings4.ui.h:27 -msgid "Switch to new images when available (unless on random mode)" +#: ui/prefsadw.ui.h:27 +msgid "Presets" msgstr "" -#: ui/Settings4.ui.h:28 extension.js:153 -msgid "Always show new images" +#: ui/prefsadw.ui.h:28 +msgid "Gallery" msgstr "" -#: ui/Settings4.ui.h:29 -msgid "Some newer features may be unstable on Wayland" +#: ui/prefsadw.ui.h:29 +msgid "Debug" msgstr "" -#: ui/Settings4.ui.h:30 -msgid "Enable all features on Wayland" +#: ui/prefsadw.ui.h:30 +msgid "Debug options" msgstr "" -#: ui/Settings4.ui.h:31 -msgid "Screen resolution" +#: ui/prefsadw.ui.h:31 +msgid "Debug logging" msgstr "" -#: ui/Settings4.ui.h:32 -msgid "Override automatic resolution selection" +#: ui/prefsadw.ui.h:32 +msgid "Enable logging to system journal" msgstr "" -#: ui/Settings4.ui.h:33 -msgid "Manually adjust random interval (seconds)" +#: ui/prefsadw.ui.h:33 extension.js:153 +msgid "Always show new images" msgstr "" -#: ui/Settings4.ui.h:34 -msgid "Random interval" +#: ui/prefsadw.ui.h:34 +msgid "Switch to new images when available (unless on random mode)" msgstr "" -#: ui/Settings4.ui.h:35 -msgid "Import Bing Wallpaper data" +#: ui/prefsadw.ui.h:35 +msgid "Purge on trash" msgstr "" -#: ui/Settings4.ui.h:36 -msgid "Import previously exported JSON data from wallpaper directory" +#: ui/prefsadw.ui.h:36 +msgid "Trashing an image will remove it from database" msgstr "" -#: ui/Settings4.ui.h:37 prefs.js:184 -msgid "Import" +#: ui/prefsadw.ui.h:37 +msgid "Screen resolution" msgstr "" -#: ui/Settings4.ui.h:38 -msgid "Export Bing Wallpaper data" +#: ui/prefsadw.ui.h:38 +msgid "Override automatic resolution selection" msgstr "" -#: ui/Settings4.ui.h:39 -msgid "Export JSON data to wallpaper dir for backup or data migration" +#: ui/prefsadw.ui.h:39 +msgid "Random interval" msgstr "" -#: ui/Settings4.ui.h:40 prefs.js:192 -msgid "Export" +#: ui/prefsadw.ui.h:40 +msgid "Custom shuffle interval when enabled" msgstr "" -#: ui/Settings4.ui.h:41 +#: ui/prefsadw.ui.h:41 msgid "Always export Bing data" msgstr "" -#: ui/Settings4.ui.h:42 -msgid "Export Bing JSON whenever data changes" +#: ui/prefsadw.ui.h:42 +msgid "Export Bing JSON when image data changes" msgstr "" -#: ui/Settings4.ui.h:43 -msgid "Debug options" +#: ui/prefsadw.ui.h:43 +msgid "Bing JSON data" msgstr "" -#: ui/Settings4.ui.h:44 -msgid "Gallery" +#: ui/prefsadw.ui.h:44 +msgid "About" msgstr "" -#: ui/Settings4.ui.h:45 -msgid "New wallpaper images everyday from Bing" +#: ui/prefsadw.ui.h:45 +msgid "Bing Wallpaper" msgstr "" -#: ui/Settings4.ui.h:46 -msgid "GNOME shell extension version " +#: ui/prefsadw.ui.h:46 +msgid "New wallpaper images everyday from Bing" msgstr "" -#: ui/Settings4.ui.h:47 +#: ui/prefsadw.ui.h:47 msgid "Maintained by Michael Carroll" msgstr "" -#: ui/Settings4.ui.h:48 -msgid "" -"Show your support to the author on Flattr or Github " -"Sponsors." +#: ui/prefsadw.ui.h:48 +msgid "Version" msgstr "" -#: ui/Settings4.ui.h:49 -msgid "Changes since last version" +#: ui/prefsadw.ui.h:49 +msgid "Release notes" msgstr "" -#: ui/Settings4.ui.h:50 -msgid "Based on NASA APOD GNOME shell extension by Elia Argentieri" +#: ui/prefsadw.ui.h:50 +msgid "GNOME extensions page" msgstr "" -#: ui/Settings4.ui.h:51 -msgid "" -"This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General " -"Public License, version 3 or later for details." +#: ui/prefsadw.ui.h:51 +msgid "Source code" msgstr "" -#: ui/Settings4.ui.h:53 -msgid "About" +#: ui/prefsadw.ui.h:52 +msgid "Report an issue" +msgstr "" + +#: ui/prefsadw.ui.h:53 +msgid "Contributors" +msgstr "" + +#: ui/prefsadw.ui.h:54 +msgid "License" +msgstr "" + +#: ui/prefsadw.ui.h:55 prefs.js:103 +msgid "Change folder" +msgstr "" + +#: ui/prefsadw.ui.h:56 +msgid "Select new wallpaper download folder" msgstr "" #: ui/carousel4.ui.h:1 @@ -276,6 +286,10 @@ msgstr "" msgid "Open image folder" msgstr "" +#: extension.js:136 extension.js:152 +msgid "Set background image" +msgstr "" + #: extension.js:137 msgid "Set lock screen image" msgstr "" @@ -284,6 +298,10 @@ msgstr "" msgid "Refresh Now" msgstr "" +#: extension.js:139 +msgid "Settings" +msgstr "" + #: extension.js:140 msgid "Open in image viewer" msgstr "" @@ -304,6 +322,10 @@ msgstr "" msgid "Image shuffle only favourites" msgstr "" +#: extension.js:156 +msgid "Enable desktop notifications" +msgstr "" + #: extension.js:157 msgid "Show image count" msgstr "" @@ -324,30 +346,42 @@ msgstr "" msgid "Next shuffle" msgstr "" -#: extension.js:802 extension.js:877 +#: extension.js:808 extension.js:883 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:915 +#: extension.js:921 msgid "No wallpaper available" msgstr "" -#: extension.js:916 +#: extension.js:922 msgid "No picture for today." msgstr "" -#: prefs.js:103 -msgid "Change folder" +#: prefs.js:95 +msgid "Open folder" msgstr "" #: prefs.js:131 msgid "Default" msgstr "" +#: prefs.js:139 +msgid "No blur, slight dim" +msgstr "" + #: prefs.js:147 msgid "Slight blur & dim" msgstr "" +#: prefs.js:184 +msgid "Import" +msgstr "" + +#: prefs.js:192 +msgid "Export" +msgstr "" + #: prefs.js:265 msgid "Select wallpaper download folder" msgstr "" From f65998ea66e1eaeb34342558ff962e0f99a76e57 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 22:05:25 +1000 Subject: [PATCH 12/25] remove reference to deleteImage --- carousel.js | 1 - 1 file changed, 1 deletion(-) diff --git a/carousel.js b/carousel.js index ed982a55..a75b550e 100644 --- a/carousel.js +++ b/carousel.js @@ -107,7 +107,6 @@ export default class Carousel { deleteButton.connect('clicked', (widget) => { this.log('Delete requested for '+filename); Utils.deleteImage(filename); - Utils.hideImage(this.settings, [image]); Utils.setImageHiddenStatus(this.settings, [image], true); Utils.cleanupImageList(this.settings); // hide image instead widget.get_parent().get_parent().set_visible(false); // bit of a hack From 6fd4a0d7d5e7f1cde9d5ab2d6b42ea05e16ecad5 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 22:47:25 +1000 Subject: [PATCH 13/25] add icon_name back --- locale/BingWallpaper.pot | 36 ++++++++++++++++++------------------ prefs.js | 20 +++++++++++--------- ui/prefsadw.ui | 28 +++++++++++++++++++++++++++- utils.js | 2 +- 4 files changed, 57 insertions(+), 29 deletions(-) diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 76f9fa8b..91f4773e 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -31,43 +31,43 @@ msgid "Select from alternate tray icons" msgstr "" #: ui/prefsadw.ui.h:9 -msgid "Wallpaper" +msgid "Download folder" msgstr "" #: ui/prefsadw.ui.h:10 -msgid "Set wallpaper" +msgid "Open or change wallpaper downloads folder" msgstr "" #: ui/prefsadw.ui.h:11 -msgid "Whether to set wallpaper automatically" +msgid "Wallpaper" msgstr "" #: ui/prefsadw.ui.h:12 -msgid "Enabled shuffle" +msgid "Set wallpaper" msgstr "" #: ui/prefsadw.ui.h:13 -msgid "Randomly select wallpaper from collection" +msgid "Whether to set wallpaper automatically" msgstr "" #: ui/prefsadw.ui.h:14 -msgid "Shuffle interval" +msgid "Enabled shuffle" msgstr "" #: ui/prefsadw.ui.h:15 -msgid "How frequently to shuffle wallpapers" +msgid "Randomly select wallpaper from collection" msgstr "" #: ui/prefsadw.ui.h:16 -msgid "Downloads" +msgid "Shuffle interval" msgstr "" #: ui/prefsadw.ui.h:17 -msgid "Download folder" +msgid "How frequently to shuffle wallpapers" msgstr "" #: ui/prefsadw.ui.h:18 -msgid "Open or change wallpaper downloads folder" +msgid "Downloads" msgstr "" #: ui/prefsadw.ui.h:19 @@ -214,7 +214,7 @@ msgstr "" msgid "License" msgstr "" -#: ui/prefsadw.ui.h:55 prefs.js:103 +#: ui/prefsadw.ui.h:55 prefs.js:104 msgid "Change folder" msgstr "" @@ -358,31 +358,31 @@ msgstr "" msgid "No picture for today." msgstr "" -#: prefs.js:95 +#: prefs.js:96 msgid "Open folder" msgstr "" -#: prefs.js:131 +#: prefs.js:132 msgid "Default" msgstr "" -#: prefs.js:139 +#: prefs.js:140 msgid "No blur, slight dim" msgstr "" -#: prefs.js:147 +#: prefs.js:148 msgid "Slight blur & dim" msgstr "" -#: prefs.js:184 +#: prefs.js:185 msgid "Import" msgstr "" -#: prefs.js:192 +#: prefs.js:193 msgid "Export" msgstr "" -#: prefs.js:265 +#: prefs.js:267 msgid "Select wallpaper download folder" msgstr "" diff --git a/prefs.js b/prefs.js index 2d5fdee4..9e1a3ac0 100644 --- a/prefs.js +++ b/prefs.js @@ -32,7 +32,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen window.set_default_size(PREFS_DEFAULT_WIDTH, PREFS_DEFAULT_HEIGHT); - let icon_image = null; + /*let icon_image = null;*/ let provider = new Gtk.CssProvider(); provider.load_from_path(this.dir.get_path() + '/ui/prefs.css'); Gtk.StyleContext.add_provider_for_display( @@ -61,13 +61,14 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen const notifySwitch = buildable.get_object('notifySwitch'); const iconEntry = buildable.get_object('iconEntry'); + /* const list = new Gtk.StringList(); Utils.icon_list.forEach((iconname, index) => { - list.append(iconname, iconname); + list.append(iconname); }); - iconEntry.set_model(list); - iconEntry.set_selected(Utils.icon_list.indexOf(settings.get_string('icon-name'))); + iconEntry.set_model(list);*/ + iconEntry.set_value(1+Utils.icon_list.indexOf(settings.get_string('icon-name'))); const wp_group = buildable.get_object('wp_group'); @@ -213,8 +214,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen catch (e) { log("Error creating httpSession: " + e); } - - + const icon_image = buildable.get_object('icon_image'); // check that these are valid (can be edited through dconf-editor) Utils.validate_resolution(settings); @@ -226,10 +226,12 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::icon-name', () => { Utils.validate_icon(settings, this.path, icon_image); - /*iconEntry.set_selected(Utils.indexOf(settings.get_string('icon-name')));*/ + iconEntry.set_value(1 + Utils.icon_list.indexOf(settings.get_string('icon-name'))); }); - //iconEntry.set_active_id(settings.get_string('icon-name')); + iconEntry.connect('output', () => { + settings.set_string('icon-name', Utils.icon_list[iconEntry.get_value()-1]); + }); // connect switches to settings changes settings.bind('set-background', bgSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); @@ -283,7 +285,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen }); resolutionEntry.set_model(resolutionModel); - settings.bind('resolution', resolutionEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); + settings.bind('resolution', resolutionEntry, 'selected', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::resolution', () => { Utils.validate_resolution(settings); diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui index c5369bfd..af581a55 100644 --- a/ui/prefsadw.ui +++ b/ui/prefsadw.ui @@ -41,9 +41,35 @@ Bing Wallpaper GNOME extension by: Michael Carroll - + Indicator icon Select from alternate tray icons + + + 1 + 5 + 1 + + + + + + + + + + 64 + 64 + 0 + end + 1 + ../icons/bing-symbolic.svg + icon_image_black_bg + + diff --git a/utils.js b/utils.js index 1a29acd8..bd52fb02 100644 --- a/utils.js +++ b/utils.js @@ -68,7 +68,7 @@ export function validate_icon(settings, extension_path, icon_image = null) { // if called from prefs if (icon_image) { BingLog('set icon to: ' + extension_path + '/icons/' + icon_name + '.svg'); - let pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(extension_path + '/icons/' + icon_name + '.svg', 32, 32); + let pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(extension_path + '/icons/' + icon_name + '.svg', 64, 64); icon_image.set_from_pixbuf(pixbuf); } } From 73d7812f035a1f2ac728220a9d4f9e50c616aba2 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 23:01:22 +1000 Subject: [PATCH 14/25] fix resolution warnings --- locale/BingWallpaper.pot | 10 +++------- prefs.js | 4 +++- ui/prefsadw.ui | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 91f4773e..8e96f142 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -1,5 +1,5 @@ -#: ui/prefsadw.ui.h:1 -msgid "Members" +#: ui/prefsadw.ui.h:1 extension.js:139 +msgid "Settings" msgstr "" #: ui/prefsadw.ui.h:2 @@ -51,7 +51,7 @@ msgid "Whether to set wallpaper automatically" msgstr "" #: ui/prefsadw.ui.h:14 -msgid "Enabled shuffle" +msgid "Shuffle wallpaper" msgstr "" #: ui/prefsadw.ui.h:15 @@ -298,10 +298,6 @@ msgstr "" msgid "Refresh Now" msgstr "" -#: extension.js:139 -msgid "Settings" -msgstr "" - #: extension.js:140 msgid "Open in image viewer" msgstr "" diff --git a/prefs.js b/prefs.js index 9e1a3ac0..78eb9527 100644 --- a/prefs.js +++ b/prefs.js @@ -285,7 +285,9 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen }); resolutionEntry.set_model(resolutionModel); - settings.bind('resolution', resolutionEntry, 'selected', Gio.SettingsBindFlags.DEFAULT); + settings.connect('changed::resolution', () => { + resolutionEntry.set_selected(Utils.resolutions.map( e => e.value).indexOf(settings.get_string('resolution'))); + }); settings.connect('changed::resolution', () => { Utils.validate_resolution(settings); diff --git a/ui/prefsadw.ui b/ui/prefsadw.ui index af581a55..538035c9 100644 --- a/ui/prefsadw.ui +++ b/ui/prefsadw.ui @@ -24,7 +24,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll emblem-photos-symbolic - Members + Settings Indicator @@ -85,7 +85,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll - Enabled shuffle + Shuffle wallpaper Randomly select wallpaper from collection From b29d41b7e7d308749ac80335e21c1df5feced213 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 23:19:50 +1000 Subject: [PATCH 15/25] fix blur function names --- blur.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/blur.js b/blur.js index e063be6e..267a3299 100644 --- a/blur.js +++ b/blur.js @@ -13,8 +13,10 @@ import St from 'gi://St'; import * as UnlockDialog from 'resource:///org/gnome/shell/ui/unlockDialog.js'; import * as Config from 'resource:///org/gnome/shell/misc/config.js'; var _updateBackgroundEffects = UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects; -var _showClock = UnlockDialog.UnlockDialog.prototype._showClock; -var _showPrompt = UnlockDialog.UnlockDialog.prototype._showPrompt; + +// original functions +var _showClock_GNOME = UnlockDialog.UnlockDialog.prototype._showClock; +var _showPrompt_GNOME = UnlockDialog.UnlockDialog.prototype._showPrompt; var shellVersionMajor = parseInt(Config.PACKAGE_VERSION.split('.')[0]); var shellVersionMinor = parseInt(Config.PACKAGE_VERSION.split('.')[1]); @@ -70,13 +72,13 @@ function _updateBackgroundEffects_BWP(monitorIndex) { // adjustable blur in a Windows-like way (this ensures login prompt is readable) function _showClock_BWP() { promptActive = false; - this._showClock_GNOME(); // pass to default GNOME function + _showClock_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } function _showPrompt_BWP() { promptActive = true; - this._showPrompt_GNOME(); // pass to default GNOME function + _showPrompt_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } @@ -123,8 +125,8 @@ export default class Blur { UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt_BWP; // this are the original functions which we call into from our versions above - UnlockDialog.UnlockDialog.prototype._showClock_GNOME = _showClock; - UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME = _showPrompt; + UnlockDialog.UnlockDialog.prototype._showClock_GNOME = _showClock_GNOME; + UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME = _showPrompt_GNOME; } this.enabled = true; From bcb432fe79fb2572e6ad9b84b4b914da94c5af90 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 19 Mar 2024 23:28:44 +1000 Subject: [PATCH 16/25] revert some changes --- blur.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blur.js b/blur.js index 267a3299..5a504b6a 100644 --- a/blur.js +++ b/blur.js @@ -72,13 +72,13 @@ function _updateBackgroundEffects_BWP(monitorIndex) { // adjustable blur in a Windows-like way (this ensures login prompt is readable) function _showClock_BWP() { promptActive = false; - _showClock_GNOME(); // pass to default GNOME function + this._showClock_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } function _showPrompt_BWP() { promptActive = true; - _showPrompt_GNOME(); // pass to default GNOME function + this._showPrompt_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } @@ -139,8 +139,8 @@ export default class Blur { if (supportedVersion()) { // restore default functions UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects; - UnlockDialog.UnlockDialog.prototype._showClock = _showClock; - UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt; + UnlockDialog.UnlockDialog.prototype._showClock = _showClock_GNOME; + UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt_GNOME; // clean up unused functions we created UnlockDialog.UnlockDialog.prototype._showClock_GNOME = null; delete UnlockDialog.UnlockDialog.prototype._showClock_GNOME; From 810bb3da498be9a0470e5cd5cbe6cccfc71a6a6b Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 20 Mar 2024 21:12:57 +1000 Subject: [PATCH 17/25] cleanup blur.js --- blur.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/blur.js b/blur.js index 5a504b6a..9c2bb0e1 100644 --- a/blur.js +++ b/blur.js @@ -28,7 +28,7 @@ var BWP_BLUR_BRIGHTNESS = 55; // GNOME defaults var BLUR_BRIGHTNESS = 0.55; var BLUR_SIGMA = 60; -var debug = false; +var debug = true; var promptActive = false; // default GNOME method of testing this relies on state of a transisiton // so we are being explicit here (do not want any races, thanks) @@ -85,12 +85,12 @@ function _showPrompt_BWP() { export default class Blur { constructor() { this.enabled = false; - log('Bing Wallpaper adjustable blur is '+supportedVersion()?'available':'not available'); + log('Bing Wallpaper adjustable blur is ' + supportedVersion() ? 'available' : 'not available'); } set_blur_strength(value) { BWP_BLUR_SIGMA = this._clampValue(value); - log("lockscreen blur strength set to "+BWP_BLUR_SIGMA); + log("lockscreen blur strength set to " + BWP_BLUR_SIGMA); } set_blur_brightness(value) { @@ -151,9 +151,8 @@ export default class Blur { } }; -function supportedVersion() { // when current lockscren blur implementation was first shipped (we ignore earlier weird version) - if (shellVersionMajor >= 40 || - (shellVersionMajor == 3 && shellVersionMinor == 36 && shellVersionPoint >= 4)) { +function supportedVersion() { + if (shellVersionMajor >= 40 ) { return true; } From 5e8c86b330d155b2961f4c9127de9ddb5d902526 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 20 Mar 2024 21:22:16 +1000 Subject: [PATCH 18/25] test blur --- blur.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blur.js b/blur.js index 9c2bb0e1..d2966dfb 100644 --- a/blur.js +++ b/blur.js @@ -70,13 +70,13 @@ function _updateBackgroundEffects_BWP(monitorIndex) { // we patch both UnlockDialog._showClock() and UnlockDialog._showPrompt() to let us // adjustable blur in a Windows-like way (this ensures login prompt is readable) -function _showClock_BWP() { +function _showClock_BWP(this) { promptActive = false; this._showClock_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } -function _showPrompt_BWP() { +function _showPrompt_BWP(this) { promptActive = true; this._showPrompt_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); From f4519b938a27ba5714002c68c87b6c0a94532c79 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 20 Mar 2024 21:58:23 +1000 Subject: [PATCH 19/25] revert blur changes --- blur.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/blur.js b/blur.js index d2966dfb..e063be6e 100644 --- a/blur.js +++ b/blur.js @@ -13,10 +13,8 @@ import St from 'gi://St'; import * as UnlockDialog from 'resource:///org/gnome/shell/ui/unlockDialog.js'; import * as Config from 'resource:///org/gnome/shell/misc/config.js'; var _updateBackgroundEffects = UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects; - -// original functions -var _showClock_GNOME = UnlockDialog.UnlockDialog.prototype._showClock; -var _showPrompt_GNOME = UnlockDialog.UnlockDialog.prototype._showPrompt; +var _showClock = UnlockDialog.UnlockDialog.prototype._showClock; +var _showPrompt = UnlockDialog.UnlockDialog.prototype._showPrompt; var shellVersionMajor = parseInt(Config.PACKAGE_VERSION.split('.')[0]); var shellVersionMinor = parseInt(Config.PACKAGE_VERSION.split('.')[1]); @@ -28,7 +26,7 @@ var BWP_BLUR_BRIGHTNESS = 55; // GNOME defaults var BLUR_BRIGHTNESS = 0.55; var BLUR_SIGMA = 60; -var debug = true; +var debug = false; var promptActive = false; // default GNOME method of testing this relies on state of a transisiton // so we are being explicit here (do not want any races, thanks) @@ -70,13 +68,13 @@ function _updateBackgroundEffects_BWP(monitorIndex) { // we patch both UnlockDialog._showClock() and UnlockDialog._showPrompt() to let us // adjustable blur in a Windows-like way (this ensures login prompt is readable) -function _showClock_BWP(this) { +function _showClock_BWP() { promptActive = false; this._showClock_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } -function _showPrompt_BWP(this) { +function _showPrompt_BWP() { promptActive = true; this._showPrompt_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); @@ -85,12 +83,12 @@ function _showPrompt_BWP(this) { export default class Blur { constructor() { this.enabled = false; - log('Bing Wallpaper adjustable blur is ' + supportedVersion() ? 'available' : 'not available'); + log('Bing Wallpaper adjustable blur is '+supportedVersion()?'available':'not available'); } set_blur_strength(value) { BWP_BLUR_SIGMA = this._clampValue(value); - log("lockscreen blur strength set to " + BWP_BLUR_SIGMA); + log("lockscreen blur strength set to "+BWP_BLUR_SIGMA); } set_blur_brightness(value) { @@ -125,8 +123,8 @@ export default class Blur { UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt_BWP; // this are the original functions which we call into from our versions above - UnlockDialog.UnlockDialog.prototype._showClock_GNOME = _showClock_GNOME; - UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME = _showPrompt_GNOME; + UnlockDialog.UnlockDialog.prototype._showClock_GNOME = _showClock; + UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME = _showPrompt; } this.enabled = true; @@ -139,8 +137,8 @@ export default class Blur { if (supportedVersion()) { // restore default functions UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects; - UnlockDialog.UnlockDialog.prototype._showClock = _showClock_GNOME; - UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt_GNOME; + UnlockDialog.UnlockDialog.prototype._showClock = _showClock; + UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt; // clean up unused functions we created UnlockDialog.UnlockDialog.prototype._showClock_GNOME = null; delete UnlockDialog.UnlockDialog.prototype._showClock_GNOME; @@ -151,8 +149,9 @@ export default class Blur { } }; -function supportedVersion() { - if (shellVersionMajor >= 40 ) { +function supportedVersion() { // when current lockscren blur implementation was first shipped (we ignore earlier weird version) + if (shellVersionMajor >= 40 || + (shellVersionMajor == 3 && shellVersionMinor == 36 && shellVersionPoint >= 4)) { return true; } From 430d3fdab9a1c53f603a82db3fb1dc85d278c56c Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 20 Mar 2024 23:39:01 +1000 Subject: [PATCH 20/25] clean up prefs --- locale/BingWallpaper.pot | 16 +++--- prefs.js | 120 ++++++++++++++------------------------- 2 files changed, 52 insertions(+), 84 deletions(-) diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 8e96f142..27e1fba3 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -214,7 +214,7 @@ msgstr "" msgid "License" msgstr "" -#: ui/prefsadw.ui.h:55 prefs.js:104 +#: ui/prefsadw.ui.h:55 prefs.js:118 msgid "Change folder" msgstr "" @@ -354,31 +354,31 @@ msgstr "" msgid "No picture for today." msgstr "" -#: prefs.js:96 +#: prefs.js:110 msgid "Open folder" msgstr "" -#: prefs.js:132 +#: prefs.js:133 msgid "Default" msgstr "" -#: prefs.js:140 +#: prefs.js:141 msgid "No blur, slight dim" msgstr "" -#: prefs.js:148 +#: prefs.js:149 msgid "Slight blur & dim" msgstr "" -#: prefs.js:185 +#: prefs.js:173 msgid "Import" msgstr "" -#: prefs.js:193 +#: prefs.js:181 msgid "Export" msgstr "" -#: prefs.js:267 +#: prefs.js:248 msgid "Select wallpaper download folder" msgstr "" diff --git a/prefs.js b/prefs.js index 78eb9527..a2a1c201 100644 --- a/prefs.js +++ b/prefs.js @@ -21,6 +21,7 @@ const BingImageURL = Utils.BingImageURL; var DESKTOP_SCHEMA = 'org.gnome.desktop.background'; +// this is pretty wide because of the size of the gallery var PREFS_DEFAULT_WIDTH = 750; var PREFS_DEFAULT_HEIGHT = 750; @@ -52,44 +53,54 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // GTK4 removes some properties, and builder breaks when it sees them buildable.add_from_file( this.dir.get_path() + '/ui/prefsadw.ui' ); + // adw or gtk objects we'll attach to below const settings_page = buildable.get_object('settings_page'); - - window.add(settings_page); - - const ui_group = buildable.get_object('ui_group'); const hideSwitch = buildable.get_object('hideSwitch'); const notifySwitch = buildable.get_object('notifySwitch'); const iconEntry = buildable.get_object('iconEntry'); + const bgSwitch = buildable.get_object('bgSwitch'); + const shuffleSwitch = buildable.get_object('shuffleSwitch'); + const shuffleInterval = buildable.get_object('shuffleInterval'); + const folderRow = buildable.get_object('folderRow'); + const lockscreen_page = buildable.get_object('lockscreen_page'); + const overrideSwitch = buildable.get_object('overrideSwitch'); + const blurPresets = buildable.get_object('blurPresets'); + const strengthEntry = buildable.get_object('strengthEntry'); + const brightnessEntry = buildable.get_object('brightnessEntry'); + const blurAdjustment = buildable.get_object('blurAdjustment'); + const brightnessAdjustment = buildable.get_object('brightnessAdjustment'); + const resolutionEntry = buildable.get_object('resolutionEntry'); + const debugSwitch = buildable.get_object('debug_switch'); + const revertSwitch = buildable.get_object('revert_switch'); + const trash_purge_switch = buildable.get_object('trash_purge_switch'); + const always_export_switch = buildable.get_object('always_export_switch'); + const gallery_page = buildable.get_object('gallery_page'); + const carouselFlowBox = buildable.get_object('carouselFlowBox'); + const randomIntervalEntry = buildable.get_object('entry_random_interval'); + const debug_page = buildable.get_object('debug_page'); + const json_actionrow = buildable.get_object('json_actionrow'); + const about_page = buildable.get_object('about_page'); + const version_button = buildable.get_object('version_button'); + const change_log = buildable.get_object('change_log'); - /* - const list = new Gtk.StringList(); - Utils.icon_list.forEach((iconname, index) => { - list.append(iconname); - }); - - iconEntry.set_model(list);*/ - iconEntry.set_value(1+Utils.icon_list.indexOf(settings.get_string('icon-name'))); - + window.add(settings_page); + window.add(lockscreen_page); + window.add(gallery_page); + window.add(debug_page); + window.add(about_page); - const wp_group = buildable.get_object('wp_group'); - //settings_page.add(wp_group); + iconEntry.set_value(1+Utils.icon_list.indexOf(settings.get_string('icon-name'))); + // shuffle intervals const shuffleIntervals = new Gtk.StringList; Utils.randomIntervals.forEach((x) => { shuffleIntervals.append(_(x.title)); }); - - const bgSwitch = buildable.get_object('bgSwitch'); - const shuffleSwitch = buildable.get_object('shuffleSwitch'); - const shuffleInterval = buildable.get_object('shuffleInterval'); + shuffleInterval.set_model(shuffleIntervals); shuffleInterval.set_selected(Utils.randomIntervals.map( e => e.value).indexOf(settings.get_string('random-interval-mode'))); - const dl_group = buildable.get_object('dl_group'); - //settings_page.add(dl_group); - - const folderRow = buildable.get_object('folderRow'); - + // add wallpaper folder open and change buttons const openBtn = new Gtk.Button( { child: new Adw.ButtonContent({ icon_name: 'folder-pictures-symbolic', @@ -108,20 +119,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen }); folderRow.add_suffix(openBtn); - folderRow.add_suffix(changeBtn); - - /* not sure how to make this work right just yet */ - const folderDialog = buildable.get_object('folderDialog'); - const lockscreen_page = buildable.get_object('lockscreen_page'); - - window.add(lockscreen_page); - const ls_group = buildable.get_object('ls_group'); - const overrideSwitch = buildable.get_object('overrideSwitch'); - const blurPresets = buildable.get_object('blurPresets'); - const strengthEntry = buildable.get_object('strengthEntry'); - const brightnessEntry = buildable.get_object('brightnessEntry'); - const blurAdjustment = buildable.get_object('blurAdjustment'); - const brightnessAdjustment = buildable.get_object('brightnessAdjustment'); + folderRow.add_suffix(changeBtn); blurAdjustment.set_value(settings.get_int('lockscreen-blur-strength')); brightnessAdjustment.set_value(settings.get_int('lockscreen-blur-brightness')); @@ -151,34 +149,14 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen halign: Gtk.Align.CENTER, }); + // add to presets row blurPresets.add_suffix(defaultBtn); blurPresets.add_suffix(noBlurBtn); blurPresets.add_suffix(slightBlurBtn); - - ls_group.add(overrideSwitch); - ls_group.add(strengthEntry); - ls_group.add(brightnessEntry); - ls_group.add(blurPresets); - - const gallery_page = buildable.get_object('gallery_page'); - window.add(gallery_page); - - const carouselViewPort = buildable.get_object('carouselViewPort'); - const carouselFlowBox = buildable.get_object('carouselFlowBox'); - - //carouselViewPort.set_size(500,500); - - const debug_page = buildable.get_object('debug_page'); - window.add(debug_page); - - const randomIntervalEntry = buildable.get_object('entry_random_interval'); + randomIntervalEntry.set_value(settings.get_int('random-interval')); - const resolutionEntry = buildable.get_object('resolutionEntry'); - const debugSwitch = buildable.get_object('debug_switch'); - const revertSwitch = buildable.get_object('revert_switch'); - const trash_purge_switch = buildable.get_object('trash_purge_switch'); - const always_export_switch = buildable.get_object('always_export_switch'); + // these buttons either export or import saved JSON data const buttonImportData = new Gtk.Button( { child: new Adw.ButtonContent({ icon_name: 'document-send-symbolic', @@ -195,17 +173,11 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen valign: Gtk.Align.CENTER, halign: Gtk.Align.CENTER, }); - const json_actionrow = buildable.get_object('json_actionrow'); + json_actionrow.add_suffix(buttonImportData); json_actionrow.add_suffix(buttonExportData); - const about_page = buildable.get_object('about_page'); - const version_button = buildable.get_object('version_button'); - window.add(about_page); - - version_button.set_label(this.metadata.version.toString()); - - const change_log = buildable.get_object('change_log'); + version_button.set_label(this.metadata.version.toString()); try { httpSession = new Soup.Session(); @@ -235,7 +207,6 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // connect switches to settings changes settings.bind('set-background', bgSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); - settings.bind('debug-logging', debugSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('revert-to-current-image', revertSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); //settings.bind('override-unsafe-wayland', unsafeSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); @@ -249,7 +220,6 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen }); // we populate the tab (gtk4+, gnome 40+), this was previously a button to open a new window in gtk3 - // disabled at the moment, needs testing carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel // this is intended for migrating image folders between computers (or even sharing) or backups @@ -261,6 +231,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen Utils.exportBingJSON(settings); }); + // change wallpaper button const dirChooser = new Gtk.FileDialog( { accept_label: "Select", modal: true, @@ -281,7 +252,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen // Resolution const resolutionModel = new Gtk.StringList(); Utils.resolutions.forEach((res) => { // add res to dropdown list (aka a GtkComboText) - resolutionModel.append(res, res); + resolutionModel.append(res); }); resolutionEntry.set_model(resolutionModel); @@ -292,7 +263,6 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen settings.connect('changed::resolution', () => { Utils.validate_resolution(settings); }); - // shuffle modes settings.bind('random-mode-enabled', shuffleSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); @@ -301,14 +271,12 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen settings.connect('changed::random-interval-mode', () => { shuffleInterval.set_selected(Utils.randomIntervals.map( e => e.value).indexOf(settings.get_string('random-interval-mode'))); }); - // GDM3 lockscreen blur override settings.bind('override-lockscreen-blur', overrideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.bind('lockscreen-blur-strength', strengthEntry, 'value', Gio.SettingsBindFlags.DEFAULT); settings.bind('lockscreen-blur-brightness', brightnessEntry, 'value', Gio.SettingsBindFlags.DEFAULT); - // add a couple of preset buttons defaultBtn.connect('clicked', (widget) => { Utils.set_blur_preset(settings, Utils.PRESET_GNOME_DEFAULT); @@ -320,7 +288,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen Utils.set_blur_preset(settings, Utils.PRESET_SLIGHT_BLUR); }); - // fetch + // fetch change log (on about page) if (httpSession) Utils.fetch_change_log(this.metadata.version.toString(), change_log, httpSession); From 6d0138835b0a5834837fb39e64a1e33aa05d73a8 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 20 Mar 2024 23:47:04 +1000 Subject: [PATCH 21/25] minor tweaks to blur --- blur.js | 27 +++++++++++++-------------- locale/BingWallpaper.pot | 16 ++++++++-------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/blur.js b/blur.js index e063be6e..95c7b774 100644 --- a/blur.js +++ b/blur.js @@ -37,7 +37,7 @@ function log(msg) { } // we patch UnlockDialog._updateBackgroundEffects() -function _updateBackgroundEffects_BWP(monitorIndex) { +export function _updateBackgroundEffects_BWP(monitorIndex) { // GNOME shell 3.36.4 and above log("_updateBackgroundEffects_BWP() called for shell >= 3.36.4"); const themeContext = St.ThemeContext.get_for_stage(global.stage); @@ -68,18 +68,26 @@ function _updateBackgroundEffects_BWP(monitorIndex) { // we patch both UnlockDialog._showClock() and UnlockDialog._showPrompt() to let us // adjustable blur in a Windows-like way (this ensures login prompt is readable) -function _showClock_BWP() { +export function _showClock_BWP() { promptActive = false; this._showClock_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } -function _showPrompt_BWP() { +export function _showPrompt_BWP() { promptActive = true; this._showPrompt_GNOME(); // pass to default GNOME function this._updateBackgroundEffects(); } +export function _clampValue(value) { + // valid values are 0 to 100 + if (value > 100) + value = 100; + if (value < 0 ) + value = 0; + return value; +} export default class Blur { constructor() { this.enabled = false; @@ -87,24 +95,15 @@ export default class Blur { } set_blur_strength(value) { - BWP_BLUR_SIGMA = this._clampValue(value); + BWP_BLUR_SIGMA = _clampValue(value); log("lockscreen blur strength set to "+BWP_BLUR_SIGMA); } set_blur_brightness(value) { - BWP_BLUR_BRIGHTNESS = this._clampValue(value); + BWP_BLUR_BRIGHTNESS = _clampValue(value); log("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS); } - // valid values are 0 to 100 - _clampValue(value) { - if (value > 100) - value = 100; - if (value < 0 ) - value = 0; - return value; - } - _switch(enabled) { if (enabled && !this.enabled) { this._enable(); diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 27e1fba3..c7f33ec0 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -214,7 +214,7 @@ msgstr "" msgid "License" msgstr "" -#: ui/prefsadw.ui.h:55 prefs.js:118 +#: ui/prefsadw.ui.h:55 prefs.js:115 msgid "Change folder" msgstr "" @@ -354,31 +354,31 @@ msgstr "" msgid "No picture for today." msgstr "" -#: prefs.js:110 +#: prefs.js:107 msgid "Open folder" msgstr "" -#: prefs.js:133 +#: prefs.js:130 msgid "Default" msgstr "" -#: prefs.js:141 +#: prefs.js:138 msgid "No blur, slight dim" msgstr "" -#: prefs.js:149 +#: prefs.js:146 msgid "Slight blur & dim" msgstr "" -#: prefs.js:173 +#: prefs.js:163 msgid "Import" msgstr "" -#: prefs.js:181 +#: prefs.js:171 msgid "Export" msgstr "" -#: prefs.js:248 +#: prefs.js:238 msgid "Select wallpaper download folder" msgstr "" From 8fe5f3ce8df79263d5991f98317e44031ef4b792 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 20 Mar 2024 23:51:32 +1000 Subject: [PATCH 22/25] fix carousel icon size warning --- ui/carousel4.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/carousel4.ui b/ui/carousel4.ui index 7fe0fc69..c3228742 100644 --- a/ui/carousel4.ui +++ b/ui/carousel4.ui @@ -186,7 +186,7 @@ Author: Michael Carroll 120 0 preferences-desktop-wallpaper-symbolic - 3 + 2 0 0 From cb350696aae74df1efe9170a539d5cc97d43b143 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 21 Mar 2024 00:31:55 +1000 Subject: [PATCH 23/25] fix image deleting code --- carousel.js | 2 +- extension.js | 4 ++-- locale/BingWallpaper.pot | 6 +++--- utils.js | 13 ++++++------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/carousel.js b/carousel.js index a75b550e..f522ee78 100644 --- a/carousel.js +++ b/carousel.js @@ -107,7 +107,7 @@ export default class Carousel { deleteButton.connect('clicked', (widget) => { this.log('Delete requested for '+filename); Utils.deleteImage(filename); - Utils.setImageHiddenStatus(this.settings, [image], true); + Utils.setImageHiddenStatus(this.settings, image.urlbase, true); Utils.cleanupImageList(this.settings); // hide image instead widget.get_parent().get_parent().set_visible(false); // bit of a hack if (this.callbackfunc) diff --git a/extension.js b/extension.js index cc709191..d747459a 100644 --- a/extension.js +++ b/extension.js @@ -589,9 +589,9 @@ class BingWallpaperIndicator extends Button { _trashImage() { log('trash image '+this.imageURL+' status was '+this.hidden_status); this.hidden_status = !this.hidden_status; - Utils.setImageHiddenStatus(this._settings, [this.imageURL], this.hidden_status); + Utils.setImageHiddenStatus(this._settings, this.imageURL, this.hidden_status); this._setTrashIcon(this.hidden_status?this.ICON_UNTRASH_BUTTON:this.ICON_TRASH_BUTTON); - if (this.settings.get_boolean('trash-deletes-images')) { + if (this._settings.get_boolean('trash-deletes-images')) { log('image to be deleted: '+this.filename); Utils.deleteImage(this.filename); Utils.validate_imagename(this.settings); diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index c7f33ec0..ab4eb258 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -386,14 +386,14 @@ msgstr "" msgid "Error fetching change log: " msgstr "" -#: utils.js:414 utils.js:417 +#: utils.js:413 utils.js:416 msgid "minutes" msgstr "" -#: utils.js:420 +#: utils.js:419 msgid "days" msgstr "" -#: utils.js:423 +#: utils.js:422 msgid "hours" msgstr "" diff --git a/utils.js b/utils.js index bd52fb02..1ebe1592 100644 --- a/utils.js +++ b/utils.js @@ -195,16 +195,15 @@ export function setImageList(settings, imageList) { } } -export function setImageHiddenStatus(settings, hide_image_list, hide_status) { +export function setImageHiddenStatus(settings, hide_image, hide_status) { // get current image list let image_list = getImageList(settings); + log ('image count = '+image_list.length+', hide_image = '+hide_image); image_list.forEach( (x, i) => { - hide_image_list.forEach(u => { - if (u.includes(x.urlbase)) { - // mark as hidden - x.hidden = hide_status; - } - }); + if (hide_image.includes(x.urlbase)) { + // mark as hidden + x.hidden = hide_status; + } }); // export image list back to settings setImageList(settings, image_list); From ea99b27c4b0b9ece9c91480df05853a7c56929aa Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 21 Mar 2024 00:46:30 +1000 Subject: [PATCH 24/25] fix trash images --- extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.js b/extension.js index d747459a..493e2c84 100644 --- a/extension.js +++ b/extension.js @@ -594,7 +594,7 @@ class BingWallpaperIndicator extends Button { if (this._settings.get_boolean('trash-deletes-images')) { log('image to be deleted: '+this.filename); Utils.deleteImage(this.filename); - Utils.validate_imagename(this.settings); + Utils.validate_imagename(this._settings); } } From c4df79874cf50b2471339e2211b11c1a6112b50e Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 21 Mar 2024 01:14:07 +1000 Subject: [PATCH 25/25] bump version in metadata --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 032cb3ff..e7f8505f 100644 --- a/metadata.json +++ b/metadata.json @@ -4,7 +4,7 @@ "name": "Bing Wallpaper", "settings-schema": "org.gnome.shell.extensions.bingwallpaper", "description": "Sync your wallpaper to today's Microsoft Bing image of the day (the image you see when you visit Bing.com).\n\n *Disclaimer*: this extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nFeatures:\n* UHD resolution wallpapers\n* Automatically fetches current Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (user selectable on GNOME versions that support it)\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n * random mode (from previously downloaded wallpapers)\n *NEW: select/cycle wallpaper through previously downloaded images\n* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr), Portuguese (pt), Ukrainian (uk), Russian (ru_RU), Spanish (es), Korean (ko), Indonesian (id), Catalan (ca), Norwegian Bokmål (nb) & Nynorsk (ni), Swedish (sv), Arabic (ar), Hungarian (hu) and Japanese (ja) - a HUGE thanks to the translators\n\nThis extension was forked from the NASA APOD extension by Elinvention (https://github.com/Elinvention) and inspired by Bing Desktop Wallpaper Changer by Utkarsh Gupta (https://github.com/UtkarshGpta).\n\nAlways restart GNOME after manually updating extensions. Please report bugs to the GitHub page below:", - "version": "48", + "version": "49", "url": "https://github.com/neffo/bing-wallpaper-gnome-extension", "gettext-domain": "BingWallpaper" }