Remove the Forks dialog.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8497 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-03-17 21:21:47 +00:00
parent f13b5fb356
commit 5394e9acc5
33 changed files with 56 additions and 869 deletions

View File

@ -1,3 +1,8 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* ui/classic.ui:
* ui/stdmenus.ui: remove "dialog-show forks".
2004-03-15 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* doc/LaTeXConfig.lyx.in: fix entry for REVTeX (bug #1533)

View File

@ -352,7 +352,6 @@ Menuset
Separator
Item "LaTeX Logfile|L" "dialog-show latexlog"
Item "Table of Contents|C" "toc-view"
Item "Child Processes|o" "dialog-show forks"
Item "TeX Information|X" "dialog-show texinfo"
End

View File

@ -412,7 +412,6 @@ Menuset
Item "Spellchecker...|S" "dialog-show spellchecker"
OptItem "Thesaurus...|T" "thesaurus-entry"
OptItem "Check TeX|h" "buffer-chktex"
Item "View Child Processes...|C" "dialog-show forks"
Item "TeX Information...|I" "dialog-show texinfo"
Separator
# A LOT of applications have Tools->Prefs. Remember this

View File

@ -105,7 +105,6 @@ src/frontends/xforms/FormErrorList.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormFloat.C
src/frontends/xforms/FormForks.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/FormMathsBitmap.C
@ -177,7 +176,6 @@ src/lyxfont.C
src/lyxfunc.C
src/lyxrc.C
src/lyxvc.C
src/mathed/formula.C
src/mathed/formulamacro.C
src/mathed/math_hullinset.C
src/mathed/math_macrotemplate.C
@ -192,8 +190,6 @@ src/paragraph.C
src/paragraph_funcs.C
src/rowpainter.C
src/support/globbing.C
src/support/path_defines.C
src/tex2lyx/lengthcommon.C
src/text.C
src/text2.C
src/text3.C

View File

@ -1,3 +1,11 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* lfuns.h:
* LyXAction.C (init): remove LFUN_FORKS_KILL.
* lyxfunc.C (getStatus, dispatch) remove lfuns to show the forks
dialog and to kill a forked process.
2004-03-17 Alfredo Braunstein <abraunst@lyx.org>
* text2.C (setCursorFromCoordinates): fix font problem

View File

@ -299,7 +299,6 @@ void LyXAction::init()
{ LFUN_TRANSPOSE_CHARS, "chars-transpose", Noop },
{ LFUN_FLOAT_LIST, "float-list", Noop },
{ LFUN_ESCAPE, "escape", ReadOnly },
{ LFUN_FORKS_KILL, "kill-forks", NoBuffer },
{ LFUN_TOOLTIPS_TOGGLE, "toggle-tooltips", NoBuffer },
{ LFUN_TRACK_CHANGES, "track-changes", Noop },
{ LFUN_MERGE_CHANGES, "merge-changes", Noop },

View File

@ -1,3 +1,9 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* Dialogs.h (showFoks): removed.
* guiapi.[Ch] (gui_ShowForks): removed.
2004-01-25 Angus Leeming <leeming@lyx.org>
* Dialogs.h (showSearch):

View File

@ -67,8 +67,6 @@ public:
//@{
///
void showDocument();
/// show all forked child processes
void showForks();
///
void showPreamble();
///

View File

@ -1,3 +1,9 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* ControlForks.[Ch]: removed.
* Makefile.am: remove mention of ControlForks.[Ch].
2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* biblio.[Ch]:

View File

@ -1,91 +0,0 @@
/**
* \file ControlForks.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "ControlForks.h"
#include "ViewBase.h"
#include "lyxfunc.h"
#include "funcrequest.h"
#include "support/forkedcontr.h"
#include "support/tostr.h"
#include <boost/bind.hpp>
using lyx::support::ForkedcallsController;
using std::string;
using std::vector;
ControlForks::ControlForks(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
{}
vector<pid_t> const ControlForks::getPIDs() const
{
return ForkedcallsController::get().getPIDs();
}
string const ControlForks::getCommand(pid_t pid) const
{
return ForkedcallsController::get().getCommand(pid);
}
void ControlForks::kill(pid_t pid)
{
pids_.push_back(pid);
}
void ControlForks::apply()
{
if (!bufferIsAvailable())
return;
view().apply();
// Nothing to apply?
if (pids_.empty())
return;
for (vector<pid_t>::const_iterator it = pids_.begin();
it != pids_.end(); ++it) {
lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, tostr(*it)));
}
pids_.clear();
}
void ControlForks::setParams()
{
if (childrenChanged_.connected())
return;
pids_.clear();
ForkedcallsController & fcc = ForkedcallsController::get();
childrenChanged_ =
fcc.childrenChanged.connect(boost::bind(&ControlForks::update, this));
}
void ControlForks::clearParams()
{
pids_.clear();
childrenChanged_.disconnect();
}

View File

@ -1,49 +0,0 @@
// -*- C++ -*-
/**
* \file ControlForks.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS.
*/
#ifndef CONTROLFORKS_H
#define CONTROLFORKS_H
#include "ControlDialog_impl.h"
#include <boost/signals/connection.hpp>
#include <vector>
#include <sys/types.h>
/** A controller for dialogs that display the child processes forked by LyX.
Also provides an interface enabling them to be killed prematurely.
*/
class ControlForks : public ControlDialogBI {
public:
///
ControlForks(LyXView &, Dialogs &);
///
std::vector<pid_t> const getPIDs() const;
///
std::string const getCommand(pid_t) const;
///
void kill(pid_t);
private:
///
virtual void apply();
/// disconnect from the ForkedcallsController
virtual void clearParams();
/// connect to the ForkedcallsController
virtual void setParams();
/// Connection to the ForkedcallsController signal
boost::signals::connection childrenChanged_;
/// The list of PIDs to kill
std::vector<pid_t> pids_;
};
#endif // CONTROLFORKS_H

View File

@ -60,8 +60,6 @@ libcontrollers_la_SOURCES= \
ControlExternal.h \
ControlFloat.C \
ControlFloat.h \
ControlForks.C \
ControlForks.h \
ControlGraphics.C \
ControlGraphics.h \
ControlInclude.C \

View File

@ -1,3 +1,8 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* Dialogs.C, Dialogs2.C, Dialogs_impl.h, Makefile.am: remove
mention of the forks dialog.
2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
* GFloat.C (update): "c" -> 'c' in calls to contains

View File

@ -35,7 +35,6 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
external(lv, d),
file(lv, d),
floats(lv, d),
forks(lv, d),
graphics(lv, d),
include(lv, d),
logfile(lv, d),

View File

@ -57,12 +57,6 @@ void Dialogs::showFloat(InsetFloat * ifl)
}
void Dialogs::showForks()
{
pimpl_->forks.controller().show();
}
void Dialogs::showGraphics(InsetGraphics * ig)
{
pimpl_->graphics.controller().showInset(ig);

View File

@ -49,10 +49,6 @@
#include "ControlFloat.h"
#include "GFloat.h"
#include "ControlForks.h"
#include "FormForks.h"
#include "forms/form_forks.h"
#include "ControlGraphics.h"
#include "FormGraphics.h"
#include "forms/form_graphics.h"
@ -159,9 +155,6 @@ FileDialog;
typedef GUI<ControlFloat, GFloat, NoRepeatedApplyReadOnlyPolicy, gnomeBC>
FloatDialog;
typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
ForksDialog;
typedef GUI<ControlGraphics, FormGraphics, NoRepeatedApplyReadOnlyPolicy, xformsBC>
GraphicsDialog;
@ -225,7 +218,6 @@ struct Dialogs::Impl {
ExternalDialog external;
FileDialog file;
FloatDialog floats;
ForksDialog forks;
GraphicsDialog graphics;
IncludeDialog include;
LogFileDialog logfile;

View File

@ -31,7 +31,6 @@ xforms_objects = \
../xforms/FormCitation.lo \
../xforms/FormDocument.lo \
../xforms/FormExternal.lo \
../xforms/FormForks.lo \
../xforms/FormGraphics.lo \
../xforms/FormInclude.lo \
../xforms/FormIndex.lo \
@ -88,7 +87,6 @@ xforms_objects = \
../xforms/forms/form_external.lo \
../xforms/forms/form_filedialog.lo \
../xforms/forms/form_float.lo \
../xforms/forms/form_forks.lo \
../xforms/forms/form_graphics.lo \
../xforms/forms/form_include.lo \
../xforms/forms/form_index.lo \

View File

@ -1,4 +1,9 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* Makefile.am: remove mention of the forks dialog.
2004-02-09 Huang Ying <hying_caritas@163.com>
* GXpmBtnTbl.C : add a GXpmBtnTbl class to automate creating a Xpm
Button Table according to a set of xpm data or xbm data, is equivalent
with bmtable in xforms frontend.
@ -7,6 +12,7 @@
* GMathDelim.C : math delimiter dialog.
2004-02-07 Huang Ying <hying_caritas@163.com>
* GViewBase.C : add addCancel, addOK, addApply, add Restore to
facilitate setup buttons signal.
* GAboutLyx.C : using addxxx series functions.

View File

@ -93,7 +93,6 @@ xforms_objects = \
../xforms/FormERT.lo \
../xforms/FormExternal.lo \
../xforms/FormFloat.lo \
../xforms/FormForks.lo \
../xforms/FormGraphics.lo \
../xforms/FormInclude.lo \
../xforms/FormLog.lo \

View File

@ -28,12 +28,6 @@ void gui_ShowDocument(Dialogs & d)
}
void gui_ShowForks(Dialogs & d)
{
d.showForks();
}
void gui_ShowPreamble(Dialogs & d)
{
d.showPreamble();

View File

@ -21,7 +21,6 @@ extern "C" {
void gui_show_dialog(Dialogs *, char const * name, char const * data);
void gui_ShowDocument(Dialogs &);
void gui_ShowForks(Dialogs &);
void gui_ShowPreamble(Dialogs &);
void gui_ShowPreferences(Dialogs &);
void gui_ShowPrint(Dialogs &);

View File

@ -1,3 +1,7 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* Dialogs2.C, lyx_gui.C: remove mention of the forks dialog.
2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QCitation.C:

View File

@ -24,7 +24,6 @@
#include "QDocument.h"
#include "QDocumentDialog.h"
//#include "QForks.h"
// Here would be an appropriate point to lecture on the evils
// of the Qt headers, those most fucked up of disgusting ratholes.
// But I won't.
@ -94,10 +93,6 @@ void Dialogs::showDocument()
}
void Dialogs::showForks()
{}
void Dialogs::showPreamble()
{
pimpl_->document.controller().show();

View File

@ -232,7 +232,7 @@ FuncStatus getStatus(FuncRequest const & ev)
FuncStatus flag;
switch (ev.action) {
case LFUN_DIALOG_SHOW:
if (ev.argument == "preamble" || ev.argument == "forks")
if (ev.argument == "preamble")
flag.unknown(true);
break;
case LFUN_TOOLTIPS_TOGGLE:

View File

@ -1,3 +1,9 @@
2004-03-17 Angus Leeming <leeming@lyx.org>
* Dialogs2.C, FormForks.[Ch], Makefile.am:
* forms/Makefile.am, forms/form_forks.fd:
remove mention of the forks dialog.
2004-03-07 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* FormCitation.C:

View File

@ -22,10 +22,6 @@
#include "FormDocument.h"
#include "forms/form_document.h"
#include "ControlForks.h"
#include "FormForks.h"
#include "forms/form_forks.h"
#include "ControlPreamble.h"
#include "FormPreamble.h"
#include "forms/form_preamble.h"
@ -50,9 +46,6 @@
typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
DocumentDialog;
typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
ForksDialog;
typedef GUI<ControlPreamble, FormPreamble, NoRepeatedApplyReadOnlyPolicy, xformsBC>
PreambleDialog;
@ -73,7 +66,6 @@ struct Dialogs::Impl {
Impl(LyXView & lv, Dialogs & d);
DocumentDialog document;
ForksDialog forks;
PreambleDialog preamble;
PreferencesDialog preferences;
PrintDialog print;
@ -84,7 +76,6 @@ struct Dialogs::Impl {
Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
: document(lv, d),
forks(lv, d),
preamble(lv, d),
preferences(lv, d),
print(lv, d),
@ -111,12 +102,6 @@ void Dialogs::showDocument()
}
void Dialogs::showForks()
{
pimpl_->forks.controller().show();
}
void Dialogs::showPreamble()
{
pimpl_->preamble.controller().show();

View File

@ -1,426 +0,0 @@
/**
* \file FormForks.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS.
* \date 2001-10-22
*/
#include <config.h>
#include "FormForks.h"
#include "ControlForks.h"
#include "forms/form_forks.h"
#include "Tooltips.h"
#include "xforms_helpers.h"
#include "xformsBC.h"
#include "controllers/ButtonController.h"
#include "support/lstrings.h"
#include "support/tostr.h"
#include "lyx_forms.h"
using lyx::support::split;
using lyx::support::strToInt;
using std::find;
using std::find_if;
using std::string;
using std::vector;
typedef FormCB<ControlForks, FormDB<FD_forks> > base_class;
FormForks::FormForks()
: base_class(_("Child Processes"))
{}
void FormForks::build() {
dialog_.reset(build_forks(this));
// It appears that the browsers aren't initialised properly.
// This fudge fixes tings.
fl_add_browser_line(dialog_->browser_children, " ");
fl_add_browser_line(dialog_->browser_kill, " ");
fl_clear_browser(dialog_->browser_children);
fl_clear_browser(dialog_->browser_kill);
// Manage the ok, apply, restore and cancel/close buttons
bcview().setOK(dialog_->button_ok);
bcview().setApply(dialog_->button_apply);
bcview().setCancel(dialog_->button_close);
bc().valid(false);
// Set up the tooltip mechanism
string str = _("All currently running child processes forked by LyX.");
tooltips().init(dialog_->browser_children, str);
#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL == 0)
// Work-around xforms' bug; enable tooltips for browser widgets.
setPrehandler(dialog_->browser_children);
#endif
str = _("A list of all child processes to kill.");
tooltips().init(dialog_->browser_kill, str);
#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL == 0)
// Work-around xforms' bug; enable tooltips for browser widgets.
setPrehandler(dialog_->browser_kill);
#endif
str = _("Add all processes to the list of processes to kill.");
tooltips().init(dialog_->button_all, str);
str = _("Add the currently selected child process to the list of processes to kill.");
tooltips().init(dialog_->button_add, str);
str = _("Remove the currently selected item from the list of processes to kill.");
tooltips().init(dialog_->button_remove, str);
}
void FormForks::update()
{
if (!form())
return;
string const current_pid_str =
getString(dialog_->browser_kill);
pid_t const current_pid = strToInt(current_pid_str);
vector<pid_t> pids = controller().getPIDs();
// No child processes.
if (pids.empty()) {
if (fl_get_browser_maxline(dialog_->browser_kill) > 0)
fl_clear_browser(dialog_->browser_kill);
if (fl_get_browser_maxline(dialog_->browser_children) > 0)
fl_clear_browser(dialog_->browser_children);
setEnabled(dialog_->browser_children, false);
setEnabled(dialog_->browser_kill, false);
setEnabled(dialog_->button_all, false);
setEnabled(dialog_->button_add, false);
setEnabled(dialog_->button_remove, false);
return;
}
// Remove any processes from the kill browser that aren't in the
// vector of existing PIDs.
for (int i = 1; i <= fl_get_browser_maxline(dialog_->browser_kill);
++i) {
string const pid_str =
getString(dialog_->browser_kill, i);
pid_t const pid = strToInt(pid_str);
vector<pid_t>::const_iterator it =
find(pids.begin(), pids.end(), pid);
if (it == pids.end())
fl_delete_browser_line(dialog_->browser_kill, i);
}
// Build the children browser from scratch.
if (fl_get_browser_maxline(dialog_->browser_children) > 0)
fl_clear_browser(dialog_->browser_children);
int i = 1;
for (vector<pid_t>::const_iterator it = pids.begin();
it != pids.end(); ++it) {
string const pid_str = tostr(*it);
string const command = controller().getCommand(*it);
string const line = pid_str + '\t' + command;
fl_add_browser_line(dialog_->browser_children, line.c_str());
if (*it == current_pid)
fl_select_browser_line(dialog_->browser_children, i);
++i;
}
setEnabled(dialog_->browser_children, true);
setEnabled(dialog_->button_all, true);
setEnabled(dialog_->button_add, true);
}
void FormForks::apply()
{
// Get the list of all processes to kill.
vector<string> const kill_vec =
getVector(dialog_->browser_kill);
if (kill_vec.empty())
return;
// Remove these items from the vector of child processes.
for (int i = 1; i <= fl_get_browser_maxline(dialog_->browser_children);
++i) {
string const selection =
getString(dialog_->browser_children, i);
string pid_str;
split(selection, pid_str, '\t');
vector<string>::const_iterator it =
find(kill_vec.begin(), kill_vec.end(), pid_str);
if (it != kill_vec.end())
fl_delete_browser_line(dialog_->browser_children, i);
}
// Clear the kill browser and deactivate appropriately.
fl_clear_browser(dialog_->browser_kill);
setEnabled(dialog_->browser_kill, false);
setEnabled(dialog_->button_remove, false);
// Pass these pids to the controller for destruction.
for (vector<string>::const_iterator it = kill_vec.begin();
it != kill_vec.end(); ++it) {
pid_t const pid = strToInt(*it);
controller().kill(pid);
}
}
ButtonPolicy::SMInput FormForks::input(FL_OBJECT * ob, long)
{
ButtonPolicy::SMInput activate = ButtonPolicy::SMI_NOOP;
if (ob == dialog_->browser_children) {
activate = input_browser_children();
} else if (ob == dialog_->browser_kill) {
activate = input_browser_kill();
} else if (ob == dialog_->button_all) {
activate = input_button_all();
} else if (ob == dialog_->button_add) {
activate = input_button_add();
} else if (ob == dialog_->button_remove) {
activate = input_button_remove();
}
return activate;
}
ButtonPolicy::SMInput FormForks::input_browser_children()
{
// Selected an item in the browser containing a list of all child
// processes.
// 1. Highlight this item in the browser of processes to kill
// if it is already there.
// 2. If it is there, enable the remove button so that it can
// be removed from this list, if so desired.
// 3. If it isn't there, activate the add button so that it can
// be added to this list if so desired.
string const selection =
getString(dialog_->browser_children);
string pid_str;
split(selection, pid_str, '\t');
vector<string> const kill_vec =
getVector(dialog_->browser_kill);
vector<string>::const_iterator it =
find(kill_vec.begin(), kill_vec.end(), pid_str);
fl_deselect_browser(dialog_->browser_kill);
if (it != kill_vec.end()) {
int const n = int(it - kill_vec.begin());
fl_select_browser_line(dialog_->browser_kill, n+1);
fl_set_browser_topline(dialog_->browser_kill, n+1);
}
setEnabled(dialog_->button_remove, it != kill_vec.end());
setEnabled(dialog_->button_add, it == kill_vec.end());
return ButtonPolicy::SMI_NOOP;
}
namespace {
class FindPID : public std::unary_function<string, bool> {
public:
FindPID(string const & pid) : pid_(pid) {}
bool operator()(string const & line) const
{
if (line.empty())
return false;
string pid_str;
split(line, pid_str, '\t');
return pid_str == pid_;
}
private:
string pid_;
};
} // namespace anon
ButtonPolicy::SMInput FormForks::input_browser_kill()
{
// Selected an item in the browser containing a list of processes
// to kill.
// 1. Highlight this item in the browser of all child processes.
// 2. Enable the remove button so that it can removed from this list,
// if so desired.
// 3. Disable the add button.
string const pid_str =
getString(dialog_->browser_kill);
// Find this string in the list of all child processes
vector<string> const child_vec =
getVector(dialog_->browser_children);
vector<string>::const_iterator it =
find_if(child_vec.begin(), child_vec.end(), FindPID(pid_str));
fl_deselect_browser(dialog_->browser_children);
if (it != child_vec.end()) {
int const n = int(it - child_vec.begin());
fl_select_browser_line(dialog_->browser_children, n+1);
fl_set_browser_topline(dialog_->browser_children, n+1);
}
setEnabled(dialog_->button_remove, true);
setEnabled(dialog_->button_add, false);
return ButtonPolicy::SMI_NOOP;
}
namespace {
vector<string> const getPIDvector(FL_OBJECT * ob)
{
vector<string> vec = getVector(ob);
if (vec.empty())
return vec;
for (vector<string>::iterator it = vec.begin(); it != vec.end(); ++it) {
string pid_str;
split(*it, pid_str, '\t');
*it = pid_str;
}
return vec;
}
} // namespace anon
ButtonPolicy::SMInput FormForks::input_button_all()
{
// Pressed the "All" button.
// 1. Check that the browser of processes to kill doesn't already
// contain the entire list.
// 2. If it doesn't, copy the PIDs of all child processes into the
// browser of processes to kill.
// 3. Deactivate the "children" browser and the "add" and "all" buttons
// 4. Activate the "kill" browser and the "remove" button"
ButtonPolicy::SMInput activate = ButtonPolicy::SMI_NOOP;
vector<string> const pid_vec = getPIDvector(dialog_->browser_children);
// to resolve a warning about comparison between signed and unsigned.
int const pid_vec_size = int(pid_vec.size());
if (fl_get_browser_maxline(dialog_->browser_kill) != pid_vec_size) {
activate = ButtonPolicy::SMI_VALID;
fl_clear_browser(dialog_->browser_kill);
for (vector<string>::const_iterator it = pid_vec.begin();
it != pid_vec.end(); ++it) {
fl_add_browser_line(dialog_->browser_kill, it->c_str());
}
if (fl_get_browser_maxline(dialog_->browser_kill) >= 1)
fl_set_browser_topline(dialog_->browser_kill, 1);
}
setEnabled(dialog_->browser_children, false);
setEnabled(dialog_->button_add, false);
setEnabled(dialog_->button_all, false);
setEnabled(dialog_->browser_kill, true);
setEnabled(dialog_->button_remove, true);
return activate;
}
ButtonPolicy::SMInput FormForks::input_button_add()
{
// Pressed the "Add" button.
// 1. Copy the PID of the selected item in the browser of all child
// processes over into the browser of processes to kill.
// 2. Activate the "kill" browser and the "remove" button.
// 3. Deactivate the "add" button.
string const selection = getString(dialog_->browser_children);
string pid_str;
split(selection, pid_str, '\t');
vector<string> const kill_vec =
getVector(dialog_->browser_kill);
vector<string>::const_iterator it =
find(kill_vec.begin(), kill_vec.end(), pid_str);
if (it == kill_vec.end()) {
fl_add_browser_line(dialog_->browser_kill, pid_str.c_str());
int const n = fl_get_browser_maxline(dialog_->browser_kill);
fl_select_browser_line(dialog_->browser_kill, n);
}
setEnabled(dialog_->browser_kill, true);
setEnabled(dialog_->button_remove, true);
setEnabled(dialog_->button_add, false);
return ButtonPolicy::SMI_VALID;
}
ButtonPolicy::SMInput FormForks::input_button_remove()
{
// Pressed the "Remove" button.
// 1. Remove the selected item in the browser of processes to kill.
// 2. Activate the "add" button and "all" buttons.
// 3. Deactivate the "remove" button.
int const sel = fl_get_browser(dialog_->browser_kill);
fl_delete_browser_line(dialog_->browser_kill, sel);
setEnabled(dialog_->button_add, true);
setEnabled(dialog_->button_all, true);
setEnabled(dialog_->button_remove, false);
return ButtonPolicy::SMI_VALID;
}

View File

@ -1,46 +0,0 @@
// -*- C++ -*-
/**
* \file FormForks.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS.
*/
#ifndef FORMFORKS_H
#define FORMFORKS_H
#include "FormBase.h"
class ControlForks;
struct FD_forks;
class FormForks : public FormCB<ControlForks, FormDB<FD_forks> > {
public:
///
FormForks();
/// preemptive handler for feedback messages
void feedbackCB(FL_OBJECT *, int);
private:
/// Return the list of PIDs to kill to the controller.
virtual void apply();
/// Build the dialog.
virtual void build();
/// Update the dialog.
virtual void update();
/// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
ButtonPolicy::SMInput input_browser_children();
ButtonPolicy::SMInput input_browser_kill();
ButtonPolicy::SMInput input_button_all();
ButtonPolicy::SMInput input_button_add();
ButtonPolicy::SMInput input_button_remove();
};
#endif // FORMFORKS_H

View File

@ -96,8 +96,6 @@ libxforms_la_SOURCES = \
FormExternal.h \
FormFloat.C \
FormFloat.h \
FormForks.C \
FormForks.h \
FormGraphics.C \
FormGraphics.h \
FormInclude.C \

View File

@ -25,7 +25,6 @@ SRCS = form_aboutlyx.fd \
form_external.fd \
form_filedialog.fd \
form_float.fd \
form_forks.fd \
form_graphics.fd \
form_include.fd \
form_maths_delim.fd \

View File

@ -1,179 +0,0 @@
Magic: 13000
Internal Form Definition File
(do not change)
Number of forms: 1
Unit of measure: FL_COORD_PIXEL
SnapGrid: 5
=============== FORM ===============
Name: form_forks
Width: 535
Height: 200
Number of Objects: 9
--------------------
class: FL_BOX
type: FLAT_BOX
box: 0 0 535 200
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
--------------------
class: FL_BROWSER
type: HOLD_BROWSER
box: 5 20 330 140
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Forked child processes:|#F
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NorthWest FL_South
name: browser_children
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BROWSER
type: HOLD_BROWSER
box: 410 20 120 140
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Kill processes:|#K
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_North FL_SouthEast
name: browser_kill
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 340 25 65 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: All ->
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_North FL_North
name: button_all
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 360 55 25 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: @->
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_North FL_North
name: button_add
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 360 85 25 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: @4->
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_North FL_North
name: button_remove
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
box: 250 170 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: OK
shortcut: ^M
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_ok
callback: C_FormBaseOKCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 345 170 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Apply|#A
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_apply
callback: C_FormBaseApplyCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 440 170 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Close|^[
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_close
callback: C_FormBaseCancelCB
argument: 0
==============================
create_the_forms

View File

@ -282,58 +282,57 @@ enum kb_action {
LFUN_TRANSPOSE_CHARS, // Lgb 20010425
LFUN_ESCAPE, // Lgb 20010517
LFUN_THESAURUS_ENTRY, // Levon 20010720
LFUN_FORKS_KILL, // Angus 16 Feb 2002
LFUN_TOOLTIPS_TOGGLE, // Angus 8 Mar 2002
// 215
LFUN_INSET_OPTARG, // Martin 12 Aug 2002
// 215
LFUN_MOUSE_PRESS, // André 9 Aug 2002
LFUN_MOUSE_MOTION, // André 9 Aug 2002
LFUN_MOUSE_RELEASE, // André 9 Aug 2002
LFUN_MOUSE_DOUBLE, // André 9 Aug 2002
// 220
LFUN_MOUSE_TRIPLE, // André 9 Aug 2002
// 220
LFUN_INSET_WRAP, // Dekel 7 Apr 2002
LFUN_TRACK_CHANGES, // Levon 20021001 (cool date !)
LFUN_MERGE_CHANGES, // Levon 20021016
LFUN_ACCEPT_CHANGE, // Levon 20021016
// 225
LFUN_REJECT_CHANGE, // Levon 20021016
// 225
LFUN_ACCEPT_ALL_CHANGES, // Levon 20021016
LFUN_REJECT_ALL_CHANGES, // Levon 20021016
LFUN_INSERT_BIBITEM, // André 14 Feb 2003
LFUN_DIALOG_SHOW,
// 230
LFUN_DIALOG_SHOW_NEW_INSET,
// 230
LFUN_DIALOG_SHOW_NEXT_INSET,
LFUN_DIALOG_UPDATE,
LFUN_DIALOG_HIDE,
LFUN_DIALOG_DISCONNECT_INSET,
// 235
LFUN_INSET_APPLY,
// 235
LFUN_INSET_INSERT,
LFUN_INSET_MODIFY,
LFUN_INSET_DIALOG_UPDATE,
LFUN_INSET_SETTINGS,
// 240
LFUN_PARAGRAPH_APPLY,
// 240
LFUN_PARAGRAPH_UPDATE,
LFUN_EXTERNAL_EDIT,
LFUN_INSERT_BRANCH,
LFUN_INSET_DIALOG_SHOW,
// 245
LFUN_INSERT_BOX,
// 245
LFUN_INSERT_LINE,
LFUN_INSERT_PAGEBREAK,
LFUN_REPEAT,
LFUN_FINISHED_LEFT,
// 250
LFUN_FINISHED_RIGHT,
// 250
LFUN_FINISHED_UP,
LFUN_FINISHED_DOWN,
LFUN_INSERT_CHARSTYLE,
LFUN_WORD_FIND,
// 255
LFUN_WORD_REPLACE,
// 255
LFUN_LASTACTION // end of the table
};

View File

@ -518,7 +518,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
if (!buf) {
disable = !(name == "aboutlyx" ||
name == "file" ||
name == "forks" ||
name == "preferences" ||
name == "texinfo");
break;
@ -1143,8 +1142,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
}
else if (name == "document")
owner->getDialogs().showDocument();
else if (name == "forks")
owner->getDialogs().showForks();
else if (name == "preamble")
owner->getDialogs().showPreamble();
else if (name == "preferences")
@ -1372,11 +1369,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
owner->message(argument);
break;
case LFUN_FORKS_KILL:
if (isStrInt(argument))
ForkedcallsController::get().kill(strToInt(argument));
break;
case LFUN_TOOLTIPS_TOGGLE:
owner->getDialogs().toggleTooltips();
break;