Changeset 86715 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 26, 2020 4:59:39 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
r86697 r86715 61 61 HelpBrowserTabs_Max 62 62 }; 63 Q_DECLARE_METATYPE(HelpBrowserTabs); 63 64 64 65 class UIHelpBrowserViewer : public QTextBrowser … … 123 124 , m_pIndexWidget(0) 124 125 , m_pBookmarksWidget(0) 125 , m_pShowHideContentsWidgetAction(0) 126 { 126 , m_pShowHideTabWidgetAction(0) 127 { 128 qRegisterMetaType<HelpBrowserTabs>("HelpBrowserTabs"); 127 129 prepare(); 128 130 } … … 157 159 void UIHelpBrowserWidget::prepareActions() 158 160 { 159 m_pShowHideContentsWidgetAction = new QAction(this); 160 m_pShowHideContentsWidgetAction->setData(HelpBrowserTabs_TOC); 161 m_pShowHideTabWidgetAction = new QAction(this); 162 m_pShowHideTabWidgetAction->setCheckable(true); 163 m_pShowHideTabWidgetAction->setChecked(true); 164 connect(m_pShowHideTabWidgetAction, &QAction::toggled, this, &UIHelpBrowserWidget::sltHandleTabVisibility); 161 165 } 162 166 … … 175 179 m_pTabWidget = new QITabWidget; 176 180 AssertReturnVoid(m_pTabWidget && m_pHelpEngine && m_pBookmarksWidget); 181 //m_pTabWidget->setTabsClosable(true); 177 182 178 183 m_pContentWidget = m_pHelpEngine->contentWidget(); … … 181 186 AssertReturnVoid(m_pContentWidget && m_pIndexWidget); 182 187 m_pSplitter->addWidget(m_pTabWidget); 188 183 189 m_pTabWidget->insertTab(HelpBrowserTabs_TOC, m_pContentWidget, QString()); 184 190 m_pTabWidget->insertTab(HelpBrowserTabs_Index, m_pIndexWidget, QString()); 185 191 m_pTabWidget->insertTab(HelpBrowserTabs_Bookmarks, m_pBookmarksWidget, QString()); 192 193 // insertTabWidgets(HelpBrowserTabs_TOC); 194 // insertTabWidgets(HelpBrowserTabs_Index); 195 // insertTabWidgets(HelpBrowserTabs_Bookmarks); 186 196 187 197 m_pContentViewer = new UIHelpBrowserViewer(m_pHelpEngine); … … 240 250 m_pMenu = new QMenu(tr("View"), this); 241 251 AssertReturnVoid(m_pMenu); 242 m_pMenu->addAction(tr("View")); 252 253 m_pMenu->addAction(m_pShowHideTabWidgetAction); 243 254 } 244 255 … … 275 286 m_pTabWidget->setTabText(HelpBrowserTabs_Bookmarks, tr("Bookmarks")); 276 287 } 277 if (m_pShowHide ContentsWidgetAction)278 m_pShowHide ContentsWidgetAction->setText("Show/Hide Contents");288 if (m_pShowHideTabWidgetAction) 289 m_pShowHideTabWidgetAction->setText("Show/Hide Tabs Widget"); 279 290 } 280 291 … … 300 311 } 301 312 313 void UIHelpBrowserWidget::sltHandleTabVisibility(bool fToggled) 314 { 315 if (!m_pTabWidget) 316 return; 317 m_pTabWidget->setVisible(fToggled); 318 } 302 319 303 320 void UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished() -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86697 r86715 79 79 void sltHandleHelpEngineSetupFinished(); 80 80 void sltHandleContentWidgetItemClicked(const QModelIndex &index); 81 void sltHandleTabVisibility(bool togggled); 81 82 82 83 private: … … 91 92 void saveOptions(); 92 93 void cleanup(); 93 94 94 /** @name Event handling stuff. 95 95 * @{ */ … … 131 131 QHelpIndexWidget *m_pIndexWidget; 132 132 QWidget *m_pBookmarksWidget; 133 QAction *m_pShowHide ContentsWidgetAction;133 QAction *m_pShowHideTabWidgetAction; 134 134 }; 135 135
Note:
See TracChangeset
for help on using the changeset viewer.