Author Topic: Recent Projects  (Read 11678 times)

Offline johne53

  • Regular
  • ***
  • Posts: 253
Recent Projects
« on: October 28, 2009, 05:05:44 pm »
It's a long shot but just out of interest.... is ti possible to configure C::B so that it only keeps recently saved workspaces in its 'Recent Project' list, instead of keeping both workspaces and projects? I almost never need to load a project without loading the workspace that contained it so I find it quite annoying to have a list full of projects when I'm really only interested in the workspaces.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Recent Projects
« Reply #1 on: October 28, 2009, 06:40:26 pm »
I don't think it is configurable.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Recent Projects
« Reply #2 on: October 28, 2009, 08:09:52 pm »
Maybe projects belonging to the workspace the user just opened, should not be added to the recent projects list?
What do the devs think about that?
If all agree on that behaviour I can make a 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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Recent Projects
« Reply #3 on: October 28, 2009, 08:21:39 pm »
What do the devs think about that?
...not too bad, but please configurable. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Recent Projects
« Reply #4 on: October 28, 2009, 09:24:53 pm »
Hm, after some testing the if I open only workspaces,
I've got not project files in the recent list.

johne53: What version do you use?
Mine is debugger-branch-head on gentoo 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 Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #5 on: October 28, 2009, 09:31:59 pm »
Try editing a project (Project -> Properties or something) and then save it. It will show up in the recent file list; at least it does that for me (rev 5679).

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: Recent Projects
« Reply #6 on: October 28, 2009, 09:51:54 pm »
Yes, it's as Zini said. Open a workspace containing (say) 6 projects. Change a few of them then save each project. Next time you open C::B they'll appear at the top of the Recent projects list. In fact, if there are a lot of projects, you can end up losing your workspace off the bottom of the list, which is really quite annoying.

I'm running version svn5859 but this has been standard behaviour for as far back as I can remember. It's one of those things that I've always meant to suggest but never quite got around to it.

I like the idea of not adding projects that are part of a workspace that was just opened.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Recent Projects
« Reply #7 on: October 29, 2009, 06:36:13 am »
Does not happen here (debian 64-bit svn r5873 from trunk).

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: Recent Projects
« Reply #8 on: October 29, 2009, 08:24:37 am »
You mean your Recent Project list contains only workspaces?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Recent Projects
« Reply #9 on: October 29, 2009, 10:03:27 am »
You mean your Recent Project list contains only workspaces?
No, if I open a projectfile directly, it appears in the list, and that's a behaviour I expect, but if I open a workspace, that contains lots of project files, only the workspace file appears, even if I change and save a single project.
« Last Edit: October 29, 2009, 10:06:09 am by jens »

Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #10 on: October 29, 2009, 05:00:39 pm »
Just updated to rev 5892. The undesirable behaviour regarding project saving is still present for me.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Recent Projects
« Reply #11 on: October 29, 2009, 06:37:13 pm »
I just updated my working copy to 5892 and build a debian-package of it, to see if something has changed.

Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #12 on: October 29, 2009, 07:00:23 pm »
Looks like these functions are the culprit:

Code
void MainFrame::OnFileSaveProject(wxCommandEvent& event)
{
    // no need to call SaveActiveProjectAs(), because this is handled in cbProject::Save()
    if (Manager::Get()->GetProjectManager()->SaveActiveProject())
        AddToRecentProjectsHistory(Manager::Get()->GetProjectManager()->GetActiveProject()->GetFilename());
    DoUpdateStatusBar();
    DoUpdateAppTitle();
}

void MainFrame::OnFileSaveProjectAs(wxCommandEvent& event)
{
    if (Manager::Get()->GetProjectManager()->SaveActiveProjectAs())
        AddToRecentProjectsHistory(Manager::Get()->GetProjectManager()->GetActiveProject()->GetFilename());
    DoUpdateStatusBar();
    DoUpdateAppTitle();
}

Though that doesn't explain why it happens only for some people.

Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #13 on: October 29, 2009, 11:41:36 pm »
I modified these two functions and that seems indeed to have fixed it. Here is the patch:

http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2844&group_id=5358

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Recent Projects
« Reply #14 on: October 30, 2009, 12:03:19 am »
It still does not happen here.

EDIT:
It does happen if it is saved from the file-menu, but I almost always save my projects from the projects-tree content-menu.

So there is an inconsitency between this two menus, that should not be.
When the projects are (or the workspace is) saved with the appropriate "save all xxx" menu-item, they are also not added to recent-projects history.
« Last Edit: October 30, 2009, 12:41:35 am by jens »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Recent Projects
« Reply #15 on: October 30, 2009, 09:07:12 am »
http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2844&group_id=5358
Sorry, This cannot be the solution. After this patch you'll never get recent projects added to the list. I had to reject the patch therefore.

The right way would be:
Is there a WS? && Is this *not* the default WS?
-> Do not add to recent projectes
Else add to recent projectes.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Recent Projects
« Reply #16 on: October 30, 2009, 09:14:40 am »
http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2844&group_id=5358
Sorry, This cannot be the solution. After this patch you'll never get recent projects added to the list. I had to reject the patch therefore.

The right way would be:
Is there a WS? && Is this *not* the default WS?
-> Do not add to recent projectes
Else add to recent projectes.

Absolutely correct, but saving the projects or workspaces  from the context-menu of the projects-tree should work in the same way.
At the moment, the recent-projects-list is ignored in this case.

Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #17 on: October 30, 2009, 11:02:17 am »
Quote
Sorry, This cannot be the solution. After this patch you'll never get recent projects added to the list. I had to reject the patch therefore.

That is not what I am experience here. Even with the patch recent projects are still added to the list.

The problem with the unpatched code is that projects are added on opening as well as on saving. Doing only one of them (opening) would be completely sufficient IMHO.


Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #18 on: October 31, 2009, 12:24:25 pm »
btw. I made a little census regarding the behaviour of the recent file list in various applictions. Adding only on open wins over adding on open and save with 60% (though my sample size is much too small to give representative results).

But considering that you can't save a project without opening it first, not adding the project on save seems to be the right solution, since the project is already guaranteed to be in the recent list (unless it was open indirectly as a part of a workspace, which is exactly the behaviour we want).

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: Recent Projects
« Reply #19 on: October 31, 2009, 12:54:27 pm »
I would just qualify that by adding that whatever gets added to the list (on open) it should be restricted to whatever the user actually opened and not to other things that happened to get opened as a consequence. In other words, if I open a workspace containing 6 x projects, only the workspace should get added to the list.

As Zini said, anything that the user opens will be guaranteed to be in the Recent Project list. Therefore the simplest solution might be to have a  user-selectable option whereby the user can decide whether or not to add 'saved' items to the list.

Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #20 on: October 31, 2009, 01:00:38 pm »
Quote
In other words, if I open a workspace containing 6 x projects, only the workspace should get added to the list.

Actually that is exactly how it is handled at the moment.

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: Recent Projects
« Reply #21 on: October 31, 2009, 01:04:27 pm »
Yes - I must have missed the last bit of your last sentence (the bit about not adding things which get opened indirectly).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Recent Projects
« Reply #22 on: October 31, 2009, 03:17:15 pm »
What about new projects?
(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 Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Recent Projects
« Reply #23 on: October 31, 2009, 06:58:57 pm »
Easy. Add them on project creation (Code::Blocks is doing that already)

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: Recent Projects
« Reply #24 on: November 23, 2009, 12:26:53 pm »
Did we ever reach a concensus about this? For the time being I'm using the popup menu to save projects and the File menu to save workspaces. However, it would be more consistent if File->Save Projects could work the same as the popup menu (i.e. NOT add projects to the Recent Projects list).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Recent Projects
« Reply #25 on: June 26, 2010, 11:09:24 pm »
Another inconsistency:
0. Add some projects to the default workspace
1. Right click on the Workspace (the root of the tree),
2. Then save workspace as
3. Close the workspace
4. The workspace is not added to the recent projects list, but all projects opened in order to be added to the workspace are added to the recent project's list

Also there is a bug:
1. Delete a project from the recent projects in the start page
2. Goto File -> Recent projects and the projects is still there

cb: debugger branch 6344

BTW, the interface for managing workspaces is not intuitive at all. It is pretty confusing and error prone.
« Last Edit: June 26, 2010, 11:12:08 pm by oBFusCATed »
(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!]