remove selected_routine stuff and other comments

master
itwrx 1 year ago
parent 188d6d1a3e
commit 425f32a290
  1. 35
      views/routine_list.nim

@ -8,19 +8,11 @@ import std/osproc
import edit_routine_dialog import edit_routine_dialog
import "../models/routine", "../shared" import "../models/routine", "../shared"
##preload selectedRoutines using routines' selByDef field value from DB.
#var selectedRoutines: seq[SelectedRoutine]
viewable RoutineList: viewable RoutineList:
## Displays a list of routines ## Displays a list of routines
#filter: string ## Filter used to search for routines
routineModel: RoutineModel ## Model of all routines routineModel: RoutineModel ## Model of all routines
#selectedRoutines: selectedRoutines
#selectedRoutines: seq[SelectedRoutine]
runStatus: string runStatus: string
#proc changed(currentRun: CurrentRun)
proc changed(state: bool) proc changed(state: bool)
method view(list: RoutineListState): Widget {.locks: "unknown".} = method view(list: RoutineListState): Widget {.locks: "unknown".} =
@ -30,7 +22,6 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} =
orient = OrientY orient = OrientY
if list.routineModel.routineSeq().len() > 0: if list.routineModel.routineSeq().len() > 0:
ListBox: ListBox:
#for routine in list.model.search(list.filter):
for it, routine in list.routineModel.routineSeq(): for it, routine in list.routineModel.routineSeq():
Box: Box:
orient = OrientY orient = OrientY
@ -40,32 +31,9 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} =
orient = OrientX orient = OrientX
margin = 6 margin = 6
spacing = 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 ]#
Label: Label:
#text = "<span size=\"large\" weight=\"bold\">" & routine.name & "</span>"
text = "<span size=\"large\">" & routine.name & "</span>" text = "<span size=\"large\">" & routine.name & "</span>"
xAlign = 0 # Align left xAlign = 0
useMarkup = true useMarkup = true
# Edit Button # Edit Button
Button {.expand: false.}: Button {.expand: false.}:
@ -175,7 +143,6 @@ method view(list: RoutineListState): Widget {.locks: "unknown".} =
#using this as "selected" for now. #using this as "selected" for now.
if routine.selByDef == true: if routine.selByDef == true:
#skip routines that don't have at least one source and one destination. #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: if routine.sources.len != 0 and routine.destinations.len != 0:
routineRuncount += 1 routineRuncount += 1
for source in routine.sources: for source in routine.sources:

Loading…
Cancel
Save