21 |
21 |
22 from .Ui_EricdocConfigDialog import Ui_EricdocConfigDialog |
22 from .Ui_EricdocConfigDialog import Ui_EricdocConfigDialog |
23 from DocumentationTools.Config import eric5docDefaultColors, \ |
23 from DocumentationTools.Config import eric5docDefaultColors, \ |
24 eric5docColorParameterNames |
24 eric5docColorParameterNames |
25 import Utilities |
25 import Utilities |
|
26 import UI.PixmapCache |
26 |
27 |
27 from eric5config import getConfig |
28 from eric5config import getConfig |
28 |
29 |
29 |
30 |
30 class EricdocConfigDialog(QDialog, Ui_EricdocConfigDialog): |
31 class EricdocConfigDialog(QDialog, Ui_EricdocConfigDialog): |
40 @param parent parent widget of this dialog |
41 @param parent parent widget of this dialog |
41 """ |
42 """ |
42 super(EricdocConfigDialog, self).__init__(parent) |
43 super(EricdocConfigDialog, self).__init__(parent) |
43 self.setupUi(self) |
44 self.setupUi(self) |
44 |
45 |
|
46 self.outputDirButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
47 self.ignoreDirButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
48 self.cssButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
49 self.qtHelpDirButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
50 |
45 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
51 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
46 |
52 |
47 self.__initializeDefaults() |
53 self.__initializeDefaults() |
48 |
54 |
49 self.sampleText = self.trUtf8( |
55 self.sampleText = self.tr( |
50 '''<?xml version="1.0" encoding="utf-8"?>''' |
56 '''<?xml version="1.0" encoding="utf-8"?>''' |
51 '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"''' |
57 '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"''' |
52 '''"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">''' |
58 '''"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">''' |
53 '''<html><head>''' |
59 '''<html><head>''' |
54 '''<title></title>''' |
60 '''<title></title>''' |
287 Private slot to select the output directory. |
293 Private slot to select the output directory. |
288 |
294 |
289 It displays a directory selection dialog to |
295 It displays a directory selection dialog to |
290 select the directory the documentations is written to. |
296 select the directory the documentations is written to. |
291 """ |
297 """ |
|
298 startDir = Utilities.fromNativeSeparators(self.outputDirEdit.text()) |
|
299 if not startDir: |
|
300 startDir = Utilities.fromNativeSeparators(self.ppath) |
292 directory = E5FileDialog.getExistingDirectory( |
301 directory = E5FileDialog.getExistingDirectory( |
293 self, |
302 self, |
294 self.trUtf8("Select output directory"), |
303 self.tr("Select output directory"), |
295 self.outputDirEdit.text(), |
304 startDir, |
296 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
305 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
297 |
306 |
298 if directory: |
307 if directory: |
299 # make it relative, if it is a subdirectory of the project path |
308 # make it relative, if it is a subdirectory of the project path |
300 dn = Utilities.toNativeSeparators(directory) |
309 dn = Utilities.toNativeSeparators(directory) |
309 Private slot to select a directory to be ignored. |
318 Private slot to select a directory to be ignored. |
310 |
319 |
311 It displays a directory selection dialog to |
320 It displays a directory selection dialog to |
312 select a directory to be ignored. |
321 select a directory to be ignored. |
313 """ |
322 """ |
314 startDir = self.ignoreDirEdit.text() |
323 startDir = Utilities.fromNativeSeparators(self.ignoreDirEdit.text()) |
315 if not startDir: |
324 if not startDir: |
316 startDir = self.ppath |
325 startDir = self.ppath |
317 directory = E5FileDialog.getExistingDirectory( |
326 directory = E5FileDialog.getExistingDirectory( |
318 self, |
327 self, |
319 self.trUtf8("Select directory to exclude"), |
328 self.tr("Select directory to exclude"), |
320 startDir, |
329 startDir, |
321 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
330 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
322 |
331 |
323 if directory: |
332 if directory: |
324 # make it relative, if it is a subdirectory of the project path |
333 # make it relative, if it is a subdirectory of the project path |
354 """ |
363 """ |
355 Private slot to select a css style sheet. |
364 Private slot to select a css style sheet. |
356 """ |
365 """ |
357 cssFile = E5FileDialog.getOpenFileName( |
366 cssFile = E5FileDialog.getOpenFileName( |
358 self, |
367 self, |
359 self.trUtf8("Select CSS style sheet"), |
368 self.tr("Select CSS style sheet"), |
360 getConfig('ericCSSDir'), |
369 getConfig('ericCSSDir'), |
361 self.trUtf8("Style sheet (*.css);;All files (*)")) |
370 self.tr("Style sheet (*.css);;All files (*)")) |
362 |
371 |
363 if cssFile: |
372 if cssFile: |
364 # make it relative, if it is in a subdirectory of the project path |
373 # make it relative, if it is in a subdirectory of the project path |
365 cf = Utilities.toNativeSeparators(cssFile) |
374 cf = Utilities.toNativeSeparators(cssFile) |
366 cf = self.project.getRelativePath(cf) |
375 cf = self.project.getRelativePath(cf) |
503 It displays a directory selection dialog to |
512 It displays a directory selection dialog to |
504 select the directory the QtHelp files are written to. |
513 select the directory the QtHelp files are written to. |
505 """ |
514 """ |
506 directory = E5FileDialog.getExistingDirectory( |
515 directory = E5FileDialog.getExistingDirectory( |
507 self, |
516 self, |
508 self.trUtf8("Select output directory for QtHelp files"), |
517 self.tr("Select output directory for QtHelp files"), |
509 self.qtHelpDirEdit.text(), |
518 self.qtHelpDirEdit.text(), |
510 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
519 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
511 |
520 |
512 if directory: |
521 if directory: |
513 # make it relative, if it is a subdirectory of the project path |
522 # make it relative, if it is a subdirectory of the project path |