3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
13 #include "ControlForks.h"
17 #include "funcrequest.h"
19 #include "support/forkedcontr.h"
20 #include "support/tostr.h"
22 #include <boost/bind.hpp>
27 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
28 : ControlDialogBI(lv, d)
32 vector<pid_t> const ControlForks::getPIDs() const
34 ForkedcallsController const & fcc = ForkedcallsController::get();
39 string const ControlForks::getCommand(pid_t pid) const
41 ForkedcallsController const & fcc = ForkedcallsController::get();
42 return fcc.getCommand(pid);
46 void ControlForks::kill(pid_t pid)
48 pids_.push_back(tostr(pid));
52 void ControlForks::apply()
54 if (!bufferIsAvailable())
63 for (vector<string>::const_iterator it = pids_.begin();
64 it != pids_.end(); ++it) {
65 lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
72 void ControlForks::setParams()
74 if (childrenChanged_.connected())
79 ForkedcallsController & fcc = ForkedcallsController::get();
81 fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
85 void ControlForks::clearParams()
88 childrenChanged_.disconnect();