forked from openlp/openlp
r1379
This commit is contained in:
commit
490ea57a87
@ -185,7 +185,7 @@ class OpenLP(QtGui.QApplication):
|
||||
self.processEvents()
|
||||
# start the main app window
|
||||
self.mainWindow = MainWindow(screens, app_version, self.clipboard(),
|
||||
has_run_wizard)
|
||||
not has_run_wizard)
|
||||
self.mainWindow.show()
|
||||
if show_splash:
|
||||
# now kill the splashscreen
|
||||
|
@ -178,8 +178,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
"""
|
||||
Prepare the UI for the process.
|
||||
"""
|
||||
# We start on 9 for the 9 plugins
|
||||
max_progress = 9
|
||||
# We start on 2 for plugins status setting plus a "finished" point.
|
||||
max_progress = 2
|
||||
# Loop through the songs list and increase for each selected item
|
||||
for i in xrange(self.songsListWidget.count()):
|
||||
if self.songsListWidget.item(i).checkState() == QtCore.Qt.Checked:
|
||||
@ -209,6 +209,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
self.finishButton.setEnabled(True)
|
||||
self.cancelButton.setVisible(False)
|
||||
self.nextButton.setVisible(False)
|
||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Download complete. Click the finish button to start OpenLP.'))
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def _performWizard(self):
|
||||
@ -219,21 +221,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
self._incrementProgressBar(translate('OpenLP.FirstTimeWizard',
|
||||
'Enabling selected plugins...'))
|
||||
self._setPluginStatus(self.songsCheckBox, u'songs/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.bibleCheckBox, u'bibles/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.presentationCheckBox, u'presentations/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.imageCheckBox, u'images/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.mediaCheckBox, u'media/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.remoteCheckBox, u'remotes/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.customCheckBox, u'custom/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.songUsageCheckBox, u'songusage/status')
|
||||
self._incrementProgressBar(None)
|
||||
self._setPluginStatus(self.alertCheckBox, u'alerts/status')
|
||||
# Build directories for downloads
|
||||
songs_destination = AppLocation.get_section_data_path(u'songs')
|
||||
|
@ -45,6 +45,18 @@ class MediaPlugin(Plugin):
|
||||
self.icon = build_icon(self.icon_path)
|
||||
# passed with drag and drop messages
|
||||
self.dnd_id = u'Media'
|
||||
self.additional_extensions = {
|
||||
u'audio/ac3': [u'.ac3'],
|
||||
u'audio/flac': [u'.flac'],
|
||||
u'audio/x-m4a': [u'.m4a'],
|
||||
u'audio/x-mp3': [u'.mp3'],
|
||||
u'audio/mpeg': [u'.mp3', u'.mp2', u'.mpga', u'.mpega', u'.m4a'],
|
||||
u'audio/qcelp': [u'.qcp'],
|
||||
u'audio/x-wma': [u'.wma'],
|
||||
u'audio/x-ms-wma': [u'.wma'],
|
||||
u'video/x-matroska': [u'.mpv', u'.mkv'],
|
||||
u'video/x-wmv': [u'.wmv'],
|
||||
u'video/x-ms-wmv': [u'.wmv']}
|
||||
self.audio_extensions_list = []
|
||||
self.video_extensions_list = []
|
||||
mimetypes.init()
|
||||
@ -65,6 +77,17 @@ class MediaPlugin(Plugin):
|
||||
self.serviceManager.supportedSuffixes(extension[1:])
|
||||
log.info(u'MediaPlugin: %s extensions: %s' % (mimetype,
|
||||
u' '.join(extensions)))
|
||||
# Add extensions for this mimetype from self.additional_extensions.
|
||||
# This hack clears mimetypes' and operating system's shortcomings
|
||||
# by providing possibly missing extensions.
|
||||
if mimetype in self.additional_extensions.keys():
|
||||
for extension in self.additional_extensions[mimetype]:
|
||||
ext = u'*%s' % extensions
|
||||
if ext not in list:
|
||||
list.append(ext)
|
||||
self.serviceManager.supportedSuffixes(extension[1:])
|
||||
log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype,
|
||||
u' '.join(self.additional_extensions[mimetype])))
|
||||
|
||||
def about(self):
|
||||
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
|
||||
|
@ -256,7 +256,7 @@ def init_schema(url):
|
||||
mapper(Song, songs_table,
|
||||
properties={
|
||||
'authors': relation(Author, backref='songs',
|
||||
secondary=authors_songs_table),
|
||||
secondary=authors_songs_table, lazy=False),
|
||||
'book': relation(Book, backref='songs'),
|
||||
'media_files': relation(MediaFile, backref='songs',
|
||||
secondary=media_files_songs_table),
|
||||
|
@ -253,9 +253,9 @@ class SongMediaItem(MediaManagerItem):
|
||||
if self.searchAsYouType:
|
||||
search_length = 1
|
||||
if self.searchTextEdit.currentSearchType() == SongSearch.Entire:
|
||||
search_length = 7
|
||||
search_length = 4
|
||||
elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
|
||||
search_length = 6
|
||||
search_length = 3
|
||||
if len(text) > search_length:
|
||||
self.onSearchTextButtonClick()
|
||||
elif len(text) == 0:
|
||||
@ -310,6 +310,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.edit_song_form.loadSong(item_id, False)
|
||||
self.edit_song_form.exec_()
|
||||
self.editItem = None
|
||||
|
||||
def onDeleteClick(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user