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 New Project opens with old parameters  #528

@zonkmachine zonkmachine added this to the 1.2.0 milestone Jun 9, 2017
@zonkmachine
Copy link
Member Author

  • 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

  • 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

  • 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 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

Works like a charm!

@zonkmachine
Copy link
Member Author

  • 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here you could add another tab

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@tresf
Copy link
Member

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

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
tresf pushed 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 commented Jun 12, 2017

Cherry-picked and ready for master via 9edaa59.

@zonkmachine zonkmachine deleted the fixopenrecent branch June 12, 2017 19:57
PhysSong pushed 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 pushed 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.
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
* 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants