eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesHeaderDialog.py

changeset 8143
2c730d5fd177
parent 7971
ff2971513d6d
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
28 @param parent reference to the parent widget (QWidget) 28 @param parent reference to the parent widget (QWidget)
29 """ 29 """
30 super(HgQueuesHeaderDialog, self).__init__(parent) 30 super(HgQueuesHeaderDialog, self).__init__(parent)
31 self.setupUi(self) 31 self.setupUi(self)
32 32
33 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 33 self.buttonBox.button(
34 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 34 QDialogButtonBox.StandardButton.Close).setEnabled(False)
35 self.buttonBox.button(
36 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
35 37
36 self.vcs = vcs 38 self.vcs = vcs
37 self.__hgClient = vcs.getClient() 39 self.__hgClient = vcs.getClient()
38 40
39 self.show() 41 self.show()
69 def __finish(self): 71 def __finish(self):
70 """ 72 """
71 Private slot called when the process finished or the user pressed 73 Private slot called when the process finished or the user pressed
72 the button. 74 the button.
73 """ 75 """
74 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) 76 self.buttonBox.button(
75 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) 77 QDialogButtonBox.StandardButton.Close).setEnabled(True)
76 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 78 self.buttonBox.button(
77 self.buttonBox.button(QDialogButtonBox.Close).setFocus( 79 QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
78 Qt.OtherFocusReason) 80 self.buttonBox.button(
81 QDialogButtonBox.StandardButton.Close).setDefault(True)
82 self.buttonBox.button(
83 QDialogButtonBox.StandardButton.Close).setFocus(
84 Qt.FocusReason.OtherFocusReason)
79 85
80 def on_buttonBox_clicked(self, button): 86 def on_buttonBox_clicked(self, button):
81 """ 87 """
82 Private slot called by a button of the button box clicked. 88 Private slot called by a button of the button box clicked.
83 89
84 @param button button that was clicked (QAbstractButton) 90 @param button button that was clicked (QAbstractButton)
85 """ 91 """
86 if button == self.buttonBox.button(QDialogButtonBox.Close): 92 if button == self.buttonBox.button(
93 QDialogButtonBox.StandardButton.Close
94 ):
87 self.close() 95 self.close()
88 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): 96 elif button == self.buttonBox.button(
97 QDialogButtonBox.StandardButton.Cancel
98 ):
89 if self.__hgClient: 99 if self.__hgClient:
90 self.__hgClient.cancel() 100 self.__hgClient.cancel()
91 else: 101 else:
92 self.__finish() 102 self.__finish()
93 103

eric ide

mercurial