[vlmc-devel] MainWindow: Add a message box if the project path is not found

Michele Valsesia git at videolan.org
Wed Nov 27 16:41:10 CET 2019


vlmc | branch: master | Michele Valsesia <luni-4 at hotmail.it> | Fri Nov 22 16:44:40 2019 +0100| [7e251362ca81a3e575210fa887ac76782f178750] | committer: Michele Valsesia

MainWindow: Add a message box if the project path is not found

> https://code.videolan.org/videolan/vlmc/commit/7e251362ca81a3e575210fa887ac76782f178750
---

 src/Gui/MainWindow.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 022d6ed8..e120f358 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -875,7 +875,17 @@ MainWindow::updateRecentProjects()
                                        );
         connect( action, &QAction::triggered, this, [this, file]()
         {
-            Core::instance()->project()->load( file );
+            if ( QFile::exists( file ) == false )
+            {
+                    QMessageBox::warning( this, tr( "Project file missing" ),
+                                          QStringLiteral( "%1\n%2" )
+                                          .arg( tr( "Sorry, we couldn't find your file. Was it moved, renamed, or deleted?" ) )
+                                          .arg( file ) );
+            }
+            else
+            {
+                    Core::instance()->project()->load( file );
+            }
         } );
     }
     m_ui.actionRecent_Projects->setMenu( menu );



More information about the Vlmc-devel mailing list