From 924d8f471cbcd2ab13b4fd924601823456351886 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Thu, 1 Jun 2006 20:34:22 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/InsertTableWidget.C | 16 ++++++++-------- src/frontends/qt4/InsertTableWidget.h | 4 +--- src/frontends/qt4/QLToolbar.C | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/InsertTableWidget.C b/src/frontends/qt4/InsertTableWidget.C index 94c61aa2eb..270bf3820e 100644 --- a/src/frontends/qt4/InsertTableWidget.C +++ b/src/frontends/qt4/InsertTableWidget.C @@ -31,8 +31,8 @@ namespace lyx { namespace frontend { -InsertTableWidget::InsertTableWidget(LyXView & lyxView, FuncRequest const & func, QWidget * parent) - : QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView), func_(func) +InsertTableWidget::InsertTableWidget(LyXView & lyxView, QWidget * parent) + : QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView) { init(); setMouseTracking(true); @@ -93,11 +93,11 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event) resetGeometry(); } - if (bottom_ != b0 || right_ != r0) + if (bottom_ != b0 || right_ != r0) { update(); - - QString status = QString("%1x%2").arg(bottom_).arg(right_); - QToolTip::showText(event->globalPos(), status , this); + QString status = QString("%1x%2").arg(bottom_).arg(right_); + QToolTip::showText(event->globalPos(), status , this); + } } @@ -166,8 +166,8 @@ void InsertTableWidget::drawGrid(int const rows, int const cols, Qt::GlobalColor void InsertTableWidget::updateParent() { - FuncStatus const status = lyxView_.getLyXFunc().getStatus(func_); - parentWidget()->setEnabled(status.enabled()); + bool status = lyxView_.getLyXFunc().getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled(); + parentWidget()->setEnabled(status); } diff --git a/src/frontends/qt4/InsertTableWidget.h b/src/frontends/qt4/InsertTableWidget.h index e3fc0f553d..c055048290 100644 --- a/src/frontends/qt4/InsertTableWidget.h +++ b/src/frontends/qt4/InsertTableWidget.h @@ -26,7 +26,7 @@ class InsertTableWidget : public QWidget { Q_OBJECT public: - InsertTableWidget(LyXView &, FuncRequest const &, QWidget *); + InsertTableWidget(LyXView &, QWidget *); signals: //! widget is visible @@ -64,8 +64,6 @@ private: int bottom_; //! column of pointer int right_; - //! the tabular_insert funcrequest - FuncRequest const & func_ ; //! the lyxview we need to dispatch the funcrequest LyXView & lyxView_; //! widget under mouse diff --git a/src/frontends/qt4/QLToolbar.C b/src/frontends/qt4/QLToolbar.C index 945edbe796..f1d10affe3 100644 --- a/src/frontends/qt4/QLToolbar.C +++ b/src/frontends/qt4/QLToolbar.C @@ -241,7 +241,7 @@ void QLToolbar::add(FuncRequest const & func, string const & tooltip) tb->setIcon(QPixmap(toqstr(toolbarbackend.getIcon(func)))); tb->setToolTip(toqstr(tooltip)); 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(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool))); connect(this, SIGNAL(updated()), iv, SLOT(updateParent())); -- 2.39.5