Changeset 36589 in vbox for trunk/src/VBox
- Timestamp:
- Apr 6, 2011 3:24:00 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71029
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 14 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r36357 r36589 458 458 src/extensions/QIWidgetValidator.cpp \ 459 459 src/extensions/QIWizard.cpp \ 460 src/settings/UISettingsDefs.cpp \ 460 461 src/settings/UISettingsDialog.cpp \ 461 462 src/settings/UISettingsDialogSpecific.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h
r36519 r36589 99 99 }; 100 100 101 /** Settings dialog types: */102 enum SettingsDialogType103 {104 SettingsDialogType_Wrong,105 SettingsDialogType_Offline,106 SettingsDialogType_Saved,107 SettingsDialogType_Runtime108 };109 110 101 static const char* GUI_LastWindowPosition; 111 102 static const char* GUI_LastNormalWindowPosition; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r36357 r36589 964 964 /* Prepare VM settings dialog: */ 965 965 UISettingsDialog *pDlg = new UISettingsDialogMachine(defaultMachineWindow()->machineWindow(), 966 VBoxDefs::SettingsDialogType_Runtime,966 SettingsDialogType_Online, 967 967 sharedMachine, session().GetConsole(), 968 968 strCategory, QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r36519 r36589 595 595 CSystemProperties props = vboxGlobal().virtualBox().GetSystemProperties(); 596 596 597 UISettingsDialog *dlg = new UISettingsDialogGlobal(this, VBoxDefs::SettingsDialogType_Offline);597 UISettingsDialog *dlg = new UISettingsDialogGlobal(this, SettingsDialogType_Offline); 598 598 dlg->getFrom(); 599 599 … … 723 723 AssertMsgReturnVoid(pItem, ("Item must be always selected here")); 724 724 725 VBoxDefs::SettingsDialogType dialogType = pItem->machineState() == KMachineState_Saved ? VBoxDefs::SettingsDialogType_Saved : 726 pItem->sessionState() == KSessionState_Unlocked ? VBoxDefs::SettingsDialogType_Offline : 727 VBoxDefs::SettingsDialogType_Runtime; 728 729 CSession session = vboxGlobal().openSession(pItem->id(), dialogType != VBoxDefs::SettingsDialogType_Offline /* connect to existing? */); 730 AssertMsgReturn(!session.isNull(), ("Session must not be null"), (void)0); 725 SettingsDialogType dialogType = machineStateToSettingsDialogType(pItem->machineState()); 726 727 CSession session = vboxGlobal().openSession(pItem->id(), dialogType != SettingsDialogType_Offline /* connect to existing? */); 728 AssertMsgReturnVoid(!session.isNull(), ("Session must not be null")); 731 729 CMachine machine = session.GetMachine(); 732 AssertMsgReturn (!machine.isNull(), ("Machine must not be null"), (void)0);733 CConsole console = dialogType == VBoxDefs::SettingsDialogType_Offline ? CConsole() : session.GetConsole();730 AssertMsgReturnVoid(!machine.isNull(), ("Machine must not be null")); 731 CConsole console = dialogType == SettingsDialogType_Offline ? CConsole() : session.GetConsole(); 734 732 735 733 /* Don't show the inaccessible warning if the user open the vm settings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.cpp
r36567 r36589 3 3 * 4 4 * VBox frontends: Qt GUI ("VirtualBox"): 5 * VBoxDefs implementation5 * UISettingsDefs implementation 6 6 */ 7 7 8 8 /* 9 * Copyright (C) 20 06-2010Oracle Corporation9 * Copyright (C) 2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 */ 19 19 20 /* Local includes*/21 #include <VBoxDefs.h>20 /* VBox includes: */ 21 #include "UISettingsDefs.h" 22 22 23 /* Global includes*/24 #include <QStringList> 23 /* Using declarations: */ 24 using namespace UISettingsDefs; 25 25 26 const char* VBoxDefs::GUI_LastWindowPosition = "GUI/LastWindowPosition"; 27 const char* VBoxDefs::GUI_LastNormalWindowPosition = "GUI/LastNormalWindowPosition"; 28 const char* VBoxDefs::GUI_LastScaleWindowPosition = "GUI/LastScaleWindowPosition"; 29 const char* VBoxDefs::GUI_LastWindowState_Max = "max"; 30 const char* VBoxDefs::GUI_LastGuestSizeHint = "GUI/LastGuestSizeHint"; 31 const char* VBoxDefs::GUI_Toolbar = "GUI/Toolbar"; 32 const char* VBoxDefs::GUI_Statusbar = "GUI/Statusbar"; 33 const char* VBoxDefs::GUI_SplitterSizes = "GUI/SplitterSizes"; 34 const char* VBoxDefs::GUI_Fullscreen = "GUI/Fullscreen"; 35 const char* VBoxDefs::GUI_Seamless = "GUI/Seamless"; 36 const char* VBoxDefs::GUI_Scale = "GUI/Scale"; 37 const char* VBoxDefs::GUI_VirtualScreenToHostScreen = "GUI/VirtualScreenToHostScreen"; 38 const char* VBoxDefs::GUI_AutoresizeGuest = "GUI/AutoresizeGuest"; 39 const char* VBoxDefs::GUI_FirstRun = "GUI/FirstRun"; 40 const char* VBoxDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime"; 41 const char* VBoxDefs::GUI_ShowMiniToolBar = "GUI/ShowMiniToolBar"; 42 const char* VBoxDefs::GUI_MiniToolBarAlignment = "GUI/MiniToolBarAlignment"; 43 const char* VBoxDefs::GUI_MiniToolBarAutoHide = "GUI/MiniToolBarAutoHide"; 44 const char* VBoxDefs::GUI_LastCloseAction = "GUI/LastCloseAction"; 45 const char* VBoxDefs::GUI_RestrictedCloseActions = "GUI/RestrictedCloseActions"; 46 const char* VBoxDefs::GUI_SuppressMessages = "GUI/SuppressMessages"; 47 const char* VBoxDefs::GUI_PermanentSharedFoldersAtRuntime = "GUI/PermanentSharedFoldersAtRuntime"; 48 const char* VBoxDefs::GUI_LanguageId = "GUI/LanguageID"; 49 const char* VBoxDefs::GUI_PreviewUpdate = "GUI/PreviewUpdate"; 50 const char* VBoxDefs::GUI_DetailsPageBoxes = "GUI/DetailsPageBoxes"; 51 const char* VBoxDefs::GUI_SelectorVMPositions = "GUI/SelectorVMPositions"; 52 const char* VBoxDefs::GUI_Input_MachineShortcuts = "GUI/Input/MachineShortcuts"; 53 const char* VBoxDefs::GUI_Input_SelectorShortcuts = "GUI/Input/SelectorShortcuts"; 54 #ifdef Q_WS_X11 55 const char* VBoxDefs::GUI_LicenseKey = "GUI/LicenseAgreed"; 56 #endif 57 const char* VBoxDefs::GUI_RegistrationDlgWinID = "GUI/RegistrationDlgWinID"; 58 const char* VBoxDefs::GUI_RegistrationData = "GUI/SUNOnlineData"; 59 const char* VBoxDefs::GUI_UpdateDlgWinID = "GUI/UpdateDlgWinID"; 60 const char* VBoxDefs::GUI_UpdateDate = "GUI/UpdateDate"; 61 const char* VBoxDefs::GUI_UpdateCheckCount = "GUI/UpdateCheckCount"; 62 const char* VBoxDefs::GUI_LastVMSelected = "GUI/LastVMSelected"; 63 const char* VBoxDefs::GUI_InfoDlgState = "GUI/InfoDlgState"; 64 const char* VBoxDefs::GUI_RenderMode = "GUI/RenderMode"; 65 #ifdef VBOX_GUI_WITH_SYSTRAY 66 const char* VBoxDefs::GUI_TrayIconWinID = "GUI/TrayIcon/WinID"; 67 const char* VBoxDefs::GUI_TrayIconEnabled = "GUI/TrayIcon/Enabled"; 68 const char* VBoxDefs::GUI_MainWindowCount = "GUI/MainWindowCount"; 69 #endif 70 #ifdef Q_WS_MAC 71 const char* VBoxDefs::GUI_RealtimeDockIconUpdateEnabled = "GUI/RealtimeDockIconUpdateEnabled"; 72 const char* VBoxDefs::GUI_RealtimeDockIconUpdateMonitor = "GUI/RealtimeDockIconUpdateMonitor"; 73 const char* VBoxDefs::GUI_PresentationModeEnabled = "GUI/PresentationModeEnabled"; 74 #endif /* Q_WS_MAC */ 75 const char* VBoxDefs::GUI_PassCAD = "GUI/PassCAD"; 76 const char* VBoxDefs::GUI_Export_StorageType = "GUI/Export/StorageType"; 77 const char* VBoxDefs::GUI_Export_Username = "GUI/Export/Username"; 78 const char* VBoxDefs::GUI_Export_Hostname = "GUI/Export/Hostname"; 79 const char* VBoxDefs::GUI_Export_Bucket = "GUI/Export/Bucket"; 80 const char* VBoxDefs::GUI_PreventBetaWarning = "GUI/PreventBetaWarning"; 81 const char* VBoxDefs::GUI_RecentFolderHD = "GUI/RecentFolderHD"; 82 const char* VBoxDefs::GUI_RecentFolderCD = "GUI/RecentFolderCD"; 83 const char* VBoxDefs::GUI_RecentFolderFD = "GUI/RecentFolderFD"; 84 const char* VBoxDefs::GUI_RecentListHD = "GUI/RecentListHD"; 85 const char* VBoxDefs::GUI_RecentListCD = "GUI/RecentListCD"; 86 const char* VBoxDefs::GUI_RecentListFD = "GUI/RecentListFD"; 87 #ifdef VBOX_WITH_VIDEOHWACCEL 88 const char* VBoxDefs::GUI_Accelerate2D_StretchLinear = "GUI/Accelerate2D/StretchLinear"; 89 const char* VBoxDefs::GUI_Accelerate2D_PixformatYV12 = "GUI/Accelerate2D/PixformatYV12"; 90 const char* VBoxDefs::GUI_Accelerate2D_PixformatUYVY = "GUI/Accelerate2D/PixformatUYVY"; 91 const char* VBoxDefs::GUI_Accelerate2D_PixformatYUY2 = "GUI/Accelerate2D/PixformatYUY2"; 92 const char* VBoxDefs::GUI_Accelerate2D_PixformatAYUV = "GUI/Accelerate2D/PixformatAYUV"; 93 #endif 94 #ifdef VBOX_WITH_DEBUGGER_GUI 95 const char* VBoxDefs::GUI_DbgEnabled = "GUI/Dbg/Enabled"; 96 const char* VBoxDefs::GUI_DbgAutoShow = "GUI/Dbg/AutoShow"; 97 #endif 26 /* Machine state => Settings dialog type converter: */ 27 SettingsDialogType UISettingsDefs::machineStateToSettingsDialogType(KMachineState machineState) 28 { 29 SettingsDialogType result = SettingsDialogType_Wrong; 30 switch (machineState) 31 { 32 case KMachineState_PoweredOff: 33 case KMachineState_Teleported: 34 case KMachineState_Aborted: 35 result = SettingsDialogType_Offline; 36 break; 37 case KMachineState_Saved: 38 result = SettingsDialogType_Saved; 39 break; 40 case KMachineState_Running: 41 case KMachineState_Paused: 42 result = SettingsDialogType_Online; 43 break; 44 default: 45 break; 46 } 47 return result; 48 } 98 49 99 QStringList VBoxDefs::VBoxFileExts = QStringList() << "xml" << "vbox";100 QStringList VBoxDefs::VBoxExtPackFileExts = QStringList() << "vbox-extpack";101 QStringList VBoxDefs::OVFFileExts = QStringList() << "ovf" << "ova";102 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h
r36567 r36589 2 2 * 3 3 * VBox frontends: Qt GUI ("VirtualBox"): 4 * Header with common definitions and global functions4 * Header with definitions and functions related to settings dialog 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 20 06-2011 Oracle Corporation8 * Copyright (C) 2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 17 17 */ 18 18 19 #ifndef __ VBoxDefs_h__20 #define __ VBoxDefs_h__19 #ifndef __UISettingsDefs_h__ 20 #define __UISettingsDefs_h__ 21 21 22 /* Qt includes */ 23 #include <QEvent> 24 #include <QUuid> 25 #include <QMetaType> 22 /* VBox includes: */ 23 #include "COMDefs.h" 26 24 27 #define LOG_GROUP LOG_GROUP_GUI 28 #include <VBox/log.h> 29 #include <iprt/assert.h> 30 #include <iprt/alloc.h> 31 32 #ifdef DEBUG 33 34 #define AssertWrapperOk(w) \ 35 AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC())) 36 #define AssertWrapperOkMsg(w, m) \ 37 AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC())) 38 39 #else /* #ifdef DEBUG */ 40 41 #define AssertWrapperOk(w) do {} while (0) 42 #define AssertWrapperOkMsg(w, m) do {} while (0) 43 44 #endif /* #ifdef DEBUG */ 45 46 #ifndef SIZEOF_ARRAY 47 #define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0])) 48 #endif 49 50 /** Common namespace for all enums */ 51 struct VBoxDefs 25 /* Settings dialog namespace: */ 26 namespace UISettingsDefs 52 27 { 53 /** Medium type. */ 54 enum MediumType 55 { 56 MediumType_Invalid, 57 MediumType_HardDisk, 58 MediumType_DVD, 59 MediumType_Floppy, 60 MediumType_All 61 }; 62 63 /** VM display rendering mode. */ 64 enum RenderMode 65 { 66 InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode, Quartz2DMode 67 #ifdef VBOX_GUI_USE_QGLFB 68 , QGLMode 69 #endif 70 }; 71 72 /** Additional Qt event types. */ 73 enum 74 { 75 ResizeEventType = QEvent::User + 101 76 , RepaintEventType 77 , SetRegionEventType 78 , ModifierKeyChangeEventType 79 , MediaEnumEventType 80 #if defined (Q_WS_WIN) 81 , ShellExecuteEventType 82 #endif 83 , ActivateActionEventType 84 #if defined (Q_WS_MAC) 85 , ShowWindowEventType 86 #endif 87 , AddVDMUrlsEventType 88 #ifdef VBOX_GUI_USE_QGL 89 , VHWACommandProcessType 90 #endif 91 }; 92 93 /** Size formatting types. */ 94 enum FormatSize 95 { 96 FormatSize_Round, 97 FormatSize_RoundDown, 98 FormatSize_RoundUp 99 }; 100 101 /** Settings dialog types: */ 28 /* Settings dialog types: */ 102 29 enum SettingsDialogType 103 30 { … … 105 32 SettingsDialogType_Offline, 106 33 SettingsDialogType_Saved, 107 SettingsDialogType_ Runtime34 SettingsDialogType_Online 108 35 }; 109 36 110 static const char* GUI_LastWindowPosition; 111 static const char* GUI_LastNormalWindowPosition; 112 static const char* GUI_LastScaleWindowPosition; 113 static const char* GUI_LastWindowState_Max; 114 static const char* GUI_SplitterSizes; 115 static const char* GUI_Toolbar; 116 static const char* GUI_Statusbar; 117 static const char* GUI_LastGuestSizeHint; 118 static const char* GUI_Fullscreen; 119 static const char* GUI_Seamless; 120 static const char* GUI_Scale; 121 static const char* GUI_VirtualScreenToHostScreen; 122 static const char* GUI_AutoresizeGuest; 123 static const char* GUI_FirstRun; 124 static const char* GUI_SaveMountedAtRuntime; 125 static const char* GUI_ShowMiniToolBar; 126 static const char* GUI_MiniToolBarAlignment; 127 static const char* GUI_MiniToolBarAutoHide; 128 static const char* GUI_LastCloseAction; 129 static const char* GUI_RestrictedCloseActions; 130 static const char* GUI_SuppressMessages; 131 static const char* GUI_PermanentSharedFoldersAtRuntime; 132 static const char* GUI_LanguageId; 133 static const char* GUI_PreviewUpdate; 134 static const char* GUI_DetailsPageBoxes; 135 static const char* GUI_SelectorVMPositions; 136 static const char* GUI_Input_MachineShortcuts; 137 static const char* GUI_Input_SelectorShortcuts; 138 #ifdef Q_WS_X11 139 static const char* GUI_LicenseKey; 140 #endif 141 static const char* GUI_RegistrationDlgWinID; 142 static const char* GUI_RegistrationData; 143 static const char* GUI_UpdateDlgWinID; 144 static const char* GUI_UpdateDate; 145 static const char* GUI_UpdateCheckCount; 146 static const char* GUI_LastVMSelected; 147 static const char* GUI_InfoDlgState; 148 static const char* GUI_RenderMode; 149 #ifdef VBOX_GUI_WITH_SYSTRAY 150 static const char* GUI_TrayIconWinID; 151 static const char* GUI_TrayIconEnabled; 152 static const char* GUI_MainWindowCount; 153 #endif 154 #ifdef Q_WS_MAC 155 static const char* GUI_RealtimeDockIconUpdateEnabled; 156 static const char* GUI_RealtimeDockIconUpdateMonitor; 157 static const char* GUI_PresentationModeEnabled; 158 #endif /* Q_WS_MAC */ 159 static const char* GUI_PassCAD; 160 static const char* GUI_Export_StorageType; 161 static const char* GUI_Export_Username; 162 static const char* GUI_Export_Hostname; 163 static const char* GUI_Export_Bucket; 164 static const char* GUI_PreventBetaWarning; 37 /* Machine state => Settings dialog type converter: */ 38 SettingsDialogType machineStateToSettingsDialogType(KMachineState machineState); 39 } 165 40 166 static const char* GUI_RecentFolderHD; 167 static const char* GUI_RecentFolderCD; 168 static const char* GUI_RecentFolderFD; 169 static const char* GUI_RecentListHD; 170 static const char* GUI_RecentListCD; 171 static const char* GUI_RecentListFD; 41 #endif /* __UISettingsDefs_h__ */ 172 42 173 #ifdef VBOX_WITH_VIDEOHWACCEL174 static const char* GUI_Accelerate2D_StretchLinear;175 static const char* GUI_Accelerate2D_PixformatYV12;176 static const char* GUI_Accelerate2D_PixformatUYVY;177 static const char* GUI_Accelerate2D_PixformatYUY2;178 static const char* GUI_Accelerate2D_PixformatAYUV;179 #endif180 181 #ifdef VBOX_WITH_DEBUGGER_GUI182 static const char* GUI_DbgEnabled;183 static const char* GUI_DbgAutoShow;184 #endif185 186 static QStringList VBoxFileExts;187 static QStringList VBoxExtPackFileExts;188 static QStringList OVFFileExts;189 };190 191 Q_DECLARE_METATYPE(VBoxDefs::MediumType);192 193 #define MAC_LEOPARD_STYLE defined(Q_WS_MAC) && (QT_VERSION >= 0x040300)194 195 #endif /* __VBoxDefs_h__ */196 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r36357 r36589 42 42 43 43 /* Settings Dialog Constructor: */ 44 UISettingsDialog::UISettingsDialog(QWidget *pParent, VBoxDefs::SettingsDialogType dialogType)44 UISettingsDialog::UISettingsDialog(QWidget *pParent, SettingsDialogType settingsDialogType) 45 45 /* Parent class: */ 46 46 : QIWithRetranslateUI<QIMainDialog>(pParent) … … 49 49 , m_pStack(0) 50 50 /* Common variables: */ 51 , m_dialogType( dialogType)51 , m_dialogType(settingsDialogType) 52 52 , m_fPolished(false) 53 53 /* Loading stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r36357 r36589 20 20 #define __UISettingsDialog_h__ 21 21 22 /* Local includes*/22 /* VBox includes: */ 23 23 #include "QIMainDialog.h" 24 24 #include "QIWithRetranslateUI.h" 25 25 #include "UISettingsDialog.gen.h" 26 #include " VBoxDefs.h"26 #include "UISettingsDefs.h" 27 27 28 /* Forward declarations */28 /* Forward declarations: */ 29 29 class QIWidgetValidator; 30 30 class QStackedWidget; … … 33 33 class VBoxSettingsSelector; 34 34 class UISettingsPage; 35 36 /* Using declarations: */ 37 using namespace UISettingsDefs; 35 38 36 39 /* Base dialog class for both Global & VM settings which encapsulates most of their similar functionalities */ … … 42 45 43 46 /* Settings Dialog Constructor/Destructor: */ 44 UISettingsDialog(QWidget *pParent, VBoxDefs::SettingsDialogType dialogType);47 UISettingsDialog(QWidget *pParent, SettingsDialogType settingsDialogType); 45 48 ~UISettingsDialog(); 46 49 … … 66 69 67 70 /* Dialog type: */ 68 VBoxDefs::SettingsDialogType dialogType() { return m_dialogType; }71 SettingsDialogType dialogType() { return m_dialogType; } 69 72 /* Dialog title: */ 70 73 virtual QString title() const = 0; … … 110 113 111 114 /* Global Flags: */ 112 VBoxDefs::SettingsDialogType m_dialogType;115 SettingsDialogType m_dialogType; 113 116 bool m_fPolished; 114 117 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r36357 r36589 27 27 /* Local includes */ 28 28 #include "UISettingsDialogSpecific.h" 29 #include "UISettingsDefs.h" 29 30 #include "VBoxGlobal.h" 30 31 #include "VBoxProblemReporter.h" … … 288 289 UISettingsSerializer* UISettingsSerializer::m_pInstance = 0; 289 290 290 UISettingsDialogGlobal::UISettingsDialogGlobal(QWidget *pParent, VBoxDefs::SettingsDialogType type)291 : UISettingsDialog(pParent, type)291 UISettingsDialogGlobal::UISettingsDialogGlobal(QWidget *pParent, SettingsDialogType settingsDialogType) 292 : UISettingsDialog(pParent, settingsDialogType) 292 293 { 293 294 /* Window icon: */ … … 507 508 } 508 509 509 UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, VBoxDefs::SettingsDialogType type,510 UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, SettingsDialogType settingsDialogType, 510 511 const CMachine &machine, const CConsole &console, 511 512 const QString &strCategory, const QString &strControl) 512 : UISettingsDialog(pParent, type)513 : UISettingsDialog(pParent, settingsDialogType) 513 514 , m_machine(machine) 514 515 , m_console(console) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r36357 r36589 43 43 }; 44 44 45 UISettingsDialogGlobal(QWidget *pParent, VBoxDefs::SettingsDialogType type);45 UISettingsDialogGlobal(QWidget *pParent, SettingsDialogType settingsDialogType); 46 46 47 47 protected: … … 82 82 }; 83 83 84 UISettingsDialogMachine(QWidget *pParent, VBoxDefs::SettingsDialogType type,84 UISettingsDialogMachine(QWidget *pParent, SettingsDialogType settingsDialogType, 85 85 const CMachine &machine, const CConsole &console, 86 86 const QString &strCategory, const QString &strControl); … … 110 110 CMachine m_machine; 111 111 CConsole m_console; 112 112 113 bool m_fAllowResetFirstRunFlag; 113 114 bool m_fResetFirstRunFlag; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r36357 r36589 24 24 UISettingsPage::UISettingsPage(UISettingsPageType pageType) 25 25 : m_pageType(pageType) 26 , m_dialogType( VBoxDefs::SettingsDialogType_Wrong)26 , m_dialogType(SettingsDialogType_Wrong) 27 27 , m_cId(-1) 28 28 , m_fPolished(false) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r36519 r36589 27 27 #include "QIWithRetranslateUI.h" 28 28 #include "COMDefs.h" 29 #include " VBoxDefs.h"29 #include "UISettingsDefs.h" 30 30 #include "VBoxGlobalSettings.h" 31 31 … … 33 33 class QIWidgetValidator; 34 34 class QShowEvent; 35 36 /* Using declarations: */ 37 using namespace UISettingsDefs; 35 38 36 39 /* Settings page types: */ … … 96 99 97 100 /* Settings dialog type stuff: */ 98 VBoxDefs::SettingsDialogType dialogType() const { return m_dialogType; }99 virtual void setDialogType( VBoxDefs::SettingsDialogType dialogType) { m_dialogType = dialogType; }100 bool isMachineOffline() const { return dialogType() == VBoxDefs::SettingsDialogType_Offline; }101 bool isMachineSaved() const { return dialogType() == VBoxDefs::SettingsDialogType_Saved; }102 bool isMachineOnline() const { return dialogType() == VBoxDefs::SettingsDialogType_Runtime; }101 SettingsDialogType dialogType() const { return m_dialogType; } 102 virtual void setDialogType(SettingsDialogType settingsDialogType) { m_dialogType = settingsDialogType; } 103 bool isMachineOffline() const { return dialogType() == SettingsDialogType_Offline; } 104 bool isMachineSaved() const { return dialogType() == SettingsDialogType_Saved; } 105 bool isMachineOnline() const { return dialogType() == SettingsDialogType_Online; } 103 106 bool isMachineInValidMode() const { return isMachineOffline() || isMachineSaved() || isMachineOnline(); } 104 107 … … 130 133 /* Private variables: */ 131 134 UISettingsPageType m_pageType; 132 VBoxDefs::SettingsDialogType m_dialogType;135 SettingsDialogType m_dialogType; 133 136 int m_cId; 134 137 bool m_fPolished; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp
r36519 r36589 701 701 } 702 702 703 void UIMachineSettingsSF::setDialogType( VBoxDefs::SettingsDialogType settingsDialogType)703 void UIMachineSettingsSF::setDialogType(SettingsDialogType settingsDialogType) 704 704 { 705 705 UISettingsPageMachine::setDialogType(settingsDialogType); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h
r36357 r36589 104 104 SFoldersNameList usedList (bool aIncludeSelected); 105 105 106 void setDialogType( VBoxDefs::SettingsDialogType settingsDialogType);106 void setDialogType(SettingsDialogType settingsDialogType); 107 107 108 108 UISharedFolderType m_type; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r36519 r36589 766 766 , mToolTipType (DefaultToolTip) 767 767 , m_chipsetType(KChipsetType_PIIX3) 768 , m_dialogType( VBoxDefs::SettingsDialogType_Wrong)768 , m_dialogType(SettingsDialogType_Wrong) 769 769 { 770 770 } … … 936 936 case R_IsMoreIDEControllersPossible: 937 937 { 938 return (m_dialogType == VBoxDefs::SettingsDialogType_Offline) &&938 return (m_dialogType == SettingsDialogType_Offline) && 939 939 (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_IDE) < 940 940 vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_IDE)); … … 942 942 case R_IsMoreSATAControllersPossible: 943 943 { 944 return (m_dialogType == VBoxDefs::SettingsDialogType_Offline) &&944 return (m_dialogType == SettingsDialogType_Offline) && 945 945 (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_SATA) < 946 946 vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_SATA)); … … 948 948 case R_IsMoreSCSIControllersPossible: 949 949 { 950 return (m_dialogType == VBoxDefs::SettingsDialogType_Offline) &&950 return (m_dialogType == SettingsDialogType_Offline) && 951 951 (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_SCSI) < 952 952 vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_SCSI)); … … 954 954 case R_IsMoreFloppyControllersPossible: 955 955 { 956 return (m_dialogType == VBoxDefs::SettingsDialogType_Offline) &&956 return (m_dialogType == SettingsDialogType_Offline) && 957 957 (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_Floppy) < 958 958 vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_Floppy)); … … 960 960 case R_IsMoreSASControllersPossible: 961 961 { 962 return (m_dialogType == VBoxDefs::SettingsDialogType_Offline) &&962 return (m_dialogType == SettingsDialogType_Offline) && 963 963 (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_SAS) < 964 964 vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_SAS)); … … 972 972 ControllerItem *ctr = static_cast <ControllerItem*> (item); 973 973 CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties(); 974 return (m_dialogType == VBoxDefs::SettingsDialogType_Offline) &&974 return (m_dialogType == SettingsDialogType_Offline) && 975 975 ((uint)rowCount(aIndex) < sp.GetMaxPortCountForStorageBus(ctr->ctrBusType()) * 976 976 sp.GetMaxDevicesPerPortForStorageBus(ctr->ctrBusType())); … … 1420 1420 } 1421 1421 1422 void StorageModel::setDialogType( VBoxDefs::SettingsDialogType dialogType)1422 void StorageModel::setDialogType(SettingsDialogType dialogType) 1423 1423 { 1424 1424 m_dialogType = dialogType; … … 1901 1901 { 1902 1902 /* Here come the properties which could be changed only in offline state: */ 1903 case VBoxDefs::SettingsDialogType_Offline:1903 case SettingsDialogType_Offline: 1904 1904 { 1905 1905 /* Remove currently present controllers & attachments */ … … 1976 1976 } 1977 1977 /* Here come the properties which could be changed at runtime too: */ 1978 case VBoxDefs::SettingsDialogType_Runtime:1978 case SettingsDialogType_Online: 1979 1979 { 1980 1980 /* Iterate all the controllers and update changed CD/DVD and floppy attachments: */ … … 3066 3066 } 3067 3067 3068 void UIMachineSettingsStorage::setDialogType( VBoxDefs::SettingsDialogType settingsDialogType)3068 void UIMachineSettingsStorage::setDialogType(SettingsDialogType settingsDialogType) 3069 3069 { 3070 3070 UISettingsPageMachine::setDialogType(settingsDialogType); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r36357 r36589 503 503 void setChipsetType(KChipsetType type); 504 504 505 void setDialogType( VBoxDefs::SettingsDialogType dialogType);505 void setDialogType(SettingsDialogType dialogType); 506 506 507 507 QMap<KStorageBus, int> currentControllerTypes() const; … … 523 523 524 524 KChipsetType m_chipsetType; 525 VBoxDefs::SettingsDialogType m_dialogType;525 SettingsDialogType m_dialogType; 526 526 }; 527 527 Q_DECLARE_METATYPE (StorageModel::ToolTipType); … … 673 673 void addRecentMediumActions(QMenu *pOpenMediumMenu, VBoxDefs::MediumType recentMediumType); 674 674 675 void setDialogType( VBoxDefs::SettingsDialogType settingsDialogType);675 void setDialogType(SettingsDialogType settingsDialogType); 676 676 void polishPage(); 677 677
Note:
See TracChangeset
for help on using the changeset viewer.