VirtualBox

Changeset 23562 in vbox


Ignore:
Timestamp:
Oct 5, 2009 1:55:22 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53210
Message:

FE/Qt4: VBoxConsoleWnd & VBoxVMSettingsNetwork: Few coding-style fixes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r23223 r23562  
    3030#include "VBoxProblemReporter.h"
    3131#include "VBoxHelpActions.h"
    32 #include "VBoxVMSettingsNetwork.h"
    3332
    3433/* Qt includes */
     
    6463
    6564class VBoxMiniToolBar;
    66 
    67 class VBoxVMSettingsNetworkPage;
    6865
    6966/* We want to make the first action highlighted but not
     
    409406};
    410407
    411 
    412 class VBoxVMSettingsSF;
    413 class VBoxSFDialog : public QIWithRetranslateUI<QDialog>
     408class VBoxSettingsPage;
     409class VBoxNetworkDialog : public QIWithRetranslateUI <QDialog>
    414410{
    415411    Q_OBJECT;
     
    417413public:
    418414
    419     VBoxSFDialog (QWidget*, CSession&);
     415    VBoxNetworkDialog (QWidget *aParent, CSession &aSession);
    420416
    421417protected:
     
    429425protected:
    430426
    431     void showEvent (QShowEvent*);
     427    void showEvent (QShowEvent *aEvent);
     428
     429private:
     430
     431    VBoxSettingsPage *mSettings;
     432    CSession &mSession;
     433};
     434
     435class VBoxVMSettingsSF;
     436class VBoxSFDialog : public QIWithRetranslateUI <QDialog>
     437{
     438    Q_OBJECT;
     439
     440public:
     441
     442    VBoxSFDialog (QWidget *aParent, CSession &aSession);
     443
     444protected:
     445
     446    void retranslateUi();
     447
     448protected slots:
     449
     450    virtual void accept();
     451
     452protected:
     453
     454    void showEvent (QShowEvent *aEvent);
    432455
    433456private:
     
    437460};
    438461
    439 
    440 class VBoxVMSettingsNetworkDialogPage : public VBoxVMSettingsNetworkPage
    441 {
    442     Q_OBJECT;
    443 
    444 public:
    445 
    446     VBoxVMSettingsNetworkDialogPage() : VBoxVMSettingsNetworkPage(true) {}
    447 
    448     void getFrom (const CMachine &aMachine) { VBoxVMSettingsNetworkPage::getFrom(aMachine); }
    449     void putBackTo() { VBoxVMSettingsNetworkPage::putBackTo(); }
    450 
    451 };
    452 
    453 class VBoxNetworkDialog : public QIWithRetranslateUI<QDialog>
    454 {
    455     Q_OBJECT;
    456 
    457 public:
    458 
    459     VBoxNetworkDialog (QWidget*, CSession&);
    460 
    461 protected:
    462 
    463     void retranslateUi();
    464 
    465 protected slots:
    466 
    467     virtual void accept();
    468 
    469 protected:
    470 
    471     void showEvent (QShowEvent*);
    472 
    473 private:
    474 
    475     VBoxVMSettingsNetworkDialogPage *mSettings;
    476     CSession &mSession;
    477 };
    478 
    479 
    480462#endif // __VBoxConsoleWnd_h__
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsNetwork.h

    r23054 r23562  
    8888public:
    8989
    90     VBoxVMSettingsNetworkPage(bool aDisableStaticControls = false);
     90    VBoxVMSettingsNetworkPage (bool aDisableStaticControls = false);
    9191
    9292    QStringList brgList (bool aRefresh = false);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r23516 r23562  
    3232#include "VBoxTakeSnapshotDlg.h"
    3333#include "VBoxVMFirstRunWzd.h"
     34#include "VBoxVMSettingsNetwork.h"
    3435#include "VBoxVMSettingsSF.h"
    3536#include "VBoxVMInformationDlg.h"
     
    38003801#endif /* VBOX_WITH_DEBUGGER_GUI */
    38013802
     3803VBoxNetworkDialog::VBoxNetworkDialog (QWidget *aParent, CSession &aSession)
     3804    : QIWithRetranslateUI <QDialog> (aParent)
     3805    , mSettings (0)
     3806    , mSession (aSession)
     3807{
     3808    setModal (true);
     3809    /* Setup Dialog's options */
     3810    setWindowIcon (QIcon (":/nw_16px.png"));
     3811    setSizeGripEnabled (true);
     3812
     3813    /* Setup main dialog's layout */
     3814    QVBoxLayout *mainLayout = new QVBoxLayout (this);
     3815    VBoxGlobal::setLayoutMargin (mainLayout, 10);
     3816    mainLayout->setSpacing (10);
     3817
     3818    /* Setup settings layout */
     3819    mSettings = new VBoxVMSettingsNetworkPage (true);
     3820    mSettings->setOrderAfter (this);
     3821    VBoxGlobal::setLayoutMargin (mSettings->layout(), 0);
     3822    mSettings->getFrom (aSession.GetMachine());
     3823    mainLayout->addWidget (mSettings);
     3824
     3825    /* Setup button's layout */
     3826    QIDialogButtonBox *buttonBox = new QIDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
     3827
     3828    connect (buttonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog()));
     3829    connect (buttonBox, SIGNAL (accepted()), this, SLOT (accept()));
     3830    connect (buttonBox, SIGNAL (rejected()), this, SLOT (reject()));
     3831    mainLayout->addWidget (buttonBox);
     3832
     3833    retranslateUi();
     3834}
     3835
     3836void VBoxNetworkDialog::retranslateUi()
     3837{
     3838    setWindowTitle (tr ("Network Adapters"));
     3839}
     3840
     3841void VBoxNetworkDialog::accept()
     3842{
     3843    mSettings->putBackTo();
     3844    CMachine machine = mSession.GetMachine();
     3845    machine.SaveSettings();
     3846    if (!machine.isOk())
     3847        vboxProblem().cannotSaveMachineSettings (machine);
     3848    QDialog::accept();
     3849}
     3850
     3851void VBoxNetworkDialog::showEvent (QShowEvent *aEvent)
     3852{
     3853    resize (450, 300);
     3854    VBoxGlobal::centerWidget (this, parentWidget());
     3855    setMinimumWidth (400);
     3856    QDialog::showEvent (aEvent);
     3857}
     3858
    38023859VBoxSFDialog::VBoxSFDialog (QWidget *aParent, CSession &aSession)
    3803     : QIWithRetranslateUI<QDialog> (aParent)
     3860    : QIWithRetranslateUI <QDialog> (aParent)
    38043861    , mSettings (0)
    38053862    , mSession (aSession)
     
    38573914}
    38583915
    3859 
    3860 VBoxNetworkDialog::VBoxNetworkDialog (QWidget *aParent, CSession &aSession)
    3861     : QIWithRetranslateUI<QDialog> (aParent)
    3862     , mSettings (0)
    3863     , mSession (aSession)
    3864 {
    3865     setModal (true);
    3866     /* Setup Dialog's options */
    3867     setWindowIcon (QIcon (":/nw_16px.png"));
    3868     setSizeGripEnabled (true);
    3869 
    3870     /* Setup main dialog's layout */
    3871     QVBoxLayout *mainLayout = new QVBoxLayout (this);
    3872     VBoxGlobal::setLayoutMargin (mainLayout, 10);
    3873     mainLayout->setSpacing (10);
    3874 
    3875     /* Setup settings layout */
    3876     mSettings = new VBoxVMSettingsNetworkDialogPage();
    3877     mSettings->setOrderAfter (this);
    3878     VBoxGlobal::setLayoutMargin (mSettings->layout(), 0);
    3879     mSettings->getFrom (aSession.GetMachine());
    3880     mainLayout->addWidget (mSettings);
    3881 
    3882     /* Setup button's layout */
    3883     QIDialogButtonBox *buttonBox = new QIDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
    3884 
    3885     connect (buttonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog()));
    3886     connect (buttonBox, SIGNAL (accepted()), this, SLOT (accept()));
    3887     connect (buttonBox, SIGNAL (rejected()), this, SLOT (reject()));
    3888     mainLayout->addWidget (buttonBox);
    3889 
    3890     retranslateUi();
    3891 }
    3892 
    3893 void VBoxNetworkDialog::retranslateUi()
    3894 {
    3895     setWindowTitle (tr ("Network Adapters"));
    3896 }
    3897 
    3898 void VBoxNetworkDialog::accept()
    3899 {
    3900     mSettings->putBackTo();
    3901     CMachine machine = mSession.GetMachine();
    3902     machine.SaveSettings();
    3903     if (!machine.isOk())
    3904         vboxProblem().cannotSaveMachineSettings (machine);
    3905     QDialog::accept();
    3906 }
    3907 
    3908 void VBoxNetworkDialog::showEvent (QShowEvent *aEvent)
    3909 {
    3910     resize (450, 300);
    3911     VBoxGlobal::centerWidget (this, parentWidget());
    3912     setMinimumWidth (400);
    3913     QDialog::showEvent (aEvent);
    3914 }
    3915 
    3916 
    39173916#include "VBoxConsoleWnd.moc"
Note: See TracChangeset for help on using the changeset viewer.

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