eric6/UI/UserInterface.py

changeset 8260
2161475d9639
parent 8243
cc717c2ae956
child 8265
0090cfa83159
equal deleted inserted replaced
8259:2bbec88047dd 8260:2161475d9639
4119 Private method to restart the application. 4119 Private method to restart the application.
4120 4120
4121 @param ask flag indicating to ask the user for permission 4121 @param ask flag indicating to ask the user for permission
4122 @type bool 4122 @type bool
4123 """ 4123 """
4124 if ask: 4124 res = (
4125 res = E5MessageBox.yesNo( 4125 E5MessageBox.yesNo(
4126 self, 4126 self,
4127 self.tr("Restart application"), 4127 self.tr("Restart application"),
4128 self.tr( 4128 self.tr(
4129 """The application needs to be restarted. Do it now?"""), 4129 """The application needs to be restarted. Do it now?"""),
4130 yesDefault=True) 4130 yesDefault=True)
4131 else: 4131 if ask else
4132 res = True 4132 True
4133 )
4133 4134
4134 if res and self.__shutdown(): 4135 if res and self.__shutdown():
4135 e5App().closeAllWindows() 4136 e5App().closeAllWindows()
4136 program = sys.executable 4137 program = sys.executable
4137 eric6 = os.path.join(getConfig("ericDir"), "eric6.py") 4138 eric6 = os.path.join(getConfig("ericDir"), "eric6.py")
6302 if not ext: 6303 if not ext:
6303 ex = selectedFilter.split("(*")[1].split(")")[0] 6304 ex = selectedFilter.split("(*")[1].split(")")[0]
6304 if ex: 6305 if ex:
6305 fn += ex 6306 fn += ex
6306 6307
6307 if os.path.exists(fn): 6308 ok = (
6308 ok = E5MessageBox.yesNo( 6309 E5MessageBox.yesNo(
6309 self, 6310 self,
6310 self.tr("Export Keyboard Shortcuts"), 6311 self.tr("Export Keyboard Shortcuts"),
6311 self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists""" 6312 self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists"""
6312 """ already. Overwrite it?</p>""").format(fn)) 6313 """ already. Overwrite it?</p>""").format(fn))
6313 else: 6314 if os.path.exists(fn) else
6314 ok = True 6315 True
6316 )
6315 6317
6316 if ok: 6318 if ok:
6317 from Preferences import Shortcuts 6319 from Preferences import Shortcuts
6318 Shortcuts.exportShortcuts(fn) 6320 Shortcuts.exportShortcuts(fn)
6319 6321

eric ide

mercurial