Phil's CVS Notes, 5-20-2009: "5.1" Prep / Global Function Sets, Finishing. ========== Changing "Workspace >> Slots >> Open Slot..." to support multiple slots. ----------------------- Q3GUI/Workspace.hpp Q3GUI/Workspace.cpp Q3GUI/Workspace.Gus.cpp ----------------------- OLD: void chooseAndOpenSlot(); OLD: void showGusOpenSlotSelector(); OLD: RootSelection* _gusOpenSlotRootSel; OLD: QAction *_chooseAndOpenSlotAction; NEW: void chooseAndOpenSlots(); NEW: void showGusOpenSlotsSelector(); NEW: RootSelection* _gusOpenSlotsRootSel; NEW: QAction *_chooseAndOpenSlotsAction; ADDED: void processAppliedGusOpenSlotsSelection (const RootSelection*); .. If more than Four (4) Slots have been selected to be opened, the user is first asked to confirm the operation with a popup query dialog: Title: Show many Open Slot dialogs? Message: Do you want to show _X_ Open Slot dialogs? Buttons: [Yes] [No] [This is similar to the query in the Find Inputs dialog]. ========== Special Handling for Opening/Loading Rulesets and Optimization Sets when the selected file had been saved as a Global Function Set. SEE: http://cadswes2.colorado.edu/~philw/2009/GlobalRplFunctions/2009may20/ ------------------- QtRpl/RplDlgMgr.hpp QtRpl/RplDlgMgr.cpp ------------------- After opening (or loading) a RplSet as a RuleSet or Optimization Set, before creating a RplSet dialog, if the _wasGlobalOnLastSave flag was set in the opened RplSet file, ASK the user if the RplSet should INSTEAD be opened as a Global Function Set -- and give the choice of, instead, aborting the open/load operation altogether. If the use chooses either of these two options, the opened/loaded RplSet is closed (and deleted from the RiverWare session). New method: // Returns indication that the user chose to dump the loaded RplSet -- // either because the RplSet was instead opened as a Global Function Set // or because the load operation was aborted. bool RplDlgMgr::maybeOpenAsGlobalFunctionSetInstead ( RplSet* inputSet, const QString& noChangeText, const rwFile& fileObj, cwfpointer& fp, RWCString& error) Called from: (1) bool RplDlgMgr::openRuleset (const rwFile& fileObj, cwfpointer& fp, .. (2) bool RplDlgMgr::openOptset (const rwFile& fileObj, cwfpointer& fp, .. --------------------- Q3GUI/LoadSaveMgr.cpp --------------------- void LoadSaveMgr::recordRuleSetPath (const QString& pathString, bool saveOp) void LoadSaveMgr::recordOptSetPath (const QString& pathString, bool saveOp) If the file SEEMS TO BE a Global Function Set -- based only on the file name ending in ".gfs" or ".gfs.gz" -- skip the operation. That is, don't record the given pathString as a recently accessed RuleSet path or Optimization Set path. This is an approximate heuristic added in conjunction with giving the user the choice to open the specified RplSet INSTEAD as a Global Function Set. But that new feature is based on a different criteria: The RplSet file containing an indication that it had been a Global Function Set when it was saved to a file. The thing is, it is too difficult to apply this correct criteria to the recording of recent paths because that occurs at a very different place in code. ============ ------------------- QtRpl/RplDlgMgr.cpp ------------------- TYPO in change checked in on 4-14-2008 (13 months ago): Incorrect loading of Optimization Set. Method: bool RplDlgMgr::openOptset (const rwFile& fileObj, cwfpointer& fp, bool load, RWCString& error); cvs rev 1.64, Line 636: loadRuleset(optSet); <<< ERROR cvs rev 1.63, Line 622: loadOptset(optSet); <<< CORRECT This is called after the optSet is opened, and only if the optSet is to be also loaded. The error code results in an assertion error in RplDlgMgr::loadRuleset, when the "local" application type does not equal RplApplication::RBS. It's strange that we haven't run into this before. ============ Enhancement to File menu of the Rpl Editor Dialogs for the "openable" RPL Applications (RBS Rulesets, Optimation Policy Sets and Global Function Sets) -- for the four RplObj types: Set, Group, Block and Function. (1) The references to "Set" are now RplApplication-specific (2) OptSet Editors: Now New/Open/Reopen OptSets (not RBS Sets) (3) Added "Reopen" history submenu for the particular RplApp (4) Added New/Open/Reopen for Global Function Sets in all Apps. Old File Menu (in all three of the "openable" RPL Application Types) New Set... Ctrl+N Open Set... Ctrl+O Save Set Ctrl+S Save Set As... Ctrl+Shift+A ... New Ruleset File Menu: New RBS Ruleset... Ctrl+N Open RBS Ruleset... Ctrl+O Reopen RBS Ruleset >> ... (history) --------------------------------------------- New Global Function Set... Open Global Function Set... Reopen Global Function Set >> ... (history) --------------------------------------------- Save RBS Ruleset Ctrl+S Save RBS Ruleset As... Ctrl+Shift+S ... New Optimization Policy Set File Menu: New Optimization Policy Set... Ctrl+N Open Optimization Policy Set... Ctrl+O Reopen Optimization Policy Set >> ... (history) ----------------------------------------------------- New Global Function Set... Open Global Function Set... Reopen Global Function Set >> ... (history) ----------------------------------------------------- Save Optimization Policy Set Ctrl+S Save Optimization Policy Set As... Ctrl+Shift+S ... New Global Function Set File Menu: New Global Function Set... Ctrl+N Open Global Function Set... Ctrl+O Reopen Global Function Set >> ... (history) ----------------------------------------------------- Save Global Function Set Ctrl+S Save Global Function Set As... Ctrl+Shift+S ... SOURCE FILE CHANGES: ------------------------------ QtRpl/RplBlockDlgWidgets.ui QtRpl/RplFunctionDlgWidgets.ui QtRpl/RplGroupDlgWidgets.ui QtRpl/RplSetDlgWidgets.ui ------------------------------ New menus and actions (under the File menu): QMenu* _reopenSetMenu; QMenu* _reopenGlobFuncSetMenu; QAction* _newGlobFuncSetAction; QAction* _openGlobFuncSetAction -------------------- QtRpl/RplBaseDlg.cpp QtRpl/RplBaseDlg.hpp -------------------- New protected Qt slots (signal handlers): void newGlobFuncSetHandler (); void openGlobFuncSetHandler (); void reopenSetMenu_aboutToShow(); void reopenGlobFuncSetMenu_aboutToShow(); New protected methods: void configNewSetAction (RplApplication::Type, QAction*); void configOpenSetAction (RplApplication::Type, QAction*); void configSaveSetAction (RplApplication::Type, QAction*); void configSaveSetAsAction (RplApplication::Type, QAction*); void configReopenSetMenu (RplApplication::Type, QMenu*); void configReopenGlobFuncSetMenu (QMenu*); New private data members: // copies of subclass widget handles QMenu* _reopenSetMenu; QMenu* _reopenGlobFuncSetMenu; ------------------------- QtRpl/RplBlockDlg.cpp QtRpl/RplFunctionDlg.cpp QtRpl/RplGroupDlg.cpp QtRpl/RplSetDlg.cpp ------------------------- Changes/additions to these methods: (1) void RplSetDlg::disableModelEdit (bool disable) (2) void RplSetDlg::initConnections() (3) void RplSetDlg::initForApplication() ---