Author Topic: User interface for project glob feature  (Read 1713 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11053
    • Travis build status
Re: User interface for project glob feature
« Reply #15 on: August 29, 2018, 12:37:50 am »
On the functionality's side - I've not seen any code to rebuild the project tree or to add the files to the project. Are people still expected to reload the project after changing the globs?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #16 on: August 29, 2018, 09:46:54 pm »
On the functionality's side - I've not seen any code to rebuild the project tree or to add the files to the project. Are people still expected to reload the project after changing the globs?
Here you have a point. I tested this and have found some problems:
The files for the globs are only updated in the project loader, and then they are added to the project file with the m_pProject->AddFile() methode, so the files are stored in the project.
I think this is not the right behavior? Wouldn't it be more convenient to work like eclipse, so that it scans the folder continuously for files in the directories but does not store them in the project file?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5095
Re: User interface for project glob feature
« Reply #17 on: August 29, 2018, 09:48:04 pm »
makes sense, but when they are not in the project, then I guess they will not be parsed for CC, nor build ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11053
    • Travis build status
Re: User interface for project glob feature
« Reply #18 on: August 29, 2018, 10:05:33 pm »
Implementing this would require major changes, probably.
We'll need a way to iterate on both types of files and probably differentiate between normal files and files coming from globs.

For now probably an automatic reload would be fine or just a warning that a reload is needed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #19 on: August 29, 2018, 11:14:30 pm »
Quote
For now probably an automatic reload would be fine or just a warning that a reload is needed.
Then we have to save the project after leaving the dialog?
The problem is also, if a file does not exist it is still in the project on load, or if i remove a glob, the files are still present... A possibility would be to scan the files and remove them by hand in the remove glob function...
« Last Edit: August 29, 2018, 11:54:25 pm by BlueHazzard »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #20 on: August 30, 2018, 12:47:31 am »
Ok, i think i have worked out all points from you list...

Quote
Ok, not testing, but what about setglobs and getglobs support in scripting?
To add setglobs/getglobs  we would have to add some kind of binding for the std::vector<Globs> class. I do not think this is needed... And i do not know how to make it nicely, i don't think it is possible to bind a generic std::vector class. And i don't feel the need to bind a set, get, remove ecc... by hand...

After editing a glob, with this patch, the user is asked if he wants to save and reload the project. So the ui gets updated... Removing globs, as i posted above, does not change anything.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11053
    • Travis build status
Re: User interface for project glob feature
« Reply #21 on: September 02, 2018, 02:01:38 pm »
I've skimmed over the patch and OnDeleteClick seems to still be broken.
Have you tried to delete two or more globs simultaneously and see if the results are correct?

@killerbot: As a user of the feature, can you try the patch and give some comments on its usability?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #22 on: September 02, 2018, 02:05:41 pm »
Quote
Have you tried to delete two or more globs simultaneously and see if the results are correct?
As far as i can tell it works as expected... I have tested in a few times with deleting only a few items, all items and random items.... All seem to work...

EDIT: I see why you think this is broken from logically thinking this should not work... hmm, i will look into it... The items should be ordered in down coming order...

EDIT2: You are true, it does not work... I will fix it
« Last Edit: September 02, 2018, 02:21:41 pm by BlueHazzard »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #23 on: September 02, 2018, 02:36:47 pm »
ok, i fixed it... I also removed the unnecessary delete from the list, and made the OK button default.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2102
Re: User interface for project glob feature
« Reply #24 on: September 02, 2018, 08:23:37 pm »
ok, i fixed it... I also removed the unnecessary delete from the list, and made the OK button default.

Cannot download file. Gets error "Failed- insufficient pemissions"
I tried 4 different ways to download. All failed.
« Last Edit: September 02, 2018, 08:26:14 pm by Pecan »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #25 on: September 02, 2018, 08:33:44 pm »
ok, i fixed it... I also removed the unnecessary delete from the list, and made the OK button default.

Cannot download file. Gets error "Failed- insufficient pemissions"
I tried 4 different ways to download. All failed.


hmm.. works for me...
anyway, i pushed it to github: https://github.com/bluehazzard/codeblocks_sf/tree/test/UnitsGlob/ui/3

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11053
    • Travis build status
Re: User interface for project glob feature
« Reply #26 on: September 02, 2018, 09:46:30 pm »
Works fine for me, too.  :(
But a branch is a better idea. It will make reviewing it further easier if there are changes.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11053
    • Travis build status
Re: User interface for project glob feature
« Reply #27 on: September 02, 2018, 11:49:37 pm »
The deletion is still not correct. .size() returns size_t, substituting 1 from 0 leads to very long loop and misery.
I don't think the sort is required, but if you still want to use it why don't you just reverse the list there?

p.s. vector has reverse iterators, which could save you the trouble to do correct iteration.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1981
Re: User interface for project glob feature
« Reply #28 on: September 03, 2018, 10:29:45 am »
The third time is the charm.

Quote
The deletion is still not correct. .size() returns size_t, substituting 1 from 0 leads to very long loop and misery.
the good old unsigned underflow... Well it worked during testing...

Quote
I don't think the sort is required, but if you still want to use it why don't you just reverse the list there?
I don't know how c++11 (lambdas) are welcome in the code, and i did not wanted to make a function or class only for sorting...

pushed the new code to github...
attached the 7ziped patch.. (no need to waste space...)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11053
    • Travis build status
Re: User interface for project glob feature
« Reply #29 on: September 06, 2018, 08:16:01 pm »
Here are some fixes on top of yours: https://github.com/obfuscated/codeblocks_sf/tree/experiments/globs

Three more things I've found which needs to be fixed:
1. The manage dialog shouldn't call Manager::Get()->GetProjectManager()->GetActiveProject(), but a project pointer should be passed to the constructor. This would make it possible to add this manage command to the context menu
2. Adding a relative path to the current project makes the path look like ../myproj instead of just '.'.
3. The ok/cancel buttons in the manage dialog must be moved at the bottom using a stdbuttonsizer. The current version looks bad.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]