# eric4.Helpviewer.Bookmarks.AddBookmarkDialog

Module implementing a dialog to add a bookmark or a bookmark folder.

### Global Attributes

None

### Classes

AddBookmarkDialog | Class implementing a dialog to add a bookmark or a bookmark folder.
AddBookmarkProxyModel | Class implementing a proxy model used by the AddBookmarkDialog dialog.

### Functions

None

## AddBookmarkDialog

Class implementing a dialog to add a bookmark or a bookmark folder.

### Derived from

QDialog, Ui_AddBookmarkDialog

### Class Attributes

None

### Class Methods

None

### Methods

AddBookmarkDialog | Constructor
accept | Public slot handling the acceptance of the dialog.
addedNode | Public method to get a reference to the added bookmark node.
currentIndex | Public method to get the current index.
isFolder | Public method to test, if the dialog is in "Add Folder" mode.
setCurrentIndex | Public method to set the current index.
setFolder | Public method to set the dialog to "Add Folder" mode.
setTitle | Public method to set the title of the new bookmark.
setUrl | Public slot to set the URL of the new bookmark.
title | Public method to get the title of the bookmark.
url | Public method to get the URL of the bookmark.

### Static Methods

None

#### AddBookmarkDialog (Constructor)

AddBookmarkDialog(parent = None, bookmarksManager = None)

Constructor

parent
  reference to the parent widget (QWidget)
bookmarksManager
  reference to the bookmarks manager object (BookmarksManager)

#### AddBookmarkDialog.accept

accept()

Public slot handling the acceptance of the dialog.

#### AddBookmarkDialog.addedNode

addedNode()

Public method to get a reference to the added bookmark node.

Returns:
  reference to the added bookmark node (BookmarkNode)

#### AddBookmarkDialog.currentIndex

currentIndex()

Public method to get the current index.

Returns:
  current index (QModelIndex)

#### AddBookmarkDialog.isFolder

isFolder()

Public method to test, if the dialog is in "Add Folder" mode.

Returns:
  flag indicating "Add Folder" mode (boolean)

#### AddBookmarkDialog.setCurrentIndex

setCurrentIndex(idx)

Public method to set the current index.

idx
  current index to be set (QModelIndex)

#### AddBookmarkDialog.setFolder

setFolder(folder)

Public method to set the dialog to "Add Folder" mode.

folder
  flag indicating "Add Folder" mode (boolean)

#### AddBookmarkDialog.setTitle

setTitle(title)

Public method to set the title of the new bookmark.

title
  title of the bookmark (QString)

#### AddBookmarkDialog.setUrl

setUrl(url)

Public slot to set the URL of the new bookmark.

url
  URL of the bookmark (QString)

#### AddBookmarkDialog.title

title()

Public method to get the title of the bookmark.

Returns:
  title of the bookmark (QString)

#### AddBookmarkDialog.url

url()

Public method to get the URL of the bookmark.

Returns:
  URL of the bookmark (QString)

Up

## AddBookmarkProxyModel

Class implementing a proxy model used by the AddBookmarkDialog dialog.

### Derived from

QSortFilterProxyModel

### Class Attributes

None

### Class Methods

None

### Methods

AddBookmarkProxyModel | Constructor
columnCount | Public method to return the number of columns.
filterAcceptsColumn | Protected method to determine, if the column is acceptable.
filterAcceptsRow | Protected method to determine, if the row is acceptable.
hasChildren | Public method to check, if a parent node has some children.

### Static Methods

None

#### AddBookmarkProxyModel (Constructor)

AddBookmarkProxyModel(parent = None)

Constructor

parent
  reference to the parent object (QObject)

#### AddBookmarkProxyModel.columnCount

columnCount(parent)

Public method to return the number of columns.

parent
  index of the parent (QModelIndex)

Returns:
  number of columns (integer)

#### AddBookmarkProxyModel.filterAcceptsColumn

filterAcceptsColumn(sourceColumn, sourceParent)

Protected method to determine, if the column is acceptable.

sourceColumn
  column number in the source model (integer)
sourceParent
  index of the source item (QModelIndex)

Returns:
  flag indicating acceptance (boolean)

#### AddBookmarkProxyModel.filterAcceptsRow

filterAcceptsRow(sourceRow, sourceParent)

Protected method to determine, if the row is acceptable.

sourceRow
  row number in the source model (integer)
sourceParent
  index of the source item (QModelIndex)

Returns:
  flag indicating acceptance (boolean)

#### AddBookmarkProxyModel.hasChildren

hasChildren(parent = QModelIndex())

Public method to check, if a parent node has some children.

parent
  index of the parent node (QModelIndex)

Returns:
  flag indicating the presence of children (boolean)

Up