py::gui::configure::colors Class Reference

List of all members.

Public Member Functions

def __init__
def setup_ui
def changed
def apply
def accept

Public Attributes

 vboxlayout
 label
 color
 hboxlayout
 accept_button
 apply_button
 reject_button


Member Function Documentation

def py::gui::configure::colors::__init__ (   self,
  parent = None 
)

00038                                             :
00039                 QDialog.__init__(self, parent)
00040                 self.setup_ui()
00041         
        def setup_ui( self ) :

def py::gui::configure::colors::setup_ui (   self  ) 

00042                              :
00043                 self.setWindowTitle(_("Configure colors[*]"))
00044 
00045                 self.vboxlayout = QVBoxLayout(self)
00046 
00047                 self.label = QLabel(_("Configure colors"),self)
00048                 font = QFont(self.label.font())
00049                 font.setPointSize(20)
00050                 font.setBold(True)
00051                 self.label.setFont(font)
00052                 self.vboxlayout.addWidget(self.label)
00053 
00054                 self.color = {
00055                         "series" : gui.widget.color_edit_inline(_("My series")),
00056                         "completed_series" : gui.widget.color_edit_inline(_("Completed series")),
00057                         "not_published" : gui.widget.color_edit_inline(_("Next out"))
00058                 }
00059 
00060                 for library_type in [qodb.cte.main_library_type, qodb.cte.shopping_list_type] :
00061                         for library in Library.objects.filter(type=library_type).order_by('id') :
00062                                 key = "library%d"%library.id
00063                                 self.color[key] = gui.widget.color_edit_inline(library.name)
00064                                 self.vboxlayout.addWidget(self.color[key])
00065 
00066                 self.vboxlayout.addWidget(self.color["series"])
00067                 self.vboxlayout.addWidget(self.color["completed_series"])
00068                 self.vboxlayout.addWidget(self.color["not_published"])
00069 
00070                 self.hboxlayout = QHBoxLayout()
00071                 self.hboxlayout.addItem(QSpacerItem(0,0,QSizePolicy.Expanding,QSizePolicy.Minimum))
00072 
00073                 self.accept_button = QPushButton(_("Ok"))
00074                 self.apply_button = QPushButton(_("Apply"))
00075                 self.apply_button.setEnabled(False)
00076                 self.reject_button = QPushButton(_("Cancel"))
00077 
00078                 self.hboxlayout.addWidget(self.accept_button)
00079                 self.hboxlayout.addWidget(self.apply_button)
00080                 self.hboxlayout.addWidget(self.reject_button)
00081 
00082                 self.vboxlayout.addLayout(self.hboxlayout)
00083 
00084                 for name, color in self.color.iteritems() :
00085                         color.set_color(*qocfg.get_color(name))
00086                         QObject.connect(color, SIGNAL("changed"), self.changed)
00087                 QObject.connect(self.reject_button, SIGNAL("clicked()"), self.reject)
00088                 QObject.connect(self.accept_button, SIGNAL("clicked()"), self.accept)
00089                 QObject.connect(self.apply_button, SIGNAL("clicked()"), self.apply)
00090         
        def changed( self ) :

def py::gui::configure::colors::changed (   self  ) 

00091                             :
00092                 self.setWindowModified(True)
00093                 self.apply_button.setEnabled(True)
00094 
00095         @gui.dialog.show_failure
        def apply( self ) :

def py::gui::configure::colors::apply (   self  ) 

00096                           :
00097                 for name, input in self.color.iteritems() :
00098                         qocfg.set_color(name, *input.get_color())
00099                 gui.models.manager.update_colors()
00100 
        def accept( self ) :

def py::gui::configure::colors::accept (   self  ) 

00101                            :
00102                 if self.isWindowModified() :
00103                         self.apply()
00104                 QDialog.accept(self)
00105 
00106 
class mirrors( Ui_configure_mirrors, QDialog ) :


Member Data Documentation

py::gui::configure::colors::vboxlayout

py::gui::configure::colors::label

py::gui::configure::colors::color

py::gui::configure::colors::hboxlayout

py::gui::configure::colors::accept_button

py::gui::configure::colors::apply_button

py::gui::configure::colors::reject_button


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