Skip to content

Commit

Permalink
Minor fixes. Do not comment out MainWindow::storePlotWindowsStateAndG…
Browse files Browse the repository at this point in the history
…eometry().
  • Loading branch information
adeas31 committed Sep 16, 2016
1 parent 549addf commit 54c5148
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
47 changes: 19 additions & 28 deletions OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -151,7 +151,6 @@ MainWindow::MainWindow(QSplashScreen *pSplashScreen, bool debug, QWidget *parent
QShortcut *pPlottingShortcut = new QShortcut(QKeySequence("Ctrl+f3"), this);
connect(pPlottingShortcut, SIGNAL(activated()), SLOT(switchToPlottingPerspectiveSlot()));
mpPerspectiveTabbar->setTabToolTip(2, tr("Changes to plotting perspective (%1)").arg(pPlottingShortcut->key().toString()));

// algorithmic debugging perspective
mpPerspectiveTabbar->addTab(QIcon(":/Resources/icons/debugger.svg"), tr("Debugging"));
QShortcut *pAlgorithmicDebuggingShortcut = new QShortcut(QKeySequence("Ctrl+f5"), this);
Expand Down Expand Up @@ -1986,8 +1985,8 @@ void MainWindow::openUsersGuide()
.append("/share/doc/omc/OpenModelicaUsersGuide/index.html"));
if (!QDesktopServices::openUrl(usersGuidePath)) {
mpMessagesWidget->addGUIMessage(MessageItem(MessageItem::Modelica, "", false, 0, 0, 0, 0,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

Expand All @@ -2002,8 +2001,8 @@ void MainWindow::openUsersGuidePdf()
.append("/share/doc/omc/OpenModelicaUsersGuide-latest.pdf"));
if (!QDesktopServices::openUrl(usersGuidePath)) {
mpMessagesWidget->addGUIMessage(MessageItem(MessageItem::Modelica, "", false, 0, 0, 0, 0,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

Expand All @@ -2018,8 +2017,8 @@ void MainWindow::openUsersGuideOldPdf()
.append("/share/doc/omc/OpenModelicaUsersGuide.pdf"));
if (!QDesktopServices::openUrl(usersGuidePath)) {
mpMessagesWidget->addGUIMessage(MessageItem(MessageItem::Modelica, "", false, 0, 0, 0, 0,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

Expand Down Expand Up @@ -2292,8 +2291,6 @@ void MainWindow::switchToPlottingPerspectiveSlot()
mpPerspectiveTabbar->setCurrentIndex(2);
}



/*!
* \brief MainWindow::switchToAlgorithmicDebuggingPerspectiveSlot
* Slot activated when Ctrl+f5 is clicked.
Expand Down Expand Up @@ -2581,7 +2578,7 @@ void MainWindow::createActions()
mpImportFromOMNotebookAction = new QAction(QIcon(":/Resources/icons/import-omnotebook.svg"), Helper::importFromOMNotebook, this);
mpImportFromOMNotebookAction->setStatusTip(Helper::importFromOMNotebookTip);
connect(mpImportFromOMNotebookAction, SIGNAL(triggered()), SLOT(importModelfromOMNotebook()));
// import ngspice netlist action
// import ngspice netlist action
mpImportNgspiceNetlistAction = new QAction(Helper::importNgspiceNetlist, this);
mpImportNgspiceNetlistAction->setStatusTip(Helper::importNgspiceNetlistTip);
connect(mpImportNgspiceNetlistAction, SIGNAL(triggered()), SLOT(importNgspiceNetlist()));
Expand Down Expand Up @@ -2695,9 +2692,9 @@ void MainWindow::createActions()
mpNewParametricPlotWindowAction->setStatusTip(tr("Inserts new parametric plot window"));
connect(mpNewParametricPlotWindowAction, SIGNAL(triggered()), mpPlotWindowContainer, SLOT(addParametricPlotWindow()));
// new mpAnimationWindowAction plot action
mpAnimationWindowAction = new QAction(QIcon(":/Resources/icons/animation.png"), tr("New Animation Window"), this);
mpAnimationWindowAction->setStatusTip(tr("Inserts new animation window"));
connect(mpAnimationWindowAction, SIGNAL(triggered()), mpPlotWindowContainer, SLOT(addAnimationWindow()));
mpNewAnimationWindowAction = new QAction(QIcon(":/Resources/icons/animation.png"), tr("New Animation Window"), this);
mpNewAnimationWindowAction->setStatusTip(tr("Inserts new animation window"));
connect(mpNewAnimationWindowAction, SIGNAL(triggered()), mpPlotWindowContainer, SLOT(addAnimationWindow()));
// export variables action
mpExportVariablesAction = new QAction(QIcon(":/Resources/icons/export-variables.svg"), Helper::exportVariables, this);
mpExportVariablesAction->setStatusTip(tr("Exports the plotted variables to a CSV file"));
Expand Down Expand Up @@ -2796,9 +2793,9 @@ void MainWindow::createMenus()
pEditMenu->addAction(mpRedoAction);
pEditMenu->addSeparator();
pEditMenu->addAction(mpSearchClassesAction);
// pEditMenu->addAction(mpCutAction);
// pEditMenu->addAction(mpCopyAction);
// pEditMenu->addAction(mpPasteAction);
// pEditMenu->addAction(mpCutAction);
// pEditMenu->addAction(mpCopyAction);
// pEditMenu->addAction(mpPasteAction);
// add Edit menu to menu bar
menuBar()->addAction(pEditMenu->menuAction());
// View menu
Expand Down Expand Up @@ -2954,13 +2951,13 @@ void MainWindow::autoSaveHelper(LibraryTreeItem *pLibraryTreeItem)
* the plot windows states & geometry and then restore it when switching back to plotting view.
*/
void MainWindow::storePlotWindowsStateAndGeometry()
{/*
{
if (mPlotWindowsStatesList.isEmpty() && mPlotWindowsGeometriesList.isEmpty()) {
foreach (QMdiSubWindow *pWindow, mpPlotWindowContainer->subWindowList()) {
mPlotWindowsStatesList.append(pWindow->windowState());
mPlotWindowsGeometriesList.append(pWindow->saveGeometry());
}
}*/
}
}

/*!
Expand Down Expand Up @@ -3007,7 +3004,6 @@ void MainWindow::switchToModelingPerspective()
mpModelWidgetContainer->currentModelWidgetChanged(mpModelWidgetContainer->getCurrentMdiSubWindow());
mpVariablesDockWidget->hide();
mpPlotToolBar->setEnabled(false);

// In case user has tabbed the dock widgets then make LibraryWidget active.
QList<QDockWidget*> tabifiedDockWidgetsList = tabifiedDockWidgets(mpLibraryDockWidget);
if (tabifiedDockWidgetsList.size() > 0) {
Expand Down Expand Up @@ -3039,7 +3035,6 @@ void MainWindow::switchToPlottingPerspective()
}
mpCentralStackedWidget->setCurrentWidget(mpPlotWindowContainer);
int i = 0;

foreach (QMdiSubWindow *pWindow, mpPlotWindowContainer->subWindowList()) {
// sanity check
if (mPlotWindowsStatesList.size() > i && mPlotWindowsGeometriesList.size() > i) {
Expand All @@ -3048,7 +3043,6 @@ void MainWindow::switchToPlottingPerspective()
}
i++;
}

mPlotWindowsStatesList.clear();
mPlotWindowsGeometriesList.clear();
mpModelWidgetContainer->currentModelWidgetChanged(0);
Expand Down Expand Up @@ -3098,7 +3092,6 @@ void MainWindow::switchToAlgorithmicDebuggingPerspective()
mpGDBLoggerDockWidget->show();
}


/*!
* \brief MainWindow::closeAllWindowsButThis
* Closes all windows except the active window.
Expand Down Expand Up @@ -3191,9 +3184,9 @@ void MainWindow::createToolbars()
// add actions to edit toolbar
mpEditToolBar->addAction(mpUndoAction);
mpEditToolBar->addAction(mpRedoAction);
// mpEditToolBar->addAction(mpCutAction);
// mpEditToolBar->addAction(mpCopyAction);
// mpEditToolBar->addAction(mpPasteAction);
// mpEditToolBar->addAction(mpCutAction);
// mpEditToolBar->addAction(mpCopyAction);
// mpEditToolBar->addAction(mpPasteAction);
// View Toolbar
mpViewToolBar = addToolBar(tr("View Toolbar"));
mpViewToolBar->setObjectName("View Toolbar");
Expand Down Expand Up @@ -3257,7 +3250,7 @@ void MainWindow::createToolbars()
mpPlotToolBar->addSeparator();
mpPlotToolBar->addAction(mpNewPlotWindowAction);
mpPlotToolBar->addAction(mpNewParametricPlotWindowAction);
mpPlotToolBar->addAction(mpAnimationWindowAction);
mpPlotToolBar->addAction(mpNewAnimationWindowAction);
mpPlotToolBar->addSeparator();
mpPlotToolBar->addAction(mpExportVariablesAction);
mpPlotToolBar->addSeparator();
Expand All @@ -3275,7 +3268,6 @@ void MainWindow::createToolbars()
mpTLMSimulationToolbar->addAction(mpTLMCoSimulationAction);
}


//! when the dragged object enters the main window
//! @param event contains information of the drag operation.
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
Expand Down Expand Up @@ -3478,4 +3470,3 @@ void AboutOMEditWidget::keyPressEvent(QKeyEvent *pEvent)
}
QWidget::keyPressEvent(pEvent);
}

2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/MainWindow.h
Expand Up @@ -341,7 +341,7 @@ class MainWindow : public QMainWindow
QAction *mpReSimulateSetupAction;
QAction *mpNewPlotWindowAction;
QAction *mpNewParametricPlotWindowAction;
QAction *mpAnimationWindowAction;
QAction *mpNewAnimationWindowAction;
QAction *mpClearPlotWindowAction;
QAction *mpExportVariablesAction;
// Other Actions
Expand Down

0 comments on commit 54c5148

Please sign in to comment.