VirtualBox

Changeset 80073 in vbox


Ignore:
Timestamp:
Jul 31, 2019 11:54:13 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7720: VirtualBox Manager: Details pane: Possibility to edit VM graphics controller type on-the-fly.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp

    r80046 r80073  
    294294    /* Graphics Controller: */
    295295    if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController)
     296    {
     297        const QString strAnchorType = QString("graphics_controller_type");
     298        const KGraphicsControllerType enmType = comMachine.GetGraphicsControllerType();
    296299        table << UITextTableLine(QApplication::translate("UIDetails", "Graphics Controller", "details (display)"),
    297                                  gpConverter->toString(comMachine.GetGraphicsControllerType()));
     300                                 QApplication::translate("UIDetails", "<a href=#%1,%2>%3</a>", "details")
     301                                     .arg(strAnchorType)
     302                                     .arg((int)enmType)
     303                                     .arg(gpConverter->toString(enmType)));
     304    }
    298305
    299306    /* Acceleration: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp

    r80046 r80073  
    122122                break;
    123123            }
     124            case MachineAttribute_GraphicsControllerType:
     125            {
     126                /* Change machine graphics controller type: */
     127                comMachine.SetGraphicsControllerType(guiAttribute.value<KGraphicsControllerType>());
     128                if (!comMachine.isOk())
     129                {
     130                    msgCenter().cannotChangeMachineAttribute(comMachine);
     131                    fErrorHappened = true;
     132                }
     133                break;
     134            }
    124135            default:
    125136                break;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.h

    r80046 r80073  
    3636    MachineAttribute_BootOrder,
    3737    MachineAttribute_VideoMemory,
     38    MachineAttribute_GraphicsControllerType,
    3839};
    3940
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp

    r80046 r80073  
    3535#include "UIDetailsModel.h"
    3636#include "UIExtraDataManager.h"
     37#include "UIGraphicsControllerEditor.h"
    3738#include "UIGraphicsRotatorButton.h"
    3839#include "UIGraphicsTextPane.h"
     
    5455    AnchorRole_BootOrder,
    5556    AnchorRole_VideoMemory,
     57    AnchorRole_GraphicsControllerType,
    5658    AnchorRole_Storage,
    5759};
     
    159161    m_pTextPane->setAnchorRoleRestricted("#boot_order", cal != ConfigurationAccessLevel_Full);
    160162    m_pTextPane->setAnchorRoleRestricted("#video_memory", cal != ConfigurationAccessLevel_Full);
     163    m_pTextPane->setAnchorRoleRestricted("#graphics_controller_type", cal != ConfigurationAccessLevel_Full);
    161164    m_pTextPane->setAnchorRoleRestricted("#mount", cal == ConfigurationAccessLevel_Null);
    162165    m_pTextPane->setAnchorRoleRestricted("#attach", cal != ConfigurationAccessLevel_Full);
     
    444447    roles["#boot_order"] = AnchorRole_BootOrder;
    445448    roles["#video_memory"] = AnchorRole_VideoMemory;
     449    roles["#graphics_controller_type"] = AnchorRole_GraphicsControllerType;
    446450    roles["#mount"] = AnchorRole_Storage;
    447451    roles["#attach"] = AnchorRole_Storage;
     
    609613            break;
    610614        }
     615        case AnchorRole_GraphicsControllerType:
     616        {
     617            /* Prepare popup: */
     618            QPointer<QIDialogContainer> pPopup = new QIDialogContainer(0, Qt::Tool);
     619            if (pPopup)
     620            {
     621                /* Prepare editor: */
     622                UIGraphicsControllerEditor *pEditor = new UIGraphicsControllerEditor(pPopup, true /* with label */);
     623                if (pEditor)
     624                {
     625                    pEditor->setValue(static_cast<KGraphicsControllerType>(strData.section(',', 0, 0).toInt()));
     626                    pPopup->setWidget(pEditor);
     627                }
     628
     629                /* Adjust popup geometry: */
     630                pPopup->move(QCursor::pos());
     631                pPopup->adjustSize();
     632
     633                // WORKAROUND:
     634                // On Windows, Tool dialogs aren't activated by default by some reason.
     635                // So we have created sltActivateWindow wrapping actual activateWindow
     636                // to fix that annoying issue.
     637                QMetaObject::invokeMethod(pPopup, "sltActivateWindow", Qt::QueuedConnection);
     638                /* Execute popup, change machine name if confirmed: */
     639                if (pPopup->exec() == QDialog::Accepted)
     640                    setMachineAttribute(machine(), MachineAttribute_GraphicsControllerType, QVariant::fromValue(pEditor->value()));
     641
     642                /* Delete popup: */
     643                delete pPopup;
     644            }
     645            break;
     646        }
    611647        case AnchorRole_Storage:
    612648        {
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