VirtualBox

Changeset 57668 in vbox for trunk


Ignore:
Timestamp:
Sep 9, 2015 2:46:10 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector UI: Details pane: Elements: Cleanup/rework (step 1).

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h

    r55401 r57668  
    159159template<> QString toInternalString(const DetailsElementType &detailsElementType);
    160160template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType);
     161template<> QIcon toIcon(const DetailsElementType &detailsElementType);
    161162template<> QString toInternalString(const PreviewUpdateIntervalType &previewUpdateIntervalType);
    162163template<> PreviewUpdateIntervalType fromInternalString<PreviewUpdateIntervalType>(const QString &strPreviewUpdateIntervalType);
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r56098 r57668  
    977977}
    978978
     979/* QIcon <= DetailsElementType: */
     980template<> QIcon toIcon(const DetailsElementType &detailsElementType)
     981{
     982    switch (detailsElementType)
     983    {
     984        case DetailsElementType_General:     return UIIconPool::iconSet(":/machine_16px.png");
     985        case DetailsElementType_Preview:     return UIIconPool::iconSet(":/machine_16px.png");
     986        case DetailsElementType_System:      return UIIconPool::iconSet(":/chipset_16px.png");
     987        case DetailsElementType_Display:     return UIIconPool::iconSet(":/vrdp_16px.png");
     988        case DetailsElementType_Storage:     return UIIconPool::iconSet(":/hd_16px.png");
     989        case DetailsElementType_Audio:       return UIIconPool::iconSet(":/sound_16px.png");
     990        case DetailsElementType_Network:     return UIIconPool::iconSet(":/nw_16px.png");
     991        case DetailsElementType_Serial:      return UIIconPool::iconSet(":/serial_port_16px.png");
     992#ifdef VBOX_WITH_PARALLEL_PORTS
     993        case DetailsElementType_Parallel:    return UIIconPool::iconSet(":/parallel_port_16px.png");
     994#endif /* VBOX_WITH_PARALLEL_PORTS */
     995        case DetailsElementType_USB:         return UIIconPool::iconSet(":/usb_16px.png");
     996        case DetailsElementType_SF:          return UIIconPool::iconSet(":/sf_16px.png");
     997        case DetailsElementType_UI:          return UIIconPool::iconSet(":/interface_16px.png");
     998        case DetailsElementType_Description: return UIIconPool::iconSet(":/description_16px.png");
     999        default:
     1000        {
     1001            AssertMsgFailed(("No icon for details element type=%d", detailsElementType));
     1002            break;
     1003        }
     1004    }
     1005    return QIcon();
     1006}
     1007
    9791008/* QString <= PreviewUpdateIntervalType: */
    9801009template<> QString toInternalString(const PreviewUpdateIntervalType &previewUpdateIntervalType)
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r56226 r57668  
    6262}
    6363
    64 UIGDetailsElementInterface::UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType elementType, bool fOpened)
    65     : UIGDetailsElement(pParent, elementType, fOpened)
     64UIGDetailsElementInterface::UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened)
     65    : UIGDetailsElement(pParent, type, fOpened)
    6666    , m_pThread(0)
    6767{
     68    /* Assign corresponding icon: */
     69    setIcon(gpConverter->toIcon(elementType()));
     70
     71    /* Translate finally: */
     72    retranslateUi();
    6873}
    6974
     
    7176{
    7277    cleanupThread();
     78}
     79
     80void UIGDetailsElementInterface::retranslateUi()
     81{
     82    /* Assign corresponding name: */
     83    setName(gpConverter->toString(elementType()));
    7384}
    7485
     
    160171}
    161172
    162 UIGDetailsElementGeneral::UIGDetailsElementGeneral(UIGDetailsSet *pParent, bool fOpened)
    163     : UIGDetailsElementInterface(pParent, DetailsElementType_General, fOpened)
    164 {
    165     /* Icon: */
    166     setIcon(UIIconPool::iconSet(":/machine_16px.png"));
    167 
    168     /* Translate: */
    169     retranslateUi();
    170 }
    171 
    172 void UIGDetailsElementGeneral::retranslateUi()
    173 {
    174     setName(gpConverter->toString(DetailsElementType_General));
    175 }
    176 
    177173UIGDetailsUpdateThread* UIGDetailsElementGeneral::createUpdateThread()
    178174{
     
    201197    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    202198
    203     /* Translate: */
     199    /* Translate finally: */
    204200    retranslateUi();
    205201}
     
    215211void UIGDetailsElementPreview::retranslateUi()
    216212{
    217     setName(gpConverter->toString(DetailsElementType_Preview));
     213    /* Assign corresponding name: */
     214    setName(gpConverter->toString(elementType()));
    218215}
    219216
     
    371368
    372369    COMBase::CleanupCOM();
    373 }
    374 
    375 UIGDetailsElementSystem::UIGDetailsElementSystem(UIGDetailsSet *pParent, bool fOpened)
    376     : UIGDetailsElementInterface(pParent, DetailsElementType_System, fOpened)
    377 {
    378     /* Icon: */
    379     setIcon(UIIconPool::iconSet(":/chipset_16px.png"));
    380 
    381     /* Translate: */
    382     retranslateUi();
    383 }
    384 
    385 void UIGDetailsElementSystem::retranslateUi()
    386 {
    387     setName(gpConverter->toString(DetailsElementType_System));
    388370}
    389371
     
    504486
    505487    COMBase::CleanupCOM();
    506 }
    507 
    508 UIGDetailsElementDisplay::UIGDetailsElementDisplay(UIGDetailsSet *pParent, bool fOpened)
    509     : UIGDetailsElementInterface(pParent, DetailsElementType_Display, fOpened)
    510 {
    511     /* Icon: */
    512     setIcon(UIIconPool::iconSet(":/vrdp_16px.png"));
    513 
    514     /* Translate: */
    515     retranslateUi();
    516 }
    517 
    518 void UIGDetailsElementDisplay::retranslateUi()
    519 {
    520     setName(gpConverter->toString(DetailsElementType_Display));
    521488}
    522489
     
    613580}
    614581
    615 UIGDetailsElementStorage::UIGDetailsElementStorage(UIGDetailsSet *pParent, bool fOpened)
    616     : UIGDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened)
    617 {
    618     /* Icon: */
    619     setIcon(UIIconPool::iconSet(":/hd_16px.png"));
    620 
    621     /* Translate: */
    622     retranslateUi();
    623 }
    624 
    625 void UIGDetailsElementStorage::retranslateUi()
    626 {
    627     setName(gpConverter->toString(DetailsElementType_Storage));
    628 }
    629 
    630582UIGDetailsUpdateThread* UIGDetailsElementStorage::createUpdateThread()
    631583{
     
    675627
    676628    COMBase::CleanupCOM();
    677 }
    678 
    679 UIGDetailsElementAudio::UIGDetailsElementAudio(UIGDetailsSet *pParent, bool fOpened)
    680     : UIGDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened)
    681 {
    682     /* Icon: */
    683     setIcon(UIIconPool::iconSet(":/sound_16px.png"));
    684 
    685     /* Translate: */
    686     retranslateUi();
    687 }
    688 
    689 void UIGDetailsElementAudio::retranslateUi()
    690 {
    691     setName(gpConverter->toString(DetailsElementType_Audio));
    692629}
    693630
     
    800737}
    801738
    802 UIGDetailsElementNetwork::UIGDetailsElementNetwork(UIGDetailsSet *pParent, bool fOpened)
    803     : UIGDetailsElementInterface(pParent, DetailsElementType_Network, fOpened)
    804 {
    805     /* Icon: */
    806     setIcon(UIIconPool::iconSet(":/nw_16px.png"));
    807 
    808     /* Translate: */
    809     retranslateUi();
    810 }
    811 
    812 void UIGDetailsElementNetwork::retranslateUi()
    813 {
    814     setName(gpConverter->toString(DetailsElementType_Network));
    815 }
    816 
    817739UIGDetailsUpdateThread* UIGDetailsElementNetwork::createUpdateThread()
    818740{
     
    870792}
    871793
    872 UIGDetailsElementSerial::UIGDetailsElementSerial(UIGDetailsSet *pParent, bool fOpened)
    873     : UIGDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened)
    874 {
    875     /* Icon: */
    876     setIcon(UIIconPool::iconSet(":/serial_port_16px.png"));
    877 
    878     /* Translate: */
    879     retranslateUi();
    880 }
    881 
    882 void UIGDetailsElementSerial::retranslateUi()
    883 {
    884     setName(gpConverter->toString(DetailsElementType_Serial));
    885 }
    886 
    887794UIGDetailsUpdateThread* UIGDetailsElementSerial::createUpdateThread()
    888795{
     
    933840
    934841    COMBase::CleanupCOM();
    935 }
    936 
    937 UIGDetailsElementParallel::UIGDetailsElementParallel(UIGDetailsSet *pParent, bool fOpened)
    938     : UIGDetailsElementInterface(pParent, DetailsElementType_Parallel, fOpened)
    939 {
    940     /* Icon: */
    941     setIcon(UIIconPool::iconSet(":/parallel_port_16px.png"));
    942 
    943     /* Translate: */
    944     retranslateUi();
    945 }
    946 
    947 void UIGDetailsElementParallel::retranslateUi()
    948 {
    949     setName(gpConverter->toString(DetailsElementType_Parallel));
    950842}
    951843
     
    1013905}
    1014906
    1015 UIGDetailsElementUSB::UIGDetailsElementUSB(UIGDetailsSet *pParent, bool fOpened)
    1016     : UIGDetailsElementInterface(pParent, DetailsElementType_USB, fOpened)
    1017 {
    1018     /* Icon: */
    1019     setIcon(UIIconPool::iconSet(":/usb_16px.png"));
    1020 
    1021     /* Translate: */
    1022     retranslateUi();
    1023 }
    1024 
    1025 void UIGDetailsElementUSB::retranslateUi()
    1026 {
    1027     setName(gpConverter->toString(DetailsElementType_USB));
    1028 }
    1029 
    1030907UIGDetailsUpdateThread* UIGDetailsElementUSB::createUpdateThread()
    1031908{
     
    1066943
    1067944    COMBase::CleanupCOM();
    1068 }
    1069 
    1070 UIGDetailsElementSF::UIGDetailsElementSF(UIGDetailsSet *pParent, bool fOpened)
    1071     : UIGDetailsElementInterface(pParent, DetailsElementType_SF, fOpened)
    1072 {
    1073     /* Icon: */
    1074     setIcon(UIIconPool::iconSet(":/sf_16px.png"));
    1075 
    1076     /* Translate: */
    1077     retranslateUi();
    1078 }
    1079 
    1080 void UIGDetailsElementSF::retranslateUi()
    1081 {
    1082     setName(gpConverter->toString(DetailsElementType_SF));
    1083945}
    1084946
     
    11871049}
    11881050
    1189 UIGDetailsElementUI::UIGDetailsElementUI(UIGDetailsSet *pParent, bool fOpened)
    1190     : UIGDetailsElementInterface(pParent, DetailsElementType_UI, fOpened)
    1191 {
    1192     /* Icon: */
    1193     setIcon(UIIconPool::iconSet(":/interface_16px.png"));
    1194 
    1195     /* Translate: */
    1196     retranslateUi();
    1197 }
    1198 
    1199 void UIGDetailsElementUI::retranslateUi()
    1200 {
    1201     setName(gpConverter->toString(DetailsElementType_UI));
    1202 }
    1203 
    12041051UIGDetailsUpdateThread* UIGDetailsElementUI::createUpdateThread()
    12051052{
     
    12421089}
    12431090
    1244 UIGDetailsElementDescription::UIGDetailsElementDescription(UIGDetailsSet *pParent, bool fOpened)
    1245     : UIGDetailsElementInterface(pParent, DetailsElementType_Description, fOpened)
    1246 {
    1247     /* Icon: */
    1248     setIcon(UIIconPool::iconSet(":/description_16px.png"));
    1249 
    1250     /* Translate: */
    1251     retranslateUi();
    1252 }
    1253 
    1254 void UIGDetailsElementDescription::retranslateUi()
    1255 {
    1256     setName(gpConverter->toString(DetailsElementType_Description));
    1257 }
    1258 
    12591091UIGDetailsUpdateThread* UIGDetailsElementDescription::createUpdateThread()
    12601092{
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h

    r55401 r57668  
    6666
    6767    /* Constructor/destructor: */
    68     UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType elementType, bool fOpened);
     68    UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened);
    6969    ~UIGDetailsElementInterface();
    7070
    7171protected:
     72
     73    /* Helper: Translate stuff: */
     74    void retranslateUi();
    7275
    7376    /* Helpers: Update stuff: */
     
    114117
    115118    /* Constructor: */
    116     UIGDetailsElementGeneral(UIGDetailsSet *pParent, bool fOpened);
    117 
    118 private:
    119 
    120     /* Helper: Translate stuff: */
    121     void retranslateUi();
     119    UIGDetailsElementGeneral(UIGDetailsSet *pParent, bool fOpened)
     120        : UIGDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {}
     121
     122private:
    122123
    123124    /* Helper: Update stuff: */
     
    183184
    184185    /* Constructor: */
    185     UIGDetailsElementSystem(UIGDetailsSet *pParent, bool fOpened);
    186 
    187 private:
    188 
    189     /* Helper: Translate stuff: */
    190     void retranslateUi();
     186    UIGDetailsElementSystem(UIGDetailsSet *pParent, bool fOpened)
     187        : UIGDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {}
     188
     189private:
    191190
    192191    /* Helper: Update stuff: */
     
    219218
    220219    /* Constructor: */
    221     UIGDetailsElementDisplay(UIGDetailsSet *pParent, bool fOpened);
    222 
    223 private:
    224 
    225     /* Helper: Translate stuff: */
    226     void retranslateUi();
     220    UIGDetailsElementDisplay(UIGDetailsSet *pParent, bool fOpened)
     221        : UIGDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {}
     222
     223private:
    227224
    228225    /* Helper: Update stuff: */
     
    255252
    256253    /* Constructor: */
    257     UIGDetailsElementStorage(UIGDetailsSet *pParent, bool fOpened);
    258 
    259 private:
    260 
    261     /* Helper: Translate stuff: */
    262     void retranslateUi();
     254    UIGDetailsElementStorage(UIGDetailsSet *pParent, bool fOpened)
     255        : UIGDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {}
     256
     257private:
    263258
    264259    /* Helper: Update stuff: */
     
    291286
    292287    /* Constructor: */
    293     UIGDetailsElementAudio(UIGDetailsSet *pParent, bool fOpened);
    294 
    295 private:
    296 
    297     /* Helper: Translate stuff: */
    298     void retranslateUi();
     288    UIGDetailsElementAudio(UIGDetailsSet *pParent, bool fOpened)
     289        : UIGDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {}
     290
     291private:
    299292
    300293    /* Helper: Update stuff: */
     
    328321
    329322    /* Constructor: */
    330     UIGDetailsElementNetwork(UIGDetailsSet *pParent, bool fOpened);
    331 
    332 private:
    333 
    334     /* Helper: Translate stuff: */
    335     void retranslateUi();
     323    UIGDetailsElementNetwork(UIGDetailsSet *pParent, bool fOpened)
     324        : UIGDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {}
     325
     326private:
    336327
    337328    /* Helper: Update stuff: */
     
    364355
    365356    /* Constructor: */
    366     UIGDetailsElementSerial(UIGDetailsSet *pParent, bool fOpened);
    367 
    368 private:
    369 
    370     /* Helper: Translate stuff: */
    371     void retranslateUi();
     357    UIGDetailsElementSerial(UIGDetailsSet *pParent, bool fOpened)
     358        : UIGDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {}
     359
     360private:
    372361
    373362    /* Helper: Update stuff: */
     
    401390
    402391    /* Constructor: */
    403     UIGDetailsElementParallel(UIGDetailsSet *pParent, bool fOpened);
    404 
    405 private:
    406 
    407     /* Helper: Translate stuff: */
    408     void retranslateUi();
     392    UIGDetailsElementParallel(UIGDetailsSet *pParent, bool fOpened)
     393        : UIGDetailsElementInterface(pParent, DetailsElementType_Parallel, fOpened) {}
     394
     395private:
    409396
    410397    /* Helper: Update stuff: */
     
    438425
    439426    /* Constructor: */
    440     UIGDetailsElementUSB(UIGDetailsSet *pParent, bool fOpened);
    441 
    442 private:
    443 
    444     /* Helper: Translate stuff: */
    445     void retranslateUi();
     427    UIGDetailsElementUSB(UIGDetailsSet *pParent, bool fOpened)
     428        : UIGDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {}
     429
     430private:
    446431
    447432    /* Helper: Update stuff: */
     
    474459
    475460    /* Constructor: */
    476     UIGDetailsElementSF(UIGDetailsSet *pParent, bool fOpened);
    477 
    478 private:
    479 
    480     /* Helper: Translate stuff: */
    481     void retranslateUi();
     461    UIGDetailsElementSF(UIGDetailsSet *pParent, bool fOpened)
     462        : UIGDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {}
     463
     464private:
    482465
    483466    /* Helper: Update stuff: */
     
    510493
    511494    /* Constructor: */
    512     UIGDetailsElementUI(UIGDetailsSet *pParent, bool fOpened);
    513 
    514 private:
    515 
    516     /* Helper: Translate stuff: */
    517     void retranslateUi();
     495    UIGDetailsElementUI(UIGDetailsSet *pParent, bool fOpened)
     496        : UIGDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {}
     497
     498private:
    518499
    519500    /* Helper: Update stuff: */
     
    546527
    547528    /* Constructor: */
    548     UIGDetailsElementDescription(UIGDetailsSet *pParent, bool fOpened);
    549 
    550 private:
    551 
    552     /* Helper: Translate stuff: */
    553     void retranslateUi();
     529    UIGDetailsElementDescription(UIGDetailsSet *pParent, bool fOpened)
     530        : UIGDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {}
     531
     532private:
    554533
    555534    /* Helper: Update stuff: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette