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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
User interface for project glob feature
« on: August 17, 2018, 05:51:03 am »
Hi,
i implemented a user interface and scripting interface for the project glob api, that was introduced 7 years ago, but never used over UI:
http://forums.codeblocks.org/index.php/topic,16958.0.html

i think this is a nice feature specially if you use a custom make file.. .

The implementation is currently here https://github.com/bluehazzard/codeblocks_sf/tree/test/UnitsGlob/ui/1
i will provide a patch and a ticket on SF as soon as someone shows interest....

Attached is a screenshot of the UI

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #1 on: August 17, 2018, 10:20:19 am »
What is this control? It looks ugly. Also you need to provide an edit button.
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #2 on: August 17, 2018, 11:56:25 am »
yes it is ugly... It is a wxGrid controll. I tried to use a wxListCtrl, but there you can not edit the second column. I did not wanted to add a second dialog, where you input the parameter and hit ok. With this control you can in place edit everything. Fast and easy...

Quote
Also you need to provide an edit button.
I will try to add an "search" button in the first column that opens the path control (that one used by the project search paths)... As far as i can see this is also more easily made with the wxGrid control then the wxListCtrl. A other possibility would be wxPropGrid, but i am annoyed by the different implementations in wx2.8 and wx3.0....

More suggestions welcome

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #3 on: August 17, 2018, 01:28:28 pm »
It is common for C::B's UI to open secondary dialogs where stuff is edited. I don't know why this bothers you.

wxPG isn't that different in wx28 and 3x from the calling code. The wx3.x is just more buggy. :(
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #4 on: August 17, 2018, 02:58:38 pm »
Quote
It is common for C::B's UI to open secondary dialogs where stuff is edited.
and i hate it... If you want to change one letter in 3 libraries (to add a debug "d" for example) you have to click 12 times  3x(select entry, open dialog, activate, close dialog), instead of 3 times (select entry and set cursor at correct position at the same time)... Quick copy and paste? Naaa forget it... you have open a dialog to get the value... Don't put design over usability, we have this crap everywhere in the new web and programing....


[Edit:] i have found wxDataViewCtrl  (http://docs.wxwidgets.org/trunk/classwx_data_view_ctrl.html) and will have a look into it. It look like the control we need
[Edit2:] This control is only available wx>2.9 ;(
« Last Edit: August 17, 2018, 03:21:57 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #5 on: August 17, 2018, 05:43:13 pm »
I doubt it would be common to want to change all entries. What would be this situation?
And consistency is a good thing. It surprises users less.

wxDVC seems like the control with the most bugs and it is also ugly.

p.s. For the libs UI you can probably make a UI based on wxTextCtrl, but editable wxListCtrl would also work. I think this was possible to have editable wxListCtrls in wx. If you're interested to test it I'd be happy to review such patch.
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #6 on: August 17, 2018, 06:52:44 pm »
Ok, i looked a bit into it:

*) wxListCtrl can not be changed, that other columns but the first can be edited (https://forums.wxwidgets.org/viewtopic.php?t=39593) The supposed way is to use the wxDataViewCtrl
*) in wx2.8 wxDataViewCtrl is implemented only rudimentary. You have to add a Data provider class ecc... It differs from the wx2.9 implementation. There is a nice interface to add columns and manage them with less code http://docs.wxwidgets.org/trunk/classwx_data_view_list_ctrl.html This class does not exist in wx2.8

Quote
I doubt it would be common to want to change all entries. What would be this situation?
I gave you an example:
Changing from release to debug libraries or for example wx2.8 to wx30.
Copy and paste many paths from one project to a other over a text file... From a make file to codeblocks...
I don't know, i had so many situations where a lot editing had to be done... Editing the cbp file directly is also no real alternative because of the xml file format...
I had this problems for the library setting and i see that coming for this settings, so i wanted to mitigate this with a ui where every field is editable in place...

So what is to do?
1) If we use the  wxDataViewCtrl  i am not really willing to implement it in wx2.8. So this UI would be only for cb wx3.0 and past (it is better as now, because now is no ui for no wx version)
2) Pimp the wxGrid so that it looks better? ( kicad uses this control a lot, so we could look if they have some nice changes)
3) Use property grid.
4) Use wxListCtrl and make a separate dialog for editing (not my favorite.... Adding a other dialog... Not being able to edit in place...)
[EDIT:]
5) Using wxListCtrl  but make the whole dialog bigger so there is a wxTextCtrl for every column. You select the entry in the ListCtrl on the left and the values from the textCtrls get updated on the right... Something like this http://wxdsgn.sourceforge.net/images/tutorials/Multicolumn_table_using_virtual_wxListCtrl_Tutorial.files/image046.jpg
« Last Edit: August 17, 2018, 06:56:59 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #7 on: August 17, 2018, 07:13:17 pm »
Quote
I doubt it would be common to want to change all entries. What would be this situation?
I gave you an example:
Changing from release to debug libraries or for example wx2.8 to wx30.
Copy and paste many paths from one project to a other over a text file... From a make file to codeblocks...
I don't know, i had so many situations where a lot editing had to be done... Editing the cbp file directly is also no real alternative because of the xml file format...
I had this problems for the library setting and i see that coming for this settings, so i wanted to mitigate this with a ui where every field is editable in place...
I was talking about the glob feature. Changing libraries in bulk is more common I agree.

So what is to do?
1) If we use the  wxDataViewCtrl  i am not really willing to implement it in wx2.8. So this UI would be only for cb wx3.0 and past (it is better as now, because now is no ui for no wx version)
2) Pimp the wxGrid so that it looks better? ( kicad uses this control a lot, so we could look if they have some nice changes)
3) Use property grid.
4) Use wxListCtrl and make a separate dialog for editing (not my favorite.... Adding a other dialog... Not being able to edit in place...)
[EDIT:]
5) Using wxListCtrl  but make the whole dialog bigger so there is a wxTextCtrl for every column. You select the entry in the ListCtrl on the left and the values from the textCtrls get updated on the right... Something like this http://wxdsgn.sourceforge.net/images/tutorials/Multicolumn_table_using_virtual_wxListCtrl_Tutorial.files/image046.jpg
1. I don't think wxDVC it is an option until we're at 3.2. wxDVS is something that is always active on the wx's issue tracker.
2. I doubt this would work. If we use wxGrid we should accept that it will be ugly and a bit hard to use. Keep in mind that many people don't know that the last row of the watches window is editable and they are confused.
3. Could probably work, but you'll have max 3 columns and only the second is easily editable. Editing the label is annoying and hard to get right if I remember correctly.
5. It is one or two clicks better than 4, but the UI will be confusing, so I don't think this is a good option.

So, I guess you have to choose between 2 and 4...
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #8 on: August 20, 2018, 12:55:29 pm »
How about this?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: User interface for project glob feature
« Reply #9 on: August 20, 2018, 01:56:30 pm »
I really like a GUI front end is being made for it.

Wrt wx28 and wx3.x, do we still want to support wx28 ?
On our windows nightlies we have switched, and let's hope by the next release we will have a more stable wx so that one will be wx3 too.
And on most linux distros by default it is already wx3x

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #10 on: August 26, 2018, 10:38:03 pm »
@bluehazzard: Looks good.

@killerbot: I'm still using wx28 on my works centos 6. I'm in a process of switching to wx3.x there.
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #11 on: August 26, 2018, 11:53:14 pm »
Ok, i posted a ticket with a patch

https://sourceforge.net/p/codeblocks/tickets/729/

i can not test it on linux at the moment, but it should work.

(Can we work on reducing the amount of project files? this is so a pain in the a** to keep in sync all this project files)

Missing are the makefiles....

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #12 on: August 28, 2018, 09:11:49 pm »
Here are some comments on the patch (starting from the top of the file to the bottom):

1. Mismatch between the comment and the name of AddGlob (glob vs globs).
2. The plugin version should be increased because of the addition of AddGlob
3. Get/SetGlobs should be added to the script bindings. Can we have tests for these 3?
4. dlgEditProjectGlob should be EditProjectGlobDlg for consistency
4.1. StaticText1, StaticText2 shouldn't be members
4.2. The click handle methods should have better names, using the names created by wxsmith is rarely a good idea
4.3. filenames should be lower case and if you need more clarity you can use underscores. This prevents nasty case sensitivity problems in different oses.
4.4. The case for variables should be consistent.
4.5. The custom var logic needs better documentation.
4.6. We don't use underscores for variables, use camelCase.
4.7. Prefer empty instead of IsEmpty and ==wxEmptyString
4.8. the cbMessageBox condition at the end of OnbtnBrowseClick is more complicated than it could be - the two blocks are almost the same
4.9. We align to the open bracket when long lines are truncated.
5. dlgManageGlobs should be ManageGlobsDlg
5.1. same for filenames all lowercase please
5.2. Duplicating Manager::Get()->GetProjectManager()->GetActiveProject() wastes resources and makes code harder to read
5.3. It is better to use wxString::Format when there is a string which will be translated instead of using operator+, different languages have different word order.
5.4. Start all columns with capital letter?
5.5. Again do not use underscores in variable names
5.6. Prefer using std::vector instead of wxArray*
5.7. Are you sure OnbtnDeleteClick works correctly when deleting multiple items? I'm pretty sure you need to iterate items backwards.
5.8. Repeated calls to prj->GetGlobs()[i\] aren't good idea - store them in variables
6. Do not pass nullptr when creating dialogs. It leads to really bad problems on linux.
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #13 on: August 29, 2018, 12:04:23 am »
ok, i will work this list down...
Quote
1. Mismatch between the comment and the name of AddGlob (glob vs globs).
Can you point out the line in the patch?
I think AddGlob is the singular (add one glob entry), and SetGlobs is plural (edit multiple globs)?

Quote
3. Get/SetGlobs should be added to the script bindings. Can we have tests for these 3?
Not really... there is no independent  read back possibility from script bindings, to check the success... If i remember correctly i have not implemented any test for all project functions, because it was not possible to create a project from the script binding and get a independent result from the function (compare a pre made project file for example) ... Testing project binding should not be topic for this patch... If there is need we should create a new topic/ticket

Quote
4.2. The click handle methods should have better names, using the names created by wxsmith is rarely a good idea
suggestions? I think OnbtnBrowseClick nicely verbose :
Code
"On"        --- On (obviously english adverb)
"btn"       --- Button
"Browse"    --- Button name
"Click"     --- on what? --> on click
"btnBrowse" --- also Variable name of button...

Quote
4.3. filenames should be lower case and if you need more clarity you can use underscores. This prevents nasty case sensitivity problems in different oses.
I have not found any camel case / upper case filename in the patch?

Quote
5.3. It is better to use wxString::Format when there is a string which will be translated instead of using operator+, different languages have different word order.
Doesn't this add unicode problems? Or how do i printf a wxString with unicode support?

Quote
5.8. Repeated calls to prj->GetGlobs()[i\] aren't good idea - store them in variables
isn't this optimized out? Isn't a copy slower?

Quote
6. Do not pass nullptr when creating dialogs. It leads to really bad problems on linux.
what instead?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #14 on: August 29, 2018, 12:36:27 am »
Can you point out the line in the patch?
This one: "@param glob the globs to add to the project."

Not really... there is no independent  read back possibility from script bindings, to check the success... If i remember correctly i have not implemented any test for all project functions, because it was not possible to create a project from the script binding and get a independent result from the function (compare a pre made project file for example) ... Testing project binding should not be topic for this patch... If there is need we should create a new topic/ticket
Ok, not testing, but what about setglobs and getglobs support in scripting?

suggestions? I think OnbtnBrowseClick nicely verbose :
OnBrowseClick is obvious and clear, IMO. If you want to stick btn or button you should make it CamelCase. Nobody cares if the variable for the button has the same name as the method name.

I have not found any camel case / upper case filename in the patch?
There you go:
+#include "dlgEditProjectGlob.h"
+#include "dlgManageGlobs.h"
+#include "dlgEditProjectGlob.h"

It seems only the includes are broken.

Doesn't this add unicode problems? Or how do i printf a wxString with unicode support?
No. Use .wx_str() when calling wxString::Format, you can also use the short F function.

Quote
5.8. Repeated calls to prj->GetGlobs()[i\] aren't good idea - store them in variables
isn't this optimized out? Isn't a copy slower?
How calling an unknown method from a dll could be optimized away? But I don't really care too much for optimizations, copy pasting shows the laziness of the writer of the code and it is hard to read because it is more text and you should verify that the function call doesn't return different value every time it is called.

Quote
6. Do not pass nullptr when creating dialogs. It leads to really bad problems on linux.
what instead?
Either a parent dialog or the main frame or the app window (these two can be accessed from the manager class).
(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: 13413
    • 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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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: 5490
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: 13413
    • 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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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: 13413
    • 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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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: 2750
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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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: 13413
    • 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: 13413
    • 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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
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: 13413
    • 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!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #30 on: September 07, 2018, 12:09:43 am »
Quote
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 '.'.
i can try to fix this.
Quote
3. The ok/cancel buttons in the manage dialog must be moved at the bottom using a stdbuttonsizer. The current version looks bad.
i am really bad with UI things... I would like to let this to some one else

Quote
Here are some fixes on top of yours: https://github.com/obfuscated/codeblocks_sf/tree/experiments/globs
What is this with the tabs change in the code? Do you use fewer white spaces?

in src/src/manageglobsdlg.cpp
Code
for (const cbProject::Glob &glob : m_GlobList)
full c++11 support now? also with "auto"?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #31 on: September 07, 2018, 12:50:33 am »
The files used tabs, CB project uses 4 spaces. We're c++11 for quite a while now.
I don't understand why c++11 is associated with auto. The second worst feature added after rvalue refs and lambdas are third.
Generally it is preferable (at least by me) if auto is used as little as possible and only where the types are obvious or too long.
(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 The_GTA

  • Multiple posting newcomer
  • *
  • Posts: 21
  • Developer & Entrepreneur
    • EirDev
Re: User interface for project glob feature
« Reply #32 on: January 29, 2019, 07:44:13 pm »
Glad that UnitsGlob does receive GUI attention! Usually I add UnitsGlob manually to the project file...

<UnitsGlob directory="../src" recursive="1" wildcard="*.cpp" />
<UnitsGlob directory="../src" recursive="1" wildcard="*.h" />
<UnitsGlob directory="../src" recursive="1" wildcard="*.hxx" />
<UnitsGlob directory="../include" recursive="1" wildcard="*.h" />

... but a GUI way does add more reach for a wider audience. Visual Studio team would refuse but Code::Blocks community does have an eye for detail. Thank you!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #33 on: January 29, 2019, 10:44:26 pm »
Have you tried the patches? Does they work for you?
(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: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #34 on: October 17, 2020, 01:50:11 pm »
@BlueHazzard: This seems like another thing you haven't finished. Can you do it?
(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

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: User interface for project glob feature
« Reply #35 on: October 19, 2020, 12:53:23 am »
Ok, i looked into this a bit again...
Can i still not convince you that we should use https://docs.wxwidgets.org/trunk/classwx_data_view_list_ctrl.html and provide all two edit possibilities? :)
On the functionality side, some points:
*)  i think we should use a https://docs.wxwidgets.org/3.0/classwx_file_system_watcher.html for checking if the folders in question have changes during runtime and add the files to the project accordingly

A) (as it is done currently)
*) add the files dynamically to the internal project, but do not save them in the project file
*) on loading the project, scan for files in globs and add them to the internal project, but store a flag, that this is a glob file and so we can not modify it (disable the property file dialog for example). At the moment it is possible to edit this options, but they are not saved for the next opening of the project.

B)
*) add the files dynamically to the internal project, save them in the project file, but also add the glob string they come from as attribute. So we can easily delete them when the glob gets deleted
*) also so we can detect if the file is not present on project load, and remove it silently from the project file, because i think files from glob should not trigger a file not found error...



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: User interface for project glob feature
« Reply #36 on: October 19, 2020, 08:28:22 pm »
I have no opinion at the moment, nor do I intend to do more review. I don't have the time at the moment.
I have just two requirements:
1. make it reliable
2. make it fast when you have the linux source tree for example (40k+ files)
(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!]