- Timestamp:
- Sep 4, 2015 12:54:17 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp
r52730 r57627 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 257 257 /* Add button-box into main-layout: */ 258 258 pMainLayout->addWidget(m_pButtonBox); 259 260 /* Prepares focus. It is important to prepare focus after adding buttonbox to the layout as, 261 * parenting the buttonbox to the QDialog changes default button focus by Qt: */ 262 prepareFocus(); 259 263 } 264 } 265 } 266 267 void QIMessageBox::prepareFocus() 268 { 269 /* Configure default button and focus: */ 270 if (m_pButton1 && (m_iButton1 & AlertButtonOption_Default)) 271 { 272 m_pButton1->setDefault(true); 273 m_pButton1->setFocus(); 274 } 275 if (m_pButton2 && (m_iButton2 & AlertButtonOption_Default)) 276 { 277 m_pButton2->setDefault(true); 278 m_pButton2->setFocus(); 279 } 280 if (m_pButton3 && (m_iButton3 & AlertButtonOption_Default)) 281 { 282 m_pButton3->setDefault(true); 283 m_pButton3->setFocus(); 260 284 } 261 285 } … … 285 309 QPushButton *pButton = m_pButtonBox->addButton(strText, role); 286 310 287 /* Configure <default> button: */288 if (iButton & AlertButtonOption_Default)289 {290 pButton->setDefault(true);291 pButton->setFocus();292 }293 311 /* Configure <escape> button: */ 294 312 if (iButton & AlertButtonOption_Escape) -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h
r55401 r57627 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 27 27 /* Forward declarations: */ 28 class QLabel;29 class QILabel;30 class QPushButton;31 28 class QCheckBox; 32 29 class QIArrowSplitter; 33 30 class QIDialogButtonBox; 31 class QILabel; 32 class QLabel; 33 class QPushButton; 34 34 35 35 /** Button types. */ … … 123 123 private: 124 124 125 /** Prepare routine. */125 /** Prepares message-box. */ 126 126 void prepare(); 127 128 /** Prepares focus. */ 129 void prepareFocus(); 127 130 128 131 /** Push-button factory. */ … … 183 186 184 187 #endif /* !___QIMessageBox_h___ */ 188
Note:
See TracChangeset
for help on using the changeset viewer.