Changeset 54919 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 24, 2015 2:02:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r54886 r54919 208 208 void UISettingsDialogGlobal::loadData() 209 209 { 210 /* Call forbase-class: */210 /* Call to base-class: */ 211 211 UISettingsDialog::loadData(); 212 212 213 /* Get properties and settings: */ 214 CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties(); 215 VBoxGlobalSettings settings = vboxGlobal().settings(); 213 216 /* Prepare global data: */ 214 217 qRegisterMetaType<UISettingsDataGlobal>(); 215 UISettingsDataGlobal data(vboxGlobal().virtualBox().GetSystemProperties(), vboxGlobal().settings()); 216 /* Create global settings loader, 217 * it will load global settings & delete itself in the appropriate time: */ 218 UISettingsDataGlobal data(properties, settings); 219 /* Create global settings loader: */ 218 220 UISettingsSerializer *pGlobalSettingsLoader = new UISettingsSerializer(this, 219 221 UISettingsSerializer::Load, … … 227 229 void UISettingsDialogGlobal::saveData() 228 230 { 229 /* Call forbase-class: */231 /* Call to base-class: */ 230 232 UISettingsDialog::saveData(); 231 233 … … 236 238 qRegisterMetaType<UISettingsDataGlobal>(); 237 239 UISettingsDataGlobal data(properties, settings); 238 /* Create global settings saver, 239 * it will save global settings & delete itself in the appropriate time: */ 240 /* Create global settings saver: */ 240 241 UISettingsSerializer *pGlobalSettingsSaver = new UISettingsSerializer(this, 241 242 UISettingsSerializer::Save, … … 511 512 return; 512 513 513 /* Call forbase-class: */514 /* Call to base-class: */ 514 515 UISettingsDialog::loadData(); 515 516 … … 518 519 519 520 /* Prepare session: */ 520 m_session = configurationAccessLevel() == ConfigurationAccessLevel_Null ? CSession() : vboxGlobal().openExistingSession(m_strMachineId); 521 m_session = configurationAccessLevel() == ConfigurationAccessLevel_Null ? CSession() : 522 configurationAccessLevel() == ConfigurationAccessLevel_Full ? vboxGlobal().openSession(m_strMachineId) : 523 vboxGlobal().openExistingSession(m_strMachineId); 521 524 /* Check that session was created: */ 522 525 if (m_session.isNull()) 523 526 return; 524 527 525 /* Get machine from session: */528 /* Get machine and console: */ 526 529 m_machine = m_session.GetMachine(); 527 /* Get console from session: */528 530 m_console = configurationAccessLevel() == ConfigurationAccessLevel_Full ? CConsole() : m_session.GetConsole(); 529 530 531 /* Prepare machine data: */ 531 532 qRegisterMetaType<UISettingsDataMachine>(); 532 533 UISettingsDataMachine data(m_machine, m_console); 533 /* Create machine settings loader, 534 * it will load machine settings & delete itself in the appropriate time: */ 534 /* Create machine settings loader: */ 535 535 UISettingsSerializer *pMachineSettingsLoader = new UISettingsSerializer(this, 536 536 UISettingsSerializer::Load, … … 551 551 return; 552 552 553 /* Call forbase-class: */553 /* Call to base-class: */ 554 554 UISettingsDialog::saveData(); 555 555 … … 558 558 559 559 /* Prepare session: */ 560 if (configurationAccessLevel() == ConfigurationAccessLevel_Null) 561 m_session = CSession(); 562 else if (configurationAccessLevel() != ConfigurationAccessLevel_Full) 563 m_session = vboxGlobal().openExistingSession(m_strMachineId); 564 else 565 m_session = vboxGlobal().openSession(m_strMachineId); 560 m_session = configurationAccessLevel() == ConfigurationAccessLevel_Null ? CSession() : 561 configurationAccessLevel() == ConfigurationAccessLevel_Full ? vboxGlobal().openSession(m_strMachineId) : 562 vboxGlobal().openExistingSession(m_strMachineId); 566 563 /* Check that session was created: */ 567 564 if (m_session.isNull()) 568 565 return; 569 566 570 /* Get machine from session: */567 /* Get machine and console: */ 571 568 m_machine = m_session.GetMachine(); 572 /* Get console from session: */573 569 m_console = configurationAccessLevel() == ConfigurationAccessLevel_Full ? CConsole() : m_session.GetConsole(); 574 575 570 /* Prepare machine data: */ 576 571 qRegisterMetaType<UISettingsDataMachine>(); 577 572 UISettingsDataMachine data(m_machine, m_console); 578 /* Create machine settings saver, 579 * it will save machine settings & delete itself in the appropriate time: */ 573 /* Create machine settings saver: */ 580 574 UISettingsSerializer *pMachineSettingsSaver = new UISettingsSerializer(this, 581 575 UISettingsSerializer::Save, … … 587 581 /* Get updated machine: */ 588 582 m_machine = pMachineSettingsSaver->data().value<UISettingsDataMachine>().m_machine; 589 /* If machine is ok=> perform final operations: */583 /* If machine is OK => perform final operations: */ 590 584 if (m_machine.isOk()) 591 585 { … … 622 616 } 623 617 624 /* If machine is NOT ok=> show the error message: */618 /* If machine is NOT OK => show the error message: */ 625 619 if (!m_machine.isOk()) 626 620 msgCenter().cannotSaveMachineSettings(m_machine, this);
Note:
See TracChangeset
for help on using the changeset viewer.