From f9f97dcaaa0b7d51a4b4193ba3802b3d0ba10441 Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Fri, 16 Oct 2015 22:55:43 +0200 Subject: [PATCH] Add notification, if an api-key is missing. --- src/extension.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/extension.js b/src/extension.js index 8f0a756..c4faf12 100644 --- a/src/extension.js +++ b/src/extension.js @@ -362,6 +362,10 @@ const OpenweatherMenuButton = new Lang.Class({ this.refreshWeatherForecast = OpenweathermapOrg.refreshWeatherForecast; this.weatherProvider = "https://openweathermap.org/"; + + if (this._appid.toString().trim() == '') + Main.notify("Openweather", _("Openweathermap.org does not work without an api-key.\nPlease register at http://openweathermap.org/appid and paste your personal key into the preferences dialog.")); + }, useForecastIo: function() { @@ -407,6 +411,9 @@ const OpenweatherMenuButton = new Lang.Class({ if (fc_locales.indexOf(locale) != -1) this.fc_locale = locale; } + + if (this._appid_fc.toString().trim() !== '') + Main.notify("Openweather", _("Forecast.io does not work without an api-key.\nPlease register at https://developer.forecast.io/register and paste your personal key into the preferences dialog.")); }, getWeatherProviderURL: function() {