VirtualBox

Changeset 98722 in vbox for trunk/src


Ignore:
Timestamp:
Feb 24, 2023 1:24:27 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156022
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking CMachine wrapper usage step-by-step; Log and OS type stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98700 r98722  
    233233}
    234234
     235QString UIMachine::osTypeId() const
     236{
     237    return uisession()->osTypeId();
     238}
     239
    235240void UIMachine::updateStateAdditionsActions()
    236241{
     
    718723{
    719724    return uisession()->acquireWhetherLogEnabled(fEnabled);
     725}
     726
     727bool UIMachine::acquireLogFolder(QString &strFolder)
     728{
     729    return uisession()->acquireLogFolder(strFolder);
    720730}
    721731
     
    12091219    /* Use the OS type icon if user one was not set: */
    12101220    if (icon.isNull())
    1211         icon = generalIconPool().guestOSTypeIcon(uisession()->machine().GetOSTypeId());
     1221        icon = generalIconPool().guestOSTypeIcon(osTypeId());
    12121222    /* Use the default icon if nothing else works: */
    12131223    if (icon.isNull())
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98700 r98722  
    185185        /** Returns the machine name. */
    186186        QString machineName() const;
     187        /** Returns the OS type id. */
     188        QString osTypeId() const;
    187189    /** @} */
    188190
     
    516518        bool acquireWhetherLogEnabled(bool &fEnabled);
    517519
     520        /** Acquire log folder. */
     521        bool acquireLogFolder(QString &strFolder);
     522
    518523        /** Acquires effective CPU @a uLoad. */
    519524        bool acquireEffectiveCPULoad(ulong &uLoad);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98682 r98722  
    415415            uimachine()->setGuestResizeIgnored(true);
    416416            /* Get log-folder: */
    417             QString strLogFolder = machine().GetLogFolder();
     417            QString strLogFolder;
     418            uimachine()->acquireLogFolder(strLogFolder);
    418419            /* Take the screenshot for debugging purposes: */
    419420            takeScreenshot(strLogFolder + "/VBox.png", "png");
     
    12411242    QPixmap pixmap = generalIconPool().userMachinePixmap(machine(), QSize(42, 42));
    12421243    if (pixmap.isNull())
    1243         pixmap = generalIconPool().guestOSTypePixmap(machine().GetOSTypeId(), QSize(42, 42));
     1244        pixmap = generalIconPool().guestOSTypePixmap(uimachine()->osTypeId(), QSize(42, 42));
    12441245    m_pDockIconPreview = new UIDockIconPreview(uimachine(), pixmap);
    12451246
     
    16581659void UIMachineLogic::sltShowFileManagerDialog()
    16591660{
    1660     if (machine().isNull() || !activeMachineWindow())
     1661    if (!activeMachineWindow())
    16611662        return;
    16621663
     
    17001701void UIMachineLogic::sltShowLogDialog()
    17011702{
    1702     if (machine().isNull() || !activeMachineWindow())
     1703    if (!activeMachineWindow())
    17031704        return;
    17041705
     
    20342035void UIMachineLogic::sltShowSoftKeyboard()
    20352036{
    2036     if (machine().isNull() || !activeMachineWindow())
     2037    if (!activeMachineWindow())
    20372038        return;
    20382039
     
    24562457void UIMachineLogic::sltShowGuestControlConsoleDialog()
    24572458{
    2458     if (machine().isNull() || !activeMachineWindow())
     2459    if (!activeMachineWindow())
    24592460        return;
    24602461
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98700 r98722  
    645645
    646646    /* Auto GA update is currently for Windows and Linux guests only */
    647     const CGuestOSType osType = uiCommon().vmGuestOSType(machine().GetOSTypeId());
     647    const CGuestOSType osType = uiCommon().vmGuestOSType(uimachine()->osTypeId());
    648648    if (!osType.isOk())
    649649        return false;
     
    10701070    else
    10711071        fEnabled = fLogEnabled == TRUE;
     1072    return fSuccess;
     1073}
     1074
     1075bool UISession::acquireLogFolder(QString &strFolder)
     1076{
     1077    CMachine comMachine = machine();
     1078    const QString strLogFolder = comMachine.GetLogFolder();
     1079    const bool fSuccess = comMachine.isOk();
     1080    if (!fSuccess)
     1081        UINotificationMessage::cannotAcquireMachineParameter(comMachine);
     1082    else
     1083        strFolder = strLogFolder;
    10721084    return fSuccess;
    10731085}
     
    14691481        return false;
    14701482
    1471     /* Update machine-name: */
     1483    /* Update machine attributes: */
    14721484    m_strMachineName = machine().GetName();
     1485    m_strOSTypeId = machine().GetOSTypeId();
    14731486
    14741487    /* Update machine-state: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98700 r98722  
    190190        /** Returns the machine name. */
    191191        QString machineName() const { return m_strMachineName; }
     192        /** Returns the OS type id. */
     193        QString osTypeId() const { return m_strOSTypeId; }
    192194
    193195        /** Returns main machine-widget id. */
     
    424426        bool acquireWhetherLogEnabled(bool &fEnabled);
    425427
     428        /** Acquire log folder. */
     429        bool acquireLogFolder(QString &strFolder);
     430
    426431        /** Acquires VM's execution engine @a enmType. */
    427432        bool acquireExecutionEngineType(KVMExecutionEngine &enmType);
     
    575580        /** Holds the machine name. */
    576581        QString  m_strMachineName;
     582        /** Holds the OS type id. */
     583        QString  m_strOSTypeId;
    577584    /** @} */
    578585
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