call message more directly

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1951 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-04-24 17:33:01 +00:00
parent 6b95441288
commit ec57ed1e96
36 changed files with 115 additions and 160 deletions

View File

@ -33,7 +33,6 @@
#include "support/lyxfunctional.h" //equal_1st_in_pair
#include "language.h"
#include "gettext.h"
#include "lyxfunc.h"
extern BufferList bufferlist;
@ -425,8 +424,7 @@ void BufferView::insertNote()
void BufferView::openStuff()
{
if (available()) {
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Open/Close..."));
owner()->message(_("Open/Close..."));
hideCursor();
beforeChange(text);
update(text, BufferView::SELECT|BufferView::FITCUR);
@ -440,8 +438,7 @@ void BufferView::openStuff()
void BufferView::toggleFloat()
{
if (available()) {
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Open/Close..."));
owner()->message(_("Open/Close..."));
hideCursor();
beforeChange(text);
update(text, BufferView::SELECT|BufferView::FITCUR);
@ -455,13 +452,12 @@ void BufferView::toggleFloat()
void BufferView::menuUndo()
{
if (available()) {
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Undo"));
owner()->message(_("Undo"));
hideCursor();
beforeChange(text);
update(text, BufferView::SELECT|BufferView::FITCUR);
if (!text->TextUndo(this))
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("No forther undo information"));
owner()->message(_("No forther undo information"));
else
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
setState();
@ -472,20 +468,17 @@ void BufferView::menuUndo()
void BufferView::menuRedo()
{
if (theLockingInset()) {
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Redo not yet supported in math mode"));
owner()->message(_("Redo not yet supported in math mode"));
return;
}
if (available()) {
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Redo"));
owner()->message(_("Redo"));
hideCursor();
beforeChange(text);
update(text, BufferView::SELECT|BufferView::FITCUR);
if (!text->TextRedo(this))
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("No further redo information"));
owner()->message(_("No further redo information"));
else
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
setState();
@ -586,8 +579,7 @@ void BufferView::copyEnvironment()
toggleSelection();
text->ClearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Paragraph environment type copied"));
owner()->message(_("Paragraph environment type copied"));
}
}
@ -596,8 +588,7 @@ void BufferView::pasteEnvironment()
{
if (available()) {
text->pasteEnvironmentType(this);
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Paragraph environment type set"));
owner()->message(_("Paragraph environment type set"));
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
}
@ -611,7 +602,7 @@ void BufferView::copy()
toggleSelection();
text->ClearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Copy"));
owner()->message(_("Copy"));
}
}
@ -622,7 +613,7 @@ void BufferView::cut()
update(text, BufferView::SELECT|BufferView::FITCUR);
text->CutSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Cut"));
owner()->message(_("Cut"));
}
}
@ -631,7 +622,7 @@ void BufferView::paste()
{
if (!available()) return;
owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Paste"));
owner()->message(_("Paste"));
hideCursor();
// clear the selection
@ -677,14 +668,10 @@ void BufferView::gotoInset(std::vector<Inset::Code> const & codes,
text->cursor.pos(0);
if (!text->GotoNextInset(this, codes, contents)) {
text->cursor = tmp;
owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("No more insets"));
owner()->message(_("No more insets"));
}
} else {
owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("No more insets"));
owner()->message(_("No more insets"));
}
}
update(text, BufferView::SELECT|BufferView::FITCUR);

View File

@ -16,7 +16,6 @@
#include "lyxrow.h"
#include "LyXView.h"
#include "commandtags.h"
#include "lyxfunc.h"
#include "font.h"
#include "bufferview_funcs.h"
#include "TextCache.h"
@ -288,8 +287,7 @@ int BufferView::Pimpl::resizeCurrentBuffer()
ProhibitInput(bv_);
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Formatting document..."));
owner_->message(_("Formatting document..."));
if (bv_->text) {
par = bv_->text->cursor.par();
@ -634,8 +632,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
UpdatableInset * inset = static_cast<UpdatableInset *>(inset_hit);
selection_possible = false;
owner_->updateLayoutChoice();
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE,
inset->EditMessage());
owner_->message(inset->EditMessage());
inset->InsetButtonPress(bv_, xpos, ypos, button);
inset->Edit(bv_, xpos, ypos, button);
return;
@ -797,8 +794,7 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
bv_->text->SetCursorParUndo(bv_->buffer());
}
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE,
inset_hit->EditMessage());
owner_->message(inset_hit->EditMessage());
if (inset_hit->Editable()==Inset::HIGHLY_EDITABLE) {
// Highly editable inset, like math
@ -1213,7 +1209,7 @@ void BufferView::Pimpl::savePosition(unsigned int i)
bv_->text->cursor.pos());
if (i > 0) {
string const str = _("Saved bookmark") + ' ' + tostr(i);
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE, str);
owner_->message(str);
}
}
@ -1248,7 +1244,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
if (i > 0) {
string const str = _("Moved to bookmark") + ' ' + tostr(i);
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE, str);
owner_->message(str);
}
}
@ -1467,8 +1463,7 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
// check selected filename
if (filename.empty()) {
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Canceled."));
owner_->message(_("Canceled."));
return;
}
}
@ -1482,16 +1477,16 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
// Inserts document
string const s1 = _("Inserting document") + ' '
+ MakeDisplayPath(filename) + " ...";
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE, s1);
owner_->message(s1);
bool const res = bv_->insertLyXFile(filename);
if (res) {
string const str = _("Document") + ' '
+ MakeDisplayPath(filename) + ' ' + _("inserted.");
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE, str);
owner_->message(str);
} else {
string const str = _("Could not insert document") + ' '
+ MakeDisplayPath(filename);
owner_->getLyXFunc()->Dispatch(LFUN_MESSAGE, str);
owner_->message(str);
}
}

View File

@ -1,5 +1,21 @@
2001-04-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
* call message directly through LyXView instead of through LyXFunc
* BufferView2.C: adjust
* BufferView_pimpl.C: adjust
* FontLoader.C: adjust
* buffer.C: adjust
* bufferview_funcs.C: adjust
* converter.C: adjust
* figureForm.C: adjust
* importer.C: adjust
* lyx_cb.C: adjust
* lyx_gui_misc.C: adjust
* lyxfunc.C: adjust
* lyxvc.C: adjust
* text2.C: adjust
+ more files in subdirs
* lyxparagraph.h (size): move up int file
(GetLayout): ditto

View File

@ -23,7 +23,6 @@
#include "lyxrc.h" // lyxrc.font_*
#include "BufferView.h"
#include "LyXView.h"
#include "lyxfunc.h"
using std::endl;
@ -246,9 +245,7 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
XFontStruct * fs = 0;
current_view->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE_PUSH,
_("Loading font into X-Server..."));
current_view->owner()->messagePush(_("Loading font into X-Server..."));
fs = XLoadQueryFont(fl_get_display(), font.c_str());
@ -276,7 +273,7 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
<< "' matched by\n" << font << endl;
}
current_view->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE_POP);
current_view->owner()->messagePop();
fontstruct[family][series][shape][size] = fs;
return fs;

View File

@ -23,7 +23,6 @@
#include "lyxlookup.h"
#endif
#include "minibuffer.h"
#include "lyxfunc.h"
#include "debug.h"
#include "intl.h"
#include "lyxrc.h"
@ -39,6 +38,7 @@
#include "lyx_gui_misc.h" // [update,Close,Redraw]AllBufferRelatedDialogs
#include "bufferview_funcs.h" // CurrentState()
#include "gettext.h"
#include "lyxfunc.h"
using std::endl;

View File

@ -19,7 +19,6 @@
#include "debug.h"
#include "support/lstrings.h"
#include "LyXView.h"
#include "lyxfunc.h"
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
#include "lyxlookup.h"

View File

@ -3482,8 +3482,7 @@ int Buffer::runChktex()
}
Path p(path); // path to LaTeX file
users->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Running chktex..."));
users->owner()->message(_("Running chktex..."));
// Remove all error insets
bool const removedErrorInsets = users->removeAutoInsets();

View File

@ -26,7 +26,6 @@
#include "lyx_cb.h"
#include "language.h"
#include "gettext.h"
#include "lyxfunc.h"
#ifndef NEW_INSETS
void Foot(BufferView * bv)
@ -72,7 +71,7 @@ void Noun(BufferView * bv)
void Margin(BufferView * bv)
{
if (bv->available()) {
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Inserting margin note...");
bv->owner()->message(_("Inserting margin note...");
bv->hideCursor();
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
bv->text->InsertFootnoteEnvironment(bv, LyXParagraph::MARGIN);
@ -105,7 +104,7 @@ void Melt(BufferView * bv)
{
if (!bv->available()) return;
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Melt"));
bv->owner()->message(_("Melt"));
bv->hideCursor();
bv->beforeChange(bv->text);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
@ -140,10 +139,8 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
if (text->inset_owner)
bv->updateInset((Inset *)text->inset_owner, true);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
bv->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("Changed environment depth "
"(in possible range, maybe not)"));
bv->owner()->message(_("Changed environment depth "
"(in possible range, maybe not)"));
}

View File

@ -28,7 +28,6 @@
#include "lyx_gui_misc.h"
#include "lyx_cb.h" // ShowMessage()
#include "support/lyxfunctional.h"
#include "lyxfunc.h"
#include "gettext.h"
using std::vector;
@ -818,8 +817,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
if (bv) {
ProhibitInput(bv);
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Running LaTeX..."));
bv->owner()->message(_("Running LaTeX..."));
// Remove all error insets
need_redraw = bv->removeAutoInsets();
}

View File

@ -22,7 +22,6 @@
#include "BufferView.h"
#include "lyxtext.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "gettext.h"
extern FD_form_figure * fd_form_figure;
@ -51,15 +50,11 @@ void FigureApplyCB(FL_OBJECT *, long)
if (buffer->isReadonly()) // paranoia
return;
current_view->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("Inserting figure..."));
current_view->owner()->message(_("Inserting figure..."));
if (fl_get_button(fd_form_figure->radio_inline)) {
InsetFig * new_inset = new InsetFig(100, 20, *buffer);
current_view->insertInset(new_inset);
current_view->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("Figure inserted"));
current_view->owner()->message(_("Figure inserted"));
new_inset->Edit(current_view, 0, 0, 0);
return;
}
@ -119,8 +114,7 @@ void FigureApplyCB(FL_OBJECT *, long)
current_view->insertInset(new_inset);
new_inset->Edit(current_view, 0, 0, 0);
current_view->update(current_view->text, BufferView::SELECT|BufferView::FITCUR);
current_view->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Figure inserted"));
current_view->owner()->message(_("Figure inserted"));
current_view->text->UnFreezeUndo();
current_view->setState();
}

View File

@ -27,7 +27,6 @@
#include "exporter.h"
#include "converter.h"
#include "support/syscall.h"
#include "lyxfunc.h"
using std::endl;

View File

@ -20,8 +20,8 @@
#include "ControlCommand.h"
#include "buffer.h"
#include "Dialogs.h"
#include "lyxfunc.h"
#include "LyXView.h"
#include "lyxfunc.h"
ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
: ControlInset<InsetCommand, InsetCommandParams>(lv, d),
@ -36,17 +36,20 @@ InsetCommandParams const ControlCommand::getParams(string const & arg)
return params;
}
InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
{
return inset.params();
}
void ControlCommand::applyParamsToInset()
{
inset()->setParams(params());
lv_.view()->updateInset(inset(), true);
}
void ControlCommand::applyParamsNoInset()
{
if (action_ == LFUN_NOACTION) return;

View File

@ -20,7 +20,6 @@
#include "ControlGraphics.h"
#include "buffer.h"
#include "Dialogs.h"
#include "lyxfunc.h"
#include "LyXView.h"
#include "gettext.h"

View File

@ -18,7 +18,6 @@
#include "ControlInclude.h"
#include "buffer.h"
#include "Dialogs.h"
#include "lyxfunc.h"
#include "LyXView.h"
#include "gettext.h"

View File

@ -22,8 +22,6 @@
#include "LyXView.h"
#include "buffer.h"
#include "lyxfunc.h"
using SigC::slot;
ControlUrl::ControlUrl(LyXView & lv, Dialogs & d)

View File

@ -19,10 +19,10 @@
#include "form_maths_delim.h"
#include "Dialogs.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "bmtable.h"
#include "debug.h"
#include "mathed/symbol_def.h"
#include "lyxfunc.h"
#include "delim.xbm"
#include "delim0.xpm"
@ -80,8 +80,8 @@ void FormMathsDelim::build()
void FormMathsDelim::apply()
{
int left = int(dialog_->radio_left->u_ldata);
int right= int(dialog_->radio_right->u_ldata);
int const left = int(dialog_->radio_left->u_ldata);
int const right= int(dialog_->radio_right->u_ldata);
std::ostringstream ost;
ost << delim_values[left] << ' ' << delim_values[right];

View File

@ -19,8 +19,8 @@
#include "form_maths_matrix.h"
#include "Dialogs.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "Lsstream.h"
#include "lyxfunc.h"
static char h_align_str[80] = "c";
static char v_align_c[] = "tcb";

View File

@ -17,11 +17,11 @@
#include "Dialogs.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "FormMathsPanel.h"
#include "form_maths_panel.h"
#include "MathsSymbols.h"
#include "debug.h"
#include "lyxfunc.h"
#include "form_maths_deco.h"
#include "form_maths_delim.h"

View File

@ -31,8 +31,8 @@
#include "form_preferences.h"
#include "input_validators.h"
#include "LyXView.h"
#include "language.h"
#include "lyxfunc.h"
#include "language.h"
#include "Dialogs.h"
#include "lyxrc.h"
#include "combox.h"

View File

@ -31,7 +31,6 @@
#include "LyXView.h"
#include "buffer.h"
#include "form_ref.h"
#include "lyxfunc.h"
*/
using std::find;

View File

@ -19,11 +19,11 @@
#include "support/LAssert.h"
#include "debug.h"
#include "LyXAction.h"
#include "lyxfunc.h"
#include "kbmap.h"
#include "buffer.h"
#include "Dialogs.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "MenuBackend.h"
#include "Menubar_pimpl.h"
#include "gettext.h"

View File

@ -20,9 +20,9 @@
#endif
#include "Toolbar_pimpl.h"
#include "lyxfunc.h"
#include "debug.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "BufferView.h"
#include "buffer.h"
#include "LyXAction.h"

View File

@ -20,6 +20,7 @@
#include "converter.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "bufferlist.h"
#include "support/filetools.h"
#include "lyx_gui_misc.h" //WriteAlert
@ -37,7 +38,7 @@ bool Importer::Import(LyXView * lv, string const & filename,
{
string const displaypath = MakeDisplayPath(filename);
string const s1 = _("Importing") + ' ' + displaypath + "...";
lv->getLyXFunc()->Dispatch(LFUN_MESSAGE, s1);
lv->message(s1);
string const lyxfile = ChangeExtension(filename, ".lyx");
@ -79,7 +80,7 @@ bool Importer::Import(LyXView * lv, string const & filename,
}
// we are done
lv->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("imported."));
lv->message(_("imported."));
return true;
}

View File

@ -20,7 +20,6 @@
#include "gettext.h"
#include "support/FileInfo.h"
#include "layout.h"
#include "lyxfunc.h"
using std::ostream;
using std::endl;

View File

@ -21,10 +21,10 @@
#include "support/filetools.h"
#include "BufferView.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "commandtags.h"
#include "buffer.h"
#include "gettext.h"
#include "lyxfunc.h"
using std::ostream;

View File

@ -10,9 +10,9 @@
#include "debug.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
#include "lyxfunc.h"
#include "LyXView.h"
#include "frontends/Dialogs.h"
#include "lyxfunc.h"
using std::ostream;

View File

@ -30,11 +30,9 @@
#include "lyxtext.h"
#include "lyx_gui_misc.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "insets/insettext.h"
#include "frontends/Dialogs.h"
#include "debug.h"
#include "lyxfunc.h"
#include "WorkArea.h"
#include "gettext.h"
#include "language.h"

View File

@ -46,7 +46,6 @@
#include "trans_mgr.h"
#include "lyxscreen.h"
#include "WorkArea.h"
#include "lyxfunc.h"
#include "gettext.h"
using std::ostream;
@ -1099,8 +1098,8 @@ InsetText::LocalDispatch(BufferView * bv,
// and current buffer's textclass (number). */
LyXTextClassList::ClassList::size_type tclass =
bv->buffer()->params.textclass;
std::pair <bool, LyXTextClass::size_type> layout =
textclasslist.NumberOfLayout(tclass, arg);
std::pair<bool, LyXTextClass::size_type> layout =
textclasslist.NumberOfLayout(tclass, arg);
// If the entry is obsolete, use the new one instead.
if (layout.first) {
@ -1113,8 +1112,7 @@ InsetText::LocalDispatch(BufferView * bv,
// see if we found the layout number:
if (!layout.first) {
string const msg = string(N_("Layout ")) + arg + N_(" not known");
bv->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE, msg);
bv->owner()->message(msg);
break;
}

View File

@ -32,7 +32,6 @@
#include "support/filetools.h"
#include "support/path.h"
#include "support/syscall.h"
#include "lyxfunc.h"
#include "gettext.h"
using std::vector;
@ -117,8 +116,7 @@ void ShowMessage(Buffer const * buf,
{
if (lyxrc.use_gui) {
string const str = msg1 + ' ' + msg2 + ' ' + msg3;
buf->getUser()->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
str);
buf->getUser()->owner()->message(str);
} else
lyxerr << msg1 << msg2 << msg3 << endl;
}
@ -317,9 +315,7 @@ void AutoSave(BufferView * bv)
return;
}
bv->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("Autosaving current document..."));
bv->owner()->message(_("Autosaving current document..."));
// create autosave filename
string fname = OnlyPath(bv->buffer()->fileName());
@ -359,9 +355,7 @@ void AutoSave(BufferView * bv)
// It is dangerous to do this in the child,
// but safe in the parent, so...
if (pid == -1)
bv->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("Autosave Failed!"));
bv->owner()->message(_("Autosave Failed!"));
}
}
if (pid == 0) { // we are the child so...
@ -573,16 +567,14 @@ void MenuLayoutSave(BufferView * bv)
// reconfigure the automatic settings.
void Reconfigure(BufferView * bv)
{
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Running configure..."));
bv->owner()->message(_("Running configure..."));
// Run configure in user lyx directory
Path p(user_lyxdir);
Systemcalls one(Systemcalls::System,
AddName(system_lyxdir, "configure"));
p.pop();
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE,
_("Reloading configuration..."));
bv->owner()->message(_("Reloading configuration..."));
lyxrc.read(LibFileSearch(string(), "lyxrc.defaults"));
WriteAlert(_("The system has been reconfigured."),
_("You need to restart LyX to make use of any"),

View File

@ -29,7 +29,6 @@
#include "bufferview_funcs.h"
#include "support/filetools.h"
#include "lyxrc.h"
#include "lyxfunc.h"
using std::pair;
using std::make_pair;
@ -139,14 +138,14 @@ char const * flyx_ident_extract(char const * sc)
//
void WriteAlert(string const & s1, string const & s2, string const & s3)
{
LyXFunc * lfun = 0;
LyXView * lview = 0;
if (current_view && current_view->owner())
lfun = current_view->owner()->getLyXFunc();
if (lfun) {
lview = current_view->owner();
if (lview) {
/// Write to minibuffer
ProhibitInput(current_view);
string const msg = s1 + ' ' + s2 + ' ' + s3;
lfun->Dispatch(LFUN_MESSAGE, msg);
lview->message(msg);
fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
AllowInput(current_view);

View File

@ -1604,7 +1604,7 @@ void LyXFunc::MenuNew(bool fromTemplate)
_("newfile"));
if (result.second.empty()) {
Dispatch(LFUN_MESSAGE, _("Canceled."));
owner->message(_("Canceled."));
lyxerr.debug() << "New Document Cancelled." << endl;
return;
}
@ -1631,7 +1631,7 @@ void LyXFunc::MenuNew(bool fromTemplate)
owner->view()->buffer(bufferlist.getBuffer(s));
return;
case 3: // Cancel: Do nothing
Dispatch(LFUN_MESSAGE, _("Canceled."));
owner->message(_("Canceled."));
return;
}
}
@ -1643,14 +1643,14 @@ void LyXFunc::MenuNew(bool fromTemplate)
MakeDisplayPath(s, 50),
_("Do you want to open the document?"))) {
// loads document
Dispatch(LFUN_MESSAGE, _("Opening document")
+ ' ' + MakeDisplayPath(s) + "...");
owner->message(_("Opening document") + ' '
+ MakeDisplayPath(s) + "...");
XFlush(fl_get_display());
owner->view()->buffer(
bufferlist.loadLyXFile(s));
Dispatch(LFUN_MESSAGE, _("Document")
+ ' ' + MakeDisplayPath(s) + ' '
+ _("opened."));
owner->message(_("Document") + ' '
+ MakeDisplayPath(s) + ' '
+ _("opened."));
return;
}
}
@ -1729,7 +1729,7 @@ void LyXFunc::Open(string const & fname)
// check selected filename
if (filename.empty()) {
Dispatch(LFUN_MESSAGE, _("Canceled."));
owner->message(_("Canceled."));
return;
}
} else
@ -1742,19 +1742,17 @@ void LyXFunc::Open(string const & fname)
filename += ".lyx";
// loads document
Dispatch(LFUN_MESSAGE,
_("Opening document") + ' '
+ MakeDisplayPath(filename) + "...");
owner->message(_("Opening document") + ' '
+ MakeDisplayPath(filename) + "...");
Buffer * openbuf = bufferlist.loadLyXFile(filename);
if (openbuf) {
owner->view()->buffer(openbuf);
Dispatch(LFUN_MESSAGE,
_("Document") + ' '
+ MakeDisplayPath(filename) + ' ' + _("opened."));
owner->message(_("Document") + ' '
+ MakeDisplayPath(filename)
+ ' ' + _("opened."));
} else {
Dispatch(LFUN_MESSAGE,
_("Could not open document") + ' '
+ MakeDisplayPath(filename));
owner->message(_("Could not open document") + ' '
+ MakeDisplayPath(filename));
}
}
@ -1801,7 +1799,7 @@ void LyXFunc::doImport(string const & argument)
// check selected filename
if (filename.empty())
Dispatch(LFUN_MESSAGE, _("Canceled."));
owner->message(_("Canceled."));
}
// still no filename? abort
@ -1829,7 +1827,7 @@ void LyXFunc::doImport(string const & argument)
owner->view()->buffer(bufferlist.getBuffer(lyxfile));
return;
case 3: // Cancel: Do nothing
Dispatch(LFUN_MESSAGE, _("Canceled."));
owner->message(_("Canceled."));
return;
}
}
@ -1839,7 +1837,7 @@ void LyXFunc::doImport(string const & argument)
if (f.exist() && !AskQuestion(_("A document by the name"),
MakeDisplayPath(lyxfile),
_("already exists. Overwrite?"))) {
Dispatch(LFUN_MESSAGE, _("Canceled"));
owner->message(_("Canceled"));
return;
}
// filename should be valid now

View File

@ -50,10 +50,10 @@
#endif
#include "lyxserver.h"
#include "lyxfunc.h"
#include "lyx_main.h"
#include "debug.h"
#include "LyXAction.h"
#include "lyxfunc.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"

View File

@ -15,8 +15,8 @@
#include "gettext.h"
#include "support/filetools.h"
#include "support/lyxlib.h"
#include "lyxfunc.h"
#include "LyXView.h"
#include "lyxfunc.h"
using std::endl;
using std::pair;

View File

@ -45,7 +45,6 @@
#include "math_spaceinset.h"
#include "math_deliminset.h"
#include "mathed/support.h"
#include "lyxfunc.h"
using std::ostream;
using std::istream;
@ -859,7 +858,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
case LFUN_GREEK:
if (!greek_kb_flag) {
greek_kb_flag = 1;
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek mode on"));
bv->owner()->message(_("Math greek mode on"));
} else
greek_kb_flag = 0;
break;
@ -868,9 +867,9 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
case LFUN_GREEK_TOGGLE:
greek_kb_flag = (greek_kb_flag) ? 0 : 2;
if (greek_kb_flag)
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek keyboard on"));
bv->owner()->message(_("Math greek keyboard on"));
else
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek keyboard off"));
bv->owner()->message(_("Math greek keyboard off"));
break;
// Math fonts
@ -884,7 +883,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
case LFUN_TEX:
// varcode = LM_TC_TEX;
mathcursor->setLastCode(LM_TC_TEX);
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("TeX mode"));
bv->owner()->message(_("TeX mode"));
break;
case LFUN_MATH_NUMBER:
@ -901,10 +900,10 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
label_.erase();
}
*/
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("No number"));
bv->owner()->message(_("No number"));
} else {
++type;
bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Number"));
bv->owner()->message(_("Number"));
}
par->SetType(type);
// Andre:
@ -1115,8 +1114,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
// Invalid actions under math mode
case LFUN_MATH_MODE:
if (mathcursor->getLastCode()!= LM_TC_TEXTRM) {
bv->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE, _("math text mode"));
bv->owner()->message(_("math text mode"));
varcode = LM_TC_TEXTRM;
} else {
varcode = LM_TC_VAR;
@ -1125,9 +1123,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
break;
case LFUN_UNDO:
bv->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("Invalid action in math mode!"));
bv->owner()->message(_("Invalid action in math mode!"));
break;
//------- dummy actions
@ -1246,7 +1242,10 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
if (was_macro)
mathcursor->MacroModeClose();
// This line nukes the mathcursor. Why?
//bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("TeX mode"));
#ifdef WITH_WARNINGS
#warning Still? (Lgb)
#endif
bv->owner()->message(_("TeX mode"));
mathcursor->setLastCode(LM_TC_TEX);
}
// Andre:

View File

@ -33,7 +33,6 @@
#include "lyxscreen.h"
#include "bufferview_funcs.h"
#include "language.h"
#include "lyxfunc.h"
using std::max;
using std::min;
@ -2110,13 +2109,9 @@ void LyXText::InsertChar(BufferView * bview, char c)
#endif
)) {
if (cursor.pos() == 0 )
bview->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("You cannot insert a space at the beginning of a paragraph. Please read the Tutorial."));
bview->owner()->message(_("You cannot insert a space at the beginning of a paragraph. Please read the Tutorial."));
else
bview->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("You cannot type two spaces this way. Please read the Tutorial."));
bview->owner()->message(_("You cannot type two spaces this way. Please read the Tutorial."));
charInserted();
return;
}

View File

@ -42,7 +42,6 @@
#include "lyxrc.h"
#include "FloatList.h"
#include "language.h"
#include "lyxfunc.h"
using std::copy;
using std::find;
@ -1322,9 +1321,7 @@ void LyXText::ToggleFree(BufferView * bview,
// If the mask is completely neutral, tell user
if (font == LyXFont(LyXFont::ALL_IGNORE)) {
// Could only happen with user style
bview->owner()->getLyXFunc()
->Dispatch(LFUN_MESSAGE,
_("No font change defined. Use Character under the Layout menu to define font change."));
bview->owner()->message(_("No font change defined. Use Character under the Layout menu to define font change."));
return;
}