Changeset 14f3280 in OpenModelica
- Timestamp:
- 2016-07-01T00:55:43+02:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 612047b
- Parents:
- 4de91514
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditGUI/MainWindow.cpp
r86dd3e9 r14f3280 63 63 * Don't remove/move the following lines. 64 64 * Because RecentFile, FindTextOM and DebuggerConfiguration structs should be registered before reading the recentFilesList, FindTextOM and 65 65 * DebuggerConfiguration section respectively from the settings file. 66 66 */ 67 67 qRegisterMetaTypeStreamOperators<RecentFile>("RecentFile"); … … 251 251 createToolbars(); 252 252 createMenus(); 253 // Create simulation dialog 254 mpSimulationDialog = new SimulationDialog(this);255 // Create TLM co-simulation dialog 256 mpTLMCoSimulationDialog = new TLMCoSimulationDialog(this);253 // Create simulation dialog when needed 254 mpSimulationDialog = 0; 255 // Create TLM co-simulation dialog when needed 256 mpTLMCoSimulationDialog = 0; 257 257 // Create an object of ModelWidgetContainer 258 258 mpModelWidgetContainer = new ModelWidgetContainer(this); … … 260 260 mpWelcomePageWidget = new WelcomePageWidget(this); 261 261 updateRecentFileActions(); 262 // create the OMEdit About widget 263 mpAboutOMEditDialog = new AboutOMEditWidget(this); 264 mpAboutOMEditDialog->hide(); 262 // create the OMEdit About widget when needed 263 mpAboutOMEditDialog = 0; 265 264 // create an instance of InfoBar 266 265 mpInfoBar = new InfoBar(this); … … 455 454 delete mpOMCProxy; 456 455 delete mpModelWidgetContainer; 457 delete mpSimulationDialog; 458 delete mpTLMCoSimulationDialog; 456 if (mpSimulationDialog) { 457 delete mpSimulationDialog; 458 } 459 if (mpTLMCoSimulationDialog) { 460 delete mpTLMCoSimulationDialog; 461 } 462 if (mpAboutOMEditDialog) { 463 delete mpAboutOMEditDialog; 464 } 459 465 /* save the TransformationsWidget last window geometry and splitters state. */ 460 466 QSettings *pSettings = Utilities::getApplicationSettings(); … … 552 558 void MainWindow::simulate(LibraryTreeItem *pLibraryTreeItem) 553 559 { 560 if (!mpSimulationDialog) { 561 mpSimulationDialog = new SimulationDialog(this); 562 } 554 563 /* if Modelica text is changed manually by user then validate it before saving. */ 555 564 if (pLibraryTreeItem->getModelWidget()) { … … 563 572 void MainWindow::simulateWithTransformationalDebugger(LibraryTreeItem *pLibraryTreeItem) 564 573 { 574 if (!mpSimulationDialog) { 575 mpSimulationDialog = new SimulationDialog(this); 576 } 565 577 /* if Modelica text is changed manually by user then validate it before saving. */ 566 578 if (pLibraryTreeItem->getModelWidget()) { … … 574 586 void MainWindow::simulateWithAlgorithmicDebugger(LibraryTreeItem *pLibraryTreeItem) 575 587 { 588 if (!mpSimulationDialog) { 589 mpSimulationDialog = new SimulationDialog(this); 590 } 576 591 /* if Modelica text is changed manually by user then validate it before saving. */ 577 592 if (pLibraryTreeItem->getModelWidget()) { … … 585 600 void MainWindow::simulationSetup(LibraryTreeItem *pLibraryTreeItem) 586 601 { 602 if (!mpSimulationDialog) { 603 mpSimulationDialog = new SimulationDialog(this); 604 } 587 605 /* if Modelica text is changed manually by user then validate it before saving. */ 588 606 if (pLibraryTreeItem->getModelWidget()) { … … 802 820 void MainWindow::TLMSimulate(LibraryTreeItem *pLibraryTreeItem) 803 821 { 822 if (!mpTLMCoSimulationDialog) { 823 mpTLMCoSimulationDialog = new TLMCoSimulationDialog(this); 824 } 804 825 /* if MetaModel text is changed manually by user then validate it before starting the TLM co-simulation. */ 805 826 if (pLibraryTreeItem->getModelWidget()) { … … 2030 2051 void MainWindow::openAboutOMEdit() 2031 2052 { 2053 if (!mpAboutOMEditDialog) { 2054 mpAboutOMEditDialog = new AboutOMEditWidget(this); 2055 } 2032 2056 mpAboutOMEditDialog->setGeometry(QRect(rect().center() - QPoint(262, 235), rect().center() + QPoint(262, 235))); 2033 2057 mpAboutOMEditDialog->setFocus(Qt::ActiveWindowFocusReason); … … 3293 3317 3294 3318 /*! 3295 \class AboutOMEditWidget 3296 \brief Creates a widget that shows the about text of OMEdit. 3297 3298 Information about OpenModelica Connection Editor. Shows the list of OMEdit contributors. 3299 */ 3300 3301 /*! 3302 \param pParent - pointer to MainWindow 3303 */ 3319 * \class AboutOMEditWidget 3320 * \brief Creates a widget that shows the about text of OMEdit. 3321 * Information about OpenModelica Connection Editor. Shows the list of OMEdit contributors. 3322 */ 3323 /*! 3324 * \brief AboutOMEditWidget::AboutOMEditWidget 3325 * \param pParent - pointer to MainWindow 3326 */ 3304 3327 AboutOMEditWidget::AboutOMEditWidget(MainWindow *pMainWindow) 3305 3328 : QWidget(pMainWindow) … … 3380 3403 // set the layout 3381 3404 QGridLayout *pMainLayout = new QGridLayout; 3382 pMainLayout->setContentsMargins( 45, 200, 45, 20);3405 pMainLayout->setContentsMargins(25, 200, 25, 20); 3383 3406 pMainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); 3384 3407 pMainLayout->addWidget(pScrollArea, 0, 0); … … 3388 3411 3389 3412 /*! 3390 Reimplementation of paintEvent.\n 3391 Draws the background image. 3392 \param event - pointer to QPaintEvent 3393 */ 3413 * \brief AboutOMEditWidget::paintEvent 3414 * Reimplementation of paintEvent.\n 3415 * Draws the background image. 3416 * \param event - pointer to QPaintEvent 3417 */ 3394 3418 void AboutOMEditWidget::paintEvent(QPaintEvent *pEvent) 3395 3419 { … … 3401 3425 3402 3426 /*! 3403 Reimplementation of keyPressEvent.\n 3404 Hides the widget. 3405 */ 3427 * \brief AboutOMEditWidget::keyPressEvent 3428 * Reimplementation of keyPressEvent.\n 3429 * Hides the widget when ESC key is pressed. 3430 * \param pEvent 3431 */ 3406 3432 void AboutOMEditWidget::keyPressEvent(QKeyEvent *pEvent) 3407 3433 { 3408 if (pEvent->key() == Qt::Key_Escape) 3434 if (pEvent->key() == Qt::Key_Escape) { 3409 3435 hide(); 3436 } 3410 3437 QWidget::keyPressEvent(pEvent); 3411 3438 }
Note: See TracChangeset
for help on using the changeset viewer.