3 * Copyright 2001 The LyX Team
6 * \author Angus Leeming
12 #pragma implementation
15 #include "ControlForks.h"
18 #include "BufferView.h"
19 #include "frontends/LyXView.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 (!lv_.view()->available())
67 for (vector<string>::const_iterator it = pids_.begin();
68 it != pids_.end(); ++it) {
69 lv_.getLyXFunc()->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();