| 120 | } |
| 121 | |
| 122 | void |
| 123 | Gui::openRecentFile() |
| 124 | { |
| 125 | QAction *action = qobject_cast<QAction *>( sender() ); |
| 126 | |
| 127 | if (action) { |
| 128 | QFileInfo f( action->data().toString() ); |
| 129 | QString path = f.path() + QLatin1Char('/'); |
| 130 | QString filename = path + f.fileName(); |
| 131 | int openedProject = appPTR->isProjectAlreadyOpened( filename.toStdString() ); |
| 132 | if (openedProject != -1) { |
| 133 | AppInstancePtr instance = appPTR->getAppInstance(openedProject); |
| 134 | if (instance) { |
| 135 | GuiAppInstance* guiApp = dynamic_cast<GuiAppInstance*>( instance.get() ); |
| 136 | assert(guiApp); |
| 137 | if (guiApp) { |
| 138 | guiApp->getGui()->activateWindow(); |
| 139 | |
| 140 | return; |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | ///if the current graph has no value, just load the project in the same window |
| 146 | if ( getApp()->getProject()->isGraphWorthLess() ) { |
| 147 | getApp()->getProject()->loadProject( path, f.fileName() ); |
| 148 | } else { |
| 149 | CLArgs cl; |
| 150 | AppInstancePtr newApp = appPTR->newAppInstance(cl, false); |
| 151 | newApp->getProject()->loadProject( path, f.fileName() ); |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | void |
| 157 | Gui::updateRecentFileActions() |
nothing calls this directly
no test coverage detected