36 @param parent parent widget (QWidget) |
36 @param parent parent widget (QWidget) |
37 """ |
37 """ |
38 super(SvnBlameDialog, self).__init__(parent) |
38 super(SvnBlameDialog, self).__init__(parent) |
39 self.setupUi(self) |
39 self.setupUi(self) |
40 SvnDialogMixin.__init__(self) |
40 SvnDialogMixin.__init__(self) |
41 self.setWindowFlags(Qt.Window) |
41 self.setWindowFlags(Qt.WindowType.Window) |
42 |
42 |
43 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
43 self.buttonBox.button( |
44 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
44 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
|
45 self.buttonBox.button( |
|
46 QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
45 |
47 |
46 self.vcs = vcs |
48 self.vcs = vcs |
47 |
49 |
48 self.blameList.headerItem().setText(self.blameList.columnCount(), "") |
50 self.blameList.headerItem().setText(self.blameList.columnCount(), "") |
49 font = Preferences.getEditorOtherFonts("MonospacedFont") |
51 font = Preferences.getEditorOtherFonts("MonospacedFont") |
87 def __finish(self): |
89 def __finish(self): |
88 """ |
90 """ |
89 Private slot called when the process finished or the user pressed the |
91 Private slot called when the process finished or the user pressed the |
90 button. |
92 button. |
91 """ |
93 """ |
92 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
94 self.buttonBox.button( |
93 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
95 QDialogButtonBox.StandardButton.Close).setEnabled(True) |
94 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
96 self.buttonBox.button( |
|
97 QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
|
98 self.buttonBox.button( |
|
99 QDialogButtonBox.StandardButton.Close).setDefault(True) |
95 |
100 |
96 self.__resizeColumns() |
101 self.__resizeColumns() |
97 |
102 |
98 self._cancel() |
103 self._cancel() |
99 |
104 |
101 """ |
106 """ |
102 Private slot called by a button of the button box clicked. |
107 Private slot called by a button of the button box clicked. |
103 |
108 |
104 @param button button that was clicked (QAbstractButton) |
109 @param button button that was clicked (QAbstractButton) |
105 """ |
110 """ |
106 if button == self.buttonBox.button(QDialogButtonBox.Close): |
111 if button == self.buttonBox.button( |
|
112 QDialogButtonBox.StandardButton.Close |
|
113 ): |
107 self.close() |
114 self.close() |
108 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): |
115 elif button == self.buttonBox.button( |
|
116 QDialogButtonBox.StandardButton.Cancel |
|
117 ): |
109 self.__finish() |
118 self.__finish() |
110 |
119 |
111 def __resizeColumns(self): |
120 def __resizeColumns(self): |
112 """ |
121 """ |
113 Private method to resize the list columns. |
122 Private method to resize the list columns. |
114 """ |
123 """ |
115 self.blameList.header().resizeSections(QHeaderView.ResizeToContents) |
124 self.blameList.header().resizeSections( |
|
125 QHeaderView.ResizeMode.ResizeToContents) |
116 |
126 |
117 def __generateItem(self, revision, author, lineno, text): |
127 def __generateItem(self, revision, author, lineno, text): |
118 """ |
128 """ |
119 Private method to generate a blame item in the blame list. |
129 Private method to generate a blame item in the blame list. |
120 |
130 |
124 @param text line of text from the annotated file (string) |
134 @param text line of text from the annotated file (string) |
125 """ |
135 """ |
126 itm = QTreeWidgetItem( |
136 itm = QTreeWidgetItem( |
127 self.blameList, |
137 self.blameList, |
128 ["{0:d}".format(revision), author, "{0:d}".format(lineno), text]) |
138 ["{0:d}".format(revision), author, "{0:d}".format(lineno), text]) |
129 itm.setTextAlignment(0, Qt.AlignRight) |
139 itm.setTextAlignment(0, Qt.AlignmentFlag.AlignRight) |
130 itm.setTextAlignment(2, Qt.AlignRight) |
140 itm.setTextAlignment(2, Qt.AlignmentFlag.AlignRight) |
131 |
141 |
132 def __showError(self, msg): |
142 def __showError(self, msg): |
133 """ |
143 """ |
134 Private slot to show an error message. |
144 Private slot to show an error message. |
135 |
145 |