* LyXView:
- getMenubars(): deleted.
- menubar_: transfered to GuiView::private.
- updateMenubar(): deleted, QLMenubar::update() is a void method anyway (to be deleted soon).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19750
a592a061-630c-0410-9148-
cb99ea01b6c8
case LFUN_MENU_OPEN:
BOOST_ASSERT(lyx_view_);
- lyx_view_->getMenubar().openByName(from_utf8(argument));
+ lyx_view_->openMenu(from_utf8(argument));
break;
// --- lyxserver commands ----------------------------
}
}
if (!quitting && lyx_view_) {
- lyx_view_->updateMenubar();
lyx_view_->updateToolbars();
// Some messages may already be translated, so we cannot use _()
sendDispatchMessage(translateIfPossible(getMessage()), cmd);
} else
toolbars_->update(false, false, false);
- // update redaonly status of open dialogs. This could also be in
- // updateMenubar(), but since updateToolbars() and updateMenubar()
- // are always called together it is only here.
+ // update redaonly status of open dialogs.
getDialogs().checkStatus();
}
}
-void LyXView::updateMenubar()
-{
- menubar_->update();
-}
-
-
void LyXView::autoSave()
{
LYXERR(Debug::INFO) << "Running autoSave()" << endl;
class ControlCommandBuffer;
class Dialogs;
-class Menubar;
class WorkArea;
/**
bool isToolbarVisible(std::string const & id);
///
virtual void showMiniBuffer(bool visible) = 0;
-
- /// return the menubar for this view
- Menubar & getMenubar() { return *menubar_.get(); }
- ///
- Menubar const & getMenubar() const { return *menubar_.get(); }
+ virtual void openMenu(docstring const & name) = 0;
/// get access to the dialogs
Dialogs & getDialogs() { return *dialogs_.get(); }
ToolbarInfo * getToolbarInfo(std::string const & name);
/// toggle toolbar state
void toggleToolbarState(std::string const & name, bool allowauto);
- /// update the menubar
- void updateMenubar();
/// update the status bar
virtual void updateStatusBar() = 0;
/// disconnect from signals in the given buffer
void disconnectBuffer();
- /// view's menubar
- boost::scoped_ptr<Menubar> menubar_;
/// view's toolbar
boost::scoped_ptr<Toolbars> toolbars_;
// Skip these when selecting
if (cmd.action != LFUN_MOUSE_MOTION) {
lyx_view_->updateLayoutChoice();
- lyx_view_->updateMenubar();
lyx_view_->updateToolbars();
}
TabWidget * tab_widget_;
QStackedWidget * stack_widget_;
BackgroundWidget * bg_widget_;
+ /// view's menubar
+ QLMenubar * menubar_;
GuiViewPrivate() : posx_offset(0), posy_offset(0)
{}
GuiView::~GuiView()
{
- menubar_.reset();
+ delete d.menubar_;
delete &d;
}
void GuiView::init()
{
- menubar_.reset(new QLMenubar(this, menubackend));
+ d.menubar_ = new QLMenubar(this, menubackend);
QObject::connect(menuBar(), SIGNAL(triggered(QAction *)),
this, SLOT(updateMenu(QAction *)));
void GuiView::updateMenu(QAction * /*action*/)
{
- menubar_->update();
+ d.menubar_->update();
}
// hidden. This should go here because some dialogs (eg ToC)
// require bv_->text.
getDialogs().updateBufferDependent(true);
- updateMenubar();
updateToolbars();
updateLayoutChoice();
updateWindowTitle();
commandbuffer_->focus_command();
}
+
+void GuiView::openMenu(docstring const & name)
+{
+ d.menubar_->openByName(name);
+}
+
} // namespace frontend
} // namespace lyx
virtual void clearMessage();
virtual bool hasFocus() const;
void showMiniBuffer(bool);
+ void openMenu(docstring const &);
/// show - display the top-level window
void show();