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 #pragma implementation
17 #include "ControlForks.h"
21 #include "funcrequest.h"
23 #include "support/forkedcontr.h"
24 #include "support/lstrings.h"
26 #include <boost/bind.hpp>
31 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
32 : ControlDialogBI(lv, d)
36 vector<pid_t> const ControlForks::getPIDs() const
38 ForkedcallsController const & fcc = ForkedcallsController::get();
43 string const ControlForks::getCommand(pid_t pid) const
45 ForkedcallsController const & fcc = ForkedcallsController::get();
46 return fcc.getCommand(pid);
50 void ControlForks::kill(pid_t pid)
52 pids_.push_back(tostr(pid));
56 void ControlForks::apply()
58 if (!bufferIsAvailable())
67 for (vector<string>::const_iterator it = pids_.begin();
68 it != pids_.end(); ++it) {
69 lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
76 void ControlForks::setParams()
78 if (childrenChanged_.connected())
83 ForkedcallsController & fcc = ForkedcallsController::get();
85 fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
89 void ControlForks::clearParams()
92 childrenChanged_.disconnect();