Commit f9dcc6ef authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MainWindow: Show the wizard when no project parameter is passed.

Before this, ./vlmc -vvv would have not show the wizard.
parent 5e2f23c8
...@@ -143,13 +143,6 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -143,13 +143,6 @@ MainWindow::MainWindow( QWidget *parent ) :
restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() ); restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() );
// Restore the layout // Restore the layout
restoreState( s.value( "MainWindowState" ).toByteArray() ); restoreState( s.value( "MainWindowState" ).toByteArray() );
if ( s.value( "ShowWizardStartup", true ).toBool() )
{
//If a project was opened from the command line: don't show the wizard.
if ( qApp->arguments().size() == 1 )
m_pWizard->show();
}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
...@@ -160,6 +153,15 @@ MainWindow::~MainWindow() ...@@ -160,6 +153,15 @@ MainWindow::~MainWindow()
LibVLCpp::Instance::destroyInstance(); LibVLCpp::Instance::destroyInstance();
} }
void
MainWindow::showWizard()
{
QSettings s;
if ( s.value( "ShowWizardStartup", true ).toBool() )
m_pWizard->show();
}
void void
MainWindow::changeEvent( QEvent *e ) MainWindow::changeEvent( QEvent *e )
{ {
......
...@@ -52,6 +52,7 @@ public: ...@@ -52,6 +52,7 @@ public:
~MainWindow(); ~MainWindow();
void registerWidgetInWindowMenu( QDockWidget* widget ); void registerWidgetInWindowMenu( QDockWidget* widget );
void showWizard();
public slots: public slots:
void zoomIn(); void zoomIn();
......
...@@ -115,6 +115,7 @@ VLMCmain( int argc, char **argv ) ...@@ -115,6 +115,7 @@ VLMCmain( int argc, char **argv )
MainWindow w; MainWindow w;
/* Check for project file */ /* Check for project file */
bool project = false;
for ( int i = 1; i < argc; i++ ) for ( int i = 1; i < argc; i++ )
{ {
QString arg = argv[i]; QString arg = argv[i];
...@@ -122,10 +123,13 @@ VLMCmain( int argc, char **argv ) ...@@ -122,10 +123,13 @@ VLMCmain( int argc, char **argv )
if ( argc > ( i + 1 ) && ( arg == "--project" || arg == "-p" ) ) if ( argc > ( i + 1 ) && ( arg == "--project" || arg == "-p" ) )
{ {
GUIProjectManager::getInstance()->loadProject( argv[i+1] ); GUIProjectManager::getInstance()->loadProject( argv[i+1] );
project = true;
break; break;
} }
} }
//Don't show the wizard if a project has been passed through command line.
if ( project == false )
w.showWizard();
w.show(); w.show();
return app.exec(); return app.exec();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment