UI/UserInterface.py

changeset 2615
bdc9b4659826
parent 2606
f9592e331194
child 2624
e04b5d53281e
equal deleted inserted replaced
2614:9c49b4419ea7 2615:bdc9b4659826
10 import os 10 import os
11 import sys 11 import sys
12 import logging 12 import logging
13 13
14 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate, \ 14 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate, \
15 QIODevice, qVersion, QProcess, QSize, QUrl, QObject, Qt, QLibraryInfo 15 QIODevice, qVersion, QProcess, QSize, QUrl, QObject, Qt
16 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ 16 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \
17 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, QProgressDialog, \ 17 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, QProgressDialog, \
18 QVBoxLayout, QDockWidget, QAction, QLabel 18 QVBoxLayout, QDockWidget, QAction, QLabel
19 from PyQt4.Qsci import QSCINTILLA_VERSION_STR 19 from PyQt4.Qsci import QSCINTILLA_VERSION_STR
20 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ 20 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \
1595 self.utProjectAct.setEnabled(False) 1595 self.utProjectAct.setEnabled(False)
1596 self.actions.append(self.utProjectAct) 1596 self.actions.append(self.utProjectAct)
1597 1597
1598 # check for Qt4/Qt5 designer and linguist 1598 # check for Qt4/Qt5 designer and linguist
1599 if Utilities.isWindowsPlatform(): 1599 if Utilities.isWindowsPlatform():
1600 designerExe = os.path.join(QLibraryInfo.location(QLibraryInfo.BinariesPath), 1600 designerExe = os.path.join(Utilities.getQtBinariesPath(),
1601 "{0}.exe".format(Utilities.generateQtToolName("designer"))) 1601 "{0}.exe".format(Utilities.generateQtToolName("designer")))
1602 elif Utilities.isMacPlatform(): 1602 elif Utilities.isMacPlatform():
1603 designerExe = Utilities.getQtMacBundle("designer") 1603 designerExe = Utilities.getQtMacBundle("designer")
1604 else: 1604 else:
1605 designerExe = os.path.join(QLibraryInfo.location(QLibraryInfo.BinariesPath), 1605 designerExe = os.path.join(Utilities.getQtBinariesPath(),
1606 Utilities.generateQtToolName("designer")) 1606 Utilities.generateQtToolName("designer"))
1607 if os.path.exists(designerExe): 1607 if os.path.exists(designerExe):
1608 self.designer4Act = E5Action(self.trUtf8('Qt-Designer'), 1608 self.designer4Act = E5Action(self.trUtf8('Qt-Designer'),
1609 UI.PixmapCache.getIcon("designer4.png"), 1609 UI.PixmapCache.getIcon("designer4.png"),
1610 self.trUtf8('Qt-&Designer...'), 0, 0, self, 'qt_designer4') 1610 self.trUtf8('Qt-&Designer...'), 0, 0, self, 'qt_designer4')
1617 self.actions.append(self.designer4Act) 1617 self.actions.append(self.designer4Act)
1618 else: 1618 else:
1619 self.designer4Act = None 1619 self.designer4Act = None
1620 1620
1621 if Utilities.isWindowsPlatform(): 1621 if Utilities.isWindowsPlatform():
1622 linguistExe = os.path.join(QLibraryInfo.location(QLibraryInfo.BinariesPath), 1622 linguistExe = os.path.join(Utilities.getQtBinariesPath(),
1623 "{0}.exe".format(Utilities.generateQtToolName("linguist"))) 1623 "{0}.exe".format(Utilities.generateQtToolName("linguist")))
1624 elif Utilities.isMacPlatform(): 1624 elif Utilities.isMacPlatform():
1625 linguistExe = Utilities.getQtMacBundle("linguist") 1625 linguistExe = Utilities.getQtMacBundle("linguist")
1626 else: 1626 else:
1627 linguistExe = os.path.join(QLibraryInfo.location(QLibraryInfo.BinariesPath), 1627 linguistExe = os.path.join(Utilities.getQtBinariesPath(),
1628 Utilities.generateQtToolName("linguist")) 1628 Utilities.generateQtToolName("linguist"))
1629 if os.path.exists(linguistExe): 1629 if os.path.exists(linguistExe):
1630 self.linguist4Act = E5Action(self.trUtf8('Qt-Linguist'), 1630 self.linguist4Act = E5Action(self.trUtf8('Qt-Linguist'),
1631 UI.PixmapCache.getIcon("linguist4.png"), 1631 UI.PixmapCache.getIcon("linguist4.png"),
1632 self.trUtf8('Qt-&Linguist...'), 0, 0, self, 'qt_linguist4') 1632 self.trUtf8('Qt-&Linguist...'), 0, 0, self, 'qt_linguist4')
3754 if Utilities.isMacPlatform(): 3754 if Utilities.isMacPlatform():
3755 designer, args = Utilities.prepareQtMacBundle("designer", version, args) 3755 designer, args = Utilities.prepareQtMacBundle("designer", version, args)
3756 else: 3756 else:
3757 if version == 4: 3757 if version == 4:
3758 designer = os.path.join( 3758 designer = os.path.join(
3759 QLibraryInfo.location(QLibraryInfo.BinariesPath), 3759 Utilities.getQtBinariesPath(),
3760 Utilities.generateQtToolName("designer")) 3760 Utilities.generateQtToolName("designer"))
3761 if Utilities.isWindowsPlatform(): 3761 if Utilities.isWindowsPlatform():
3762 designer += '.exe' 3762 designer += '.exe'
3763 3763
3764 proc = QProcess() 3764 proc = QProcess()
3813 if Utilities.isMacPlatform(): 3813 if Utilities.isMacPlatform():
3814 linguist, args = Utilities.prepareQtMacBundle("linguist", version, args) 3814 linguist, args = Utilities.prepareQtMacBundle("linguist", version, args)
3815 else: 3815 else:
3816 if version == 4: 3816 if version == 4:
3817 linguist = os.path.join( 3817 linguist = os.path.join(
3818 QLibraryInfo.location(QLibraryInfo.BinariesPath), 3818 Utilities.getQtBinariesPath(),
3819 Utilities.generateQtToolName("linguist")) 3819 Utilities.generateQtToolName("linguist"))
3820 if Utilities.isWindowsPlatform(): 3820 if Utilities.isWindowsPlatform():
3821 linguist += '.exe' 3821 linguist += '.exe'
3822 3822
3823 proc = QProcess() 3823 proc = QProcess()
3859 if Utilities.isMacPlatform(): 3859 if Utilities.isMacPlatform():
3860 assistant, args = Utilities.prepareQtMacBundle("assistant", version, args) 3860 assistant, args = Utilities.prepareQtMacBundle("assistant", version, args)
3861 else: 3861 else:
3862 if version == 4: 3862 if version == 4:
3863 assistant = os.path.join( 3863 assistant = os.path.join(
3864 QLibraryInfo.location(QLibraryInfo.BinariesPath), 3864 Utilities.getQtBinariesPath(),
3865 Utilities.generateQtToolName("assistant")) 3865 Utilities.generateQtToolName("assistant"))
3866 if Utilities.isWindowsPlatform(): 3866 if Utilities.isWindowsPlatform():
3867 assistant += '.exe' 3867 assistant += '.exe'
3868 3868
3869 proc = QProcess() 3869 proc = QProcess()

eric ide

mercurial