]> git.lyx.org Git - features.git/commitdiff
two small qbranch ui fixes
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 5 Mar 2004 13:08:08 +0000 (13:08 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 5 Mar 2004 13:08:08 +0000 (13:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8477 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QBranch.C
src/frontends/qt2/QDocumentDialog.C

index 1f7458e033ca8012006530e4267e6d5509805c99..0e182c3ec6c5cb1de1efcc199d8d4182d5d89d81 100644 (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
index 6a5557514c8fbb81f9fdcbe29b9730756e3e206a..28fd7446b304a6c1bae486373668c706a093675d 100644 (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));
index 0c1d173eb2005c806eae2313516fba18b8ad197b..873371fa0c8811dcc0f2115039b5ff617f96f50b 100644 (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();
 }