Since the button is placed in the secondaryToolbar, it seems a little strange to me that there isn't any code in that file for this functionality.

The nicest thing would perhaps be if you created a proper initialization function and called that, similar how for example the find functionality is initialized.