Changeset 81309 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 17, 2019 11:40:23 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 134014
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r81263 r81309 205 205 const char *UIExtraDataDefs::GUI_SoftKeyboard_DialogGeometry = "GUI/SoftKeyboardDialogGeometry"; 206 206 const char *UIExtraDataDefs::GUI_SoftKeyboard_ColorTheme = "GUI/SoftKeyboardColorTheme"; 207 const char *UIExtraDataDefs::GUI_SoftKeyboard_SelectedColorTheme = "GUI/SoftKeyboardSelectedColorTheme"; 207 208 const char *UIExtraDataDefs::GUI_SoftKeyboard_SelectedLayout = "GUI/SoftKeyboardSelectedLayout"; 208 209 const char *UIExtraDataDefs::GUI_SoftKeyboard_Options = "GUI/SoftKeyboardOptions"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r81263 r81309 382 382 extern const char *GUI_SoftKeyboard_DialogGeometry; 383 383 extern const char *GUI_SoftKeyboard_ColorTheme; 384 extern const char *GUI_SoftKeyboard_SelectedColorTheme; 384 385 extern const char *GUI_SoftKeyboard_SelectedLayout; 385 386 extern const char *GUI_SoftKeyboard_Options; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r81272 r81309 4277 4277 } 4278 4278 4279 void UIExtraDataManager::setSoftKeyboardSelectedColorTheme(const QString &strColorThemeName) 4280 { 4281 setExtraDataString(GUI_SoftKeyboard_SelectedColorTheme, strColorThemeName); 4282 } 4283 4284 QString UIExtraDataManager::softKeyboardSelectedColorTheme() 4285 { 4286 return extraDataString(GUI_SoftKeyboard_SelectedColorTheme); 4287 } 4288 4279 4289 void UIExtraDataManager::setSoftKeyboardSelectedLayout(const QUuid &uLayoutUid) 4280 4290 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r81263 r81309 669 669 void setSoftKeyboardColorTheme(const QStringList &colorStringList); 670 670 QStringList softKeyboardColorTheme(); 671 void setSoftKeyboardSelectedColorTheme(const QString &strColorThemeName); 672 QString softKeyboardSelectedColorTheme(); 671 673 void setSoftKeyboardSelectedLayout(const QUuid &uLayoutUid); 672 674 QUuid softKeyboardSelectedLayout(); -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r81303 r81309 645 645 void setColor(KeyboardColorType ennmColorType, const QColor &color); 646 646 647 QStringList colorsToStringList( ) const;648 void colorsFromStringList(const QString List &colorStringList);647 QStringList colorsToStringList(const QString &strColorThemeName); 648 void colorsFromStringList(const QString &strColorThemeName, const QStringList &colorStringList); 649 649 650 650 /** Unlike modifier and ordinary keys we update the state of the Lock keys thru event singals we receieve … … 655 655 QStringList colorThemeNames() const; 656 656 QString currentColorThemeName() const; 657 void setColorTheme (const QString &strColorThemeName);657 void setColorThemeByName(const QString &strColorThemeName); 658 658 void parentDialogDeactivated(); 659 659 … … 694 694 /** Looks under the default keyboard layout folder and add the file names to the fileList. */ 695 695 void lookAtDefaultLayoutFolder(QStringList &fileList); 696 696 UISoftKeyboardColorTheme *colorTheme(const QString &strColorThemeName); 697 697 UISoftKeyboardKey *m_pKeyUnderMouse; 698 698 UISoftKeyboardKey *m_pKeyBeingEdited; … … 2499 2499 } 2500 2500 2501 QStringList UISoftKeyboardWidget::colorsToStringList() const 2502 { 2503 if (!m_currentColorTheme) 2504 QStringList(); 2505 return m_currentColorTheme->colorsToStringList(); 2506 } 2507 2508 void UISoftKeyboardWidget::colorsFromStringList(const QStringList &colorStringList) 2509 { 2510 if (m_currentColorTheme) 2511 m_currentColorTheme->colorsFromStringList(colorStringList); 2501 QStringList UISoftKeyboardWidget::colorsToStringList(const QString &strColorThemeName) 2502 { 2503 UISoftKeyboardColorTheme *pTheme = colorTheme(strColorThemeName); 2504 if (!pTheme) 2505 return QStringList(); 2506 return pTheme->colorsToStringList(); 2507 } 2508 2509 void UISoftKeyboardWidget::colorsFromStringList(const QString &strColorThemeName, const QStringList &colorStringList) 2510 { 2511 UISoftKeyboardColorTheme *pTheme = colorTheme(strColorThemeName); 2512 if (!pTheme) 2513 return; 2514 pTheme->colorsFromStringList(colorStringList); 2512 2515 } 2513 2516 … … 2536 2539 } 2537 2540 2538 void UISoftKeyboardWidget::setColorTheme (const QString &strColorThemeName)2541 void UISoftKeyboardWidget::setColorThemeByName(const QString &strColorThemeName) 2539 2542 { 2540 2543 if (m_currentColorTheme && m_currentColorTheme->name() == strColorThemeName) … … 3104 3107 foreach (const QFileInfo &fileInfo, fileInfoList) 3105 3108 fileList << fileInfo.absoluteFilePath(); 3109 } 3110 3111 UISoftKeyboardColorTheme *UISoftKeyboardWidget::colorTheme(const QString &strColorThemeName) 3112 { 3113 for (int i = 0; i < m_colorThemes.size(); ++i) 3114 { 3115 if (m_colorThemes[i].name() == strColorThemeName) 3116 return &(m_colorThemes[i]); 3117 } 3118 return 0; 3106 3119 } 3107 3120 … … 3879 3892 { 3880 3893 if (m_pKeyboardWidget) 3881 m_pKeyboardWidget->setColorTheme (strColorThemeName);3894 m_pKeyboardWidget->setColorThemeByName(strColorThemeName); 3882 3895 } 3883 3896 … … 4058 4071 if (m_pKeyboardWidget) 4059 4072 { 4060 gEDataManager->setSoftKeyboardColorTheme(m_pKeyboardWidget->colorsToStringList()); 4061 4073 /* Save the changes to the 'Custom' color theme to extra data: */ 4074 QStringList colors = m_pKeyboardWidget->colorsToStringList("Custom"); 4075 colors.prepend("Custom"); 4076 gEDataManager->setSoftKeyboardColorTheme(colors); 4077 gEDataManager->setSoftKeyboardSelectedColorTheme(m_pKeyboardWidget->currentColorThemeName()); 4062 4078 gEDataManager->setSoftKeyboardOptions(m_pKeyboardWidget->hideNumPad(), 4063 4079 m_pKeyboardWidget->hideOSMenuKeys(), … … 4092 4108 if (m_pKeyboardWidget) 4093 4109 { 4094 m_pKeyboardWidget->colorsFromStringList(gEDataManager->softKeyboardColorTheme()); 4110 QStringList colorTheme = gEDataManager->softKeyboardColorTheme(); 4111 /* The fist item is the theme name and the rest are color codes: */ 4112 QString strThemeName = colorTheme[0]; 4113 colorTheme.removeFirst(); 4114 m_pKeyboardWidget->colorsFromStringList(strThemeName, colorTheme); 4115 m_pKeyboardWidget->setColorThemeByName(gEDataManager->softKeyboardSelectedColorTheme()); 4095 4116 m_pKeyboardWidget->setCurrentLayout(gEDataManager->softKeyboardSelectedLayout()); 4096 4117 /* Load other options from exra data: */
Note:
See TracChangeset
for help on using the changeset viewer.