1. Martin Rieser
  2. hgcr-gui

Commits

Martin Rieser  committed f4a0195

swap reviewer developer option in context menu added

  • Participants
  • Parent commits b303a55
  • Branches default

Comments (0)

Files changed (1)

File hgcr-gui-qt.py

View file
         #commitAction = menu.addAction(qtlib.geticon("menucommit"),_('Commit'))
         emailAction  = menu.addAction(qtlib.geticon("menulog"),_('Email'))
         removeAction = menu.addAction(qtlib.geticon("filedelete"),_('Remove'))
+        swapDevRev =  menu.addAction(qtlib.geticon("menusynch"),_('Swap responsibilities'))
         
         #add action, only possible if only one file is selected
         #TODO There must be a better way to find out, that only one line is selected
             self.onEmailButtonClicked()
         if action == removeAction:
             self.onRemoveButtonClicked()
+        if action == swapDevRev:
+           self.swapDeveloperReviewer()
         if i==1 and action == editAction:
             # get file path item
             file_item = self._qui.list_of_files.item(selectedRowIndes, self.FM_PATH)
         if i==1 and action == historyAction:
             self.onHistoryButtonClicked()
     
+    def swapDeveloperReviewer(self):
+        selectionModel = self._qui.list_of_files.selectionModel()
+        for index in selectionModel.selectedRows():            
+            developer = self._qui.list_of_files.item(index.row(), self.FM_DEVELOPER)
+            reviewer = self._qui.list_of_files.item(index.row(), self.FM_REVIEWER)
+            reviewerText = reviewer.text()
+            reviewer.setText(developer.text())
+            developer.setText(reviewerText)
+            
     @pyqtSlot()
     def onRefreshButtonClicked(self):
         # refresh