Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes to recent files #3621

Merged
merged 7 commits into from Jun 10, 2017
Merged

Conversation

@zonkmachine
Copy link
Member

@zonkmachine zonkmachine commented Jun 9, 2017

The recent file system feels a bit glitchy. If you work with a saved file and then start a new project, or a new project from template that you decide to scratch, the next time you launch LMMS you will get back the previous saved work again. I find this a bit unintuitive as you've done other work in between.


Fixes

  • If the last project was a template we create a new project.
  • If there is a recovery file present and you discard it we create a new project. The project launched could be defective or, if .lmmsrc.xml wasn't written, an earlier project.
  • Add a factory default data/projects/templates/default.mpt. Fixes #528
@zonkmachine zonkmachine added this to the 1.2.0 milestone Jun 9, 2017
@zonkmachine zonkmachine added this to In Progress in Release 1.2.0 RC4 Jun 9, 2017
@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Jun 9, 2017

  • if the last project was a template we create a new project. ( This PR )

Works fine. Clears the action up good. Some more testing and I'll merge this later.

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Jun 9, 2017

  • if the last project was a template we create a new project. ( This PR )

Seem to be fixed for when you create project from a template but not when the project is the default.mpt .

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Jun 10, 2017

  • if the last project was a template we create a new project. ( This PR )

Seem to be fixed for when you create project from a template but not when the project is the default.mpt .

No. It works if you save a project as default project. Song::createNewProject() first tries to find default.mpt in your templates directory. Next it looks in factoryProjectsDir() and this it cant find because there seem to be no default.mpt among the factory templates, so it proceeds to generate a hard coded project and this isn't really a file so it doesn't get registered in the recent files list.

@tresf Should there be a default.mpt in the factory templates?

@tresf
Copy link
Member

@tresf tresf commented Jun 10, 2017

@tresf Should there be a default.mpt in the factory templates?

It certainly sounds more logical than a hard-coded project.

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Jun 10, 2017

Works like a charm!

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Jun 10, 2017

  • Add a factory default data/projects/templates/default.mpt

I believe this also takes care of issue #528

Copy link
Member

@Umcaruje Umcaruje left a comment

I tested this, works like a charm, can confirm it fixes #528 too

@@ -282,7 +282,8 @@ void ConfigManager::addRecentlyOpenedProject( const QString & file )
{
QFileInfo recentFile( file );
if( recentFile.suffix().toLower() == "mmp" ||
recentFile.suffix().toLower() == "mmpz" )
recentFile.suffix().toLower() == "mmpz" ||
recentFile.suffix().toLower() == "mpt" )

This comment has been minimized.

@Umcaruje

Umcaruje Jun 10, 2017
Member

You could remove the one tab of indentation here so these two lines are at the same level

This comment has been minimized.

@zonkmachine

zonkmachine Jun 10, 2017
Author Member

Fixed

@@ -846,13 +846,15 @@ int main( int argc, char * * argv )
else if( ConfigManager::inst()->
value( "app", "openlastproject" ).toInt() &&
!ConfigManager::inst()->
recentlyOpenedProjects().isEmpty() )
recentlyOpenedProjects().isEmpty() &&
!recoveryFilePresent )

This comment has been minimized.

@Umcaruje

Umcaruje Jun 10, 2017
Member

And here you could add another tab

This comment has been minimized.

@zonkmachine

zonkmachine Jun 10, 2017
Author Member

I added even more for a casual look. Bohemic chic.

This comment has been minimized.

@Umcaruje

Umcaruje Jun 10, 2017
Member

Haha, it'll maybe look weird in some editors that don't have the same spaces for tabs like github does, don't you think?

@@ -0,0 +1,89 @@
<?xml version="1.0"?>
<!DOCTYPE lmms-project>
<lmms-project version="1.0" creator="LMMS" creatorversion="1.2.0-rc3.15" type="song">

This comment has been minimized.

@Umcaruje

Umcaruje Jun 10, 2017
Member

I wonder what we should do with the creator version, this way we'd need to update it for every version, otherwise the users would keep getting the 'Project version mismatch' tool tip on each new project, right?

This comment has been minimized.

@zonkmachine

zonkmachine Jun 10, 2017
Author Member

I updated the creatorversion manually. It could be automated with the --upgrade command. For another release though...

zonkmachine added 2 commits Jun 10, 2017
@tresf
Copy link
Member

@tresf tresf commented Jun 10, 2017

Interesting point about creator version. A cmake configured default.mpt.in could address this problem, or we could suppress project version warnings for template files.

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Jun 10, 2017

I thought about suppressing warnings too but we should really keep our own made stuff up to date, making such a sing a bit superfluous. Update the projects for a new release makes most sense to me.
We should have a release protocol to follow with things like this defined.

@zonkmachine zonkmachine merged commit a371ff0 into LMMS:stable-1.2 Jun 10, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zonkmachine zonkmachine moved this from In Progress to Done in Release 1.2.0 RC4 Jun 10, 2017
tresf added a commit to liushuyu/lmms that referenced this pull request Jun 12, 2017
* Add a factory default data/projects/templates/default.mpt. Fixes LMMS#528
* On launch, if the last project was a template we create a new project (default.mpt) instead.
* If there is a recovery file present and you discard it we create a new project as the project launched could be defective or, if .lmmsrc.xml wasn't written, an earlier project.
@tresf
Copy link
Member

@tresf tresf commented Jun 12, 2017

Cherry-picked and ready for master via 9edaa59.

@zonkmachine zonkmachine deleted the zonkmachine:fixopenrecent branch Jun 12, 2017
PhysSong added a commit to PhysSong/lmms that referenced this pull request Jul 8, 2017
* Add a factory default data/projects/templates/default.mpt. Fixes LMMS#528
* On launch, if the last project was a template we create a new project (default.mpt) instead.
* If there is a recovery file present and you discard it we create a new project as the project launched could be defective or, if .lmmsrc.xml wasn't written, an earlier project.
PhysSong added a commit to PhysSong/lmms that referenced this pull request Jul 8, 2017
* Add a factory default data/projects/templates/default.mpt. Fixes LMMS#528
* On launch, if the last project was a template we create a new project (default.mpt) instead.
* If there is a recovery file present and you discard it we create a new project as the project launched could be defective or, if .lmmsrc.xml wasn't written, an earlier project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.