mirror of
https://github.com/ApfelTeeSaft/SplitNotes.git
synced 2026-08-26 19:33:39 +00:00
Bug Fixes
Committing some bugfixes and addition of update_GUI function. This function is not yet implemented in the rest of the project.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@ LS_COMMANDS = {
|
||||
}
|
||||
|
||||
#Default Window Size
|
||||
DEFAULT_WINDOW = {"WIDTH": 200, "HEIGHT": 500, "TITLE": "SplitNotes"}
|
||||
DEFAULT_WINDOW = {"WIDTH": 400, "HEIGHT": 300, "TITLE": "SplitNotes"}
|
||||
|
||||
#Color Scheme
|
||||
COLOR_SCHEME = {}
|
||||
|
||||
+30
-3
@@ -93,7 +93,24 @@ def update(window, com_socket, text1, text2):
|
||||
|
||||
|
||||
#self looping
|
||||
window.after(int(config.POLLING_TIME * 1000), update, window, com_socket, text1, text2)
|
||||
window.after(int(config.POLLING_TIME * 1000), update, window, com_socket, text1, text2)
|
||||
|
||||
|
||||
def update_GUI(window, com_socket, text1, text2):
|
||||
#TODO implemement this function
|
||||
index = runtime_info["active_split"]
|
||||
|
||||
if index == -1:
|
||||
index = 0
|
||||
|
||||
if runtime_info["timer_running"]:
|
||||
#Does not test connection if it fails
|
||||
split_name = con.get_split_name(com_socket)
|
||||
else:
|
||||
split_name = False
|
||||
|
||||
update_notes(window, text1, text2, index)
|
||||
set_title_notes(window, index, split_name)
|
||||
|
||||
|
||||
def test_connection(com_socket, window, text1, text2):
|
||||
@@ -208,9 +225,19 @@ def load_notes(window, text1, text2):
|
||||
|
||||
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_notes(window, text1, text2, runtime_info["active_split"])
|
||||
set_title_notes(window, 0, split_name = False)
|
||||
|
||||
#Make sure right number is displayed after notes have been loaded.
|
||||
if runtime_info["active_split"] == -1:
|
||||
disp_index = 0
|
||||
else:
|
||||
disp_index = runtime_info["active_split"]
|
||||
|
||||
set_title_notes(window, disp_index)
|
||||
else:
|
||||
show_info(config.ERRORS["NOTES_EMPTY"], True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user