make the close button close the window

This commit is contained in:
Damien Churchill 2009-04-08 20:35:35 +00:00
parent 62375c7109
commit 8a51a5e978

View File

@ -35,7 +35,9 @@ Copyright:
this.resizable = false; this.resizable = false;
this.title = _('Preferences'); this.title = _('Preferences');
this.buttons = [{ this.buttons = [{
text: _('Close') text: _('Close'),
handler: this.onCloseButtonClick,
scope: this
},{ },{
text: _('Apply') text: _('Apply')
},{ },{
@ -81,6 +83,10 @@ Copyright:
this.on('show', this.onShow.bindWithEvent(this)); this.on('show', this.onShow.bindWithEvent(this));
}, },
onCloseButtonClick: function() {
this.hide();
},
addPage: function(name, page) { addPage: function(name, page) {
var store = this.categoriesGrid.getStore(); var store = this.categoriesGrid.getStore();
store.loadData([[name]], true); store.loadData([[name]], true);
@ -97,7 +103,9 @@ Copyright:
}, },
onShow: function() { onShow: function() {
if (!this.categoriesGrid.getSelectionModel().hasSelection()) {
this.categoriesGrid.getSelectionModel().selectFirstRow();
}
} }
}); });