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 ) :