Merge lp:~raoul-snyman/openlp/bug-1559336-2.4 into lp:openlp/2.4

Proposed by Raoul Snyman
Status: Merged
Approved by: Tim Bentley
Approved revision: 2630
Merged at revision: 2629
Proposed branch: lp:~raoul-snyman/openlp/bug-1559336-2.4
Merge into: lp:openlp/2.4
Diff against target: 56 lines (+33/-1)
2 files modified
openlp/plugins/songs/forms/editsongform.py (+16/-1)
tests/functional/openlp_core_ui/test_firsttimeform.py (+17/-0)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/bug-1559336-2.4
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+293453@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2016-01-30 20:41:22 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2016-04-29 21:13:24 +0000
@@ -1054,8 +1054,23 @@
1054 filename = item.data(QtCore.Qt.UserRole)1054 filename = item.data(QtCore.Qt.UserRole)
1055 if not filename.startswith(save_path):1055 if not filename.startswith(save_path):
1056 old_file, filename = filename, os.path.join(save_path, os.path.split(filename)[1])1056 old_file, filename = filename, os.path.join(save_path, os.path.split(filename)[1])
1057 shutil.copyfile(old_file, filename)1057 try:
1058 shutil.copyfile(old_file, filename)
1059 except FileNotFoundError:
1060 # show a dialog
1061 button = QtWidgets.QMessageBox.critical(
1062 self,
1063 translate('SongsPlugin.EditSongForm', 'File not found'),
1064 translate('SongsPlugin.EditSongForm', 'Unable to find the following file:\n' +
1065 '%s\nDo you want to remove the entry from the song?') % old_file,
1066 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
1067 QtWidgets.QMessageBox.Yes
1068 )
1069 if button == QtWidgets.QMessageBox.Yes:
1070 # If they want the file removed, skip the rest and move onto the next file
1071 continue
1058 files.append(filename)1072 files.append(filename)
1073 # Add the file to the media_file table
1059 media_file = MediaFile()1074 media_file = MediaFile()
1060 media_file.file_name = filename1075 media_file.file_name = filename
1061 media_file.type = 'audio'1076 media_file.type = 'audio'
10621077
=== modified file 'tests/functional/openlp_core_ui/test_firsttimeform.py'
--- tests/functional/openlp_core_ui/test_firsttimeform.py 2015-12-31 22:46:06 +0000
+++ tests/functional/openlp_core_ui/test_firsttimeform.py 2016-04-29 21:13:24 +0000
@@ -78,6 +78,23 @@
78 if os.path.isfile(self.tempfile):78 if os.path.isfile(self.tempfile):
79 os.remove(self.tempfile)79 os.remove(self.tempfile)
8080
81 @patch('openlp.core.ui.firsttimewizard.is_macosx')
82 def constructor_macosx_test(self, mocked_is_macosx):
83 """
84 Test that the form is resized correctly on OS X
85 """
86 # GIVEN: The platform is OS X
87 mocked_is_macosx.return_value = True
88
89 # WHEN: The wizard is created
90 frw = FirstTimeForm(None)
91
92 # THEN: The form should have been resized
93 size = frw.size()
94 self.assertEqual(634, size.width())
95 self.assertEqual(386, size.height())
96
97
81 def initialise_test(self):98 def initialise_test(self):
82 """99 """
83 Test if we can intialise the FirstTimeForm100 Test if we can intialise the FirstTimeForm

Subscribers

People subscribed via source and target branches

to all changes: