add LanguageEditWindow
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
7a3bb07a8d
commit
7029d72ad2
1
Makefile
1
Makefile
@ -39,6 +39,7 @@ JSSRC= \
|
||||
window/Edit.js \
|
||||
window/PasswordEdit.js \
|
||||
window/TaskViewer.js \
|
||||
window/LanguageEdit.js \
|
||||
node/APT.js \
|
||||
node/NetworkEdit.js \
|
||||
node/NetworkView.js \
|
||||
|
43
window/LanguageEdit.js
Normal file
43
window/LanguageEdit.js
Normal file
@ -0,0 +1,43 @@
|
||||
Ext.define('Proxmox.window.LanguageEditWindow', {
|
||||
extend: 'Ext.window.Window',
|
||||
alias: 'widget.pmxLanguageEditWindow',
|
||||
|
||||
cookieName: 'PVELangCookie',
|
||||
|
||||
title: gettext('Language'),
|
||||
modal: true,
|
||||
bodyPadding: 10,
|
||||
items: [
|
||||
{
|
||||
xtype: 'proxmoxLanguageSelector',
|
||||
fieldLabel: gettext('Language'),
|
||||
},
|
||||
],
|
||||
|
||||
buttons: [
|
||||
{
|
||||
text: gettext('OK'),
|
||||
handler: function() {
|
||||
let me = this;
|
||||
let win = this.up('window');
|
||||
let value = win.down('proxmoxLanguageSelector').getValue();
|
||||
let dt = Ext.Date.add(new Date(), Ext.Date.YEAR, 10);
|
||||
Ext.util.Cookies.set(win.cookieName, value, dt);
|
||||
win.mask(gettext('Please wait...'), 'x-mask-loading');
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
initComponent: function() {
|
||||
let me = this;
|
||||
|
||||
if (!me.cookieName) {
|
||||
throw "no cookie name given";
|
||||
}
|
||||
|
||||
me.callParent();
|
||||
me.down('proxmoxLanguageSelector')
|
||||
.setValue(Ext.util.Cookies.get(me.cookieName) || '__default__');
|
||||
},
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user