two small qbranch ui fixes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8477 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2004-03-05 13:08:08 +00:00
parent 97c371abd9
commit f0b5144444
3 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2004-03-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QDocumentDialog.C (branches): Don't deselect branch
after button press.
* QBranch.C: fix off-by-one-error.
2004-02-21 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* QPrefs.C, QPrefsDialog.C, ui/QPrefPathsModule.ui: remove

View File

@ -56,8 +56,8 @@ void QBranch::update_contents()
const_iterator const begin = branchlist.begin();
const_iterator const end = branchlist.end();
int id = 1;
int count = 1;
int id = 0;
int count = 0;
for (const_iterator it = begin; it != end; ++it, ++count) {
string const & branch = it->getBranch();
dialog_->branchCO->insertItem(toqstr(branch));

View File

@ -420,6 +420,13 @@ void QDocumentDialog::updateNumbering()
void QDocumentDialog::updateBranchView()
{
// store the selected branch
QListViewItem * selItem =
branchesModule->branchesLV->selectedItem();
QString sel_branch;
if (selItem != 0)
sel_branch = selItem->text(0);
branchesModule->branchesLV->clear();
BranchList::const_iterator it = form_->branchlist_.begin();
@ -438,6 +445,9 @@ void QDocumentDialog::updateBranchView()
coloritem.fill(itemcolor);
newItem->setPixmap(2, coloritem);
}
// restore selected branch
if (bname == sel_branch)
branchesModule->branchesLV->setSelected(newItem, true);
}
form_->changed();
}