def onFileSelected self files Saves chosen file in model data filename

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
def onFileSelected(self, files):
"""
Saves chosen file in
model data
"""
filename = files.takeFirst()
itemCount = len(self._data)
# Inserting filename into combobox
self.insertItem(itemCount, filename)
# Changing current index to the
# new element
self.setCurrentIndex(itemCount)
# Adding new action to data
# container
self._data.append(
unicode(filename)
)