mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#846 Added Open Last Used Project feature
This commit is contained in:
@@ -232,8 +232,6 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
void RiuMainWindow::createActions()
|
||||
{
|
||||
// File actions
|
||||
m_openLastUsedProjectAction = new QAction("Open &Last Used Project", this);
|
||||
|
||||
m_importGeoMechCaseAction = new QAction(QIcon(":/GeoMechCase48x48.png"), "Import &Geo Mechanical Model", this);
|
||||
|
||||
m_mockModelAction = new QAction("&Mock Model", this);
|
||||
@@ -257,8 +255,6 @@ void RiuMainWindow::createActions()
|
||||
|
||||
m_exitAction = new QAction("E&xit", this);
|
||||
|
||||
connect(m_openLastUsedProjectAction, SIGNAL(triggered()), SLOT(slotOpenLastUsedProject()));
|
||||
|
||||
connect(m_importGeoMechCaseAction, SIGNAL(triggered()), SLOT(slotImportGeoMechModel()));
|
||||
|
||||
connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel()));
|
||||
@@ -379,7 +375,7 @@ void RiuMainWindow::createMenus()
|
||||
menuBar()->addMenu(fileMenu);
|
||||
|
||||
fileMenu->addAction(cmdFeatureMgr->action("RicOpenProjectFeature"));
|
||||
fileMenu->addAction(m_openLastUsedProjectAction);
|
||||
fileMenu->addAction(cmdFeatureMgr->action("RicOpenLastUsedFileFeature"));
|
||||
fileMenu->addSeparator();
|
||||
|
||||
QMenu* importMenu = fileMenu->addMenu("&Import");
|
||||
|
||||
@@ -140,7 +140,6 @@ private:
|
||||
private:
|
||||
// File actions
|
||||
QAction* m_importGeoMechCaseAction;
|
||||
QAction* m_openLastUsedProjectAction;
|
||||
QAction* m_saveProjectAction;
|
||||
QAction* m_saveProjectAsAction;
|
||||
QAction* m_closeProjectAction;
|
||||
|
||||
@@ -122,20 +122,7 @@ void RiuRecentFileActionProvider::slotOpenRecentFile()
|
||||
if (action)
|
||||
{
|
||||
QString filename = action->data().toString();
|
||||
bool loadingSucceded = false;
|
||||
|
||||
if (filename.contains(".rsp", Qt::CaseInsensitive) || filename.contains(".rip", Qt::CaseInsensitive))
|
||||
{
|
||||
loadingSucceded = RiaApplication::instance()->loadProject(action->data().toString());
|
||||
}
|
||||
else if (filename.contains(".egrid", Qt::CaseInsensitive) || filename.contains(".grid", Qt::CaseInsensitive))
|
||||
{
|
||||
loadingSucceded = RiaApplication::instance()->openEclipseCaseFromFile(filename);
|
||||
}
|
||||
else if (filename.contains(".odb", Qt::CaseInsensitive))
|
||||
{
|
||||
loadingSucceded = RiaApplication::instance()->openOdbCaseFromFile(filename);
|
||||
}
|
||||
bool loadingSucceded = RiaApplication::instance()->openFile(filename);
|
||||
|
||||
if (loadingSucceded)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user