コード例 #1
0
ファイル: eggtimer.py プロジェクト: larilofman/EggTimer
    def change_state_to_run(self):
        """Save time as seconds and change state to run"""
        self.seconds = self.get_time_in_secs()

        if self.seconds > 0:
            save_setting({'timer_seconds': self.seconds})
            self.create_or_set_state(state_run)
コード例 #2
0
ファイル: eggtimer.py プロジェクト: larilofman/EggTimer
    def toggle_display_mode(self):
        """Saves display mode when it's changed.

        0 = h:m:s
        1 = hh:mm:ss
        Timer displays read the variable and format accordingly
        """
        save_setting({'display_mode': self.display_mode.get()})
コード例 #3
0
ファイル: eggtimer.py プロジェクト: larilofman/EggTimer
    def change_state_to_run_pomodoro(self):
        pomodoro_timers = self.get_pomodoro_time_in_secs()

        if pomodoro_timers[0] > 0 and pomodoro_timers[1] > 0:
            self.pomodoro_work = pomodoro_timers[0]
            self.pomodoro_break = pomodoro_timers[1]
            save_setting({'pomodoro_work': self.pomodoro_work})
            save_setting({'pomodoro_break': self.pomodoro_break})
            self.create_or_set_state(state_run_pomodoro)
コード例 #4
0
ファイル: eggtimer.py プロジェクト: larilofman/EggTimer
 def toggle_timer_mode(self):
     """Toggles mode between timer(0) and pomodoro(1)"""
     timer_id = self.timer_mode.get()
     save_setting({'timer_mode': timer_id})
     if timer_id == 1:
         if type(self.state) != state_set_pomodoro and type(self.state) != state_run_pomodoro:
             self.change_state_to_set_pomodoro()
     else:
         if type(self.state) != state_run and type(self.state) != state_set and type(self.state) != state_alarm:
             self.change_state_to_set()
コード例 #5
0
    def start_odoo(self):
        self.ui.wait_overlay.show_overlay()
        version = int(self.ui.combo_version.currentText())
        enterprise_path = ""
        if self.ui.checkbox_enterprise.isChecked(
        ) and self.ui.line_edit_enterprise_path.text():
            enterprise_path = self.ui.line_edit_enterprise_path.text()
        self.starter_thread = StartOdooThread(self.ui.wait_overlay, version,
                                              enterprise_path)

        self.starter_thread.start()
        self.starter_thread.done.connect(self.starter_thread_done)
        settings.save_setting('USE_ENTERPRISE',
                              self.ui.checkbox_enterprise.isChecked())
        settings.save_setting('ENTERPRISE_PATH',
                              self.ui.line_edit_enterprise_path.text())
コード例 #6
0
 def save_database_settings(self, db_name=''):
     setting_name = 'github modules %s' % (db_name
                                           or 'odoo_%s' % self.version)
     settings.save_setting(setting_name, self.db_settings)