def OnFilelist_selectionchange(self): self.btn_input_source.setEnabled(True) self.channel_list.clear() if len(self.File_list.selectedItems()) == 1: file = self.File_list.selectedItems()[0].parent for station in file.stations: listitem = QListWidgetItem(station) listitem.setText(station.name) self.channel_list.addItem(listitem) if file.Invpath != None: self.invdisplayer.setText(str(file.Invpath)) self.source = file.source if self.source != None: self.soulongti.setText(str(self.source.longitude)) self.soulati.setText(str(self.source.latitude)) self.soudepth.setText(str(self.source.depth)) self.sourcetime.setText(str(self.source.time)) else: self.soulongti.setText('') self.soulati.setText('') self.soudepth.setText('') self.sourcetime.setText('')
def OnFilelist_selectionchange(self): self.channel_list.clear() if len(self.File_list.selectedItems()) == 1: self.channel_list.setEnabled(True) self.allchannel_checkbox.setEnabled(True) file = self.File_list.selectedItems()[0].parent for station in file.stations: listitem = QListWidgetItem(station) listitem.setText(station.name) self.channel_list.addItem(listitem) if len(self.File_list.selectedItems()) > 1: for item in self.File_list.selectedItems(): file = item.parent for station in file.stations: listitem = QListWidgetItem(station) listitem.setText(station.name) self.channel_list.addItem(listitem) self.channel_list.setEnabled(False) self.allchannel_checkbox.setChecked(True) self.allchannel_checkbox.setEnabled(False)
def initList(self): self.Files = self.Rcs.Files for file in self.Files.files: listitem = QListWidgetItem(file) listitem.setText(file.name) self.File_list.addItem(listitem)
def getFiles(self, Files): self.Files = Files for file in self.Files.files: listitem = QListWidgetItem(file) listitem.setText(file.name) self.File_list.addItem(listitem)