Changeset 86724 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 27, 2020 2:39:16 PM (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
r86723 r86724 31 31 #include <QSplitter> 32 32 #include <QTextBrowser> 33 #include <QVBoxLayout> 33 34 #ifdef RT_OS_SOLARIS 34 35 # include <QFontDatabase> … … 45 46 #include "QIToolBar.h" 46 47 #include "UICommon.h" 48 #include "UIIconPool.h" 47 49 48 50 /* COM includes: */ … … 121 123 , m_pBookmarksWidget(0) 122 124 , m_pShowHideTabWidgetAction(0) 125 , m_pGoHomeAction(0) 123 126 , m_fModelContentCreated(false) 124 127 { … … 147 150 void UIHelpBrowserWidget::prepare() 148 151 { 152 /* Create main layout: */ 153 m_pMainLayout = new QVBoxLayout(this); 154 AssertReturnVoid(m_pMainLayout); 155 149 156 prepareActions(); 157 prepareToolBar(); 150 158 prepareWidgets(); 151 159 prepareMenu(); … … 159 167 m_pShowHideTabWidgetAction->setChecked(true); 160 168 connect(m_pShowHideTabWidgetAction, &QAction::toggled, this, &UIHelpBrowserWidget::sltHandleTabVisibility); 169 m_pGoHomeAction = new QAction(UIIconPool::iconSet(":/file_manager_go_home_16px.png"), "", this); 170 connect(m_pGoHomeAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleGoHomeAction); 161 171 } 162 172 163 173 void UIHelpBrowserWidget::prepareWidgets() 164 174 { 165 /* Create main layout: */166 m_pMainLayout = new QHBoxLayout(this);167 175 m_pSplitter = new QSplitter; 168 169 AssertReturnVoid(m_pMainLayout && m_pSplitter); 176 AssertReturnVoid(m_pSplitter); 170 177 171 178 m_pMainLayout->addWidget(m_pSplitter); … … 226 233 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 227 234 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 228 235 m_pToolBar->addAction(m_pGoHomeAction); 229 236 230 237 #ifdef VBOX_WS_MAC … … 388 395 } 389 396 397 void sltHandleGoHomeAction(); 398 390 399 void UIHelpBrowserWidget::sltHandleContentWidgetItemClicked(const QModelIndex &index) 391 400 { … … 435 444 sltHandleHelpBrowserViewerSourceChange(m_pContentViewer->source()); 436 445 } 446 447 void UIHelpBrowserWidget::sltHandleGoHomeAction() 448 { 449 if (!m_pContentViewer) 450 return; 451 452 QUrl homeUrl = findIndexHtml(); 453 if (!homeUrl.isValid()) 454 return; 455 m_pContentViewer->setSource(homeUrl); 456 } 457 437 458 #include "UIHelpBrowserWidget.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86723 r86724 37 37 38 38 /* Forward declarations: */ 39 class Q HBoxLayout;39 class QVBoxLayout; 40 40 class QHelpEngine; 41 41 class QHelpContentModel; … … 83 83 void sltHandleHelpBrowserViewerSourceChange(const QUrl &source); 84 84 void sltHandleContentsCreated(); 85 void sltHandleGoHomeAction(); 85 86 86 87 private: … … 119 120 120 121 /** Holds container for log-pages. */ 121 Q HBoxLayout *m_pMainLayout;122 QVBoxLayout *m_pMainLayout; 122 123 QITabWidget *m_pTabWidget; 123 124 /** @name Toolbar and menu variables. … … 138 139 QWidget *m_pBookmarksWidget; 139 140 QAction *m_pShowHideTabWidgetAction; 141 QAction *m_pGoHomeAction; 140 142 QString m_strPageNotFoundText; 141 143 /* This is set t true when handling QHelpContentModel::contentsCreated signal. */
Note:
See TracChangeset
for help on using the changeset viewer.