Changeset 55305 in vbox for trunk/src/VBox
- Timestamp:
- Apr 16, 2015 12:40:54 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r55214 r55305 914 914 .arg(strSnapshotName).arg(strMachineName), 915 915 formatErrorInfo(progress)); 916 } 917 918 void UIMessageCenter::cannotSaveSettings(const QString strDetails, QWidget *pParent /* = 0 */) const 919 { 920 error(pParent, MessageType_Error, 921 tr("Failed to save the settings."), 922 strDetails); 916 923 } 917 924 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r55214 r55305 209 209 void cannotRemoveSnapshot(const CMachine &machine, const QString &strSnapshotName, const QString &strMachineName) const; 210 210 void cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const; 211 212 /* API: Common settings warnings: */ 213 void cannotSaveSettings(const QString strDetails, QWidget *pParent = 0) const; 211 214 212 215 /* API: Global settings warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r55279 r55305 88 88 ulong iOperation, ulong iPercent); 89 89 90 /** Notifies listeners about particular COM error. 91 * @param strErrorInfo holds the details of the error happened. */ 92 void sigOperationProgressError(QString strErrorInfo); 93 90 94 public: 91 95 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.cpp
r55282 r55305 27 27 /* GUI includes: */ 28 28 # include "UISettingsSerializer.h" 29 # include "UIMessageCenter.h" 29 30 # include "UISettingsPage.h" 30 31 # include "UIIconPool.h" … … 147 148 connect(pPage, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong)), 148 149 this, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong))); 150 connect(pPage, SIGNAL(sigOperationProgressError(QString)), 151 this, SIGNAL(sigOperationProgressError(QString))); 149 152 if (pPage->isEnabled()) 150 153 { … … 157 160 disconnect(pPage, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong)), 158 161 this, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong))); 162 disconnect(pPage, SIGNAL(sigOperationProgressError(QString)), 163 this, SIGNAL(sigOperationProgressError(QString))); 159 164 pPage->setProcessed(true); 160 165 /* Remove processed page from our map: */ … … 233 238 connect(m_pSerializer, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong)), 234 239 this, SLOT(sltHandleOperationProgressChange(ulong, QString, ulong, ulong))); 240 connect(m_pSerializer, SIGNAL(sigOperationProgressError(QString)), 241 this, SLOT(sltHandleOperationProgressError(QString))); 235 242 } 236 243 … … 376 383 } 377 384 385 void UISettingsSerializerProgress::sltHandleOperationProgressError(QString strErrorInfo) 386 { 387 /* Show the error message: */ 388 msgCenter().cannotSaveSettings(strErrorInfo, this); 389 } 390 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h
r55279 r55305 72 72 ulong iOperation, ulong iPercent); 73 73 74 /** Notifies listeners about particular COM error. 75 * @param strErrorInfo holds the details of the error happened. */ 76 void sigOperationProgressError(QString strErrorInfo); 77 74 78 public: 75 79 … … 196 200 ulong iOperation, ulong iPercent); 197 201 202 /** Handles particular COM error. 203 * @param strErrorInfo holds the details of the error happened. */ 204 void sltHandleOperationProgressError(QString strErrorInfo); 205 198 206 private: 199 207 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r55279 r55305 329 329 QString strOldPassword = encryptionPasswords.value(strOldPasswordId); 330 330 331 // printf(" Medium: %s, old password = %s, new cipher = %s, new password = %s, new password id = %s\n",332 // medium.GetId().toAscii().constData(),333 // strOldPassword.toAscii().constData(),334 // strNewCipher.toAscii().constData(),335 // strNewPassword.toAscii().constData(),336 // strNewPasswordId.toAscii().constData());337 338 331 /* Update encryption: */ 339 332 CProgress cprogress = medium.ChangeEncryption(strOldPassword, … … 341 334 strNewPassword, 342 335 strNewPasswordId); 343 // if (!medium.isOk()) 344 // printf(" Medium API Error, rc = %s\n", msgCenter().formatRC(medium.lastRC()).toAscii().constData()); 336 if (!medium.isOk()) 337 { 338 QMetaObject::invokeMethod(this, "sigOperationProgressError", Qt::BlockingQueuedConnection, 339 Q_ARG(QString, UIMessageCenter::formatErrorInfo(medium))); 340 continue; 341 } 345 342 UIProgress uiprogress(cprogress); 346 343 connect(&uiprogress, SIGNAL(sigProgressChange(ulong, QString, ulong, ulong)), 347 344 this, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong)), 348 345 Qt::QueuedConnection); 346 connect(&uiprogress, SIGNAL(sigProgressError(QString)), 347 this, SIGNAL(sigOperationProgressError(QString)), 348 Qt::BlockingQueuedConnection); 349 349 uiprogress.run(350); 350 // if (!progress.isOk())351 // printf(" Progress API Error, rc = %s\n", msgCenter().formatRC(progress.lastRC()).toAscii().constData());352 // if (progress.GetResultCode() != 0)353 // printf(" Progress Processing Error, rc = %s\n", msgCenter().formatRC(progress.GetResultCode()).toAscii().constData());354 350 } 355 351 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp
r55277 r55305 30 30 /* GUI includes: */ 31 31 # include "UIProgressDialog.h" 32 # include "UIMessageCenter.h" 33 # include "UISpecialControls.h" 34 # include "UIModalWindowManager.h" 32 35 # include "QIDialogButtonBox.h" 33 36 # include "QILabel.h" 34 # include "UISpecialControls.h"35 37 # include "VBoxGlobal.h" 36 # include "UIModalWindowManager.h"37 38 # ifdef Q_WS_MAC 38 39 # include "VBoxUtils-darwin.h" … … 378 379 if (!m_progress.isOk() || m_progress.GetCompleted()) 379 380 { 381 /* Notify listeners about the operation progress error: */ 382 if (!m_progress.isOk() || m_progress.GetResultCode() != 0) 383 emit sigProgressError(UIMessageCenter::formatErrorInfo(m_progress)); 384 380 385 /* Exit from the event-loop if there is any: */ 381 386 if (m_pEventLoop) -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.h
r55277 r55305 115 115 ulong iOperation, ulong iPercent); 116 116 117 /** Notifies listeners about particular COM error. 118 * @param strErrorInfo holds the details of the error happened. */ 119 void sigProgressError(QString strErrorInfo); 120 117 121 public: 118 122
Note:
See TracChangeset
for help on using the changeset viewer.