diff --git a/views/routine_list.nim b/views/routine_list.nim index 01e648b..7d8370a 100644 --- a/views/routine_list.nim +++ b/views/routine_list.nim @@ -8,19 +8,11 @@ import std/osproc import edit_routine_dialog import "../models/routine", "../shared" -##preload selectedRoutines using routines' selByDef field value from DB. -#var selectedRoutines: seq[SelectedRoutine] - viewable RoutineList: ## Displays a list of routines - - #filter: string ## Filter used to search for routines routineModel: RoutineModel ## Model of all routines - #selectedRoutines: selectedRoutines - #selectedRoutines: seq[SelectedRoutine] runStatus: string - #proc changed(currentRun: CurrentRun) proc changed(state: bool) method view(list: RoutineListState): Widget {.locks: "unknown".} = @@ -30,7 +22,6 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = orient = OrientY if list.routineModel.routineSeq().len() > 0: ListBox: - #for routine in list.model.search(list.filter): for it, routine in list.routineModel.routineSeq(): Box: orient = OrientY @@ -39,33 +30,10 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = Box: orient = OrientX margin = 6 - spacing = 6 - #[Switch {.expand: false.}: - state = routine.selByDef - proc changed(state: bool) = - #if state == true: - #list.selectedRoutines.ids.add(routine.id) - - if not list.changed.isNil: - list.changed.callback(list.selectedRoutines) ]# - #[CheckButton {.expand: false.}: - state = routine.selected - #if routine.selected == true: - #echo list.currentRun.selected - #list.currentRun.selected[it] = true - #state = t - #state = list.currentRun.selectedRoutines[it] - proc changed(state: bool) = - list.currentRun.selectedRoutines.add(routine.id) - if routine.id in list.currentRun.selectedRoutines: - = state - #echo "hehe" - #list.currentRun.selectedRoutines[it] = state ]# - + spacing = 6 Label: - #text = "" & routine.name & "" text = "" & routine.name & "" - xAlign = 0 # Align left + xAlign = 0 useMarkup = true # Edit Button Button {.expand: false.}: @@ -175,7 +143,6 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} = #using this as "selected" for now. if routine.selByDef == true: #skip routines that don't have at least one source and one destination. - #list.routineModel.routineSeq() returns an empty seq so len != 0 when empty... if routine.sources.len != 0 and routine.destinations.len != 0: routineRuncount += 1 for source in routine.sources: