VirtualBox

Changeset 79387 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jun 27, 2019 12:11:36 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131626
Message:

FE/Qt: bugref:6143. Some cleanup

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

Legend:

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

    r79365 r79387  
    16051605    /* Create the soft keyboard only once: */
    16061606    if (m_pSoftKeyboardDialog)
    1607         return;
    1608 
    1609     UISoftKeyboard *pSoftKeyboard = new UISoftKeyboard(0, uisession(), machine().GetName());
    1610     // UISoftKeyboardDialogFactory dialogFactory(uisession(), actionPool(), machine().GetName());
    1611     // dialogFactory.prepare(pSoftKeyboardDialog, activeMachineWindow());
    1612     if (pSoftKeyboard)
    1613     {
    1614         //m_pSoftKeyboardDialog = pSoftKeyboardDialog;
    1615 
    1616         /* Show instance: */
    1617         pSoftKeyboard->show();
    1618         // pSoftKeyboardDialog->setWindowState(pSoftKeyboardDialog->windowState() & ~Qt::WindowMinimized);
    1619         // pSoftKeyboardDialog->activateWindow();
    1620         // connect(pSoftKeyboardDialog, &QIManagerDialog::sigClose,
    1621         //         this, &UIMachineLogic::sltCloseSoftKeyboard);
    1622     }
    1623 }
    1624 
    1625 void UIMachineLogic::sltCloseSoftKeyboard()
    1626 {
    1627     // QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender());
    1628     // if (m_pSoftKeyboardDialog != pDialog || !pDialog)
    1629     //     return;
    1630 
    1631     // /* Set the m_pSoftKeyboardDialog to NULL before closing the dialog. or we will have redundant deletes*/
    1632     // m_pSoftKeyboardDialog = 0;
    1633     // pDialog->close();
    1634     // UISoftKeyboardDialogFactory().cleanup(pDialog);
     1607    {
     1608        m_pSoftKeyboardDialog->raise();
     1609        return;
     1610    }
     1611    m_pSoftKeyboardDialog = new UISoftKeyboard(0, uisession(), machine().GetName());
     1612    if (m_pSoftKeyboardDialog)
     1613    {
     1614        connect(m_pSoftKeyboardDialog, &QMainWindow::destroyed, this, &UIMachineLogic::sltSoftKeyboardClosed);
     1615        m_pSoftKeyboardDialog->show();
     1616    }
     1617}
     1618
     1619void UIMachineLogic::sltSoftKeyboardClosed()
     1620{
     1621    m_pSoftKeyboardDialog = 0;
    16351622}
    16361623
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r78567 r79387  
    4040class UIMachineView;
    4141class UIDockIconPreview;
     42class UISoftKeyboard;
    4243class CSession;
    4344class CMachine;
     
    266267    void sltShowKeyboardSettings();
    267268    void sltShowSoftKeyboard();
    268     void sltCloseSoftKeyboard();
     269    void sltSoftKeyboardClosed();
    269270    void sltToggleMouseIntegration(bool fEnabled);
    270271    void sltTypeCAD();
     
    438439    QIManagerDialog *m_pFileManagerDialog;
    439440    QIManagerDialog *m_pProcessControlDialog;
    440     QIManagerDialog *m_pSoftKeyboardDialog;
     441    UISoftKeyboard *m_pSoftKeyboardDialog;
    441442
    442443    /* Friend classes: */
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r79385 r79387  
    19601960    QString strNewName;
    19611961    if (!newLayout.name().isEmpty())
    1962         strNewName= QString("%1-%2").arg(newLayout.name()).arg(tr("Copy"));
     1962        strNewName= QString("%1-%2").arg(newLayout.name()).arg(UISoftKeyboard::tr("Copy"));
    19631963    QString strNewNativeName;
    19641964    if (!newLayout.nativeName().isEmpty())
    1965         strNewNativeName= QString("%1-%2").arg(newLayout.nativeName()).arg(tr("Copy"));
     1965        strNewNativeName= QString("%1-%2").arg(newLayout.nativeName()).arg(UISoftKeyboard::tr("Copy"));
    19661966    newLayout.setName(strNewName);
    19671967    newLayout.setNativeName(strNewNativeName);
     
    28292829{
    28302830    if (m_pLayoutListButton)
    2831         m_pLayoutListButton->setToolTip(tr("Layout List"));
     2831        m_pLayoutListButton->setToolTip(UISoftKeyboard::tr("Layout List"));
    28322832    if (m_pSettingsButton)
    2833         m_pSettingsButton->setToolTip(tr("Settings"));
     2833        m_pSettingsButton->setToolTip(UISoftKeyboard::tr("Settings"));
    28342834}
    28352835
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