Changeset 65521 in vbox for trunk/src/VBox
- Timestamp:
- Jan 30, 2017 5:54:29 PM (8 years ago)
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/VBoxDbgConsole.cpp
r64721 r65521 44 44 #include <iprt/string.h> 45 45 46 #include <VBox/com/string.h> 47 #ifdef VBOX_WITH_XPCOM 48 # include <VirtualBox_XPCOM.h> 49 #else 50 # include <VirtualBox.h> 51 #endif 46 52 47 53 … … 57 63 58 64 59 VBoxDbgConsoleOutput::VBoxDbgConsoleOutput(QWidget *pParent/* = NULL*/, const char *pszName/* = NULL*/) 60 : QTextEdit(pParent), m_uCurLine(0), m_uCurPos(0), m_hGUIThread(RTThreadNativeSelf()) 65 VBoxDbgConsoleOutput::VBoxDbgConsoleOutput(QWidget *pParent/* = NULL*/, IVirtualBox *a_pVirtualBox /* = NULL */, 66 const char *pszName/* = NULL*/) 67 : QTextEdit(pParent), m_uCurLine(0), m_uCurPos(0), m_hGUIThread(RTThreadNativeSelf()), m_pVirtualBox(a_pVirtualBox) 61 68 { 62 69 setReadOnly(true); … … 112 119 * Set the defaults (which syncs with the menu item checked state). 113 120 */ 114 setFontCourier(); 115 setColorGreenOnBlack(); 121 122 if (m_pVirtualBox) 123 { 124 com::Bstr strColor; 125 HRESULT hrc = m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/ColorScheme").raw(), strColor.asOutParam()); 126 if ( SUCCEEDED(hrc) 127 && strColor.compareUtf8("blackonwhite", com::Bstr::CaseInsensitive) == 0) 128 setColorBlackOnWhite(); 129 else 130 setColorGreenOnBlack(); 131 com::Bstr strFont; 132 hrc = m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/Font").raw(), strFont.asOutParam()); 133 if ( SUCCEEDED(hrc) 134 && strFont.compareUtf8("monospace", com::Bstr::CaseInsensitive) == 0) 135 setFontMonospace(); 136 else 137 setFontCourier(); 138 } 116 139 117 140 NOREF(pszName); … … 122 145 { 123 146 Assert(m_hGUIThread == RTThreadNativeSelf()); 147 if (m_pVirtualBox) 148 { 149 m_pVirtualBox->Release(); 150 m_pVirtualBox = NULL; 151 } 124 152 } 125 153 … … 155 183 if (!m_pGreenOnBlackAction->isChecked()) 156 184 m_pGreenOnBlackAction->setChecked(true); 185 186 /* Make this setting persistent */ 187 if (m_pVirtualBox) 188 m_pVirtualBox->SetExtraData(com::Bstr("DbgConsole/ColorScheme").raw(), com::Bstr("GreenOnBlack").raw()); 157 189 } 158 190 … … 166 198 if (!m_pBlackOnWhiteAction->isChecked()) 167 199 m_pBlackOnWhiteAction->setChecked(true); 200 201 /* Make this setting persistent */ 202 if (m_pVirtualBox) 203 m_pVirtualBox->SetExtraData(com::Bstr("DbgConsole/ColorScheme").raw(), com::Bstr("BlackOnWhite").raw()); 168 204 } 169 205 … … 184 220 if (!m_pCourierFontAction->isChecked()) 185 221 m_pCourierFontAction->setChecked(true); 222 223 /* Make this setting persistent */ 224 if (m_pVirtualBox) 225 m_pVirtualBox->SetExtraData(com::Bstr("DbgConsole/Font").raw(), com::Bstr("Courier").raw()); 186 226 } 187 227 … … 198 238 if (!m_pMonospaceFontAction->isChecked()) 199 239 m_pMonospaceFontAction->setChecked(true); 240 241 /* Make this setting persistent */ 242 if (m_pVirtualBox) 243 m_pVirtualBox->SetExtraData(com::Bstr("DbgConsole/Font").raw(), com::Bstr("Monospace").raw()); 200 244 } 201 245 … … 353 397 354 398 355 VBoxDbgConsole::VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent/* = NULL*/ )399 VBoxDbgConsole::VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent/* = NULL*/, IVirtualBox *a_pVirtualBox/* = NULL */) 356 400 : VBoxDbgBaseWindow(a_pDbgGui, a_pParent), m_pOutput(NULL), m_pInput(NULL), m_fInputRestoreFocus(false), 357 401 m_pszInputBuf(NULL), m_cbInputBuf(0), m_cbInputBufAlloc(0), … … 365 409 * Create the output text box. 366 410 */ 367 m_pOutput = new VBoxDbgConsoleOutput(this );411 m_pOutput = new VBoxDbgConsoleOutput(this, a_pVirtualBox); 368 412 369 413 /* try figure a suitable size */ -
trunk/src/VBox/Debugger/VBoxDbgConsole.h
r65066 r65521 30 30 #include <iprt/thread.h> 31 31 32 class IVirtualBox; 32 33 33 34 class VBoxDbgConsoleOutput : public QTextEdit … … 42 43 * @param pszName Widget name. 43 44 */ 44 VBoxDbgConsoleOutput(QWidget *pParent = NULL, const char *pszName = NULL);45 VBoxDbgConsoleOutput(QWidget *pParent = NULL, IVirtualBox *pVirtualBox = NULL, const char *pszName = NULL); 45 46 46 47 /** … … 90 91 /** The current color scheme (foreground on background). */ 91 92 VBoxDbgConsoleColor m_enmColorScheme; 93 /** The IVirtualBox object */ 94 IVirtualBox *m_pVirtualBox; 92 95 93 96 private slots: … … 180 183 * @param a_pParent Parent Widget. 181 184 */ 182 VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent = NULL );185 VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent = NULL, IVirtualBox *a_pVirtualBox = NULL); 183 186 184 187 /** -
trunk/src/VBox/Debugger/VBoxDbgGui.cpp
r62480 r65521 196 196 if (!m_pDbgConsole) 197 197 { 198 m_pDbgConsole = new VBoxDbgConsole(this, m_pParent); 198 IVirtualBox *pVirtualBox = NULL; 199 m_pMachine->COMGETTER(Parent)(&pVirtualBox); 200 m_pDbgConsole = new VBoxDbgConsole(this, m_pParent, pVirtualBox); 199 201 connect(m_pDbgConsole, SIGNAL(destroyed(QObject *)), this, SLOT(notifyChildDestroyed(QObject *))); 200 202 repositionConsole();
Note:
See TracChangeset
for help on using the changeset viewer.