View Single Post
Old 03-22-2021, 03:04 PM   #418
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@capink: the changes to the template dialog broke action chains. Opening the template editor now silently dies.

The problem is in these lines of code at (I think) line 431 in templates.py:
Code:
        try:        
            self.gridLayout.setRowStretch(self.getWidgetRow(self.textbox), 2)
            self.gridLayout.setRowStretch(self.getWidgetRow(self.source_code), 1)
        except:
            if DEBUG:
                prints('Action chains: TemplateBox: Not able to modify stretch')
If I comment out the line:
Code:
            self.gridLayout.setRowStretch(self.getWidgetRow(self.source_code), 1)
the plugin works again.

I don't know why these lines are there.

While making the changes to add more result lines and ability to change the font, I cleaned up the layout of the dialog. In particular, the function reference stuff is now in its own unnamed grid layout put into a cell in the parent layout.

My recommendation is that unless there is a compelling reason you should remove the try/except block changing the stretch factor. You shouldn't need it. If you do then I can look at why and see if it is fixable in the TemplateDialog class itself.
chaley is offline   Reply With Quote