KDE 4.7 PyKDE API Reference

- KDE's Python API

# KBookmarkDialog Class Reference

`from PyKDE4.kio import *`

Inherits: KDialog → QDialog → QWidget → QObject

## Detailed Description

This class provides a Dialog for editing properties, adding Bookmarks and creating new folders. It can be used to show dialogs for common tasks with bookmarks.

It is used by KBookmarkMenu to show a dialog for "Properties", "Add Bookmark" and "Create New Folder". If you want to customize those dialogs, derive from KBookmarkOwner and reimplement bookmarkDialog(), return a KBookmarkDialog subclass and reimplement initLayout(), aboutToShow() and save().

## Enumerations
BookmarkDialogMode | { NewFolder, NewBookmark, EditBookmark, NewMultipleBookmarks, SelectFolder }
## Methods
| __init__ (self, KBookmarkManager a0, QWidget a1=0)
| aboutToShow (self, KBookmarkDialog.BookmarkDialogMode mode)
KBookmark | addBookmark (self, QString title, KUrl url, KBookmark parent=KBookmark())
KBookmarkGroup | addBookmarks (self, [(QString,QString)] list, QString name=QString(), KBookmarkGroup parent=KBookmarkGroup())
KBookmarkGroup | createNewFolder (self, QString name, KBookmark parent=KBookmark())
KBookmark | editBookmark (self, KBookmark bm)
| fillGroup (self, QTreeWidgetItem parentItem, KBookmarkGroup group)
| initLayout (self)
| initLayoutPrivate (self)
| newFolderButton (self)
KBookmarkGroup | parentBookmark (self)
| save (self, KBookmarkDialog.BookmarkDialogMode mode, KBookmark a1)
KBookmarkGroup | selectFolder (self, KBookmark start=KBookmark())
| setParentBookmark (self, KBookmark bm)
| slotButtonClicked (self, int a0)

## Method Documentation

__init__ | ( | self, |
|  | KBookmarkManager | a0,
|  | QWidget | a1=0
| ) |  |  |

Creates a new KBookmarkDialog

aboutToShow | ( | self, |
|  | KBookmarkDialog.BookmarkDialogMode | mode
| ) |  |  |

aboutToShow is called immediately before exec() Reimplement this to show or hide UI elements for certain modes.

KBookmark addBookmark | ( | self, |
|  | QString | title,
|  | KUrl | url,
|  | KBookmark | parent=KBookmark()
| ) |  |  |

shows a add Bookmark dialog Note: That this updates the bookmark and calls KBookmarkManager.emitChanged

KBookmarkGroup addBookmarks | ( | self, |
|  | [(QString,QString)] | list,
|  | QString | name=QString(),
|  | KBookmarkGroup | parent=KBookmarkGroup()
| ) |  |  |

Creates a folder from a list of bookmarks Note: That this updates the bookmark and calls KBookmarkManager.emitChanged

KBookmarkGroup createNewFolder | ( | self, |
|  | QString | name,
|  | KBookmark | parent=KBookmark()
| ) |  |  |

A dialog to create a new folder.

KBookmark editBookmark | ( | self, |
|  | KBookmark | bm
| ) |  |  |

shows a propeties dialog Note: That this updates the bookmark and calls KBookmarkManager.emitChanged

fillGroup | ( | self, |
|  | QTreeWidgetItem | parentItem,
|  | KBookmarkGroup | group
| ) |  |  |

initLayout | ( |  | self ) |

initLayout is called to set the dialog up, indepent from the mode If you want to add widgets or a custom layout, reimplement this function. The default implementation is rather simple, take a look at the source.

initLayoutPrivate | ( |  | self ) |

newFolderButton | ( |  | self ) |

KBookmarkGroup parentBookmark | ( |  | self ) |

returns the selected bookmark in the folder tree, or the root (top-level) bookmark if none was selected

save | ( | self, |
|  | KBookmarkDialog.BookmarkDialogMode | mode,
|  | KBookmark | a1
| ) |  |  |

save all your custom data in this method This is called after the users has accepted() the dialog.

KBookmarkGroup selectFolder | ( | self, |
|  | KBookmark | start=KBookmark()
| ) |  |  |

A dialog to select a folder.

setParentBookmark | ( | self, |
|  | KBookmark | bm
| ) |  |  |

selects the specified bookmark in the folder tree

slotButtonClicked | ( | self, |
|  | int | a0
| ) |  |  |

## Enumeration Documentation

BookmarkDialogMode

Enumerator: