#846 Added Open Last Used Project feature

This commit is contained in:
Magne Sjaastad
2016-10-05 10:42:08 +02:00
parent 98643a7b84
commit d719491a33
9 changed files with 127 additions and 23 deletions

View File

@@ -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");

View File

@@ -140,7 +140,6 @@ private:
private:
// File actions
QAction* m_importGeoMechCaseAction;
QAction* m_openLastUsedProjectAction;
QAction* m_saveProjectAction;
QAction* m_saveProjectAsAction;
QAction* m_closeProjectAction;

View File

@@ -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)
{