Changeset 86735 in vbox
- Timestamp:
- Oct 28, 2020 11:43:16 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r85613 r86735 379 379 <file alias="hd_warning_16px.png">images/hd_warning_16px.png</file> 380 380 <file alias="hd_write_16px.png">images/hd_write_16px.png</file> 381 <file alias="help_browser_add_bookmark.png">images/help_browser_add_bookmark.png</file> 382 <file alias="help_browser_backward_32px.png">images/help_browser_backward_32px.png</file> 383 <file alias="help_browser_backward_disabled_32px.png">images/help_browser_backward_disabled_32px.png</file> 384 <file alias="help_browser_forward_disabled_32px.png">images/help_browser_forward_disabled_32px.png</file> 385 <file alias="help_browser_forward_32px.png">images/help_browser_forward_32px.png</file> 386 <file alias="help_browser_home_32px.png">images/help_browser_home_32px.png</file> 387 <file alias="help_browser_search.png">images/help_browser_search.png</file> 381 388 <file alias="help_16px.png">images/help_16px.png</file> 382 389 <file alias="help_button_normal_mac_24px.png">images/help_button_normal_mac_24px.png</file> -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86724 r86735 123 123 , m_pBookmarksWidget(0) 124 124 , m_pShowHideTabWidgetAction(0) 125 , m_pGoHomeAction(0) 125 , m_pHomeAction(0) 126 , m_pForwardAction(0) 127 , m_pBackwardAction(0) 126 128 , m_fModelContentCreated(false) 127 129 { … … 167 169 m_pShowHideTabWidgetAction->setChecked(true); 168 170 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); 171 m_pHomeAction = 172 new QAction(UIIconPool::iconSet(":/help_browser_home_32px.png"), QString(), this); 173 connect(m_pHomeAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleHomeAction); 174 175 m_pForwardAction = 176 new QAction(UIIconPool::iconSet(":/help_browser_forward_32px.png", ":/help_browser_forward_disabled_32px.png"), QString(), this); 177 connect(m_pForwardAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleForwardAction); 178 sltHandleForwardAvailable(false); 179 180 m_pBackwardAction = 181 new QAction(UIIconPool::iconSet(":/help_browser_backward_32px.png", ":/help_browser_backward_disabled_32px.png"), QString(), this); 182 connect(m_pBackwardAction, &QAction::triggered, this, &UIHelpBrowserWidget::sltHandleBackwardAction); 183 sltHandleBackwardAvailable(false); 171 184 } 172 185 … … 198 211 AssertReturnVoid(m_pContentViewer); 199 212 200 201 213 connect(m_pContentViewer, &UIHelpBrowserViewer::sourceChanged, 202 214 this, &UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange); 215 connect(m_pContentViewer, &UIHelpBrowserViewer::forwardAvailable, 216 this, &UIHelpBrowserWidget::sltHandleForwardAvailable); 217 connect(m_pContentViewer, &UIHelpBrowserViewer::backwardAvailable, 218 this, &UIHelpBrowserWidget::sltHandleBackwardAvailable); 219 connect(m_pContentViewer, &UIHelpBrowserViewer::sourceChanged, 220 this, &UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange); 221 203 222 m_pSplitter->addWidget(m_pContentViewer); 204 223 … … 230 249 { 231 250 /* Configure toolbar: */ 251 m_pToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); 232 252 const int iIconMetric = (int)(QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize)); 233 253 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 234 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 235 m_pToolBar->addAction(m_pGoHomeAction); 254 m_pToolBar->addAction(m_pBackwardAction); 255 m_pToolBar->addAction(m_pForwardAction); 256 m_pToolBar->addAction(m_pHomeAction); 236 257 237 258 #ifdef VBOX_WS_MAC … … 312 333 313 334 m_strPageNotFoundText = tr("<div><p><h3>404. Not found.</h3>The page <b>%1</b> could not be found.</p></div>"); 335 336 if (m_pHomeAction) 337 { 338 m_pHomeAction->setText(tr("Home")); 339 m_pHomeAction->setToolTip(tr("Return to start page")); 340 } 341 342 if (m_pBackwardAction) 343 { 344 m_pBackwardAction->setText(tr("Backward")); 345 m_pBackwardAction->setToolTip(tr("Navigate to previous page")); 346 } 347 348 if (m_pForwardAction) 349 { 350 m_pForwardAction->setText(tr("Forward")); 351 m_pForwardAction->setToolTip(tr("Navigate to next page")); 352 } 314 353 } 315 354 … … 395 434 } 396 435 397 void sltHandle GoHomeAction();436 void sltHandleHomeAction(); 398 437 399 438 void UIHelpBrowserWidget::sltHandleContentWidgetItemClicked(const QModelIndex &index) … … 445 484 } 446 485 447 void UIHelpBrowserWidget::sltHandle GoHomeAction()486 void UIHelpBrowserWidget::sltHandleHomeAction() 448 487 { 449 488 if (!m_pContentViewer) … … 456 495 } 457 496 497 void UIHelpBrowserWidget::sltHandleForwardAction() 498 { 499 if (m_pContentViewer) 500 m_pContentViewer->forward(); 501 } 502 503 void UIHelpBrowserWidget::sltHandleBackwardAction() 504 { 505 if (m_pContentViewer) 506 m_pContentViewer->backward(); 507 } 508 509 void UIHelpBrowserWidget::sltHandleForwardAvailable(bool fAvailable) 510 { 511 if (m_pForwardAction) 512 m_pForwardAction->setEnabled(fAvailable); 513 } 514 515 void UIHelpBrowserWidget::sltHandleBackwardAvailable(bool fAvailable) 516 { 517 if (m_pBackwardAction) 518 m_pBackwardAction->setEnabled(fAvailable); 519 } 520 458 521 #include "UIHelpBrowserWidget.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86724 r86735 83 83 void sltHandleHelpBrowserViewerSourceChange(const QUrl &source); 84 84 void sltHandleContentsCreated(); 85 void sltHandleGoHomeAction(); 85 void sltHandleHomeAction(); 86 void sltHandleForwardAction(); 87 void sltHandleBackwardAction(); 88 void sltHandleForwardAvailable(bool fAvailable); 89 void sltHandleBackwardAvailable(bool fAvailable); 86 90 87 91 private: … … 139 143 QWidget *m_pBookmarksWidget; 140 144 QAction *m_pShowHideTabWidgetAction; 141 QAction *m_pGoHomeAction; 145 QAction *m_pHomeAction; 146 QAction *m_pForwardAction; 147 QAction *m_pBackwardAction; 142 148 QString m_strPageNotFoundText; 143 149 /* This is set t true when handling QHelpContentModel::contentsCreated signal. */
Note:
See TracChangeset
for help on using the changeset viewer.