[vlmc-devel] [PATCH] WelcomePage: Add QMessageBox noticing user when project file is not found

Hieu Pham phamhuuquanghieu at gmail.com
Sun Mar 12 22:12:41 CET 2017


---
 src/Gui/wizard/WelcomePage.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/Gui/wizard/WelcomePage.cpp b/src/Gui/wizard/WelcomePage.cpp
index 0b95dc1..1830a24 100644
--- a/src/Gui/wizard/WelcomePage.cpp
+++ b/src/Gui/wizard/WelcomePage.cpp
@@ -105,6 +105,19 @@ WelcomePage::validatePage()
                                       tr( "You first need to select a project from "
                                       "the list.\nThen click next to continue..." ) );
             return false;
+        }        
+        else
+        {
+            QFile* m_projectFile = new QFile( *m_projectPath );
+            if ( !m_projectFile->open( QFile::ReadOnly ) )
+            {
+                QMessageBox msgBox;
+                msgBox.setText( QObject::tr( "Sorry, we couldn't find your file. Was it moved, renamed, or deleted?" ) );
+                msgBox.setInformativeText( QObject::tr( m_projectPath->toUtf8() ) );
+                msgBox.setDefaultButton( QMessageBox::Ok );
+                msgBox.exec();
+                return false;
+            }
         }
         return true;
     }
-- 
2.9.3



More information about the Vlmc-devel mailing list