Put LyXView on a diet, step 2: Transfer ControlCommandBuffer handling from LyXView to QCommandBuffer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19753 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-23 13:20:01 +00:00
parent 5e5f824376
commit c7d83abbac
5 changed files with 8 additions and 20 deletions

View File

@ -38,8 +38,6 @@
#include "MenuBackend.h"
#include "Paragraph.h"
#include "controllers/ControlCommandBuffer.h"
#include "support/lstrings.h"
#include "support/filetools.h" // OnlyFilename()
#include "support/Timeout.h"
@ -72,7 +70,7 @@ LyXView::LyXView(int id)
: toolbars_(new Toolbars(*this)),
autosave_timeout_(new Timeout(5000)),
dialogs_(new Dialogs(*this)),
controlcommand_(new ControlCommandBuffer(*this)), id_(id)
id_(id)
{
// Start autosave timer
if (lyxrc.autosave) {

View File

@ -39,7 +39,6 @@ class Timeout;
namespace frontend {
class ControlCommandBuffer;
class Dialogs;
class WorkArea;
@ -257,14 +256,6 @@ protected:
///
void updateToc();
/// view's command buffer controller
// this has to be declared _after_ lyxfunc_ as its initialization depends
// on it!
typedef boost::scoped_ptr<ControlCommandBuffer>
CommandBufferPtr;
CommandBufferPtr const controlcommand_;
private:
int id_;
};

View File

@ -572,7 +572,7 @@ void GuiView::setWindowTitle(docstring const & t, docstring const & it)
void GuiView::addCommandBuffer(QToolBar * toolbar)
{
commandbuffer_ = new QCommandBuffer(this, *controlcommand_);
commandbuffer_ = new QCommandBuffer(this);
toolbar->addWidget(commandbuffer_);
}

View File

@ -18,8 +18,6 @@
#include "QCommandEdit.h"
#include "qt_helpers.h"
#include "controllers/ControlCommandBuffer.h"
#include "support/filetools.h"
#include <QHBoxLayout>
@ -77,8 +75,8 @@ protected:
} // end of anon
QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control)
: view_(view), controller_(control)
QCommandBuffer::QCommandBuffer(GuiView * view)
: view_(view), controller_(*view)
{
QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm").absFilename()));
QPixmap qpdown(toqstr(libFileSearch("images", "down", "xpm").absFilename()));

View File

@ -12,6 +12,8 @@
#ifndef QCOMMANDBUFFER_H
#define QCOMMANDBUFFER_H
#include "controllers/ControlCommandBuffer.h"
#include <QWidget>
class QListWidgetItem;
@ -21,12 +23,11 @@ namespace frontend {
class QCommandEdit;
class GuiView;
class ControlCommandBuffer;
class QCommandBuffer : public QWidget {
Q_OBJECT
public:
QCommandBuffer(GuiView * view, ControlCommandBuffer & control);
QCommandBuffer(GuiView * view);
/// focus the edit widget
void focus_command();
@ -50,7 +51,7 @@ private:
GuiView * view_;
/// controller
ControlCommandBuffer & controller_;
ControlCommandBuffer controller_;
/// command widget
QCommandEdit * edit_;