Exemple #1
0
    def __init__(self, parent):
        standard.Dialog.__init__(self, parent)
        self.setWindowTitle(N_('Recently Modified Files'))
        self.setWindowModality(Qt.WindowModal)

        count = 8
        self.update_thread = UpdateFileListThread(count)

        self.count = QtGui.QSpinBox()
        self.count.setMinimum(0)
        self.count.setMaximum(10000)
        self.count.setValue(count)
        self.count.setSuffix(N_(' commits ago'))

        self.count_label = QtGui.QLabel()
        self.count_label.setText(N_('Showing changes since'))

        self.refresh_button = QtGui.QPushButton()
        self.refresh_button.setText(N_('Refresh'))
        self.refresh_button.setIcon(qtutils.reload_icon())
        self.refresh_button.setEnabled(False)

        self.tree = GitTreeWidget(parent=self)
        self.tree_model = GitFileTreeModel(self)
        self.tree.setModel(self.tree_model)

        self.expand_button = QtGui.QPushButton()
        self.expand_button.setText(N_('Expand all'))
        self.expand_button.setIcon(qtutils.open_icon())

        self.collapse_button = QtGui.QPushButton()
        self.collapse_button.setText(N_('Collapse all'))
        self.collapse_button.setIcon(qtutils.dir_close_icon())

        self.edit_button = QtGui.QPushButton()
        self.edit_button.setText(N_('Edit'))
        self.edit_button.setIcon(qtutils.apply_icon())
        self.edit_button.setDefault(True)
        self.edit_button.setEnabled(False)

        self.close_button = QtGui.QPushButton()
        self.close_button.setText(N_('Close'))

        self.top_layout = qtutils.hbox(defs.no_margin, defs.spacing,
                                       self.count_label, self.count,
                                       qtutils.STRETCH, self.refresh_button)

        self.button_layout = qtutils.hbox(defs.no_margin, defs.spacing,
                                          self.expand_button,
                                          self.collapse_button,
                                          qtutils.STRETCH,
                                          self.edit_button, self.close_button)

        self.main_layout = qtutils.vbox(defs.margin, defs.spacing,
                                        self.top_layout, self.tree,
                                        self.button_layout)
        self.setLayout(self.main_layout)

        self.connect(self.tree, SIGNAL('selectionChanged()'),
                     self.selection_changed)

        self.connect(self.tree, SIGNAL('path_chosen'), self.edit_file)

        self.connect(self.count, SIGNAL('valueChanged(int)'),
                     self.count_changed)

        self.connect(self.count, SIGNAL('editingFinished()'), self.refresh)

        self.connect(self.update_thread, SIGNAL('filenames'),
                     self.set_filenames)

        qtutils.connect_button(self.refresh_button, self.refresh)
        qtutils.connect_button(self.expand_button, self.tree.expandAll)
        qtutils.connect_button(self.collapse_button, self.tree.collapseAll)
        qtutils.connect_button(self.close_button, self.accept)
        qtutils.connect_button(self.edit_button, self.edit_selected)

        qtutils.add_action(self, N_('Refresh'), self.refresh, 'Ctrl+R')

        self.update_thread.start()
Exemple #2
0
    def __init__(self, parent):
        standard.Dialog.__init__(self, parent)
        self.setWindowTitle(N_('Recently Modified Files'))
        self.setWindowModality(Qt.WindowModal)

        count = 8
        self.update_thread = UpdateFileListThread(count)

        self.count = QtGui.QSpinBox()
        self.count.setMinimum(0)
        self.count.setMaximum(10000)
        self.count.setValue(count)
        self.count.setSuffix(N_(' commits ago'))

        self.count_label = QtGui.QLabel()
        self.count_label.setText(N_('Showing changes since'))

        self.refresh_button = QtGui.QPushButton()
        self.refresh_button.setText(N_('Refresh'))
        self.refresh_button.setIcon(qtutils.reload_icon())
        self.refresh_button.setEnabled(False)

        self.tree = GitTreeWidget(parent=self)
        self.tree_model = GitFileTreeModel(self)
        self.tree.setModel(self.tree_model)

        self.expand_button = QtGui.QPushButton()
        self.expand_button.setText(N_('Expand all'))
        self.expand_button.setIcon(qtutils.open_icon())

        self.collapse_button = QtGui.QPushButton()
        self.collapse_button.setText(N_('Collapse all'))
        self.collapse_button.setIcon(qtutils.dir_close_icon())

        self.edit_button = QtGui.QPushButton()
        self.edit_button.setText(N_('Edit'))
        self.edit_button.setIcon(qtutils.apply_icon())
        self.edit_button.setDefault(True)
        self.edit_button.setEnabled(False)

        self.close_button = QtGui.QPushButton()
        self.close_button.setText(N_('Close'))

        self.top_layout = qtutils.hbox(defs.no_margin, defs.spacing,
                                       self.count_label, self.count,
                                       qtutils.STRETCH, self.refresh_button)

        self.button_layout = qtutils.hbox(defs.no_margin, defs.spacing,
                                          self.expand_button,
                                          self.collapse_button,
                                          qtutils.STRETCH, self.edit_button,
                                          self.close_button)

        self.main_layout = qtutils.vbox(defs.margin, defs.spacing,
                                        self.top_layout, self.tree,
                                        self.button_layout)
        self.setLayout(self.main_layout)

        self.connect(self.tree, SIGNAL('selectionChanged()'),
                     self.selection_changed)

        self.connect(self.tree, SIGNAL('path_chosen(PyQt_PyObject)'),
                     self.edit_file)

        self.connect(self.count, SIGNAL('valueChanged(int)'),
                     self.count_changed)

        self.connect(self.count, SIGNAL('editingFinished()'), self.refresh)

        self.connect(self.update_thread, SIGNAL('filenames(PyQt_PyObject)'),
                     self.set_filenames, Qt.QueuedConnection)

        qtutils.connect_button(self.refresh_button, self.refresh)
        qtutils.connect_button(self.expand_button, self.tree.expandAll)
        qtutils.connect_button(self.collapse_button, self.tree.collapseAll)
        qtutils.connect_button(self.close_button, self.accept)
        qtutils.connect_button(self.edit_button, self.edit_selected)

        qtutils.add_action(self, N_('Refresh'), self.refresh, hotkeys.REFRESH)

        self.update_thread.start()
Exemple #3
0
    def __init__(self, parent):
        standard.Dialog.__init__(self, parent)
        self.setWindowTitle(N_('Recently Modified Files'))
        self.setWindowModality(Qt.WindowModal)

        count = 8
        self.update_thread = UpdateFileListThread(count)

        self.count = QtGui.QSpinBox()
        self.count.setMinimum(0)
        self.count.setMaximum(10000)
        self.count.setValue(count)
        self.count.setSuffix(N_(' commits ago'))

        self.count_label = QtGui.QLabel()
        self.count_label.setText(N_('Showing changes since'))

        self.refresh_button = QtGui.QPushButton()
        self.refresh_button.setText(N_('Refresh'))
        self.refresh_button.setIcon(qtutils.reload_icon())
        self.refresh_button.setEnabled(False)

        self.tree = GitTreeWidget(parent=self)
        self.tree_model = GitFileTreeModel(self)
        self.tree.setModel(self.tree_model)

        self.expand_button = QtGui.QPushButton()
        self.expand_button.setText(N_('Expand'))
        self.expand_button.setIcon(qtutils.open_icon())

        self.collapse_button = QtGui.QPushButton()
        self.collapse_button.setText(N_('Collapse'))
        self.collapse_button.setIcon(qtutils.dir_close_icon())

        self.edit_button = QtGui.QPushButton()
        self.edit_button.setText(N_('Edit'))
        self.edit_button.setIcon(qtutils.apply_icon())
        self.edit_button.setDefault(True)
        self.edit_button.setEnabled(False)

        self.close_button = QtGui.QPushButton()
        self.close_button.setText(N_('Close'))

        toplayout = QtGui.QHBoxLayout()
        toplayout.setMargin(0)
        toplayout.setSpacing(defs.spacing)
        toplayout.addWidget(self.count_label)
        toplayout.addWidget(self.count)
        toplayout.addStretch()
        toplayout.addWidget(self.refresh_button)

        btnlayout = QtGui.QHBoxLayout()
        btnlayout.setMargin(0)
        btnlayout.setSpacing(defs.spacing)
        btnlayout.addWidget(self.expand_button)
        btnlayout.addWidget(self.collapse_button)
        btnlayout.addStretch()
        btnlayout.addWidget(self.edit_button)
        btnlayout.addWidget(self.close_button)

        layout = QtGui.QVBoxLayout()
        layout.setMargin(defs.margin)
        layout.setSpacing(defs.spacing)
        layout.addLayout(toplayout)
        layout.addWidget(self.tree)
        layout.addLayout(btnlayout)
        self.setLayout(layout)

        self.connect(self.tree, SIGNAL('selectionChanged()'),
                     self.selection_changed)

        self.connect(self.tree, SIGNAL('path_chosen'), self.edit_file)

        self.connect(self.count, SIGNAL('valueChanged(int)'),
                     self.count_changed)

        self.connect(self.count, SIGNAL('editingFinished()'), self.refresh)

        self.connect(self.update_thread, SIGNAL('filenames'),
                     self.set_filenames)

        qtutils.connect_button(self.refresh_button, self.refresh)
        qtutils.connect_button(self.expand_button, self.tree.expandAll)
        qtutils.connect_button(self.collapse_button, self.tree.collapseAll)
        qtutils.connect_button(self.close_button, self.accept)
        qtutils.connect_button(self.edit_button, self.edit_selected)

        qtutils.add_action(self, N_('Refresh'), self.refresh, 'Ctrl+R')

        self.update_thread.start()
Exemple #4
0
    def __init__(self, parent):
        standard.Dialog.__init__(self, parent)
        self.setWindowTitle(self.tr('Recently Modified Files'))
        self.setWindowModality(QtCore.Qt.WindowModal)

        self.update_thread = UpdateFileListThread()

        self.count = QtGui.QSpinBox()
        self.count.setMinimum(0)
        self.count.setMaximum(10000)
        self.count.setValue(0)
        self.count.setSuffix(self.tr(' commits ago'))

        self.count_label = QtGui.QLabel()
        self.count_label.setText(self.tr('Showing changes since'))

        self.refresh_button = QtGui.QPushButton()
        self.refresh_button.setText('Refresh')
        self.refresh_button.setIcon(qtutils.reload_icon())
        self.refresh_button.setEnabled(False)

        self.tree = GitTreeWidget(None, parent=self)
        self.tree_model = GitFileTreeModel(self)
        self.tree.setModel(self.tree_model)

        self.expand_button = QtGui.QPushButton()
        self.expand_button.setText('Expand')
        self.expand_button.setIcon(qtutils.open_icon())

        self.collapse_button = QtGui.QPushButton()
        self.collapse_button.setText('Collapse')
        self.collapse_button.setIcon(qtutils.dir_close_icon())

        self.edit_button = QtGui.QPushButton()
        self.edit_button.setText('Edit')
        self.edit_button.setIcon(qtutils.apply_icon())
        self.edit_button.setDefault(True)
        self.edit_button.setEnabled(False)

        self.close_button = QtGui.QPushButton()
        self.close_button.setText('Close')

        toplayout = QtGui.QHBoxLayout()
        toplayout.setMargin(0)
        toplayout.setSpacing(defs.spacing)
        toplayout.addWidget(self.count_label)
        toplayout.addWidget(self.count)
        toplayout.addStretch()
        toplayout.addWidget(self.refresh_button)

        btnlayout = QtGui.QHBoxLayout()
        btnlayout.setMargin(0)
        btnlayout.setSpacing(defs.spacing)
        btnlayout.addWidget(self.expand_button)
        btnlayout.addWidget(self.collapse_button)
        btnlayout.addStretch()
        btnlayout.addWidget(self.edit_button)
        btnlayout.addWidget(self.close_button)

        layout = QtGui.QVBoxLayout()
        layout.setMargin(defs.margin)
        layout.setSpacing(defs.spacing)
        layout.addLayout(toplayout)
        layout.addWidget(self.tree)
        layout.addLayout(btnlayout)
        self.setLayout(layout)

        self.connect(self.tree, SIGNAL('selectionChanged()'),
                     self.selection_changed)

        self.connect(self.tree, SIGNAL('path_chosen'), self.edit_file)

        self.connect(self.count, SIGNAL('valueChanged(int)'),
                     self.count_changed)

        self.connect(self.count, SIGNAL('editingFinished()'), self.refresh)

        self.connect(self.refresh_button, SIGNAL('clicked()'), self.refresh)

        self.connect(self.update_thread, SIGNAL('filenames'),
                     self.set_filenames)

        self.connect(self.expand_button, SIGNAL('clicked()'),
                     self.tree.expandAll)

        self.connect(self.collapse_button, SIGNAL('clicked()'),
                     self.tree.collapseAll)

        self.connect(self.close_button, SIGNAL('clicked()'), self.accept)
        self.connect(self.edit_button, SIGNAL('clicked()'), self.edit_selected)

        qtutils.add_action(self, 'Refresh', self.refresh, 'Ctrl+R')

        self.update_thread.count = 0
        self.update_thread.start()