Jean-Marc Lasgouttes a écrit :
"Abdel" == Abdel  <[EMAIL PROTECTED]> writes:

Abdel> Well this use the Lyx Menu Backend which I have great
Abdel> difficulty to understand. It keeps crashing a lot so I gave up
Abdel> on that (But I have ported the menubar to Qt4.1).

The Navigation part is kind of horrible indeed. The rest should be
easier. Feel free to ask me.

OK, thanks. My main problem is that while a MenuItem is of Submenu kind,
sometimes (depends on the document you load and the time of day) its
associated submenu is empty. This happens only for the Navigate menu,
others works fine. It seems that the submenu is filled in after you ask
for it. So IMHO, there is a chicken and eggs problem here.
Ex: in this code snippet I had to put a continue here in order to avoid
potential crash:

  if (m->kind() == MenuItem::Submenu) {
        QMenu * subMenu = qMenu->addMenu(toqstr(getLabel(*m)));
        if (m->submenuname().empty()) {
                lyxerr[Debug::GUI]
                        << "ERROR Submenu name empty formenuItem "
                        << m->label() << endl;
                                continue;
        }


Second, I really don't understand why we have to expand the menu we are
looking for into a new local menu:

Menu submenu;
// This has caused a crash once:
//owner_->backend().expand(*(m->submenu()), submenu, owner_->view());
// So I just do that:
Menu const & fromLyxMenu = owner_->backend().getMenu(m->submenuname());
owner_->backend().expand(fromLyxMenu, submenu, owner_->view());

In my opinion we should just be able to use getMenu() without having to expand it. In this case MenuVackend member menulist_ should of course be mutable (because getMenu is a const function). So the MenuBackend should make sure that the menu you ask for is always up to date.


Another problem that I have is with the MenuItem::func() member. I store
it this way in a QLAction which is a lyx tailored QAction:
QLAction * action = new QLAction(*(owner_->view()), label, m->func());
So the FuncRequest is stored in the QLAction and is called when you
click on the corresponding MenuItem. The problem is that this make lyx
crashing for some MenuItem randomly (not all). It seems that this
FuncRequest is not constant for a given MenuItem... weird.

For comparison, in QLToolbar I create QActions (not QLAction) on the fly
and it works well.

My idea is that in the future, maybe for 1.5, there should be a unique
configuration file which will describe all available FuncRequests,
together with associated label, icon, tooltip, number of argument (if
any), etc. All these will be converted into QLAction. These QLAction
would then be available as MenuItem or Toolbar button indifferently.

I realize now that my explanation is a bit abstract so I attach my ports
of QView, QLMenubar and QLPopupmenu to this mail (QLAction is defined in QView.[hC]

Sorry Jean-Marc, you asked for it ;-)

Abdel.

JMarc



// -*- C++ -*-
/**
 * \file QtView.h
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author Lars Gullik Bjornes
 * \author John Levon
 *
 * Full author contact details are available in file CREDITS.
 */

#ifndef QTVIEW_H
#define QTVIEW_H

// Must be here because of moc.
#include <config.h>

#include "frontends/LyXView.h"

#include <QMainWindow>
#include <QTimer>
#include <QAction>

//Added by qt3to4:
#include <QCloseEvent>

class QToolBar;

class FuncRequest;

//class string;

namespace lyx {
namespace frontend {

class QCommandBuffer;

/**
 * QLAction - Qt interface with LyX' FuncRequest.
 *
 * QLAction can be used in LyX menubar and/or toolbars.
 */
class QLAction: public QAction {
        Q_OBJECT
public:

        QLAction(LyXView & lyxView, std::string const & text,
                FuncRequest const & func, std::string const & tooltip="");

        QLAction(LyXView & lyxView, std::string const & icon, std::string const 
& text,
                FuncRequest const & func, std::string const & tooltip="");

private slots:
        void action();

private:
        FuncRequest const & func_;
        LyXView & lyxView_;
};

/**
 * QtView - Qt implementation of LyXView
 *
 * Qt-private implementation of the main LyX window.
 */
class QtView : public QMainWindow, public LyXView {
        Q_OBJECT
public:
        /// create a main window of the given dimensions
        QtView(unsigned int w, unsigned int h);

        ~QtView();

        /// show - display the top-level window
        void show();

        /// show busy cursor
        virtual void busy(bool) const;

        /// display a status message
        virtual void message(std::string const & str);

        /// clear status message
        virtual void clearMessage();

        /// add the command buffer
        void addCommandBuffer(QToolBar * toolbar);

        /// menu item has been selected
        void activated(FuncRequest const &);

        // returns true if this view has the focus.
        virtual bool hasFocus() const;

public slots:
        /// idle timeout
        void update_view_state_qt();

        /// populate a toplevel menu and all its children on demand
        void updateMenu(QAction *);

protected:
        /// make sure we quit cleanly
        virtual void closeEvent(QCloseEvent * e);
private:
        /// focus the command buffer widget
        void focus_command_widget();

        /// update status bar
        void update_view_state();

        /**
         * setWindowTitle - set title of window
         * @param t main window title
         * @param it iconified (short) title
         */
        virtual void setWindowTitle(std::string const & t, std::string const & 
it);

        QTimer statusbar_timer_;

        /// command buffer
        QCommandBuffer * commandbuffer_;
};

} // namespace frontend
} // namespace lyx

#endif // QTVIEW_H

/**
 * \file qt2/QLMenubar.C
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author John Levon
 *
 * Full author contact details are available in file CREDITS.
 */

#include <config.h>

// Qt defines a macro 'signals' that clashes with a boost namespace.
// All is well if the namespace is visible first.
#include "QtView.h"

#include "QLMenubar.h"
#include "QLPopupMenu.h"

#include "qt_helpers.h"
#include "support/lstrings.h"

#include "MenuBackend.h"
#include "support/lstrings.h"

#include "debug.h"

#ifdef Q_WS_MACX
#include "kbmap.h"
#include "QLyXKeySym.h"
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
#endif

#include <QMenuBar>
#include <QCursor>

using std::pair;
using std::string;
using std::endl;

namespace {

} // namespace anon

namespace lyx {


namespace frontend {

// MacOSX specific stuff is at the end.

QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe)
        : owner_(static_cast<QtView*>(view)), menubackend_(mbe)
{
        macxMenuBarInit();

        lyxerr[Debug::GUI] << "populating menu bar" << 
menubackend_.getMenubar().name() << endl;

        if (menubackend_.getMenubar().size() == 0) {
                lyxerr[Debug::GUI] << "\tERROR: empty menu bar" << 
menubackend_.getMenubar().name() << endl;
                return;
                //                      continue;
        }
        else {
                lyxerr[Debug::GUI] << "menu bar entries " << 
menubackend_.getMenubar().size();
        }
        //      for (; m != end; ++m) {

        Menu menu;
        menubackend_.expand(menubackend_.getMenubar(), menu, owner_);

        Menu::const_iterator m = menu.begin();
        Menu::const_iterator end = menu.end();

        for (; m != end; ++m) {

                if (m->kind() != MenuItem::Submenu) {
                        lyxerr[Debug::GUI] << "\tERROR: not a submenu " << 
m->label() << endl;
                        continue;
                }

                lyxerr[Debug::GUI] << "menu bar item " << m->label() << " is a 
submenu named " << m->submenuname() << endl;

                string name = m->submenuname();
                if (!menubackend_.hasMenu(name)) {
                        lyxerr[Debug::GUI] << "\tERROR: " << name << " submenu 
has no menu!" << endl;
                        continue;
                }

                QLPopupMenu * qMenu = new QLPopupMenu(this, *m);
                owner_->menuBar()->addMenu(qMenu);

                pair<NameMap::iterator, bool> I = 
name_map_.insert(make_pair(name, qMenu));
                if (!I.second) {
                        lyxerr[Debug::GUI] << "\tERROR: " << name << " submenu 
is already there!" << endl;
                }
/*
                QObject::connect(qMenu, SIGNAL(aboutToShow()), this, 
SLOT(update()));
                QObject::connect(qMenu, SIGNAL(triggered(QAction *)), this, 
SLOT(update()));
                QObject::connect(qMenu->menuAction(), SIGNAL(triggered()), 
this, SLOT(update()));
*/
        }
        //QObject::connect(owner_->menuBar(), SIGNAL(triggered()), this, 
SLOT(update()));
}

void QLMenubar::openByName(string const & name)
{
        NameMap::const_iterator const cit = name_map_.find(name);
        if (cit == name_map_.end())
                return;

        // I (Abdel) don't understand this comment:
        // this will have to do I'm afraid.
        cit->second->exec(QCursor::pos());
}


void QLMenubar::update()
{ }

QtView * QLMenubar::view()
{
        return owner_;
}


MenuBackend const & QLMenubar::backend()
{
        return menubackend_;
}


/*
  Here is what the Qt documentation says about how a menubar is chosen:

     1) If the window has a QMenuBar then it is used. 2) If the window
     is a modal then its menubar is used. If no menubar is specified
     then a default menubar is used (as documented below) 3) If the
     window has no parent then the default menubar is used (as
     documented below).

     The above 3 steps are applied all the way up the parent window
     chain until one of the above are satisifed. If all else fails a
     default menubar will be created, the default menubar on Qt/Mac is
     an empty menubar, however you can create a different default
     menubar by creating a parentless QMenuBar, the first one created
     will thus be designated the default menubar, and will be used
     whenever a default menubar is needed.

  Thus, for Qt/Mac, we add the menus to a free standing menubar, so
  that this menubar will be used also when one of LyX' dialogs has
  focus. (JMarc)
*/
QMenuBar * QLMenubar::menuBar() const
{
#ifdef Q_WS_MAC
        return menubar_.get();
#else
        return owner_->menuBar();
#endif
}

void QLMenubar::macxMenuBarInit()
{
#ifdef Q_WS_MACX
        menubar_ = new QMenuBar;

        // this is the name of the menu that contains our special entries
        menubackend_.specialMenu("LyX");
        // make sure that the special entries are added to the first
        // menu even before this menu has been opened.
        name_map_[menubackend_.getMenubar().begin()->submenuname()]->showing();
#endif
}

} // namespace frontend
} // namespace lyx

// -*- C++ -*-
/**
 * \file qt2/QLMenubar.h
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author Lars Gullik Bjønnes
 * \author John Levon
 *
 * Full author contact details are available in file CREDITS.
 */

#ifndef QLMENUBAR_H
#define QLMENUBAR_H

#include "frontends/Menubar.h"

#include <map>

#include <QObject>

class QMenuBar;
class QMenu;
class LyXView;
class MenuBackend;
class Menu;
class MenuItem;

namespace lyx {


namespace frontend {

class QtView;

class QLMenubar : public QObject, public Menubar {
        Q_OBJECT
public:
        QLMenubar(LyXView *, MenuBackend &);

        /// opens a top-level submenu given its name
        void openByName(std::string const &);

        /// return the owning view
        QtView * view();

        /// return the menu controller
        MenuBackend const & backend();

        /// The QMenuBar used by LyX
        QMenuBar * menuBar() const;

        /// update the state of the menuitems - not needed
        void update();

public slots:
        /// populate a toplevel menu and all its children on demand
//      void updateMenu();

private:
        /// Initialize specific MACOS X menubar
        void QLMenubar::macxMenuBarInit();

        /// owning view
        QtView * owner_;

        /// menu controller
        MenuBackend & menubackend_;

        typedef std::map<std::string, QMenu *> NameMap;

        /// name to menu for openByName
        NameMap name_map_;

#ifdef Q_WS_MACX
        boost::scoped_ptr<QMenuBar> menubar_;
#endif
};

} // namespace frontend
} // namespace lyx

#endif // QLMENUBAR_H

/**
 * \file QLPopupMenu.C
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author John Levon
 * \author Abdelrazak Younes
 *
 * Full author contact details are available in file CREDITS.
 */

#include <config.h>

// Qt defines a macro 'signals' that clashes with a boost namespace.
// All is well if the namespace is visible first.
#include "QtView.h"

#include "QLPopupMenu.h"
#include "QLMenubar.h"
#include "qt_helpers.h"
#include "MenuBackend.h"

#include "frontends/lyx_gui.h"
#include "support/lstrings.h"
#include "debug.h"


#ifdef Q_WS_MACX
#include "kbmap.h"
#include "QLyXKeySym.h"
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
#endif

using std::make_pair;
using std::string;
using std::pair;
using std::endl;

namespace {

} // namespace anon

namespace lyx {

namespace frontend {


// MacOSX specific stuff is at the end.

QLPopupMenu::QLPopupMenu(QLMenubar * owner, 
                                                 MenuItem const & mi)
        : owner_(owner)
{
        name_ = mi.submenuname();

        setTitle(toqstr(getLabel(mi)));

        connect(this, SIGNAL(aboutToShow()), this, SLOT(update()));
}



void QLPopupMenu::update()
{
        lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION << endl;
        lyxerr[Debug::GUI] << "\tTriggered menu: " << name_ << endl;

        clear();

        if (name_.empty())
                return;

        Menu const & fromLyxMenu = owner_->backend().getMenu(name_);
        Menu tomenu;
        owner_->backend().expand(fromLyxMenu, tomenu, owner_->view());
        
        if (!owner_->backend().hasMenu(tomenu.name())) {
                lyxerr[Debug::GUI] << "\tWARNING: menu seems empty" << 
tomenu.name() << endl;
        }

        populate(this, &tomenu);

        specialMacXmenuHack();
}

void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
{
        lyxerr[Debug::GUI] << "populating menu " << menu->name() ;
        if (menu->size() == 0) {
                lyxerr[Debug::GUI] << "\tERROR: empty menu " << menu->name() << 
endl;
                return;
        }
        else {
                lyxerr[Debug::GUI] << " *****  menu entries " << menu->size() 
<< endl;
        }

        Menu::const_iterator m = menu->begin();
        Menu::const_iterator end = menu->end();
        
        for (; m != end; ++m) {

                if (m->kind() == MenuItem::Separator) {
                
                        qMenu->addSeparator();
                        lyxerr[Debug::GUI] << "adding Menubar Separator" << 
endl;

                } else if (m->kind() == MenuItem::Submenu) {
                        
                        QMenu * subMenu = qMenu->addMenu(toqstr(getLabel(*m)));
                        if (m->submenuname().empty()) {
                                lyxerr[Debug::GUI] << "ERROR Submenu name empty 
for menuItem " << m->label() << endl;
                                continue;
                        }

                        lyxerr[Debug::GUI] << "adding Submenu " << 
m->submenuname() << " to menu "<< m->label() << endl;
                        
subMenu->menuAction()->setEnabled(m->status().enabled());
                        
                        Menu submenu;
                        //owner_->backend().expand(*(m->submenu()), submenu, 
owner_->view());
                        Menu const & fromLyxMenu = 
owner_->backend().getMenu(m->submenuname());
                        owner_->backend().expand(fromLyxMenu, submenu, 
owner_->view());
                        
                        if (owner_->backend().hasMenu(m->submenuname())) {
                                lyxerr[Debug::GUI] << "\tWARNING: menu seems 
empty" << m->submenuname() << endl;
                        }
                        populate(subMenu, &submenu);
                        
                } else { // we have a MenuItem::Command

                        FuncStatus status = m->status();
                        
                        lyxerr[Debug::GUI] << "creating Menu Item " << 
m->label() << endl;
                        
                        string label = getLabel(*m);
                        addBinding(label, *m);
                        
                        QLAction * action = new QLAction(*(owner_->view()), 
label, m->func());
                        action->setEnabled(m->status().enabled());
                        action->setChecked(m->status().onoff(true));
                        // Actually insert the menu item
                        qMenu->addAction(action);
                }
        }
}

string const QLPopupMenu::getLabel(MenuItem const & mi)
{
        string const shortcut = mi.shortcut();
        string label = support::subst(mi.label(), "&", "&&");

        if (!shortcut.empty()) {
                string::size_type pos = label.find(shortcut);
                if (pos != string::npos)
                        label.insert(pos, 1, '&');
        }

        return label;
}

/// \todo Mac specific binding handling.
void QLPopupMenu::addBinding(string & label, MenuItem const & mi)
{
#ifndef Q_WS_MACX

                string const binding(mi.binding());
                if (!binding.empty()) {
                        label += '\t' + binding;
                }

#else
                        /* There are two constraints on Qt/Mac: (1)
                           the bindings require a unicode string to be
                           represented meaningfully and std::string
                           does not work (2) only 1-key bindings can
                           be represented in menus.

                           This is why the unpleasant hack bellow is
                           needed (JMarc)
                        */
/*                      pair<LyXKeySym const *, key_modifier::state>
                                binding = 
toplevel_keymap->find1keybinding(mi.func());
                        if (binding.first) {
                                QLyXKeySym const *key = static_cast<QLyXKeySym 
const *>(binding.first);
                                label += '\t' + key->qprint(binding.second);
                        }
*/
#endif
}

/// \todo Fix Mac specific menu hack
void QLPopupMenu::specialMacXmenuHack()
{
#ifdef Q_WS_MACX
        /* The qt/mac menu code has a very silly hack that
           moves some menu entries that it recognizes by name
           (e.g. "Preferences...") to the "LyX" menu. This
           feature can only work if the menu entries are
           always available. Since we build menus on demand,
           we add some dummy contents to one of the menus (JMarc)
        */
/*
        static QLPopupMenu * themenu = this;
        if (themenu == this && owner_->backend().hasMenu("LyX")) {
                Menu special = owner_->backend().getMenu("LyX");
                Menu::const_iterator end = special.end();
                Menu::size_type i = 0;
                for (Menu::const_iterator cit = special.begin();
                     cit != end ; ++cit, ++i)
                        insertItem(toqstr(cit->label()), indexOffset + i);
        }
*/
#endif
}

} // namespace frontend
} // namespace lyx

// -*- C++ -*-
/**
 * \file QLPopupMenu.h
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author John Levon
 *
 * Full author contact details are available in file CREDITS.
 */

#ifndef QLPOPUPMENU_H
#define QLPOPUPMENU_H

#include <QMenu>

#include "funcrequest.h"
class MenuBackend;

#include <utility>
#include <string>

class MenuItem;
class Menu;

namespace lyx {
namespace frontend {

class QLMenubar;

/// a submenu
class QLPopupMenu : public QMenu {
        Q_OBJECT
public:

        QLPopupMenu(QLMenubar * owner, MenuItem const & mi);
 
        /// populates the menu or one of its submenu
        /// This is used as a recursive function
        void populate(QMenu* qMenu, Menu * menu);

public slots:
        /// populate the toplevel menu and all children
        void update();

private:

        /// our owning menubar
        QLMenubar * owner_;

        /// the name of this menu
        std::string name_;

private:        
        /// Get a Menu item label from the menu backend
        std::string const getLabel(MenuItem const & mi);

        /// add binding keys a the menu item label.
        /// \todo Mac specific binding handling.
        void addBinding(std::string & label, MenuItem const & mi);

        /// Mac specific menu hack
        /// \todo Fix it
        void specialMacXmenuHack();
};

} // namespace frontend
} // namespace lyx

#endif // QLPOPUPMENU_H

/**
 * \file QtView.C
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author Lars Gullik Bjønnes
 * \author John Levon
 *
 * Full author contact details are available in file CREDITS.
 */

#include <config.h>

#include "BufferView.h"
#include "lyx_cb.h"
#include "lyxfunc.h"
#include "MenuBackend.h"

#include "debug.h"

#include "frontends/Toolbars.h"

#include "support/filetools.h"

#include <boost/bind.hpp>

#include "QtView.h"
#include "QLMenubar.h"
#include "qfont_loader.h"
#include "QCommandBuffer.h"
#include "qt_helpers.h"

#include <QApplication>
#include <QPixmap>
#include <QStatusbar>
#include <QToolBar>
#include <QCloseEvent>
#include <QAction>
#include <QMenu>
#include <QMenuBar>

#include "support/lstrings.h"


using std::string;
using std::endl;

FontLoader fontloader;

namespace lyx {

using support::subst;
using support::LibFileSearch;

namespace frontend {

namespace {

int const statusbar_timer_value = 3000;

} // namespace anon

QLAction::QLAction(LyXView & lyxView, string const & text,
                FuncRequest const & func, string const & tooltip)
                : QAction(this), lyxView_(lyxView), func_(func)
{
        setText(tr(toqstr(text)));
        setToolTip(tr(toqstr(tooltip)));
        setStatusTip(toqstr(tooltip));
        connect(this, SIGNAL(triggered()), this, SLOT(action()));
}

QLAction::QLAction(LyXView & lyxView, string const & icon, string const & text,
                FuncRequest const & func, string const & tooltip)
                : QAction(this), lyxView_(lyxView), func_(func)
{
        setIcon(QPixmap(icon.c_str()));
        setText(tr(toqstr(text)));
        setToolTip(tr(toqstr(tooltip)));
        setStatusTip(toqstr(tooltip));
        connect(this, SIGNAL(triggered()), this, SLOT(action()));
}

void QLAction::action()
{
        lyxerr[Debug::ACTION] << "calling LyXFunc::dispatch: func_: " << func_ 
<< endl;

        lyxView_.getLyXFunc().dispatch(func_);
}

QtView::QtView(unsigned int width, unsigned int height)
        : QMainWindow(), LyXView(), commandbuffer_(0)
{
        resize(width, height);

        qApp->setMainWidget(this);

//      setToolButtonStyle(Qt::ToolButtonIconOnly);
//      setIconSize(QSize(12,12));

        bufferview_.reset(new BufferView(this, width, height));

        menubar_.reset(new QLMenubar(this, menubackend));
        connect(menuBar(), SIGNAL(triggered(QAction *)), this, 
SLOT(updateMenu(QAction *)));

        getToolbars().init();

        statusBar()->setSizeGripEnabled(false);

        view_state_changed.connect(boost::bind(&QtView::update_view_state, 
this));
        connect(&statusbar_timer_, SIGNAL(timeout()), this, 
SLOT(update_view_state_qt()));

#ifndef Q_WS_MACX
        //  assign an icon to main form. We do not do it under Qt/Mac,
        //  since the icon is provided in the application bundle.
        string const iconname = LibFileSearch("images", "lyx", "xpm");
        if (!iconname.empty())
                setIcon(QPixmap(toqstr(iconname)));
#endif

        // make sure the buttons are disabled if needed
        updateToolbars();
}


QtView::~QtView()
{
}

void QtView::updateMenu(QAction *action)
{
        menubar_->update();
}

void QtView::setWindowTitle(string const & t, string const & it)
{
        QMainWindow::setWindowTitle(toqstr(t));
        QMainWindow::setWindowIconText(toqstr(it));
}


void QtView::addCommandBuffer(QToolBar * toolbar)
{
        commandbuffer_ = new QCommandBuffer(this, *controlcommand_);
        focus_command_buffer.connect(boost::bind(&QtView::focus_command_widget, 
this));
        toolbar->addWidget(commandbuffer_);
}


void QtView::message(string const & str)
{
        statusBar()->message(toqstr(str));
        statusbar_timer_.stop();
        statusbar_timer_.start(statusbar_timer_value);
}


void QtView::clearMessage()
{
        update_view_state_qt();
}


void QtView::focus_command_widget()
{
        if (commandbuffer_)
                commandbuffer_->focus_command();
}


void QtView::update_view_state_qt()
{
        statusBar()->message(toqstr(getLyXFunc().viewStatusMessage()));
        statusbar_timer_.stop();
}


void QtView::update_view_state()
{
        // let the user see the explicit message
        if (statusbar_timer_.isActive())
                return;

        statusBar()->message(toqstr(getLyXFunc().viewStatusMessage()));
}


void QtView::activated(FuncRequest const & func)
{
        getLyXFunc().dispatch(func);
}


bool QtView::hasFocus() const
{
        return qApp->activeWindow() == this;
}


void QtView::closeEvent(QCloseEvent *)
{
        QuitLyX(false);
}


void QtView::show()
{
        setCaption(qt_("LyX"));
        QMainWindow::show();
}


void QtView::busy(bool yes) const
{
        if (yes)
                QApplication::setOverrideCursor(Qt::waitCursor);
        else
                QApplication::restoreOverrideCursor();
}

} // namespace frontend
} // namespace lyx

Reply via email to