3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Jürgen Spitzmüller
8 * Full author contact details are available in file CREDITS.
14 #include "QBranchDialog.h"
16 #include "qt_helpers.h"
18 #include "BranchList.h"
20 #include "controllers/ControlBranch.h"
22 #include "insets/insetbranch.h"
24 #include <QPushButton>
29 typedef QController<ControlBranch, QView<QBranchDialog> > base_class;
32 QBranch::QBranch(Dialog & parent)
33 : base_class(parent, _("Branch Settings"))
37 void QBranch::build_dialog()
39 dialog_.reset(new QBranchDialog(this));
41 bcview().setOK(dialog_->okPB);
42 bcview().setCancel(dialog_->closePB);
46 void QBranch::update_contents()
48 typedef BranchList::const_iterator const_iterator;
50 BranchList const & branchlist = controller().branchlist();
51 docstring const cur_branch = controller().params().branch;
53 dialog_->branchCO->clear();
55 const_iterator const begin = branchlist.begin();
56 const_iterator const end = branchlist.end();
59 for (const_iterator it = begin; it != end; ++it, ++count) {
60 docstring const & branch = it->getBranch();
61 dialog_->branchCO->addItem(toqstr(branch));
63 if (cur_branch == branch)
66 dialog_->branchCO->setCurrentIndex(id);
72 docstring const type = qstring_to_ucs4(dialog_->branchCO->currentText());
73 controller().params().branch = type;
76 } // namespace frontend