Changeset 282:568be726e4bc
- Timestamp:
- 07/07/12 13:01:09 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/callouts.py
r280 r282 124 124 self._addingFile = False 125 125 self._fileListModel.connect("row-inserted", self._fileAdded) 126 self._lastAddedAltitude = None 126 127 127 128 self._fileList = gtk.TreeView(model = self._fileListModel) … … 216 217 altitude = self._getNewAltitude(baseName) 217 218 self._addingFile = True 219 self._lastAddedAltitude = altitude 218 220 self._fileListModel.append([altitude, baseName, filePath]) 219 221 self._addingFile = False … … 224 226 Makes the treeview to edit the altitude in the given row.""" 225 227 if self._addingFile: 226 gobject.idle_add(self._fileList.set_cursor, 227 model.get_path(iter), 228 self._fileList.get_column(0), True) 228 gobject.idle_add(self._selectFile) 229 229 self._fileList.grab_focus() 230 230 self.grab_focus() 231 232 def _selectFile(self): 233 """Select the file with the last added altitude.""" 234 if self._lastAddedAltitude is None: return 235 236 model = self._fileListModel 237 iter = model.get_iter_first() 238 while iter is not None: 239 if model.get_value(iter, 0)==self._lastAddedAltitude: break 240 iter = model.iter_next(iter) 241 if iter is not None: 242 self._fileList.set_cursor(model.get_path(iter), 243 self._fileList.get_column(0), True) 244 self._lastAddedAltitude = None 231 245 232 246 def _removeButtonClicked(self, button):
Note:
See TracChangeset
for help on using the changeset viewer.