3 * Copyright 2001 The LyX Team
6 * \author Angus Leeming
12 #pragma implementation
15 #include "ControlForks.h"
19 #include "funcrequest.h"
21 #include "support/forkedcontr.h"
22 #include "support/lstrings.h"
24 #include <boost/bind.hpp>
29 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
30 : ControlDialogBI(lv, d)
34 vector<pid_t> const ControlForks::getPIDs() const
36 ForkedcallsController const & fcc = ForkedcallsController::get();
41 string const ControlForks::getCommand(pid_t pid) const
43 ForkedcallsController const & fcc = ForkedcallsController::get();
44 return fcc.getCommand(pid);
48 void ControlForks::kill(pid_t pid)
50 pids_.push_back(tostr(pid));
54 void ControlForks::apply()
56 if (!bufferIsAvailable())
65 for (vector<string>::const_iterator it = pids_.begin();
66 it != pids_.end(); ++it) {
67 lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
74 void ControlForks::setParams()
76 if (childrenChanged_.connected())
81 ForkedcallsController & fcc = ForkedcallsController::get();
83 fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
87 void ControlForks::clearParams()
90 childrenChanged_.disconnect();