Beispiel #1
0
 def __init__(self, parent):
     super(DayMenu, self).__init__(parent=parent)
     self.set_background_color(color_bleu_gris)
     self.master_hbox = QHBoxLayout()
     self.left_hbox = QHBoxLayout()
     self.center_hbox = QHBoxLayout()
     self.right_hbox = QHBoxLayout()
     self.bt_jour_plus = PixmapButton(parent=self)
     self.bt_jour_moins = PixmapButton(parent=self)
     self.label_date = QLabel()
     self.init_widget()
Beispiel #2
0
 def __init__(self, parent=None):
     super(TeamGestionMenu, self).__init__(parent=parent)
     self.background_color = color_bleu_gris
     self.hbox = QHBoxLayout(self)
     self.bt_plus = PixmapButton(parent=self)
     self.bt_moins = PixmapButton(parent=self)
     self.label_date = QLabel()
     self.label_type_stat = QLabel("Gestion des équipes")
     self.init_button()
     self.init_widget()
     self.update_button()
     self.update_label()
Beispiel #3
0
 def __init__(self, parent):
     super(ChartMenu, self).__init__(parent=parent)
     self.set_background_color(color_bleu_gris)
     self.bt_jour_plus = PixmapButton(parent=self)
     self.bt_jour_moins = PixmapButton(parent=self)
     self.bt_zoom_plus = PixmapButton(parent=self)
     self.bt_zoom_moins = PixmapButton(parent=self)
     self.bt_live = QPushButton("En direct")
     self.label_date = QLabel()
     self.live_speed = LiveSpeed(self)
     self.init_widget()
     self.update_label()
     self.update_button()
Beispiel #4
0
 def __init__(self, parent=None):
     super(RapportMenu, self).__init__(parent=parent)
     self.background_color = color_bleu_gris
     self.bt_impression = PixmapButton(parent=self)
     self.bt_save = PixmapButton(parent=self)
     self.bt_jour_plus = PixmapButton(parent=self)
     self.bt_jour_moins = PixmapButton(parent=self)
     self.bt_live = QPushButton("Aujourd'hui")
     self.label_date = QLabel()
     self.rapport = Rapport(parent=self)
     self.rapport.hide()
     self.init_button()
     self.init_widget()
     self.update_button()
     self.update_label()
 def update_widget(self):
     print("update_widget")
     clear_layout(self.master_hbox)
     self.clear_bt = PixmapButton(parent=self)
     self.init_button()
     self.master_hbox.addLayout(self.get_content())
     if self.data_type != "bobine":
         self.master_hbox.addWidget(self.clear_bt)
 def __init__(self, data_type, callback, parent=None):
     super(BlocSelected, self).__init__(parent=parent)
     self.background_color = color_blanc
     self.set_border(color=color_noir)
     self.data_type = data_type
     self.parent = parent
     self.callback = callback
     self.master_hbox = QHBoxLayout()
     self.master_hbox.setContentsMargins(0, 0, 10, 0)
     self.clear_bt = PixmapButton(parent=self)
     self.init_button()
     self.init_ui()
Beispiel #7
0
    def init_widget(self):
        self.hbox.setContentsMargins(0, 0, 0, 0)
        self.hbox.setSpacing(0)

        bt_acceuil = PixmapButton("Production")
        bt_acceuil.setFixedWidth(self.WIDTH_BT)
        self.list_bt["prod"] = bt_acceuil
        bt_acceuil.clicked.connect(lambda: self.on_click("prod"))
        self.hbox.addWidget(bt_acceuil)

        self.bt_stat.setFixedWidth(self.WIDTH_BT)
        self.bt_stat.hide()
        self.list_bt["chart_stat"] = self.bt_stat
        self.bt_stat.clicked.connect(lambda: self.on_click("chart_stat"))
        self.hbox.addWidget(self.bt_stat)

        self.bt_rapport.setFixedWidth(self.WIDTH_BT)
        self.bt_rapport.hide()
        self.list_bt["rapport"] = self.bt_rapport
        self.bt_rapport.clicked.connect(lambda: self.on_click("rapport"))
        self.hbox.addWidget(self.bt_rapport)

        # self.bt_team_gestion.setFixedWidth(self.WIDTH_BT)
        # self.bt_team_gestion.hide()
        # self.list_bt["team_gestion"] = self.bt_team_gestion
        # self.bt_team_gestion.clicked.connect(lambda: self.on_click("team_gestion"))
        # self.hbox.addWidget(self.bt_team_gestion)

        self.hbox.addStretch(1)
        self.label_user.setStyleSheet(white_16_label_stylesheet)
        self.hbox.addWidget(self.label_user)
        bt_user = PixmapButton(parent=self)
        bt_user.addImage("commun/assets/images/user_icon.png")
        bt_user.setStyleSheet(button_green_stylesheet)
        bt_user.setFixedSize(self.height(), self.height())
        bt_user.clicked.connect(self.on_click_user)
        self.hbox.addWidget(bt_user)
        self.setLayout(self.hbox)
Beispiel #8
0
 def create_line_raison(self, raison, first_type):
     """
     S'occupe de créer une ligne associé a une raison
     :return: Le layout de la ligne
     """
     hbox = QHBoxLayout()
     # On met le label et la croix en couleur en fonction du type
     if raison.type == "Prévu":
         label_stylesheet = blue_title_label_stylesheet
         bt_cross_stylesheet = button_blue_cross_stylesheet
     elif raison.type == "Imprévu":
         label_stylesheet = red_title_label_stylesheet
         bt_cross_stylesheet = button_red_cross_stylesheet
     else:
         label_stylesheet = gray_title_label_stylesheet
         bt_cross_stylesheet = button_gray_cross_stylesheet
     # On regarde si le type est égale au first type pour ajouter le radiobutton si besoin
     if raison.type == first_type and raison.type != "Nettoyage":
         radio_bt = RadioButton(parent=self)
         radio_bt.is_selected = raison.primaire == 1
         radio_bt.setStyleSheet(bt_cross_stylesheet)
         self.radio_button_manager.add(radio_bt)
         radio_bt.setFixedSize(self.HEIGHT_LINE, self.HEIGHT_LINE)
         hbox.addWidget(radio_bt, alignment=Qt.AlignVCenter)
     # Création du label type
     type_label = QLabel(raison.type)
     type_label.setStyleSheet(label_stylesheet)
     type_label.setAlignment(Qt.AlignCenter)
     type_label.setFixedWidth(self.WIDTH_TYPE)
     type_label.setFixedHeight(self.HEIGHT_LINE)
     # On ajoute le label au layout
     hbox.addWidget(type_label)
     # Création du label raison
     raison_label = QLabel(raison.raison)
     # On met le label en couleur en fonction du type et on définit la largeur
     raison_label.setStyleSheet(label_stylesheet)
     raison_label.setFixedHeight(self.HEIGHT_LINE)
     # On ajoute le label au layout
     hbox.addWidget(raison_label)
     # On crée un bouton pour supprimer la ligne
     bt_cross = PixmapButton(parent=self)
     bt_cross.setFixedSize(self.HEIGHT_LINE, self.HEIGHT_LINE)
     bt_cross.addImage("commun/assets/images/white_cross.png")
     bt_cross.setStyleSheet(bt_cross_stylesheet)
     bt_cross.clicked.connect(
         lambda: self.delete_line_raison(raison.raison))
     # On ajoute le bouton au layout
     hbox.addWidget(bt_cross)
     hbox.setSpacing(0)
     return hbox
Beispiel #9
0
 def __init__(self, bobine, amount, parent=None):
     super(LineBobineSelected, self).__init__(parent=parent)
     self.parent = parent
     self.set_border(color=color_noir)
     self.bobine = bobine
     self.amount = amount
     self.clear_bt = PixmapButton(parent=self)
     self.init_button()
     self.stock_prev_value = 0
     self.production = QLabel()
     self.stock_prev = QLabel()
     self.etat = QLabel()
     self.init_widget()
     self.update_widget()
     self.setFixedHeight(30)
Beispiel #10
0
 def __init__(self, on_close):
     super(TrackerWindow, self).__init__(None)
     self.on_close = on_close
     self.live_speed = LiveSpeed(parent=self)
     self.bt_retour = PixmapButton(parent=self)
     self.init_widget()