namespace lyx {\r
namespace frontend {\r
\r
-InsertTableWidget::InsertTableWidget(LyXView & lyxView, FuncRequest const & func, QWidget * parent)\r
- : QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView), func_(func)\r
+InsertTableWidget::InsertTableWidget(LyXView & lyxView, QWidget * parent)\r
+ : QWidget(parent, Qt::Popup), colwidth_(20), rowheight_(12), lyxView_(lyxView)\r
{\r
init();\r
setMouseTracking(true);\r
resetGeometry();\r
}\r
\r
- if (bottom_ != b0 || right_ != r0)\r
+ if (bottom_ != b0 || right_ != r0) {\r
update();\r
-\r
- QString status = QString("%1x%2").arg(bottom_).arg(right_);\r
- QToolTip::showText(event->globalPos(), status , this); \r
+ QString status = QString("%1x%2").arg(bottom_).arg(right_);\r
+ QToolTip::showText(event->globalPos(), status , this);\r
+ }\r
}\r
\r
\r
\r
void InsertTableWidget::updateParent()\r
{\r
- FuncStatus const status = lyxView_.getLyXFunc().getStatus(func_);\r
- parentWidget()->setEnabled(status.enabled());\r
+ bool status = lyxView_.getLyXFunc().getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled();\r
+ parentWidget()->setEnabled(status);\r
}\r
\r
\r
Q_OBJECT\r
public:\r
\r
- InsertTableWidget(LyXView &, FuncRequest const &, QWidget *);\r
+ InsertTableWidget(LyXView &, QWidget *);\r
\r
signals:\r
//! widget is visible\r
int bottom_;\r
//! column of pointer\r
int right_; \r
- //! the tabular_insert funcrequest\r
- FuncRequest const & func_ ;\r
//! the lyxview we need to dispatch the funcrequest\r
LyXView & lyxView_;\r
//! widget under mouse\r
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()));