Martin,

I note that the branches dialog isn't very useful at the moment and 
suspect that this is my doing. The choice of available branches is 
empty. I'll sort it out but have a few questions of my own:

1 Looking at the code in FormBranch.C, QBranch.C:
why do you bother filling the choice in 'build'? It is subsequently 
overwritten in 'update', so this is just a waste of cycles.

2 Why do you store a copy of the list of available branches in the 
inset? Why not provide an accessor from the controller. Eg

std::vector<std::string> const
ControlBranches::all_branches() const
{
        BranchList const & branchlist =
                kernel().buffer().params().branchlist();

        ...
}

3. Why do you store the list of all branch names in BranchList as a 
'|'-separated string. Why not use a vector?

If you're worried about filling the choice in the xforms frontend, 
then don't be:
        string const all_branches =
                ' ' +
                getStringFromVector(controller().all_branches(), " | ") +
                ' ';
        fl_clear_choice(dialog_->choice_branch);
        fl_addto_choice(dialog_->choice_branch, all_branches.c_str());

4. I notice a bug in the display of new branches. For example:
* I created a branch 'Purple' and a branch 'Green' in that order and 
set the colours of both appropriately.
* I created a 'Purple' branch inset and discovered it was displayed 
with a green background. I subsequently created a 'Green' inset. It 
also had a green background.
* Close the file and re-open and all is Ok. (Maybe I restarted LyX.)

I propose to address questions 1-3 myself and to fix the currently 
useless Branch dialog. Ok?

-- 
Angus

Reply via email to