VirtualBox

Ignore:
Timestamp:
Apr 29, 2021 2:02:38 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144115
Message:

FE/Qt: bugref:8161. Closing soft keyboard dialog from UIMachineLogic::sltHandleCommitData

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

Legend:

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

    r88780 r88785  
    16271627
    16281628    /* Create the soft keyboard only once: */
     1629    if (!m_pSoftKeyboardDialog)
     1630    {
     1631        QWidget *pCenterWidget = windowManager().realParentWindow(activeMachineWindow());
     1632        m_pSoftKeyboardDialog = new UISoftKeyboard(0, uisession(), pCenterWidget, machine().GetName());
     1633        connect(m_pSoftKeyboardDialog, &UISoftKeyboard::sigClose, this, &UIMachineLogic::sltCloseSoftKeyboard);
     1634    }
     1635
    16291636    if (m_pSoftKeyboardDialog)
    16301637    {
     
    16331640        m_pSoftKeyboardDialog->setWindowState(m_pSoftKeyboardDialog->windowState() & ~Qt::WindowMinimized);
    16341641        m_pSoftKeyboardDialog->activateWindow();
    1635         return;
    1636     }
    1637     QWidget *pCenterWidget = windowManager().realParentWindow(activeMachineWindow());
    1638     m_pSoftKeyboardDialog = new UISoftKeyboard(0, uisession(), pCenterWidget, machine().GetName());
    1639     if (m_pSoftKeyboardDialog)
    1640     {
    1641         connect(m_pSoftKeyboardDialog, &QMainWindow::destroyed, this, &UIMachineLogic::sltSoftKeyboardClosed);
    1642         m_pSoftKeyboardDialog->show();
    1643     }
    1644 }
    1645 
    1646 void UIMachineLogic::sltSoftKeyboardClosed()
    1647 {
     1642    }
     1643}
     1644
     1645void UIMachineLogic::sltCloseSoftKeyboard()
     1646{
     1647    delete m_pSoftKeyboardDialog;
    16481648    m_pSoftKeyboardDialog = 0;
    16491649}
     
    28102810    sltCloseFileManagerDialog();
    28112811    sltCloseVMInformationDialog();
     2812    sltCloseSoftKeyboard();
    28122813}
    28132814
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r88741 r88785  
    268268    void sltShowKeyboardSettings();
    269269    void sltShowSoftKeyboard();
    270     void sltSoftKeyboardClosed();
     270    void sltCloseSoftKeyboard();
    271271    void sltToggleMouseIntegration(bool fEnabled);
    272272    void sltTypeCAD();
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r87001 r88785  
    38493849{
    38503850    setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("Soft Keyboard")));
    3851     setAttribute(Qt::WA_DeleteOnClose);
    38523851    prepareObjects();
    38533852    prepareConnections();
     
    38883887    {
    38893888        QString strJoinedString = strNameList.join("<br/>");
    3890         if (msgCenter().questionBinary(this, MessageType_Warning,
     3889        if (!msgCenter().questionBinary(this, MessageType_Warning,
    38913890                                       tr("<p>Following layouts are edited/copied but not saved:</p>%1"
    38923891                                          "<p>Closing this dialog will cause loosing the changes. Proceed?</p>").arg(strJoinedString),
    38933892                                       0 /* auto-confirm id */,
    38943893                                       "Ok", "Cancel"))
    3895             QMainWindowWithRestorableGeometryAndRetranslateUi::closeEvent(event);
    3896         else
     3894        {
    38973895            event->ignore();
    3898         return;
    3899     }
    3900     QMainWindowWithRestorableGeometryAndRetranslateUi::closeEvent(event);
     3896            return;
     3897        }
     3898    }
     3899    emit sigClose();
     3900    event->ignore();
    39013901}
    39023902
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h

    r86995 r88785  
    5757
    5858    void sigHelpRequested(const QString &strHelpKeyword);
     59    void sigClose();
    5960
    6061public:
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