Changeset 37138 in vbox
- Timestamp:
- May 18, 2011 2:53:25 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r37109 r37138 53 53 , m_fPolished(false) 54 54 /* Loading/saving stuff: */ 55 , m_fProcessed(false) 55 , m_fLoaded(false) 56 , m_fSaved(false) 56 57 /* Status bar stuff: */ 57 58 , m_pStatusBar(new QStackedWidget(this)) … … 217 218 } 218 219 219 void UISettingsDialog::sltMarkProcessed() 220 { 221 m_fProcessed = true; 220 void UISettingsDialog::sltMarkLoaded() 221 { 222 m_fLoaded = true; 223 } 224 225 void UISettingsDialog::sltMarkSaved() 226 { 227 m_fSaved = true; 222 228 } 223 229 … … 238 244 m_pStatusBar->setCurrentIndex(0); 239 245 } 246 } 247 248 void UISettingsDialog::loadData() 249 { 250 m_fLoaded = false; 251 } 252 253 void UISettingsDialog::saveData() 254 { 255 m_fSaved = false; 240 256 } 241 257 … … 488 504 void UISettingsDialog::reject() 489 505 { 490 if (m_f Processed)506 if (m_fLoaded) 491 507 QIMainDialog::reject(); 492 508 } … … 591 607 void UISettingsDialog::closeEvent(QCloseEvent *pEvent) 592 608 { 593 if (m_f Processed)609 if (m_fLoaded) 594 610 QIMainDialog::closeEvent(pEvent); 595 611 else -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r37109 r37138 60 60 virtual void sltCategoryChanged(int cId); 61 61 62 /* Mark dialog as processed: */ 63 virtual void sltMarkProcessed(); 62 /* Mark dialog as loaded: */ 63 virtual void sltMarkLoaded(); 64 /* Mark dialog as saved: */ 65 virtual void sltMarkSaved(); 64 66 65 67 /* Handlers for process bar: */ … … 70 72 71 73 /* Save/load API: */ 72 virtual void loadData() = 0;73 virtual void saveData() = 0;74 virtual void loadData(); 75 virtual void saveData(); 74 76 75 77 /* UI translator: */ … … 126 128 127 129 /* Loading/saving stuff: */ 128 bool m_fProcessed; 130 bool m_fLoaded; 131 bool m_fSaved; 129 132 130 133 /* Status bar widget: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r37126 r37138 405 405 void UISettingsDialogGlobal::loadData() 406 406 { 407 /* Call for base-class: */ 408 UISettingsDialog::loadData(); 409 407 410 /* Prepare global data: */ 408 411 qRegisterMetaType<UISettingsDataGlobal>(); … … 411 414 * it will load global settings & delete itself in the appropriate time: */ 412 415 UISettingsSerializer *pGlobalSettingsLoader = new UISettingsSerializer(this, QVariant::fromValue(data), UISettingsSerializeDirection_Load); 413 connect(pGlobalSettingsLoader, SIGNAL(destroyed(QObject*)), this, SLOT(sltMark Processed()));416 connect(pGlobalSettingsLoader, SIGNAL(destroyed(QObject*)), this, SLOT(sltMarkLoaded())); 414 417 /* Set pages to be loaded: */ 415 418 pGlobalSettingsLoader->setPageList(m_pSelector->settingPages()); … … 422 425 void UISettingsDialogGlobal::saveData() 423 426 { 427 /* Call for base-class: */ 428 UISettingsDialog::saveData(); 429 424 430 /* Get properties and settings: */ 425 431 CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties(); … … 447 453 else if (!(newSettings == settings)) 448 454 vboxGlobal().setSettings(newSettings); 455 456 /* Mark page processed: */ 457 sltMarkSaved(); 449 458 } 450 459 … … 700 709 else 701 710 m_pSelector->selectById(0); 702 703 /* Make sure settings dialog will be updated on machine state changes: */704 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),705 this, SLOT(sltMachineStateChanged(QString, KMachineState)));706 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),707 this, SLOT(sltMachineDataChanged(QString)));708 711 } 709 712 … … 713 716 if (!m_session.isNull()) 714 717 return; 718 719 /* Call for base-class: */ 720 UISettingsDialog::loadData(); 721 722 /* Disconnect global VBox events from this dialog: */ 723 gVBoxEvents->disconnect(this); 715 724 716 725 /* Prepare session: */ … … 731 740 * it will load machine settings & delete itself in the appropriate time: */ 732 741 UISettingsSerializer *pMachineSettingsLoader = new UISettingsSerializer(this, QVariant::fromValue(data), UISettingsSerializeDirection_Load); 733 connect(pMachineSettingsLoader, SIGNAL(destroyed(QObject*)), this, SLOT(sltMark Processed()));742 connect(pMachineSettingsLoader, SIGNAL(destroyed(QObject*)), this, SLOT(sltMarkLoaded())); 734 743 connect(pMachineSettingsLoader, SIGNAL(sigNotifyAboutPagesProcessed()), this, SLOT(sltSetFirstRunFlag())); 735 744 /* Set pages to be loaded: */ … … 748 757 if (!m_session.isNull()) 749 758 return; 759 760 /* Call for base-class: */ 761 UISettingsDialog::saveData(); 750 762 751 763 /* Prepare session: */ … … 821 833 822 834 /* Mark page processed: */ 823 sltMark Processed();835 sltMarkSaved(); 824 836 } 825 837 … … 1014 1026 } 1015 1027 1016 void UISettingsDialogMachine::sltMark Processed()1028 void UISettingsDialogMachine::sltMarkLoaded() 1017 1029 { 1018 1030 /* Call for base-class: */ 1019 UISettingsDialog::sltMarkProcessed(); 1031 UISettingsDialog::sltMarkLoaded(); 1032 1033 /* Unlock the session if exists: */ 1034 if (!m_session.isNull()) 1035 { 1036 m_session.UnlockMachine(); 1037 m_session = CSession(); 1038 m_machine = CMachine(); 1039 m_console = CConsole(); 1040 } 1041 1042 /* Make sure settings dialog will be updated on machine state/data changes: */ 1043 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), 1044 this, SLOT(sltMachineStateChanged(QString, KMachineState))); 1045 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), 1046 this, SLOT(sltMachineDataChanged(QString))); 1047 } 1048 1049 void UISettingsDialogMachine::sltMarkSaved() 1050 { 1051 /* Call for base-class: */ 1052 UISettingsDialog::sltMarkSaved(); 1020 1053 1021 1054 /* Unlock the session if exists: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r37109 r37138 98 98 private slots: 99 99 100 void sltMarkProcessed(); 100 void sltMarkLoaded(); 101 void sltMarkSaved(); 101 102 void sltMachineStateChanged(QString strMachineId, KMachineState machineState); 102 103 void sltMachineDataChanged(QString strMachineId);
Note:
See TracChangeset
for help on using the changeset viewer.