UI/UserInterface.py

changeset 536
6d8d39753c82
parent 535
4b00d7336e19
child 537
72b32daeb8d6
equal deleted inserted replaced
535:4b00d7336e19 536:6d8d39753c82
77 from E5Gui.E5ToolBarManager import E5ToolBarManager 77 from E5Gui.E5ToolBarManager import E5ToolBarManager
78 from E5Gui.E5ToolBarDialog import E5ToolBarDialog 78 from E5Gui.E5ToolBarDialog import E5ToolBarDialog
79 from E5Gui.E5SqueezeLabels import E5SqueezeLabelPath 79 from E5Gui.E5SqueezeLabels import E5SqueezeLabelPath
80 from E5Gui.E5ToolBox import E5VerticalToolBox, E5HorizontalToolBox 80 from E5Gui.E5ToolBox import E5VerticalToolBox, E5HorizontalToolBox
81 from E5Gui.E5SideBar import E5SideBar 81 from E5Gui.E5SideBar import E5SideBar
82 from E5Gui import E5MessageBox
82 83
83 from VCS.StatusMonitorLed import StatusMonitorLed 84 from VCS.StatusMonitorLed import StatusMonitorLed
84 85
85 import Preferences 86 import Preferences
86 import ViewManager 87 import ViewManager
3988 version = 3 3989 version = 3
3989 except IOError: 3990 except IOError:
3990 pass 3991 pass
3991 3992
3992 if version == 3: 3993 if version == 3:
3993 QMessageBox.information(None, 3994 E5MessageBox.information(self,
3994 self.trUtf8("Qt 3 support"), 3995 self.trUtf8("Qt 3 support"),
3995 self.trUtf8("""Qt v.3 is not supported by eric5.""")) 3996 self.trUtf8("""Qt v.3 is not supported by eric5."""))
3996 return 3997 return
3997 3998
3998 args = [] 3999 args = []
4044 4045
4045 @param fn filename of the translation file to be opened 4046 @param fn filename of the translation file to be opened
4046 @param version indication for the requested version (Qt 4) (integer) 4047 @param version indication for the requested version (Qt 4) (integer)
4047 """ 4048 """
4048 if version < 4: 4049 if version < 4:
4049 QMessageBox.information(None, 4050 E5MessageBox.information(self,
4050 self.trUtf8("Qt 3 support"), 4051 self.trUtf8("Qt 3 support"),
4051 self.trUtf8("""Qt v.3 is not supported by eric5.""")) 4052 self.trUtf8("""Qt v.3 is not supported by eric5."""))
4052 return 4053 return
4053 4054
4054 args = [] 4055 args = []
4103 4104
4104 @param home full pathname of a file to display (string) 4105 @param home full pathname of a file to display (string)
4105 @param version indication for the requested version (Qt 4) (integer) 4106 @param version indication for the requested version (Qt 4) (integer)
4106 """ 4107 """
4107 if version < 4: 4108 if version < 4:
4108 QMessageBox.information(None, 4109 E5MessageBox.information(self,
4109 self.trUtf8("Qt 3 support"), 4110 self.trUtf8("Qt 3 support"),
4110 self.trUtf8("""Qt v.3 is not supported by eric5.""")) 4111 self.trUtf8("""Qt v.3 is not supported by eric5."""))
4111 return 4112 return
4112 4113
4113 args = [] 4114 args = []
4153 4154
4154 @param home full pathname of a file to display (string) 4155 @param home full pathname of a file to display (string)
4155 """ 4156 """
4156 customViewer = Preferences.getHelp("CustomViewer") 4157 customViewer = Preferences.getHelp("CustomViewer")
4157 if not customViewer: 4158 if not customViewer:
4158 QMessageBox.information(self, 4159 E5MessageBox.information(self,
4159 self.trUtf8("Help"), 4160 self.trUtf8("Help"),
4160 self.trUtf8("""Currently no custom viewer is selected.""" 4161 self.trUtf8("""Currently no custom viewer is selected."""
4161 """ Please use the preferences dialog to specify one.""")) 4162 """ Please use the preferences dialog to specify one."""))
4162 return 4163 return
4163 4164
4336 for tool in toolGroup[1]: 4337 for tool in toolGroup[1]:
4337 if tool['menutext'] == toolMenuText: 4338 if tool['menutext'] == toolMenuText:
4338 self.__startToolProcess(tool) 4339 self.__startToolProcess(tool)
4339 return 4340 return
4340 4341
4341 QMessageBox.information(self, 4342 E5MessageBox.information(self,
4342 self.trUtf8("External Tools"), 4343 self.trUtf8("External Tools"),
4343 self.trUtf8("""No tool entry found for external tool '{0}' """ 4344 self.trUtf8("""No tool entry found for external tool '{0}' """
4344 """in tool group '{1}'.""").format(toolMenuText, toolGroupName)) 4345 """in tool group '{1}'.""").format(toolMenuText, toolGroupName))
4345 return 4346 return
4346 4347
4347 QMessageBox.information(self, 4348 E5MessageBox.information(self,
4348 self.trUtf8("External Tools"), 4349 self.trUtf8("External Tools"),
4349 self.trUtf8("""No toolgroup entry '{0}' found.""").format(toolGroupName)) 4350 self.trUtf8("""No toolgroup entry '{0}' found.""").format(toolGroupName))
4350 4351
4351 def __toolExecute(self, act): 4352 def __toolExecute(self, act):
4352 """ 4353 """
5291 fname = url.toLocalFile() 5292 fname = url.toLocalFile()
5292 if fname: 5293 if fname:
5293 if QFileInfo(fname).isFile(): 5294 if QFileInfo(fname).isFile():
5294 self.viewmanager.openSourceFile(fname) 5295 self.viewmanager.openSourceFile(fname)
5295 else: 5296 else:
5296 QMessageBox.information(None, 5297 E5MessageBox.information(self,
5297 self.trUtf8("Drop Error"), 5298 self.trUtf8("Drop Error"),
5298 self.trUtf8("""<p><b>{0}</b> is not a file.</p>""") 5299 self.trUtf8("""<p><b>{0}</b> is not a file.</p>""")
5299 .format(fname)) 5300 .format(fname))
5300 5301
5301 self.inDragDrop = False 5302 self.inDragDrop = False
5518 url = "" 5519 url = ""
5519 try: 5520 try:
5520 if "-snapshot-" in Version: 5521 if "-snapshot-" in Version:
5521 # check snapshot version 5522 # check snapshot version
5522 if versions[2] > Version: 5523 if versions[2] > Version:
5523 res = QMessageBox.information(None, 5524 res = QMessageBox.question(self,
5524 self.trUtf8("Update available"), 5525 self.trUtf8("Update available"),
5525 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" 5526 self.trUtf8("""The update to <b>{0}</b> of eric5 is available"""
5526 """ at <b>{1}</b>. Would you like to get it?""")\ 5527 """ at <b>{1}</b>. Would you like to get it?""")\
5527 .format(versions[2], versions[3]), 5528 .format(versions[2], versions[3]),
5528 QMessageBox.StandardButtons(\ 5529 QMessageBox.StandardButtons(\
5529 QMessageBox.No | \ 5530 QMessageBox.No | \
5530 QMessageBox.Yes), 5531 QMessageBox.Yes),
5531 QMessageBox.Yes) 5532 QMessageBox.Yes)
5532 url = res == QMessageBox.Yes and versions[3] or '' 5533 url = res == QMessageBox.Yes and versions[3] or ''
5533 elif versions[0] > Version: 5534 elif versions[0] > Version:
5534 res = QMessageBox.information(None, 5535 res = QMessageBox.question(self,
5535 self.trUtf8("Update available"), 5536 self.trUtf8("Update available"),
5536 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" 5537 self.trUtf8("""The update to <b>{0}</b> of eric5 is available"""
5537 """ at <b>{1}</b>. Would you like to get it?""")\ 5538 """ at <b>{1}</b>. Would you like to get it?""")\
5538 .format(versions[0], versions[1]), 5539 .format(versions[0], versions[1]),
5539 QMessageBox.StandardButtons(\ 5540 QMessageBox.StandardButtons(\
5541 QMessageBox.Yes), 5542 QMessageBox.Yes),
5542 QMessageBox.Yes) 5543 QMessageBox.Yes)
5543 url = res == QMessageBox.Yes and versions[1] or '' 5544 url = res == QMessageBox.Yes and versions[1] or ''
5544 else: 5545 else:
5545 if self.manualUpdatesCheck: 5546 if self.manualUpdatesCheck:
5546 QMessageBox.information(None, 5547 E5MessageBox.information(self,
5547 self.trUtf8("Eric5 is up to date"), 5548 self.trUtf8("Eric5 is up to date"),
5548 self.trUtf8("""You are using the latest version of eric5""")) 5549 self.trUtf8("""You are using the latest version of eric5"""))
5549 else: 5550 else:
5550 # check release version 5551 # check release version
5551 if versions[0] > Version: 5552 if versions[0] > Version:
5552 res = QMessageBox.information(None, 5553 res = QMessageBox.question(self,
5553 self.trUtf8("Update available"), 5554 self.trUtf8("Update available"),
5554 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" 5555 self.trUtf8("""The update to <b>{0}</b> of eric5 is available"""
5555 """ at <b>{1}</b>. Would you like to get it?""")\ 5556 """ at <b>{1}</b>. Would you like to get it?""")\
5556 .format(versions[0], versions[1]), 5557 .format(versions[0], versions[1]),
5557 QMessageBox.StandardButtons(\ 5558 QMessageBox.StandardButtons(\
5559 QMessageBox.Yes), 5560 QMessageBox.Yes),
5560 QMessageBox.Yes) 5561 QMessageBox.Yes)
5561 url = res == QMessageBox.Yes and versions[1] or '' 5562 url = res == QMessageBox.Yes and versions[1] or ''
5562 else: 5563 else:
5563 if self.manualUpdatesCheck: 5564 if self.manualUpdatesCheck:
5564 QMessageBox.information(None, 5565 E5MessageBox.information(self,
5565 self.trUtf8("Eric5 is up to date"), 5566 self.trUtf8("Eric5 is up to date"),
5566 self.trUtf8("""You are using the latest version of eric5""")) 5567 self.trUtf8("""You are using the latest version of eric5"""))
5567 except IndexError: 5568 except IndexError:
5568 QMessageBox.warning(None, 5569 QMessageBox.warning(self,
5569 self.trUtf8("Error during updates check"), 5570 self.trUtf8("Error during updates check"),
5570 self.trUtf8("""Could not perform updates check.""")) 5571 self.trUtf8("""Could not perform updates check."""))
5571 5572
5572 if url: 5573 if url:
5573 QDesktopServices.openUrl(QUrl(url)) 5574 QDesktopServices.openUrl(QUrl(url))
5638 """ 5639 """
5639 Public method to check, if eric5 has been configured. If it is not, 5640 Public method to check, if eric5 has been configured. If it is not,
5640 the configuration dialog is shown. 5641 the configuration dialog is shown.
5641 """ 5642 """
5642 if not Preferences.isConfigured(): 5643 if not Preferences.isConfigured():
5643 QMessageBox.information(None, 5644 E5MessageBox.information(self,
5644 self.trUtf8("First time usage"), 5645 self.trUtf8("First time usage"),
5645 self.trUtf8("""eric5 has not been configured yet. """ 5646 self.trUtf8("""eric5 has not been configured yet. """
5646 """The configuration dialog will be started.""")) 5647 """The configuration dialog will be started."""))
5647 self.showPreferences() 5648 self.showPreferences()
5648 5649

eric ide

mercurial