Changeset 93988 in vbox
- Timestamp:
- Feb 28, 2022 3:04:55 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r93408 r93988 105 105 template<> Qt::Alignment fromInternalString<Qt::Alignment>(const QString &strAlignment) 106 106 { 107 /* Here we have some fancy stuff allowing us 108 * to search through the keys using 'case-insensitive' rule: */ 109 QStringList keys; QList<Qt::Alignment> values; 110 keys << "Top"; values << Qt::AlignTop; 111 keys << "Bottom"; values << Qt::AlignBottom; 112 /* Qt::AlignTop type for unknown words: */ 113 if (!keys.contains(strAlignment, Qt::CaseInsensitive)) 107 if (strAlignment.compare("Top", Qt::CaseInsensitive) == 0) 114 108 return Qt::AlignTop; 115 /* Corresponding type for known words: */ 116 return values.at(keys.indexOf(QRegExp(strAlignment, Qt::CaseInsensitive))); 109 if (strAlignment.compare("Bottom", Qt::CaseInsensitive) == 0) 110 return Qt::AlignBottom; 111 return Qt::AlignTop; 117 112 } 118 113 … … 137 132 template<> Qt::SortOrder fromInternalString<Qt::SortOrder>(const QString &strSortOrder) 138 133 { 139 /* Here we have some fancy stuff allowing us 140 * to search through the keys using 'case-insensitive' rule: */ 141 QStringList keys; QList<Qt::SortOrder> values; 142 keys << "Ascending"; values << Qt::AscendingOrder; 143 keys << "Descending"; values << Qt::DescendingOrder; 144 /* Qt::AscendingOrder type for unknown words: */ 145 if (!keys.contains(strSortOrder, Qt::CaseInsensitive)) 134 if (strSortOrder.compare("Ascending", Qt::CaseInsensitive) == 0) 146 135 return Qt::AscendingOrder; 147 /* Corresponding type for known words: */ 148 return values.at(keys.indexOf(QRegExp(strSortOrder, Qt::CaseInsensitive))); 136 if (strSortOrder.compare("Descending", Qt::CaseInsensitive) == 0) 137 return Qt::DescendingOrder; 138 return Qt::AscendingOrder; 149 139 } 150 140 … … 470 460 template<> UIExtraDataMetaDefs::DialogType fromInternalString<UIExtraDataMetaDefs::DialogType>(const QString &strDialogType) 471 461 { 472 /* Here we have some fancy stuff allowing us 473 * to search through the keys using 'case-insensitive' rule: */ 474 QStringList keys; QList<UIExtraDataMetaDefs::DialogType> values; 475 keys << "VISOCreator"; values << UIExtraDataMetaDefs::DialogType_VISOCreator; 476 keys << "BootFailure"; values << UIExtraDataMetaDefs::DialogType_BootFailure; 477 keys << "All"; values << UIExtraDataMetaDefs::DialogType_All; 478 /* Invalid type for unknown words: */ 479 if (!keys.contains(strDialogType, Qt::CaseInsensitive)) 480 return UIExtraDataMetaDefs::DialogType_Invalid; 481 /* Corresponding type for known words: */ 482 return values.at(keys.indexOf(QRegExp(strDialogType, Qt::CaseInsensitive))); 462 if (strDialogType.compare("VISOCreator", Qt::CaseInsensitive) == 0) 463 return UIExtraDataMetaDefs::DialogType_VISOCreator; 464 if (strDialogType.compare("BootFailure", Qt::CaseInsensitive) == 0) 465 return UIExtraDataMetaDefs::DialogType_BootFailure; 466 if (strDialogType.compare("All", Qt::CaseInsensitive) == 0) 467 return UIExtraDataMetaDefs::DialogType_All; 468 return UIExtraDataMetaDefs::DialogType_Invalid; 483 469 } 484 470 … … 514 500 template<> UIExtraDataMetaDefs::MenuType fromInternalString<UIExtraDataMetaDefs::MenuType>(const QString &strMenuType) 515 501 { 516 /* Here we have some fancy stuff allowing us 517 * to search through the keys using 'case-insensitive' rule: */ 518 QStringList keys; QList<UIExtraDataMetaDefs::MenuType> values; 519 keys << "Application"; values << UIExtraDataMetaDefs::MenuType_Application; 520 keys << "Machine"; values << UIExtraDataMetaDefs::MenuType_Machine; 521 keys << "View"; values << UIExtraDataMetaDefs::MenuType_View; 522 keys << "Input"; values << UIExtraDataMetaDefs::MenuType_Input; 523 keys << "Devices"; values << UIExtraDataMetaDefs::MenuType_Devices; 502 if (strMenuType.compare("Application", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Application; 503 if (strMenuType.compare("Machine", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Machine; 504 if (strMenuType.compare("View", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_View; 505 if (strMenuType.compare("Input", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Input; 506 if (strMenuType.compare("Devices", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Devices; 524 507 #ifdef VBOX_WITH_DEBUGGER_GUI 525 keys << "Debug"; values <<UIExtraDataMetaDefs::MenuType_Debug;526 #endif /* VBOX_WITH_DEBUGGER_GUI */508 if (strMenuType.compare("Debug", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Debug; 509 #endif 527 510 #ifdef RT_OS_DARWIN 528 keys << "Window"; values << UIExtraDataMetaDefs::MenuType_Window; 529 #endif /* RT_OS_DARWIN */ 530 keys << "Help"; values << UIExtraDataMetaDefs::MenuType_Help; 531 keys << "All"; values << UIExtraDataMetaDefs::MenuType_All; 532 /* Invalid type for unknown words: */ 533 if (!keys.contains(strMenuType, Qt::CaseInsensitive)) 534 return UIExtraDataMetaDefs::MenuType_Invalid; 535 /* Corresponding type for known words: */ 536 return values.at(keys.indexOf(QRegExp(strMenuType, Qt::CaseInsensitive))); 511 if (strMenuType.compare("Window", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Window; 512 #endif 513 if (strMenuType.compare("Help", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Help; 514 if (strMenuType.compare("All", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_All; 515 return UIExtraDataMetaDefs::MenuType_Invalid; 537 516 } 538 517 … … 564 543 565 544 /* UIExtraDataMetaDefs::MenuApplicationActionType <= QString: */ 566 template<> UIExtraDataMetaDefs::MenuApplicationActionType fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(const QString &strMenuApplicationActionType) 567 { 568 /* Here we have some fancy stuff allowing us 569 * to search through the keys using 'case-insensitive' rule: */ 570 QStringList keys; QList<UIExtraDataMetaDefs::MenuApplicationActionType> values; 545 template<> UIExtraDataMetaDefs::MenuApplicationActionType 546 fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(const QString &strMenuApplicationActionType) 547 { 571 548 #ifdef VBOX_WS_MAC 572 keys << "About"; values << UIExtraDataMetaDefs::MenuApplicationActionType_About; 573 #endif /* VBOX_WS_MAC */ 574 keys << "Preferences"; values << UIExtraDataMetaDefs::MenuApplicationActionType_Preferences; 549 if (strMenuApplicationActionType.compare("About", Qt::CaseInsensitive) == 0) 550 return UIExtraDataMetaDefs::MenuApplicationActionType_About; 551 #endif 552 if (strMenuApplicationActionType.compare("Preferences", Qt::CaseInsensitive) == 0) 553 return UIExtraDataMetaDefs::MenuApplicationActionType_Preferences; 575 554 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 576 keys << "NetworkAccessManager"; values << UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager; 577 keys << "CheckForUpdates"; values << UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates; 578 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 579 keys << "ResetWarnings"; values << UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings; 580 keys << "Close"; values << UIExtraDataMetaDefs::MenuApplicationActionType_Close; 581 keys << "All"; values << UIExtraDataMetaDefs::MenuApplicationActionType_All; 582 /* Invalid type for unknown words: */ 583 if (!keys.contains(strMenuApplicationActionType, Qt::CaseInsensitive)) 584 return UIExtraDataMetaDefs::MenuApplicationActionType_Invalid; 585 /* Corresponding type for known words: */ 586 return values.at(keys.indexOf(QRegExp(strMenuApplicationActionType, Qt::CaseInsensitive))); 555 if (strMenuApplicationActionType.compare("NetworkAccessManager", Qt::CaseInsensitive) == 0) 556 return UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager; 557 if (strMenuApplicationActionType.compare("CheckForUpdates", Qt::CaseInsensitive) == 0) 558 return UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates; 559 #endif 560 if (strMenuApplicationActionType.compare("ResetWarnings", Qt::CaseInsensitive) == 0) 561 return UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings; 562 if (strMenuApplicationActionType.compare("Close", Qt::CaseInsensitive) == 0) 563 return UIExtraDataMetaDefs::MenuApplicationActionType_Close; 564 if (strMenuApplicationActionType.compare("All", Qt::CaseInsensitive) == 0) 565 return UIExtraDataMetaDefs::MenuApplicationActionType_All; 566 return UIExtraDataMetaDefs::MenuApplicationActionType_Invalid; 587 567 } 588 568 … … 612 592 613 593 /* UIExtraDataMetaDefs::MenuHelpActionType <= QString: */ 614 template<> UIExtraDataMetaDefs::MenuHelpActionType fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(const QString &strMenuHelpActionType) 615 { 616 /* Here we have some fancy stuff allowing us 617 * to search through the keys using 'case-insensitive' rule: */ 618 QStringList keys; QList<UIExtraDataMetaDefs::MenuHelpActionType> values; 619 keys << "Contents"; values << UIExtraDataMetaDefs::MenuHelpActionType_Contents; 620 keys << "WebSite"; values << UIExtraDataMetaDefs::MenuHelpActionType_WebSite; 621 keys << "BugTracker"; values << UIExtraDataMetaDefs::MenuHelpActionType_BugTracker; 622 keys << "Forums"; values << UIExtraDataMetaDefs::MenuHelpActionType_Forums; 623 keys << "Oracle"; values << UIExtraDataMetaDefs::MenuHelpActionType_Oracle; 594 template<> UIExtraDataMetaDefs::MenuHelpActionType 595 fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(const QString &strMenuHelpActionType) 596 { 597 if (strMenuHelpActionType.compare("Contents", Qt::CaseInsensitive) == 0) 598 return UIExtraDataMetaDefs::MenuHelpActionType_Contents; 599 if (strMenuHelpActionType.compare("WebSite", Qt::CaseInsensitive) == 0) 600 return UIExtraDataMetaDefs::MenuHelpActionType_WebSite; 601 if (strMenuHelpActionType.compare("BugTracker", Qt::CaseInsensitive) == 0) 602 return UIExtraDataMetaDefs::MenuHelpActionType_BugTracker; 603 if (strMenuHelpActionType.compare("Forums", Qt::CaseInsensitive) == 0) 604 return UIExtraDataMetaDefs::MenuHelpActionType_Forums; 605 if (strMenuHelpActionType.compare("Oracle", Qt::CaseInsensitive) == 0) 606 return UIExtraDataMetaDefs::MenuHelpActionType_Oracle; 624 607 #ifndef VBOX_WS_MAC 625 keys << "About"; values << UIExtraDataMetaDefs::MenuHelpActionType_About; 626 #endif /* !VBOX_WS_MAC */ 627 keys << "All"; values << UIExtraDataMetaDefs::MenuHelpActionType_All; 628 /* Invalid type for unknown words: */ 629 if (!keys.contains(strMenuHelpActionType, Qt::CaseInsensitive)) 630 return UIExtraDataMetaDefs::MenuHelpActionType_Invalid; 631 /* Corresponding type for known words: */ 632 return values.at(keys.indexOf(QRegExp(strMenuHelpActionType, Qt::CaseInsensitive))); 608 if (strMenuHelpActionType.compare("About", Qt::CaseInsensitive) == 0) 609 return UIExtraDataMetaDefs::MenuHelpActionType_About; 610 #endif 611 if (strMenuHelpActionType.compare("All", Qt::CaseInsensitive) == 0) 612 return UIExtraDataMetaDefs::MenuHelpActionType_All; 613 return UIExtraDataMetaDefs::MenuHelpActionType_Invalid; 633 614 } 634 615 … … 662 643 663 644 /* UIExtraDataMetaDefs::RuntimeMenuMachineActionType <= QString: */ 664 template<> UIExtraDataMetaDefs::RuntimeMenuMachineActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(const QString &strRuntimeMenuMachineActionType) 665 { 666 /* Here we have some fancy stuff allowing us 667 * to search through the keys using 'case-insensitive' rule: */ 668 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuMachineActionType> values; 669 keys << "SettingsDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog; 670 keys << "TakeSnapshot"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot; 671 keys << "InformationDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog; 672 keys << "FileManagerDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog; 673 keys << "GuestProcessControlDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog; 674 keys << "Pause"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause; 675 keys << "Reset"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset; 676 keys << "Detach"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach; 677 keys << "SaveState"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState; 678 keys << "Shutdown"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown; 679 keys << "PowerOff"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff; 680 keys << "Nothing"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing; 681 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All; 682 /* Invalid type for unknown words: */ 683 if (!keys.contains(strRuntimeMenuMachineActionType, Qt::CaseInsensitive)) 684 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid; 685 /* Corresponding type for known words: */ 686 return values.at(keys.indexOf(QRegExp(strRuntimeMenuMachineActionType, Qt::CaseInsensitive))); 645 template<> UIExtraDataMetaDefs::RuntimeMenuMachineActionType 646 fromInternalString<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(const QString &strRuntimeMenuMachineActionType) 647 { 648 if (strRuntimeMenuMachineActionType.compare("SettingsDialog", Qt::CaseInsensitive) == 0) 649 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog; 650 if (strRuntimeMenuMachineActionType.compare("TakeSnapshot", Qt::CaseInsensitive) == 0) 651 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot; 652 if (strRuntimeMenuMachineActionType.compare("InformationDialog", Qt::CaseInsensitive) == 0) 653 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog; 654 if (strRuntimeMenuMachineActionType.compare("FileManagerDialog", Qt::CaseInsensitive) == 0) 655 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog; 656 if (strRuntimeMenuMachineActionType.compare("GuestProcessControlDialog", Qt::CaseInsensitive) == 0) 657 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog; 658 if (strRuntimeMenuMachineActionType.compare("Pause", Qt::CaseInsensitive) == 0) 659 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause; 660 if (strRuntimeMenuMachineActionType.compare("Reset", Qt::CaseInsensitive) == 0) 661 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset; 662 if (strRuntimeMenuMachineActionType.compare("Detach", Qt::CaseInsensitive) == 0) 663 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach; 664 if (strRuntimeMenuMachineActionType.compare("SaveState", Qt::CaseInsensitive) == 0) 665 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState; 666 if (strRuntimeMenuMachineActionType.compare("Shutdown", Qt::CaseInsensitive) == 0) 667 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown; 668 if (strRuntimeMenuMachineActionType.compare("PowerOff", Qt::CaseInsensitive) == 0) 669 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff; 670 if (strRuntimeMenuMachineActionType.compare("Nothing", Qt::CaseInsensitive) == 0) 671 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing; 672 if (strRuntimeMenuMachineActionType.compare("All", Qt::CaseInsensitive) == 0) 673 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All; 674 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid; 687 675 } 688 676 … … 728 716 729 717 /* UIExtraDataMetaDefs::RuntimeMenuViewActionType <= QString: */ 730 template<> UIExtraDataMetaDefs::RuntimeMenuViewActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(const QString &strRuntimeMenuViewActionType) 731 { 732 /* Here we have some fancy stuff allowing us 733 * to search through the keys using 'case-insensitive' rule: */ 734 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuViewActionType> values; 735 keys << "Fullscreen"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen; 736 keys << "Seamless"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless; 737 keys << "Scale"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale; 718 template<> UIExtraDataMetaDefs::RuntimeMenuViewActionType 719 fromInternalString<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(const QString &strRuntimeMenuViewActionType) 720 { 721 if (strRuntimeMenuViewActionType.compare("Fullscreen", Qt::CaseInsensitive) == 0) 722 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen; 723 if (strRuntimeMenuViewActionType.compare("Seamless", Qt::CaseInsensitive) == 0) 724 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless; 725 if (strRuntimeMenuViewActionType.compare("Scale", Qt::CaseInsensitive) == 0) 726 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale; 738 727 #ifndef VBOX_WS_MAC 739 keys << "MinimizeWindow"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow; 728 if (strRuntimeMenuViewActionType.compare("MinimizeWindow", Qt::CaseInsensitive) == 0) 729 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow; 740 730 #endif /* !VBOX_WS_MAC */ 741 keys << "AdjustWindow"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow; 742 keys << "GuestAutoresize"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize; 743 keys << "TakeScreenshot"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot; 744 keys << "Recording"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording; 745 keys << "RecordingSettings"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings; 746 keys << "StartRecording"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording; 747 keys << "VRDEServer"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer; 748 keys << "MenuBar"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar; 749 keys << "MenuBarSettings"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings; 731 if (strRuntimeMenuViewActionType.compare("AdjustWindow", Qt::CaseInsensitive) == 0) 732 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow; 733 if (strRuntimeMenuViewActionType.compare("GuestAutoresize", Qt::CaseInsensitive) == 0) 734 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize; 735 if (strRuntimeMenuViewActionType.compare("TakeScreenshot", Qt::CaseInsensitive) == 0) 736 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot; 737 if (strRuntimeMenuViewActionType.compare("Recording", Qt::CaseInsensitive) == 0) 738 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording; 739 if (strRuntimeMenuViewActionType.compare("RecordingSettings", Qt::CaseInsensitive) == 0) 740 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings; 741 if (strRuntimeMenuViewActionType.compare("StartRecording", Qt::CaseInsensitive) == 0) 742 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording; 743 if (strRuntimeMenuViewActionType.compare("VRDEServer", Qt::CaseInsensitive) == 0) 744 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer; 745 if (strRuntimeMenuViewActionType.compare("MenuBar", Qt::CaseInsensitive) == 0) 746 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar; 747 if (strRuntimeMenuViewActionType.compare("MenuBarSettings", Qt::CaseInsensitive) == 0) 748 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings; 750 749 #ifndef VBOX_WS_MAC 751 keys << "ToggleMenuBar"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar; 750 if (strRuntimeMenuViewActionType.compare("ToggleMenuBar", Qt::CaseInsensitive) == 0) 751 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar; 752 752 #endif /* !VBOX_WS_MAC */ 753 keys << "StatusBar"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar; 754 keys << "StatusBarSettings"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings; 755 keys << "ToggleStatusBar"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar; 756 keys << "Resize"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize; 757 keys << "Remap"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap; 758 keys << "Rescale"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale; 759 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_All; 760 /* Invalid type for unknown words: */ 761 if (!keys.contains(strRuntimeMenuViewActionType, Qt::CaseInsensitive)) 762 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid; 763 /* Corresponding type for known words: */ 764 return values.at(keys.indexOf(QRegExp(strRuntimeMenuViewActionType, Qt::CaseInsensitive))); 753 if (strRuntimeMenuViewActionType.compare("StatusBar", Qt::CaseInsensitive) == 0) 754 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar; 755 if (strRuntimeMenuViewActionType.compare("StatusBarSettings", Qt::CaseInsensitive) == 0) 756 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings; 757 if (strRuntimeMenuViewActionType.compare("ToggleStatusBar", Qt::CaseInsensitive) == 0) 758 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar; 759 if (strRuntimeMenuViewActionType.compare("Resize", Qt::CaseInsensitive) == 0) 760 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize; 761 if (strRuntimeMenuViewActionType.compare("Remap", Qt::CaseInsensitive) == 0) 762 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap; 763 if (strRuntimeMenuViewActionType.compare("Rescale", Qt::CaseInsensitive) == 0) 764 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale; 765 if (strRuntimeMenuViewActionType.compare("All", Qt::CaseInsensitive) == 0) 766 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_All; 767 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid; 765 768 } 766 769 … … 796 799 797 800 /* UIExtraDataMetaDefs::RuntimeMenuInputActionType <= QString: */ 798 template<> UIExtraDataMetaDefs::RuntimeMenuInputActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(const QString &strRuntimeMenuInputActionType) 799 { 800 /* Here we have some fancy stuff allowing us 801 * to search through the keys using 'case-insensitive' rule: */ 802 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuInputActionType> values; 803 keys << "Keyboard"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard; 804 keys << "KeyboardSettings"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings; 805 keys << "SoftKeyboard"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard; 806 keys << "TypeCAD"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD; 801 template<> UIExtraDataMetaDefs::RuntimeMenuInputActionType 802 fromInternalString<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(const QString &strRuntimeMenuInputActionType) 803 { 804 if (strRuntimeMenuInputActionType.compare("Keyboard", Qt::CaseInsensitive) == 0) 805 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard; 806 if (strRuntimeMenuInputActionType.compare("KeyboardSettings", Qt::CaseInsensitive) == 0) 807 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings; 808 if (strRuntimeMenuInputActionType.compare("SoftKeyboard", Qt::CaseInsensitive) == 0) 809 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard; 810 if (strRuntimeMenuInputActionType.compare("TypeCAD", Qt::CaseInsensitive) == 0) 811 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD; 807 812 #ifdef VBOX_WS_X11 808 keys << "TypeCABS"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS; 813 if (strRuntimeMenuInputActionType.compare("TypeCABS", Qt::CaseInsensitive) == 0) 814 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS; 809 815 #endif /* VBOX_WS_X11 */ 810 keys << "TypeCtrlBreak"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak; 811 keys << "TypeInsert"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert; 812 keys << "TypePrintScreen"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen; 813 keys << "TypeAltPrintScreen"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen; 814 keys << "Mouse"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse; 815 keys << "MouseIntegration"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration; 816 keys << "TypeHostKeyCombo"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo; 817 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_All; 818 /* Invalid type for unknown words: */ 819 if (!keys.contains(strRuntimeMenuInputActionType, Qt::CaseInsensitive)) 820 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid; 821 /* Corresponding type for known words: */ 822 return values.at(keys.indexOf(QRegExp(strRuntimeMenuInputActionType, Qt::CaseInsensitive))); 816 if (strRuntimeMenuInputActionType.compare("TypeCtrlBreak", Qt::CaseInsensitive) == 0) 817 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak; 818 if (strRuntimeMenuInputActionType.compare("TypeInsert", Qt::CaseInsensitive) == 0) 819 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert; 820 if (strRuntimeMenuInputActionType.compare("TypePrintScreen", Qt::CaseInsensitive) == 0) 821 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen; 822 if (strRuntimeMenuInputActionType.compare("TypeAltPrintScreen", Qt::CaseInsensitive) == 0) 823 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen; 824 if (strRuntimeMenuInputActionType.compare("Mouse", Qt::CaseInsensitive) == 0) 825 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse; 826 if (strRuntimeMenuInputActionType.compare("MouseIntegration", Qt::CaseInsensitive) == 0) 827 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration; 828 if (strRuntimeMenuInputActionType.compare("TypeHostKeyCombo", Qt::CaseInsensitive) == 0) 829 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo; 830 if (strRuntimeMenuInputActionType.compare("All", Qt::CaseInsensitive) == 0) 831 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_All; 832 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid; 823 833 } 824 834 … … 858 868 859 869 /* UIExtraDataMetaDefs::RuntimeMenuDevicesActionType <= QString: */ 860 template<> UIExtraDataMetaDefs::RuntimeMenuDevicesActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(const QString &strRuntimeMenuDevicesActionType) 861 { 862 /* Here we have some fancy stuff allowing us 863 * to search through the keys using 'case-insensitive' rule: */ 864 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType> values; 865 keys << "HardDrives"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives; 866 keys << "HardDrivesSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings; 867 keys << "OpticalDevices"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices; 868 keys << "FloppyDevices"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices; 869 keys << "Audio"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio; 870 keys << "AudioOutput"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput; 871 keys << "AudioInput"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput; 872 keys << "Network"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network; 873 keys << "NetworkSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings; 874 keys << "USBDevices"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices; 875 keys << "USBDevicesSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings; 876 keys << "WebCams"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams; 877 keys << "SharedClipboard"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard; 878 keys << "DragAndDrop"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop; 879 keys << "SharedFolders"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders; 880 keys << "SharedFoldersSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings; 881 keys << "InstallGuestTools"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools; 882 keys << "Nothing"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Nothing; 883 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_All; 884 /* Invalid type for unknown words: */ 885 if (!keys.contains(strRuntimeMenuDevicesActionType, Qt::CaseInsensitive)) 886 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid; 887 /* Corresponding type for known words: */ 888 return values.at(keys.indexOf(QRegExp(strRuntimeMenuDevicesActionType, Qt::CaseInsensitive))); 870 template<> UIExtraDataMetaDefs::RuntimeMenuDevicesActionType 871 fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(const QString &strRuntimeMenuDevicesActionType) 872 { 873 if (strRuntimeMenuDevicesActionType.compare("HardDrives", Qt::CaseInsensitive) == 0) 874 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives; 875 if (strRuntimeMenuDevicesActionType.compare("HardDrivesSettings", Qt::CaseInsensitive) == 0) 876 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings; 877 if (strRuntimeMenuDevicesActionType.compare("OpticalDevices", Qt::CaseInsensitive) == 0) 878 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices; 879 if (strRuntimeMenuDevicesActionType.compare("FloppyDevices", Qt::CaseInsensitive) == 0) 880 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices; 881 if (strRuntimeMenuDevicesActionType.compare("Audio", Qt::CaseInsensitive) == 0) 882 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio; 883 if (strRuntimeMenuDevicesActionType.compare("AudioOutput", Qt::CaseInsensitive) == 0) 884 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput; 885 if (strRuntimeMenuDevicesActionType.compare("AudioInput", Qt::CaseInsensitive) == 0) 886 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput; 887 if (strRuntimeMenuDevicesActionType.compare("Network", Qt::CaseInsensitive) == 0) 888 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network; 889 if (strRuntimeMenuDevicesActionType.compare("NetworkSettings", Qt::CaseInsensitive) == 0) 890 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings; 891 if (strRuntimeMenuDevicesActionType.compare("USBDevices", Qt::CaseInsensitive) == 0) 892 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices; 893 if (strRuntimeMenuDevicesActionType.compare("USBDevicesSettings", Qt::CaseInsensitive) == 0) 894 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings; 895 if (strRuntimeMenuDevicesActionType.compare("WebCams", Qt::CaseInsensitive) == 0) 896 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams; 897 if (strRuntimeMenuDevicesActionType.compare("SharedClipboard", Qt::CaseInsensitive) == 0) 898 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard; 899 if (strRuntimeMenuDevicesActionType.compare("DragAndDrop", Qt::CaseInsensitive) == 0) 900 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop; 901 if (strRuntimeMenuDevicesActionType.compare("SharedFolders", Qt::CaseInsensitive) == 0) 902 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders; 903 if (strRuntimeMenuDevicesActionType.compare("SharedFoldersSettings", Qt::CaseInsensitive) == 0) 904 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings; 905 if (strRuntimeMenuDevicesActionType.compare("InstallGuestTools", Qt::CaseInsensitive) == 0) 906 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools; 907 if (strRuntimeMenuDevicesActionType.compare("Nothing", Qt::CaseInsensitive) == 0) 908 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Nothing; 909 if (strRuntimeMenuDevicesActionType.compare("All", Qt::CaseInsensitive) == 0) 910 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_All; 911 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid; 889 912 } 890 913 … … 912 935 913 936 /* UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType <= QString: */ 914 template<> UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(const QString &strRuntimeMenuDebuggerActionType)915 { 916 /* Here we have some fancy stuff allowing us 917 * to search through the keys using 'case-insensitive' rule: */918 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType> values;919 keys << "Statistics"; values << UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics;920 keys << "CommandLine"; values <<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine;921 keys << "Logging"; values << UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging;922 keys << "LogDialog"; values << UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog;923 keys << "GuestControlConsole"; values << UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole;924 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All;925 /* Invalid type for unknown words: */926 if (!keys.contains(strRuntimeMenuDebuggerActionType, Qt::CaseInsensitive))927 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid;928 /* Corresponding type for known words: */929 return values.at(keys.indexOf(QRegExp(strRuntimeMenuDebuggerActionType, Qt::CaseInsensitive)));937 template<> UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType 938 fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(const QString &strRuntimeMenuDebuggerActionType) 939 { 940 if (strRuntimeMenuDebuggerActionType.compare("Statistics", Qt::CaseInsensitive) == 0) 941 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics; 942 if (strRuntimeMenuDebuggerActionType.compare("CommandLine", Qt::CaseInsensitive) == 0) 943 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine; 944 if (strRuntimeMenuDebuggerActionType.compare("Logging", Qt::CaseInsensitive) == 0) 945 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging; 946 if (strRuntimeMenuDebuggerActionType.compare("LogDialog", Qt::CaseInsensitive) == 0) 947 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog; 948 if (strRuntimeMenuDebuggerActionType.compare("GuestControlConsole", Qt::CaseInsensitive) == 0) 949 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole; 950 if (strRuntimeMenuDebuggerActionType.compare("All", Qt::CaseInsensitive) == 0) 951 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All; 952 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid; 930 953 } 931 954 #endif /* VBOX_WITH_DEBUGGER_GUI */ … … 951 974 952 975 /* UIExtraDataMetaDefs::MenuWindowActionType <= QString: */ 953 template<> UIExtraDataMetaDefs::MenuWindowActionType fromInternalString<UIExtraDataMetaDefs::MenuWindowActionType>(const QString &strMenuWindowActionType) 954 { 955 /* Here we have some fancy stuff allowing us 956 * to search through the keys using 'case-insensitive' rule: */ 957 QStringList keys; QList<UIExtraDataMetaDefs::MenuWindowActionType> values; 958 keys << "Minimize"; values << UIExtraDataMetaDefs::MenuWindowActionType_Minimize; 959 keys << "Switch"; values << UIExtraDataMetaDefs::MenuWindowActionType_Switch; 960 keys << "All"; values << UIExtraDataMetaDefs::MenuWindowActionType_All; 961 /* Invalid type for unknown words: */ 962 if (!keys.contains(strMenuWindowActionType, Qt::CaseInsensitive)) 963 return UIExtraDataMetaDefs::MenuWindowActionType_Invalid; 964 /* Corresponding type for known words: */ 965 return values.at(keys.indexOf(QRegExp(strMenuWindowActionType, Qt::CaseInsensitive))); 976 template<> UIExtraDataMetaDefs::MenuWindowActionType 977 fromInternalString<UIExtraDataMetaDefs::MenuWindowActionType>(const QString &strMenuWindowActionType) 978 { 979 if (strMenuWindowActionType.compare("Minimize", Qt::CaseInsensitive) == 0) 980 return UIExtraDataMetaDefs::MenuWindowActionType_Minimize; 981 if (strMenuWindowActionType.compare("Switch", Qt::CaseInsensitive) == 0) 982 return UIExtraDataMetaDefs::MenuWindowActionType_Switch; 983 if (strMenuWindowActionType.compare("All", Qt::CaseInsensitive) == 0) 984 return UIExtraDataMetaDefs::MenuWindowActionType_All; 985 return UIExtraDataMetaDefs::MenuWindowActionType_Invalid; 966 986 } 967 987 #endif /* VBOX_WS_MAC */ … … 1006 1026 1007 1027 /* UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral <= QString: */ 1008 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral>(const QString &strDetailsElementOptionTypeGeneral) 1009 { 1010 /* Here we have some fancy stuff allowing us 1011 * to search through the keys using 'case-insensitive' rule: */ 1012 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral> values; 1013 keys << "Name"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name; 1014 keys << "OS"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS; 1015 keys << "Location"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location; 1016 keys << "Groups"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups; 1017 /* Invalid type for unknown words: */ 1018 if (!keys.contains(strDetailsElementOptionTypeGeneral, Qt::CaseInsensitive)) 1019 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Invalid; 1020 /* Corresponding type for known words: */ 1021 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeGeneral, Qt::CaseInsensitive))); 1028 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral 1029 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral>(const QString &strDetailsElementOptionTypeGeneral) 1030 { 1031 if (strDetailsElementOptionTypeGeneral.compare("Name", Qt::CaseInsensitive) == 0) 1032 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name; 1033 if (strDetailsElementOptionTypeGeneral.compare("OS", Qt::CaseInsensitive) == 0) 1034 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS; 1035 if (strDetailsElementOptionTypeGeneral.compare("Location", Qt::CaseInsensitive) == 0) 1036 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location; 1037 if (strDetailsElementOptionTypeGeneral.compare("Groups", Qt::CaseInsensitive) == 0) 1038 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups; 1039 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Invalid; 1022 1040 } 1023 1041 … … 1067 1085 1068 1086 /* UIExtraDataMetaDefs::DetailsElementOptionTypeSystem <= QString: */ 1069 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSystem fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSystem>(const QString &strDetailsElementOptionTypeSystem) 1070 { 1071 /* Here we have some fancy stuff allowing us 1072 * to search through the keys using 'case-insensitive' rule: */ 1073 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeSystem> values; 1074 keys << "RAM"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM; 1075 keys << "CPUCount"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount; 1076 keys << "CPUExecutionCap"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap; 1077 keys << "BootOrder"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder; 1078 keys << "ChipsetType"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType; 1079 keys << "Firmware"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware; 1080 keys << "Acceleration"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration; 1081 /* Invalid type for unknown words: */ 1082 if (!keys.contains(strDetailsElementOptionTypeSystem, Qt::CaseInsensitive)) 1083 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Invalid; 1084 /* Corresponding type for known words: */ 1085 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeSystem, Qt::CaseInsensitive))); 1087 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSystem 1088 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSystem>(const QString &strDetailsElementOptionTypeSystem) 1089 { 1090 if (strDetailsElementOptionTypeSystem.compare("RAM", Qt::CaseInsensitive) == 0) 1091 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM; 1092 if (strDetailsElementOptionTypeSystem.compare("CPUCount", Qt::CaseInsensitive) == 0) 1093 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount; 1094 if (strDetailsElementOptionTypeSystem.compare("CPUExecutionCap", Qt::CaseInsensitive) == 0) 1095 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap; 1096 if (strDetailsElementOptionTypeSystem.compare("BootOrder", Qt::CaseInsensitive) == 0) 1097 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder; 1098 if (strDetailsElementOptionTypeSystem.compare("ChipsetType", Qt::CaseInsensitive) == 0) 1099 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType; 1100 if (strDetailsElementOptionTypeSystem.compare("Firmware", Qt::CaseInsensitive) == 0) 1101 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware; 1102 if (strDetailsElementOptionTypeSystem.compare("Acceleration", Qt::CaseInsensitive) == 0) 1103 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration; 1104 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Invalid; 1086 1105 } 1087 1106 … … 1131 1150 1132 1151 /* UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay <= QString: */ 1133 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay>(const QString &strDetailsElementOptionTypeDisplay) 1134 { 1135 /* Here we have some fancy stuff allowing us 1136 * to search through the keys using 'case-insensitive' rule: */ 1137 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay> values; 1138 keys << "VRAM"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM; 1139 keys << "ScreenCount"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount; 1140 keys << "ScaleFactor"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor; 1141 keys << "GraphicsController"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController; 1142 keys << "Acceleration"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration; 1143 keys << "VRDE"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE; 1144 keys << "Recording"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording; 1145 /* Invalid type for unknown words: */ 1146 if (!keys.contains(strDetailsElementOptionTypeDisplay, Qt::CaseInsensitive)) 1147 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Invalid; 1148 /* Corresponding type for known words: */ 1149 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeDisplay, Qt::CaseInsensitive))); 1152 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay 1153 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay>(const QString &strDetailsElementOptionTypeDisplay) 1154 { 1155 if (strDetailsElementOptionTypeDisplay.compare("VRAM", Qt::CaseInsensitive) == 0) 1156 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM; 1157 if (strDetailsElementOptionTypeDisplay.compare("ScreenCount", Qt::CaseInsensitive) == 0) 1158 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount; 1159 if (strDetailsElementOptionTypeDisplay.compare("ScaleFactor", Qt::CaseInsensitive) == 0) 1160 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor; 1161 if (strDetailsElementOptionTypeDisplay.compare("GraphicsController", Qt::CaseInsensitive) == 0) 1162 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController; 1163 if (strDetailsElementOptionTypeDisplay.compare("Acceleration", Qt::CaseInsensitive) == 0) 1164 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration; 1165 if (strDetailsElementOptionTypeDisplay.compare("VRDE", Qt::CaseInsensitive) == 0) 1166 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE; 1167 if (strDetailsElementOptionTypeDisplay.compare("Recording", Qt::CaseInsensitive) == 0) 1168 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording; 1169 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Invalid; 1150 1170 } 1151 1171 … … 1187 1207 1188 1208 /* UIExtraDataMetaDefs::DetailsElementOptionTypeStorage <= QString: */ 1189 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeStorage fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeStorage>(const QString &strDetailsElementOptionTypeStorage) 1190 { 1191 /* Here we have some fancy stuff allowing us 1192 * to search through the keys using 'case-insensitive' rule: */ 1193 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeStorage> values; 1194 keys << "HardDisks"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks; 1195 keys << "OpticalDevices"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices; 1196 keys << "FloppyDevices"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices; 1197 /* Invalid type for unknown words: */ 1198 if (!keys.contains(strDetailsElementOptionTypeStorage, Qt::CaseInsensitive)) 1199 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_Invalid; 1200 /* Corresponding type for known words: */ 1201 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeStorage, Qt::CaseInsensitive))); 1209 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeStorage 1210 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeStorage>(const QString &strDetailsElementOptionTypeStorage) 1211 { 1212 if (strDetailsElementOptionTypeStorage.compare("HardDisks", Qt::CaseInsensitive) == 0) 1213 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks; 1214 if (strDetailsElementOptionTypeStorage.compare("OpticalDevices", Qt::CaseInsensitive) == 0) 1215 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices; 1216 if (strDetailsElementOptionTypeStorage.compare("FloppyDevices", Qt::CaseInsensitive) == 0) 1217 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices; 1218 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_Invalid; 1202 1219 } 1203 1220 … … 1239 1256 1240 1257 /* UIExtraDataMetaDefs::DetailsElementOptionTypeAudio <= QString: */ 1241 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeAudio fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeAudio>(const QString &strDetailsElementOptionTypeAudio) 1242 { 1243 /* Here we have some fancy stuff allowing us 1244 * to search through the keys using 'case-insensitive' rule: */ 1245 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeAudio> values; 1246 keys << "Driver"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver; 1247 keys << "Controller"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller; 1248 keys << "IO"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO; 1249 /* Invalid type for unknown words: */ 1250 if (!keys.contains(strDetailsElementOptionTypeAudio, Qt::CaseInsensitive)) 1251 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Invalid; 1252 /* Corresponding type for known words: */ 1253 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeAudio, Qt::CaseInsensitive))); 1258 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeAudio 1259 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeAudio>(const QString &strDetailsElementOptionTypeAudio) 1260 { 1261 if (strDetailsElementOptionTypeAudio.compare("Driver", Qt::CaseInsensitive) == 0) 1262 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver; 1263 if (strDetailsElementOptionTypeAudio.compare("Controller", Qt::CaseInsensitive) == 0) 1264 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller; 1265 if (strDetailsElementOptionTypeAudio.compare("IO", Qt::CaseInsensitive) == 0) 1266 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO; 1267 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Invalid; 1254 1268 } 1255 1269 … … 1311 1325 1312 1326 /* UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork <= QString: */ 1313 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork>(const QString &strDetailsElementOptionTypeNetwork) 1314 { 1315 /* Here we have some fancy stuff allowing us 1316 * to search through the keys using 'case-insensitive' rule: */ 1317 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork> values; 1318 keys << "NotAttached"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached; 1319 keys << "NAT"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT; 1320 keys << "BridgetAdapter"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgetAdapter; 1321 keys << "InternalNetwork"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork; 1322 keys << "HostOnlyAdapter"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter; 1323 keys << "GenericDriver"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver; 1324 keys << "NATNetwork"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork; 1327 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork 1328 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork>(const QString &strDetailsElementOptionTypeNetwork) 1329 { 1330 if (strDetailsElementOptionTypeNetwork.compare("NotAttached", Qt::CaseInsensitive) == 0) 1331 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached; 1332 if (strDetailsElementOptionTypeNetwork.compare("NAT", Qt::CaseInsensitive) == 0) 1333 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT; 1334 if (strDetailsElementOptionTypeNetwork.compare("BridgetAdapter", Qt::CaseInsensitive) == 0) 1335 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgetAdapter; 1336 if (strDetailsElementOptionTypeNetwork.compare("InternalNetwork", Qt::CaseInsensitive) == 0) 1337 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork; 1338 if (strDetailsElementOptionTypeNetwork.compare("HostOnlyAdapter", Qt::CaseInsensitive) == 0) 1339 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter; 1340 if (strDetailsElementOptionTypeNetwork.compare("GenericDriver", Qt::CaseInsensitive) == 0) 1341 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver; 1342 if (strDetailsElementOptionTypeNetwork.compare("NATNetwork", Qt::CaseInsensitive) == 0) 1343 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork; 1325 1344 #ifdef VBOX_WITH_CLOUD_NET 1326 keys << "CloudNetwork"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_CloudNetwork; 1345 if (strDetailsElementOptionTypeNetwork.compare("CloudNetwork", Qt::CaseInsensitive) == 0) 1346 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_CloudNetwork; 1327 1347 #endif 1328 1348 #ifdef VBOX_WITH_VMNET 1329 keys << "HostOnlyNetwork"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyNetwork; 1349 if (strDetailsElementOptionTypeNetwork.compare("HostOnlyNetwork", Qt::CaseInsensitive) == 0) 1350 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyNetwork; 1330 1351 #endif 1331 /* Invalid type for unknown words: */ 1332 if (!keys.contains(strDetailsElementOptionTypeNetwork, Qt::CaseInsensitive)) 1333 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid; 1334 /* Corresponding type for known words: */ 1335 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeNetwork, Qt::CaseInsensitive))); 1352 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid; 1336 1353 } 1337 1354 … … 1377 1394 1378 1395 /* UIExtraDataMetaDefs::DetailsElementOptionTypeSerial <= QString: */ 1379 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSerial fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSerial>(const QString &strDetailsElementOptionTypeSerial) 1380 { 1381 /* Here we have some fancy stuff allowing us 1382 * to search through the keys using 'case-insensitive' rule: */ 1383 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeSerial> values; 1384 keys << "Disconnected"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected; 1385 keys << "HostPipe"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe; 1386 keys << "HostDevice"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice; 1387 keys << "RawFile"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile; 1388 keys << "TCP"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP; 1389 /* Invalid type for unknown words: */ 1390 if (!keys.contains(strDetailsElementOptionTypeSerial, Qt::CaseInsensitive)) 1391 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Invalid; 1392 /* Corresponding type for known words: */ 1393 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeSerial, Qt::CaseInsensitive))); 1396 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSerial 1397 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSerial>(const QString &strDetailsElementOptionTypeSerial) 1398 { 1399 if (strDetailsElementOptionTypeSerial.compare("Disconnected", Qt::CaseInsensitive) == 0) 1400 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected; 1401 if (strDetailsElementOptionTypeSerial.compare("HostPipe", Qt::CaseInsensitive) == 0) 1402 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe; 1403 if (strDetailsElementOptionTypeSerial.compare("HostDevice", Qt::CaseInsensitive) == 0) 1404 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice; 1405 if (strDetailsElementOptionTypeSerial.compare("RawFile", Qt::CaseInsensitive) == 0) 1406 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile; 1407 if (strDetailsElementOptionTypeSerial.compare("TCP", Qt::CaseInsensitive) == 0) 1408 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP; 1409 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Invalid; 1394 1410 } 1395 1411 … … 1429 1445 1430 1446 /* UIExtraDataMetaDefs::DetailsElementOptionTypeUsb <= QString: */ 1431 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeUsb fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeUsb>(const QString &strDetailsElementOptionTypeUsb) 1432 { 1433 /* Here we have some fancy stuff allowing us 1434 * to search through the keys using 'case-insensitive' rule: */ 1435 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeUsb> values; 1436 keys << "Controller"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller; 1437 keys << "DeviceFilters"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters; 1438 /* Invalid type for unknown words: */ 1439 if (!keys.contains(strDetailsElementOptionTypeUsb, Qt::CaseInsensitive)) 1440 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Invalid; 1441 /* Corresponding type for known words: */ 1442 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeUsb, Qt::CaseInsensitive))); 1447 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeUsb 1448 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeUsb>(const QString &strDetailsElementOptionTypeUsb) 1449 { 1450 if (strDetailsElementOptionTypeUsb.compare("Controller", Qt::CaseInsensitive) == 0) 1451 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller; 1452 if (strDetailsElementOptionTypeUsb.compare("DeviceFilters", Qt::CaseInsensitive) == 0) 1453 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters; 1454 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Invalid; 1443 1455 } 1444 1456 … … 1474 1486 1475 1487 /* UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders <= QString: */ 1476 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders>(const QString &strDetailsElementOptionTypeSharedFolders) 1477 { 1478 /* Here we have some fancy stuff allowing us 1479 * to search through the keys using 'case-insensitive' rule: */ 1480 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders> values; 1481 /* Invalid type for unknown words: */ 1482 if (!keys.contains(strDetailsElementOptionTypeSharedFolders, Qt::CaseInsensitive)) 1483 return UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders_Invalid; 1484 /* Corresponding type for known words: */ 1485 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeSharedFolders, Qt::CaseInsensitive))); 1488 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders 1489 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders>(const QString &strDetailsElementOptionTypeSharedFolders) 1490 { 1491 RT_NOREF(strDetailsElementOptionTypeSharedFolders); 1492 return UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders_Invalid; 1486 1493 } 1487 1494 … … 1525 1532 1526 1533 /* UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface <= QString: */ 1527 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface>(const QString &strDetailsElementOptionTypeUserInterface) 1528 { 1529 /* Here we have some fancy stuff allowing us 1530 * to search through the keys using 'case-insensitive' rule: */ 1531 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface> values; 1532 keys << "VisualState"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState; 1533 keys << "MenuBar"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar; 1534 keys << "StatusBar"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar; 1535 keys << "MiniToolbar"; values << UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar; 1536 /* Invalid type for unknown words: */ 1537 if (!keys.contains(strDetailsElementOptionTypeUserInterface, Qt::CaseInsensitive)) 1538 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_Invalid; 1539 /* Corresponding type for known words: */ 1540 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeUserInterface, Qt::CaseInsensitive))); 1534 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface 1535 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface>(const QString &strDetailsElementOptionTypeUserInterface) 1536 { 1537 if (strDetailsElementOptionTypeUserInterface.compare("VisualState", Qt::CaseInsensitive) == 0) 1538 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState; 1539 if (strDetailsElementOptionTypeUserInterface.compare("MenuBar", Qt::CaseInsensitive) == 0) 1540 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar; 1541 if (strDetailsElementOptionTypeUserInterface.compare("StatusBar", Qt::CaseInsensitive) == 0) 1542 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar; 1543 if (strDetailsElementOptionTypeUserInterface.compare("MiniToolbar", Qt::CaseInsensitive) == 0) 1544 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar; 1545 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_Invalid; 1541 1546 } 1542 1547 … … 1572 1577 1573 1578 /* UIExtraDataMetaDefs::DetailsElementOptionTypeDescription <= QString: */ 1574 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeDescription fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription>(const QString &strDetailsElementOptionTypeDescription) 1575 { 1576 /* Here we have some fancy stuff allowing us 1577 * to search through the keys using 'case-insensitive' rule: */ 1578 QStringList keys; QList<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription> values; 1579 /* Invalid type for unknown words: */ 1580 if (!keys.contains(strDetailsElementOptionTypeDescription, Qt::CaseInsensitive)) 1581 return UIExtraDataMetaDefs::DetailsElementOptionTypeDescription_Invalid; 1582 /* Corresponding type for known words: */ 1583 return values.at(keys.indexOf(QRegExp(strDetailsElementOptionTypeDescription, Qt::CaseInsensitive))); 1579 template<> UIExtraDataMetaDefs::DetailsElementOptionTypeDescription 1580 fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription>(const QString &strDetailsElementOptionTypeDescription) 1581 { 1582 RT_NOREF(strDetailsElementOptionTypeDescription); 1583 return UIExtraDataMetaDefs::DetailsElementOptionTypeDescription_Invalid; 1584 1584 } 1585 1585 … … 1623 1623 template<> UIColorThemeType fromInternalString<UIColorThemeType>(const QString &strColorThemeType) 1624 1624 { 1625 /* Here we have some fancy stuff allowing us 1626 * to search through the keys using 'case-insensitive' rule: */ 1627 QStringList keys; QList<UIColorThemeType> values; 1628 keys << "Light"; values << UIColorThemeType_Light; 1629 keys << "Dark"; values << UIColorThemeType_Dark; 1630 /* Auto type for unknown words: */ 1631 if (!keys.contains(strColorThemeType, Qt::CaseInsensitive)) 1632 return UIColorThemeType_Auto; 1633 /* Corresponding type for known words: */ 1634 return values.at(keys.indexOf(QRegExp(strColorThemeType, Qt::CaseInsensitive))); 1625 if (strColorThemeType.compare("Light", Qt::CaseInsensitive) == 0) 1626 return UIColorThemeType_Light; 1627 if (strColorThemeType.compare("Dark", Qt::CaseInsensitive) == 0) 1628 return UIColorThemeType_Dark; 1629 return UIColorThemeType_Auto; 1635 1630 } 1636 1631 … … 1665 1660 template<> UIToolType fromInternalString<UIToolType>(const QString &strToolType) 1666 1661 { 1667 /* Here we have some fancy stuff allowing us 1668 * to search through the keys using 'case-insensitive' rule: */ 1669 QStringList keys; QList<UIToolType> values; 1670 keys << "Welcome"; values << UIToolType_Welcome; 1671 keys << "Extensions"; values << UIToolType_Extensions; 1672 keys << "Media"; values << UIToolType_Media; 1673 keys << "Network"; values << UIToolType_Network; 1674 keys << "Cloud"; values << UIToolType_Cloud; 1675 keys << "CloudConsole"; values << UIToolType_CloudConsole; 1676 keys << "Activities"; values << UIToolType_VMActivityOverview; 1677 keys << "Details"; values << UIToolType_Details; 1678 keys << "Snapshots"; values << UIToolType_Snapshots; 1679 keys << "Logs"; values << UIToolType_Logs; 1680 keys << "Activity"; values << UIToolType_VMActivity; 1681 keys << "FileManager"; values << UIToolType_FileManager; 1682 /* Invalid type for unknown words: */ 1683 if (!keys.contains(strToolType, Qt::CaseInsensitive)) 1684 return UIToolType_Invalid; 1685 /* Corresponding type for known words: */ 1686 return values.at(keys.indexOf(QRegExp(strToolType, Qt::CaseInsensitive))); 1662 if (strToolType.compare("Welcome", Qt::CaseInsensitive) == 0) 1663 return UIToolType_Welcome; 1664 if (strToolType.compare("Extensions", Qt::CaseInsensitive) == 0) 1665 return UIToolType_Extensions; 1666 if (strToolType.compare("Media", Qt::CaseInsensitive) == 0) 1667 return UIToolType_Media; 1668 if (strToolType.compare("Network", Qt::CaseInsensitive) == 0) 1669 return UIToolType_Network; 1670 if (strToolType.compare("Cloud", Qt::CaseInsensitive) == 0) 1671 return UIToolType_Cloud; 1672 if (strToolType.compare("CloudConsole", Qt::CaseInsensitive) == 0) 1673 return UIToolType_CloudConsole; 1674 if (strToolType.compare("Activities", Qt::CaseInsensitive) == 0) 1675 return UIToolType_VMActivityOverview; 1676 if (strToolType.compare("Details", Qt::CaseInsensitive) == 0) 1677 return UIToolType_Details; 1678 if (strToolType.compare("Snapshots", Qt::CaseInsensitive) == 0) 1679 return UIToolType_Snapshots; 1680 if (strToolType.compare("Logs", Qt::CaseInsensitive) == 0) 1681 return UIToolType_Logs; 1682 if (strToolType.compare("Activity", Qt::CaseInsensitive) == 0) 1683 return UIToolType_VMActivity; 1684 if (strToolType.compare("FileManager", Qt::CaseInsensitive) == 0) 1685 return UIToolType_FileManager; 1686 return UIToolType_Invalid; 1687 1687 } 1688 1688 … … 1729 1729 template<> UIVisualStateType fromInternalString<UIVisualStateType>(const QString &strVisualStateType) 1730 1730 { 1731 /* Here we have some fancy stuff allowing us 1732 * to search through the keys using 'case-insensitive' rule: */ 1733 QStringList keys; QList<UIVisualStateType> values; 1734 keys << "Normal"; values << UIVisualStateType_Normal; 1735 keys << "Fullscreen"; values << UIVisualStateType_Fullscreen; 1736 keys << "Seamless"; values << UIVisualStateType_Seamless; 1737 keys << "Scale"; values << UIVisualStateType_Scale; 1738 keys << "All"; values << UIVisualStateType_All; 1739 /* Invalid type for unknown words: */ 1740 if (!keys.contains(strVisualStateType, Qt::CaseInsensitive)) 1741 return UIVisualStateType_Invalid; 1742 /* Corresponding type for known words: */ 1743 return values.at(keys.indexOf(QRegExp(strVisualStateType, Qt::CaseInsensitive))); 1731 if (strVisualStateType.compare("Normal", Qt::CaseInsensitive) == 0) 1732 return UIVisualStateType_Normal; 1733 if (strVisualStateType.compare("Fullscreen", Qt::CaseInsensitive) == 0) 1734 return UIVisualStateType_Fullscreen; 1735 if (strVisualStateType.compare("Seamless", Qt::CaseInsensitive) == 0) 1736 return UIVisualStateType_Seamless; 1737 if (strVisualStateType.compare("Scale", Qt::CaseInsensitive) == 0) 1738 return UIVisualStateType_Scale; 1739 if (strVisualStateType.compare("All", Qt::CaseInsensitive) == 0) 1740 return UIVisualStateType_All; 1741 return UIVisualStateType_Invalid; 1744 1742 } 1745 1743 … … 1774 1772 template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType) 1775 1773 { 1776 /* Here we have some fancy stuff allowing us 1777 * to search through the keys using 'case-insensitive' rule: */ 1778 QStringList keys; QList<DetailsElementType> values; 1779 keys << QApplication::translate("UICommon", "General", "DetailsElementType"); values << DetailsElementType_General; 1780 keys << QApplication::translate("UICommon", "Preview", "DetailsElementType"); values << DetailsElementType_Preview; 1781 keys << QApplication::translate("UICommon", "System", "DetailsElementType"); values << DetailsElementType_System; 1782 keys << QApplication::translate("UICommon", "Display", "DetailsElementType"); values << DetailsElementType_Display; 1783 keys << QApplication::translate("UICommon", "Storage", "DetailsElementType"); values << DetailsElementType_Storage; 1784 keys << QApplication::translate("UICommon", "Audio", "DetailsElementType"); values << DetailsElementType_Audio; 1785 keys << QApplication::translate("UICommon", "Network", "DetailsElementType"); values << DetailsElementType_Network; 1786 keys << QApplication::translate("UICommon", "Serial ports", "DetailsElementType"); values << DetailsElementType_Serial; 1787 keys << QApplication::translate("UICommon", "USB", "DetailsElementType"); values << DetailsElementType_USB; 1788 keys << QApplication::translate("UICommon", "Shared folders", "DetailsElementType"); values << DetailsElementType_SF; 1789 keys << QApplication::translate("UICommon", "User interface", "DetailsElementType"); values << DetailsElementType_UI; 1790 keys << QApplication::translate("UICommon", "Description", "DetailsElementType"); values << DetailsElementType_Description; 1791 /* Invalid type for unknown words: */ 1792 if (!keys.contains(strDetailsElementType, Qt::CaseInsensitive)) 1793 return DetailsElementType_Invalid; 1794 /* Corresponding type for known words: */ 1795 return values.at(keys.indexOf(QRegExp(strDetailsElementType, Qt::CaseInsensitive))); 1774 if (strDetailsElementType.compare(QApplication::translate("UICommon", "General", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1775 return DetailsElementType_General; 1776 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Preview", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1777 return DetailsElementType_Preview; 1778 if (strDetailsElementType.compare(QApplication::translate("UICommon", "System", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1779 return DetailsElementType_System; 1780 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Display", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1781 return DetailsElementType_Display; 1782 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Storage", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1783 return DetailsElementType_Storage; 1784 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Audio", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1785 return DetailsElementType_Audio; 1786 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Network", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1787 return DetailsElementType_Network; 1788 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Serial ports", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1789 return DetailsElementType_Serial; 1790 if (strDetailsElementType.compare(QApplication::translate("UICommon", "USB", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1791 return DetailsElementType_USB; 1792 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Shared folders", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1793 return DetailsElementType_SF; 1794 if (strDetailsElementType.compare(QApplication::translate("UICommon", "User interface", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1795 return DetailsElementType_UI; 1796 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Description", "DetailsElementType"), Qt::CaseInsensitive) == 0) 1797 return DetailsElementType_Description; 1798 return DetailsElementType_Invalid; 1796 1799 } 1797 1800 … … 1826 1829 template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType) 1827 1830 { 1828 /* Here we have some fancy stuff allowing us 1829 * to search through the keys using 'case-insensitive' rule: */ 1830 QStringList keys; QList<DetailsElementType> values; 1831 keys << "general"; values << DetailsElementType_General; 1832 keys << "preview"; values << DetailsElementType_Preview; 1833 keys << "system"; values << DetailsElementType_System; 1834 keys << "display"; values << DetailsElementType_Display; 1835 keys << "storage"; values << DetailsElementType_Storage; 1836 keys << "audio"; values << DetailsElementType_Audio; 1837 keys << "network"; values << DetailsElementType_Network; 1838 keys << "serialPorts"; values << DetailsElementType_Serial; 1839 keys << "usb"; values << DetailsElementType_USB; 1840 keys << "sharedFolders"; values << DetailsElementType_SF; 1841 keys << "userInterface"; values << DetailsElementType_UI; 1842 keys << "description"; values << DetailsElementType_Description; 1843 /* Invalid type for unknown words: */ 1844 if (!keys.contains(strDetailsElementType, Qt::CaseInsensitive)) 1845 return DetailsElementType_Invalid; 1846 /* Corresponding type for known words: */ 1847 return values.at(keys.indexOf(QRegExp(strDetailsElementType, Qt::CaseInsensitive))); 1831 if (strDetailsElementType.compare("general", Qt::CaseInsensitive) == 0) 1832 return DetailsElementType_General; 1833 if (strDetailsElementType.compare("preview", Qt::CaseInsensitive) == 0) 1834 return DetailsElementType_Preview; 1835 if (strDetailsElementType.compare("system", Qt::CaseInsensitive) == 0) 1836 return DetailsElementType_System; 1837 if (strDetailsElementType.compare("display", Qt::CaseInsensitive) == 0) 1838 return DetailsElementType_Display; 1839 if (strDetailsElementType.compare("storage", Qt::CaseInsensitive) == 0) 1840 return DetailsElementType_Storage; 1841 if (strDetailsElementType.compare("audio", Qt::CaseInsensitive) == 0) 1842 return DetailsElementType_Audio; 1843 if (strDetailsElementType.compare("network", Qt::CaseInsensitive) == 0) 1844 return DetailsElementType_Network; 1845 if (strDetailsElementType.compare("serialPorts", Qt::CaseInsensitive) == 0) 1846 return DetailsElementType_Serial; 1847 if (strDetailsElementType.compare("usb", Qt::CaseInsensitive) == 0) 1848 return DetailsElementType_USB; 1849 if (strDetailsElementType.compare("sharedFolders", Qt::CaseInsensitive) == 0) 1850 return DetailsElementType_SF; 1851 if (strDetailsElementType.compare("userInterface", Qt::CaseInsensitive) == 0) 1852 return DetailsElementType_UI; 1853 if (strDetailsElementType.compare("description", Qt::CaseInsensitive) == 0) 1854 return DetailsElementType_Description; 1855 return DetailsElementType_Invalid; 1848 1856 } 1849 1857 … … 1895 1903 template<> PreviewUpdateIntervalType fromInternalString<PreviewUpdateIntervalType>(const QString &strPreviewUpdateIntervalType) 1896 1904 { 1897 /* Here we have some fancy stuff allowing us 1898 * to search through the keys using 'case-insensitive' rule: */ 1899 QStringList keys; QList<PreviewUpdateIntervalType> values; 1900 keys << "disabled"; values << PreviewUpdateIntervalType_Disabled; 1901 keys << "500"; values << PreviewUpdateIntervalType_500ms; 1902 keys << "1000"; values << PreviewUpdateIntervalType_1000ms; 1903 keys << "2000"; values << PreviewUpdateIntervalType_2000ms; 1904 keys << "5000"; values << PreviewUpdateIntervalType_5000ms; 1905 keys << "10000"; values << PreviewUpdateIntervalType_10000ms; 1906 /* 1000ms type for unknown words: */ 1907 if (!keys.contains(strPreviewUpdateIntervalType, Qt::CaseInsensitive)) 1905 if (strPreviewUpdateIntervalType.compare("disabled", Qt::CaseInsensitive) == 0) 1906 return PreviewUpdateIntervalType_Disabled; 1907 if (strPreviewUpdateIntervalType.compare("500", Qt::CaseInsensitive) == 0) 1908 return PreviewUpdateIntervalType_500ms; 1909 if (strPreviewUpdateIntervalType.compare("1000", Qt::CaseInsensitive) == 0) 1908 1910 return PreviewUpdateIntervalType_1000ms; 1909 /* Corresponding type for known words: */ 1910 return values.at(keys.indexOf(QRegExp(strPreviewUpdateIntervalType, Qt::CaseInsensitive))); 1911 if (strPreviewUpdateIntervalType.compare("2000", Qt::CaseInsensitive) == 0) 1912 return PreviewUpdateIntervalType_2000ms; 1913 if (strPreviewUpdateIntervalType.compare("5000", Qt::CaseInsensitive) == 0) 1914 return PreviewUpdateIntervalType_5000ms; 1915 if (strPreviewUpdateIntervalType.compare("10000", Qt::CaseInsensitive) == 0) 1916 return PreviewUpdateIntervalType_10000ms; 1917 /* 1000ms type for unknown input: */ 1918 return PreviewUpdateIntervalType_1000ms; 1911 1919 } 1912 1920 … … 1972 1980 template<> GUIFeatureType fromInternalString<GUIFeatureType>(const QString &strGuiFeatureType) 1973 1981 { 1974 /* Here we have some fancy stuff allowing us 1975 * to search through the keys using 'case-insensitive' rule: */ 1976 QStringList keys; QList<GUIFeatureType> values; 1977 keys << "noSelector"; values << GUIFeatureType_NoSelector; 1982 if (strGuiFeatureType.compare("noSelector", Qt::CaseInsensitive) == 0) 1983 return GUIFeatureType_NoSelector; 1978 1984 #ifdef VBOX_WS_MAC 1979 keys << "noUserElements"; values << GUIFeatureType_NoUserElements; 1985 if (strGuiFeatureType.compare("noUserElements", Qt::CaseInsensitive) == 0) 1986 return GUIFeatureType_NoUserElements; 1980 1987 #else 1981 keys << "noMenuBar"; values << GUIFeatureType_NoMenuBar; 1988 if (strGuiFeatureType.compare("noMenuBar", Qt::CaseInsensitive) == 0) 1989 return GUIFeatureType_NoMenuBar; 1982 1990 #endif 1983 keys << "noStatusBar"; values << GUIFeatureType_NoStatusBar; 1984 /* None type for unknown words: */ 1985 if (!keys.contains(strGuiFeatureType, Qt::CaseInsensitive)) 1986 return GUIFeatureType_None; 1987 /* Corresponding type for known words: */ 1988 return values.at(keys.indexOf(QRegExp(strGuiFeatureType, Qt::CaseInsensitive))); 1991 if (strGuiFeatureType.compare("noStatusBar", Qt::CaseInsensitive) == 0) 1992 return GUIFeatureType_NoStatusBar; 1993 return GUIFeatureType_None; 1989 1994 } 1990 1995 … … 2018 2023 template<> GlobalSettingsPageType fromInternalString<GlobalSettingsPageType>(const QString &strGlobalSettingsPageType) 2019 2024 { 2020 /* Here we have some fancy stuff allowing us 2021 * to search through the keys using 'case-insensitive' rule: */ 2022 QStringList keys; QList<GlobalSettingsPageType> values; 2023 keys << "General"; values << GlobalSettingsPageType_General; 2024 keys << "Input"; values << GlobalSettingsPageType_Input; 2025 if (strGlobalSettingsPageType.compare("General", Qt::CaseInsensitive) == 0) 2026 return GlobalSettingsPageType_General; 2027 if (strGlobalSettingsPageType.compare("Input", Qt::CaseInsensitive) == 0) 2028 return GlobalSettingsPageType_Input; 2025 2029 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 2026 keys << "Update"; values << GlobalSettingsPageType_Update; 2030 if (strGlobalSettingsPageType.compare("Update", Qt::CaseInsensitive) == 0) 2031 return GlobalSettingsPageType_Update; 2027 2032 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 2028 keys << "Language"; values << GlobalSettingsPageType_Language; 2029 keys << "Display"; values << GlobalSettingsPageType_Display; 2033 if (strGlobalSettingsPageType.compare("Language", Qt::CaseInsensitive) == 0) 2034 return GlobalSettingsPageType_Language; 2035 if (strGlobalSettingsPageType.compare("Display", Qt::CaseInsensitive) == 0) 2036 return GlobalSettingsPageType_Display; 2030 2037 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 2031 keys << "Proxy"; values << GlobalSettingsPageType_Proxy; 2038 if (strGlobalSettingsPageType.compare("Proxy", Qt::CaseInsensitive) == 0) 2039 return GlobalSettingsPageType_Proxy; 2032 2040 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 2033 keys << "Interface"; values << GlobalSettingsPageType_Interface; 2034 /* Invalid type for unknown words: */ 2035 if (!keys.contains(strGlobalSettingsPageType, Qt::CaseInsensitive)) 2036 return GlobalSettingsPageType_Invalid; 2037 /* Corresponding type for known words: */ 2038 return values.at(keys.indexOf(QRegExp(strGlobalSettingsPageType, Qt::CaseInsensitive))); 2041 if (strGlobalSettingsPageType.compare("Interface", Qt::CaseInsensitive) == 0) 2042 return GlobalSettingsPageType_Interface; 2043 return GlobalSettingsPageType_Invalid; 2039 2044 } 2040 2045 … … 2089 2094 template<> MachineSettingsPageType fromInternalString<MachineSettingsPageType>(const QString &strMachineSettingsPageType) 2090 2095 { 2091 /* Here we have some fancy stuff allowing us 2092 * to search through the keys using 'case-insensitive' rule: */ 2093 QStringList keys; QList<MachineSettingsPageType> values; 2094 keys << "General"; values << MachineSettingsPageType_General; 2095 keys << "System"; values << MachineSettingsPageType_System; 2096 keys << "Display"; values << MachineSettingsPageType_Display; 2097 keys << "Storage"; values << MachineSettingsPageType_Storage; 2098 keys << "Audio"; values << MachineSettingsPageType_Audio; 2099 keys << "Network"; values << MachineSettingsPageType_Network; 2100 keys << "Ports"; values << MachineSettingsPageType_Ports; 2101 keys << "Serial"; values << MachineSettingsPageType_Serial; 2102 keys << "USB"; values << MachineSettingsPageType_USB; 2103 keys << "SharedFolders"; values << MachineSettingsPageType_SF; 2104 keys << "Interface"; values << MachineSettingsPageType_Interface; 2105 /* Invalid type for unknown words: */ 2106 if (!keys.contains(strMachineSettingsPageType, Qt::CaseInsensitive)) 2107 return MachineSettingsPageType_Invalid; 2108 /* Corresponding type for known words: */ 2109 return values.at(keys.indexOf(QRegExp(strMachineSettingsPageType, Qt::CaseInsensitive))); 2096 if (strMachineSettingsPageType.compare("General", Qt::CaseInsensitive) == 0) 2097 return MachineSettingsPageType_General; 2098 if (strMachineSettingsPageType.compare("System", Qt::CaseInsensitive) == 0) 2099 return MachineSettingsPageType_System; 2100 if (strMachineSettingsPageType.compare("Display", Qt::CaseInsensitive) == 0) 2101 return MachineSettingsPageType_Display; 2102 if (strMachineSettingsPageType.compare("Storage", Qt::CaseInsensitive) == 0) 2103 return MachineSettingsPageType_Storage; 2104 if (strMachineSettingsPageType.compare("Audio", Qt::CaseInsensitive) == 0) 2105 return MachineSettingsPageType_Audio; 2106 if (strMachineSettingsPageType.compare("Network", Qt::CaseInsensitive) == 0) 2107 return MachineSettingsPageType_Network; 2108 if (strMachineSettingsPageType.compare("Ports", Qt::CaseInsensitive) == 0) 2109 return MachineSettingsPageType_Ports; 2110 if (strMachineSettingsPageType.compare("Serial", Qt::CaseInsensitive) == 0) 2111 return MachineSettingsPageType_Serial; 2112 if (strMachineSettingsPageType.compare("USB", Qt::CaseInsensitive) == 0) 2113 return MachineSettingsPageType_USB; 2114 if (strMachineSettingsPageType.compare("SharedFolders", Qt::CaseInsensitive) == 0) 2115 return MachineSettingsPageType_SF; 2116 if (strMachineSettingsPageType.compare("Interface", Qt::CaseInsensitive) == 0) 2117 return MachineSettingsPageType_Interface; 2118 return MachineSettingsPageType_Invalid; 2110 2119 } 2111 2120 … … 2157 2166 template<> WizardType fromInternalString<WizardType>(const QString &strWizardType) 2158 2167 { 2159 /* Here we have some fancy stuff allowing us 2160 * to search through the keys using 'case-insensitive' rule: */ 2161 QStringList keys; QList<WizardType> values; 2162 keys << "NewVM"; values << WizardType_NewVM; 2163 keys << "CloneVM"; values << WizardType_CloneVM; 2164 keys << "ExportAppliance"; values << WizardType_ExportAppliance; 2165 keys << "ImportAppliance"; values << WizardType_ImportAppliance; 2166 keys << "NewCloudVM"; values << WizardType_NewCloudVM; 2167 keys << "AddCloudVM"; values << WizardType_AddCloudVM; 2168 keys << "NewVD"; values << WizardType_NewVD; 2169 keys << "CloneVD"; values << WizardType_CloneVD; 2170 /* Invalid type for unknown words: */ 2171 if (!keys.contains(strWizardType, Qt::CaseInsensitive)) 2172 return WizardType_Invalid; 2173 /* Corresponding type for known words: */ 2174 return values.at(keys.indexOf(QRegExp(strWizardType, Qt::CaseInsensitive))); 2168 if (strWizardType.compare("NewVM", Qt::CaseInsensitive) == 0) 2169 return WizardType_NewVM; 2170 if (strWizardType.compare("CloneVM", Qt::CaseInsensitive) == 0) 2171 return WizardType_CloneVM; 2172 if (strWizardType.compare("ExportAppliance", Qt::CaseInsensitive) == 0) 2173 return WizardType_ExportAppliance; 2174 if (strWizardType.compare("ImportAppliance", Qt::CaseInsensitive) == 0) 2175 return WizardType_ImportAppliance; 2176 if (strWizardType.compare("NewCloudVM", Qt::CaseInsensitive) == 0) 2177 return WizardType_NewCloudVM; 2178 if (strWizardType.compare("AddCloudVM", Qt::CaseInsensitive) == 0) 2179 return WizardType_AddCloudVM; 2180 if (strWizardType.compare("NewVD", Qt::CaseInsensitive) == 0) 2181 return WizardType_NewVD; 2182 if (strWizardType.compare("CloneVD", Qt::CaseInsensitive) == 0) 2183 return WizardType_CloneVD; 2184 return WizardType_Invalid; 2175 2185 } 2176 2186 … … 2205 2215 template<> IndicatorType fromInternalString<IndicatorType>(const QString &strIndicatorType) 2206 2216 { 2207 /* Here we have some fancy stuff allowing us 2208 * to search through the keys using 'case-insensitive' rule: */ 2209 QStringList keys; QList<IndicatorType> values; 2210 keys << "HardDisks"; values << IndicatorType_HardDisks; 2211 keys << "OpticalDisks"; values << IndicatorType_OpticalDisks; 2212 keys << "FloppyDisks"; values << IndicatorType_FloppyDisks; 2213 keys << "Audio"; values << IndicatorType_Audio; 2214 keys << "Network"; values << IndicatorType_Network; 2215 keys << "USB"; values << IndicatorType_USB; 2216 keys << "SharedFolders"; values << IndicatorType_SharedFolders; 2217 keys << "Display"; values << IndicatorType_Display; 2218 keys << "Recording"; values << IndicatorType_Recording; 2219 keys << "Features"; values << IndicatorType_Features; 2220 keys << "Mouse"; values << IndicatorType_Mouse; 2221 keys << "Keyboard"; values << IndicatorType_Keyboard; 2222 /* Invalid type for unknown words: */ 2223 if (!keys.contains(strIndicatorType, Qt::CaseInsensitive)) 2224 return IndicatorType_Invalid; 2225 /* Corresponding type for known words: */ 2226 return values.at(keys.indexOf(QRegExp(strIndicatorType, Qt::CaseInsensitive))); 2217 if (strIndicatorType.compare("HardDisks", Qt::CaseInsensitive) == 0) 2218 return IndicatorType_HardDisks; 2219 if (strIndicatorType.compare("OpticalDisks", Qt::CaseInsensitive) == 0) 2220 return IndicatorType_OpticalDisks; 2221 if (strIndicatorType.compare("FloppyDisks", Qt::CaseInsensitive) == 0) 2222 return IndicatorType_FloppyDisks; 2223 if (strIndicatorType.compare("Audio", Qt::CaseInsensitive) == 0) 2224 return IndicatorType_Audio; 2225 if (strIndicatorType.compare("Network", Qt::CaseInsensitive) == 0) 2226 return IndicatorType_Network; 2227 if (strIndicatorType.compare("USB", Qt::CaseInsensitive) == 0) 2228 return IndicatorType_USB; 2229 if (strIndicatorType.compare("SharedFolders", Qt::CaseInsensitive) == 0) 2230 return IndicatorType_SharedFolders; 2231 if (strIndicatorType.compare("Display", Qt::CaseInsensitive) == 0) 2232 return IndicatorType_Display; 2233 if (strIndicatorType.compare("Recording", Qt::CaseInsensitive) == 0) 2234 return IndicatorType_Recording; 2235 if (strIndicatorType.compare("Features", Qt::CaseInsensitive) == 0) 2236 return IndicatorType_Features; 2237 if (strIndicatorType.compare("Mouse", Qt::CaseInsensitive) == 0) 2238 return IndicatorType_Mouse; 2239 if (strIndicatorType.compare("Keyboard", Qt::CaseInsensitive) == 0) 2240 return IndicatorType_Keyboard; 2241 return IndicatorType_Invalid; 2227 2242 } 2228 2243 … … 2302 2317 template<> MachineCloseAction fromInternalString<MachineCloseAction>(const QString &strMachineCloseAction) 2303 2318 { 2304 /* Here we have some fancy stuff allowing us 2305 * to search through the keys using 'case-insensitive' rule: */ 2306 QStringList keys; QList<MachineCloseAction> values; 2307 keys << "Detach"; values << MachineCloseAction_Detach; 2308 keys << "SaveState"; values << MachineCloseAction_SaveState; 2309 keys << "Shutdown"; values << MachineCloseAction_Shutdown; 2310 keys << "PowerOff"; values << MachineCloseAction_PowerOff; 2311 /* Invalid type for unknown words: */ 2312 if (!keys.contains(strMachineCloseAction, Qt::CaseInsensitive)) 2313 return MachineCloseAction_Invalid; 2314 /* Corresponding type for known words: */ 2315 return values.at(keys.indexOf(QRegExp(strMachineCloseAction, Qt::CaseInsensitive))); 2319 if (strMachineCloseAction.compare("Detach", Qt::CaseInsensitive) == 0) 2320 return MachineCloseAction_Detach; 2321 if (strMachineCloseAction.compare("SaveState", Qt::CaseInsensitive) == 0) 2322 return MachineCloseAction_SaveState; 2323 if (strMachineCloseAction.compare("Shutdown", Qt::CaseInsensitive) == 0) 2324 return MachineCloseAction_Shutdown; 2325 if (strMachineCloseAction.compare("PowerOff", Qt::CaseInsensitive) == 0) 2326 return MachineCloseAction_PowerOff; 2327 return MachineCloseAction_Invalid; 2316 2328 } 2317 2329 … … 2334 2346 template<> MouseCapturePolicy fromInternalString<MouseCapturePolicy>(const QString &strMouseCapturePolicy) 2335 2347 { 2336 /* Here we have some fancy stuff allowing us 2337 * to search through the keys using 'case-insensitive' rule: */ 2338 QStringList keys; QList<MouseCapturePolicy> values; 2339 keys << "Default"; values << MouseCapturePolicy_Default; 2340 keys << "HostComboOnly"; values << MouseCapturePolicy_HostComboOnly; 2341 keys << "Disabled"; values << MouseCapturePolicy_Disabled; 2342 /* Default type for unknown words: */ 2343 if (!keys.contains(strMouseCapturePolicy, Qt::CaseInsensitive)) 2348 if (strMouseCapturePolicy.compare("Default", Qt::CaseInsensitive) == 0) 2344 2349 return MouseCapturePolicy_Default; 2345 /* Corresponding type for known words: */ 2346 return values.at(keys.indexOf(QRegExp(strMouseCapturePolicy, Qt::CaseInsensitive))); 2350 if (strMouseCapturePolicy.compare("HostComboOnly", Qt::CaseInsensitive) == 0) 2351 return MouseCapturePolicy_HostComboOnly; 2352 if (strMouseCapturePolicy.compare("Disabled", Qt::CaseInsensitive) == 0) 2353 return MouseCapturePolicy_Disabled; 2354 return MouseCapturePolicy_Default; 2347 2355 } 2348 2356 … … 2368 2376 template<> GuruMeditationHandlerType fromInternalString<GuruMeditationHandlerType>(const QString &strGuruMeditationHandlerType) 2369 2377 { 2370 /* Here we have some fancy stuff allowing us 2371 * to search through the keys using 'case-insensitive' rule: */ 2372 QStringList keys; QList<GuruMeditationHandlerType> values; 2373 keys << "Default"; values << GuruMeditationHandlerType_Default; 2374 keys << "PowerOff"; values << GuruMeditationHandlerType_PowerOff; 2375 keys << "Ignore"; values << GuruMeditationHandlerType_Ignore; 2376 /* Default type for unknown words: */ 2377 if (!keys.contains(strGuruMeditationHandlerType, Qt::CaseInsensitive)) 2378 if (strGuruMeditationHandlerType.compare("Default", Qt::CaseInsensitive) == 0) 2378 2379 return GuruMeditationHandlerType_Default; 2379 /* Corresponding type for known words: */ 2380 return values.at(keys.indexOf(QRegExp(strGuruMeditationHandlerType, Qt::CaseInsensitive))); 2380 if (strGuruMeditationHandlerType.compare("PowerOff", Qt::CaseInsensitive) == 0) 2381 return GuruMeditationHandlerType_PowerOff; 2382 if (strGuruMeditationHandlerType.compare("Ignore", Qt::CaseInsensitive) == 0) 2383 return GuruMeditationHandlerType_Ignore; 2384 return GuruMeditationHandlerType_Default; 2381 2385 } 2382 2386 … … 2401 2405 template<> ScalingOptimizationType fromInternalString<ScalingOptimizationType>(const QString &strOptimizationType) 2402 2406 { 2403 /* Here we have some fancy stuff allowing us 2404 * to search through the keys using 'case-insensitive' rule: */ 2405 QStringList keys; QList<ScalingOptimizationType> values; 2406 keys << "None"; values << ScalingOptimizationType_None; 2407 keys << "Performance"; values << ScalingOptimizationType_Performance; 2408 /* 'None' type for empty/unknown words: */ 2409 if (!keys.contains(strOptimizationType, Qt::CaseInsensitive)) 2407 if (strOptimizationType.compare("None", Qt::CaseInsensitive) == 0) 2410 2408 return ScalingOptimizationType_None; 2411 /* Corresponding type for known words: */ 2412 return values.at(keys.indexOf(QRegExp(strOptimizationType, Qt::CaseInsensitive))); 2409 if (strOptimizationType.compare("Performance", Qt::CaseInsensitive) == 0) 2410 return ScalingOptimizationType_Performance; 2411 return ScalingOptimizationType_None; 2413 2412 } 2414 2413 2415 2414 #ifndef VBOX_WS_MAC 2415 2416 2416 /* QString <= MiniToolbarAlignment: */ 2417 2417 template<> QString toInternalString(const MiniToolbarAlignment &miniToolbarAlignment) … … 2431 2431 template<> MiniToolbarAlignment fromInternalString<MiniToolbarAlignment>(const QString &strMiniToolbarAlignment) 2432 2432 { 2433 /* Here we have some fancy stuff allowing us 2434 * to search through the keys using 'case-insensitive' rule: */ 2435 QStringList keys; QList<MiniToolbarAlignment> values; 2436 keys << "Bottom"; values << MiniToolbarAlignment_Bottom; 2437 keys << "Top"; values << MiniToolbarAlignment_Top; 2438 /* Bottom type for unknown words: */ 2439 if (!keys.contains(strMiniToolbarAlignment, Qt::CaseInsensitive)) 2433 if (strMiniToolbarAlignment.compare("Bottom", Qt::CaseInsensitive) == 0) 2440 2434 return MiniToolbarAlignment_Bottom; 2441 /* Corresponding type for known words: */ 2442 return values.at(keys.indexOf(QRegExp(strMiniToolbarAlignment, Qt::CaseInsensitive))); 2443 } 2435 if (strMiniToolbarAlignment.compare("Top", Qt::CaseInsensitive) == 0) 2436 return MiniToolbarAlignment_Top; 2437 return MiniToolbarAlignment_Bottom; 2438 } 2439 2444 2440 #endif /* !VBOX_WS_MAC */ 2445 2441 … … 2477 2473 template<> InformationElementType fromString<InformationElementType>(const QString &strInformationElementType) 2478 2474 { 2479 /* Here we have some fancy stuff allowing us 2480 * to search through the keys using 'case-insensitive' rule: */ 2481 QStringList keys; QList<InformationElementType> values; 2482 keys << QApplication::translate("UICommon", "General", "InformationElementType"); values << InformationElementType_General; 2483 keys << QApplication::translate("UICommon", "Preview", "InformationElementType"); values << InformationElementType_Preview; 2484 keys << QApplication::translate("UICommon", "System", "InformationElementType"); values << InformationElementType_System; 2485 keys << QApplication::translate("UICommon", "Display", "InformationElementType"); values << InformationElementType_Display; 2486 keys << QApplication::translate("UICommon", "Storage", "InformationElementType"); values << InformationElementType_Storage; 2487 keys << QApplication::translate("UICommon", "Audio", "InformationElementType"); values << InformationElementType_Audio; 2488 keys << QApplication::translate("UICommon", "Network", "InformationElementType"); values << InformationElementType_Network; 2489 keys << QApplication::translate("UICommon", "Serial ports", "InformationElementType"); values << InformationElementType_Serial; 2490 keys << QApplication::translate("UICommon", "USB", "InformationElementType"); values << InformationElementType_USB; 2491 keys << QApplication::translate("UICommon", "Shared folders", "InformationElementType"); values << InformationElementType_SharedFolders; 2492 keys << QApplication::translate("UICommon", "User interface", "InformationElementType"); values << InformationElementType_UI; 2493 keys << QApplication::translate("UICommon", "Description", "InformationElementType"); values << InformationElementType_Description; 2494 keys << QApplication::translate("UICommon", "Runtime attributes", "InformationElementType"); values << InformationElementType_RuntimeAttributes; 2495 keys << QApplication::translate("UICommon", "Storage statistics", "InformationElementType"); values << InformationElementType_StorageStatistics; 2496 keys << QApplication::translate("UICommon", "Network statistics", "InformationElementType"); values << InformationElementType_NetworkStatistics; 2497 /* Invalid type for unknown words: */ 2498 if (!keys.contains(strInformationElementType, Qt::CaseInsensitive)) 2499 return InformationElementType_Invalid; 2500 /* Corresponding type for known words: */ 2501 return values.at(keys.indexOf(QRegExp(strInformationElementType, Qt::CaseInsensitive))); 2475 if (strInformationElementType.compare(QApplication::translate("UICommon", "General", "InformationElementType"), Qt::CaseInsensitive) == 0) 2476 return InformationElementType_General; 2477 if (strInformationElementType.compare(QApplication::translate("UICommon", "Preview", "InformationElementType"), Qt::CaseInsensitive) == 0) 2478 return InformationElementType_Preview; 2479 if (strInformationElementType.compare(QApplication::translate("UICommon", "System", "InformationElementType"), Qt::CaseInsensitive) == 0) 2480 return InformationElementType_System; 2481 if (strInformationElementType.compare(QApplication::translate("UICommon", "Display", "InformationElementType"), Qt::CaseInsensitive) == 0) 2482 return InformationElementType_Display; 2483 if (strInformationElementType.compare(QApplication::translate("UICommon", "Storage", "InformationElementType"), Qt::CaseInsensitive) == 0) 2484 return InformationElementType_Storage; 2485 if (strInformationElementType.compare(QApplication::translate("UICommon", "Audio", "InformationElementType"), Qt::CaseInsensitive) == 0) 2486 return InformationElementType_Audio; 2487 if (strInformationElementType.compare(QApplication::translate("UICommon", "Network", "InformationElementType"), Qt::CaseInsensitive) == 0) 2488 return InformationElementType_Network; 2489 if (strInformationElementType.compare(QApplication::translate("UICommon", "Serial ports", "InformationElementType"), Qt::CaseInsensitive) == 0) 2490 return InformationElementType_Serial; 2491 if (strInformationElementType.compare(QApplication::translate("UICommon", "USB", "InformationElementType"), Qt::CaseInsensitive) == 0) 2492 return InformationElementType_USB; 2493 if (strInformationElementType.compare(QApplication::translate("UICommon", "Shared folders", "InformationElementType"), Qt::CaseInsensitive) == 0) 2494 return InformationElementType_SharedFolders; 2495 if (strInformationElementType.compare(QApplication::translate("UICommon", "User interface", "InformationElementType"), Qt::CaseInsensitive) == 0) 2496 return InformationElementType_UI; 2497 if (strInformationElementType.compare(QApplication::translate("UICommon", "Description", "InformationElementType"), Qt::CaseInsensitive) == 0) 2498 return InformationElementType_Description; 2499 if (strInformationElementType.compare(QApplication::translate("UICommon", "Runtime attributes", "InformationElementType"), Qt::CaseInsensitive) == 0) 2500 return InformationElementType_RuntimeAttributes; 2501 if (strInformationElementType.compare(QApplication::translate("UICommon", "Storage statistics", "InformationElementType"), Qt::CaseInsensitive) == 0) 2502 return InformationElementType_StorageStatistics; 2503 if (strInformationElementType.compare(QApplication::translate("UICommon", "Network statistics", "InformationElementType"), Qt::CaseInsensitive) == 0) 2504 return InformationElementType_NetworkStatistics; 2505 return InformationElementType_Invalid; 2502 2506 } 2503 2507 … … 2533 2537 template<> InformationElementType fromInternalString<InformationElementType>(const QString &strInformationElementType) 2534 2538 { 2535 /* Here we have some fancy stuff allowing us 2536 * to search through the keys using 'case-insensitive' rule: */ 2537 QStringList keys; QList<InformationElementType> values; 2538 keys << "general"; values << InformationElementType_General; 2539 keys << "preview"; values << InformationElementType_Preview; 2540 keys << "system"; values << InformationElementType_System; 2541 keys << "display"; values << InformationElementType_Display; 2542 keys << "storage"; values << InformationElementType_Storage; 2543 keys << "audio"; values << InformationElementType_Audio; 2544 keys << "network"; values << InformationElementType_Network; 2545 keys << "serialPorts"; values << InformationElementType_Serial; 2546 keys << "usb"; values << InformationElementType_USB; 2547 keys << "sharedFolders"; values << InformationElementType_SharedFolders; 2548 keys << "userInterface"; values << InformationElementType_UI; 2549 keys << "description"; values << InformationElementType_Description; 2550 keys << "runtime-attributes"; values << InformationElementType_RuntimeAttributes; 2551 /* Invalid type for unknown words: */ 2552 if (!keys.contains(strInformationElementType, Qt::CaseInsensitive)) 2553 return InformationElementType_Invalid; 2554 /* Corresponding type for known words: */ 2555 return values.at(keys.indexOf(QRegExp(strInformationElementType, Qt::CaseInsensitive))); 2539 if (strInformationElementType.compare("general", Qt::CaseInsensitive) == 0) 2540 return InformationElementType_General; 2541 if (strInformationElementType.compare("preview", Qt::CaseInsensitive) == 0) 2542 return InformationElementType_Preview; 2543 if (strInformationElementType.compare("system", Qt::CaseInsensitive) == 0) 2544 return InformationElementType_System; 2545 if (strInformationElementType.compare("display", Qt::CaseInsensitive) == 0) 2546 return InformationElementType_Display; 2547 if (strInformationElementType.compare("storage", Qt::CaseInsensitive) == 0) 2548 return InformationElementType_Storage; 2549 if (strInformationElementType.compare("audio", Qt::CaseInsensitive) == 0) 2550 return InformationElementType_Audio; 2551 if (strInformationElementType.compare("network", Qt::CaseInsensitive) == 0) 2552 return InformationElementType_Network; 2553 if (strInformationElementType.compare("serialPorts", Qt::CaseInsensitive) == 0) 2554 return InformationElementType_Serial; 2555 if (strInformationElementType.compare("usb", Qt::CaseInsensitive) == 0) 2556 return InformationElementType_USB; 2557 if (strInformationElementType.compare("sharedFolders", Qt::CaseInsensitive) == 0) 2558 return InformationElementType_SharedFolders; 2559 if (strInformationElementType.compare("userInterface", Qt::CaseInsensitive) == 0) 2560 return InformationElementType_UI; 2561 if (strInformationElementType.compare("description", Qt::CaseInsensitive) == 0) 2562 return InformationElementType_Description; 2563 if (strInformationElementType.compare("runtime-attributes", Qt::CaseInsensitive) == 0) 2564 return InformationElementType_RuntimeAttributes; 2565 return InformationElementType_Invalid; 2556 2566 } 2557 2567 … … 2621 2631 2622 2632 /* MaximumGuestScreenSizePolicy <= QString: */ 2623 template<> MaximumGuestScreenSizePolicy fromInternalString<MaximumGuestScreenSizePolicy>(const QString &strMaximumGuestScreenSizePolicy) 2624 { 2625 /* Here we have some fancy stuff allowing us 2626 * to search through the keys using 'case-insensitive' rule: */ 2627 QStringList keys; QList<MaximumGuestScreenSizePolicy> values; 2628 keys << "auto"; values << MaximumGuestScreenSizePolicy_Automatic; 2629 /* Auto type for empty value: */ 2630 if (strMaximumGuestScreenSizePolicy.isEmpty()) 2633 template<> MaximumGuestScreenSizePolicy 2634 fromInternalString<MaximumGuestScreenSizePolicy>(const QString &strMaximumGuestScreenSizePolicy) 2635 { 2636 if ( strMaximumGuestScreenSizePolicy.isEmpty() 2637 || strMaximumGuestScreenSizePolicy.compare("auto", Qt::CaseInsensitive) == 0) 2631 2638 return MaximumGuestScreenSizePolicy_Automatic; 2639 if (strMaximumGuestScreenSizePolicy.compare("any", Qt::CaseInsensitive) == 0) 2640 return MaximumGuestScreenSizePolicy_Any; 2632 2641 /* Fixed type for value which can be parsed: */ 2633 2642 if (QRegularExpression("[1-9]\\d*,[1-9]\\d*").match(strMaximumGuestScreenSizePolicy).hasMatch()) 2634 2643 return MaximumGuestScreenSizePolicy_Fixed; 2635 /* Any type for unknown words: */ 2636 if (!keys.contains(strMaximumGuestScreenSizePolicy, Qt::CaseInsensitive)) 2637 return MaximumGuestScreenSizePolicy_Any; 2638 /* Corresponding type for known words: */ 2639 return values.at(keys.indexOf(QRegExp(strMaximumGuestScreenSizePolicy, Qt::CaseInsensitive))); 2644 return MaximumGuestScreenSizePolicy_Any; 2640 2645 } 2641 2646 … … 2685 2690 template<> UIMediumFormat fromInternalString<UIMediumFormat>(const QString &strUIMediumFormat) 2686 2691 { 2687 /* Here we have some fancy stuff allowing us 2688 * to search through the keys using 'case-insensitive' rule: */ 2689 QStringList keys; QList<UIMediumFormat> values; 2690 keys << "VDI"; values << UIMediumFormat_VDI; 2691 keys << "VMDK"; values << UIMediumFormat_VMDK; 2692 keys << "VHD"; values << UIMediumFormat_VHD; 2693 keys << "Parallels"; values << UIMediumFormat_Parallels; 2694 keys << "QED"; values << UIMediumFormat_QED; 2695 keys << "QCOW"; values << UIMediumFormat_QCOW; 2696 /* VDI format for unknown words: */ 2697 if (!keys.contains(strUIMediumFormat, Qt::CaseInsensitive)) 2692 if (strUIMediumFormat.compare("VDI", Qt::CaseInsensitive) == 0) 2698 2693 return UIMediumFormat_VDI; 2699 /* Corresponding format for known words: */ 2700 return values.at(keys.indexOf(QRegExp(strUIMediumFormat, Qt::CaseInsensitive))); 2694 if (strUIMediumFormat.compare("VMDK", Qt::CaseInsensitive) == 0) 2695 return UIMediumFormat_VMDK; 2696 if (strUIMediumFormat.compare("VHD", Qt::CaseInsensitive) == 0) 2697 return UIMediumFormat_VHD; 2698 if (strUIMediumFormat.compare("Parallels", Qt::CaseInsensitive) == 0) 2699 return UIMediumFormat_Parallels; 2700 if (strUIMediumFormat.compare("QED", Qt::CaseInsensitive) == 0) 2701 return UIMediumFormat_QED; 2702 if (strUIMediumFormat.compare("QCOW", Qt::CaseInsensitive) == 0) 2703 return UIMediumFormat_QCOW; 2704 return UIMediumFormat_VDI; 2701 2705 } 2702 2706 … … 2722 2726 template<> UISettingsDefs::RecordingMode fromString<UISettingsDefs::RecordingMode>(const QString &strRecordingMode) 2723 2727 { 2724 /* Here we have some fancy stuff allowing us 2725 * to search through the keys using 'case-insensitive' rule: */ 2726 QStringList keys; QList<UISettingsDefs::RecordingMode> values; 2727 keys << "Video/Audio"; values << UISettingsDefs::RecordingMode_VideoAudio; 2728 keys << "Video Only"; values << UISettingsDefs::RecordingMode_VideoOnly; 2729 keys << "Audio Only"; values << UISettingsDefs::RecordingMode_AudioOnly; 2730 /* Video/Audio for unknown words: */ 2731 if (!keys.contains(strRecordingMode, Qt::CaseInsensitive)) 2728 if (strRecordingMode.compare("Video/Audio", Qt::CaseInsensitive) == 0) 2732 2729 return UISettingsDefs::RecordingMode_VideoAudio; 2733 /* Corresponding format for known words: */ 2734 return values.at(keys.indexOf(QRegExp(strRecordingMode, Qt::CaseInsensitive))); 2730 if (strRecordingMode.compare("Video Only", Qt::CaseInsensitive) == 0) 2731 return UISettingsDefs::RecordingMode_VideoOnly; 2732 if (strRecordingMode.compare("Audio Only", Qt::CaseInsensitive) == 0) 2733 return UISettingsDefs::RecordingMode_AudioOnly; 2734 return UISettingsDefs::RecordingMode_VideoAudio; 2735 2735 } 2736 2736 … … 2765 2765 template<> VMActivityOverviewColumn fromInternalString<VMActivityOverviewColumn>(const QString &strVMActivityOverviewColumn) 2766 2766 { 2767 QStringList keys; QList<VMActivityOverviewColumn> values; 2768 keys << "VMName"; values << VMActivityOverviewColumn_Name; 2769 keys << "CPUGuestLoad"; values << VMActivityOverviewColumn_CPUGuestLoad; 2770 keys << "CPUVMMLoad"; values << VMActivityOverviewColumn_CPUVMMLoad; 2771 keys << "RAMUsedAndTotal"; values << VMActivityOverviewColumn_RAMUsedAndTotal; 2772 keys << "RAMUsedPercentage"; values << VMActivityOverviewColumn_RAMUsedPercentage; 2773 keys << "NetworkUpRate"; values << VMActivityOverviewColumn_NetworkUpRate; 2774 keys << "NetworkDownRate"; values << VMActivityOverviewColumn_NetworkDownRate; 2775 keys << "NetworkUpTotal"; values << VMActivityOverviewColumn_NetworkUpTotal; 2776 keys << "NetworkDownTotal"; values << VMActivityOverviewColumn_NetworkDownTotal; 2777 keys << "DiskIOReadRate"; values << VMActivityOverviewColumn_DiskIOReadRate; 2778 keys << "DiskIOWriteRate"; values << VMActivityOverviewColumn_DiskIOWriteRate; 2779 keys << "DiskIOReadTotal"; values << VMActivityOverviewColumn_DiskIOReadTotal; 2780 keys << "DiskIOWriteTotal"; values << VMActivityOverviewColumn_DiskIOWriteTotal; 2781 keys << "VMExits"; values << VMActivityOverviewColumn_VMExits; 2782 if (!keys.contains(strVMActivityOverviewColumn, Qt::CaseInsensitive)) 2783 return VMActivityOverviewColumn_Max; 2784 /* Corresponding format for known words: */ 2785 return values.at(keys.indexOf(QRegExp(strVMActivityOverviewColumn, Qt::CaseInsensitive))); 2786 } 2767 if (strVMActivityOverviewColumn.compare("VMName", Qt::CaseInsensitive) == 0) 2768 return VMActivityOverviewColumn_Name; 2769 if (strVMActivityOverviewColumn.compare("CPUGuestLoad", Qt::CaseInsensitive) == 0) 2770 return VMActivityOverviewColumn_CPUGuestLoad; 2771 if (strVMActivityOverviewColumn.compare("CPUVMMLoad", Qt::CaseInsensitive) == 0) 2772 return VMActivityOverviewColumn_CPUVMMLoad; 2773 if (strVMActivityOverviewColumn.compare("RAMUsedAndTotal", Qt::CaseInsensitive) == 0) 2774 return VMActivityOverviewColumn_RAMUsedAndTotal; 2775 if (strVMActivityOverviewColumn.compare("RAMUsedPercentage", Qt::CaseInsensitive) == 0) 2776 return VMActivityOverviewColumn_RAMUsedPercentage; 2777 if (strVMActivityOverviewColumn.compare("NetworkUpRate", Qt::CaseInsensitive) == 0) 2778 return VMActivityOverviewColumn_NetworkUpRate; 2779 if (strVMActivityOverviewColumn.compare("NetworkDownRate", Qt::CaseInsensitive) == 0) 2780 return VMActivityOverviewColumn_NetworkDownRate; 2781 if (strVMActivityOverviewColumn.compare("NetworkUpTotal", Qt::CaseInsensitive) == 0) 2782 return VMActivityOverviewColumn_NetworkUpTotal; 2783 if (strVMActivityOverviewColumn.compare("NetworkDownTotal", Qt::CaseInsensitive) == 0) 2784 return VMActivityOverviewColumn_NetworkDownTotal; 2785 if (strVMActivityOverviewColumn.compare("DiskIOReadRate", Qt::CaseInsensitive) == 0) 2786 return VMActivityOverviewColumn_DiskIOReadRate; 2787 if (strVMActivityOverviewColumn.compare("DiskIOWriteRate", Qt::CaseInsensitive) == 0) 2788 return VMActivityOverviewColumn_DiskIOWriteRate; 2789 if (strVMActivityOverviewColumn.compare("DiskIOReadTotal", Qt::CaseInsensitive) == 0) 2790 return VMActivityOverviewColumn_DiskIOReadTotal; 2791 if (strVMActivityOverviewColumn.compare("DiskIOWriteTotal", Qt::CaseInsensitive) == 0) 2792 return VMActivityOverviewColumn_DiskIOWriteTotal; 2793 if (strVMActivityOverviewColumn.compare("VMExits", Qt::CaseInsensitive) == 0) 2794 return VMActivityOverviewColumn_VMExits; 2795 return VMActivityOverviewColumn_Max; 2796 }
Note:
See TracChangeset
for help on using the changeset viewer.