From 706cbcefc9cff5f0c5f7071c67d5b03beb6c04f3 Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Fri, 10 Feb 2017 00:24:50 +0100 Subject: [PATCH] Fix for #172: Configuration window hides add/remove buttons by default --- data/weather-settings.ui | 1902 +++++++++++++++++++------------------- src/prefs.js | 26 +- 2 files changed, 946 insertions(+), 982 deletions(-) diff --git a/data/weather-settings.ui b/data/weather-settings.ui index 0c7db46..9fd2133 100644 --- a/data/weather-settings.ui +++ b/data/weather-settings.ui @@ -352,1006 +352,988 @@ - - 775 - 480 + True True - 20 + True - + True False - natural - natural - none + True + True + vertical + + + True + True + in + 300 + 250 + + + True + True + tree-liststore + True + 0 + False + 12 + 1 + + + + + + + + True + True + 0 + + + + + True + False + icons + 1 + + + True + False + list-add + + + False + True + + + + + True + False + list-remove + + + False + True + + + + + True + False + gtk-edit + + + False + True + + + + + False + True + 1 + + + + + + + True + False + Locations + + + False + + + + + True + False + True + True + 10 + 5 + 5 + + + True + False + start + True + Chose default weather provider + + + 0 + 0 + + + + + True + False + start + True + Personal Api key from openweathermap.org + + + 0 + 2 + + + + + True + False + + http://openweathermap.org + http://darksky.net + + + + 1 + 0 + + + + + True + True + 32 + 32 + + + 1 + 2 + + + + + True + True + 32 + 32 + + + 1 + 3 + + + + + True + False + start + True + Personal Api key from Dark Sky + + + 0 + 3 + + + + + True + False + start + True + Refresh timeout for current weather [min] + end + + + 0 + 5 + + + + + True + False + start + True + Refresh timeout for weather forecast [min] + end + + + 0 + 6 + + + + + True + True + number + current-refresh-adjustment + 5 + True + if-valid + 10 + + + 1 + 5 + + + + + True + True + Note: the forecast-timout is not used for Dark Sky, because they do not provide seperate downloads for current weather and forecasts. + number + forecast-refresh-adjustment + 5 + True + 10 + + + 1 + 6 + + + + + True + False + + + 0 + 4 + 2 + + + + + True + False + start + Use extensions api-key for openweathermap.org + + + 0 + 1 + + + + + True + True + Switch off, if you have your own api-key for openweathermap.org and put it into the text-box below. + center + + + 1 + 1 + + + + + 1 + + + + + True + False + Weather provider + + + 1 + False + + + + + True + False + True + True + 10 + 5 + 5 + + + True + False + Chose geolocation provider + + + 0 + 0 + + + + + True + False + + https://nominatim.openstreetmap.org/ + https://geocode.farm/ + https://open.mapquestapi.com/nominatim/ + + + + 1 + 0 + + + + + True + False + Personal AppKey from developer.mapquest.com + + + 0 + 1 + + + + + True + True + True + 32 + 32 + + + 1 + 1 + + + + + 2 + + + + + True + False + Geolocation provider + + + 2 + False + + + + + True + False + True + True + 10 + 5 + 5 + + + True + False + Temperature Unit + + + 0 + 0 + + + + + True + False + Wind Speed Unit + + + 0 + 1 + + + + + True + False + Pressure Unit + + + 0 + 2 + + + + + True + False + + °C + °F + K + °Ra + °Ré + °Rø + °De + °N + + + + 1 + 0 + + + + + True + False + + km/h + mph + m/s + kn + ft/s + Beaufort + + + + 1 + 1 + + + + + True + False + + hPa + inHg + bar + Pa + kPa + atm + at + Torr + psi + mmHg + mbar + + + + 1 + 2 + + + + + 3 + + + + + True + False + Units + + + 3 + False + + + + + True + False + True + True + 10 + 5 + 5 + + + True + False + Position in Panel + + + 0 + 0 + + + + + True + False + Position of menu-box [%] from 0 (left) to 100 (right) + + + 0 + 1 + + + + + True + False + Wind Direction by Arrows + + + 0 + 2 + + + + + True + False + Translate Conditions + + + 0 + 3 + + + + + True + False + Symbolic Icons + + + 0 + 4 + + + + + True + False + Text on buttons + + + 0 + 5 + + + + + True + False + Temperature in Panel + + + 0 + 6 + + + + + True + False + Conditions in Panel + + + 0 + 7 + + + + + True + False + Conditions in Forecast + + + 0 + 8 + + + + + True + False + Center forecast + + + 0 + 9 + + + + + True + False + Number of days in forecast + + + 0 + 10 + + + + + True + False + Maximal number of digits after the decimal point + + + 0 + 11 + + + + + True + False + + Center + Right + Left + + + + 1 + 0 + + + + + 200 + True + True + True + menu-alignment-adjustment + True + False + 100 + + + 1 + 1 + + + + + True + True + center + + + 1 + 2 + + + + + True + True + center + + + 1 + 3 + + + + + True + True + center + + + 1 + 4 + + + + + True + True + center + + + 1 + 5 + + + + + True + True + center + + + 1 + 6 + + + + + True + True + center + + + 1 + 7 + + + + + True + True + center + + + 1 + 8 + + - + True True - True + center + + + 1 + 9 + + + + + True + False + + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + + + 1 + 10 + + + + + True + False + + 0 + 1 + 2 + 3 + + + + 1 + 11 + + + + + 4 + + + + + True + False + Layout + + + 4 + False + + + + + False + 24 + 24 + True + True + vertical + 5 + + + True + False + OpenWeather.png + + + False + True + 10 + 0 + + + + + True + False + <b>Openweather</b> + True + + + False + True + 1 + + + + + True + False + center - - True - False - True - True - vertical - - - True - True - in - 300 - 250 - - - True - True - tree-liststore - True - 0 - False - 12 - 1 - - - - - - - - True - True - 0 - - - - - True - False - icons - 1 - - - True - False - list-add - - - False - True - - - - - True - False - list-remove - - - False - True - - - - - True - False - gtk-edit - - - False - True - - - - - False - True - 1 - - - - - - + True False - Locations + end + Version: + False - False + False + True + 0 - - True - False - True - True - 10 - 5 - 5 - - - True - False - start - True - Chose default weather provider - - - 0 - 0 - - - - - True - False - start - True - Personal Api key from openweathermap.org - - - 0 - 2 - - - - - True - False - - http://openweathermap.org - http://darksky.net - - - - 1 - 0 - - - - - True - True - 32 - 32 - - - 1 - 2 - - - - - True - True - 32 - 32 - - - 1 - 3 - - - - - True - False - start - True - Personal Api key from Dark Sky - - - 0 - 3 - - - - - True - False - start - True - Refresh timeout for current weather [min] - end - - - 0 - 5 - - - - - True - False - start - True - Refresh timeout for weather forecast [min] - end - - - 0 - 6 - - - - - True - True - number - current-refresh-adjustment - 5 - True - if-valid - 10 - - - 1 - 5 - - - - - True - True - Note: the forecast-timout is not used for Dark Sky, because they do not provide seperate downloads for current weather and forecasts. - number - forecast-refresh-adjustment - 5 - True - 10 - - - 1 - 6 - - - - - True - False - - - 0 - 4 - 2 - - - - - True - False - start - Use extensions api-key for openweathermap.org - - - 0 - 1 - - - - - True - True - Switch off, if you have your own api-key for openweathermap.org and put it into the text-box below. - center - - - 1 - 1 - - - - - 1 - - - - + True False - Weather provider + start + unknown (self-build ?) + end + False + True 1 - False - - - - - True - False - True - True - 10 - 5 - 5 - - - True - False - Chose geolocation provider - - - 0 - 0 - - - - - True - False - - https://nominatim.openstreetmap.org/ - https://geocode.farm/ - https://open.mapquestapi.com/nominatim/ - - - - 1 - 0 - - - - - True - False - Personal AppKey from developer.mapquest.com - - - 0 - 1 - - - - - True - True - True - 32 - 32 - - - 1 - 1 - - - - - 2 - - - - - True - False - Geolocation provider - - - 2 - False + + + False + True + 2 + + + + + True + False + <span>Weather extension to display weather information from <a href="https://openweathermap.org/">Openweathermap</a> or <a href="https://darksky.net">Dark Sky</a> for almost all locations in the world.</span> + True + center + True + word-char + 1 + + + False + True + 3 + + + + + True + False + center + 5 - - True - False - True - True - 10 - 5 - 5 - - - True - False - Temperature Unit - - - 0 - 0 - - - - - True - False - Wind Speed Unit - - - 0 - 1 - - - - - True - False - Pressure Unit - - - 0 - 2 - - - - - True - False - - °C - °F - K - °Ra - °Ré - °Rø - °De - °N - - - - 1 - 0 - - - - - True - False - - km/h - mph - m/s - kn - ft/s - Beaufort - - - - 1 - 1 - - - - - True - False - - hPa - inHg - bar - Pa - kPa - atm - at - Torr - psi - mmHg - mbar - - - - 1 - 2 - - - - - 3 - - - - + True False - Units + Maintained by - 3 - False + False + True + 0 - - True - False - True - True - 10 - 5 - 5 - - - True - False - Position in Panel - - - 0 - 0 - - - - - True - False - Position of menu-box [%] from 0 (left) to 100 (right) - - - 0 - 1 - - - - - True - False - Wind Direction by Arrows - - - 0 - 2 - - - - - True - False - Translate Conditions - - - 0 - 3 - - - - - True - False - Symbolic Icons - - - 0 - 4 - - - - - True - False - Text on buttons - - - 0 - 5 - - - - - True - False - Temperature in Panel - - - 0 - 6 - - - - - True - False - Conditions in Panel - - - 0 - 7 - - - - - True - False - Conditions in Forecast - - - 0 - 8 - - - - - True - False - Center forecast - - - 0 - 9 - - - - - True - False - Number of days in forecast - - - 0 - 10 - - - - - True - False - Maximal number of digits after the decimal point - - - 0 - 11 - - - - - True - False - - Center - Right - Left - - - - 1 - 0 - - - - - 200 - True - True - True - menu-alignment-adjustment - True - False - 100 - - - 1 - 1 - - - - - True - True - center - - - 1 - 2 - - - - - True - True - center - - - 1 - 3 - - - - - True - True - center - - - 1 - 4 - - - - - True - True - center - - - 1 - 5 - - - - - True - True - center - - - 1 - 6 - - - - - True - True - center - - - 1 - 7 - - - - - True - True - center - - - 1 - 8 - - - - - True - True - center - - - 1 - 9 - - - - - True - False - - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - - - - 1 - 10 - - - - - True - False - - 0 - 1 - 2 - 3 - - - - 1 - 11 - - - - - 4 - - - - + True - False - Layout + True + Jens Lody (<a href="mailto:openweather@jenslody.de">openweather@jenslody.de</a>) + True - 4 - False + False + True + 1 - - - False - 24 - 24 - True - True - vertical - 5 - - - True - False - OpenWeather.png - - - False - True - 10 - 0 - - - - - True - False - <b>Openweather</b> - True - - - False - True - 1 - - - - - True - False - center - - - True - False - end - Version: - False - - - False - True - 0 - - - - - True - False - start - unknown (self-build ?) - end - - - False - True - 1 - - - - - False - True - 2 - - - - - True - False - <span>Weather extension to display weather information from <a href="https://openweathermap.org/">Openweathermap</a> or <a href="https://darksky.net">Dark Sky</a> for almost all locations in the world.</span> - True - center - True - word-char - 1 - - - False - True - 3 - - - - - True - False - center - 5 - - - True - False - Maintained by - - - False - True - 0 - - - - - True - True - Jens Lody (<a href="mailto:openweather@jenslody.de">openweather@jenslody.de</a>) - True - - - False - True - 1 - - - - - False - True - 4 - - - - - Webpage - True - True - True - - 0.99999999977648257 - center - none - https://github.com/jenslody/gnome-shell-extension-openweather - - - False - True - 5 - - - - - True - True - end - <span size="small">This program comes with ABSOLUTELY NO WARRANTY. + + + False + True + 4 + + + + + Webpage + True + True + True + + 0.99999999977648257 + center + none + https://github.com/jenslody/gnome-shell-extension-openweather + + + False + True + 5 + + + + + True + True + end + <span size="small">This program comes with ABSOLUTELY NO WARRANTY. See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2 or later</a> for details.</span> - True - center - True - - - True - True - 6 - - - - - 5 - - - - - True - False - About - - - 5 - False - - + True + center + True + + True + True + 6 + + + 5 + + + + + True + False + About + + + 5 + False + diff --git a/src/prefs.js b/src/prefs.js index 1ae4917..9dca840 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -119,26 +119,7 @@ const WeatherPrefsWidget = new GObject.Class({ this.initWindow(); - defaultSize = this.MainWidget.get_size_request(); - var borderWidth = this.MainWidget.get_border_width(); - - defaultSize[0] += 2 * borderWidth; - defaultSize[1] += 2 * borderWidth; - - this.MainWidget.set_size_request(-1, -1); - this.MainWidget.set_border_width(0); - this.refreshUI(); - - this.add(this.MainWidget); - this.MainWidget.connect('realize', Lang.bind(this, function() { - if (inRealize) - return; - inRealize = true; - - this.MainWidget.get_toplevel().resize(defaultSize[0], defaultSize[1]); - inRealize = false; - })); }, Window: new Gtk.Builder(), @@ -148,7 +129,7 @@ const WeatherPrefsWidget = new GObject.Class({ this.Window.add_from_file(EXTENSIONDIR + "/weather-settings.ui"); - this.MainWidget = this.Window.get_object("main-widget"); + this.mainWidget = this.Window.get_object("prefs-notebook"); this.treeview = this.Window.get_object("tree-treeview"); this.liststore = this.Window.get_object("tree-liststore"); this.editWidget = this.Window.get_object("edit-widget"); @@ -497,7 +478,7 @@ const WeatherPrefsWidget = new GObject.Class({ }, refreshUI: function() { - this.MainWidget = this.Window.get_object("main-widget"); + this.mainWidget = this.Window.get_object("prefs-notebook"); this.treeview = this.Window.get_object("tree-treeview"); this.liststore = this.Window.get_object("tree-liststore"); @@ -1093,7 +1074,8 @@ function init() { } function buildPrefsWidget() { - let widget = new WeatherPrefsWidget(); + let prefs = new WeatherPrefsWidget(); + let widget = prefs.mainWidget; widget.show_all(); return widget; }