X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiBranch.cpp;h=57484c86f174426fd29c12c7d158339017d265d7;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=1a85b35fff4e12b58f4a3646d99c04ea569be3b5;hpb=470aba2a0e552f27d55992372c09f15af9725fa8;p=lyx.git diff --git a/src/frontends/qt4/GuiBranch.cpp b/src/frontends/qt4/GuiBranch.cpp index 1a85b35fff..57484c86f1 100644 --- a/src/frontends/qt4/GuiBranch.cpp +++ b/src/frontends/qt4/GuiBranch.cpp @@ -3,7 +3,9 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Jürgen Spitzmüller + * \author Angus Leeming + * \author Martin Vermeer + * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. */ @@ -12,26 +14,26 @@ #include "GuiBranch.h" -#include "ControlBranch.h" - #include "qt_helpers.h" + +#include "Buffer.h" +#include "BufferParams.h" #include "BranchList.h" +#include "FuncRequest.h" #include "insets/InsetBranch.h" #include -#include +using namespace std; namespace lyx { namespace frontend { -GuiBranchDialog::GuiBranchDialog(LyXView & lv) - : GuiDialog(lv, "branch") +GuiBranch::GuiBranch(GuiView & lv) + : GuiDialog(lv, "branch", qt_("Branch Settings")) { setupUi(this); - setController(new ControlBranch(*this)); - setViewTitle(_("Branch Settings")); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); @@ -43,31 +45,18 @@ GuiBranchDialog::GuiBranchDialog(LyXView & lv) } -ControlBranch & GuiBranchDialog::controller() -{ - return static_cast(GuiDialog::controller()); -} - - -void GuiBranchDialog::closeEvent(QCloseEvent * e) -{ - slotClose(); - e->accept(); -} - - -void GuiBranchDialog::change_adaptor() +void GuiBranch::change_adaptor() { changed(); } -void GuiBranchDialog::updateContents() +void GuiBranch::updateContents() { typedef BranchList::const_iterator const_iterator; - BranchList const & branchlist = controller().branchlist(); - docstring const cur_branch = controller().params().branch; + BranchList const & branchlist = buffer().params().branchlist(); + docstring const cur_branch = params_.branch; branchCO->clear(); @@ -76,7 +65,7 @@ void GuiBranchDialog::updateContents() int id = 0; int count = 0; for (const_iterator it = begin; it != end; ++it, ++count) { - docstring const & branch = it->getBranch(); + docstring const & branch = it->branch(); branchCO->addItem(toqstr(branch)); if (cur_branch == branch) @@ -86,13 +75,35 @@ void GuiBranchDialog::updateContents() } -void GuiBranchDialog::applyView() +void GuiBranch::applyView() { - docstring const type = qstring_to_ucs4(branchCO->currentText()); - controller().params().branch = type; + params_.branch = qstring_to_ucs4(branchCO->currentText()); } + +bool GuiBranch::initialiseParams(string const & data) +{ + InsetBranch::string2params(data, params_); + return true; +} + + +void GuiBranch::clearParams() +{ + params_ = InsetBranchParams(); +} + + +void GuiBranch::dispatchParams() +{ + dispatch(FuncRequest(getLfun(), InsetBranch::params2string(params_))); +} + + +Dialog * createGuiBranch(GuiView & lv) { return new GuiBranch(lv); } + + } // namespace frontend } // namespace lyx -#include "GuiBranch_moc.cpp" +#include "moc_GuiBranch.cpp"