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
14 #include "ControlForks.h"
18 #include "funcrequest.h"
20 #include "support/forkedcontr.h"
21 #include "support/lstrings.h"
23 #include <boost/bind.hpp>
28 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
29 : ControlDialogBI(lv, d)
33 vector<pid_t> const ControlForks::getPIDs() const
35 ForkedcallsController const & fcc = ForkedcallsController::get();
40 string const ControlForks::getCommand(pid_t pid) const
42 ForkedcallsController const & fcc = ForkedcallsController::get();
43 return fcc.getCommand(pid);
47 void ControlForks::kill(pid_t pid)
49 pids_.push_back(tostr(pid));
53 void ControlForks::apply()
55 if (!bufferIsAvailable())
64 for (vector<string>::const_iterator it = pids_.begin();
65 it != pids_.end(); ++it) {
66 lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
73 void ControlForks::setParams()
75 if (childrenChanged_.connected())
80 ForkedcallsController & fcc = ForkedcallsController::get();
82 fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
86 void ControlForks::clearParams()
89 childrenChanged_.disconnect();