Skip to content

Commit 9fe1dd6

Browse files
authored
Merge pull request #3285 from OpenShot/timeline-import-improvements
Allow *.osp project files to be imported as a Clip
2 parents acc6986 + 7fa2716 commit 9fe1dd6

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

src/classes/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ def __init__(self, *args, mode=None):
128128
# Stop launching and exit
129129
sys.exit()
130130

131+
# Set location of OpenShot program (for libopenshot)
132+
openshot.Settings.Instance().PATH_OPENSHOT_INSTALL = info.PATH
133+
131134
# Tests of project data loading/saving
132135
self.project = project_data.ProjectDataStore()
133136

src/windows/main_window.py

+2
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ def actionImportImageSequence_trigger(self, event):
447447

448448
def actionClearHistory_trigger(self, event):
449449
"""Clear history for current project"""
450+
project = get_app().project
451+
project.has_unsaved_changes = True
450452
get_app().updates.reset()
451453
log.info('History cleared')
452454

src/windows/views/files_listview.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
"""
1+
"""
22
@file
33
@brief This file contains the project file listview, used by the main window
44
@author Noah Figg <[email protected]>
55
@author Jonathan Thomas <[email protected]>
6-
6+
77
@section LICENSE
8-
8+
99
Copyright (c) 2008-2018 OpenShot Studios, LLC
1010
(http://www.openshotstudios.com). This file is part of
1111
OpenShot Video Editor (http://www.openshot.org), an open-source project
1212
dedicated to delivering high quality video editing and animation solutions
1313
to the world.
14-
14+
1515
OpenShot Video Editor is free software: you can redistribute it and/or modify
1616
it under the terms of the GNU General Public License as published by
1717
the Free Software Foundation, either version 3 of the License, or
1818
(at your option) any later version.
19-
19+
2020
OpenShot Video Editor is distributed in the hope that it will be useful,
2121
but WITHOUT ANY WARRANTY; without even the implied warranty of
2222
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2323
GNU General Public License for more details.
24-
24+
2525
You should have received a copy of the GNU General Public License
2626
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2727
"""
@@ -151,6 +151,9 @@ def add_file(self, filepath):
151151
file_data["media_type"] = "image"
152152
elif file_data["has_audio"] and not file_data["has_video"]:
153153
file_data["media_type"] = "audio"
154+
else:
155+
# If neither set, just assume video
156+
file_data["media_type"] = "video"
154157

155158
# Save new file to the project data
156159
file = File()

src/windows/views/files_treeview.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
"""
1+
"""
22
@file
33
@brief This file contains the project file treeview, used by the main window
44
@author Noah Figg <[email protected]>
55
@author Jonathan Thomas <[email protected]>
66
@author Olivier Girard <[email protected]>
7-
7+
88
@section LICENSE
9-
9+
1010
Copyright (c) 2008-2018 OpenShot Studios, LLC
1111
(http://www.openshotstudios.com). This file is part of
1212
OpenShot Video Editor (http://www.openshot.org), an open-source project
1313
dedicated to delivering high quality video editing and animation solutions
1414
to the world.
15-
15+
1616
OpenShot Video Editor is free software: you can redistribute it and/or modify
1717
it under the terms of the GNU General Public License as published by
1818
the Free Software Foundation, either version 3 of the License, or
1919
(at your option) any later version.
20-
20+
2121
OpenShot Video Editor is distributed in the hope that it will be useful,
2222
but WITHOUT ANY WARRANTY; without even the implied warranty of
2323
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2424
GNU General Public License for more details.
25-
25+
2626
You should have received a copy of the GNU General Public License
2727
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2828
"""
@@ -150,6 +150,9 @@ def add_file(self, filepath):
150150
file_data["media_type"] = "image"
151151
elif file_data["has_audio"] and not file_data["has_video"]:
152152
file_data["media_type"] = "audio"
153+
else:
154+
# If neither set, just assume video
155+
file_data["media_type"] = "video"
153156

154157
# Save new file to the project data
155158
file = File()

0 commit comments

Comments
 (0)