VirtualBox

Ignore:
Timestamp:
Oct 22, 2019 11:33:14 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134165
Message:

FE/Qt: bugref:6699 Listing the names of unsaved layouts in the warning dialog.

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

Legend:

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

    r81442 r81447  
    24082408}
    24092409
    2410 bool UIMessageCenter::confirmSoftKeyboardClose() const
    2411 {
     2410bool UIMessageCenter::confirmSoftKeyboardClose(const QStringList &strNameList) const
     2411{
     2412    QString strJoinedString = strNameList.join("<br/>");
    24122413    return questionBinary(0, MessageType_Warning,
    2413                           tr("There are not saved layouts? Closing this dialog will cause loosing the changed. Proceed?"),
     2414                          tr("<p>Following layouts are edited/copied but not saved:</p>%1"
     2415                             "<p>Closing this dialog will cause loosing the changes. Proceed?</p>").arg(strJoinedString),
    24142416                          0 /* auto-confirm id */,
    24152417                          "Ok", "Cancel");
    2416 
    2417 
    2418 
    2419     // bool questionBinary(QWidget *pParent, MessageType enmType,
    2420     //                     const QString &strMessage,
    2421     //                     const char *pcszAutoConfirmId = 0,
    2422     //                     const QString &strOkButtonText = QString(),
    2423     //                     const QString &strCancelButtonText = QString(),
    2424     //                     bool fDefaultFocusForOk = true) const;
    2425 
    24262418}
    24272419
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r81442 r81447  
    446446    void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
    447447    void cannotAddDiskEncryptionPassword(const CConsole &console);
    448     bool confirmSoftKeyboardClose() const;
     448    bool confirmSoftKeyboardClose(const QStringList &strNameList) const;
    449449
    450450#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r81442 r81447  
    654654    void parentDialogDeactivated();
    655655    bool isColorThemeEditable() const;
    656     bool unsavedLayoutsExist() const;
     656
     657    QStringList unsavedLayoutsNameList() const;
    657658
    658659protected:
     
    25712572}
    25722573
    2573 bool UISoftKeyboardWidget::unsavedLayoutsExist() const
    2574 {
     2574QStringList UISoftKeyboardWidget::unsavedLayoutsNameList() const
     2575{
     2576    QStringList nameList;
    25752577    foreach (const UISoftKeyboardLayout &layout, m_layouts)
    25762578    {
    25772579        if (layout.editedButNotSaved())
    2578             return true;
    2579     }
    2580     return false;
    2581 }
     2580            nameList << layout.nameString();
     2581    }
     2582    return nameList;
     2583}
     2584
    25822585
    25832586void UISoftKeyboardWidget::deleteCurrentLayout()
     
    37973800void UISoftKeyboard::closeEvent(QCloseEvent *event)
    37983801{
     3802    QStringList strNameList = m_pKeyboardWidget->unsavedLayoutsNameList();
    37993803    /* Show a warning dialog when there are not saved layouts: */
    3800     if (m_pKeyboardWidget && m_pKeyboardWidget->unsavedLayoutsExist())
    3801     {
    3802         if (msgCenter().confirmSoftKeyboardClose())
     3804    if (m_pKeyboardWidget && !strNameList.empty())
     3805    {
     3806        if (msgCenter().confirmSoftKeyboardClose(strNameList))
    38033807            QMainWindowWithRestorableGeometryAndRetranslateUi::closeEvent(event);
    38043808        else
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