Changeset 92884 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 13, 2021 1:46:35 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148835
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp
r92860 r92884 247 247 m_fMarkedForError = fMarkForError; 248 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 249 if (m_pUserNameEdit) 250 { 251 QPalette mPalette = m_pUserNameEdit->palette(); 252 if (m_fMarkedForError) 253 mPalette.setColor(QPalette::Base, m_errorBaseColor); 254 else 255 mPalette.setColor(QPalette::Base, m_defaultBaseColor); 256 m_pUserNameEdit->setPalette(mPalette); 257 } 258 if (m_pPasswordEdit) 259 { 260 QPalette mPalette = m_pPasswordEdit->palette(); 261 if (m_fMarkedForError) 262 mPalette.setColor(QPalette::Base, m_errorBaseColor); 263 else 264 mPalette.setColor(QPalette::Base, m_defaultBaseColor); 265 m_pPasswordEdit->setPalette(mPalette); 266 } 267 267 } 268 268 … … 1204 1204 } 1205 1205 1206 void UIFileManagerGuestTable::postGuestSessionCreated()1207 {1208 if (m_pGuestSessionPanel)1209 m_pGuestSessionPanel->switchSessionCloseMode();1210 }1211 1212 void UIFileManagerGuestTable::postGuestSessionClosed()1213 {1214 if (m_pGuestSessionPanel)1215 m_pGuestSessionPanel->switchSessionCreateMode();1216 }1217 1218 1206 void UIFileManagerGuestTable::prepareListener(ComObjPtr<UIMainEventListenerImpl> &QtListener, 1219 1207 CEventListener &comEventListener, … … 1258 1246 { 1259 1247 m_comGuestSession.detach(); 1260 postGuestSessionClosed();1261 1248 emit sigLogOutput("Guest session unregistered", m_strTableName, FileManagerLogType_Info); 1262 1249 } … … 1279 1266 if (m_comGuestSession.isOk()) 1280 1267 { 1268 emit sigLogOutput(QString("%1: %2").arg("Guest session status has changed").arg(gpConverter->toString(m_comGuestSession.GetStatus())), 1269 m_strTableName, FileManagerLogType_Info); 1270 1281 1271 if (m_comGuestSession.GetStatus() == KGuestSessionStatus_Started) 1282 1272 initFileTable(); 1283 emit sigLogOutput(QString("%1: %2").arg("Guest session status has changed").arg(gpConverter->toString(m_comGuestSession.GetStatus())), 1284 m_strTableName, FileManagerLogType_Info); 1273 else 1274 { 1275 cleanupGuestSessionListener(); 1276 closeGuestSession(); 1277 } 1285 1278 } 1286 1279 else 1287 1280 emit sigLogOutput("Guest session is not valid", m_strTableName, FileManagerLogType_Error); 1288 postGuestSessionCreated();1289 1281 setStateAndEnableWidgets(); 1290 1282 } … … 1337 1329 void UIFileManagerGuestTable::sltHandleCloseSessionRequest() 1338 1330 { 1331 cleanupGuestSessionListener(); 1339 1332 closeGuestSession(); 1340 1333 } … … 1362 1355 m_pWarningLabel->setVisible(true); 1363 1356 m_pGuestSessionPanel->setEnabled(false); 1357 if (m_pGuestSessionPanel) 1358 m_pGuestSessionPanel->switchSessionCreateMode(); 1364 1359 break; 1365 1360 case State_SessionPossible: … … 1367 1362 m_pWarningLabel->setVisible(true); 1368 1363 m_pGuestSessionPanel->setEnabled(true); 1364 if (m_pGuestSessionPanel) 1365 m_pGuestSessionPanel->switchSessionCreateMode(); 1369 1366 break; 1370 1367 case State_SessionRunning: … … 1372 1369 m_pWarningLabel->setVisible(false); 1373 1370 m_pGuestSessionPanel->setEnabled(true); 1371 if (m_pGuestSessionPanel) 1372 m_pGuestSessionPanel->switchSessionCloseMode(); 1374 1373 break; 1375 1374 default: … … 1389 1388 { 1390 1389 emit sigLogOutput("Could not find Guest Additions", m_strTableName, FileManagerLogType_Error); 1391 postGuestSessionClosed();1392 1390 if (m_pGuestSessionPanel) 1393 1391 m_pGuestSessionPanel->markForError(true); … … 1415 1413 this, &UIFileManagerGuestTable::sltGuestSessionStateChanged); 1416 1414 1415 if (m_comGuestSession.GetStatus() != KGuestSessionStatus_Started || 1416 m_comGuestSession.GetStatus() != KGuestSessionStatus_Starting) 1417 return false; 1417 1418 return true; 1418 1419 } … … 1420 1421 void UIFileManagerGuestTable::closeGuestSession() 1421 1422 { 1422 cleanupGuestSessionListener();1423 1423 if (!m_comGuestSession.isNull()) 1424 { 1424 1425 m_comGuestSession.Close(); 1425 // if (!m_comGuestSession.isNull()) 1426 // { 1427 // m_comGuestSession.Close(); 1428 // m_comGuestSession.detach(); 1429 // emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info); 1430 // } 1431 // reset(); 1432 // postGuestSessionClosed(); 1426 m_comGuestSession.detach(); 1427 emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info); 1428 } 1429 reset(); 1433 1430 } 1434 1431 1435 1432 void UIFileManagerGuestTable::cleanAll() 1436 1433 { 1437 printf("UIFileManagerGuestTable::cleanAll()\n");1438 1439 1434 cleanupConsoleListener(); 1440 1435 cleanupGuestListener(); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h
r92860 r92884 140 140 void setStateAndEnableWidgets(); 141 141 142 /** @name Perform operations needed after creating/ending a guest control session143 * @{ */144 void postGuestSessionCreated();145 void postGuestSessionClosed();146 /** @} */147 148 142 void initFileTable(); 149 143 void cleanAll();
Note:
See TracChangeset
for help on using the changeset viewer.