Example #1
0
def browse_git_branch(branch):
    """Launch a dialog to browse files in a specific branch."""
    if not branch:
        return
    model = browser.BrowserModel(branch)
    parent = QtGui.QApplication.instance().activeWindow()
    view = SelectCommitsView(parent, syntax=False)
    controller = RepoBrowserController(model, view)
    view.show()
    return view.exec_() == QtGui.QDialog.Accepted
Example #2
0
def browse_git_branch(branch):
    """Launch a dialog to browse files in a specific branch."""
    if not branch:
        return
    # Clone the model to allow opening multiple browsers
    # with different sets of data
    model = browser.BrowserModel(branch)
    parent = QtGui.QApplication.instance().activeWindow()
    view = SelectCommitsView(parent, syntax=False)
    controller = RepoBrowserController(model, view)
    view.show()
    return view.exec_() == QtGui.QDialog.Accepted
Example #3
0
def select_file_from_repo():
    """Launche a dialog to selecting a filename from a branch."""
    model = cola.model().clone()
    parent = QtGui.QApplication.instance().activeWindow()
    view = SelectCommitsView(parent, syntax=False)
    controller = RepoBrowserController(model, view,
                                       title='Select File',
                                       get_file=True)
    view.show()
    if view.exec_() == QtGui.QDialog.Accepted:
        return controller.filename
    else:
        return None
Example #4
0
def select_file_from_repo():
    """Launch a dialog for selecting a filename from a branch."""
    # Clone the model to allow opening multiple browsers
    # with different sets of data
    model = browser.BrowserModel(gitcmds.current_branch())
    parent = QtGui.QApplication.instance().activeWindow()
    view = SelectCommitsView(parent, syntax=False)
    controller = RepoBrowserController(model, view,
                                       title='Select File',
                                       get_file=True)
    view.show()
    if view.exec_() == QtGui.QDialog.Accepted:
        return controller.filename
    else:
        return None