use of org.olat.core.gui.WindowManager in project OpenOLAT by OpenOLAT.
the class BaseFullWebappController method event.
@Override
public void event(Event event) {
if (event == Window.AFTER_VALIDATING) {
// now update the guimessage
List<ZIndexWrapper> places = getWindowControl().getWindowBackOffice().getGuiMessages();
Panel winnerP = null;
int maxZ = -1;
if (places != null) {
// we have places where we can put the gui message
for (Iterator<ZIndexWrapper> it_places = places.iterator(); it_places.hasNext(); ) {
ZIndexWrapper ziw = it_places.next();
int cind = ziw.getZindex();
if (cind > maxZ) {
maxZ = cind;
winnerP = ziw.getPanel();
}
}
} else {
winnerP = guimsgHolder;
}
if (winnerP != null && winnerP != currentMsgHolder) {
currentMsgHolder.setContent(null);
winnerP.setContent(guimsgPanel);
currentMsgHolder = winnerP;
} else {
currentMsgHolder = guimsgHolder;
currentMsgHolder.setContent(guimsgPanel);
currentMsgHolder.setDirty(guimsgPanel.isDirty());
}
} else if (event instanceof LanguageChangedEvent) {
LanguageChangedEvent lce = (LanguageChangedEvent) event;
UserRequest ureq = lce.getCurrentUreq();
getTranslator().setLocale(lce.getNewLocale());
initialize(ureq);
WindowManager winman = Windows.getWindows(ureq).getWindowManager();
initializeBase(ureq, winman, initialPanel);
initialPanel.setContent(mainVc);
reload = Boolean.TRUE;
} else if (event instanceof ChiefControllerMessageEvent) {
// msg can be set to show only on one node or on all nodes
updateStickyMessage();
} else if (event instanceof AssessmentModeNotificationEvent) {
try {
processAssessmentModeNotificationEvent((AssessmentModeNotificationEvent) event);
} catch (Exception e) {
logError("", e);
}
}
}
use of org.olat.core.gui.WindowManager in project openolat by klemens.
the class PreferencesFormController method formOK.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formOK(org.olat.core.gui.UserRequest)
*/
protected void formOK(UserRequest ureq) {
UserManager um = UserManager.getInstance();
BaseSecurity secMgr = BaseSecurityManager.getInstance();
// Refresh user from DB to prevent stale object issues
tobeChangedIdentity = secMgr.loadIdentityByKey(tobeChangedIdentity.getKey());
Preferences prefs = tobeChangedIdentity.getUser().getPreferences();
prefs.setLanguage(language.getSelectedKey());
prefs.setFontsize(fontsize.getSelectedKey());
if (notificationInterval != null) {
// only read notification interval if available, could be disabled by configuration
prefs.setNotificationInterval(notificationInterval.getSelectedKey());
}
// Maybe the user changed the font size
if (ureq.getIdentity().equalsByPersistableKey(tobeChangedIdentity)) {
int fontSize = Integer.parseInt(fontsize.getSelectedKey());
WindowManager wm = getWindowControl().getWindowBackOffice().getWindowManager();
if (fontSize != wm.getFontSize()) {
getWindowControl().getWindowBackOffice().getWindow().setDirty(true);
}
}
if (mailSystem != null && mailSystem.isOneSelected()) {
String val = mailSystem.isSelected(1) ? "true" : "false";
prefs.setReceiveRealMail(val);
}
if (um.updateUserFromIdentity(tobeChangedIdentity)) {
// Language change needs logout / login
showInfo("preferences.successful");
} else {
showInfo("preferences.unsuccessful");
}
um.setUserCharset(tobeChangedIdentity, charset.getSelectedKey());
fireEvent(ureq, Event.DONE_EVENT);
}
use of org.olat.core.gui.WindowManager in project OpenOLAT by OpenOLAT.
the class PreferencesFormController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == fontsize && ureq.getIdentity().equalsByPersistableKey(tobeChangedIdentity)) {
int fontSize = Integer.parseInt(fontsize.getSelectedKey());
WindowManager wm = getWindowControl().getWindowBackOffice().getWindowManager();
if (fontSize != wm.getFontSize()) {
getWindowControl().getWindowBackOffice().getWindow().setDirty(true);
}
}
}
use of org.olat.core.gui.WindowManager in project OpenOLAT by OpenOLAT.
the class PreferencesFormController method formOK.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formOK(org.olat.core.gui.UserRequest)
*/
protected void formOK(UserRequest ureq) {
UserManager um = UserManager.getInstance();
BaseSecurity secMgr = BaseSecurityManager.getInstance();
// Refresh user from DB to prevent stale object issues
tobeChangedIdentity = secMgr.loadIdentityByKey(tobeChangedIdentity.getKey());
Preferences prefs = tobeChangedIdentity.getUser().getPreferences();
prefs.setLanguage(language.getSelectedKey());
prefs.setFontsize(fontsize.getSelectedKey());
if (notificationInterval != null) {
// only read notification interval if available, could be disabled by configuration
prefs.setNotificationInterval(notificationInterval.getSelectedKey());
}
// Maybe the user changed the font size
if (ureq.getIdentity().equalsByPersistableKey(tobeChangedIdentity)) {
int fontSize = Integer.parseInt(fontsize.getSelectedKey());
WindowManager wm = getWindowControl().getWindowBackOffice().getWindowManager();
if (fontSize != wm.getFontSize()) {
getWindowControl().getWindowBackOffice().getWindow().setDirty(true);
}
}
if (mailSystem != null && mailSystem.isOneSelected()) {
String val = mailSystem.isSelected(1) ? "true" : "false";
prefs.setReceiveRealMail(val);
}
if (um.updateUserFromIdentity(tobeChangedIdentity)) {
// Language change needs logout / login
showInfo("preferences.successful");
} else {
showInfo("preferences.unsuccessful");
}
um.setUserCharset(tobeChangedIdentity, charset.getSelectedKey());
fireEvent(ureq, Event.DONE_EVENT);
}
use of org.olat.core.gui.WindowManager in project openolat by klemens.
the class PreferencesFormController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == fontsize && ureq.getIdentity().equalsByPersistableKey(tobeChangedIdentity)) {
int fontSize = Integer.parseInt(fontsize.getSelectedKey());
WindowManager wm = getWindowControl().getWindowBackOffice().getWindowManager();
if (fontSize != wm.getFontSize()) {
getWindowControl().getWindowBackOffice().getWindow().setDirty(true);
}
}
}
Aggregations