Commits

Martin Rieser committed 842ab46

radio buttons added again. They are more intuitive to use.

Comments (0)

Files changed (3)

     FM_DEVELOPER = 4
     FM_REVIEWER = 5
     
-
     VIEW_ALL = 0
     VIEW_MY_FILES = 1
     VIEW_FILES_FOR_ME = 2
         self._qui.list_of_files.setContextMenuPolicy(Qt.CustomContextMenu)
         self._qui.list_of_files.customContextMenuRequested.connect(self.onContextMenuTriggered)
         
-        #person filter setup
-        self._qui.responcibilitySelector.insertItem(self.VIEW_ALL,' ')
-        self._qui.responcibilitySelector.insertItem(self.VIEW_MY_FILES,_('Files I own'))
-        self._qui.responcibilitySelector.insertItem(self.VIEW_FILES_FOR_ME,_('Files for my review'))
-        self._qui.responcibilitySelector.insertItem(self.VIEW_UNKNOWN,_('Unknown reviewer'))
-        self._qui.responcibilitySelector.setCurrentIndex(self.VIEW_ALL) 
-        QtCore.QObject.connect(self._qui.responcibilitySelector, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), self.onPersonFilerChange)
+        #radio button filter setup
+        QtCore.QObject.connect(self._qui.all_files, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.onRadioButtonClicked)
+        QtCore.QObject.connect(self._qui.files_i_own, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.onRadioButtonClicked)
+        QtCore.QObject.connect(self._qui.files_for_my_review, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.onRadioButtonClicked)
+        QtCore.QObject.connect(self._qui.unknown_reviewer, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.onRadioButtonClicked)
         
         #status filter setup
         self._qui.fileStatus.insertItem(0,_('All'))
         self.refresh()        
 
     @pyqtSlot()
-    def onPersonFilerChange(self, index):
-        """change a view of files to match combo box"""
-        if index >= 0 and index <= self.VIEW_UNKNOWN:
-            self.VIEW = index
-            # refresh the display
-            self.refresh()     
+    def onRadioButtonClicked(self, bool_state):
+        """change a view of files to match radio choice"""
+        
+        if self._qui.all_files.isChecked():
+            self.VIEW = self.VIEW_ALL
+            self._qui.fileStatus.setCurrentIndex(self.VIEW_ALL)
+        elif self._qui.files_i_own.isChecked():
+            self.VIEW = self.VIEW_MY_FILES
+            self._qui.fileStatus.setCurrentIndex(self.VIEW_ALL)
+        elif self._qui.files_for_my_review.isChecked():
+            self.VIEW = self.VIEW_FILES_FOR_ME
+            self._qui.fileStatus.setCurrentIndex(self.VIEW_ChangedState)
+        elif self._qui.unknown_reviewer.isChecked():
+            self.VIEW = self.VIEW_UNKNOWN
+            self._qui.fileStatus.setCurrentIndex(self.VIEW_ALL)
+
+        # refresh the display
+        self.refresh()  
         
     @pyqtSlot()
     def onTableEdit(self, row, column):
          <widget class="QComboBox" name="fileStatus"/>
         </item>
         <item>
-         <widget class="QLabel" name="labelResponcibility">
-          <property name="locale">
-           <locale language="English" country="UnitedStates"/>
+         <widget class="QRadioButton" name="all_files">
+          <property name="text">
+           <string>All Files</string>
           </property>
-          <property name="text">
-           <string>Filter:</string>
+          <property name="checked">
+           <bool>true</bool>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="responcibilitySelector"/>
+         <widget class="QRadioButton" name="files_for_my_review">
+          <property name="text">
+           <string>Files For My Review</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="files_i_own">
+          <property name="text">
+           <string>Files I Own</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="unknown_reviewer">
+          <property name="text">
+           <string>Unknown Reviewer</string>
+          </property>
+         </widget>
         </item>
         <item>
          <spacer name="horizontalSpacer">
 
 # Form implementation generated from reading ui file 'hgcr.ui'
 #
-# Created: Sat Nov 03 18:12:19 2012
+# Created: Mon Nov 12 09:56:15 2012
 #      by: PyQt4 UI code generator 4.9.4
 #
 # WARNING! All changes made in this file will be lost!
         self.fileStatus = QtGui.QComboBox(self.mode_viewer)
         self.fileStatus.setObjectName(_fromUtf8("fileStatus"))
         self.radio_layout.addWidget(self.fileStatus)
-        self.labelResponcibility = QtGui.QLabel(self.mode_viewer)
-        self.labelResponcibility.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
-        self.labelResponcibility.setObjectName(_fromUtf8("labelResponcibility"))
-        self.radio_layout.addWidget(self.labelResponcibility)
-        self.responcibilitySelector = QtGui.QComboBox(self.mode_viewer)
-        self.responcibilitySelector.setObjectName(_fromUtf8("responcibilitySelector"))
-        self.radio_layout.addWidget(self.responcibilitySelector)
+        self.all_files = QtGui.QRadioButton(self.mode_viewer)
+        self.all_files.setChecked(True)
+        self.all_files.setObjectName(_fromUtf8("all_files"))
+        self.radio_layout.addWidget(self.all_files)
+        self.files_for_my_review = QtGui.QRadioButton(self.mode_viewer)
+        self.files_for_my_review.setObjectName(_fromUtf8("files_for_my_review"))
+        self.radio_layout.addWidget(self.files_for_my_review)
+        self.files_i_own = QtGui.QRadioButton(self.mode_viewer)
+        self.files_i_own.setObjectName(_fromUtf8("files_i_own"))
+        self.radio_layout.addWidget(self.files_i_own)
+        self.unknown_reviewer = QtGui.QRadioButton(self.mode_viewer)
+        self.unknown_reviewer.setObjectName(_fromUtf8("unknown_reviewer"))
+        self.radio_layout.addWidget(self.unknown_reviewer)
         spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
         self.radio_layout.addItem(spacerItem)
         self.gridLayout.addWidget(self.mode_viewer, 1, 0, 1, 1)
     def retranslateUi(self, CodeREviewDialog):
         CodeREviewDialog.setWindowTitle(QtGui.QApplication.translate("CodeREviewDialog", "CodeReview", None, QtGui.QApplication.UnicodeUTF8))
         self.labelStatus.setText(QtGui.QApplication.translate("CodeREviewDialog", "Status:", None, QtGui.QApplication.UnicodeUTF8))
-        self.labelResponcibility.setText(QtGui.QApplication.translate("CodeREviewDialog", "Filter:", None, QtGui.QApplication.UnicodeUTF8))
+        self.all_files.setText(QtGui.QApplication.translate("CodeREviewDialog", "All Files", None, QtGui.QApplication.UnicodeUTF8))
+        self.files_for_my_review.setText(QtGui.QApplication.translate("CodeREviewDialog", "Files For My Review", None, QtGui.QApplication.UnicodeUTF8))
+        self.files_i_own.setText(QtGui.QApplication.translate("CodeREviewDialog", "Files I Own", None, QtGui.QApplication.UnicodeUTF8))
+        self.unknown_reviewer.setText(QtGui.QApplication.translate("CodeREviewDialog", "Unknown Reviewer", None, QtGui.QApplication.UnicodeUTF8))
         self.status.setText(QtGui.QApplication.translate("CodeREviewDialog", "0 selected, 0 total", None, QtGui.QApplication.UnicodeUTF8))
         self.list_of_files.setSortingEnabled(True)
         item = self.list_of_files.horizontalHeaderItem(1)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.