Skip to content
Snippets Groups Projects
Commit 181ac51b authored by dfurrer's avatar dfurrer
Browse files

OO-1698: added name argument for locked message

parent 025722df
No related branches found
No related tags found
No related merge requests found
...@@ -175,7 +175,9 @@ public class IQManager implements UserDataDeletable { ...@@ -175,7 +175,9 @@ public class IQManager implements UserDataDeletable {
// -- VERY RARE CASE -- 1) qti is open in an editor session right now on the screen (or session on the way to timeout) // -- VERY RARE CASE -- 1) qti is open in an editor session right now on the screen (or session on the way to timeout)
// -- 99% of cases -- 2) qti is ready to be run as test/survey // -- 99% of cases -- 2) qti is ready to be run as test/survey
if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(res, null)){ if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(res, null)){
GenericMainController glc = createLockedMessageController(ureq, wControl); LockResult lockEntry = CoordinatorManager.getInstance().getCoordinator().getLocker().aquirePersistentLock(res, ureq.getIdentity(), null);
String fullName = userManager.getUserDisplayName(lockEntry.getOwner());
GenericMainController glc = createLockedMessageController(ureq, wControl, fullName);
return glc; return glc;
}else{ }else{
Controller controller = new IQDisplayController(resolver, type, secCallback, ureq, wControl); Controller controller = new IQDisplayController(resolver, type, secCallback, ureq, wControl);
...@@ -185,14 +187,14 @@ public class IQManager implements UserDataDeletable { ...@@ -185,14 +187,14 @@ public class IQManager implements UserDataDeletable {
} }
} }
private GenericMainController createLockedMessageController(UserRequest ureq, WindowControl wControl) { private GenericMainController createLockedMessageController(UserRequest ureq, WindowControl wControl, String fullName) {
//wrap simple message into mainLayout //wrap simple message into mainLayout
GenericMainController glc = new GenericMainController(ureq, wControl) { GenericMainController glc = new GenericMainController(ureq, wControl) {
@Override @Override
public void init(UserRequest ureq) { public void init(UserRequest ureq) {
Panel empty = new Panel("empty"); Panel empty = new Panel("empty");
setTranslator(Util.createPackageTranslator(this.getClass(), ureq.getLocale())); setTranslator(Util.createPackageTranslator(this.getClass(), ureq.getLocale()));
Controller contentCtr = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), translate("status.currently.locked.title"), translate("status.currently.locked")); Controller contentCtr = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), translate("status.currently.locked.title"), translate("status.currently.locked", fullName));
listenTo(contentCtr); // auto dispose later listenTo(contentCtr); // auto dispose later
Component resComp = contentCtr.getInitialComponent(); Component resComp = contentCtr.getInitialComponent();
LayoutMain3ColsController columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), empty, resComp, /*do not save no prefs*/null); LayoutMain3ColsController columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), empty, resComp, /*do not save no prefs*/null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment