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 <qcombobox.h>
25 #include <qpushbutton.h>
32 typedef QController<ControlBranch, QView<QBranchDialog> > base_class;
35 QBranch::QBranch(Dialog & parent)
36 : base_class(parent, _("LyX: Branch Settings"))
40 void QBranch::build_dialog()
42 dialog_.reset(new QBranchDialog(this));
44 bcview().setOK(dialog_->okPB);
45 bcview().setCancel(dialog_->closePB);
49 void QBranch::update_contents()
51 typedef BranchList::const_iterator const_iterator;
53 BranchList const & branchlist = controller().branchlist();
54 string const cur_branch = controller().params().branch;
56 dialog_->branchCO->clear();
58 const_iterator const begin = branchlist.begin();
59 const_iterator const end = branchlist.end();
62 for (const_iterator it = begin; it != end; ++it, ++count) {
63 string const & branch = it->getBranch();
64 dialog_->branchCO->insertItem(toqstr(branch));
66 if (cur_branch == branch)
69 dialog_->branchCO->setCurrentItem(id);
75 string const type = fromqstr(dialog_->branchCO->currentText());
76 controller().params().branch = type;
79 } // namespace frontend