'Update plugin title, i.e. dockwidget or mainwindow title'

def update_plugin_title(self):

    if (self.dockwidget is not None):
        win = self.dockwidget
    elif (self.mainwindow is not None):
        win = self.mainwindow
    else:
        return
    win.setWindowTitle(self.get_plugin_title())
