From 5d9ad8a2da060345ba55e3192600085a4126b2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manne=20=C3=96hrstr=C3=B6m?= Date: Thu, 22 Sep 2016 13:14:57 +0100 Subject: [PATCH 1/2] Tweaks --- python/note_input_widget/dialog.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/note_input_widget/dialog.py b/python/note_input_widget/dialog.py index 7f3cb5a4..6ffe303d 100644 --- a/python/note_input_widget/dialog.py +++ b/python/note_input_widget/dialog.py @@ -15,11 +15,12 @@ class NoteInputDialog(QtGui.QDialog): """ A dialog wrapper for the :class:`NoteInputWidget` widget. """ - def __init__(self, *args, **kwargs): + def __init__(self, parent): """ - 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) From 9f8c22d7e76fc1a6d96a1917062714dbce4ffb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manne=20=C3=96hrstr=C3=B6m?= Date: Thu, 22 Sep 2016 13:30:36 +0100 Subject: [PATCH 2/2] docs --- python/note_input_widget/dialog.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/python/note_input_widget/dialog.py b/python/note_input_widget/dialog.py index 6ffe303d..438daa43 100644 --- a/python/note_input_widget/dialog.py +++ b/python/note_input_widget/dialog.py @@ -14,6 +14,20 @@ 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, parent): """ @@ -37,4 +51,10 @@ def __init__(self, parent): 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)