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>
31 typedef QController<ControlBranch, QView<QBranchDialog> > base_class;
34 QBranch::QBranch(Dialog & parent)
35 : base_class(parent, _("Branch Settings"))
39 void QBranch::build_dialog()
41 dialog_.reset(new QBranchDialog(this));
43 bcview().setOK(dialog_->okPB);
44 bcview().setCancel(dialog_->closePB);
48 void QBranch::update_contents()
50 typedef BranchList::const_iterator const_iterator;
52 BranchList const & branchlist = controller().branchlist();
53 string const cur_branch = controller().params().branch;
55 dialog_->branchCO->clear();
57 const_iterator const begin = branchlist.begin();
58 const_iterator const end = branchlist.end();
61 for (const_iterator it = begin; it != end; ++it, ++count) {
62 string const & branch = it->getBranch();
63 dialog_->branchCO->insertItem(toqstr(branch));
65 if (cur_branch == branch)
68 dialog_->branchCO->setCurrentItem(id);
74 string const type = fromqstr(dialog_->branchCO->currentText());
75 controller().params().branch = type;
78 } // namespace frontend