Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phantom Auto-Refreshment / How to disable? #710

Closed
JoxCoswit opened this issue Feb 6, 2024 · 4 comments
Closed

Phantom Auto-Refreshment / How to disable? #710

JoxCoswit opened this issue Feb 6, 2024 · 4 comments

Comments

@JoxCoswit
Copy link

Dear Gaku,

I noticed it last time and now when I tested it again yesterday.
Last time, I commented on it with ccfs.

Comment

I think I saw what this could be about yesterday.

When I use the grouping script some "auto-refresh" occurs.

I think I found out what it is about, and the process is like this:

  1. Initially, I unpack the package - eg "te240206" (settings orginal)

  2. There are three folders
    Picture1

  3. I mark two folders, and run the grouping script.

  4. Those two folders are neatly grouped into one folder (that's OK)
    Arrangement as in the picture:
    Picture2

The next procedure is a little different, with a change to the Layout (put any one, it doesn't matter)

In this example; I created one, i.e. the first "1tab.xml"

The procedure is repeated with the maps:

  1. There are three folders
    Picture1

  2. I mark two folders, and run the grouping script.

  3. Those two folders are neatly grouped into one folder (that's OK)

But unlike the previous one, now this phantom auto-refresh occurs.

Arrangement as in the picture:
Picutre3

Why is this happening?
I would like the folder that was created not to change the folder order until I manually refresh it by myself.

The thing is sometimes it's hard like before for me to keep track of what I've done.

The only thing that has changed is that I have changed the "Layout".

If there are any questions, feel free to ask me.

Best regards.

@tablacus
Copy link
Owner

tablacus commented Feb 7, 2024

This happens if the move starts before the created folder appears, so I shifted the timing by about 2000ms.

// Create a folder and move any selected items to it
const currentPath = api.GetDisplayNameOf(FV, SHGDN_FORPARSING);
const Selected = FV.SelectedItems();
const prompt = (Selected && Selected.Count) ? "Move " + Selected.Count + " item(s) to new folder" : "New Folder" ;
InputDialog(prompt, "", function (r) {
  if (r) {
    let path = r.replace(/^\s+/, "");
    if (!/^[A-Z]:\\|^\\/i.test(path)) {
      path = BuildPath(currentPath, path);
    }
    CreateFolder(path);
    if (Selected && Selected.Count) {
      const oDest = sha.NameSpace(path);
      if (oDest) {
        setTimeout(function(oDest, Selected) {
          oDest.MoveHere(Selected, FOF_ALLOWUNDO);
        }, 2000, oDest, Selected);
      }
    }
  }
});
// Move selected items to a new folder
const currentPath = api.GetDisplayNameOf(FV, SHGDN_FORPARSING);
const Selected = FV.SelectedItems();
if (Selected && Selected.Count) {
  InputDialog("Move " + Selected.Count + " item(s) to new folder", "", function (r) {
    if (r) {
      let path = r.replace(/^\s+/, "");
      if (!/^[A-Z]:\\|^\\/i.test(path)) {
        path = BuildPath(currentPath, path);
      }
      CreateFolder(path);
      const oDest = sha.NameSpace(path);
      if (oDest) {
        setTimeout(function(oDest, Selected) {
          oDest.MoveHere(Selected, FOF_ALLOWUNDO);
        }, 2000, oDest, Selected);
      }
    }
  });
}

Regards,

@ccfs
Copy link

ccfs commented Feb 7, 2024

These alternatives avoid 2000ms delay, but the new folder is restricted to a sub-folder (the original and the above versions can create a folder elsewhere).

  • "select new": The new sub-folder will be selected.
  • "select unmoved": The new sub-folder will NOT be selected. If any item is not moved (e.g. being opened by another app), it will stay selected.

@tablacus
Copy link
Owner

tablacus commented Feb 7, 2024

999ms version.

// Create a folder and move any selected items to it
const currentPath = api.GetDisplayNameOf(FV, SHGDN_FORPARSING);
const Selected = FV.SelectedItems();
const prompt = (Selected && Selected.Count) ? "Move " + Selected.Count + " item(s) to new folder" : "New Folder" ;
InputDialog(prompt, "", function (r) {
  if (r) {
    let path = r.replace(/^\s+/, "");
    if (!/^[A-Z]:\\|^\\/i.test(path)) {
      path = BuildPath(currentPath, path);
    }
    CreateFolders(path);
    if (Selected && Selected.Count) {
      const oDest = sha.NameSpace(path);
      if (oDest) {
        setTimeout(function(oDest, Selected) {
          oDest.MoveHere(Selected, FOF_ALLOWUNDO);
        }, 999, oDest, Selected);
      }
    }
  }
});
// Move selected items to a new folder
const currentPath = api.GetDisplayNameOf(FV, SHGDN_FORPARSING);
const Selected = FV.SelectedItems();
if (Selected && Selected.Count) {
  InputDialog("Move " + Selected.Count + " item(s) to new folder", "", function (r) {
    if (r) {
      let path = r.replace(/^\s+/, "");
      if (!/^[A-Z]:\\|^\\/i.test(path)) {
        path = BuildPath(currentPath, path);
      }
      CreateFolders(path);
      const oDest = sha.NameSpace(path);
      if (oDest) {
        setTimeout(function(oDest, Selected) {
          oDest.MoveHere(Selected, FOF_ALLOWUNDO);
        }, 999, oDest, Selected);
      }
    }
  });
}

Regards,

@JoxCoswit
Copy link
Author

Thank you both for the offered solutions and effort 😊

I tried both and both solutions are closest to my needs.
From Gaku, with delayed, and from ccfs ie. second, with unmoved.

Basically, I will combine both of your two solutions.
Depending on where I need which of this for works.

That's settled. Excellent! 🥇

P.S. Gaku, I have two more questions; but it's not related to this - or yesterday's topics.
I haven't decided yet which one would be helpful to have.
When I decide I will open a new issue with a comment which is relate with that.
Then you can see if any of it makes sense or not and whether any of these would be good for all.

Kind regards.
Jox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants