Main topic: the dialog.window property.
Context: a file synchronization script.
Side-topic: missing in documentation.
MAIN TOPIC. I created a button, a while ago, which starts a new lister in dual mode, as wide as possible, with the Synchronize panel open. Within that new lister I then click a button (in fact the same button, which detects the new Sync lister) and this button opens a dialog which guides me through a series of folders that I want to synchronize from one device to another one. By doing this in separate, limited chunks, the file listings in the sychronization panels in Opus are (in my experience) shorter and easier to inspect for changes ("Compare") before hitting the "Synchronize" button. You could do this with separate buttons of course, but I preferred having all those paths in a single button.
Problem was, the progress window, that shows the progress during synchronization, did not show up anymore. Apparently the dialog blocked it. From the moment I closed the dialog while a sync was running, the progress window immediately showed up.
It took me over an hour to figure that I could just change dlg.window=lister; to dlg.window=null;
dlg.window=null;
That's all it took to solve it.
This possibility, and the fact that it sort of fully decouples the dialog from the lister, is not indicated in the description of the Dialog object. On the contrary, the description gives the impression that you need to somehow set the dialog window to an original source (unless it is set automatically, as is the case under certain conditions).
Problem solved.
= = =
CONTEXT (((Off-Topic))) -* For those interested in my sync method*: my corrected button script, slightly shortened.
function OnClick(clickData) {
var arrPaths=[
//------------------------------------------------------------------------
["C:\\Data\\Nord_Modular\\Patches" ,"F:\\BACKUPS\\Nord_Modular\\Patches"]
,["C:\\Users\\me\\Downloads\\Pages" ,"F:\\BACKUPS\\Downloads\\Pages"]
,["C:\\Users\\me\\Downloads\\Notes" ,"F:\\BACKUPS\\Downloads\\Notes"]
,["C:\\Users\\me\\Documents" ,"F:\\BACKUPS\\me\\Documents"]
//------------------------------------------------------------------------
,["F:\\VideoFilms" ,"E:\\SAM_SYNC\\VideoFilms"]
,["F:\\VideoPodcasts" ,"E:\\SAM_SYNC\\VideoPodcasts"]
,["F:\\VideoSongs" ,"E:\\SAM_SYNC\\VideoSongs"]
,["F:\Books" ,"E:\\SAM_SYNC\\Books"]
,["F:\\AudioMusic" ,"E:\\SAM_SYNC\\AudioMusic"]
,["F:\\Magazines" ,"E:\\SAM_SYNC\\Magazines"]
,["F:\\Strips" ,"E:\\SAM_SYNC\\Strips"]
//------------------------------------------------------------------------
,["E:\\VideoSongs" ,"mtp://Galaxy phone/Card/Videos/VideoSongs"]
//------------------------------------------------------------------------
]
var source=arrPaths[0][0];
var target=arrPaths[0][1];
var lister = DOpus.Listers.LastActive();
//If not the "WideView" window: open wide lister and quit
if (lister.title!='WideView') {
var sysinfo = DOpus.Create().SysInfo();
var monitor = sysinfo.WorkAreas(sysinfo.MouseMonitor());
if (monitor.empty) {DOpus.Output('No mouse detected on any monitor - quitting.');return;}
var maxW = monitor.width - 200 - (monitor.width - lister.right);
var maxH = monitor.height - 60;
var cmd = DOpus.Create.Command;
var commandStr = "GO \""+source+"\" NEW=100,40,"+maxW+","+maxH+",notree,dualvert,noviewpane,noutilitypanel,nometapane DUALPATH \""+target+"\" TITLE WideView VIEW=Details"
cmd.RunCommand(commandStr);
return;
}
//Otherwise: Create dialog to confirm or skip each backup:
var cmd = DOpus.Create.Command;
var dlg = DOpus.Dlg; dlg.detach=true;dlg.singleton=true;dlg.top=true;
//dlg.window = lister; <== The bad guy apprently!
dlg.window = null; // <== Solved!
dlg.template = "confirmdialog";
dlg.icon = 'info';
dlg.title = 'Confirm-Skip-Cancel';
if (dlg.Show() == false) return;
var msgobj = dlg.Control("message");var font=dlg.CreateFont('*',10);msgobj.SetFont(font); msgobj.fg='#ffffff';
dlg.FlushMsg();
//Already set up the first backup:
var backupIX = 0;
var source=arrPaths[backupIX][0];
var target=arrPaths[backupIX][1];
var syncParams = "SHOWRESULTS=tab,right DELETE RECURSE IGNORESECONDS DSTCOMPENSATION SHOWEVERYTHING EXCLUDEHIDDEN=no COMPARE=newer,size HIDEUNAFFECTED";
cmd.RunCommand('Find SYNC NOAUTORUN FROM "'+source+'" TO "'+target+'" '+syncParams);
do
{
msgobj.title = "Ready for Backup from:\n<#32ff32>"+source+"</#>\nTo: <#32ff32>"+target+"</#>";
if (backupIX==arrPaths.length-1) msgobj.title += " <#ff00aa> [--last one--]</#>";
var objMsg = dlg.GetMsg();
if (objMsg == false) break;
if (objMsg.event == "focus") continue;
switch (objMsg.control) {
case "btnNext" :
case "btnPrev" :
var count = objMsg.control=="btnNext" ? 1 : -1;
if ((backupIX+count) < 0 || (backupIX+count) > arrPaths.length-1) break;
backupIX+=count; var source=arrPaths[backupIX][0]; var target=arrPaths[backupIX][1];
cmd.RunCommand('Find SYNC NOAUTORUN FROM "'+source+'" TO "'+target+'" '+syncParams);
break;
case "btnRefresh" : break;
case "btnQuit" : objMsg=null;
}
}
while (objMsg);
}
Resources tab (the dialog) :
<resources>
<resource name="confirmdialog" type="dialog">
<dialog height="50" lang="english" width="371">
<control halign="center" height="29" name="message" title="..." type="markuptext" width="360" x="4" y="3" />
<control height="14" name="btnRefresh" title="Refresh" type="button" width="50" x="178" y="34" />
<control height="14" name="btnQuit" title="Quit" type="button" width="50" x="235" y="34" />
<control height="14" name="btnNext" title="Next" type="button" width="50" x="122" y="34" />
<control height="14" name="btnPrev" title="<" type="button" width="17" x="100" y="34" />
</dialog>
</resource>
</resources>
= = =
SIDE-TOPIC: I'm sure if the manual had been some kind of wiki-page system, many of us would already have filled perhaps hundreds of gaps (which the Opus team could always accept or reject). I did not create a new message either for every single issue I've run into, because it's more work, and also, every search in this forum already delivers me more irrelevant pages (with 'stupid' questions of the kind I myself have also posted sometimes) than relevant topics (containing real information). If the manual would have been a wiki, I'm certain I would already have made at least 100 or 150 contributions. Anyway, I just want to say: I recommend a wiki-style manual.