mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 06:15:16 +00:00
Make showState be view_state_changed, and rename setState to something
more descriptive git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4671 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
264b62f42f
commit
91bcdf564a
@ -163,9 +163,9 @@ void BufferView::update(LyXText * text, UpdateCodes f)
|
||||
}
|
||||
|
||||
|
||||
void BufferView::setState()
|
||||
void BufferView::switchKeyMap()
|
||||
{
|
||||
pimpl_->setState();
|
||||
pimpl_->switchKeyMap();
|
||||
}
|
||||
|
||||
|
||||
|
@ -185,7 +185,7 @@ public:
|
||||
void scrollDocView(int);
|
||||
|
||||
///
|
||||
void setState();
|
||||
void switchKeyMap();
|
||||
|
||||
///
|
||||
bool ChangeInsets(Inset::Code code, string const & from,
|
||||
|
@ -344,7 +344,7 @@ void BufferView::menuUndo()
|
||||
owner()->message(_("No further undo information"));
|
||||
else
|
||||
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
setState();
|
||||
switchKeyMap();
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ void BufferView::menuRedo()
|
||||
owner()->message(_("No further redo information"));
|
||||
else
|
||||
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
setState();
|
||||
switchKeyMap();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ int BufferView::Pimpl::resizeCurrentBuffer()
|
||||
|
||||
bv_->text->first_y = screen().topCursorVisible(bv_->text->cursor, bv_->text->first_y);
|
||||
|
||||
setState();
|
||||
switchKeyMap();
|
||||
owner_->allowInput();
|
||||
|
||||
/// clear the "Formatting Document" message
|
||||
@ -734,8 +734,8 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
|
||||
workarea().haveSelection(bv_->getLyXText()->selection.set());
|
||||
}
|
||||
|
||||
setState();
|
||||
owner_->showState();
|
||||
switchKeyMap();
|
||||
owner_->view_state_changed();
|
||||
owner_->updateMenubar();
|
||||
owner_->updateToolbar();
|
||||
|
||||
@ -1236,7 +1236,7 @@ bool BufferView::Pimpl::isSavedPosition(unsigned int i)
|
||||
}
|
||||
|
||||
|
||||
void BufferView::Pimpl::setState()
|
||||
void BufferView::Pimpl::switchKeyMap()
|
||||
{
|
||||
if (!lyxrc.rtl_support)
|
||||
return;
|
||||
@ -1384,10 +1384,7 @@ void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
|
||||
if (!lt->selection.set())
|
||||
workarea().haveSelection(false);
|
||||
|
||||
/* ---> Everytime the cursor is moved, show the current font state. */
|
||||
// should this too me moved out of this func?
|
||||
//owner->showState();
|
||||
setState();
|
||||
switchKeyMap();
|
||||
}
|
||||
|
||||
|
||||
@ -1520,7 +1517,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
|
||||
case LFUN_PASTE:
|
||||
bv_->paste();
|
||||
setState();
|
||||
switchKeyMap();
|
||||
break;
|
||||
|
||||
case LFUN_PASTESELECTION:
|
||||
@ -1546,7 +1543,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
|
||||
case LFUN_LAYOUT_PASTE:
|
||||
bv_->pasteEnvironment();
|
||||
setState();
|
||||
switchKeyMap();
|
||||
break;
|
||||
|
||||
case LFUN_GOTOERROR:
|
||||
@ -1675,60 +1672,60 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
BufferView::SELECT
|
||||
| BufferView::FITCUR
|
||||
| BufferView::CHANGE);
|
||||
setState();
|
||||
switchKeyMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LFUN_LANGUAGE:
|
||||
lang(bv_, argument);
|
||||
setState();
|
||||
owner_->showState();
|
||||
switchKeyMap();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_EMPH:
|
||||
emph(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_BOLD:
|
||||
bold(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_NOUN:
|
||||
noun(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_CODE:
|
||||
code(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_SANS:
|
||||
sans(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_ROMAN:
|
||||
roman(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_DEFAULT:
|
||||
styleReset(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_UNDERLINE:
|
||||
underline(bv_);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_FONT_SIZE:
|
||||
fontSize(bv_, argument);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
case LFUN_FONT_STATE:
|
||||
@ -1874,7 +1871,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorRight(bv_, false);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1907,7 +1904,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1921,7 +1918,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorUp(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1935,7 +1932,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorDown(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1949,7 +1946,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorUpParagraph(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1963,7 +1960,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorDownParagraph(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1977,7 +1974,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
cursorPrevious(lt);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false, false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1991,7 +1988,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
cursorNext(lt);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false, false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2005,7 +2002,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorHome(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2020,7 +2017,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorEnd(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2036,7 +2033,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorTab(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2053,7 +2050,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorRightOneWord(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2070,7 +2067,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorLeftOneWord(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2085,7 +2082,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorTop(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2100,7 +2097,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorBottom(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2117,7 +2114,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorRight(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2133,7 +2130,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorLeft(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2146,7 +2143,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorUp(bv_, true);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2159,7 +2156,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorDown(bv_, true);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2172,7 +2169,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorUpParagraph(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2185,7 +2182,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorDownParagraph(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2197,7 +2194,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
cursorPrevious(lt);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2209,7 +2206,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
cursorNext(lt);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2221,7 +2218,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorHome(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2233,7 +2230,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorEnd(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2248,7 +2245,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorRightOneWord(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2263,7 +2260,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorLeftOneWord(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2277,7 +2274,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorTop(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2292,7 +2289,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
lt->cursorBottom(bv_);
|
||||
finishUndo();
|
||||
moveCursorUpdate(true);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2370,8 +2367,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
bv_->cut(false);
|
||||
}
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
setState();
|
||||
owner_->view_state_changed();
|
||||
switchKeyMap();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2435,7 +2432,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
bv_->getLyXText()->deleteWordForward(bv_);
|
||||
update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
|
||||
/* -------> Delete word backward. */
|
||||
@ -2450,7 +2447,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
| BufferView::FITCUR
|
||||
| BufferView::CHANGE);
|
||||
moveCursorUpdate(false);
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2513,8 +2510,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
} else {
|
||||
bv_->cut(false);
|
||||
}
|
||||
owner_->showState();
|
||||
setState();
|
||||
owner_->view_state_changed();
|
||||
switchKeyMap();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2567,8 +2564,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
| BufferView::FITCUR
|
||||
| BufferView::CHANGE);
|
||||
lt->selection.cursor = lt->cursor;
|
||||
setState();
|
||||
owner_->showState();
|
||||
switchKeyMap();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2583,8 +2580,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
| BufferView::FITCUR
|
||||
| BufferView::CHANGE);
|
||||
lt->selection.cursor = lt->cursor;
|
||||
setState();
|
||||
owner_->showState();
|
||||
switchKeyMap();
|
||||
owner_->view_state_changed();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2623,8 +2620,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
| BufferView::FITCUR
|
||||
| BufferView::CHANGE);
|
||||
lt->selection.cursor = cursor;
|
||||
setState();
|
||||
owner_->showState();
|
||||
switchKeyMap();
|
||||
owner_->view_state_changed();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2686,7 +2683,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
update(lt, BufferView::SELECT|BufferView::FITCUR);
|
||||
lt->toggleInset(bv_);
|
||||
update(lt, BufferView::SELECT|BufferView::FITCUR);
|
||||
setState();
|
||||
switchKeyMap();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3125,7 +3122,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
||||
// real_current_font.number can change so we need to
|
||||
// update the minibuffer
|
||||
if (old_font != lt->real_current_font)
|
||||
owner_->showState();
|
||||
owner_->view_state_changed();
|
||||
//return string();
|
||||
}
|
||||
break;
|
||||
|
@ -107,7 +107,7 @@ struct BufferView::Pimpl : public boost::signals::trackable {
|
||||
///
|
||||
bool isSavedPosition(unsigned int i);
|
||||
///
|
||||
void setState();
|
||||
void switchKeyMap();
|
||||
///
|
||||
void insetUnlock();
|
||||
///
|
||||
|
@ -1,3 +1,12 @@
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* BufferView.h:
|
||||
* BufferView.C:
|
||||
* BufferView2.C:
|
||||
* BufferView_pimpl.h:
|
||||
* BufferView_pimpl.C:
|
||||
* lyxfunc.C: s/setState/switchKeyMap/, s/showState/view_state_changed/
|
||||
|
||||
2002-07-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* MenuBackend.C (expand): add numeric shortcuts to document menu
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* LyXView.h:
|
||||
* LyXView.C: change showState to view_state_changed signal
|
||||
|
||||
2002-07-14 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* lyx_gui.h: add set_read_callback()
|
||||
|
@ -227,9 +227,3 @@ void LyXView::updateWindowTitle()
|
||||
last_title = title;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LyXView::showState()
|
||||
{
|
||||
message(currentState(view()));
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/signals/trackable.hpp>
|
||||
#include <boost/signals/signal0.hpp>
|
||||
|
||||
class Buffer;
|
||||
class Toolbar;
|
||||
@ -107,14 +108,15 @@ public:
|
||||
/// update the menubar
|
||||
void updateMenubar();
|
||||
|
||||
/// view state string changed
|
||||
boost::signal0<void> view_state_changed;
|
||||
|
||||
/// display a message in the view
|
||||
void message(string const &);
|
||||
/// push a message onto the history, and show it
|
||||
void messagePush(string const & str);
|
||||
/// pop the last message pushed
|
||||
void messagePop();
|
||||
/// show state (font etc.) in minibuffer
|
||||
void showState();
|
||||
|
||||
/// updates the title of the window
|
||||
void updateWindowTitle();
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* ControlCharacter.C: use view_state_changed not setState
|
||||
|
||||
2002-07-15 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* biblio.C (parseBibTeX): use ascii_lowercase instead of lowercase
|
||||
|
@ -63,7 +63,7 @@ void ControlCharacter::apply()
|
||||
view().apply();
|
||||
|
||||
toggleAndShow(lv_.view(), *(font_.get()), toggleall_);
|
||||
lv_.view()->setState();
|
||||
lv_.view_state_changed();
|
||||
lv_.buffer()->markDirty();
|
||||
setMinibuffer(&lv_, _("Character set"));
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* QtView.C: basic statusbar show
|
||||
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* QLImage.C: add using std
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "LString.h"
|
||||
|
||||
#include "MiniBuffer.h"
|
||||
#include "frontends/MiniBuffer.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "QMiniBuffer.h"
|
||||
#include "ToolbarDefaults.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "bufferview_funcs.h"
|
||||
#include "BufferView.h"
|
||||
|
||||
#include "frontends/Toolbar.h"
|
||||
@ -36,6 +37,8 @@
|
||||
#include <qmenubar.h>
|
||||
#include <qstatusbar.h>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
using std::endl;
|
||||
|
||||
// FIXME: this has to go away
|
||||
@ -65,6 +68,8 @@ QtView::QtView(unsigned int width, unsigned int height)
|
||||
bufferview_.reset(new BufferView(this, 0, 0, width, height));
|
||||
::current_view = bufferview_.get();
|
||||
|
||||
view_state_changed.connect(boost::bind(&QtView::update_view_state, this));
|
||||
|
||||
// FIXME: move
|
||||
// FIXME autosave_timeout_->timeout.connect(SigC::slot(this, &QtView::autoSave));
|
||||
|
||||
@ -84,6 +89,12 @@ QtView::~QtView()
|
||||
}
|
||||
|
||||
|
||||
void QtView::update_view_state()
|
||||
{
|
||||
statusBar()->message(currentState(view()).c_str());
|
||||
}
|
||||
|
||||
|
||||
void QtView::activated(int id)
|
||||
{
|
||||
getLyXFunc()->verboseDispatch(id, true);
|
||||
|
@ -56,6 +56,9 @@ protected:
|
||||
virtual void closeEvent(QCloseEvent * e);
|
||||
|
||||
private:
|
||||
/// update status bar
|
||||
void update_view_state();
|
||||
|
||||
/**
|
||||
* setWindowTitle - set title of window
|
||||
* @param t main window title
|
||||
|
@ -111,6 +111,7 @@ void lyx_gui::start(string const & batch, vector<string> files)
|
||||
view.getLyXFunc()->verboseDispatch(batch, false);
|
||||
}
|
||||
|
||||
// FIXME: something somewhere is EATING CPU
|
||||
while (!finished) {
|
||||
qApp->processEvents();
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* XFormsView.h:
|
||||
* XFormsView.C: hook up view_state_changed
|
||||
|
||||
2002-07-16 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* XPainter.C: add some #ifdef ugliness to enable the home grown image
|
||||
|
@ -66,6 +66,8 @@ XFormsView::XFormsView(int width, int height)
|
||||
minibuffer_->inputReady.connect(boost::bind(&LyXFunc::miniDispatch, getLyXFunc(), _1));
|
||||
minibuffer_->timeout.connect(boost::bind(&LyXFunc::initMiniBuffer, getLyXFunc()));
|
||||
|
||||
view_state_changed.connect(boost::bind(&XFormsView::update_view_state, this));
|
||||
|
||||
// Make sure the buttons are disabled if needed.
|
||||
updateToolbar();
|
||||
getDialogs()->redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
|
||||
@ -198,6 +200,12 @@ void XFormsView::setWindowTitle(string const & title, string const & icon_title)
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::update_view_state()
|
||||
{
|
||||
minibuffer_->message(currentState(view()));
|
||||
}
|
||||
|
||||
|
||||
// How should this actually work? Should it prohibit input in all BufferViews,
|
||||
// or just in the current one? If "just the current one", then it should be
|
||||
// placed in BufferView. If "all BufferViews" then LyXGUI (I think) should
|
||||
|
@ -62,6 +62,9 @@ private:
|
||||
*/
|
||||
virtual void setWindowTitle(string const & t, string const & it);
|
||||
|
||||
/// update the minibuffer state message
|
||||
void update_view_state();
|
||||
|
||||
/// makes the main form.
|
||||
void create_form_form_main(Dialogs & d, int width, int height);
|
||||
/// the main form.
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-07-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* insettext.C: use view_state_changed, switchKeyMap
|
||||
|
||||
2002-07-17 Herbert Voss <voss@perce.de>
|
||||
|
||||
* insetgraphics.C (prepareFile): keep the extension when
|
||||
|
@ -658,7 +658,7 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty) const
|
||||
|
||||
if (need_update == CURSOR)
|
||||
need_update = NONE;
|
||||
bv->owner()->showState();
|
||||
bv->owner()->view_state_changed();
|
||||
bv->owner()->updateMenubar();
|
||||
bv->owner()->updateToolbar();
|
||||
if (old_par != cpar(bv)) {
|
||||
@ -1261,7 +1261,7 @@ InsetText::localDispatch(BufferView * bv,
|
||||
|
||||
setUndo(bv, Undo::INSERT,
|
||||
lt->cursor.par(), lt->cursor.par()->next());
|
||||
bv->setState();
|
||||
bv->switchKeyMap();
|
||||
if (lyxrc.auto_region_delete) {
|
||||
if (lt->selection.set()) {
|
||||
lt->cutSelection(bv, false);
|
||||
|
@ -145,11 +145,6 @@ LyXText * LyXFunc::TEXT(bool flag = true) const
|
||||
}
|
||||
|
||||
|
||||
// I changed this func slightly. I commented out the ...FinishUndo(),
|
||||
// this means that all places that used to have a moveCursorUpdate, now
|
||||
// have a ...FinishUndo() as the preceeding statement. I have also added
|
||||
// a moveCursorUpdate to some of the functions that updated the cursor, but
|
||||
// that did not show its new position.
|
||||
inline
|
||||
void LyXFunc::moveCursorUpdate(bool flag, bool selecting)
|
||||
{
|
||||
@ -161,9 +156,7 @@ void LyXFunc::moveCursorUpdate(bool flag, bool selecting)
|
||||
owner->view()->update(TEXT(flag), BufferView::SELECT|BufferView::FITCUR);
|
||||
owner->view()->showCursor();
|
||||
|
||||
/* ---> Everytime the cursor is moved, show the current font state. */
|
||||
// should this too me moved out of this func?
|
||||
owner->view()->setState();
|
||||
owner->view()->switchKeyMap();
|
||||
}
|
||||
|
||||
|
||||
@ -852,7 +845,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
} else if (result == UpdatableInset::FINISHED_RIGHT) {
|
||||
TEXT()->cursorRight(owner->view());
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
goto exit_with_message;
|
||||
} else if (result == UpdatableInset::FINISHED_UP) {
|
||||
if (TEXT()->cursor.irow()->previous()) {
|
||||
@ -866,7 +859,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
TEXT()->cursorUp(owner->view());
|
||||
#endif
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
} else {
|
||||
owner->view()->update(TEXT(), BufferView::SELECT|BufferView::FITCUR);
|
||||
}
|
||||
@ -887,7 +880,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
TEXT()->cursorRight(owner->view());
|
||||
}
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
goto exit_with_message;
|
||||
}
|
||||
#warning I am not sure this is still right, please have a look! (Jug 20020417)
|
||||
@ -898,21 +891,21 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
case LFUN_BREAKPARAGRAPH:
|
||||
case LFUN_BREAKLINE:
|
||||
TEXT()->cursorRight(owner->view());
|
||||
owner->view()->setState();
|
||||
owner->showState();
|
||||
owner->view()->switchKeyMap();
|
||||
owner->view_state_changed();
|
||||
break;
|
||||
case LFUN_RIGHT:
|
||||
if (!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
|
||||
TEXT()->cursorRight(owner->view());
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
}
|
||||
goto exit_with_message;
|
||||
case LFUN_LEFT:
|
||||
if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
|
||||
TEXT()->cursorRight(owner->view());
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
}
|
||||
goto exit_with_message;
|
||||
case LFUN_DOWN:
|
||||
@ -921,7 +914,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
else
|
||||
TEXT()->cursorRight(owner->view());
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
goto exit_with_message;
|
||||
default:
|
||||
break;
|
||||
@ -945,7 +938,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
owner->view()->unlockInset(tli);
|
||||
TEXT()->cursorRight(owner->view());
|
||||
moveCursorUpdate(true, false);
|
||||
owner->showState();
|
||||
owner->view_state_changed();
|
||||
} else {
|
||||
tli->unlockInsetInInset(owner->view(),
|
||||
lock,
|
||||
@ -1385,8 +1378,8 @@ string const LyXFunc::dispatch(kb_action action, string argument)
|
||||
}
|
||||
// Set the cursor
|
||||
owner->view()->getLyXText()->setCursor(owner->view(), par, 0);
|
||||
owner->view()->setState();
|
||||
owner->showState();
|
||||
owner->view()->switchKeyMap();
|
||||
owner->view_state_changed();
|
||||
|
||||
owner->view()->center();
|
||||
// see BufferView_pimpl::center()
|
||||
|
Loading…
Reference in New Issue
Block a user