mirror of
https://github.com/Hopiu/RandomWallpaperGnome3.git
synced 2026-03-16 22:20:24 +00:00
rebuild history list on history change
This commit is contained in:
parent
b96eab2f34
commit
f282c53bd9
2 changed files with 7 additions and 4 deletions
|
|
@ -152,8 +152,6 @@ var RandomWallpaperEntry = new Lang.Class({
|
|||
});
|
||||
|
||||
this.menu.actor.connect('show', function () {
|
||||
wallpaperController.update();
|
||||
this.setHistoryList(); // TODO: move this call to a new background changed hook (because overhead on close)
|
||||
this.newWallpaperItem.show();
|
||||
}.bind(this));
|
||||
|
||||
|
|
@ -167,6 +165,7 @@ var RandomWallpaperEntry = new Lang.Class({
|
|||
wallpaperController.resetWallpaper();
|
||||
});
|
||||
|
||||
settings.observe('history', this.setHistoryList.bind(this));
|
||||
},
|
||||
|
||||
setCurrentBackgroundElement: function () {
|
||||
|
|
@ -182,6 +181,7 @@ var RandomWallpaperEntry = new Lang.Class({
|
|||
},
|
||||
|
||||
setHistoryList: function () {
|
||||
wallpaperController.update();
|
||||
this.setCurrentBackgroundElement();
|
||||
|
||||
this.historySection.removeAll();
|
||||
|
|
|
|||
|
|
@ -245,13 +245,16 @@ var RandomWallpaperSettings = new Lang.Class({
|
|||
|
||||
_bindButtons: function () {
|
||||
let newWallpaperButton = this._builder.get_object('request-new-wallpaper');
|
||||
let origNewWallpaperText = newWallpaperButton.get_label();
|
||||
newWallpaperButton.connect('clicked', () => {
|
||||
let text = newWallpaperButton.get_label();
|
||||
newWallpaperButton.set_label("Loading ...");
|
||||
newWallpaperButton.set_sensitive(false);
|
||||
|
||||
this._wallpaperController.update();
|
||||
this._wallpaperController.fetchNewWallpaper(()=>{
|
||||
this._wallpaperController.update();
|
||||
newWallpaperButton.set_label(text);
|
||||
newWallpaperButton.set_label(origNewWallpaperText);
|
||||
newWallpaperButton.set_sensitive(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue