py::gui::editor::entity_editor Class Reference

Inheritance diagram for py::gui::editor::entity_editor:

Inheritance graph
[legend]

List of all members.

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 = []


Member Function Documentation

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 
)

00154                                       :
00155                 return self.model.create_qoid(**form)
00156         
        def fetch_form( 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 
)

Reimplemented in py::gui::editor::collection_editor, and py::gui::editor::series_editor.

00161                                         :
00162                 pass
00163         
        def apply_value( self, entity ) :

def py::gui::editor::entity_editor::apply_value (   self,
  entity 
)

Reimplemented in py::gui::editor::album.

00164                                         :
00165                 pass
00166 
        def apply( self, form ) :

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  ) 

00192                           :
00193                 if QDialog.exec_(self) :
00194                         return self.value
00195 
        def fill( self ) :

def py::gui::editor::entity_editor::fill (   self  ) 

00196                          :
00197                 for p in self.properties :
00198                         getattr(self,p).setText(getattr(self.entity,p))
00199         
        def fill_context( self ) :

def py::gui::editor::entity_editor::fill_context (   self  ) 

Reimplemented in py::gui::editor::collection_editor, and py::gui::editor::series_editor.

00200                                  :
00201                 pass
00202 
00203 
class editor_editor( entity_editor, Ui_editor_editor ) :


Member Data Documentation

py::gui::editor::entity_editor::model = None [static]

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.

list py::gui::editor::entity_editor::properties = [] [static]

Reimplemented in py::gui::editor::editor_editor, py::gui::editor::collection_editor, py::gui::editor::series_editor, and py::gui::editor::author_editor.

list py::gui::editor::entity_editor::ro_fields = [] [static]

Reimplemented in py::gui::editor::collection_editor, and py::gui::editor::series_editor.

py::gui::editor::entity_editor::entity

Reimplemented in py::gui::editor::author_editor.

py::gui::editor::entity_editor::context

py::gui::editor::entity_editor::value

Reimplemented in py::gui::editor::author_editor.


The documentation for this class was generated from the following file:
Generated on Tue Oct 9 20:40:26 2007 for Qomics by  doxygen 1.5.3