MCPcopy Create free account
hub / github.com/LeFroid/Viper-Browser / onClickBookmarkIcon

Method onClickBookmarkIcon

src/ui/window/MainWindow.cpp:700–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698}
699
700void MainWindow::onClickBookmarkIcon()
701{
702 WebWidget *currentView = m_tabWidget->currentWebWidget();
703 if (!currentView)
704 return;
705
706 // Search for bookmark already existing, if not found, add to bookmarks, otherwise edit the existing bookmark
707 BookmarkNode *node = ui->toolBar->getURLWidget()->getBookmarkNode();
708 if (node == nullptr)
709 addPageToBookmarks();
710 else
711 {
712 if (!m_bookmarkDialog)
713 m_bookmarkDialog = new BookmarkDialog(m_bookmarkManager);
714
715 m_bookmarkDialog->setDialogHeader(tr("Bookmark"));
716 m_bookmarkDialog->setBookmarkInfo(node->getName(), node->getURL(), node->getParent());
717
718 // Set position of add bookmark dialog to align just under the URL bar on the right side
719 m_bookmarkDialog->alignAndShow(frameGeometry(), ui->toolBar->frameGeometry(), ui->toolBar->getURLWidget()->frameGeometry());
720 }
721}
722
723BrowserTabWidget *MainWindow::getTabWidget() const
724{

Callers

nothing calls this directly

Calls 7

getBookmarkNodeMethod · 0.80
getURLWidgetMethod · 0.80
setDialogHeaderMethod · 0.80
setBookmarkInfoMethod · 0.80
getParentMethod · 0.80
currentWebWidgetMethod · 0.45
alignAndShowMethod · 0.45

Tested by

no test coverage detected