From 7bb99be122d9a8e092a082ca836b17e6720cd41e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Sun, 13 Jan 2002 13:07:27 +0000 Subject: [PATCH] fix problem with nroff detection, remove dead code with old floats, bogus message when closing last buffer, toolbar status when changing fonts in math; remove gnome menubar git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3352 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 6 ------ lib/ChangeLog | 4 ++++ lib/configure | 2 +- lib/configure.m4 | 2 +- src/BufferView_pimpl.C | 25 ++-------------------- src/ChangeLog | 26 +++++++++++++++++++++++ src/LyXView.C | 4 +--- src/frontends/gnome/ChangeLog | 9 ++++++++ src/insets/ChangeLog | 4 ++++ src/insets/insettext.C | 2 ++ src/lyxfunc.C | 39 +++++++++++++++++++++-------------- src/lyxfunc.h | 9 +++++++- 12 files changed, 82 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee33f1f804..83dce7f792 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,12 +7,6 @@ * configure.in: remove test for -lpt on SCO. Hopefully it is not needed anymore. This fixes bug #137 -2001-11-29 Ben Stanley - - * src/LaTeX.C - * src/LaTeX.h Fixed bug in LaTeX class where it would not - re-run latex if no depfiles were changed, but the .dvi was removed. - 2001-11-28 John Levon * README: fix ghostscript comment diff --git a/lib/ChangeLog b/lib/ChangeLog index db7fabbba1..479430bebd 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2002-01-12 Jean-Marc Lasgouttes + + * configure.m4: try to fix problem with groff detection + 2002-01-10 Angus Leeming * lyxrc.example: change the names of some variables in line with lyxrc.C diff --git a/lib/configure b/lib/configure index 8b1c146ed8..bc348bd6d2 100755 --- a/lib/configure +++ b/lib/configure @@ -729,7 +729,7 @@ if test -n "$ac_word"; then if test -n "$prog"; then ac_result=yes - test $prog = "nroff" && prog='tbl $$FName | nroff' + test "$prog" = "nroff" && prog='tbl $$FName | nroff' else ac_result=no fi diff --git a/lib/configure.m4 b/lib/configure.m4 index ec4b104d75..a68db82805 100644 --- a/lib/configure.m4 +++ b/lib/configure.m4 @@ -269,7 +269,7 @@ test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i" # Search a *roff program (used to translate tables in ASCII export) LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl 'groff -t -Tlatin1 $$FName' nroff,dnl - test $prog = "nroff" && prog='tbl $$FName | nroff') + test "$prog" = "nroff" && prog='tbl $$FName | nroff') # Search the ChkTeX program LYXRC_PROG([for ChkTeX], \chktex_command,dnl diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 220390374e..ca62780d4a 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -782,6 +782,8 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y, setState(); owner_->showState(); + owner_->updateMenubar(); + owner_->updateToolbar(); // Did we hit an editable inset? if (inset_hit) { @@ -834,29 +836,6 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y, return; } -#ifdef WITH_WARNINGS -#warning variable c is set but never used. What is it good for?? (JMarc) -#warning isnt this code dead ?? "open a float" ??? (jbl) -#endif - // check whether we want to open a float - if (bv_->text) { - bool hit = false; - char c = ' '; - if (bv_->text->cursor.pos() < - bv_->text->cursor.par()->size()) { - c = bv_->text->cursor.par()-> - getChar(bv_->text->cursor.pos()); - } - if (bv_->text->cursor.pos() - 1 >= 0) { - c = bv_->text->cursor.par()-> - getChar(bv_->text->cursor.pos() - 1); - } - if (hit == true) { - selection_possible = false; - return; - } - } - // Maybe we want to edit a bibitem ale970302 if (bv_->text->cursor.par()->bibkey && x < 20 + bibitemMaxWidth(bv_, textclasslist. diff --git a/src/ChangeLog b/src/ChangeLog index 0e26bc0036..0b35b334fe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2002-01-13 Jean-Marc Lasgouttes + + * BufferView_pimpl.C (workAreaButtonRelease): remove dead code (to + open a float) + + * lyxfunc.C (setStatusMessage): + (getStatusMessage): new methods + (getStatus):use setStatusMessage instead of setErrorMessage + (dispatch): when function is disabled, set error message here + [instead of in getStatus previously] + + * BufferView_pimpl.C (workAreaButtonRelease): update + toolbar/menubar here too. + 2002-01-13 Allan Rae * BufferView2.C (removeAutoInsets): finished off earlier fix. @@ -40,6 +54,12 @@ 2002-01-12 Jean-Marc Lasgouttes + * lyxfunc.C (dispatch): update toolbar/menubar after dispatching. + + * LyXView.C (updateMenubar): call MenuBar::update here + (updateToolbar): but not here + (showState): do not update toolbar/menubar + * LyXAction.[Ch]: move isPseudoAction to the C file, since nobody should need to care about that. @@ -745,6 +765,12 @@ (simpleDocBookOnePar): changed a PAR::META_INSET to isInset(). Fixed a double write of labels. +2001-11-29 Ben Stanley + + * LaTeX.C: + * LaTeX.h Fixed bug in LaTeX class where it would not + re-run latex if no depfiles were changed, but the .dvi was removed. + 2001-11-28 André Pönitz * all the files from the change on 2001/11/26: diff --git a/src/LyXView.C b/src/LyXView.C index 5362a6e48e..5b913c99ac 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -111,7 +111,6 @@ void LyXView::setLayout(layout_type layout) void LyXView::updateToolbar() { toolbar->update(); - menubar->update(); } @@ -158,6 +157,7 @@ void LyXView::updateMenubar() menubar->set("main_nobuffer"); else menubar->set("main"); + menubar->update(); } @@ -246,6 +246,4 @@ void LyXView::updateWindowTitle() void LyXView::showState() { message(currentState(view())); - getToolbar()->update(); - menubar->update(); } diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index ef4c9ca862..e04b9a8599 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,12 @@ +2002-01-12 Michael A. Koziarski + + * Menubar_pimpl.C + * Menubar_pimpl.h + * mainapp.h + * mainapp.C: Removed, We should behave similarly to the qt2 + frontend, so I've removed the LyXGnomified and menubar code. The + menubar wasn't working properly anyway. + 2002-01-08 Martin Vermeer * Menubar_pimpl.C (composeUIInfo): diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 7fa91dc48c..56493b7b4d 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-01-13 Jean-Marc Lasgouttes + + * insettext.C (updateLocal): update menubar and toolbar here too. + 2002-01-13 Allan Rae * insettabular.C (InsetTabular): Both constructors now initialise diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 2b44ae2cc5..61a0147063 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -621,6 +621,8 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty) const if (need_update == CURSOR) need_update = NONE; bv->owner()->showState(); + bv->owner()->updateMenubar(); + bv->owner()->updateToolbar(); if (old_par != cpar(bv)) { bv->owner()->setLayout(cpar(bv)->getLayout()); old_par = cpar(bv); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index c76ebbdd9c..ec2eb4513b 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -354,7 +354,7 @@ FuncStatus LyXFunc::getStatus(kb_action action, Buffer * buf = owner->buffer(); if (action == LFUN_UNKNOWN_ACTION) { - setErrorMessage(N_("Unknown action")); + setStatusMessage(N_("Unknown action")); return flag.unknown(true); } @@ -368,12 +368,12 @@ FuncStatus LyXFunc::getStatus(kb_action action, !lyxaction.funcHasFlag(action, LyXAction::ReadOnly)) { // no - setErrorMessage(N_("Document is read-only")); + setStatusMessage(N_("Document is read-only")); flag.disabled(true); } } else { // no - setErrorMessage(N_("Command not allowed with" + setStatusMessage(N_("Command not allowed with" "out any document open")); return flag.disabled(true); } @@ -869,6 +869,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) << lyxaction.getActionName(action) << " [" << action << "] is disabled at this location" << endl; + setErrorMessage(getStatusMessage()); goto exit_with_message; } @@ -884,36 +885,36 @@ string const LyXFunc::dispatch(kb_action action, string argument) // Undo/Redo is a bit tricky for insets. if (action == LFUN_UNDO) { owner->view()->menuUndo(); - return string(); + goto exit_with_message; } else if (action == LFUN_REDO) { owner->view()->menuRedo(); - return string(); + goto exit_with_message; } else if (((result=owner->view()->theLockingInset()-> localDispatch(owner->view(), action, argument)) == UpdatableInset::DISPATCHED) || (result == UpdatableInset::DISPATCHED_NOUPDATE)) - return string(); + goto exit_with_message; else if (result == UpdatableInset::FINISHED) { if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) { TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); owner->showState(); } - return string(); + goto exit_with_message; } else if (result == UpdatableInset::FINISHED_RIGHT) { if (!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) { TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); owner->showState(); } - return string(); + goto exit_with_message; } else if (result == UpdatableInset::FINISHED_UP) { if (TEXT()->cursor.row()->previous()) { TEXT()->cursorUp(owner->view()); moveCursorUpdate(true, false); owner->showState(); } - return string(); + goto exit_with_message; } else if (result == UpdatableInset::FINISHED_DOWN) { if (TEXT()->cursor.row()->next()) TEXT()->cursorDown(owner->view()); @@ -921,7 +922,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); owner->showState(); - return string(); + goto exit_with_message; } else { //setMessage(N_("Text mode")); switch (action) { @@ -938,14 +939,14 @@ string const LyXFunc::dispatch(kb_action action, string argument) moveCursorUpdate(true, false); owner->showState(); } - return string(); + goto exit_with_message; case LFUN_LEFT: if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) { TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); owner->showState(); } - return string(); + goto exit_with_message; case LFUN_DOWN: if (TEXT()->cursor.row()->next()) TEXT()->cursorDown(owner->view()); @@ -953,7 +954,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); owner->showState(); - return string(); + goto exit_with_message; default: break; } @@ -1632,7 +1633,9 @@ exit_with_message: if (!res.empty()) owner->message(_(res)); - + owner->updateMenubar(); + owner->updateToolbar(); + return res; } @@ -1965,12 +1968,18 @@ void LyXFunc::setErrorMessage(string const & m) const } -void LyXFunc::setMessage(string const & m) +void LyXFunc::setMessage(string const & m) const { dispatch_buffer = m; } +void LyXFunc::setStatusMessage(string const & m) const +{ + status_buffer = m; +} + + void LyXFunc::initMiniBuffer() { string text = _("Welcome to LyX!"); diff --git a/src/lyxfunc.h b/src/lyxfunc.h index c74eecf984..9259846615 100644 --- a/src/lyxfunc.h +++ b/src/lyxfunc.h @@ -67,11 +67,15 @@ public: /// True if lyxfunc reports an error bool errorStat() const { return errorstat; } /// Buffer to store result messages - void setMessage(string const & m); + void setMessage(string const & m) const; /// Buffer to store result messages void setErrorMessage(string const &) const; + /// Buffer to store result messages from getStatus + void setStatusMessage(string const &) const; /// Buffer to store result messages string const getMessage() const { return dispatch_buffer; } + /// Buffer to store result messages + string const getStatusMessage() const { return status_buffer; } /// Handle a accented char keysequenze void handleKeyFunc(kb_action action); @@ -101,6 +105,9 @@ private: good reason to have this one as static in Dispatch? (Ale) */ mutable string dispatch_buffer; + /** Buffer to store messages and result data from getStatus + */ + mutable string status_buffer; /// Command name and shortcut information string commandshortcut; -- 2.39.2