Changeset 58395 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 23, 2015 3:19:21 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/net
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp
r57474 r58395 165 165 m_pRetryButton->setHidden(false); 166 166 167 /* Show error label: */ 168 m_pErrorPane->setHidden(false); 169 m_pErrorPane->setText(composeErrorText(strError)); 170 } 171 172 void UINetworkRequestWidget::sltTimeIsOut() 173 { 174 /* Stop timer: */ 175 m_pTimer->stop(); 176 177 /* Set current progress to unknown: */ 178 m_pProgressBar->setRange(0, 0); 179 } 180 181 void UINetworkRequestWidget::retranslateUi() 182 { 183 /* Get corresponding title: */ 184 const QString &strTitle = m_pNetworkRequest->description(); 185 186 /* Set popup title (default if missed): */ 187 setTitle(strTitle.isEmpty() ? UINetworkManagerDialog::tr("Network Operation") : strTitle); 188 189 /* Translate retry button: */ 190 m_pRetryButton->setStatusTip(UINetworkManagerDialog::tr("Restart network operation")); 191 192 /* Translate cancel button: */ 193 m_pCancelButton->setStatusTip(UINetworkManagerDialog::tr("Cancel network operation")); 194 195 /* Translate error label: */ 196 if (m_pNetworkRequest->reply()) 197 m_pErrorPane->setText(composeErrorText(m_pNetworkRequest->reply()->errorString())); 198 } 199 200 /* static */ 201 const QString UINetworkRequestWidget::composeErrorText(QString strErrorText) 202 { 203 /* Null-string for null-string: */ 204 if (strErrorText.isEmpty()) 205 return QString(); 206 167 207 /* Try to find all the links in the error-message, 168 208 * replace them with %increment if present: */ 169 QString strErrorText(strError);170 209 QRegExp linkRegExp("[\\S]+[\\./][\\S]+"); 171 210 QStringList links; … … 184 223 strErrorText.prepend("<br>"); 185 224 186 /* Show error label: */ 187 m_pErrorPane->setHidden(false); 188 m_pErrorPane->setText(UINetworkManagerDialog::tr("The network operation failed with the following error: %1.").arg(strErrorText)); 189 } 190 191 void UINetworkRequestWidget::sltTimeIsOut() 192 { 193 /* Stop timer: */ 194 m_pTimer->stop(); 195 196 /* Set current progress to unknown: */ 197 m_pProgressBar->setRange(0, 0); 198 } 199 200 void UINetworkRequestWidget::retranslateUi() 201 { 202 /* Get corresponding title: */ 203 const QString &strTitle = m_pNetworkRequest->description(); 204 205 /* Set popup title (default if missed): */ 206 setTitle(strTitle.isEmpty() ? UINetworkManagerDialog::tr("Network Operation") : strTitle); 207 208 /* Translate retry button: */ 209 m_pRetryButton->setStatusTip(UINetworkManagerDialog::tr("Restart network operation")); 210 211 /* Translate cancel button: */ 212 m_pCancelButton->setStatusTip(UINetworkManagerDialog::tr("Cancel network operation")); 213 } 225 /* Return final result: */ 226 return UINetworkManagerDialog::tr("The network operation failed with the following error: %1.").arg(strErrorText); 227 } 228 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.h
r55401 r58395 72 72 void retranslateUi(); 73 73 74 /** Composes error text on the basis of the passed @a strErrorText. */ 75 static const QString composeErrorText(QString strErrorText); 76 74 77 /* Widgets: */ 75 78 QWidget *m_pContentWidget;
Note:
See TracChangeset
for help on using the changeset viewer.