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 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);
}

View File

@ -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

View File

@ -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()));