Compatibility with gnome-shell 3.10

yahoo_weather
Jens Lody 11 years ago
parent dda527ec38
commit 712bd6458e
  1. 2
      data/metadata.json.in
  2. 6
      data/stylesheet.css
  3. 10
      src/extension.js
  4. 7
      src/prefs.js

@ -2,7 +2,7 @@
"uuid": "@uuid@", "uuid": "@uuid@",
"name": "Weather", "name": "Weather",
"description": "A simple extension for displaying weather information from several cities in GNOME Shell", "description": "A simple extension for displaying weather information from several cities in GNOME Shell",
"shell-version": [ "3.4", "3.5", "3.6" ], "shell-version": [ "3.4", "3.5", "3.6", "3.8", "3.10" ],
"localedir": "@LOCALEDIR@", "localedir": "@LOCALEDIR@",
"url": "@url@" "url": "@url@"
} }

@ -7,11 +7,11 @@
} }
.weather-current-databox { .weather-current-databox {
padding: 5px 15px 0px 30px; padding: 5px 15px 0px;
} }
.weather-current-icon { .weather-current-icon {
padding: 0px 30px; padding-right: 30px;
} }
.weather-current-iconbox { .weather-current-iconbox {
@ -33,7 +33,7 @@
} }
.weather-forecast-icon { .weather-forecast-icon {
padding: 0 15px 0px 25px; padding-right: 15px;
} }
.weather-forecast-databox { .weather-forecast-databox {

@ -196,12 +196,16 @@ const WeatherMenuButton = new Lang.Class({
this._futureWeather = new St.Bin({ style_class: 'forecast'}); this._futureWeather = new St.Bin({ style_class: 'forecast'});
// Putting the popup item together // Putting the popup item together
this.menu.addActor(this._currentWeather); this._itemCurrent = new PopupMenu.PopupBaseMenuItem({reactive:false,style_class: 'current'});
this._itemCurrent.actor.add_actor(this._currentWeather);
this.menu.addMenuItem(this._itemCurrent);
let item = new PopupMenu.PopupSeparatorMenuItem(); let item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
this.menu.addActor(this._futureWeather); this._itemFuture = new PopupMenu.PopupBaseMenuItem({reactive:false,style_class: 'forecast'});
this._itemFuture.actor.add_actor(this._futureWeather);
this.menu.addMenuItem(this._itemFuture);
let item = new PopupMenu.PopupSeparatorMenuItem(); let item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
@ -517,7 +521,7 @@ const WeatherMenuButton = new Lang.Class({
item = new PopupMenu.PopupMenuItem(this.extractLocation(cities[i])); item = new PopupMenu.PopupMenuItem(this.extractLocation(cities[i]));
item.location = i; item.location = i;
if(i == this._actual_city) if(i == this._actual_city)
item.setShowDot(true); item.setOrnament(PopupMenu.Ornament.DOT);
this._selectCity.menu.addMenuItem(item); this._selectCity.menu.addMenuItem(item);
item.connect('activate', function(actor,event) item.connect('activate', function(actor,event)
{ {

@ -280,7 +280,8 @@ Extends: Gtk.Box,
let entry = new Gtk.Entry(); let entry = new Gtk.Entry();
let completion = new Gtk.EntryCompletion(); let completion = new Gtk.EntryCompletion();
entry.set_completion(completion); entry.set_completion(completion);
let completionModel = new Gtk.ListStore.new([GObject.TYPE_STRING]); let completionModel = new Gtk.ListStore;
completionModel.set_column_types([GObject.TYPE_STRING]);
completion.set_model(completionModel); completion.set_model(completionModel);
completion.set_text_column(0); completion.set_text_column(0);
completion.set_popup_single_match(true); completion.set_popup_single_match(true);
@ -501,14 +502,14 @@ Extends: Gtk.Box,
let path = this.actual_city; let path = this.actual_city;
if(arguments[0]) if(arguments[0])
path = arguments[0]; path = arguments[0];
path = new Gtk.TreePath.new_from_string(String(path)); path = Gtk.TreePath.new_from_string(String(path));
this.treeview.get_selection().select_path(path); this.treeview.get_selection().select_path(path);
}, },
loadJsonAsync : function(url, fun, id) loadJsonAsync : function(url, fun, id)
{ {
let here = this; let here = this;
let message = new Soup.Message.new('GET', url); let message = Soup.Message.new('GET', url);
if(typeof this.asyncSession == "undefined") if(typeof this.asyncSession == "undefined")
this.asyncSession = {}; this.asyncSession = {};

Loading…
Cancel
Save