forked from openlp/openlp
Remove settings for confirm delete
This commit is contained in:
parent
30b56d6fee
commit
231c47db53
@ -47,32 +47,17 @@ class CustomTab(SettingsTab):
|
||||
self.displayFooterCheckBox.setObjectName(u'displayFooterCheckBox')
|
||||
self.customModeLayout.addRow(self.displayFooterCheckBox)
|
||||
self.leftLayout.addWidget(self.customModeGroupBox)
|
||||
self.customUIGroupBox = QtGui.QGroupBox(self.leftColumn)
|
||||
self.customUIGroupBox.setObjectName(u'customUIGroupBox')
|
||||
self.customUILayout = QtGui.QFormLayout(self.customUIGroupBox)
|
||||
self.customUILayout.setObjectName(u'customUILayout')
|
||||
self.confirmDeleteCheckBox = QtGui.QCheckBox(self.customUIGroupBox)
|
||||
self.confirmDeleteCheckBox.setObjectName(u'confirmDeleteCheckBox')
|
||||
self.customUILayout.addRow(self.confirmDeleteCheckBox)
|
||||
self.leftLayout.addWidget(self.customUIGroupBox)
|
||||
self.leftLayout.addStretch()
|
||||
self.rightLayout.addStretch()
|
||||
QtCore.QObject.connect(self.displayFooterCheckBox,
|
||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||
self.onDisplayFooterCheckBoxChanged)
|
||||
QtCore.QObject.connect(self.confirmDeleteCheckBox,
|
||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||
self.onConfirmDeleteCheckBoxChanged)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.customModeGroupBox.setTitle(translate('CustomPlugin.CustomTab',
|
||||
'Custom Display'))
|
||||
self.displayFooterCheckBox.setText(
|
||||
translate('CustomPlugin.CustomTab', 'Display footer'))
|
||||
self.customUIGroupBox.setTitle(translate('CustomPlugin.CustomTab',
|
||||
'UI Settings'))
|
||||
self.confirmDeleteCheckBox.setText(
|
||||
translate('CustomPlugin.CustomTab', 'Confirm delete'))
|
||||
|
||||
def onDisplayFooterCheckBoxChanged(self, check_state):
|
||||
self.displayFooter = False
|
||||
@ -80,24 +65,12 @@ class CustomTab(SettingsTab):
|
||||
if check_state == QtCore.Qt.Checked:
|
||||
self.displayFooter = True
|
||||
|
||||
def onConfirmDeleteCheckBoxChanged(self, check_state):
|
||||
self.confirmDelete = False
|
||||
# we have a set value convert to True/False
|
||||
if check_state == QtCore.Qt.Checked:
|
||||
self.confirmDelete = True
|
||||
|
||||
def load(self):
|
||||
self.displayFooter = QtCore.QSettings().value(
|
||||
self.settingsSection + u'/display footer',
|
||||
QtCore.QVariant(True)).toBool()
|
||||
self.displayFooterCheckBox.setChecked(self.displayFooter)
|
||||
self.confirmDelete = QtCore.QSettings().value(
|
||||
self.settingsSection + u'/confirm delete',
|
||||
QtCore.QVariant(True)).toBool()
|
||||
self.confirmDeleteCheckBox.setChecked(self.confirmDelete)
|
||||
|
||||
def save(self):
|
||||
QtCore.QSettings().setValue(self.settingsSection + u'/display footer',
|
||||
QtCore.QVariant(self.displayFooter))
|
||||
QtCore.QSettings().setValue(self.settingsSection + u'/confirm delete',
|
||||
QtCore.QVariant(self.confirmDelete))
|
||||
|
@ -200,20 +200,16 @@ class CustomMediaItem(MediaManagerItem):
|
||||
Remove a custom item from the list and database
|
||||
"""
|
||||
if check_item_selected(self.listView, UiStrings().SelectDelete):
|
||||
self.confirmDelete = QtCore.QSettings().value(
|
||||
self.settingsSection + u'/confirm delete',
|
||||
QtCore.QVariant(u'False')).toBool()
|
||||
items = self.listView.selectedIndexes()
|
||||
if self.confirmDelete:
|
||||
if QtGui.QMessageBox.question(self,
|
||||
translate('CustomPlugin.MediaItem', 'Delete Custom(s)?'),
|
||||
translate('CustomPlugin.MediaItem',
|
||||
'Are you sure you want to delete the %n selected custom(s)?', '',
|
||||
QtCore.QCoreApplication.CodecForTr, len(items)),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok |
|
||||
QtGui.QMessageBox.Cancel),
|
||||
QtGui.QMessageBox.Ok) == QtGui.QMessageBox.Cancel:
|
||||
return
|
||||
if QtGui.QMessageBox.question(self,
|
||||
translate('CustomPlugin.MediaItem', 'Delete Custom(s)?'),
|
||||
translate('CustomPlugin.MediaItem',
|
||||
'Are you sure you want to delete the %n selected custom(s)?', '',
|
||||
QtCore.QCoreApplication.CodecForTr, len(items)),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok |
|
||||
QtGui.QMessageBox.Cancel),
|
||||
QtGui.QMessageBox.Ok) == QtGui.QMessageBox.Cancel:
|
||||
return
|
||||
row_list = [item.row() for item in self.listView.selectedIndexes()]
|
||||
row_list.sort(reverse=True)
|
||||
id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
|
Loading…
Reference in New Issue
Block a user