Just FYI. This is what's in my tree for the allow/prohibitInput stuff.
btw, we have a bug in that convertors convert does not set busy - this is bad for e.g. pdf output. But busy cursor might be distracting for general convert stuff .We should try it and see. Minor UI thing anyhoo regards john Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.321 diff -u -r1.321 BufferView_pimpl.C --- BufferView_pimpl.C 27 Nov 2002 10:30:03 -0000 1.321 +++ BufferView_pimpl.C 5 Dec 2002 16:26:31 -0000 @@ -265,8 +267,8 @@ bool selection = false; bool mark_set = false; - owner_->prohibitInput(); - + owner_->busy(true); + owner_->message(_("Formatting document...")); if (bv_->text) { @@ -330,7 +332,7 @@ bv_->text->first_y = screen().topCursorVisible(bv_->text->cursor, bv_->text->first_y); switchKeyMap(); - owner_->allowInput(); + owner_->busy(false); updateScrollbar(); Index: buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.394 diff -u -r1.394 buffer.C --- buffer.C 27 Nov 2002 10:30:05 -0000 1.394 +++ buffer.C 5 Dec 2002 16:28:56 -0000 @@ -3066,7 +3054,7 @@ { if (!users->text) return 0; - users->owner()->prohibitInput(); + users->owner()->busy(true); // get LaTeX-Filename string const name = getLatexName(); @@ -3105,7 +3093,7 @@ users->repaint(); users->fitCursor(); } - users->owner()->allowInput(); + users->owner()->busy(false); return res; } diff -u -r1.92 bufferlist.C --- bufferlist.C 27 Nov 2002 10:30:07 -0000 1.92 +++ bufferlist.C 5 Dec 2002 16:29:01 -0000 @@ -177,16 +167,7 @@ if (!buf->paragraphs.empty() && !buf->isClean() && !quitting) { - if (buf->getUser()) - buf->getUser()->owner()->prohibitInput(); string fname; if (buf->isUnnamed()) fname = OnlyFilename(buf->fileName()); @@ -204,8 +185,6 @@ lastfiles->newFile(buf->fileName()); reask = false; } else { - if (buf->getUser()) - buf->getUser()->owner()->allowInput(); return false; } break; @@ -216,16 +195,12 @@ reask = false; break; case 3: // Cancel - if (buf->getUser()) - buf->getUser()->owner()->allowInput(); return false; } } - if (buf->getUser()) - buf->getUser()->owner()->allowInput(); } Index: converter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v retrieving revision 1.61 diff -u -r1.61 converter.C --- converter.C 29 Nov 2002 15:51:16 -0000 1.61 +++ converter.C 5 Dec 2002 16:29:30 -0000 @@ -832,7 +832,7 @@ BufferView * bv = buffer->getUser(); if (bv) { - bv->owner()->prohibitInput(); + bv->owner()->busy(true); // all error insets should have been removed by now } @@ -847,7 +847,7 @@ bv->repaint(); bv->fitCursor(); } - bv->owner()->allowInput(); + bv->owner()->busy(false); } if ((result & LaTeX::ERRORS)) { @@ -890,7 +890,7 @@ BufferView * bv = buffer->getUser(); if (bv) { - bv->owner()->prohibitInput(); + bv->owner()->busy(true); bv->owner()->message(_("Running LaTeX...")); // all the autoinsets have already been removed } @@ -937,7 +937,7 @@ } if (bv) - bv->owner()->allowInput(); + bv->owner()->busy(false); int const ERROR_MASK = LaTeX::NO_LOGFILE | Index: lyx_cb.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v retrieving revision 1.189 diff -u -r1.189 lyx_cb.C --- lyx_cb.C 27 Nov 2002 10:30:08 -0000 1.189 +++ lyx_cb.C 5 Dec 2002 16:30:28 -0000 @@ -473,7 +473,6 @@ void MenuInsertLabel(BufferView * bv, string const & arg) { string label = arg; - bv->owner()->prohibitInput(); if (label.empty()) { Paragraph * par = bv->getLyXText()->cursor.par(); LyXLayout_ptr layout = par->layout(); @@ -518,7 +517,6 @@ InsetLabel * inset = new InsetLabel(p); bv->insertInset(inset); } - bv->owner()->allowInput(); } Index: lyxfunc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v retrieving revision 1.385 diff -u -r1.385 lyxfunc.C --- lyxfunc.C 27 Nov 2002 10:30:10 -0000 1.385 +++ lyxfunc.C 5 Dec 2002 16:31:42 -0000 @@ -1109,12 +1109,10 @@ setErrorMessage(N_("Missing argument")); break; } - owner->prohibitInput(); string const fname = i18nLibFileSearch("doc", arg, "lyx"); if (fname.empty()) { lyxerr << "LyX: unable to find documentation file `" << arg << "'. Bad installation?" << endl; - owner->allowInput(); break; } ostringstream str; @@ -1127,7 +1125,6 @@ #endif owner->message(STRCONV(str.str())); view()->buffer(bufferlist.loadLyXFile(fname, false)); - owner->allowInput(); break; } Index: frontends/LyXView.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/LyXView.h,v retrieving revision 1.17 diff -u -r1.17 LyXView.h --- frontends/LyXView.h 5 Sep 2002 15:14:20 -0000 1.17 +++ frontends/LyXView.h 5 Dec 2002 16:36:58 -0000 @@ -67,10 +67,8 @@ */ void init(); - /// start modal operation - virtual void prohibitInput() const = 0; - /// end modal operation - virtual void allowInput() const = 0; + /// show busy cursor + virtual void busy(bool) const = 0; //@{ generic accessor functions Index: frontends/gnome/FileDialog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/gnome/FileDialog.C,v retrieving revision 1.7 diff -u -r1.7 FileDialog.C --- frontends/gnome/FileDialog.C 26 Sep 2002 08:57:42 -0000 1.7 +++ frontends/gnome/FileDialog.C 5 Dec 2002 16:39:05 -0000 @@ -115,9 +115,7 @@ private_->set_complete(mask); private_->set_filename(path+suggested); - lv_->prohibitInput(); string const filename = private_->exec(); - lv_->allowInput(); // Collect the info and return it for synchronous dialog. return FileDialog::Result(Chosen, filename); Index: frontends/qt2/QtView.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QtView.C,v retrieving revision 1.20 diff -u -r1.20 QtView.C --- frontends/qt2/QtView.C 20 Oct 2002 01:48:28 -0000 1.20 +++ frontends/qt2/QtView.C 5 Dec 2002 16:42:32 -0000 @@ -142,16 +142,7 @@ } -// it's not at all clear that these are actually -// needed anywhere in the source. Something to -// check on a rainy day. -void QtView::prohibitInput() const +void QtView::busy(bool) const { - //setFocusPolicy(QWidget::NoFocus); -} - - -void QtView::allowInput() const -{ - //setFocusPolicy(QWidget::strongFocus); + // FIXME: set cursor to watch } Index: frontends/qt2/QtView.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QtView.h,v retrieving revision 1.7 diff -u -r1.7 QtView.h --- frontends/qt2/QtView.h 20 Oct 2002 01:48:28 -0000 1.7 +++ frontends/qt2/QtView.h 5 Dec 2002 16:42:32 -0000 @@ -45,10 +45,8 @@ */ void show(int x, int y, string const & t = string("LyX")); - /// start modal operation - virtual void prohibitInput() const; - /// end modal operation - virtual void allowInput() const; + /// show busy cursor + virtual void busy(bool) const; /// display a status message virtual void message(string const & str); Index: frontends/xforms/FileDialog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FileDialog.C,v retrieving revision 1.16 diff -u -r1.16 FileDialog.C --- frontends/xforms/FileDialog.C 27 Nov 2002 10:30:23 -0000 1.16 +++ frontends/xforms/FileDialog.C 5 Dec 2002 16:44:17 -0000 @@ -16,9 +16,6 @@ #include "FormFiledialog.h" #include "frontends/FileDialog.h" -// temp. hack until Allow/prohibitInput is not -// needed any more in src/ - for now it's simplest -// to leave it there #include "frontends/LyXView.h" #include "bufferview_funcs.h" #include "gettext.h" @@ -71,14 +68,10 @@ // no support for asynchronous selection yet - lv_->prohibitInput(); - FileDialog::Result result; result.first = FileDialog::Chosen; result.second = private_->Select(title_, path, filter, suggested); - - lv_->allowInput(); return result; } Index: frontends/xforms/XFormsView.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/XFormsView.C,v retrieving revision 1.26 diff -u -r1.26 XFormsView.C --- frontends/xforms/XFormsView.C 30 Sep 2002 20:00:42 -0000 1.26 +++ frontends/xforms/XFormsView.C 5 Dec 2002 16:47:41 -0000 @@ -205,40 +205,34 @@ } -// 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 -// run "prohibitInput" on all LyXViews which will run prohibitInput on all -// BufferViews. Or is it perhaps just the (input in) BufferViews in the -// current LyXView that should be prohibited (Lgb) (This applies to -// "allowInput" as well.) -void XFormsView::prohibitInput() const +void XFormsView::busy(bool yes) const { - view()->hideCursor(); + if (yes) { + view()->hideCursor(); - static Cursor cursor; - static bool cursor_undefined = true; + static Cursor cursor; + static bool cursor_undefined = true; - if (cursor_undefined) { - cursor = XCreateFontCursor(fl_get_display(), XC_watch); - XFlush(fl_get_display()); - cursor_undefined = false; - } + if (cursor_undefined) { + cursor = XCreateFontCursor(fl_get_display(), XC_watch); + XFlush(fl_get_display()); + cursor_undefined = false; + } - /* set the cursor to the watch for all forms and the canvas */ - XDefineCursor(fl_get_display(), getForm()->window, cursor); + /// set the cursor to the watch for all forms and the canvas + XDefineCursor(fl_get_display(), getForm()->window, cursor); - XFlush(fl_get_display()); - fl_deactivate_all_forms(); -} + XFlush(fl_get_display()); + /// we only need to deactivate to prevent resetting the cursor + /// to I-beam over the workarea + fl_deactivate_all_forms(); + } else { + /// reset the cursor from the watch for all forms and the canvas -void XFormsView::allowInput() const -{ - /* reset the cursor from the watch for all forms and the canvas */ + XUndefineCursor(fl_get_display(), getForm()->window); - XUndefineCursor(fl_get_display(), getForm()->window); - - XFlush(fl_get_display()); - fl_activate_all_forms(); + XFlush(fl_get_display()); + fl_activate_all_forms(); + } } Index: frontends/xforms/XFormsView.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/XFormsView.h,v retrieving revision 1.15 diff -u -r1.15 XFormsView.h --- frontends/xforms/XFormsView.h 30 Sep 2002 20:00:42 -0000 1.15 +++ frontends/xforms/XFormsView.h 5 Dec 2002 16:47:41 -0000 @@ -47,10 +47,8 @@ FL_FORM * getForm() const; /// redraw the main form. virtual void redraw(); - /// - virtual void prohibitInput() const; - /// - virtual void allowInput() const; + /// show busy cursor + virtual void busy(bool) const; /// callback for close event from window manager static int atCloseMainFormCB(FL_FORM *, void *); -- "Yeah, I woke up in the day accidentally once, the moon was on fire for some reason and I couldn't see very well and all the bandwidth disappeared, it was very scary :(" - Orion