- Timestamp:
- Sep 1, 2021 6:43:24 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.cpp
r90688 r91075 52 52 const QString &strDetails, 53 53 const QString &strInternalName, 54 const QString &strHelpKeyword, 54 55 bool fCritical /* = true */) 55 56 : m_strName(strName) 56 57 , m_strDetails(strDetails) 57 58 , m_strInternalName(strInternalName) 59 , m_strHelpKeyword(strHelpKeyword) 58 60 , m_fCritical(fCritical) 59 61 { … … 78 80 { 79 81 return m_strInternalName; 82 } 83 84 QString UINotificationSimple::helpKeyword() const 85 { 86 return m_strHelpKeyword; 80 87 } 81 88 … … 135 142 136 143 QString UINotificationProgress::internalName() const 144 { 145 return QString(); 146 } 147 148 QString UINotificationProgress::helpKeyword() const 137 149 { 138 150 return QString(); … … 213 225 214 226 QString UINotificationDownloader::internalName() const 227 { 228 return QString(); 229 } 230 231 QString UINotificationDownloader::helpKeyword() const 215 232 { 216 233 return QString(); … … 317 334 } 318 335 336 QString UINotificationNewVersionChecker::helpKeyword() const 337 { 338 return QString(); 339 } 340 319 341 void UINotificationNewVersionChecker::handle() 320 342 { -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.h
r90688 r91075 62 62 /** Returns object internal name. */ 63 63 virtual QString internalName() const = 0; 64 /** Returns object help heyword. */ 65 virtual QString helpKeyword() const = 0; 64 66 /** Handles notification-object being added. */ 65 67 virtual void handle() = 0; … … 84 86 * @param strDetails Brings the message details. 85 87 * @param strInternalName Brings the message internal name. 88 * @param strHelpKeyword Brings the message help keyword. 86 89 * @param fCritical Brings whether message is critical. */ 87 90 UINotificationSimple(const QString &strName, 88 91 const QString &strDetails, 89 92 const QString &strInternalName, 93 const QString &strHelpKeyword, 90 94 bool fCritical = true); 91 95 … … 98 102 /** Returns object internal name. */ 99 103 virtual QString internalName() const /* override final */; 104 /** Returns object help heyword. */ 105 virtual QString helpKeyword() const /* override final */; 100 106 /** Handles notification-object being added. */ 101 107 virtual void handle() /* override final */; … … 112 118 /** Holds the message internal name. */ 113 119 QString m_strInternalName; 120 /** Holds the message help keyword. */ 121 QString m_strHelpKeyword; 114 122 /** Holds whether message is critical. */ 115 123 bool m_fCritical; … … 152 160 /** Returns object internal name. */ 153 161 virtual QString internalName() const /* override final */; 162 /** Returns object help heyword. */ 163 virtual QString helpKeyword() const /* override final */; 154 164 /** Handles notification-object being added. */ 155 165 virtual void handle() /* override final */; … … 216 226 /** Returns object internal name. */ 217 227 virtual QString internalName() const /* override final */; 228 /** Returns object help heyword. */ 229 virtual QString helpKeyword() const /* override final */; 218 230 /** Handles notification-object being added. */ 219 231 virtual void handle() /* override final */; … … 281 293 /** Returns object internal name. */ 282 294 virtual QString internalName() const /* override final */; 295 /** Returns object help heyword. */ 296 virtual QString helpKeyword() const /* override final */; 283 297 /** Handles notification-object being added. */ 284 298 virtual void handle() /* override final */; -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.cpp
r90688 r91075 30 30 #include "QIToolButton.h" 31 31 #include "UIIconPool.h" 32 #include "UIMessageCenter.h" 32 33 #include "UINotificationObject.h" 33 34 #include "UINotificationObjectItem.h" … … 44 45 , m_pLayoutUpper(0) 45 46 , m_pLabelName(0) 47 , m_pButtonHelp(0) 46 48 , m_pButtonForget(0) 47 49 , m_pButtonClose(0) … … 67 69 m_pLabelName->setText(m_pObject->name()); 68 70 m_pLayoutUpper->addWidget(m_pLabelName); 71 } 72 73 /* Prepare help button: */ 74 if (!m_pObject->helpKeyword().isEmpty()) 75 m_pButtonHelp = new QIToolButton(this); 76 if (m_pButtonHelp) 77 { 78 m_pButtonHelp->setIcon(UIIconPool::iconSet(":/help_16px.png")); 79 m_pButtonHelp->setIconSize(QSize(10, 10)); 80 m_pButtonHelp->setProperty("helpkeyword", m_pObject->helpKeyword()); 81 connect(m_pButtonHelp, &QIToolButton::clicked, 82 &msgCenter(), &UIMessageCenter::sltHandleHelpRequest); 83 84 m_pLayoutUpper->addWidget(m_pButtonHelp); 69 85 } 70 86 … … 107 123 m_pLabelDetails->setVisible(false); 108 124 int iHint = m_pLabelName->minimumSizeHint().width(); 125 if (m_pButtonHelp) 126 iHint += m_pLayoutUpper->spacing() + m_pButtonHelp->minimumSizeHint().width(); 109 127 if (m_pButtonForget) 110 128 iHint += m_pLayoutUpper->spacing() + m_pButtonForget->minimumSizeHint().width(); -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.h
r90688 r91075 67 67 /** Holds the name label instance. */ 68 68 QLabel *m_pLabelName; 69 /** Holds the help button instance. */ 70 QIToolButton *m_pButtonHelp; 69 71 /** Holds the forget button instance. */ 70 72 QIToolButton *m_pButtonForget; -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r91029 r91075 382 382 UINotificationMessage::UINotificationMessage(const QString &strName, 383 383 const QString &strDetails, 384 const QString &strInternalName) 384 const QString &strInternalName, 385 const QString &strHelpKeyword) 385 386 : UINotificationSimple(strName, 386 387 strDetails, 387 strInternalName) 388 strInternalName, 389 strHelpKeyword) 388 390 { 389 391 } … … 398 400 void UINotificationMessage::createMessage(const QString &strName, 399 401 const QString &strDetails, 400 const QString &strInternalName /* = QString() */) 402 const QString &strInternalName /* = QString() */, 403 const QString &strHelpKeyword /* = QString() */) 401 404 { 402 405 /* Check if message suppressed: */ … … 410 413 m_messages[strInternalName] = gpNotificationCenter->append(new UINotificationMessage(strName, 411 414 strDetails, 412 strInternalName)); 415 strInternalName, 416 strHelpKeyword)); 413 417 } 414 418 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r91029 r91075 168 168 * @param strName Brings the message name. 169 169 * @param strDetails Brings the message details. 170 * @param strInternalName Brings the message internal name. */ 170 * @param strInternalName Brings the message internal name. 171 * @param strHelpKeyword Brings the message help keyword. */ 171 172 UINotificationMessage(const QString &strName, 172 173 const QString &strDetails, 173 const QString &strInternalName); 174 const QString &strInternalName, 175 const QString &strHelpKeyword); 174 176 /** Destructs message notification-object. */ 175 177 virtual ~UINotificationMessage() /* override final */; … … 180 182 * @param strName Brings the message name. 181 183 * @param strDetails Brings the message details. 182 * @param strInternalName Brings the message internal name. */ 184 * @param strInternalName Brings the message internal name. 185 * @param strHelpKeyword Brings the message help keyword. */ 183 186 static void createMessage(const QString &strName, 184 187 const QString &strDetails, 185 const QString &strInternalName = QString()); 188 const QString &strInternalName = QString(), 189 const QString &strHelpKeyword = QString()); 186 190 /** Destroys message. 187 191 * @param strInternalName Brings the message internal name. */
Note:
See TracChangeset
for help on using the changeset viewer.