Gnats 4630: Deleting supply
from underneath exchange causes crash
Gnats
Record -- 11-20-2008 -- Hit Refresh
-- See Bug Status note, below.
This utility function shows the following Confirmation dialog box (one of two forms -- see below) if the specified Supply is part of an Exchange. This is used in the Supply Manager dialog and the Open Account dialog (Supplies Tab).
File: QtAccounting/QtAcctUtils.cpp bool QtAcct::supplyDeletable (Supply* sply, QWidget* parentDlg, // can be NULL bool isSingleOrLastDeletion, bool& continueDeletions, bool& continueNotifications); |
![]() |
(isSingleOrLastDeletion == true) |
|
![]() |
(isSingleOrLastDeletion == false) |
---
Gnats 4630: Deleting supply from underneath exchange
causes [assertion failure]
CVS Notes, 11-20-2008, RiverWare 5.1 Development.
Only Stand-Alone (Role) Supplies are now deletable through the GUI. This has been addressed for Supply Deletions initiated directly from the GUI, i.e. from the Supply Manager Dialog or the "Open Account" Dialog (Supplies Tab).
NOT ADDRESSED: Supply Deletions which occur as the result of deleting an Account or Simulation Object having Accounts.
The new [QtAccounting/QtAcctUtils] QtAcct::supplyDeletable(..) utility function, which shows a notification dialog box if the Supply cannot be deleted, _could_ be adapted and moved to a sub-GUI level (the Accounting library) if we want this supported at a lower level. (The method already checks for "batch mode" before creating a dialog box). This should be done at a place where it is possible to back out of the overall Account and Simulation Object deletion operation -- not part way through.
----------------------------
QtAccounting/QtAcctUtils.cpp
QtAccounting/QtAcctUtils.hpp
----------------------------
New function which conditionally shows a "Can't Delete Supply" notification dialog box.
bool QtAcct::supplyDeletable (Supply* sply, QWidget* parentDlg, // can be NULL bool isSingleOrLastDeletion, bool& continueDeletions, bool& continueNotifications) SEE: http://cadswes2.colorado.edu/~philw/2008/bugs/4630/
-------------------------------
QtAccounting/OpenAccountDlg.cpp [Open Account Dialog, "Supplies" Tab]
QtAccounting/QtSplyMgrDlg.cpp [Supply Manager Dialog]
-------------------------------
Deleting Supplies involved in exchanges is now prevented using the QtAcct:: supplyDeletable() utility function (see above). If a non-deletable Supply is encountered, the user can show the relevant Exchange's configuration dialog box. Also, in that case, if multiple Supplies are being deleted, the user has the option of aborting the remaining deletion operations. This is implemented in two places:
---