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"
23 #include "frontends/Dialogs.h"
25 #include "support/forkedcontr.h"
26 #include "support/lstrings.h"
31 ControlForks::ControlForks(LyXView & lv, Dialogs & d)
32 : ControlDialogBI(lv, d)
34 d_.showForks.connect(slot(this, &ControlForks::show));
38 vector<pid_t> const ControlForks::getPIDs() const
40 ForkedcallsController const & fcc = ForkedcallsController::get();
45 string const ControlForks::getCommand(pid_t pid) const
47 ForkedcallsController const & fcc = ForkedcallsController::get();
48 return fcc.getCommand(pid);
52 void ControlForks::kill(pid_t pid)
54 pids_.push_back(tostr(pid));
58 void ControlForks::apply()
60 if (!lv_.view()->available())
69 for (vector<string>::const_iterator it = pids_.begin();
70 it != pids_.end(); ++it) {
71 lv_.getLyXFunc()->dispatch(LFUN_FORKS_KILL, *it);
78 void ControlForks::setParams()
80 if (childrenChanged_.connected())
85 ForkedcallsController & fcc = ForkedcallsController::get();
87 fcc.childrenChanged.connect(slot(this, &ControlForks::update));
91 void ControlForks::clearParams()
94 childrenChanged_.disconnect();