#2 add treeview displaying bugs
Opened 5 months ago by srikavin. Modified 5 months ago
fedora-qa/ srikavin/fedora-gooey-karma master  into  master

file modified
+13

@@ -260,6 +260,17 @@ 

                          pass

          

  

+         def populateBugs(self, update):

+                 for bug in update['bugs']:

+                         bugItem = QtWidgets.QTreeWidgetItem()

+                         bugItem.setText(1, str(bug['security']))

+                         bugItem.setText(2, str(bug['title']))

+                         self.ui.treeWidget_bugs.insertTopLevelItem(0, bugItem)

+ 

+                         label = QtWidgets.QLabel(f'<a href="http://bugzilla.redhat.com/show_bug.cgi?id={bug["bug_id"]}">{bug["bug_id"]}</a>')

+                         label.setOpenExternalLinks(True)

+ 

+                         self.ui.treeWidget_bugs.setItemWidget(bugItem, 0, label)

  

  

          # changes the display text on selection.

@@ -277,7 +288,9 @@ 

                                          self.ui.Karma.setText(str(p['karma']))

                                          self.ui.Release_notes.setText(p['notes'])

                                          self.ui.treeWidget_comment.clear()

+                                         self.ui.treeWidget_bugs.clear()

                                          self.populateComments(p)

+                                         self.populateBugs(p)

                                          if(p["type"] == "enhancement"):  

                                                  self.ui.UpdateType.setPixmap(self.enhancement)

                                          elif(p["type"] == "bugfix"):

file modified
+8 -1

@@ -2,7 +2,7 @@ 

  

  # Form implementation generated from reading ui file 'ui/MainWindow.ui'

  #

- # Created by: PyQt5 UI code generator 5.13.0

+ # Created by: PyQt5 UI code generator 5.14.0

  #

  # WARNING! All changes made in this file will be lost!

  

@@ -262,6 +262,9 @@ 

          self.critpathBox.addItem("")

          self.critpathBox.addItem("")

          self.gridLayout_2.addWidget(self.critpathBox, 26, 5, 1, 1)

+         self.treeWidget_bugs = QtWidgets.QTreeWidget(self.frame)

+         self.treeWidget_bugs.setObjectName("treeWidget_bugs")

+         self.gridLayout_2.addWidget(self.treeWidget_bugs, 8, 3, 1, 6)

          self.Karma_static.raise_()

          self.frame_2.raise_()

          self.Package_breif.raise_()

@@ -287,6 +290,7 @@ 

          self.treeWidget_comment.raise_()

          self.critpathText.raise_()

          self.critpathBox.raise_()

+         self.treeWidget_bugs.raise_()

          self.gridLayout.addWidget(self.frame, 3, 0, 1, 5)

          self.usernamLable = QtWidgets.QLabel(self.centralwidget)

          self.usernamLable.setObjectName("usernamLable")

@@ -341,4 +345,7 @@ 

          self.critpathBox.setItemText(0, _translate("MainWindow", "1"))

          self.critpathBox.setItemText(1, _translate("MainWindow", "0"))

          self.critpathBox.setItemText(2, _translate("MainWindow", "-1"))

+         self.treeWidget_bugs.headerItem().setText(0, _translate("MainWindow", "#"))

+         self.treeWidget_bugs.headerItem().setText(1, _translate("MainWindow", "security"))

+         self.treeWidget_bugs.headerItem().setText(2, _translate("MainWindow", "title"))

          self.usernamLable.setText(_translate("MainWindow", "Username"))

file modified
+20

@@ -559,6 +559,25 @@ 

           </item>

          </widget>

         </item>

+        <item row="8" column="3" colspan="6">

+         <widget class="QTreeWidget" name="treeWidget_bugs">

+          <column>

+           <property name="text">

+            <string>#</string>

+           </property>

+          </column>

+          <column>

+           <property name="text">

+            <string>security</string>

+           </property>

+          </column>

+          <column>

+           <property name="text">

+            <string>title</string>

+           </property>

+          </column>

+         </widget>

+        </item>

        </layout>

        <zorder>Karma_static</zorder>

        <zorder>frame_2</zorder>

@@ -585,6 +604,7 @@ 

        <zorder>treeWidget_comment</zorder>

        <zorder>critpathText</zorder>

        <zorder>critpathBox</zorder>

+       <zorder>treeWidget_bugs</zorder>

       </widget>

      </item>

      <item row="1" column="3" alignment="Qt::AlignRight">

I added a QTreeWidget to display bugs associated with an update.

Screenshot

This is part of this GCI task.

rebased onto c15199f

5 months ago

rebased onto 1c95398

5 months ago

rebased onto 0c9e836

5 months ago