I am using Quickly and created the main window and a dialog. In the main window I am setting access to database (u1db) in the finish_initializing method (self.db=...). After an action I open a dialog where I need access to the database.
I thought that I can use self.get_parent() in the dialog to get instance of the main window and access the database, but return value of the get_parent() is None.
My question is, how can I access the instance of the parent window in the dialog or perhaps where should I place the instance of the database wrapper?
Shortened code:
class GuitestWindow(Window):
def finish_initializing(self, builder):
...
self.db = u1db.open(
db_path,
create=True
)
def on_addaccountbutton_clicked(self, widget):
dialog = NewAccountDialog.NewAccountDialog()
result = dialog.run()
dialog.hide()