-----------------------------------------------------------------------------
| 28 | |
| 29 | //----------------------------------------------------------------------------- |
| 30 | pqPythonScriptEditor::pqPythonScriptEditor(QWidget* p) |
| 31 | : QMainWindow(p) |
| 32 | , TabWidget(new pqPythonTabWidget(this)) |
| 33 | , PythonManager(nullptr) |
| 34 | { |
| 35 | this->setCentralWidget(TabWidget); |
| 36 | |
| 37 | this->createMenus(); |
| 38 | |
| 39 | this->resize(300, 450); |
| 40 | |
| 41 | pqApplicationCore::instance()->settings()->restoreState("PythonScriptEditor", *this); |
| 42 | vtkPythonInterpreter::Initialize(); |
| 43 | |
| 44 | this->setWindowTitle(tr("ParaView Python Script Editor")); |
| 45 | |
| 46 | this->connect(this->TabWidget, &pqPythonTabWidget::fileSaved, |
| 47 | [this](const QString& filename) |
| 48 | { |
| 49 | this->setWindowTitle( |
| 50 | tr("%1[*] - %2").arg(details::stripFilename(filename)).arg(tr("Script Editor"))); |
| 51 | this->statusBar()->showMessage(tr("File %1 saved").arg(filename), 4000); |
| 52 | }); |
| 53 | |
| 54 | this->connect(this->TabWidget, &pqPythonTabWidget::fileOpened, |
| 55 | [this](const QString& filename) |
| 56 | { |
| 57 | this->setWindowTitle( |
| 58 | tr("%1[*] - %2").arg(details::stripFilename(filename)).arg(tr("Script Editor"))); |
| 59 | this->statusBar()->showMessage(tr("File %1 opened").arg(filename), 4000); |
| 60 | }); |
| 61 | |
| 62 | connect(this->TabWidget, &QTabWidget::currentChanged, |
| 63 | [this]() { this->TabWidget->updateActions(this->Actions); }); |
| 64 | |
| 65 | this->TabWidget->connectActions(this->Actions); |
| 66 | this->TabWidget->updateActions(this->Actions); |
| 67 | pqPythonEditorActions::connect(this->Actions, this); |
| 68 | |
| 69 | // monitor parent's events so we can intercept the close event |
| 70 | if (p) |
| 71 | { |
| 72 | p->installEventFilter(this); |
| 73 | } |
| 74 | |
| 75 | this->createStatusBar(); |
| 76 | } |
| 77 | |
| 78 | //----------------------------------------------------------------------------- |
| 79 | void pqPythonScriptEditor::runCurrentTab() |
nothing calls this directly
no test coverage detected