Changeset 86622 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 19, 2020 8:20:16 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86620 r86622 109 109 , m_pHelpEngine(0) 110 110 #endif 111 , m_p TextBrowser(0)111 , m_pContentViewer(0) 112 112 , m_pSplitter(0) 113 { 114 /* Prepare VM Log-Viewer: */ 113 , m_pMenu(0) 114 { 115 115 prepare(); 116 116 } … … 124 124 QMenu *UIHelpBrowserWidget::menu() const 125 125 { 126 return 0;//m_pActionPool->action(UIActionIndex_M_LogWindow)->menu();126 return m_pMenu; 127 127 } 128 128 … … 139 139 prepareActions(); 140 140 prepareWidgets(); 141 142 141 prepareMenuAndMenuActions(); 143 142 retranslateUi(); 144 143 } … … 168 167 m_pTabWidget->addTab(m_pHelpEngine->indexWidget(), tr("Index")); 169 168 170 m_p TextBrowser = new UIHelpBrowserViewer(m_pHelpEngine);171 AssertReturnVoid(m_p TextBrowser);172 m_pSplitter->addWidget(m_p TextBrowser);169 m_pContentViewer = new UIHelpBrowserViewer(m_pHelpEngine); 170 AssertReturnVoid(m_pContentViewer); 171 m_pSplitter->addWidget(m_pContentViewer); 173 172 174 173 m_pSplitter->setStretchFactor(0, 1); … … 180 179 181 180 connect(m_pHelpEngine->contentWidget(), &QHelpContentWidget::linkActivated, 182 m_p TextBrowser, &UIHelpBrowserViewer::setSource);181 m_pContentViewer, &UIHelpBrowserViewer::setSource); 183 182 connect(m_pHelpEngine->contentWidget(), &QHelpContentWidget::clicked, 184 183 this, &UIHelpBrowserWidget::sltHandleContentWidgetItemClicked); … … 186 185 187 186 connect(m_pHelpEngine->indexWidget(), &QHelpIndexWidget::linkActivated, 188 m_p TextBrowser, &UIHelpBrowserViewer::setSource);187 m_pContentViewer, &UIHelpBrowserViewer::setSource); 189 188 190 189 if (QFile(m_strHelpFilePath).exists() && m_pHelpEngine) … … 219 218 } 220 219 220 void UIHelpBrowserWidget::prepareMenuAndMenuActions() 221 { 222 m_pMenu = new QMenu(tr("View"), this); 223 AssertReturnVoid(m_pMenu); 224 m_pMenu->addAction(tr("View")); 225 } 226 221 227 void UIHelpBrowserWidget::loadOptions() 222 228 { … … 272 278 { 273 279 #ifdef RT_OS_LINUX 274 AssertReturnVoid(m_p TextBrowser && m_pHelpEngine);280 AssertReturnVoid(m_pContentViewer && m_pHelpEngine); 275 281 QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList()); 276 282 if (!files.empty()) 277 m_p TextBrowser->setSource(files[0]);283 m_pContentViewer->setSource(files[0]); 278 284 /** @todo show some kind of error maybe. */ 279 285 #endif … … 283 289 { 284 290 #ifdef RT_OS_LINUX 285 AssertReturnVoid(m_p TextBrowser && m_pHelpEngine && m_pHelpEngine->contentWidget());291 AssertReturnVoid(m_pContentViewer && m_pHelpEngine && m_pHelpEngine->contentWidget()); 286 292 QHelpContentModel *pContentModel = 287 293 qobject_cast<QHelpContentModel*>(m_pHelpEngine->contentWidget()->model()); … … 292 298 return; 293 299 const QUrl &url = pItem->url(); 294 m_pTextBrowser->setSource(url); 300 m_pContentViewer->setSource(url); 301 #else 302 Q_UNUSED(index); 295 303 #endif 296 304 } -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86620 r86622 93 93 void prepareWidgets(); 94 94 void prepareToolBar(); 95 void prepareMenuAndMenuActions(); 95 96 void loadOptions(); 96 97 … … 131 132 QHelpEngine *m_pHelpEngine; 132 133 #endif 133 UIHelpBrowserViewer *m_p TextBrowser;134 UIHelpBrowserViewer *m_pContentViewer; 134 135 QSplitter *m_pSplitter; 136 QMenu *m_pMenu; 135 137 }; 136 138
Note:
See TracChangeset
for help on using the changeset viewer.