Changeset 47763 in vbox
- Timestamp:
- Aug 15, 2013 1:18:56 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 88021
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r47616 r47763 30 30 #include "VBoxGlobal.h" 31 31 #include "UIMessageCenter.h" 32 #include "UIPopupCenter.h" 32 33 #include "QIWidgetValidator.h" 33 34 #include "VBoxSettingsSelector.h" … … 107 108 /* Creating stack of pages: */ 108 109 m_pStack = new QStackedWidget(m_pWtStackHandler); 110 popupCenter().setPopupStackOrientation(m_pStack, UIPopupStackOrientation_Bottom); 109 111 QVBoxLayout *pStackLayout = new QVBoxLayout(m_pWtStackHandler); 110 112 pStackLayout->setContentsMargins(0, 0, 0, 0); … … 120 122 /* Setup error & warning stuff: */ 121 123 m_pStatusBar->addWidget(m_pWarningPane); 124 connect(m_pWarningPane, SIGNAL(sigHoverEnter()), this, SLOT(sltHandleWarningPaneHovered())); 125 connect(m_pWarningPane, SIGNAL(sigHoverLeave()), this, SLOT(sltHandleWarningPaneUnhovered())); 122 126 123 127 /* Setup whatsthis stuff: */ … … 146 150 UISettingsDialog::~UISettingsDialog() 147 151 { 152 /* Recall popup-pane if any: */ 153 popupCenter().recall(m_pStack, "SettingsDialogWarning"); 148 154 /* Delete selector early! */ 149 155 delete m_pSelector; … … 276 282 m_strErrorString = strError.isEmpty() ? QString() : 277 283 QString("<font color=red>%1</font>").arg(strError); 278 279 /* Do not touching QILabel until dialog is polished280 * otherwise it can change its size to undefined: */281 if (m_fPolished)282 {283 if (!m_strErrorString.isEmpty() && m_pStatusBar->currentWidget() == m_pWarningPane)284 m_pLbWhatsThis->setText(m_strErrorString);285 else286 sltUpdateWhatsThis(true /* got focus? */);287 }288 284 } 289 285 … … 292 288 m_strWarningString = strWarning.isEmpty() ? QString() : 293 289 QString("<font color=#ff5400>%1</font>").arg(strWarning); 294 295 /* Do not touching QILabel until dialog is polished296 * otherwise it can change its size to undefined: */297 if (m_fPolished)298 {299 if (!m_strWarningString.isEmpty() && m_pStatusBar->currentWidget() == m_pWarningPane)300 m_pLbWhatsThis->setText(m_strWarningString);301 else302 sltUpdateWhatsThis(true /* got focus? */);303 }304 290 } 305 291 … … 377 363 setError(pValidator->lastMessage()); 378 364 m_pWarningPane->setWarningText(m_strErrorHint); 379 #ifdef Q_WS_MAC380 m_pWarningPane->setToolTip(m_strErrorString);381 #endif /* Q_WS_MAC */382 365 } 383 366 /* Show warning if message is not an error: */ … … 387 370 setWarning(pValidator->lastMessage()); 388 371 m_pWarningPane->setWarningText(m_strWarningHint); 389 #ifdef Q_WS_MAC390 m_pWarningPane->setToolTip(m_strWarningString);391 #endif /* Q_WS_MAC */392 372 } 393 373 394 /* Configure warning pixmap: */374 /* Configure warning-pane pixmap: */ 395 375 m_pWarningPane->setWarningPixmap(pFailedSettingsPage->warningPixmap()); 396 376 … … 434 414 } 435 415 416 void UISettingsDialog::sltHandleWarningPaneHovered() 417 { 418 LogRel(("Settings Dialog: Warning-pane hovered.\n")); 419 420 /* Show corresponding popup: */ 421 if (!m_fValid || !m_fSilent) 422 { 423 popupCenter().popup(m_pStack, "SettingsDialogWarning", 424 !m_fValid ? m_strErrorString : 425 !m_fSilent ? m_strWarningString : 426 QString()); 427 } 428 } 429 430 void UISettingsDialog::sltHandleWarningPaneUnhovered() 431 { 432 LogRel(("Settings Dialog: Warning-pane unhovered.\n")); 433 434 /* Recall corresponding popup: */ 435 popupCenter().recall(m_pStack, "SettingsDialogWarning"); 436 } 437 436 438 void UISettingsDialog::sltUpdateWhatsThis(bool fGotFocus /* = false */) 437 439 { … … 463 465 464 466 #ifndef Q_WS_MAC 465 if (m_pStatusBar->currentWidget() == m_pWarningPane)466 {467 if (strWhatsThisText.isEmpty() && !m_strErrorString.isEmpty())468 strWhatsThisText = m_strErrorString;469 else if (strWhatsThisText.isEmpty() && !m_strWarningString.isEmpty())470 strWhatsThisText = m_strWarningString;471 }472 467 if (strWhatsThisText.isEmpty()) 473 468 strWhatsThisText = whatsThis(); 474 469 m_pLbWhatsThis->setText(strWhatsThisText); 475 #else 470 #else /* !Q_WS_MAC */ 476 471 if (pWhatsThisWidget && !strWhatsThisText.isEmpty()) 477 472 pWhatsThisWidget->setToolTip(QString("<qt>%1</qt>").arg(strWhatsThisText)); 478 #endif 473 #endif /* Q_WS_MAC */ 479 474 } 480 475 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r47616 r47763 104 104 private slots: 105 105 106 /* Handler : Validation stuff: */106 /* Handlers: Validation stuff: */ 107 107 void sltHandleValidityChange(UIPageValidator *pValidator); 108 void sltHandleWarningPaneHovered(); 109 void sltHandleWarningPaneUnhovered(); 108 110 109 111 /* Slot to update whats-this: */
Note:
See TracChangeset
for help on using the changeset viewer.