VirtualBox

Changeset 101724 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 3, 2023 8:43:56 AM (13 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10543: UIAdvancedSettingsDialogMachine & UIMachineSettingsGeneral: Notifying UIAdvancedSettingsDialogMachine about platform architecture changes; Passing platform architecture through whole the UIEditor hierarchy using optional arch flag.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.cpp

    r101607 r101724  
    622622}
    623623
     624void UIAdvancedSettingsDialogMachine::sltHandlePlatformArchitectureChanged(KPlatformArchitecture enmArch)
     625{
     626    /* Update optional flags accordingly: */
     627    QMap<QString, QVariant> optFlags = optionalFlags();
     628    /* For x86 we no need the flag at all, removing if present: */
     629    if (enmArch == KPlatformArchitecture_x86)
     630        optFlags.remove("arch");
     631    /* For ARM (and potentially rest) we need the flag: */
     632    else if (enmArch == KPlatformArchitecture_ARM)
     633        optFlags["arch"] = QVariant::fromValue(enmArch);
     634    setOptionalFlags(optFlags);
     635}
     636
    624637void UIAdvancedSettingsDialogMachine::prepare()
    625638{
     
    660673                case MachineSettingsPageType_General:
    661674                {
    662                     pSettingsPage = new UIMachineSettingsGeneral;
     675                    UIMachineSettingsGeneral *pSettingsPageGeneral = new UIMachineSettingsGeneral;
    663676                    addItem(":/machine_32px.png", ":/machine_24px.png", ":/machine_16px.png",
    664                             iPageIndex, "#general", pSettingsPage);
     677                            iPageIndex, "#general", pSettingsPageGeneral);
    665678                    addPageHelpKeyword(iPageIndex, "generalsettings");
     679                    connect(pSettingsPageGeneral, &UIMachineSettingsGeneral::sigPlatformArchitectureChanged,
     680                            this, &UIAdvancedSettingsDialogMachine::sltHandlePlatformArchitectureChanged);
    666681                    break;
    667682                }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.h

    r101654 r101724  
    144144    void sltMachineDataChanged(const QUuid &uMachineId);
    145145
     146    /** Handles platform @a enmArch change. */
     147    void sltHandlePlatformArchitectureChanged(KPlatformArchitecture enmArch);
     148
    146149private:
    147150
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r101717 r101724  
    503503}
    504504
     505void UIMachineSettingsGeneral::sltHandleOsTypeChanged()
     506{
     507    /* Compose new guest OS type: */
     508    const CGuestOSType comNewType = uiCommon().virtualBox().GetGuestOSType(guestOSTypeId());
     509    /* Notify listeners about new platform architecture: */
     510    if (comNewType.isNotNull())
     511    {
     512        const KPlatformArchitecture enmArch = comNewType.GetPlatformArchitecture();
     513        if (comNewType.isOk() && enmArch != KPlatformArchitecture_None)
     514            emit sigPlatformArchitectureChanged(enmArch);
     515    }
     516
     517    /* Revalidate the usual way as well: */
     518    revalidate();
     519}
     520
    505521void UIMachineSettingsGeneral::sltHandleEncryptionCipherChanged()
    506522{
     
    702718    /* Configure 'Basic' connections: */
    703719    connect(m_pEditorNameAndSystem, &UINameAndSystemEditor::sigOsTypeChanged,
    704             this, &UIMachineSettingsGeneral::revalidate);
     720            this, &UIMachineSettingsGeneral::sltHandleOsTypeChanged);
    705721    connect(m_pEditorNameAndSystem, &UINameAndSystemEditor::sigNameChanged,
    706722            this, &UIMachineSettingsGeneral::revalidate);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h

    r101717 r101724  
    5151    Q_OBJECT;
    5252
     53signals:
     54
     55    /** Notifies listeners about platform @a enmArch changed. */
     56    void sigPlatformArchitectureChanged(KPlatformArchitecture enmArch);
     57
    5358public:
    5459
     
    96101
    97102private slots:
     103
     104    /** Handles OS type change. */
     105    void sltHandleOsTypeChanged();
    98106
    99107    /** Handles encryption cipher change. */
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