def __init__(self, table_group, parent, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) vbox = QVBoxLayout() vbox.addWidget(FBoxTitle(u"Ajout d'un nouveau groupe")) self.parent = table_group self.name = LineEdit() formbox = QGridLayout() self.error_field = FLabel(u"") formbox.addWidget(self.error_field, 0, 1) formbox.addWidget(FLabel(u"Nom"), 1, 0) formbox.addWidget(self.name, 1, 1) butt = Button(u"Enregistrer") butt.clicked.connect(self.edit_prod) cancel_but = Button(u"Annuler") cancel_but.clicked.connect(self.cancel) formbox.addWidget(butt, 2, 1) formbox.addWidget(cancel_but, 2, 0) formbox.setColumnStretch(3, 3) formbox.setRowStretch(2, 2) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, table_group, parent, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) self.parent = table_group group_id = self.parent.table_group.group.group_id self.group = Group.select().where(Group.id == group_id).get() vbox = QVBoxLayout() vbox.addWidget( FBoxTitle(u"<h3>Groupe: {}</h3>".format(self.group.name))) self.order_number = LineEdit() # form transfer self.amount = LineEdit() self.amount.setFont(QFont("Arial", 15)) self.amount.setValidator(QIntValidator()) self.amount.setToolTip(u"Taper le montant du transfert") # self.solde = FLabel(get_solde()) self.amount_error = ErrorLabel(u"") send_butt = Button(u"Envoyer") send_butt.clicked.connect(self.sender) cancel_but = Button(u"Annuler") cancel_but.clicked.connect(self.cancel) formbox = QGridLayout() formbox.addWidget(FLabel(u"Montant: "), 0, 0) formbox.addWidget(self.amount, 0, 1) formbox.addWidget(send_butt, 2, 1) formbox.addWidget(cancel_but, 2, 0) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, parent, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) vbox = QVBoxLayout() vbox.addWidget(FBoxTitle(u" Configuration ")) self.sttg = LocalSetting.get(LocalSetting.slug == 1) self.baudrate = LineEdit(self.sttg.baudrate) self.code_consultation = LineEdit(self.sttg.code_consultation) self.code_send = LineEdit(self.sttg.code_send) self.code_send.setEchoMode(LineEdit.Password) self.port = LineEdit(self.sttg.port) formbox = QGridLayout() formbox.addWidget(FLabel(u"Mon de passe"), 1, 0) formbox.addWidget(self.baudrate, 1, 1) formbox.addWidget(FLabel(u"Consultation"), 2, 0) formbox.addWidget(self.code_consultation, 2, 1) formbox.addWidget(FLabel(u"Code envoi"), 3, 0) formbox.addWidget(self.code_send, 3, 1) formbox.addWidget(FLabel(u"PORT"), 4, 0) formbox.addWidget(self.port, 4, 1) butt = Button(u"Enregistrer") butt.clicked.connect(self.edit_prod) cancel_but = Button(u"Annuler") cancel_but.clicked.connect(self.cancel) formbox.addWidget(butt, 5, 1) formbox.addWidget(cancel_but, 5, 0) formbox.setColumnStretch(3, 3) formbox.setRowStretch(2, 2) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, parent=0, *args, **kwargs): super(ContactViewWidget, self).__init__(parent=parent, *args, **kwargs) self.parent = parent self.parentWidget().setWindowTitle(Config.NAME_ORGA + u"Carnet d'adresse") hbox = QHBoxLayout(self) self.table_contact = ContactTableWidget(parent=self) self.table_group = GroupTableWidget(parent=self) self.table_transf = TransfTableWidget(parent=self) self.operation = OperationWidget(parent=self) splitter = QSplitter(Qt.Horizontal) self.splitter_left = QSplitter(Qt.Vertical) self.splitter_left.addWidget(FBoxTitle(u"Les groupes")) self.splitter_left.addWidget(self.table_group) splitter_details = QSplitter(Qt.Horizontal) splitter_down = QSplitter(Qt.Vertical) splitter_down.addWidget(self.operation) splitter_transf = QSplitter(Qt.Horizontal) splitter_transf.addWidget(self.table_transf) splt_contact = QSplitter(Qt.Vertical) splt_contact.addWidget(FBoxTitle(u"Les contactes")) splt_contact.addWidget(self.table_contact) splt_contact.resize(900, 1000) self.splitter_left.addWidget(splitter_down) splitter_details.addWidget(splitter_transf) splt_contact.addWidget(splitter_details) splitter.addWidget(self.splitter_left) splitter.addWidget(splt_contact) hbox.addWidget(splitter) self.setLayout(hbox)
def __init__(self, parent=0, *args, **kwargs): super(DashbordViewWidget, self).__init__(parent=parent, *args, **kwargs) self.parentWidget().setWindowTitle(Config.APP_NAME + u" TABLEAU DE BORD") self.parent = parent vbox = QVBoxLayout() table_invoice = QVBoxLayout() table_buying = QVBoxLayout() self.search_field = LineEdit() self.search_field.setPlaceholderText( "Taper un nom client ou num. facture") self.search_field.setMaximumSize( 500, self.search_field.maximumSize().height()) self.search_field.textChanged.connect(self.finder) self.title = FPageTitle("TABLEAU DE BORD") self.title_buying = FBoxTitle(u"L'arivages ") self.table_buying = BuyTableWidget(parent=self) table_buying.addWidget(self.title_buying) table_buying.addWidget(self.table_buying) self.title_invoice = FBoxTitle(u"Les Factures") self.table_invoice = InvoiceTableWidget(parent=self) table_invoice.addWidget(self.search_field) table_invoice.addWidget(self.table_invoice) tab_widget = tabbox((table_invoice, u"Factures"), (table_buying, u"Arivages ")) vbox.addWidget(self.title) vbox.addWidget(tab_widget) self.setLayout(vbox)
def __init__(self, parent=0, *args, **kwargs): super(DashbordViewWidget, self).__init__( parent=parent, *args, **kwargs) self.parentWidget().set_window_title("TABLEAU DE BORD") self.parent = parent vbox = QVBoxLayout() # self.resize(self.wc, self.hc) self.title = FPageTitle("TABLEAU DE BORD") self.title_alert = FBoxTitle(u"Les alertes") jinja = Environment(loader=FileSystemLoader('static')) template = jinja.get_template('chart.html') cc_list = CooperativeCompanie.select().order_by('-start_date') dataset = { "wc": self.width(), "hc": self.height(), "toal_scoop": cc_list.count(), "sc_coop_ca": cc_list.where(CooperativeCompanie.forme == "b").count(), "sc_scoops": cc_list.where(CooperativeCompanie.forme == "a").count(), "union": cc_list.where(CooperativeCompanie.forme == "bv").count(), "federation": cc_list.where(CooperativeCompanie.forme == "bf").count(), "confederation": cc_list.where(CooperativeCompanie.forme == "bc").count(), } graph1 = template.render(base_url=ROOT_DIR, data=dataset) template2 = jinja.get_template('table.html') table_html = template2.render(base_url=ROOT_DIR, dataset=dataset) web_graphic = QWebView() web_graphic.setHtml(graph1) tab_graphic = QVBoxLayout() # tab_graphic.setMargin(20) tab_graphic.addWidget(web_graphic) web_table = QWebView() web_table.setHtml(table_html) tab_table = QVBoxLayout() tab_table.addWidget(web_table) tab_widget = tabbox((tab_graphic, u"Graphique"), (tab_table, u"Tableau")) # tab_widget1 = tabbox((tab_table, u"Tableau")) vbox.addWidget(self.title) vbox.addWidget(tab_widget) # vbox.addWidget(tab_widget1) self.setLayout(vbox)
def __init__(self, parent, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) vbox = QVBoxLayout() vbox.addWidget(FBoxTitle(u"<h3>Ajout de contact </h3>")) self.combo_grp = QComboBox() groups = Group() groups.name = "Aucun" self.list_grp = Group.all() self.list_grp.append(groups) self.list_grp.reverse() for index in self.list_grp: sentence = u"%(name)s" % {'name': index.name} self.combo_grp.addItem(sentence) self.full_name = LineEdit() self.msg_e_or_c = FLabel("") self.full_name.setFont(QFont("Arial", 16)) self.phone_number = IntLineEdit() self.phone_number.setInputMask("D9.99.99.99") self.phone_number.setAlignment(Qt.AlignCenter) self.phone_number.setFont(QFont("Arial", 16)) send_butt = Button(u"Enregistrer") send_butt.clicked.connect(self.save_form) cancel_but = Button(u"Fermer") cancel_but.clicked.connect(self.cancel) formbox = QGridLayout() formbox.addWidget(FLabel(u"Groupes:"), 0, 0) formbox.addWidget(self.combo_grp, 1, 0) formbox.addWidget(FLabel(u"Nom complèt: "), 0, 1) formbox.addWidget(self.full_name, 1, 1) formbox.addWidget(FLabel(u"Numéro: "), 0, 2) formbox.addWidget(self.phone_number, 1, 2) formbox.addWidget(send_butt, 2, 1) formbox.addWidget(cancel_but, 2, 0) formbox.addWidget(self.msg_e_or_c, 3, 0, 3, 2) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, table_group, parent, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) self.parent = table_group group_id = self.parent.table_group.group.group_id self.group = Group.select().where(Group.id == group_id).get() vbox = QVBoxLayout() vbox.addWidget( FBoxTitle( u"<h2>Envoi pour les ({0}) contactes du groupe <b>{1}</b></h2>" .format(len(self.group.contacts), self.group.name))) # form transfer self.amount = LineEdit() self.amount.setFont(QFont("Arial", 15)) self.amount.setValidator(QIntValidator()) self.amount.setToolTip(u"Taper le montant du transfert") self.amount_error = ErrorLabel(u"") self.password_field = EnterTabbedLineEdit() self.password_field.setEchoMode(LineEdit.Password) self.password_field.setToolTip(u"Taper le code orange money") self.send_butt = Button(u"Envoyer") self.send_butt.clicked.connect(self.sender) cancel_but = Button(u"Annuler") cancel_but.clicked.connect(self.cancel) formbox = QGridLayout() formbox.addWidget(FLabel(u"Montant: "), 0, 0) formbox.addWidget(self.amount, 0, 1) formbox.addWidget(FLabel(u"Code: "), 1, 0) formbox.addWidget(self.password_field, 1, 1) formbox.addWidget(self.send_butt, 2, 1) formbox.addWidget(cancel_but, 2, 0) self.isvalid() vbox.addLayout(formbox) self.setLayout(vbox)