Esempio n. 1
0
    def on_start(self):
        self.autonomous = AutonomousDropDown(self)
        self.teleop = TeleOpDropDown(self)
        self.endgame = EndgameDropDown(self)
        self.penalties = PenaltiesDropDown(self)

        scoring_dropdowns = [self.autonomous, self.teleop, self.endgame]
        for dropdown in scoring_dropdowns:
            panel = MDExpansionPanel(
                icon="",
                content=dropdown,
                panel_cls=MDExpansionPanelOneLine(text=dropdown.title))
            panel.bind(_state=self.rescroll)
            self.root.ids.score_sheet.ids.scoring_menu.add_widget(panel)

        penalty_panel = MDExpansionPanel(
            icon="",
            content=self.penalties,
            panel_cls=MDExpansionPanelOneLine(text=self.penalties.title))
        penalty_panel.bind(_state=self.rescroll)
        self.root.ids.score_sheet.ids.penalties_menu.add_widget(penalty_panel)

        self.root.ids.toolbar2.ids.label_title.font_size = "24sp"

        self.started = True
def drilling(self):
    dic = {'WSTĘP DO WIERCENIA': IntroductionContent, "PROCEDURY WYBORU": MaterialsContent, 'STOSOWANIE': EdgeContent,
           'JAKOŚĆ OTWORU': ToolsMaterialsContent, }

    for i in dic:
        self.root.ids.knowledge_drilling.ids.box.add_widget(
            MDExpansionPanel(
                icon="icons/education.png",
                content=dic[i](),

                panel_cls=MDExpansionPanelOneLine(
                    text=i,
                    font_style=theme_font_styles[9],

                )
            )
        )

######################################################################
# All content from turning
######################################################################

# Add!!!

######################################################################
# All content from milling
######################################################################

# Add!!

######################################################################
# All content from drilling
######################################################################

# Add!!
Esempio n. 3
0
    def search_account(self):
        """
        this method use when search button pressed search_field
        contain data in string that you want to search on hamster server
        """

        # for dummy search item [------
        """
        twolineW= TwoLineAvatarListItem(text=f"{search_field}",
            secondary_text=f"@{search_field}")

        twolineW.add_widget(ImageLeftWidget(source="assets//img//hamster_icon.png"))
        
        self.ids.search_items.add_widget(twolineW)
        """
        self.ids.search_items.remove_widget(self.ids.search_items)
        for i in range(10):
            oneLineitem = OneLineListItem(
                text=
                "Haber İçeriği Haber İçeriğiHaber İçeriğiHaber İçeriğiHaber İçeriği\nHaber İçeriğiHaber İçeriği\nHaber İçeriğiHaber İçeriğiHaber İçeriği"
            )
            oneLineitem = MDLabel(
                text=
                "Haber İçeriği Haber İçeriğiHaber İçeriğiHaber İçeriğiHaber İçeriği\nHaber İçeriğiHaber İçeriği\nHaber İçeriğiHaber İçeriğiHaber İçeriği",
                valign="center")
            self.ids.search_items.add_widget(
                MDExpansionPanel(
                    icon=f"assets//img//hamster_icon.png",
                    content=oneLineitem,
                    panel_cls=MDExpansionPanelOneLine(
                        text="Haber Başlığı")  # panel class
                ))
Esempio n. 4
0
    def add_phone_numbers(self):
        self.data_first = Show.pickle_list(self)[0]

        country = self.default_country[5]

        try:
           country = self.default_country[5].replace("ê", "ę")

        except Exception:
            pass

        try:
            country = self.default_country[5].replace("³", "ł")

        except Exception:
            pass

        self.data_second = Show.pickle_list(self)[3][country]


        for i in range(len(self.data_first)):
            self.exp = MDExpansionPanel(icon=f'images/emergency/{self.data_first[i]}.png',
                                        content=CustomList(text=self.data_second[i]),
                                        panel_cls=MDExpansionPanelOneLine(
                                            text=self.data_first[i]
                                        ))
            self.numbers_container.add_widget(self.exp)
Esempio n. 5
0
 def add_expansion_panel(self, card):
     content = KitchenSinkExpansionPanelContent()
     card.add_widget(
         MDExpansionPanel(
             icon=f"{os.environ['KITCHEN_SINK_ASSETS']}avatar.png",
             content=content,
             panel_cls=MDExpansionPanelOneLine(text="KivyMD 0.104.1"),
         ))
Esempio n. 6
0
 def load_nav(self):
     self.display.ids.nav_drawer_.nav_list.add_widget(
         MDExpansionPanel(icon="img/logo.png",
                          content=Content(),
                          panel_cls=MDExpansionPanelOneLine(
                              text="Добавить",
                              secondary_text="Secondary text",
                              tertiary_text="Tertiary text",
                          )))
Esempio n. 7
0
    def on_enter(self):
        self.ids.panel_container.clear_widgets()
        self.panel = MDExpansionPanel(icon="all.png",
                                      panel_cls=MDExpansionPanelOneLine(
                                          text="Moje testy", ),
                                      content=Content())

        self.ids.panel_container.add_widget(self.panel)
        self.panel.bind(on_open=self.panel_open, on_close=self.panel_close)
Esempio n. 8
0
 def add_expansion_panel(self, card):
     content = ProjectExpansionPanelContent()
     card.add_widget(
         MDExpansionPanel(
             icon=f"{os.environ['PROJECT_ASSETS']}avatar.png",
             content=content,
             panel_cls=MDExpansionPanelOneLine(
                 text=f"KivyMD {__version__}"),
         ))
Esempio n. 9
0
 def on_start(self):
     content = Content()
     self.root.ids.card.add_widget(
         MDExpansionPanel(
             on_open=self.panel_open,
             on_close=self.panel_close,
             icon=f"{images_path}kivymd_logo.png",
             content=content,
             panel_cls=MDExpansionPanelOneLine(text="KivyMD v.0.103.0"),
         ))
Esempio n. 10
0
 def add_expansion_panel(self, card, box):
     content = KitchenSinkExpansionPanelContent()
     card.add_widget(
         MDExpansionPanel(
             on_open=lambda x, y: self.panel_open(box, content),
             on_close=lambda x, y: self.panel_close(box, content),
             icon=f"{os.environ['KITCHEN_SINK_ASSETS']}avatar.png",
             content=content,
             panel_cls=MDExpansionPanelOneLine(text="KivyMD v.0.102.1"),
         )
     )
Esempio n. 11
0
    def provinces_list(self, *args):
        self.phone_number_screen_manager.current = 'phone_provinces'
        content = self.pickle_list()[4]
        self.delete_container = MDGridLayout(cols=1, adaptive_height=True)
        self.phone_provinces.add_widget(self.delete_container)
        for key, value in content.items():
            item = MDExpansionPanel(
                icon=f'images/provinces/{key}.png',
                content=ProvinceContent(content[key]),
                panel_cls=MDExpansionPanelOneLine(text=key))

            self.delete_container.add_widget(item)
Esempio n. 12
0
    def on_enter(self):
        if self.has_already_opened:
            return
        else:
            self.has_already_opened = True

        content_for_panel = MoreInformation()
        md_expansion_panel = MDExpansionPanel(
            content=content_for_panel,
            icon=f"{PATH_TO_IMAGES}/information.png",
            panel_cls=MDExpansionPanelOneLine(text="More information"),
        )
        self.ids.expansion_panel_box.add_widget(md_expansion_panel)
        self.ids.previous_image.source = f"{PATH_TO_IMAGES}/previous.jpg"
Esempio n. 13
0
    def on_enter(self):
        self.ids.cards.clear_widgets()
        self.panel0 = MDExpansionPanel(
            icon="flash",
            content=AContent(),
            panel_cls=MDExpansionPanelOneLine(text="Definuj si ciele"),
        )

        self.ids.cards.add_widget(self.panel0)
        self.panel0.bind(on_open=self.panel_open, on_close=self.panel_close)

        self.panel1 = MDExpansionPanel(
            icon="human-greeting",
            content=MeContent(),
            panel_cls=MDExpansionPanelOneLine(text="Ja"),
        )

        self.ids.cards.add_widget(self.panel1)
        self.panel1.bind(on_open=self.panel_open, on_close=self.panel_close)

        self.panel2 = MDExpansionPanel(
            icon="human-capacity-increase",
            content=TeamContent(),
            panel_cls=MDExpansionPanelOneLine(text="Tím"),
        )

        self.ids.cards.add_widget(self.panel2)
        self.panel2.bind(on_open=self.panel_open, on_close=self.panel_close)

        self.panel3 = MDExpansionPanel(
            icon="human-male-female",
            content=WeContent(),
            panel_cls=MDExpansionPanelOneLine(text="Vzťah"),
        )

        self.ids.cards.add_widget(self.panel3)
        self.panel3.bind(on_open=self.panel_open, on_close=self.panel_close)
Esempio n. 14
0
    def down_button(self, country, *args):
        try:
            self.clear_screen()
        except:
            pass
        self.phone_number_screen_manager.current = 'phone_number_list'
        numbers = self.pickle_list()[3][country]
        if len(numbers) == self.NORMAL:
            names = self.pickle_list()[0]
            self.container = SecondScreen()
            self.phone_container.add_widget(self.container)
            for i in range(self.NORMAL):
                self.container.add_widget(
                    MDExpansionPanel(
                        icon=f'images/emergency/{names[i]}.png',
                        content=PhoneContent(numbers[i]),
                        panel_cls=MDExpansionPanelOneLine(text=names[i])))

        elif len(numbers) == self.EXTENDED:
            names = self.pickle_list()[1]
            self.container = SecondScreen()
            self.phone_container.add_widget(self.container)
            self.prov_item = OneLineAvatarIconListItem(
                text='Numery ws. koronawirusa w Województwach',
                on_release=self.clear_add_provinces)
            prov_item_icon_left = IconLeftWidget(
                icon='images/emergency/mask.png', size_hint=(0.9, 0.9))
            prov_item_icon_right = IconRightWidget(icon='arrow-right')
            self.phone_list_container.add_widget(self.prov_item)
            self.prov_item.add_widget(prov_item_icon_left)
            self.prov_item.add_widget(prov_item_icon_right)
            for i in range(self.EXTENDED):
                self.container.add_widget(
                    MDExpansionPanel(
                        icon=f'images/emergency/{names[i]}.png',
                        content=PhoneContent(numbers[i]),
                        panel_cls=MDExpansionPanelOneLine(text=names[i])))
def turning(self):
    dic = {'WSTĘP DO TOCZENIA': IntroductionTurning, "PROCEDURY WYBORU": MaterialsContent, 'OZNACZENIA': EdgeContent,
           'WYBÓR PŁYTEK': ToolsMaterialsContent, 'WYBÓR OPRAWEK': UsageContent}

    for i in dic:
        self.root.ids.knowledge_turning.ids.box.add_widget(
            MDExpansionPanel(
                icon="icons/education.png",
                content=dic[i](),
                panel_cls=MDExpansionPanelOneLine(
                    text=i,
                    font_style=theme_font_styles[9]
                )
            )
        )
Esempio n. 16
0
    def build_local_panel(self):
        self.root.ids.result.clear_widgets(self.root.ids.result.children)

        options = self.bdd_get_chambres()
        if (len(options) != 0):
            for id, nom in options:
                content = Content()
                content.build_data(self.bdd_get_commandes(id))
                panel = MDExpansionPanel(icon="room.png",
                                         content=content,
                                         panel_cls=MDExpansionPanelOneLine(
                                             text=nom, ))
                self.root.ids.result.add_widget(panel)
        else:
            toast(" veuillez synchronizer ")
def milling(self):
    dic = {'WSTĘP DO FREZOWANIA': IntroductionContent, "PROCEDURY WYBORU": MaterialsContent, 'STOSOWANIE': EdgeContent,
           }

    for i in dic:
        self.root.ids.knowledge_milling.ids.box.add_widget(
            MDExpansionPanel(
                icon="icons/education.png",
                content=dic[i](),
                panel_cls=MDExpansionPanelOneLine(
                    text=i,
                    font_style=theme_font_styles[9]
                )
            )
        )
def introduction(self):
    dic = {'WSTĘP': IntroductionContent, "MATERIAłY OBRABIANE": MaterialsContent, 'KRAWĘDŹ SKRAWAJĄCA': EdgeContent,
           'MATERIAŁY NARZĘDZIOWE': ToolsMaterialsContent, 'ZUŻYCIE I KONSERWACJA': UsageContent}

    for i in dic:
        self.root.ids.machining_introduction_screen.ids.box.add_widget(
            MDExpansionPanel(
                icon="icons/education.png",
                content=dic[i](),
                panel_cls=MDExpansionPanelOneLine(
                    text=i,
                    font_style=theme_font_styles[9]

                )
            )
        )
Esempio n. 19
0
    def add_content(self, lang):
        '''Adds main content in the specified language to the HomeScreen'''
        self.home_content.clear_widgets()
        self.titles = languages[lang]['home_titles']
        self.texts = languages[lang]['home_texts']

        for tls, txs, ics in zip(self.titles, self.texts, self.icons):
            content = MDBoxLayout(adaptive_height=True,
                                  orientation='vertical',
                                  padding=[dp(25), dp(100)])
            content.add_widget(
                MDLabel(text=txs,
                        size_hint=(1, None),
                        height=dp(Window.height * .1),
                        theme_text_color='Secondary'))
            self.home_content.add_widget(
                MDExpansionPanel(icon='images/' + ics,
                                 content=content,
                                 panel_cls=MDExpansionPanelOneLine(text=tls)))
Esempio n. 20
0
    def on_enter(self):
        if self.has_already_opened:
            return
        else:
            self.has_already_opened = True

        content_for_panel = MoreInformation()
        md_expansion_panel = MDExpansionPanel(
            content=content_for_panel,
            icon=f"{PATH_TO_IMAGES}/information.png",
            panel_cls=MDExpansionPanelOneLine(text="More information"),
        )
        self.ids.expansion_panel_box.add_widget(md_expansion_panel)

        path = f"{PATH_TO_IMAGES}/previous_crop.jpg"
        if not os.path.exists(path):
            crop_image(
                (Window.width, int(dp(Window.height * 35 // 100))),
                f"{PATH_TO_IMAGES}/previous.jpg",
                path,
            )
        Clock.schedule_once(lambda x: self.set_path_to_image_product(path),
                            0.2)
Esempio n. 21
0
    def add_color_panel(self):
        def set_list_colors_themes(*args):
            self.settings_theme_panel_open = True
            if not theme_panel.content.ids.rv.data:
                for name_theme in palette:
                    theme_panel.content.ids.rv.data.append({
                        "viewclass":
                        "FileManagerSettingsColorItem",
                        "color":
                        get_color_from_hex(colors[name_theme]["500"]),
                        "text":
                        name_theme,
                        "manager":
                        self,
                    })

        # Adds a panel.
        theme_panel = MDExpansionPanel(
            icon="palette",
            content=Factory.FileManagerChangeTheme(),
            panel_cls=MDExpansionPanelOneLine(text="Select theme"),
        )
        theme_panel.bind(
            on_open=set_list_colors_themes,
            on_close=self._set_state_close_theme_panel,
        )
        self.ids.settings.add_widget(theme_panel)

        # Adds a close button to the settings panel.
        box = MDBoxLayout(adaptive_height=True)
        box.add_widget(Widget())
        box.add_widget(
            MDFlatButton(
                text="CLOSE",
                on_release=lambda x: self.hide_settings(theme_panel),
            ))
        self.ids.settings.add_widget(box)
Esempio n. 22
0
    def reload(self):
        try:
            students = api.students()
        except Exception as e:
            Snackbar(
                text=f"You seem to be offline, trying again in 10 seconds.",
                snackbar_x="10dp",
                snackbar_y="10dp",
                size_hint_x=.5).open()
            print(str(e))
            Clock.schedule_once(lambda *args: self.reload(), 10)
            return
        try:
            attendance = api.attendance()
        except Exception as e:
            Snackbar(
                text=f"You seem to be offline, trying again in 10 seconds.",
                snackbar_x="10dp",
                snackbar_y="10dp",
                size_hint_x=.5).open()
            print(str(e))
            Clock.schedule_once(lambda *args: self.reload(), 10)
            return

        self.attendance.clear_widgets()

        self.today_att = AttendanceContent()
        self.yesterday_att = AttendanceContent()

        std = MDExpansionPanel(content=self.today_att,
                               panel_cls=MDExpansionPanelOneLine(text="Today"))
        self.attendance.add_widget(std)
        std = MDExpansionPanel(
            content=self.yesterday_att,
            panel_cls=MDExpansionPanelOneLine(text="Yesterday"))
        self.attendance.add_widget(std)

        today = datetime.today()
        today_ = today.strftime('%Y-%m-%d')
        yesterday = (today - timedelta(days=1)).strftime('%Y-%m-%d')
        for student in students:
            if student['status'] == 'inactive':
                continue
            try:
                info = next(att for att in attendance
                            if att['student_id'] == student['id']
                            and att['date'] == today_)
            except StopIteration:
                info = {
                    'student_id': student['id'],
                    'date': today_,
                    'status': ''
                }

            att = Attendance(student_name=student['student_name'],
                             group='today' + student['id'],
                             state=info['status'],
                             student_id=info['student_id'],
                             date=today_)
            self.today_att.add_widget(att)

            has_yesterday = any(att['status'] for att in attendance
                                if att['student_id'] == student['id']
                                and att['date'] == yesterday)
            if not has_yesterday:
                att = Attendance(student_name=student['student_name'],
                                 group='yesterday' + student['id'],
                                 student_id=student['id'],
                                 date=yesterday)
                self.yesterday_att.add_widget(att)
Esempio n. 23
0
    def __init__(self, **kwargs):
        self.title = kwargs.get("title")
        super().__init__(panel_cls=MDExpansionPanelOneLine(text=self.title),
                         content=CategoryContent())

        self.db_id = kwargs.get("db_id")