forked from openlp/openlp
Fix pep8 errors
This commit is contained in:
parent
bf4225838e
commit
afaf54a142
@ -252,7 +252,8 @@ class Settings(QtCore.QSettings):
|
|||||||
'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
|
'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
|
||||||
'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
|
'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
|
||||||
'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],
|
'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],
|
||||||
'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete), QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
|
'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
|
||||||
|
QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
|
||||||
'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
|
'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
|
||||||
'shortcuts/editSong': [],
|
'shortcuts/editSong': [],
|
||||||
'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
|
'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
|
||||||
@ -329,7 +330,8 @@ class Settings(QtCore.QSettings):
|
|||||||
'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)],
|
'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)],
|
||||||
'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
||||||
'shortcuts/nextTrackItem': [],
|
'shortcuts/nextTrackItem': [],
|
||||||
'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down),
|
||||||
|
QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
||||||
'shortcuts/nextItem_preview': [QtGui.QKeySequence(QtCore.Qt.Key_Down),
|
'shortcuts/nextItem_preview': [QtGui.QKeySequence(QtCore.Qt.Key_Down),
|
||||||
QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
||||||
'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
|
'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
|
||||||
@ -339,7 +341,8 @@ class Settings(QtCore.QSettings):
|
|||||||
QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_F1)],
|
QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_F1)],
|
||||||
'shortcuts/openService': [],
|
'shortcuts/openService': [],
|
||||||
'shortcuts/saveService': [],
|
'shortcuts/saveService': [],
|
||||||
'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
|
'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
|
||||||
|
QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
|
||||||
'shortcuts/playbackPause': [],
|
'shortcuts/playbackPause': [],
|
||||||
'shortcuts/playbackPlay': [],
|
'shortcuts/playbackPlay': [],
|
||||||
'shortcuts/playbackStop': [],
|
'shortcuts/playbackStop': [],
|
||||||
|
@ -531,6 +531,7 @@ def words_split(line):
|
|||||||
line = line.replace('\n', ' ')
|
line = line.replace('\n', ' ')
|
||||||
return line.split(' ')
|
return line.split(' ')
|
||||||
|
|
||||||
|
|
||||||
def get_start_tags(raw_text):
|
def get_start_tags(raw_text):
|
||||||
"""
|
"""
|
||||||
Tests the given text for not closed formatting tags and returns a tuple consisting of three unicode strings::
|
Tests the given text for not closed formatting tags and returns a tuple consisting of three unicode strings::
|
||||||
@ -566,4 +567,3 @@ def get_start_tags(raw_text):
|
|||||||
# Remove the indexes.
|
# Remove the indexes.
|
||||||
html_tags = [tag[1] for tag in html_tags]
|
html_tags = [tag[1] for tag in html_tags]
|
||||||
return raw_text + ''.join(end_tags), ''.join(start_tags), ''.join(html_tags)
|
return raw_text + ''.join(end_tags), ''.join(start_tags), ''.join(html_tags)
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ class ScreenList(object):
|
|||||||
y = window.y() + (window.height() // 2)
|
y = window.y() + (window.height() // 2)
|
||||||
for screen in self.screen_list:
|
for screen in self.screen_list:
|
||||||
size = screen['size']
|
size = screen['size']
|
||||||
if x >= size.x() and x <= (size.x() + size.width()) and y >= size.y() and y <= (size.y() + size.height()):
|
if size.x() <= x <= (size.x() + size.width()) and size.y() <= y <= (size.y() + size.height()):
|
||||||
return screen['number']
|
return screen['number']
|
||||||
|
|
||||||
def load_screen_settings(self):
|
def load_screen_settings(self):
|
||||||
|
@ -40,8 +40,7 @@ class AboutForm(QtWidgets.QDialog, UiAboutDialog):
|
|||||||
"""
|
"""
|
||||||
Do some initialisation stuff
|
Do some initialisation stuff
|
||||||
"""
|
"""
|
||||||
super(AboutForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(AboutForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self._setup()
|
self._setup()
|
||||||
|
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
|
@ -89,8 +89,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
"""
|
"""
|
||||||
super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint
|
super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.settings_section = 'crashreport'
|
self.settings_section = 'crashreport'
|
||||||
self.report_text = '**OpenLP Bug Report**\n' \
|
self.report_text = '**OpenLP Bug Report**\n' \
|
||||||
|
@ -39,7 +39,7 @@ class FileRenameForm(QtWidgets.QDialog, Ui_FileRenameDialog, RegistryProperties)
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(FileRenameForm, self).__init__(Registry().get('main_window'),
|
super(FileRenameForm, self).__init__(Registry().get('main_window'),
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
self._setup()
|
self._setup()
|
||||||
|
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
|
@ -37,8 +37,7 @@ class FirstTimeLanguageForm(QtWidgets.QDialog, Ui_FirstTimeLanguageDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.qm_list = LanguageManager.get_qm_list()
|
self.qm_list = LanguageManager.get_qm_list()
|
||||||
self.language_combo_box.addItem('Autodetect')
|
self.language_combo_box.addItem('Autodetect')
|
||||||
|
@ -51,8 +51,7 @@ class FormattingTagForm(QtWidgets.QDialog, Ui_FormattingTagDialog, FormattingTag
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self._setup()
|
self._setup()
|
||||||
|
|
||||||
|
@ -326,10 +326,10 @@ class WebkitPlayer(MediaPlayer):
|
|||||||
controller = display.controller
|
controller = display.controller
|
||||||
if controller.media_info.is_flash:
|
if controller.media_info.is_flash:
|
||||||
seek = seek_value
|
seek = seek_value
|
||||||
display.frame.evaluateJavaScript('show_flash("seek", null, null, "%s");' % (seek))
|
display.frame.evaluateJavaScript('show_flash("seek", null, null, "%s");' % seek)
|
||||||
else:
|
else:
|
||||||
seek = float(seek_value) / 1000
|
seek = float(seek_value) / 1000
|
||||||
display.frame.evaluateJavaScript('show_video("seek", null, null, null, "%f");' % (seek))
|
display.frame.evaluateJavaScript('show_video("seek", null, null, null, "%f");' % seek)
|
||||||
|
|
||||||
def reset(self, display):
|
def reset(self, display):
|
||||||
"""
|
"""
|
||||||
|
@ -41,8 +41,7 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(PluginForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(PluginForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.active_plugin = None
|
self.active_plugin = None
|
||||||
self.programatic_change = False
|
self.programatic_change = False
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
@ -113,7 +113,7 @@ class PrintServiceForm(QtWidgets.QDialog, Ui_PrintServiceDialog, RegistryPropert
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(PrintServiceForm, self).__init__(Registry().get('main_window'),
|
super(PrintServiceForm, self).__init__(Registry().get('main_window'),
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
self.printer = QtPrintSupport.QPrinter()
|
self.printer = QtPrintSupport.QPrinter()
|
||||||
self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)
|
self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)
|
||||||
self.document = QtGui.QTextDocument()
|
self.document = QtGui.QTextDocument()
|
||||||
|
@ -144,8 +144,7 @@ class ProjectorEditForm(QDialog, Ui_ProjectorEditForm):
|
|||||||
editProjector = pyqtSignal(object)
|
editProjector = pyqtSignal(object)
|
||||||
|
|
||||||
def __init__(self, parent=None, projectordb=None):
|
def __init__(self, parent=None, projectordb=None):
|
||||||
super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.projectordb = projectordb
|
self.projectordb = projectordb
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.button_box.accepted.connect(self.accept_me)
|
self.button_box.accepted.connect(self.accept_me)
|
||||||
|
@ -236,8 +236,7 @@ class SourceSelectTabs(QDialog):
|
|||||||
:param projectordb: ProjectorDB session to use
|
:param projectordb: ProjectorDB session to use
|
||||||
"""
|
"""
|
||||||
log.debug('Initializing SourceSelectTabs()')
|
log.debug('Initializing SourceSelectTabs()')
|
||||||
super(SourceSelectTabs, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SourceSelectTabs, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setMinimumWidth(350)
|
self.setMinimumWidth(350)
|
||||||
self.projectordb = projectordb
|
self.projectordb = projectordb
|
||||||
self.edit = edit
|
self.edit = edit
|
||||||
@ -386,8 +385,7 @@ class SourceSelectSingle(QDialog):
|
|||||||
"""
|
"""
|
||||||
log.debug('Initializing SourceSelectSingle()')
|
log.debug('Initializing SourceSelectSingle()')
|
||||||
self.projectordb = projectordb
|
self.projectordb = projectordb
|
||||||
super(SourceSelectSingle, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SourceSelectSingle, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.edit = edit
|
self.edit = edit
|
||||||
if self.edit:
|
if self.edit:
|
||||||
title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
|
title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
|
||||||
|
@ -38,7 +38,7 @@ class ServiceItemEditForm(QtWidgets.QDialog, Ui_ServiceItemEditDialog, RegistryP
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ServiceItemEditForm, self).__init__(Registry().get('main_window'),
|
super(ServiceItemEditForm, self).__init__(Registry().get('main_window'),
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.item_list = []
|
self.item_list = []
|
||||||
self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
|
self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
|
||||||
|
@ -1131,6 +1131,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ServiceMa
|
|||||||
:param item: The service item to be checked
|
:param item: The service item to be checked
|
||||||
"""
|
"""
|
||||||
pos = item.data(0, QtCore.Qt.UserRole)
|
pos = item.data(0, QtCore.Qt.UserRole)
|
||||||
|
print('{}: {}; {}'.format(pos, len(self.service_items), item.text()))
|
||||||
self.service_items[pos - 1]['expanded'] = False
|
self.service_items[pos - 1]['expanded'] = False
|
||||||
|
|
||||||
def on_expand_all(self, field=None):
|
def on_expand_all(self, field=None):
|
||||||
@ -1149,6 +1150,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ServiceMa
|
|||||||
:param item: The service item to be checked
|
:param item: The service item to be checked
|
||||||
"""
|
"""
|
||||||
pos = item.data(0, QtCore.Qt.UserRole)
|
pos = item.data(0, QtCore.Qt.UserRole)
|
||||||
|
print('{}: {}; {}'.format(pos, len(self.service_items), item.text()))
|
||||||
self.service_items[pos - 1]['expanded'] = True
|
self.service_items[pos - 1]['expanded'] = True
|
||||||
|
|
||||||
def on_service_top(self, field=None):
|
def on_service_top(self, field=None):
|
||||||
@ -1666,4 +1668,3 @@ def get_parent_item_data(item):
|
|||||||
return item.data(0, QtCore.Qt.UserRole)
|
return item.data(0, QtCore.Qt.UserRole)
|
||||||
else:
|
else:
|
||||||
return parent_item.data(0, QtCore.Qt.UserRole)
|
return parent_item.data(0, QtCore.Qt.UserRole)
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties):
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ServiceNoteForm, self).__init__(Registry().get('main_window'),
|
super(ServiceNoteForm, self).__init__(Registry().get('main_window'),
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
self.setupUi()
|
self.setupUi()
|
||||||
self.retranslateUi()
|
self.retranslateUi()
|
||||||
|
|
||||||
|
@ -46,8 +46,7 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Registry().register('settings_form', self)
|
Registry().register('settings_form', self)
|
||||||
Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up)
|
Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up)
|
||||||
super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.processes = []
|
self.processes = []
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)
|
self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)
|
||||||
|
@ -44,8 +44,7 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.changed_actions = {}
|
self.changed_actions = {}
|
||||||
self.action_list = ActionList.get_instance()
|
self.action_list = ActionList.get_instance()
|
||||||
|
@ -39,7 +39,7 @@ class StartTimeForm(QtWidgets.QDialog, Ui_StartTimeDialog, RegistryProperties):
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(StartTimeForm, self).__init__(Registry().get('main_window'),
|
super(StartTimeForm, self).__init__(Registry().get('main_window'),
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self):
|
def exec(self):
|
||||||
|
@ -37,7 +37,7 @@ class AlertForm(QtWidgets.QDialog, Ui_AlertDialog):
|
|||||||
Initialise the alert form
|
Initialise the alert form
|
||||||
"""
|
"""
|
||||||
super(AlertForm, self).__init__(Registry().get('main_window'),
|
super(AlertForm, self).__init__(Registry().get('main_window'),
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
self.manager = plugin.manager
|
self.manager = plugin.manager
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.item_id = None
|
self.item_id = None
|
||||||
|
@ -69,8 +69,8 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
"""
|
"""
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
self.web_bible_list = {}
|
self.web_bible_list = {}
|
||||||
super(BibleImportForm, self).__init__(
|
super(BibleImportForm, self).__init__(parent, bible_plugin,
|
||||||
parent, bible_plugin, 'bibleImportWizard', ':/wizards/wizard_importbible.bmp')
|
'bibleImportWizard', ':/wizards/wizard_importbible.bmp')
|
||||||
|
|
||||||
def setupUi(self, image):
|
def setupUi(self, image):
|
||||||
"""
|
"""
|
||||||
|
@ -49,8 +49,7 @@ class BookNameForm(QDialog, Ui_BookNameDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.custom_signals()
|
self.custom_signals()
|
||||||
self.book_names = BibleStrings().BookNames
|
self.book_names = BibleStrings().BookNames
|
||||||
|
@ -45,8 +45,7 @@ class EditBibleForm(QtWidgets.QDialog, Ui_EditBibleDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(EditBibleForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(EditBibleForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.media_item = media_item
|
self.media_item = media_item
|
||||||
self.book_names = BibleStrings().BookNames
|
self.book_names = BibleStrings().BookNames
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
@ -47,8 +47,7 @@ class LanguageForm(QDialog, Ui_LanguageDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, bible_name):
|
def exec(self, bible_name):
|
||||||
|
@ -44,8 +44,7 @@ class EditCustomForm(QtWidgets.QDialog, Ui_CustomEditDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(EditCustomForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(EditCustomForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
self.media_item = media_item
|
self.media_item = media_item
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
@ -39,8 +39,7 @@ class EditCustomSlideForm(QtWidgets.QDialog, Ui_CustomSlideEditDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
# Connecting signals and slots
|
# Connecting signals and slots
|
||||||
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
||||||
|
@ -190,7 +190,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
if QtWidgets.QMessageBox.question(
|
if QtWidgets.QMessageBox.question(
|
||||||
self, UiStrings().ConfirmDelete,
|
self, UiStrings().ConfirmDelete,
|
||||||
translate('CustomPlugin.MediaItem',
|
translate('CustomPlugin.MediaItem',
|
||||||
'Are you sure you want to delete the "%d" selected custom slide(s)?') %len(items),
|
'Are you sure you want to delete the "%d" selected custom slide(s)?') % len(items),
|
||||||
QtWidgets.QMessageBox.StandardButtons(
|
QtWidgets.QMessageBox.StandardButtons(
|
||||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
|
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
|
||||||
QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
|
QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
|
||||||
|
@ -35,8 +35,7 @@ class AddGroupForm(QtWidgets.QDialog, Ui_AddGroupDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, clear=True, show_top_level_group=False, selected_group=None):
|
def exec(self, clear=True, show_top_level_group=False, selected_group=None):
|
||||||
|
@ -33,8 +33,7 @@ class ChooseGroupForm(QtWidgets.QDialog, Ui_ChooseGroupDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, selected_group=None):
|
def exec(self, selected_group=None):
|
||||||
|
@ -52,8 +52,7 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.vlc_instance = None
|
self.vlc_instance = None
|
||||||
self.vlc_media_player = None
|
self.vlc_media_player = None
|
||||||
self.vlc_media = None
|
self.vlc_media = None
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<div data-role="controlgroup">
|
<div data-role="controlgroup">
|
||||||
<a href="#service-manager" data-role="button" data-icon="arrow-r" data-iconpos="right">${service_manager}</a>
|
<a href="#service-manager" data-role="button" data-icon="arrow-r" data-iconpos="right">${service_manager}</a>
|
||||||
<a href="#slide-controller" data-role="button" data-icon="arrow-r" data-iconpos="right">${slide_controller}</a>
|
<a href="#slide-controller" data-role="button" data-icon="arrow-r" data-iconpos="right">${slide_controller}</a>
|
||||||
<a href="#alerts" data-role="button" data-icon="arrow-r" data-iconpos="right">${alerts}</a>
|
<a class="hidden" href="#alerts" data-role="button" data-icon="arrow-r" data-iconpos="right">${alerts}</a>
|
||||||
<a href="#search" data-role="button" data-icon="arrow-r" data-iconpos="right">${search}</a>
|
<a href="#search" data-role="button" data-icon="arrow-r" data-iconpos="right">${search}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="#service-manager" data-theme="e">${service}</a></li>
|
<li><a href="#service-manager" data-theme="e">${service}</a></li>
|
||||||
<li><a href="#slide-controller">${slides}</a></li>
|
<li><a href="#slide-controller">${slides}</a></li>
|
||||||
<li><a href="#alerts">${alerts}</a></li>
|
<li class="hidden"><a href="#alerts">${alerts}</a></li>
|
||||||
<li><a href="#search">${search}</a></li>
|
<li><a href="#search">${search}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="#service-manager">${service}</a></li>
|
<li><a href="#service-manager">${service}</a></li>
|
||||||
<li><a href="#slide-controller" data-theme="e">${slides}</a></li>
|
<li><a href="#slide-controller" data-theme="e">${slides}</a></li>
|
||||||
<li><a href="#alerts">${alerts}</a></li>
|
<li class="hidden"><a href="#alerts">${alerts}</a></li>
|
||||||
<li><a href="#search">${search}</a></li>
|
<li><a href="#search">${search}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -144,7 +144,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="#service-manager">${service}</a></li>
|
<li><a href="#service-manager">${service}</a></li>
|
||||||
<li><a href="#slide-controller">${slides}</a></li>
|
<li><a href="#slide-controller">${slides}</a></li>
|
||||||
<li><a href="#alerts">${alerts}</a></li>
|
<li class="hidden"><a href="#alerts">${alerts}</a></li>
|
||||||
<li><a href="#search" data-theme="e">${search}</a></li>
|
<li><a href="#search" data-theme="e">${search}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,3 +29,7 @@
|
|||||||
.ui-li .ui-btn-text a.ui-link-inherit{
|
.ui-li .ui-btn-text a.ui-link-inherit{
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@ -35,8 +35,7 @@ class AuthorsForm(QtWidgets.QDialog, Ui_AuthorsDialog):
|
|||||||
"""
|
"""
|
||||||
Set up the screen and common data
|
Set up the screen and common data
|
||||||
"""
|
"""
|
||||||
super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.auto_display_name = False
|
self.auto_display_name = False
|
||||||
self.first_name_edit.textEdited.connect(self.on_first_name_edited)
|
self.first_name_edit.textEdited.connect(self.on_first_name_edited)
|
||||||
|
@ -55,8 +55,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(EditSongForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(EditSongForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.media_item = media_item
|
self.media_item = media_item
|
||||||
self.song = None
|
self.song = None
|
||||||
# can this be automated?
|
# can this be automated?
|
||||||
|
@ -41,8 +41,7 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.has_single_verse = False
|
self.has_single_verse = False
|
||||||
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
||||||
|
@ -37,8 +37,7 @@ class MediaFilesForm(QtWidgets.QDialog, Ui_MediaFilesDialog):
|
|||||||
log.info('%s MediaFilesForm loaded', __name__)
|
log.info('%s MediaFilesForm loaded', __name__)
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def populate_files(self, files):
|
def populate_files(self, files):
|
||||||
|
@ -38,8 +38,7 @@ class SongBookForm(QtWidgets.QDialog, Ui_SongBookDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, clear=True):
|
def exec(self, clear=True):
|
||||||
|
@ -84,58 +84,56 @@ class SongExportForm(OpenLPWizard):
|
|||||||
"""
|
"""
|
||||||
# The page with all available songs.
|
# The page with all available songs.
|
||||||
self.available_songs_page = QtWidgets.QWizardPage()
|
self.available_songs_page = QtWidgets.QWizardPage()
|
||||||
self.available_songs_page.setObjectName('available_songs_page')
|
available_songs_layout = QtWidgets.QHBoxLayout(self.available_songs_page)
|
||||||
self.available_songs_layout = QtWidgets.QHBoxLayout(self.available_songs_page)
|
available_songs_layout.setObjectName('available_songs_layout')
|
||||||
self.available_songs_layout.setObjectName('available_songs_layout')
|
vertical_layout = QtWidgets.QVBoxLayout()
|
||||||
self.vertical_layout = QtWidgets.QVBoxLayout()
|
vertical_layout.setObjectName('vertical_layout')
|
||||||
self.vertical_layout.setObjectName('vertical_layout')
|
|
||||||
self.available_list_widget = QtWidgets.QListWidget(self.available_songs_page)
|
self.available_list_widget = QtWidgets.QListWidget(self.available_songs_page)
|
||||||
self.available_list_widget.setObjectName('available_list_widget')
|
self.available_list_widget.setObjectName('available_list_widget')
|
||||||
self.vertical_layout.addWidget(self.available_list_widget)
|
vertical_layout.addWidget(self.available_list_widget)
|
||||||
self.horizontal_layout = QtWidgets.QHBoxLayout()
|
horizontal_layout = QtWidgets.QHBoxLayout()
|
||||||
self.horizontal_layout.setObjectName('horizontal_layout')
|
horizontal_layout.setObjectName('horizontal_layout')
|
||||||
self.search_label = QtWidgets.QLabel(self.available_songs_page)
|
self.search_label = QtWidgets.QLabel(self.available_songs_page)
|
||||||
self.search_label.setObjectName('search_label')
|
self.search_label.setObjectName('search_label')
|
||||||
self.horizontal_layout.addWidget(self.search_label)
|
horizontal_layout.addWidget(self.search_label)
|
||||||
self.search_line_edit = QtWidgets.QLineEdit(self.available_songs_page)
|
self.search_line_edit = QtWidgets.QLineEdit(self.available_songs_page)
|
||||||
self.search_line_edit.setObjectName('search_line_edit')
|
self.search_line_edit.setObjectName('search_line_edit')
|
||||||
self.horizontal_layout.addWidget(self.search_line_edit)
|
horizontal_layout.addWidget(self.search_line_edit)
|
||||||
spacer_item = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
spacer_item = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||||
self.horizontal_layout.addItem(spacer_item)
|
horizontal_layout.addItem(spacer_item)
|
||||||
self.uncheck_button = QtWidgets.QPushButton(self.available_songs_page)
|
self.uncheck_button = QtWidgets.QPushButton(self.available_songs_page)
|
||||||
self.uncheck_button.setObjectName('uncheck_button')
|
self.uncheck_button.setObjectName('uncheck_button')
|
||||||
self.horizontal_layout.addWidget(self.uncheck_button)
|
horizontal_layout.addWidget(self.uncheck_button)
|
||||||
self.check_button = QtWidgets.QPushButton(self.available_songs_page)
|
self.check_button = QtWidgets.QPushButton(self.available_songs_page)
|
||||||
self.check_button.setObjectName('selectButton')
|
self.check_button.setObjectName('selectButton')
|
||||||
self.horizontal_layout.addWidget(self.check_button)
|
horizontal_layout.addWidget(self.check_button)
|
||||||
self.vertical_layout.addLayout(self.horizontal_layout)
|
vertical_layout.addLayout(horizontal_layout)
|
||||||
self.available_songs_layout.addLayout(self.vertical_layout)
|
available_songs_layout.addLayout(vertical_layout)
|
||||||
self.addPage(self.available_songs_page)
|
self.addPage(self.available_songs_page)
|
||||||
# The page with the selected songs.
|
# The page with the selected songs.
|
||||||
self.export_song_page = QtWidgets.QWizardPage()
|
self.export_song_page = QtWidgets.QWizardPage()
|
||||||
self.export_song_page.setObjectName('available_songs_page')
|
self.export_song_page.setObjectName('available_songs_page')
|
||||||
self.export_song_layout = QtWidgets.QHBoxLayout(self.export_song_page)
|
export_song_layout = QtWidgets.QHBoxLayout(self.export_song_page)
|
||||||
self.export_song_layout.setObjectName('export_song_layout')
|
export_song_layout.setObjectName('export_song_layout')
|
||||||
self.grid_layout = QtWidgets.QGridLayout()
|
grid_layout = QtWidgets.QGridLayout()
|
||||||
self.grid_layout.setObjectName('range_layout')
|
grid_layout.setObjectName('range_layout')
|
||||||
self.selected_list_widget = QtWidgets.QListWidget(self.export_song_page)
|
self.selected_list_widget = QtWidgets.QListWidget(self.export_song_page)
|
||||||
self.selected_list_widget.setObjectName('selected_list_widget')
|
self.selected_list_widget.setObjectName('selected_list_widget')
|
||||||
self.grid_layout.addWidget(self.selected_list_widget, 1, 0, 1, 1)
|
grid_layout.addWidget(self.selected_list_widget, 1, 0, 1, 1)
|
||||||
# FIXME: self.horizontal_layout is already defined above?!?!?
|
horizontal_layout = QtWidgets.QHBoxLayout()
|
||||||
self.horizontal_layout = QtWidgets.QHBoxLayout()
|
horizontal_layout.setObjectName('horizontal_layout')
|
||||||
self.horizontal_layout.setObjectName('horizontal_layout')
|
|
||||||
self.directory_label = QtWidgets.QLabel(self.export_song_page)
|
self.directory_label = QtWidgets.QLabel(self.export_song_page)
|
||||||
self.directory_label.setObjectName('directory_label')
|
self.directory_label.setObjectName('directory_label')
|
||||||
self.horizontal_layout.addWidget(self.directory_label)
|
horizontal_layout.addWidget(self.directory_label)
|
||||||
self.directory_line_edit = QtWidgets.QLineEdit(self.export_song_page)
|
self.directory_line_edit = QtWidgets.QLineEdit(self.export_song_page)
|
||||||
self.directory_line_edit.setObjectName('directory_line_edit')
|
self.directory_line_edit.setObjectName('directory_line_edit')
|
||||||
self.horizontal_layout.addWidget(self.directory_line_edit)
|
horizontal_layout.addWidget(self.directory_line_edit)
|
||||||
self.directory_button = QtWidgets.QToolButton(self.export_song_page)
|
self.directory_button = QtWidgets.QToolButton(self.export_song_page)
|
||||||
self.directory_button.setIcon(build_icon(':/exports/export_load.png'))
|
self.directory_button.setIcon(build_icon(':/exports/export_load.png'))
|
||||||
self.directory_button.setObjectName('directory_button')
|
self.directory_button.setObjectName('directory_button')
|
||||||
self.horizontal_layout.addWidget(self.directory_button)
|
horizontal_layout.addWidget(self.directory_button)
|
||||||
self.grid_layout.addLayout(self.horizontal_layout, 0, 0, 1, 1)
|
grid_layout.addLayout(horizontal_layout, 0, 0, 1, 1)
|
||||||
self.export_song_layout.addLayout(self.grid_layout)
|
export_song_layout.addLayout(grid_layout)
|
||||||
self.addPage(self.export_song_page)
|
self.addPage(self.export_song_page)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
@ -308,6 +306,7 @@ def find_list_widget_items(list_widget, text=''):
|
|||||||
item for item in list_widget.findItems(text, QtCore.Qt.MatchContains)
|
item for item in list_widget.findItems(text, QtCore.Qt.MatchContains)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def on_item_activated(item):
|
def on_item_activated(item):
|
||||||
"""
|
"""
|
||||||
Called, when an item in the *available_list_widget* has been triggered.
|
Called, when an item in the *available_list_widget* has been triggered.
|
||||||
@ -317,4 +316,3 @@ def on_item_activated(item):
|
|||||||
:param item: The *QListWidgetItem* which was triggered.
|
:param item: The *QListWidgetItem* which was triggered.
|
||||||
"""
|
"""
|
||||||
item.setCheckState(QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked)
|
item.setCheckState(QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked)
|
||||||
|
|
||||||
|
@ -44,8 +44,7 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
self.author_form = AuthorsForm(self)
|
self.author_form = AuthorsForm(self)
|
||||||
|
@ -81,8 +81,7 @@ class SongSelectForm(QtWidgets.QDialog, Ui_SongSelectDialog):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parent=None, plugin=None, db_manager=None):
|
def __init__(self, parent=None, plugin=None, db_manager=None):
|
||||||
QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint
|
QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.db_manager = db_manager
|
self.db_manager = db_manager
|
||||||
self.setup_ui(self)
|
self.setup_ui(self)
|
||||||
|
@ -38,8 +38,7 @@ class TopicsForm(QtWidgets.QDialog, Ui_TopicsDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, clear=True):
|
def exec(self, clear=True):
|
||||||
|
@ -541,4 +541,3 @@ def to_str(element):
|
|||||||
if element is not None:
|
if element is not None:
|
||||||
return str(element)
|
return str(element)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
if QtWidgets.QMessageBox.question(
|
if QtWidgets.QMessageBox.question(
|
||||||
self, UiStrings().ConfirmDelete,
|
self, UiStrings().ConfirmDelete,
|
||||||
translate('SongsPlugin.MediaItem',
|
translate('SongsPlugin.MediaItem',
|
||||||
'Are you sure you want to delete the "%d" selected song(s)?') % len(items),
|
'Are you sure you want to delete the "%d" selected song(s)?') % len(items),
|
||||||
QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
|
QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
|
||||||
QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
|
QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
|
||||||
return
|
return
|
||||||
|
@ -36,8 +36,8 @@ class SongUsageDeleteForm(QtWidgets.QDialog, Ui_SongUsageDeleteDialog, RegistryP
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint |
|
||||||
| QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.button_box.clicked.connect(self.on_button_box_clicked)
|
self.button_box.clicked.connect(self.on_button_box_clicked)
|
||||||
|
|
||||||
@ -48,13 +48,14 @@ class SongUsageDeleteForm(QtWidgets.QDialog, Ui_SongUsageDeleteDialog, RegistryP
|
|||||||
:param button: The button pressed
|
:param button: The button pressed
|
||||||
"""
|
"""
|
||||||
if self.button_box.standardButton(button) == QtWidgets.QDialogButtonBox.Ok:
|
if self.button_box.standardButton(button) == QtWidgets.QDialogButtonBox.Ok:
|
||||||
ret = QtWidgets.QMessageBox.question(
|
ret = QtWidgets.QMessageBox.question(self,
|
||||||
self,
|
translate('SongUsagePlugin.SongUsageDeleteForm',
|
||||||
translate('SongUsagePlugin.SongUsageDeleteForm', 'Delete Selected Song Usage Events?'),
|
'Delete Selected Song Usage Events?'),
|
||||||
translate('SongUsagePlugin.SongUsageDeleteForm',
|
translate('SongUsagePlugin.SongUsageDeleteForm',
|
||||||
'Are you sure you want to delete selected Song Usage data?'),
|
'Are you sure you want to delete selected Song Usage data?'),
|
||||||
QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
|
QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
|
||||||
QtWidgets.QMessageBox.No)
|
QtWidgets.QMessageBox.No),
|
||||||
|
QtWidgets.QMessageBox.No)
|
||||||
if ret == QtWidgets.QMessageBox.Yes:
|
if ret == QtWidgets.QMessageBox.Yes:
|
||||||
delete_date = self.delete_calendar.selectedDate().toPyDate()
|
delete_date = self.delete_calendar.selectedDate().toPyDate()
|
||||||
self.manager.delete_all_objects(SongUsageItem, SongUsageItem.usagedate <= delete_date)
|
self.manager.delete_all_objects(SongUsageItem, SongUsageItem.usagedate <= delete_date)
|
||||||
|
@ -44,8 +44,7 @@ class SongUsageDetailForm(QtWidgets.QDialog, Ui_SongUsageDetailDialog, RegistryP
|
|||||||
"""
|
"""
|
||||||
Initialise the form
|
Initialise the form
|
||||||
"""
|
"""
|
||||||
super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
|
super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
||||||
| QtCore.Qt.WindowTitleHint)
|
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ class SongUsagePlugin(Plugin):
|
|||||||
"""
|
"""
|
||||||
self.song_usage_detail_form.initialise()
|
self.song_usage_detail_form.initialise()
|
||||||
self.song_usage_detail_form.exec()
|
self.song_usage_detail_form.exec()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def about():
|
def about():
|
||||||
"""
|
"""
|
||||||
|
@ -75,7 +75,6 @@ class TestMediaManagerItem(TestCase, TestMixin):
|
|||||||
self.assertTrue(mmi.has_delete_icon, 'By default a delete icon should be present')
|
self.assertTrue(mmi.has_delete_icon, 'By default a delete icon should be present')
|
||||||
self.assertFalse(mmi.add_to_service_item, 'There should be no add_to_service icon by default')
|
self.assertFalse(mmi.add_to_service_item, 'There should be no add_to_service icon by default')
|
||||||
|
|
||||||
|
|
||||||
@patch(u'openlp.core.lib.mediamanageritem.Settings')
|
@patch(u'openlp.core.lib.mediamanageritem.Settings')
|
||||||
@patch(u'openlp.core.lib.mediamanageritem.MediaManagerItem.on_live_click')
|
@patch(u'openlp.core.lib.mediamanageritem.MediaManagerItem.on_live_click')
|
||||||
def on_double_clicked_go_live_test(self, mocked_on_live_click, MockedSettings):
|
def on_double_clicked_go_live_test(self, mocked_on_live_click, MockedSettings):
|
||||||
|
@ -185,4 +185,3 @@ class TestProjectorDB(TestCase):
|
|||||||
# THEN: Projector should have the same source entry
|
# THEN: Projector should have the same source entry
|
||||||
item = self.projector.get_projector_by_id(item_id)
|
item = self.projector.get_projector_by_id(item_id)
|
||||||
self.assertTrue(compare_source(item.source_list[0], source))
|
self.assertTrue(compare_source(item.source_list[0], source))
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class TestSongFormat(TestCase):
|
|||||||
# WHEN: Retrieving the format list
|
# WHEN: Retrieving the format list
|
||||||
# THEN: All SongFormats should be returned
|
# THEN: All SongFormats should be returned
|
||||||
self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__),
|
self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__),
|
||||||
"The returned SongFormats don't match the stored ones")
|
"The returned SongFormats don't match the stored ones")
|
||||||
|
|
||||||
def test_get_attributed_no_attributes(self):
|
def test_get_attributed_no_attributes(self):
|
||||||
"""
|
"""
|
||||||
@ -51,7 +51,7 @@ class TestSongFormat(TestCase):
|
|||||||
for song_format in SongFormat.get_format_list():
|
for song_format in SongFormat.get_format_list():
|
||||||
# THEN: All attributes associated with the SongFormat should be returned
|
# THEN: All attributes associated with the SongFormat should be returned
|
||||||
self.assertEquals(SongFormat.get(song_format), SongFormat.__attributes__[song_format],
|
self.assertEquals(SongFormat.get(song_format), SongFormat.__attributes__[song_format],
|
||||||
"The returned attributes don't match the stored ones")
|
"The returned attributes don't match the stored ones")
|
||||||
|
|
||||||
def test_get_attributed_single_attribute(self):
|
def test_get_attributed_single_attribute(self):
|
||||||
"""
|
"""
|
||||||
@ -63,13 +63,13 @@ class TestSongFormat(TestCase):
|
|||||||
for attribute in SongFormat.get(song_format).keys():
|
for attribute in SongFormat.get(song_format).keys():
|
||||||
# THEN: Return the attribute
|
# THEN: Return the attribute
|
||||||
self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.get(song_format)[attribute],
|
self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.get(song_format)[attribute],
|
||||||
"The returned attribute doesn't match the stored one")
|
"The returned attribute doesn't match the stored one")
|
||||||
# WHEN: Retrieving an attribute that was not overridden
|
# WHEN: Retrieving an attribute that was not overridden
|
||||||
for attribute in SongFormat.__defaults__.keys():
|
for attribute in SongFormat.__defaults__.keys():
|
||||||
if attribute not in SongFormat.get(song_format).keys():
|
if attribute not in SongFormat.get(song_format).keys():
|
||||||
# THEN: Return the default value
|
# THEN: Return the default value
|
||||||
self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.__defaults__[attribute],
|
self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.__defaults__[attribute],
|
||||||
"The returned attribute does not match the default values stored")
|
"The returned attribute does not match the default values stored")
|
||||||
|
|
||||||
def test_get_attributed_multiple_attributes(self):
|
def test_get_attributed_multiple_attributes(self):
|
||||||
"""
|
"""
|
||||||
@ -80,5 +80,5 @@ class TestSongFormat(TestCase):
|
|||||||
for song_format in SongFormat.get_format_list():
|
for song_format in SongFormat.get_format_list():
|
||||||
# THEN: Return all attributes that were specified
|
# THEN: Return all attributes that were specified
|
||||||
self.assertEquals(len(SongFormat.get(song_format, 'canDisable', 'availability')), 2,
|
self.assertEquals(len(SongFormat.get(song_format, 'canDisable', 'availability')), 2,
|
||||||
"Did not return the correct number of attributes when retrieving multiple attributes at once")
|
"Did not return the correct number of attributes"
|
||||||
|
" when retrieving multiple attributes at once")
|
||||||
|
@ -103,5 +103,3 @@ class TestProjectorEditForm(TestCase, TestMixin):
|
|||||||
'Projector edit form should be marked as existing entry')
|
'Projector edit form should be marked as existing entry')
|
||||||
self.assertTrue((item.ip is TEST1_DATA['ip'] and item.name is TEST1_DATA['name']),
|
self.assertTrue((item.ip is TEST1_DATA['ip'] and item.name is TEST1_DATA['name']),
|
||||||
'Projector edit form should have TEST1_DATA() instance to edit')
|
'Projector edit form should have TEST1_DATA() instance to edit')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user