Changeset 45696 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
- Timestamp:
- Apr 24, 2013 1:09:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
r45691 r45696 40 40 } 41 41 42 void UIPopupStack::updatePopupPane(const QString &strPopupPaneID, 42 bool UIPopupStack::exists(const QString &strPopupPaneID) const 43 { 44 /* Is there already popup-pane with the same ID? */ 45 return m_panes.contains(strPopupPaneID); 46 } 47 48 void UIPopupStack::createPopupPane(const QString &strPopupPaneID, 43 49 const QString &strMessage, const QString &strDetails, 44 50 const QMap<int, QString> &buttonDescriptions, 45 51 bool fProposeAutoConfirmation) 46 52 { 47 /* Looking for the corresponding popup-pane: */ 48 UIPopupPane *pPopupPane = 0; 49 /* Is there already popup-pane with the same ID? */ 53 /* Make sure there is no such popup-pane already: */ 50 54 if (m_panes.contains(strPopupPaneID)) 51 55 { 52 /* Get existing one: */ 53 pPopupPane = m_panes[strPopupPaneID]; 54 /* Update message and details: */ 55 pPopupPane->setMessage(strMessage); 56 pPopupPane->setDetails(strDetails); 57 } 58 /* There is no popup-pane with the same ID? */ 59 else 60 { 61 /* Create new one: */ 62 pPopupPane = m_panes[strPopupPaneID] = new UIPopupPane(this, 63 strMessage, strDetails, 64 buttonDescriptions, 65 fProposeAutoConfirmation); 66 /* Attach popup-pane connection: */ 67 connect(pPopupPane, SIGNAL(sigSizeHintChanged()), this, SLOT(sltAdjustGeometry())); 68 connect(pPopupPane, SIGNAL(sigDone(int)), this, SLOT(sltPopupPaneDone(int))); 69 /* Show popup-pane: */ 70 pPopupPane->show(); 71 } 56 AssertMsgFailed(("Popup-pane already exists!")); 57 return; 58 } 59 60 /* Create new popup-pane: */ 61 UIPopupPane *pPopupPane = m_panes[strPopupPaneID] = new UIPopupPane(this, 62 strMessage, strDetails, 63 buttonDescriptions, 64 fProposeAutoConfirmation); 65 /* Attach popup-pane connection: */ 66 connect(pPopupPane, SIGNAL(sigSizeHintChanged()), this, SLOT(sltAdjustGeometry())); 67 connect(pPopupPane, SIGNAL(sigDone(int)), this, SLOT(sltPopupPaneDone(int))); 68 /* Show popup-pane: */ 69 pPopupPane->show(); 70 71 /* Propagate desired width: */ 72 setDesiredWidth(parentWidget()->width()); 73 /* Adjust geometry: */ 74 sltAdjustGeometry(); 75 } 76 77 void UIPopupStack::updatePopupPane(const QString &strPopupPaneID, 78 const QString &strMessage, const QString &strDetails) 79 { 80 /* Make sure there is such popup-pane already: */ 81 if (!m_panes.contains(strPopupPaneID)) 82 { 83 AssertMsgFailed(("Popup-pane doesn't exists!")); 84 return; 85 } 86 87 /* Get existing popup-pane: */ 88 UIPopupPane *pPopupPane = m_panes[strPopupPaneID]; 89 /* Update message and details: */ 90 pPopupPane->setMessage(strMessage); 91 pPopupPane->setDetails(strDetails); 72 92 73 93 /* Propagate desired width: */
Note:
See TracChangeset
for help on using the changeset viewer.