Changeset 82713 in vbox
- Timestamp:
- Jan 10, 2020 12:39:04 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
-
globals/UIActionPool.h (modified) (1 diff)
-
manager/tools/UIToolsItem.cpp (modified) (1 diff)
-
manager/tools/UIToolsItem.h (modified) (1 diff)
-
manager/tools/UIToolsModel.cpp (modified) (5 diffs)
-
manager/tools/UIToolsModel.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r82187 r82713 633 633 virtual void updateShortcuts(); 634 634 635 /** Ha dles translation event. */635 /** Handles translation event. */ 636 636 virtual void retranslateUi() /* override */; 637 637 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp
r76606 r82713 237 237 updatePixmap(); 238 238 239 /* Update name finally: */ 240 reconfigure(strName); 241 } 242 243 void UIToolsItem::reconfigure(const QString &strName) 244 { 239 245 /* If name is changed: */ 240 246 if (m_strName != strName) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.h
r76581 r82713 93 93 UIToolsModel *model() const; 94 94 95 /** Reconfigures i conwith new @a enmClass, @a enmType, @a icon and @a strName. */95 /** Reconfigures item with new @a enmClass, @a enmType, @a icon and @a strName. */ 96 96 void reconfigure(UIToolClass enmClass, UIToolType enmType, 97 97 const QIcon &icon, const QString &strName); 98 /** Reconfigures item with @a strName. */ 99 void reconfigure(const QString &strName); 98 100 99 101 /** Returns item class. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r80881 r82713 55 55 56 56 UIToolsModel:: UIToolsModel(UITools *pParent) 57 : Q Object(pParent)57 : QIWithRetranslateUI3<QObject>(pParent) 58 58 , m_pTools(pParent) 59 59 , m_pScene(0) … … 392 392 /* Process only scene events: */ 393 393 if (pWatched != scene()) 394 return Q Object::eventFilter(pWatched, pEvent);394 return QIWithRetranslateUI3<QObject>::eventFilter(pWatched, pEvent); 395 395 396 396 /* Process only item focused by model: */ 397 397 if (scene()->focusItem()) 398 return Q Object::eventFilter(pWatched, pEvent);398 return QIWithRetranslateUI3<QObject>::eventFilter(pWatched, pEvent); 399 399 400 400 /* Do not handle disabled items: */ 401 401 if (!currentItem()->isEnabled()) 402 return Q Object::eventFilter(pWatched, pEvent);402 return QIWithRetranslateUI3<QObject>::eventFilter(pWatched, pEvent); 403 403 404 404 /* Checking event-type: */ … … 420 420 421 421 /* Call to base-class: */ 422 return QObject::eventFilter(pWatched, pEvent); 422 return QIWithRetranslateUI3<QObject>::eventFilter(pWatched, pEvent); 423 } 424 425 void UIToolsModel::retranslateUi() 426 { 427 foreach (UIToolsItem *pItem, m_items) 428 { 429 switch (pItem->itemType()) 430 { 431 case UIToolType_Welcome: pItem->reconfigure(tr("Welcome")); break; 432 case UIToolType_Media: pItem->reconfigure(tr("Media")); break; 433 case UIToolType_Network: pItem->reconfigure(tr("Network")); break; 434 case UIToolType_Cloud: pItem->reconfigure(tr("Cloud")); break; 435 case UIToolType_Details: pItem->reconfigure(tr("Details")); break; 436 case UIToolType_Snapshots: pItem->reconfigure(tr("Snapshots")); break; 437 case UIToolType_Logs: pItem->reconfigure(tr("Logs")); break; 438 default: break; 439 } 440 } 423 441 } 424 442 … … 438 456 /* Prepare connections: */ 439 457 prepareConnections(); 458 /* Apply language settings: */ 459 retranslateUi(); 440 460 } 441 461 … … 458 478 459 479 /* Welcome: */ 460 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Welcome, tr("Welcome"),461 UIIconPool::iconSet(":/welcome_screen_24px.png", ":/welcome_screen_24px.png")); /// @todo fix icon!480 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Welcome, QString(), 481 UIIconPool::iconSet(":/welcome_screen_24px.png", ":/welcome_screen_24px.png")); 462 482 463 483 /* Media: */ 464 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Media, tr("Media"),484 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Media, QString(), 465 485 UIIconPool::iconSet(":/media_manager_24px.png", ":/media_manager_disabled_24px.png")); 466 486 467 487 /* Network: */ 468 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Network, tr("Network"),488 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Network, QString(), 469 489 UIIconPool::iconSet(":/host_iface_manager_24px.png", ":/host_iface_manager_disabled_24px.png")); 470 490 471 491 /* Cloud: */ 472 492 if (fExtPackAccessible) 473 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Cloud, tr("Cloud"),493 m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Cloud, QString(), 474 494 UIIconPool::iconSet(":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_disabled_24px.png")); 475 495 476 496 /* Details: */ 477 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Details, tr("Details"),497 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Details, QString(), 478 498 UIIconPool::iconSet(":/machine_details_manager_24px.png", ":/machine_details_manager_disabled_24px.png")); 479 499 480 500 /* Snapshots: */ 481 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Snapshots, tr("Snapshots"),482 UIIconPool::iconSet(":/snapshot_manager_24px.png", ":/snapshot_manager_disabled_24px.png"));501 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Snapshots, QString(), 502 UIIconPool::iconSet(":/snapshot_manager_24px.png", ":/snapshot_manager_disabled_24px.png")); 483 503 484 504 /* Logs: */ 485 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Logs, tr("Logs"),505 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Logs, QString(), 486 506 UIIconPool::iconSet(":/vm_show_logs_24px.png", ":/vm_show_logs_disabled_24px.png")); 487 507 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h
r80802 r82713 29 29 30 30 /* GUI includes: */ 31 #include "QIWithRetranslateUI.h" 31 32 #include "UIToolsItem.h" 32 33 … … 47 48 48 49 /** QObject extension used as VM Tools-pane model: */ 49 class UIToolsModel : public Q Object50 class UIToolsModel : public QIWithRetranslateUI3<QObject> 50 51 { 51 52 Q_OBJECT; … … 187 188 /** Preprocesses Qt @a pEvent for passed @a pObject. */ 188 189 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */; 190 191 /** Handles translation event. */ 192 virtual void retranslateUi() /* override */; 189 193 /** @} */ 190 194
Note:
See TracChangeset
for help on using the changeset viewer.

