
Public Member Functions | |
| def | __init__ |
| def | setup_ui |
| def | create_qoid |
| def | fetch_form |
| def | fetch_context |
| def | apply_value |
| def | apply |
| def | accept |
| def | exec_ |
| def | fill |
| def | fill_context |
Public Attributes | |
| entity | |
| context | |
| value | |
Static Public Attributes | |
| model = None | |
| list | properties = [] |
| list | ro_fields = [] |
| def py::gui::editor::entity_editor::__init__ | ( | self, | ||
| parent, | ||||
| entity, | ||||
context = None | ||||
| ) |
Reimplemented in py::gui::editor::editor_editor, py::gui::editor::collection_editor, py::gui::editor::series_editor, py::gui::editor::author_editor, and py::gui::editor::album.
00131 : 00132 QDialog.__init__(self, parent) 00133 self.entity = entity 00134 self.context = context 00135 self.setup_ui() 00136 self.value = None 00137 def setup_ui( self ) :
| def py::gui::editor::entity_editor::setup_ui | ( | self | ) |
Reimplemented in py::gui::editor::album.
00138 : 00139 self.setupUi(self) 00140 self.fill_context() 00141 if self.entity : 00142 self.okButton.setText(_("Modify")) 00143 self.fill() 00144 else : 00145 self.okButton.setText(_("Create")) 00146 00147 for n in self.ro_fields : 00148 f = getattr(self,n) 00149 p = f.palette() 00150 p.setColor(QPalette.Text,p.windowText().color()) 00151 p.setColor(QPalette.Base,p.window().color()) 00152 f.setPalette(p) 00153 def create_qoid( self, form ) :
| def py::gui::editor::entity_editor::create_qoid | ( | self, | ||
| form | ||||
| ) |
| def py::gui::editor::entity_editor::fetch_form | ( | self, | ||
| form | ||||
| ) |
Reimplemented in py::gui::editor::album.
00157 : 00158 for p in self.properties : 00159 form[p] = unicode(getattr(self,p).text()).strip() 00160 def fetch_context( self, form ) :
| def py::gui::editor::entity_editor::fetch_context | ( | self, | ||
| form | ||||
| ) |
| def py::gui::editor::entity_editor::apply_value | ( | self, | ||
| entity | ||||
| ) |
| def py::gui::editor::entity_editor::apply | ( | self, | ||
| form | ||||
| ) |
Reimplemented in py::gui::editor::author_editor.
00167 : 00168 def _apply() : 00169 self.apply_value(self.value) 00170 gui.models.manager.update_entity(self.value) 00171 00172 if self.entity : 00173 # overlay existing entity 00174 if self.entity.overlay(**form) : 00175 self.value = self.entity 00176 _apply() 00177 else : 00178 # create entity 00179 self.fetch_context(form) 00180 qoid = self.model.create_qoid(**form) 00181 self.value = self.model.make_overlay(qoid, **form) 00182 _apply() 00183 00184 @gui.dialog.show_failure def accept( self ) :
| def py::gui::editor::entity_editor::accept | ( | self | ) |
00185 : 00186 # fetch values 00187 form = {} 00188 self.fetch_form(form) 00189 self.apply(form) 00190 return QDialog.accept(self) 00191 def exec_( self ) :
| def py::gui::editor::entity_editor::exec_ | ( | self | ) |
| def py::gui::editor::entity_editor::fill | ( | self | ) |
| def py::gui::editor::entity_editor::fill_context | ( | self | ) |
py::gui::editor::entity_editor::model = None [static] |
list py::gui::editor::entity_editor::properties = [] [static] |
list py::gui::editor::entity_editor::ro_fields = [] [static] |
Reimplemented in py::gui::editor::collection_editor, and py::gui::editor::series_editor.
Reimplemented in py::gui::editor::author_editor.
Reimplemented in py::gui::editor::author_editor.
1.5.3