Changeset 51401 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 26, 2014 4:45:43 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxAboutDlg.cpp
r47086 r51401 31 31 # include "VBoxAboutDlg.h" 32 32 # include "VBoxGlobal.h" 33 # include "UIConverter.h" 34 # include "UIExtraDataManager.h" 33 35 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 34 36 … … 105 107 QString strAboutText = tr("VirtualBox Graphical User Interface"); 106 108 #ifdef DEBUG 107 QString strRenderingInfo(" (%1)"); 108 QString strRenderingMode("QImage"); 109 # ifdef VBOX_GUI_USE_QUARTZ2D 110 if (vboxGlobal().vmRenderMode() == Quartz2DMode) 111 strRenderingMode = "Quartz2D"; 112 # endif /* VBOX_GUI_USE_QUARTZ2D */ 113 strAboutText += strRenderingInfo.arg(strRenderingMode); 109 strAboutText += QString(" (%1)").arg(gpConverter->toString(gEDataManager->renderMode(vboxGlobal().managedVMUuid()))); 114 110 #endif /* DEBUG */ 115 111 #ifdef VBOX_BLEEDING_EDGE -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r49940 r51401 32 32 #include "UIMessageCenter.h" 33 33 #include "UIPopupCenter.h" 34 #include "UIExtraDataDefs.h" 34 35 #include "VBoxGlobal.h" 35 36 -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r51214 r51401 72 72 #endif /* VBOX_WITH_DEBUGGER_GUI */ 73 73 template<> bool canConvert<RuntimeMenuHelpActionType>(); 74 template<> bool canConvert<RenderMode>(); 74 75 template<> bool canConvert<UIVisualStateType>(); 75 76 template<> bool canConvert<DetailsElementType>(); … … 128 129 template<> QString toInternalString(const RuntimeMenuHelpActionType &runtimeMenuHelpActionType); 129 130 template<> RuntimeMenuHelpActionType fromInternalString<RuntimeMenuHelpActionType>(const QString &strRuntimeMenuHelpActionType); 131 template<> QString toInternalString(const RenderMode &renderMode); 132 template<> RenderMode fromInternalString<RenderMode>(const QString &strRenderMode); 130 133 template<> QString toInternalString(const UIVisualStateType &visualStateType); 131 134 template<> UIVisualStateType fromInternalString<UIVisualStateType>(const QString &strVisualStateType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r51398 r51401 44 44 #endif /* VBOX_WITH_DEBUGGER_GUI */ 45 45 template<> bool canConvert<RuntimeMenuHelpActionType>() { return true; } 46 template<> bool canConvert<RenderMode>() { return true; } 46 47 template<> bool canConvert<UIVisualStateType>() { return true; } 47 48 template<> bool canConvert<DetailsElementType>() { return true; } … … 675 676 } 676 677 678 /* QString <= RenderMode: */ 679 template<> QString toInternalString(const RenderMode &renderMode) 680 { 681 QString strResult; 682 switch (renderMode) 683 { 684 case RenderMode_QImage: strResult = "QImage"; break; 685 #ifdef VBOX_GUI_USE_QUARTZ2D 686 case RenderMode_Quartz2D: strResult = "Quartz2D"; break; 687 #endif /* VBOX_GUI_USE_QUARTZ2D */ 688 default: 689 { 690 AssertMsgFailed(("No text for render-mode=%d", renderMode)); 691 break; 692 } 693 } 694 return strResult; 695 } 696 697 /* RenderMode <= QString: */ 698 template<> RenderMode fromInternalString<RenderMode>(const QString &strRenderMode) 699 { 700 /* Here we have some fancy stuff allowing us 701 * to search through the keys using 'case-insensitive' rule: */ 702 QStringList keys; QList<RenderMode> values; 703 keys << "QImage"; values << RenderMode_QImage; 704 #ifdef VBOX_GUI_USE_QUARTZ2D 705 keys << "Quartz2D"; values << RenderMode_Quartz2D; 706 #endif /* VBOX_GUI_USE_QUARTZ2D */ 707 /* Invalid mode for unknown words: */ 708 if (!keys.contains(strRenderMode, Qt::CaseInsensitive)) 709 return RenderMode_Invalid; 710 /* Corresponding mode for known words: */ 711 return values.at(keys.indexOf(QRegExp(strRenderMode, Qt::CaseInsensitive))); 712 } 713 677 714 /* QString <= UIVisualStateType: */ 678 715 template<> QString toInternalString(const UIVisualStateType &visualStateType) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r51398 r51401 345 345 enum RenderMode 346 346 { 347 InvalidRenderMode348 , QImageMode347 RenderMode_Invalid, 348 RenderMode_QImage, 349 349 #ifdef VBOX_GUI_USE_QUARTZ2D 350 , Quartz2DMode350 RenderMode_Quartz2D 351 351 #endif /* VBOX_GUI_USE_QUARTZ2D */ 352 352 }; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51363 r51401 303 303 } 304 304 305 RenderMode UIExtraDataManager::renderMode(const QString &strId) const 306 { 307 RenderMode rm = gpConverter->fromInternalString<RenderMode>(extraDataString(GUI_RenderMode, strId)); 308 printf("RenderMode=%d\n", (int)rm); 309 return rm; 310 } 311 305 312 bool UIExtraDataManager::isFirstRun(const QString &strId) const 306 313 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51363 r51401 130 130 /** Defines @a mode (basic/expert) for wizard of @a type. */ 131 131 void setModeForWizard(WizardType type, WizardMode mode); 132 133 /** Returns render-mode for machine with passed @a strId. */ 134 RenderMode renderMode(const QString &strId) const; 132 135 133 136 /** Returns whether this machine started for the first time. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r51322 r51401 178 178 // VBoxGlobal 179 179 //////////////////////////////////////////////////////////////////////////////// 180 181 /** @internal182 *183 * Determines the rendering mode from the argument. Sets the appropriate184 * default rendering mode if the argument is NULL.185 */186 static RenderMode vboxGetRenderMode (const char *aModeStr)187 {188 RenderMode mode = InvalidRenderMode;189 190 #ifdef VBOX_GUI_USE_QIMAGE191 mode = QImageMode;192 #else /* !VBOX_GUI_USE_QIMAGE */193 # error "Cannot determine the default render mode!"194 #endif /* !VBOX_GUI_USE_QIMAGE */195 196 if (aModeStr)197 {198 if (0) ;199 #ifdef VBOX_GUI_USE_QIMAGE200 else if (::strcmp(aModeStr, "image") == 0)201 mode = QImageMode;202 #endif /* VBOX_GUI_USE_QIMAGE */203 #ifdef VBOX_GUI_USE_QUARTZ2D204 else if (::strcmp(aModeStr, "quartz2d") == 0)205 mode = Quartz2DMode;206 #endif /* VBOX_GUI_USE_QUARTZ2D */207 }208 209 return mode;210 }211 180 212 181 /* static */ … … 4055 4024 bool bForceFullscreen = false; 4056 4025 4057 vm_render_mode_str = RTStrDup (virtualBox()4058 .GetExtraData (GUI_RenderMode).toAscii().constData());4059 4060 4026 #ifdef Q_WS_X11 4061 4027 mIsKWinManaged = X11IsWindowManagerKWin(); … … 4112 4078 { 4113 4079 ++i; 4114 }4115 else if (!::strcmp (arg, "-rmode") || !::strcmp (arg, "--rmode"))4116 {4117 if (++i < argc)4118 vm_render_mode_str = qApp->argv() [i];4119 4080 } 4120 4081 else if (!::strcmp (arg, "--settingspw")) … … 4284 4245 } 4285 4246 4286 vm_render_mode = vboxGetRenderMode (vm_render_mode_str);4287 4288 4247 #ifdef VBOX_WITH_DEBUGGER_GUI 4289 4248 /* setup the debugger gui. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r51187 r51401 33 33 #include "UIDefs.h" 34 34 #include "UIMediumDefs.h" 35 #include "UIExtraDataDefs.h"36 35 #include "VBoxGlobalSettings.h" 37 36 … … 127 126 QList<QUrl> &argUrlList() { return m_ArgUrlList; } 128 127 129 RenderMode vmRenderMode() const { return vm_render_mode; }130 const char *vmRenderModeStr() const { return vm_render_mode_str; }131 128 bool isKWinManaged() const { return mIsKWinManaged; } 132 129 … … 438 435 mutable QReadWriteLock m_mediumEnumeratorDtorRwLock; 439 436 440 RenderMode vm_render_mode;441 const char * vm_render_mode_str;442 437 bool mIsKWinManaged; 443 438 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r51398 r51401 20 20 /* Local includes: */ 21 21 #include "UIActionPoolRuntime.h" 22 #include "UIExtraDataDefs.h" 22 23 #include "UIShortcutPool.h" 23 24 #include "VBoxGlobal.h" -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r51149 r51401 49 49 #include "UIMachineViewSeamless.h" 50 50 #include "UIMachineViewScale.h" 51 #include "UIExtraDataManager.h" 51 52 52 53 #ifdef VBOX_WITH_DRAG_AND_DROP … … 410 411 { 411 412 /* Prepare frame-buffer depending on render-mode: */ 412 switch (vboxGlobal().vmRenderMode()) 413 RenderMode rm = gEDataManager->renderMode(vboxGlobal().managedVMUuid()); 414 switch (rm) 413 415 { 414 416 #ifdef VBOX_GUI_USE_QIMAGE 415 case QImageMode:417 case RenderMode_QImage: 416 418 { 417 419 UIFrameBuffer *pFrameBuffer = uisession()->frameBuffer(screenId()); … … 448 450 449 451 #ifdef VBOX_GUI_USE_QUARTZ2D 450 case Quartz2DMode:452 case RenderMode_Quartz2D: 451 453 { 452 454 /* Indicate that we are doing all drawing stuff ourself: */ … … 484 486 485 487 default: 486 AssertReleaseMsgFailed(("Render mode must be valid: %d\n", vboxGlobal().vmRenderMode()));487 LogRel(("Invalid render mode: %d\n", vboxGlobal().vmRenderMode()));488 AssertReleaseMsgFailed(("Render mode must be valid: %d\n", rm)); 489 LogRel(("Invalid render mode: %d\n", rm)); 488 490 qApp->exit(1); 489 491 break; … … 904 906 { 905 907 # ifdef VBOX_GUI_USE_QUARTZ2D 906 if ( vboxGlobal().vmRenderMode() == Quartz2DMode)908 if (gEDataManager->renderMode(vboxGlobal().managedVMUuid()) == RenderMode_Quartz2D) 907 909 { 908 910 /* If the render mode is Quartz2D we could use the CGImageRef … … 1078 1080 1079 1081 #ifdef VBOX_GUI_USE_QUARTZ2D 1080 if ( vboxGlobal().vmRenderMode() == Quartz2DMode&& m_pFrameBuffer)1082 if (gEDataManager->renderMode(vboxGlobal().managedVMUuid()) == RenderMode_Quartz2D && m_pFrameBuffer) 1081 1083 { 1082 1084 m_pFrameBuffer->paintEvent(pPaintEvent); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp
r51390 r51401 20 20 /* Local includes: */ 21 21 #include "UIActionPoolSelector.h" 22 #include "UIExtraDataDefs.h" 22 23 #include "UIShortcutPool.h" 23 24 #include "UIDefs.h" -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp
r50924 r51401 27 27 #include "UIGMachinePreview.h" 28 28 #include "UIVirtualBoxEventHandler.h" 29 #include "UIExtraDataDefs.h" 29 30 #include "UIImageTools.h" 30 31 #include "VBoxGlobal.h" -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp
r50553 r51401 27 27 /* GUI includes: */ 28 28 #include "UIHostComboEditor.h" 29 #include "UIExtraDataDefs.h" 30 #include "UIIconPool.h" 31 #include "QIToolButton.h" 29 32 #include "VBoxGlobal.h" 30 #include "QIToolButton.h"31 #include "UIIconPool.h"32 33 33 34 #ifdef Q_WS_WIN
Note:
See TracChangeset
for help on using the changeset viewer.