5 * \author Angus Leeming
7 * Full author contact details are available in file CREDITS
13 #pragma implementation
16 #include "ControlForks.h"
20 #include "funcrequest.h"
22 #include "support/forkedcontr.h"
23 #include "support/lstrings.h"
25 #include <boost/bind.hpp>
30 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
31 : ControlDialogBI(lv, d)
35 vector<pid_t> const ControlForks::getPIDs() const
37 ForkedcallsController const & fcc = ForkedcallsController::get();
42 string const ControlForks::getCommand(pid_t pid) const
44 ForkedcallsController const & fcc = ForkedcallsController::get();
45 return fcc.getCommand(pid);
49 void ControlForks::kill(pid_t pid)
51 pids_.push_back(tostr(pid));
55 void ControlForks::apply()
57 if (!bufferIsAvailable())
66 for (vector<string>::const_iterator it = pids_.begin();
67 it != pids_.end(); ++it) {
68 lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
75 void ControlForks::setParams()
77 if (childrenChanged_.connected())
82 ForkedcallsController & fcc = ForkedcallsController::get();
84 fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
88 void ControlForks::clearParams()
91 childrenChanged_.disconnect();