Changeset 65521 in vbox for trunk/src/VBox/Debugger/VBoxDbgConsole.cpp
- Timestamp:
- Jan 30, 2017 5:54:29 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113158
- File:
-
- 1 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 */
Note:
See TracChangeset
for help on using the changeset viewer.