remove selected_routine stuff and other comments
This commit is contained in:
		
							parent
							
								
									188d6d1a3e
								
							
						
					
					
						commit
						425f32a290
					
				@ -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 = "<span size=\"large\" weight=\"bold\">" & routine.name & "</span>"
 | 
			
		||||
                    text = "<span size=\"large\">" & routine.name & "</span>"
 | 
			
		||||
                    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:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user