Example #1
0
    def import_file_queued(path):
        # Save the directory the user was in.
        current_prefs['last_path'] = picker.directory().absolutePath()
        prefs.save_prefs(current_prefs)

        # Wait for an event loop cycle, or the open dialog will stay on screen while we load
        # data.
        def run_import():
            import_file(path)

        Qt.QTimer.singleShot(0, run_import)
Example #2
0
    def on_close(self):
        self.prefs_dict['schedule_prefs'] = {}
        self.prefs_dict['schedule_prefs'][
            'last_schedule_directory'] = self.last_schedule_directory
        if self.frames[IntervalTimer] != None:
            self.prefs_dict['interval_timer_prefs'] = self.frames[
                IntervalTimer].get_prefs_as_dict()
        try:
            save_prefs(
                self.prefs_dict,
                os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
                             'prefs.json'))
        except IntervalTimerException:
            messagebox.showerror('Save Preferences Error',
                                 'Couldn\'t save preferences')

        self.destroy()
Example #3
0
        def on_close():
            if vlc_connection:
                vlc_connection.vlc_subprocess.kill()
            if music_library:
                ml.save_library(music_library, music_library_path)

            prefs['interval_timer_prefs'] = interval_timer.get_prefs_as_dict()
            try:
                save_prefs(
                    prefs,
                    os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
                                 'prefs.json'))
            except IntervalTimerException:
                messagebox.showerror('Save Preferences Error',
                                     'Couldn\'t save preferences')

            root.destroy()
Example #4
0
 def save_prefs(self):
     """
     If true, we'll force modifiers enabled if we think they're required by another modifier.
     """
     prefs.save_prefs(self.prefs)