VirtualBox

Changeset 32759 in vbox


Ignore:
Timestamp:
Sep 24, 2010 1:20:18 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt4: coding style

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp

    r32758 r32759  
    7676 */
    7777VBoxSelectorWnd::
    78 VBoxSelectorWnd (VBoxSelectorWnd **aSelf, QWidget* aParent,
    79                  Qt::WindowFlags aFlags /* = Qt::Window */)
    80     : QIWithRetranslateUI2<QMainWindow> (aParent, aFlags)
    81     , mDoneInaccessibleWarningOnce (false)
     78VBoxSelectorWnd(VBoxSelectorWnd **aSelf, QWidget* aParent,
     79                Qt::WindowFlags aFlags /* = Qt::Window */)
     80    : QIWithRetranslateUI2<QMainWindow>(aParent, aFlags)
     81    , mDoneInaccessibleWarningOnce(false)
    8282{
    8383    VBoxGlobalSettings settings = vboxGlobal().settings();
     
    9191
    9292#if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)
    93     qApp->installEventFilter (this);
     93    qApp->installEventFilter(this);
    9494#endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402) */
    9595
     
    9797    /* The application icon. On Win32, it's built-in to the executable. On Mac
    9898     * OS X the icon referenced in info.plist is used. */
    99     setWindowIcon (QIcon (":/VirtualBox_48px.png"));
     99    setWindowIcon(QIcon(":/VirtualBox_48px.png"));
    100100#endif
    101101
    102102    /* actions */
    103103
    104     mFileMediaMgrAction = new QAction (this);
     104    mFileMediaMgrAction = new QAction(this);
    105105    mFileMediaMgrAction->setIcon(UIIconPool::iconSet(":/diskimage_16px.png"));
    106106
    107     mFileApplianceImportAction = new QAction (this);
     107    mFileApplianceImportAction = new QAction(this);
    108108    mFileApplianceImportAction->setIcon(UIIconPool::iconSet(":/import_16px.png"));
    109109
    110     mFileApplianceExportAction = new QAction (this);
     110    mFileApplianceExportAction = new QAction(this);
    111111    mFileApplianceExportAction->setIcon(UIIconPool::iconSet(":/export_16px.png"));
    112112
    113113    mFileSettingsAction = new QAction(this);
    114     mFileSettingsAction->setMenuRole (QAction::PreferencesRole);
     114    mFileSettingsAction->setMenuRole(QAction::PreferencesRole);
    115115    mFileSettingsAction->setIcon(UIIconPool::iconSet(":/global_settings_16px.png"));
    116     mFileExitAction = new QAction (this);
    117     mFileExitAction->setMenuRole (QAction::QuitRole);
     116    mFileExitAction = new QAction(this);
     117    mFileExitAction->setMenuRole(QAction::QuitRole);
    118118    mFileExitAction->setIcon(UIIconPool::iconSet(":/exit_16px.png"));
    119119
    120     mVmNewAction = new QAction (this);
     120    mVmNewAction = new QAction(this);
    121121    mVmNewAction->setIcon(UIIconPool::iconSetFull(
    122         QSize (32, 32), QSize (16, 16),
     122        QSize(32, 32), QSize(16, 16),
    123123        ":/vm_new_32px.png", ":/new_16px.png"));
    124     mVmConfigAction = new QAction (this);
     124    mVmConfigAction = new QAction(this);
    125125    mVmConfigAction->setIcon(UIIconPool::iconSetFull(
    126         QSize (32, 32), QSize (16, 16),
     126        QSize(32, 32), QSize(16, 16),
    127127        ":/vm_settings_32px.png", ":/settings_16px.png",
    128128        ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png"));
    129     mVmDeleteAction = new QAction (this);
     129    mVmDeleteAction = new QAction(this);
    130130    mVmDeleteAction->setIcon(UIIconPool::iconSetFull(
    131         QSize (32, 32), QSize (16, 16),
     131        QSize(32, 32), QSize(16, 16),
    132132        ":/vm_delete_32px.png", ":/delete_16px.png",
    133133        ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png"));
    134     mVmStartAction = new QAction (this);
     134    mVmStartAction = new QAction(this);
    135135    mVmStartAction->setIcon(UIIconPool::iconSetFull(
    136         QSize (32, 32), QSize (16, 16),
     136        QSize(32, 32), QSize(16, 16),
    137137        ":/vm_start_32px.png", ":/start_16px.png",
    138138        ":/vm_start_disabled_32px.png", ":/start_dis_16px.png"));
    139     mVmDiscardAction = new QAction (this);
     139    mVmDiscardAction = new QAction(this);
    140140    mVmDiscardAction->setIcon(UIIconPool::iconSetFull(
    141         QSize (32, 32), QSize (16, 16),
     141        QSize(32, 32), QSize(16, 16),
    142142        ":/vm_discard_32px.png", ":/discard_16px.png",
    143143        ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png"));
    144     mVmPauseAction = new QAction (this);
    145     mVmPauseAction->setCheckable (true);
     144    mVmPauseAction = new QAction(this);
     145    mVmPauseAction->setCheckable(true);
    146146    mVmPauseAction->setIcon(UIIconPool::iconSetFull(
    147         QSize (32, 32), QSize (16, 16),
     147        QSize(32, 32), QSize(16, 16),
    148148        ":/vm_pause_32px.png", ":/pause_16px.png",
    149149        ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png"));
    150     mVmRefreshAction = new QAction (this);
     150    mVmRefreshAction = new QAction(this);
    151151    mVmRefreshAction->setIcon(UIIconPool::iconSetFull(
    152         QSize (32, 32), QSize (16, 16),
     152        QSize(32, 32), QSize(16, 16),
    153153        ":/refresh_32px.png", ":/refresh_16px.png",
    154154        ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png"));
    155     mVmShowLogsAction = new QAction (this);
     155    mVmShowLogsAction = new QAction(this);
    156156    mVmShowLogsAction->setIcon(UIIconPool::iconSetFull(
    157         QSize (32, 32), QSize (16, 16),
     157        QSize(32, 32), QSize(16, 16),
    158158        ":/vm_show_logs_32px.png", ":/show_logs_16px.png",
    159159        ":/vm_show_logs_disabled_32px.png", ":/show_logs_disabled_16px.png"));
    160160
    161     mHelpActions.setup (this);
     161    mHelpActions.setup(this);
    162162
    163163    /* VM list toolbar */
     
    181181    /* Make non-possible to activate list elements by single click,
    182182     * this hack should disable the current possibility to do it if present */
    183     if (mVMListView->style()->styleHint (QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, mVMListView))
    184         mVMListView->setStyleSheet ("activate-on-singleclick : 0");
     183    if (mVMListView->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, mVMListView))
     184        mVMListView->setStyleSheet("activate-on-singleclick : 0");
    185185
    186186    m_pSplitter = new QISplitter(this);
     
    190190#if MAC_LEOPARD_STYLE
    191191    /* Enable unified toolbars on Mac OS X. Available on Qt >= 4.3 */
    192     addToolBar (mVMToolBar);
     192    addToolBar(mVMToolBar);
    193193    mVMToolBar->setMacToolbar();
    194194    /* Central widget @ horizontal layout */
    195195    setCentralWidget(m_pSplitter);
    196     m_pSplitter->addWidget (mVMListView);
     196    m_pSplitter->addWidget(mVMListView);
    197197#else /* MAC_LEOPARD_STYLE */
    198198//    mVMToolBar->setContentsMargins(5, 5, 0, 0);
    199 //    addToolBar (mVMToolBar);
    200 //    m_pSplitter->addWidget (mVMListView);
     199//    addToolBar(mVMToolBar);
     200//    m_pSplitter->addWidget(mVMListView);
    201201    QWidget *pLeftWidget = new QWidget(this);
    202202    QVBoxLayout *pLeftVLayout = new QVBoxLayout(pLeftWidget);
     
    220220    /* add actions to the toolbar */
    221221
    222     mVMToolBar->setIconSize (QSize (32, 32));
    223     mVMToolBar->setToolButtonStyle (Qt::ToolButtonTextUnderIcon);
    224 //    mVMToolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred);
    225 
    226     mVMToolBar->addAction (mVmNewAction);
    227     mVMToolBar->addAction (mVmConfigAction);
     222    mVMToolBar->setIconSize(QSize(32, 32));
     223    mVMToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
     224//    mVMToolBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
     225
     226    mVMToolBar->addAction(mVmNewAction);
     227    mVMToolBar->addAction(mVmConfigAction);
    228228#if 0 /* delete action is really rare */
    229     mVMToolBar->addAction (mVmDeleteAction);
     229    mVMToolBar->addAction(mVmDeleteAction);
    230230#endif
    231     mVMToolBar->addAction (mVmStartAction);
    232     mVMToolBar->addAction (mVmDiscardAction);
     231    mVMToolBar->addAction(mVmStartAction);
     232    mVMToolBar->addAction(mVmDiscardAction);
    233233
    234234    /* VM tab widget containing details and snapshots tabs */
     
    240240    pVBox->addWidget(m_pVMDesktop);
    241241
    242     m_pSplitter->addWidget (w);
     242    m_pSplitter->addWidget(w);
    243243
    244244    /* Set the initial distribution. The right site is bigger. */
     
    252252
    253253    /* add actions to menubar */
    254     mFileMenu = menuBar()->addMenu (QString::null);
    255     mFileMenu->addAction (mFileMediaMgrAction);
    256     mFileMenu->addAction (mFileApplianceImportAction);
    257     mFileMenu->addAction (mFileApplianceExportAction);
     254    mFileMenu = menuBar()->addMenu(QString::null);
     255    mFileMenu->addAction(mFileMediaMgrAction);
     256    mFileMenu->addAction(mFileApplianceImportAction);
     257    mFileMenu->addAction(mFileApplianceExportAction);
    258258#ifndef Q_WS_MAC
    259259    mFileMenu->addSeparator();
    260260#endif /* Q_WS_MAC */
    261     mFileMenu->addAction (mFileSettingsAction);
     261    mFileMenu->addAction(mFileSettingsAction);
    262262#ifndef Q_WS_MAC
    263263    mFileMenu->addSeparator();
    264264#endif /* Q_WS_MAC */
    265     mFileMenu->addAction (mFileExitAction);
    266 
    267     mVMMenu = menuBar()->addMenu (QString::null);
    268     mVMMenu->addAction (mVmNewAction);
    269     mVMMenu->addAction (mVmConfigAction);
    270     mVMMenu->addAction (mVmDeleteAction);
     265    mFileMenu->addAction(mFileExitAction);
     266
     267    mVMMenu = menuBar()->addMenu(QString::null);
     268    mVMMenu->addAction(mVmNewAction);
     269    mVMMenu->addAction(mVmConfigAction);
     270    mVMMenu->addAction(mVmDeleteAction);
    271271    mVMMenu->addSeparator();
    272     mVMMenu->addAction (mVmStartAction);
    273     mVMMenu->addAction (mVmDiscardAction);
    274     mVMMenu->addAction (mVmPauseAction);
     272    mVMMenu->addAction(mVmStartAction);
     273    mVMMenu->addAction(mVmDiscardAction);
     274    mVMMenu->addAction(mVmPauseAction);
    275275    mVMMenu->addSeparator();
    276     mVMMenu->addAction (mVmRefreshAction);
    277     mVMMenu->addAction (mVmShowLogsAction);
    278 
    279     mVMCtxtMenu = new QMenu (this);
    280     mVMCtxtMenu->addAction (mVmConfigAction);
    281     mVMCtxtMenu->addAction (mVmDeleteAction);
     276    mVMMenu->addAction(mVmRefreshAction);
     277    mVMMenu->addAction(mVmShowLogsAction);
     278
     279    mVMCtxtMenu = new QMenu(this);
     280    mVMCtxtMenu->addAction(mVmConfigAction);
     281    mVMCtxtMenu->addAction(mVmDeleteAction);
    282282    mVMCtxtMenu->addSeparator();
    283     mVMCtxtMenu->addAction (mVmStartAction);
    284     mVMCtxtMenu->addAction (mVmDiscardAction);
    285     mVMCtxtMenu->addAction (mVmPauseAction);
     283    mVMCtxtMenu->addAction(mVmStartAction);
     284    mVMCtxtMenu->addAction(mVmDiscardAction);
     285    mVMCtxtMenu->addAction(mVmPauseAction);
    286286    mVMCtxtMenu->addSeparator();
    287     mVMCtxtMenu->addAction (mVmRefreshAction);
    288     mVMCtxtMenu->addAction (mVmShowLogsAction);
     287    mVMCtxtMenu->addAction(mVmRefreshAction);
     288    mVMCtxtMenu->addAction(mVmShowLogsAction);
    289289
    290290    /* Make sure every status bar hint from the context menu is cleared when
    291291     * the menu is closed. */
    292     connect (mVMCtxtMenu, SIGNAL(aboutToHide()),
    293              statusBar(), SLOT(clearMessage()));
    294 
    295     mHelpMenu = menuBar()->addMenu (QString::null);
    296     mHelpActions.addTo (mHelpMenu);
     292    connect(mVMCtxtMenu, SIGNAL(aboutToHide()),
     293            statusBar(), SLOT(clearMessage()));
     294
     295    mHelpMenu = menuBar()->addMenu(QString::null);
     296    mHelpActions.addTo(mHelpMenu);
    297297
    298298#ifdef VBOX_GUI_WITH_SYSTRAY
    299     mTrayIcon = new VBoxTrayIcon (this, mVMModel);
    300     Assert (mTrayIcon);
    301     connect (mTrayIcon, SIGNAL (activated (QSystemTrayIcon::ActivationReason)),
    302              this, SLOT (trayIconActivated (QSystemTrayIcon::ActivationReason)));
     299    mTrayIcon = new VBoxTrayIcon(this, mVMModel);
     300    Assert(mTrayIcon);
     301    connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
     302            this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
    303303#endif
    304304
     
    308308    /* Restore the position of the window */
    309309    {
    310         QString winPos = vbox.GetExtraData (VBoxDefs::GUI_LastWindowPosition);
     310        QString winPos = vbox.GetExtraData(VBoxDefs::GUI_LastWindowPosition);
    311311
    312312        bool ok = false, max = false;
    313313        int x = 0, y = 0, w = 0, h = 0;
    314         x = winPos.section (',', 0, 0).toInt (&ok);
     314        x = winPos.section(',', 0, 0).toInt(&ok);
    315315        if (ok)
    316             y = winPos.section (',', 1, 1).toInt (&ok);
     316            y = winPos.section(',', 1, 1).toInt(&ok);
    317317        if (ok)
    318             w = winPos.section (',', 2, 2).toInt (&ok);
     318            w = winPos.section(',', 2, 2).toInt(&ok);
    319319        if (ok)
    320             h = winPos.section (',', 3, 3).toInt (&ok);
     320            h = winPos.section(',', 3, 3).toInt(&ok);
    321321        if (ok)
    322             max = winPos.section (',', 4, 4) == VBoxDefs::GUI_LastWindowState_Max;
    323 
    324         QRect ar = ok ? QApplication::desktop()->availableGeometry (QPoint (x, y)) :
    325                         QApplication::desktop()->availableGeometry (this);
     322            max = winPos.section(',', 4, 4) == VBoxDefs::GUI_LastWindowState_Max;
     323
     324        QRect ar = ok ? QApplication::desktop()->availableGeometry(QPoint(x, y)) :
     325                        QApplication::desktop()->availableGeometry(this);
    326326
    327327        if (ok /* previous parameters were read correctly */
     
    329329            && (x + w > ar.left()) && (x < ar.right()) /* & horizontal bounds */)
    330330        {
    331             mNormalGeo.moveTo (x, y);
    332             mNormalGeo.setSize (QSize (w, h).expandedTo (minimumSizeHint())
    333                                             .boundedTo (ar.size()));
    334             setGeometry (mNormalGeo);
     331            mNormalGeo.moveTo(x, y);
     332            mNormalGeo.setSize(QSize(w, h).expandedTo(minimumSizeHint())
     333                                          .boundedTo(ar.size()));
     334            setGeometry(mNormalGeo);
    335335            if (max) /* maximize if needed */
    336336                showMaximized();
     
    338338        else
    339339        {
    340             mNormalGeo.setSize (QSize (770, 550).expandedTo (minimumSizeHint())
    341                                                 .boundedTo (ar.size()));
    342             mNormalGeo.moveCenter (ar.center());
    343             setGeometry (mNormalGeo);
     340            mNormalGeo.setSize(QSize(770, 550).expandedTo(minimumSizeHint())
     341                                              .boundedTo(ar.size()));
     342            mNormalGeo.moveCenter(ar.center());
     343            setGeometry(mNormalGeo);
    344344        }
    345345    }
     
    349349
    350350    /* Reset to the first item */
    351     mVMListView->selectItemByRow (0);
     351    mVMListView->selectItemByRow(0);
    352352
    353353    /* restore the position of vm selector */
    354354    {
    355         QString prevVMId = vbox.GetExtraData (VBoxDefs::GUI_LastVMSelected);
    356 
    357         mVMListView->selectItemById (prevVMId);
     355        QString prevVMId = vbox.GetExtraData(VBoxDefs::GUI_LastVMSelected);
     356
     357        mVMListView->selectItemById(prevVMId);
    358358    }
    359359
     
    383383
    384384    /* signals and slots connections */
    385     connect (mFileMediaMgrAction, SIGNAL (triggered()), this, SLOT (fileMediaMgr()));
    386     connect (mFileApplianceImportAction, SIGNAL (triggered()), this, SLOT (fileImportAppliance()));
    387     connect (mFileApplianceExportAction, SIGNAL (triggered()), this, SLOT (fileExportAppliance()));
    388     connect (mFileSettingsAction, SIGNAL (triggered()), this, SLOT (fileSettings()));
    389     connect (mFileExitAction, SIGNAL (triggered()), this, SLOT (fileExit()));
    390     connect (mVmNewAction, SIGNAL (triggered()), this, SLOT (vmNew()));
    391 
    392     connect (mVmConfigAction, SIGNAL (triggered()), this, SLOT (vmSettings()));
    393     connect (mVmDeleteAction, SIGNAL (triggered()), this, SLOT (vmDelete()));
    394     connect (mVmStartAction, SIGNAL (triggered()), this, SLOT (vmStart()));
    395     connect (mVmDiscardAction, SIGNAL (triggered()), this, SLOT (vmDiscard()));
    396     connect (mVmPauseAction, SIGNAL (toggled (bool)), this, SLOT (vmPause (bool)));
    397     connect (mVmRefreshAction, SIGNAL (triggered()), this, SLOT (vmRefresh()));
    398     connect (mVmShowLogsAction, SIGNAL (triggered()), this, SLOT (vmShowLogs()));
    399 
    400     connect (mVMListView, SIGNAL (currentChanged()),
    401              this, SLOT (vmListViewCurrentChanged()));
    402     connect (mVMListView, SIGNAL (activated()),
    403              this, SLOT (vmStart()));
    404     connect (mVMListView, SIGNAL (customContextMenuRequested (const QPoint &)),
    405              this, SLOT (showContextMenu (const QPoint &)));
    406 
    407     connect (m_pVMDesktop, SIGNAL(linkClicked(const QString &)),
    408              this, SLOT(vmSettings(const QString &)));
     385    connect(mFileMediaMgrAction, SIGNAL(triggered()), this, SLOT(fileMediaMgr()));
     386    connect(mFileApplianceImportAction, SIGNAL(triggered()), this, SLOT(fileImportAppliance()));
     387    connect(mFileApplianceExportAction, SIGNAL(triggered()), this, SLOT(fileExportAppliance()));
     388    connect(mFileSettingsAction, SIGNAL(triggered()), this, SLOT(fileSettings()));
     389    connect(mFileExitAction, SIGNAL(triggered()), this, SLOT(fileExit()));
     390    connect(mVmNewAction, SIGNAL(triggered()), this, SLOT(vmNew()));
     391
     392    connect(mVmConfigAction, SIGNAL(triggered()), this, SLOT(vmSettings()));
     393    connect(mVmDeleteAction, SIGNAL(triggered()), this, SLOT(vmDelete()));
     394    connect(mVmStartAction, SIGNAL(triggered()), this, SLOT(vmStart()));
     395    connect(mVmDiscardAction, SIGNAL(triggered()), this, SLOT(vmDiscard()));
     396    connect(mVmPauseAction, SIGNAL(toggled(bool)), this, SLOT(vmPause(bool)));
     397    connect(mVmRefreshAction, SIGNAL(triggered()), this, SLOT(vmRefresh()));
     398    connect(mVmShowLogsAction, SIGNAL(triggered()), this, SLOT(vmShowLogs()));
     399
     400    connect(mVMListView, SIGNAL(currentChanged()),
     401            this, SLOT(vmListViewCurrentChanged()));
     402    connect(mVMListView, SIGNAL(activated()),
     403            this, SLOT(vmStart()));
     404    connect(mVMListView, SIGNAL(customContextMenuRequested(const QPoint &)),
     405            this, SLOT(showContextMenu(const QPoint &)));
     406
     407    connect(m_pVMDesktop, SIGNAL(linkClicked(const QString &)),
     408            this, SLOT(vmSettings(const QString &)));
    409409
    410410    /* listen to media enumeration signals */
    411     connect (&vboxGlobal(), SIGNAL (mediumEnumStarted()),
    412              this, SLOT (mediumEnumStarted()));
    413     connect (&vboxGlobal(), SIGNAL (mediumEnumFinished (const VBoxMediaList &)),
    414              this, SLOT (mediumEnumFinished (const VBoxMediaList &)));
     411    connect(&vboxGlobal(), SIGNAL(mediumEnumStarted()),
     412            this, SLOT(mediumEnumStarted()));
     413    connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)),
     414            this, SLOT(mediumEnumFinished(const VBoxMediaList &)));
    415415
    416416    /* connect VirtualBox events */
    417     connect (gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    418              this, SLOT(machineStateChanged(QString, KMachineState)));
    419     connect (gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
    420              this, SLOT(machineDataChanged(QString)));
    421     connect (gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),
    422              this, SLOT(machineRegistered(QString, bool)));
    423     connect (gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)),
    424              this, SLOT(sessionStateChanged(QString, KSessionState)));
    425     connect (gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)),
    426              this, SLOT(snapshotChanged(QString, QString)));
     417    connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
     418            this, SLOT(machineStateChanged(QString, KMachineState)));
     419    connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
     420            this, SLOT(machineDataChanged(QString)));
     421    connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),
     422            this, SLOT(machineRegistered(QString, bool)));
     423    connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)),
     424            this, SLOT(sessionStateChanged(QString, KSessionState)));
     425    connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)),
     426            this, SLOT(snapshotChanged(QString, QString)));
    427427#ifdef VBOX_GUI_WITH_SYSTRAY
    428     connect (gEDataEvents, SIGNAL(sigMainWindowCountChange(int)),
    429              this, SLOT(mainWindowCountChanged(int)));
    430     connect (gEDataEvents, SIGNAL(sigCanShowTrayIcon(bool)),
    431              this, SLOT(trayIconCanShow(bool)));
    432     connect (gEDataEvents, SIGNAL(sigTrayIconChange(bool)),
    433              this, SLOT(trayIconChanged(bool)));
    434     connect (&vboxGlobal(), SIGNAL(sigTrayIconShow(bool)),
    435              this, SLOT(trayIconShow(bool)));
     428    connect(gEDataEvents, SIGNAL(sigMainWindowCountChange(int)),
     429            this, SLOT(mainWindowCountChanged(int)));
     430    connect(gEDataEvents, SIGNAL(sigCanShowTrayIcon(bool)),
     431            this, SLOT(trayIconCanShow(bool)));
     432    connect(gEDataEvents, SIGNAL(sigTrayIconChange(bool)),
     433            this, SLOT(trayIconChanged(bool)));
     434    connect(&vboxGlobal(), SIGNAL(sigTrayIconShow(bool)),
     435            this, SLOT(trayIconShow(bool)));
    436436#endif
    437437
     
    453453    {
    454454        int y = mNormalGeo.y();
    455         QString winPos = QString ("%1,%2,%3,%4")
    456             .arg (mNormalGeo.x()).arg (y)
    457             .arg (mNormalGeo.width()).arg (mNormalGeo.height());
     455        QString winPos = QString("%1,%2,%3,%4")
     456            .arg(mNormalGeo.x()).arg(y)
     457            .arg(mNormalGeo.width()).arg(mNormalGeo.height());
    458458#ifdef Q_WS_MAC
    459459        ::darwinUnregisterForUnifiedToolbarContextMenuEvents(this);
     
    462462        if (isMaximized())
    463463#endif /* !Q_WS_MAC */
    464             winPos += QString (",%1").arg (VBoxDefs::GUI_LastWindowState_Max);
    465 
    466         vbox.SetExtraData (VBoxDefs::GUI_LastWindowPosition, winPos);
     464            winPos += QString(",%1").arg(VBoxDefs::GUI_LastWindowState_Max);
     465
     466        vbox.SetExtraData(VBoxDefs::GUI_LastWindowPosition, winPos);
    467467    }
    468468
     
    471471        UIVMItem *item = mVMListView->selectedItem();
    472472        QString curVMId = item ?
    473             QString (item->id()) :
     473            QString(item->id()) :
    474474            QString::null;
    475         vbox.SetExtraData (VBoxDefs::GUI_LastVMSelected, curVMId);
     475        vbox.SetExtraData(VBoxDefs::GUI_LastVMSelected, curVMId);
    476476    }
    477477
     
    497497void VBoxSelectorWnd::fileMediaMgr()
    498498{
    499     VBoxMediaManagerDlg::showModeless (this);
     499    VBoxMediaManagerDlg::showModeless(this);
    500500}
    501501
    502502void VBoxSelectorWnd::fileImportAppliance()
    503503{
    504     UIImportApplianceWzd wzd (this);
     504    UIImportApplianceWzd wzd(this);
    505505
    506506    wzd.exec();
     
    515515        name = item->name();
    516516
    517     UIExportApplianceWzd wzd (this, name);
     517    UIExportApplianceWzd wzd(this, name);
    518518
    519519    wzd.exec();
     
    525525    CSystemProperties props = vboxGlobal().virtualBox().GetSystemProperties();
    526526
    527     UISettingsDialog *dlg = new UIGLSettingsDlg (this);
     527    UISettingsDialog *dlg = new UIGLSettingsDlg(this);
    528528    dlg->getFrom();
    529529
     
    540540     * different to Qt3 where a *mainWidget* exists & if this going to close
    541541     * all other windows are closed automatically. We do the same below. */
    542     foreach (QWidget *widget, QApplication::topLevelWidgets())
     542    foreach(QWidget *widget, QApplication::topLevelWidgets())
    543543    {
    544544        if (widget->isVisible() &&
     
    552552void VBoxSelectorWnd::vmNew()
    553553{
    554     UINewVMWzd wzd (this);
     554    UINewVMWzd wzd(this);
    555555    if (wzd.exec() == QDialog::Accepted)
    556556    {
     
    559559        /* wait until the list is updated by OnMachineRegistered() */
    560560        QModelIndex index;
    561         while (!index.isValid())
     561        while(!index.isValid())
    562562        {
    563563            qApp->processEvents();
    564             index = mVMModel->indexById (m.GetId());
    565         }
    566         mVMListView->setCurrentIndex (index);
     564            index = mVMModel->indexById(m.GetId());
     565        }
     566        mVMListView->setCurrentIndex(index);
    567567    }
    568568}
     
    571571 *  Opens the VM settings dialog.
    572572 */
    573 void VBoxSelectorWnd::vmSettings (const QString &aCategory /* = QString::null */,
    574                                   const QString &aControl /* = QString::null */,
    575                                   const QString &aUuid /* = QString::null */)
     573void VBoxSelectorWnd::vmSettings(const QString &aCategory /* = QString::null */,
     574                                 const QString &aControl /* = QString::null */,
     575                                 const QString &aUuid /* = QString::null */)
    576576{
    577577    if (!aCategory.isEmpty() && aCategory [0] != '#')
    578578    {
    579579        /* Assume it's a href from the Details HTML */
    580         vboxGlobal().openURL (aCategory);
     580        vboxGlobal().openURL(aCategory);
    581581        return;
    582582    }
     
    595595
    596596    UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() :
    597                        mVMModel->itemById (aUuid);
    598 
    599     AssertMsgReturnVoid (item, ("Item must be always selected here"));
     597                       mVMModel->itemById(aUuid);
     598
     599    AssertMsgReturnVoid(item, ("Item must be always selected here"));
    600600
    601601    // open a direct session to modify VM settings
    602602    QString id = item->id();
    603     CSession session = vboxGlobal().openSession (id);
     603    CSession session = vboxGlobal().openSession(id);
    604604    if (session.isNull())
    605605        return;
    606606
    607607    CMachine m = session.GetMachine();
    608     AssertMsgReturn (!m.isNull(), ("Machine must not be null"), (void) 0);
    609 
    610     UISettingsDialog *dlg = new UIVMSettingsDlg (this, m, strCategory, strControl);
     608    AssertMsgReturn(!m.isNull(), ("Machine must not be null"), (void) 0);
     609
     610    UISettingsDialog *dlg = new UIVMSettingsDlg(this, m, strCategory, strControl);
    611611    dlg->getFrom();
    612612
     
    619619        if (m.isOk())
    620620        {
    621             if (oldName.compare (m.GetName()))
     621            if (oldName.compare(m.GetName()))
    622622                mVMModel->sort();
    623623        }
    624624        else
    625             vboxProblem().cannotSaveMachineSettings (m);
     625            vboxProblem().cannotSaveMachineSettings(m);
    626626
    627627        /* To check use the result in future
    628          * vboxProblem().cannotApplyMachineSettings (m, res); */
     628         * vboxProblem().cannotApplyMachineSettings(m, res); */
    629629    }
    630630
     
    636636}
    637637
    638 void VBoxSelectorWnd::vmDelete (const QString &aUuid /* = QString::null */)
     638void VBoxSelectorWnd::vmDelete(const QString &aUuid /* = QString::null */)
    639639{
    640640    UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() :
    641                        mVMModel->itemById (aUuid);
    642 
    643     AssertMsgReturnVoid (item, ("Item must be always selected here"));
     641                       mVMModel->itemById(aUuid);
     642
     643    AssertMsgReturnVoid(item, ("Item must be always selected here"));
    644644
    645645    CMachine machine = item->machine();
     
    667667}
    668668
    669 void VBoxSelectorWnd::vmStart (const QString &aUuid /* = QString::null */)
    670 {
    671     QUuid uuid (aUuid);
     669void VBoxSelectorWnd::vmStart(const QString &aUuid /* = QString::null */)
     670{
     671    QUuid uuid(aUuid);
    672672    UIVMItem *item = uuid.isNull() ? mVMListView->selectedItem() :
    673                        mVMModel->itemById (aUuid);
    674 
    675     AssertMsgReturnVoid (item, ("Item must be always selected here"));
     673                       mVMModel->itemById(aUuid);
     674
     675    AssertMsgReturnVoid(item, ("Item must be always selected here"));
    676676
    677677    /* Are we called from the mVMListView's activated() signal? */
     
    684684    }
    685685
    686     AssertMsg (!vboxGlobal().isVMConsoleProcess(),
    687                ("Must NOT be a VM console process"));
     686    AssertMsg(!vboxGlobal().isVMConsoleProcess(),
     687              ("Must NOT be a VM console process"));
    688688
    689689    /* just switch to the VM window if it already exists */
     
    694694    }
    695695
    696     AssertMsg (   item->machineState() == KMachineState_PoweredOff
    697                || item->machineState() == KMachineState_Saved
    698                || item->machineState() == KMachineState_Teleported
    699                || item->machineState() == KMachineState_Aborted
    700                , ("Machine must be PoweredOff/Saved/Aborted (%d)", item->machineState()));
     696    AssertMsg(   item->machineState() == KMachineState_PoweredOff
     697              || item->machineState() == KMachineState_Saved
     698              || item->machineState() == KMachineState_Teleported
     699              || item->machineState() == KMachineState_Aborted
     700              , ("Machine must be PoweredOff/Saved/Aborted (%d)", item->machineState()));
    701701
    702702    QString id = item->id();
     
    704704    CSession session;
    705705
    706     session.createInstance (CLSID_Session);
     706    session.createInstance(CLSID_Session);
    707707    if (session.isNull())
    708708    {
    709         vboxProblem().cannotOpenSession (session);
     709        vboxProblem().cannotOpenSession(session);
    710710        return;
    711711    }
    712712
    713 #if defined (Q_OS_WIN32)
     713#if defined(Q_OS_WIN32)
    714714    /* allow the started VM process to make itself the foreground window */
    715     AllowSetForegroundWindow (ASFW_ANY);
     715    AllowSetForegroundWindow(ASFW_ANY);
    716716#endif
    717717
    718718    QString env;
    719 #if defined (Q_WS_X11)
     719#if defined(Q_WS_X11)
    720720    /* make sure the VM process will start on the same display as the Selector */
    721     const char *display = RTEnvGet ("DISPLAY");
     721    const char *display = RTEnvGet("DISPLAY");
    722722    if (display)
    723723        env.append(QString("DISPLAY=%1\n").arg(display));
    724     const char *xauth = RTEnvGet ("XAUTHORITY");
     724    const char *xauth = RTEnvGet("XAUTHORITY");
    725725    if (xauth)
    726726        env.append(QString("XAUTHORITY=%1\n").arg(xauth));
     
    744744}
    745745
    746 void VBoxSelectorWnd::vmDiscard (const QString &aUuid /* = QString::null */)
     746void VBoxSelectorWnd::vmDiscard(const QString &aUuid /* = QString::null */)
    747747{
    748748    UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() :
    749                        mVMModel->itemById (aUuid);
    750 
    751     AssertMsgReturnVoid (item, ("Item must be always selected here"));
    752 
    753     if (!vboxProblem().confirmDiscardSavedState (item->machine()))
     749                       mVMModel->itemById(aUuid);
     750
     751    AssertMsgReturnVoid(item, ("Item must be always selected here"));
     752
     753    if (!vboxProblem().confirmDiscardSavedState(item->machine()))
    754754        return;
    755755
     
    758758    CSession session;
    759759    CVirtualBox vbox = vboxGlobal().virtualBox();
    760     session.createInstance (CLSID_Session);
     760    session.createInstance(CLSID_Session);
    761761    if (session.isNull())
    762762    {
     
    770770    if (!vbox.isOk())
    771771    {
    772         vboxProblem().cannotOpenSession (vbox, item->machine());
     772        vboxProblem().cannotOpenSession(vbox, item->machine());
    773773        return;
    774774    }
     
    777777    console.DiscardSavedState(true /* fDeleteFile */);
    778778    if (!console.isOk())
    779         vboxProblem().cannotDiscardSavedState (console);
     779        vboxProblem().cannotDiscardSavedState(console);
    780780
    781781    session.UnlockMachine();
    782782}
    783783
    784 void VBoxSelectorWnd::vmPause (bool aPause, const QString &aUuid /* = QString::null */)
     784void VBoxSelectorWnd::vmPause(bool aPause, const QString &aUuid /* = QString::null */)
    785785{
    786786    UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() :
    787                        mVMModel->itemById (aUuid);
    788 
    789     AssertMsgReturnVoid (item, ("Item must be always selected here"));
    790 
    791     CSession session = vboxGlobal().openExistingSession (item->id());
     787                       mVMModel->itemById(aUuid);
     788
     789    AssertMsgReturnVoid(item, ("Item must be always selected here"));
     790
     791    CSession session = vboxGlobal().openExistingSession(item->id());
    792792    if (session.isNull())
    793793        return;
     
    806806    {
    807807        if (aPause)
    808             vboxProblem().cannotPauseMachine (console);
     808            vboxProblem().cannotPauseMachine(console);
    809809        else
    810             vboxProblem().cannotResumeMachine (console);
     810            vboxProblem().cannotResumeMachine(console);
    811811    }
    812812
     
    814814}
    815815
    816 void VBoxSelectorWnd::vmRefresh (const QString &aUuid /* = QString::null */)
     816void VBoxSelectorWnd::vmRefresh(const QString &aUuid /* = QString::null */)
    817817{
    818818    UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() :
    819                        mVMModel->itemById (aUuid);
    820 
    821     AssertMsgReturnVoid (item, ("Item must be always selected here"));
    822 
    823     refreshVMItem (item->id(),
     819                       mVMModel->itemById(aUuid);
     820
     821    AssertMsgReturnVoid(item, ("Item must be always selected here"));
     822
     823    refreshVMItem(item->id(),
    824824                   true /* aDetails */,
    825825                   true /* aSnapshot */,
     
    827827}
    828828
    829 void VBoxSelectorWnd::vmShowLogs (const QString &aUuid /* = QString::null */)
     829void VBoxSelectorWnd::vmShowLogs(const QString &aUuid /* = QString::null */)
    830830{
    831831    UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() :
    832                        mVMModel->itemById (aUuid);
    833 
    834     AssertMsgReturnVoid (item, ("Item must be always selected here"));
     832                       mVMModel->itemById(aUuid);
     833
     834    AssertMsgReturnVoid(item, ("Item must be always selected here"));
    835835
    836836    CMachine machine = item->machine();
    837     VBoxVMLogViewer::createLogViewer (this, machine);
     837    VBoxVMLogViewer::createLogViewer(this, machine);
    838838}
    839839
     
    844844    for (CMachineVector::ConstIterator m = vec.begin();
    845845         m != vec.end(); ++ m)
    846         mVMModel->addItem (new UIVMItem (*m));
     846        mVMModel->addItem(new UIVMItem(*m));
    847847    mVMModel->sort();
    848848
     
    860860                                    bool aDescription)
    861861{
    862     UIVMItem *item = mVMModel->itemById (aID);
     862    UIVMItem *item = mVMModel->itemById(aID);
    863863    if (item)
    864864    {
    865         mVMModel->refreshItem (item);
     865        mVMModel->refreshItem(item);
    866866        if (item && item->id() == aID)
    867             vmListViewCurrentChanged (aDetails, aSnapshots, aDescription);
    868     }
    869 }
    870 
    871 void VBoxSelectorWnd::showContextMenu (const QPoint &aPoint)
     867            vmListViewCurrentChanged(aDetails, aSnapshots, aDescription);
     868    }
     869}
     870
     871void VBoxSelectorWnd::showContextMenu(const QPoint &aPoint)
    872872{
    873873    /* Send a context menu request */
    874     const QModelIndex &index = mVMListView->indexAt (aPoint);
     874    const QModelIndex &index = mVMListView->indexAt(aPoint);
    875875    if (index.isValid())
    876         if (mVMListView->model()->data (index,
     876        if (mVMListView->model()->data(index,
    877877            UIVMItemModel::UIVMItemPtrRole).value <UIVMItem*>())
    878                 mVMCtxtMenu->exec (mVMListView->mapToGlobal (aPoint));
     878                mVMCtxtMenu->exec(mVMListView->mapToGlobal(aPoint));
    879879}
    880880
    881881#ifdef VBOX_GUI_WITH_SYSTRAY
    882882
    883 void VBoxSelectorWnd::trayIconActivated (QSystemTrayIcon::ActivationReason aReason)
     883void VBoxSelectorWnd::trayIconActivated(QSystemTrayIcon::ActivationReason aReason)
    884884{
    885885    switch (aReason)
     
    918918/////////////////////////////////////////////////////////////////////////////
    919919
    920 bool VBoxSelectorWnd::event (QEvent *e)
     920bool VBoxSelectorWnd::event(QEvent *e)
    921921{
    922922    switch (e->type())
     
    931931            if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized |
    932932                                  Qt::WindowFullScreen)) == 0)
    933                 mNormalGeo.setSize (re->size());
     933                mNormalGeo.setSize(re->size());
    934934            break;
    935935        }
     
    938938            if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized |
    939939                                  Qt::WindowFullScreen)) == 0)
    940                 mNormalGeo.moveTo (geometry().x(), geometry().y());
     940                mNormalGeo.moveTo(geometry().x(), geometry().y());
    941941            break;
    942942        }
     
    974974    }
    975975
    976     return QMainWindow::event (e);
    977 }
    978 
    979 void VBoxSelectorWnd::closeEvent (QCloseEvent *aEvent)
     976    return QMainWindow::event(e);
     977}
     978
     979void VBoxSelectorWnd::closeEvent(QCloseEvent *aEvent)
    980980{
    981981#ifdef VBOX_GUI_WITH_SYSTRAY
    982982    /* Needed for breaking out of the while() loop in main(). */
    983983    if (vboxGlobal().isTrayMenu())
    984         vboxGlobal().setTrayMenu (false);
     984        vboxGlobal().setTrayMenu(false);
    985985#endif
    986986
    987987    emit closing();
    988     QMainWindow::closeEvent (aEvent);
     988    QMainWindow::closeEvent(aEvent);
    989989}
    990990
    991991#if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)
    992 bool VBoxSelectorWnd::eventFilter (QObject *aObject, QEvent *aEvent)
     992bool VBoxSelectorWnd::eventFilter(QObject *aObject, QEvent *aEvent)
    993993{
    994994    if (!isActiveWindow())
    995         return QIWithRetranslateUI2<QMainWindow>::eventFilter (aObject, aEvent);
    996 
    997     if (qobject_cast<QWidget*> (aObject) &&
    998         qobject_cast<QWidget*> (aObject)->window() != this)
    999         return QIWithRetranslateUI2<QMainWindow>::eventFilter (aObject, aEvent);
     995        return QIWithRetranslateUI2<QMainWindow>::eventFilter(aObject, aEvent);
     996
     997    if (qobject_cast<QWidget*>(aObject) &&
     998        qobject_cast<QWidget*>(aObject)->window() != this)
     999        return QIWithRetranslateUI2<QMainWindow>::eventFilter(aObject, aEvent);
    10001000
    10011001    switch (aEvent->type())
     
    10121012            break;
    10131013    }
    1014     return QIWithRetranslateUI2<QMainWindow>::eventFilter (aObject, aEvent);
     1014    return QIWithRetranslateUI2<QMainWindow>::eventFilter(aObject, aEvent);
    10151015}
    10161016#endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402) */
     
    10231023{
    10241024#ifdef VBOX_OSE
    1025     QString title (tr ("VirtualBox OSE"));
     1025    QString title(tr("VirtualBox OSE"));
    10261026#else
    1027     QString title (VBOX_PRODUCT);
     1027    QString title(VBOX_PRODUCT);
    10281028#endif
    10291029
     
    10361036#endif
    10371037
    1038     setWindowTitle (title);
     1038    setWindowTitle(title);
    10391039
    10401040    /* ensure the details and screenshot view are updated */
    10411041    vmListViewCurrentChanged();
    10421042
    1043     mFileMediaMgrAction->setText (tr ("&Virtual Media Manager..."));
    1044     mFileMediaMgrAction->setShortcut (QKeySequence ("Ctrl+D"));
    1045     mFileMediaMgrAction->setStatusTip (tr ("Display the Virtual Media Manager dialog"));
    1046 
    1047     mFileApplianceImportAction->setText (tr ("&Import Appliance..."));
    1048     mFileApplianceImportAction->setShortcut (QKeySequence ("Ctrl+I"));
    1049     mFileApplianceImportAction->setStatusTip (tr ("Import an appliance into VirtualBox"));
    1050 
    1051     mFileApplianceExportAction->setText (tr ("&Export Appliance..."));
    1052     mFileApplianceExportAction->setShortcut (QKeySequence ("Ctrl+E"));
    1053     mFileApplianceExportAction->setStatusTip (tr ("Export one or more VirtualBox virtual machines as an appliance"));
     1043    mFileMediaMgrAction->setText(tr("&Virtual Media Manager..."));
     1044    mFileMediaMgrAction->setShortcut(QKeySequence("Ctrl+D"));
     1045    mFileMediaMgrAction->setStatusTip(tr("Display the Virtual Media Manager dialog"));
     1046
     1047    mFileApplianceImportAction->setText(tr("&Import Appliance..."));
     1048    mFileApplianceImportAction->setShortcut(QKeySequence("Ctrl+I"));
     1049    mFileApplianceImportAction->setStatusTip(tr("Import an appliance into VirtualBox"));
     1050
     1051    mFileApplianceExportAction->setText(tr("&Export Appliance..."));
     1052    mFileApplianceExportAction->setShortcut(QKeySequence("Ctrl+E"));
     1053    mFileApplianceExportAction->setStatusTip(tr("Export one or more VirtualBox virtual machines as an appliance"));
    10541054
    10551055#ifdef Q_WS_MAC
     
    10641064     * be really interesting to see how this plays on non-english systems...
    10651065     */
    1066     mFileSettingsAction->setText (tr ("&Preferences...", "global settings"));
     1066    mFileSettingsAction->setText(tr("&Preferences...", "global settings"));
    10671067#else
    10681068    /*
     
    10711071     * to figure out.
    10721072     */
    1073     mFileSettingsAction->setText (tr ("&Preferences...", "global settings"));
     1073    mFileSettingsAction->setText(tr("&Preferences...", "global settings"));
    10741074#endif
    1075     mFileSettingsAction->setShortcut (QKeySequence ("Ctrl+G"));
    1076     mFileSettingsAction->setStatusTip (tr ("Display the global settings dialog"));
    1077 
    1078     mFileExitAction->setText (tr ("E&xit"));
    1079     mFileExitAction->setShortcut (QKeySequence ("Ctrl+Q"));
    1080     mFileExitAction->setStatusTip (tr ("Close application"));
    1081 
    1082     mVmNewAction->setText (tr ("&New..."));
    1083     mVmNewAction->setShortcut (QKeySequence ("Ctrl+N"));
    1084     mVmNewAction->setStatusTip (tr ("Create a new virtual machine"));
    1085     mVmNewAction->setToolTip (mVmNewAction->text().remove ('&').remove ('.') +
    1086         QString (" (%1)").arg (mVmNewAction->shortcut().toString()));
    1087 
    1088     mVmConfigAction->setText (tr ("&Settings..."));
    1089     mVmConfigAction->setShortcut (QKeySequence ("Ctrl+S"));
    1090     mVmConfigAction->setStatusTip (tr ("Configure the selected virtual machine"));
    1091     mVmConfigAction->setToolTip (mVmConfigAction->text().remove ('&').remove ('.') +
    1092         QString (" (%1)").arg (mVmConfigAction->shortcut().toString()));
    1093 
    1094     mVmDeleteAction->setText (tr ("&Delete"));
    1095     mVmDeleteAction->setShortcut (QKeySequence ("Ctrl+R"));
    1096     mVmDeleteAction->setStatusTip (tr ("Delete the selected virtual machine"));
     1075    mFileSettingsAction->setShortcut(QKeySequence("Ctrl+G"));
     1076    mFileSettingsAction->setStatusTip(tr("Display the global settings dialog"));
     1077
     1078    mFileExitAction->setText(tr("E&xit"));
     1079    mFileExitAction->setShortcut(QKeySequence("Ctrl+Q"));
     1080    mFileExitAction->setStatusTip(tr("Close application"));
     1081
     1082    mVmNewAction->setText(tr("&New..."));
     1083    mVmNewAction->setShortcut(QKeySequence("Ctrl+N"));
     1084    mVmNewAction->setStatusTip(tr("Create a new virtual machine"));
     1085    mVmNewAction->setToolTip(mVmNewAction->text().remove('&').remove('.') +
     1086        QString("(%1)").arg(mVmNewAction->shortcut().toString()));
     1087
     1088    mVmConfigAction->setText(tr("&Settings..."));
     1089    mVmConfigAction->setShortcut(QKeySequence("Ctrl+S"));
     1090    mVmConfigAction->setStatusTip(tr("Configure the selected virtual machine"));
     1091    mVmConfigAction->setToolTip(mVmConfigAction->text().remove('&').remove('.') +
     1092        QString("(%1)").arg(mVmConfigAction->shortcut().toString()));
     1093
     1094    mVmDeleteAction->setText(tr("&Delete"));
     1095    mVmDeleteAction->setShortcut(QKeySequence("Ctrl+R"));
     1096    mVmDeleteAction->setStatusTip(tr("Delete the selected virtual machine"));
    10971097
    10981098    /* Note: mVmStartAction text is set up in vmListViewCurrentChanged() */
    10991099
    1100     mVmDiscardAction->setText (tr ("D&iscard"));
    1101     mVmDiscardAction->setStatusTip (
    1102         tr ("Discard the saved state of the selected virtual machine"));
    1103 
    1104     mVmPauseAction->setText (tr ("&Pause"));
    1105     mVmPauseAction->setStatusTip (
    1106         tr ("Suspend the execution of the virtual machine"));
    1107 
    1108     mVmRefreshAction->setText (tr ("Re&fresh"));
    1109     mVmRefreshAction->setStatusTip (
    1110         tr ("Refresh the accessibility state of the selected virtual machine"));
    1111 
    1112     mVmShowLogsAction->setText (tr ("Show &Log..."));
    1113     mVmShowLogsAction->setIconText (tr ("Log", "icon text"));
    1114     mVmShowLogsAction->setShortcut (QKeySequence ("Ctrl+L"));
    1115     mVmShowLogsAction->setStatusTip (
    1116         tr ("Show the log files of the selected virtual machine"));
     1100    mVmDiscardAction->setText(tr("D&iscard"));
     1101    mVmDiscardAction->setStatusTip(
     1102        tr("Discard the saved state of the selected virtual machine"));
     1103
     1104    mVmPauseAction->setText(tr("&Pause"));
     1105    mVmPauseAction->setStatusTip(
     1106        tr("Suspend the execution of the virtual machine"));
     1107
     1108    mVmRefreshAction->setText(tr("Re&fresh"));
     1109    mVmRefreshAction->setStatusTip(
     1110        tr("Refresh the accessibility state of the selected virtual machine"));
     1111
     1112    mVmShowLogsAction->setText(tr("Show &Log..."));
     1113    mVmShowLogsAction->setIconText(tr("Log", "icon text"));
     1114    mVmShowLogsAction->setShortcut(QKeySequence("Ctrl+L"));
     1115    mVmShowLogsAction->setStatusTip(
     1116        tr("Show the log files of the selected virtual machine"));
    11171117
    11181118    mHelpActions.retranslateUi();
    11191119
    11201120#ifdef Q_WS_MAC
    1121     mFileMenu->setTitle (tr("&File", "Mac OS X version"));
     1121    mFileMenu->setTitle(tr("&File", "Mac OS X version"));
    11221122#else /* Q_WS_MAC */
    1123     mFileMenu->setTitle (tr("&File", "Non Mac OS X version"));
     1123    mFileMenu->setTitle(tr("&File", "Non Mac OS X version"));
    11241124#endif /* !Q_WS_MAC */
    1125     mVMMenu->setTitle (tr ("&Machine"));
    1126     mHelpMenu->setTitle (tr ("&Help"));
     1125    mVMMenu->setTitle(tr("&Machine"));
     1126    mHelpMenu->setTitle(tr("&Help"));
    11271127
    11281128#ifdef VBOX_GUI_WITH_SYSTRAY
     
    11511151/////////////////////////////////////////////////////////////////////////////
    11521152
    1153 void VBoxSelectorWnd::vmListViewCurrentChanged (bool aRefreshDetails,
    1154                                                 bool aRefreshSnapshots,
    1155                                                 bool aRefreshDescription)
     1153void VBoxSelectorWnd::vmListViewCurrentChanged(bool aRefreshDetails,
     1154                                               bool aRefreshSnapshots,
     1155                                               bool aRefreshDescription)
    11561156{
    11571157    UIVMItem *item = mVMListView->selectedItem();
     
    11911191           )
    11921192        {
    1193             mVmStartAction->setText (tr ("S&tart"));
     1193            mVmStartAction->setText(tr("S&tart"));
    11941194#ifdef QT_MAC_USE_COCOA
    11951195            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    11991199            mVMToolBar->updateLayout();
    12001200#endif /* QT_MAC_USE_COCOA */
    1201             mVmStartAction->setStatusTip (
    1202                 tr ("Start the selected virtual machine"));
    1203 
    1204             mVmStartAction->setEnabled (!running);
     1201            mVmStartAction->setStatusTip(
     1202                tr("Start the selected virtual machine"));
     1203
     1204            mVmStartAction->setEnabled(!running);
    12051205        }
    12061206        else
    12071207        {
    1208             mVmStartAction->setText (tr ("S&how"));
     1208            mVmStartAction->setText(tr("S&how"));
    12091209#ifdef QT_MAC_USE_COCOA
    12101210            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    12141214            mVMToolBar->updateLayout();
    12151215#endif /* QT_MAC_USE_COCOA */
    1216             mVmStartAction->setStatusTip (
    1217                 tr ("Switch to the window of the selected virtual machine"));
    1218 
    1219             mVmStartAction->setEnabled (item->canSwitchTo());
     1216            mVmStartAction->setStatusTip(
     1217                tr("Switch to the window of the selected virtual machine"));
     1218
     1219            mVmStartAction->setEnabled(item->canSwitchTo());
    12201220        }
    12211221
     
    12251225           )
    12261226        {
    1227             mVmPauseAction->setText (tr ("R&esume"));
    1228             mVmPauseAction->setShortcut (QKeySequence ("Ctrl+P"));
    1229             mVmPauseAction->setStatusTip (
    1230                 tr ("Resume the execution of the virtual machine"));
    1231             mVmPauseAction->blockSignals (true);
    1232             mVmPauseAction->setChecked (true);
    1233             mVmPauseAction->blockSignals (false);
     1227            mVmPauseAction->setText(tr("R&esume"));
     1228            mVmPauseAction->setShortcut(QKeySequence("Ctrl+P"));
     1229            mVmPauseAction->setStatusTip(
     1230                tr("Resume the execution of the virtual machine"));
     1231            mVmPauseAction->blockSignals(true);
     1232            mVmPauseAction->setChecked(true);
     1233            mVmPauseAction->blockSignals(false);
    12341234        }
    12351235        else
    12361236        {
    1237             mVmPauseAction->setText (tr ("&Pause"));
    1238             mVmPauseAction->setShortcut (QKeySequence ("Ctrl+P"));
    1239             mVmPauseAction->setStatusTip (
    1240                 tr ("Suspend the execution of the virtual machine"));
    1241             mVmPauseAction->blockSignals (true);
    1242             mVmPauseAction->setChecked (false);
    1243             mVmPauseAction->blockSignals (false);
     1237            mVmPauseAction->setText(tr("&Pause"));
     1238            mVmPauseAction->setShortcut(QKeySequence("Ctrl+P"));
     1239            mVmPauseAction->setStatusTip(
     1240                tr("Suspend the execution of the virtual machine"));
     1241            mVmPauseAction->blockSignals(true);
     1242            mVmPauseAction->setChecked(false);
     1243            mVmPauseAction->blockSignals(false);
    12441244        }
    12451245
    12461246        /* disable Refresh for accessible machines */
    1247         mVmRefreshAction->setEnabled (false);
     1247        mVmRefreshAction->setEnabled(false);
    12481248
    12491249        /* enable the show log item for the selected vm */
    1250         mVmShowLogsAction->setEnabled (true);
     1250        mVmShowLogsAction->setEnabled(true);
    12511251    }
    12521252    else
     
    12811281                   "or visit "
    12821282                   "<a href=http://www.virtualbox.org>www.virtualbox.org</a> "
    1283                    "for the latest information and news.</p>").arg (QKeySequence (QKeySequence::HelpContents).toString (QKeySequence::NativeText)));
     1283                   "for the latest information and news.</p>").arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
    12841284            mVmRefreshAction->setEnabled(false);
    12851285        }
     
    12901290
    12911291        /* disable modify actions */
    1292         mVmConfigAction->setEnabled (false);
    1293         mVmDeleteAction->setEnabled (item != NULL);
    1294         mVmDiscardAction->setEnabled (false);
    1295         mVmPauseAction->setEnabled (false);
     1292        mVmConfigAction->setEnabled(false);
     1293        mVmDeleteAction->setEnabled(item != NULL);
     1294        mVmDiscardAction->setEnabled(false);
     1295        mVmPauseAction->setEnabled(false);
    12961296
    12971297        /* change the Start button text accordingly */
    1298         mVmStartAction->setText (tr ("S&tart"));
    1299         mVmStartAction->setStatusTip (
    1300             tr ("Start the selected virtual machine"));
    1301         mVmStartAction->setEnabled (false);
     1298        mVmStartAction->setText(tr("S&tart"));
     1299        mVmStartAction->setStatusTip(
     1300            tr("Start the selected virtual machine"));
     1301        mVmStartAction->setEnabled(false);
    13021302
    13031303        /* disable the show log item for the selected vm */
    1304         mVmShowLogsAction->setEnabled (false);
     1304        mVmShowLogsAction->setEnabled(false);
    13051305    }
    13061306}
     
    13091309{
    13101310    /* refresh the current details to pick up hard disk sizes */
    1311     vmListViewCurrentChanged (true /* aRefreshDetails */);
    1312 }
    1313 
    1314 void VBoxSelectorWnd::mediumEnumFinished (const VBoxMediaList &list)
     1311    vmListViewCurrentChanged(true /* aRefreshDetails */);
     1312}
     1313
     1314void VBoxSelectorWnd::mediumEnumFinished(const VBoxMediaList &list)
    13151315{
    13161316    /* refresh the current details to pick up hard disk sizes */
    1317     vmListViewCurrentChanged (true /* aRefreshDetails */);
     1317    vmListViewCurrentChanged(true /* aRefreshDetails */);
    13181318
    13191319    /* we warn about inaccessible media only once (after media emumeration
     
    13371337        /* ignore the signal if a VBoxMediaManagerDlg window is active */
    13381338        if (qApp->activeWindow() &&
    1339             !strcmp (qApp->activeWindow()->metaObject()->className(), "VBoxMediaManagerDlg"))
     1339            !strcmp(qApp->activeWindow()->metaObject()->className(), "VBoxMediaManagerDlg"))
    13401340            break;
    13411341
     
    13501350            /* Show the VDM dialog but don't refresh once more after a
    13511351             * just-finished refresh */
    1352             VBoxMediaManagerDlg::showModeless (this, false /* aRefresh */);
     1352            VBoxMediaManagerDlg::showModeless(this, false /* aRefresh */);
    13531353        }
    13541354    }
     
    13711371#endif
    13721372
    1373     refreshVMItem (strId,
    1374                    false /* aDetails */,
    1375                    false /* aSnapshots */,
    1376                    false /* aDescription */);
     1373    refreshVMItem(strId,
     1374                  false /* aDetails */,
     1375                  false /* aSnapshots */,
     1376                  false /* aDescription */);
    13771377
    13781378    /* simulate a state change signal */
     
    13821382void VBoxSelectorWnd::machineDataChanged(QString strId)
    13831383{
    1384     refreshVMItem (strId,
    1385                    true  /* aDetails */,
    1386                    false /* aSnapshots */,
    1387                    true  /* aDescription */);
     1384    refreshVMItem(strId,
     1385                  true  /* aDetails */,
     1386                  false /* aSnapshots */,
     1387                  true  /* aDescription */);
    13881388}
    13891389
     
    13931393    {
    13941394        CVirtualBox vbox = vboxGlobal().virtualBox();
    1395         CMachine m = vbox.GetMachine (strId);
     1395        CMachine m = vbox.GetMachine(strId);
    13961396        if (!m.isNull())
    13971397        {
    1398             mVMModel->addItem (new UIVMItem (m));
     1398            mVMModel->addItem(new UIVMItem(m));
    13991399            mVMModel->sort();
    14001400            /* Make sure the description, ... pages are properly updated.
     
    14091409    else
    14101410    {
    1411         UIVMItem *item = mVMModel->itemById (strId);
     1411        UIVMItem *item = mVMModel->itemById(strId);
    14121412        if (item)
    14131413        {
    1414             int row = mVMModel->rowById (item->id());
    1415             mVMModel->removeItem (item);
     1414            int row = mVMModel->rowById(item->id());
     1415            mVMModel->removeItem(item);
    14161416            delete item;
    1417             mVMListView->ensureSomeRowSelected (row);
     1417            mVMListView->ensureSomeRowSelected(row);
    14181418        }
    14191419
     
    14251425void VBoxSelectorWnd::sessionStateChanged(QString strId, KSessionState /* state */)
    14261426{
    1427     refreshVMItem (strId,
    1428                    true  /* aDetails */,
    1429                    false /* aSnapshots */,
    1430                    false /* aDescription */);
     1427    refreshVMItem(strId,
     1428                  true  /* aDetails */,
     1429                  false /* aSnapshots */,
     1430                  false /* aDescription */);
    14311431
    14321432    /* simulate a state change signal */
     
    14361436void VBoxSelectorWnd::snapshotChanged(QString strId, QString /* strSnapshotId */)
    14371437{
    1438     refreshVMItem (strId,
    1439                    false /* aDetails */,
    1440                    true  /* aSnapshot */,
    1441                    false /* aDescription */);
     1438    refreshVMItem(strId,
     1439                  false /* aDetails */,
     1440                  true  /* aSnapshot */,
     1441                  false /* aDescription */);
    14421442}
    14431443
     
    14521452void VBoxSelectorWnd::trayIconCanShow(bool fEnabled)
    14531453{
    1454     emit trayIconChanged(VBoxChangeTrayIconEvent (vboxGlobal().settings().trayIconEnabled()));
     1454    emit trayIconChanged(VBoxChangeTrayIconEvent(vboxGlobal().settings().trayIconEnabled()));
    14551455}
    14561456
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.h

    r32758 r32759  
    5050public:
    5151
    52     VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
    53                      QWidget* aParent = 0,
    54                      Qt::WindowFlags aFlags = Qt::Window);
     52    VBoxSelectorWnd(VBoxSelectorWnd **aSelf,
     53                    QWidget* aParent = 0,
     54                    Qt::WindowFlags aFlags = Qt::Window);
    5555    virtual ~VBoxSelectorWnd();
    5656
     
    6868
    6969    void vmNew();
    70     void vmSettings (const QString &aCategory = QString::null,
    71                      const QString &aControl = QString::null,
    72                      const QString & = QString::null);
    73     void vmDelete (const QString & = QString::null);
    74     void vmStart (const QString & = QString::null);
    75     void vmDiscard (const QString & = QString::null);
    76     void vmPause (bool, const QString & = QString::null);
    77     void vmRefresh (const QString & = QString::null);
    78     void vmShowLogs (const QString & = QString::null);
     70    void vmSettings(const QString &aCategory = QString::null, const QString &aControl = QString::null, const QString & = QString::null);
     71    void vmDelete(const QString & = QString::null);
     72    void vmStart(const QString & = QString::null);
     73    void vmDiscard(const QString & = QString::null);
     74    void vmPause(bool, const QString & = QString::null);
     75    void vmRefresh(const QString & = QString::null);
     76    void vmShowLogs(const QString & = QString::null);
    7977
    8078    void refreshVMList();
    81     void refreshVMItem (const QString &aID, bool aDetails,
    82                                           bool aSnapshots,
    83                                           bool aDescription);
     79    void refreshVMItem(const QString &aID, bool aDetails, bool aSnapshots, bool aDescription);
    8480
    85     void showContextMenu (const QPoint &aPoint);
     81    void showContextMenu(const QPoint &aPoint);
    8682
    8783#ifdef VBOX_GUI_WITH_SYSTRAY
    88     void trayIconActivated (QSystemTrayIcon::ActivationReason aReason);
     84    void trayIconActivated(QSystemTrayIcon::ActivationReason aReason);
    8985    void showWindow();
    9086#endif
     
    10298
    10399    /* Events */
    104     bool event (QEvent *aEvent);
    105     void closeEvent (QCloseEvent *aEvent);
     100    bool event(QEvent *aEvent);
     101    void closeEvent(QCloseEvent *aEvent);
    106102//#if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)
    107 //    bool eventFilter (QObject *aObject, QEvent *aEvent);
     103//    bool eventFilter(QObject *aObject, QEvent *aEvent);
    108104//#endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402) */
    109105
     
    112108private slots:
    113109
    114     void vmListViewCurrentChanged (bool aRefreshDetails = true,
    115                                    bool aRefreshSnapshots = true,
    116                                    bool aRefreshDescription = true);
    117 
     110    void vmListViewCurrentChanged(bool aRefreshDetails = true, bool aRefreshSnapshots = true, bool aRefreshDescription = true);
    118111    void mediumEnumStarted();
    119     void mediumEnumFinished (const VBoxMediaList &);
     112    void mediumEnumFinished(const VBoxMediaList &);
    120113
    121114    /* VirtualBox callback events we're interested in */
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