def __init__(self, context_model=None, reference_variant=None,<EOL>in_window=False, parent=None):
super(VariantVersionsWidget, self).__init__(parent)<EOL>ContextViewMixin.__init__(self, context_model)<EOL>self.in_window = in_window<EOL>self.variant = None<EOL>self.reference_variant = reference_variant<EOL>self.pending_changelog_packages = None<EOL>self.label = QtGui.QLabel()<EOL>self.changelog_edit = ChangelogEdit()<EOL>self.table = VariantVersionsTable(self.context_model,<EOL>reference_variant=reference_variant)<EOL>self.tab = QtGui.QTabWidget()<EOL>self.tab.addTab(self.table, "<STR_LIT>")<EOL>self.tab.addTab(self.changelog_edit, "<STR_LIT>")<EOL>self.tab.currentChanged.connect(self._tabIndexChanged)<EOL>buttons = [None]<EOL>if self.in_window:<EOL><INDENT>close_btn = QtGui.QPushButton("<STR_LIT>")<EOL>buttons.append(close_btn)<EOL>close_btn.clicked.connect(self._close_window)<EOL><DEDENT>else:<EOL><INDENT>browse_versions_btn = QtGui.QPushButton("<STR_LIT>")<EOL>browse_versions_btn.clicked.connect(self._browseVersions)<EOL>buttons.append(browse_versions_btn)<EOL>window_btn = QtGui.QPushButton("<STR_LIT>")<EOL>window_btn.clicked.connect(self._view_changelogs_window)<EOL>buttons.append(window_btn)<EOL><DEDENT>btn_pane = create_pane(buttons, True, compact=not self.in_window)<EOL>pane = create_pane([self.label, self.tab, btn_pane], False, compact=True)<EOL>self.set_main_widget(pane)<EOL>self.set_loader_swap_delay(<NUM_LIT>)<EOL>self.clear()<EOL>
Args:
    reference_variant (`Variant`): Used to show the difference between
        two variants.
    in_window (bool): If True, the 'view changelogs' option turns
        into a checkbox, dropping the 'View in window' option.