示例#1
0
def load_notes(window, text1, text2, com_socket):
    """
	Prompts user to select notes and then tries to load these into the UI.
	"""
    file = noter.select_file()

    if file:
        notes = noter.get_notes(file, runtime_info["settings"]["separator"])
        if notes:
            # Notes loaded correctly
            runtime_info["notes"] = notes

            # Save notes to settings
            settings = setting_handler.load_settings()
            settings["notes"] = file
            setting_handler.save_settings(settings)

            split_c = len(notes)
            show_info(("Notes Loaded",
                       ("Loaded notes with " + str(split_c) + " splits.")))

            if not runtime_info["timer_running"]:
                runtime_info["active_split"] = -1

            update_GUI(window, com_socket, text1, text2)

        else:
            show_info(config.ERRORS["NOTES_EMPTY"], True)
示例#2
0
def load_notes(window, text1, text2, com_socket):
	"""
	Prompts user to select notes and then tries to load these into the UI.
	"""
	file = noter.select_file()

	if file:
		notes = noter.get_notes(file, runtime_info["settings"]["separator"])
		if notes:
			# Notes loaded correctly
			runtime_info["notes"] = notes

			# Save notes to settings
			settings = setting_handler.load_settings()
			settings["notes"] = file
			setting_handler.save_settings(settings)

			split_c = len(notes)
			show_info(("Notes Loaded",
					   ("Loaded notes with " + str(split_c) + " splits.")))

			if not runtime_info["timer_running"]:
				runtime_info["active_split"] = -1

			update_GUI(window, com_socket, text1, text2)

		else:
			show_info(config.ERRORS["NOTES_EMPTY"], True)
示例#3
0
def save_geometry_settings(width, height):
    """
	Saves given width and height to settigns file.
	"""
    settings = setting_handler.load_settings()
    settings["width"] = str(width)
    settings["height"] = str(height)
    setting_handler.save_settings(settings)
示例#4
0
def save_geometry_settings(width, height):
	"""
	Saves given width and height to settigns file.
	"""
	settings = setting_handler.load_settings()
	settings["width"] = str(width)
	settings["height"] = str(height)
	setting_handler.save_settings(settings)