2014-10-16 18:08:44 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2019-04-13 13:00:22 +00:00
|
|
|
##########################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# ---------------------------------------------------------------------- #
|
2022-02-01 10:10:57 +00:00
|
|
|
# Copyright (c) 2008-2022 OpenLP Developers #
|
2019-04-13 13:00:22 +00:00
|
|
|
# ---------------------------------------------------------------------- #
|
|
|
|
# This program is free software: you can redistribute it and/or modify #
|
|
|
|
# it under the terms of the GNU General Public License as published by #
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or #
|
|
|
|
# (at your option) any later version. #
|
|
|
|
# #
|
|
|
|
# This program is distributed in the hope that it will be useful, #
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
|
|
|
# GNU General Public License for more details. #
|
|
|
|
# #
|
|
|
|
# You should have received a copy of the GNU General Public License #
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
|
|
|
##########################################################################
|
2014-10-16 18:08:44 +00:00
|
|
|
"""
|
2017-10-07 07:05:07 +00:00
|
|
|
The :mod: `openlp.core.ui.projector.editform` module provides the functions for adding/editing entries in the projector
|
|
|
|
database.
|
2014-10-16 18:08:44 +00:00
|
|
|
"""
|
|
|
|
import logging
|
|
|
|
|
2015-11-07 00:49:40 +00:00
|
|
|
from PyQt5 import QtCore, QtWidgets
|
2014-10-16 18:08:44 +00:00
|
|
|
|
2022-03-29 18:29:12 +00:00
|
|
|
from openlp.core.common import verify_ip_address, Singleton
|
2017-10-07 07:05:07 +00:00
|
|
|
from openlp.core.common.i18n import translate
|
2022-03-29 18:29:12 +00:00
|
|
|
from openlp.core.projectors.constants import PJLINK_PORT, PJLINK_VALID_PORTS
|
2017-12-28 08:27:44 +00:00
|
|
|
from openlp.core.projectors.db import Projector
|
2018-10-02 04:39:42 +00:00
|
|
|
from openlp.core.ui.icons import UiIcons
|
|
|
|
|
2014-10-16 18:08:44 +00:00
|
|
|
|
2017-10-07 07:05:07 +00:00
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
log.debug('editform loaded')
|
|
|
|
|
2019-04-21 01:04:59 +00:00
|
|
|
# TODO: Fix db entries for input source(s)
|
|
|
|
|
2022-03-29 18:29:12 +00:00
|
|
|
_translate_group = 'OpenLP.ProjectorEditForm'
|
|
|
|
|
|
|
|
|
|
|
|
class MessageList(metaclass=Singleton):
|
|
|
|
"""
|
|
|
|
Consolidate the messages here. Simplify calls to QMessageBox.
|
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
self.AddressDuplicate = {'title': translate(_translate_group, 'Duplicate Address'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'IP:port combination are already in the database <br /><br />'
|
|
|
|
'Please Enter a different IP:port combination.')
|
|
|
|
}
|
|
|
|
self.DatabaseError = {'title': translate(_translate_group, 'Database Error'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'There was an error saving projector information.<br /><br />'
|
|
|
|
'See the log for the error')
|
|
|
|
}
|
|
|
|
self.DatabaseID = {'title': translate(_translate_group, 'Database ID Error'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'Mismatch between this entry and the database.<br /><br />'
|
|
|
|
'See the log for possible issues.')
|
|
|
|
}
|
|
|
|
self.DatabaseMultiple = {'title': translate(_translate_group, 'Multiple Records'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'Multiple entries found in the database<br /><br />'
|
|
|
|
'Ensure Name and/or IP/Port data is unique')
|
|
|
|
}
|
|
|
|
self.IPBlank = {'title': translate(_translate_group, 'IP Address Not Set'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'You must enter an IP address.<br /><br />'
|
|
|
|
'Please enter a valid IP address.')
|
|
|
|
}
|
|
|
|
self.IPInvalid = {'title': translate(_translate_group, 'Invalid IP Address'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'IP address is not valid.<br /><br />'
|
|
|
|
'Please enter a valid IP address.')
|
|
|
|
}
|
|
|
|
self.NameBlank = {'title': translate(_translate_group, 'Name Not Set'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'You must enter a name for this entry.<br /><br />'
|
|
|
|
'Please enter a unique name for this entry.')
|
|
|
|
}
|
|
|
|
self.NameDuplicate = {'title': translate(_translate_group, 'Duplicate Name'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'Entries must have unique names.<br /><br />'
|
|
|
|
'Please enter a different name.')
|
|
|
|
}
|
|
|
|
self.ProjectorInvalid = {'title': translate(_translate_group, 'Invalid Projector'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'Projector instance not a valid PJLink or Projector Instance'
|
|
|
|
'<br /><br />See log for issue')
|
|
|
|
}
|
|
|
|
self.PortBlank = {'title': translate(_translate_group, 'Port Not Set'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'You must enter a port number for this entry.<br /><br />'
|
|
|
|
'Please enter a valid port number.')
|
|
|
|
}
|
|
|
|
self.PortInvalid = {'title': translate(_translate_group, 'Invalid Port Number'),
|
|
|
|
'text': translate(_translate_group,
|
|
|
|
'Port numbers below 1000 are reserved for admin use only.<br />'
|
|
|
|
'Port numbers above 32767 are not currently usable.<br /><br />'
|
|
|
|
'Please enter a valid port number between 1000 and 32767 inclusive.'
|
|
|
|
f'<br /><br />Default PJLink port is {PJLINK_PORT}')
|
|
|
|
}
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def show_warning(message, form=None):
|
|
|
|
"""
|
|
|
|
Display QMessageBox.warning()
|
|
|
|
"""
|
|
|
|
return QtWidgets.QMessageBox.warning(form, message['title'], message['text'])
|
|
|
|
|
|
|
|
|
|
|
|
Message = MessageList()
|
|
|
|
|
2014-10-16 18:16:08 +00:00
|
|
|
|
2014-10-16 18:08:44 +00:00
|
|
|
class Ui_ProjectorEditForm(object):
|
|
|
|
"""
|
2014-10-21 21:50:35 +00:00
|
|
|
The :class:`~openlp.core.lib.ui.projector.editform.Ui_ProjectorEditForm` class defines
|
2014-10-16 18:08:44 +00:00
|
|
|
the user interface for the ProjectorEditForm dialog.
|
|
|
|
"""
|
2018-09-12 05:43:27 +00:00
|
|
|
def setup_ui(self, edit_projector_dialog):
|
2014-10-16 18:08:44 +00:00
|
|
|
"""
|
|
|
|
Create the interface layout.
|
|
|
|
"""
|
|
|
|
edit_projector_dialog.setObjectName('edit_projector_dialog')
|
2018-04-21 19:57:51 +00:00
|
|
|
edit_projector_dialog.setWindowIcon(UiIcons().main_icon)
|
2014-10-16 18:08:44 +00:00
|
|
|
edit_projector_dialog.setMinimumWidth(400)
|
|
|
|
edit_projector_dialog.setModal(True)
|
|
|
|
# Define the basic layout
|
2016-07-18 21:36:16 +00:00
|
|
|
self.dialog_layout = QtWidgets.QGridLayout(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.dialog_layout.setObjectName('dialog_layout')
|
|
|
|
self.dialog_layout.setSpacing(8)
|
2014-10-16 18:16:08 +00:00
|
|
|
self.dialog_layout.setContentsMargins(8, 8, 8, 8)
|
2022-03-29 18:29:12 +00:00
|
|
|
# Name
|
|
|
|
_row = 0 # If I decide to rearrange the layout again
|
|
|
|
self.name_label = QtWidgets.QLabel(edit_projector_dialog)
|
|
|
|
self.name_label.setObjectName('projector_edit_name_label')
|
|
|
|
self.name_text = QtWidgets.QLineEdit(edit_projector_dialog)
|
|
|
|
self.name_text.setObjectName('projector_edit_name_text')
|
|
|
|
self.dialog_layout.addWidget(self.name_label, _row, 0)
|
|
|
|
self.dialog_layout.addWidget(self.name_text, _row, 1)
|
2014-10-16 18:08:44 +00:00
|
|
|
# IP Address
|
2022-03-29 18:29:12 +00:00
|
|
|
_row += 1
|
2016-07-18 21:36:16 +00:00
|
|
|
self.ip_label = QtWidgets.QLabel(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.ip_label.setObjectName('projector_edit_ip_label')
|
2022-03-29 18:29:12 +00:00
|
|
|
self.ip_text = QtWidgets.QLineEdit(edit_projector_dialog)
|
|
|
|
self.ip_text.setObjectName('projector_edit_ip_text')
|
|
|
|
self.dialog_layout.addWidget(self.ip_label, _row, 0)
|
|
|
|
self.dialog_layout.addWidget(self.ip_text, _row, 1)
|
2014-10-16 18:08:44 +00:00
|
|
|
# Port number
|
2022-03-29 18:29:12 +00:00
|
|
|
_row += 1
|
2016-07-18 21:36:16 +00:00
|
|
|
self.port_label = QtWidgets.QLabel(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.port_label.setObjectName('projector_edit_ip_label')
|
2016-07-18 21:36:16 +00:00
|
|
|
self.port_text = QtWidgets.QLineEdit(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.port_text.setObjectName('projector_edit_port_text')
|
2022-03-29 18:29:12 +00:00
|
|
|
self.dialog_layout.addWidget(self.port_label, _row, 0)
|
|
|
|
self.dialog_layout.addWidget(self.port_text, _row, 1)
|
2014-10-16 18:08:44 +00:00
|
|
|
# PIN
|
2022-03-29 18:29:12 +00:00
|
|
|
_row += 1
|
2016-07-18 21:36:16 +00:00
|
|
|
self.pin_label = QtWidgets.QLabel(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.pin_label.setObjectName('projector_edit_pin_label')
|
2016-07-18 21:36:16 +00:00
|
|
|
self.pin_text = QtWidgets.QLineEdit(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.pin_label.setObjectName('projector_edit_pin_text')
|
2022-03-29 18:29:12 +00:00
|
|
|
self.dialog_layout.addWidget(self.pin_label, _row, 0)
|
|
|
|
self.dialog_layout.addWidget(self.pin_text, _row, 1)
|
2014-10-16 18:08:44 +00:00
|
|
|
# Location
|
2022-03-29 18:29:12 +00:00
|
|
|
_row += 1
|
2016-07-18 21:36:16 +00:00
|
|
|
self.location_label = QtWidgets.QLabel(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.location_label.setObjectName('projector_edit_location_label')
|
2016-07-18 21:36:16 +00:00
|
|
|
self.location_text = QtWidgets.QLineEdit(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.location_text.setObjectName('projector_edit_location_text')
|
2022-03-29 18:29:12 +00:00
|
|
|
self.dialog_layout.addWidget(self.location_label, _row, 0)
|
|
|
|
self.dialog_layout.addWidget(self.location_text, _row, 1)
|
2014-10-16 18:08:44 +00:00
|
|
|
# Notes
|
2022-03-29 18:29:12 +00:00
|
|
|
_row += 1
|
2016-07-18 21:36:16 +00:00
|
|
|
self.notes_label = QtWidgets.QLabel(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.notes_label.setObjectName('projector_edit_notes_label')
|
2016-07-18 21:36:16 +00:00
|
|
|
self.notes_text = QtWidgets.QPlainTextEdit(edit_projector_dialog)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.notes_text.setObjectName('projector_edit_notes_text')
|
2022-03-29 18:29:12 +00:00
|
|
|
self.dialog_layout.addWidget(self.notes_label, _row, 0, alignment=QtCore.Qt.AlignTop)
|
|
|
|
self.dialog_layout.addWidget(self.notes_text, _row, 1)
|
2014-10-16 18:08:44 +00:00
|
|
|
# Time for the buttons
|
2022-03-29 18:29:12 +00:00
|
|
|
self.button_box_edit = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Help |
|
|
|
|
QtWidgets.QDialogButtonBox.Save |
|
|
|
|
QtWidgets.QDialogButtonBox.Cancel)
|
|
|
|
self.dialog_layout.addWidget(self.button_box_edit, 8, 0, 1, 2)
|
|
|
|
self.button_box_view = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok)
|
|
|
|
self.dialog_layout.addWidget(self.button_box_view, 8, 0, 1, 2)
|
2014-10-16 18:08:44 +00:00
|
|
|
|
2018-09-12 05:43:27 +00:00
|
|
|
def retranslate_ui(self, edit_projector_dialog):
|
2014-10-21 20:05:35 +00:00
|
|
|
if self.new_projector:
|
2014-10-16 18:08:44 +00:00
|
|
|
title = translate('OpenLP.ProjectorEditForm', 'Add New Projector')
|
|
|
|
self.projector.port = PJLINK_PORT
|
|
|
|
else:
|
|
|
|
title = translate('OpenLP.ProjectorEditForm', 'Edit Projector')
|
|
|
|
edit_projector_dialog.setWindowTitle(title)
|
2014-10-21 21:50:35 +00:00
|
|
|
self.ip_label.setText(translate('OpenLP.ProjectorEditForm', 'IP Address'))
|
2022-03-29 18:29:12 +00:00
|
|
|
self.ip_text.setText(self.projector.ip)
|
2014-10-16 18:08:44 +00:00
|
|
|
self.port_label.setText(translate('OpenLP.ProjectorEditForm', 'Port Number'))
|
|
|
|
self.port_text.setText(str(self.projector.port))
|
|
|
|
self.pin_label.setText(translate('OpenLP.ProjectorEditForm', 'PIN'))
|
|
|
|
self.pin_text.setText(self.projector.pin)
|
|
|
|
self.name_label.setText(translate('OpenLP.ProjectorEditForm', 'Name'))
|
|
|
|
self.name_text.setText(self.projector.name)
|
|
|
|
self.location_label.setText(translate('OpenLP.ProjectorEditForm', 'Location'))
|
|
|
|
self.location_text.setText(self.projector.location)
|
|
|
|
self.notes_label.setText(translate('OpenLP.ProjectorEditForm', 'Notes'))
|
2015-01-05 18:36:10 +00:00
|
|
|
self.notes_text.clear()
|
2014-10-16 18:08:44 +00:00
|
|
|
self.notes_text.insertPlainText(self.projector.notes)
|
|
|
|
|
2014-10-16 18:16:08 +00:00
|
|
|
|
2016-07-18 21:36:16 +00:00
|
|
|
class ProjectorEditForm(QtWidgets.QDialog, Ui_ProjectorEditForm):
|
2014-10-16 18:08:44 +00:00
|
|
|
"""
|
|
|
|
Class to add or edit a projector entry in the database.
|
|
|
|
|
|
|
|
Fields that are editable:
|
2022-03-29 18:29:12 +00:00
|
|
|
name = Column(String(20))
|
|
|
|
ip = Column(String(100))
|
2014-10-16 18:08:44 +00:00
|
|
|
port = Column(String(8))
|
|
|
|
pin = Column(String(20))
|
|
|
|
location = Column(String(30))
|
|
|
|
notes = Column(String(200))
|
|
|
|
"""
|
2022-03-29 18:29:12 +00:00
|
|
|
updateProjectors = QtCore.pyqtSignal()
|
2014-10-16 18:08:44 +00:00
|
|
|
|
|
|
|
def __init__(self, parent=None, projectordb=None):
|
2022-03-29 18:29:12 +00:00
|
|
|
self.parent = parent
|
2014-10-16 18:08:44 +00:00
|
|
|
self.projectordb = projectordb
|
2022-03-29 18:29:12 +00:00
|
|
|
self.new_projector = False
|
|
|
|
super(ProjectorEditForm, self).__init__(parent,
|
|
|
|
QtCore.Qt.WindowSystemMenuHint |
|
|
|
|
QtCore.Qt.WindowTitleHint |
|
|
|
|
QtCore.Qt.WindowCloseButtonHint)
|
2018-09-12 05:43:27 +00:00
|
|
|
self.setup_ui(self)
|
2022-03-29 18:29:12 +00:00
|
|
|
self.button_box_edit.accepted.connect(self.accept_me)
|
|
|
|
self.button_box_edit.helpRequested.connect(self.help_me)
|
|
|
|
self.button_box_edit.rejected.connect(self.cancel_me)
|
|
|
|
self.button_box_view.accepted.connect(self.cancel_me)
|
2014-10-16 18:08:44 +00:00
|
|
|
|
2022-03-29 18:29:12 +00:00
|
|
|
def exec(self, projector=None, edit=True):
|
2014-10-21 20:05:35 +00:00
|
|
|
if projector is None:
|
|
|
|
self.projector = Projector()
|
|
|
|
self.new_projector = True
|
|
|
|
else:
|
2022-03-29 18:29:12 +00:00
|
|
|
if not isinstance(projector, Projector):
|
|
|
|
log.warning('edit_form() Projector type not valid for this form')
|
|
|
|
log.warning(f'editform() projector type is {type(projector)}')
|
|
|
|
return Message.show_warning(Message.ProjectorInvalid)
|
2014-10-21 20:05:35 +00:00
|
|
|
self.projector = projector
|
|
|
|
self.new_projector = False
|
2022-03-29 18:29:12 +00:00
|
|
|
|
|
|
|
self.button_box_edit.setVisible(edit)
|
|
|
|
self.button_box_view.setVisible(not edit)
|
|
|
|
self.name_text.setReadOnly(not edit)
|
|
|
|
self.ip_text.setReadOnly(not edit)
|
|
|
|
self.port_text.setReadOnly(not edit)
|
|
|
|
self.pin_text.setReadOnly(not edit)
|
|
|
|
self.location_text.setReadOnly(not edit)
|
|
|
|
self.notes_text.setReadOnly(not edit)
|
|
|
|
if edit:
|
|
|
|
self.name_text.setFocus()
|
2018-09-12 05:43:27 +00:00
|
|
|
self.retranslate_ui(self)
|
2016-07-18 21:36:16 +00:00
|
|
|
reply = QtWidgets.QDialog.exec(self)
|
2014-10-16 18:08:44 +00:00
|
|
|
return reply
|
|
|
|
|
2016-07-18 21:36:16 +00:00
|
|
|
@QtCore.pyqtSlot()
|
2014-10-16 18:08:44 +00:00
|
|
|
def accept_me(self):
|
|
|
|
"""
|
2022-03-29 18:29:12 +00:00
|
|
|
Validate inputs before accepting.
|
2014-10-16 18:08:44 +00:00
|
|
|
"""
|
|
|
|
log.debug('accept_me() signal received')
|
2022-03-29 18:29:12 +00:00
|
|
|
|
|
|
|
# Verify name
|
|
|
|
_name = self.name_text.text().strip()
|
|
|
|
|
|
|
|
if len(_name) < 1:
|
|
|
|
return Message.show_warning(message=Message.NameBlank)
|
|
|
|
_record = self.projectordb.get_projector(name=_name)
|
|
|
|
if len(_record) == 0:
|
2014-10-16 18:08:44 +00:00
|
|
|
if self.new_projector:
|
2022-03-29 18:29:12 +00:00
|
|
|
if self.projector.id is not None:
|
|
|
|
log.warning(f'editform(): No record found but projector had id={self.projector.id}')
|
|
|
|
return Message.show_warning(message=Message.DatabaseError)
|
2014-10-16 18:08:44 +00:00
|
|
|
else:
|
2022-03-29 18:29:12 +00:00
|
|
|
if self.projector.name.strip() == _name:
|
|
|
|
log.warning(f'editform(): No record found when there should be name="{_name}"')
|
|
|
|
return Message.show_warning(message=Message.DatabaseError)
|
|
|
|
elif len(_record) == 1 and self.new_projector:
|
|
|
|
log.warning(f'editform(): Name "{_name}" already in database')
|
|
|
|
return Message.show_warning(message=Message.NameDuplicate)
|
|
|
|
elif len(_record) > 1:
|
|
|
|
log.warning(f'editform(): Multiple records found for name "{_name}"')
|
|
|
|
for item in _record:
|
|
|
|
log.warning(f'editform() Found record={item.id} name="{item.name}"')
|
|
|
|
return Message.show_warning(message=Message.DatabaseMultiple)
|
|
|
|
|
|
|
|
# Verify IP address
|
|
|
|
_ip = self.ip_text.text().strip()
|
|
|
|
if len(_ip) < 1:
|
|
|
|
return Message.show_warning(message=Message.IPBlank)
|
|
|
|
elif not verify_ip_address(_ip):
|
|
|
|
return Message.show_warning(message=Message.IPInvalid)
|
|
|
|
|
|
|
|
# Verify valid port
|
|
|
|
_port = self.port_text.text().strip()
|
|
|
|
if len(_port) < 1:
|
|
|
|
return Message.show_warning(message=Message.PortBlank)
|
|
|
|
elif not _port.isdecimal():
|
|
|
|
return Message.show_warning(message=Message.PortInvalid)
|
|
|
|
elif int(_port) not in PJLINK_VALID_PORTS:
|
|
|
|
return Message.show_warning(message=Message.PortInvalid)
|
|
|
|
_port = int(_port)
|
|
|
|
|
|
|
|
# Verify valid ip:port address
|
|
|
|
check = self.projectordb.get_projector(ip=_ip, port=str(_port))
|
|
|
|
if len(check) == 1:
|
|
|
|
if self.projector.id != check[0].id:
|
|
|
|
log.warning(f'editform(): Address already in database {_ip}:{_port}')
|
|
|
|
return Message.show_warning(message=Message.AddressDuplicate)
|
|
|
|
elif len(check) > 1:
|
|
|
|
log.warning(f'editform(): Multiple records found for {_ip}:{_port}')
|
|
|
|
for chk in check:
|
|
|
|
log.warning(f'editform(): record={chk.id} name="{chk.name}" adx={chk.ip}:{chk.port}')
|
|
|
|
return Message.show_warning(message=Message.DatabaseMultiple)
|
|
|
|
|
|
|
|
self.projector.name = _name
|
|
|
|
self.projector.ip = _ip
|
|
|
|
self.projector.port = _port
|
|
|
|
self.projector.pin = self.pin_text.text()
|
|
|
|
self.projector.location = self.location_text.text()
|
|
|
|
self.projector.notes = self.notes_text.toPlainText()
|
|
|
|
# TODO: Update calls when update_projector fixed
|
|
|
|
if self.new_projector:
|
|
|
|
_saved = self.projectordb.add_projector(self.projector)
|
|
|
|
else:
|
|
|
|
_saved = self.projectordb.update_projector(self.projector)
|
|
|
|
if not _saved:
|
|
|
|
return Message.show_warning(message=Message.DatabaseError)
|
|
|
|
|
|
|
|
self.updateProjectors.emit()
|
|
|
|
self.projector = None
|
|
|
|
self.close()
|
2014-10-16 18:08:44 +00:00
|
|
|
|
2016-07-18 21:36:16 +00:00
|
|
|
@QtCore.pyqtSlot()
|
2014-10-16 18:08:44 +00:00
|
|
|
def help_me(self):
|
|
|
|
"""
|
|
|
|
Show a help message about the input fields.
|
|
|
|
"""
|
|
|
|
log.debug('help_me() signal received')
|
|
|
|
|
2016-07-18 21:36:16 +00:00
|
|
|
@QtCore.pyqtSlot()
|
2014-10-16 18:08:44 +00:00
|
|
|
def cancel_me(self):
|
|
|
|
"""
|
|
|
|
Cancel button clicked - just close.
|
|
|
|
"""
|
|
|
|
log.debug('cancel_me() signal received')
|
|
|
|
self.close()
|