From 98639d5c002cea5250a06233d056b6e05eea284e Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 21 Sep 2022 14:58:30 +1000 Subject: [PATCH] Version 42 (#177) * wrap refresh title #175 * update ru translation #14 * don't change popup-menu-item CSS system wide * add support for Gnome 43 * support libsoup3 (GNOME 43+, some version of GNOME 42) * improve useragent string * clean up errors on first start * Fix libsoup3 json request * clean up menu * setup CodeQL (code scanning) * small readme cleanups Co-authored-by: Christopher Snowhill --- .github/workflows/codeql-analysis.yml | 74 ++++ README.md | 16 +- extension.js | 179 +++++---- locale/BingWallpaper.pot | 66 ++-- locale/ru_RU/LC_MESSAGES/BingWallpaper.mo | Bin 3891 -> 9278 bytes locale/ru_RU/LC_MESSAGES/BingWallpaper.po | 431 +++++++++++++++------- metadata.json | 6 +- prefs.js | 12 +- stylesheet.css | 3 - utils.js | 71 +--- 10 files changed, 543 insertions(+), 315 deletions(-) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..6c96ed67 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,74 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '15 1 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/README.md b/README.md index 9631df3c..eeb5c4bb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # GNOME Shell extension - Bing Wallpaper -A lightweight extension that brings some color to your desktop by syncing your desktop and lockscreen wallpapers with today's Microsoft Bing image of the day (the image you see when you visit Bing.com). The intention of this extension is to just do what it needs to do and stay out of your way, with a few optional features to improve quality-of-life. +Bring some color to your GNOME desktop by syncing your desktop and lockscreen wallpapers with today's Microsoft Bing image of the day (the image you see when you visit Bing.com) with this extension. The intention of this extension is to just do what it needs to do and stay out of your way, with a few optional features to improve quality-of-life. -![Screenshot](/screenshot/notification.png) +[![Get it on GNOME extensions](/screenshot/get_it_on_gnome_extensions.png)](https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/) [![<3 Sponsor this project on GitHub <3](/screenshot/sponsor.png)](https://github.com/sponsors/neffo) -This extension is based extensively on the NASA APOD extension by [Elinvention](https://github.com/Elinvention) -and inspired by Bing Desktop WallpaperChanger by [Utkarsh Gupta](https://github.com/UtkarshGpta). As featured on [OMG! Ubuntu](https://www.omgubuntu.co.uk/2017/07/bing-wallpaper-changer-gnome-extension). Lockscreen blur code is based on [Pratap-Kumar's extension.](https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen) +![Screenshot](/screenshot/notification.png) -Also, check out my related [Google Earth View wallpaper extension](https://github.com/neffo/earth-view-wallpaper-gnome-extension) and the partially-derived [Bing Desktop Wallpaper for Cinnamon](https://github.com/Starcross/bing-wallpaper-cinnamon) by Starcross. +As featured on [OMG! Ubuntu](https://www.omgubuntu.co.uk/2017/07/bing-wallpaper-changer-gnome-extension). -[![Get it on GNOME extensions](/screenshot/get_it_on_gnome_extensions.png)](https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/) [![<3 Sponsor this project on GitHub <3](/screenshot/sponsor.png)](https://github.com/sponsors/neffo) +Also, check out my related [Google Earth View wallpaper extension](https://github.com/neffo/earth-view-wallpaper-gnome-extension) and the partially-derived [Bing Desktop Wallpaper for Cinnamon](https://cinnamon-spices.linuxmint.com/applets/view/320) applet by Starcross. ## Features @@ -19,7 +18,7 @@ Also, check out my related [Google Earth View wallpaper extension](https://githu * Image gallery to view, select and curate stored images * Optionally delete old images after a week, or you can keep (and curate) them forever * Override the lockscreen blur -* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN), French (fr_FR), Portuguese (pt, pt_BR), Russian (ru_RU), Spanish (es), Korean (ko, ko_KR, ko_KP), 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 +* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr_FR), Portuguese (pt, pt_BR), 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 * Image preview in menus & ability to manually set wallpapers individually or copy image to clipboard * A selection of different theme-aware indicator (tray) icons to choose (or hide it completely) @@ -91,7 +90,8 @@ This extension is unofficial and not affiliated with Bing or Microsoft in any wa ## Special Thanks -I'd like to give a special shout out to those who have [contributed code and translations](https://github.com/neffo/bing-wallpaper-gnome-extension/graphs/contributors) as well as everyone who has reported bugs or provided feedback and suggestions for improvements. Also, thanks to Microsoft for this great API and wallpaper collection. +This extension is based on the NASA APOD extension by [Elinvention](https://github.com/Elinvention) +and inspired by Bing Desktop WallpaperChanger by [Utkarsh Gupta](https://github.com/UtkarshGpta). Lockscreen blur code is based on [Pratap-Kumar's extension](https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen). I'd like to give a special shout out to those who have [contributed code and translations](https://github.com/neffo/bing-wallpaper-gnome-extension/graphs/contributors) as well as everyone who has reported bugs or provided feedback and suggestions for improvements. Also, thanks to Microsoft for this great API and wallpaper collection. ## License diff --git a/extension.js b/extension.js index 8305932e..788a664a 100644 --- a/extension.js +++ b/extension.js @@ -1,5 +1,5 @@ // Bing Wallpaper GNOME extension -// Copyright (C) 2017-2021 Michael Carroll +// Copyright (C) 2017-2022 Michael Carroll // 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 @@ -7,6 +7,8 @@ // See the GNU General Public License, version 3 or later for details. // Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod +imports.gi.versions.Soup = "2.4"; + const {St, Soup, Gio, GObject, GLib, Clutter, Cogl, Gdk} = imports.gi; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; @@ -57,13 +59,6 @@ function log(msg) { print('BingWallpaper extension: ' + msg); // disable to keep the noise down in journal } -// pinched from here https://github.com/Odyseus/CinnamonTools (/extensions/MultiTranslatorExtension/js_modules/utils.js) -function soupPrinter(aLog, aLevel = null, aDirection = null, aData = null) { - if (aLevel && aDirection && aData) { - log('Soup: '+String(aData)); - } -} - function notifyError(msg) { Main.notifyError("BingWallpaper extension error", msg); } @@ -125,6 +120,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { } this.refreshDueItem = new PopupMenu.PopupMenuItem(_("")); + this._wrapLabelItem(this.refreshDueItem); //this.showItem = new PopupMenu.PopupMenuItem(_("Show description")); this.titleItem = new PopupMenu.PopupMenuItem(_("Awaiting refresh...")); //FIXME: clean this up this._wrapLabelItem(this.titleItem); @@ -212,15 +208,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { } } - // create soup Session, set proxy resolver and hook up the logger + // create soup Session _initSoup() { this.httpSession = new Soup.Session(); - if (this._settings.get_boolean('debug-logging')) { - this.logger = Soup.Logger.new(Soup.LoggerLogLevel.HEADERS, -1); - this.logger.attach(this.httpSession); - this.logger.set_printer(soupPrinter); - } - Soup.Session.prototype.add_feature.call(this.httpSession, new Soup.ProxyResolverDefault()); // unclear if this is necessary + this.httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + imports.misc.config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + Me.metadata.version; } // listen for configuration changes @@ -264,8 +255,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.titleItem.setSensitive(!this._updatePending && this.imageinfolink != ""); let maxlongdate = Utils.getMaxLongDate(this._settings); this.refreshduetext = - _("Next refresh") + ": " + (this.refreshdue ? this.refreshdue.format("%X") : '-') + " (" + Utils.friendly_time_diff(this.refreshdue) + "), " + - _("Last updated") + ": " + (maxlongdate? this._localeDate(maxlongdate, true) : '-'); + _("Next refresh") + ": " + (this.refreshdue ? this.refreshdue.format("%Y-%m-%d %X") : '-') + " (" + Utils.friendly_time_diff(this.refreshdue) + ")\n" + + _("Last refresh") + ": " + (maxlongdate? this._localeDate(maxlongdate, true) : '-'); this.refreshDueItem.label.set_text(this.refreshduetext); } @@ -347,8 +338,13 @@ class BingWallpaperIndicator extends PanelMenu.Button { // convert longdate format into human friendly format _localeDate(longdate, include_time = false) { - let date = Utils.dateFromLongDate(longdate, 300); // date at update - return date.to_local().format('%Y-%m-%d' + (include_time? ' %X' : '')); // ISO 8601 - https://xkcd.com/1179/ + try { + let date = Utils.dateFromLongDate(longdate, 300); // date at update + return date.to_local().format('%Y-%m-%d' + (include_time? ' %X' : '')); // ISO 8601 - https://xkcd.com/1179/ + } + catch (e) { + return 'none'; + } } // set menu text in lieu of a notification/popup @@ -494,31 +490,58 @@ class BingWallpaperIndicator extends PanelMenu.Button { return; this._updatePending = true; this._restartTimeout(); + let market = this._settings.get_string('market'); - //this._initSoup(); // get new session, incase we aren't detecting proxy changes - // create an http message - let url = BingImageURL + (market != 'auto' ? market : ''); - let request = Soup.Message.new('GET', url); - log('fetching: ' + url); + if (Soup.MAJOR_VERSION >= 3) { + let url = BingImageURL; + let params = Utils.BingParams; + params['mkt'] = ( market != 'auto' ? market : '' ); - // queue the http request - this.httpSession.queue_message(request, (httpSession, message) => { - if (message.status_code == 200) { - let data = message.response_body.data; - log('Recieved ' + data.length + ' bytes'); - this._parseData(data); - if (this.selected_image != 'random') - this._selectImage(); - } else if (message.status_code == 403) { - log('Access denied: ' + message.status_code); - this._updatePending = false; - this._restartTimeout(TIMEOUT_SECONDS_ON_HTTP_ERROR); - } else { - log('Network error occured: ' + message.status_code); - this._updatePending = false; - this._restartTimeout(TIMEOUT_SECONDS_ON_HTTP_ERROR); + let request = Soup.Message.new_from_encoded_form('GET', url, Soup.form_encode_hash(params)); + request.request_headers.append('Accept', 'application/json'); + + try { + this.httpSession.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null, (httpSession, message) => { + this._processMessageRefresh(message); + }); } - }); + catch(error) { + log('unable to send libsoup json message '+error); + } + } + else { + let url = BingImageURL + '?format=js&idx=0&n=8&mbl=1&mkt=' + (market != 'auto' ? market : ''); + let request = Soup.Message.new('GET', url); + request.request_headers.append('Accept', 'application/json'); + //log('fetching: ' + message.get_uri().to_string(false)); + + // queue the http request + try { + this.httpSession.queue_message(request, (httpSession, message) => { + this._processMessageRefresh(message); + }); + } + catch (error) { + log('unable to send libsoup json message '+error); + } + } + } + + _processMessageRefresh(message) { + try { + let data = (Soup.MAJOR_VERSION >= 3) ? + ByteArray.toString(this.httpSession.send_and_read_finish(message).get_data()): // Soup3 + message.response_body.data; // Soup 2 + log('Recieved ' + data.length + ' bytes'); + this._parseData(data); + if (this.selected_image != 'random') + this._selectImage(); + } + catch (error) { + log('Network error occured: ' + error); + this._updatePending = false; + this._restartTimeout(TIMEOUT_SECONDS_ON_HTTP_ERROR); + } } // sets a timer for next refresh of Bing metadata @@ -708,35 +731,59 @@ class BingWallpaperIndicator extends PanelMenu.Button { // download and process new image // FIXME: improve error handling _downloadImage(url, file) { - log("Downloading " + url + " to " + file.get_uri()); + log("Downloading " + url + " to " + file.get_uri()); let request = Soup.Message.new('GET', url); // queue the http request - this.httpSession.queue_message(request, (httpSession, message) => { - // request completed - this._updatePending = false; - if (message.status_code == 200) { - file.replace_contents_bytes_async( - message.response_body.flatten().get_as_bytes(), - null, - false, - Gio.FileCreateFlags.REPLACE_DESTINATION, - null, - (file, res) => { - try { - file.replace_contents_finish(res); - this._setBackground(); - log('Download successful'); - } catch(e) { - log('Error writing file: ' + e); - } - } - ); - } else { - log('Couldn\'t fetch image from ' + url); - file.delete(null); + try { + if (Soup.MAJOR_VERSION >= 3) { + this.httpSession.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null, (httpSession, message) => { + // request completed + this._updatePending = false; + this._processFileDownload(message, file); + }); } - }); + else { + this.httpSession.queue_message(request, (httpSession, message) => { + // request completed + this._updatePending = false; + this._processFileDownload(message, file); + }); + } + + } + catch (error) { + log('error sending libsoup message '+error); + } + } + + _processFileDownload(message, file) { + try { + let data = (Soup.MAJOR_VERSION >= 3) ? + this.httpSession.send_and_read_finish(message).get_data(): + message.response_body.flatten().get_as_bytes(); + + file.replace_contents_bytes_async( + data, + null, + false, + Gio.FileCreateFlags.REPLACE_DESTINATION, + null, + (file, res) => { + try { + file.replace_contents_finish(res); + this._setBackground(); + log('Download successful'); + } + catch(e) { + log('Error writing file: ' + e); + } + } + ); + } + catch (error) { + log('Unable download image '+error); + } } // open image in default image view diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index f2f00320..755efa04 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -10,7 +10,7 @@ msgstr "" msgid "Enable desktop notifications" msgstr "" -#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:139 +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:135 msgid "Set background image" msgstr "" @@ -46,7 +46,7 @@ msgstr "" msgid "Bing locale" msgstr "" -#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:142 +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:138 msgid "Settings" msgstr "" @@ -248,98 +248,78 @@ msgstr "" msgid "Load image gallery" msgstr "" -#: extension.js:127 +#: extension.js:122 msgid "" msgstr "" -#: extension.js:129 extension.js:131 extension.js:134 +#: extension.js:125 extension.js:127 extension.js:130 msgid "Awaiting refresh..." msgstr "" -#: extension.js:136 +#: extension.js:132 msgid "Copy image to clipboard" msgstr "" -#: extension.js:137 +#: extension.js:133 msgid "Copy image URL to clipboard" msgstr "" -#: extension.js:138 +#: extension.js:134 msgid "Open image folder" msgstr "" -#: extension.js:140 +#: extension.js:136 msgid "Set lock screen image" msgstr "" -#: extension.js:141 +#: extension.js:137 msgid "Refresh Now" msgstr "" -#: extension.js:267 +#: extension.js:258 msgid "Next refresh" msgstr "" -#: extension.js:268 -msgid "Last updated" +#: extension.js:259 +msgid "Last refresh" msgstr "" -#: extension.js:592 extension.js:622 +#: extension.js:615 extension.js:645 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:649 +#: extension.js:672 msgid "No wallpaper available" msgstr "" -#: extension.js:650 +#: extension.js:673 msgid "No picture for today." msgstr "" -#: prefs.js:168 +#: prefs.js:170 msgid "Select folder" msgstr "" -#: prefs.js:233 +#: prefs.js:229 msgid "Most recent image" msgstr "" -#: prefs.js:234 +#: prefs.js:230 msgid "Random image" msgstr "" -#: utils.js:116 -msgid "Fetching data..." -msgstr "" - -#: utils.js:127 -msgid "Market not available in your region" -msgstr "" - -#: utils.js:131 -msgid "A network error occured" -msgstr "" - -#: utils.js:136 -msgid "Too many requests in 5 seconds" -msgstr "" - -#: utils.js:162 -msgid "No change log found for this release" -msgstr "" - -#: utils.js:168 -msgid "Error fetching change log" +#: utils.js:135 +msgid "Error fetching change log: " msgstr "" -#: utils.js:383 utils.js:386 +#: utils.js:350 utils.js:353 msgid "minutes" msgstr "" -#: utils.js:389 +#: utils.js:356 msgid "days" msgstr "" -#: utils.js:392 +#: utils.js:359 msgid "hours" msgstr "" diff --git a/locale/ru_RU/LC_MESSAGES/BingWallpaper.mo b/locale/ru_RU/LC_MESSAGES/BingWallpaper.mo index 1f3cb8a2ba662315bdc3972904f789e91e51ec72..bcc78b3a5e77a15cfc566da99741b70d27b654fa 100644 GIT binary patch literal 9278 zcmb`LUu+!Lb;fTT*RE;Db<(CylP0}U97k%!r6?(iEsKmPiISB{q#{aI0@OB!yTj#L zyF2TdS6)36eUBW7l;96iBUqw5Uj;UR)F@P;?e~Xn~?B3N+}0`xGDu z`VgSM@7`JN@Q>_1biv`bbLaj!=R4my_s;(GBe#Cb@R{KHJ+4c)81p2!|JV4(=bqb* z`EBsS;D^EW;NOAU!QTPRuN$MT9|Lv&DNy~l-4}x!j zp9J3pKLy@#hcS18>%ooSR`6ah06z|X1JpdPgP#B|gPQLr;D^9>bNnChHtuilGv;&P z-QaJ4+d!?e2bA9-Xu&y9cD?~>+;#9i@EuU=z6%b6w_)5p;3%l|9sxC91%w)NGQU3s zeuVqK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?;&qqN9)w3CDrEFodp|8xTAnvA=*^HN?F!r15=`)bxt6VO5tE*!sYqW*= zrl0xMYE|v5SJ@$Tt-cX7i;fJUX3+4-UQPNzM3+RwLf6Tl(e_QKkN7l581gnbX)+zf znf6a1fxi$MXu6$cHAQD=+8agNYAV)SJWB^=F}hS`wO`1#BXxqz5=qJLX0h7 zU8hY7FAcd!sy_j{+h07w)1>wbZG0<$mo8#br!Xe z!J2;h>B59PwY}I3Vl%Y&U}dMX*#5*`u^ar`v}@Y_+`g*qTXr))lb>b%n!S~;+O_;F z&#T&AwQKf?mT0CLbvp1_1d)cnz=Pawe|L?&~mTURx z{0teba(WYm470?azbor0s7Un`Hhx z25*RohoF>=IYsN1tmLXac2=l>RV3M;9*mk zl$#!|Ahs%9TBLbHq(ps;Hp$|a%Y*JiGKu{b*`INe^mwzrBMH*hP~L;aA0WeN+_>>DaZ zTH5Fe9tkBK=^96lI#@*myCD&!i>_1UbNP?BD~T$md#l0Llzm0cg#X%6ZYrUp+(mo# zqd2a%*k_Q6$#x@@uNFj<4d+^sb4U1wQd*DV(5^TGwvKG4@(up3F?6LaoKy^6k#pG# zoMHB+G(dhv+1G@GJ56+cNwnYvBZe}sOTz9+I=Xbigp^+0$6}{5Wo>6u7=P#aLtow& hR6Z{vtc+MON8Aa8(nRtZ*>u|XR8fV!@<0Et<3Ds!j}HI< diff --git a/locale/ru_RU/LC_MESSAGES/BingWallpaper.po b/locale/ru_RU/LC_MESSAGES/BingWallpaper.po index 610c3c43..1e8781aa 100644 --- a/locale/ru_RU/LC_MESSAGES/BingWallpaper.po +++ b/locale/ru_RU/LC_MESSAGES/BingWallpaper.po @@ -1,209 +1,376 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# msgid "" msgstr "" "Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-04 18:11+1000\n" -"PO-Revision-Date: 2020-03-04 18:20+1000\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" "Language: ru_RU\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.4\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Generator: Poedit 3.1.1\n" -#: Settings.ui.h:1 +#: ui/Settings.ui.h:1 ui/Settings4.ui.h:2 msgid "Hide the indicator" msgstr "Скрыть индикатор" -#: Settings.ui.h:2 -#, fuzzy +#: ui/Settings.ui.h:2 ui/Settings4.ui.h:3 msgid "Indicator icon" -msgstr "Выберите значок индикатора" +msgstr "Значок индикатора" + +#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 +msgid "Enable desktop notifications" +msgstr "Включить уведомления на рабочем столе" -#: Settings.ui.h:3 extension.js:159 +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:139 msgid "Set background image" msgstr "Установить фоновое изображение" -#: Settings.ui.h:4 extension.js:160 -msgid "Set lock screen image" -msgstr "Установить изображение экрана блокировки" +#: ui/Settings.ui.h:5 ui/Settings4.ui.h:6 +msgid "Background style option" +msgstr "Опция стиля фона" -#: Settings.ui.h:5 -msgid "Download folder:" -msgstr "Папка для скачивания:" +#: ui/Settings.ui.h:6 ui/Settings4.ui.h:7 +msgid "Download folder" +msgstr "Папка для загрузки" -#: Settings.ui.h:6 +#: ui/Settings.ui.h:7 ui/Settings4.ui.h:1 msgid "Bing Wallpaper pictures folder" -msgstr "Папка изображений Bing Wallpaper" +msgstr "Папка с картинками для обоев Bing" -#: Settings.ui.h:7 -msgid "Delete previously downloaded wallpapers:" -msgstr "Удалить ранее скачанные обои:" +#: ui/Settings.ui.h:8 ui/Settings4.ui.h:8 +msgid "Open folder" +msgstr "Открыть папку" -#: Settings.ui.h:8 -msgid "Days to store wallpapers before deleting:" -msgstr "Хранить обои перед удалением, дни:" +#: ui/Settings.ui.h:9 ui/Settings4.ui.h:9 +msgid "Delete previously downloaded wallpapers" +msgstr "Удалить ранее загруженные обои" -#: Settings.ui.h:9 -msgid "Bing locale:" -msgstr "Локализация Bing:" +#: ui/Settings.ui.h:10 ui/Settings4.ui.h:10 +msgid "Selected image" +msgstr "Выбранное изображение" -#: Settings.ui.h:10 -msgid "Default is English - United States" -msgstr "По умолчанию - США" +#: ui/Settings.ui.h:11 +msgid "Select from image gallery" +msgstr "Выберите из галереи изображений" -#: Settings.ui.h:11 -msgid "Screen resolution:" -msgstr "Разрешение экрана:" - -#: Settings.ui.h:12 -msgid "Override automatic resolution selection" -msgstr "Изменять автоматически выбранное разрешение" +#: ui/Settings.ui.h:12 ui/Settings4.ui.h:11 +msgid "Bing locale" +msgstr "Языковой стандарт Bing" -#: Settings.ui.h:13 extension.js:162 +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:142 msgid "Settings" msgstr "Настройки" -#: Settings.ui.h:14 -msgid "Gnome shell extension version: " -msgstr "Версия расширения Gnome shell:" +#: ui/Settings.ui.h:14 ui/Settings4.ui.h:13 +msgid "Use custom blur and brightness" +msgstr "Используйте настраиваемое размытие и яркость" -#: Settings.ui.h:15 -msgid "" -"Changes your wallpaper daily to the Bing picture of the day for your region. " -"Displays the picture description and copyright information." +#: ui/Settings.ui.h:15 ui/Settings4.ui.h:14 +msgid "Override GDM3 lockscreen effects" +msgstr "Переопределение эффектов экрана блокировки GDM3" + +#: ui/Settings.ui.h:16 ui/Settings4.ui.h:15 +msgid "Blur can improve readability of login prompt" +msgstr "Размытие может улучшить читаемость для входа в систему" + +#: ui/Settings.ui.h:17 ui/Settings4.ui.h:16 +msgid "Background blur intensity" +msgstr "Интенсивность размытия фона" + +#: ui/Settings.ui.h:18 ui/Settings4.ui.h:17 +msgid "Can improve contrast of login prompt" +msgstr "Может улучшить контрастность приглашения для входа в систему" + +#: ui/Settings.ui.h:19 ui/Settings4.ui.h:18 +msgid "Background brightness" +msgstr "Фоновая яркость" + +#: ui/Settings.ui.h:20 ui/Settings4.ui.h:19 +msgid "Presets" +msgstr "Пресеты" + +#: ui/Settings.ui.h:21 +msgid "Commonly used presets" +msgstr "Часто используемые пресеты" + +#: ui/Settings.ui.h:22 ui/Settings4.ui.h:20 +msgid "No blur, slight dim" +msgstr "Никакого размытия, легкое затемнение" + +#: ui/Settings.ui.h:23 ui/Settings4.ui.h:21 +msgid "GNOME default" +msgstr "GNOME по умолчанию" + +#: ui/Settings.ui.h:24 ui/Settings4.ui.h:22 +msgid "Slight blur, slight dim" +msgstr "Легкое размытие, легкое затемнение" + +#: ui/Settings.ui.h:25 ui/Settings4.ui.h:23 +msgid "Lock Screen" +msgstr "Экран блокировки" + +#: ui/Settings.ui.h:26 ui/Settings4.ui.h:25 +msgid "Debug logging" +msgstr "Ведение журнала отладки" + +#: ui/Settings.ui.h:27 ui/Settings4.ui.h:24 +msgid "Enable logging to system journal" +msgstr "Включить ведение журнала в системный журнал" + +#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 +msgid "Always show new images" +msgstr "Всегда показывайте новые изображения" + +#: ui/Settings.ui.h:29 ui/Settings4.ui.h:26 +msgid "Switch to new images when available (unless on random mode)" msgstr "" -"Ежедневное изменение ваших обоив на изображение дня Bing для вашего региона. " -"Показ уведомлений с описанием изображения и информацией об авторских правах." +"Переключайтесь на новые изображения, когда они доступны (если только не в " +"случайном режиме)" + +#: ui/Settings.ui.h:30 ui/Settings4.ui.h:29 +msgid "Enable all features on Wayland" +msgstr "Включить все функции на Wayland" + +#: ui/Settings.ui.h:31 ui/Settings4.ui.h:28 +msgid "Some newer features may be unstable on Wayland" +msgstr "Некоторые новые функции могут быть нестабильными на Wayland" + +#: ui/Settings.ui.h:32 ui/Settings4.ui.h:30 +msgid "Screen resolution" +msgstr "Разрешение экрана" + +#: ui/Settings.ui.h:33 ui/Settings4.ui.h:31 +msgid "Override automatic resolution selection" +msgstr "Переопределение автоматического выбора разрешения" + +#: ui/Settings.ui.h:34 ui/Settings4.ui.h:32 +msgid "Manually adjust random interval (seconds)" +msgstr "Ручная настройка случайного интервала (секунды)" + +#: ui/Settings.ui.h:35 ui/Settings4.ui.h:33 +msgid "Random interval" +msgstr "Случайный интервал" + +#: ui/Settings.ui.h:36 ui/Settings4.ui.h:34 +msgid "Import Bing Wallpaper data" +msgstr "Импорт данных обоев Bing" + +#: ui/Settings.ui.h:37 ui/Settings4.ui.h:35 +msgid "Import previously exported JSON data from wallpaper directory" +msgstr "Импорт ранее экспортированных данных JSON из каталога обоев" + +#: ui/Settings.ui.h:38 ui/Settings4.ui.h:36 +msgid "Import" +msgstr "Импорт" + +#: ui/Settings.ui.h:39 ui/Settings4.ui.h:37 +msgid "Export Bing Wallpaper data" +msgstr "Экспорт данных обоев Bing" + +#: ui/Settings.ui.h:40 ui/Settings4.ui.h:38 +msgid "Export JSON data to wallpaper dir for backup or data migration" +msgstr "" +"Экспортировать данные JSON в каталог обоев для резервного копирования или " +"переноса данных" + +#: ui/Settings.ui.h:41 ui/Settings4.ui.h:39 +msgid "Export" +msgstr "Экспорт" + +#: ui/Settings.ui.h:42 ui/Settings4.ui.h:40 +msgid "Always export Bing data" +msgstr "Всегда экспортировать большие данные" + +#: ui/Settings.ui.h:43 ui/Settings4.ui.h:41 +msgid "Export Bing JSON whenever data changes" +msgstr "Экспортировать Bing JSON всякий раз, когда данные изменяются" + +#: ui/Settings.ui.h:44 ui/Settings4.ui.h:42 +msgid "Debug options" +msgstr "Параметры отладки" + +#: ui/Settings.ui.h:45 ui/Settings4.ui.h:44 +msgid "New wallpaper images everyday from Bing" +msgstr "Новые изображения обоев каждый день от Bing" + +#: ui/Settings.ui.h:46 +msgid "Gnome shell extension version " +msgstr "Версия расширения Gnome shell " -#: Settings.ui.h:16 +#: ui/Settings.ui.h:47 ui/Settings4.ui.h:46 msgid "Maintained by Michael Carroll" -msgstr "Создано Майклом Кэрроллом" +msgstr "Поддерживается Майклом Кэрроллом" -#: Settings.ui.h:17 -msgid "https://github.com/neffo/bing-wallpaper-gnome-extension" -msgstr "https://github.com/neffo/bing-wallpaper-gnome-extension" +#: ui/Settings.ui.h:48 ui/Settings4.ui.h:47 +msgid "" +"Show your support to the author on Flattr or Github " +"Sponsors." +msgstr "" +"Покажите свою поддержку автору на Flattr или Github " +"Sponsor." + +#: ui/Settings.ui.h:49 ui/Settings4.ui.h:48 +msgid "Changes since last version" +msgstr "Изменения с момента последней версии" -#: Settings.ui.h:18 +#: ui/Settings.ui.h:50 ui/Settings4.ui.h:49 msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" -msgstr "Основано на расширении Gnome shell NASA APOD от Элии Аргентиери" +msgstr "" +"Основано на расширении оболочки NASA APOD Gnome, разработанном Элией " +"Арджентьери" -#: Settings.ui.h:19 +#: ui/Settings.ui.h:51 ui/Settings4.ui.h:50 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General Public License, version 3 or later for details." +"See the GNU General " +"Public License, version 3 or later for details." msgstr "" -"Данное ПО поставляется без каких-либо гарантий.\n" -"Смотри GNU General Public License, версия 3 или позже, чтобы узнать детали." +"его программа поставляется без КАКИХ-ЛИБО ГАРАНТИЙ.\n" +"Посмотрите GNU " +"General Public License, version 3 или позже для получения подробной " +"информации." -#: Settings.ui.h:21 +#: ui/Settings.ui.h:53 ui/Settings4.ui.h:52 msgid "About" -msgstr "О приложении" +msgstr "О программе" -#: extension.js:88 extension.js:91 -#, fuzzy -msgid "minutes" -msgstr "минут" +#: ui/Settings4.ui.h:43 +msgid "Gallery" +msgstr "Галерея" -#: extension.js:94 -#, fuzzy -msgid "days" -msgstr "день" +#: ui/Settings4.ui.h:45 +msgid "GNOME shell extension version " +msgstr "Версия расширения GNOME shell " -#: extension.js:97 -msgid "hours" -msgstr "часа" +#: ui/carousel.ui.h:1 ui/carousel4.ui.h:1 +msgid "Apply" +msgstr "Принять" -#: extension.js:152 -#, fuzzy +#: ui/carousel.ui.h:2 ui/carousel4.ui.h:2 +msgid "View" +msgstr "View" + +#: ui/carousel.ui.h:3 ui/carousel4.ui.h:3 +msgid "Info" +msgstr "Инфо" + +#: ui/carousel.ui.h:4 ui/carousel4.ui.h:4 +msgid "Delete" +msgstr "Удалить" + +#: ui/carousel.ui.h:5 ui/carousel4.ui.h:6 +msgid "Set random mode" +msgstr "Выбрать случайный режим" + +#: ui/carousel4.ui.h:5 +msgid "" +msgstr "<имя изображения здесь>" + +#: ui/carousel4.ui.h:7 +msgid "Load image gallery" +msgstr "Загрузить галерею изображений" + +#: extension.js:127 msgid "" -msgstr "<обновление не запланировано>" +msgstr "<Обновление не запланировано>" -#: extension.js:154 extension.js:155 extension.js:156 -#, fuzzy +#: extension.js:129 extension.js:131 extension.js:134 msgid "Awaiting refresh..." -msgstr "ожидание обновления..." +msgstr "Ожидание обновления." -#: extension.js:157 -#, fuzzy +#: extension.js:136 msgid "Copy image to clipboard" -msgstr "Скопировать в буфер" +msgstr "Скопировать изображение в буфер обмена" -#: extension.js:158 +#: extension.js:137 msgid "Copy image URL to clipboard" -msgstr "Скопировать URL в буфер" +msgstr "Скопировать URL-адрес изображения в буфер обмена" -#: extension.js:161 +#: extension.js:138 +msgid "Open image folder" +msgstr "Открыть папку с изображениями" + +#: extension.js:140 +msgid "Set lock screen image" +msgstr "Установить изображение на экран блокировки" + +#: extension.js:141 msgid "Refresh Now" -msgstr "Обновить сейчас" +msgstr "Обновить" -#: extension.js:203 +#: extension.js:267 msgid "Next refresh" -msgstr "Следующее обновление" +msgstr "Следующее" -#: extension.js:388 -msgid "Bing Wallpaper of the Day for" -msgstr "Изображение дня Bing Wallpaper для" +#: extension.js:268 +msgid "Last updated" +msgstr "Прошлое" -#: extension.js:393 prefs.js:181 -msgid "Market not available in your region" -msgstr "В вашем регионе магазин недоступен" +#: extension.js:592 extension.js:622 +msgid "Bing Wallpaper of the Day for" +msgstr "Bing Обои дня для" -#: extension.js:441 +#: extension.js:649 msgid "No wallpaper available" msgstr "Нет доступных обоев" -#: extension.js:442 +#: extension.js:650 msgid "No picture for today." -msgstr "Нет изображения дня." +msgstr "На сегодня фотографии нет." -#: prefs.js:169 -msgid "Fetching data..." -msgstr "Получение данных..." +#: prefs.js:168 +msgid "Select folder" +msgstr "Выберите папку" -#: prefs.js:185 -msgid "A network error occured" -msgstr "Ошибка сети" +#: prefs.js:233 +msgid "Most recent image" +msgstr "Самое последнее изображение" -#~ msgid "Set wallpaper" -#~ msgstr "Установить обои" +#: prefs.js:234 +msgid "Random image" +msgstr "Случайное изображение" -#~ msgid "Send a notification with explanation when a new image is downloaded." -#~ msgstr "" -#~ "Показывать уведомления с подробностями после скачивания нового " -#~ "изображения." +#: utils.js:116 +msgid "Fetching data..." +msgstr "Выборка данных..." -#~ msgid "Notifications" -#~ msgstr "Уведомления" +#: utils.js:127 +msgid "Market not available in your region" +msgstr "Рынок недоступен в вашем регионе" -#~ msgid "Use transient notifications (auto dismiss)" -#~ msgstr "Использовать всплывающие уведомления (автоотключение)" +#: utils.js:131 +msgid "A network error occured" +msgstr "Произошла сетевая ошибка" -#~ msgid "Show description" -#~ msgstr "Показать описание" +#: utils.js:136 +msgid "Too many requests in 5 seconds" +msgstr "Слишком много запросов за 5 секунд" -#~ msgid "Open extension settings" -#~ msgstr "Открыть настройки расширения" +#: utils.js:162 +msgid "No change log found for this release" +msgstr "Список изменений для этого выпуска не найден" -#~ msgid "Bing website" -#~ msgstr "Сайт Bing" +#: utils.js:168 +msgid "Error fetching change log" +msgstr "Ошибка выборки журнала изменений" -#~ msgid "" -#~ "The selected market is not available in your country or geographic " -#~ "region.\n" -#~ msgstr "" -#~ "Выбранный магазин недоступен в вашей стране или географическом регионе.\n" +#: utils.js:383 utils.js:386 +#, fuzzy +msgid "minutes" +msgstr "минут" -#~ msgid "This market is not available in your region" -#~ msgstr "В вашем регионе магазин недоступен" +#: utils.js:389 +#, fuzzy +msgid "days" +msgstr "дни" + +#: utils.js:392 +#, fuzzy +msgid "hours" +msgstr "часы" diff --git a/metadata.json b/metadata.json index 83ab7154..2aa5da51 100644 --- a/metadata.json +++ b/metadata.json @@ -1,10 +1,10 @@ { "uuid": "BingWallpaper@ineffable-gmail.com", - "shell-version": ["3.36", "3.38", "40", "41", "42"], + "shell-version": ["3.36", "3.38", "40", "41", "42", "43", "43.beta", "43.rc"], "name": "Bing Wallpaper", "settings-schema": "org.gnome.shell.extensions.bingwallpaper", - "description": "Lightweight GNOME shell extension to set 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\nThis extension is based extensively on 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\nFeatures:\n* Fetches Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (user selectable on GNOME versions that support it)\n* Optionally force a specific region (i.e. locale)\n* UHD supported resolutions\n* Only attempts to download wallpapers when they have been updated\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n *NEW: random mode\n *NEW: select wallpaper from previously downloaded images\n* English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN), French (fr_FR), Portuguese (pt, pt_BR), Russian (ru_RU), Spanish (es), Korean (ko, ko_KR, ko_KP), Indonesian (id), Catalan (ca), Norwegian Bokmål (nb) & Nynorsk (ni), Swedish (sv), Arabic (ar), Hungarian (hu) and Finnish (fi_FI) - a HUGE thanks to the translators\n\nAlways restart GNOME after manually updating extensions. Please report bugs to the GitHub page below:", - "version": "41", + "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_FR), Portuguese (pt, pt_BR), 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": "42", "url": "https://github.com/neffo/bing-wallpaper-gnome-extension", "gettext-domain": "BingWallpaper" } diff --git a/prefs.js b/prefs.js index db386adc..cc8208c0 100644 --- a/prefs.js +++ b/prefs.js @@ -1,5 +1,5 @@ // Bing Wallpaper GNOME extension -// Copyright (C) 2017-2021 Michael Carroll +// Copyright (C) 2017-2022 Michael Carroll // 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 @@ -7,6 +7,8 @@ // See the GNU General Public License, version 3 or later for details. // Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod +imports.gi.versions.Soup = "2.4"; + const {Gtk, Gdk, GdkPixbuf, Gio, GLib, Soup} = imports.gi; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -104,13 +106,13 @@ function buildPrefsWidget() { desktop_settings = ExtensionUtils.getSettings(Utils.DESKTOP_SCHEMA); try { httpSession = new Soup.Session(); + httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + imports.misc.config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + Me.metadata.version; } catch (e) { log("Error creating httpSession: " + e); } // check that these are valid (can be edited through dconf-editor) - //Utils.validate_market(settings, marketDescription); Utils.validate_resolution(settings); Utils.validate_icon(settings, icon_image); @@ -189,8 +191,6 @@ function buildPrefsWidget() { log('dropdown selected '+id+' = '+Utils.markets[id]+" - "+Utils.marketName[id]); }); settings.connect('changed::market', () => { - /*Utils.validate_market(settings, marketDescription, lastreq); - lastreq = GLib.DateTime.new_now_utc();*/ marketEntry.set_selected(Utils.markets.indexOf(settings.get_string('market'))); }); settings.connect('changed::download-folder', () => { @@ -210,10 +210,6 @@ function buildPrefsWidget() { }); settings.bind('market', marketEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); - /*settings.connect('changed::market', () => { - Utils.validate_market(settings, marketDescription, lastreq); - lastreq = GLib.DateTime.new_now_utc(); - });*/ settings.connect('changed::download-folder', () => { fileChooserBtn.set_filename(Utils.getWallpaperDir(settings)); }); diff --git a/stylesheet.css b/stylesheet.css index 12a8dd7f..7dc79975 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -1,5 +1,2 @@ -.popup-menu-item:focus, .popup-menu-item:hover { - background-color: rgba(247, 247, 247, 0.1) !important; } - .wp-thumbnail-image:focus, .wp-thumbnail-image:hover { background-color: rgba(247, 247, 247, 0.1) !important; } \ No newline at end of file diff --git a/utils.js b/utils.js index 79f5e362..dbabd0a1 100644 --- a/utils.js +++ b/utils.js @@ -1,5 +1,5 @@ // Bing Wallpaper GNOME extension -// Copyright (C) 2017-2021 Michael Carroll +// Copyright (C) 2017-2022 Michael Carroll // 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 @@ -65,7 +65,8 @@ var backgroundStyle = ['none', 'wallpaper', 'centered', 'scaled', 'stretched', ' var randomIntervals = [300, 3600, 86400, 604800]; var randomIntervalsTitle = ['00:00:05:00', '00:01:00:00', '00:24:00:00', '07:00:00:00']; -var BingImageURL = 'https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=8&mbl=1&mkt='; +var BingImageURL = 'https://www.bing.com/HPImageArchive.aspx'; +var BingParams = { format: 'js', idx: '0' , n: '8' , mbl: '1' , mkt: '' } ; function validate_icon(settings, icon_image = null) { log('validate_icon()'); @@ -100,43 +101,6 @@ function validate_imagename(settings) { } } -function validate_market(settings, marketDescription = null, lastreq = null, httpSession) { - let market = settings.get_string('market'); - if (market == '' || markets.indexOf(market) == -1) { // if not a valid market - settings.reset('market'); - } - // only run this check if called from prefs - let lastReqDiff = lastreq ? GLib.DateTime.new_now_utc().difference(lastreq) : null; // time diff in *micro*seconds - log("last check was " + lastReqDiff + " us ago"); - - if ((marketDescription && lastreq === null) || (lastReqDiff && lastReqDiff > 5000000)) { // rate limit no more than 1 request per 5 seconds - let request = Soup.Message.new('GET', BingImageURL + (market != 'auto' ? market : '')); // + market - log("fetching: " + BingImageURL + (market != 'auto' ? market : '')); - - marketDescription.set_label(_("Fetching data...")); - // queue the http request - httpSession.queue_message(request, function (httpSession, message) { - if (message.status_code == 200) { - let data = message.response_body.data; - log("Recieved " + data.length + " bytes"); - let checkData = JSON.parse(data); - let checkStatus = checkData.market.mkt; - if (market == 'auto' || checkStatus == market) { - marketDescription.set_label('Data OK, ' + data.length + ' bytes recieved'); - } else { - marketDescription.set_label(_("Market not available in your region")); - } - } else { - log("Network error occured: " + message.status_code); - marketDescription.set_label(_("A network error occured") + ": " + message.status_code); - } - }); - } - else { - marketDescription.set_label(_("Too many requests in 5 seconds")); - } -} - function get_current_bg(schema) { let gsettings = new Gio.Settings({ schema: schema }); let cur = gsettings.get_string('picture-uri'); @@ -147,25 +111,28 @@ function fetch_change_log(version, label, httpSession) { // create an http message let url = gitreleaseurl + "v" + version; let request = Soup.Message.new('GET', url); - httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:' + version + ') BingWallpaper Gnome Extension'; + request.request_headers.append('Accept', 'application/json'); log("Fetching " + url); // queue the http request try { - httpSession.queue_message(request, (httpSession, message) => { - if (message.status_code == 200) { + if (Soup.MAJOR_VERSION >= 3) { + httpSession.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null, (httpSession, message) => { + let data = ByteArray.toString(httpSession.send_and_read_finish(message).get_data()); + let text = JSON.parse(data).body; + label.set_label(text); + }); + } + else { + httpSession.queue_message(request, (httpSession, message) => { let data = message.response_body.data; let text = JSON.parse(data).body; label.set_label(text); - } - else { - log("Change log not found: " + message.status_code + "\n" + message.response_body.data); - label.set_label(_("No change log found for this release") + ": " + message.status_code); - } - }); - } - catch (e) { - log("Error fetching change log: " + e); - label.set_label(_("Error fetching change log")); + }); + } + } + catch (error) { + log("Error fetching change log: " + error); + label.set_label(_("Error fetching change log: "+error)); } }