Changeset 37143 in vbox
- Timestamp:
- May 18, 2011 3:25:29 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r37027 r37143 720 720 } 721 721 722 bool VBoxProblemReporter::confirmedSettingsReloading(QWidget *pParent) 723 { 724 int rc = message(pParent, Question, 725 tr("<p>The machine settings were changed while you were editing them. " 726 "You currently have unsaved setting changes.</p>" 727 "<p>Would you like to reload the changed settings or to keep your own changes?</p>"), 0, 728 QIMessageBox::Yes, QIMessageBox::No | QIMessageBox::Default | QIMessageBox::Escape, 0, 729 tr("Reload settings"), tr("Keep changes"), 0); 730 return rc == QIMessageBox::Yes; 731 } 732 722 733 void VBoxProblemReporter::cannotStartMachine (const CConsole &console) 723 734 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r36393 r37143 202 202 QWidget *parent = 0); 203 203 204 bool confirmedSettingsReloading(QWidget *pParent); 205 204 206 void cannotStartMachine (const CConsole &console); 205 207 void cannotStartMachine (const CProgress &progress); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r37138 r37143 1092 1092 return; 1093 1093 1094 /* Check if user had changed something and warn him about he will loose settings on reloading: */ 1095 if (isSettingsChanged() && !vboxProblem().confirmedSettingsReloading(this)) 1096 return; 1097 1094 1098 /* Reload data: */ 1095 1099 loadData(); … … 1166 1170 } 1167 1171 1172 bool UISettingsDialogMachine::isSettingsChanged() 1173 { 1174 bool fIsSettingsChanged = false; 1175 for (int iWidgetNumber = 0; iWidgetNumber < m_pStack->count() && !fIsSettingsChanged; ++iWidgetNumber) 1176 { 1177 UISettingsPage *pPage = static_cast<UISettingsPage*>(m_pStack->widget(iWidgetNumber)); 1178 pPage->putToCache(); 1179 if (pPage->changed()) 1180 fIsSettingsChanged = true; 1181 } 1182 return fIsSettingsChanged; 1183 } 1184 1168 1185 # include "UISettingsDialogSpecific.moc" 1169 1186 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r37138 r37143 110 110 111 111 bool isPageAvailable(int iPageId); 112 bool isSettingsChanged(); 112 113 113 114 QString m_strMachineId; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r37051 r37143 106 106 bool isMachineInValidMode() const { return isMachineOffline() || isMachineSaved() || isMachineOnline(); } 107 107 108 /* Page changed: */ 109 virtual bool changed() const = 0; 110 108 111 /* Page 'ID' stuff: */ 109 112 int id() const { return m_cId; } … … 153 156 void uploadData(QVariant &data) const; 154 157 158 /* Page changed: */ 159 bool changed() const { return false; } 160 155 161 /* Global data source: */ 156 162 CSystemProperties m_properties; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.h
r36924 r37143 75 75 void saveFromCacheTo(QVariant &data); 76 76 77 /* Page changed: */ 78 bool changed() const { return m_cache.wasChanged(); } 79 77 80 void setOrderAfter (QWidget *aWidget); 78 81 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r36920 r37143 110 110 void saveFromCacheTo(QVariant &data); 111 111 112 /* Page changed: */ 113 bool changed() const { return m_cache.wasChanged(); } 114 112 115 void setValidator (QIWidgetValidator *aVal); 113 116 bool revalidate (QString &aWarning, QString &aTitle); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
r36917 r37143 96 96 void getFromCache(); 97 97 98 /* Page changed: */ 99 bool changed() const { return m_cache.wasChanged(); } 100 98 101 /* Save data from corresponding widgets to cache, 99 102 * this task SHOULD be performed in GUI thread only: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
r36928 r37143 187 187 void saveFromCacheTo(QVariant &data); 188 188 189 /* Page changed: */ 190 bool changed() const { return m_cache.wasChanged(); } 191 189 192 void setValidator(QIWidgetValidator *pValidator); 190 193 bool revalidate(QString &strWarning, QString &strTitle); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.h
r36930 r37143 132 132 void saveFromCacheTo(QVariant &data); 133 133 134 /* Page changed: */ 135 bool changed() const { return m_cache.wasChanged(); } 136 134 137 void setValidator (QIWidgetValidator *aVal); 135 138 bool revalidate (QString &aWarning, QString &aTitle); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h
r37051 r37143 100 100 void saveFromCacheTo(UISharedFolderType sharedFoldersType); 101 101 102 /* Page changed: */ 103 bool changed() const { return m_cache.wasChanged(); } 104 102 105 void setOrderAfter (QWidget *aWidget); 103 106 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.h
r36929 r37143 139 139 void saveFromCacheTo(QVariant &data); 140 140 141 /* Page changed: */ 142 bool changed() const { return m_cache.wasChanged(); } 143 141 144 void setValidator (QIWidgetValidator *aVal); 142 145 bool revalidate (QString &aWarning, QString &aTitle); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r37051 r37143 654 654 void saveFromCacheTo(QVariant &data); 655 655 656 /* Page changed: */ 657 bool changed() const { return m_cache.wasChanged(); } 658 656 659 void setValidator (QIWidgetValidator *aVal); 657 660 bool revalidate (QString &aWarning, QString &aTitle); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r36919 r37143 130 130 void saveFromCacheTo(QVariant &data); 131 131 132 /* Page changed: */ 133 bool changed() const { return m_cache.wasChanged(); } 134 132 135 void setValidator (QIWidgetValidator *aVal); 133 136 bool revalidate (QString &aWarning, QString &aTitle); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h
r37126 r37143 138 138 void saveFromCacheTo(QVariant &data); 139 139 140 /* Page changed: */ 141 bool changed() const { return m_cache.wasChanged(); } 142 140 143 void setValidator (QIWidgetValidator *aVal); 141 144 bool revalidate(QString &strWarningText, QString &strTitle);
Note:
See TracChangeset
for help on using the changeset viewer.