forked from openlp/openlp
Fix notes edit not clearing between calls, added projectoreditform tests
This commit is contained in:
parent
926f89eece
commit
c596940a15
@ -132,6 +132,8 @@ class Ui_ProjectorEditForm(object):
|
|||||||
self.location_label.setText(translate('OpenLP.ProjectorEditForm', 'Location'))
|
self.location_label.setText(translate('OpenLP.ProjectorEditForm', 'Location'))
|
||||||
self.location_text.setText(self.projector.location)
|
self.location_text.setText(self.projector.location)
|
||||||
self.notes_label.setText(translate('OpenLP.ProjectorEditForm', 'Notes'))
|
self.notes_label.setText(translate('OpenLP.ProjectorEditForm', 'Notes'))
|
||||||
|
self.notes_text.selectAll()
|
||||||
|
self.notes_text.cut()
|
||||||
self.notes_text.insertPlainText(self.projector.notes)
|
self.notes_text.insertPlainText(self.projector.notes)
|
||||||
|
|
||||||
|
|
||||||
@ -158,7 +160,7 @@ class ProjectorEditForm(QDialog, Ui_ProjectorEditForm):
|
|||||||
self.button_box.helpRequested.connect(self.help_me)
|
self.button_box.helpRequested.connect(self.help_me)
|
||||||
self.button_box.rejected.connect(self.cancel_me)
|
self.button_box.rejected.connect(self.cancel_me)
|
||||||
|
|
||||||
def exec_(self, projector=None):
|
def exec_(self, projector=None, test=False):
|
||||||
if projector is None:
|
if projector is None:
|
||||||
self.projector = Projector()
|
self.projector = Projector()
|
||||||
self.new_projector = True
|
self.new_projector = True
|
||||||
@ -167,6 +169,7 @@ class ProjectorEditForm(QDialog, Ui_ProjectorEditForm):
|
|||||||
self.new_projector = False
|
self.new_projector = False
|
||||||
self.retranslateUi(self)
|
self.retranslateUi(self)
|
||||||
reply = QDialog.exec_(self)
|
reply = QDialog.exec_(self)
|
||||||
|
if not test:
|
||||||
self.projector = None
|
self.projector = None
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
|
@ -562,9 +562,8 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QWidget, Ui_ProjectorManager,
|
|||||||
return
|
return
|
||||||
self.old_projector = projector
|
self.old_projector = projector
|
||||||
projector.link.disconnect_from_host()
|
projector.link.disconnect_from_host()
|
||||||
record = self.projectordb.get_projector_by_ip(projector.link.ip)
|
self.projector_form.exec(projector.db_item)
|
||||||
self.projector_form.exec_(record)
|
projector.db_item = self.projectordb.get_projector_by_id(self.old_projector.db_item.id)
|
||||||
new_record = self.projectordb.get_projector_by_id(record.id)
|
|
||||||
|
|
||||||
def on_poweroff_projector(self, opt=None):
|
def on_poweroff_projector(self, opt=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user