- Timestamp:
- Apr 17, 2013 12:53:04 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
r45523 r45586 141 141 const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3) const 142 142 { 143 /* Choose at least one button by 'default': */ 144 if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0) 145 iButton1 = AlertButton_Ok | AlertButtonOption_Default | AlertButtonOption_Escape; 146 147 /* Create popup-box window: */ 148 QWidget *pPopupBoxParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown()); 149 UIPopupPane *pPopupBox = new UIPopupPane(pPopupBoxParent, strId, 150 strMessage, strDetails, 151 iButton1, iButton2, iButton3, 152 strButtonText1, strButtonText2, strButtonText3); 153 m_popups.insert(strId, pPopupBox); 154 connect(pPopupBox, SIGNAL(sigDone(int)), this, SLOT(sltPopupDone(int))); 155 pPopupBox->show(); 143 /* Prepare popup-pane: */ 144 UIPopupPane *pPopupPane = 0; 145 /* Is there already popup-pane with the same ID? */ 146 if (m_popups.contains(strId)) 147 { 148 /* Get existing one: */ 149 pPopupPane = m_popups[strId]; 150 /* And update message and details: */ 151 pPopupPane->setMessage(strMessage); 152 pPopupPane->setDetails(strDetails); 153 } 154 /* There is no popup-pane with the same ID? */ 155 else 156 { 157 /* Choose at least one button to be the 'default' and 'escape': */ 158 if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0) 159 iButton1 = AlertButton_Ok | AlertButtonOption_Default | AlertButtonOption_Escape; 160 /* Create popup-pane and insert it into our map: */ 161 QWidget *pPopupBoxParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown()); 162 pPopupPane = new UIPopupPane(pPopupBoxParent, strId, 163 strMessage, strDetails, 164 iButton1, iButton2, iButton3, 165 strButtonText1, strButtonText2, strButtonText3); 166 m_popups.insert(strId, pPopupPane); 167 /* Attach popup-pane connections: */ 168 connect(pPopupPane, SIGNAL(sigDone(int)), this, SLOT(sltPopupDone(int))); 169 } 170 /* Show popup-pane: */ 171 pPopupPane->show(); 156 172 } 157 173 … … 182 198 if (fSupportsAbsolute) 183 199 { 184 alert(0, QString("remindAboutMouseIntegration On"),200 alert(0, QString("remindAboutMouseIntegration"), 185 201 tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. " 186 202 "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- " … … 195 211 else 196 212 { 197 alert(0, QString("remindAboutMouseIntegration Off"),213 alert(0, QString("remindAboutMouseIntegration"), 198 214 tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> " 199 215 "in the current video mode. You need to capture the mouse (by clicking over the VM display " -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp
r45523 r45586 50 50 /* State-machine 'forward' animation: */ 51 51 QPropertyAnimation *pForwardAnimation = new QPropertyAnimation(pParent, strPropertyName, pParent); 52 pForwardAnimation->setEasingCurve(QEasingCurve(QEasingCurve::InOutCubic)); 52 53 pForwardAnimation->setDuration(iAnimationDuration); 53 54 pForwardAnimation->setStartValue(iStartValue); … … 55 56 /* State-machine 'backward' animation: */ 56 57 QPropertyAnimation *pBackwardAnimation = new QPropertyAnimation(pParent, strPropertyName, pParent); 58 pBackwardAnimation->setEasingCurve(QEasingCurve(QEasingCurve::InOutCubic)); 57 59 pBackwardAnimation->setDuration(iAnimationDuration); 58 60 pBackwardAnimation->setStartValue(iFinalValue); … … 189 191 /* Cleanup: */ 190 192 cleanup(); 193 } 194 195 void UIPopupPane::setMessage(const QString &strMessage) 196 { 197 /* Make sure somthing changed: */ 198 if (m_strMessage == strMessage) 199 return; 200 201 /* Fetch new message: */ 202 m_strMessage = strMessage; 203 m_pTextPane->setText(m_strMessage); 204 } 205 206 void UIPopupPane::setDetails(const QString &strDetails) 207 { 208 /* Make sure somthing changed: */ 209 if (m_strDetails == strDetails) 210 return; 211 212 /* Fetch new details: */ 213 m_strDetails = strDetails; 191 214 } 192 215 … … 579 602 /* Configure painter clipping: */ 580 603 QPainterPath path; 581 int iDiameter = 5;604 int iDiameter = 6; 582 605 QSizeF arcSize(2 * iDiameter, 2 * iDiameter); 583 606 path.moveTo(iDiameter, 0); … … 594 617 /* Fill with background: */ 595 618 QColor currentColor(palette().color(QPalette::Window)); 596 QColor newColor(currentColor.red(), currentColor.green(), currentColor.blue(), opacity()); 597 painter.fillRect(rect, newColor); 619 QColor newColor1(currentColor.red(), currentColor.green(), currentColor.blue(), opacity()); 620 QColor newColor2 = newColor1.darker(115); 621 QLinearGradient headerGradient(rect.topLeft(), rect.topRight()); 622 headerGradient.setColorAt(0, newColor1); 623 headerGradient.setColorAt(1, newColor2); 624 painter.fillRect(rect, headerGradient); 598 625 } 599 626 … … 678 705 pMainLayout->addWidget(m_pLabel); 679 706 /* Prepare label: */ 707 QFont currentFont = m_pLabel->font(); 708 currentFont.setPointSize(currentFont.pointSize() - 2); 709 m_pLabel->setFont(currentFont); 680 710 m_pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 681 711 m_pLabel->setWordWrap(true); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.h
r45523 r45586 68 68 /* API: Id stuff: */ 69 69 const QString& id() const { return m_strId; } 70 71 /* API: Text stuff: */ 72 void setMessage(const QString &strMessage); 73 void setDetails(const QString &strDetails); 70 74 71 75 private slots:
Note:
See TracChangeset
for help on using the changeset viewer.