-
Notifications
You must be signed in to change notification settings - Fork 39
Tweaks to NoteInputDialog #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,12 +14,27 @@ | |
| class NoteInputDialog(QtGui.QDialog): | ||
| """ | ||
| A dialog wrapper for the :class:`NoteInputWidget` widget. | ||
|
|
||
| The dialog instance will mirror all attributes and methods | ||
| found on the embedded :class:`NoteInputWidget` instance. | ||
| Example:: | ||
|
|
||
| note_dialog = NoteInputDialog(parent=self) | ||
| note_dialog.entity_created.connect(self._on_entity_created) | ||
| note_dialog.data_updated.connect(self.rescan) | ||
| note_dialog.set_bg_task_manager(self._task_manager) | ||
| note_dialog.set_current_entity(self._entity_type, self._entity_id) | ||
|
|
||
| # show modal | ||
| note_dialog.exec_() | ||
|
|
||
| """ | ||
| def __init__(self, *args, **kwargs): | ||
| def __init__(self, parent): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is how we do it everywhere else in the code. I think in general, we should try to avoid the |
||
| """ | ||
| Constructor. | ||
| :param parent: Qt parent object | ||
| :type parent: :class:`~PySide.QtGui.QWidget` | ||
| """ | ||
| super(NoteInputDialog, self).__init__(*args, **kwargs) | ||
| super(NoteInputDialog, self).__init__(parent) | ||
|
|
||
| self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint) | ||
|
|
||
|
|
@@ -36,4 +51,10 @@ def __init__(self, *args, **kwargs): | |
| self.widget.open_editor() | ||
|
|
||
| def __getattr__(self, name): | ||
| """ | ||
| Attribute dispatcher that promotes all the properties | ||
| and methods of the NoteInputWidget up to the widget. | ||
|
|
||
| :param name: Attribute name to retrieve | ||
| """ | ||
| return getattr(self.widget, name) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: this was looking odd in the sphinx docs!