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

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

eric ide

mercurial