Changeset 43855 in vbox
- Timestamp:
- Nov 12, 2012 11:58:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp
r43104 r43855 50 50 , m_progress(progress) 51 51 , m_pImageLbl(0) 52 , m_pCancelBtn(0)53 52 , m_fCancelEnabled(false) 54 53 , m_cOperations(m_progress.GetOperationCount()) … … 109 108 m_progressBar->setValue(0); 110 109 m_fCancelEnabled = m_progress.GetCancelable(); 111 if (m_fCancelEnabled) 112 { 113 m_pCancelBtn = new UIMiniCancelButton(this); 114 m_pCancelBtn->setFocusPolicy(Qt::ClickFocus); 115 pLayout2->addWidget(m_pCancelBtn, 0, Qt::AlignVCenter); 116 connect(m_pCancelBtn, SIGNAL(clicked()), this, SLOT(cancelOperation())); 117 } 110 m_pCancelBtn = new UIMiniCancelButton(this); 111 m_pCancelBtn->setEnabled(m_fCancelEnabled); 112 m_pCancelBtn->setFocusPolicy(Qt::ClickFocus); 113 pLayout2->addWidget(m_pCancelBtn, 0, Qt::AlignVCenter); 114 connect(m_pCancelBtn, SIGNAL(clicked()), this, SLOT(cancelOperation())); 118 115 119 116 m_pEtaLbl = new QILabel(this); … … 143 140 { 144 141 m_strCancel = tr("Canceling..."); 145 if (m_pCancelBtn) 146 { 147 m_pCancelBtn->setText(tr("&Cancel")); 148 m_pCancelBtn->setToolTip(tr("Cancel the current operation")); 149 } 142 m_pCancelBtn->setText(tr("&Cancel")); 143 m_pCancelBtn->setToolTip(tr("Cancel the current operation")); 150 144 } 151 145 … … 287 281 } 288 282 m_progressBar->setValue(m_progress.GetPercent()); 283 284 /* Then cancel button: */ 285 m_fCancelEnabled = m_progress.GetCancelable(); 286 m_pCancelBtn->setEnabled(m_fCancelEnabled); 289 287 } 290 288 else … … 313 311 void UIProgressDialog::cancelOperation() 314 312 { 315 if (m_pCancelBtn) 316 m_pCancelBtn->setEnabled(false); 313 m_pCancelBtn->setEnabled(false); 317 314 m_progress.Cancel(); 318 315 }
Note:
See TracChangeset
for help on using the changeset viewer.