add LanguageEditWindow

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-04-17 13:23:35 +02:00 committed by Thomas Lamprecht
parent 7a3bb07a8d
commit 7029d72ad2
2 changed files with 44 additions and 0 deletions

View File

@ -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
View 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__');
},
});