src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
31 def __init__(self, vcs, parent=None): 31 def __init__(self, vcs, parent=None):
32 """ 32 """
33 Constructor 33 Constructor
34 34
35 @param vcs reference to the vcs object 35 @param vcs reference to the vcs object
36 @param parent parent widget (QWidget) 36 @type Subversion
37 @param parent parent widget
38 @type QWidget
37 """ 39 """
38 super().__init__(parent, Qt.WindowType.Window) 40 super().__init__(parent, Qt.WindowType.Window)
39 self.setupUi(self) 41 self.setupUi(self)
40 42
41 self.__vcs = vcs 43 self.__vcs = vcs
52 54
53 def showEvent(self, evt): 55 def showEvent(self, evt):
54 """ 56 """
55 Protected method called when the dialog is about to be shown. 57 Protected method called when the dialog is about to be shown.
56 58
57 @param evt the event (QShowEvent) 59 @param evt the event
60 @type QShowEvent
58 """ 61 """
59 commitMessages = self.__vcs.vcsCommitMessages() 62 commitMessages = self.__vcs.vcsCommitMessages()
60 self.recentComboBox.clear() 63 self.recentComboBox.clear()
61 self.recentComboBox.addItem("") 64 self.recentComboBox.addItem("")
62 self.recentComboBox.addItems(commitMessages) 65 self.recentComboBox.addItems(commitMessages)
68 Public method to retrieve the log message. 71 Public method to retrieve the log message.
69 72
70 This method has the side effect of saving the 20 most recent 73 This method has the side effect of saving the 20 most recent
71 commit messages for reuse. 74 commit messages for reuse.
72 75
73 @return the log message (string) 76 @return the log message
77 @rtype str
74 """ 78 """
75 msg = self.logEdit.toPlainText() 79 msg = self.logEdit.toPlainText()
76 if msg: 80 if msg:
77 self.__vcs.vcsAddCommitMessage(msg) 81 self.__vcs.vcsAddCommitMessage(msg)
78 return msg 82 return msg
79 83
80 def hasChangelists(self): 84 def hasChangelists(self):
81 """ 85 """
82 Public method to check, if the user entered some changelists. 86 Public method to check, if the user entered some change lists.
83 87
84 @return flag indicating availability of changelists (boolean) 88 @return flag indicating availability of change lists
89 @rtype bool
85 """ 90 """
86 return len(self.changeLists.selectedItems()) > 0 91 return len(self.changeLists.selectedItems()) > 0
87 92
88 def changelistsData(self): 93 def changelistsData(self):
89 """ 94 """
90 Public method to retrieve the changelists data. 95 Public method to retrieve the change lists data.
91 96
92 @return tuple containing the changelists (list of strings) and a flag 97 @return tuple containing the change lists and a flag indicating to keep
93 indicating to keep changelists (boolean) 98 the change lists
99 @rtype tuple of (list of str, bool)
94 """ 100 """
95 slists = [ 101 slists = [
96 line.text().strip() 102 line.text().strip()
97 for line in self.changeLists.selectedItems() 103 for line in self.changeLists.selectedItems()
98 if line.text().strip() != "" 104 if line.text().strip() != ""
105 111
106 def on_buttonBox_clicked(self, button): 112 def on_buttonBox_clicked(self, button):
107 """ 113 """
108 Private slot called by a button of the button box clicked. 114 Private slot called by a button of the button box clicked.
109 115
110 @param button button that was clicked (QAbstractButton) 116 @param button button that was clicked
117 @type QAbstractButton
111 """ 118 """
112 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): 119 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
113 self.logEdit.clear() 120 self.logEdit.clear()
114 121
115 def on_buttonBox_accepted(self): 122 def on_buttonBox_accepted(self):

eric ide

mercurial