- Timestamp:
- Aug 4, 2016 1:48:34 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 109597
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
r62987 r62988 144 144 // printf("UIDesktopWidgetWatchdog::sltUpdateHostScreenConfiguration(%d)\n", cHostScreenCount); 145 145 146 /* Update host-screen configuration: */ 147 updateHostScreenConfiguration(cHostScreenCount); 148 } 149 150 void UIDesktopWidgetWatchdog::sltRecalculateHostScreenAvailableGeometry(int iHostScreenIndex) 151 { 152 // printf("UIDesktopWidgetWatchdog::sltRecalculateHostScreenAvailableGeometry(%d)\n", iHostScreenIndex); 153 154 /* Recalculate host-screen available-geometry: */ 155 recalculateHostScreenAvailableGeometry(iHostScreenIndex); 156 } 157 158 void UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated(int iHostScreenIndex, QRect availableGeometry) 159 { 160 // printf("UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated(%d): %dx%d x %dx%d\n", 161 // iHostScreenIndex, availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height()); 162 163 /* Apply received data: */ 164 m_availableGeometryData[iHostScreenIndex] = availableGeometry; 165 /* Forget finished worker: */ 166 AssertPtrReturnVoid(m_availableGeometryWorkers.value(iHostScreenIndex)); 167 m_availableGeometryWorkers.value(iHostScreenIndex)->disconnect(); 168 m_availableGeometryWorkers.value(iHostScreenIndex)->deleteLater(); 169 m_availableGeometryWorkers[iHostScreenIndex] = 0; 170 } 171 172 void UIDesktopWidgetWatchdog::prepare() 173 { 174 /* Prepare connections: */ 175 connect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltUpdateHostScreenConfiguration(int))); 176 connect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltRecalculateHostScreenAvailableGeometry(int))); 177 178 /* Update host-screen configuration: */ 179 updateHostScreenConfiguration(); 180 } 181 182 void UIDesktopWidgetWatchdog::cleanup() 183 { 184 /* Cleanup connections: */ 185 disconnect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltUpdateHostScreenConfiguration(int))); 186 disconnect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltRecalculateHostScreenAvailableGeometry(int))); 187 188 /* Cleanup existing workers finally: */ 189 cleanupExistingWorkers(); 190 } 191 192 void UIDesktopWidgetWatchdog::updateHostScreenConfiguration(int cHostScreenCount /* = -1 */) 193 { 146 194 /* Acquire new host-screen count: */ 147 195 m_cHostScreenCount = cHostScreenCount != -1 ? cHostScreenCount : m_pDesktopWidget->screenCount(); … … 156 204 /* Calculate host-screen available-geometry for each particular host-screen: */ 157 205 for (int iHostScreenIndex = 0; iHostScreenIndex < m_cHostScreenCount; ++iHostScreenIndex) 158 sltRecalculateHostScreenAvailableGeometry(iHostScreenIndex); 159 } 160 161 void UIDesktopWidgetWatchdog::sltRecalculateHostScreenAvailableGeometry(int iHostScreenIndex) 162 { 163 // printf("UIDesktopWidgetWatchdog::sltRecalculateHostScreenAvailableGeometry(%d)\n", iHostScreenIndex); 164 206 recalculateHostScreenAvailableGeometry(iHostScreenIndex); 207 } 208 209 void UIDesktopWidgetWatchdog::recalculateHostScreenAvailableGeometry(int iHostScreenIndex) 210 { 165 211 /* Make sure index is valid: */ 166 212 if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount) … … 193 239 } 194 240 195 void UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated(int iHostScreenIndex, QRect availableGeometry)196 {197 // printf("UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated(%d): %dx%d x %dx%d\n",198 // iHostScreenIndex, availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height());199 200 /* Apply received data: */201 m_availableGeometryData[iHostScreenIndex] = availableGeometry;202 /* Forget finished worker: */203 AssertPtrReturnVoid(m_availableGeometryWorkers.value(iHostScreenIndex));204 m_availableGeometryWorkers.value(iHostScreenIndex)->disconnect();205 m_availableGeometryWorkers.value(iHostScreenIndex)->deleteLater();206 m_availableGeometryWorkers[iHostScreenIndex] = 0;207 }208 209 void UIDesktopWidgetWatchdog::prepare()210 {211 /* Prepare connections: */212 connect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltUpdateHostScreenConfiguration(int)));213 connect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltRecalculateHostScreenAvailableGeometry(int)));214 215 /* Update host-screen configuration: */216 sltUpdateHostScreenConfiguration();217 }218 219 void UIDesktopWidgetWatchdog::cleanup()220 {221 /* Cleanup connections: */222 disconnect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltUpdateHostScreenConfiguration(int)));223 disconnect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltRecalculateHostScreenAvailableGeometry(int)));224 225 /* Cleanup existing workers finally: */226 cleanupExistingWorkers();227 }228 229 241 void UIDesktopWidgetWatchdog::cleanupExistingWorkers() 230 242 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h
r62987 r62988 50 50 private slots: 51 51 52 /** Updates host-screen configuration according to new @a cHostScreenCount. 53 * @note cHostScreenCount can be equal to -1 which means we have to acquire it ourselves. */ 54 void sltUpdateHostScreenConfiguration(int cHostScreenCount = -1); 52 /** Updates host-screen configuration according to new @a cHostScreenCount. */ 53 void sltUpdateHostScreenConfiguration(int cHostScreenCount); 55 54 56 55 /** Recalculates available-geometry for the host-screen with @a iHostScreenIndex. */ … … 66 65 /** Cleanup routine. */ 67 66 void cleanup(); 67 68 /** Updates host-screen configuration according to new @a cHostScreenCount. 69 * @note cHostScreenCount can be equal to -1 which means we have to acquire it ourselves. */ 70 void updateHostScreenConfiguration(int cHostScreenCount = -1); 71 72 /** Recalculates available-geometry for the host-screen with @a iHostScreenIndex. */ 73 void recalculateHostScreenAvailableGeometry(int iHostScreenIndex); 68 74 69 75 /** Cleanups existing workers. */
Note:
See TracChangeset
for help on using the changeset viewer.