예제 #1
0
    def setupSelectedModuleConfig(self, selectedModuleFileName):

        groupDesctiptionNotebook = Notebook(self)
        groupDesctiptionNotebook.grid(row=3, column=0, columnspan=4, sticky=E + W)

        groupNameList = jsonHelper.getAllGroups()

        groupDescriptionFrameList = []

        for groupName in groupNameList:
            groupDescriptionFrame = GroupDescriptionCheckboxFrame(groupDesctiptionNotebook, groupName)

            modulesForGroupList = jsonHelper.getModuleListForGroup(groupName)
            isEnabled = selectedModuleFileName in modulesForGroupList
            groupDescriptionFrame.enableCheckButtonInt.set(isEnabled)

            groupDescriptionFrameList.append(groupDescriptionFrame)
            groupDescriptionFrame.pack(fill=BOTH, expand=True)
            groupDesctiptionNotebook.add(groupDescriptionFrame, text=groupName)

        Button(
            self,
            text="Apply & Close",
            relief=RAISED,
            command=lambda: self.applyModuleButtonPressed(selectedModuleFileName, groupDescriptionFrameList),
        ).grid(row=4, column=1, columnspan=1, sticky=S + E)
    def __init__(self,notebook,groupName):
        Frame.__init__(self,notebook) 
        self.groupName = groupName
        self.enableCheckButtonInt = IntVar()
        Checkbutton(self, text='Enabled', variable=self.enableCheckButtonInt).grid(row=0, column=0, columnspan=3, sticky=N+W)

        Label(self,text="Head Filters").grid(row=1,column=0,sticky=N+S+E+W)
        Label(self,text="Jaw Filters").grid(row=1,column=1,sticky=N+S+E+W)
        Label(self,text="Modules").grid(row=1,column=2,sticky=N+S+E+W)

        headFilterList = jsonHelper.getHeadFiltersListForGroup(groupName)
        jawFilterList = jsonHelper.getJawFiltersListForGroup(groupName)
        moduleList = jsonHelper.getModuleListForGroup(groupName)

        self.columnconfigure(0,weight=1)
        self.columnconfigure(1,weight=1)
        self.columnconfigure(2,weight=1)

        self.rowconfigure(0,weight=1)
        self.rowconfigure(1,weight=1)

        for i in range(len(headFilterList)):
            Label(self,text=objectHelper.getHeadFilterNameFromHeadFilterFilename(headFilterList[i])).grid(row=2+i,column=0,sticky=N+S+E+W)
            self.rowconfigure(2+i,weight=1)

        for i in range(len(jawFilterList)):
            Label(self,text=objectHelper.getJawFilterNameFromJawFilterFilename(jawFilterList[i])).grid(row=2+i,column=1,sticky=N+S+E+W)
            self.rowconfigure(2+i,weight=1)

        for i in range(len(moduleList)):
            Label(self,text=objectHelper.getModuleNameFromModuleFilename(moduleList[i])).grid(row=2+i,column=2,sticky=N+S+E+W)
            self.rowconfigure(2+i,weight=1)
예제 #3
0
    def setupSelectedGroup(self, groupName):

        groupCheckboxFrame = GroupEditCheckboxFrame(
            self,
            jsonHelper.getAllHeadFiltersFileNames(),
            jsonHelper.getAllJawFiltersFileNames(),
            jsonHelper.getAllModulesFileNames(),
        )
        groupCheckboxFrame.setEnabledHeadFilenames(jsonHelper.getHeadFiltersListForGroup(groupName))
        groupCheckboxFrame.setEnabledJawFilenames(jsonHelper.getJawFiltersListForGroup(groupName))
        groupCheckboxFrame.setEnabledModuleFilenames(jsonHelper.getModuleListForGroup(groupName))

        groupCheckboxFrame.grid(row=2, column=0, columnspan=4, sticky=E + W + N + S)
        Button(
            self,
            text="Apply & Close",
            relief=RAISED,
            command=lambda: self.applyGroupButtonPressed(groupName, groupCheckboxFrame),
        ).grid(row=3, column=1, columnspan=1, sticky=S + E)