Changeset 81447 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 22, 2019 11:33:14 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 134165
- 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 2408 2408 } 2409 2409 2410 bool UIMessageCenter::confirmSoftKeyboardClose() const 2411 { 2410 bool UIMessageCenter::confirmSoftKeyboardClose(const QStringList &strNameList) const 2411 { 2412 QString strJoinedString = strNameList.join("<br/>"); 2412 2413 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), 2414 2416 0 /* auto-confirm id */, 2415 2417 "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 2426 2418 } 2427 2419 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r81442 r81447 446 446 void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const; 447 447 void cannotAddDiskEncryptionPassword(const CConsole &console); 448 bool confirmSoftKeyboardClose( ) const;448 bool confirmSoftKeyboardClose(const QStringList &strNameList) const; 449 449 450 450 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r81442 r81447 654 654 void parentDialogDeactivated(); 655 655 bool isColorThemeEditable() const; 656 bool unsavedLayoutsExist() const; 656 657 QStringList unsavedLayoutsNameList() const; 657 658 658 659 protected: … … 2571 2572 } 2572 2573 2573 bool UISoftKeyboardWidget::unsavedLayoutsExist() const 2574 { 2574 QStringList UISoftKeyboardWidget::unsavedLayoutsNameList() const 2575 { 2576 QStringList nameList; 2575 2577 foreach (const UISoftKeyboardLayout &layout, m_layouts) 2576 2578 { 2577 2579 if (layout.editedButNotSaved()) 2578 return true; 2579 } 2580 return false; 2581 } 2580 nameList << layout.nameString(); 2581 } 2582 return nameList; 2583 } 2584 2582 2585 2583 2586 void UISoftKeyboardWidget::deleteCurrentLayout() … … 3797 3800 void UISoftKeyboard::closeEvent(QCloseEvent *event) 3798 3801 { 3802 QStringList strNameList = m_pKeyboardWidget->unsavedLayoutsNameList(); 3799 3803 /* 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)) 3803 3807 QMainWindowWithRestorableGeometryAndRetranslateUi::closeEvent(event); 3804 3808 else
Note:
See TracChangeset
for help on using the changeset viewer.