Skip to content

Commit

Permalink
[gui] Add edit basket support
Browse files Browse the repository at this point in the history
  • Loading branch information
gacarrillor committed Sep 22, 2024
1 parent 91e423f commit 504d16a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions QgisModelBaker/gui/edit_basket.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* *
***************************************************************************/
"""
from PyQt5.QtWidgets import QMessageBox
from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QDialog, QWidget

Expand Down Expand Up @@ -83,10 +84,20 @@ def _get_filtered_datasets(self) -> dict:

return filtered_datasets

def _accept(self):
def _accept(self) -> None:
self._save_edited_basket()
self.close()

def _save_edited_basket(self):
# Save basket attributes
return
def _save_edited_basket(self) -> None:
# Save edited basket attributes
basket_config = self._basket_info.copy()
basket_config["dataset_t_id"] = self.cboDatasets.currentData()
basket_config["datasetname"] = self.cboDatasets.currentText()
basket_config["bid_value"] = self.txtBidValue.text().strip()
basket_config["attachmentkey"] = self.txtAttachmentKey.text().strip()

res, msg = self.db_connector.edit_basket(basket_config)
if not res:
QMessageBox.warning(
self, self.tr("Edit Basket Failed"), msg, QMessageBox.Close
)

0 comments on commit 504d16a

Please sign in to comment.