Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesFoldDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3008
7848489bcb92
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
52 @pyqtSlot() 52 @pyqtSlot()
53 def on_addButton_clicked(self): 53 def on_addButton_clicked(self):
54 """ 54 """
55 Private slot to add a patch to the list of selected patches. 55 Private slot to add a patch to the list of selected patches.
56 """ 56 """
57 row = self.sourcePatches.indexOfTopLevelItem(self.sourcePatches.currentItem()) 57 row = self.sourcePatches.indexOfTopLevelItem(
58 self.sourcePatches.currentItem())
58 itm = self.sourcePatches.takeTopLevelItem(row) 59 itm = self.sourcePatches.takeTopLevelItem(row)
59 60
60 curItm = self.selectedPatches.currentItem() 61 curItm = self.selectedPatches.currentItem()
61 if curItm is not None: 62 if curItm is not None:
62 row = self.selectedPatches.indexOfTopLevelItem(curItm) + 1 63 row = self.selectedPatches.indexOfTopLevelItem(curItm) + 1
69 @pyqtSlot() 70 @pyqtSlot()
70 def on_removeButton_clicked(self): 71 def on_removeButton_clicked(self):
71 """ 72 """
72 Private slot to remove a patch from the list of selected patches. 73 Private slot to remove a patch from the list of selected patches.
73 """ 74 """
74 row = self.selectedPatches.indexOfTopLevelItem(self.selectedPatches.currentItem()) 75 row = self.selectedPatches.indexOfTopLevelItem(
76 self.selectedPatches.currentItem())
75 itm = self.selectedPatches.takeTopLevelItem(row) 77 itm = self.selectedPatches.takeTopLevelItem(row)
76 self.sourcePatches.addTopLevelItem(itm) 78 self.sourcePatches.addTopLevelItem(itm)
77 self.sourcePatches.sortItems(0, Qt.AscendingOrder) 79 self.sourcePatches.sortItems(0, Qt.AscendingOrder)
78 80
79 self.__updateOkButton() 81 self.__updateOkButton()
81 @pyqtSlot() 83 @pyqtSlot()
82 def on_upButton_clicked(self): 84 def on_upButton_clicked(self):
83 """ 85 """
84 Private slot to move a patch up in the list. 86 Private slot to move a patch up in the list.
85 """ 87 """
86 row = self.selectedPatches.indexOfTopLevelItem(self.selectedPatches.currentItem()) 88 row = self.selectedPatches.indexOfTopLevelItem(
89 self.selectedPatches.currentItem())
87 if row > 0: 90 if row > 0:
88 targetRow = row - 1 91 targetRow = row - 1
89 itm = self.selectedPatches.takeTopLevelItem(row) 92 itm = self.selectedPatches.takeTopLevelItem(row)
90 self.selectedPatches.insertTopLevelItem(targetRow, itm) 93 self.selectedPatches.insertTopLevelItem(targetRow, itm)
91 self.selectedPatches.setCurrentItem(itm) 94 self.selectedPatches.setCurrentItem(itm)
93 @pyqtSlot() 96 @pyqtSlot()
94 def on_downButton_clicked(self): 97 def on_downButton_clicked(self):
95 """ 98 """
96 Private slot to move a patch down in the list. 99 Private slot to move a patch down in the list.
97 """ 100 """
98 row = self.selectedPatches.indexOfTopLevelItem(self.selectedPatches.currentItem()) 101 row = self.selectedPatches.indexOfTopLevelItem(
102 self.selectedPatches.currentItem())
99 if row < self.selectedPatches.topLevelItemCount() - 1: 103 if row < self.selectedPatches.topLevelItemCount() - 1:
100 targetRow = row + 1 104 targetRow = row + 1
101 itm = self.selectedPatches.takeTopLevelItem(row) 105 itm = self.selectedPatches.takeTopLevelItem(row)
102 self.selectedPatches.insertTopLevelItem(targetRow, itm) 106 self.selectedPatches.insertTopLevelItem(targetRow, itm)
103 self.selectedPatches.setCurrentItem(itm) 107 self.selectedPatches.setCurrentItem(itm)
106 def on_sourcePatches_currentItemChanged(self, current, previous): 110 def on_sourcePatches_currentItemChanged(self, current, previous):
107 """ 111 """
108 Private slot to react on changes of the current item of source patches. 112 Private slot to react on changes of the current item of source patches.
109 113
110 @param current reference to the new current item (QTreeWidgetItem) 114 @param current reference to the new current item (QTreeWidgetItem)
111 @param previous reference to the previous current item (QTreeWidgetItem) 115 @param previous reference to the previous current item
116 (QTreeWidgetItem)
112 """ 117 """
113 self.addButton.setEnabled(current is not None) 118 self.addButton.setEnabled(current is not None)
114 119
115 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) 120 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
116 def on_selectedPatches_currentItemChanged(self, current, previous): 121 def on_selectedPatches_currentItemChanged(self, current, previous):
117 """ 122 """
118 Private slot to react on changes of the current item of selected patches. 123 Private slot to react on changes of the current item of selected
124 patches.
119 125
120 @param current reference to the new current item (QTreeWidgetItem) 126 @param current reference to the new current item (QTreeWidgetItem)
121 @param previous reference to the previous current item (QTreeWidgetItem) 127 @param previous reference to the previous current item
128 (QTreeWidgetItem)
122 """ 129 """
123 self.removeButton.setEnabled(current is not None) 130 self.removeButton.setEnabled(current is not None)
124 131
125 row = self.selectedPatches.indexOfTopLevelItem(current) 132 row = self.selectedPatches.indexOfTopLevelItem(current)
126 self.upButton.setEnabled(row > 0) 133 self.upButton.setEnabled(row > 0)
127 self.downButton.setEnabled(row < self.selectedPatches.topLevelItemCount() - 1) 134 self.downButton.setEnabled(
135 row < self.selectedPatches.topLevelItemCount() - 1)
128 136
129 def getData(self): 137 def getData(self):
130 """ 138 """
131 Public method to retrieve the entered data. 139 Public method to retrieve the entered data.
132 140

eric ide

mercurial