eric6/UI/InstallInfoDialog.py

changeset 7808
da107cd00f63
parent 7807
5514ca6a62ca
child 7809
f5a61d073100
equal deleted inserted replaced
7807:5514ca6a62ca 7808:da107cd00f63
15 15
16 import Globals 16 import Globals
17 import UI.PixmapCache 17 import UI.PixmapCache
18 18
19 19
20 # TODO: add install date output
21 class InstallInfoDialog(QDialog, Ui_InstallInfoDialog): 20 class InstallInfoDialog(QDialog, Ui_InstallInfoDialog):
22 """ 21 """
23 Class documentation goes here. 22 Class documentation goes here.
24 """ 23 """
25 def __init__(self, parent=None): 24 def __init__(self, parent=None):
41 infoFileName = Globals.getInstallInfoFilePath() 40 infoFileName = Globals.getInstallInfoFilePath()
42 try: 41 try:
43 with open(infoFileName, "r") as infoFile: 42 with open(infoFileName, "r") as infoFile:
44 self.__info = json.load(infoFile) 43 self.__info = json.load(infoFile)
45 44
46 self.sudoLabel.setText( 45 if Globals.isWindowsPlatform():
46 self.sudoLabel1.setText(self.tr("Installed as Administrator:"))
47 else:
48 self.sudoLabel1.setText(self.tr("Installed with sudo:"))
49 self.sudoLabel2.setText(
47 self.tr("Yes") if self.__info["sudo"] else self.tr("No")) 50 self.tr("Yes") if self.__info["sudo"] else self.tr("No"))
48 self.userLabel.setText(self.__info["user"]) 51 self.userLabel.setText(self.__info["user"])
49 self.interpreteEdit.setText(self.__info["exe"]) 52 self.interpreteEdit.setText(self.__info["exe"])
50 self.commandEdit.setText(self.__info["argv"]) 53 self.commandEdit.setText(self.__info["argv"])
51 self.installPathEdit.setText(self.__info["eric"]) 54 self.installPathEdit.setText(self.__info["eric"])
62 "The information shown in this dialog was guessed at" 65 "The information shown in this dialog was guessed at"
63 " the first start of eric.")) 66 " the first start of eric."))
64 else: 67 else:
65 self.guessLabel.hide() 68 self.guessLabel.hide()
66 self.remarksEdit.setPlainText(self.__info["remarks"]) 69 self.remarksEdit.setPlainText(self.__info["remarks"])
70 if "installed_on" in self.__info:
71 self.installDateTimeLabel.setText(self.__info["installed_on"])
72 else:
73 self.installDateTimeLabel.setText(self.tr("unknown"))
67 except EnvironmentError as err: 74 except EnvironmentError as err:
68 E5MessageBox.critical( 75 E5MessageBox.critical(
69 self, 76 self,
70 self.tr("Load Install Information"), 77 self.tr("Load Install Information"),
71 self.tr("<p>The file containing the install information could" 78 self.tr("<p>The file containing the install information could"

eric ide

mercurial