|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.UI.DiffDialog</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.UI.DiffDialog</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a dialog to compare two files. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#DiffDialog">DiffDialog</a></td> |
|
39 <td>Class implementing a dialog to compare two files.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#DiffWindow">DiffWindow</a></td> |
|
43 <td>Main window class for the standalone dialog.</td> |
|
44 </tr> |
|
45 </table> |
|
46 <h3>Functions</h3> |
|
47 |
|
48 <table> |
|
49 <tr><td>None</td></tr> |
|
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
|
53 <a NAME="DiffDialog" ID="DiffDialog"></a> |
|
54 <h2>DiffDialog</h2> |
|
55 |
|
56 <p> |
|
57 Class implementing a dialog to compare two files. |
|
58 </p> |
|
59 <h3>Derived from</h3> |
|
60 QWidget, Ui_DiffDialog |
|
61 <h3>Class Attributes</h3> |
|
62 |
|
63 <table> |
|
64 <tr><td>None</td></tr> |
|
65 </table> |
|
66 <h3>Class Methods</h3> |
|
67 |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 <h3>Methods</h3> |
|
72 |
|
73 <table> |
|
74 |
|
75 <tr> |
|
76 <td><a href="#DiffDialog.__init__">DiffDialog</a></td> |
|
77 <td>Constructor</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#DiffDialog.__appendText">__appendText</a></td> |
|
81 <td>Private method to append text to the end of the contents pane.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#DiffDialog.__fileChanged">__fileChanged</a></td> |
|
85 <td>Private slot to enable/disable the Compare button.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#DiffDialog.__generateContextDiff">__generateContextDiff</a></td> |
|
89 <td>Private slot to generate a context diff output.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#DiffDialog.__generateUnifiedDiff">__generateUnifiedDiff</a></td> |
|
93 <td>Private slot to generate a unified diff output.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#DiffDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
97 <td>Private slot called by a button of the button box clicked.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#DiffDialog.on_diffButton_clicked">on_diffButton_clicked</a></td> |
|
101 <td>Private slot to handle the Compare button press.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#DiffDialog.on_saveButton_clicked">on_saveButton_clicked</a></td> |
|
105 <td>Private slot to handle the Save button press.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#DiffDialog.show">show</a></td> |
|
109 <td>Public slot to show the dialog.</td> |
|
110 </tr> |
|
111 </table> |
|
112 <h3>Static Methods</h3> |
|
113 |
|
114 <table> |
|
115 <tr><td>None</td></tr> |
|
116 </table> |
|
117 |
|
118 <a NAME="DiffDialog.__init__" ID="DiffDialog.__init__"></a> |
|
119 <h4>DiffDialog (Constructor)</h4> |
|
120 <b>DiffDialog</b>(<i>parent=None</i>) |
|
121 |
|
122 <p> |
|
123 Constructor |
|
124 </p> |
|
125 <dl> |
|
126 |
|
127 <dt><i>parent</i></dt> |
|
128 <dd> |
|
129 reference to the parent widget (QWidget) |
|
130 </dd> |
|
131 </dl> |
|
132 <a NAME="DiffDialog.__appendText" ID="DiffDialog.__appendText"></a> |
|
133 <h4>DiffDialog.__appendText</h4> |
|
134 <b>__appendText</b>(<i>txt</i>) |
|
135 |
|
136 <p> |
|
137 Private method to append text to the end of the contents pane. |
|
138 </p> |
|
139 <dl> |
|
140 |
|
141 <dt><i>txt</i></dt> |
|
142 <dd> |
|
143 text to insert (string) |
|
144 </dd> |
|
145 </dl> |
|
146 <a NAME="DiffDialog.__fileChanged" ID="DiffDialog.__fileChanged"></a> |
|
147 <h4>DiffDialog.__fileChanged</h4> |
|
148 <b>__fileChanged</b>(<i></i>) |
|
149 |
|
150 <p> |
|
151 Private slot to enable/disable the Compare button. |
|
152 </p> |
|
153 <a NAME="DiffDialog.__generateContextDiff" ID="DiffDialog.__generateContextDiff"></a> |
|
154 <h4>DiffDialog.__generateContextDiff</h4> |
|
155 <b>__generateContextDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>) |
|
156 |
|
157 <p> |
|
158 Private slot to generate a context diff output. |
|
159 </p> |
|
160 <dl> |
|
161 |
|
162 <dt><i>a</i></dt> |
|
163 <dd> |
|
164 first sequence of lines (list of strings) |
|
165 </dd> |
|
166 <dt><i>b</i></dt> |
|
167 <dd> |
|
168 second sequence of lines (list of strings) |
|
169 </dd> |
|
170 <dt><i>fromfile</i></dt> |
|
171 <dd> |
|
172 filename of the first file (string) |
|
173 </dd> |
|
174 <dt><i>tofile</i></dt> |
|
175 <dd> |
|
176 filename of the second file (string) |
|
177 </dd> |
|
178 <dt><i>fromfiledate</i></dt> |
|
179 <dd> |
|
180 modification time of the first file (string) |
|
181 </dd> |
|
182 <dt><i>tofiledate</i></dt> |
|
183 <dd> |
|
184 modification time of the second file (string) |
|
185 </dd> |
|
186 </dl> |
|
187 <a NAME="DiffDialog.__generateUnifiedDiff" ID="DiffDialog.__generateUnifiedDiff"></a> |
|
188 <h4>DiffDialog.__generateUnifiedDiff</h4> |
|
189 <b>__generateUnifiedDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>) |
|
190 |
|
191 <p> |
|
192 Private slot to generate a unified diff output. |
|
193 </p> |
|
194 <dl> |
|
195 |
|
196 <dt><i>a</i></dt> |
|
197 <dd> |
|
198 first sequence of lines (list of strings) |
|
199 </dd> |
|
200 <dt><i>b</i></dt> |
|
201 <dd> |
|
202 second sequence of lines (list of strings) |
|
203 </dd> |
|
204 <dt><i>fromfile</i></dt> |
|
205 <dd> |
|
206 filename of the first file (string) |
|
207 </dd> |
|
208 <dt><i>tofile</i></dt> |
|
209 <dd> |
|
210 filename of the second file (string) |
|
211 </dd> |
|
212 <dt><i>fromfiledate</i></dt> |
|
213 <dd> |
|
214 modification time of the first file (string) |
|
215 </dd> |
|
216 <dt><i>tofiledate</i></dt> |
|
217 <dd> |
|
218 modification time of the second file (string) |
|
219 </dd> |
|
220 </dl> |
|
221 <a NAME="DiffDialog.on_buttonBox_clicked" ID="DiffDialog.on_buttonBox_clicked"></a> |
|
222 <h4>DiffDialog.on_buttonBox_clicked</h4> |
|
223 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
224 |
|
225 <p> |
|
226 Private slot called by a button of the button box clicked. |
|
227 </p> |
|
228 <dl> |
|
229 |
|
230 <dt><i>button</i></dt> |
|
231 <dd> |
|
232 button that was clicked (QAbstractButton) |
|
233 </dd> |
|
234 </dl> |
|
235 <a NAME="DiffDialog.on_diffButton_clicked" ID="DiffDialog.on_diffButton_clicked"></a> |
|
236 <h4>DiffDialog.on_diffButton_clicked</h4> |
|
237 <b>on_diffButton_clicked</b>(<i></i>) |
|
238 |
|
239 <p> |
|
240 Private slot to handle the Compare button press. |
|
241 </p> |
|
242 <a NAME="DiffDialog.on_saveButton_clicked" ID="DiffDialog.on_saveButton_clicked"></a> |
|
243 <h4>DiffDialog.on_saveButton_clicked</h4> |
|
244 <b>on_saveButton_clicked</b>(<i></i>) |
|
245 |
|
246 <p> |
|
247 Private slot to handle the Save button press. |
|
248 </p> |
|
249 <p> |
|
250 It saves the diff shown in the dialog to a file in the local |
|
251 filesystem. |
|
252 </p> |
|
253 <a NAME="DiffDialog.show" ID="DiffDialog.show"></a> |
|
254 <h4>DiffDialog.show</h4> |
|
255 <b>show</b>(<i>filename=None</i>) |
|
256 |
|
257 <p> |
|
258 Public slot to show the dialog. |
|
259 </p> |
|
260 <dl> |
|
261 |
|
262 <dt><i>filename</i></dt> |
|
263 <dd> |
|
264 name of a file to use as the first file (string) |
|
265 </dd> |
|
266 </dl> |
|
267 <div align="right"><a href="#top">Up</a></div> |
|
268 <hr /> |
|
269 <hr /> |
|
270 <a NAME="DiffWindow" ID="DiffWindow"></a> |
|
271 <h2>DiffWindow</h2> |
|
272 |
|
273 <p> |
|
274 Main window class for the standalone dialog. |
|
275 </p> |
|
276 <h3>Derived from</h3> |
|
277 EricMainWindow |
|
278 <h3>Class Attributes</h3> |
|
279 |
|
280 <table> |
|
281 <tr><td>None</td></tr> |
|
282 </table> |
|
283 <h3>Class Methods</h3> |
|
284 |
|
285 <table> |
|
286 <tr><td>None</td></tr> |
|
287 </table> |
|
288 <h3>Methods</h3> |
|
289 |
|
290 <table> |
|
291 |
|
292 <tr> |
|
293 <td><a href="#DiffWindow.__init__">DiffWindow</a></td> |
|
294 <td>Constructor</td> |
|
295 </tr> |
|
296 <tr> |
|
297 <td><a href="#DiffWindow.eventFilter">eventFilter</a></td> |
|
298 <td>Public method to filter events.</td> |
|
299 </tr> |
|
300 </table> |
|
301 <h3>Static Methods</h3> |
|
302 |
|
303 <table> |
|
304 <tr><td>None</td></tr> |
|
305 </table> |
|
306 |
|
307 <a NAME="DiffWindow.__init__" ID="DiffWindow.__init__"></a> |
|
308 <h4>DiffWindow (Constructor)</h4> |
|
309 <b>DiffWindow</b>(<i>parent=None</i>) |
|
310 |
|
311 <p> |
|
312 Constructor |
|
313 </p> |
|
314 <dl> |
|
315 |
|
316 <dt><i>parent</i></dt> |
|
317 <dd> |
|
318 reference to the parent widget (QWidget) |
|
319 </dd> |
|
320 </dl> |
|
321 <a NAME="DiffWindow.eventFilter" ID="DiffWindow.eventFilter"></a> |
|
322 <h4>DiffWindow.eventFilter</h4> |
|
323 <b>eventFilter</b>(<i>obj, event</i>) |
|
324 |
|
325 <p> |
|
326 Public method to filter events. |
|
327 </p> |
|
328 <dl> |
|
329 |
|
330 <dt><i>obj</i></dt> |
|
331 <dd> |
|
332 reference to the object the event is meant for (QObject) |
|
333 </dd> |
|
334 <dt><i>event</i></dt> |
|
335 <dd> |
|
336 reference to the event object (QEvent) |
|
337 </dd> |
|
338 </dl> |
|
339 <dl> |
|
340 <dt>Return:</dt> |
|
341 <dd> |
|
342 flag indicating, whether the event was handled (boolean) |
|
343 </dd> |
|
344 </dl> |
|
345 <div align="right"><a href="#top">Up</a></div> |
|
346 <hr /> |
|
347 </body></html> |