Status: | Superseded |
---|---|
Proposed branch: | lp:~trb143/openlp/dnd |
Merge into: | lp:openlp |
Diff against target: |
371 lines (+157/-33) (has conflicts) 9 files modified
openlp.pyw (+2/-0) openlp/core/lib/__init__.py (+5/-0) openlp/core/lib/listwidgetwithdnd.py (+50/-0) openlp/core/lib/mediamanageritem.py (+52/-14) openlp/core/ui/servicemanager.py (+29/-9) openlp/plugins/images/lib/mediaitem.py (+3/-0) openlp/plugins/media/lib/mediaitem.py (+12/-9) openlp/plugins/presentations/lib/mediaitem.py (+3/-0) openlp/plugins/songusage/songusageplugin.py (+1/-1) Text conflict in openlp/core/lib/__init__.py |
To merge this branch: | bzr merge lp:~trb143/openlp/dnd |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Needs Fixing | ||
Andreas Preikschat | Pending | ||
Review via email: mp+70201@code.launchpad.net |
This proposal supersedes a proposal from 2011-08-02.
This proposal has been superseded by a proposal from 2011-08-03.
Commit message
Description of the change
Move all the Drag and Drop changes from the B1 tree which is stuck at present.
It is no possible to Dnd Images, Presentations and Media into the plugins as wee as dragging a otz file into the service manager.
Can import Folders now.
Remove duplicate popups now.
Servicefile load now checks for unsaved file and asks to save.
To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal | # |
review:
Needs Fixing
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : | # |
line 74: hasUrls should be hasUrls()
review:
Needs Fixing
lp:~trb143/openlp/dnd
updated
- 1700. By Tim Bentley
-
Fix missing()
- 1701. By Tim Bentley
-
Fix conflict
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openlp.pyw' | |||
2 | --- openlp.pyw 2011-07-23 22:52:34 +0000 | |||
3 | +++ openlp.pyw 2011-08-03 17:36:20 +0000 | |||
4 | @@ -127,6 +127,8 @@ | |||
5 | 127 | # now kill the splashscreen | 127 | # now kill the splashscreen |
6 | 128 | self.splash.finish(self.mainWindow) | 128 | self.splash.finish(self.mainWindow) |
7 | 129 | log.debug(u'Splashscreen closed') | 129 | log.debug(u'Splashscreen closed') |
8 | 130 | # make sure Qt really display the splash screen | ||
9 | 131 | self.processEvents() | ||
10 | 130 | self.mainWindow.repaint() | 132 | self.mainWindow.repaint() |
11 | 131 | self.processEvents() | 133 | self.processEvents() |
12 | 132 | if not has_run_wizard: | 134 | if not has_run_wizard: |
13 | 133 | 135 | ||
14 | === modified file 'openlp/core/lib/__init__.py' | |||
15 | --- openlp/core/lib/__init__.py 2011-07-30 07:34:37 +0000 | |||
16 | +++ openlp/core/lib/__init__.py 2011-08-03 17:36:20 +0000 | |||
17 | @@ -233,9 +233,14 @@ | |||
18 | 233 | except IOError: | 233 | except IOError: |
19 | 234 | pass | 234 | pass |
20 | 235 | 235 | ||
21 | 236 | from eventreceiver import Receiver | ||
22 | 236 | from listwidgetwithdnd import ListWidgetWithDnD | 237 | from listwidgetwithdnd import ListWidgetWithDnD |
23 | 238 | <<<<<<< TREE | ||
24 | 237 | from formattingtags import FormattingTags | 239 | from formattingtags import FormattingTags |
25 | 238 | from eventreceiver import Receiver | 240 | from eventreceiver import Receiver |
26 | 241 | ======= | ||
27 | 242 | from displaytags import DisplayTags | ||
28 | 243 | >>>>>>> MERGE-SOURCE | ||
29 | 239 | from spelltextedit import SpellTextEdit | 244 | from spelltextedit import SpellTextEdit |
30 | 240 | from settingsmanager import SettingsManager | 245 | from settingsmanager import SettingsManager |
31 | 241 | from plugin import PluginStatus, StringContent, Plugin | 246 | from plugin import PluginStatus, StringContent, Plugin |
32 | 242 | 247 | ||
33 | === modified file 'openlp/core/lib/listwidgetwithdnd.py' | |||
34 | --- openlp/core/lib/listwidgetwithdnd.py 2011-06-12 16:02:52 +0000 | |||
35 | +++ openlp/core/lib/listwidgetwithdnd.py 2011-08-03 17:36:20 +0000 | |||
36 | @@ -27,8 +27,12 @@ | |||
37 | 27 | """ | 27 | """ |
38 | 28 | Extend QListWidget to handle drag and drop functionality | 28 | Extend QListWidget to handle drag and drop functionality |
39 | 29 | """ | 29 | """ |
40 | 30 | import os.path | ||
41 | 31 | |||
42 | 30 | from PyQt4 import QtCore, QtGui | 32 | from PyQt4 import QtCore, QtGui |
43 | 31 | 33 | ||
44 | 34 | from openlp.core.lib import Receiver | ||
45 | 35 | |||
46 | 32 | class ListWidgetWithDnD(QtGui.QListWidget): | 36 | class ListWidgetWithDnD(QtGui.QListWidget): |
47 | 33 | """ | 37 | """ |
48 | 34 | Provide a list widget to store objects and handle drag and drop events | 38 | Provide a list widget to store objects and handle drag and drop events |
49 | @@ -41,6 +45,16 @@ | |||
50 | 41 | self.mimeDataText = name | 45 | self.mimeDataText = name |
51 | 42 | assert(self.mimeDataText) | 46 | assert(self.mimeDataText) |
52 | 43 | 47 | ||
53 | 48 | def activateDnD(self): | ||
54 | 49 | """ | ||
55 | 50 | Activate DnD of widget | ||
56 | 51 | """ | ||
57 | 52 | self.setAcceptDrops(True) | ||
58 | 53 | self.setDragDropMode(QtGui.QAbstractItemView.DragDrop) | ||
59 | 54 | QtCore.QObject.connect(Receiver.get_receiver(), | ||
60 | 55 | QtCore.SIGNAL(u'%s_dnd' % self.mimeDataText), | ||
61 | 56 | self.parent().loadFile) | ||
62 | 57 | |||
63 | 44 | def mouseMoveEvent(self, event): | 58 | def mouseMoveEvent(self, event): |
64 | 45 | """ | 59 | """ |
65 | 46 | Drag and drop event does not care what data is selected | 60 | Drag and drop event does not care what data is selected |
66 | @@ -58,3 +72,39 @@ | |||
67 | 58 | drag.setMimeData(mimeData) | 72 | drag.setMimeData(mimeData) |
68 | 59 | mimeData.setText(self.mimeDataText) | 73 | mimeData.setText(self.mimeDataText) |
69 | 60 | drag.start(QtCore.Qt.CopyAction) | 74 | drag.start(QtCore.Qt.CopyAction) |
70 | 75 | |||
71 | 76 | def dragEnterEvent(self, event): | ||
72 | 77 | if event.mimeData().hasUrls(): | ||
73 | 78 | event.accept() | ||
74 | 79 | else: | ||
75 | 80 | event.ignore() | ||
76 | 81 | |||
77 | 82 | def dragMoveEvent(self, event): | ||
78 | 83 | if event.mimeData().hasUrls(): | ||
79 | 84 | event.setDropAction(QtCore.Qt.CopyAction) | ||
80 | 85 | event.accept() | ||
81 | 86 | else: | ||
82 | 87 | event.ignore() | ||
83 | 88 | |||
84 | 89 | def dropEvent(self, event): | ||
85 | 90 | """ | ||
86 | 91 | Receive drop event check if it is a file and process it if it is. | ||
87 | 92 | |||
88 | 93 | ``event`` | ||
89 | 94 | Handle of the event pint passed | ||
90 | 95 | """ | ||
91 | 96 | if event.mimeData().hasUrls(): | ||
92 | 97 | event.setDropAction(QtCore.Qt.CopyAction) | ||
93 | 98 | event.accept() | ||
94 | 99 | files = [] | ||
95 | 100 | for url in event.mimeData().urls(): | ||
96 | 101 | localFile = unicode(url.toLocalFile()) | ||
97 | 102 | if os.path.isfile(localFile): | ||
98 | 103 | files.append(localFile) | ||
99 | 104 | elif os.path.isdir(localFile): | ||
100 | 105 | listing = os.listdir(localFile) | ||
101 | 106 | for file in listing: | ||
102 | 107 | files.append(os.path.join(localFile,file)) | ||
103 | 108 | Receiver.send_message(u'%s_dnd' % self.mimeDataText,files) | ||
104 | 109 | else: | ||
105 | 110 | event.ignore() | ||
106 | 61 | 111 | ||
107 | === modified file 'openlp/core/lib/mediamanageritem.py' | |||
108 | --- openlp/core/lib/mediamanageritem.py 2011-07-23 21:29:24 +0000 | |||
109 | +++ openlp/core/lib/mediamanageritem.py 2011-08-03 17:36:20 +0000 | |||
110 | @@ -252,7 +252,6 @@ | |||
111 | 252 | self.listView.setSelectionMode( | 252 | self.listView.setSelectionMode( |
112 | 253 | QtGui.QAbstractItemView.ExtendedSelection) | 253 | QtGui.QAbstractItemView.ExtendedSelection) |
113 | 254 | self.listView.setAlternatingRowColors(True) | 254 | self.listView.setAlternatingRowColors(True) |
114 | 255 | self.listView.setDragEnabled(True) | ||
115 | 256 | self.listView.setObjectName(u'%sListView' % self.plugin.name) | 255 | self.listView.setObjectName(u'%sListView' % self.plugin.name) |
116 | 257 | # Add to pageLayout | 256 | # Add to pageLayout |
117 | 258 | self.pageLayout.addWidget(self.listView) | 257 | self.pageLayout.addWidget(self.listView) |
118 | @@ -339,26 +338,65 @@ | |||
119 | 339 | log.info(u'New files(s) %s', unicode(files)) | 338 | log.info(u'New files(s) %s', unicode(files)) |
120 | 340 | if files: | 339 | if files: |
121 | 341 | Receiver.send_message(u'cursor_busy') | 340 | Receiver.send_message(u'cursor_busy') |
129 | 342 | names = [] | 341 | self.validateAndLoad(files) |
130 | 343 | for count in range(0, self.listView.count()): | 342 | Receiver.send_message(u'cursor_normal') |
131 | 344 | names.append(self.listView.item(count).text()) | 343 | |
132 | 345 | newFiles = [] | 344 | def loadFile(self, files): |
133 | 346 | for file in files: | 345 | """ |
134 | 347 | filename = os.path.split(unicode(file))[1] | 346 | Turn file from Drag and Drop into an array so the Validate code |
135 | 348 | if filename in names: | 347 | can run it. |
136 | 348 | |||
137 | 349 | ``files`` | ||
138 | 350 | The list of files to be loaded | ||
139 | 351 | """ | ||
140 | 352 | newFiles = [] | ||
141 | 353 | errorShown = False | ||
142 | 354 | for file in files: | ||
143 | 355 | type = file.split(u'.')[-1] | ||
144 | 356 | if type.lower() not in self.onNewFileMasks: | ||
145 | 357 | if not errorShown: | ||
146 | 349 | critical_error_message_box( | 358 | critical_error_message_box( |
148 | 350 | UiStrings().Duplicate, | 359 | translate('OpenLP.MediaManagerItem', |
149 | 360 | 'Invalid File Type'), | ||
150 | 351 | unicode(translate('OpenLP.MediaManagerItem', | 361 | unicode(translate('OpenLP.MediaManagerItem', |
155 | 352 | 'Duplicate filename %s.\nThis filename is already in ' | 362 | 'Invalid File %s.\nSuffix not supported')) |
156 | 353 | 'the list')) % filename) | 363 | % file) |
157 | 354 | else: | 364 | errorShown = True |
158 | 355 | newFiles.append(file) | 365 | else: |
159 | 366 | newFiles.append(file) | ||
160 | 367 | if file: | ||
161 | 368 | self.validateAndLoad(newFiles) | ||
162 | 369 | |||
163 | 370 | def validateAndLoad(self, files): | ||
164 | 371 | """ | ||
165 | 372 | Process a list for files either from the File Dialog or from Drag and | ||
166 | 373 | Drop | ||
167 | 374 | |||
168 | 375 | ``files`` | ||
169 | 376 | The files to be loaded | ||
170 | 377 | """ | ||
171 | 378 | names = [] | ||
172 | 379 | for count in range(0, self.listView.count()): | ||
173 | 380 | names.append(self.listView.item(count).text()) | ||
174 | 381 | newFiles = [] | ||
175 | 382 | duplicatesFound = False | ||
176 | 383 | for file in files: | ||
177 | 384 | filename = os.path.split(unicode(file))[1] | ||
178 | 385 | if filename in names: | ||
179 | 386 | duplicatesFound = True | ||
180 | 387 | else: | ||
181 | 388 | newFiles.append(file) | ||
182 | 389 | if newFiles: | ||
183 | 356 | self.loadList(newFiles) | 390 | self.loadList(newFiles) |
184 | 357 | lastDir = os.path.split(unicode(files[0]))[0] | 391 | lastDir = os.path.split(unicode(files[0]))[0] |
185 | 358 | SettingsManager.set_last_dir(self.settingsSection, lastDir) | 392 | SettingsManager.set_last_dir(self.settingsSection, lastDir) |
186 | 359 | SettingsManager.set_list(self.settingsSection, | 393 | SettingsManager.set_list(self.settingsSection, |
187 | 360 | self.settingsSection, self.getFileList()) | 394 | self.settingsSection, self.getFileList()) |
189 | 361 | Receiver.send_message(u'cursor_normal') | 395 | if duplicatesFound: |
190 | 396 | critical_error_message_box( | ||
191 | 397 | UiStrings().Duplicate, | ||
192 | 398 | unicode(translate('OpenLP.MediaManagerItem', | ||
193 | 399 | 'Duplicate files found on import and ignored.'))) | ||
194 | 362 | 400 | ||
195 | 363 | def contextMenu(self, point): | 401 | def contextMenu(self, point): |
196 | 364 | item = self.listView.itemAt(point) | 402 | item = self.listView.itemAt(point) |
197 | 365 | 403 | ||
198 | === modified file 'openlp/core/ui/servicemanager.py' | |||
199 | --- openlp/core/ui/servicemanager.py 2011-07-24 17:52:53 +0000 | |||
200 | +++ openlp/core/ui/servicemanager.py 2011-08-03 17:36:20 +0000 | |||
201 | @@ -408,20 +408,33 @@ | |||
202 | 408 | return False | 408 | return False |
203 | 409 | self.newFile() | 409 | self.newFile() |
204 | 410 | 410 | ||
206 | 411 | def onLoadServiceClicked(self): | 411 | def onLoadServiceClicked(self, loadFile=None): |
207 | 412 | """ | ||
208 | 413 | Loads the service file and saves the existing one it there is one | ||
209 | 414 | unchanged | ||
210 | 415 | |||
211 | 416 | ``loadFile`` | ||
212 | 417 | The service file to the loaded. Will be None is from menu so | ||
213 | 418 | selection will be required. | ||
214 | 419 | """ | ||
215 | 412 | if self.isModified(): | 420 | if self.isModified(): |
216 | 413 | result = self.saveModifiedService() | 421 | result = self.saveModifiedService() |
217 | 414 | if result == QtGui.QMessageBox.Cancel: | 422 | if result == QtGui.QMessageBox.Cancel: |
218 | 415 | return False | 423 | return False |
219 | 416 | elif result == QtGui.QMessageBox.Save: | 424 | elif result == QtGui.QMessageBox.Save: |
220 | 417 | self.saveFile() | 425 | self.saveFile() |
228 | 418 | fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.mainwindow, | 426 | if not loadFile: |
229 | 419 | translate('OpenLP.ServiceManager', 'Open File'), | 427 | fileName = unicode(QtGui.QFileDialog.getOpenFileName( |
230 | 420 | SettingsManager.get_last_dir( | 428 | self.mainwindow, |
231 | 421 | self.mainwindow.serviceSettingsSection), | 429 | translate('OpenLP.ServiceManager', 'Open File'), |
232 | 422 | translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)'))) | 430 | SettingsManager.get_last_dir( |
233 | 423 | if not fileName: | 431 | self.mainwindow.serviceSettingsSection), |
234 | 424 | return False | 432 | translate('OpenLP.ServiceManager', |
235 | 433 | 'OpenLP Service Files (*.osz)'))) | ||
236 | 434 | if not fileName: | ||
237 | 435 | return False | ||
238 | 436 | else: | ||
239 | 437 | fileName = loadFile | ||
240 | 425 | SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection, | 438 | SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection, |
241 | 426 | split_filename(fileName)[0]) | 439 | split_filename(fileName)[0]) |
242 | 427 | self.loadFile(fileName) | 440 | self.loadFile(fileName) |
243 | @@ -1239,7 +1252,14 @@ | |||
244 | 1239 | Handle of the event pint passed | 1252 | Handle of the event pint passed |
245 | 1240 | """ | 1253 | """ |
246 | 1241 | link = event.mimeData() | 1254 | link = event.mimeData() |
248 | 1242 | if link.hasText(): | 1255 | if event.mimeData().hasUrls(): |
249 | 1256 | event.setDropAction(QtCore.Qt.CopyAction) | ||
250 | 1257 | event.accept() | ||
251 | 1258 | for url in event.mimeData().urls(): | ||
252 | 1259 | filename = unicode(url.toLocalFile()) | ||
253 | 1260 | if filename.endswith(u'.osz'): | ||
254 | 1261 | self.onLoadServiceClicked(filename) | ||
255 | 1262 | elif event.mimeData().hasText(): | ||
256 | 1243 | plugin = unicode(event.mimeData().text()) | 1263 | plugin = unicode(event.mimeData().text()) |
257 | 1244 | item = self.serviceManagerList.itemAt(event.pos()) | 1264 | item = self.serviceManagerList.itemAt(event.pos()) |
258 | 1245 | # ServiceManager started the drag and drop | 1265 | # ServiceManager started the drag and drop |
259 | 1246 | 1266 | ||
260 | === modified file 'openlp/plugins/images/lib/mediaitem.py' | |||
261 | --- openlp/plugins/images/lib/mediaitem.py 2011-07-03 08:13:48 +0000 | |||
262 | +++ openlp/plugins/images/lib/mediaitem.py 2011-08-03 17:36:20 +0000 | |||
263 | @@ -52,6 +52,8 @@ | |||
264 | 52 | self.hasSearch = True | 52 | self.hasSearch = True |
265 | 53 | QtCore.QObject.connect(Receiver.get_receiver(), | 53 | QtCore.QObject.connect(Receiver.get_receiver(), |
266 | 54 | QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged) | 54 | QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged) |
267 | 55 | # Allow DnD from the desktop | ||
268 | 56 | self.listView.activateDnD() | ||
269 | 55 | 57 | ||
270 | 56 | def retranslateUi(self): | 58 | def retranslateUi(self): |
271 | 57 | self.onNewPrompt = translate('ImagePlugin.MediaItem', | 59 | self.onNewPrompt = translate('ImagePlugin.MediaItem', |
272 | @@ -131,6 +133,7 @@ | |||
273 | 131 | icon = self.iconFromFile(imageFile, thumb) | 133 | icon = self.iconFromFile(imageFile, thumb) |
274 | 132 | item_name = QtGui.QListWidgetItem(filename) | 134 | item_name = QtGui.QListWidgetItem(filename) |
275 | 133 | item_name.setIcon(icon) | 135 | item_name.setIcon(icon) |
276 | 136 | item_name.setToolTip(imageFile) | ||
277 | 134 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(imageFile)) | 137 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(imageFile)) |
278 | 135 | self.listView.addItem(item_name) | 138 | self.listView.addItem(item_name) |
279 | 136 | if not initialLoad: | 139 | if not initialLoad: |
280 | 137 | 140 | ||
281 | === modified file 'openlp/plugins/media/lib/mediaitem.py' | |||
282 | --- openlp/plugins/media/lib/mediaitem.py 2011-07-03 08:13:48 +0000 | |||
283 | +++ openlp/plugins/media/lib/mediaitem.py 2011-08-03 17:36:20 +0000 | |||
284 | @@ -39,6 +39,8 @@ | |||
285 | 39 | 39 | ||
286 | 40 | log = logging.getLogger(__name__) | 40 | log = logging.getLogger(__name__) |
287 | 41 | 41 | ||
288 | 42 | CLAPPERBOARD = QtGui.QPixmap(u':/media/media_video.png').toImage() | ||
289 | 43 | |||
290 | 42 | class MediaMediaItem(MediaManagerItem): | 44 | class MediaMediaItem(MediaManagerItem): |
291 | 43 | """ | 45 | """ |
292 | 44 | This is the custom media manager item for Media Slides. | 46 | This is the custom media manager item for Media Slides. |
293 | @@ -48,8 +50,7 @@ | |||
294 | 48 | def __init__(self, parent, plugin, icon): | 50 | def __init__(self, parent, plugin, icon): |
295 | 49 | self.IconPath = u'images/image' | 51 | self.IconPath = u'images/image' |
296 | 50 | self.background = False | 52 | self.background = False |
299 | 51 | self.PreviewFunction = QtGui.QPixmap( | 53 | self.PreviewFunction = CLAPPERBOARD |
298 | 52 | u':/media/media_video.png').toImage() | ||
300 | 53 | MediaManagerItem.__init__(self, parent, plugin, icon) | 54 | MediaManagerItem.__init__(self, parent, plugin, icon) |
301 | 54 | self.singleServiceItem = False | 55 | self.singleServiceItem = False |
302 | 55 | self.hasSearch = True | 56 | self.hasSearch = True |
303 | @@ -60,6 +61,8 @@ | |||
304 | 60 | QtCore.QObject.connect(Receiver.get_receiver(), | 61 | QtCore.QObject.connect(Receiver.get_receiver(), |
305 | 61 | QtCore.SIGNAL(u'openlp_phonon_creation'), | 62 | QtCore.SIGNAL(u'openlp_phonon_creation'), |
306 | 62 | self.createPhonon) | 63 | self.createPhonon) |
307 | 64 | # Allow DnD from the desktop | ||
308 | 65 | self.listView.activateDnD() | ||
309 | 63 | 66 | ||
310 | 64 | def retranslateUi(self): | 67 | def retranslateUi(self): |
311 | 65 | self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') | 68 | self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') |
312 | @@ -201,17 +204,17 @@ | |||
313 | 201 | SettingsManager.set_list(self.settingsSection, | 204 | SettingsManager.set_list(self.settingsSection, |
314 | 202 | u'media', self.getFileList()) | 205 | u'media', self.getFileList()) |
315 | 203 | 206 | ||
317 | 204 | def loadList(self, files): | 207 | def loadList(self, media): |
318 | 205 | # Sort the themes by its filename considering language specific | 208 | # Sort the themes by its filename considering language specific |
319 | 206 | # characters. lower() is needed for windows! | 209 | # characters. lower() is needed for windows! |
321 | 207 | files.sort(cmp=locale.strcoll, | 210 | media.sort(cmp=locale.strcoll, |
322 | 208 | key=lambda filename: os.path.split(unicode(filename))[1].lower()) | 211 | key=lambda filename: os.path.split(unicode(filename))[1].lower()) |
325 | 209 | for file in files: | 212 | for track in media: |
326 | 210 | filename = os.path.split(unicode(file))[1] | 213 | filename = os.path.split(unicode(track))[1] |
327 | 211 | item_name = QtGui.QListWidgetItem(filename) | 214 | item_name = QtGui.QListWidgetItem(filename) |
331 | 212 | img = QtGui.QPixmap(u':/media/media_video.png').toImage() | 215 | item_name.setIcon(build_icon(CLAPPERBOARD)) |
332 | 213 | item_name.setIcon(build_icon(img)) | 216 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track)) |
333 | 214 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) | 217 | item_name.setToolTip(track) |
334 | 215 | self.listView.addItem(item_name) | 218 | self.listView.addItem(item_name) |
335 | 216 | 219 | ||
336 | 217 | def createPhonon(self): | 220 | def createPhonon(self): |
337 | 218 | 221 | ||
338 | === modified file 'openlp/plugins/presentations/lib/mediaitem.py' | |||
339 | --- openlp/plugins/presentations/lib/mediaitem.py 2011-06-12 17:56:11 +0000 | |||
340 | +++ openlp/plugins/presentations/lib/mediaitem.py 2011-08-03 17:36:20 +0000 | |||
341 | @@ -58,6 +58,8 @@ | |||
342 | 58 | self.hasSearch = True | 58 | self.hasSearch = True |
343 | 59 | QtCore.QObject.connect(Receiver.get_receiver(), | 59 | QtCore.QObject.connect(Receiver.get_receiver(), |
344 | 60 | QtCore.SIGNAL(u'mediaitem_presentation_rebuild'), self.rebuild) | 60 | QtCore.SIGNAL(u'mediaitem_presentation_rebuild'), self.rebuild) |
345 | 61 | # Allow DnD from the desktop | ||
346 | 62 | self.listView.activateDnD() | ||
347 | 61 | 63 | ||
348 | 62 | def retranslateUi(self): | 64 | def retranslateUi(self): |
349 | 63 | """ | 65 | """ |
350 | @@ -205,6 +207,7 @@ | |||
351 | 205 | item_name = QtGui.QListWidgetItem(filename) | 207 | item_name = QtGui.QListWidgetItem(filename) |
352 | 206 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) | 208 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) |
353 | 207 | item_name.setIcon(icon) | 209 | item_name.setIcon(icon) |
354 | 210 | item_name.setToolTip(file) | ||
355 | 208 | self.listView.addItem(item_name) | 211 | self.listView.addItem(item_name) |
356 | 209 | Receiver.send_message(u'cursor_normal') | 212 | Receiver.send_message(u'cursor_normal') |
357 | 210 | if not initialLoad: | 213 | if not initialLoad: |
358 | 211 | 214 | ||
359 | === modified file 'openlp/plugins/songusage/songusageplugin.py' | |||
360 | --- openlp/plugins/songusage/songusageplugin.py 2011-07-23 21:29:24 +0000 | |||
361 | +++ openlp/plugins/songusage/songusageplugin.py 2011-08-03 17:36:20 +0000 | |||
362 | @@ -91,8 +91,8 @@ | |||
363 | 91 | self.toolsMenu.addAction(self.songUsageMenu.menuAction()) | 91 | self.toolsMenu.addAction(self.songUsageMenu.menuAction()) |
364 | 92 | self.songUsageMenu.addAction(self.songUsageStatus) | 92 | self.songUsageMenu.addAction(self.songUsageStatus) |
365 | 93 | self.songUsageMenu.addSeparator() | 93 | self.songUsageMenu.addSeparator() |
366 | 94 | self.songUsageMenu.addAction(self.songUsageReport) | ||
367 | 94 | self.songUsageMenu.addAction(self.songUsageDelete) | 95 | self.songUsageMenu.addAction(self.songUsageDelete) |
368 | 95 | self.songUsageMenu.addAction(self.songUsageReport) | ||
369 | 96 | self.songUsageActiveButton = QtGui.QToolButton( | 96 | self.songUsageActiveButton = QtGui.QToolButton( |
370 | 97 | self.formparent.statusBar) | 97 | self.formparent.statusBar) |
371 | 98 | self.songUsageActiveButton.setCheckable(True) | 98 | self.songUsageActiveButton.setCheckable(True) |
A few things:
1) line 74: hasUrls should be hasUrls()
2) line 143: spelling (runn)
3) line 146-147, 165-166: wrong indents
4) Dropping a few files (e. g. images) makes the mainwindow process bar going from 0 to 100 (in one step) as many times as many files I drop (instead of increasing the bar after processing each file)
5) when I DnD a service file to the service manager without asking me to save an already opened service
6) I thought you were going to add support for folders as well (e. g. image library)
7) line 220-222, ...: I do not like this. All ListWidgets which allow dnd need to connect to the signal, thus it should be taken care of when activating the dnd. I am not sure if we should call/have an activate method. I was thinking about specifying this in the constructor or to have an attribute (like hasDnD) in the media manager.
8) When I DnD two files (e. g. "Copy of Foo" and "Foo") a dialog pops up and says that "Copy of Foo" is already in the list. I guess this will be/is fixed in your b1 branch?
9) The "duplicate error message" does not pop up once, instead it pop ups x times which can block the program (as you have to close x dialogs)