From: Angus Leeming Date: Wed, 17 Mar 2004 21:21:47 +0000 (+0000) Subject: Remove the Forks dialog. X-Git-Tag: 1.6.10~15459 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5394e9acc584a95587de5abde7623e30a2634a47;p=features.git Remove the Forks dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8497 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index fca80e724e..0923b1f066 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2004-03-17 Angus Leeming + + * ui/classic.ui: + * ui/stdmenus.ui: remove "dialog-show forks". + 2004-03-15 Jean-Marc Lasgouttes * doc/LaTeXConfig.lyx.in: fix entry for REVTeX (bug #1533) diff --git a/lib/ui/classic.ui b/lib/ui/classic.ui index 779ca99c81..de54f0b631 100644 --- a/lib/ui/classic.ui +++ b/lib/ui/classic.ui @@ -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 diff --git a/lib/ui/stdmenus.ui b/lib/ui/stdmenus.ui index fd83c7bd73..1962093ab7 100644 --- a/lib/ui/stdmenus.ui +++ b/lib/ui/stdmenus.ui @@ -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 diff --git a/po/POTFILES.in b/po/POTFILES.in index e2a9c1d57a..42c95124bb 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/ChangeLog b/src/ChangeLog index 6855488417..6cb26d3160 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-03-17 Angus Leeming + + * 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 * text2.C (setCursorFromCoordinates): fix font problem diff --git a/src/LyXAction.C b/src/LyXAction.C index f424e4c8d8..c166089e2c 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -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 }, diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 8b69af6d19..b143e27c1e 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,9 @@ +2004-03-17 Angus Leeming + + * Dialogs.h (showFoks): removed. + + * guiapi.[Ch] (gui_ShowForks): removed. + 2004-01-25 Angus Leeming * Dialogs.h (showSearch): diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index ddaf2c05df..daf888cfba 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -67,8 +67,6 @@ public: //@{ /// void showDocument(); - /// show all forked child processes - void showForks(); /// void showPreamble(); /// diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 1c3da24e21..61c503d1ad 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,9 @@ +2004-03-17 Angus Leeming + + * ControlForks.[Ch]: removed. + + * Makefile.am: remove mention of ControlForks.[Ch]. + 2004-03-07 Jürgen Spitzmüller * biblio.[Ch]: diff --git a/src/frontends/controllers/ControlForks.C b/src/frontends/controllers/ControlForks.C deleted file mode 100644 index 57bdf8be05..0000000000 --- a/src/frontends/controllers/ControlForks.C +++ /dev/null @@ -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 - -#include "ControlForks.h" -#include "ViewBase.h" - -#include "lyxfunc.h" -#include "funcrequest.h" - -#include "support/forkedcontr.h" -#include "support/tostr.h" - -#include - - -using lyx::support::ForkedcallsController; - -using std::string; -using std::vector; - - -ControlForks::ControlForks(LyXView & lv, Dialogs & d) - : ControlDialogBI(lv, d) -{} - - -vector 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::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(); -} diff --git a/src/frontends/controllers/ControlForks.h b/src/frontends/controllers/ControlForks.h deleted file mode 100644 index d88b1af791..0000000000 --- a/src/frontends/controllers/ControlForks.h +++ /dev/null @@ -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 - -#include -#include - - -/** 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 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 pids_; -}; - -#endif // CONTROLFORKS_H diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am index 2efe63eb97..d5944dc4cb 100644 --- a/src/frontends/controllers/Makefile.am +++ b/src/frontends/controllers/Makefile.am @@ -60,8 +60,6 @@ libcontrollers_la_SOURCES= \ ControlExternal.h \ ControlFloat.C \ ControlFloat.h \ - ControlForks.C \ - ControlForks.h \ ControlGraphics.C \ ControlGraphics.h \ ControlInclude.C \ diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index 7f1bdeb618..9b46d77add 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,8 @@ +2004-03-17 Angus Leeming + + * Dialogs.C, Dialogs2.C, Dialogs_impl.h, Makefile.am: remove + mention of the forks dialog. + 2004-02-01 Lars Gullik Bjonnes * GFloat.C (update): "c" -> 'c' in calls to contains diff --git a/src/frontends/gnome/Dialogs.C b/src/frontends/gnome/Dialogs.C index dacdef266f..99501a66cd 100644 --- a/src/frontends/gnome/Dialogs.C +++ b/src/frontends/gnome/Dialogs.C @@ -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), diff --git a/src/frontends/gnome/Dialogs2.C b/src/frontends/gnome/Dialogs2.C index 7ba8db630e..66d20ef798 100644 --- a/src/frontends/gnome/Dialogs2.C +++ b/src/frontends/gnome/Dialogs2.C @@ -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); diff --git a/src/frontends/gnome/Dialogs_impl.h b/src/frontends/gnome/Dialogs_impl.h index 1f5d933e84..1dfe4c9f5b 100644 --- a/src/frontends/gnome/Dialogs_impl.h +++ b/src/frontends/gnome/Dialogs_impl.h @@ -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 FloatDialog; -typedef GUI -ForksDialog; - typedef GUI GraphicsDialog; @@ -225,7 +218,6 @@ struct Dialogs::Impl { ExternalDialog external; FileDialog file; FloatDialog floats; - ForksDialog forks; GraphicsDialog graphics; IncludeDialog include; LogFileDialog logfile; diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index 94419ba803..1a75af66af 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -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 \ diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index 42bc3f1b27..c85b401e9a 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,4 +1,9 @@ +2004-03-17 Angus Leeming + + * Makefile.am: remove mention of the forks dialog. + 2004-02-09 Huang Ying + * 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 + * GViewBase.C : add addCancel, addOK, addApply, add Restore to facilitate setup buttons signal. * GAboutLyx.C : using addxxx series functions. diff --git a/src/frontends/gtk/Makefile.am b/src/frontends/gtk/Makefile.am index 69af83c3ba..f5bfda984a 100644 --- a/src/frontends/gtk/Makefile.am +++ b/src/frontends/gtk/Makefile.am @@ -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 \ diff --git a/src/frontends/guiapi.C b/src/frontends/guiapi.C index 9cd0d32a00..49edd6ae41 100644 --- a/src/frontends/guiapi.C +++ b/src/frontends/guiapi.C @@ -28,12 +28,6 @@ void gui_ShowDocument(Dialogs & d) } -void gui_ShowForks(Dialogs & d) -{ - d.showForks(); -} - - void gui_ShowPreamble(Dialogs & d) { d.showPreamble(); diff --git a/src/frontends/guiapi.h b/src/frontends/guiapi.h index 77e3c46f3c..4250df825c 100644 --- a/src/frontends/guiapi.h +++ b/src/frontends/guiapi.h @@ -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 &); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index f8ba471690..b217d52f64 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2004-03-17 Angus Leeming + + * Dialogs2.C, lyx_gui.C: remove mention of the forks dialog. + 2004-03-07 Jürgen Spitzmüller * QCitation.C: diff --git a/src/frontends/qt2/Dialogs2.C b/src/frontends/qt2/Dialogs2.C index e419f68387..1cf38f7789 100644 --- a/src/frontends/qt2/Dialogs2.C +++ b/src/frontends/qt2/Dialogs2.C @@ -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(); diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 4b95e12f15..2636e2805c 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -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: diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index d6c3d49c0a..517e664cb7 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,9 @@ +2004-03-17 Angus Leeming + + * 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 * FormCitation.C: diff --git a/src/frontends/xforms/Dialogs2.C b/src/frontends/xforms/Dialogs2.C index 1d50034f26..082c8398d8 100644 --- a/src/frontends/xforms/Dialogs2.C +++ b/src/frontends/xforms/Dialogs2.C @@ -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 DocumentDialog; -typedef GUI -ForksDialog; - typedef GUI 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(); diff --git a/src/frontends/xforms/FormForks.C b/src/frontends/xforms/FormForks.C deleted file mode 100644 index 83d3392def..0000000000 --- a/src/frontends/xforms/FormForks.C +++ /dev/null @@ -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 - -#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 > 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 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::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::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 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::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::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 const kill_vec = - getVector(dialog_->browser_kill); - - vector::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 { -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 const child_vec = - getVector(dialog_->browser_children); - - vector::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 const getPIDvector(FL_OBJECT * ob) -{ - vector vec = getVector(ob); - if (vec.empty()) - return vec; - - for (vector::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 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::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 const kill_vec = - getVector(dialog_->browser_kill); - - vector::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; -} diff --git a/src/frontends/xforms/FormForks.h b/src/frontends/xforms/FormForks.h deleted file mode 100644 index 41133cfbcf..0000000000 --- a/src/frontends/xforms/FormForks.h +++ /dev/null @@ -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 > { -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 diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 77ad9d6193..87528326e5 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -96,8 +96,6 @@ libxforms_la_SOURCES = \ FormExternal.h \ FormFloat.C \ FormFloat.h \ - FormForks.C \ - FormForks.h \ FormGraphics.C \ FormGraphics.h \ FormInclude.C \ diff --git a/src/frontends/xforms/forms/Makefile.am b/src/frontends/xforms/forms/Makefile.am index fd98192efd..0904dce39b 100644 --- a/src/frontends/xforms/forms/Makefile.am +++ b/src/frontends/xforms/forms/Makefile.am @@ -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 \ diff --git a/src/frontends/xforms/forms/form_forks.fd b/src/frontends/xforms/forms/form_forks.fd deleted file mode 100644 index c93f13291a..0000000000 --- a/src/frontends/xforms/forms/form_forks.fd +++ /dev/null @@ -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 diff --git a/src/lfuns.h b/src/lfuns.h index 40ffc22c1f..54319e8d8e 100644 --- a/src/lfuns.h +++ b/src/lfuns.h @@ -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 }; diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 63cda7cf37..7f45fa4a33 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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;