| 285 | } |
| 286 | |
| 287 | QWidget* Notebook::view() const { |
| 288 | #ifndef SDK |
| 289 | if (!m_partView) { |
| 290 | m_view = new NotebookView(const_cast<Notebook*>(this)); |
| 291 | m_view->setBaseSize(1500, 1500); |
| 292 | m_partView = m_view; |
| 293 | connect(this, &Notebook::viewAboutToBeDeleted, [this]() { |
| 294 | m_view = nullptr; |
| 295 | }); |
| 296 | // connect(m_view, SIGNAL(statusInfo(QString)), this, SIGNAL(statusInfo(QString))); |
| 297 | |
| 298 | // set the current path in the session to the path of the project file |
| 299 | #ifdef HAVE_CANTOR_LIBS |
| 300 | if (m_session) { |
| 301 | const Project* project = const_cast<Notebook*>(this)->project(); |
| 302 | const QString& fileName = project->fileName(); |
| 303 | if (!fileName.isEmpty()) { |
| 304 | QFileInfo fi(fileName); |
| 305 | m_session->setWorksheetPath(fi.filePath()); |
| 306 | } |
| 307 | } |
| 308 | #endif |
| 309 | } |
| 310 | #endif |
| 311 | return m_partView; |
| 312 | } |
| 313 | |
| 314 | //! Return a new context menu. |
| 315 | /** |