3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Bernhard Reiter
8 * Full author contact details are available in file CREDITS.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
22 #include "ControlBranch.h"
24 #include "BranchList.h"
25 #include "insets/insetbranch.h"
29 #include <libglademm.h>
37 GBranch::GBranch(Dialog & parent)
38 : GViewCB<ControlBranch, GViewGladeB>(parent, _("Branch Settings"), false)
42 void GBranch::doBuild()
44 string const gladeName = findGladeFile("branch");
45 xml_ = Gnome::Glade::Xml::create(gladeName);
47 xml_->get_widget("Cancel", cancelbutton_);
48 setCancel(cancelbutton_);
49 xml_->get_widget("OK", okbutton_);
52 Gtk::Box * box = NULL;
53 xml_->get_widget("innerbox", box);
54 box->pack_start(branchescombo_, true, true, 0);
57 // Set shortcut target
58 xml_->get_widget("BranchesLabel", brancheslabel_);
59 brancheslabel_->set_mnemonic_widget(branchescombo_);
61 // Single click in branches list
62 branchescombo_.signal_changed().connect(
63 sigc::mem_fun(*this, &GBranch::selection_changed));
68 void GBranch::update()
72 typedef BranchList::const_iterator const_iterator;
74 BranchList const branchlist = controller().branchlist();
75 string const cur_branch = controller().params().branch;
77 // FIXME: deprecated in favor of clear_items since gtkmm 2.8
78 branchescombo_.clear();
80 const_iterator const begin = branchlist.begin();
81 const_iterator const end = branchlist.end();
82 for (const_iterator it = begin; it != end; ++it)
83 branchescombo_.append_text(it->getBranch());
84 branchescombo_.set_active_text(cur_branch);
92 controller().params().branch = branchescombo_.get_active_text();;
96 void GBranch::selection_changed()
103 } // namespace frontend