! called when the current aspect in the tree of the project explorer was changed. Selects the new aspect. */
| 2141 | Selects the new aspect. |
| 2142 | */ |
| 2143 | void MainWin::handleCurrentAspectChanged(AbstractAspect* aspect) { |
| 2144 | DEBUG(Q_FUNC_INFO) |
| 2145 | if (!aspect) |
| 2146 | aspect = m_project; // should never happen, just in case |
| 2147 | |
| 2148 | m_suppressCurrentSubWindowChangedEvent = true; |
| 2149 | if (aspect->folder() != m_currentFolder) { |
| 2150 | m_currentFolder = aspect->folder(); |
| 2151 | updateDockWindowVisibility(); |
| 2152 | } |
| 2153 | |
| 2154 | m_currentAspect = aspect; |
| 2155 | |
| 2156 | // activate the corresponding MDI sub window for the current aspect |
| 2157 | activateSubWindowForAspect(aspect); |
| 2158 | m_suppressCurrentSubWindowChangedEvent = false; |
| 2159 | |
| 2160 | updateGUI(); |
| 2161 | } |
| 2162 | |
| 2163 | void MainWin::activateSubWindowForAspect(const AbstractAspect* aspect) { |
| 2164 | Q_ASSERT(aspect); |