コード例 #1
0
ファイル: repobrowser.py プロジェクト: kbielefe/git-cola
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
コード例 #2
0
ファイル: repobrowser.py プロジェクト: johnpaulett/git-cola
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
コード例 #3
0
ファイル: repobrowser.py プロジェクト: johnpaulett/git-cola
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
コード例 #4
0
ファイル: repobrowser.py プロジェクト: kbielefe/git-cola
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