Skip to content

Commit

Permalink
Fixes bug where CF amount can't be edited (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvisscher authored Sep 20, 2024
1 parent 1165399 commit 3e993b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activity_browser/ui/tables/impact_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Iterable

from PySide2 import QtWidgets
from PySide2.QtCore import QModelIndex, Slot
from PySide2.QtCore import QModelIndex, Slot, Qt

from activity_browser import actions
from activity_browser.mod.bw2data import methods
Expand Down Expand Up @@ -296,10 +296,10 @@ def cell_edited(self) -> None:
cell = self.selectedIndexes()[0]
column = cell.column()

if column in [2]:
if self.model.headerData(column, Qt.Horizontal) == 'Amount':
# if the column changed is 2 (Amount) --> This is a list in case of future editable columns
new_amount = self.model.get_value(cell)
actions.CFAmountModify.run(self.method_name, self.selected_cfs, new_amount)
actions.CFAmountModify.run(self.method_name(), self.selected_cfs(), new_amount)

@Slot(bool, name="toggleUncertainColumns")
def hide_uncertain(self, hide: bool = True) -> None:
Expand Down

0 comments on commit 3e993b5

Please sign in to comment.