"save" will act on the relation selected in the list

It used to act on the active relation, that is, the one being displayed
in the central table, that is selected with a double click.

This change makes it act on the relation directly selected instead.
It should be more intuitive.
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2016-08-21 10:50:22 +02:00
parent 8d8db2ac0c
commit ae042a7ae4
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,8 @@
- Improved multi-line text editor - Improved multi-line text editor
- Multi-line mode has support for optimizations - Multi-line mode has support for optimizations
- Workaround a QSettings bug so that sessions work again - Workaround a QSettings bug so that sessions work again
- "Save" button works on the relation selected in the list, instead of the
one shown in the central table
2.4 2.4
- Improve error reporting - Improve error reporting

View File

@ -273,7 +273,7 @@ class relForm(QtWidgets.QMainWindow):
self.ui.lstRelations.addItem(i) self.ui.lstRelations.addItem(i)
def saveRelation(self): def saveRelation(self):
if self.selectedRelation is None: if not self.ui.lstRelations.selectedItems():
r = QtWidgets.QApplication.translate( r = QtWidgets.QApplication.translate(
"Form", "Select a relation first." "Form", "Select a relation first."
) )
@ -288,7 +288,9 @@ class relForm(QtWidgets.QMainWindow):
)[0] )[0]
if (len(filename) == 0): # Returns if no file was selected if (len(filename) == 0): # Returns if no file was selected
return return
self.selectedRelation.save(filename)
relname = self.ui.lstRelations.selectedItems()[0].text()
self.user_interface.relations[relname].save(filename)
def unloadRelation(self): def unloadRelation(self):
for i in self.ui.lstRelations.selectedItems(): for i in self.ui.lstRelations.selectedItems():