Commits

Martin Rieser committed 49faabf

new actions, set me as reviewer and set me as developer. Maybe someone has an
idea for a better menu text.

Comments (0)

Files changed (1)

         emailAction  = menu.addAction(qtlib.geticon("menulog"),_('Email'))
         removeAction = menu.addAction(qtlib.geticon("filedelete"),_('Remove'))
         swapDevRev =  menu.addAction(qtlib.geticon("menusynch"),_('Swap responsibilities'))
+        setMeAsReviewer = menu.addAction(qtlib.geticon("settings_user"),_('Set me as reviewer'))
+        setMeAsDeveloper = menu.addAction(qtlib.geticon("settings_user"),_('Set me as developer'))
         
         #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.onRemoveButtonClicked()
         if action == swapDevRev:
            self.swapDeveloperReviewer()
+        if action == setMeAsReviewer:
+           self.setMeAsReviewer()
+        if action == setMeAsDeveloper:
+           self.setMeAsDeveloper()
         if i==1 and action == editAction:
             # get file path item
             file_item = self._qui.list_of_files.item(selectedRowIndes, self.FM_PATH)
             reviewerText = reviewer.text()
             reviewer.setText(developer.text())
             developer.setText(reviewerText)
+    
+    def setMeAsReviewer(self):
+        selectionModel = self._qui.list_of_files.selectionModel()
+        for index in selectionModel.selectedRows():            
+            reviewer = self._qui.list_of_files.item(index.row(), self.FM_REVIEWER)
+            reviewer.setText(self.code_review._find_user().lower())
+            
+    def setMeAsDeveloper(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)
+            developer.setText(self.code_review._find_user().lower())
             
     @pyqtSlot()
     def onRefreshButtonClicked(self):