Beispiel #1
0
 def build(self):
     # TODO refactor backgroung - handle list type for config.get()
     backgroung_dict = {
         'Orange': [0.8, 0.4, 0.0, 1],
         "White": [1.0, 1.0, 1.0, 1],
         "Black": [0, 0, 0, 1],
     }
     Window.clearcolor = backgroung_dict[config.get_option_value(
         'background_colour')]
     Window.softinput_mode = 'below_target'  # TextInput keyboard position https://android.developreference.com/article/19684878/Android+on-screen+keyboard+hiding+Python+Kivy+TextInputs
     # TODO move ALL paths to system settings
     self.icon = 'images/icon.png'
     self.title = F"{config.get_option_value('app_title')}  {config.get_option_value('app_version')}"
     config.load_config()
     db.create_db()
     lang.reload_lang()
     return ScreenManagement()
Beispiel #2
0
        self.icon = 'images/icon.png'
        self.title = F"{config.get_option_value('app_title')}  {config.get_option_value('app_version')}"
        config.load_config()
        db.create_db()
        lang.reload_lang()
        return ScreenManagement()

    def build_config(self, app_config):
        app_config.setdefaults(
            '',
            {
                # 'font_size': '15dp',
                # 'entries_font_size': 42,
                # 'lists_font_size': '15dp',
                'app_version': '0.0.20',
                'app_title': 'TODOit',
                'db_path': "..//TODO.db",
            },
        )

    @staticmethod
    def open_error_popup(text):
        CustomWidgets.ErrorPopup.error_text = text
        CustomWidgets.ErrorPopup().open()


if __name__ == '__main__':
    db.create_db()  # create database at first start
    db.run_migrations()  # update db to the actual state
    MainApp().run()