plugdata icon indicating copy to clipboard operation
plugdata copied to clipboard

Savepanel object issues and discrepancy with Vanilla counterpart.

Open sidec opened this issue 1 year ago • 9 comments

There are still problems with savepanel object that makes its behaviour inconsistent with its Vanilla counterpart and overall just inconsistent with other object that deal with file and directory paths, at least on MS Win 10/11 platform.

Firstly, it returns path with backward slashes, in contrast to openpanel and file objects that give and deal with paths constracted with forward slashes (unix style delimeter). This can be dealt with by placing file normalize object after savepanel but obviously this is a hack and shouldn't be necessary.

Secondly, savepanel does not take into account whether a path is given - to open the system dialog at a specific location on the filesystem. This is demonstrated in the patch below by passing the file location from the pdcontrol object. Instead, it opens the file selection dialog at the last location where the system browser was used in pd (for example via openpanel).

Here is the patch that demonstrate forementioned issues.

As mentioned, OS is Windows 11/10, PlugData version 0.9.1

#N canvas 827 239 762 550 12;
#X obj 82 37 bng 25 250 50 0 empty empty empty 17 7 0 10 #e4e4e4 #4d4d4d #373737;
#X obj 82 165 savepanel;
#X obj 283 37 bng 25 250 50 0 empty empty empty 17 7 0 10 #e4e4e4 #4d4d4d #373737;
#X msg 153 71 dir;
#X obj 153 97 pdcontrol;
#X msg 337 71 dir, f 4;
#X obj 337 97 pdcontrol;
#X obj 283 165 openpanel;
#X obj 65 287 file normalize;
#X listbox 65 320 46 0 0 0 - - - 16;
#X obj 82 191 t a a;
#X listbox 93 243 33 0 0 0 - - - 16;
#X listbox 283 191 42 0 0 0 - - - 16;
#X connect 0 0 1 0;
#X connect 1 0 10 0;
#X connect 2 0 7 0;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 12 0;
#X connect 8 0 9 0;
#X connect 10 0 8 0;
#X connect 10 1 11 0;

sidec avatar Oct 21 '24 21:10 sidec

can you upload the patch as a zip file?

screenshots are also nice :)

porres avatar Oct 21 '24 21:10 porres

sure, here is the patch savepanel-bug.zip and a screenshot image

sidec avatar Oct 22 '24 09:10 sidec

I was hoping you cold show in the image the backslashes.

Anyway, I don;t get the backslasehs in my mac, the rest I can confirm. I can summarize this [savepanel] issue as

  • [ ] symbol input does not set saving folder
  • [ ] outputs with backslashes in windows

porres avatar Oct 22 '24 13:10 porres

Fair enough, here the backslashes: image I don't have backslashes on Linux neither, so this issue is specific to Win

sidec avatar Oct 22 '24 14:10 sidec

just a note on the side, instead of uploading screenshots or zips, it is possilble to save on manual labour by simply coping the entire text in patch listing except the first one containing #canvas, and paste it from the clipboard into a new patch in PlugData. So cool that.

sidec avatar Oct 25 '24 09:10 sidec

Should be fixed!

timothyschoen avatar Oct 25 '24 15:10 timothyschoen

Hi, I tested last nightly build: e493ff48e from yesterday which should bring Pd vanilla compatability and it seems that there still are discrepancies. So efectively Pd approach accross of all supported OSs is to adopt unix forward slash delimiter in system paths (with drive letter at the begining on Windows). So for comparision the same patch in PlugData and PD: Actual: image Expected: image

The other issue I found in latest builds is that banging openpanel and savepanel after they have been used doesn't open file browser. So @timothyschoen could you reopen the issue or should I create another one?

sidec avatar Oct 28 '24 12:10 sidec

Backslashes are now fixed on Windows

timothyschoen avatar Jan 09 '25 12:01 timothyschoen

Sending a path in as input to open in that folder also works here

timothyschoen avatar Jan 09 '25 12:01 timothyschoen