mirror of
https://github.com/LMMS/lmms.git
synced 2026-04-01 21:04:18 -04:00
Added an option to save a project as the default template
A new option to save a project as the default template is now available in the file menu. If the default template already exists the user is asked whether he wants to overwrite it.
This commit is contained in:
@@ -277,6 +277,9 @@ void MainWindow::finalize()
|
||||
this, SLOT( saveProjectAsNewVersion() ),
|
||||
Qt::CTRL + Qt::ALT + Qt::Key_S );
|
||||
|
||||
project_menu->addAction( tr( "Save as default template" ),
|
||||
this, SLOT( saveProjectAsDefaultTemplate() ) );
|
||||
|
||||
project_menu->addSeparator();
|
||||
project_menu->addAction( embed::getIconPixmap( "project_import" ),
|
||||
tr( "Import..." ),
|
||||
@@ -933,6 +936,29 @@ bool MainWindow::saveProjectAsNewVersion()
|
||||
|
||||
|
||||
|
||||
void MainWindow::saveProjectAsDefaultTemplate()
|
||||
{
|
||||
QString defaultTemplate = ConfigManager::inst()->userTemplateDir() + "default.mpt";
|
||||
|
||||
QFileInfo fileInfo(defaultTemplate);
|
||||
if (fileInfo.exists())
|
||||
{
|
||||
if (QMessageBox::warning(this,
|
||||
tr("Overwrite default template?"),
|
||||
tr("This will overwrite your current default template."),
|
||||
QMessageBox::Ok,
|
||||
QMessageBox::Cancel) != QMessageBox::Ok)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Engine::getSong()->saveProjectFile( defaultTemplate );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void MainWindow::showSettingsDialog()
|
||||
{
|
||||
SetupDialog sd;
|
||||
|
||||
Reference in New Issue
Block a user