3 * Copyright 2001 The LyX Team
6 * \author Angus Leeming
12 #pragma implementation
15 #include "ControlForks.h"
16 #include "ButtonControllerBase.h"
19 #include "BufferView.h"
20 #include "frontends/LyXView.h"
23 #include "frontends/Dialogs.h"
25 #include "support/forkedcontr.h"
26 #include "support/lstrings.h"
28 #include <boost/bind.hpp>
33 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
34 : ControlDialogBI(lv, d)
36 d_.showForks = boost::bind(&ControlForks::show, this);
40 vector<pid_t> const ControlForks::getPIDs() const
42 ForkedcallsController const & fcc = ForkedcallsController::get();
47 string const ControlForks::getCommand(pid_t pid) const
49 ForkedcallsController const & fcc = ForkedcallsController::get();
50 return fcc.getCommand(pid);
54 void ControlForks::kill(pid_t pid)
56 pids_.push_back(tostr(pid));
60 void ControlForks::apply()
62 if (!lv_.view()->available())
71 for (vector<string>::const_iterator it = pids_.begin();
72 it != pids_.end(); ++it) {
73 lv_.getLyXFunc()->dispatch(LFUN_FORKS_KILL, *it);
80 void ControlForks::setParams()
82 if (childrenChanged_.connected())
87 ForkedcallsController & fcc = ForkedcallsController::get();
89 fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
93 void ControlForks::clearParams()
96 childrenChanged_.disconnect();