source/riffle/browser.py
def _construct(self):
        '''Construct widget.'''
        self.setLayout(QtGui.QVBoxLayout())

        self._headerLayout = QtGui.QHBoxLayout()

        self._locationWidget = QtGui.QComboBox()
        self._headerLayout.addWidget(self._locationWidget, stretch=1)

        self._upButton = QtGui.QToolButton()
        self._upButton.setIcon(QtGui.QIcon(':riffle/icon/up'))
        self._headerLayout.addWidget(self._upButton)

        self.layout().addLayout(self._headerLayout)

        self._contentSplitter = QtGui.QSplitter()

        self._bookmarksWidget = QtGui.QListView()
        self._contentSplitter.addWidget(self._bookmarksWidget)

        self._filesystemWidget = QtGui.QTableView()
        self._filesystemWidget.setSelectionBehavior(
            self._filesystemWidget.SelectRows
        )
        self._filesystemWidget.setSelectionMode(
            self._filesystemWidget.SingleSelection
        )
        self._filesystemWidget.verticalHeader().hide()

        self._contentSplitter.addWidget(self._filesystemWidget)

        proxy = riffle.model.FilesystemSortProxy(self)
        model = riffle.model.Filesystem(
            path=self._root, parent=self, iconFactory=self._iconFactory
        )
        proxy.setSourceModel(model)
        proxy.setDynamicSortFilter(True)

        self._filesystemWidget.setModel(proxy)
        self._filesystemWidget.setSortingEnabled(True)

        self._contentSplitter.setStretchFactor(1, 1)
        self.layout().addWidget(self._contentSplitter)

        self._footerLayout = QtGui.QHBoxLayout()
        self._footerLayout.addStretch(1)

        self._cancelButton = QtGui.QPushButton('Cancel')
        self._footerLayout.addWidget(self._cancelButton)

        self._acceptButton = QtGui.QPushButton('Choose')
        self._footerLayout.addWidget(self._acceptButton)

        self.layout().addLayout(self._footerLayout)
def _construct(self):
        '''Construct widget.'''
        self.setLayout(QtGui.QVBoxLayout())

        self._headerLayout = QtGui.QHBoxLayout()

        self._locationWidget = QtGui.QComboBox()
        self._headerLayout.addWidget(self._locationWidget, stretch=1)

        self._upButton = QtGui.QToolButton()
        self._upButton.setIcon(QtGui.QIcon(':riffle/icon/up'))
        self._headerLayout.addWidget(self._upButton)

        self.layout().addLayout(self._headerLayout)

        self._contentSplitter = QtGui.QSplitter()

        self._bookmarksWidget = QtGui.QListView()
        self._contentSplitter.addWidget(self._bookmarksWidget)

        self._filesystemWidget = QtGui.QTableView()
        self._filesystemWidget.setSelectionBehavior(
            self._filesystemWidget.SelectRows
        )
        self._filesystemWidget.setSelectionMode(
            self._filesystemWidget.SingleSelection
        )
        self._filesystemWidget.verticalHeader().hide()

        self._contentSplitter.addWidget(self._filesystemWidget)

        proxy = riffle.model.FilesystemSortProxy(self)
        model = riffle.model.Filesystem(
            path=self._root, parent=self, iconFactory=self._iconFactory
        )
        proxy.setSourceModel(model)
        proxy.setDynamicSortFilter(True)

        self._filesystemWidget.setModel(proxy)
        self._filesystemWidget.setSortingEnabled(True)

        self._contentSplitter.setStretchFactor(1, 1)
        self.layout().addWidget(self._contentSplitter)

        self._footerLayout = QtGui.QHBoxLayout()
        self._footerLayout.addStretch(1)

        self._cancelButton = QtGui.QPushButton('Cancel')
        self._footerLayout.addWidget(self._cancelButton)

        self._acceptButton = QtGui.QPushButton('Choose')
        self._footerLayout.addWidget(self._acceptButton)

        self.layout().addLayout(self._footerLayout)
Construct widget.