- Timestamp:
- Oct 22, 2019 4:37:21 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134175
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r81447 r81456 526 526 527 527 void drawTextInRect(const UISoftKeyboardKey &key, QPainter &painter); 528 529 528 530 529 531 private: … … 2425 2427 void UISoftKeyboardWidget::copyCurentLayout() 2426 2428 { 2429 2427 2430 UISoftKeyboardLayout newLayout(*(m_pCurrentKeyboardLayout)); 2428 QString strNewName; 2429 if (!newLayout.name().isEmpty()) 2430 strNewName= QString("%1-%2").arg(newLayout.name()).arg(UISoftKeyboard::tr("Copy")); 2431 QString strNewNativeName; 2432 if (!newLayout.nativeName().isEmpty()) 2433 strNewNativeName= QString("%1-%2").arg(newLayout.nativeName()).arg(UISoftKeyboard::tr("Copy")); 2431 2432 QString strNewName = QString("%1-%2").arg(newLayout.name()).arg(UISoftKeyboard::tr("Copy")); 2433 int iCount = 1; 2434 while (findLayoutByName(strNewName)) 2435 { 2436 strNewName = QString("%1-%2-%3").arg(newLayout.name()).arg(UISoftKeyboard::tr("Copy")).arg(QString::number(iCount)); 2437 ++iCount; 2438 } 2439 2434 2440 newLayout.setName(strNewName); 2435 2441 newLayout.setEditedBuNotSaved(true); 2436 newLayout.setNativeName(strNewNativeName);2437 2442 newLayout.setEditable(true); 2438 2443 newLayout.setIsFromResources(false); … … 2944 2949 UIKeyboardLayoutReader keyboardLayoutReader; 2945 2950 2946 m_layouts.append(UISoftKeyboardLayout()); 2947 UISoftKeyboardLayout &newLayout = m_layouts.back(); 2948 2951 UISoftKeyboardLayout newLayout; 2949 2952 if (!keyboardLayoutReader.parseFile(strLayoutFileName, newLayout)) 2950 {2951 m_layouts.removeLast();2952 2953 return false; 2953 }2954 2954 2955 2955 UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(newLayout.physicalLayoutUuid()); 2956 2956 /* If no pyhsical layout with the UUID the keyboard layout refers is found then cancel loading the keyboard layout: */ 2957 2957 if (!pPhysicalLayout) 2958 {2959 m_layouts.removeLast();2960 2958 return false; 2961 } 2962 /* Make sure we have unique lay out UUIDs: */2959 2960 /* Make sure we have unique lay1out UUIDs: */ 2963 2961 int iCount = 0; 2964 2962 foreach (const UISoftKeyboardLayout &layout, m_layouts) … … 2968 2966 } 2969 2967 if (iCount > 1) 2970 {2971 m_layouts.removeLast();2972 2968 return false; 2973 } 2969 2974 2970 newLayout.setSourceFilePath(strLayoutFileName); 2971 addLayout(newLayout); 2975 2972 return true; 2976 2973 }
Note:
See TracChangeset
for help on using the changeset viewer.