Skip to content

Allow *.osp project files to be imported as a Clip #3285

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

Merged
merged 2 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/classes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def __init__(self, *args, mode=None):
# Stop launching and exit
sys.exit()

# Set location of OpenShot program (for libopenshot)
openshot.Settings.Instance().PATH_OPENSHOT_INSTALL = info.PATH

# Tests of project data loading/saving
self.project = project_data.ProjectDataStore()

Expand Down
2 changes: 2 additions & 0 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ def actionImportImageSequence_trigger(self, event):

def actionClearHistory_trigger(self, event):
"""Clear history for current project"""
project = get_app().project
project.has_unsaved_changes = True
get_app().updates.reset()
log.info('History cleared')

Expand Down
15 changes: 9 additions & 6 deletions src/windows/views/files_listview.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
"""
"""
@file
@brief This file contains the project file listview, used by the main window
@author Noah Figg <[email protected]>
@author Jonathan Thomas <[email protected]>

@section LICENSE

Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an open-source project
dedicated to delivering high quality video editing and animation solutions
to the world.

OpenShot Video Editor is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

OpenShot Video Editor is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
"""
Expand Down Expand Up @@ -151,6 +151,9 @@ def add_file(self, filepath):
file_data["media_type"] = "image"
elif file_data["has_audio"] and not file_data["has_video"]:
file_data["media_type"] = "audio"
else:
# If neither set, just assume video
file_data["media_type"] = "video"
Comment on lines +154 to +156
Copy link
Contributor

Choose a reason for hiding this comment

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

This exact same code is copypasted into files_treeview.py as well, it probably makes sense to keep them in sync. (Better would be to eliminate the redundancy, but short of that...)

Copy link
Contributor

Choose a reason for hiding this comment

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

Done, pushed a commit.


# Save new file to the project data
file = File()
Expand Down