VirtualBox

Changeset 10475 in vbox


Ignore:
Timestamp:
Jul 10, 2008 3:51:22 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4: Cleanup & renaming.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsSelector.h

    r10474 r10475  
    7070};
    7171
    72 class VBoxSettingsTreeSelector: public VBoxSettingsSelector
     72class VBoxSettingsTreeViewSelector: public VBoxSettingsSelector
    7373{
    7474    Q_OBJECT;
     
    7676public:
    7777
    78     VBoxSettingsTreeSelector (QWidget *aParent = NULL);
     78    VBoxSettingsTreeViewSelector (QWidget *aParent = NULL);
    7979
    8080    virtual QWidget *widget() const;
     
    138138private:
    139139
    140     int findId (int aIndex) const;
    141     int findIndex (int aId) const;
    142     int findLink (const QString &aLink) const;
    143140    SelectorAction* findAction (int aId) const;
    144141
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialog.cpp

    r10474 r10475  
    7878#else
    7979    /* Create the classical tree view selector */
    80     mSelector = new VBoxSettingsTreeSelector (mAllWidget);
     80    mSelector = new VBoxSettingsTreeViewSelector (this);
    8181    mainLayout->addWidget (mSelector->widget(), 0, 0, 3, 1);
    8282    mSelector->widget()->setFocus();
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialogSpecific.cpp

    r10474 r10475  
    226226
    227227    attachPage (new VBoxVMSettingsVRDP());
     228
     229    /* Applying language settings */
     230    retranslateUi();
    228231
    229232    /* Setup Settings Dialog */
     
    257260        }
    258261    }
    259     /* Applying language settings */
    260     retranslateUi();
    261262}
    262263
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsSelector.cpp

    r10474 r10475  
    3939}
    4040
    41 /* VBoxSettingsTreeSelector */
     41/* VBoxSettingsTreeViewSelector */
    4242
    4343/* Returns the path to the item in the form of 'grandparent > parent > item'
     
    5858}
    5959
    60 VBoxSettingsTreeSelector::VBoxSettingsTreeSelector (QWidget *aParent /* = NULL */)
     60VBoxSettingsTreeViewSelector::VBoxSettingsTreeViewSelector (QWidget *aParent /* = NULL */)
    6161    :VBoxSettingsSelector (aParent)
    6262{
     
    8585}
    8686
    87 QWidget *VBoxSettingsTreeSelector::widget() const
     87QWidget *VBoxSettingsTreeViewSelector::widget() const
    8888{
    8989    return mTwSelector;
    9090}
    9191
    92 void VBoxSettingsTreeSelector::addItem (const QIcon &aIcon,
     92void VBoxSettingsTreeViewSelector::addItem (const QIcon &aIcon,
    9393                                        const QString &aText,
    9494                                        int aId,
     
    101101}
    102102
    103 QString VBoxSettingsTreeSelector::itemText (int aId) const
     103QString VBoxSettingsTreeViewSelector::itemText (int aId) const
    104104{
    105105    return pagePath (idToString (aId));
    106106}
    107107
    108 int VBoxSettingsTreeSelector::currentId () const
     108int VBoxSettingsTreeViewSelector::currentId () const
    109109{
    110110    int id = -1;
     
    115115}
    116116
    117 int VBoxSettingsTreeSelector::idToIndex (int aId) const
     117int VBoxSettingsTreeViewSelector::idToIndex (int aId) const
    118118{
    119119    int index = -1;
     
    124124}
    125125
    126 int VBoxSettingsTreeSelector::indexToId (int aIndex) const
     126int VBoxSettingsTreeViewSelector::indexToId (int aIndex) const
    127127{
    128128    int id = -1;
     
    133133}
    134134
    135 int VBoxSettingsTreeSelector::linkToId (const QString &aLink) const
     135int VBoxSettingsTreeViewSelector::linkToId (const QString &aLink) const
    136136{
    137137    int id = -1;
     
    143143
    144144
    145 void VBoxSettingsTreeSelector::selectById (int aId)
     145void VBoxSettingsTreeViewSelector::selectById (int aId)
    146146{
    147147    QTreeWidgetItem *item = findItem (mTwSelector, idToString (aId), treeWidget_Id);
     
    150150}
    151151
    152 void VBoxSettingsTreeSelector::setVisibleById (int aId, bool aShow)
     152void VBoxSettingsTreeViewSelector::setVisibleById (int aId, bool aShow)
    153153{
    154154    QTreeWidgetItem *item = findItem (mTwSelector, idToString (aId), treeWidget_Category);
     
    157157}
    158158
    159 void VBoxSettingsTreeSelector::clear()
     159void VBoxSettingsTreeViewSelector::clear()
    160160{
    161161    mTwSelector->clear();
    162162}
    163163
    164 void VBoxSettingsTreeSelector::polish()
     164void VBoxSettingsTreeViewSelector::polish()
    165165{
    166166    mTwSelector->setFixedWidth (static_cast<QAbstractItemView*> (mTwSelector)
     
    175175}
    176176
    177 void VBoxSettingsTreeSelector::settingsGroupChanged (QTreeWidgetItem *aItem,
     177void VBoxSettingsTreeViewSelector::settingsGroupChanged (QTreeWidgetItem *aItem,
    178178                                                     QTreeWidgetItem * /* aPrevItem */)
    179179{
     
    190190 *  details.
    191191 */
    192 QString VBoxSettingsTreeSelector::pagePath (const QString &aMatch) const
     192QString VBoxSettingsTreeViewSelector::pagePath (const QString &aMatch) const
    193193{
    194194    QTreeWidgetItem *li =
     
    201201/* Returns first item of 'aView' matching required 'aMatch' value
    202202 * searching the 'aColumn' column. */
    203 QTreeWidgetItem* VBoxSettingsTreeSelector::findItem (QTreeWidget *aView,
     203QTreeWidgetItem* VBoxSettingsTreeViewSelector::findItem (QTreeWidget *aView,
    204204                                                     const QString &aMatch,
    205205                                                     int aColumn) const
     
    211211}
    212212
    213 QString VBoxSettingsTreeSelector::idToString (int aId) const
     213QString VBoxSettingsTreeViewSelector::idToString (int aId) const
    214214{
    215215    return QString ("%1").arg (aId, 2, 10, QLatin1Char ('0'));
     
    287287int VBoxSettingsToolBarSelector::idToIndex (int aId) const
    288288{
    289     return findIndex (aId);
    290 }
    291 
    292 int VBoxSettingsToolBarSelector::indexToId (int aIndex) const
    293 {
    294     return findId (aIndex);
    295 }
    296 
    297 int VBoxSettingsToolBarSelector::linkToId (const QString &aLink) const
    298 {
    299     return findLink (aLink);
    300 }
    301 
    302 
    303 void VBoxSettingsToolBarSelector::selectById (int aId)
    304 {
    305     SelectorAction *action = findAction (aId);
    306 
    307     if (action)
    308         action->trigger();
    309 }
    310 
    311 void VBoxSettingsToolBarSelector::setVisibleById (int aId, bool aShow)
    312 {
    313     SelectorAction *action = findAction (aId);
    314 
    315     if (action)
    316         action->setVisible (aShow);
    317 }
    318 
    319 void VBoxSettingsToolBarSelector::clear()
    320 {
    321     QList<QAction*> list = mActionGroup->actions();
    322     foreach (QAction *action, list)
    323        delete action;
    324 }
    325 
    326 int VBoxSettingsToolBarSelector::minWidth() const
    327 {
    328     return mTbSelector->sizeHint().width() + 2 * 10;
    329 }
    330 
    331 void VBoxSettingsToolBarSelector::settingsGroupChanged (QAction *aAction)
    332 {
    333     SelectorAction *action = static_cast<SelectorAction*> (aAction);
    334     if (action)
    335         emit categoryChanged (action->id());
    336 }
    337 
    338 int VBoxSettingsToolBarSelector::findId (int aIndex) const
    339 {
    340     int id = -1;
    341     QList<QAction*> list = mActionGroup->actions();
    342     if (aIndex > -1 &&
    343         aIndex < list.count())
    344     {
    345         SelectorAction *sa = static_cast<SelectorAction*> (list.at (aIndex));
    346         if (sa)
    347             id = sa->id();
    348     }
    349     return id;
    350 }
    351 
    352 int VBoxSettingsToolBarSelector::findIndex (int aId) const
    353 {
    354289    int index = -1;
    355290    QList<QAction*> list = mActionGroup->actions();
     
    367302}
    368303
    369 int VBoxSettingsToolBarSelector::findLink (const QString &aLink) const
     304int VBoxSettingsToolBarSelector::indexToId (int aIndex) const
     305{
     306    int id = -1;
     307    QList<QAction*> list = mActionGroup->actions();
     308    if (aIndex > -1 &&
     309        aIndex < list.count())
     310    {
     311        SelectorAction *sa = static_cast<SelectorAction*> (list.at (aIndex));
     312        if (sa)
     313            id = sa->id();
     314    }
     315    return id;
     316}
     317
     318int VBoxSettingsToolBarSelector::linkToId (const QString &aLink) const
    370319{
    371320    int id = -1;
     
    384333}
    385334
     335
     336void VBoxSettingsToolBarSelector::selectById (int aId)
     337{
     338    SelectorAction *action = findAction (aId);
     339
     340    if (action)
     341        action->trigger();
     342}
     343
     344void VBoxSettingsToolBarSelector::setVisibleById (int aId, bool aShow)
     345{
     346    SelectorAction *action = findAction (aId);
     347
     348    if (action)
     349        action->setVisible (aShow);
     350}
     351
     352void VBoxSettingsToolBarSelector::clear()
     353{
     354    QList<QAction*> list = mActionGroup->actions();
     355    foreach (QAction *action, list)
     356       delete action;
     357}
     358
     359int VBoxSettingsToolBarSelector::minWidth() const
     360{
     361    return mTbSelector->sizeHint().width() + 2 * 10;
     362}
     363
     364void VBoxSettingsToolBarSelector::settingsGroupChanged (QAction *aAction)
     365{
     366    SelectorAction *action = static_cast<SelectorAction*> (aAction);
     367    if (action)
     368        emit categoryChanged (action->id());
     369}
     370
    386371SelectorAction* VBoxSettingsToolBarSelector::findAction (int aId) const
    387372{
    388     int index = findIndex (aId);
     373    int index = idToIndex (aId);
    389374    SelectorAction *sa = NULL;
    390375    QList<QAction*> list = mActionGroup->actions();
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