Changeset 91236 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 14, 2021 5:05:22 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 146894
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r91227 r91236 2345 2345 } 2346 2346 2347 void UIExtraDataManager::setKeepSuccessfullNotificationProgresses(bool fKeep) 2348 { 2349 /* 'True' if feature allowed, null-string otherwise: */ 2350 setExtraDataString(GUI_KeepSuccessfullNotificationProgresses, toFeatureAllowed(fKeep)); 2351 } 2352 2347 2353 #if !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG) 2348 2354 QString UIExtraDataManager::preventBetaBuildWarningForVersion() -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r91227 r91236 186 186 /** Returns whether successfull notification-progresses should NOT close automatically. */ 187 187 bool keepSuccessfullNotificationProgresses(); 188 /** Defines whether successfull notification-progresses should NOT close (@a fKeep) automatically. */ 189 void setKeepSuccessfullNotificationProgresses(bool fKeep); 188 190 189 191 #if !defined(VBOX_BLEEDING_EDGE) && !defined(DEBUG) -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.cpp
r91231 r91236 32 32 /* GUI includes: */ 33 33 #include "QIToolButton.h" 34 #include "UIExtraDataManager.h" 34 35 #include "UIIconPool.h" 35 36 #include "UINotificationCenter.h" … … 154 155 155 156 /* Reparent: */ 156 Q Widget::setParent(pParent);157 QIWithRetranslateUI<QWidget>::setParent(pParent); 157 158 158 159 /* Install filter to new parent: */ … … 198 199 199 200 UINotificationCenter::UINotificationCenter(QWidget *pParent) 200 : Q Widget(pParent)201 : QIWithRetranslateUI<QWidget>(pParent) 201 202 , m_pModel(0) 202 203 , m_pLayoutMain(0) 203 , m_pLayout OpenButton(0)204 , m_pLayoutButtons(0) 204 205 , m_pOpenButton(0) 206 , m_pKeepButton(0) 205 207 , m_pLayoutItems(0) 206 208 , m_pStateMachineSliding(0) … … 215 217 { 216 218 s_pInstance = 0; 219 } 220 221 void UINotificationCenter::retranslateUi() 222 { 223 if (m_pOpenButton) 224 m_pOpenButton->setToolTip(tr("Open notification center")); 225 if (m_pKeepButton) 226 m_pKeepButton->setToolTip(tr("Keep finished progresses")); 217 227 } 218 228 … … 238 248 239 249 /* Call to base-class: */ 240 return Q Widget::eventFilter(pObject, pEvent);250 return QIWithRetranslateUI<QWidget>::eventFilter(pObject, pEvent); 241 251 } 242 252 … … 266 276 267 277 /* Call to base-class: */ 268 return Q Widget::event(pEvent);278 return QIWithRetranslateUI<QWidget>::event(pEvent); 269 279 } 270 280 … … 291 301 else 292 302 emit sigClose(); 303 } 304 305 void UINotificationCenter::sltHandleKeepButtonToggled(bool fToggled) 306 { 307 gEDataManager->setKeepSuccessfullNotificationProgresses(fToggled); 293 308 } 294 309 … … 352 367 prepareStateMachineSliding(); 353 368 prepareOpenTimer(); 369 370 /* Apply language settings: */ 371 retranslateUi(); 354 372 } 355 373 … … 368 386 if (m_pLayoutMain) 369 387 { 370 /* Prepare open-buttonlayout: */371 m_pLayout OpenButton= new QHBoxLayout;372 if (m_pLayout OpenButton)373 { 374 m_pLayout OpenButton->setContentsMargins(0, 0, 0, 0);388 /* Prepare buttons layout: */ 389 m_pLayoutButtons = new QHBoxLayout; 390 if (m_pLayoutButtons) 391 { 392 m_pLayoutButtons->setContentsMargins(0, 0, 0, 0); 375 393 376 394 /* Prepare open-button: */ … … 381 399 m_pOpenButton->setCheckable(true); 382 400 connect(m_pOpenButton, &QIToolButton::toggled, this, &UINotificationCenter::sltHandleOpenButtonToggled); 383 m_pLayout OpenButton->addWidget(m_pOpenButton);401 m_pLayoutButtons->addWidget(m_pOpenButton); 384 402 } 385 403 386 m_pLayoutOpenButton->addStretch(); 404 /* Prepare keep-button: */ 405 m_pKeepButton = new QIToolButton(this); 406 if (m_pKeepButton) 407 { 408 m_pKeepButton->setIcon(UIIconPool::iconSet(":/pin_16px.png")); 409 m_pKeepButton->setCheckable(true); 410 m_pKeepButton->setChecked(gEDataManager->keepSuccessfullNotificationProgresses()); 411 connect(m_pKeepButton, &QIToolButton::toggled, this, &UINotificationCenter::sltHandleKeepButtonToggled); 412 m_pLayoutButtons->addWidget(m_pKeepButton); 413 } 414 415 m_pLayoutButtons->addStretch(); 387 416 388 417 /* Add to layout: */ 389 m_pLayoutMain->addLayout(m_pLayout OpenButton);418 m_pLayoutMain->addLayout(m_pLayoutButtons); 390 419 } 391 420 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h
r91225 r91236 27 27 28 28 /* GUI includes: */ 29 #include "QIWithRetranslateUI.h" 29 30 #include "UILibraryDefs.h" 30 31 #include "UINotificationObjects.h" … … 41 42 42 43 /** QWidget-based notification-center overlay. */ 43 class SHARED_LIBRARY_STUFF UINotificationCenter : public Q Widget44 class SHARED_LIBRARY_STUFF UINotificationCenter : public QIWithRetranslateUI<QWidget> 44 45 { 45 46 Q_OBJECT; … … 80 81 virtual ~UINotificationCenter() /* override final */; 81 82 83 /** Handles translation event. */ 84 virtual void retranslateUi() /* override final */; 85 82 86 /** Preprocesses any Qt @a pEvent for passed @a pObject. */ 83 87 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override final */; … … 93 97 /** Issues request to make open button @a fToggled. */ 94 98 void sltHandleOpenButtonToggled(bool fToggled); 99 /** Toggles notification-progresses keep approach. */ 100 void sltHandleKeepButtonToggled(bool fToggled); 101 95 102 /** Handles open-timer timeout. */ 96 103 void sltHandleOpenTimerTimeout(); … … 135 142 /** Holds the main layout instance. */ 136 143 QVBoxLayout *m_pLayoutMain; 137 /** Holds the open buttonlayout instance. */138 QHBoxLayout *m_pLayout OpenButton;144 /** Holds the buttons layout instance. */ 145 QHBoxLayout *m_pLayoutButtons; 139 146 /** Holds the open button instance. */ 140 147 QIToolButton *m_pOpenButton; 148 /** Holds the keep button instance. */ 149 QIToolButton *m_pKeepButton; 141 150 /** Holds the items layout instance. */ 142 151 QVBoxLayout *m_pLayoutItems;
Note:
See TracChangeset
for help on using the changeset viewer.