Add "Save as new version" action to project menu

Use Shortcut Ctrl+Alt+S. Part of issue #86
This commit is contained in:
Lukas W
2014-01-24 15:45:13 +01:00
parent 5c186eba0e
commit 84a6d0bf02
2 changed files with 23 additions and 0 deletions

View File

@@ -102,6 +102,7 @@ public slots:
void openProject( void );
bool saveProject( void );
bool saveProjectAs( void );
bool saveProjectAsNewVersion( void );
void showSettingsDialog( void );
void aboutLMMS( void );
void help( void );

View File

@@ -243,6 +243,10 @@ void MainWindow::finalize( void )
this, SLOT( saveProject() ),
Qt::CTRL + Qt::Key_S );
project_menu->addAction( embed::getIconPixmap( "project_save" ),
tr( "Save as new &version" ),
this, SLOT( saveProjectAsNewVersion() ),
Qt::CTRL + Qt::ALT + Qt::Key_S );
project_menu->addAction( embed::getIconPixmap( "project_saveas" ),
tr( "Save &As..." ),
this, SLOT( saveProjectAs() ),
@@ -776,6 +780,24 @@ bool MainWindow::saveProjectAs( void )
bool MainWindow::saveProjectAsNewVersion( void )
{
QString fileName = engine::getSong()->projectFileName();
if( fileName == "" )
{
return saveProjectAs();
}
else
{
VersionedSaveDialog::changeFileNameVersion( fileName, true );
engine::getSong()->guiSaveProjectAs( fileName );
return true;
}
}
void MainWindow::showSettingsDialog( void )
{
setupDialog sd;