Changeset 100925 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 21, 2023 3:09:13 PM (16 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r100924 r100925 71 71 , m_fPolished(false) 72 72 , m_fSerializationIsInProgress(false) 73 , m_fSerializationClean( true)73 , m_fSerializationClean(false) 74 74 , m_fClosed(false) 75 75 , m_pStatusBar(0) … … 96 96 save(); 97 97 98 /* If serialization was clean: */ 99 if (m_fSerializationClean) 100 { 101 /* Tell the listener to close us (once): */ 102 if (!m_fClosed) 103 { 104 m_fClosed = true; 105 emit sigClose(); 106 } 107 } 98 /* Close if theere is no ongoing serialization: */ 99 if (!isSerializationInProgress()) 100 close(); 108 101 } 109 102 110 103 void UISettingsDialog::reject() 111 104 { 105 /* Close if theere is no ongoing serialization: */ 112 106 if (!isSerializationInProgress()) 113 107 close(); … … 163 157 } 164 158 165 void UISettingsDialog::sltHandleSerializationFinished() 166 { 167 /* Delete serializer if exists: */ 168 if (serializeProcess()) 169 { 170 delete m_pSerializeProcess; 171 m_pSerializeProcess = 0; 172 } 173 174 /* Mark serialization finished: */ 175 m_fSerializationIsInProgress = false; 176 } 177 178 void UISettingsDialog::sltHandleProcessStarted() 159 void UISettingsDialog::sltHandleSerializationStarted() 179 160 { 180 161 m_pProcessBar->setValue(0); … … 182 163 } 183 164 184 void UISettingsDialog::sltHandle ProcessProgressChange(int iValue)165 void UISettingsDialog::sltHandleSerializationProgressChange(int iValue) 185 166 { 186 167 m_pProcessBar->setValue(iValue); … … 192 173 m_pStatusBar->setCurrentIndex(0); 193 174 } 175 } 176 177 void UISettingsDialog::sltHandleSerializationFinished() 178 { 179 /* Delete serializer if exists: */ 180 delete m_pSerializeProcess; 181 m_pSerializeProcess = 0; 182 183 /* Mark serialization finished: */ 184 m_fSerializationIsInProgress = false; 194 185 } 195 186 … … 219 210 { 220 211 m_fPolished = true; 221 polishEvent( pEvent);212 polishEvent(); 222 213 } 223 214 … … 226 217 } 227 218 228 void UISettingsDialog::polishEvent( QShowEvent*)219 void UISettingsDialog::polishEvent() 229 220 { 230 221 /* Check what's the minimum selector size: */ … … 293 284 pEvent->ignore(); 294 285 295 /* Check whether there are unsaved settings 296 * which will be lost in such case: */ 297 if ( !isSettingsChanged() 286 /* Check whether serialization was clean (save) 287 * or there are no unsaved settings to be lost (cancel): */ 288 if ( m_fSerializationClean 289 || !isSettingsChanged() 298 290 || msgCenter().confirmSettingsDiscarding(this)) 299 291 { … … 355 347 { 356 348 /* Configure settings loader: */ 357 connect(m_pSerializeProcess, &UISettingsSerializer::sigNotifyAboutProcessStarted, this, &UISettingsDialog::sltHandleProcessStarted); 358 connect(m_pSerializeProcess, &UISettingsSerializer::sigNotifyAboutProcessProgressChanged, this, &UISettingsDialog::sltHandleProcessProgressChange); 359 connect(m_pSerializeProcess, &UISettingsSerializer::sigNotifyAboutProcessFinished, this, &UISettingsDialog::sltHandleSerializationFinished); 349 connect(m_pSerializeProcess, &UISettingsSerializer::sigNotifyAboutProcessStarted, 350 this, &UISettingsDialog::sltHandleSerializationStarted); 351 connect(m_pSerializeProcess, &UISettingsSerializer::sigNotifyAboutProcessProgressChanged, 352 this, &UISettingsDialog::sltHandleSerializationProgressChange); 353 connect(m_pSerializeProcess, &UISettingsSerializer::sigNotifyAboutProcessFinished, 354 this, &UISettingsDialog::sltHandleSerializationFinished); 360 355 361 356 /* Raise current page priority: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r100924 r100925 99 99 virtual void sltCategoryChanged(int cId); 100 100 101 /** Handles serializartion start. */ 102 virtual void sltHandleSerializationStarted(); 103 /** Handles serializartion progress change to @a iValue. */ 104 virtual void sltHandleSerializationProgressChange(int iValue); 101 105 /** Handle serializartion finished. */ 102 106 virtual void sltHandleSerializationFinished(); 103 104 /** Handles process start. */105 void sltHandleProcessStarted();106 /** Handles process progress change to @a iValue. */107 void sltHandleProcessProgressChange(int iValue);108 107 109 108 protected: … … 113 112 /** Handles show @a pEvent. */ 114 113 virtual void showEvent(QShowEvent *pEvent) RT_OVERRIDE; 115 /** Handles first show @a pEvent. */116 virtual void polishEvent( QShowEvent *pEvent);114 /** Handles first show event. */ 115 virtual void polishEvent(); 117 116 /** Handles close @a pEvent. */ 118 117 virtual void closeEvent(QCloseEvent *pEvent) RT_OVERRIDE;
Note:
See TracChangeset
for help on using the changeset viewer.