View Issue Details

IDProjectCategoryView StatusLast Update
0019269MediaMonkey 5Extensions frameworkpublic2022-08-30 23:50
Reporterzvezdan Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionreopened 
Fixed in Version5.0.4 
Summary0019269: There are methods that are working only from the main window
DescriptionMany objects/methods are working only from the main window, but there are situations when they are needed to work from dialog boxes as well, e.g. if a dialog box is modeless.

MM4 didn't have such issues. For example, I could have used SDB.MainTracksWindow.Refresh in dialog box and it would refresh the main tracklist without any problem. But it is not such case with uitools.refreshView() in MM5.

Here are objects and/or methods that doesn't work correctly within dialog boxes or they could cause errors:
- uitools (any method),
- nodeUtils (any method),
- navUtils (any method),
- ... (to be added).

I am using var __window = app.dialogs.getMainWindow()._window as a workaround, but I think that you should make it easier for scipters and allow their use in dialog boxes without workarounds.
TagsNo tags attached.
Fixed in build2659

Activities

Ludek

2022-07-22 10:40

developer   ~0068870

Last edited: 2022-07-22 15:15

Yes, the mentioned methods are performed in the window context so they really are executed for the current window.

As for the
__window = app.dialogs.getMainWindow()._window

I think this is quite dangerous workaround as then also methods that are meant to be performed in the dialog window context are performed in the Main window.
(e.g. window.uitools.unselectAllText)

Nevertheless you are true that methods like window.uitools.refreshView are probably always meant to be executed within the main window -- so tweaking them makes sense.

Something like:
if (!window.isMainWindow) {
     var mainWnd = app.dialogs.getMainWindow();
     mainWnd.getValue('uitools').refreshView();
}

Ludek

2022-07-22 15:29

developer   ~0068879

Last edited: 2022-07-22 15:31

Fixed in 5.0.4.2658

i.e. uitools.refrehView, whole navUtils and nodeUtils are now always executed in the main window context (because of the following code change):
image.png (26,576 bytes)   
image.png (26,576 bytes)   

zvezdan

2022-07-22 17:00

updater   ~0068881

Maybe not only uitools.refrehView() from uitools, but others as well, like uitools.getSelectedTracklist().

Ludek

2022-08-01 15:12

developer   ~0068950

Last edited: 2022-08-01 15:22

Re-opened as this caused a regression in 2658:

Accessing Properties > Classification throws exception now (because of the changes to nodeUtils for the related Playlists tree there).

The reason is that Properties dialog uses TrackPlaylistsTree component that defines some own nodeHandlers in the Properties window context, but nodeUtils accesses nodeHandlers of the main window instead.

So I reverted the "fix" in 2658 for nodeUtils (to keep the window context again).

=> Fixed in 2659

peke

2022-08-30 23:50

developer   ~0069099

Verified 2661

No new regressions found