small cleanup: we don't need to store the funcrequest

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13980 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2006-06-01 20:34:22 +00:00
parent 40783d2ebb
commit 924d8f471c
3 changed files with 10 additions and 12 deletions

View File

@ -31,8 +31,8 @@
namespace lyx { namespace lyx {
namespace frontend { namespace frontend {
InsertTableWidget::InsertTableWidget(LyXView & lyxView, FuncRequest const & func, QWidget * parent) InsertTableWidget::InsertTableWidget(LyXView & lyxView, QWidget * parent)
: QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView), func_(func) : QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView)
{ {
init(); init();
setMouseTracking(true); setMouseTracking(true);
@ -93,11 +93,11 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event)
resetGeometry(); resetGeometry();
} }
if (bottom_ != b0 || right_ != r0) if (bottom_ != b0 || right_ != r0) {
update(); update();
QString status = QString("%1x%2").arg(bottom_).arg(right_); QString status = QString("%1x%2").arg(bottom_).arg(right_);
QToolTip::showText(event->globalPos(), status , this); QToolTip::showText(event->globalPos(), status , this);
}
} }
@ -166,8 +166,8 @@ void InsertTableWidget::drawGrid(int const rows, int const cols, Qt::GlobalColor
void InsertTableWidget::updateParent() void InsertTableWidget::updateParent()
{ {
FuncStatus const status = lyxView_.getLyXFunc().getStatus(func_); bool status = lyxView_.getLyXFunc().getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled();
parentWidget()->setEnabled(status.enabled()); parentWidget()->setEnabled(status);
} }

View File

@ -26,7 +26,7 @@ class InsertTableWidget : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
InsertTableWidget(LyXView &, FuncRequest const &, QWidget *); InsertTableWidget(LyXView &, QWidget *);
signals: signals:
//! widget is visible //! widget is visible
@ -64,8 +64,6 @@ private:
int bottom_; int bottom_;
//! column of pointer //! column of pointer
int right_; int right_;
//! the tabular_insert funcrequest
FuncRequest const & func_ ;
//! the lyxview we need to dispatch the funcrequest //! the lyxview we need to dispatch the funcrequest
LyXView & lyxView_; LyXView & lyxView_;
//! widget under mouse //! widget under mouse

View File

@ -241,7 +241,7 @@ void QLToolbar::add(FuncRequest const & func, string const & tooltip)
tb->setIcon(QPixmap(toqstr(toolbarbackend.getIcon(func)))); tb->setIcon(QPixmap(toqstr(toolbarbackend.getIcon(func))));
tb->setToolTip(toqstr(tooltip)); tb->setToolTip(toqstr(tooltip));
tb->setFocusPolicy(Qt::NoFocus); tb->setFocusPolicy(Qt::NoFocus);
InsertTableWidget * iv = new InsertTableWidget(owner_, func, tb); InsertTableWidget * iv = new InsertTableWidget(owner_, tb);
connect(tb, SIGNAL(toggled(bool)), iv, SLOT(show(bool))); connect(tb, SIGNAL(toggled(bool)), iv, SLOT(show(bool)));
connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool))); connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool)));
connect(this, SIGNAL(updated()), iv, SLOT(updateParent())); connect(this, SIGNAL(updated()), iv, SLOT(updateParent()));