10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt5.QtCore import pyqtSlot |
12 from PyQt5.QtCore import pyqtSlot |
13 |
13 |
14 from E5Gui import E5FileDialog |
14 from E5Gui import E5FileDialog |
|
15 from E5Gui.E5Completers import E5DirCompleter, E5FileCompleter |
15 |
16 |
16 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
17 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
17 ConfigurationPageBase |
18 ConfigurationPageBase |
18 from .Ui_DjangoPage import Ui_DjangoPage |
19 from .Ui_DjangoPage import Ui_DjangoPage |
19 |
20 |
20 from Globals import isWindowsPlatform, isMacPlatform |
21 from Globals import isWindowsPlatform, isMacPlatform |
21 |
22 |
22 import Utilities |
23 import Utilities |
|
24 import UI.PixmapCache |
23 |
25 |
24 |
26 |
25 class DjangoPage(ConfigurationPageBase, Ui_DjangoPage): |
27 class DjangoPage(ConfigurationPageBase, Ui_DjangoPage): |
26 """ |
28 """ |
27 Class implementing the Django configuration page. |
29 Class implementing the Django configuration page. |
34 """ |
36 """ |
35 super(DjangoPage, self).__init__() |
37 super(DjangoPage, self).__init__() |
36 self.setupUi(self) |
38 self.setupUi(self) |
37 self.setObjectName("DjangoPage") |
39 self.setObjectName("DjangoPage") |
38 |
40 |
|
41 self.virtualEnvPy3Button.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
42 self.virtualEnvPy2Button.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
43 self.translationsButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
44 |
|
45 self.__virtualEnvPy3Completer = E5DirCompleter(self.virtualEnvPy3Edit) |
|
46 self.__virtualEnvPy2Completer = E5DirCompleter(self.virtualEnvPy2Edit) |
|
47 self.__translationsCompleter = E5FileCompleter(self.translationsEdit) |
|
48 |
39 self.__plugin = plugin |
49 self.__plugin = plugin |
40 |
50 |
41 consoleList = [] |
51 consoleList = [] |
42 if isWindowsPlatform(): |
52 if isWindowsPlatform(): |
43 consoleList.append("cmd.exe /c") |
53 consoleList.append("cmd.exe /c") |
44 elif isMacPlatform(): |
54 elif isMacPlatform(): |
45 consoleList.append("xterm -e") |
55 consoleList.append("xterm -e") |
46 consoleList.append("/opt/X11/bin/xterm -e") |
56 consoleList.append("/opt/X11/bin/xterm -e") |
47 else: |
57 else: |
48 consoleList.append("@konsole --workdir . -e") |
58 consoleList.append("@konsole --workdir . -e") |
49 # KDE4 konsole spawns |
59 # KDE4/5 konsole spawns |
50 consoleList.append("gnome-terminal -e") |
60 consoleList.append("gnome-terminal -e") |
|
61 consoleList.append("mate-terminal -e") |
51 consoleList.append("xfce4-terminal -e") |
62 consoleList.append("xfce4-terminal -e") |
52 consoleList.append("xterm -e") |
63 consoleList.append("xterm -e") |
53 |
64 |
54 consoleNoCloseList = [] |
65 consoleNoCloseList = [] |
55 if isWindowsPlatform(): |
66 if isWindowsPlatform(): |
57 elif isMacPlatform(): |
68 elif isMacPlatform(): |
58 consoleNoCloseList.append("xterm -hold -e") |
69 consoleNoCloseList.append("xterm -hold -e") |
59 consoleNoCloseList.append("/opt/X11/bin/xterm -hold -e") |
70 consoleNoCloseList.append("/opt/X11/bin/xterm -hold -e") |
60 else: |
71 else: |
61 consoleNoCloseList.append("@konsole --noclose --workdir . -e") |
72 consoleNoCloseList.append("@konsole --noclose --workdir . -e") |
62 # KDE4 konsole spawns |
73 # KDE4/5 konsole spawns |
63 consoleNoCloseList.append("gnome-terminal -e") |
74 consoleNoCloseList.append("gnome-terminal --profile=<noclose> -e") |
|
75 consoleNoCloseList.append("mate-terminal --profile=<noclose> -e") |
64 consoleNoCloseList.append("xfce4-terminal --hold -e") |
76 consoleNoCloseList.append("xfce4-terminal --hold -e") |
65 consoleNoCloseList.append("xterm -hold -e") |
77 consoleNoCloseList.append("xterm -hold -e") |
66 |
78 |
67 self.consoleCommandCombo.addItems(consoleList) |
79 self.consoleCommandCombo.addItems(consoleList) |
68 self.consoleCommandNoCloseCombo.addItems(consoleNoCloseList) |
80 self.consoleCommandNoCloseCombo.addItems(consoleNoCloseList) |