예제 #1
0
	def delete_data(self):
		selected = self.maps_combo.get_active()
		if selected != -1:
			# delete
			map_name = self.maps_combo.get_active_text()
			del self.data[map_name]
			self.maps_combo.remove(selected)
			# save data
			maps.save(self.data)
			# update parent window
			self.parent.collect_map_combo.append_list(self.data, sort=True, clear=True)
예제 #2
0
 def save_data(self, name, data):
     # get map data
     map_data = []
     for row in self.parent.map_data_listbox.get_rows():
         text = self.parent.map_data_listbox.get_row_text(row)
         map_data.append(maps.to_array(text))
     data[name] = map_data
     # save data
     maps.save(data)
     # update parent window
     self.parent.collect_map_combo.append_list(data, sort=True, clear=True)
     # destroy dialog
     self.destroy()