4 * John Levon, moz@compsoc.man.ac.uk
7 /***************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 ***************************************************************************/
18 #include "tabcreatedlg.h"
20 #include "FormTabularCreate.h"
22 #include "QtLyXView.h"
23 #include "BufferView.h"
24 #include "insets/insettabular.h"
25 #include "support/lstrings.h"
27 FormTabularCreate::FormTabularCreate(LyXView *v, Dialogs *d)
28 : dialog_(0), lv_(v), d_(d), h_(0)
30 // let the dialog be shown
31 // This is a permanent connection so we won't bother
32 // storing a copy because we won't be disconnecting.
33 d->showTabularCreate.connect(slot(this, &FormTabularCreate::show));
36 FormTabularCreate::~FormTabularCreate()
41 void FormTabularCreate::apply(unsigned int rows, unsigned cols)
43 if (!lv_->view()->available())
46 string tmp = tostr(rows) + " " + tostr(cols);
47 lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp);
50 void FormTabularCreate::show()
53 dialog_ = new TabularCreateDialog(this, 0, _("LyX: Insert Table"));
55 if (!dialog_->isVisible()) {
56 h_ = d_->hideBufferDependent.connect(slot(this, &FormTabularCreate::hide));
60 dialog_->setActiveWindow();
66 void FormTabularCreate::close()
71 void FormTabularCreate::hide()