RPL Global User-defined Functions -- 4-21-2009 http://cadswes2.colorado.edu/~philw/2009/GlobalRplFunctions/ -------------- Rpl/RplSet.cpp -------------- (1) In the RplSet serialization, don't write out the "IS_GLOBAL" flag if it is 'false'. The default value for that property is already 'false'. This allows non-Global RplSets which are saved from a current RiverWare build to be read in by certain older versions of RiverWare (which isn't generally supported, but should be supported when it can be). Change in: cwostream& RplSet::generalSave (cwostream& ..); (2) In RplSet::addUtilityGroup (RplGroup* ..), at the end of the operation, add a call to notifyRplGlobalChanged() to unconditionally generate notifications of a potential Globalness change with the new Utility Group. --------------------- QtRpl/RplListView.cpp QtRpl/RplListView.hpp --------------------- (1) Disable certain operations on External Global RplObj Items (e.g. RplGroups or RplFunctions which are actually owned by a different open RplSet, and which appear in the current list (as references, white globes) only because they are Global. (a) Drag and Drop (b) Renaming (c) Toggle Active <<--- NOTE: More notification work needed. (d) Delete (2) Partial fix to Gnats 4728: "Problems with drag-and-drop of RPL Groups". Part 2: As a result of dragging a RplGroup from one RplSet to another, the RplGroup was not being removed from the first RplSet. This is now fixed in RplListView::contentsDropEvent (QDropEvent*). RplListView:: removeUtilityGroup (and RplListView::removePolicyGroup) were being called on the wrong RplListView instance ('this' instance). They need to be called instead on the RplListView instance of the original (source) RplSet (where the drag was started). (3) In RplListView::addUtilityGroup, call updateDlgs (.., RplDlgMgr:: RPL_EDIT_IS_GLOBAL) if the RplSet is global. New protected (effectively, private) method: bool rplObjIsLocalInList (RplObj*) const; // This method returns false if the given RplObj is in a RplSet other // than the one supported by this RplListView, e.g. in the case of // a reference to RplFunction or RplGroup in a GLOBAL RplSet (other // than the locally supported RplSet). ------------------- QtRpl/RplSetDlg.cpp QtRpl/RplSetDlg.hpp ------------------- Disable the Delete operation if the selected RplObj List Item is for an External Reference to a Global RplObj (e.g. a RplGroup defined in a different RplSet which is Global). New private method: bool rplObjIsLocalInDlg (RplObj*) const; // This method returns false if the given RplObj is in a RplSet other // than the one supported by this RplDlg, e.g. in the case of a // reference to RplFunction or RplGroup in a GLOBAL RplSet (other // than the locally supported RplSet). ------------------- QtRpl/RplDlgMgr.cpp ------------------- In RplDlgMgr::closeAllRplSetDlgs (bool confirmEach), before closing dialogs, turn off the Global flag in RplSets which are global. This is needed to fix a sequencing problem in the demise of RplSets. =================== RplSet Editor "View" menu: Add "[X] Show External Global Groups" toggle. This is done without any persistence or propagation, being that we're in the process of considering removing the entire feature. ------------------------- QtRpl/RplSetDlg.cpp QtRpl/RplSetDlgWidgets.ui ------------------------- QAction* _showExtGlobalGroupsAction; ... connected to a handler in RplListView ... --------------------- QtRpl/RplListView.cpp QtRpl/RplListView.hpp --------------------- New data member: bool _showExternalGlobalGroups; New Qt slot (signal handler): void showExternalGlobalGroups (bool show); And REMOVED the default parameter from this related method: (LOOK AT THIS, ONE! The effect of calling this method without a parameter was to turn OFF the visibility of Predefined Groups!!! JEESH!). void showPredefinedGroups (bool show = false); ---